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-11-21 13:23+0000\n"
13 "PO-Revision-Date: 2011-10-27 09:15+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 ../examples/guestfs-testing.pod:3
28 #: ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3
29 #: ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3
30 #: ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3
31 #: ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3
32 #: ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3
33 #: ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3
34 #: ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3
35 #: ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3
36 #: ../test-tool/libguestfs-test-tool.pod:3
37 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
38 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
39 #: ../tools/virt-win-reg.pl:35
44 #: ../align/virt-alignment-scan.pod:5
45 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
49 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7
50 #: ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
51 #: ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
52 #: ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7
53 #: ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7
54 #: ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7
55 #: ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7
56 #: ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7
57 #: ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7
58 #: ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7
59 #: ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7
60 #: ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7
61 #: ../test-tool/libguestfs-test-tool.pod:7
62 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
63 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
64 #: ../tools/virt-win-reg.pl:39
69 #: ../align/virt-alignment-scan.pod:9
72 " virt-alignment-scan [--options] -d domname\n"
77 #: ../align/virt-alignment-scan.pod:11
80 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
85 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19
86 #: ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
87 #: ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
88 #: ../erlang/examples/guestfs-erlang.pod:16
89 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
90 #: ../examples/guestfs-testing.pod:7 ../fish/guestfish.pod:30
91 #: ../fish/virt-copy-in.pod:19 ../fish/virt-copy-out.pod:13
92 #: ../fish/virt-tar-in.pod:21 ../fish/virt-tar-out.pod:15
93 #: ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pod:19
94 #: ../java/examples/guestfs-java.pod:15 ../ocaml/examples/guestfs-ocaml.pod:25
95 #: ../perl/examples/guestfs-perl.pod:18
96 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:31
97 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
98 #: ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23
99 #: ../test-tool/libguestfs-test-tool.pod:11
100 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
101 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
102 #: ../tools/virt-win-reg.pl:63
107 #: ../align/virt-alignment-scan.pod:15
109 "When older operating systems install themselves, the partitioning tools "
110 "place partitions at a sector misaligned with the underlying storage "
111 "(commonly the first partition starts on sector C<63>). Misaligned "
112 "partitions can result in an operating system issuing more I/O than should be "
117 #: ../align/virt-alignment-scan.pod:21
119 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
120 "machines and disk images and warns you if there are alignment problems."
124 #: ../align/virt-alignment-scan.pod:25
126 "Currently there is no virt tool for fixing alignment problems. You can only "
127 "reinstall the guest operating system. The following NetApp document "
128 "summarises the problem and possible solutions: L<http://media.netapp.com/"
129 "documents/tr-3747.pdf>"
133 #: ../align/virt-alignment-scan.pod:30
138 #: ../align/virt-alignment-scan.pod:32
139 msgid "To run this tool on a disk image directly, use the I<-a> option:"
143 #: ../align/virt-alignment-scan.pod:34
146 " $ virt-alignment-scan -a winxp.img\n"
147 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
152 #: ../align/virt-alignment-scan.pod:37
155 " $ virt-alignment-scan -a fedora16.img\n"
156 " /dev/sda1 1048576 1024K ok\n"
157 " /dev/sda2 2097152 2048K ok\n"
158 " /dev/sda3 526385152 2048K ok\n"
163 #: ../align/virt-alignment-scan.pod:42
165 "To run the tool on a guest known to libvirt, use the I<-d> option and "
166 "possibly the I<-c> option:"
170 #: ../align/virt-alignment-scan.pod:45
173 " # virt-alignment-scan -d RHEL5\n"
174 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
175 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
180 #: ../align/virt-alignment-scan.pod:49
183 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
184 " /dev/sda1 1048576 1024K ok\n"
185 " /dev/sda2 105906176 1024K ok\n"
186 " /dev/sdb1 65536 64K ok\n"
191 #: ../align/virt-alignment-scan.pod:54
193 "The output consists of 4 or more whitespace-separated columns. Only the "
194 "first 4 columns are signficant if you want to parse this from a program. "
199 #: ../align/virt-alignment-scan.pod:60
204 #: ../align/virt-alignment-scan.pod:62
206 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
207 "on the first block device)"
211 #: ../align/virt-alignment-scan.pod:65
216 #: ../align/virt-alignment-scan.pod:67
217 msgid "the start of the partition in bytes"
221 #: ../align/virt-alignment-scan.pod:69
226 #: ../align/virt-alignment-scan.pod:71
227 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
231 #: ../align/virt-alignment-scan.pod:73
236 #: ../align/virt-alignment-scan.pod:75
238 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
239 "can cause performance problems"
243 #: ../align/virt-alignment-scan.pod:78
248 #: ../align/virt-alignment-scan.pod:80
249 msgid "optional free-text explanation."
253 #: ../align/virt-alignment-scan.pod:84
255 "The exit code from the program changes depending on whether poorly aligned "
256 "partitions were found. See L</EXIT STATUS> below."
260 #: ../align/virt-alignment-scan.pod:87
261 msgid "If you just want the exit code with no output, use the I<-q> option."
265 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62
266 #: ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261
267 #: ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
268 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
269 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
270 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:92
271 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:112
272 #: ../resize/virt-resize.pod:262 ../sparsify/virt-sparsify.pod:99
273 #: ../test-tool/libguestfs-test-tool.pod:36
274 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
275 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
276 #: ../tools/virt-win-reg.pl:96
281 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66
282 #: ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265
283 #: ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
284 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160
285 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:116
286 #: ../resize/virt-resize.pod:266 ../sparsify/virt-sparsify.pod:103
287 #: ../test-tool/libguestfs-test-tool.pod:40
288 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
289 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
290 #: ../tools/virt-win-reg.pl:104
295 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68
296 #: ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267
297 #: ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
298 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:118
299 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
300 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
301 #: ../tools/virt-win-reg.pl:106
302 msgid "Display brief help."
306 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70
307 #: ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269
308 #: ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
309 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:120
314 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72
315 #: ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271
316 #: ../clone/virt-sysprep.pod:52 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
317 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:122
318 msgid "B<--add> file"
322 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:54
323 msgid "Add I<file> which should be a disk image from a virtual machine."
327 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78
328 #: ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277
329 #: ../clone/virt-sysprep.pod:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
330 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102
331 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:128
333 "The format of the disk image is auto-detected. To override this and force a "
334 "particular format use the I<--format=..> option."
338 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81
339 #: ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291
340 #: ../clone/virt-sysprep.pod:59 ../df/virt-df.pod:78
341 #: ../rescue/virt-rescue.pod:135
346 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83
347 #: ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293
348 #: ../clone/virt-sysprep.pod:61 ../df/virt-df.pod:80
349 #: ../rescue/virt-rescue.pod:137
350 msgid "B<--connect> URI"
354 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85
355 #: ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295
356 #: ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
357 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:139
358 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
359 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
361 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
362 "to the default libvirt hypervisor."
366 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88
367 #: ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298
368 #: ../clone/virt-sysprep.pod:66 ../df/virt-df.pod:85
369 #: ../rescue/virt-rescue.pod:142
371 "If you specify guest block devices directly (I<-a>), then libvirt is not "
376 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91
377 #: ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307
378 #: ../clone/virt-sysprep.pod:69 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
379 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:145
384 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93
385 #: ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309
386 #: ../clone/virt-sysprep.pod:71 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
387 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:147
388 msgid "B<--domain> guest"
392 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95
393 #: ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311
394 #: ../clone/virt-sysprep.pod:73 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
395 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:149
397 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
402 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105
403 #: ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328
404 #: ../clone/virt-sysprep.pod:95 ../df/virt-df.pod:101
405 #: ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142
406 #: ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:152
407 msgid "B<--format=raw|qcow2|..>"
411 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107
412 #: ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330
413 #: ../clone/virt-sysprep.pod:97 ../df/virt-df.pod:103
414 #: ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235
415 #: ../fuse/guestmount.pod:144 ../inspector/virt-inspector.pod:101
416 #: ../rescue/virt-rescue.pod:154
421 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109
422 #: ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332
423 #: ../clone/virt-sysprep.pod:99 ../df/virt-df.pod:105
424 #: ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237
425 #: ../fuse/guestmount.pod:146 ../rescue/virt-rescue.pod:156
427 "The default for the I<-a> option is to auto-detect the format of the disk "
428 "image. Using this forces the disk format for I<-a> options which follow on "
429 "the command line. Using I<--format> with no argument switches back to auto-"
430 "detection for subsequent I<-a> options."
434 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114
435 #: ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337
436 #: ../clone/virt-sysprep.pod:104 ../df/virt-df.pod:110
437 #: ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242
438 #: ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:351
439 #: ../rescue/virt-rescue.pod:161 ../src/guestfs.pod:2877
444 #: ../align/virt-alignment-scan.pod:134
447 " virt-alignment-scan --format=raw -a disk.img\n"
452 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118
453 #: ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341
454 #: ../clone/virt-sysprep.pod:108 ../df/virt-df.pod:114
455 #: ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246
456 #: ../rescue/virt-rescue.pod:165
457 msgid "forces raw format (no auto-detection) for C<disk.img>."
461 #: ../align/virt-alignment-scan.pod:138
464 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
469 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122
470 #: ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345
471 #: ../clone/virt-sysprep.pod:112 ../df/virt-df.pod:118
472 #: ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250
473 #: ../rescue/virt-rescue.pod:169
475 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
476 "detection for C<another.img>."
480 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125
481 #: ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348
482 #: ../clone/virt-sysprep.pod:115 ../df/virt-df.pod:121
483 #: ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:172
485 "If you have untrusted raw-format guest disk images, you should use this "
486 "option to specify the disk format. This avoids a possible security problem "
487 "with malicious guests (CVE-2010-3851)."
491 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:491
492 #: ../sparsify/virt-sparsify.pod:153
497 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:493
498 #: ../sparsify/virt-sparsify.pod:155
503 #: ../align/virt-alignment-scan.pod:151
505 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
510 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134
511 #: ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425
512 #: ../clone/virt-sysprep.pod:138 ../df/virt-df.pod:173
513 #: ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390
514 #: ../fuse/guestmount.pod:266 ../inspector/virt-inspector.pod:119
515 #: ../rescue/virt-rescue.pod:219 ../sparsify/virt-sparsify.pod:159
520 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136
521 #: ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427
522 #: ../clone/virt-sysprep.pod:140 ../df/virt-df.pod:175
523 #: ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392
524 #: ../fuse/guestmount.pod:268 ../inspector/virt-inspector.pod:121
525 #: ../rescue/virt-rescue.pod:221 ../sparsify/virt-sparsify.pod:161
530 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138
531 #: ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429
532 #: ../clone/virt-sysprep.pod:142 ../df/virt-df.pod:177
533 #: ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123
534 #: ../rescue/virt-rescue.pod:223 ../sparsify/virt-sparsify.pod:163
535 msgid "Enable verbose messages for debugging."
539 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140
540 #: ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431
541 #: ../clone/virt-sysprep.pod:144 ../df/virt-df.pod:179
542 #: ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397
543 #: ../fuse/guestmount.pod:272 ../inspector/virt-inspector.pod:125
544 #: ../rescue/virt-rescue.pod:225 ../resize/virt-resize.pod:561
545 #: ../sparsify/virt-sparsify.pod:165
550 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142
551 #: ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433
552 #: ../clone/virt-sysprep.pod:146 ../df/virt-df.pod:181
553 #: ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399
554 #: ../fuse/guestmount.pod:274 ../inspector/virt-inspector.pod:127
555 #: ../rescue/virt-rescue.pod:227 ../resize/virt-resize.pod:563
556 #: ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69
557 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
558 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
563 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144
564 #: ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435
565 #: ../clone/virt-sysprep.pod:148 ../df/virt-df.pod:183
566 #: ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129
567 #: ../rescue/virt-rescue.pod:229 ../resize/virt-resize.pod:565
568 #: ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71
569 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
570 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
571 msgid "Display version number and exit."
575 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146
576 #: ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437
577 #: ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185
578 #: ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412
579 #: ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131
580 #: ../rescue/virt-rescue.pod:240 ../sparsify/virt-sparsify.pod:171
581 #: ../tools/virt-tar.pl:158
586 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148
587 #: ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439
588 #: ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187
589 #: ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133
590 #: ../rescue/virt-rescue.pod:242 ../sparsify/virt-sparsify.pod:173
591 msgid "Enable tracing of libguestfs API calls."
595 #: ../align/virt-alignment-scan.pod:172
596 msgid "RECOMMENDED ALIGNMENT"
600 #: ../align/virt-alignment-scan.pod:174
602 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
603 "first sector of the first partition at sector 63, with a 512 byte sector "
604 "size. This happens because of a historical accident. Drives have to report "
605 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
606 "completely meaningless on modern drives, but it happens that the geometry "
607 "reported always has 63 sectors per track. The operating system therefore "
608 "places the first partition at the start of the second \"track\", at sector "
613 #: ../align/virt-alignment-scan.pod:183
615 "When the guest OS is virtualized, the host operating system and hypervisor "
616 "may prefer accesses aligned to one of:"
620 #: ../align/virt-alignment-scan.pod:188
625 #: ../align/virt-alignment-scan.pod:190
627 "if the host OS uses local storage directly on hard drive partitions, and the "
628 "hard drive has 512 byte physical sectors."
632 #: ../align/virt-alignment-scan.pod:193
637 #: ../align/virt-alignment-scan.pod:195
639 "for local storage on new hard drives with 4Kbyte physical sectors; for file-"
640 "backed storage on filesystems with 4Kbyte block size; or for some types of "
641 "network-attached storage."
645 #: ../align/virt-alignment-scan.pod:199
650 #: ../align/virt-alignment-scan.pod:201
652 "for high-end network-attached storage. This is the optimal block size for "
653 "some NetApp hardware."
657 #: ../align/virt-alignment-scan.pod:204
662 #: ../align/virt-alignment-scan.pod:206
663 msgid "see L</1 MB PARTITION ALIGNMENT> below."
667 #: ../align/virt-alignment-scan.pod:210
669 "Partitions which are not aligned correctly to the underlying storage cause "
670 "extra I/O. For example:"
674 #: ../align/virt-alignment-scan.pod:213
678 " +--------------------------+------\n"
680 " | filesystem block |\n"
681 " ---+------------------+------+-------------------+-----+---\n"
682 " | host block | host block |\n"
684 " ---+-------------------------+-------------------------+---\n"
689 #: ../align/virt-alignment-scan.pod:222
691 "In this example, each time a 4K guest block is read, two blocks on the host "
692 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
693 "written, two host blocks must first be read, the old and new data combined, "
694 "and the two blocks written back (4x I/O)."
698 #: ../align/virt-alignment-scan.pod:227
699 msgid "LINUX HOST BLOCK AND I/O SIZE"
703 #: ../align/virt-alignment-scan.pod:229
705 "New versions of the Linux kernel expose the physical and logical block size, "
706 "and minimum and recommended I/O size."
710 #: ../align/virt-alignment-scan.pod:232
711 msgid "For a typical consumer hard drive with 512 byte sectors:"
715 #: ../align/virt-alignment-scan.pod:234
718 " $ cat /sys/block/sda/queue/hw_sector_size\n"
720 " $ cat /sys/block/sda/queue/physical_block_size\n"
722 " $ cat /sys/block/sda/queue/logical_block_size\n"
724 " $ cat /sys/block/sda/queue/minimum_io_size\n"
726 " $ cat /sys/block/sda/queue/optimal_io_size\n"
732 #: ../align/virt-alignment-scan.pod:245
733 msgid "For a new consumer hard drive with 4Kbyte sectors:"
737 #: ../align/virt-alignment-scan.pod:247
740 " $ cat /sys/block/sda/queue/hw_sector_size\n"
742 " $ cat /sys/block/sda/queue/physical_block_size\n"
744 " $ cat /sys/block/sda/queue/logical_block_size\n"
746 " $ cat /sys/block/sda/queue/minimum_io_size\n"
748 " $ cat /sys/block/sda/queue/optimal_io_size\n"
754 #: ../align/virt-alignment-scan.pod:258
755 msgid "For a NetApp LUN:"
759 #: ../align/virt-alignment-scan.pod:260
762 " $ cat /sys/block/sdc/queue/logical_block_size\n"
764 " $ cat /sys/block/sdc/queue/physical_block_size\n"
766 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
768 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
774 #: ../align/virt-alignment-scan.pod:269
776 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
777 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
781 #: ../align/virt-alignment-scan.pod:273
783 "For detailed information about what these numbers mean, see L<http://docs."
784 "redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/"
785 "Storage_Administration_Guide/newstorage-iolimits.html>"
789 #: ../align/virt-alignment-scan.pod:276
791 "[Thanks to Matt Booth for providing 4K drive data. Thanks to Mike Snitzer "
792 "for providing NetApp data and additional information.]"
796 #: ../align/virt-alignment-scan.pod:279
797 msgid "1 MB PARTITION ALIGNMENT"
801 #: ../align/virt-alignment-scan.pod:281
803 "Microsoft picked 1 MB as the default alignment for all partitions starting "
804 "with Windows 2008 Server, and Linux has followed this."
808 #: ../align/virt-alignment-scan.pod:284
810 "Assuming 512 byte sectors in the guest, you will now see the first partition "
811 "starting at sector 2048, and subsequent partitions (if any) will start at a "
812 "multiple of 2048 sectors."
816 #: ../align/virt-alignment-scan.pod:288
818 "1 MB alignment is compatible with all current alignment requirements (4K, "
819 "64K) and provides room for future growth in physical block sizes."
823 #: ../align/virt-alignment-scan.pod:291
824 msgid "SETTING ALIGNMENT"
828 #: ../align/virt-alignment-scan.pod:293
830 "L<virt-resize(1)> can change the alignment of the partitions of some "
831 "guests. Currently it can fully align all the partitions of all Windows "
832 "guests, and it will fix the bootloader where necessary. For Linux guests, "
833 "it can align the second and subsequent partitions, so the majority of OS "
834 "accesses except at boot will be aligned."
838 #: ../align/virt-alignment-scan.pod:299
840 "Another way to correct partition alignment problems is to reinstall your "
841 "guest operating systems. If you install operating systems from templates, "
842 "ensure these have correct partition alignment too."
846 #: ../align/virt-alignment-scan.pod:303
848 "For older versions of Windows, the following NetApp document contains useful "
849 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
853 #: ../align/virt-alignment-scan.pod:306
855 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
856 "an explicit C<%pre> section that creates aligned partitions using L<parted(8)"
857 ">. Do not use the Kickstart C<part> command. The NetApp document above "
858 "contains an example."
862 #: ../align/virt-alignment-scan.pod:311 ../cat/virt-cat.pod:231
863 #: ../cat/virt-filesystems.pod:373 ../cat/virt-ls.pod:483
864 #: ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215
865 #: ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:367
866 #: ../rescue/virt-rescue.pod:303 ../resize/virt-resize.pod:676
867 #: ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258
868 #: ../tools/virt-make-fs.pl:550 ../tools/virt-tar.pl:289
869 #: ../tools/virt-win-reg.pl:744
870 msgid "SHELL QUOTING"
874 #: ../align/virt-alignment-scan.pod:313 ../cat/virt-cat.pod:233
875 #: ../cat/virt-filesystems.pod:375 ../cat/virt-ls.pod:485
876 #: ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217
877 #: ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:369
878 #: ../rescue/virt-rescue.pod:305 ../resize/virt-resize.pod:678
879 #: ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260
880 #: ../tools/virt-make-fs.pl:552 ../tools/virt-tar.pl:291
881 #: ../tools/virt-win-reg.pl:752
883 "Libvirt guest names can contain arbitrary characters, some of which have "
884 "meaning to the shell such as C<#> and space. You may need to quote or "
885 "escape these characters on the command line. See the shell manual page L<sh"
890 #: ../align/virt-alignment-scan.pod:318 ../cat/virt-cat.pod:238
891 #: ../cat/virt-filesystems.pod:380 ../cat/virt-ls.pod:490
892 #: ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222
893 #: ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114
894 #: ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:390
895 #: ../resize/virt-resize.pod:683 ../sparsify/virt-sparsify.pod:227
896 #: ../test-tool/libguestfs-test-tool.pod:90
901 #: ../align/virt-alignment-scan.pod:320
902 msgid "This program returns:"
906 #: ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330
907 #: ../align/virt-alignment-scan.pod:336 ../align/virt-alignment-scan.pod:343
908 #: ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187
909 #: ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202
910 #: ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287
911 #: ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295
912 #: ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314
913 #: ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322
914 #: ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362
915 #: ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388
916 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
917 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
918 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
919 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
920 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
921 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
922 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
923 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
924 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
925 #: ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:449
926 #: ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:463
927 #: ../fish/guestfish-actions.pod:1262 ../fish/guestfish-actions.pod:1266
928 #: ../fish/guestfish-actions.pod:1270 ../fish/guestfish-actions.pod:1274
929 #: ../fish/guestfish-actions.pod:1282 ../fish/guestfish-actions.pod:1286
930 #: ../fish/guestfish-actions.pod:1290 ../fish/guestfish-actions.pod:1300
931 #: ../fish/guestfish-actions.pod:1304 ../fish/guestfish-actions.pod:1308
932 #: ../fish/guestfish-actions.pod:1398 ../fish/guestfish-actions.pod:1402
933 #: ../fish/guestfish-actions.pod:1407 ../fish/guestfish-actions.pod:1412
934 #: ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:1458
935 #: ../fish/guestfish-actions.pod:1463 ../fish/guestfish-actions.pod:1719
936 #: ../fish/guestfish-actions.pod:1726 ../fish/guestfish-actions.pod:1733
937 #: ../fish/guestfish-actions.pod:2136 ../fish/guestfish-actions.pod:2142
938 #: ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:2157
939 #: ../fish/guestfish-actions.pod:2164 ../fish/guestfish.pod:445
940 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
941 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:408
942 #: ../inspector/virt-inspector.pod:412 ../resize/virt-resize.pod:359
943 #: ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:372
944 #: ../resize/virt-resize.pod:378 ../sparsify/virt-sparsify.pod:32
945 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
946 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
947 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
948 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
949 #: ../src/guestfs-actions.pod:641 ../src/guestfs-actions.pod:649
950 #: ../src/guestfs-actions.pod:656 ../src/guestfs-actions.pod:663
951 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2083
952 #: ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2091
953 #: ../src/guestfs-actions.pod:2099 ../src/guestfs-actions.pod:2103
954 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:2117
955 #: ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2125
956 #: ../src/guestfs-actions.pod:2263 ../src/guestfs-actions.pod:2267
957 #: ../src/guestfs-actions.pod:2272 ../src/guestfs-actions.pod:2277
958 #: ../src/guestfs-actions.pod:2338 ../src/guestfs-actions.pod:2342
959 #: ../src/guestfs-actions.pod:2347 ../src/guestfs-actions.pod:2762
960 #: ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2776
961 #: ../src/guestfs-actions.pod:3321 ../src/guestfs-actions.pod:3327
962 #: ../src/guestfs-actions.pod:3335 ../src/guestfs-actions.pod:3342
963 #: ../src/guestfs-actions.pod:3349 ../src/guestfs.pod:403
964 #: ../src/guestfs.pod:408 ../src/guestfs.pod:413 ../src/guestfs.pod:417
965 #: ../src/guestfs.pod:422 ../src/guestfs.pod:426 ../src/guestfs.pod:431
966 #: ../src/guestfs.pod:436 ../src/guestfs.pod:1109 ../src/guestfs.pod:1113
967 #: ../src/guestfs.pod:1117 ../src/guestfs.pod:1122 ../src/guestfs.pod:1130
968 #: ../src/guestfs.pod:1149 ../src/guestfs.pod:1157 ../src/guestfs.pod:1179
969 #: ../src/guestfs.pod:1183 ../src/guestfs.pod:1187 ../src/guestfs.pod:1191
970 #: ../src/guestfs.pod:1195 ../src/guestfs.pod:1199 ../src/guestfs.pod:1689
971 #: ../src/guestfs.pod:1694 ../src/guestfs.pod:1698 ../src/guestfs.pod:1800
972 #: ../src/guestfs.pod:1805 ../src/guestfs.pod:1809 ../src/guestfs.pod:1819
973 #: ../src/guestfs.pod:2108 ../src/guestfs.pod:2113 ../src/guestfs.pod:2119
974 #: ../src/guestfs.pod:2127 ../src/guestfs.pod:2645 ../src/guestfs.pod:2651
975 #: ../src/guestfs.pod:2656 ../src/guestfs.pod:2662 ../src/guestfs.pod:3062
976 #: ../src/guestfs.pod:3067 ../src/guestfs.pod:3071 ../src/guestfs.pod:3075
977 #: ../src/guestfs.pod:3079 ../src/guestfs.pod:3093 ../src/guestfs.pod:3098
978 #: ../src/guestfs.pod:3330 ../src/guestfs.pod:3334 ../src/guestfs.pod:3338
979 #: ../src/guestfs.pod:3342 ../tools/virt-win-reg.pl:197
980 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
981 #: ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727
982 #: ../tools/virt-win-reg.pl:733
987 #: ../align/virt-alignment-scan.pod:326
992 #: ../align/virt-alignment-scan.pod:328
994 "successful exit, all partitions are aligned E<ge> 64K for best performance"
998 #: ../align/virt-alignment-scan.pod:332
1003 #: ../align/virt-alignment-scan.pod:334
1004 msgid "an error scanning the disk image or guest"
1008 #: ../align/virt-alignment-scan.pod:338
1013 #: ../align/virt-alignment-scan.pod:340
1015 "successful exit, some partitions have alignment E<lt> 64K which can result "
1016 "in poor performance on high end network storage"
1020 #: ../align/virt-alignment-scan.pod:345
1025 #: ../align/virt-alignment-scan.pod:347
1027 "successful exit, some partitions have alignment E<lt> 4K which can result in "
1028 "poor performance on most hypervisors"
1032 #: ../align/virt-alignment-scan.pod:352 ../cat/virt-cat.pod:243
1033 #: ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:495
1034 #: ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227
1035 #: ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97
1036 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
1037 #: ../examples/guestfs-testing.pod:269 ../fish/guestfish.pod:1268
1038 #: ../fish/virt-copy-in.pod:50 ../fish/virt-copy-out.pod:39
1039 #: ../fish/virt-tar-in.pod:47 ../fish/virt-tar-out.pod:41
1040 #: ../fuse/guestmount.pod:317 ../inspector/virt-inspector.pod:395
1041 #: ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78
1042 #: ../perl/examples/guestfs-perl.pod:39
1043 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:325
1044 #: ../resize/virt-resize.pod:688 ../ruby/examples/guestfs-ruby.pod:36
1045 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3270
1046 #: ../test-tool/libguestfs-test-tool.pod:100
1047 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
1048 #: ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296
1049 #: ../tools/virt-win-reg.pl:757
1054 #: ../align/virt-alignment-scan.pod:354
1056 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
1057 "L<virt-resize(1)>, L<http://libguestfs.org/>."
1061 #: ../align/virt-alignment-scan.pod:361 ../cat/virt-cat.pod:252
1062 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:507
1063 #: ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235
1064 #: ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:334
1065 #: ../resize/virt-resize.pod:711 ../sparsify/virt-sparsify.pod:264
1066 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
1067 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311
1068 #: ../tools/virt-win-reg.pl:783
1073 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:254
1074 #: ../cat/virt-filesystems.pod:398 ../cat/virt-ls.pod:509
1075 #: ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237
1076 #: ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:410
1077 #: ../rescue/virt-rescue.pod:336 ../resize/virt-resize.pod:713
1078 #: ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210
1079 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584
1080 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
1081 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
1085 #: ../align/virt-alignment-scan.pod:365 ../cat/virt-cat.pod:256
1086 #: ../cat/virt-filesystems.pod:400 ../cat/virt-ls.pod:511
1087 #: ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239
1088 #: ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114
1089 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
1090 #: ../examples/guestfs-testing.pod:280 ../fish/guestfish.pod:1300
1091 #: ../fish/virt-copy-in.pod:64 ../fish/virt-copy-out.pod:53
1092 #: ../fish/virt-tar-in.pod:62 ../fish/virt-tar-out.pod:55
1093 #: ../fuse/guestmount.pod:332 ../inspector/virt-inspector.pod:418
1094 #: ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95
1095 #: ../perl/examples/guestfs-perl.pod:56
1096 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:338
1097 #: ../resize/virt-resize.pod:715 ../ruby/examples/guestfs-ruby.pod:52
1098 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3353
1099 #: ../test-tool/libguestfs-test-tool.pod:110
1100 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
1101 #: ../tools/virt-make-fs.pl:586 ../tools/virt-tar.pl:315
1102 #: ../tools/virt-win-reg.pl:787
1107 #: ../align/virt-alignment-scan.pod:367 ../clone/virt-sysprep.pod:507
1108 #: ../sparsify/virt-sparsify.pod:270
1109 msgid "Copyright (C) 2011 Red Hat Inc."
1113 #: ../align/virt-alignment-scan.pod:369 ../cat/virt-cat.pod:260
1114 #: ../cat/virt-filesystems.pod:404 ../cat/virt-ls.pod:515
1115 #: ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243
1116 #: ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305
1117 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
1118 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
1119 #: ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:422
1120 #: ../rescue/virt-rescue.pod:342 ../resize/virt-resize.pod:719
1121 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
1122 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
1123 #: ../tools/virt-make-fs.pl:590 ../tools/virt-tar.pl:319
1124 #: ../tools/virt-win-reg.pl:791
1126 "This program is free software; you can redistribute it and/or modify it "
1127 "under the terms of the GNU General Public License as published by the Free "
1128 "Software Foundation; either version 2 of the License, or (at your option) "
1129 "any later version."
1133 #: ../align/virt-alignment-scan.pod:374 ../cat/virt-cat.pod:265
1134 #: ../cat/virt-filesystems.pod:409 ../cat/virt-ls.pod:520
1135 #: ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248
1136 #: ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310
1137 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
1138 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
1139 #: ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:427
1140 #: ../rescue/virt-rescue.pod:347 ../resize/virt-resize.pod:724
1141 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
1142 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
1143 #: ../tools/virt-make-fs.pl:595 ../tools/virt-tar.pl:324
1144 #: ../tools/virt-win-reg.pl:796
1146 "This program is distributed in the hope that it will be useful, but WITHOUT "
1147 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
1148 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
1153 #: ../align/virt-alignment-scan.pod:379 ../cat/virt-cat.pod:270
1154 #: ../cat/virt-filesystems.pod:414 ../cat/virt-ls.pod:525
1155 #: ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253
1156 #: ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315
1157 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
1158 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
1159 #: ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:432
1160 #: ../rescue/virt-rescue.pod:352 ../resize/virt-resize.pod:729
1161 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
1162 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
1163 #: ../tools/virt-make-fs.pl:600 ../tools/virt-tar.pl:329
1164 #: ../tools/virt-win-reg.pl:801
1166 "You should have received a copy of the GNU General Public License along with "
1167 "this program; if not, write to the Free Software Foundation, Inc., 51 "
1168 "Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
1172 #: ../cat/virt-cat.pod:5
1173 msgid "virt-cat - Display files in a virtual machine"
1177 #: ../cat/virt-cat.pod:9
1180 " virt-cat [--options] -d domname file [file ...]\n"
1185 #: ../cat/virt-cat.pod:11
1188 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
1193 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
1194 #: ../inspector/virt-inspector.pod:13
1199 #: ../cat/virt-cat.pod:15
1202 " virt-cat domname file\n"
1207 #: ../cat/virt-cat.pod:17
1210 " virt-cat disk.img file\n"
1215 #: ../cat/virt-cat.pod:21
1217 "C<virt-cat> is a command line tool to display the contents of C<file> where "
1218 "C<file> exists in the named virtual machine (or disk image)."
1222 #: ../cat/virt-cat.pod:24
1224 "Multiple filenames can be given, in which case they are concatenated "
1225 "together. Each filename must be a full path, starting at the root directory "
1226 "(starting with '/')."
1230 #: ../cat/virt-cat.pod:28
1232 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
1233 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
1234 "(see L</USING GUESTFISH> below)."
1238 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
1239 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
1240 #: ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29
1241 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
1242 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
1243 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
1244 #: ../tools/virt-tar.pl:50
1249 #: ../cat/virt-cat.pod:34
1251 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
1255 #: ../cat/virt-cat.pod:37
1258 " virt-cat -d mydomain /etc/fstab\n"
1263 #: ../cat/virt-cat.pod:39
1264 msgid "List syslog messages from a VM disk image file:"
1268 #: ../cat/virt-cat.pod:41
1271 " virt-cat -a disk.img /var/log/messages | tail\n"
1276 #: ../cat/virt-cat.pod:43
1277 msgid "Find out what DHCP IP address a VM acquired:"
1281 #: ../cat/virt-cat.pod:45
1284 " virt-cat -d mydomain /var/log/messages | \\\n"
1285 " grep 'dhclient: bound to' | tail\n"
1290 #: ../cat/virt-cat.pod:48
1291 msgid "Find out what packages were recently installed:"
1295 #: ../cat/virt-cat.pod:50
1298 " virt-cat -d mydomain /var/log/yum.log | tail\n"
1303 #: ../cat/virt-cat.pod:52
1304 msgid "Find out who is logged on inside a virtual machine:"
1308 #: ../cat/virt-cat.pod:54
1311 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
1317 #: ../cat/virt-cat.pod:57
1318 msgid "or who was logged on:"
1322 #: ../cat/virt-cat.pod:59
1325 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
1326 " last -f /tmp/wtmp\n"
1331 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
1332 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
1333 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:124
1335 "Add I<file> which should be a disk image from a virtual machine. If the "
1336 "virtual machine has multiple block devices, you must supply all of them with "
1337 "separate I<-a> options."
1341 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
1342 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
1343 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
1344 msgid "B<--echo-keys>"
1348 #: ../cat/virt-cat.pod:100
1350 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
1351 "so you cannot see what you are typing. If you are not worried about Tempest "
1352 "attacks and there is no one else in the room you can specify this flag to "
1353 "see what you are typing."
1357 #: ../cat/virt-cat.pod:116
1360 " virt-cat --format=raw -a disk.img file\n"
1365 #: ../cat/virt-cat.pod:120
1368 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1373 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1374 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1375 #: ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
1376 msgid "B<--keys-from-stdin>"
1380 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1381 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1382 #: ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1384 "Read key or passphrase parameters from stdin. The default is to try to read "
1385 "passphrases from the user by opening C</dev/tty>."
1389 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1390 #: ../inspector/virt-inspector.pod:144 ../rescue/virt-rescue.pod:246
1391 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1395 #: ../cat/virt-cat.pod:154
1396 msgid "Previous versions of virt-cat allowed you to write either:"
1400 #: ../cat/virt-cat.pod:156
1403 " virt-cat disk.img [disk.img ...] file\n"
1408 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1409 #: ../inspector/virt-inspector.pod:150 ../rescue/virt-rescue.pod:252
1414 #: ../cat/virt-cat.pod:160
1417 " virt-cat guestname file\n"
1422 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1423 #: ../inspector/virt-inspector.pod:154 ../rescue/virt-rescue.pod:256
1425 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1426 "the confusing case where a disk image might have the same name as a guest."
1430 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1431 #: ../inspector/virt-inspector.pod:158 ../rescue/virt-rescue.pod:260
1432 msgid "For compatibility the old style is still supported."
1436 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1437 msgid "WINDOWS PATHS"
1441 #: ../cat/virt-cat.pod:170
1443 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1444 "paths (eg. C<E:\\foo\\bar.txt>)."
1448 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1449 msgid "If and only if the guest is running Windows then:"
1453 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1455 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1456 "to the correct filesystem."
1460 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1462 "Any backslash (C<\\>) characters in the path are replaced with forward "
1463 "slashes so that libguestfs can process it."
1467 #: ../cat/virt-cat.pod:189
1469 "The path is resolved case insensitively to locate the file that should be "
1474 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1475 msgid "There are some known shortcomings:"
1479 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1480 msgid "Some NTFS symbolic links may not be followed correctly."
1484 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1485 msgid "NTFS junction points that cross filesystems are not followed."
1489 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1490 msgid "USING GUESTFISH"
1494 #: ../cat/virt-cat.pod:210
1496 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1497 "C<virt-cat> doesn't work."
1501 #: ../cat/virt-cat.pod:213
1502 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1506 #: ../cat/virt-cat.pod:215
1509 " guestfish --ro -i -d domname download file -\n"
1514 #: ../cat/virt-cat.pod:217
1516 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1517 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1521 #: ../cat/virt-cat.pod:221
1523 "The command above uses libguestfs's guest inspection feature and so does not "
1524 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1525 "disk images that don't contain guests. To display a file from a disk image "
1530 #: ../cat/virt-cat.pod:226
1533 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1538 #: ../cat/virt-cat.pod:228
1540 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1541 "the disk image, and C<file> is the full path to the file."
1545 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382
1546 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1547 #: ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:392
1548 #: ../resize/virt-resize.pod:685 ../sparsify/virt-sparsify.pod:229
1550 "This program returns 0 if successful, or non-zero if there was an error."
1554 #: ../cat/virt-cat.pod:245
1556 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1557 "tar-out(1)>, L<http://libguestfs.org/>."
1561 #: ../cat/virt-cat.pod:258 ../inspector/virt-inspector.pod:420
1562 #: ../resize/virt-resize.pod:717 ../tools/virt-make-fs.pl:588
1563 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1567 #: ../cat/virt-filesystems.pod:5
1569 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1570 "virtual machine or disk image"
1574 #: ../cat/virt-filesystems.pod:9
1577 " virt-filesystems [--options] -d domname\n"
1582 #: ../cat/virt-filesystems.pod:11
1585 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1590 #: ../cat/virt-filesystems.pod:15
1592 "This tool allows you to discover filesystems, partitions, logical volumes, "
1593 "and their sizes in a disk image or virtual machine. It is a replacement for "
1594 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1598 #: ../cat/virt-filesystems.pod:20
1600 "One use for this tool is from shell scripts to iterate over all filesystems "
1601 "from a disk image:"
1605 #: ../cat/virt-filesystems.pod:23
1608 " for fs in $(virt-filesystems -a disk.img); do\n"
1615 #: ../cat/virt-filesystems.pod:27
1617 "Another use is to list partitions before using another tool to modify those "
1618 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1619 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1623 #: ../cat/virt-filesystems.pod:32
1625 "Various command line options control what this program displays. You need "
1626 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1627 "guest respectively. If you just specify that then the program shows "
1628 "filesystems found, one per line, like this:"
1632 #: ../cat/virt-filesystems.pod:37
1635 " $ virt-filesystems -a disk.img\n"
1637 " /dev/vg_guest/lv_root\n"
1642 #: ../cat/virt-filesystems.pod:41
1644 "If you add I<-l> or I<--long> then the output includes extra information:"
1648 #: ../cat/virt-filesystems.pod:44
1651 " $ virt-filesystems -a disk.img -l\n"
1652 " Name Type VFS Label Size\n"
1653 " /dev/sda1 filesystem ext4 boot 524288000\n"
1654 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1659 #: ../cat/virt-filesystems.pod:49
1661 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1666 #: ../cat/virt-filesystems.pod:52
1669 " $ virt-filesystems -a disk.img --extra\n"
1671 " /dev/vg_guest/lv_root\n"
1672 " /dev/vg_guest/lv_swap\n"
1673 " /dev/vg_guest/lv_data\n"
1678 #: ../cat/virt-filesystems.pod:58
1680 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1684 #: ../cat/virt-filesystems.pod:60
1687 " $ virt-filesystems -a disk.img --partitions\n"
1694 #: ../cat/virt-filesystems.pod:64
1696 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1697 "volumes>, I<--block-devices> to list those items."
1701 #: ../cat/virt-filesystems.pod:67
1703 "You can use these options in combination as well (if you want a combination "
1704 "including filesystems, you have to add I<--filesystems>). Notice that some "
1705 "items fall into several categories (eg. C</dev/sda1> might be both a "
1706 "partition and a filesystem). These items are listed several times. To get "
1707 "a list which includes absolutely everything that virt-filesystems knows "
1708 "about, use the I<--all> option."
1712 #: ../cat/virt-filesystems.pod:74
1714 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1715 "uuid> option to display device and filesystem UUIDs in the long output."
1719 #: ../cat/virt-filesystems.pod:78
1721 "I<--all --long --uuid> is a useful combination to display all possible "
1722 "information about everything."
1726 #: ../cat/virt-filesystems.pod:81
1729 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1730 " Name Type VFS Label Size Parent UUID\n"
1731 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1732 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1733 " /dev/sda1 partition - - 100M /dev/sda -\n"
1734 " /dev/sda2 partition - - 20G /dev/sda -\n"
1735 " /dev/sda device - - 20G - -\n"
1740 #: ../cat/virt-filesystems.pod:89
1742 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1746 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1751 #: ../cat/virt-filesystems.pod:112
1753 "Display everything. This is currently the same as specifying these options: "
1754 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1755 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1756 "added to this list in future)."
1760 #: ../cat/virt-filesystems.pod:117
1761 msgid "See also I<--long>."
1765 #: ../cat/virt-filesystems.pod:119
1766 msgid "B<--blkdevs>"
1770 #: ../cat/virt-filesystems.pod:121
1771 msgid "B<--block-devices>"
1775 #: ../cat/virt-filesystems.pod:123
1776 msgid "Display block devices."
1780 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1785 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1787 "Write out the results in CSV format (comma-separated values). This format "
1788 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1789 "ABOUT CSV FORMAT> below."
1793 #: ../cat/virt-filesystems.pod:150
1795 "When prompting for keys and passphrases, virt-filesystems normally turns "
1796 "echoing off so you cannot see what you are typing. If you are not worried "
1797 "about Tempest attacks and there is no one else in the room you can specify "
1798 "this flag to see what you are typing."
1802 #: ../cat/virt-filesystems.pod:155
1807 #: ../cat/virt-filesystems.pod:157
1809 "This causes filesystems that are not ordinary, mountable filesystems to be "
1810 "displayed. This category includes swapspace, and filesystems that are empty "
1811 "or contain unknown data."
1815 #: ../cat/virt-filesystems.pod:161
1816 msgid "This option implies I<--filesystems>."
1820 #: ../cat/virt-filesystems.pod:163
1821 msgid "B<--filesystems>"
1825 #: ../cat/virt-filesystems.pod:165
1827 "Display mountable filesystems. If no display option was selected then this "
1828 "option is implied."
1832 #: ../cat/virt-filesystems.pod:168
1833 msgid "With I<--extra>, non-mountable filesystems are shown too."
1837 #: ../cat/virt-filesystems.pod:181
1840 " virt-filesystems --format=raw -a disk.img\n"
1845 #: ../cat/virt-filesystems.pod:185
1848 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1853 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1854 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1855 #: ../tools/virt-list-partitions.pl:109
1860 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1861 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1862 msgid "B<--human-readable>"
1866 #: ../cat/virt-filesystems.pod:198
1867 msgid "In I<--long> mode, display sizes in human-readable format."
1871 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1872 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1877 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1878 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1883 #: ../cat/virt-filesystems.pod:209
1884 msgid "Display extra columns of data (\"long format\")."
1888 #: ../cat/virt-filesystems.pod:211
1889 msgid "A title row is added unless you also specify I<--no-title>."
1893 #: ../cat/virt-filesystems.pod:213
1895 "The extra columns displayed depend on what output you select, and the "
1896 "ordering of columns may change in future versions. Use the title row, I<--"
1897 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1902 #: ../cat/virt-filesystems.pod:218
1904 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1905 "default is to show raw numbers of I<bytes>."
1909 #: ../cat/virt-filesystems.pod:221
1910 msgid "Use I<--uuid> to display UUIDs too."
1914 #: ../cat/virt-filesystems.pod:223
1919 #: ../cat/virt-filesystems.pod:225
1920 msgid "B<--logvols>"
1924 #: ../cat/virt-filesystems.pod:227
1925 msgid "B<--logical-volumes>"
1929 #: ../cat/virt-filesystems.pod:229
1931 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1932 "of whether the LVs contain filesystems."
1936 #: ../cat/virt-filesystems.pod:232
1937 msgid "B<--no-title>"
1941 #: ../cat/virt-filesystems.pod:234
1942 msgid "In I<--long> mode, don't add a title row."
1946 #: ../cat/virt-filesystems.pod:236
1948 "Note that the order of the columns is not fixed, and may change in future "
1949 "versions of virt-filesystems, so using this option may give you unexpected "
1954 #: ../cat/virt-filesystems.pod:240
1959 #: ../cat/virt-filesystems.pod:242
1960 msgid "B<--partitions>"
1964 #: ../cat/virt-filesystems.pod:244
1966 "Display partitions. In this mode, these are displayed irrespective of "
1967 "whether the partitions contain filesystems."
1971 #: ../cat/virt-filesystems.pod:247
1976 #: ../cat/virt-filesystems.pod:249
1977 msgid "B<--physvols>"
1981 #: ../cat/virt-filesystems.pod:251
1982 msgid "B<--physical-volumes>"
1986 #: ../cat/virt-filesystems.pod:253
1987 msgid "Display LVM physical volumes."
1991 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1996 #: ../cat/virt-filesystems.pod:257
2001 #: ../cat/virt-filesystems.pod:259
2002 msgid "In I<--long> mode, display UUIDs as well."
2006 #: ../cat/virt-filesystems.pod:273
2011 #: ../cat/virt-filesystems.pod:275
2012 msgid "B<--volgroups>"
2016 #: ../cat/virt-filesystems.pod:277
2017 msgid "B<--volume-groups>"
2021 #: ../cat/virt-filesystems.pod:279
2022 msgid "Display LVM volume groups."
2026 #: ../cat/virt-filesystems.pod:287
2031 #: ../cat/virt-filesystems.pod:289
2033 "Note that columns in the output are subject to reordering and change in "
2034 "future versions of this tool."
2038 #: ../cat/virt-filesystems.pod:294
2043 #: ../cat/virt-filesystems.pod:296
2044 msgid "The filesystem, partition, block device or LVM name."
2048 #: ../cat/virt-filesystems.pod:298
2050 "For device and partition names these are displayed as canonical libguestfs "
2051 "names, so that for example C</dev/sda2> is the second partition on the first "
2056 #: ../cat/virt-filesystems.pod:302
2058 "If the I<--long> option is B<not> specified, then only the name column is "
2059 "shown in the output."
2063 #: ../cat/virt-filesystems.pod:305
2068 #: ../cat/virt-filesystems.pod:307
2069 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
2073 #: ../cat/virt-filesystems.pod:309
2078 #: ../cat/virt-filesystems.pod:311
2080 "If there is a filesystem, then this column displays the filesystem type if "
2081 "one could be detected, eg. C<ext4>."
2085 #: ../cat/virt-filesystems.pod:314
2090 #: ../cat/virt-filesystems.pod:316
2092 "If the object has a label (used for identifying and mounting filesystems) "
2093 "then this column contains the label."
2097 #: ../cat/virt-filesystems.pod:319
2102 #: ../cat/virt-filesystems.pod:321
2104 "The partition type byte, displayed as a two digit hexadecimal number. A "
2105 "comprehensive list of partition types can be found here: L<http://www.win."
2106 "tue.nl/~aeb/partitions/partition_types-1.html>"
2110 #: ../cat/virt-filesystems.pod:325
2111 msgid "This is only applicable for DOS (MBR) partitions."
2115 #: ../cat/virt-filesystems.pod:327
2120 #: ../cat/virt-filesystems.pod:329
2122 "The size of the object in bytes. If the I<--human> option is used then the "
2123 "size is displayed in a human-readable form."
2127 #: ../cat/virt-filesystems.pod:332
2132 #: ../cat/virt-filesystems.pod:334
2134 "The parent column records the parent relationship between objects. For "
2135 "example, if the object is a partition, then this column contains the name of "
2136 "the containing device. If the object is a logical volume, then this column "
2137 "is the name of the volume group."
2141 #: ../cat/virt-filesystems.pod:339
2146 #: ../cat/virt-filesystems.pod:341
2148 "If the object has a UUID (used for identifying and mounting filesystems and "
2149 "block devices) then this column contains the UUID as a string."
2153 #: ../cat/virt-filesystems.pod:345
2154 msgid "The UUID is only displayed if the I<--uuid> option is given."
2158 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:459
2159 #: ../df/virt-df.pod:191
2160 msgid "NOTE ABOUT CSV FORMAT"
2164 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461
2165 #: ../df/virt-df.pod:193
2167 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
2168 "should be easy to parse, but it is definitely not easy to parse."
2172 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464
2173 #: ../df/virt-df.pod:196
2175 "Myth: Just split fields at commas. Reality: This does I<not> work "
2176 "reliably. This example has two columns:"
2180 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467
2181 #: ../df/virt-df.pod:199
2184 " \"foo,bar\",baz\n"
2189 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469
2190 #: ../df/virt-df.pod:201
2192 "Myth: Read the file one line at a time. Reality: This does I<not> work "
2193 "reliably. This example has one row:"
2197 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472
2198 #: ../df/virt-df.pod:204
2207 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475
2208 #: ../df/virt-df.pod:207
2210 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
2211 "packaged in major Linux distributions)."
2215 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478
2216 #: ../df/virt-df.pod:210
2218 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
2219 "or Python's built-in csv library)."
2223 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481
2224 #: ../df/virt-df.pod:213
2225 msgid "Most spreadsheets and databases can import CSV directly."
2229 #: ../cat/virt-filesystems.pod:387
2231 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
2232 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
2237 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
2238 msgid "Copyright (C) 2010 Red Hat Inc."
2242 #: ../cat/virt-ls.pod:5
2243 msgid "virt-ls - List files in a virtual machine"
2247 #: ../cat/virt-ls.pod:9
2250 " virt-ls [--options] -d domname directory [directory ...]\n"
2255 #: ../cat/virt-ls.pod:11
2258 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
2263 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:15
2268 #: ../cat/virt-ls.pod:15
2271 " virt-ls [--options] domname directory\n"
2276 #: ../cat/virt-ls.pod:17
2279 " virt-ls [--options] disk.img [disk.img ...] directory\n"
2284 #: ../cat/virt-ls.pod:21
2286 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
2287 "more from a virtual machine or disk image."
2291 #: ../cat/virt-ls.pod:24
2293 "Multiple directory names can be given, in which case the output from each is "
2298 #: ../cat/virt-ls.pod:27
2300 "To list directories from a libvirt guest use the I<-d> option to specify the "
2301 "name of the guest. For a disk image, use the I<-a> option."
2305 #: ../cat/virt-ls.pod:31
2307 "C<virt-ls> can do many simple file listings. For more complicated cases you "
2308 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
2313 #: ../cat/virt-ls.pod:37
2314 msgid "Get a list of all files and directories in a virtual machine:"
2318 #: ../cat/virt-ls.pod:39
2321 " virt-ls -R -d guest /\n"
2326 #: ../cat/virt-ls.pod:41 ../examples/guestfs-testing.pod:160
2327 msgid "List all setuid or setgid programs in a Linux virtual machine:"
2331 #: ../cat/virt-ls.pod:43
2334 " virt-ls -lR -d guest / | grep '^- [42]'\n"
2339 #: ../cat/virt-ls.pod:45 ../examples/guestfs-testing.pod:164
2340 msgid "List all public-writable directories in a Linux virtual machine:"
2344 #: ../cat/virt-ls.pod:47
2347 " virt-ls -lR -d guest / | grep '^d ...7'\n"
2352 #: ../cat/virt-ls.pod:49 ../examples/guestfs-testing.pod:168
2353 msgid "List all Unix domain sockets in a Linux virtual machine:"
2357 #: ../cat/virt-ls.pod:51
2360 " virt-ls -lR -d guest / | grep '^s'\n"
2365 #: ../cat/virt-ls.pod:53 ../examples/guestfs-testing.pod:172
2366 msgid "List all regular files with filenames ending in '.png':"
2370 #: ../cat/virt-ls.pod:55
2373 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
2378 #: ../cat/virt-ls.pod:57
2379 msgid "To display files larger than 10MB in home directories:"
2383 #: ../cat/virt-ls.pod:59
2386 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
2391 #: ../cat/virt-ls.pod:61 ../examples/guestfs-testing.pod:180
2392 msgid "Find everything modified in the last 7 days:"
2396 #: ../cat/virt-ls.pod:63
2399 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
2404 #: ../cat/virt-ls.pod:65 ../examples/guestfs-testing.pod:184
2405 msgid "Find regular files modified in the last 24 hours:"
2409 #: ../cat/virt-ls.pod:67
2412 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2417 #: ../cat/virt-ls.pod:69
2418 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2422 #: ../cat/virt-ls.pod:71
2424 "Find the differences between files in a guest and an earlier snapshot of the "
2429 #: ../cat/virt-ls.pod:74
2432 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2433 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2434 " diff -u old new | less\n"
2439 #: ../cat/virt-ls.pod:78
2441 "The commands above won't find files where the content has changed but the "
2442 "metadata (eg. file size and modification date) is the same. To do that, you "
2443 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2444 "checksum> can be quite slow since it has to read and compute a checksum of "
2445 "every regular file in the virtual machine."
2449 #: ../cat/virt-ls.pod:84
2450 msgid "OUTPUT MODES"
2454 #: ../cat/virt-ls.pod:86
2456 "C<virt-ls> has four output modes, controlled by different combinations of "
2457 "the I<-l> and I<-R> options."
2461 #: ../cat/virt-ls.pod:89
2462 msgid "SIMPLE LISTING"
2466 #: ../cat/virt-ls.pod:91
2467 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2471 #: ../cat/virt-ls.pod:93
2474 " $ virt-ls -d guest /\n"
2482 #: ../cat/virt-ls.pod:98
2483 msgid "LONG LISTING"
2487 #: ../cat/virt-ls.pod:100
2489 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2490 "(more specifically, like the C<guestfs_ll> function)."
2494 #: ../cat/virt-ls.pod:103
2497 " $ virt-ls -l -d guest /\n"
2499 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2500 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2506 #: ../cat/virt-ls.pod:109
2508 "Note that while this is useful for displaying a directory, do not try "
2509 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2514 #: ../cat/virt-ls.pod:113
2515 msgid "RECURSIVE LISTING"
2519 #: ../cat/virt-ls.pod:115
2521 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2522 "and directories recursively:"
2526 #: ../cat/virt-ls.pod:118
2529 " $ virt-ls -R -d guest /tmp\n"
2537 #: ../cat/virt-ls.pod:123
2539 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2540 "converts C<\\0> characters to C<\\n>."
2544 #: ../cat/virt-ls.pod:126
2545 msgid "RECURSIVE LONG LISTING"
2549 #: ../cat/virt-ls.pod:128
2551 "Using I<-lR> options together changes the output to display directories "
2552 "recursively, with file stats, and optionally other features such as "
2553 "checksums and extended attributes."
2557 #: ../cat/virt-ls.pod:132
2559 "Most of the interesting features of C<virt-ls> are only available when using "
2564 #: ../cat/virt-ls.pod:135
2566 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2567 "you cannot use the output in another program (because filenames can contain "
2568 "spaces and other unsafe characters). If the guest was untrusted and someone "
2569 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2570 "on you by creating filenames with embedded newline characters. To B<safely> "
2571 "parse the output in another program, use the I<--csv> (Comma-Separated "
2576 #: ../cat/virt-ls.pod:143
2578 "Note that this output format is completely unrelated to the C<ls -lR> "
2583 #: ../cat/virt-ls.pod:146
2586 " $ virt-ls -lR -d guest /bin\n"
2587 " d 0555 4096 /bin\n"
2588 " - 0755 123 /bin/alsaunmute\n"
2589 " - 0755 28328 /bin/arch\n"
2590 " l 0777 4 /bin/awk -> gawk\n"
2591 " - 0755 27216 /bin/basename\n"
2592 " - 0755 943360 /bin/bash\n"
2598 #: ../cat/virt-ls.pod:155
2599 msgid "These basic fields are always shown:"
2603 #: ../cat/virt-ls.pod:159
2608 #: ../cat/virt-ls.pod:161
2610 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2611 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2612 "link), C<s> (socket) or C<u> (unknown)."
2616 #: ../cat/virt-ls.pod:171
2621 #: ../cat/virt-ls.pod:173
2622 msgid "The Unix permissions, displayed as a 4 digit octal number."
2626 #: ../cat/virt-ls.pod:175
2631 #: ../cat/virt-ls.pod:177
2633 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2634 "readable> option is given, in which case this is shown as a human-readable "
2639 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4477
2644 #: ../cat/virt-ls.pod:183
2645 msgid "The full path of the file or directory."
2649 #: ../cat/virt-ls.pod:185
2654 #: ../cat/virt-ls.pod:187
2655 msgid "For symbolic links only, the link target."
2659 #: ../cat/virt-ls.pod:191
2661 "In I<-lR> mode, additional command line options enable the display of more "
2666 #: ../cat/virt-ls.pod:194
2668 "With the I<--uids> flag, these additional fields are displayed before the "
2673 #: ../cat/virt-ls.pod:199
2678 #: ../cat/virt-ls.pod:201
2683 #: ../cat/virt-ls.pod:203
2685 "The UID and GID of the owner of the file (displayed numerically). Note "
2686 "these only make sense in the context of a Unix-like guest."
2690 #: ../cat/virt-ls.pod:208
2691 msgid "With the I<--times> flag, these additional fields are displayed:"
2695 #: ../cat/virt-ls.pod:212
2700 #: ../cat/virt-ls.pod:214
2701 msgid "The time of last access."
2705 #: ../cat/virt-ls.pod:216
2710 #: ../cat/virt-ls.pod:218
2711 msgid "The time of last modification."
2715 #: ../cat/virt-ls.pod:220
2720 #: ../cat/virt-ls.pod:222
2721 msgid "The time of last status change."
2725 #: ../cat/virt-ls.pod:226
2727 "The time fields are displayed as string dates and times, unless one of the "
2728 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2732 #: ../cat/virt-ls.pod:229
2733 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2737 #: ../cat/virt-ls.pod:233
2742 #: ../cat/virt-ls.pod:235
2744 "The device containing the file (displayed as major:minor). This may not "
2745 "match devices as known to the guest."
2749 #: ../cat/virt-ls.pod:238
2754 #: ../cat/virt-ls.pod:240
2755 msgid "The inode number."
2759 #: ../cat/virt-ls.pod:242
2764 #: ../cat/virt-ls.pod:244
2765 msgid "The number of hard links."
2769 #: ../cat/virt-ls.pod:246
2774 #: ../cat/virt-ls.pod:248
2776 "For block and char special files, the device (displayed as major:minor)."
2780 #: ../cat/virt-ls.pod:251
2785 #: ../cat/virt-ls.pod:253
2786 msgid "The number of 512 byte blocks allocated to the file."
2790 #: ../cat/virt-ls.pod:257
2792 "With the I<--checksum> flag, the checksum of the file contents is shown "
2793 "(only for regular files). Computing file checksums can take a considerable "
2798 #: ../cat/virt-ls.pod:280
2799 msgid "B<--checksum>"
2803 #: ../cat/virt-ls.pod:282
2804 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2808 #: ../cat/virt-ls.pod:284
2810 "Display checksum over file contents for regular files. With no argument, "
2811 "this defaults to using I<md5>. Using an argument, you can select the "
2812 "checksum type to use."
2816 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2817 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2818 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2820 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2825 #: ../cat/virt-ls.pod:316
2827 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2828 "so you cannot see what you are typing. If you are not worried about Tempest "
2829 "attacks and there is no one else in the room you can specify this flag to "
2830 "see what you are typing."
2834 #: ../cat/virt-ls.pod:321
2835 msgid "B<--extra-stats>"
2839 #: ../cat/virt-ls.pod:323
2840 msgid "Display extra stats."
2844 #: ../cat/virt-ls.pod:339
2847 " virt-ls --format=raw -a disk.img /dir\n"
2852 #: ../cat/virt-ls.pod:343
2855 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2860 #: ../cat/virt-ls.pod:356
2861 msgid "Display file sizes in human-readable format."
2865 #: ../cat/virt-ls.pod:370
2870 #: ../cat/virt-ls.pod:372
2871 msgid "B<--recursive>"
2875 #: ../cat/virt-ls.pod:374
2877 "Select the mode. With neither of these options, C<virt-ls> produces a "
2878 "simple, flat list of the files in the named directory. See L</SIMPLE "
2883 #: ../cat/virt-ls.pod:378
2885 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2890 #: ../cat/virt-ls.pod:381
2892 "C<virt-ls -R> produces a recursive list of files starting at the named "
2893 "directory. See L</RECURSIVE LISTING>."
2897 #: ../cat/virt-ls.pod:384
2899 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2900 "parsed. See L</RECURSIVE LONG LISTING>."
2904 #: ../cat/virt-ls.pod:387
2909 #: ../cat/virt-ls.pod:389
2910 msgid "Display time fields."
2914 #: ../cat/virt-ls.pod:394
2915 msgid "B<--time-days>"
2919 #: ../cat/virt-ls.pod:396
2920 msgid "Display time fields as days before now (negative if in the future)."
2924 #: ../cat/virt-ls.pod:398
2926 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2927 "of the file is between 0 and 86399 seconds."
2931 #: ../cat/virt-ls.pod:404
2932 msgid "B<--time-relative>"
2936 #: ../cat/virt-ls.pod:406
2937 msgid "Display time fields as seconds before now (negative if in the future)."
2941 #: ../cat/virt-ls.pod:411
2946 #: ../cat/virt-ls.pod:413
2947 msgid "Display time fields as seconds since the Unix epoch."
2951 #: ../cat/virt-ls.pod:418
2956 #: ../cat/virt-ls.pod:420
2957 msgid "Display UID and GID fields."
2961 #: ../cat/virt-ls.pod:445
2962 msgid "Previous versions of virt-ls allowed you to write either:"
2966 #: ../cat/virt-ls.pod:447
2969 " virt-ls disk.img [disk.img ...] /dir\n"
2974 #: ../cat/virt-ls.pod:451
2977 " virt-ls guestname /dir\n"
2982 #: ../cat/virt-ls.pod:497
2984 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2985 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2986 "L<http://libguestfs.org/>."
2990 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2991 #: ../rescue/virt-rescue.pod:340
2992 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2996 #: ../clone/virt-sysprep.pod:5
2998 "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
3002 #: ../clone/virt-sysprep.pod:9
3005 " virt-sysprep [--options] -d domname\n"
3010 #: ../clone/virt-sysprep.pod:11
3013 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
3018 #: ../clone/virt-sysprep.pod:15
3020 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
3021 "can be made from it. Steps in this process include removing SSH host keys, "
3022 "removing persistent network MAC configuration, and removing user accounts. "
3023 "Each step can be enabled or disabled as required."
3027 #: ../clone/virt-sysprep.pod:21
3029 "Virt-sysprep is a simple shell script, allowing easy inspection or "
3030 "customization by the system administrator."
3034 #: ../clone/virt-sysprep.pod:24
3036 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
3037 "be shut down. If you want to preserve the existing contents of the guest, "
3038 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> below."
3042 #: ../clone/virt-sysprep.pod:29
3044 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
3045 "recommend that you don't. The time you might want to run it as root is when "
3046 "you need root in order to access the disk image, but even in this case it "
3047 "would be better to change the permissions on the disk image to be writable "
3048 "as the non-root user running virt-sysprep."
3052 #: ../clone/virt-sysprep.pod:35
3054 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
3055 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
3056 "machines in preparation for cloning them. Having said that, virt-sysprep "
3057 "does I<not> currently work on Microsoft Windows guests. We plan to support "
3058 "Windows sysprepping in a future version, and we already have code to do it."
3062 #: ../clone/virt-sysprep.pod:76
3063 msgid "B<--enable=...>"
3067 #: ../clone/virt-sysprep.pod:78
3069 "Choose which sysprep operations to perform. Give a comma-separated list of "
3070 "operations, for example:"
3074 #: ../clone/virt-sysprep.pod:81
3077 " --enable=ssh-hostkeys,udev-persistent-net\n"
3082 #: ../clone/virt-sysprep.pod:83
3084 "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
3088 #: ../clone/virt-sysprep.pod:85
3090 "If the I<--enable> option is not given, then we default to trying all "
3091 "possible sysprep operations. But some sysprep operations are skipped for "
3096 #: ../clone/virt-sysprep.pod:89
3098 "Use I<--list-operations> to list operations supported by a particular "
3099 "version of virt-sysprep."
3103 #: ../clone/virt-sysprep.pod:92
3105 "See L</OPERATIONS> below for a list and an explanation of each operation."
3109 #: ../clone/virt-sysprep.pod:106
3112 " virt-sysprep --format=raw -a disk.img\n"
3117 #: ../clone/virt-sysprep.pod:110
3120 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
3125 #: ../clone/virt-sysprep.pod:119
3126 msgid "B<--hostname> newhostname"
3130 #: ../clone/virt-sysprep.pod:121
3132 "Change the hostname. See the L</hostname> operation below. If not given, "
3133 "defaults to C<localhost.localdomain>."
3137 #: ../clone/virt-sysprep.pod:124
3138 msgid "B<--list-operations>"
3142 #: ../clone/virt-sysprep.pod:126
3143 msgid "List the operations supported by the virt-sysprep program."
3147 #: ../clone/virt-sysprep.pod:128
3148 msgid "B<--selinux-relabel>"
3152 #: ../clone/virt-sysprep.pod:130
3153 msgid "B<--no-selinux-relabel>"
3157 #: ../clone/virt-sysprep.pod:132
3159 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
3160 "I<--no-selinux-relabel> disables relabelling."
3164 #: ../clone/virt-sysprep.pod:135
3166 "The default is to try to detect if SELinux relabelling is required. See L</"
3167 "SELINUX RELABELLING> below for more details."
3171 #: ../clone/virt-sysprep.pod:156
3176 #: ../clone/virt-sysprep.pod:158
3178 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
3179 "enabled>, although some are skipped depending on the type of guest."
3183 #: ../clone/virt-sysprep.pod:162
3185 "Operations can be individually enabled using the I<--enable> option. Use a "
3186 "comma-separated list, for example:"
3190 #: ../clone/virt-sysprep.pod:165
3193 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
3198 #: ../clone/virt-sysprep.pod:167
3200 "To list the operations supported by the current version of virt-sysprep, use "
3201 "I<--list-operations>."
3205 #: ../clone/virt-sysprep.pod:170
3207 "Future versions of virt-sysprep may add more operations. If you are using "
3208 "virt-sysprep and want predictable behaviour, specify only the operations "
3209 "that you want to have enabled."
3213 #: ../clone/virt-sysprep.pod:174
3218 #: ../clone/virt-sysprep.pod:176
3219 msgid "Remove user at-jobs and cron-jobs."
3223 #: ../clone/virt-sysprep.pod:178
3224 msgid "dhcp-client-state"
3228 #: ../clone/virt-sysprep.pod:180
3229 msgid "Remove DHCP client leases."
3233 #: ../clone/virt-sysprep.pod:182
3234 msgid "dhcp-server-state"
3238 #: ../clone/virt-sysprep.pod:184
3239 msgid "Remove DHCP server leases."
3243 #: ../clone/virt-sysprep.pod:186
3248 #: ../clone/virt-sysprep.pod:188
3250 "Changes the hostname of the guest to the value given in the I<--hostname> "
3255 #: ../clone/virt-sysprep.pod:191
3257 "If the I<--hostname> parameter is not given, then the hostname is changed to "
3258 "C<localhost.localdomain>."
3262 #: ../clone/virt-sysprep.pod:194
3267 #: ../clone/virt-sysprep.pod:196
3268 msgid "Remove many log files."
3272 #: ../clone/virt-sysprep.pod:198
3277 #: ../clone/virt-sysprep.pod:200
3278 msgid "Remove email from the local mail spool directory."
3282 #: ../clone/virt-sysprep.pod:202
3287 #: ../clone/virt-sysprep.pod:204
3289 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
3290 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
3294 #: ../clone/virt-sysprep.pod:207
3299 #: ../clone/virt-sysprep.pod:209
3301 "Write some random bytes from the host into the random seed file of the guest."
3305 #: ../clone/virt-sysprep.pod:212
3306 msgid "See L</RANDOM SEED> below."
3310 #: ../clone/virt-sysprep.pod:214
3311 msgid "rhn-systemid"
3315 #: ../clone/virt-sysprep.pod:216
3316 msgid "Remove the RHN system ID."
3320 #: ../clone/virt-sysprep.pod:218
3325 #: ../clone/virt-sysprep.pod:220
3326 msgid "Remove the Smolt hardware UUID."
3330 #: ../clone/virt-sysprep.pod:222
3331 msgid "ssh-hostkeys"
3335 #: ../clone/virt-sysprep.pod:224
3336 msgid "Remove the SSH host keys in the guest."
3340 #: ../clone/virt-sysprep.pod:226
3342 "The SSH host keys are regenerated (differently) next time the guest is "
3347 #: ../clone/virt-sysprep.pod:229
3349 "If, after cloning, the guest gets the same IP address, ssh will give you a "
3350 "stark warning about the host key changing:"
3354 #: ../clone/virt-sysprep.pod:232
3357 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3358 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
3359 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3360 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
3365 #: ../clone/virt-sysprep.pod:237
3366 msgid "udev-persistent-net"
3370 #: ../clone/virt-sysprep.pod:239
3372 "Remove udev persistent net rules which map the guest's existing MAC address "
3373 "to a fixed ethernet device (eg. eth0)."
3377 #: ../clone/virt-sysprep.pod:242
3379 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
3380 "address occupies the old name (eg. eth0), this means the fresh MAC address "
3381 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
3382 "Erasing the udev persistent net rules avoids this."
3386 #: ../clone/virt-sysprep.pod:247
3391 #: ../clone/virt-sysprep.pod:249
3392 msgid "Remove the utmp file."
3396 #: ../clone/virt-sysprep.pod:251
3398 "This records who is currently logged in on a machine. In modern Linux "
3399 "distros it is stored in a ramdisk and hence not part of the virtual "
3400 "machine's disk, but it was stored on disk in older distros."
3404 #: ../clone/virt-sysprep.pod:255
3409 #: ../clone/virt-sysprep.pod:257
3410 msgid "Remove the yum UUID."
3414 #: ../clone/virt-sysprep.pod:259
3416 "Yum creates a fresh UUID the next time it runs when it notices that the "
3417 "original UUID has been erased."
3421 #: ../clone/virt-sysprep.pod:262
3422 msgid "COPYING AND CLONING"
3426 #: ../clone/virt-sysprep.pod:264
3428 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3429 "prepare a template from which guests can be cloned. There are many "
3430 "different ways to achieve this using the virt tools, and this section is "
3431 "just an introduction."
3435 #: ../clone/virt-sysprep.pod:269
3436 msgid "A virtual machine (when switched off) consists of two parts:"
3440 #: ../clone/virt-sysprep.pod:273
3441 msgid "I<configuration>"
3445 #: ../clone/virt-sysprep.pod:275
3447 "The configuration or description of the guest. eg. The libvirt XML (see "
3448 "C<virsh dumpxml>), the running configuration of the guest, or another "
3449 "external format like OVF."
3453 #: ../clone/virt-sysprep.pod:279
3454 msgid "Some configuration items that might need to be changed:"
3458 #: ../clone/virt-sysprep.pod:285
3463 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3468 #: ../clone/virt-sysprep.pod:293
3469 msgid "path to block device(s)"
3473 #: ../clone/virt-sysprep.pod:297
3474 msgid "network card MAC address"
3478 #: ../clone/virt-sysprep.pod:301
3479 msgid "I<block device(s)>"
3483 #: ../clone/virt-sysprep.pod:303
3485 "One or more hard disk images, themselves containing files, directories, "
3486 "applications, kernels, configuration, etc."
3490 #: ../clone/virt-sysprep.pod:306
3491 msgid "Some things inside the block devices that might need to be changed:"
3495 #: ../clone/virt-sysprep.pod:312
3496 msgid "hostname and other net configuration"
3500 #: ../clone/virt-sysprep.pod:320
3501 msgid "SSH host keys"
3505 #: ../clone/virt-sysprep.pod:324
3506 msgid "Windows unique security ID (SID)"
3510 #: ../clone/virt-sysprep.pod:328
3511 msgid "Puppet registration"
3515 #: ../clone/virt-sysprep.pod:334
3516 msgid "COPYING THE BLOCK DEVICE"
3520 #: ../clone/virt-sysprep.pod:336
3522 "Starting with an original guest, you probably wish to copy the guest block "
3523 "device and its configuration to make a template. Then once you are happy "
3524 "with the template, you will want to make many clones from it."
3528 #: ../clone/virt-sysprep.pod:341
3534 " original guest --------> template ---------->\n"
3535 " \\------> cloned\n"
3536 " \\-----> guests\n"
3542 #: ../clone/virt-sysprep.pod:349
3544 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3549 #: ../clone/virt-sysprep.pod:352
3553 " original guest --------> template ---------->\n"
3554 " \\------> cloned\n"
3555 " \\-----> guests\n"
3561 #: ../clone/virt-sysprep.pod:358
3562 msgid "There are some smarter (and faster) ways too:"
3566 #: ../clone/virt-sysprep.pod:364
3570 " template ---------->\n"
3571 " \\------> cloned\n"
3572 " \\-----> guests\n"
3578 #: ../clone/virt-sysprep.pod:370
3580 "Use the block device as a backing file and create a snapshot on top for each "
3581 "guest. The advantage is that you don't need to copy the block device (very "
3582 "fast) and only changes are stored (less storage required)."
3586 #: ../clone/virt-sysprep.pod:375
3588 "Note that writing to the backing file once you have created guests on top of "
3589 "it is not possible: you will corrupt the guests."
3593 #: ../clone/virt-sysprep.pod:378
3595 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 -"
3596 "o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3597 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3598 "also create cheap snapshots from files or LUNs."
3602 #: ../clone/virt-sysprep.pod:386
3603 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3607 #: ../clone/virt-sysprep.pod:390
3608 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3612 #: ../clone/virt-sysprep.pod:394
3617 #: ../clone/virt-sysprep.pod:396
3619 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3620 "and/or modify the external libvirt configuration of a guest. It will reset "
3621 "the name, UUID and MAC address of the guest in the libvirt XML."
3625 #: ../clone/virt-sysprep.pod:401
3627 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3628 "image. This was the original motivation to write virt-sysprep."
3632 #: ../clone/virt-sysprep.pod:404
3637 #: ../clone/virt-sysprep.pod:406
3641 " original guest --------> template\n"
3646 #: ../clone/virt-sysprep.pod:409
3648 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3649 "it easier to compress and/or faster to copy."
3653 #: ../clone/virt-sysprep.pod:412
3655 "Notice that since virt-sparsify also copies the image, you can use it to "
3656 "make the initial copy (instead of C<dd>)."
3660 #: ../clone/virt-sysprep.pod:415
3665 #: ../clone/virt-sysprep.pod:417
3669 " template ---------->\n"
3670 " \\------> cloned\n"
3671 " \\-----> guests\n"
3677 #: ../clone/virt-sysprep.pod:423
3679 "If you want to give people cloned guests, but let them pick the size of the "
3680 "guest themselves (eg. depending on how much they are prepared to pay for "
3681 "disk space), then instead of copying the template, you can run L<virt-resize"
3682 "(1)>. Virt-resize performs a copy and resize, and thus is ideal for cloning "
3683 "guests from a template."
3687 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3692 #: ../clone/virt-sysprep.pod:431
3694 "Although virt-sysprep removes some sensitive information from the guest, it "
3695 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3696 "above, and the implementation of the operations in the shell script. You "
3697 "should also examine the guest afterwards."
3701 #: ../clone/virt-sysprep.pod:436
3703 "Sensitive files are simply removed. The data they contained may still exist "
3704 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3705 "L<virt-sparsify(1)> as one way to remove this content. See also the L<scrub"
3706 "(1)> command to get rid of deleted content in directory entries and inodes."
3710 #: ../clone/virt-sysprep.pod:442
3715 #: ../clone/virt-sysprep.pod:444
3716 msgid "I<(This section applies to Linux guests only)>"
3720 #: ../clone/virt-sysprep.pod:446
3722 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3723 "from the host into the guest's random seed file."
3727 #: ../clone/virt-sysprep.pod:449
3729 "If this is just done once and the guest is cloned from the same template, "
3730 "then each guest will start with the same entropy, and things like SSH host "
3731 "keys and TCP sequence numbers may be predictable."
3735 #: ../clone/virt-sysprep.pod:453
3737 "Therefore you should arrange to add more randomness I<after> cloning from a "
3738 "template too, which can be done by just enabling the C<random-seed> "
3743 #: ../clone/virt-sysprep.pod:457
3746 " cp template.img newguest.img\n"
3747 " virt-sysprep --enable=random-seed -a newguest.img\n"
3752 #: ../clone/virt-sysprep.pod:460
3753 msgid "SELINUX RELABELLING"
3757 #: ../clone/virt-sysprep.pod:462
3758 msgid "I<(This section applies to Linux guests using SELinux only)>"
3762 #: ../clone/virt-sysprep.pod:464
3764 "If any new files are created by virt-sysprep, then virt-sysprep touches C</."
3765 "autorelabel> so that these will be correctly labelled by SELinux the next "
3766 "time the guest is booted. This process interrupts boot and can take some "
3771 #: ../clone/virt-sysprep.pod:469
3773 "You can force relabelling for all guests by supplying the I<--selinux-"
3778 #: ../clone/virt-sysprep.pod:472
3780 "You can disable relabelling entirely by supplying the I<--no-selinux-"
3785 #: ../clone/virt-sysprep.pod:484
3786 msgid "This program returns 0 on success, or 1 if there was an error."
3790 #: ../clone/virt-sysprep.pod:488
3792 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, L<virt-"
3793 "resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, L<qemu-img(1)"
3794 ">, L<scrub(1)>, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3798 #: ../df/virt-df.pod:5
3799 msgid "virt-df - Display free space on virtual filesystems"
3803 #: ../df/virt-df.pod:9
3806 " virt-df [--options]\n"
3811 #: ../df/virt-df.pod:11
3814 " virt-df [--options] -d domname\n"
3819 #: ../df/virt-df.pod:13
3822 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3827 #: ../df/virt-df.pod:17
3830 " virt-df [--options] domname\n"
3835 #: ../df/virt-df.pod:19
3838 " virt-df [--options] disk.img [disk.img ...]\n"
3843 #: ../df/virt-df.pod:23
3845 "C<virt-df> is a command line tool to display free space on virtual machine "
3846 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3847 "allocated to a virtual machine, but can look inside disk images to see how "
3848 "much space is really being used."
3852 #: ../df/virt-df.pod:28
3854 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3855 "to get a list of all active and inactive guests, and performs a C<df>-type "
3856 "operation on each one in turn, printing out the results."
3860 #: ../df/virt-df.pod:32
3862 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
3863 "type operation on either the single named libvirt domain, or on the disk "
3864 "image(s) listed on the command line (which must all belong to a single VM). "
3865 "In this mode (with arguments), C<virt-df> will I<only work for a single "
3866 "guest>. If you want to run on multiple guests, then you have to invoke "
3867 "C<virt-df> multiple times."
3871 #: ../df/virt-df.pod:39
3873 "Use the I<--csv> option to get a format which can be easily parsed by other "
3874 "programs. Other options are similar to the standard L<df(1)> command."
3878 #: ../df/virt-df.pod:45
3880 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3881 "output human-readable:"
3885 #: ../df/virt-df.pod:48
3888 " # virt-df -d F14x64 -h\n"
3889 " Filesystem Size Used Available Use%\n"
3890 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3891 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3896 #: ../df/virt-df.pod:53
3897 msgid "Show disk usage for a disk image file called C<test.img>:"
3901 #: ../df/virt-df.pod:55
3904 " $ virt-df -a test1.img\n"
3905 " Filesystem 1K-blocks Used Available Use%\n"
3906 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3911 #: ../df/virt-df.pod:112
3914 " virt-df --format=raw -a disk.img\n"
3919 #: ../df/virt-df.pod:116
3922 " virt-df --format=raw -a disk.img --format -a another.img\n"
3927 #: ../df/virt-df.pod:129
3928 msgid "Print sizes in human-readable format."
3932 #: ../df/virt-df.pod:131
3933 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3937 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3942 #: ../df/virt-df.pod:135
3947 #: ../df/virt-df.pod:137
3948 msgid "Print inodes instead of blocks."
3952 #: ../df/virt-df.pod:139
3953 msgid "B<--one-per-guest>"
3957 #: ../df/virt-df.pod:141
3959 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3960 "disks from several guests to a single libguestfs appliance."
3964 #: ../df/virt-df.pod:144
3965 msgid "You might use this option in the following circumstances:"
3969 #: ../df/virt-df.pod:150
3971 "If you think an untrusted guest might actively try to exploit the libguestfs "
3972 "appliance kernel, then this prevents one guest from interfering with the "
3973 "stats printed for another guest."
3977 #: ../df/virt-df.pod:156
3979 "If the kernel has a bug which stops it from accessing a filesystem in one "
3980 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3981 "and report stats for further guests."
3985 #: ../df/virt-df.pod:165
3987 "Print UUIDs instead of names. This is useful for following a guest even "
3988 "when the guest is migrated or renamed, or when two guests happen to have the "
3993 #: ../df/virt-df.pod:169
3995 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3996 "images, we still print the disk image name even when this option is "
4001 #: ../df/virt-df.pod:229
4003 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
4008 #: ../edit/virt-edit.pod:5
4009 msgid "virt-edit - Edit a file in a virtual machine"
4013 #: ../edit/virt-edit.pod:9
4016 " virt-edit [--options] -d domname file [file ...]\n"
4021 #: ../edit/virt-edit.pod:11
4024 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
4029 #: ../edit/virt-edit.pod:13
4032 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
4037 #: ../edit/virt-edit.pod:17
4040 " virt-edit domname file\n"
4045 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
4048 " virt-edit disk.img [disk.img ...] file\n"
4053 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
4054 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
4055 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:21
4056 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
4061 #: ../edit/virt-edit.pod:23
4063 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
4064 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
4065 "doing this, but doesn't catch all cases."
4069 #: ../edit/virt-edit.pod:29
4071 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
4072 "exists in the named virtual machine (or disk image)."
4076 #: ../edit/virt-edit.pod:32
4078 "Multiple filenames can be given, in which case they are each edited in "
4079 "turn. Each filename must be a full path, starting at the root directory "
4080 "(starting with '/')."
4084 #: ../edit/virt-edit.pod:36
4085 msgid "If you want to just view a file, use L<virt-cat(1)>."
4089 #: ../edit/virt-edit.pod:38
4091 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
4092 "USING GUESTFISH> below)."
4096 #: ../edit/virt-edit.pod:41
4098 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
4099 "that and much more."
4103 #: ../edit/virt-edit.pod:46
4104 msgid "Edit the named files interactively:"
4108 #: ../edit/virt-edit.pod:48
4111 " virt-edit -d mydomain /boot/grub/grub.conf\n"
4116 #: ../edit/virt-edit.pod:50
4119 " virt-edit -d mydomain /etc/passwd\n"
4124 #: ../edit/virt-edit.pod:52
4125 msgid "For Windows guests, some Windows paths are understood:"
4129 #: ../edit/virt-edit.pod:54
4132 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
4137 #: ../edit/virt-edit.pod:56
4139 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
4140 "INTERACTIVE EDITING> below). To change the init default level to 5:"
4144 #: ../edit/virt-edit.pod:60
4147 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
4152 #: ../edit/virt-edit.pod:81
4153 msgid "B<-b> extension"
4157 #: ../edit/virt-edit.pod:83
4158 msgid "B<--backup> extension"
4162 #: ../edit/virt-edit.pod:85
4164 "Create a backup of the original file I<in the guest disk image>. The backup "
4165 "has the original filename with C<extension> added."
4169 #: ../edit/virt-edit.pod:88
4171 "Usually the first character of C<extension> would be a dot C<.> so you would "
4176 #: ../edit/virt-edit.pod:91
4179 " virt-edit -b .orig [etc]\n"
4184 #: ../edit/virt-edit.pod:93
4185 msgid "By default, no backup file is made."
4189 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
4190 #: ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74
4191 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
4192 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
4197 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
4198 #: ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76
4199 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
4200 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
4201 msgid "B<--connect URI>"
4205 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
4206 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
4207 #: ../tools/virt-win-reg.pl:135
4209 "If you specify guest block devices directly, then libvirt is not used at all."
4213 #: ../edit/virt-edit.pod:114
4215 "When prompting for keys and passphrases, virt-edit normally turns echoing "
4216 "off so you cannot see what you are typing. If you are not worried about "
4217 "Tempest attacks and there is no one else in the room you can specify this "
4218 "flag to see what you are typing."
4222 #: ../edit/virt-edit.pod:119
4227 #: ../edit/virt-edit.pod:121
4228 msgid "B<--expr> EXPR"
4232 #: ../edit/virt-edit.pod:123
4234 "Instead of launching the external editor, non-interactively apply the Perl "
4235 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
4240 #: ../edit/virt-edit.pod:127
4242 "Be careful to properly quote the expression to prevent it from being altered "
4247 #: ../edit/virt-edit.pod:130
4248 msgid "Note that this option is only available when Perl 5 is installed."
4252 #: ../edit/virt-edit.pod:132
4253 msgid "B<--format> raw|qcow2|..."
4257 #: ../edit/virt-edit.pod:143
4260 " virt-edit --format=raw -a disk.img file\n"
4265 #: ../edit/virt-edit.pod:147
4268 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
4273 #: ../edit/virt-edit.pod:181
4274 msgid "Previous versions of virt-edit allowed you to write either:"
4278 #: ../edit/virt-edit.pod:187
4281 " virt-edit guestname file\n"
4286 #: ../edit/virt-edit.pod:195
4287 msgid "NON-INTERACTIVE EDITING"
4291 #: ../edit/virt-edit.pod:197
4293 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
4294 "administrator can interactively edit the file."
4298 #: ../edit/virt-edit.pod:200
4300 "There are two ways also to use C<virt-edit> from scripts in order to make "
4301 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
4302 "like this, it's less error-prone to write scripts directly using the "
4303 "libguestfs API and Augeas for configuration file editing.)"
4307 #: ../edit/virt-edit.pod:206
4309 "The first method is to temporarily set C<$EDITOR> to any script or program "
4310 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
4311 "update C<tmpfile> in place however it likes."
4315 #: ../edit/virt-edit.pod:210
4317 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
4318 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
4319 "instances of C<foo> with C<bar> in a file:"
4323 #: ../edit/virt-edit.pod:214
4326 " virt-edit -d domname filename -e 's/foo/bar/'\n"
4331 #: ../edit/virt-edit.pod:216
4333 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
4334 "For example to delete root's password you could do:"
4338 #: ../edit/virt-edit.pod:219
4341 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4346 #: ../edit/virt-edit.pod:221
4348 "What really happens is that the snippet is evaluated as a Perl expression "
4349 "for each line of the file. The line, including the final C<\\n>, is passed "
4350 "in C<$_> and the expression should update C<$_> or leave it unchanged."
4354 #: ../edit/virt-edit.pod:226
4356 "To delete a line, set C<$_> to the empty string. For example, to delete the "
4357 "C<apache> user account from the password file you can do:"
4361 #: ../edit/virt-edit.pod:229
4364 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
4369 #: ../edit/virt-edit.pod:231
4371 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4372 "the end of the file is rather difficult this way since there is no concept "
4373 "of \"last line of the file\" - your expression just doesn't get called "
4374 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4379 #: ../edit/virt-edit.pod:237
4381 "The variable C<$lineno> contains the current line number. As is "
4382 "traditional, the first line in the file is number C<1>."
4386 #: ../edit/virt-edit.pod:240
4388 "The return value from the expression is ignored, but the expression may call "
4389 "C<die> in order to abort the whole program, leaving the original file "
4394 #: ../edit/virt-edit.pod:244
4396 "Remember when matching the end of a line that C<$_> may contain the final C<"
4397 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4398 "newline then neither of these. Thus to match or substitute some text at the "
4399 "end of a line, use this regular expression:"
4403 #: ../edit/virt-edit.pod:249
4406 " /some text(\\r?\\n)?$/\n"
4411 #: ../edit/virt-edit.pod:251
4413 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
4414 "$_> itself (since that would remove all newlines from the file):"
4418 #: ../edit/virt-edit.pod:255
4421 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4426 #: ../edit/virt-edit.pod:259
4428 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4429 "paths (eg. C<E:\\foo\\bar.txt>)."
4433 #: ../edit/virt-edit.pod:278
4435 "The path is resolved case insensitively to locate the file that should be "
4440 #: ../edit/virt-edit.pod:299
4442 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4443 "C<virt-edit> doesn't work."
4447 #: ../edit/virt-edit.pod:302
4448 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4452 #: ../edit/virt-edit.pod:304
4455 " guestfish --rw -i -d domname edit /file\n"
4460 #: ../edit/virt-edit.pod:306
4462 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4467 #: ../edit/virt-edit.pod:309
4469 "The command above uses libguestfs's guest inspection feature and so does not "
4470 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4471 "disk images that don't contain guests. To edit a file on a disk image "
4476 #: ../edit/virt-edit.pod:314
4479 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4484 #: ../edit/virt-edit.pod:316
4486 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4487 "the disk image to edit, and C</file> is the full path to the file."
4491 #: ../edit/virt-edit.pod:320
4493 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4494 "C<write> or C<upload> instead:"
4498 #: ../edit/virt-edit.pod:323
4501 " guestfish --rw -i -d domname touch /newfile\n"
4506 #: ../edit/virt-edit.pod:325
4509 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4514 #: ../edit/virt-edit.pod:327
4517 " guestfish --rw -i -d domname upload localfile /newfile\n"
4522 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119
4523 #: ../rescue/virt-rescue.pod:298 ../sparsify/virt-sparsify.pod:232
4524 #: ../src/guestfs.pod:3209 ../test-tool/libguestfs-test-tool.pod:95
4525 msgid "ENVIRONMENT VARIABLES"
4529 #: ../edit/virt-edit.pod:333
4534 #: ../edit/virt-edit.pod:335
4536 "If set, this string is used as the editor. It may contain arguments, eg. C<"
4541 #: ../edit/virt-edit.pod:338
4542 msgid "If not set, C<vi> is used."
4546 #: ../edit/virt-edit.pod:356
4548 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
4549 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
4550 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4554 #: ../erlang/examples/guestfs-erlang.pod:5
4555 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4559 #: ../erlang/examples/guestfs-erlang.pod:9
4562 " {ok, G} = guestfs:create(),\n"
4563 " ok = guestfs:add_drive_opts(G, Disk,\n"
4564 " [{format, \"raw\"}, {readonly, true}]),\n"
4565 " ok = guestfs:launch(G),\n"
4566 " [Device] = guestfs:list_devices(G),\n"
4567 " ok = guestfs:close(G).\n"
4572 #: ../erlang/examples/guestfs-erlang.pod:18
4574 "This manual page documents how to call libguestfs from the Erlang "
4575 "programming language. This page just documents the differences from the C "
4576 "API and gives some examples. If you are not familiar with using libguestfs, "
4577 "you also need to read L<guestfs(3)>."
4581 #: ../erlang/examples/guestfs-erlang.pod:23
4582 msgid "OPENING AND CLOSING THE HANDLE"
4586 #: ../erlang/examples/guestfs-erlang.pod:25
4588 "The Erlang bindings are implemented using an external program called C<erl-"
4589 "guestfs>. This program must be on the current PATH, or else you should "
4590 "specify the full path to the program:"
4594 #: ../erlang/examples/guestfs-erlang.pod:29
4597 " {ok, G} = guestfs:create().\n"
4602 #: ../erlang/examples/guestfs-erlang.pod:31
4605 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4610 #: ../erlang/examples/guestfs-erlang.pod:33
4611 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4615 #: ../erlang/examples/guestfs-erlang.pod:36
4616 msgid "To close the handle:"
4620 #: ../erlang/examples/guestfs-erlang.pod:38
4623 " ok = guestfs:close(G).\n"
4628 #: ../erlang/examples/guestfs-erlang.pod:40
4629 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4633 #: ../erlang/examples/guestfs-erlang.pod:42
4635 "For functions that take optional arguments, the first arguments are the non-"
4636 "optional ones. The last argument is a list of tuples supplying the "
4637 "remaining optional arguments."
4641 #: ../erlang/examples/guestfs-erlang.pod:46
4644 " ok = guestfs:add_drive_opts(G, Disk,\n"
4645 " [{format, \"raw\"}, {readonly, true}]).\n"
4650 #: ../erlang/examples/guestfs-erlang.pod:49
4651 msgid "If the last argument would be an empty list, you can also omit it:"
4655 #: ../erlang/examples/guestfs-erlang.pod:51
4658 " ok = guestfs:add_drive_opts(G, Disk).\n"
4663 #: ../erlang/examples/guestfs-erlang.pod:53
4664 msgid "RETURN VALUES AND ERRORS"
4668 #: ../erlang/examples/guestfs-erlang.pod:55
4670 "On success, most functions return a C<Result> term (which could be a list, "
4671 "string, tuple etc.). If there is nothing for the function to return, then "
4672 "the atom C<ok> is returned."
4676 #: ../erlang/examples/guestfs-erlang.pod:59
4677 msgid "On error, you would see one of the following tuples:"
4681 #: ../erlang/examples/guestfs-erlang.pod:63
4682 msgid "C<{error, Msg, Errno}>"
4686 #: ../erlang/examples/guestfs-erlang.pod:65
4687 msgid "This indicates an ordinary error from the function."
4691 #: ../erlang/examples/guestfs-erlang.pod:67
4693 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4698 #: ../erlang/examples/guestfs-erlang.pod:70
4699 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4703 #: ../erlang/examples/guestfs-erlang.pod:72
4704 msgid "C<{unknown, Function}>"
4708 #: ../erlang/examples/guestfs-erlang.pod:74
4710 "This indicates that the function you called is not known. Generally this "
4711 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4712 "which you should not do."
4716 #: ../erlang/examples/guestfs-erlang.pod:78
4717 msgid "C<Function> is the name of the unknown function."
4721 #: ../erlang/examples/guestfs-erlang.pod:80
4722 msgid "C<{unknownarg, Arg}>"
4726 #: ../erlang/examples/guestfs-erlang.pod:82
4728 "This indicates that you called a function with optional arguments, with an "
4729 "unknown argument name."
4733 #: ../erlang/examples/guestfs-erlang.pod:85
4734 msgid "C<Arg> is the name of the unknown argument."
4738 #: ../erlang/examples/guestfs-erlang.pod:89
4739 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
4740 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
4741 #: ../python/examples/guestfs-python.pod:34
4742 #: ../ruby/examples/guestfs-ruby.pod:28
4743 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4747 #: ../erlang/examples/guestfs-erlang.pod:91
4748 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
4749 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
4750 #: ../python/examples/guestfs-python.pod:36
4751 #: ../ruby/examples/guestfs-ruby.pod:30
4756 #: ../erlang/examples/guestfs-erlang.pod:93
4757 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
4758 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
4759 #: ../python/examples/guestfs-python.pod:38
4760 #: ../ruby/examples/guestfs-ruby.pod:32
4761 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4765 #: ../erlang/examples/guestfs-erlang.pod:95
4766 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
4767 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
4768 #: ../python/examples/guestfs-python.pod:40
4769 #: ../ruby/examples/guestfs-ruby.pod:34
4774 #: ../erlang/examples/guestfs-erlang.pod:99
4776 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4777 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4778 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
4782 #: ../erlang/examples/guestfs-erlang.pod:110
4783 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
4784 #: ../examples/guestfs-testing.pod:276 ../fish/guestfish.pod:1296
4785 #: ../fish/virt-copy-in.pod:60 ../fish/virt-copy-out.pod:49
4786 #: ../fish/virt-tar-in.pod:58 ../fish/virt-tar-out.pod:51
4787 #: ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:404
4788 #: ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91
4789 #: ../perl/examples/guestfs-perl.pod:52
4790 #: ../python/examples/guestfs-python.pod:54
4791 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3349
4792 #: ../test-tool/libguestfs-test-tool.pod:106
4797 #: ../erlang/examples/guestfs-erlang.pod:112
4798 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
4799 #: ../examples/guestfs-testing.pod:278 ../fish/guestfish.pod:1298
4800 #: ../fish/virt-copy-in.pod:62 ../fish/virt-copy-out.pod:51
4801 #: ../fish/virt-tar-in.pod:60 ../fish/virt-tar-out.pod:53
4802 #: ../fuse/guestmount.pod:330 ../java/examples/guestfs-java.pod:60
4803 #: ../ocaml/examples/guestfs-ocaml.pod:93 ../perl/examples/guestfs-perl.pod:54
4804 #: ../python/examples/guestfs-python.pod:56
4805 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3351
4806 #: ../test-tool/libguestfs-test-tool.pod:108
4807 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4811 #: ../erlang/examples/guestfs-erlang.pod:116
4812 #: ../examples/guestfs-testing.pod:282 ../java/examples/guestfs-java.pod:64
4813 #: ../perl/examples/guestfs-perl.pod:58
4814 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4818 #: ../erlang/examples/guestfs-erlang.pod:118
4819 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
4820 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
4821 #: ../perl/examples/guestfs-perl.pod:60
4822 #: ../python/examples/guestfs-python.pod:62
4823 #: ../ruby/examples/guestfs-ruby.pod:56
4825 "The examples in this manual page may be freely copied, modified and "
4826 "distributed without any restrictions."
4830 #: ../erlang/examples/guestfs-erlang.pod:121
4831 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
4832 #: ../examples/guestfs-testing.pod:284 ../java/examples/guestfs-java.pod:69
4833 #: ../ocaml/examples/guestfs-ocaml.pod:102
4834 #: ../perl/examples/guestfs-perl.pod:63
4835 #: ../python/examples/guestfs-python.pod:65
4836 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3358
4838 "This library is free software; you can redistribute it and/or modify it "
4839 "under the terms of the GNU Lesser General Public License as published by the "
4840 "Free Software Foundation; either version 2 of the License, or (at your "
4841 "option) any later version."
4845 #: ../erlang/examples/guestfs-erlang.pod:126
4846 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
4847 #: ../examples/guestfs-testing.pod:289 ../java/examples/guestfs-java.pod:74
4848 #: ../ocaml/examples/guestfs-ocaml.pod:107
4849 #: ../perl/examples/guestfs-perl.pod:68
4850 #: ../python/examples/guestfs-python.pod:70
4851 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3363
4853 "This library is distributed in the hope that it will be useful, but WITHOUT "
4854 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4855 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4860 #: ../erlang/examples/guestfs-erlang.pod:131
4861 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
4862 #: ../examples/guestfs-testing.pod:294 ../java/examples/guestfs-java.pod:79
4863 #: ../ocaml/examples/guestfs-ocaml.pod:112
4864 #: ../perl/examples/guestfs-perl.pod:73
4865 #: ../python/examples/guestfs-python.pod:75
4866 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3368
4868 "You should have received a copy of the GNU Lesser General Public License "
4869 "along with this library; if not, write to the Free Software Foundation, "
4870 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4874 #: ../examples/guestfs-examples.pod:5
4875 msgid "guestfs-examples - Examples of using libguestfs from C"
4879 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4882 " #include <guestfs.h>\n"
4884 msgstr "#include <guestfs.h>\n"
4887 #: ../examples/guestfs-examples.pod:11
4890 " guestfs_h *g = guestfs_create ();\n"
4891 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4892 " guestfs_launch (g);\n"
4897 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4900 " cc prog.c -o prog -lguestfs\n"
4902 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4905 " cc prog.c -o prog -lguestfs\n"
4907 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4911 #: ../examples/guestfs-examples.pod:21
4913 "This manual page contains examples of calling libguestfs from the C "
4914 "programming language. If you are not familiar with using libguestfs, you "
4915 "also need to read L<guestfs(3)>."
4919 #: ../examples/guestfs-examples.pod:35
4921 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4922 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4923 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4927 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
4928 #: ../python/examples/guestfs-python.pod:60
4929 #: ../ruby/examples/guestfs-ruby.pod:54
4930 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4934 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4939 #: ../examples/guestfs-recipes.pod:5
4941 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4942 "here. The only way which works for both sorts of output is to just write "
4943 "the URL directly. Do NOT use L<...> for URLs."
4947 #: ../examples/guestfs-recipes.pod:9
4949 "We break with tradition here and don't use ALL CAPS for the section "
4950 "headings, as this makes them much easier to read."
4954 #: ../examples/guestfs-recipes.pod:16
4955 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4959 #: ../examples/guestfs-recipes.pod:20
4961 "This page contains recipes for and links to things you can do using "
4962 "libguestfs, L<guestfish(1)> and the virt tools."
4966 #: ../examples/guestfs-recipes.pod:23
4967 msgid "Audit a virtual machine for setuid files"
4971 #: ../examples/guestfs-recipes.pod:25
4973 "The link below contains a small program which can be used to audit a Linux "
4974 "virtual machine to see what setuid and setgid files it contains."
4978 #: ../examples/guestfs-recipes.pod:28
4980 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
4985 #: ../examples/guestfs-recipes.pod:30
4986 msgid "Change the background image in a Windows XP VM"
4990 #: ../examples/guestfs-recipes.pod:32
4992 "The links below explain how to use L<guestfish(1)> to change the background "
4993 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4994 "be substantially different for each version of Windows."
4998 #: ../examples/guestfs-recipes.pod:37
5000 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
5001 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
5005 #: ../examples/guestfs-recipes.pod:40
5006 msgid "Cloning a virtual machine (Linux)"
5010 #: ../examples/guestfs-recipes.pod:42
5012 "The guestfish technique described in the link below works well for most "
5013 "Linux VMs. Depending on the Linux distro you may need to change the paths "
5018 #: ../examples/guestfs-recipes.pod:46
5020 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
5025 #: ../examples/guestfs-recipes.pod:48
5027 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
5032 #: ../examples/guestfs-recipes.pod:51
5033 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
5037 #: ../examples/guestfs-recipes.pod:53
5038 msgid "Cloning a virtual machine (Windows)"
5042 #: ../examples/guestfs-recipes.pod:55
5044 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
5045 "straightforward. Currently there is code in the Aeolus Oz project which "
5046 "does this (using libguestfs). As part of our review of the virt-clone tool, "
5047 "we may add sysprepping ability."
5051 #: ../examples/guestfs-recipes.pod:60
5053 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
5054 "list/2011-May/msg00019.html"
5058 #: ../examples/guestfs-recipes.pod:63
5059 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
5063 #: ../examples/guestfs-recipes.pod:65
5064 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
5068 #: ../examples/guestfs-recipes.pod:67
5071 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
5076 #: ../examples/guestfs-recipes.pod:69
5077 msgid "To export just a subdirectory, eg. C</files>, do:"
5081 #: ../examples/guestfs-recipes.pod:71
5084 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
5089 #: ../examples/guestfs-recipes.pod:73
5090 msgid "Create empty disk images"
5094 #: ../examples/guestfs-recipes.pod:75
5096 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
5097 "The useful guide below explains the options available."
5101 #: ../examples/guestfs-recipes.pod:78
5103 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
5108 #: ../examples/guestfs-recipes.pod:80
5109 msgid "Dump raw filesystem content from inside a disk image or VM"
5113 #: ../examples/guestfs-recipes.pod:82
5115 "You can use the L<guestfish(1)> C<download> command to extract the raw "
5116 "filesystem content from any filesystem in a disk image or a VM (even one "
5117 "which is encrypted or buried inside an LV):"
5121 #: ../examples/guestfs-recipes.pod:86
5124 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
5129 #: ../examples/guestfs-recipes.pod:88
5132 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
5137 #: ../examples/guestfs-recipes.pod:90
5138 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
5142 #: ../examples/guestfs-recipes.pod:92
5143 msgid "Edit grub configuration in a VM"
5147 #: ../examples/guestfs-recipes.pod:94
5148 msgid "You can use this to:"
5152 #: ../examples/guestfs-recipes.pod:100
5153 msgid "Fix a virtual machine that does not boot."
5157 #: ../examples/guestfs-recipes.pod:104
5158 msgid "Change which kernel is used to boot the VM."
5162 #: ../examples/guestfs-recipes.pod:108
5163 msgid "Change kernel command line options."
5167 #: ../examples/guestfs-recipes.pod:112
5168 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
5172 #: ../examples/guestfs-recipes.pod:114
5175 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
5180 #: ../examples/guestfs-recipes.pod:116
5182 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
5187 #: ../examples/guestfs-recipes.pod:119
5190 " virt-rescue -d BrokenGuest\n"
5195 #: ../examples/guestfs-recipes.pod:121
5196 msgid "Export any directory from a VM"
5200 #: ../examples/guestfs-recipes.pod:123
5202 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
5206 #: ../examples/guestfs-recipes.pod:126 ../examples/guestfs-testing.pod:93
5209 " virt-copy-out -d Guest /home .\n"
5214 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
5215 #: ../fish/guestfish-actions.pod:1450 ../fish/guestfish-actions.pod:1715
5216 #: ../fish/guestfish-actions.pod:2132 ../src/guestfs-actions.pod:18
5217 #: ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2758
5218 #: ../src/guestfs-actions.pod:3317 ../src/guestfs.pod:1685
5219 #: ../tools/virt-win-reg.pl:717
5224 #: ../examples/guestfs-recipes.pod:134
5226 "The final dot of the command is not a printing error. It means we want to "
5227 "copy out to the current directory."
5231 #: ../examples/guestfs-recipes.pod:139
5232 msgid "This creates a directory called C<home> under the current directory."
5236 #: ../examples/guestfs-recipes.pod:143
5238 "If the guest is a Windows guest then you can use drive letters and "
5239 "backslashes, but you must prefix the path with C<win:> and quote it to "
5240 "protect it from the shell, like this:"
5244 #: ../examples/guestfs-recipes.pod:147
5247 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
5252 #: ../examples/guestfs-recipes.pod:149
5253 msgid "To get the output as a compressed tarball, do:"
5257 #: ../examples/guestfs-recipes.pod:151
5260 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
5265 #: ../examples/guestfs-recipes.pod:153
5267 "Although it sounds tempting, this is usually not a reliable way to get a "
5268 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
5269 "org/FAQ.html#backup"
5273 #: ../examples/guestfs-recipes.pod:157
5274 msgid "Find out which user is using the most space"
5278 #: ../examples/guestfs-recipes.pod:159
5280 "This simple script examines a Linux guest to find out which user is using "
5281 "the most space in their home directory:"
5285 #: ../examples/guestfs-recipes.pod:162
5293 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
5301 #: ../examples/guestfs-recipes.pod:166
5310 #: ../examples/guestfs-recipes.pod:169
5313 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
5318 #: ../examples/guestfs-recipes.pod:171
5321 " for d in $(guestfish --remote ls \"$dir\"); do\n"
5322 " echo -n \"$dir/$d\"\n"
5324 " guestfish --remote du \"$dir/$d\";\n"
5325 " done | sort -nr -k 2\n"
5330 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
5333 " guestfish --remote exit\n"
5338 #: ../examples/guestfs-recipes.pod:179
5339 msgid "Get DHCP address from a VM"
5343 #: ../examples/guestfs-recipes.pod:181
5345 "The link below explains the many different possible techniques for getting "
5346 "the last assigned DHCP address of a virtual machine."
5350 #: ../examples/guestfs-recipes.pod:184
5352 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
5353 "a-virtual-machine-disk-image/#content"
5357 #: ../examples/guestfs-recipes.pod:186
5359 "In the libguestfs source examples directory you will find the latest version "
5360 "of the C<virt-dhcp-address.c> program."
5364 #: ../examples/guestfs-recipes.pod:189
5365 msgid "Get the operating system product name string"
5369 #: ../examples/guestfs-recipes.pod:191
5370 msgid "Save the following script into a file called C<product-name.sh>:"
5374 #: ../examples/guestfs-recipes.pod:193
5379 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5380 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5381 " guestfish --remote inspect-get-product-name \"$root\"\n"
5382 " guestfish --remote exit\n"
5387 #: ../examples/guestfs-recipes.pod:200
5388 msgid "Make the script executable and run it on a named guest:"
5392 #: ../examples/guestfs-recipes.pod:202
5395 " # product-name.sh RHEL60x64\n"
5396 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
5401 #: ../examples/guestfs-recipes.pod:205
5403 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
5404 "C<xpath> command line tool or from your favourite programming language:"
5408 #: ../examples/guestfs-recipes.pod:209
5411 " # virt-inspector RHEL60x64 > xml\n"
5412 " # xpath '//product_name' < xml\n"
5415 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
5420 #: ../examples/guestfs-recipes.pod:215
5421 msgid "Get the default boot kernel for a Linux VM"
5425 #: ../examples/guestfs-recipes.pod:217
5427 "The link below contains a program to print the default boot kernel for a "
5432 #: ../examples/guestfs-recipes.pod:220
5434 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
5435 "kernel-for-a-vm/#content"
5439 #: ../examples/guestfs-recipes.pod:222
5441 "It uses Augeas, and the technique is generally applicable for many different "
5446 #: ../examples/guestfs-recipes.pod:229
5447 msgid "listing the user accounts in the guest"
5451 #: ../examples/guestfs-recipes.pod:233
5452 msgid "what repositories is it configured to use"
5456 #: ../examples/guestfs-recipes.pod:237
5457 msgid "what NTP servers does it connect to"
5461 #: ../examples/guestfs-recipes.pod:241
5462 msgid "what were the boot messages last time it booted"
5466 #: ../examples/guestfs-recipes.pod:245
5467 msgid "listing who was logged in recently"
5471 #: ../examples/guestfs-recipes.pod:249
5472 msgid "http://augeas.net/"
5476 #: ../examples/guestfs-recipes.pod:251
5477 msgid "Install RPMs in a guest"
5481 #: ../examples/guestfs-recipes.pod:253
5483 "The link below contains a method to install RPMs in a guest. In fact the "
5484 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5485 "installs them next time the guest is booted. You could use this technique "
5486 "to install vital security updates in an offline guest."
5490 #: ../examples/guestfs-recipes.pod:259
5492 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5496 #: ../examples/guestfs-recipes.pod:261
5497 msgid "List applications installed in a VM"
5501 #: ../examples/guestfs-recipes.pod:263
5502 msgid "Save the following to a file C<list-apps.sh>:"
5506 #: ../examples/guestfs-recipes.pod:265
5511 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5512 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5513 " guestfish --remote inspect-list-applications \"$root\"\n"
5514 " guestfish --remote exit\n"
5519 #: ../examples/guestfs-recipes.pod:272
5521 "Make the file executable and then you can run it on any named virtual "
5526 #: ../examples/guestfs-recipes.pod:275
5529 " # list-apps.sh WinGuest\n"
5531 " app_name: Mozilla Firefox (3.6.12)\n"
5532 " app_display_name: Mozilla Firefox (3.6.12)\n"
5534 " app_version: 3.6.12 (en-GB)\n"
5536 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5537 " app_trans_path:\n"
5538 " app_publisher: Mozilla\n"
5539 " app_url: http://www.mozilla.com/en-GB/\n"
5540 " app_source_package:\n"
5542 " app_description: Mozilla Firefox\n"
5545 " app_name: VLC media player\n"
5546 " app_display_name: VLC media player 1.1.5\n"
5548 " app_version: 1.1.5\n"
5550 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5551 " app_trans_path:\n"
5552 " app_publisher: VideoLAN\n"
5553 " app_url: http://www.videolan.org/\n"
5554 " app_source_package:\n"
5556 " app_description:\n"
5562 #: ../examples/guestfs-recipes.pod:305
5564 "If you want to run the script on disk images (instead of libvirt virtual "
5565 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
5570 #: ../examples/guestfs-recipes.pod:309
5571 msgid "List files and directories in a VM"
5575 #: ../examples/guestfs-recipes.pod:311
5576 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5580 #: ../examples/guestfs-recipes.pod:313
5583 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5588 #: ../examples/guestfs-recipes.pod:315
5589 msgid "List services in a Windows VM"
5593 #: ../examples/guestfs-recipes.pod:317
5595 "The link below contains a script that can be used to list out the services "
5596 "from a Windows VM, and whether those services run at boot time or are loaded "
5601 #: ../examples/guestfs-recipes.pod:321
5603 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
5608 #: ../examples/guestfs-recipes.pod:323
5609 msgid "Make a disk image sparse"
5613 #: ../examples/guestfs-recipes.pod:325
5615 "The link below contains some guides for making a disk image sparse (or "
5616 "reintroducing sparseness)."
5620 #: ../examples/guestfs-recipes.pod:328
5622 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5626 #: ../examples/guestfs-recipes.pod:330
5627 msgid "Monitor disk usage over time"
5631 #: ../examples/guestfs-recipes.pod:332
5633 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5634 "The link below contains a guide."
5638 #: ../examples/guestfs-recipes.pod:335
5639 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5643 #: ../examples/guestfs-recipes.pod:337
5644 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5648 #: ../examples/guestfs-recipes.pod:339
5650 "L<guestfish(1)> plus the tools described in the link below can be used to "
5651 "read out the Windows Event Log from any virtual machine running Windows "
5652 "Vista or a later version."
5656 #: ../examples/guestfs-recipes.pod:343
5658 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
5659 "guestfish/#content"
5663 #: ../examples/guestfs-recipes.pod:345
5664 msgid "Remove root password (Linux)"
5668 #: ../examples/guestfs-recipes.pod:347
5670 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5671 "files. One use is to remove the root password from a Linux guest:"
5675 #: ../examples/guestfs-recipes.pod:350
5678 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5683 #: ../examples/guestfs-recipes.pod:352
5684 msgid "Remove Administrator password (Windows)"
5688 #: ../examples/guestfs-recipes.pod:354
5690 "The link below contains one technique for removing the Administrator "
5691 "password from a Windows VM, or to be more precise, it gives you a command "
5692 "prompt the next time you log in which you can use to bypass any security:"
5696 #: ../examples/guestfs-recipes.pod:359
5698 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
5699 "administrator-password-with-guestfish/"
5703 #: ../examples/guestfs-recipes.pod:361
5704 msgid "Unpack a live CD"
5708 #: ../examples/guestfs-recipes.pod:363
5710 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5711 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5712 "layers, as outlined in the guide below."
5716 #: ../examples/guestfs-recipes.pod:367
5718 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
5723 #: ../examples/guestfs-recipes.pod:369
5724 msgid "Uploading and downloading files"
5728 #: ../examples/guestfs-recipes.pod:371
5730 "The link below contains general tips on uploading (copying in) and "
5731 "downloading (copying out) files from VMs."
5735 #: ../examples/guestfs-recipes.pod:374
5737 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5741 #: ../examples/guestfs-recipes.pod:376
5742 msgid "Use libguestfs tools on VMware ESX guests"
5746 #: ../examples/guestfs-recipes.pod:378
5748 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5749 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5753 #: ../examples/guestfs-recipes.pod:382
5755 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
5760 #: ../examples/guestfs-recipes.pod:386
5762 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
5763 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
5764 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
5768 #: ../examples/guestfs-recipes.pod:403
5769 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5773 #: ../examples/guestfs-testing.pod:5
5774 msgid "guestfs-testing - manual testing of libguestfs, you can help!"
5778 #: ../examples/guestfs-testing.pod:9
5780 "This page has manual tests you can try on libguestfs. Everyone has a "
5781 "slightly different combination of platform, hardware and guests, so this "
5782 "testing is very valuable. Thanks for helping out!"
5786 #: ../examples/guestfs-testing.pod:13
5787 msgid "These tests require libguestfs E<ge> 1.14."
5791 #: ../examples/guestfs-testing.pod:15
5793 "Tests marked with a B<*> (asterisk) can B<destroy data> if you're not "
5794 "careful. The others are safe and won't modify anything."
5798 #: ../examples/guestfs-testing.pod:18
5799 msgid "You can report bugs you find through this link:"
5803 #: ../examples/guestfs-testing.pod:20
5805 "https://bugzilla.redhat.com/enter_bug.cgi?"
5806 "component=libguestfs&product=Virtualization+Tools"
5810 #: ../examples/guestfs-testing.pod:22
5812 "or post on the mailing list (registration is B<not> required, but if you're "
5813 "not registered then you'll have to wait for a moderator to manually approve "
5818 #: ../examples/guestfs-testing.pod:26
5819 msgid "https://www.redhat.com/mailman/listinfo/libguestfs"
5823 #: ../examples/guestfs-testing.pod:28
5828 #: ../examples/guestfs-testing.pod:30
5829 msgid "Check KVM acceleration is being used."
5833 #: ../examples/guestfs-testing.pod:32
5835 "If your host has hardware virt acceleration, then with a hot cache "
5836 "libguestfs should be able to start up in a few seconds. Run the following "
5837 "command a few times:"
5841 #: ../examples/guestfs-testing.pod:36
5844 " time guestfish -a /dev/null run\n"
5849 #: ../examples/guestfs-testing.pod:38
5851 "After a few runs, the time should settle down to a few seconds (under 5 "
5852 "seconds on fast 64 bit hardware)."
5856 #: ../examples/guestfs-testing.pod:41
5857 msgid "How to check for hardware virt:"
5861 #: ../examples/guestfs-testing.pod:43
5862 msgid "http://virt-tools.org/learning/check-hardware-virt/"
5866 #: ../examples/guestfs-testing.pod:45
5868 "If the command above does not work at all, use L<libguestfs-test-tool(1)>."
5872 #: ../examples/guestfs-testing.pod:48
5873 msgid "Run virt-alignment-scan on all your guests."
5877 #: ../examples/guestfs-testing.pod:50
5878 msgid "Run L<virt-alignment-scan(1)> on guests or disk images:"
5882 #: ../examples/guestfs-testing.pod:52
5885 " virt-alignment-scan -a /path/to/disk.img\n"
5890 #: ../examples/guestfs-testing.pod:54 ../examples/guestfs-testing.pod:139
5891 #: ../examples/guestfs-testing.pod:152 ../examples/guestfs-testing.pod:212
5892 #: ../src/guestfs.pod:2792
5897 #: ../examples/guestfs-testing.pod:56
5900 " virt-alignment-scan -d Guest\n"
5905 #: ../examples/guestfs-testing.pod:58
5906 msgid "Does the alignment report match how the guest partitions are aligned?"
5910 #: ../examples/guestfs-testing.pod:60
5911 msgid "Run virt-cat on some files in guests."
5915 #: ../examples/guestfs-testing.pod:62
5916 msgid "L<virt-cat(1)> can display files from guests. For a Linux guest, try:"
5920 #: ../examples/guestfs-testing.pod:64
5923 " virt-cat LinuxGuest /etc/passwd\n"
5928 #: ../examples/guestfs-testing.pod:66
5929 msgid "A recent feature is support for Windows paths, for example:"
5933 #: ../examples/guestfs-testing.pod:68
5936 " virt-cat WindowsGuest 'c:\\windows\\win.ini'\n"
5941 #: ../examples/guestfs-testing.pod:70
5943 "An even better test is if you have a Windows guest with multiple drives. Do "
5944 "C<D:>, C<E:> etc paths work correctly?"
5948 #: ../examples/guestfs-testing.pod:73
5949 msgid "B<*> Copy some files into a B<shut off> guest."
5953 #: ../examples/guestfs-testing.pod:75
5955 "L<virt-copy-in(1)> can recursively copy files and directories into a guest "
5960 #: ../examples/guestfs-testing.pod:78
5963 " virt-copy-in -d Guest /etc /tmp\n"
5968 #: ../examples/guestfs-testing.pod:80
5970 "This should copy local directory C</etc> to C</tmp/etc> in the guest "
5971 "(recursively). If you boot the guest, can you see all of the copied files "
5976 #: ../examples/guestfs-testing.pod:84
5977 msgid "Shut the guest down and try copying multiple files and directories:"
5981 #: ../examples/guestfs-testing.pod:86
5984 " virt-copy-in -d Guest /home /etc/issue /tmp\n"
5989 #: ../examples/guestfs-testing.pod:88
5990 msgid "Copy some files out of a guest."
5994 #: ../examples/guestfs-testing.pod:90
5996 "L<virt-copy-out(1)> can recursively copy files and directories out of a "
5997 "guest or disk image."
6001 #: ../examples/guestfs-testing.pod:95
6002 msgid "Note the final space and period in the command is not a typo."
6006 #: ../examples/guestfs-testing.pod:97
6007 msgid "This should copy C</home> from the guest into the current directory."
6011 #: ../examples/guestfs-testing.pod:99
6012 msgid "Run virt-df."
6016 #: ../examples/guestfs-testing.pod:101
6017 msgid "L<virt-df(1)> lists disk space. Run:"
6021 #: ../examples/guestfs-testing.pod:103
6029 #: ../examples/guestfs-testing.pod:105
6030 msgid "Do the results match what's reported inside the guests?"
6034 #: ../examples/guestfs-testing.pod:107
6035 msgid "Try importing virt-df CSV output into a spreadsheet or database."
6039 #: ../examples/guestfs-testing.pod:109 ../src/guestfs.pod:3083
6044 #: ../examples/guestfs-testing.pod:111
6047 " virt-df --csv > /tmp/report.csv\n"
6052 #: ../examples/guestfs-testing.pod:113
6054 "Now try to load this into your favorite spreadsheet or database. Are the "
6055 "results reproduced faithfully in the spreadsheet/database?"
6059 #: ../examples/guestfs-testing.pod:116
6061 "http://www.postgresql.org/docs/8.1/static/sql-copy.html http://dev.mysql.com/"
6062 "doc/refman/5.1/en/load-data.html"
6066 #: ../examples/guestfs-testing.pod:119
6067 msgid "B<*> Edit a file in a B<shut off> guest."
6071 #: ../examples/guestfs-testing.pod:121
6073 "L<virt-edit(1)> can edit files in guests. Try this command on a RHEL or "
6078 #: ../examples/guestfs-testing.pod:124
6081 " virt-edit LinuxGuest /etc/sysconfig/network\n"
6086 #: ../examples/guestfs-testing.pod:126
6087 msgid "On other Linux guests try editing other files such as:"
6091 #: ../examples/guestfs-testing.pod:128
6094 " virt-edit LinuxGuest /etc/motd\n"
6099 #: ../examples/guestfs-testing.pod:130
6100 msgid "Are the changes seen inside the guest when it is booted?"
6104 #: ../examples/guestfs-testing.pod:132
6105 msgid "Display the filesystems / partitions / LVs in a guest."
6109 #: ../examples/guestfs-testing.pod:134
6111 "L<virt-filesystems(1)> can be used to display filesystems in a guest. Try "
6112 "this command on any disk image or guest:"
6116 #: ../examples/guestfs-testing.pod:137
6119 " virt-filesystems -a /path/to/disk.img --all --long -h\n"
6124 #: ../examples/guestfs-testing.pod:141
6127 " virt-filesystems -d Guest --all --long -h\n"
6132 #: ../examples/guestfs-testing.pod:143
6133 msgid "Do the results match what is seen in the guest?"
6137 #: ../examples/guestfs-testing.pod:145
6138 msgid "Run virt-inspector on all your guests."
6142 #: ../examples/guestfs-testing.pod:147
6144 "Use L<virt-inspector(1)> to get a report on all of your guests or disk "
6149 #: ../examples/guestfs-testing.pod:150
6152 " virt-inspector -a /path/to/disk.img | less\n"
6157 #: ../examples/guestfs-testing.pod:154
6160 " virt-inspector -d Guest | less\n"
6165 #: ../examples/guestfs-testing.pod:156
6166 msgid "Do the results match what is actually in the guest?"
6170 #: ../examples/guestfs-testing.pod:158
6171 msgid "Try the auditing features of virt-ls on all your guests."
6175 #: ../examples/guestfs-testing.pod:162
6178 " virt-ls -lR -d Guest / | grep '^- [42]'\n"
6183 #: ../examples/guestfs-testing.pod:166
6186 " virt-ls -lR -d Guest / | grep '^d ...7'\n"
6191 #: ../examples/guestfs-testing.pod:170
6194 " virt-ls -lR -d Guest / | grep '^s'\n"
6199 #: ../examples/guestfs-testing.pod:174
6202 " virt-ls -lR -d Guest / | grep -i '^-.*\\.png$'\n"
6207 #: ../examples/guestfs-testing.pod:176
6208 msgid "Display files larger than 10MB in home directories:"
6212 #: ../examples/guestfs-testing.pod:178
6215 " virt-ls -lR -d Guest /home | awk '$3 > 10*1024*1024'\n"
6220 #: ../examples/guestfs-testing.pod:182
6223 " virt-ls -lR -d Guest --time-days / | awk '$6 <= 7'\n"
6228 #: ../examples/guestfs-testing.pod:186
6231 " virt-ls -lR -d Guest --time-days / | grep '^-' | awk '$6 < 1'\n"
6236 #: ../examples/guestfs-testing.pod:188
6237 msgid "Do the results match what is in the guest?"
6241 #: ../examples/guestfs-testing.pod:190
6242 msgid "Create a disk image from a tarball."
6246 #: ../examples/guestfs-testing.pod:192
6248 "Use L<virt-make-fs(1)> to create a disk image from any tarball that you "
6253 #: ../examples/guestfs-testing.pod:195
6256 " virt-make-fs --partition=mbr --type=vfat /any/tarball.tar.gz output.img\n"
6261 #: ../examples/guestfs-testing.pod:197
6263 "Add 'output.img' as a raw disk to an existing guest. Check the guest can "
6264 "see the files. This test is particularly useful if you try it with a "
6269 #: ../examples/guestfs-testing.pod:201
6270 msgid "Try other partitioning schemes, eg. I<--partition=gpt>."
6274 #: ../examples/guestfs-testing.pod:203
6275 msgid "Try other filesystem formats, eg. I<--type=ntfs>, I<--type=ext2>."
6279 #: ../examples/guestfs-testing.pod:205
6280 msgid "B<*> Run virt-rescue on a B<shut off> disk image or guest."
6284 #: ../examples/guestfs-testing.pod:207
6286 "Use L<virt-rescue(1)> to examine, rescue or repair a B<shut off> guest or "
6291 #: ../examples/guestfs-testing.pod:210
6294 " virt-rescue -a /path/to/disk.img\n"
6299 #: ../examples/guestfs-testing.pod:214
6302 " virt-rescue -d Guest\n"
6307 #: ../examples/guestfs-testing.pod:216
6308 msgid "Can you use ordinary shell commands to examine the guest?"
6312 #: ../examples/guestfs-testing.pod:218
6313 msgid "B<*> Resize your guests."
6317 #: ../examples/guestfs-testing.pod:220
6319 "Use L<virt-resize(1)> to give a guest some more disk space. For example, if "
6320 "you have a disk image that is smaller than 30G, increase it to 30G by doing:"
6324 #: ../examples/guestfs-testing.pod:224
6327 " truncate -s 30G newdisk.img\n"
6328 " virt-filesystems -a /path/to/olddisk.img --all --long -h\n"
6329 " virt-resize /path/to/olddisk.img newdisk.img --expand /dev/sda1\n"
6330 " qemu-kvm -m 1024 -hda newdisk.img\n"
6335 #: ../examples/guestfs-testing.pod:229
6336 msgid "Does the guest still boot? Try expanding other partitions."
6340 #: ../examples/guestfs-testing.pod:231
6341 msgid "B<*> Sparsify a guest disk."
6345 #: ../examples/guestfs-testing.pod:233
6346 msgid "Using L<virt-sparsify(1)>, make a disk image more sparse:"
6350 #: ../examples/guestfs-testing.pod:235
6353 " virt-sparsify /path/to/olddisk.img newdisk.img\n"
6358 #: ../examples/guestfs-testing.pod:237
6360 "Is C<newdisk.img> still bootable after sparsifying? Is the resulting disk "
6361 "image smaller (use C<du> to check)?"
6365 #: ../examples/guestfs-testing.pod:240
6366 msgid "B<*> \"sysprep\" a B<shut off> Linux guest."
6370 #: ../examples/guestfs-testing.pod:242
6372 "Note that this really will mess up an existing guest, so it's better to "
6373 "clone the guest before trying this."
6377 #: ../examples/guestfs-testing.pod:245
6380 " virt-sysprep --hostname newhost.example.com -a /path/to/disk.img\n"
6385 #: ../examples/guestfs-testing.pod:247
6387 "Was the sysprep successful? After booting, what changes were made and were "
6392 #: ../examples/guestfs-testing.pod:250
6393 msgid "Dump the Windows Registry from your Windows guests."
6397 #: ../examples/guestfs-testing.pod:252
6399 "Use L<virt-win-reg(1)> to dump out the Windows Registry from any Windows "
6400 "guests that you have."
6404 #: ../examples/guestfs-testing.pod:255
6407 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\Software' |\n"
6413 #: ../examples/guestfs-testing.pod:258
6416 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\System' |\n"
6422 #: ../examples/guestfs-testing.pod:261
6423 msgid "Does the output match running C<regedit> inside the guest?"
6427 #: ../examples/guestfs-testing.pod:263
6429 "A recent feature is the ability to dump user registries, so try this, "
6430 "replacing I<username> with the name of a local user in the guest:"
6434 #: ../examples/guestfs-testing.pod:266
6437 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKEY_USERS\\username' |\n"
6443 #: ../examples/guestfs-testing.pod:271
6445 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<http://libguestfs."
6450 #: ../fish/guestfish-actions.pod:1
6455 #: ../fish/guestfish-actions.pod:3
6458 " add-cdrom filename\n"
6463 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
6464 msgid "This function adds a virtual CD-ROM disk image to the guest."
6468 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
6469 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
6473 #: ../fish/guestfish-actions.pod:15
6475 "This call checks for the existence of C<filename>. This stops you from "
6476 "specifying other types of drive which are supported by qemu such as C<nbd:> "
6477 "and C<http:> URLs. To specify those, use the general L</config> call "
6482 #: ../fish/guestfish-actions.pod:22
6484 "If you just want to add an ISO file (often you use this as an efficient way "
6485 "to transfer large files into the guest), then you should probably use L</add-"
6486 "drive-ro> instead."
6490 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:214
6491 #: ../fish/guestfish-actions.pod:228
6493 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
6498 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:217
6499 #: ../fish/guestfish-actions.pod:231 ../fish/guestfish-actions.pod:941
6500 #: ../fish/guestfish-actions.pod:976 ../fish/guestfish-actions.pod:1149
6501 #: ../fish/guestfish-actions.pod:1509 ../fish/guestfish-actions.pod:1523
6502 #: ../fish/guestfish-actions.pod:3381 ../fish/guestfish-actions.pod:3692
6503 #: ../fish/guestfish-actions.pod:3740 ../fish/guestfish-actions.pod:4658
6504 #: ../fish/guestfish-actions.pod:4678 ../fish/guestfish-actions.pod:4697
6505 #: ../fish/guestfish-actions.pod:4735 ../fish/guestfish-actions.pod:5463
6506 #: ../fish/guestfish-actions.pod:5566 ../src/guestfs-actions.pod:10
6507 #: ../src/guestfs-actions.pod:305 ../src/guestfs-actions.pod:326
6508 #: ../src/guestfs-actions.pod:1580 ../src/guestfs-actions.pod:1637
6509 #: ../src/guestfs-actions.pod:1920 ../src/guestfs-actions.pod:2419
6510 #: ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:5225
6511 #: ../src/guestfs-actions.pod:5747 ../src/guestfs-actions.pod:5847
6512 #: ../src/guestfs-actions.pod:7143 ../src/guestfs-actions.pod:7184
6513 #: ../src/guestfs-actions.pod:7215 ../src/guestfs-actions.pod:7275
6514 #: ../src/guestfs-actions.pod:8327 ../src/guestfs-actions.pod:8436
6515 #: ../src/guestfs-actions.pod:8616
6517 "Deprecated functions will not be removed from the API, but the fact that "
6518 "they are deprecated indicates that there are problems with correct use of "
6523 #: ../fish/guestfish-actions.pod:35
6528 #: ../fish/guestfish-actions.pod:37
6533 #: ../fish/guestfish-actions.pod:39
6536 " add-domain dom [libvirturi:..] [readonly:true|false] [iface:..] [live:true|false] [allowuuid:true|false] [readonlydisk:..]\n"
6541 #: ../fish/guestfish-actions.pod:41
6543 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
6544 "It works by connecting to libvirt, requesting the domain and domain XML from "
6545 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
6549 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:65
6551 "The number of disks added is returned. This operation is atomic: if an "
6552 "error is returned, then no disks are added."
6556 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:68
6558 "This function does some minimal checks to make sure the libvirt domain is "
6559 "not running (unless C<readonly> is true). In a future version we will try "
6560 "to acquire the libvirt lock on each disk."
6564 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:72
6566 "Disks must be accessible locally. This often means that adding disks from a "
6567 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6568 "unless those disks are accessible via the same device path locally too."
6572 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:77
6574 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
6575 "libvirt.org/uri.html>). If this is not set then we connect to the default "
6576 "libvirt URI (or one set through an environment variable, see the libvirt "
6577 "documentation for full details)."
6581 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:83
6583 "The optional C<live> flag controls whether this call will try to connect to "
6584 "a running virtual machine C<guestfsd> process if it sees a suitable "
6585 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6586 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6587 "DAEMONS> for more information."
6591 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:90
6593 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
6594 "passed instead of the domain name. The C<dom> string is treated as a UUID "
6595 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
6600 #: ../fish/guestfish-actions.pod:76 ../src/guestfs-actions.pod:95
6602 "The optional C<readonlydisk> parameter controls what we do for disks which "
6603 "are marked E<lt>readonly/E<gt> in the libvirt XML. Possible values are:"
6607 #: ../fish/guestfish-actions.pod:82 ../src/guestfs-actions.pod:101
6608 msgid "readonlydisk = \"error\""
6612 #: ../fish/guestfish-actions.pod:84 ../fish/guestfish-actions.pod:95
6613 #: ../fish/guestfish-actions.pod:106 ../src/guestfs-actions.pod:103
6614 #: ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:125
6615 msgid "If C<readonly> is false:"
6619 #: ../fish/guestfish-actions.pod:86 ../src/guestfs-actions.pod:105
6621 "The whole call is aborted with an error if any disk with the E<lt>readonly/"
6622 "E<gt> flag is found."
6626 #: ../fish/guestfish-actions.pod:89 ../fish/guestfish-actions.pod:100
6627 #: ../fish/guestfish-actions.pod:110 ../src/guestfs-actions.pod:108
6628 #: ../src/guestfs-actions.pod:119 ../src/guestfs-actions.pod:129
6629 msgid "If C<readonly> is true:"
6633 #: ../fish/guestfish-actions.pod:91 ../fish/guestfish-actions.pod:102
6634 #: ../fish/guestfish-actions.pod:112 ../src/guestfs-actions.pod:110
6635 #: ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:131
6636 msgid "Disks with the E<lt>readonly/E<gt> flag are added read-only."
6640 #: ../fish/guestfish-actions.pod:93 ../src/guestfs-actions.pod:112
6641 msgid "readonlydisk = \"read\""
6645 #: ../fish/guestfish-actions.pod:97 ../src/guestfs-actions.pod:116
6647 "Disks with the E<lt>readonly/E<gt> flag are added read-only. Other disks "
6648 "are added read/write."
6652 #: ../fish/guestfish-actions.pod:104 ../src/guestfs-actions.pod:123
6653 msgid "readonlydisk = \"write\" (default)"
6657 #: ../fish/guestfish-actions.pod:108 ../src/guestfs-actions.pod:127
6658 msgid "Disks with the E<lt>readonly/E<gt> flag are added read/write."
6662 #: ../fish/guestfish-actions.pod:114 ../src/guestfs-actions.pod:133
6663 msgid "readonlydisk = \"ignore\""
6667 #: ../fish/guestfish-actions.pod:116 ../src/guestfs-actions.pod:135
6668 msgid "If C<readonly> is true or false:"
6672 #: ../fish/guestfish-actions.pod:118 ../src/guestfs-actions.pod:137
6673 msgid "Disks with the E<lt>readonly/E<gt> flag are skipped."
6677 #: ../fish/guestfish-actions.pod:122
6679 "The other optional parameters are passed directly through to L</add-drive-"
6684 #: ../fish/guestfish-actions.pod:125 ../fish/guestfish-actions.pod:194
6685 #: ../fish/guestfish-actions.pod:624 ../fish/guestfish-actions.pod:835
6686 #: ../fish/guestfish-actions.pod:856 ../fish/guestfish-actions.pod:894
6687 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:912
6688 #: ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:2171
6689 #: ../fish/guestfish-actions.pod:3215 ../fish/guestfish-actions.pod:3430
6690 #: ../fish/guestfish-actions.pod:3593 ../fish/guestfish-actions.pod:3728
6691 #: ../fish/guestfish-actions.pod:5099
6693 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
6697 #: ../fish/guestfish-actions.pod:127
6702 #: ../fish/guestfish-actions.pod:129
6705 " add-drive filename\n"
6710 #: ../fish/guestfish-actions.pod:131
6712 "This function is the equivalent of calling L</add-drive-opts> with no "
6713 "optional parameters, so the disk is added writable, with the format being "
6714 "detected automatically."
6718 #: ../fish/guestfish-actions.pod:135
6720 "Automatic detection of the format opens you up to a potential security hole "
6721 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6722 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6723 "you should think about replacing calls to this function with calls to L</add-"
6724 "drive-opts>, and specifying the format."
6728 #: ../fish/guestfish-actions.pod:142
6729 msgid "add-drive-opts"
6733 #: ../fish/guestfish-actions.pod:144
6738 #: ../fish/guestfish-actions.pod:146
6741 " add-drive-opts filename [readonly:true|false] [format:..] [iface:..] [name:..]\n"
6746 #: ../fish/guestfish-actions.pod:148 ../src/guestfs-actions.pod:208
6748 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6749 "The first time you call this function, the disk appears as C</dev/sda>, the "
6750 "second time as C</dev/sdb>, and so on."
6754 #: ../fish/guestfish-actions.pod:153 ../src/guestfs-actions.pod:213
6756 "You don't necessarily need to be root when using libguestfs. However you "
6757 "obviously do need sufficient permissions to access the filename for whatever "
6758 "operations you want to perform (ie. read access if you just want to read the "
6759 "image or write access if you want to modify the image)."
6763 #: ../fish/guestfish-actions.pod:159 ../src/guestfs-actions.pod:219
6764 msgid "This call checks that C<filename> exists."
6768 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:3392
6769 #: ../src/guestfs-actions.pod:221 ../src/guestfs-actions.pod:5262
6770 msgid "The optional arguments are:"
6774 #: ../fish/guestfish-actions.pod:165 ../src/guestfs-actions.pod:225
6779 #: ../fish/guestfish-actions.pod:167 ../src/guestfs-actions.pod:227
6781 "If true then the image is treated as read-only. Writes are still allowed, "
6782 "but they are stored in a temporary snapshot overlay which is discarded at "
6783 "the end. The disk that you add is not modified."
6787 #: ../fish/guestfish-actions.pod:171 ../src/guestfs-actions.pod:231
6792 #: ../fish/guestfish-actions.pod:173
6794 "This forces the image format. If you omit this (or use L</add-drive> or L</"
6795 "add-drive-ro>) then the format is automatically detected. Possible formats "
6796 "include C<raw> and C<qcow2>."
6800 #: ../fish/guestfish-actions.pod:177 ../src/guestfs-actions.pod:237
6802 "Automatic detection of the format opens you up to a potential security hole "
6803 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6804 "RHBZ#642934. Specifying the format closes this security hole."
6808 #: ../fish/guestfish-actions.pod:182 ../src/guestfs-actions.pod:242
6813 #: ../fish/guestfish-actions.pod:184
6815 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
6816 "add-drive-with-if> call (q.v.)"
6820 #: ../fish/guestfish-actions.pod:187 ../fish/guestfish-actions.pod:3242
6821 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:4994
6826 #: ../fish/guestfish-actions.pod:189 ../src/guestfs-actions.pod:249
6828 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6829 "a hint to the guest inspection process if it is available."
6833 #: ../fish/guestfish-actions.pod:196
6834 msgid "add-drive-ro"
6838 #: ../fish/guestfish-actions.pod:198
6843 #: ../fish/guestfish-actions.pod:200
6846 " add-drive-ro filename\n"
6851 #: ../fish/guestfish-actions.pod:202
6853 "This function is the equivalent of calling L</add-drive-opts> with the "
6854 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6855 "is added read-only, with the format being detected automatically."
6859 #: ../fish/guestfish-actions.pod:207
6860 msgid "add-drive-ro-with-if"
6864 #: ../fish/guestfish-actions.pod:209
6867 " add-drive-ro-with-if filename iface\n"
6872 #: ../fish/guestfish-actions.pod:211
6874 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6875 "interface emulation to use at run time."
6879 #: ../fish/guestfish-actions.pod:221
6880 msgid "add-drive-with-if"
6884 #: ../fish/guestfish-actions.pod:223
6887 " add-drive-with-if filename iface\n"
6892 #: ../fish/guestfish-actions.pod:225
6894 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6895 "interface emulation to use at run time."
6899 #: ../fish/guestfish-actions.pod:235
6904 #: ../fish/guestfish-actions.pod:237
6907 " aug-clear augpath\n"
6912 #: ../fish/guestfish-actions.pod:239 ../src/guestfs-actions.pod:343
6914 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6915 "L<augtool(1)> C<clear> command."
6919 #: ../fish/guestfish-actions.pod:242
6924 #: ../fish/guestfish-actions.pod:244
6932 #: ../fish/guestfish-actions.pod:246
6934 "Close the current Augeas handle and free up any resources used by it. After "
6935 "calling this, you have to call L</aug-init> again before you can use any "
6936 "other Augeas functions."
6940 #: ../fish/guestfish-actions.pod:251
6945 #: ../fish/guestfish-actions.pod:253
6948 " aug-defnode name expr val\n"
6953 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:372
6955 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6959 #: ../fish/guestfish-actions.pod:258
6961 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6962 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6963 "containing that single node."
6967 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:379
6969 "On success this returns a pair containing the number of nodes in the "
6970 "nodeset, and a boolean flag if a node was created."
6974 #: ../fish/guestfish-actions.pod:266
6979 #: ../fish/guestfish-actions.pod:268
6982 " aug-defvar name expr\n"
6987 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:396
6989 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6990 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6994 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:400
6996 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6997 "evaluates to something which is not a nodeset."
7001 #: ../fish/guestfish-actions.pod:277
7006 #: ../fish/guestfish-actions.pod:279
7009 " aug-get augpath\n"
7014 #: ../fish/guestfish-actions.pod:281 ../src/guestfs-actions.pod:413
7016 "Look up the value associated with C<path>. If C<path> matches exactly one "
7017 "node, the C<value> is returned."
7021 #: ../fish/guestfish-actions.pod:284
7026 #: ../fish/guestfish-actions.pod:286
7029 " aug-init root flags\n"
7034 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:428
7036 "Create a new Augeas handle for editing configuration files. If there was "
7037 "any previous Augeas handle associated with this guestfs session, then it is "
7042 #: ../fish/guestfish-actions.pod:292
7043 msgid "You must call this before using any other L</aug-*> commands."
7047 #: ../fish/guestfish-actions.pod:295 ../src/guestfs-actions.pod:435
7049 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
7053 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:438
7055 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
7056 "logical I<or> of the following integers:"
7060 #: ../fish/guestfish-actions.pod:304 ../src/guestfs-actions.pod:444
7061 msgid "C<AUG_SAVE_BACKUP> = 1"
7065 #: ../fish/guestfish-actions.pod:306 ../src/guestfs-actions.pod:446
7066 msgid "Keep the original file with a C<.augsave> extension."
7070 #: ../fish/guestfish-actions.pod:308 ../src/guestfs-actions.pod:448
7071 msgid "C<AUG_SAVE_NEWFILE> = 2"
7075 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:450
7077 "Save changes into a file with extension C<.augnew>, and do not overwrite "
7078 "original. Overrides C<AUG_SAVE_BACKUP>."
7082 #: ../fish/guestfish-actions.pod:313 ../src/guestfs-actions.pod:453
7083 msgid "C<AUG_TYPE_CHECK> = 4"
7087 #: ../fish/guestfish-actions.pod:315 ../src/guestfs-actions.pod:455
7088 msgid "Typecheck lenses."
7092 #: ../fish/guestfish-actions.pod:317
7094 "This option is only useful when debugging Augeas lenses. Use of this option "
7095 "may require additional memory for the libguestfs appliance. You may need to "
7096 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
7100 #: ../fish/guestfish-actions.pod:322 ../src/guestfs-actions.pod:462
7101 msgid "C<AUG_NO_STDINC> = 8"
7105 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:464
7106 msgid "Do not use standard load path for modules."
7110 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:466
7111 msgid "C<AUG_SAVE_NOOP> = 16"
7115 #: ../fish/guestfish-actions.pod:328 ../src/guestfs-actions.pod:468
7116 msgid "Make save a no-op, just record what would have been changed."
7120 #: ../fish/guestfish-actions.pod:330 ../src/guestfs-actions.pod:470
7121 msgid "C<AUG_NO_LOAD> = 32"
7125 #: ../fish/guestfish-actions.pod:332
7126 msgid "Do not load the tree in L</aug-init>."
7130 #: ../fish/guestfish-actions.pod:336
7131 msgid "To close the handle, you can call L</aug-close>."
7135 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:478
7136 msgid "To find out more about Augeas, see L<http://augeas.net/>."
7140 #: ../fish/guestfish-actions.pod:340
7145 #: ../fish/guestfish-actions.pod:342
7148 " aug-insert augpath label true|false\n"
7153 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:492
7155 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
7156 "or after C<path> (depending on the boolean flag C<before>)."
7160 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:496
7162 "C<path> must match exactly one existing node in the tree, and C<label> must "
7163 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
7167 #: ../fish/guestfish-actions.pod:352
7172 #: ../fish/guestfish-actions.pod:354
7180 #: ../fish/guestfish-actions.pod:356 ../src/guestfs-actions.pod:509
7181 msgid "Load files into the tree."
7185 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:511
7186 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
7190 #: ../fish/guestfish-actions.pod:361
7195 #: ../fish/guestfish-actions.pod:363
7203 #: ../fish/guestfish-actions.pod:365
7205 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
7206 "resulting nodes into alphabetical order."
7210 #: ../fish/guestfish-actions.pod:368
7215 #: ../fish/guestfish-actions.pod:370
7218 " aug-match augpath\n"
7223 #: ../fish/guestfish-actions.pod:372 ../src/guestfs-actions.pod:539
7225 "Returns a list of paths which match the path expression C<path>. The "
7226 "returned paths are sufficiently qualified so that they match exactly one "
7227 "node in the current tree."
7231 #: ../fish/guestfish-actions.pod:376
7236 #: ../fish/guestfish-actions.pod:378
7239 " aug-mv src dest\n"
7244 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:556
7246 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
7247 "C<dest> is overwritten if it exists."
7251 #: ../fish/guestfish-actions.pod:383
7256 #: ../fish/guestfish-actions.pod:385
7264 #: ../fish/guestfish-actions.pod:387 ../src/guestfs-actions.pod:569
7265 msgid "Remove C<path> and all of its children."
7269 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:571
7270 msgid "On success this returns the number of entries which were removed."
7274 #: ../fish/guestfish-actions.pod:391
7279 #: ../fish/guestfish-actions.pod:393
7287 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:582
7288 msgid "This writes all pending changes to disk."
7292 #: ../fish/guestfish-actions.pod:397
7294 "The flags which were passed to L</aug-init> affect exactly how files are "
7299 #: ../fish/guestfish-actions.pod:400
7304 #: ../fish/guestfish-actions.pod:402
7307 " aug-set augpath val\n"
7312 #: ../fish/guestfish-actions.pod:404 ../src/guestfs-actions.pod:598
7313 msgid "Set the value associated with C<path> to C<val>."
7317 #: ../fish/guestfish-actions.pod:406
7319 "In the Augeas API, it is possible to clear a node by setting the value to "
7320 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
7321 "this call. Instead you must use the L</aug-clear> call."
7325 #: ../fish/guestfish-actions.pod:411
7330 #: ../fish/guestfish-actions.pod:413
7333 " available 'groups ...'\n"
7338 #: ../fish/guestfish-actions.pod:415 ../src/guestfs-actions.pod:615
7340 "This command is used to check the availability of some groups of "
7341 "functionality in the appliance, which not all builds of the libguestfs "
7342 "appliance will be able to provide."
7346 #: ../fish/guestfish-actions.pod:419
7348 "The libguestfs groups, and the functions that those groups correspond to, "
7349 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
7350 "runtime by calling L</available-all-groups>."
7354 #: ../fish/guestfish-actions.pod:424 ../src/guestfs-actions.pod:624
7356 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
7357 "\"]> would check for the availability of the Linux inotify functions and "
7358 "Augeas (configuration file editing) functions."
7362 #: ../fish/guestfish-actions.pod:429 ../src/guestfs-actions.pod:629
7363 msgid "The command returns no error if I<all> requested groups are available."
7367 #: ../fish/guestfish-actions.pod:431 ../src/guestfs-actions.pod:631
7369 "It fails with an error if one or more of the requested groups is unavailable "
7374 #: ../fish/guestfish-actions.pod:434 ../src/guestfs-actions.pod:634
7376 "If an unknown group name is included in the list of groups then an error is "
7381 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:637
7386 #: ../fish/guestfish-actions.pod:443
7387 msgid "You must call L</launch> before calling this function."
7391 #: ../fish/guestfish-actions.pod:445 ../src/guestfs-actions.pod:645
7393 "The reason is because we don't know what groups are supported by the "
7394 "appliance/daemon until it is running and can be queried."
7398 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:651
7400 "If a group of functions is available, this does not necessarily mean that "
7401 "they will work. You still have to check for errors when calling individual "
7402 "API functions even if they are available."
7406 #: ../fish/guestfish-actions.pod:458 ../src/guestfs-actions.pod:658
7408 "It is usually the job of distro packagers to build complete functionality "
7409 "into the libguestfs appliance. Upstream libguestfs, if built from source "
7410 "with all requirements satisfied, will support everything."
7414 #: ../fish/guestfish-actions.pod:465
7416 "This call was added in version C<1.0.80>. In previous versions of "
7417 "libguestfs all you could do would be to speculatively execute a command to "
7418 "find out if the daemon implemented it. See also L</version>."
7422 #: ../fish/guestfish-actions.pod:472
7423 msgid "available-all-groups"
7427 #: ../fish/guestfish-actions.pod:474
7430 " available-all-groups\n"
7435 #: ../fish/guestfish-actions.pod:476
7437 "This command returns a list of all optional groups that this daemon knows "
7438 "about. Note this returns both supported and unsupported groups. To find "
7439 "out which ones the daemon can actually support you have to call L</"
7440 "available> on each member of the returned list."
7444 #: ../fish/guestfish-actions.pod:482
7445 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
7449 #: ../fish/guestfish-actions.pod:484
7454 #: ../fish/guestfish-actions.pod:486
7457 " base64-in (base64file|-) filename\n"
7462 #: ../fish/guestfish-actions.pod:488 ../src/guestfs-actions.pod:702
7464 "This command uploads base64-encoded data from C<base64file> to C<filename>."
7468 #: ../fish/guestfish-actions.pod:491 ../fish/guestfish-actions.pod:500
7469 #: ../fish/guestfish-actions.pod:749 ../fish/guestfish-actions.pod:833
7470 #: ../fish/guestfish-actions.pod:854 ../fish/guestfish-actions.pod:1025
7471 #: ../fish/guestfish-actions.pod:1044 ../fish/guestfish-actions.pod:1418
7472 #: ../fish/guestfish-actions.pod:4955 ../fish/guestfish-actions.pod:4967
7473 #: ../fish/guestfish-actions.pod:4978 ../fish/guestfish-actions.pod:4989
7474 #: ../fish/guestfish-actions.pod:5120 ../fish/guestfish-actions.pod:5129
7475 #: ../fish/guestfish-actions.pod:5183 ../fish/guestfish-actions.pod:5206
7476 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
7480 #: ../fish/guestfish-actions.pod:493
7485 #: ../fish/guestfish-actions.pod:495
7488 " base64-out filename (base64file|-)\n"
7493 #: ../fish/guestfish-actions.pod:497 ../src/guestfs-actions.pod:716
7495 "This command downloads the contents of C<filename>, writing it out to local "
7496 "file C<base64file> encoded as base64."
7500 #: ../fish/guestfish-actions.pod:502
7501 msgid "blockdev-flushbufs"
7505 #: ../fish/guestfish-actions.pod:504
7508 " blockdev-flushbufs device\n"
7513 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:729
7515 "This tells the kernel to flush internal buffers associated with C<device>."
7519 #: ../fish/guestfish-actions.pod:509 ../fish/guestfish-actions.pod:520
7520 #: ../fish/guestfish-actions.pod:529 ../fish/guestfish-actions.pod:539
7521 #: ../fish/guestfish-actions.pod:551 ../fish/guestfish-actions.pod:564
7522 #: ../fish/guestfish-actions.pod:572 ../fish/guestfish-actions.pod:583
7523 #: ../fish/guestfish-actions.pod:591 ../fish/guestfish-actions.pod:599
7524 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:749
7525 #: ../src/guestfs-actions.pod:764 ../src/guestfs-actions.pod:780
7526 #: ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:817
7527 #: ../src/guestfs-actions.pod:831 ../src/guestfs-actions.pod:849
7528 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:877
7529 msgid "This uses the L<blockdev(8)> command."
7533 #: ../fish/guestfish-actions.pod:511
7534 msgid "blockdev-getbsz"
7538 #: ../fish/guestfish-actions.pod:513
7541 " blockdev-getbsz device\n"
7546 #: ../fish/guestfish-actions.pod:515 ../src/guestfs-actions.pod:744
7547 msgid "This returns the block size of a device."
7551 #: ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:580
7552 #: ../src/guestfs-actions.pod:746 ../src/guestfs-actions.pod:846
7554 "(Note this is different from both I<size in blocks> and I<filesystem block "
7559 #: ../fish/guestfish-actions.pod:522
7560 msgid "blockdev-getro"
7564 #: ../fish/guestfish-actions.pod:524
7567 " blockdev-getro device\n"
7572 #: ../fish/guestfish-actions.pod:526 ../src/guestfs-actions.pod:761
7574 "Returns a boolean indicating if the block device is read-only (true if read-"
7575 "only, false if not)."
7579 #: ../fish/guestfish-actions.pod:531
7580 msgid "blockdev-getsize64"
7584 #: ../fish/guestfish-actions.pod:533
7587 " blockdev-getsize64 device\n"
7592 #: ../fish/guestfish-actions.pod:535 ../src/guestfs-actions.pod:776
7593 msgid "This returns the size of the device in bytes."
7597 #: ../fish/guestfish-actions.pod:537
7598 msgid "See also L</blockdev-getsz>."
7602 #: ../fish/guestfish-actions.pod:541
7603 msgid "blockdev-getss"
7607 #: ../fish/guestfish-actions.pod:543
7610 " blockdev-getss device\n"
7615 #: ../fish/guestfish-actions.pod:545 ../src/guestfs-actions.pod:792
7617 "This returns the size of sectors on a block device. Usually 512, but can be "
7618 "larger for modern devices."
7622 #: ../fish/guestfish-actions.pod:548
7624 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
7628 #: ../fish/guestfish-actions.pod:553
7629 msgid "blockdev-getsz"
7633 #: ../fish/guestfish-actions.pod:555
7636 " blockdev-getsz device\n"
7641 #: ../fish/guestfish-actions.pod:557 ../src/guestfs-actions.pod:810
7643 "This returns the size of the device in units of 512-byte sectors (even if "
7644 "the sectorsize isn't 512 bytes ... weird)."
7648 #: ../fish/guestfish-actions.pod:560
7650 "See also L</blockdev-getss> for the real sector size of the device, and L</"
7651 "blockdev-getsize64> for the more useful I<size in bytes>."
7655 #: ../fish/guestfish-actions.pod:566
7656 msgid "blockdev-rereadpt"
7660 #: ../fish/guestfish-actions.pod:568
7663 " blockdev-rereadpt device\n"
7668 #: ../fish/guestfish-actions.pod:570 ../src/guestfs-actions.pod:829
7669 msgid "Reread the partition table on C<device>."
7673 #: ../fish/guestfish-actions.pod:574
7674 msgid "blockdev-setbsz"
7678 #: ../fish/guestfish-actions.pod:576
7681 " blockdev-setbsz device blocksize\n"
7686 #: ../fish/guestfish-actions.pod:578 ../src/guestfs-actions.pod:844
7687 msgid "This sets the block size of a device."
7691 #: ../fish/guestfish-actions.pod:585
7692 msgid "blockdev-setro"
7696 #: ../fish/guestfish-actions.pod:587
7699 " blockdev-setro device\n"
7704 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:861
7705 msgid "Sets the block device named C<device> to read-only."
7709 #: ../fish/guestfish-actions.pod:593
7710 msgid "blockdev-setrw"
7714 #: ../fish/guestfish-actions.pod:595
7717 " blockdev-setrw device\n"
7722 #: ../fish/guestfish-actions.pod:597 ../src/guestfs-actions.pod:875
7723 msgid "Sets the block device named C<device> to read-write."
7727 #: ../fish/guestfish-actions.pod:601
7728 msgid "btrfs-filesystem-resize"
7732 #: ../fish/guestfish-actions.pod:603
7735 " btrfs-filesystem-resize mountpoint [size:N]\n"
7740 #: ../fish/guestfish-actions.pod:605 ../src/guestfs-actions.pod:897
7741 msgid "This command resizes a btrfs filesystem."
7745 #: ../fish/guestfish-actions.pod:607 ../src/guestfs-actions.pod:899
7747 "Note that unlike other resize calls, the filesystem has to be mounted and "
7748 "the parameter is the mountpoint not the device (this is a requirement of "
7753 #: ../fish/guestfish-actions.pod:611 ../fish/guestfish-actions.pod:3164
7754 #: ../fish/guestfish-actions.pod:3703 ../fish/guestfish-actions.pod:5029
7755 #: ../src/guestfs-actions.pod:903 ../src/guestfs-actions.pod:4890
7756 #: ../src/guestfs-actions.pod:5786 ../src/guestfs-actions.pod:7762
7757 msgid "The optional parameters are:"
7761 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3707
7762 #: ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:5790
7767 #: ../fish/guestfish-actions.pod:617 ../src/guestfs-actions.pod:909
7769 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
7770 "resized to the maximum size."
7774 #: ../fish/guestfish-actions.pod:622 ../src/guestfs-actions.pod:914
7775 msgid "See also L<btrfs(8)>."
7779 #: ../fish/guestfish-actions.pod:626
7780 msgid "case-sensitive-path"
7784 #: ../fish/guestfish-actions.pod:628
7787 " case-sensitive-path path\n"
7792 #: ../fish/guestfish-actions.pod:630 ../src/guestfs-actions.pod:948
7794 "This can be used to resolve case insensitive paths on a filesystem which is "
7795 "case sensitive. The use case is to resolve paths which you have read from "
7796 "Windows configuration files or the Windows Registry, to the true path."
7800 #: ../fish/guestfish-actions.pod:635 ../src/guestfs-actions.pod:953
7802 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7803 "(and probably others), which is that although the underlying filesystem is "
7804 "case-insensitive, the driver exports the filesystem to Linux as case-"
7809 #: ../fish/guestfish-actions.pod:640 ../src/guestfs-actions.pod:958
7811 "One consequence of this is that special directories such as C<c:\\windows> "
7812 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7813 "precise details of how they were created. In Windows itself this would not "
7818 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:964
7820 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
7825 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:967
7827 "This function resolves the true case of each element in the path and returns "
7828 "the case-sensitive path."
7832 #: ../fish/guestfish-actions.pod:652
7834 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
7835 "WINDOWS/system32\"> (the exact return value would depend on details of how "
7836 "the directories were originally created under Windows)."
7840 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:975
7841 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7845 #: ../fish/guestfish-actions.pod:660
7846 msgid "See also L</realpath>."
7850 #: ../fish/guestfish-actions.pod:662
7855 #: ../fish/guestfish-actions.pod:664
7863 #: ../fish/guestfish-actions.pod:666 ../fish/guestfish-actions.pod:4134
7864 #: ../src/guestfs-actions.pod:991 ../src/guestfs-actions.pod:6446
7865 msgid "Return the contents of the file named C<path>."
7869 #: ../fish/guestfish-actions.pod:668
7871 "Note that this function cannot correctly handle binary files (specifically, "
7872 "files containing C<\\0> character which is treated as end of string). For "
7873 "those you need to use the L</read-file> or L</download> functions which have "
7874 "a more complex interface."
7878 #: ../fish/guestfish-actions.pod:673 ../fish/guestfish-actions.pod:808
7879 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:1103
7880 #: ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1180
7881 #: ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1382
7882 #: ../fish/guestfish-actions.pod:1695 ../fish/guestfish-actions.pod:1705
7883 #: ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1770
7884 #: ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1799
7885 #: ../fish/guestfish-actions.pod:4004 ../fish/guestfish-actions.pod:4019
7886 #: ../fish/guestfish-actions.pod:4095 ../fish/guestfish-actions.pod:4112
7887 #: ../fish/guestfish-actions.pod:4127 ../fish/guestfish-actions.pod:4796
7888 #: ../fish/guestfish-actions.pod:4842 ../fish/guestfish-actions.pod:4927
7889 #: ../fish/guestfish-actions.pod:4942 ../fish/guestfish-actions.pod:5427
7890 #: ../fish/guestfish-actions.pod:5439 ../fish/guestfish-actions.pod:5457
7891 #: ../fish/guestfish-actions.pod:5474 ../fish/guestfish-actions.pod:5484
7892 #: ../fish/guestfish-actions.pod:5538 ../fish/guestfish-actions.pod:5548
7893 #: ../fish/guestfish-actions.pod:5577 ../fish/guestfish-actions.pod:5587
7894 #: ../src/guestfs-actions.pod:1001 ../src/guestfs-actions.pod:1180
7895 #: ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1855
7896 #: ../src/guestfs-actions.pod:1874 ../src/guestfs-actions.pod:1977
7897 #: ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:2242
7898 #: ../src/guestfs-actions.pod:2724 ../src/guestfs-actions.pod:2743
7899 #: ../src/guestfs-actions.pod:2808 ../src/guestfs-actions.pod:2832
7900 #: ../src/guestfs-actions.pod:2849 ../src/guestfs-actions.pod:2878
7901 #: ../src/guestfs-actions.pod:6228 ../src/guestfs-actions.pod:6254
7902 #: ../src/guestfs-actions.pod:6385 ../src/guestfs-actions.pod:6411
7903 #: ../src/guestfs-actions.pod:6435 ../src/guestfs-actions.pod:7390
7904 #: ../src/guestfs-actions.pod:7445 ../src/guestfs-actions.pod:7591
7905 #: ../src/guestfs-actions.pod:7615 ../src/guestfs-actions.pod:8400
7906 #: ../src/guestfs-actions.pod:8420 ../src/guestfs-actions.pod:8453
7907 #: ../src/guestfs-actions.pod:8472 ../src/guestfs-actions.pod:8491
7908 #: ../src/guestfs-actions.pod:8582 ../src/guestfs-actions.pod:8601
7909 #: ../src/guestfs-actions.pod:8647 ../src/guestfs-actions.pod:8666
7911 "Because of the message protocol, there is a transfer limit of somewhere "
7912 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7916 #: ../fish/guestfish-actions.pod:676
7921 #: ../fish/guestfish-actions.pod:678
7924 " checksum csumtype path\n"
7929 #: ../fish/guestfish-actions.pod:680 ../src/guestfs-actions.pod:1013
7931 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7935 #: ../fish/guestfish-actions.pod:683 ../src/guestfs-actions.pod:1016
7937 "The type of checksum to compute is given by the C<csumtype> parameter which "
7938 "must have one of the following values:"
7942 #: ../fish/guestfish-actions.pod:688 ../src/guestfs-actions.pod:1021
7947 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1023
7949 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7954 #: ../fish/guestfish-actions.pod:693 ../src/guestfs-actions.pod:1026
7959 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1028
7960 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7964 #: ../fish/guestfish-actions.pod:697 ../src/guestfs-actions.pod:1030
7969 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1032
7970 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7974 #: ../fish/guestfish-actions.pod:701 ../src/guestfs-actions.pod:1034
7979 #: ../fish/guestfish-actions.pod:703 ../src/guestfs-actions.pod:1036
7980 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7984 #: ../fish/guestfish-actions.pod:705 ../src/guestfs-actions.pod:1038
7989 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1040
7990 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7994 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1042
7999 #: ../fish/guestfish-actions.pod:711 ../src/guestfs-actions.pod:1044
8000 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
8004 #: ../fish/guestfish-actions.pod:713 ../src/guestfs-actions.pod:1046
8009 #: ../fish/guestfish-actions.pod:715 ../src/guestfs-actions.pod:1048
8010 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
8014 #: ../fish/guestfish-actions.pod:719 ../src/guestfs-actions.pod:1052
8015 msgid "The checksum is returned as a printable string."
8019 #: ../fish/guestfish-actions.pod:721
8020 msgid "To get the checksum for a device, use L</checksum-device>."
8024 #: ../fish/guestfish-actions.pod:723
8025 msgid "To get the checksums for many files, use L</checksums-out>."
8029 #: ../fish/guestfish-actions.pod:725
8030 msgid "checksum-device"
8034 #: ../fish/guestfish-actions.pod:727
8037 " checksum-device csumtype device\n"
8042 #: ../fish/guestfish-actions.pod:729
8044 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
8045 "device named C<device>. For the types of checksums supported see the L</"
8046 "checksum> command."
8050 #: ../fish/guestfish-actions.pod:733
8051 msgid "checksums-out"
8055 #: ../fish/guestfish-actions.pod:735
8058 " checksums-out csumtype directory (sumsfile|-)\n"
8063 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1087
8065 "This command computes the checksums of all regular files in C<directory> and "
8066 "then emits a list of those checksums to the local output file C<sumsfile>."
8070 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1091
8072 "This can be used for verifying the integrity of a virtual machine. However "
8073 "to be properly secure you should pay attention to the output of the checksum "
8074 "command (it uses the ones from GNU coreutils). In particular when the "
8075 "filename is not printable, coreutils uses a special backslash syntax. For "
8076 "more information, see the GNU coreutils info file."
8080 #: ../fish/guestfish-actions.pod:751
8085 #: ../fish/guestfish-actions.pod:753
8088 " chmod mode path\n"
8093 #: ../fish/guestfish-actions.pod:755 ../src/guestfs-actions.pod:1110
8095 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
8100 #: ../fish/guestfish-actions.pod:758 ../src/guestfs-actions.pod:1113
8102 "I<Note>: When using this command from guestfish, C<mode> by default would be "
8103 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
8108 #: ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:3356
8109 #: ../fish/guestfish-actions.pod:3495 ../fish/guestfish-actions.pod:3505
8110 #: ../fish/guestfish-actions.pod:3515 ../src/guestfs-actions.pod:1117
8111 #: ../src/guestfs-actions.pod:5193 ../src/guestfs-actions.pod:5402
8112 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:5440
8113 msgid "The mode actually set is affected by the umask."
8117 #: ../fish/guestfish-actions.pod:764
8122 #: ../fish/guestfish-actions.pod:766
8125 " chown owner group path\n"
8130 #: ../fish/guestfish-actions.pod:768 ../src/guestfs-actions.pod:1131
8131 msgid "Change the file owner to C<owner> and group to C<group>."
8135 #: ../fish/guestfish-actions.pod:770 ../fish/guestfish-actions.pod:2703
8136 #: ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:4124
8138 "Only numeric uid and gid are supported. If you want to use names, you will "
8139 "need to locate and parse the password file yourself (Augeas support makes "
8140 "this relatively easy)."
8144 #: ../fish/guestfish-actions.pod:774
8149 #: ../fish/guestfish-actions.pod:776
8152 " command 'arguments ...'\n"
8157 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1147
8159 "This call runs a command from the guest filesystem. The filesystem must be "
8160 "mounted, and must contain a compatible operating system (ie. something "
8161 "Linux, with the same or compatible processor architecture)."
8165 #: ../fish/guestfish-actions.pod:783
8167 "The single parameter is an argv-style list of arguments. The first element "
8168 "is the name of the program to run. Subsequent elements are parameters. The "
8169 "list must be non-empty (ie. must contain a program name). Note that the "
8170 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
8174 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1159
8175 msgid "The return value is anything printed to I<stdout> by the command."
8179 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1162
8181 "If the command returns a non-zero exit status, then this function returns an "
8182 "error message. The error message string is the content of I<stderr> from "
8187 #: ../fish/guestfish-actions.pod:797 ../src/guestfs-actions.pod:1166
8189 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
8190 "bin>. If you require a program from another location, you should provide "
8191 "the full path in the first parameter."
8195 #: ../fish/guestfish-actions.pod:802 ../src/guestfs-actions.pod:1171
8197 "Shared libraries and data files required by the program must be available on "
8198 "filesystems which are mounted in the correct places. It is the caller's "
8199 "responsibility to ensure all filesystems that are needed are mounted at the "
8204 #: ../fish/guestfish-actions.pod:811
8205 msgid "command-lines"
8209 #: ../fish/guestfish-actions.pod:813
8212 " command-lines 'arguments ...'\n"
8217 #: ../fish/guestfish-actions.pod:815
8219 "This is the same as L</command>, but splits the result into a list of lines."
8223 #: ../fish/guestfish-actions.pod:818
8224 msgid "See also: L</sh-lines>"
8228 #: ../fish/guestfish-actions.pod:823
8229 msgid "compress-device-out"
8233 #: ../fish/guestfish-actions.pod:825
8236 " compress-device-out ctype device (zdevice|-) [level:N]\n"
8241 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1221
8243 "This command compresses C<device> and writes it out to the local file "
8248 #: ../fish/guestfish-actions.pod:830
8250 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
8255 #: ../fish/guestfish-actions.pod:837
8256 msgid "compress-out"
8260 #: ../fish/guestfish-actions.pod:839
8263 " compress-out ctype file (zfile|-) [level:N]\n"
8268 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1273
8270 "This command compresses C<file> and writes it out to the local file C<zfile>."
8274 #: ../fish/guestfish-actions.pod:844 ../src/guestfs-actions.pod:1276
8276 "The compression program used is controlled by the C<ctype> parameter. "
8277 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
8278 "Some compression types may not be supported by particular builds of "
8279 "libguestfs, in which case you will get an error containing the substring "
8280 "\"not supported\"."
8284 #: ../fish/guestfish-actions.pod:850 ../src/guestfs-actions.pod:1282
8286 "The optional C<level> parameter controls compression level. The meaning and "
8287 "default for this parameter depends on the compression program being used."
8291 #: ../fish/guestfish-actions.pod:858
8296 #: ../fish/guestfish-actions.pod:860
8299 " config qemuparam qemuvalue\n"
8304 #: ../fish/guestfish-actions.pod:862 ../src/guestfs-actions.pod:1323
8306 "This can be used to add arbitrary qemu command line parameters of the form "
8307 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
8308 "setting some parameters which would interfere with parameters that we use."
8312 #: ../fish/guestfish-actions.pod:867 ../src/guestfs-actions.pod:1328
8313 msgid "The first character of C<param> string must be a C<-> (dash)."
8317 #: ../fish/guestfish-actions.pod:869 ../src/guestfs-actions.pod:1330
8318 msgid "C<value> can be NULL."
8322 #: ../fish/guestfish-actions.pod:871
8323 msgid "copy-device-to-device"
8327 #: ../fish/guestfish-actions.pod:873
8330 " copy-device-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
8335 #: ../fish/guestfish-actions.pod:875
8337 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, L</copy-"
8338 "file-to-device>, and L</copy-file-to-file> let you copy from a source "
8339 "(device|file) to a destination (device|file)."
8343 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1360
8345 "Partial copies can be made since you can specify optionally the source "
8346 "offset, destination offset and size to copy. These values are all specified "
8347 "in bytes. If not given, the offsets both default to zero, and the size "
8348 "defaults to copying as much as possible until we hit the end of the source."
8352 #: ../fish/guestfish-actions.pod:888 ../src/guestfs-actions.pod:1366
8354 "The source and destination may be the same object. However overlapping "
8355 "regions may not be copied correctly."
8359 #: ../fish/guestfish-actions.pod:891 ../src/guestfs-actions.pod:1369
8361 "If the destination is a file, it is created if required. If the destination "
8362 "file is not large enough, it is extended."
8366 #: ../fish/guestfish-actions.pod:896
8367 msgid "copy-device-to-file"
8371 #: ../fish/guestfish-actions.pod:898
8374 " copy-device-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
8379 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:909
8380 #: ../fish/guestfish-actions.pod:918
8381 msgid "See L</copy-device-to-device> for a general overview of this call."
8385 #: ../fish/guestfish-actions.pod:905
8386 msgid "copy-file-to-device"
8390 #: ../fish/guestfish-actions.pod:907
8393 " copy-file-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
8398 #: ../fish/guestfish-actions.pod:914
8399 msgid "copy-file-to-file"
8403 #: ../fish/guestfish-actions.pod:916
8406 " copy-file-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
8411 #: ../fish/guestfish-actions.pod:921
8413 "This is B<not> the function you want for copying files. This is for copying "
8414 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
8415 "file copying and moving functions."
8419 #: ../fish/guestfish-actions.pod:928
8424 #: ../fish/guestfish-actions.pod:930
8427 " copy-size src dest size\n"
8432 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1584
8434 "This command copies exactly C<size> bytes from one source device or file "
8435 "C<src> to another destination device or file C<dest>."
8439 #: ../fish/guestfish-actions.pod:935 ../src/guestfs-actions.pod:1587
8441 "Note this will fail if the source is too short or if the destination is not "
8446 #: ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:973
8448 "I<This function is deprecated.> In new code, use the L</"
8449 "copy_device_to_device> call instead."
8453 #: ../fish/guestfish-actions.pod:945
8458 #: ../fish/guestfish-actions.pod:947
8466 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1606
8468 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8469 "destination filename or destination directory."
8473 #: ../fish/guestfish-actions.pod:952
8478 #: ../fish/guestfish-actions.pod:954
8486 #: ../fish/guestfish-actions.pod:956 ../src/guestfs-actions.pod:1620
8488 "This copies a file or directory from C<src> to C<dest> recursively using the "
8493 #: ../fish/guestfish-actions.pod:959
8498 #: ../fish/guestfish-actions.pod:961
8506 #: ../fish/guestfish-actions.pod:963 ../src/guestfs-actions.pod:1641
8508 "This command copies from one source device or file C<src> to another "
8509 "destination device or file C<dest>. Normally you would use this to copy to "
8510 "or from a device or partition, for example to duplicate a filesystem."
8514 #: ../fish/guestfish-actions.pod:968
8516 "If the destination is a device, it must be as large or larger than the "
8517 "source file or device, otherwise the copy will fail. This command cannot do "
8518 "partial copies (see L</copy-device-to-device>)."
8522 #: ../fish/guestfish-actions.pod:980
8527 #: ../fish/guestfish-actions.pod:982
8535 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1660
8536 msgid "This command runs the C<df> command to report disk space used."
8540 #: ../fish/guestfish-actions.pod:986 ../fish/guestfish-actions.pod:997
8542 "This command is mostly useful for interactive sessions. It is I<not> "
8543 "intended that you try to parse the output string. Use L</statvfs> from "
8548 #: ../fish/guestfish-actions.pod:990
8553 #: ../fish/guestfish-actions.pod:992
8561 #: ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1676
8563 "This command runs the C<df -h> command to report disk space used in human-"
8568 #: ../fish/guestfish-actions.pod:1001
8573 #: ../fish/guestfish-actions.pod:1003
8581 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1693
8583 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8584 "This is sometimes useful for extended debugging of problems."
8588 #: ../fish/guestfish-actions.pod:1009
8590 "Another way to get the same information is to enable verbose messages with "
8591 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
8592 "before running the program."
8596 #: ../fish/guestfish-actions.pod:1014
8601 #: ../fish/guestfish-actions.pod:1016
8604 " download remotefilename (filename|-)\n"
8609 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1031
8610 #: ../src/guestfs-actions.pod:1714 ../src/guestfs-actions.pod:1739
8612 "Download file C<remotefilename> and save it as C<filename> on the local "
8617 #: ../fish/guestfish-actions.pod:1021 ../fish/guestfish-actions.pod:5179
8618 #: ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:7970
8619 msgid "C<filename> can also be a named pipe."
8623 #: ../fish/guestfish-actions.pod:1023
8624 msgid "See also L</upload>, L</cat>."
8628 #: ../fish/guestfish-actions.pod:1027
8629 msgid "download-offset"
8633 #: ../fish/guestfish-actions.pod:1029
8636 " download-offset remotefilename (filename|-) offset size\n"
8641 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1742
8643 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8644 "region must be within the file or device)."
8648 #: ../fish/guestfish-actions.pod:1037
8650 "Note that there is no limit on the amount of data that can be downloaded "
8651 "with this call, unlike with L</pread>, and this call always reads the full "
8652 "amount unless an error occurs."
8656 #: ../fish/guestfish-actions.pod:1042
8657 msgid "See also L</download>, L</pread>."
8661 #: ../fish/guestfish-actions.pod:1046
8666 #: ../fish/guestfish-actions.pod:1048
8669 " drop-caches whattodrop\n"
8674 #: ../fish/guestfish-actions.pod:1050 ../src/guestfs-actions.pod:1767
8676 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8677 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8678 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8682 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1772
8683 msgid "Setting C<whattodrop> to 3 should drop everything."
8687 #: ../fish/guestfish-actions.pod:1057 ../src/guestfs-actions.pod:1774
8689 "This automatically calls L<sync(2)> before the operation, so that the "
8690 "maximum guest memory is freed."
8694 #: ../fish/guestfish-actions.pod:1060
8699 #: ../fish/guestfish-actions.pod:1062
8707 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1787
8709 "This command runs the C<du -s> command to estimate file space usage for "
8714 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1790
8716 "C<path> can be a file or a directory. If C<path> is a directory then the "
8717 "estimate includes the contents of the directory and all subdirectories "
8722 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1794
8724 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8728 #: ../fish/guestfish-actions.pod:1074
8733 #: ../fish/guestfish-actions.pod:1076
8736 " e2fsck-f device\n"
8741 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1812
8743 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8744 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
8749 #: ../fish/guestfish-actions.pod:1082
8751 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
8752 "should use L</fsck>."
8756 #: ../fish/guestfish-actions.pod:1085
8761 #: ../fish/guestfish-actions.pod:1087
8764 " echo-daemon 'words ...'\n"
8769 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1829
8771 "This command concatenates the list of C<words> passed with single spaces "
8772 "between them and returns the resulting string."
8776 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1832
8777 msgid "You can use this command to test the connection through to the daemon."
8781 #: ../fish/guestfish-actions.pod:1094
8782 msgid "See also L</ping-daemon>."
8786 #: ../fish/guestfish-actions.pod:1096
8791 #: ../fish/guestfish-actions.pod:1098
8794 " egrep regex path\n"
8799 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1848
8801 "This calls the external C<egrep> program and returns the matching lines."
8805 #: ../fish/guestfish-actions.pod:1106
8810 #: ../fish/guestfish-actions.pod:1108
8813 " egrepi regex path\n"
8818 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1867
8820 "This calls the external C<egrep -i> program and returns the matching lines."
8824 #: ../fish/guestfish-actions.pod:1116
8829 #: ../fish/guestfish-actions.pod:1118
8832 " equal file1 file2\n"
8837 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1886
8839 "This compares the two files C<file1> and C<file2> and returns true if their "
8840 "content is exactly equal, or false otherwise."
8844 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1889
8845 msgid "The external L<cmp(1)> program is used for the comparison."
8849 #: ../fish/guestfish-actions.pod:1125
8854 #: ../fish/guestfish-actions.pod:1127
8862 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1901
8864 "This returns C<true> if and only if there is a file, directory (or anything) "
8865 "with the given C<path> name."
8869 #: ../fish/guestfish-actions.pod:1132
8870 msgid "See also L</is-file>, L</is-dir>, L</stat>."
8874 #: ../fish/guestfish-actions.pod:1134
8879 #: ../fish/guestfish-actions.pod:1136
8882 " fallocate path len\n"
8887 #: ../fish/guestfish-actions.pod:1138 ../fish/guestfish-actions.pod:1157
8888 #: ../src/guestfs-actions.pod:1924 ../src/guestfs-actions.pod:1943
8890 "This command preallocates a file (containing zero bytes) named C<path> of "
8891 "size C<len> bytes. If the file exists already, it is overwritten."
8895 #: ../fish/guestfish-actions.pod:1142 ../src/guestfs-actions.pod:1928
8897 "Do not confuse this with the guestfish-specific C<alloc> command which "
8898 "allocates a file in the host and attaches it as a device."
8902 #: ../fish/guestfish-actions.pod:1146
8904 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
8909 #: ../fish/guestfish-actions.pod:1153
8914 #: ../fish/guestfish-actions.pod:1155
8917 " fallocate64 path len\n"
8922 #: ../fish/guestfish-actions.pod:1161
8924 "Note that this call allocates disk blocks for the file. To create a sparse "
8925 "file use L</truncate-size> instead."
8929 #: ../fish/guestfish-actions.pod:1164
8931 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8932 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8933 "maximum size of files created through that call to 1GB."
8937 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1955
8939 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8940 "commands which create a file in the host and attach it as a device."
8944 #: ../fish/guestfish-actions.pod:1173
8949 #: ../fish/guestfish-actions.pod:1175
8952 " fgrep pattern path\n"
8957 #: ../fish/guestfish-actions.pod:1177 ../src/guestfs-actions.pod:1970
8959 "This calls the external C<fgrep> program and returns the matching lines."
8963 #: ../fish/guestfish-actions.pod:1183
8968 #: ../fish/guestfish-actions.pod:1185
8971 " fgrepi pattern path\n"
8976 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1989
8978 "This calls the external C<fgrep -i> program and returns the matching lines."
8982 #: ../fish/guestfish-actions.pod:1193
8987 #: ../fish/guestfish-actions.pod:1195
8995 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:2007
8997 "This call uses the standard L<file(1)> command to determine the type or "
8998 "contents of the file."
9002 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2010
9004 "This call will also transparently look inside various types of compressed "
9009 #: ../fish/guestfish-actions.pod:1203 ../src/guestfs-actions.pod:2013
9011 "The exact command which runs is C<file -zb path>. Note in particular that "
9012 "the filename is not prepended to the output (the I<-b> option)."
9016 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:2017
9018 "The output depends on the output of the underlying L<file(1)> command and it "
9019 "can change in future in ways beyond our control. In other words, the output "
9020 "is not guaranteed by the ABI."
9024 #: ../fish/guestfish-actions.pod:1211
9026 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
9027 "(etc), L</is-zero>."
9031 #: ../fish/guestfish-actions.pod:1214
9032 msgid "file-architecture"
9036 #: ../fish/guestfish-actions.pod:1216
9039 " file-architecture filename\n"
9044 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2035
9046 "This detects the architecture of the binary C<filename>, and returns it if "
9051 #: ../fish/guestfish-actions.pod:1221 ../src/guestfs-actions.pod:2038
9052 msgid "Currently defined architectures are:"
9056 #: ../fish/guestfish-actions.pod:1225 ../src/guestfs-actions.pod:2042
9061 #: ../fish/guestfish-actions.pod:1227 ../src/guestfs-actions.pod:2044
9063 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
9064 "irrespective of the precise processor requirements of the binary."
9068 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2047
9073 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2049
9074 msgid "64 bit x86-64."
9078 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2051
9083 #: ../fish/guestfish-actions.pod:1236 ../src/guestfs-actions.pod:2053
9084 msgid "32 bit SPARC."
9088 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2055
9093 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:2057
9094 msgid "64 bit SPARC V9 and above."
9098 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2059
9103 #: ../fish/guestfish-actions.pod:1244 ../src/guestfs-actions.pod:2061
9104 msgid "Intel Itanium."
9108 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2063
9113 #: ../fish/guestfish-actions.pod:1248 ../src/guestfs-actions.pod:2065
9114 msgid "32 bit Power PC."
9118 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2067
9123 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:2069
9124 msgid "64 bit Power PC."
9128 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2073
9129 msgid "Libguestfs may return other architecture strings in future."
9133 #: ../fish/guestfish-actions.pod:1258 ../src/guestfs-actions.pod:2075
9134 msgid "The function works on at least the following types of files:"
9138 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2081
9139 msgid "many types of Un*x and Linux binary"
9143 #: ../fish/guestfish-actions.pod:1268 ../src/guestfs-actions.pod:2085
9144 msgid "many types of Un*x and Linux shared library"
9148 #: ../fish/guestfish-actions.pod:1272 ../src/guestfs-actions.pod:2089
9149 msgid "Windows Win32 and Win64 binaries"
9153 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:2093
9154 msgid "Windows Win32 and Win64 DLLs"
9158 #: ../fish/guestfish-actions.pod:1278 ../src/guestfs-actions.pod:2095
9159 msgid "Win32 binaries and DLLs return C<i386>."
9163 #: ../fish/guestfish-actions.pod:1280 ../src/guestfs-actions.pod:2097
9164 msgid "Win64 binaries and DLLs return C<x86_64>."
9168 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:2101
9169 msgid "Linux kernel modules"
9173 #: ../fish/guestfish-actions.pod:1288 ../src/guestfs-actions.pod:2105
9174 msgid "Linux new-style initrd images"
9178 #: ../fish/guestfish-actions.pod:1292 ../src/guestfs-actions.pod:2109
9179 msgid "some non-x86 Linux vmlinuz kernels"
9183 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:2113
9184 msgid "What it can't do currently:"
9188 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:2119
9189 msgid "static libraries (libfoo.a)"
9193 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:2123
9194 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
9198 #: ../fish/guestfish-actions.pod:1310 ../src/guestfs-actions.pod:2127
9199 msgid "x86 Linux vmlinuz kernels"
9203 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:2129
9205 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
9206 "compressed code, and are horribly hard to unpack. If you want to find the "
9207 "architecture of a kernel, use the architecture of the associated initrd or "
9208 "kernel module(s) instead."
9212 #: ../fish/guestfish-actions.pod:1319
9217 #: ../fish/guestfish-actions.pod:1321
9225 #: ../fish/guestfish-actions.pod:1323 ../src/guestfs-actions.pod:2147
9226 msgid "This command returns the size of C<file> in bytes."
9230 #: ../fish/guestfish-actions.pod:1325
9232 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
9233 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
9237 #: ../fish/guestfish-actions.pod:1329
9242 #: ../fish/guestfish-actions.pod:1331
9245 " fill c len path\n"
9250 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2165
9252 "This command creates a new file called C<path>. The initial content of the "
9253 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
9258 #: ../fish/guestfish-actions.pod:1337
9260 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
9261 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
9266 #: ../fish/guestfish-actions.pod:1342
9267 msgid "fill-pattern"
9271 #: ../fish/guestfish-actions.pod:1344
9274 " fill-pattern pattern len path\n"
9279 #: ../fish/guestfish-actions.pod:1346
9281 "This function is like L</fill> except that it creates a new file of length "
9282 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
9283 "is truncated if necessary to ensure the length of the file is exactly C<len> "
9288 #: ../fish/guestfish-actions.pod:1351
9293 #: ../fish/guestfish-actions.pod:1353
9301 #: ../fish/guestfish-actions.pod:1355 ../src/guestfs-actions.pod:2211
9303 "This command lists out all files and directories, recursively, starting at "
9304 "C<directory>. It is essentially equivalent to running the shell command "
9305 "C<find directory -print> but some post-processing happens on the output, "
9310 #: ../fish/guestfish-actions.pod:1360 ../src/guestfs-actions.pod:2216
9312 "This returns a list of strings I<without any prefix>. Thus if the directory "
9317 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2219
9327 #: ../fish/guestfish-actions.pod:1367
9328 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
9332 #: ../fish/guestfish-actions.pod:1370 ../src/guestfs-actions.pod:2226
9343 #: ../fish/guestfish-actions.pod:1375 ../src/guestfs-actions.pod:2231
9344 msgid "If C<directory> is not a directory, then this command returns an error."
9348 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2234
9349 msgid "The returned list is sorted."
9353 #: ../fish/guestfish-actions.pod:1380
9354 msgid "See also L</find0>."
9358 #: ../fish/guestfish-actions.pod:1385
9363 #: ../fish/guestfish-actions.pod:1387
9366 " find0 directory (files|-)\n"
9371 #: ../fish/guestfish-actions.pod:1389 ../src/guestfs-actions.pod:2254
9373 "This command lists out all files and directories, recursively, starting at "
9374 "C<directory>, placing the resulting list in the external file called "
9379 #: ../fish/guestfish-actions.pod:1393
9381 "This command works the same way as L</find> with the following exceptions:"
9385 #: ../fish/guestfish-actions.pod:1400 ../src/guestfs-actions.pod:2265
9386 msgid "The resulting list is written to an external file."
9390 #: ../fish/guestfish-actions.pod:1404 ../src/guestfs-actions.pod:2269
9392 "Items (filenames) in the result are separated by C<\\0> characters. See "
9393 "L<find(1)> option I<-print0>."
9397 #: ../fish/guestfish-actions.pod:1409 ../src/guestfs-actions.pod:2274
9398 msgid "This command is not limited in the number of names that it can return."
9402 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2279
9403 msgid "The result list is not sorted."
9407 #: ../fish/guestfish-actions.pod:1420
9408 msgid "findfs-label"
9412 #: ../fish/guestfish-actions.pod:1422
9415 " findfs-label label\n"
9420 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2293
9422 "This command searches the filesystems and returns the one which has the "
9423 "given label. An error is returned if no such filesystem can be found."
9427 #: ../fish/guestfish-actions.pod:1428
9428 msgid "To find the label of a filesystem, use L</vfs-label>."
9432 #: ../fish/guestfish-actions.pod:1430
9437 #: ../fish/guestfish-actions.pod:1432
9440 " findfs-uuid uuid\n"
9445 #: ../fish/guestfish-actions.pod:1434 ../src/guestfs-actions.pod:2310
9447 "This command searches the filesystems and returns the one which has the "
9448 "given UUID. An error is returned if no such filesystem can be found."
9452 #: ../fish/guestfish-actions.pod:1438
9453 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
9457 #: ../fish/guestfish-actions.pod:1440
9462 #: ../fish/guestfish-actions.pod:1442
9465 " fsck fstype device\n"
9470 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2328
9472 "This runs the filesystem checker (fsck) on C<device> which should have "
9473 "filesystem type C<fstype>."
9477 #: ../fish/guestfish-actions.pod:1447 ../src/guestfs-actions.pod:2331
9479 "The returned integer is the status. See L<fsck(8)> for the list of status "
9480 "codes from C<fsck>."
9484 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2340
9485 msgid "Multiple status codes can be summed together."
9489 #: ../fish/guestfish-actions.pod:1460 ../src/guestfs-actions.pod:2344
9491 "A non-zero return code can mean \"success\", for example if errors have been "
9492 "corrected on the filesystem."
9496 #: ../fish/guestfish-actions.pod:1465 ../src/guestfs-actions.pod:2349
9497 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
9501 #: ../fish/guestfish-actions.pod:1470 ../src/guestfs-actions.pod:2354
9503 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
9507 #: ../fish/guestfish-actions.pod:1472
9512 #: ../fish/guestfish-actions.pod:1474
9520 #: ../fish/guestfish-actions.pod:1476 ../src/guestfs-actions.pod:2365
9522 "Return the additional kernel options which are added to the guest kernel "
9527 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2368
9528 msgid "If C<NULL> then no options are added."
9532 #: ../fish/guestfish-actions.pod:1481
9533 msgid "get-attach-method"
9537 #: ../fish/guestfish-actions.pod:1483
9540 " get-attach-method\n"
9545 #: ../fish/guestfish-actions.pod:1485
9546 msgid "Return the current attach method. See L</set-attach-method>."
9550 #: ../fish/guestfish-actions.pod:1487
9551 msgid "get-autosync"
9555 #: ../fish/guestfish-actions.pod:1489
9563 #: ../fish/guestfish-actions.pod:1491 ../src/guestfs-actions.pod:2393
9564 msgid "Get the autosync flag."
9568 #: ../fish/guestfish-actions.pod:1493
9573 #: ../fish/guestfish-actions.pod:1495
9581 #: ../fish/guestfish-actions.pod:1497 ../src/guestfs-actions.pod:2404
9582 msgid "Return the direct appliance mode flag."
9586 #: ../fish/guestfish-actions.pod:1499
9591 #: ../fish/guestfish-actions.pod:1501
9594 " get-e2label device\n"
9599 #: ../fish/guestfish-actions.pod:1503 ../src/guestfs-actions.pod:2423
9601 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9605 #: ../fish/guestfish-actions.pod:1506
9607 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
9612 #: ../fish/guestfish-actions.pod:1513
9617 #: ../fish/guestfish-actions.pod:1515
9620 " get-e2uuid device\n"
9625 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2444
9627 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9631 #: ../fish/guestfish-actions.pod:1520
9633 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
9638 #: ../fish/guestfish-actions.pod:1527
9643 #: ../fish/guestfish-actions.pod:1529
9651 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2457
9653 "This gets the memory size in megabytes allocated to the qemu subprocess."
9657 #: ../fish/guestfish-actions.pod:1534
9659 "If L</set-memsize> was not called on this handle, and if "
9660 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9661 "value for memsize."
9665 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:1595
9666 #: ../fish/guestfish-actions.pod:4457 ../fish/guestfish-actions.pod:4559
9667 #: ../src/guestfs-actions.pod:2464 ../src/guestfs-actions.pod:2556
9668 #: ../src/guestfs-actions.pod:6904 ../src/guestfs-actions.pod:7030
9670 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9674 #: ../fish/guestfish-actions.pod:1541
9679 #: ../fish/guestfish-actions.pod:1543
9687 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2476
9688 msgid "This returns the enable network flag."
9692 #: ../fish/guestfish-actions.pod:1547
9697 #: ../fish/guestfish-actions.pod:1549
9705 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2487
9706 msgid "Return the current search path."
9710 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2489
9712 "This is always non-NULL. If it wasn't set already, then this will return "
9717 #: ../fish/guestfish-actions.pod:1556
9722 #: ../fish/guestfish-actions.pod:1558
9730 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2502
9731 msgid "This returns the process group flag."
9735 #: ../fish/guestfish-actions.pod:1562
9740 #: ../fish/guestfish-actions.pod:1564
9745 #: ../fish/guestfish-actions.pod:1566
9753 #: ../fish/guestfish-actions.pod:1568 ../src/guestfs-actions.pod:2513
9755 "Return the process ID of the qemu subprocess. If there is no qemu "
9756 "subprocess, then this will return an error."
9760 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2516
9761 msgid "This is an internal call used for debugging and testing."
9765 #: ../fish/guestfish-actions.pod:1573
9770 #: ../fish/guestfish-actions.pod:1575
9778 #: ../fish/guestfish-actions.pod:1577 ../src/guestfs-actions.pod:2527
9779 msgid "Return the current qemu binary."
9783 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2529
9785 "This is always non-NULL. If it wasn't set already, then this will return "
9786 "the default qemu binary name."
9790 #: ../fish/guestfish-actions.pod:1582
9791 msgid "get-recovery-proc"
9795 #: ../fish/guestfish-actions.pod:1584
9798 " get-recovery-proc\n"
9803 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2542
9804 msgid "Return the recovery process enabled flag."
9808 #: ../fish/guestfish-actions.pod:1588
9813 #: ../fish/guestfish-actions.pod:1590
9821 #: ../fish/guestfish-actions.pod:1592
9823 "This returns the current setting of the selinux flag which is passed to the "
9824 "appliance at boot time. See L</set-selinux>."
9828 #: ../fish/guestfish-actions.pod:1598
9833 #: ../fish/guestfish-actions.pod:1600
9841 #: ../fish/guestfish-actions.pod:1602 ../src/guestfs-actions.pod:2568
9842 msgid "This returns the number of virtual CPUs assigned to the appliance."
9846 #: ../fish/guestfish-actions.pod:1604
9851 #: ../fish/guestfish-actions.pod:1606
9859 #: ../fish/guestfish-actions.pod:1608 ../src/guestfs-actions.pod:2579
9861 "This returns the current state as an opaque integer. This is only useful "
9862 "for printing debug and internal error messages."
9866 #: ../fish/guestfish-actions.pod:1611 ../fish/guestfish-actions.pod:2570
9867 #: ../fish/guestfish-actions.pod:2588 ../fish/guestfish-actions.pod:2626
9868 #: ../fish/guestfish-actions.pod:2642 ../src/guestfs-actions.pod:2582
9869 #: ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:3930
9870 #: ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:4018
9871 msgid "For more information on states, see L<guestfs(3)>."
9875 #: ../fish/guestfish-actions.pod:1613
9880 #: ../fish/guestfish-actions.pod:1615
9888 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2593
9889 msgid "Return the command trace flag."
9893 #: ../fish/guestfish-actions.pod:1619
9898 #: ../fish/guestfish-actions.pod:1621
9906 #: ../fish/guestfish-actions.pod:1623
9908 "Return the current umask. By default the umask is C<022> unless it has been "
9909 "set by calling L</umask>."
9913 #: ../fish/guestfish-actions.pod:1626
9918 #: ../fish/guestfish-actions.pod:1628
9926 #: ../fish/guestfish-actions.pod:1630 ../src/guestfs-actions.pod:2616
9927 msgid "This returns the verbose messages flag."
9931 #: ../fish/guestfish-actions.pod:1632
9936 #: ../fish/guestfish-actions.pod:1634
9944 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2627
9945 msgid "This gets the SELinux security context of the daemon."
9949 #: ../fish/guestfish-actions.pod:1638
9950 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9954 #: ../fish/guestfish-actions.pod:1641
9959 #: ../fish/guestfish-actions.pod:1643
9962 " getxattr path name\n"
9967 #: ../fish/guestfish-actions.pod:1645
9969 "Get a single extended attribute from file C<path> named C<name>. This call "
9970 "follows symlinks. If you want to lookup an extended attribute for the "
9971 "symlink itself, use L</lgetxattr>."
9975 #: ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:2715
9977 "Normally it is better to get all extended attributes from a file in one go "
9978 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9979 "buggy and do not provide a way to list out attributes. For these "
9980 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9981 "attributes you want in advance and call this function."
9985 #: ../fish/guestfish-actions.pod:1656 ../fish/guestfish-actions.pod:2722
9986 #: ../src/guestfs-actions.pod:2656 ../src/guestfs-actions.pod:4151
9988 "Extended attribute values are blobs of binary data. If there is no extended "
9989 "attribute named C<name>, this returns an error."
9993 #: ../fish/guestfish-actions.pod:1659
9994 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9998 #: ../fish/guestfish-actions.pod:1661
10003 #: ../fish/guestfish-actions.pod:1663
10006 " getxattrs path\n"
10011 #: ../fish/guestfish-actions.pod:1665 ../src/guestfs-actions.pod:2673
10013 "This call lists the extended attributes of the file or directory C<path>."
10017 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2676
10019 "At the system call level, this is a combination of the L<listxattr(2)> and "
10020 "L<getxattr(2)> calls."
10024 #: ../fish/guestfish-actions.pod:1671
10025 msgid "See also: L</lgetxattrs>, L<attr(5)>."
10029 #: ../fish/guestfish-actions.pod:1673
10030 msgid "glob-expand"
10034 #: ../fish/guestfish-actions.pod:1675
10037 " glob-expand pattern\n"
10042 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2693
10044 "This command searches for all the pathnames matching C<pattern> according to "
10045 "the wildcard expansion rules used by the shell."
10049 #: ../fish/guestfish-actions.pod:1681 ../src/guestfs-actions.pod:2697
10051 "If no paths match, then this returns an empty list (note: not an error)."
10055 #: ../fish/guestfish-actions.pod:1684 ../src/guestfs-actions.pod:2700
10057 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
10058 "GLOB_BRACE>. See that manual page for more details."
10062 #: ../fish/guestfish-actions.pod:1688
10067 #: ../fish/guestfish-actions.pod:1690
10070 " grep regex path\n"
10075 #: ../fish/guestfish-actions.pod:1692 ../src/guestfs-actions.pod:2717
10076 msgid "This calls the external C<grep> program and returns the matching lines."
10080 #: ../fish/guestfish-actions.pod:1698
10085 #: ../fish/guestfish-actions.pod:1700
10088 " grepi regex path\n"
10093 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2736
10095 "This calls the external C<grep -i> program and returns the matching lines."
10099 #: ../fish/guestfish-actions.pod:1708
10100 msgid "grub-install"
10104 #: ../fish/guestfish-actions.pod:1710
10107 " grub-install root device\n"
10112 #: ../fish/guestfish-actions.pod:1712 ../src/guestfs-actions.pod:2755
10114 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
10115 "with the root directory being C<root>."
10119 #: ../fish/guestfish-actions.pod:1721 ../src/guestfs-actions.pod:2764
10121 "There is currently no way in the API to install grub2, which is used by most "
10122 "modern Linux guests. It is possible to run the grub2 command from the "
10123 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
10127 #: ../fish/guestfish-actions.pod:1728 ../src/guestfs-actions.pod:2771
10129 "This uses C<grub-install> from the host. Unfortunately grub is not always "
10130 "compatible with itself, so this only works in rather narrow circumstances. "
10131 "Careful testing with each guest version is advisable."
10135 #: ../fish/guestfish-actions.pod:1735 ../src/guestfs-actions.pod:2778
10137 "If grub-install reports the error \"No suitable drive was found in the "
10138 "generated device map.\" it may be that you need to create a C</boot/grub/"
10139 "device.map> file first that contains the mapping between grub device names "
10140 "and Linux device names. It is usually sufficient to create a file "
10145 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2785
10148 " (hd0) /dev/vda\n"
10153 #: ../fish/guestfish-actions.pod:1744 ../src/guestfs-actions.pod:2787
10154 msgid "replacing C</dev/vda> with the name of the installation device."
10158 #: ../fish/guestfish-actions.pod:1748
10163 #: ../fish/guestfish-actions.pod:1750
10171 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2801
10173 "This command returns up to the first 10 lines of a file as a list of strings."
10177 #: ../fish/guestfish-actions.pod:1758
10182 #: ../fish/guestfish-actions.pod:1760
10185 " head-n nrlines path\n"
10190 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2820
10192 "If the parameter C<nrlines> is a positive number, this returns the first "
10193 "C<nrlines> lines of the file C<path>."
10197 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2823
10199 "If the parameter C<nrlines> is a negative number, this returns lines from "
10200 "the file C<path>, excluding the last C<nrlines> lines."
10204 #: ../fish/guestfish-actions.pod:1768 ../fish/guestfish-actions.pod:4940
10205 #: ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:7609
10206 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
10210 #: ../fish/guestfish-actions.pod:1773
10215 #: ../fish/guestfish-actions.pod:1775
10223 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2843
10225 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
10226 "readable, canonical hex dump of the file."
10230 #: ../fish/guestfish-actions.pod:1783
10235 #: ../fish/guestfish-actions.pod:1785
10238 " initrd-cat initrdpath filename\n"
10243 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2862
10245 "This command unpacks the file C<filename> from the initrd file called "
10246 "C<initrdpath>. The filename must be given I<without> the initial C</> "
10251 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2866
10253 "For example, in guestfish you could use the following command to examine the "
10254 "boot script (usually called C</init>) contained in a Linux initrd or "
10259 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2870
10262 " initrd-cat /boot/initrd-<version>.img init\n"
10267 #: ../fish/guestfish-actions.pod:1797
10268 msgid "See also L</initrd-list>."
10272 #: ../fish/guestfish-actions.pod:1802
10273 msgid "initrd-list"
10277 #: ../fish/guestfish-actions.pod:1804
10280 " initrd-list path\n"
10285 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2889
10286 msgid "This command lists out files contained in an initrd."
10290 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2891
10292 "The files are listed without any initial C</> character. The files are "
10293 "listed in the order they appear (not necessarily alphabetical). Directory "
10294 "names are listed as separate items."
10298 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2895
10300 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
10301 "initrd. We I<only> support the newer initramfs format (compressed cpio "
10306 #: ../fish/guestfish-actions.pod:1816
10307 msgid "inotify-add-watch"
10311 #: ../fish/guestfish-actions.pod:1818
10314 " inotify-add-watch path mask\n"
10319 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2912
10320 msgid "Watch C<path> for the events listed in C<mask>."
10324 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2914
10326 "Note that if C<path> is a directory then events within that directory are "
10327 "watched, but this does I<not> happen recursively (in subdirectories)."
10331 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2918
10333 "Note for non-C or non-Linux callers: the inotify events are defined by the "
10334 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
10338 #: ../fish/guestfish-actions.pod:1830
10339 msgid "inotify-close"
10343 #: ../fish/guestfish-actions.pod:1832
10351 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2931
10353 "This closes the inotify handle which was previously opened by inotify_init. "
10354 "It removes all watches, throws away any pending events, and deallocates all "
10359 #: ../fish/guestfish-actions.pod:1838
10360 msgid "inotify-files"
10364 #: ../fish/guestfish-actions.pod:1840
10372 #: ../fish/guestfish-actions.pod:1842
10374 "This function is a helpful wrapper around L</inotify-read> which just "
10375 "returns a list of pathnames of objects that were touched. The returned "
10376 "pathnames are sorted and deduplicated."
10380 #: ../fish/guestfish-actions.pod:1846
10381 msgid "inotify-init"
10385 #: ../fish/guestfish-actions.pod:1848
10388 " inotify-init maxevents\n"
10393 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2960
10395 "This command creates a new inotify handle. The inotify subsystem can be "
10396 "used to notify events which happen to objects in the guest filesystem."
10400 #: ../fish/guestfish-actions.pod:1854
10402 "C<maxevents> is the maximum number of events which will be queued up between "
10403 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
10404 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
10405 "default was 16384 events. Beyond this limit, the kernel throws away events, "
10406 "but records the fact that it threw them away by setting a flag "
10407 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
10411 #: ../fish/guestfish-actions.pod:1864
10413 "Before any events are generated, you have to add some watches to the "
10414 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
10415 "L</inotify-watch-all>."
10419 #: ../fish/guestfish-actions.pod:1870
10421 "Queued up events should be read periodically by calling L</inotify-read> (or "
10422 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
10423 "If you don't read the events out often enough then you risk the internal "
10424 "queue overflowing."
10428 #: ../fish/guestfish-actions.pod:1877
10430 "The handle should be closed after use by calling L</inotify-close>. This "
10431 "also removes any watches automatically."
10435 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2991
10437 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
10438 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
10439 "that there is one global inotify handle per libguestfs instance."
10443 #: ../fish/guestfish-actions.pod:1886
10444 msgid "inotify-read"
10448 #: ../fish/guestfish-actions.pod:1888
10456 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:3005
10458 "Return the complete queue of events that have happened since the previous "
10463 #: ../fish/guestfish-actions.pod:1893 ../src/guestfs-actions.pod:3008
10464 msgid "If no events have happened, this returns an empty list."
10468 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:3010
10470 "I<Note>: In order to make sure that all events have been read, you must call "
10471 "this function repeatedly until it returns an empty list. The reason is that "
10472 "the call will read events up to the maximum appliance-to-host message size "
10473 "and leave remaining events in the queue."
10477 #: ../fish/guestfish-actions.pod:1901
10478 msgid "inotify-rm-watch"
10482 #: ../fish/guestfish-actions.pod:1903
10485 " inotify-rm-watch wd\n"
10490 #: ../fish/guestfish-actions.pod:1905
10491 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
10495 #: ../fish/guestfish-actions.pod:1908
10496 msgid "inspect-get-arch"
10500 #: ../fish/guestfish-actions.pod:1910
10503 " inspect-get-arch root\n"
10508 #: ../fish/guestfish-actions.pod:1912
10510 "This returns the architecture of the inspected operating system. The "
10511 "possible return values are listed under L</file-architecture>."
10515 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3045
10517 "If the architecture could not be determined, then the string C<unknown> is "
10522 #: ../fish/guestfish-actions.pod:1919 ../fish/guestfish-actions.pod:2014
10523 #: ../fish/guestfish-actions.pod:2093 ../fish/guestfish-actions.pod:2105
10524 #: ../fish/guestfish-actions.pod:2189 ../fish/guestfish-actions.pod:2251
10525 #: ../fish/guestfish-actions.pod:2272 ../fish/guestfish-actions.pod:2286
10526 #: ../fish/guestfish-actions.pod:2326 ../fish/guestfish-actions.pod:2362
10527 #: ../fish/guestfish-actions.pod:2375 ../fish/guestfish-actions.pod:2388
10528 #: ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2408
10529 #: ../fish/guestfish-actions.pod:2420 ../fish/guestfish-actions.pod:2516
10530 #: ../fish/guestfish-actions.pod:2550 ../src/guestfs-actions.pod:3048
10531 #: ../src/guestfs-actions.pod:3150 ../src/guestfs-actions.pod:3254
10532 #: ../src/guestfs-actions.pod:3273 ../src/guestfs-actions.pod:3404
10533 #: ../src/guestfs-actions.pod:3488 ../src/guestfs-actions.pod:3516
10534 #: ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3590
10535 #: ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3654
10536 #: ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:3691
10537 #: ../src/guestfs-actions.pod:3707 ../src/guestfs-actions.pod:3725
10538 #: ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:3868
10539 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
10543 #: ../fish/guestfish-actions.pod:1921
10544 msgid "inspect-get-distro"
10548 #: ../fish/guestfish-actions.pod:1923
10551 " inspect-get-distro root\n"
10556 #: ../fish/guestfish-actions.pod:1925 ../src/guestfs-actions.pod:3061
10558 "This returns the distro (distribution) of the inspected operating system."
10562 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3064
10563 msgid "Currently defined distros are:"
10567 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3068
10568 msgid "\"archlinux\""
10572 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3070
10573 msgid "Arch Linux."
10577 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3072
10582 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3074
10587 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3076
10592 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3078
10597 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3080
10602 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3082
10607 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3084
10612 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3086
10617 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3088
10618 msgid "\"linuxmint\""
10622 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:3090
10623 msgid "Linux Mint."
10627 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3092
10632 #: ../fish/guestfish-actions.pod:1958 ../src/guestfs-actions.pod:3094
10637 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3096
10638 msgid "\"mandriva\""
10642 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:3098
10647 #: ../fish/guestfish-actions.pod:1964 ../src/guestfs-actions.pod:3100
10652 #: ../fish/guestfish-actions.pod:1966 ../src/guestfs-actions.pod:3102
10657 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:3104
10658 msgid "\"opensuse\""
10662 #: ../fish/guestfish-actions.pod:1970 ../src/guestfs-actions.pod:3106
10667 #: ../fish/guestfish-actions.pod:1972 ../src/guestfs-actions.pod:3108
10672 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3110
10677 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:3112
10678 msgid "\"redhat-based\""
10682 #: ../fish/guestfish-actions.pod:1978 ../src/guestfs-actions.pod:3114
10683 msgid "Some Red Hat-derived distro."
10687 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3116
10692 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:3118
10693 msgid "Red Hat Enterprise Linux."
10697 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3120
10698 msgid "\"scientificlinux\""
10702 #: ../fish/guestfish-actions.pod:1986 ../src/guestfs-actions.pod:3122
10703 msgid "Scientific Linux."
10707 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3124
10708 msgid "\"slackware\""
10712 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:3126
10717 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:3128
10718 msgid "\"ttylinux\""
10722 #: ../fish/guestfish-actions.pod:1994 ../src/guestfs-actions.pod:3130
10727 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3132
10732 #: ../fish/guestfish-actions.pod:1998 ../src/guestfs-actions.pod:3134
10737 #: ../fish/guestfish-actions.pod:2000 ../fish/guestfish-actions.pod:2084
10738 #: ../fish/guestfish-actions.pod:2353 ../src/guestfs-actions.pod:3136
10739 #: ../src/guestfs-actions.pod:3245 ../src/guestfs-actions.pod:3625
10740 msgid "\"unknown\""
10744 #: ../fish/guestfish-actions.pod:2002 ../src/guestfs-actions.pod:3138
10745 msgid "The distro could not be determined."
10749 #: ../fish/guestfish-actions.pod:2004 ../fish/guestfish-actions.pod:2341
10750 #: ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3613
10751 msgid "\"windows\""
10755 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3142
10757 "Windows does not have distributions. This string is returned if the OS type "
10762 #: ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2090
10763 #: ../fish/guestfish-actions.pod:2359 ../src/guestfs-actions.pod:3147
10764 #: ../src/guestfs-actions.pod:3251 ../src/guestfs-actions.pod:3631
10766 "Future versions of libguestfs may return other strings here. The caller "
10767 "should be prepared to handle any string."
10771 #: ../fish/guestfish-actions.pod:2016
10772 msgid "inspect-get-drive-mappings"
10776 #: ../fish/guestfish-actions.pod:2018
10779 " inspect-get-drive-mappings root\n"
10784 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3163
10786 "This call is useful for Windows which uses a primitive system of assigning "
10787 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10788 "Windows Registry to find out how disks/partitions are mapped to drive "
10789 "letters, and returns a hash table as in the example below:"
10793 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3169
10796 " C => /dev/vda2\n"
10797 " E => /dev/vdb1\n"
10798 " F => /dev/vdc1\n"
10803 #: ../fish/guestfish-actions.pod:2030 ../src/guestfs-actions.pod:3173
10805 "Note that keys are drive letters. For Windows, the key is case insensitive "
10806 "and just contains the drive letter, without the customary colon separator "
10811 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3177
10813 "In future we may support other operating systems that also used drive "
10814 "letters, but the keys for those might not be case insensitive and might be "
10815 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10820 #: ../fish/guestfish-actions.pod:2039 ../src/guestfs-actions.pod:3182
10822 "For Windows guests, currently only hard drive mappings are returned. "
10823 "Removable disks (eg. DVD-ROMs) are ignored."
10827 #: ../fish/guestfish-actions.pod:2042 ../src/guestfs-actions.pod:3185
10829 "For guests that do not use drive mappings, or if the drive mappings could "
10830 "not be determined, this returns an empty hash table."
10834 #: ../fish/guestfish-actions.pod:2045
10836 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10837 "get-mountpoints>, L</inspect-get-filesystems>."
10841 #: ../fish/guestfish-actions.pod:2049
10842 msgid "inspect-get-filesystems"
10846 #: ../fish/guestfish-actions.pod:2051
10849 " inspect-get-filesystems root\n"
10854 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3206
10856 "This returns a list of all the filesystems that we think are associated with "
10857 "this operating system. This includes the root filesystem, other ordinary "
10858 "filesystems, and non-mounted devices like swap partitions."
10862 #: ../fish/guestfish-actions.pod:2058 ../src/guestfs-actions.pod:3211
10864 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10865 "to be shared between operating systems."
10869 #: ../fish/guestfish-actions.pod:2061
10871 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10872 "get-mountpoints>."
10876 #: ../fish/guestfish-actions.pod:2064
10877 msgid "inspect-get-format"
10881 #: ../fish/guestfish-actions.pod:2066
10884 " inspect-get-format root\n"
10889 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3229
10891 "This returns the format of the inspected operating system. You can use it "
10892 "to detect install images, live CDs and similar."
10896 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3232
10897 msgid "Currently defined formats are:"
10901 #: ../fish/guestfish-actions.pod:2075 ../src/guestfs-actions.pod:3236
10902 msgid "\"installed\""
10906 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3238
10907 msgid "This is an installed operating system."
10911 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3240
10912 msgid "\"installer\""
10916 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3242
10918 "The disk image being inspected is not an installed operating system, but a "
10919 "I<bootable> install disk, live CD, or similar."
10923 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3247
10924 msgid "The format of this disk image is not known."
10928 #: ../fish/guestfish-actions.pod:2095
10929 msgid "inspect-get-hostname"
10933 #: ../fish/guestfish-actions.pod:2097
10936 " inspect-get-hostname root\n"
10941 #: ../fish/guestfish-actions.pod:2099 ../src/guestfs-actions.pod:3267
10943 "This function returns the hostname of the operating system as found by "
10944 "inspection of the guest's configuration files."
10948 #: ../fish/guestfish-actions.pod:2102 ../src/guestfs-actions.pod:3270
10950 "If the hostname could not be determined, then the string C<unknown> is "
10955 #: ../fish/guestfish-actions.pod:2107
10956 msgid "inspect-get-icon"
10960 #: ../fish/guestfish-actions.pod:2109
10963 " inspect-get-icon root [favicon:true|false] [highquality:true|false]\n"
10968 #: ../fish/guestfish-actions.pod:2111 ../src/guestfs-actions.pod:3296
10970 "This function returns an icon corresponding to the inspected operating "
10971 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10972 "to PNG if necessary)."
10976 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3300
10978 "If it was not possible to get an icon this function returns a zero-length "
10979 "(non-NULL) buffer. I<Callers must check for this case>."
10983 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3303
10985 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10986 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10987 "this file will be returned. You can disable favicons by passing the "
10988 "optional C<favicon> boolean as false (default is true)."
10992 #: ../fish/guestfish-actions.pod:2124 ../src/guestfs-actions.pod:3309
10994 "If finding the favicon fails, then we look in other places in the guest for "
10999 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3312
11001 "If the optional C<highquality> boolean is true then only high quality icons "
11002 "are returned, which means only icons of high resolution with an alpha "
11003 "channel. The default (false) is to return any icon we can, even if it is of "
11004 "substandard quality."
11008 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3323
11010 "Unlike most other inspection API calls, the guest's disks must be mounted up "
11011 "before you call this, since it needs to read information from the guest "
11012 "filesystem during the call."
11016 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3329
11018 "B<Security:> The icon data comes from the untrusted guest, and should be "
11019 "treated with caution. PNG files have been known to contain exploits. "
11020 "Ensure that libpng (or other relevant libraries) are fully up to date before "
11021 "trying to process or display the icon."
11025 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3337
11027 "The PNG image returned can be any size. It might not be square. Libguestfs "
11028 "tries to return the largest, highest quality icon available. The "
11029 "application must scale the icon to the required size."
11033 #: ../fish/guestfish-actions.pod:2159 ../src/guestfs-actions.pod:3344
11035 "Extracting icons from Windows guests requires the external C<wrestool> "
11036 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
11037 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
11038 "installed separately."
11042 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3351
11044 "Operating system icons are usually trademarks. Seek legal advice before "
11045 "using trademarks in applications."
11049 #: ../fish/guestfish-actions.pod:2173
11050 msgid "inspect-get-major-version"
11054 #: ../fish/guestfish-actions.pod:2175
11057 " inspect-get-major-version root\n"
11062 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3392
11064 "This returns the major version number of the inspected operating system."
11068 #: ../fish/guestfish-actions.pod:2180 ../src/guestfs-actions.pod:3395
11070 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
11071 "popular public names used by the operating system. Notably the operating "
11072 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
11073 "1). You can find out the real versions corresponding to releases of Windows "
11074 "by consulting Wikipedia or MSDN."
11078 #: ../fish/guestfish-actions.pod:2187 ../fish/guestfish-actions.pod:2198
11079 #: ../src/guestfs-actions.pod:3402 ../src/guestfs-actions.pod:3419
11080 msgid "If the version could not be determined, then C<0> is returned."
11084 #: ../fish/guestfish-actions.pod:2191
11085 msgid "inspect-get-minor-version"
11089 #: ../fish/guestfish-actions.pod:2193
11092 " inspect-get-minor-version root\n"
11097 #: ../fish/guestfish-actions.pod:2195 ../src/guestfs-actions.pod:3416
11099 "This returns the minor version number of the inspected operating system."
11103 #: ../fish/guestfish-actions.pod:2200
11105 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
11106 "get-major-version>."
11110 #: ../fish/guestfish-actions.pod:2203
11111 msgid "inspect-get-mountpoints"
11115 #: ../fish/guestfish-actions.pod:2205
11118 " inspect-get-mountpoints root\n"
11123 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3434
11125 "This returns a hash of where we think the filesystems associated with this "
11126 "operating system should be mounted. Callers should note that this is at "
11127 "best an educated guess made by reading configuration files such as C</etc/"
11128 "fstab>. I<In particular note> that this may return filesystems which are "
11129 "non-existent or not mountable and callers should be prepared to handle or "
11130 "ignore failures if they try to mount them."
11134 #: ../fish/guestfish-actions.pod:2216 ../src/guestfs-actions.pod:3443
11136 "Each element in the returned hashtable has a key which is the path of the "
11137 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
11138 "mounted there (eg. C</dev/sda1>)."
11142 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3448
11144 "Non-mounted devices such as swap devices are I<not> returned in this list."
11148 #: ../fish/guestfish-actions.pod:2224
11150 "For operating systems like Windows which still use drive letters, this call "
11151 "will only return an entry for the first drive \"mounted on\" C</>. For "
11152 "information about the mapping of drive letters to partitions, see L</inspect-"
11153 "get-drive-mappings>."
11157 #: ../fish/guestfish-actions.pod:2230
11159 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
11160 "get-filesystems>."
11164 #: ../fish/guestfish-actions.pod:2233
11165 msgid "inspect-get-package-format"
11169 #: ../fish/guestfish-actions.pod:2235
11172 " inspect-get-package-format root\n"
11177 #: ../fish/guestfish-actions.pod:2237
11179 "This function and L</inspect-get-package-management> return the package "
11180 "format and package management tool used by the inspected operating system. "
11181 "For example for Fedora these functions would return C<rpm> (package format) "
11182 "and C<yum> (package management)."
11186 #: ../fish/guestfish-actions.pod:2243 ../src/guestfs-actions.pod:3480
11188 "This returns the string C<unknown> if we could not determine the package "
11189 "format I<or> if the operating system does not have a real packaging system "
11194 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3484
11196 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
11197 "C<pkgsrc>. Future versions of libguestfs may return other strings."
11201 #: ../fish/guestfish-actions.pod:2253
11202 msgid "inspect-get-package-management"
11206 #: ../fish/guestfish-actions.pod:2255
11209 " inspect-get-package-management root\n"
11214 #: ../fish/guestfish-actions.pod:2257
11216 "L</inspect-get-package-format> and this function return the package format "
11217 "and package management tool used by the inspected operating system. For "
11218 "example for Fedora these functions would return C<rpm> (package format) and "
11219 "C<yum> (package management)."
11223 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3507
11225 "This returns the string C<unknown> if we could not determine the package "
11226 "management tool I<or> if the operating system does not have a real packaging "
11227 "system (eg. Windows)."
11231 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3511
11233 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
11234 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
11235 "versions of libguestfs may return other strings."
11239 #: ../fish/guestfish-actions.pod:2274
11240 msgid "inspect-get-product-name"
11244 #: ../fish/guestfish-actions.pod:2276
11247 " inspect-get-product-name root\n"
11252 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3529
11254 "This returns the product name of the inspected operating system. The "
11255 "product name is generally some freeform string which can be displayed to the "
11256 "user, but should not be parsed by programs."
11260 #: ../fish/guestfish-actions.pod:2283 ../src/guestfs-actions.pod:3534
11262 "If the product name could not be determined, then the string C<unknown> is "
11267 #: ../fish/guestfish-actions.pod:2288
11268 msgid "inspect-get-product-variant"
11272 #: ../fish/guestfish-actions.pod:2290
11275 " inspect-get-product-variant root\n"
11280 #: ../fish/guestfish-actions.pod:2292 ../src/guestfs-actions.pod:3550
11281 msgid "This returns the product variant of the inspected operating system."
11285 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3553
11287 "For Windows guests, this returns the contents of the Registry key C<HKLM"
11288 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
11289 "is usually a string such as C<Client> or C<Server> (other values are "
11290 "possible). This can be used to distinguish consumer and enterprise versions "
11291 "of Windows that have the same version number (for example, Windows 7 and "
11292 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
11293 "the latter is C<Server>)."
11297 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3562
11299 "For enterprise Linux guests, in future we intend this to return the product "
11300 "variant such as C<Desktop>, C<Server> and so on. But this is not "
11301 "implemented at present."
11305 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3566
11307 "If the product variant could not be determined, then the string C<unknown> "
11312 #: ../fish/guestfish-actions.pod:2311
11314 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
11315 "get-product-name>, L</inspect-get-major-version>."
11319 #: ../fish/guestfish-actions.pod:2315
11320 msgid "inspect-get-roots"
11324 #: ../fish/guestfish-actions.pod:2317
11327 " inspect-get-roots\n"
11332 #: ../fish/guestfish-actions.pod:2319
11334 "This function is a convenient way to get the list of root devices, as "
11335 "returned from a previous call to L</inspect-os>, but without redoing the "
11336 "whole inspection process."
11340 #: ../fish/guestfish-actions.pod:2323
11342 "This returns an empty list if either no root devices were found or the "
11343 "caller has not called L</inspect-os>."
11347 #: ../fish/guestfish-actions.pod:2328
11348 msgid "inspect-get-type"
11352 #: ../fish/guestfish-actions.pod:2330
11355 " inspect-get-type root\n"
11360 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3604
11362 "This returns the type of the inspected operating system. Currently defined "
11367 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3609
11372 #: ../fish/guestfish-actions.pod:2339 ../src/guestfs-actions.pod:3611
11373 msgid "Any Linux-based operating system."
11377 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3615
11378 msgid "Any Microsoft Windows operating system."
11382 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3617
11383 msgid "\"freebsd\""
11387 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3619
11392 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3621
11397 #: ../fish/guestfish-actions.pod:2351 ../src/guestfs-actions.pod:3623
11402 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3627
11403 msgid "The operating system type could not be determined."
11407 #: ../fish/guestfish-actions.pod:2364
11408 msgid "inspect-get-windows-current-control-set"
11412 #: ../fish/guestfish-actions.pod:2366
11415 " inspect-get-windows-current-control-set root\n"
11420 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3647
11422 "This returns the Windows CurrentControlSet of the inspected guest. The "
11423 "CurrentControlSet is a registry key name such as C<ControlSet001>."
11427 #: ../fish/guestfish-actions.pod:2371 ../src/guestfs-actions.pod:3650
11429 "This call assumes that the guest is Windows and that the Registry could be "
11430 "examined by inspection. If this is not the case then an error is returned."
11434 #: ../fish/guestfish-actions.pod:2377
11435 msgid "inspect-get-windows-systemroot"
11439 #: ../fish/guestfish-actions.pod:2379
11442 " inspect-get-windows-systemroot root\n"
11447 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3667
11449 "This returns the Windows systemroot of the inspected guest. The systemroot "
11450 "is a directory path such as C</WINDOWS>."
11454 #: ../fish/guestfish-actions.pod:2384 ../src/guestfs-actions.pod:3670
11456 "This call assumes that the guest is Windows and that the systemroot could be "
11457 "determined by inspection. If this is not the case then an error is returned."
11461 #: ../fish/guestfish-actions.pod:2390
11462 msgid "inspect-is-live"
11466 #: ../fish/guestfish-actions.pod:2392
11469 " inspect-is-live root\n"
11474 #: ../fish/guestfish-actions.pod:2394
11476 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
11477 "then this returns true if a live image was detected on the disk."
11481 #: ../fish/guestfish-actions.pod:2400
11482 msgid "inspect-is-multipart"
11486 #: ../fish/guestfish-actions.pod:2402
11489 " inspect-is-multipart root\n"
11494 #: ../fish/guestfish-actions.pod:2404
11496 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
11497 "then this returns true if the disk is part of a set."
11501 #: ../fish/guestfish-actions.pod:2410
11502 msgid "inspect-is-netinst"
11506 #: ../fish/guestfish-actions.pod:2412
11509 " inspect-is-netinst root\n"
11514 #: ../fish/guestfish-actions.pod:2414
11516 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
11517 "then this returns true if the disk is a network installer, ie. not a self-"
11518 "contained install CD but one which is likely to require network access to "
11519 "complete the install."
11523 #: ../fish/guestfish-actions.pod:2422
11524 msgid "inspect-list-applications"
11528 #: ../fish/guestfish-actions.pod:2424
11531 " inspect-list-applications root\n"
11536 #: ../fish/guestfish-actions.pod:2426 ../src/guestfs-actions.pod:3737
11537 msgid "Return the list of applications installed in the operating system."
11541 #: ../fish/guestfish-actions.pod:2428
11543 "I<Note:> This call works differently from other parts of the inspection "
11544 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
11545 "then mount up the disks, before calling this. Listing applications is a "
11546 "significantly more difficult operation which requires access to the full "
11547 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
11548 "are just returning data cached in the libguestfs handle, this call actually "
11549 "reads parts of the mounted filesystems during the call."
11553 #: ../fish/guestfish-actions.pod:2438 ../src/guestfs-actions.pod:3749
11555 "This returns an empty list if the inspection code was not able to determine "
11556 "the list of applications."
11560 #: ../fish/guestfish-actions.pod:2441 ../src/guestfs-actions.pod:3752
11561 msgid "The application structure contains the following fields:"
11565 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3756
11566 msgid "C<app_name>"
11570 #: ../fish/guestfish-actions.pod:2447 ../src/guestfs-actions.pod:3758
11572 "The name of the application. For Red Hat-derived and Debian-derived Linux "
11573 "guests, this is the package name."
11577 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3761
11578 msgid "C<app_display_name>"
11582 #: ../fish/guestfish-actions.pod:2452 ../src/guestfs-actions.pod:3763
11584 "The display name of the application, sometimes localized to the install "
11585 "language of the guest operating system."
11589 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3766
11591 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
11592 "to display something can use C<app_name> instead."
11596 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3769
11597 msgid "C<app_epoch>"
11601 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3771
11603 "For package managers which use epochs, this contains the epoch of the "
11604 "package (an integer). If unavailable, this is returned as C<0>."
11608 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3774
11609 msgid "C<app_version>"
11613 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3776
11615 "The version string of the application or package. If unavailable this is "
11616 "returned as an empty string C<\"\">."
11620 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3779
11621 msgid "C<app_release>"
11625 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3781
11627 "The release string of the application or package, for package managers that "
11628 "use this. If unavailable this is returned as an empty string C<\"\">."
11632 #: ../fish/guestfish-actions.pod:2474 ../src/guestfs-actions.pod:3785
11633 msgid "C<app_install_path>"
11637 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3787
11639 "The installation path of the application (on operating systems such as "
11640 "Windows which use installation paths). This path is in the format used by "
11641 "the guest operating system, it is not a libguestfs path."
11645 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3792
11646 msgid "If unavailable this is returned as an empty string C<\"\">."
11650 #: ../fish/guestfish-actions.pod:2483 ../src/guestfs-actions.pod:3794
11651 msgid "C<app_trans_path>"
11655 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3796
11657 "The install path translated into a libguestfs path. If unavailable this is "
11658 "returned as an empty string C<\"\">."
11662 #: ../fish/guestfish-actions.pod:2488 ../src/guestfs-actions.pod:3799
11663 msgid "C<app_publisher>"
11667 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3801
11669 "The name of the publisher of the application, for package managers that use "
11670 "this. If unavailable this is returned as an empty string C<\"\">."
11674 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3805
11679 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3807
11681 "The URL (eg. upstream URL) of the application. If unavailable this is "
11682 "returned as an empty string C<\"\">."
11686 #: ../fish/guestfish-actions.pod:2499 ../src/guestfs-actions.pod:3810
11687 msgid "C<app_source_package>"
11691 #: ../fish/guestfish-actions.pod:2501 ../src/guestfs-actions.pod:3812
11693 "For packaging systems which support this, the name of the source package. "
11694 "If unavailable this is returned as an empty string C<\"\">."
11698 #: ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:3815
11699 msgid "C<app_summary>"
11703 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:3817
11705 "A short (usually one line) description of the application or package. If "
11706 "unavailable this is returned as an empty string C<\"\">."
11710 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3820
11711 msgid "C<app_description>"
11715 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3822
11717 "A longer description of the application or package. If unavailable this is "
11718 "returned as an empty string C<\"\">."
11722 #: ../fish/guestfish-actions.pod:2518
11727 #: ../fish/guestfish-actions.pod:2520
11735 #: ../fish/guestfish-actions.pod:2522 ../src/guestfs-actions.pod:3840
11737 "This function uses other libguestfs functions and certain heuristics to "
11738 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
11739 "for operating systems."
11743 #: ../fish/guestfish-actions.pod:2526 ../src/guestfs-actions.pod:3844
11744 msgid "The list returned is empty if no operating systems were found."
11748 #: ../fish/guestfish-actions.pod:2528 ../src/guestfs-actions.pod:3846
11750 "If one operating system was found, then this returns a list with a single "
11751 "element, which is the name of the root filesystem of this operating system. "
11752 "It is also possible for this function to return a list containing more than "
11753 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
11754 "element being the root filesystem of one of the operating systems."
11758 #: ../fish/guestfish-actions.pod:2535
11760 "You can pass the root string(s) returned to other L</inspect-get-*> "
11761 "functions in order to query further information about each operating system, "
11762 "such as the name and version."
11766 #: ../fish/guestfish-actions.pod:2540
11768 "This function uses other libguestfs features such as L</mount-ro> and L</"
11769 "umount-all> in order to mount and unmount filesystems and look at the "
11770 "contents. This should be called with no disks currently mounted. The "
11771 "function may also use Augeas, so any existing Augeas handle will be closed."
11775 #: ../fish/guestfish-actions.pod:2546 ../src/guestfs-actions.pod:3864
11777 "This function cannot decrypt encrypted disks. The caller must do that first "
11778 "(supplying the necessary keys) if the disk is encrypted."
11782 #: ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2750
11783 #: ../fish/guestfish-actions.pod:2815
11784 msgid "See also L</list-filesystems>."
11788 #: ../fish/guestfish-actions.pod:2554
11789 msgid "is-blockdev"
11793 #: ../fish/guestfish-actions.pod:2556
11796 " is-blockdev path\n"
11801 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3884
11803 "This returns C<true> if and only if there is a block device with the given "
11808 #: ../fish/guestfish-actions.pod:2561 ../fish/guestfish-actions.pod:2579
11809 #: ../fish/guestfish-actions.pod:2598 ../fish/guestfish-actions.pod:2607
11810 #: ../fish/guestfish-actions.pod:2617 ../fish/guestfish-actions.pod:2651
11811 #: ../fish/guestfish-actions.pod:2660
11812 msgid "See also L</stat>."
11816 #: ../fish/guestfish-actions.pod:2563
11821 #: ../fish/guestfish-actions.pod:2565
11829 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3898
11831 "This returns true iff this handle is busy processing a command (in the "
11836 #: ../fish/guestfish-actions.pod:2572
11841 #: ../fish/guestfish-actions.pod:2574
11844 " is-chardev path\n"
11849 #: ../fish/guestfish-actions.pod:2576 ../src/guestfs-actions.pod:3913
11851 "This returns C<true> if and only if there is a character device with the "
11852 "given C<path> name."
11856 #: ../fish/guestfish-actions.pod:2581
11861 #: ../fish/guestfish-actions.pod:2583
11869 #: ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:3927
11871 "This returns true iff this handle is being configured (in the C<CONFIG> "
11876 #: ../fish/guestfish-actions.pod:2590
11881 #: ../fish/guestfish-actions.pod:2592
11889 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3942
11891 "This returns C<true> if and only if there is a directory with the given "
11892 "C<path> name. Note that it returns false for other objects like files."
11896 #: ../fish/guestfish-actions.pod:2600
11901 #: ../fish/guestfish-actions.pod:2602
11909 #: ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:3958
11911 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11912 "given C<path> name."
11916 #: ../fish/guestfish-actions.pod:2609
11921 #: ../fish/guestfish-actions.pod:2611
11929 #: ../fish/guestfish-actions.pod:2613 ../src/guestfs-actions.pod:3973
11931 "This returns C<true> if and only if there is a regular file with the given "
11932 "C<path> name. Note that it returns false for other objects like directories."
11936 #: ../fish/guestfish-actions.pod:2619
11937 msgid "is-launching"
11941 #: ../fish/guestfish-actions.pod:2621
11949 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3988
11951 "This returns true iff this handle is launching the subprocess (in the "
11952 "C<LAUNCHING> state)."
11956 #: ../fish/guestfish-actions.pod:2628
11961 #: ../fish/guestfish-actions.pod:2630
11969 #: ../fish/guestfish-actions.pod:2632 ../src/guestfs-actions.pod:4003
11971 "This command tests whether C<device> is a logical volume, and returns true "
11972 "iff this is the case."
11976 #: ../fish/guestfish-actions.pod:2635
11981 #: ../fish/guestfish-actions.pod:2637
11989 #: ../fish/guestfish-actions.pod:2639 ../src/guestfs-actions.pod:4015
11991 "This returns true iff this handle is ready to accept commands (in the "
11996 #: ../fish/guestfish-actions.pod:2644
12001 #: ../fish/guestfish-actions.pod:2646
12004 " is-socket path\n"
12009 #: ../fish/guestfish-actions.pod:2648 ../src/guestfs-actions.pod:4030
12011 "This returns C<true> if and only if there is a Unix domain socket with the "
12012 "given C<path> name."
12016 #: ../fish/guestfish-actions.pod:2653
12021 #: ../fish/guestfish-actions.pod:2655
12024 " is-symlink path\n"
12029 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:4045
12031 "This returns C<true> if and only if there is a symbolic link with the given "
12036 #: ../fish/guestfish-actions.pod:2662
12041 #: ../fish/guestfish-actions.pod:2664
12049 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:4060
12051 "This returns true iff the file exists and the file is empty or it contains "
12056 #: ../fish/guestfish-actions.pod:2669
12057 msgid "is-zero-device"
12061 #: ../fish/guestfish-actions.pod:2671
12064 " is-zero-device device\n"
12069 #: ../fish/guestfish-actions.pod:2673 ../src/guestfs-actions.pod:4073
12070 msgid "This returns true iff the device exists and contains all zero bytes."
12074 #: ../fish/guestfish-actions.pod:2675 ../src/guestfs-actions.pod:4075
12075 msgid "Note that for large devices this can take a long time to run."
12079 #: ../fish/guestfish-actions.pod:2677
12080 msgid "kill-subprocess"
12084 #: ../fish/guestfish-actions.pod:2679
12087 " kill-subprocess\n"
12092 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:4086
12093 msgid "This kills the qemu subprocess. You should never need to call this."
12097 #: ../fish/guestfish-actions.pod:2683
12102 #: ../fish/guestfish-actions.pod:2685
12107 #: ../fish/guestfish-actions.pod:2687
12115 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4097
12117 "Internally libguestfs is implemented by running a virtual machine using "
12122 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:4100
12124 "You should call this after configuring the handle (eg. adding drives) but "
12125 "before performing any actions."
12129 #: ../fish/guestfish-actions.pod:2695
12134 #: ../fish/guestfish-actions.pod:2697
12137 " lchown owner group path\n"
12142 #: ../fish/guestfish-actions.pod:2699
12144 "Change the file owner to C<owner> and group to C<group>. This is like L</"
12145 "chown> but if C<path> is a symlink then the link itself is changed, not the "
12150 #: ../fish/guestfish-actions.pod:2707
12155 #: ../fish/guestfish-actions.pod:2709
12158 " lgetxattr path name\n"
12163 #: ../fish/guestfish-actions.pod:2711 ../src/guestfs-actions.pod:4140
12165 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
12166 "is a symlink, then this call returns an extended attribute from the symlink."
12170 #: ../fish/guestfish-actions.pod:2725
12171 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
12175 #: ../fish/guestfish-actions.pod:2727
12180 #: ../fish/guestfish-actions.pod:2729
12183 " lgetxattrs path\n"
12188 #: ../fish/guestfish-actions.pod:2731
12190 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
12191 "it returns the extended attributes of the link itself."
12195 #: ../fish/guestfish-actions.pod:2735
12200 #: ../fish/guestfish-actions.pod:2737
12208 #: ../fish/guestfish-actions.pod:2739 ../src/guestfs-actions.pod:4183
12210 "List all 9p filesystems attached to the guest. A list of mount tags is "
12215 #: ../fish/guestfish-actions.pod:2742
12216 msgid "list-devices"
12220 #: ../fish/guestfish-actions.pod:2744
12228 #: ../fish/guestfish-actions.pod:2746 ../src/guestfs-actions.pod:4197
12229 msgid "List all the block devices."
12233 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4199
12234 msgid "The full block device names are returned, eg. C</dev/sda>."
12238 #: ../fish/guestfish-actions.pod:2752
12239 msgid "list-dm-devices"
12243 #: ../fish/guestfish-actions.pod:2754
12246 " list-dm-devices\n"
12251 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4214
12252 msgid "List all device mapper devices."
12256 #: ../fish/guestfish-actions.pod:2758
12258 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
12259 "previous call to L</luks-open>."
12263 #: ../fish/guestfish-actions.pod:2761
12265 "Device mapper devices which correspond to logical volumes are I<not> "
12266 "returned in this list. Call L</lvs> if you want to list logical volumes."
12270 #: ../fish/guestfish-actions.pod:2765
12271 msgid "list-filesystems"
12275 #: ../fish/guestfish-actions.pod:2767
12278 " list-filesystems\n"
12283 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4234
12285 "This inspection command looks for filesystems on partitions, block devices "
12286 "and logical volumes, returning a list of devices containing filesystems and "
12291 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4238
12293 "The return value is a hash, where the keys are the devices containing "
12294 "filesystems, and the values are the filesystem types. For example:"
12298 #: ../fish/guestfish-actions.pod:2777 ../src/guestfs-actions.pod:4242
12301 " \"/dev/sda1\" => \"ntfs\"\n"
12302 " \"/dev/sda2\" => \"ext2\"\n"
12303 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
12304 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
12309 #: ../fish/guestfish-actions.pod:2782 ../src/guestfs-actions.pod:4247
12311 "The value can have the special value \"unknown\", meaning the content of the "
12312 "device is undetermined or empty. \"swap\" means a Linux swap partition."
12316 #: ../fish/guestfish-actions.pod:2786
12318 "This command runs other libguestfs commands, which might include L</mount> "
12319 "and L</umount>, and therefore you should use this soon after launch and only "
12320 "when nothing is mounted."
12324 #: ../fish/guestfish-actions.pod:2790
12326 "Not all of the filesystems returned will be mountable. In particular, swap "
12327 "partitions are returned in the list. Also this command does not check that "
12328 "each filesystem found is valid and mountable, and some filesystems might be "
12329 "mountable but require special options. Filesystems may not all belong to a "
12330 "single logical operating system (use L</inspect-os> to look for OSes)."
12334 #: ../fish/guestfish-actions.pod:2798
12335 msgid "list-md-devices"
12339 #: ../fish/guestfish-actions.pod:2800
12342 " list-md-devices\n"
12347 #: ../fish/guestfish-actions.pod:2802 ../src/guestfs-actions.pod:4276
12348 msgid "List all Linux md devices."
12352 #: ../fish/guestfish-actions.pod:2804
12353 msgid "list-partitions"
12357 #: ../fish/guestfish-actions.pod:2806
12360 " list-partitions\n"
12365 #: ../fish/guestfish-actions.pod:2808 ../src/guestfs-actions.pod:4287
12366 msgid "List all the partitions detected on all block devices."
12370 #: ../fish/guestfish-actions.pod:2810 ../src/guestfs-actions.pod:4289
12371 msgid "The full partition device names are returned, eg. C</dev/sda1>"
12375 #: ../fish/guestfish-actions.pod:2812
12377 "This does not return logical volumes. For that you will need to call L</"
12382 #: ../fish/guestfish-actions.pod:2817
12387 #: ../fish/guestfish-actions.pod:2819
12395 #: ../fish/guestfish-actions.pod:2821 ../src/guestfs-actions.pod:4308
12397 "List the files in C<directory> (relative to the root directory, there is no "
12398 "cwd) in the format of 'ls -la'."
12402 #: ../fish/guestfish-actions.pod:2824 ../src/guestfs-actions.pod:4311
12404 "This command is mostly useful for interactive sessions. It is I<not> "
12405 "intended that you try to parse the output string."
12409 #: ../fish/guestfish-actions.pod:2827
12414 #: ../fish/guestfish-actions.pod:2829
12417 " ln target linkname\n"
12422 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4326
12423 msgid "This command creates a hard link using the C<ln> command."
12427 #: ../fish/guestfish-actions.pod:2833
12432 #: ../fish/guestfish-actions.pod:2835
12435 " ln-f target linkname\n"
12440 #: ../fish/guestfish-actions.pod:2837 ../src/guestfs-actions.pod:4339
12442 "This command creates a hard link using the C<ln -f> command. The I<-f> "
12443 "option removes the link (C<linkname>) if it exists already."
12447 #: ../fish/guestfish-actions.pod:2840
12452 #: ../fish/guestfish-actions.pod:2842
12455 " ln-s target linkname\n"
12460 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4353
12461 msgid "This command creates a symbolic link using the C<ln -s> command."
12465 #: ../fish/guestfish-actions.pod:2846
12470 #: ../fish/guestfish-actions.pod:2848
12473 " ln-sf target linkname\n"
12478 #: ../fish/guestfish-actions.pod:2850 ../src/guestfs-actions.pod:4366
12480 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
12481 "option removes the link (C<linkname>) if it exists already."
12485 #: ../fish/guestfish-actions.pod:2853
12486 msgid "lremovexattr"
12490 #: ../fish/guestfish-actions.pod:2855
12493 " lremovexattr xattr path\n"
12498 #: ../fish/guestfish-actions.pod:2857
12500 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
12501 "it removes an extended attribute of the link itself."
12505 #: ../fish/guestfish-actions.pod:2861
12510 #: ../fish/guestfish-actions.pod:2863
12518 #: ../fish/guestfish-actions.pod:2865 ../src/guestfs-actions.pod:4394
12520 "List the files in C<directory> (relative to the root directory, there is no "
12521 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
12525 #: ../fish/guestfish-actions.pod:2869
12527 "This command is mostly useful for interactive sessions. Programs should "
12528 "probably use L</readdir> instead."
12532 #: ../fish/guestfish-actions.pod:2872
12537 #: ../fish/guestfish-actions.pod:2874
12540 " lsetxattr xattr val vallen path\n"
12545 #: ../fish/guestfish-actions.pod:2876
12547 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
12548 "sets an extended attribute of the link itself."
12552 #: ../fish/guestfish-actions.pod:2880
12557 #: ../fish/guestfish-actions.pod:2882
12565 #: ../fish/guestfish-actions.pod:2884 ../fish/guestfish-actions.pod:4775
12566 #: ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:7349
12567 msgid "Returns file information for the given C<path>."
12571 #: ../fish/guestfish-actions.pod:2886
12573 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
12574 "the link is stat-ed, not the file it refers to."
12578 #: ../fish/guestfish-actions.pod:2890 ../src/guestfs-actions.pod:4436
12579 msgid "This is the same as the C<lstat(2)> system call."
12583 #: ../fish/guestfish-actions.pod:2892
12588 #: ../fish/guestfish-actions.pod:2894
12591 " lstatlist path 'names ...'\n"
12596 #: ../fish/guestfish-actions.pod:2896
12598 "This call allows you to perform the L</lstat> operation on multiple files, "
12599 "where all files are in the directory C<path>. C<names> is the list of files "
12600 "from this directory."
12604 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4455
12606 "On return you get a list of stat structs, with a one-to-one correspondence "
12607 "to the C<names> list. If any name did not exist or could not be lstat'd, "
12608 "then the C<ino> field of that structure is set to C<-1>."
12612 #: ../fish/guestfish-actions.pod:2905
12614 "This call is intended for programs that want to efficiently list a directory "
12615 "contents without making many round-trips. See also L</lxattrlist> for a "
12616 "similarly efficient call for getting extended attributes. Very long "
12617 "directory listings might cause the protocol message size to be exceeded, "
12618 "causing this call to fail. The caller must split up such requests into "
12619 "smaller groups of names."
12623 #: ../fish/guestfish-actions.pod:2913
12624 msgid "luks-add-key"
12628 #: ../fish/guestfish-actions.pod:2915
12631 " luks-add-key device keyslot\n"
12636 #: ../fish/guestfish-actions.pod:2917 ../src/guestfs-actions.pod:4483
12638 "This command adds a new key on LUKS device C<device>. C<key> is any "
12639 "existing key, and is used to access the device. C<newkey> is the new key to "
12640 "add. C<keyslot> is the key slot that will be replaced."
12644 #: ../fish/guestfish-actions.pod:2922
12646 "Note that if C<keyslot> already contains a key, then this command will "
12647 "fail. You have to use L</luks-kill-slot> first to remove that key."
12651 #: ../fish/guestfish-actions.pod:2926 ../fish/guestfish-actions.pod:2948
12652 #: ../fish/guestfish-actions.pod:2958 ../fish/guestfish-actions.pod:2969
12653 #: ../fish/guestfish-actions.pod:2995 ../fish/guestfish-actions.pod:3005
12655 "This command has one or more key or passphrase parameters. Guestfish will "
12656 "prompt for these separately."
12660 #: ../fish/guestfish-actions.pod:2929
12665 #: ../fish/guestfish-actions.pod:2931
12668 " luks-close device\n"
12673 #: ../fish/guestfish-actions.pod:2933
12675 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
12676 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
12677 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
12682 #: ../fish/guestfish-actions.pod:2939
12683 msgid "luks-format"
12687 #: ../fish/guestfish-actions.pod:2941
12690 " luks-format device keyslot\n"
12695 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4524
12697 "This command erases existing data on C<device> and formats the device as a "
12698 "LUKS encrypted device. C<key> is the initial key, which is added to key "
12699 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
12703 #: ../fish/guestfish-actions.pod:2951
12704 msgid "luks-format-cipher"
12708 #: ../fish/guestfish-actions.pod:2953
12711 " luks-format-cipher device keyslot cipher\n"
12716 #: ../fish/guestfish-actions.pod:2955
12718 "This command is the same as L</luks-format> but it also allows you to set "
12719 "the C<cipher> used."
12723 #: ../fish/guestfish-actions.pod:2961
12724 msgid "luks-kill-slot"
12728 #: ../fish/guestfish-actions.pod:2963
12731 " luks-kill-slot device keyslot\n"
12736 #: ../fish/guestfish-actions.pod:2965 ../src/guestfs-actions.pod:4565
12738 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
12739 "device C<device>. C<key> must be one of the I<other> keys."
12743 #: ../fish/guestfish-actions.pod:2972
12748 #: ../fish/guestfish-actions.pod:2974
12751 " luks-open device mapname\n"
12756 #: ../fish/guestfish-actions.pod:2976 ../src/guestfs-actions.pod:4585
12758 "This command opens a block device which has been encrypted according to the "
12759 "Linux Unified Key Setup (LUKS) standard."
12763 #: ../fish/guestfish-actions.pod:2979 ../src/guestfs-actions.pod:4588
12764 msgid "C<device> is the encrypted block device or partition."
12768 #: ../fish/guestfish-actions.pod:2981 ../src/guestfs-actions.pod:4590
12770 "The caller must supply one of the keys associated with the LUKS block "
12771 "device, in the C<key> parameter."
12775 #: ../fish/guestfish-actions.pod:2984 ../src/guestfs-actions.pod:4593
12777 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
12778 "writes to this block device are decrypted from and encrypted to the "
12779 "underlying C<device> respectively."
12783 #: ../fish/guestfish-actions.pod:2988
12785 "If this block device contains LVM volume groups, then calling L</vgscan> "
12786 "followed by L</vg-activate-all> will make them visible."
12790 #: ../fish/guestfish-actions.pod:2992
12791 msgid "Use L</list-dm-devices> to list all device mapper devices."
12795 #: ../fish/guestfish-actions.pod:2998
12796 msgid "luks-open-ro"
12800 #: ../fish/guestfish-actions.pod:3000
12803 " luks-open-ro device mapname\n"
12808 #: ../fish/guestfish-actions.pod:3002
12810 "This is the same as L</luks-open> except that a read-only mapping is created."
12814 #: ../fish/guestfish-actions.pod:3008
12819 #: ../fish/guestfish-actions.pod:3010
12822 " lvcreate logvol volgroup mbytes\n"
12827 #: ../fish/guestfish-actions.pod:3012 ../src/guestfs-actions.pod:4639
12829 "This creates an LVM logical volume called C<logvol> on the volume group "
12830 "C<volgroup>, with C<size> megabytes."
12834 #: ../fish/guestfish-actions.pod:3015
12835 msgid "lvm-canonical-lv-name"
12839 #: ../fish/guestfish-actions.pod:3017
12842 " lvm-canonical-lv-name lvname\n"
12847 #: ../fish/guestfish-actions.pod:3019 ../src/guestfs-actions.pod:4652
12849 "This converts alternative naming schemes for LVs that you might find to the "
12850 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
12855 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4656
12857 "This command returns an error if the C<lvname> parameter does not refer to a "
12862 #: ../fish/guestfish-actions.pod:3026
12863 msgid "See also L</is-lv>."
12867 #: ../fish/guestfish-actions.pod:3028
12868 msgid "lvm-clear-filter"
12872 #: ../fish/guestfish-actions.pod:3030
12875 " lvm-clear-filter\n"
12880 #: ../fish/guestfish-actions.pod:3032
12882 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
12887 #: ../fish/guestfish-actions.pod:3035 ../fish/guestfish-actions.pod:3063
12888 #: ../src/guestfs-actions.pod:4674 ../src/guestfs-actions.pod:4713
12890 "This command also clears the LVM cache and performs a volume group scan."
12894 #: ../fish/guestfish-actions.pod:3038
12895 msgid "lvm-remove-all"
12899 #: ../fish/guestfish-actions.pod:3040
12902 " lvm-remove-all\n"
12907 #: ../fish/guestfish-actions.pod:3042 ../src/guestfs-actions.pod:4686
12909 "This command removes all LVM logical volumes, volume groups and physical "
12914 #: ../fish/guestfish-actions.pod:3045
12915 msgid "lvm-set-filter"
12919 #: ../fish/guestfish-actions.pod:3047
12922 " lvm-set-filter 'devices ...'\n"
12927 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4699
12929 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12930 "block devices in the list C<devices>, and will ignore all other attached "
12935 #: ../fish/guestfish-actions.pod:3053 ../src/guestfs-actions.pod:4703
12937 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12938 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12939 "there are two types of duplication possible: either cloned PVs/VGs which "
12940 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12941 "same name. In normal operation you cannot create this situation, but you "
12942 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12943 "inside the LVM metadata."
12947 #: ../fish/guestfish-actions.pod:3066 ../src/guestfs-actions.pod:4716
12948 msgid "You can filter whole block devices or individual partitions."
12952 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4718
12954 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12955 "filesystem), even if you are not filtering out that VG."
12959 #: ../fish/guestfish-actions.pod:3072
12964 #: ../fish/guestfish-actions.pod:3074
12967 " lvremove device\n"
12972 #: ../fish/guestfish-actions.pod:3076 ../src/guestfs-actions.pod:4732
12974 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12975 "LV, such as C</dev/VG/LV>."
12979 #: ../fish/guestfish-actions.pod:3079 ../src/guestfs-actions.pod:4735
12981 "You can also remove all LVs in a volume group by specifying the VG name, C</"
12986 #: ../fish/guestfish-actions.pod:3082
12991 #: ../fish/guestfish-actions.pod:3084
12994 " lvrename logvol newlogvol\n"
12999 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4749
13000 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
13004 #: ../fish/guestfish-actions.pod:3088
13009 #: ../fish/guestfish-actions.pod:3090
13012 " lvresize device mbytes\n"
13017 #: ../fish/guestfish-actions.pod:3092 ../src/guestfs-actions.pod:4762
13019 "This resizes (expands or shrinks) an existing LVM logical volume to "
13020 "C<mbytes>. When reducing, data in the reduced part is lost."
13024 #: ../fish/guestfish-actions.pod:3096
13025 msgid "lvresize-free"
13029 #: ../fish/guestfish-actions.pod:3098
13032 " lvresize-free lv percent\n"
13037 #: ../fish/guestfish-actions.pod:3100 ../src/guestfs-actions.pod:4777
13039 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
13040 "remaining free space in the volume group. Commonly you would call this with "
13041 "pc = 100 which expands the logical volume as much as possible, using all "
13042 "remaining free space in the volume group."
13046 #: ../fish/guestfish-actions.pod:3106
13051 #: ../fish/guestfish-actions.pod:3108
13059 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4792
13061 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13066 #: ../fish/guestfish-actions.pod:3113 ../src/guestfs-actions.pod:4795
13068 "This returns a list of the logical volume device names (eg. C</dev/"
13069 "VolGroup00/LogVol00>)."
13073 #: ../fish/guestfish-actions.pod:3116
13074 msgid "See also L</lvs-full>, L</list-filesystems>."
13078 #: ../fish/guestfish-actions.pod:3118
13083 #: ../fish/guestfish-actions.pod:3120
13091 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4811
13093 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13094 "(8)> command. The \"full\" version includes all fields."
13098 #: ../fish/guestfish-actions.pod:3125
13103 #: ../fish/guestfish-actions.pod:3127
13111 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4826
13112 msgid "This command returns the UUID of the LVM LV C<device>."
13116 #: ../fish/guestfish-actions.pod:3131
13121 #: ../fish/guestfish-actions.pod:3133
13124 " lxattrlist path 'names ...'\n"
13129 #: ../fish/guestfish-actions.pod:3135 ../src/guestfs-actions.pod:4840
13131 "This call allows you to get the extended attributes of multiple files, where "
13132 "all files are in the directory C<path>. C<names> is the list of files from "
13137 #: ../fish/guestfish-actions.pod:3139 ../src/guestfs-actions.pod:4844
13139 "On return you get a flat list of xattr structs which must be interpreted "
13140 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
13141 "C<attrval> in this struct is zero-length to indicate there was an error "
13142 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
13143 "number (the number of following attributes for this file, which could be C<"
13144 "\"0\">). Then after the first xattr struct are the zero or more attributes "
13145 "for the first named file. This repeats for the second and subsequent files."
13149 #: ../fish/guestfish-actions.pod:3149
13151 "This call is intended for programs that want to efficiently list a directory "
13152 "contents without making many round-trips. See also L</lstatlist> for a "
13153 "similarly efficient call for getting standard stats. Very long directory "
13154 "listings might cause the protocol message size to be exceeded, causing this "
13155 "call to fail. The caller must split up such requests into smaller groups of "
13160 #: ../fish/guestfish-actions.pod:3157
13161 msgid "mdadm-create"
13165 #: ../fish/guestfish-actions.pod:3159
13168 " mdadm-create name 'devices ...' [missingbitmap:N] [nrdevices:N] [spare:N] [chunk:N] [level:..]\n"
13173 #: ../fish/guestfish-actions.pod:3161 ../src/guestfs-actions.pod:4887
13175 "Create a Linux md (RAID) device named C<name> on the devices in the list "
13180 #: ../fish/guestfish-actions.pod:3168 ../src/guestfs-actions.pod:4894
13181 msgid "C<missingbitmap>"
13185 #: ../fish/guestfish-actions.pod:3170 ../src/guestfs-actions.pod:4896
13187 "A bitmap of missing devices. If a bit is set it means that a missing device "
13188 "is added to the array. The least significant bit corresponds to the first "
13189 "device in the array."
13193 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4900
13194 msgid "As examples:"
13198 #: ../fish/guestfish-actions.pod:3176 ../src/guestfs-actions.pod:4902
13200 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x1> then the resulting "
13201 "array would be C<[E<lt>missingE<gt>, \"/dev/sda\"]>."
13205 #: ../fish/guestfish-actions.pod:3179 ../src/guestfs-actions.pod:4905
13207 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x2> then the resulting "
13208 "array would be C<[\"/dev/sda\", E<lt>missingE<gt>]>."
13212 #: ../fish/guestfish-actions.pod:3182 ../src/guestfs-actions.pod:4908
13213 msgid "This defaults to C<0> (no missing devices)."
13217 #: ../fish/guestfish-actions.pod:3184 ../src/guestfs-actions.pod:4910
13219 "The length of C<devices> + the number of bits set in C<missingbitmap> must "
13220 "equal C<nrdevices> + C<spare>."
13224 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4913
13225 msgid "C<nrdevices>"
13229 #: ../fish/guestfish-actions.pod:3189 ../src/guestfs-actions.pod:4915
13230 msgid "The number of active RAID devices."
13234 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4917
13236 "If not set, this defaults to the length of C<devices> plus the number of "
13237 "bits set in C<missingbitmap>."
13241 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4920
13246 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4922
13247 msgid "The number of spare devices."
13251 #: ../fish/guestfish-actions.pod:3198 ../src/guestfs-actions.pod:4924
13252 msgid "If not set, this defaults to C<0>."
13256 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4926
13261 #: ../fish/guestfish-actions.pod:3202 ../src/guestfs-actions.pod:4928
13262 msgid "The chunk size in bytes."
13266 #: ../fish/guestfish-actions.pod:3204 ../fish/guestfish-actions.pod:3226
13267 #: ../src/guestfs-actions.pod:4930 ../src/guestfs-actions.pod:4978
13272 #: ../fish/guestfish-actions.pod:3206 ../src/guestfs-actions.pod:4932
13274 "The RAID level, which can be one of: I<linear>, I<raid0>, I<0>, I<stripe>, "
13275 "I<raid1>, I<1>, I<mirror>, I<raid4>, I<4>, I<raid5>, I<5>, I<raid6>, I<6>, "
13276 "I<raid10>, I<10>. Some of these are synonymous, and more levels may be "
13281 #: ../fish/guestfish-actions.pod:3211 ../src/guestfs-actions.pod:4937
13282 msgid "If not set, this defaults to C<raid1>."
13286 #: ../fish/guestfish-actions.pod:3217
13287 msgid "mdadm-detail"
13291 #: ../fish/guestfish-actions.pod:3219
13294 " mdadm-detail md\n"
13299 #: ../fish/guestfish-actions.pod:3221 ../src/guestfs-actions.pod:4973
13301 "This command exposes the output of 'mdadm -DY <md>'. The following fields "
13302 "are usually present in the returned hash. Other fields may also be present."
13306 #: ../fish/guestfish-actions.pod:3228 ../src/guestfs-actions.pod:4980
13307 msgid "The raid level of the MD device."
13311 #: ../fish/guestfish-actions.pod:3230 ../src/guestfs-actions.pod:4982
13316 #: ../fish/guestfish-actions.pod:3232 ../src/guestfs-actions.pod:4984
13317 msgid "The number of underlying devices in the MD device."
13321 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4986
13322 msgid "C<metadata>"
13326 #: ../fish/guestfish-actions.pod:3236 ../src/guestfs-actions.pod:4988
13327 msgid "The metadata version used."
13331 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4990
13336 #: ../fish/guestfish-actions.pod:3240 ../src/guestfs-actions.pod:4992
13337 msgid "The UUID of the MD device."
13341 #: ../fish/guestfish-actions.pod:3244 ../src/guestfs-actions.pod:4996
13342 msgid "The name of the MD device."
13346 #: ../fish/guestfish-actions.pod:3248
13351 #: ../fish/guestfish-actions.pod:3250
13359 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:5012
13360 msgid "Create a directory named C<path>."
13364 #: ../fish/guestfish-actions.pod:3254
13369 #: ../fish/guestfish-actions.pod:3256
13372 " mkdir-mode path mode\n"
13377 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:5025
13379 "This command creates a directory, setting the initial permissions of the "
13380 "directory to C<mode>."
13384 #: ../fish/guestfish-actions.pod:3261 ../src/guestfs-actions.pod:5028
13386 "For common Linux filesystems, the actual mode which is set will be C<mode & "
13387 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
13392 #: ../fish/guestfish-actions.pod:3265
13393 msgid "See also L</mkdir>, L</umask>"
13397 #: ../fish/guestfish-actions.pod:3267
13402 #: ../fish/guestfish-actions.pod:3269
13410 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:5044
13412 "Create a directory named C<path>, creating any parent directories as "
13413 "necessary. This is like the C<mkdir -p> shell command."
13417 #: ../fish/guestfish-actions.pod:3274
13422 #: ../fish/guestfish-actions.pod:3276
13425 " mkdtemp template\n"
13430 #: ../fish/guestfish-actions.pod:3278 ../src/guestfs-actions.pod:5057
13432 "This command creates a temporary directory. The C<template> parameter "
13433 "should be a full pathname for the temporary directory name with the final "
13434 "six characters being \"XXXXXX\"."
13438 #: ../fish/guestfish-actions.pod:3283 ../src/guestfs-actions.pod:5062
13440 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
13441 "being suitable for Windows filesystems."
13445 #: ../fish/guestfish-actions.pod:3286 ../src/guestfs-actions.pod:5065
13446 msgid "The name of the temporary directory that was created is returned."
13450 #: ../fish/guestfish-actions.pod:3289 ../src/guestfs-actions.pod:5068
13451 msgid "The temporary directory is created with mode 0700 and is owned by root."
13455 #: ../fish/guestfish-actions.pod:3292 ../src/guestfs-actions.pod:5071
13457 "The caller is responsible for deleting the temporary directory and its "
13458 "contents after use."
13462 #: ../fish/guestfish-actions.pod:3295 ../src/guestfs-actions.pod:5074
13463 msgid "See also: L<mkdtemp(3)>"
13467 #: ../fish/guestfish-actions.pod:3297
13472 #: ../fish/guestfish-actions.pod:3299
13475 " mke2fs-J fstype blocksize device journal\n"
13480 #: ../fish/guestfish-actions.pod:3301 ../src/guestfs-actions.pod:5090
13482 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13483 "C<journal>. It is equivalent to the command:"
13487 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5094
13490 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
13495 #: ../fish/guestfish-actions.pod:3307
13496 msgid "See also L</mke2journal>."
13500 #: ../fish/guestfish-actions.pod:3309
13505 #: ../fish/guestfish-actions.pod:3311
13508 " mke2fs-JL fstype blocksize device label\n"
13513 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5111
13515 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13516 "the journal labeled C<label>."
13520 #: ../fish/guestfish-actions.pod:3316
13521 msgid "See also L</mke2journal-L>."
13525 #: ../fish/guestfish-actions.pod:3318
13530 #: ../fish/guestfish-actions.pod:3320
13533 " mke2fs-JU fstype blocksize device uuid\n"
13538 #: ../fish/guestfish-actions.pod:3322 ../src/guestfs-actions.pod:5129
13540 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13541 "the journal with UUID C<uuid>."
13545 #: ../fish/guestfish-actions.pod:3325
13546 msgid "See also L</mke2journal-U>."
13550 #: ../fish/guestfish-actions.pod:3327
13551 msgid "mke2journal"
13555 #: ../fish/guestfish-actions.pod:3329
13558 " mke2journal blocksize device\n"
13563 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5145
13565 "This creates an ext2 external journal on C<device>. It is equivalent to the "
13570 #: ../fish/guestfish-actions.pod:3334 ../src/guestfs-actions.pod:5148
13573 " mke2fs -O journal_dev -b blocksize device\n"
13578 #: ../fish/guestfish-actions.pod:3336
13579 msgid "mke2journal-L"
13583 #: ../fish/guestfish-actions.pod:3338
13586 " mke2journal-L blocksize label device\n"
13591 #: ../fish/guestfish-actions.pod:3340 ../src/guestfs-actions.pod:5162
13592 msgid "This creates an ext2 external journal on C<device> with label C<label>."
13596 #: ../fish/guestfish-actions.pod:3342
13597 msgid "mke2journal-U"
13601 #: ../fish/guestfish-actions.pod:3344
13604 " mke2journal-U blocksize uuid device\n"
13609 #: ../fish/guestfish-actions.pod:3346 ../src/guestfs-actions.pod:5176
13610 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
13614 #: ../fish/guestfish-actions.pod:3348
13619 #: ../fish/guestfish-actions.pod:3350
13622 " mkfifo mode path\n"
13627 #: ../fish/guestfish-actions.pod:3352
13629 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
13630 "is just a convenient wrapper around L</mknod>."
13634 #: ../fish/guestfish-actions.pod:3358
13639 #: ../fish/guestfish-actions.pod:3360
13642 " mkfs fstype device\n"
13647 #: ../fish/guestfish-actions.pod:3362 ../src/guestfs-actions.pod:5206
13649 "This creates a filesystem on C<device> (usually a partition or LVM logical "
13650 "volume). The filesystem type is C<fstype>, for example C<ext3>."
13654 #: ../fish/guestfish-actions.pod:3366
13659 #: ../fish/guestfish-actions.pod:3368
13662 " mkfs-b fstype blocksize device\n"
13667 #: ../fish/guestfish-actions.pod:3370
13669 "This call is similar to L</mkfs>, but it allows you to control the block "
13670 "size of the resulting filesystem. Supported block sizes depend on the "
13671 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
13675 #: ../fish/guestfish-actions.pod:3375 ../fish/guestfish-actions.pod:3402
13676 #: ../src/guestfs-actions.pod:5234 ../src/guestfs-actions.pod:5272
13678 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
13683 #: ../fish/guestfish-actions.pod:3378
13685 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
13690 #: ../fish/guestfish-actions.pod:3385
13695 #: ../fish/guestfish-actions.pod:3387
13698 " mkfs-opts fstype device [blocksize:N] [features:..] [inode:N] [sectorsize:N]\n"
13703 #: ../fish/guestfish-actions.pod:3389 ../src/guestfs-actions.pod:5259
13705 "This function creates a filesystem on C<device>. The filesystem type is "
13706 "C<fstype>, for example C<ext3>."
13710 #: ../fish/guestfish-actions.pod:3396 ../src/guestfs-actions.pod:5266
13711 msgid "C<blocksize>"
13715 #: ../fish/guestfish-actions.pod:3398 ../src/guestfs-actions.pod:5268
13717 "The filesystem block size. Supported block sizes depend on the filesystem "
13718 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
13723 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5275
13724 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
13728 #: ../fish/guestfish-actions.pod:3407 ../src/guestfs-actions.pod:5277
13729 msgid "C<features>"
13733 #: ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:5279
13734 msgid "This passes the I<-O> parameter to the external mkfs program."
13738 #: ../fish/guestfish-actions.pod:3411 ../src/guestfs-actions.pod:5281
13740 "For certain filesystem types, this allows extra filesystem features to be "
13741 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
13745 #: ../fish/guestfish-actions.pod:3415 ../src/guestfs-actions.pod:5285
13747 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
13752 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5288
13757 #: ../fish/guestfish-actions.pod:3420 ../src/guestfs-actions.pod:5290
13759 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
13760 "sets the inode size (only for ext2/3/4 filesystems at present)."
13764 #: ../fish/guestfish-actions.pod:3423 ../src/guestfs-actions.pod:5293
13765 msgid "C<sectorsize>"
13769 #: ../fish/guestfish-actions.pod:3425 ../src/guestfs-actions.pod:5295
13771 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
13772 "sets sector size for ufs filesystem."
13776 #: ../fish/guestfish-actions.pod:3432
13777 msgid "mkmountpoint"
13781 #: ../fish/guestfish-actions.pod:3434
13784 " mkmountpoint exemptpath\n"
13789 #: ../fish/guestfish-actions.pod:3436
13791 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
13792 "to create extra mountpoints before mounting the first filesystem."
13796 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5338
13798 "These calls are I<only> necessary in some very limited circumstances, mainly "
13799 "the case where you want to mount a mix of unrelated and/or read-only "
13800 "filesystems together."
13804 #: ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5342
13806 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
13807 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
13808 "inside that. You can unpack this as follows in guestfish:"
13812 #: ../fish/guestfish-actions.pod:3449 ../src/guestfs-actions.pod:5347
13815 " add-ro Fedora-11-i686-Live.iso\n"
13817 " mkmountpoint /cd\n"
13818 " mkmountpoint /sqsh\n"
13819 " mkmountpoint /ext3fs\n"
13820 " mount /dev/sda /cd\n"
13821 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
13822 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
13827 #: ../fish/guestfish-actions.pod:3458 ../src/guestfs-actions.pod:5356
13828 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
13832 #: ../fish/guestfish-actions.pod:3460
13834 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
13835 "unexpected errors if you try to mix these calls. It is safest to manually "
13836 "unmount filesystems and remove mountpoints after use."
13840 #: ../fish/guestfish-actions.pod:3464
13842 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
13843 "for this to work for manual mountpoints, you must ensure that the innermost "
13844 "mountpoints have the longest pathnames, as in the example code above."
13848 #: ../fish/guestfish-actions.pod:3469 ../src/guestfs-actions.pod:5367
13850 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
13854 #: ../fish/guestfish-actions.pod:3471
13856 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
13857 "L</umount-all> to be called when the handle is closed which can also trigger "
13862 #: ../fish/guestfish-actions.pod:3475
13867 #: ../fish/guestfish-actions.pod:3477
13870 " mknod mode devmajor devminor path\n"
13875 #: ../fish/guestfish-actions.pod:3479 ../src/guestfs-actions.pod:5386
13877 "This call creates block or character special devices, or named pipes (FIFOs)."
13881 #: ../fish/guestfish-actions.pod:3482 ../src/guestfs-actions.pod:5389
13883 "The C<mode> parameter should be the mode, using the standard constants. "
13884 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
13885 "used when creating block and character special devices."
13889 #: ../fish/guestfish-actions.pod:3487
13891 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
13892 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
13893 "regular file). These constants are available in the standard Linux header "
13894 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
13895 "wrappers around this command which bitwise OR in the appropriate constant "
13900 #: ../fish/guestfish-actions.pod:3497
13905 #: ../fish/guestfish-actions.pod:3499
13908 " mknod-b mode devmajor devminor path\n"
13913 #: ../fish/guestfish-actions.pod:3501
13915 "This call creates a block device node called C<path> with mode C<mode> and "
13916 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13917 "wrapper around L</mknod>."
13921 #: ../fish/guestfish-actions.pod:3507
13926 #: ../fish/guestfish-actions.pod:3509
13929 " mknod-c mode devmajor devminor path\n"
13934 #: ../fish/guestfish-actions.pod:3511
13936 "This call creates a char device node called C<path> with mode C<mode> and "
13937 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13938 "wrapper around L</mknod>."
13942 #: ../fish/guestfish-actions.pod:3517
13947 #: ../fish/guestfish-actions.pod:3519
13955 #: ../fish/guestfish-actions.pod:3521 ../src/guestfs-actions.pod:5452
13956 msgid "Create a swap partition on C<device>."
13960 #: ../fish/guestfish-actions.pod:3523
13965 #: ../fish/guestfish-actions.pod:3525
13968 " mkswap-L label device\n"
13973 #: ../fish/guestfish-actions.pod:3527 ../src/guestfs-actions.pod:5465
13974 msgid "Create a swap partition on C<device> with label C<label>."
13978 #: ../fish/guestfish-actions.pod:3529 ../src/guestfs-actions.pod:5467
13980 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
13981 "sda>), just to a partition. This appears to be a limitation of the kernel "
13986 #: ../fish/guestfish-actions.pod:3533
13991 #: ../fish/guestfish-actions.pod:3535
13994 " mkswap-U uuid device\n"
13999 #: ../fish/guestfish-actions.pod:3537 ../src/guestfs-actions.pod:5482
14000 msgid "Create a swap partition on C<device> with UUID C<uuid>."
14004 #: ../fish/guestfish-actions.pod:3539
14005 msgid "mkswap-file"
14009 #: ../fish/guestfish-actions.pod:3541
14012 " mkswap-file path\n"
14017 #: ../fish/guestfish-actions.pod:3543 ../src/guestfs-actions.pod:5494
14018 msgid "Create a swap file."
14022 #: ../fish/guestfish-actions.pod:3545
14024 "This command just writes a swap file signature to an existing file. To "
14025 "create the file itself, use something like L</fallocate>."
14029 #: ../fish/guestfish-actions.pod:3548
14034 #: ../fish/guestfish-actions.pod:3550
14037 " modprobe modulename\n"
14042 #: ../fish/guestfish-actions.pod:3552 ../src/guestfs-actions.pod:5509
14043 msgid "This loads a kernel module in the appliance."
14047 #: ../fish/guestfish-actions.pod:3554 ../src/guestfs-actions.pod:5511
14049 "The kernel module must have been whitelisted when libguestfs was built (see "
14050 "C<appliance/kmod.whitelist.in> in the source)."
14054 #: ../fish/guestfish-actions.pod:3557
14059 #: ../fish/guestfish-actions.pod:3559
14062 " mount device mountpoint\n"
14067 #: ../fish/guestfish-actions.pod:3561 ../src/guestfs-actions.pod:5525
14069 "Mount a guest disk at a position in the filesystem. Block devices are named "
14070 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
14071 "those block devices contain partitions, they will have the usual names (eg. "
14072 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
14076 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5531
14078 "The rules are the same as for L<mount(2)>: A filesystem must first be "
14079 "mounted on C</> before others can be mounted. Other filesystems can only be "
14080 "mounted on directories which already exist."
14084 #: ../fish/guestfish-actions.pod:3572 ../src/guestfs-actions.pod:5536
14086 "The mounted filesystem is writable, if we have sufficient permissions on the "
14087 "underlying device."
14091 #: ../fish/guestfish-actions.pod:3575
14093 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
14094 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
14095 "problems for users. If your program might need to work with older versions "
14096 "of libguestfs, use L</mount-options> instead (using an empty string for the "
14097 "first parameter if you don't want any options)."
14101 #: ../fish/guestfish-actions.pod:3582
14106 #: ../fish/guestfish-actions.pod:3584
14109 " mount-9p mounttag mountpoint [options:..]\n"
14114 #: ../fish/guestfish-actions.pod:3586 ../src/guestfs-actions.pod:5565
14116 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
14121 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5568
14123 "If required, C<trans=virtio> will be automatically added to the options. "
14124 "Any other options required can be passed in the optional C<options> "
14129 #: ../fish/guestfish-actions.pod:3595
14134 #: ../fish/guestfish-actions.pod:3597
14137 " mount-loop file mountpoint\n"
14142 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5607
14144 "This command lets you mount C<file> (a filesystem image in a file) on a "
14145 "mount point. It is entirely equivalent to the command C<mount -o loop file "
14150 #: ../fish/guestfish-actions.pod:3603
14151 msgid "mount-options"
14155 #: ../fish/guestfish-actions.pod:3605
14158 " mount-options options device mountpoint\n"
14163 #: ../fish/guestfish-actions.pod:3607
14165 "This is the same as the L</mount> command, but it allows you to set the "
14166 "mount options as for the L<mount(8)> I<-o> flag."
14170 #: ../fish/guestfish-actions.pod:3611 ../src/guestfs-actions.pod:5627
14172 "If the C<options> parameter is an empty string, then no options are passed "
14173 "(all options default to whatever the filesystem uses)."
14177 #: ../fish/guestfish-actions.pod:3615
14182 #: ../fish/guestfish-actions.pod:3617
14185 " mount-ro device mountpoint\n"
14190 #: ../fish/guestfish-actions.pod:3619
14192 "This is the same as the L</mount> command, but it mounts the filesystem with "
14193 "the read-only (I<-o ro>) flag."
14197 #: ../fish/guestfish-actions.pod:3622
14202 #: ../fish/guestfish-actions.pod:3624
14205 " mount-vfs options vfstype device mountpoint\n"
14210 #: ../fish/guestfish-actions.pod:3626
14212 "This is the same as the L</mount> command, but it allows you to set both the "
14213 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
14217 #: ../fish/guestfish-actions.pod:3630
14218 msgid "mountpoints"
14222 #: ../fish/guestfish-actions.pod:3632
14230 #: ../fish/guestfish-actions.pod:3634
14232 "This call is similar to L</mounts>. That call returns a list of devices. "
14233 "This one returns a hash table (map) of device name to directory where the "
14234 "device is mounted."
14238 #: ../fish/guestfish-actions.pod:3638
14243 #: ../fish/guestfish-actions.pod:3640
14251 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5688
14253 "This returns the list of currently mounted filesystems. It returns the list "
14254 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
14258 #: ../fish/guestfish-actions.pod:3645 ../src/guestfs-actions.pod:5691
14259 msgid "Some internal mounts are not shown."
14263 #: ../fish/guestfish-actions.pod:3647
14264 msgid "See also: L</mountpoints>"
14268 #: ../fish/guestfish-actions.pod:3649
14273 #: ../fish/guestfish-actions.pod:3651
14281 #: ../fish/guestfish-actions.pod:3653 ../src/guestfs-actions.pod:5708
14283 "This moves a file from C<src> to C<dest> where C<dest> is either a "
14284 "destination filename or destination directory."
14288 #: ../fish/guestfish-actions.pod:3656
14289 msgid "ntfs-3g-probe"
14293 #: ../fish/guestfish-actions.pod:3658
14296 " ntfs-3g-probe true|false device\n"
14301 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5722
14303 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
14304 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
14305 "write, and some cannot be mounted at all)."
14309 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5726
14311 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
14312 "can be mounted read-write. Set it to false if you want to test if the "
14313 "volume can be mounted read-only."
14317 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5730
14319 "The return value is an integer which C<0> if the operation would succeed, or "
14320 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
14324 #: ../fish/guestfish-actions.pod:3672
14329 #: ../fish/guestfish-actions.pod:3674
14332 " ntfsresize device\n"
14337 #: ../fish/guestfish-actions.pod:3676 ../fish/guestfish-actions.pod:3700
14338 #: ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5783
14340 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
14341 "size of the underlying device."
14345 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5754
14347 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
14348 "consistency check (for safety). You have to boot into Windows to perform "
14349 "this check and clear this condition. Furthermore, ntfsresize refuses to "
14350 "resize filesystems which have been marked in this way. So in effect it is "
14351 "not possible to call ntfsresize multiple times on a single filesystem "
14352 "without booting into Windows between each resize."
14356 #: ../fish/guestfish-actions.pod:3687 ../fish/guestfish-actions.pod:3726
14357 #: ../src/guestfs-actions.pod:5762 ../src/guestfs-actions.pod:5809
14358 msgid "See also L<ntfsresize(8)>."
14362 #: ../fish/guestfish-actions.pod:3689 ../fish/guestfish-actions.pod:3737
14364 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
14369 #: ../fish/guestfish-actions.pod:3696
14370 msgid "ntfsresize-opts"
14374 #: ../fish/guestfish-actions.pod:3698
14377 " ntfsresize-opts device [size:N] [force:true|false]\n"
14382 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5792
14384 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
14385 "resized to fit the container (eg. partition)."
14389 #: ../fish/guestfish-actions.pod:3712 ../fish/guestfish-actions.pod:5033
14390 #: ../src/guestfs-actions.pod:5795 ../src/guestfs-actions.pod:7766
14395 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5797
14397 "If this option is true, then force the resize of the filesystem even if the "
14398 "filesystem is marked as requiring a consistency check."
14402 #: ../fish/guestfish-actions.pod:3717
14404 "After the resize operation, the filesystem is always marked as requiring a "
14405 "consistency check (for safety). You have to boot into Windows to perform "
14406 "this check and clear this condition. If you I<don't> set the C<force> "
14407 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
14408 "a single filesystem without booting into Windows between each resize."
14412 #: ../fish/guestfish-actions.pod:3730
14413 msgid "ntfsresize-size"
14417 #: ../fish/guestfish-actions.pod:3732
14420 " ntfsresize-size device size\n"
14425 #: ../fish/guestfish-actions.pod:3734
14427 "This command is the same as L</ntfsresize> except that it allows you to "
14428 "specify the new size (in bytes) explicitly."
14432 #: ../fish/guestfish-actions.pod:3744
14437 #: ../fish/guestfish-actions.pod:3746
14440 " part-add device prlogex startsect endsect\n"
14445 #: ../fish/guestfish-actions.pod:3748
14447 "This command adds a partition to C<device>. If there is no partition table "
14448 "on the device, call L</part-init> first."
14452 #: ../fish/guestfish-actions.pod:3751 ../src/guestfs-actions.pod:5870
14454 "The C<prlogex> parameter is the type of partition. Normally you should pass "
14455 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
14456 "C<logical>) and C<e> (or C<extended>) partition types."
14460 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5875
14462 "C<startsect> and C<endsect> are the start and end of the partition in "
14463 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
14464 "from the end of the disk (C<-1> is the last sector)."
14468 #: ../fish/guestfish-actions.pod:3760
14470 "Creating a partition which covers the whole disk is not so easy. Use L</"
14471 "part-disk> to do that."
14475 #: ../fish/guestfish-actions.pod:3763
14480 #: ../fish/guestfish-actions.pod:3765
14483 " part-del device partnum\n"
14488 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5893
14489 msgid "This command deletes the partition numbered C<partnum> on C<device>."
14493 #: ../fish/guestfish-actions.pod:3769 ../src/guestfs-actions.pod:5895
14495 "Note that in the case of MBR partitioning, deleting an extended partition "
14496 "also deletes any logical partitions it contains."
14500 #: ../fish/guestfish-actions.pod:3773
14505 #: ../fish/guestfish-actions.pod:3775
14508 " part-disk device parttype\n"
14513 #: ../fish/guestfish-actions.pod:3777
14515 "This command is simply a combination of L</part-init> followed by L</part-"
14516 "add> to create a single primary partition covering the whole disk."
14520 #: ../fish/guestfish-actions.pod:3781
14522 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
14523 "possible values are described in L</part-init>."
14527 #: ../fish/guestfish-actions.pod:3784
14528 msgid "part-get-bootable"
14532 #: ../fish/guestfish-actions.pod:3786
14535 " part-get-bootable device partnum\n"
14540 #: ../fish/guestfish-actions.pod:3788 ../src/guestfs-actions.pod:5928
14542 "This command returns true if the partition C<partnum> on C<device> has the "
14543 "bootable flag set."
14547 #: ../fish/guestfish-actions.pod:3791
14548 msgid "See also L</part-set-bootable>."
14552 #: ../fish/guestfish-actions.pod:3793
14553 msgid "part-get-mbr-id"
14557 #: ../fish/guestfish-actions.pod:3795
14560 " part-get-mbr-id device partnum\n"
14565 #: ../fish/guestfish-actions.pod:3797 ../src/guestfs-actions.pod:5944
14567 "Returns the MBR type byte (also known as the ID byte) from the numbered "
14568 "partition C<partnum>."
14572 #: ../fish/guestfish-actions.pod:3800 ../fish/guestfish-actions.pod:3944
14574 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
14575 "undefined results for other partition table types (see L</part-get-"
14580 #: ../fish/guestfish-actions.pod:3804
14581 msgid "part-get-parttype"
14585 #: ../fish/guestfish-actions.pod:3806
14588 " part-get-parttype device\n"
14593 #: ../fish/guestfish-actions.pod:3808 ../src/guestfs-actions.pod:5961
14595 "This command examines the partition table on C<device> and returns the "
14596 "partition table type (format) being used."
14600 #: ../fish/guestfish-actions.pod:3811
14602 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
14603 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
14604 "possible, although unusual. See L</part-init> for a full list."
14608 #: ../fish/guestfish-actions.pod:3816
14613 #: ../fish/guestfish-actions.pod:3818
14616 " part-init device parttype\n"
14621 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5981
14623 "This creates an empty partition table on C<device> of one of the partition "
14624 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
14625 "(for large disks)."
14629 #: ../fish/guestfish-actions.pod:3824
14631 "Initially there are no partitions. Following this, you should call L</part-"
14632 "add> for each partition required."
14636 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5988
14637 msgid "Possible values for C<parttype> are:"
14641 #: ../fish/guestfish-actions.pod:3831 ../src/guestfs-actions.pod:5992
14646 #: ../fish/guestfish-actions.pod:3833 ../src/guestfs-actions.pod:5994
14651 #: ../fish/guestfish-actions.pod:3835 ../src/guestfs-actions.pod:5996
14652 msgid "Intel EFI / GPT partition table."
14656 #: ../fish/guestfish-actions.pod:3837 ../src/guestfs-actions.pod:5998
14658 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
14659 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
14660 "the C<mbr> format."
14664 #: ../fish/guestfish-actions.pod:3841 ../src/guestfs-actions.pod:6002
14669 #: ../fish/guestfish-actions.pod:3843 ../src/guestfs-actions.pod:6004
14674 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:6006
14676 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
14677 "Windows. This partition type will B<only> work for device sizes up to 2 "
14678 "TB. For large disks we recommend using C<gpt>."
14682 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:6013
14684 "Other partition table types that may work but are not supported include:"
14688 #: ../fish/guestfish-actions.pod:3857 ../src/guestfs-actions.pod:6018
14693 #: ../fish/guestfish-actions.pod:3859 ../src/guestfs-actions.pod:6020
14694 msgid "AIX disk labels."
14698 #: ../fish/guestfish-actions.pod:3861 ../src/guestfs-actions.pod:6022
14703 #: ../fish/guestfish-actions.pod:3863 ../src/guestfs-actions.pod:6024
14708 #: ../fish/guestfish-actions.pod:3865 ../src/guestfs-actions.pod:6026
14709 msgid "Amiga \"Rigid Disk Block\" format."
14713 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:6028
14718 #: ../fish/guestfish-actions.pod:3869 ../src/guestfs-actions.pod:6030
14719 msgid "BSD disk labels."
14723 #: ../fish/guestfish-actions.pod:3871 ../src/guestfs-actions.pod:6032
14728 #: ../fish/guestfish-actions.pod:3873 ../src/guestfs-actions.pod:6034
14729 msgid "DASD, used on IBM mainframes."
14733 #: ../fish/guestfish-actions.pod:3875 ../src/guestfs-actions.pod:6036
14738 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:6038
14739 msgid "MIPS/SGI volumes."
14743 #: ../fish/guestfish-actions.pod:3879 ../src/guestfs-actions.pod:6040
14748 #: ../fish/guestfish-actions.pod:3881 ../src/guestfs-actions.pod:6042
14749 msgid "Old Mac partition format. Modern Macs use C<gpt>."
14753 #: ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:6044
14758 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:6046
14759 msgid "NEC PC-98 format, common in Japan apparently."
14763 #: ../fish/guestfish-actions.pod:3887 ../src/guestfs-actions.pod:6048
14768 #: ../fish/guestfish-actions.pod:3889 ../src/guestfs-actions.pod:6050
14769 msgid "Sun disk labels."
14773 #: ../fish/guestfish-actions.pod:3893
14778 #: ../fish/guestfish-actions.pod:3895
14781 " part-list device\n"
14786 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:6064
14788 "This command parses the partition table on C<device> and returns the list of "
14789 "partitions found."
14793 #: ../fish/guestfish-actions.pod:3900 ../src/guestfs-actions.pod:6067
14794 msgid "The fields in the returned structure are:"
14798 #: ../fish/guestfish-actions.pod:3904 ../src/guestfs-actions.pod:6071
14799 msgid "B<part_num>"
14803 #: ../fish/guestfish-actions.pod:3906 ../src/guestfs-actions.pod:6073
14804 msgid "Partition number, counting from 1."
14808 #: ../fish/guestfish-actions.pod:3908 ../src/guestfs-actions.pod:6075
14809 msgid "B<part_start>"
14813 #: ../fish/guestfish-actions.pod:3910
14815 "Start of the partition I<in bytes>. To get sectors you have to divide by "
14816 "the device's sector size, see L</blockdev-getss>."
14820 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:6080
14821 msgid "B<part_end>"
14825 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:6082
14826 msgid "End of the partition in bytes."
14830 #: ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:6084
14831 msgid "B<part_size>"
14835 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6086
14836 msgid "Size of the partition in bytes."
14840 #: ../fish/guestfish-actions.pod:3923
14841 msgid "part-set-bootable"
14845 #: ../fish/guestfish-actions.pod:3925
14848 " part-set-bootable device partnum true|false\n"
14853 #: ../fish/guestfish-actions.pod:3927 ../src/guestfs-actions.pod:6104
14855 "This sets the bootable flag on partition numbered C<partnum> on device "
14856 "C<device>. Note that partitions are numbered from 1."
14860 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6107
14862 "The bootable flag is used by some operating systems (notably Windows) to "
14863 "determine which partition to boot from. It is by no means universally "
14868 #: ../fish/guestfish-actions.pod:3934
14869 msgid "part-set-mbr-id"
14873 #: ../fish/guestfish-actions.pod:3936
14876 " part-set-mbr-id device partnum idbyte\n"
14881 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6123
14883 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
14884 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
14885 "documentation are in fact hexadecimal numbers, but usually documented "
14886 "without any leading \"0x\" which might be confusing."
14890 #: ../fish/guestfish-actions.pod:3948
14891 msgid "part-set-name"
14895 #: ../fish/guestfish-actions.pod:3950
14898 " part-set-name device partnum name\n"
14903 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6145
14905 "This sets the partition name on partition numbered C<partnum> on device "
14906 "C<device>. Note that partitions are numbered from 1."
14910 #: ../fish/guestfish-actions.pod:3955 ../src/guestfs-actions.pod:6148
14912 "The partition name can only be set on certain types of partition table. "
14913 "This works on C<gpt> but not on C<mbr> partitions."
14917 #: ../fish/guestfish-actions.pod:3958
14918 msgid "part-to-dev"
14922 #: ../fish/guestfish-actions.pod:3960
14925 " part-to-dev partition\n"
14930 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6161
14932 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
14933 "partition number, returning the device name (eg. \"/dev/sdb\")."
14937 #: ../fish/guestfish-actions.pod:3966 ../fish/guestfish-actions.pod:3978
14939 "The named partition must exist, for example as a string returned from L</"
14940 "list-partitions>."
14944 #: ../fish/guestfish-actions.pod:3969
14945 msgid "See also L</part-to-partnum>."
14949 #: ../fish/guestfish-actions.pod:3971
14950 msgid "part-to-partnum"
14954 #: ../fish/guestfish-actions.pod:3973
14957 " part-to-partnum partition\n"
14962 #: ../fish/guestfish-actions.pod:3975 ../src/guestfs-actions.pod:6181
14964 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
14965 "partition number (eg. C<1>)."
14969 #: ../fish/guestfish-actions.pod:3981
14970 msgid "See also L</part-to-dev>."
14974 #: ../fish/guestfish-actions.pod:3983
14975 msgid "ping-daemon"
14979 #: ../fish/guestfish-actions.pod:3985
14987 #: ../fish/guestfish-actions.pod:3987 ../src/guestfs-actions.pod:6198
14989 "This is a test probe into the guestfs daemon running inside the qemu "
14990 "subprocess. Calling this function checks that the daemon responds to the "
14991 "ping message, without affecting the daemon or attached block device(s) in "
14996 #: ../fish/guestfish-actions.pod:3992
15001 #: ../fish/guestfish-actions.pod:3994
15004 " pread path count offset\n"
15009 #: ../fish/guestfish-actions.pod:3996 ../src/guestfs-actions.pod:6216
15011 "This command lets you read part of a file. It reads C<count> bytes of the "
15012 "file, starting at C<offset>, from file C<path>."
15016 #: ../fish/guestfish-actions.pod:3999 ../fish/guestfish-actions.pod:4014
15017 #: ../src/guestfs-actions.pod:6219 ../src/guestfs-actions.pod:6245
15019 "This may read fewer bytes than requested. For further details see the "
15020 "L<pread(2)> system call."
15024 #: ../fish/guestfish-actions.pod:4002
15025 msgid "See also L</pwrite>, L</pread-device>."
15029 #: ../fish/guestfish-actions.pod:4007
15030 msgid "pread-device"
15034 #: ../fish/guestfish-actions.pod:4009
15037 " pread-device device count offset\n"
15042 #: ../fish/guestfish-actions.pod:4011 ../src/guestfs-actions.pod:6242
15044 "This command lets you read part of a file. It reads C<count> bytes of "
15045 "C<device>, starting at C<offset>."
15049 #: ../fish/guestfish-actions.pod:4017
15050 msgid "See also L</pread>."
15054 #: ../fish/guestfish-actions.pod:4022
15059 #: ../fish/guestfish-actions.pod:4024
15062 " pvcreate device\n"
15067 #: ../fish/guestfish-actions.pod:4026 ../src/guestfs-actions.pod:6265
15069 "This creates an LVM physical volume on the named C<device>, where C<device> "
15070 "should usually be a partition name such as C</dev/sda1>."
15074 #: ../fish/guestfish-actions.pod:4030
15079 #: ../fish/guestfish-actions.pod:4032
15082 " pvremove device\n"
15087 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6279
15089 "This wipes a physical volume C<device> so that LVM will no longer recognise "
15094 #: ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:6282
15096 "The implementation uses the C<pvremove> command which refuses to wipe "
15097 "physical volumes that contain any volume groups, so you have to remove those "
15102 #: ../fish/guestfish-actions.pod:4041
15107 #: ../fish/guestfish-actions.pod:4043
15110 " pvresize device\n"
15115 #: ../fish/guestfish-actions.pod:4045 ../src/guestfs-actions.pod:6296
15117 "This resizes (expands or shrinks) an existing LVM physical volume to match "
15118 "the new size of the underlying device."
15122 #: ../fish/guestfish-actions.pod:4048
15123 msgid "pvresize-size"
15127 #: ../fish/guestfish-actions.pod:4050
15130 " pvresize-size device size\n"
15135 #: ../fish/guestfish-actions.pod:4052
15137 "This command is the same as L</pvresize> except that it allows you to "
15138 "specify the new size (in bytes) explicitly."
15142 #: ../fish/guestfish-actions.pod:4055
15147 #: ../fish/guestfish-actions.pod:4057
15155 #: ../fish/guestfish-actions.pod:4059 ../src/guestfs-actions.pod:6322
15157 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15162 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6325
15164 "This returns a list of just the device names that contain PVs (eg. C</dev/"
15169 #: ../fish/guestfish-actions.pod:4065
15170 msgid "See also L</pvs-full>."
15174 #: ../fish/guestfish-actions.pod:4067
15179 #: ../fish/guestfish-actions.pod:4069
15187 #: ../fish/guestfish-actions.pod:4071 ../src/guestfs-actions.pod:6341
15189 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15190 "(8)> command. The \"full\" version includes all fields."
15194 #: ../fish/guestfish-actions.pod:4074
15199 #: ../fish/guestfish-actions.pod:4076
15207 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6356
15208 msgid "This command returns the UUID of the LVM PV C<device>."
15212 #: ../fish/guestfish-actions.pod:4080
15217 #: ../fish/guestfish-actions.pod:4082
15220 " pwrite path content offset\n"
15225 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6372
15227 "This command writes to part of a file. It writes the data buffer C<content> "
15228 "to the file C<path> starting at offset C<offset>."
15232 #: ../fish/guestfish-actions.pod:4087 ../src/guestfs-actions.pod:6375
15234 "This command implements the L<pwrite(2)> system call, and like that system "
15235 "call it may not write the full data requested. The return value is the "
15236 "number of bytes that were actually written to the file. This could even be "
15237 "0, although short writes are unlikely for regular files in ordinary "
15242 #: ../fish/guestfish-actions.pod:4093
15243 msgid "See also L</pread>, L</pwrite-device>."
15247 #: ../fish/guestfish-actions.pod:4098
15248 msgid "pwrite-device"
15252 #: ../fish/guestfish-actions.pod:4100
15255 " pwrite-device device content offset\n"
15260 #: ../fish/guestfish-actions.pod:4102 ../src/guestfs-actions.pod:6399
15262 "This command writes to part of a device. It writes the data buffer "
15263 "C<content> to C<device> starting at offset C<offset>."
15267 #: ../fish/guestfish-actions.pod:4105 ../src/guestfs-actions.pod:6402
15269 "This command implements the L<pwrite(2)> system call, and like that system "
15270 "call it may not write the full data requested (although short writes to disk "
15271 "devices and partitions are probably impossible with standard Linux kernels)."
15275 #: ../fish/guestfish-actions.pod:4110
15276 msgid "See also L</pwrite>."
15280 #: ../fish/guestfish-actions.pod:4115
15285 #: ../fish/guestfish-actions.pod:4117
15288 " read-file path\n"
15293 #: ../fish/guestfish-actions.pod:4119 ../src/guestfs-actions.pod:6423
15294 msgid "This calls returns the contents of the file C<path> as a buffer."
15298 #: ../fish/guestfish-actions.pod:4122
15300 "Unlike L</cat>, this function can correctly handle files that contain "
15301 "embedded ASCII NUL characters. However unlike L</download>, this function "
15302 "is limited in the total size of file that can be handled."
15306 #: ../fish/guestfish-actions.pod:4130
15311 #: ../fish/guestfish-actions.pod:4132
15314 " read-lines path\n"
15319 #: ../fish/guestfish-actions.pod:4136 ../src/guestfs-actions.pod:6448
15321 "The file contents are returned as a list of lines. Trailing C<LF> and "
15322 "C<CRLF> character sequences are I<not> returned."
15326 #: ../fish/guestfish-actions.pod:4139
15328 "Note that this function cannot correctly handle binary files (specifically, "
15329 "files containing C<\\0> character which is treated as end of line). For "
15330 "those you need to use the L</read-file> function which has a more complex "
15335 #: ../fish/guestfish-actions.pod:4144
15340 #: ../fish/guestfish-actions.pod:4146
15348 #: ../fish/guestfish-actions.pod:4148 ../src/guestfs-actions.pod:6468
15349 msgid "This returns the list of directory entries in directory C<dir>."
15353 #: ../fish/guestfish-actions.pod:4150 ../src/guestfs-actions.pod:6470
15355 "All entries in the directory are returned, including C<.> and C<..>. The "
15356 "entries are I<not> sorted, but returned in the same order as the underlying "
15361 #: ../fish/guestfish-actions.pod:4154 ../src/guestfs-actions.pod:6474
15363 "Also this call returns basic file type information about each file. The "
15364 "C<ftyp> field will contain one of the following characters:"
15368 #: ../fish/guestfish-actions.pod:4159 ../src/guestfs-actions.pod:6479
15373 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6481
15374 msgid "Block special"
15378 #: ../fish/guestfish-actions.pod:4163 ../src/guestfs-actions.pod:6483
15383 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6485
15384 msgid "Char special"
15388 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6487
15393 #: ../fish/guestfish-actions.pod:4169 ../src/guestfs-actions.pod:6489
15398 #: ../fish/guestfish-actions.pod:4171 ../src/guestfs-actions.pod:6491
15403 #: ../fish/guestfish-actions.pod:4173 ../src/guestfs-actions.pod:6493
15404 msgid "FIFO (named pipe)"
15408 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6495
15413 #: ../fish/guestfish-actions.pod:4177 ../src/guestfs-actions.pod:6497
15414 msgid "Symbolic link"
15418 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6499
15423 #: ../fish/guestfish-actions.pod:4181 ../src/guestfs-actions.pod:6501
15424 msgid "Regular file"
15428 #: ../fish/guestfish-actions.pod:4183 ../src/guestfs-actions.pod:6503
15433 #: ../fish/guestfish-actions.pod:4185 ../src/guestfs-actions.pod:6505
15438 #: ../fish/guestfish-actions.pod:4187 ../src/guestfs-actions.pod:6507
15443 #: ../fish/guestfish-actions.pod:4189 ../src/guestfs-actions.pod:6509
15444 msgid "Unknown file type"
15448 #: ../fish/guestfish-actions.pod:4191 ../src/guestfs-actions.pod:6511
15453 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6513
15455 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
15459 #: ../fish/guestfish-actions.pod:4198
15461 "This function is primarily intended for use by programs. To get a simple "
15462 "list of names, use L</ls>. To get a printable directory for human "
15463 "consumption, use L</ll>."
15467 #: ../fish/guestfish-actions.pod:4202
15472 #: ../fish/guestfish-actions.pod:4204
15480 #: ../fish/guestfish-actions.pod:4206 ../src/guestfs-actions.pod:6534
15481 msgid "This command reads the target of a symbolic link."
15485 #: ../fish/guestfish-actions.pod:4208
15486 msgid "readlinklist"
15490 #: ../fish/guestfish-actions.pod:4210
15493 " readlinklist path 'names ...'\n"
15498 #: ../fish/guestfish-actions.pod:4212 ../src/guestfs-actions.pod:6548
15500 "This call allows you to do a C<readlink> operation on multiple files, where "
15501 "all files are in the directory C<path>. C<names> is the list of files from "
15506 #: ../fish/guestfish-actions.pod:4216 ../src/guestfs-actions.pod:6552
15508 "On return you get a list of strings, with a one-to-one correspondence to the "
15509 "C<names> list. Each string is the value of the symbolic link."
15513 #: ../fish/guestfish-actions.pod:4220 ../src/guestfs-actions.pod:6556
15515 "If the C<readlink(2)> operation fails on any name, then the corresponding "
15516 "result string is the empty string C<\"\">. However the whole operation is "
15517 "completed even if there were C<readlink(2)> errors, and so you can call this "
15518 "function with names where you don't know if they are symbolic links already "
15519 "(albeit slightly less efficient)."
15523 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6563
15525 "This call is intended for programs that want to efficiently list a directory "
15526 "contents without making many round-trips. Very long directory listings "
15527 "might cause the protocol message size to be exceeded, causing this call to "
15528 "fail. The caller must split up such requests into smaller groups of names."
15532 #: ../fish/guestfish-actions.pod:4234
15537 #: ../fish/guestfish-actions.pod:4236
15545 #: ../fish/guestfish-actions.pod:4238 ../src/guestfs-actions.pod:6582
15547 "Return the canonicalized absolute pathname of C<path>. The returned path "
15548 "has no C<.>, C<..> or symbolic link path elements."
15552 #: ../fish/guestfish-actions.pod:4241
15553 msgid "removexattr"
15557 #: ../fish/guestfish-actions.pod:4243
15560 " removexattr xattr path\n"
15565 #: ../fish/guestfish-actions.pod:4245 ../src/guestfs-actions.pod:6597
15567 "This call removes the extended attribute named C<xattr> of the file C<path>."
15571 #: ../fish/guestfish-actions.pod:4248
15572 msgid "See also: L</lremovexattr>, L<attr(5)>."
15576 #: ../fish/guestfish-actions.pod:4250
15581 #: ../fish/guestfish-actions.pod:4252
15584 " resize2fs device\n"
15589 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6612
15591 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
15592 "underlying device."
15596 #: ../fish/guestfish-actions.pod:4257
15598 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
15599 "before calling this command. For unknown reasons C<resize2fs> sometimes "
15600 "gives an error about this and sometimes not. In any case, it is always safe "
15601 "to call L</e2fsck-f> before calling this function."
15605 #: ../fish/guestfish-actions.pod:4263
15606 msgid "resize2fs-M"
15610 #: ../fish/guestfish-actions.pod:4265
15613 " resize2fs-M device\n"
15618 #: ../fish/guestfish-actions.pod:4267
15620 "This command is the same as L</resize2fs>, but the filesystem is resized to "
15621 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
15626 #: ../fish/guestfish-actions.pod:4271
15628 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
15629 "and read the C<Block size> and C<Block count> values. These two numbers, "
15630 "multiplied together, give the resulting size of the minimal filesystem in "
15635 #: ../fish/guestfish-actions.pod:4276
15636 msgid "resize2fs-size"
15640 #: ../fish/guestfish-actions.pod:4278
15643 " resize2fs-size device size\n"
15648 #: ../fish/guestfish-actions.pod:4280
15650 "This command is the same as L</resize2fs> except that it allows you to "
15651 "specify the new size (in bytes) explicitly."
15655 #: ../fish/guestfish-actions.pod:4283
15660 #: ../fish/guestfish-actions.pod:4285
15668 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6664
15669 msgid "Remove the single file C<path>."
15673 #: ../fish/guestfish-actions.pod:4289
15678 #: ../fish/guestfish-actions.pod:4291
15686 #: ../fish/guestfish-actions.pod:4293 ../src/guestfs-actions.pod:6676
15688 "Remove the file or directory C<path>, recursively removing the contents if "
15689 "its a directory. This is like the C<rm -rf> shell command."
15693 #: ../fish/guestfish-actions.pod:4297
15698 #: ../fish/guestfish-actions.pod:4299
15706 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6690
15707 msgid "Remove the single directory C<path>."
15711 #: ../fish/guestfish-actions.pod:4303
15712 msgid "rmmountpoint"
15716 #: ../fish/guestfish-actions.pod:4305
15719 " rmmountpoint exemptpath\n"
15724 #: ../fish/guestfish-actions.pod:4307
15726 "This calls removes a mountpoint that was previously created with L</"
15727 "mkmountpoint>. See L</mkmountpoint> for full details."
15731 #: ../fish/guestfish-actions.pod:4311
15732 msgid "scrub-device"
15736 #: ../fish/guestfish-actions.pod:4313
15739 " scrub-device device\n"
15744 #: ../fish/guestfish-actions.pod:4315 ../src/guestfs-actions.pod:6716
15746 "This command writes patterns over C<device> to make data retrieval more "
15751 #: ../fish/guestfish-actions.pod:4318 ../fish/guestfish-actions.pod:4330
15752 #: ../fish/guestfish-actions.pod:4343 ../src/guestfs-actions.pod:6719
15753 #: ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:6756
15755 "It is an interface to the L<scrub(1)> program. See that manual page for "
15760 #: ../fish/guestfish-actions.pod:4321
15765 #: ../fish/guestfish-actions.pod:4323
15768 " scrub-file file\n"
15773 #: ../fish/guestfish-actions.pod:4325 ../src/guestfs-actions.pod:6732
15775 "This command writes patterns over a file to make data retrieval more "
15780 #: ../fish/guestfish-actions.pod:4328 ../src/guestfs-actions.pod:6735
15781 msgid "The file is I<removed> after scrubbing."
15785 #: ../fish/guestfish-actions.pod:4333
15786 msgid "scrub-freespace"
15790 #: ../fish/guestfish-actions.pod:4335
15793 " scrub-freespace dir\n"
15798 #: ../fish/guestfish-actions.pod:4337
15800 "This command creates the directory C<dir> and then fills it with files until "
15801 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
15802 "deletes them. The intention is to scrub any free space on the partition "
15803 "containing C<dir>."
15807 #: ../fish/guestfish-actions.pod:4346
15812 #: ../fish/guestfish-actions.pod:4348
15817 #: ../fish/guestfish-actions.pod:4350
15820 " set-append append\n"
15825 #: ../fish/guestfish-actions.pod:4352 ../src/guestfs-actions.pod:6769
15827 "This function is used to add additional options to the guest kernel command "
15832 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6772
15834 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
15835 "environment variable."
15839 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6775
15841 "Setting C<append> to C<NULL> means I<no> additional options are passed "
15842 "(libguestfs always adds a few of its own)."
15846 #: ../fish/guestfish-actions.pod:4361
15847 msgid "set-attach-method"
15851 #: ../fish/guestfish-actions.pod:4363
15852 msgid "attach-method"
15856 #: ../fish/guestfish-actions.pod:4365
15859 " set-attach-method attachmethod\n"
15864 #: ../fish/guestfish-actions.pod:4367 ../src/guestfs-actions.pod:6788
15866 "Set the method that libguestfs uses to connect to the back end guestfsd "
15867 "daemon. Possible methods are:"
15871 #: ../fish/guestfish-actions.pod:4372 ../src/guestfs-actions.pod:6793
15872 #: ../src/guestfs.pod:2916
15873 msgid "C<appliance>"
15877 #: ../fish/guestfish-actions.pod:4374 ../src/guestfs-actions.pod:6795
15879 "Launch an appliance and connect to it. This is the ordinary method and the "
15884 #: ../fish/guestfish-actions.pod:4377 ../src/guestfs-actions.pod:6798
15885 msgid "C<unix:I<path>>"
15889 #: ../fish/guestfish-actions.pod:4379 ../src/guestfs-actions.pod:6800
15890 msgid "Connect to the Unix domain socket I<path>."
15894 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6802
15896 "This method lets you connect to an existing daemon or (using virtio-serial) "
15897 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
15898 "RUNNING DAEMONS>."
15902 #: ../fish/guestfish-actions.pod:4387
15903 msgid "set-autosync"
15907 #: ../fish/guestfish-actions.pod:4389
15912 #: ../fish/guestfish-actions.pod:4391
15915 " set-autosync true|false\n"
15920 #: ../fish/guestfish-actions.pod:4393 ../src/guestfs-actions.pod:6818
15922 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
15923 "effort attempt to make filesystems consistent and synchronized when the "
15924 "handle is closed (also if the program exits without closing handles)."
15928 #: ../fish/guestfish-actions.pod:4398 ../src/guestfs-actions.pod:6823
15930 "This is enabled by default (since libguestfs 1.5.24, previously it was "
15931 "disabled by default)."
15935 #: ../fish/guestfish-actions.pod:4401
15940 #: ../fish/guestfish-actions.pod:4403
15945 #: ../fish/guestfish-actions.pod:4405
15948 " set-direct true|false\n"
15953 #: ../fish/guestfish-actions.pod:4407 ../src/guestfs-actions.pod:6836
15955 "If the direct appliance mode flag is enabled, then stdin and stdout are "
15956 "passed directly through to the appliance once it is launched."
15960 #: ../fish/guestfish-actions.pod:4411
15962 "One consequence of this is that log messages aren't caught by the library "
15963 "and handled by L</set-log-message-callback>, but go straight to stdout."
15967 #: ../fish/guestfish-actions.pod:4415 ../src/guestfs-actions.pod:6844
15968 msgid "You probably don't want to use this unless you know what you are doing."
15972 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6847
15973 msgid "The default is disabled."
15977 #: ../fish/guestfish-actions.pod:4420
15978 msgid "set-e2label"
15982 #: ../fish/guestfish-actions.pod:4422
15985 " set-e2label device label\n"
15990 #: ../fish/guestfish-actions.pod:4424 ../src/guestfs-actions.pod:6860
15992 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15993 "C<label>. Filesystem labels are limited to 16 characters."
15997 #: ../fish/guestfish-actions.pod:4428
15999 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
16000 "label on a filesystem."
16004 #: ../fish/guestfish-actions.pod:4431
16009 #: ../fish/guestfish-actions.pod:4433
16012 " set-e2uuid device uuid\n"
16017 #: ../fish/guestfish-actions.pod:4435 ../src/guestfs-actions.pod:6878
16019 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
16020 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
16021 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
16025 #: ../fish/guestfish-actions.pod:4440
16027 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
16028 "UUID of a filesystem."
16032 #: ../fish/guestfish-actions.pod:4443
16033 msgid "set-memsize"
16037 #: ../fish/guestfish-actions.pod:4445
16042 #: ../fish/guestfish-actions.pod:4447
16045 " set-memsize memsize\n"
16050 #: ../fish/guestfish-actions.pod:4449
16052 "This sets the memory size in megabytes allocated to the qemu subprocess. "
16053 "This only has any effect if called before L</launch>."
16057 #: ../fish/guestfish-actions.pod:4453 ../src/guestfs-actions.pod:6900
16059 "You can also change this by setting the environment variable "
16060 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
16064 #: ../fish/guestfish-actions.pod:4460
16065 msgid "set-network"
16069 #: ../fish/guestfish-actions.pod:4462
16074 #: ../fish/guestfish-actions.pod:4464
16077 " set-network true|false\n"
16082 #: ../fish/guestfish-actions.pod:4466 ../src/guestfs-actions.pod:6917
16084 "If C<network> is true, then the network is enabled in the libguestfs "
16085 "appliance. The default is false."
16089 #: ../fish/guestfish-actions.pod:4469 ../src/guestfs-actions.pod:6920
16091 "This affects whether commands are able to access the network (see L<guestfs"
16092 "(3)/RUNNING COMMANDS>)."
16096 #: ../fish/guestfish-actions.pod:4472
16098 "You must call this before calling L</launch>, otherwise it has no effect."
16102 #: ../fish/guestfish-actions.pod:4475
16107 #: ../fish/guestfish-actions.pod:4479
16110 " set-path searchpath\n"
16115 #: ../fish/guestfish-actions.pod:4481 ../src/guestfs-actions.pod:6936
16116 msgid "Set the path that libguestfs searches for kernel and initrd.img."
16120 #: ../fish/guestfish-actions.pod:4483 ../src/guestfs-actions.pod:6938
16122 "The default is C<$libdir/guestfs> unless overridden by setting "
16123 "C<LIBGUESTFS_PATH> environment variable."
16127 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6941
16128 msgid "Setting C<path> to C<NULL> restores the default path."
16132 #: ../fish/guestfish-actions.pod:4488
16137 #: ../fish/guestfish-actions.pod:4490
16142 #: ../fish/guestfish-actions.pod:4492
16145 " set-pgroup true|false\n"
16150 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6953
16152 "If C<pgroup> is true, child processes are placed into their own process "
16157 #: ../fish/guestfish-actions.pod:4497 ../src/guestfs-actions.pod:6956
16159 "The practical upshot of this is that signals like C<SIGINT> (from users "
16160 "pressing C<^C>) won't be received by the child process."
16164 #: ../fish/guestfish-actions.pod:4500 ../src/guestfs-actions.pod:6959
16166 "The default for this flag is false, because usually you want C<^C> to kill "
16171 #: ../fish/guestfish-actions.pod:4503
16176 #: ../fish/guestfish-actions.pod:4505
16181 #: ../fish/guestfish-actions.pod:4507
16189 #: ../fish/guestfish-actions.pod:4509 ../src/guestfs-actions.pod:6972
16190 msgid "Set the qemu binary that we will use."
16194 #: ../fish/guestfish-actions.pod:4511 ../src/guestfs-actions.pod:6974
16196 "The default is chosen when the library was compiled by the configure script."
16200 #: ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6977
16202 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
16207 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6980
16208 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
16212 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6982
16214 "Note that you should call this function as early as possible after creating "
16215 "the handle. This is because some pre-launch operations depend on testing "
16216 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
16217 "don't retest features, and so you might see inconsistent results. Using the "
16218 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
16219 "the qemu binary at the same time as the handle is created."
16223 #: ../fish/guestfish-actions.pod:4527
16224 msgid "set-recovery-proc"
16228 #: ../fish/guestfish-actions.pod:4529
16229 msgid "recovery-proc"
16233 #: ../fish/guestfish-actions.pod:4531
16236 " set-recovery-proc true|false\n"
16241 #: ../fish/guestfish-actions.pod:4533
16243 "If this is called with the parameter C<false> then L</launch> does not "
16244 "create a recovery process. The purpose of the recovery process is to stop "
16245 "runaway qemu processes in the case where the main program aborts abruptly."
16249 #: ../fish/guestfish-actions.pod:4538
16251 "This only has any effect if called before L</launch>, and the default is "
16256 #: ../fish/guestfish-actions.pod:4541 ../src/guestfs-actions.pod:7008
16258 "About the only time when you would want to disable this is if the main "
16259 "process will fork itself into the background (\"daemonize\" itself). In "
16260 "this case the recovery process thinks that the main program has disappeared "
16261 "and so kills qemu, which is not very helpful."
16265 #: ../fish/guestfish-actions.pod:4547
16266 msgid "set-selinux"
16270 #: ../fish/guestfish-actions.pod:4549
16275 #: ../fish/guestfish-actions.pod:4551
16278 " set-selinux true|false\n"
16283 #: ../fish/guestfish-actions.pod:4553 ../src/guestfs-actions.pod:7024
16285 "This sets the selinux flag that is passed to the appliance at boot time. "
16286 "The default is C<selinux=0> (disabled)."
16290 #: ../fish/guestfish-actions.pod:4556 ../src/guestfs-actions.pod:7027
16292 "Note that if SELinux is enabled, it is always in Permissive mode "
16293 "(C<enforcing=0>)."
16297 #: ../fish/guestfish-actions.pod:4562
16302 #: ../fish/guestfish-actions.pod:4564
16307 #: ../fish/guestfish-actions.pod:4566
16315 #: ../fish/guestfish-actions.pod:4568 ../src/guestfs-actions.pod:7043
16317 "Change the number of virtual CPUs assigned to the appliance. The default is "
16318 "C<1>. Increasing this may improve performance, though often it has no "
16323 #: ../fish/guestfish-actions.pod:4572
16324 msgid "This function must be called before L</launch>."
16328 #: ../fish/guestfish-actions.pod:4574
16333 #: ../fish/guestfish-actions.pod:4576
16338 #: ../fish/guestfish-actions.pod:4578
16341 " set-trace true|false\n"
16346 #: ../fish/guestfish-actions.pod:4580 ../src/guestfs-actions.pod:7059
16348 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
16349 "return values are traced."
16353 #: ../fish/guestfish-actions.pod:4583 ../src/guestfs-actions.pod:7062
16355 "If you want to trace C API calls into libguestfs (and other libraries) then "
16356 "possibly a better way is to use the external ltrace(1) command."
16360 #: ../fish/guestfish-actions.pod:4587 ../src/guestfs-actions.pod:7066
16362 "Command traces are disabled unless the environment variable "
16363 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
16367 #: ../fish/guestfish-actions.pod:4590
16369 "Trace messages are normally sent to C<stderr>, unless you register a "
16370 "callback to send them somewhere else (see L</set-event-callback>)."
16374 #: ../fish/guestfish-actions.pod:4594
16375 msgid "set-verbose"
16379 #: ../fish/guestfish-actions.pod:4596
16384 #: ../fish/guestfish-actions.pod:4598
16387 " set-verbose true|false\n"
16392 #: ../fish/guestfish-actions.pod:4600 ../src/guestfs-actions.pod:7083
16393 msgid "If C<verbose> is true, this turns on verbose messages."
16397 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:7085
16399 "Verbose messages are disabled unless the environment variable "
16400 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
16404 #: ../fish/guestfish-actions.pod:4605
16406 "Verbose messages are normally sent to C<stderr>, unless you register a "
16407 "callback to send them somewhere else (see L</set-event-callback>)."
16411 #: ../fish/guestfish-actions.pod:4609
16416 #: ../fish/guestfish-actions.pod:4611
16419 " setcon context\n"
16424 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:7102
16426 "This sets the SELinux security context of the daemon to the string "
16431 #: ../fish/guestfish-actions.pod:4616 ../src/guestfs-actions.pod:7105
16432 msgid "See the documentation about SELINUX in L<guestfs(3)>."
16436 #: ../fish/guestfish-actions.pod:4618
16441 #: ../fish/guestfish-actions.pod:4620
16444 " setxattr xattr val vallen path\n"
16449 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:7120
16451 "This call sets the extended attribute named C<xattr> of the file C<path> to "
16452 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
16456 #: ../fish/guestfish-actions.pod:4626
16457 msgid "See also: L</lsetxattr>, L<attr(5)>."
16461 #: ../fish/guestfish-actions.pod:4628
16466 #: ../fish/guestfish-actions.pod:4630
16469 " sfdisk device cyls heads sectors 'lines ...'\n"
16474 #: ../fish/guestfish-actions.pod:4632 ../src/guestfs-actions.pod:7147
16476 "This is a direct interface to the L<sfdisk(8)> program for creating "
16477 "partitions on block devices."
16481 #: ../fish/guestfish-actions.pod:4635 ../src/guestfs-actions.pod:7150
16482 msgid "C<device> should be a block device, for example C</dev/sda>."
16486 #: ../fish/guestfish-actions.pod:4637 ../src/guestfs-actions.pod:7152
16488 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
16489 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
16490 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
16491 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
16492 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
16493 "the kernel) cannot work out the right geometry and you will need to tell it."
16497 #: ../fish/guestfish-actions.pod:4645 ../src/guestfs-actions.pod:7160
16499 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
16500 "refer to the L<sfdisk(8)> manpage."
16504 #: ../fish/guestfish-actions.pod:4648 ../src/guestfs-actions.pod:7163
16506 "To create a single partition occupying the whole disk, you would pass "
16507 "C<lines> as a single element list, when the single element being the string "
16512 #: ../fish/guestfish-actions.pod:4652
16513 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
16517 #: ../fish/guestfish-actions.pod:4655 ../fish/guestfish-actions.pod:4675
16518 #: ../fish/guestfish-actions.pod:4694
16520 "I<This function is deprecated.> In new code, use the L</part_add> call "
16525 #: ../fish/guestfish-actions.pod:4662
16530 #: ../fish/guestfish-actions.pod:4664
16533 " sfdiskM device 'lines ...'\n"
16538 #: ../fish/guestfish-actions.pod:4666
16540 "This is a simplified interface to the L</sfdisk> command, where partition "
16541 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
16542 "you don't need to specify the cyls, heads and sectors parameters which were "
16543 "rarely if ever used anyway."
16547 #: ../fish/guestfish-actions.pod:4672
16548 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
16552 #: ../fish/guestfish-actions.pod:4682
16557 #: ../fish/guestfish-actions.pod:4684
16560 " sfdisk-N device partnum cyls heads sectors line\n"
16565 #: ../fish/guestfish-actions.pod:4686 ../src/guestfs-actions.pod:7219
16567 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
16568 "(note: C<n> counts from 1)."
16572 #: ../fish/guestfish-actions.pod:4689
16574 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
16575 "cyls/heads/sectors parameters."
16579 #: ../fish/guestfish-actions.pod:4692
16580 msgid "See also: L</part-add>"
16584 #: ../fish/guestfish-actions.pod:4701
16585 msgid "sfdisk-disk-geometry"
16589 #: ../fish/guestfish-actions.pod:4703
16592 " sfdisk-disk-geometry device\n"
16597 #: ../fish/guestfish-actions.pod:4705
16599 "This displays the disk geometry of C<device> read from the partition table. "
16600 "Especially in the case where the underlying block device has been resized, "
16601 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
16602 "kernel-geometry>)."
16606 #: ../fish/guestfish-actions.pod:4710 ../fish/guestfish-actions.pod:4719
16607 #: ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7258
16608 msgid "The result is in human-readable format, and not designed to be parsed."
16612 #: ../fish/guestfish-actions.pod:4713
16613 msgid "sfdisk-kernel-geometry"
16617 #: ../fish/guestfish-actions.pod:4715
16620 " sfdisk-kernel-geometry device\n"
16625 #: ../fish/guestfish-actions.pod:4717 ../src/guestfs-actions.pod:7256
16626 msgid "This displays the kernel's idea of the geometry of C<device>."
16630 #: ../fish/guestfish-actions.pod:4722
16635 #: ../fish/guestfish-actions.pod:4724
16638 " sfdisk-l device\n"
16643 #: ../fish/guestfish-actions.pod:4726 ../src/guestfs-actions.pod:7279
16645 "This displays the partition table on C<device>, in the human-readable output "
16646 "of the L<sfdisk(8)> command. It is not intended to be parsed."
16650 #: ../fish/guestfish-actions.pod:4730
16651 msgid "See also: L</part-list>"
16655 #: ../fish/guestfish-actions.pod:4732
16657 "I<This function is deprecated.> In new code, use the L</part_list> call "
16662 #: ../fish/guestfish-actions.pod:4739
16667 #: ../fish/guestfish-actions.pod:4741
16675 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7296
16677 "This call runs a command from the guest filesystem via the guest's C</bin/"
16682 #: ../fish/guestfish-actions.pod:4746
16683 msgid "This is like L</command>, but passes the command to:"
16687 #: ../fish/guestfish-actions.pod:4748 ../src/guestfs-actions.pod:7301
16690 " /bin/sh -c \"command\"\n"
16695 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7303
16697 "Depending on the guest's shell, this usually results in wildcards being "
16698 "expanded, shell expressions being interpolated and so on."
16702 #: ../fish/guestfish-actions.pod:4754
16703 msgid "All the provisos about L</command> apply to this call."
16707 #: ../fish/guestfish-actions.pod:4756
16712 #: ../fish/guestfish-actions.pod:4758
16715 " sh-lines command\n"
16720 #: ../fish/guestfish-actions.pod:4760
16721 msgid "This is the same as L</sh>, but splits the result into a list of lines."
16725 #: ../fish/guestfish-actions.pod:4763
16726 msgid "See also: L</command-lines>"
16730 #: ../fish/guestfish-actions.pod:4765
16735 #: ../fish/guestfish-actions.pod:4767
16743 #: ../fish/guestfish-actions.pod:4769 ../src/guestfs-actions.pod:7337
16744 msgid "Sleep for C<secs> seconds."
16748 #: ../fish/guestfish-actions.pod:4771
16753 #: ../fish/guestfish-actions.pod:4773
16761 #: ../fish/guestfish-actions.pod:4777 ../src/guestfs-actions.pod:7351
16762 msgid "This is the same as the C<stat(2)> system call."
16766 #: ../fish/guestfish-actions.pod:4779
16771 #: ../fish/guestfish-actions.pod:4781
16779 #: ../fish/guestfish-actions.pod:4783 ../src/guestfs-actions.pod:7365
16781 "Returns file system statistics for any mounted file system. C<path> should "
16782 "be a file or directory in the mounted file system (typically it is the mount "
16783 "point itself, but it doesn't need to be)."
16787 #: ../fish/guestfish-actions.pod:4787 ../src/guestfs-actions.pod:7369
16788 msgid "This is the same as the C<statvfs(2)> system call."
16792 #: ../fish/guestfish-actions.pod:4789
16797 #: ../fish/guestfish-actions.pod:4791
16805 #: ../fish/guestfish-actions.pod:4793 ../src/guestfs-actions.pod:7383
16807 "This runs the L<strings(1)> command on a file and returns the list of "
16808 "printable strings found."
16812 #: ../fish/guestfish-actions.pod:4799
16817 #: ../fish/guestfish-actions.pod:4801
16820 " strings-e encoding path\n"
16825 #: ../fish/guestfish-actions.pod:4803
16827 "This is like the L</strings> command, but allows you to specify the encoding "
16828 "of strings that are looked for in the source file C<path>."
16832 #: ../fish/guestfish-actions.pod:4807 ../src/guestfs-actions.pod:7406
16833 msgid "Allowed encodings are:"
16837 #: ../fish/guestfish-actions.pod:4811 ../src/guestfs-actions.pod:7410
16842 #: ../fish/guestfish-actions.pod:4813
16844 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
16845 "ISO-8859-X (this is what L</strings> uses)."
16849 #: ../fish/guestfish-actions.pod:4816 ../src/guestfs-actions.pod:7415
16854 #: ../fish/guestfish-actions.pod:4818 ../src/guestfs-actions.pod:7417
16855 msgid "Single 8-bit-byte characters."
16859 #: ../fish/guestfish-actions.pod:4820 ../src/guestfs-actions.pod:7419
16864 #: ../fish/guestfish-actions.pod:4822 ../src/guestfs-actions.pod:7421
16865 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
16869 #: ../fish/guestfish-actions.pod:4825 ../src/guestfs-actions.pod:7424
16870 msgid "l (lower case letter L)"
16874 #: ../fish/guestfish-actions.pod:4827 ../src/guestfs-actions.pod:7426
16876 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
16877 "examining binaries in Windows guests."
16881 #: ../fish/guestfish-actions.pod:4830 ../src/guestfs-actions.pod:7429
16886 #: ../fish/guestfish-actions.pod:4832 ../src/guestfs-actions.pod:7431
16887 msgid "32-bit big endian such as UCS-4BE."
16891 #: ../fish/guestfish-actions.pod:4834 ../src/guestfs-actions.pod:7433
16896 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7435
16897 msgid "32-bit little endian such as UCS-4LE."
16901 #: ../fish/guestfish-actions.pod:4840 ../src/guestfs-actions.pod:7439
16902 msgid "The returned strings are transcoded to UTF-8."
16906 #: ../fish/guestfish-actions.pod:4845
16907 msgid "swapoff-device"
16911 #: ../fish/guestfish-actions.pod:4847
16914 " swapoff-device device\n"
16919 #: ../fish/guestfish-actions.pod:4849
16921 "This command disables the libguestfs appliance swap device or partition "
16922 "named C<device>. See L</swapon-device>."
16926 #: ../fish/guestfish-actions.pod:4853
16927 msgid "swapoff-file"
16931 #: ../fish/guestfish-actions.pod:4855
16934 " swapoff-file file\n"
16939 #: ../fish/guestfish-actions.pod:4857 ../src/guestfs-actions.pod:7470
16940 msgid "This command disables the libguestfs appliance swap on file."
16944 #: ../fish/guestfish-actions.pod:4859
16945 msgid "swapoff-label"
16949 #: ../fish/guestfish-actions.pod:4861
16952 " swapoff-label label\n"
16957 #: ../fish/guestfish-actions.pod:4863 ../src/guestfs-actions.pod:7482
16959 "This command disables the libguestfs appliance swap on labeled swap "
16964 #: ../fish/guestfish-actions.pod:4866
16965 msgid "swapoff-uuid"
16969 #: ../fish/guestfish-actions.pod:4868
16972 " swapoff-uuid uuid\n"
16977 #: ../fish/guestfish-actions.pod:4870 ../src/guestfs-actions.pod:7495
16979 "This command disables the libguestfs appliance swap partition with the given "
16984 #: ../fish/guestfish-actions.pod:4873
16985 msgid "swapon-device"
16989 #: ../fish/guestfish-actions.pod:4875
16992 " swapon-device device\n"
16997 #: ../fish/guestfish-actions.pod:4877
16999 "This command enables the libguestfs appliance to use the swap device or "
17000 "partition named C<device>. The increased memory is made available for all "
17001 "commands, for example those run using L</command> or L</sh>."
17005 #: ../fish/guestfish-actions.pod:4882 ../src/guestfs-actions.pod:7513
17007 "Note that you should not swap to existing guest swap partitions unless you "
17008 "know what you are doing. They may contain hibernation information, or other "
17009 "information that the guest doesn't want you to trash. You also risk leaking "
17010 "information about the host to the guest this way. Instead, attach a new "
17011 "host device to the guest and swap on that."
17015 #: ../fish/guestfish-actions.pod:4889
17016 msgid "swapon-file"
17020 #: ../fish/guestfish-actions.pod:4891
17023 " swapon-file file\n"
17028 #: ../fish/guestfish-actions.pod:4893
17030 "This command enables swap to a file. See L</swapon-device> for other notes."
17034 #: ../fish/guestfish-actions.pod:4896
17035 msgid "swapon-label"
17039 #: ../fish/guestfish-actions.pod:4898
17042 " swapon-label label\n"
17047 #: ../fish/guestfish-actions.pod:4900
17049 "This command enables swap to a labeled swap partition. See L</swapon-"
17050 "device> for other notes."
17054 #: ../fish/guestfish-actions.pod:4903
17055 msgid "swapon-uuid"
17059 #: ../fish/guestfish-actions.pod:4905
17062 " swapon-uuid uuid\n"
17067 #: ../fish/guestfish-actions.pod:4907
17069 "This command enables swap to a swap partition with the given UUID. See L</"
17070 "swapon-device> for other notes."
17074 #: ../fish/guestfish-actions.pod:4910
17079 #: ../fish/guestfish-actions.pod:4912
17087 #: ../fish/guestfish-actions.pod:4914 ../src/guestfs-actions.pod:7568
17089 "This syncs the disk, so that any writes are flushed through to the "
17090 "underlying disk image."
17094 #: ../fish/guestfish-actions.pod:4917 ../src/guestfs-actions.pod:7571
17096 "You should always call this if you have modified a disk image, before "
17097 "closing the handle."
17101 #: ../fish/guestfish-actions.pod:4920
17106 #: ../fish/guestfish-actions.pod:4922
17114 #: ../fish/guestfish-actions.pod:4924 ../src/guestfs-actions.pod:7584
17116 "This command returns up to the last 10 lines of a file as a list of strings."
17120 #: ../fish/guestfish-actions.pod:4930
17125 #: ../fish/guestfish-actions.pod:4932
17128 " tail-n nrlines path\n"
17133 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7603
17135 "If the parameter C<nrlines> is a positive number, this returns the last "
17136 "C<nrlines> lines of the file C<path>."
17140 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7606
17142 "If the parameter C<nrlines> is a negative number, this returns lines from "
17143 "the file C<path>, starting with the C<-nrlines>th line."
17147 #: ../fish/guestfish-actions.pod:4945
17152 #: ../fish/guestfish-actions.pod:4947
17155 " tar-in (tarfile|-) directory\n"
17160 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7627
17162 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
17163 "tar file) into C<directory>."
17167 #: ../fish/guestfish-actions.pod:4952
17168 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
17172 #: ../fish/guestfish-actions.pod:4957
17177 #: ../fish/guestfish-actions.pod:4959
17180 " tar-out directory (tarfile|-)\n"
17185 #: ../fish/guestfish-actions.pod:4961 ../src/guestfs-actions.pod:7644
17187 "This command packs the contents of C<directory> and downloads it to local "
17192 #: ../fish/guestfish-actions.pod:4964
17193 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
17197 #: ../fish/guestfish-actions.pod:4969
17202 #: ../fish/guestfish-actions.pod:4971
17205 " tgz-in (tarball|-) directory\n"
17210 #: ../fish/guestfish-actions.pod:4973 ../src/guestfs-actions.pod:7661
17212 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
17213 "tar file) into C<directory>."
17217 #: ../fish/guestfish-actions.pod:4976
17218 msgid "To upload an uncompressed tarball, use L</tar-in>."
17222 #: ../fish/guestfish-actions.pod:4980
17227 #: ../fish/guestfish-actions.pod:4982
17230 " tgz-out directory (tarball|-)\n"
17235 #: ../fish/guestfish-actions.pod:4984 ../src/guestfs-actions.pod:7677
17237 "This command packs the contents of C<directory> and downloads it to local "
17242 #: ../fish/guestfish-actions.pod:4987
17243 msgid "To download an uncompressed tarball, use L</tar-out>."
17247 #: ../fish/guestfish-actions.pod:4991
17252 #: ../fish/guestfish-actions.pod:4993
17260 #: ../fish/guestfish-actions.pod:4995 ../src/guestfs-actions.pod:7692
17262 "Touch acts like the L<touch(1)> command. It can be used to update the "
17263 "timestamps on a file, or, if the file does not exist, to create a new zero-"
17268 #: ../fish/guestfish-actions.pod:4999 ../src/guestfs-actions.pod:7696
17270 "This command only works on regular files, and will fail on other file types "
17271 "such as directories, symbolic links, block special etc."
17275 #: ../fish/guestfish-actions.pod:5002
17280 #: ../fish/guestfish-actions.pod:5004
17288 #: ../fish/guestfish-actions.pod:5006 ../src/guestfs-actions.pod:7709
17290 "This command truncates C<path> to a zero-length file. The file must exist "
17295 #: ../fish/guestfish-actions.pod:5009
17296 msgid "truncate-size"
17300 #: ../fish/guestfish-actions.pod:5011
17303 " truncate-size path size\n"
17308 #: ../fish/guestfish-actions.pod:5013 ../src/guestfs-actions.pod:7723
17310 "This command truncates C<path> to size C<size> bytes. The file must exist "
17315 #: ../fish/guestfish-actions.pod:5016
17317 "If the current file size is less than C<size> then the file is extended to "
17318 "the required size with zero bytes. This creates a sparse file (ie. disk "
17319 "blocks are not allocated for the file until you write to it). To create a "
17320 "non-sparse file of zeroes, use L</fallocate64> instead."
17324 #: ../fish/guestfish-actions.pod:5022
17329 #: ../fish/guestfish-actions.pod:5024
17332 " tune2fs device [force:true|false] [maxmountcount:N] [mountcount:N] [errorbehavior:..] [group:N] [intervalbetweenchecks:N] [reservedblockspercentage:N] [lastmounteddirectory:..] [reservedblockscount:N] [user:N]\n"
17337 #: ../fish/guestfish-actions.pod:5026 ../src/guestfs-actions.pod:7759
17339 "This call allows you to adjust various filesystem parameters of an ext2/ext3/"
17340 "ext4 filesystem called C<device>."
17344 #: ../fish/guestfish-actions.pod:5035 ../src/guestfs-actions.pod:7768
17346 "Force tune2fs to complete the operation even in the face of errors. This is "
17347 "the same as the tune2fs C<-f> option."
17351 #: ../fish/guestfish-actions.pod:5038 ../src/guestfs-actions.pod:7771
17352 msgid "C<maxmountcount>"
17356 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7773
17358 "Set the number of mounts after which the filesystem is checked by L<e2fsck(8)"
17359 ">. If this is C<0> then the number of mounts is disregarded. This is the "
17360 "same as the tune2fs C<-c> option."
17364 #: ../fish/guestfish-actions.pod:5044 ../src/guestfs-actions.pod:7777
17365 msgid "C<mountcount>"
17369 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7779
17371 "Set the number of times the filesystem has been mounted. This is the same "
17372 "as the tune2fs C<-C> option."
17376 #: ../fish/guestfish-actions.pod:5049 ../src/guestfs-actions.pod:7782
17377 msgid "C<errorbehavior>"
17381 #: ../fish/guestfish-actions.pod:5051 ../src/guestfs-actions.pod:7784
17383 "Change the behavior of the kernel code when errors are detected. Possible "
17384 "values currently are: C<continue>, C<remount-ro>, C<panic>. In practice "
17385 "these options don't really make any difference, particularly for write "
17390 #: ../fish/guestfish-actions.pod:5056 ../src/guestfs-actions.pod:7789
17391 msgid "This is the same as the tune2fs C<-e> option."
17395 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7791
17400 #: ../fish/guestfish-actions.pod:5060 ../src/guestfs-actions.pod:7793
17402 "Set the group which can use reserved filesystem blocks. This is the same as "
17403 "the tune2fs C<-g> option except that it can only be specified as a number."
17407 #: ../fish/guestfish-actions.pod:5064 ../src/guestfs-actions.pod:7797
17408 msgid "C<intervalbetweenchecks>"
17412 #: ../fish/guestfish-actions.pod:5066 ../src/guestfs-actions.pod:7799
17414 "Adjust the maximal time between two filesystem checks (in seconds). If the "
17415 "option is passed as C<0> then time-dependent checking is disabled."
17419 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7803
17420 msgid "This is the same as the tune2fs C<-i> option."
17424 #: ../fish/guestfish-actions.pod:5072 ../src/guestfs-actions.pod:7805
17425 msgid "C<reservedblockspercentage>"
17429 #: ../fish/guestfish-actions.pod:5074 ../src/guestfs-actions.pod:7807
17431 "Set the percentage of the filesystem which may only be allocated by "
17432 "privileged processes. This is the same as the tune2fs C<-m> option."
17436 #: ../fish/guestfish-actions.pod:5078 ../src/guestfs-actions.pod:7811
17437 msgid "C<lastmounteddirectory>"
17441 #: ../fish/guestfish-actions.pod:5080 ../src/guestfs-actions.pod:7813
17443 "Set the last mounted directory. This is the same as the tune2fs C<-M> "
17448 #: ../fish/guestfish-actions.pod:5083 ../src/guestfs-actions.pod:7816
17450 "C<reservedblockscount> Set the number of reserved filesystem blocks. This "
17451 "is the same as the tune2fs C<-r> option."
17455 #: ../fish/guestfish-actions.pod:5087 ../src/guestfs-actions.pod:7820
17460 #: ../fish/guestfish-actions.pod:5089 ../src/guestfs-actions.pod:7822
17462 "Set the user who can use the reserved filesystem blocks. This is the same "
17463 "as the tune2fs C<-u> option except that it can only be specified as a number."
17467 #: ../fish/guestfish-actions.pod:5095
17469 "To get the current values of filesystem parameters, see L</tune2fs-l>. For "
17470 "precise details of how tune2fs works, see the L<tune2fs(8)> man page."
17474 #: ../fish/guestfish-actions.pod:5101
17479 #: ../fish/guestfish-actions.pod:5103
17482 " tune2fs-l device\n"
17487 #: ../fish/guestfish-actions.pod:5105 ../src/guestfs-actions.pod:7862
17489 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
17494 #: ../fish/guestfish-actions.pod:5108 ../src/guestfs-actions.pod:7865
17496 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
17497 "for more details. The list of fields returned isn't clearly defined, and "
17498 "depends on both the version of C<tune2fs> that libguestfs was built against, "
17499 "and the filesystem itself."
17503 #: ../fish/guestfish-actions.pod:5113
17508 #: ../fish/guestfish-actions.pod:5115
17511 " txz-in (tarball|-) directory\n"
17516 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7885
17518 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
17519 "tar file) into C<directory>."
17523 #: ../fish/guestfish-actions.pod:5122
17528 #: ../fish/guestfish-actions.pod:5124
17531 " txz-out directory (tarball|-)\n"
17536 #: ../fish/guestfish-actions.pod:5126 ../src/guestfs-actions.pod:7899
17538 "This command packs the contents of C<directory> and downloads it to local "
17539 "file C<tarball> (as an xz compressed tar archive)."
17543 #: ../fish/guestfish-actions.pod:5131
17548 #: ../fish/guestfish-actions.pod:5133
17556 #: ../fish/guestfish-actions.pod:5135 ../src/guestfs-actions.pod:7912
17558 "This function sets the mask used for creating new files and device nodes to "
17563 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7915
17565 "Typical umask values would be C<022> which creates new files with "
17566 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
17567 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
17571 #: ../fish/guestfish-actions.pod:5143 ../src/guestfs-actions.pod:7920
17573 "The default umask is C<022>. This is important because it means that "
17574 "directories and device nodes will be created with C<0644> or C<0755> mode "
17575 "even if you specify C<0777>."
17579 #: ../fish/guestfish-actions.pod:5147
17580 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
17584 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7927
17585 msgid "This call returns the previous umask."
17589 #: ../fish/guestfish-actions.pod:5152
17594 #: ../fish/guestfish-actions.pod:5154
17599 #: ../fish/guestfish-actions.pod:5156
17602 " umount pathordevice\n"
17607 #: ../fish/guestfish-actions.pod:5158 ../src/guestfs-actions.pod:7939
17609 "This unmounts the given filesystem. The filesystem may be specified either "
17610 "by its mountpoint (path) or the device which contains the filesystem."
17614 #: ../fish/guestfish-actions.pod:5162
17619 #: ../fish/guestfish-actions.pod:5164
17620 msgid "unmount-all"
17624 #: ../fish/guestfish-actions.pod:5166
17632 #: ../fish/guestfish-actions.pod:5168 ../src/guestfs-actions.pod:7952
17633 msgid "This unmounts all mounted filesystems."
17637 #: ../fish/guestfish-actions.pod:5170 ../src/guestfs-actions.pod:7954
17638 msgid "Some internal mounts are not unmounted by this call."
17642 #: ../fish/guestfish-actions.pod:5172
17647 #: ../fish/guestfish-actions.pod:5174
17650 " upload (filename|-) remotefilename\n"
17655 #: ../fish/guestfish-actions.pod:5176 ../fish/guestfish-actions.pod:5189
17656 #: ../src/guestfs-actions.pod:7967 ../src/guestfs-actions.pod:7991
17657 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
17661 #: ../fish/guestfish-actions.pod:5181
17662 msgid "See also L</download>."
17666 #: ../fish/guestfish-actions.pod:5185
17667 msgid "upload-offset"
17671 #: ../fish/guestfish-actions.pod:5187
17674 " upload-offset (filename|-) remotefilename offset\n"
17679 #: ../fish/guestfish-actions.pod:5192 ../src/guestfs-actions.pod:7994
17681 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
17682 "The intention is to overwrite parts of existing files or devices, although "
17683 "if a non-existant file is specified then it is created with a \"hole\" "
17684 "before C<offset>. The size of the data written is implicit in the size of "
17685 "the source C<filename>."
17689 #: ../fish/guestfish-actions.pod:5199
17691 "Note that there is no limit on the amount of data that can be uploaded with "
17692 "this call, unlike with L</pwrite>, and this call always writes the full "
17693 "amount unless an error occurs."
17697 #: ../fish/guestfish-actions.pod:5204
17698 msgid "See also L</upload>, L</pwrite>."
17702 #: ../fish/guestfish-actions.pod:5208
17707 #: ../fish/guestfish-actions.pod:5210
17710 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
17715 #: ../fish/guestfish-actions.pod:5212 ../src/guestfs-actions.pod:8027
17716 msgid "This command sets the timestamps of a file with nanosecond precision."
17720 #: ../fish/guestfish-actions.pod:5215 ../src/guestfs-actions.pod:8030
17722 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
17727 #: ../fish/guestfish-actions.pod:5218 ../src/guestfs-actions.pod:8033
17729 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
17730 "nanoseconds from the epoch."
17734 #: ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:8036
17736 "If the C<*nsecs> field contains the special value C<-1> then the "
17737 "corresponding timestamp is set to the current time. (The C<*secs> field is "
17738 "ignored in this case)."
17742 #: ../fish/guestfish-actions.pod:5225 ../src/guestfs-actions.pod:8040
17744 "If the C<*nsecs> field contains the special value C<-2> then the "
17745 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
17750 #: ../fish/guestfish-actions.pod:5229
17755 #: ../fish/guestfish-actions.pod:5231
17763 #: ../fish/guestfish-actions.pod:5233 ../src/guestfs-actions.pod:8053
17765 "Return the libguestfs version number that the program is linked against."
17769 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:8056
17771 "Note that because of dynamic linking this is not necessarily the version of "
17772 "libguestfs that you compiled against. You can compile the program, and then "
17773 "at runtime dynamically link against a completely different C<libguestfs.so> "
17778 #: ../fish/guestfish-actions.pod:5241 ../src/guestfs-actions.pod:8061
17780 "This call was added in version C<1.0.58>. In previous versions of "
17781 "libguestfs there was no way to get the version number. From C code you can "
17782 "use dynamic linker functions to find out if this symbol exists (if it "
17783 "doesn't, then it's an earlier version)."
17787 #: ../fish/guestfish-actions.pod:5247 ../src/guestfs-actions.pod:8067
17789 "The call returns a structure with four elements. The first three (C<major>, "
17790 "C<minor> and C<release>) are numbers and correspond to the usual version "
17791 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
17792 "but may be used for distro-specific information."
17796 #: ../fish/guestfish-actions.pod:5253 ../src/guestfs-actions.pod:8073
17798 "To construct the original version string: C<$major.$minor.$release$extra>"
17802 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8076
17803 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
17807 #: ../fish/guestfish-actions.pod:5258
17809 "I<Note:> Don't use this call to test for availability of features. In "
17810 "enterprise distributions we backport features from later versions into "
17811 "earlier versions, making this an unreliable way to test for features. Use "
17812 "L</available> instead."
17816 #: ../fish/guestfish-actions.pod:5264
17821 #: ../fish/guestfish-actions.pod:5266
17824 " vfs-label device\n"
17829 #: ../fish/guestfish-actions.pod:5268 ../src/guestfs-actions.pod:8096
17830 msgid "This returns the filesystem label of the filesystem on C<device>."
17834 #: ../fish/guestfish-actions.pod:5271 ../src/guestfs-actions.pod:8099
17835 msgid "If the filesystem is unlabeled, this returns the empty string."
17839 #: ../fish/guestfish-actions.pod:5273
17840 msgid "To find a filesystem from the label, use L</findfs-label>."
17844 #: ../fish/guestfish-actions.pod:5275
17849 #: ../fish/guestfish-actions.pod:5277
17852 " vfs-type device\n"
17857 #: ../fish/guestfish-actions.pod:5279 ../src/guestfs-actions.pod:8114
17859 "This command gets the filesystem type corresponding to the filesystem on "
17864 #: ../fish/guestfish-actions.pod:5282 ../src/guestfs-actions.pod:8117
17866 "For most filesystems, the result is the name of the Linux VFS module which "
17867 "would be used to mount this filesystem if you mounted it without specifying "
17868 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
17872 #: ../fish/guestfish-actions.pod:5287
17877 #: ../fish/guestfish-actions.pod:5289
17880 " vfs-uuid device\n"
17885 #: ../fish/guestfish-actions.pod:5291 ../src/guestfs-actions.pod:8133
17886 msgid "This returns the filesystem UUID of the filesystem on C<device>."
17890 #: ../fish/guestfish-actions.pod:5294 ../src/guestfs-actions.pod:8136
17891 msgid "If the filesystem does not have a UUID, this returns the empty string."
17895 #: ../fish/guestfish-actions.pod:5296
17896 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
17900 #: ../fish/guestfish-actions.pod:5298
17901 msgid "vg-activate"
17905 #: ../fish/guestfish-actions.pod:5300
17908 " vg-activate true|false 'volgroups ...'\n"
17913 #: ../fish/guestfish-actions.pod:5302 ../src/guestfs-actions.pod:8152
17915 "This command activates or (if C<activate> is false) deactivates all logical "
17916 "volumes in the listed volume groups C<volgroups>."
17920 #: ../fish/guestfish-actions.pod:5305 ../src/guestfs-actions.pod:8155
17921 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
17925 #: ../fish/guestfish-actions.pod:5307 ../src/guestfs-actions.pod:8157
17927 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
17928 "activated or deactivated."
17932 #: ../fish/guestfish-actions.pod:5310
17933 msgid "vg-activate-all"
17937 #: ../fish/guestfish-actions.pod:5312
17940 " vg-activate-all true|false\n"
17945 #: ../fish/guestfish-actions.pod:5314 ../src/guestfs-actions.pod:8170
17947 "This command activates or (if C<activate> is false) deactivates all logical "
17948 "volumes in all volume groups."
17952 #: ../fish/guestfish-actions.pod:5317 ../src/guestfs-actions.pod:8173
17953 msgid "This command is the same as running C<vgchange -a y|n>"
17957 #: ../fish/guestfish-actions.pod:5319
17962 #: ../fish/guestfish-actions.pod:5321
17965 " vgcreate volgroup 'physvols ...'\n"
17970 #: ../fish/guestfish-actions.pod:5323 ../src/guestfs-actions.pod:8186
17972 "This creates an LVM volume group called C<volgroup> from the non-empty list "
17973 "of physical volumes C<physvols>."
17977 #: ../fish/guestfish-actions.pod:5326
17982 #: ../fish/guestfish-actions.pod:5328
17985 " vglvuuids vgname\n"
17990 #: ../fish/guestfish-actions.pod:5330 ../src/guestfs-actions.pod:8199
17992 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
17993 "volumes created in this volume group."
17997 #: ../fish/guestfish-actions.pod:5333
17999 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
18000 "logical volumes and volume groups."
18004 #: ../fish/guestfish-actions.pod:5336
18005 msgid "See also L</vgpvuuids>."
18009 #: ../fish/guestfish-actions.pod:5338
18014 #: ../fish/guestfish-actions.pod:5340
18017 " vgpvuuids vgname\n"
18022 #: ../fish/guestfish-actions.pod:5342 ../src/guestfs-actions.pod:8219
18024 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
18025 "volumes that this volume group resides on."
18029 #: ../fish/guestfish-actions.pod:5345
18031 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
18032 "physical volumes and volume groups."
18036 #: ../fish/guestfish-actions.pod:5348
18037 msgid "See also L</vglvuuids>."
18041 #: ../fish/guestfish-actions.pod:5350
18046 #: ../fish/guestfish-actions.pod:5352
18049 " vgremove vgname\n"
18054 #: ../fish/guestfish-actions.pod:5354 ../src/guestfs-actions.pod:8239
18055 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
18059 #: ../fish/guestfish-actions.pod:5356 ../src/guestfs-actions.pod:8241
18061 "This also forcibly removes all logical volumes in the volume group (if any)."
18065 #: ../fish/guestfish-actions.pod:5359
18070 #: ../fish/guestfish-actions.pod:5361
18073 " vgrename volgroup newvolgroup\n"
18078 #: ../fish/guestfish-actions.pod:5363 ../src/guestfs-actions.pod:8255
18079 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
18083 #: ../fish/guestfish-actions.pod:5365
18088 #: ../fish/guestfish-actions.pod:5367
18096 #: ../fish/guestfish-actions.pod:5369 ../src/guestfs-actions.pod:8266
18098 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
18103 #: ../fish/guestfish-actions.pod:5372 ../src/guestfs-actions.pod:8269
18105 "This returns a list of just the volume group names that were detected (eg. "
18110 #: ../fish/guestfish-actions.pod:5375
18111 msgid "See also L</vgs-full>."
18115 #: ../fish/guestfish-actions.pod:5377
18120 #: ../fish/guestfish-actions.pod:5379
18128 #: ../fish/guestfish-actions.pod:5381 ../src/guestfs-actions.pod:8285
18130 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
18131 "> command. The \"full\" version includes all fields."
18135 #: ../fish/guestfish-actions.pod:5384
18140 #: ../fish/guestfish-actions.pod:5386
18148 #: ../fish/guestfish-actions.pod:5388 ../src/guestfs-actions.pod:8299
18150 "This rescans all block devices and rebuilds the list of LVM physical "
18151 "volumes, volume groups and logical volumes."
18155 #: ../fish/guestfish-actions.pod:5391
18160 #: ../fish/guestfish-actions.pod:5393
18168 #: ../fish/guestfish-actions.pod:5395 ../src/guestfs-actions.pod:8312
18169 msgid "This command returns the UUID of the LVM VG named C<vgname>."
18173 #: ../fish/guestfish-actions.pod:5397
18178 #: ../fish/guestfish-actions.pod:5399
18186 #: ../fish/guestfish-actions.pod:5401 ../src/guestfs-actions.pod:8352
18188 "This command counts the characters in a file, using the C<wc -c> external "
18193 #: ../fish/guestfish-actions.pod:5404
18198 #: ../fish/guestfish-actions.pod:5406
18206 #: ../fish/guestfish-actions.pod:5408 ../src/guestfs-actions.pod:8365
18208 "This command counts the lines in a file, using the C<wc -l> external command."
18212 #: ../fish/guestfish-actions.pod:5411
18217 #: ../fish/guestfish-actions.pod:5413
18225 #: ../fish/guestfish-actions.pod:5415 ../src/guestfs-actions.pod:8378
18227 "This command counts the words in a file, using the C<wc -w> external command."
18231 #: ../fish/guestfish-actions.pod:5418
18236 #: ../fish/guestfish-actions.pod:5420
18239 " write path content\n"
18244 #: ../fish/guestfish-actions.pod:5422 ../src/guestfs-actions.pod:8393
18246 "This call creates a file called C<path>. The content of the file is the "
18247 "string C<content> (which can contain any 8 bit data)."
18251 #: ../fish/guestfish-actions.pod:5425
18252 msgid "See also L</write-append>."
18256 #: ../fish/guestfish-actions.pod:5430
18257 msgid "write-append"
18261 #: ../fish/guestfish-actions.pod:5432
18264 " write-append path content\n"
18269 #: ../fish/guestfish-actions.pod:5434 ../src/guestfs-actions.pod:8413
18271 "This call appends C<content> to the end of file C<path>. If C<path> does "
18272 "not exist, then a new file is created."
18276 #: ../fish/guestfish-actions.pod:5437
18277 msgid "See also L</write>."
18281 #: ../fish/guestfish-actions.pod:5442
18286 #: ../fish/guestfish-actions.pod:5444
18289 " write-file path content size\n"
18294 #: ../fish/guestfish-actions.pod:5446 ../src/guestfs-actions.pod:8440
18296 "This call creates a file called C<path>. The contents of the file is the "
18297 "string C<content> (which can contain any 8 bit data), with length C<size>."
18301 #: ../fish/guestfish-actions.pod:5450 ../src/guestfs-actions.pod:8444
18303 "As a special case, if C<size> is C<0> then the length is calculated using "
18304 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
18308 #: ../fish/guestfish-actions.pod:5454 ../src/guestfs-actions.pod:8448
18310 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
18311 "I<not> work, even if the length is specified."
18315 #: ../fish/guestfish-actions.pod:5460
18317 "I<This function is deprecated.> In new code, use the L</write> call instead."
18321 #: ../fish/guestfish-actions.pod:5467
18326 #: ../fish/guestfish-actions.pod:5469
18329 " zegrep regex path\n"
18334 #: ../fish/guestfish-actions.pod:5471 ../src/guestfs-actions.pod:8465
18336 "This calls the external C<zegrep> program and returns the matching lines."
18340 #: ../fish/guestfish-actions.pod:5477
18345 #: ../fish/guestfish-actions.pod:5479
18348 " zegrepi regex path\n"
18353 #: ../fish/guestfish-actions.pod:5481 ../src/guestfs-actions.pod:8484
18355 "This calls the external C<zegrep -i> program and returns the matching lines."
18359 #: ../fish/guestfish-actions.pod:5487
18364 #: ../fish/guestfish-actions.pod:5489
18372 #: ../fish/guestfish-actions.pod:5491 ../src/guestfs-actions.pod:8502
18373 msgid "This command writes zeroes over the first few blocks of C<device>."
18377 #: ../fish/guestfish-actions.pod:5493 ../src/guestfs-actions.pod:8504
18379 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
18380 "securely wipe the device). It should be sufficient to remove any partition "
18381 "tables, filesystem superblocks and so on."
18385 #: ../fish/guestfish-actions.pod:5497 ../fish/guestfish-actions.pod:5512
18386 #: ../src/guestfs-actions.pod:8508 ../src/guestfs-actions.pod:8534
18388 "If blocks are already zero, then this command avoids writing zeroes. This "
18389 "prevents the underlying device from becoming non-sparse or growing "
18394 #: ../fish/guestfish-actions.pod:5501
18395 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
18399 #: ../fish/guestfish-actions.pod:5504
18400 msgid "zero-device"
18404 #: ../fish/guestfish-actions.pod:5506
18407 " zero-device device\n"
18412 #: ../fish/guestfish-actions.pod:5508
18414 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
18415 "which just zeroes the first few blocks of a device."
18419 #: ../fish/guestfish-actions.pod:5516
18424 #: ../fish/guestfish-actions.pod:5518
18427 " zerofree device\n"
18432 #: ../fish/guestfish-actions.pod:5520 ../src/guestfs-actions.pod:8553
18434 "This runs the I<zerofree> program on C<device>. This program claims to zero "
18435 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
18436 "possible to compress the filesystem more effectively."
18440 #: ../fish/guestfish-actions.pod:5525 ../src/guestfs-actions.pod:8558
18441 msgid "You should B<not> run this program if the filesystem is mounted."
18445 #: ../fish/guestfish-actions.pod:5528 ../src/guestfs-actions.pod:8561
18447 "It is possible that using this program can damage the filesystem or data on "
18452 #: ../fish/guestfish-actions.pod:5531
18457 #: ../fish/guestfish-actions.pod:5533
18460 " zfgrep pattern path\n"
18465 #: ../fish/guestfish-actions.pod:5535 ../src/guestfs-actions.pod:8575
18467 "This calls the external C<zfgrep> program and returns the matching lines."
18471 #: ../fish/guestfish-actions.pod:5541
18476 #: ../fish/guestfish-actions.pod:5543
18479 " zfgrepi pattern path\n"
18484 #: ../fish/guestfish-actions.pod:5545 ../src/guestfs-actions.pod:8594
18486 "This calls the external C<zfgrep -i> program and returns the matching lines."
18490 #: ../fish/guestfish-actions.pod:5551
18495 #: ../fish/guestfish-actions.pod:5553
18498 " zfile meth path\n"
18503 #: ../fish/guestfish-actions.pod:5555 ../src/guestfs-actions.pod:8620
18505 "This command runs C<file> after first decompressing C<path> using C<method>."
18509 #: ../fish/guestfish-actions.pod:5558 ../src/guestfs-actions.pod:8623
18510 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
18514 #: ../fish/guestfish-actions.pod:5560
18516 "Since 1.0.63, use L</file> instead which can now process compressed files."
18520 #: ../fish/guestfish-actions.pod:5563
18522 "I<This function is deprecated.> In new code, use the L</file> call instead."
18526 #: ../fish/guestfish-actions.pod:5570
18531 #: ../fish/guestfish-actions.pod:5572
18534 " zgrep regex path\n"
18539 #: ../fish/guestfish-actions.pod:5574 ../src/guestfs-actions.pod:8640
18541 "This calls the external C<zgrep> program and returns the matching lines."
18545 #: ../fish/guestfish-actions.pod:5580
18550 #: ../fish/guestfish-actions.pod:5582
18553 " zgrepi regex path\n"
18558 #: ../fish/guestfish-actions.pod:5584 ../src/guestfs-actions.pod:8659
18560 "This calls the external C<zgrep -i> program and returns the matching lines."
18564 #: ../fish/guestfish-commands.pod:1
18569 #: ../fish/guestfish-commands.pod:3
18574 #: ../fish/guestfish-commands.pod:5
18577 " alloc filename size\n"
18582 #: ../fish/guestfish-commands.pod:7
18584 "This creates an empty (zeroed) file of the given size, and then adds so it "
18585 "can be further examined."
18589 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
18590 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
18594 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
18595 msgid "Size can be specified using standard suffixes, eg. C<1M>."
18599 #: ../fish/guestfish-commands.pod:14
18601 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
18602 "image, see L</PREPARED DISK IMAGES>."
18606 #: ../fish/guestfish-commands.pod:17
18611 #: ../fish/guestfish-commands.pod:19
18614 " copy-in local [local ...] /remotedir\n"
18619 #: ../fish/guestfish-commands.pod:21
18621 "C<copy-in> copies local files or directories recursively into the disk "
18622 "image, placing them in the directory called C</remotedir> (which must "
18623 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
18624 "other commands as necessary."
18628 #: ../fish/guestfish-commands.pod:26
18630 "Multiple local files and directories can be specified, but the last "
18631 "parameter must always be a remote directory. Wildcards cannot be used."
18635 #: ../fish/guestfish-commands.pod:30
18640 #: ../fish/guestfish-commands.pod:32
18643 " copy-out remote [remote ...] localdir\n"
18648 #: ../fish/guestfish-commands.pod:34
18650 "C<copy-out> copies remote files or directories recursively out of the disk "
18651 "image, placing them on the host disk in a local directory called C<localdir> "
18652 "(which must exist). This guestfish meta-command turns into a sequence of L</"
18653 "download>, L</tar-out> and other commands as necessary."
18657 #: ../fish/guestfish-commands.pod:40
18659 "Multiple remote files and directories can be specified, but the last "
18660 "parameter must always be a local directory. To download to the current "
18661 "directory, use C<.> as in:"
18665 #: ../fish/guestfish-commands.pod:44
18668 " copy-out /home .\n"
18673 #: ../fish/guestfish-commands.pod:46
18675 "Wildcards cannot be used in the ordinary command, but you can use them with "
18676 "the help of L</glob> like this:"
18680 #: ../fish/guestfish-commands.pod:49
18683 " glob copy-out /home/* .\n"
18688 #: ../fish/guestfish-commands.pod:51
18693 #: ../fish/guestfish-commands.pod:53
18696 " display filename\n"
18701 #: ../fish/guestfish-commands.pod:55
18703 "Use C<display> (a graphical display program) to display an image file. It "
18704 "downloads the file, and runs C<display> on it."
18708 #: ../fish/guestfish-commands.pod:58
18710 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
18711 "environment variable. For example to use the GNOME display program:"
18715 #: ../fish/guestfish-commands.pod:61
18718 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
18723 #: ../fish/guestfish-commands.pod:63
18724 msgid "See also L<display(1)>."
18728 #: ../fish/guestfish-commands.pod:65
18733 #: ../fish/guestfish-commands.pod:67
18736 " echo [params ...]\n"
18741 #: ../fish/guestfish-commands.pod:69
18742 msgid "This echos the parameters to the terminal."
18746 #: ../fish/guestfish-commands.pod:71
18751 #: ../fish/guestfish-commands.pod:73
18756 #: ../fish/guestfish-commands.pod:75
18761 #: ../fish/guestfish-commands.pod:77
18769 #: ../fish/guestfish-commands.pod:79
18771 "This is used to edit a file. It downloads the file, edits it locally using "
18772 "your editor, then uploads the result."
18776 #: ../fish/guestfish-commands.pod:82
18778 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
18779 "or C<emacs> you will get those corresponding editors."
18783 #: ../fish/guestfish-commands.pod:86
18788 #: ../fish/guestfish-commands.pod:88
18791 " glob command args...\n"
18796 #: ../fish/guestfish-commands.pod:90
18798 "Expand wildcards in any paths in the args list, and run C<command> "
18799 "repeatedly on each matching path."
18803 #: ../fish/guestfish-commands.pod:93
18804 msgid "See L</WILDCARDS AND GLOBBING>."
18808 #: ../fish/guestfish-commands.pod:95
18813 #: ../fish/guestfish-commands.pod:97
18816 " hexedit <filename|device>\n"
18817 " hexedit <filename|device> <max>\n"
18818 " hexedit <filename|device> <start> <max>\n"
18823 #: ../fish/guestfish-commands.pod:101
18825 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
18830 #: ../fish/guestfish-commands.pod:104
18832 "This command works by downloading potentially the whole file or device, "
18833 "editing it locally, then uploading it. If the file or device is large, you "
18834 "have to specify which part you wish to edit by using C<max> and/or C<start> "
18835 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
18836 "usual modifiers allowed such as C<1M> (1 megabyte)."
18840 #: ../fish/guestfish-commands.pod:111
18841 msgid "For example to edit the first few sectors of a disk you might do:"
18845 #: ../fish/guestfish-commands.pod:114
18848 " hexedit /dev/sda 1M\n"
18853 #: ../fish/guestfish-commands.pod:116
18855 "which would allow you to edit anywhere within the first megabyte of the disk."
18859 #: ../fish/guestfish-commands.pod:119
18860 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
18864 #: ../fish/guestfish-commands.pod:121
18867 " hexedit /dev/sda1 0x400 0x400\n"
18872 #: ../fish/guestfish-commands.pod:123
18873 msgid "(assuming the superblock is in the standard location)."
18877 #: ../fish/guestfish-commands.pod:125
18879 "This command requires the external L<hexedit(1)> program. You can specify "
18880 "another program to use by setting the C<HEXEDITOR> environment variable."
18884 #: ../fish/guestfish-commands.pod:129
18885 msgid "See also L</hexdump>."
18889 #: ../fish/guestfish-commands.pod:131
18894 #: ../fish/guestfish-commands.pod:133
18902 #: ../fish/guestfish-commands.pod:135
18904 "Change the local directory, ie. the current directory of guestfish itself."
18908 #: ../fish/guestfish-commands.pod:138
18909 msgid "Note that C<!cd> won't do what you might expect."
18913 #: ../fish/guestfish-commands.pod:140
18918 #: ../fish/guestfish-commands.pod:142
18923 #: ../fish/guestfish-commands.pod:144
18931 #: ../fish/guestfish-commands.pod:146
18932 msgid "Opens the manual page for guestfish."
18936 #: ../fish/guestfish-commands.pod:148
18941 #: ../fish/guestfish-commands.pod:150
18946 #: ../fish/guestfish-commands.pod:152
18954 #: ../fish/guestfish-commands.pod:154
18962 #: ../fish/guestfish-commands.pod:156
18963 msgid "This is used to view a file."
18967 #: ../fish/guestfish-commands.pod:158
18969 "The default viewer is C<$PAGER>. However if you use the alternate command "
18970 "C<less> you will get the C<less> command specifically."
18974 #: ../fish/guestfish-commands.pod:161
18979 #: ../fish/guestfish-commands.pod:163
18987 #: ../fish/guestfish-commands.pod:165
18989 "Close and reopen the libguestfs handle. It is not necessary to use this "
18990 "normally, because the handle is closed properly when guestfish exits. "
18991 "However this is occasionally useful for testing."
18995 #: ../fish/guestfish-commands.pod:169
19000 #: ../fish/guestfish-commands.pod:171
19003 " setenv VAR value\n"
19008 #: ../fish/guestfish-commands.pod:173
19009 msgid "Set the environment variable C<VAR> to the string C<value>."
19013 #: ../fish/guestfish-commands.pod:175
19015 "To print the value of an environment variable use a shell command such as:"
19019 #: ../fish/guestfish-commands.pod:178
19027 #: ../fish/guestfish-commands.pod:180
19032 #: ../fish/guestfish-commands.pod:182
19035 " sparse filename size\n"
19040 #: ../fish/guestfish-commands.pod:184
19042 "This creates an empty sparse file of the given size, and then adds so it can "
19043 "be further examined."
19047 #: ../fish/guestfish-commands.pod:187
19049 "In all respects it works the same as the L</alloc> command, except that the "
19050 "image file is allocated sparsely, which means that disk blocks are not "
19051 "assigned to the file until they are needed. Sparse disk files only use "
19052 "space when written to, but they are slower and there is a danger you could "
19053 "run out of real disk space during a write operation."
19057 #: ../fish/guestfish-commands.pod:197
19062 #: ../fish/guestfish-commands.pod:199
19070 #: ../fish/guestfish-commands.pod:201
19072 "This command returns a list of the optional groups known to the daemon, and "
19073 "indicates which ones are supported by this build of the libguestfs appliance."
19077 #: ../fish/guestfish-commands.pod:205
19078 msgid "See also L<guestfs(3)/AVAILABILITY>."
19082 #: ../fish/guestfish-commands.pod:207
19087 #: ../fish/guestfish-commands.pod:209
19090 " time command args...\n"
19095 #: ../fish/guestfish-commands.pod:211
19097 "Run the command as usual, but print the elapsed time afterwards. This can "
19098 "be useful for benchmarking operations."
19102 #: ../fish/guestfish-commands.pod:214
19107 #: ../fish/guestfish-commands.pod:216
19115 #: ../fish/guestfish-commands.pod:218
19116 msgid "Remove C<VAR> from the environment."
19120 #: ../fish/guestfish.pod:5
19121 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
19125 #: ../fish/guestfish.pod:9
19128 " guestfish [--options] [commands]\n"
19133 #: ../fish/guestfish.pod:11
19141 #: ../fish/guestfish.pod:13
19144 " guestfish [--ro|--rw] -a disk.img\n"
19149 #: ../fish/guestfish.pod:15
19152 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
19157 #: ../fish/guestfish.pod:17
19160 " guestfish -d libvirt-domain\n"
19165 #: ../fish/guestfish.pod:19
19168 " guestfish [--ro|--rw] -a disk.img -i\n"
19173 #: ../fish/guestfish.pod:21
19176 " guestfish -d libvirt-domain -i\n"
19181 #: ../fish/guestfish.pod:25
19183 "Using guestfish in read/write mode on live virtual machines can be "
19184 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
19185 "option to use guestfish safely if the disk image or virtual machine might be "
19190 #: ../fish/guestfish.pod:32
19192 "Guestfish is a shell and command-line tool for examining and modifying "
19193 "virtual machine filesystems. It uses libguestfs and exposes all of the "
19194 "functionality of the guestfs API, see L<guestfs(3)>."
19198 #: ../fish/guestfish.pod:36
19200 "Guestfish gives you structured access to the libguestfs API, from shell "
19201 "scripts or the command line or interactively. If you want to rescue a "
19202 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
19207 #: ../fish/guestfish.pod:43
19208 msgid "As an interactive shell"
19212 #: ../fish/guestfish.pod:45
19220 #: ../fish/guestfish.pod:47
19223 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
19224 " editing virtual machine filesystems.\n"
19229 #: ../fish/guestfish.pod:50
19232 " Type: 'help' for a list of commands\n"
19233 " 'man' to read the manual\n"
19234 " 'quit' to quit the shell\n"
19239 #: ../fish/guestfish.pod:54
19242 " ><fs> add-ro disk.img\n"
19244 " ><fs> list-filesystems\n"
19245 " /dev/sda1: ext4\n"
19246 " /dev/vg_guest/lv_root: ext4\n"
19247 " /dev/vg_guest/lv_swap: swap\n"
19248 " ><fs> mount /dev/vg_guest/lv_root /\n"
19249 " ><fs> cat /etc/fstab\n"
19251 " # Created by anaconda\n"
19258 #: ../fish/guestfish.pod:67
19259 msgid "From shell scripts"
19263 #: ../fish/guestfish.pod:69
19264 msgid "Create a new C</etc/motd> file in a guest or disk image:"
19268 #: ../fish/guestfish.pod:71
19271 " guestfish <<_EOF_\n"
19274 " mount /dev/vg_guest/lv_root /\n"
19275 " write /etc/motd \"Welcome, new users\"\n"
19281 #: ../fish/guestfish.pod:78
19282 msgid "List the LVM logical volumes in a disk image:"
19286 #: ../fish/guestfish.pod:80
19289 " guestfish -a disk.img --ro <<_EOF_\n"
19297 #: ../fish/guestfish.pod:85
19298 msgid "List all the filesystems in a disk image:"
19302 #: ../fish/guestfish.pod:87
19305 " guestfish -a disk.img --ro <<_EOF_\n"
19307 " list-filesystems\n"
19313 #: ../fish/guestfish.pod:92
19314 msgid "On one command line"
19318 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
19319 msgid "Update C</etc/resolv.conf> in a guest:"
19323 #: ../fish/guestfish.pod:96
19327 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
19328 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
19333 #: ../fish/guestfish.pod:100
19334 msgid "Edit C</boot/grub/grub.conf> interactively:"
19338 #: ../fish/guestfish.pod:102
19341 " guestfish --rw --add disk.img \\\n"
19342 " --mount /dev/vg_guest/lv_root \\\n"
19343 " --mount /dev/sda1:/boot \\\n"
19344 " edit /boot/grub/grub.conf\n"
19349 #: ../fish/guestfish.pod:107
19350 msgid "Mount disks automatically"
19354 #: ../fish/guestfish.pod:109
19356 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
19360 #: ../fish/guestfish.pod:112
19363 " guestfish --ro -a disk.img -i cat /etc/group\n"
19368 #: ../fish/guestfish.pod:114
19371 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
19376 #: ../fish/guestfish.pod:116
19377 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
19381 #: ../fish/guestfish.pod:118
19384 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
19389 #: ../fish/guestfish.pod:120
19390 msgid "As a script interpreter"
19394 #: ../fish/guestfish.pod:122
19395 msgid "Create a 100MB disk containing an ext2-formatted partition:"
19399 #: ../fish/guestfish.pod:124
19402 " #!/usr/bin/guestfish -f\n"
19403 " sparse test1.img 100M\n"
19405 " part-disk /dev/sda mbr\n"
19406 " mkfs ext2 /dev/sda1\n"
19411 #: ../fish/guestfish.pod:130
19412 msgid "Start with a prepared disk"
19416 #: ../fish/guestfish.pod:132
19418 "An alternate way to create a 100MB disk called C<test1.img> containing a "
19419 "single ext2-formatted partition:"
19423 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
19426 " guestfish -N fs\n"
19431 #: ../fish/guestfish.pod:137
19432 msgid "To list what is available do:"
19436 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
19439 " guestfish -N help | less\n"
19444 #: ../fish/guestfish.pod:141
19445 msgid "Remote control"
19449 #: ../fish/guestfish.pod:143
19452 " eval \"`guestfish --listen`\"\n"
19453 " guestfish --remote add-ro disk.img\n"
19454 " guestfish --remote run\n"
19455 " guestfish --remote lvs\n"
19460 #: ../fish/guestfish.pod:154
19461 msgid "Displays general help on options."
19465 #: ../fish/guestfish.pod:158
19466 msgid "B<--cmd-help>"
19470 #: ../fish/guestfish.pod:160
19471 msgid "Lists all available guestfish commands."
19475 #: ../fish/guestfish.pod:162
19480 #: ../fish/guestfish.pod:164
19481 msgid "B<--cmd-help cmd>"
19485 #: ../fish/guestfish.pod:166
19486 msgid "Displays detailed help on a single command C<cmd>."
19490 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
19491 msgid "B<-a image>"
19495 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
19496 msgid "B<--add image>"
19500 #: ../fish/guestfish.pod:172
19501 msgid "Add a block device or virtual machine image to the shell."
19505 #: ../fish/guestfish.pod:177
19507 "Using this flag is mostly equivalent to using the C<add> command, with "
19508 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
19509 "the I<--format=...> flag was given."
19513 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
19515 "When used in conjunction with the I<-d> option, this specifies the libvirt "
19516 "URI to use. The default is to use the default libvirt connection."
19520 #: ../fish/guestfish.pod:189
19525 #: ../fish/guestfish.pod:191
19527 "If using the I<--listen> option and a csh-like shell, use this option. See "
19528 "section L</REMOTE CONTROL AND CSH> below."
19532 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
19533 msgid "B<-d libvirt-domain>"
19537 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
19538 msgid "B<--domain libvirt-domain>"
19542 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
19544 "Add disks from the named libvirt domain. If the I<--ro> option is also "
19545 "used, then any libvirt domain can be used. However in write mode, only "
19546 "libvirt domains which are shut down can be named here."
19550 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
19551 msgid "Domain UUIDs can be used instead of names."
19555 #: ../fish/guestfish.pod:204
19557 "Using this flag is mostly equivalent to using the C<add-domain> command, "
19558 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
19559 "if the I<--format:...> flag was given."
19563 #: ../fish/guestfish.pod:208
19568 #: ../fish/guestfish.pod:210
19569 msgid "B<--no-dest-paths>"
19573 #: ../fish/guestfish.pod:212
19575 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
19576 "to hit the tab key to complete paths on the guest filesystem, but this "
19577 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
19578 "allow this feature to be disabled."
19582 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
19584 "When prompting for keys and passphrases, guestfish normally turns echoing "
19585 "off so you cannot see what you are typing. If you are not worried about "
19586 "Tempest attacks and there is no one else in the room you can specify this "
19587 "flag to see what you are typing."
19591 #: ../fish/guestfish.pod:224
19596 #: ../fish/guestfish.pod:226
19597 msgid "B<--file file>"
19601 #: ../fish/guestfish.pod:228
19602 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
19606 #: ../fish/guestfish.pod:231
19609 " #!/usr/bin/guestfish -f\n"
19614 #: ../fish/guestfish.pod:244
19617 " guestfish --format=raw -a disk.img\n"
19622 #: ../fish/guestfish.pod:248
19625 " guestfish --format=raw -a disk.img --format -a another.img\n"
19630 #: ../fish/guestfish.pod:253
19632 "If you have untrusted raw-format guest disk images, you should use this "
19633 "option to specify the disk format. This avoids a possible security problem "
19634 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
19638 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
19639 msgid "B<--inspector>"
19643 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
19645 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
19646 "system and mount filesystems as they would be mounted on the real virtual "
19651 #: ../fish/guestfish.pod:266
19652 msgid "Typical usage is either:"
19656 #: ../fish/guestfish.pod:268
19659 " guestfish -d myguest -i\n"
19664 #: ../fish/guestfish.pod:270
19665 msgid "(for an inactive libvirt domain called I<myguest>), or:"
19669 #: ../fish/guestfish.pod:272
19672 " guestfish --ro -d myguest -i\n"
19677 #: ../fish/guestfish.pod:274
19678 msgid "(for active domains, readonly), or specify the block device directly:"
19682 #: ../fish/guestfish.pod:276
19685 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
19690 #: ../fish/guestfish.pod:278
19692 "Note that the command line syntax changed slightly over older versions of "
19693 "guestfish. You can still use the old syntax:"
19697 #: ../fish/guestfish.pod:281
19700 " guestfish [--ro] -i disk.img\n"
19705 #: ../fish/guestfish.pod:283
19708 " guestfish [--ro] -i libvirt-domain\n"
19713 #: ../fish/guestfish.pod:285
19715 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
19716 "then using other commands to mount the filesystems that were found."
19720 #: ../fish/guestfish.pod:294
19721 msgid "B<--listen>"
19725 #: ../fish/guestfish.pod:296
19727 "Fork into the background and listen for remote commands. See section L</"
19728 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
19732 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
19737 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
19739 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
19740 "ATTACHING TO RUNNING DAEMONS>)."
19744 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
19745 msgid "B<-m dev[:mountpoint[:options]]>"
19749 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
19750 msgid "B<--mount dev[:mountpoint[:options]]>"
19754 #: ../fish/guestfish.pod:308
19755 msgid "Mount the named partition or logical volume on the given mountpoint."
19759 #: ../fish/guestfish.pod:310
19760 msgid "If the mountpoint is omitted, it defaults to C</>."
19764 #: ../fish/guestfish.pod:312
19765 msgid "You have to mount something on C</> before most commands will work."
19769 #: ../fish/guestfish.pod:314
19771 "If any I<-m> or I<--mount> options are given, the guest is automatically "
19776 #: ../fish/guestfish.pod:317
19778 "If you don't know what filesystems a disk image contains, you can either run "
19779 "guestfish without this option, then list the partitions, filesystems and LVs "
19780 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
19781 "commands), or you can use the L<virt-filesystems(1)> program."
19785 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
19787 "The third (and rarely used) part of the mount parameter is the list of mount "
19788 "options used to mount the underlying filesystem. If this is not given, then "
19789 "the mount options are either the empty string or C<ro> (the latter if the "
19790 "I<--ro> flag is used). By specifying the mount options, you override this "
19791 "default choice. Probably the only time you would use this is to enable ACLs "
19792 "and/or extended attributes if the filesystem can support them:"
19796 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
19799 " -m /dev/sda1:/:acl,user_xattr\n"
19804 #: ../fish/guestfish.pod:333
19805 msgid "Using this flag is equivalent to using the C<mount-options> command."
19809 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202
19810 #: ../resize/virt-resize.pod:435
19815 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
19816 msgid "B<--no-sync>"
19820 #: ../fish/guestfish.pod:339
19822 "Disable autosync. This is enabled by default. See the discussion of "
19823 "autosync in the L<guestfs(3)> manpage."
19827 #: ../fish/guestfish.pod:342
19832 #: ../fish/guestfish.pod:344
19833 msgid "B<--new type>"
19837 #: ../fish/guestfish.pod:346
19842 #: ../fish/guestfish.pod:348
19844 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
19845 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
19846 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
19851 #: ../fish/guestfish.pod:353
19852 msgid "B<--progress-bars>"
19856 #: ../fish/guestfish.pod:355
19857 msgid "Enable progress bars, even when guestfish is used non-interactively."
19861 #: ../fish/guestfish.pod:357
19863 "Progress bars are enabled by default when guestfish is used as an "
19864 "interactive shell."
19868 #: ../fish/guestfish.pod:360
19869 msgid "B<--no-progress-bars>"
19873 #: ../fish/guestfish.pod:362
19874 msgid "Disable progress bars."
19878 #: ../fish/guestfish.pod:364
19879 msgid "B<--remote[=pid]>"
19883 #: ../fish/guestfish.pod:366
19885 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
19886 "CONTROL GUESTFISH OVER A SOCKET> below."
19890 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248
19891 #: ../rescue/virt-rescue.pod:189
19896 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250
19897 #: ../rescue/virt-rescue.pod:191
19902 #: ../fish/guestfish.pod:373
19904 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19905 "mounts are done read-only."
19909 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:195
19911 "The option must always be used if the disk image or virtual machine might be "
19912 "running, and is generally recommended in cases where you don't need write "
19913 "access to the disk."
19917 #: ../fish/guestfish.pod:380
19919 "Note that prepared disk images created with I<-N> are not affected by this "
19920 "option. Also commands like C<add> are not affected - you have to specify "
19921 "the C<readonly:true> option explicitly if you need it."
19925 #: ../fish/guestfish.pod:384
19926 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
19930 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262
19931 #: ../rescue/virt-rescue.pod:201
19932 msgid "B<--selinux>"
19936 #: ../fish/guestfish.pod:388
19937 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
19941 #: ../fish/guestfish.pod:394
19943 "Enable very verbose messages. This is particularly useful if you find a bug."
19947 #: ../fish/guestfish.pod:401
19948 msgid "Display the guestfish / libguestfs version number and exit."
19952 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278
19953 #: ../rescue/virt-rescue.pod:231
19958 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280
19959 #: ../rescue/virt-rescue.pod:233
19964 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
19966 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19967 "mounts are done read-write."
19971 #: ../fish/guestfish.pod:410
19972 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
19976 #: ../fish/guestfish.pod:414
19977 msgid "Echo each command before executing it."
19981 #: ../fish/guestfish.pod:418
19982 msgid "COMMANDS ON COMMAND LINE"
19986 #: ../fish/guestfish.pod:420
19988 "Any additional (non-option) arguments are treated as commands to execute."
19992 #: ../fish/guestfish.pod:423
19994 "Commands to execute should be separated by a colon (C<:>), where the colon "
19995 "is a separate parameter. Thus:"
19999 #: ../fish/guestfish.pod:426
20002 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
20007 #: ../fish/guestfish.pod:428
20009 "If there are no additional arguments, then we enter a shell, either an "
20010 "interactive shell with a prompt (if the input is a terminal) or a non-"
20011 "interactive shell."
20015 #: ../fish/guestfish.pod:432
20017 "In either command line mode or non-interactive shell, the first command that "
20018 "gives an error causes the whole shell to exit. In interactive mode (with a "
20019 "prompt) if a command fails, you can continue to enter commands."
20023 #: ../fish/guestfish.pod:437
20024 msgid "USING launch (OR run)"
20028 #: ../fish/guestfish.pod:439
20030 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
20031 "then launch it, then mount any disks you need, and finally issue actions/"
20032 "commands. So the general order of the day is:"
20036 #: ../fish/guestfish.pod:447
20037 msgid "add or -a/--add"
20041 #: ../fish/guestfish.pod:451
20042 msgid "launch (aka run)"
20046 #: ../fish/guestfish.pod:455
20047 msgid "mount or -m/--mount"
20051 #: ../fish/guestfish.pod:459
20052 msgid "any other commands"
20056 #: ../fish/guestfish.pod:463
20058 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
20059 "guest before mounting or performing any other commands."
20063 #: ../fish/guestfish.pod:466
20065 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
20066 "I<--new> options were given then C<run> is done automatically, simply "
20067 "because guestfish can't perform the action you asked for without doing this."
20071 #: ../fish/guestfish.pod:471
20072 msgid "OPENING DISKS FOR READ AND WRITE"
20076 #: ../fish/guestfish.pod:473
20078 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
20079 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
20080 "I<-i> and I<-m> open disk images read-only or for writing."
20084 #: ../fish/guestfish.pod:478
20086 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
20087 "opening disk images supplied on the command line for write. To open a disk "
20088 "image read-only you have to do I<-a image --ro>."
20092 #: ../fish/guestfish.pod:482
20094 "This matters: If you accidentally open a live VM disk image writable then "
20095 "you will cause irreversible disk corruption."
20099 #: ../fish/guestfish.pod:485
20101 "In a future libguestfs we intend to change the default the other way. Disk "
20102 "images will be opened read-only. You will have to either specify "
20103 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
20104 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
20105 "access for disk images specified by those other command line options."
20109 #: ../fish/guestfish.pod:492
20111 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
20112 "which does nothing (it is already the default). However it is highly "
20113 "recommended that you use this option to indicate that you need write access, "
20114 "and prepare your scripts for the day when this option will be required for "
20119 #: ../fish/guestfish.pod:498
20121 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
20122 "other libguestfs program apart from guestfish and guestmount."
20126 #: ../fish/guestfish.pod:501
20131 #: ../fish/guestfish.pod:503
20133 "You can quote ordinary parameters using either single or double quotes. For "
20138 #: ../fish/guestfish.pod:506
20141 " add \"file with a space.img\"\n"
20146 #: ../fish/guestfish.pod:508
20149 " rm '/file name'\n"
20154 #: ../fish/guestfish.pod:510
20162 #: ../fish/guestfish.pod:512
20164 "A few commands require a list of strings to be passed. For these, use a "
20165 "whitespace-separated list, enclosed in quotes. Strings containing "
20166 "whitespace to be passed through must be enclosed in single quotes. A "
20167 "literal single quote must be escaped with a backslash."
20171 #: ../fish/guestfish.pod:517
20174 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
20175 " command \"/bin/echo 'foo bar'\"\n"
20176 " command \"/bin/echo \\'foo\\'\"\n"
20181 #: ../fish/guestfish.pod:521
20182 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
20186 #: ../fish/guestfish.pod:523
20188 "In double-quoted arguments (only) use backslash to insert special characters:"
20192 #: ../fish/guestfish.pod:528
20197 #: ../fish/guestfish.pod:530
20198 msgid "Alert (bell) character."
20202 #: ../fish/guestfish.pod:532
20207 #: ../fish/guestfish.pod:534
20208 msgid "Backspace character."
20212 #: ../fish/guestfish.pod:536
20217 #: ../fish/guestfish.pod:538
20218 msgid "Form feed character."
20222 #: ../fish/guestfish.pod:540
20227 #: ../fish/guestfish.pod:542
20228 msgid "Newline character."
20232 #: ../fish/guestfish.pod:544
20237 #: ../fish/guestfish.pod:546
20238 msgid "Carriage return character."
20242 #: ../fish/guestfish.pod:548
20247 #: ../fish/guestfish.pod:550
20248 msgid "Horizontal tab character."
20252 #: ../fish/guestfish.pod:552
20257 #: ../fish/guestfish.pod:554
20258 msgid "Vertical tab character."
20262 #: ../fish/guestfish.pod:556
20267 #: ../fish/guestfish.pod:558
20268 msgid "A literal double quote character."
20272 #: ../fish/guestfish.pod:560
20277 #: ../fish/guestfish.pod:562
20279 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
20284 #: ../fish/guestfish.pod:565
20289 #: ../fish/guestfish.pod:567
20291 "A character with hex value I<hh>. There must be precisely 2 hex digits."
20295 #: ../fish/guestfish.pod:570
20297 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
20302 #: ../fish/guestfish.pod:573
20307 #: ../fish/guestfish.pod:575
20308 msgid "A literal backslash character."
20312 #: ../fish/guestfish.pod:579
20313 msgid "OPTIONAL ARGUMENTS"
20317 #: ../fish/guestfish.pod:581
20319 "Some commands take optional arguments. These arguments appear in this "
20320 "documentation as C<[argname:..]>. You can use them as in these examples:"
20324 #: ../fish/guestfish.pod:585
20327 " add-drive-opts filename\n"
20332 #: ../fish/guestfish.pod:587
20335 " add-drive-opts filename readonly:true\n"
20340 #: ../fish/guestfish.pod:589
20343 " add-drive-opts filename format:qcow2 readonly:false\n"
20348 #: ../fish/guestfish.pod:591
20350 "Each optional argument can appear at most once. All optional arguments must "
20351 "appear after the required ones."
20355 #: ../fish/guestfish.pod:594
20360 #: ../fish/guestfish.pod:596
20362 "This section applies to all commands which can take integers as parameters."
20366 #: ../fish/guestfish.pod:599
20367 msgid "SIZE SUFFIX"
20371 #: ../fish/guestfish.pod:601
20373 "When the command takes a parameter measured in bytes, you can use one of the "
20374 "following suffixes to specify kilobytes, megabytes and larger sizes:"
20378 #: ../fish/guestfish.pod:607
20379 msgid "B<k> or B<K> or B<KiB>"
20383 #: ../fish/guestfish.pod:609
20384 msgid "The size in kilobytes (multiplied by 1024)."
20388 #: ../fish/guestfish.pod:611
20393 #: ../fish/guestfish.pod:613
20394 msgid "The size in SI 1000 byte units."
20398 #: ../fish/guestfish.pod:615
20399 msgid "B<M> or B<MiB>"
20403 #: ../fish/guestfish.pod:617
20404 msgid "The size in megabytes (multiplied by 1048576)."
20408 #: ../fish/guestfish.pod:619
20413 #: ../fish/guestfish.pod:621
20414 msgid "The size in SI 1000000 byte units."
20418 #: ../fish/guestfish.pod:623
20419 msgid "B<G> or B<GiB>"
20423 #: ../fish/guestfish.pod:625
20424 msgid "The size in gigabytes (multiplied by 2**30)."
20428 #: ../fish/guestfish.pod:627
20433 #: ../fish/guestfish.pod:629
20434 msgid "The size in SI 10**9 byte units."
20438 #: ../fish/guestfish.pod:631
20439 msgid "B<T> or B<TiB>"
20443 #: ../fish/guestfish.pod:633
20444 msgid "The size in terabytes (multiplied by 2**40)."
20448 #: ../fish/guestfish.pod:635
20453 #: ../fish/guestfish.pod:637
20454 msgid "The size in SI 10**12 byte units."
20458 #: ../fish/guestfish.pod:639
20459 msgid "B<P> or B<PiB>"
20463 #: ../fish/guestfish.pod:641
20464 msgid "The size in petabytes (multiplied by 2**50)."
20468 #: ../fish/guestfish.pod:643
20473 #: ../fish/guestfish.pod:645
20474 msgid "The size in SI 10**15 byte units."
20478 #: ../fish/guestfish.pod:647
20479 msgid "B<E> or B<EiB>"
20483 #: ../fish/guestfish.pod:649
20484 msgid "The size in exabytes (multiplied by 2**60)."
20488 #: ../fish/guestfish.pod:651
20493 #: ../fish/guestfish.pod:653
20494 msgid "The size in SI 10**18 byte units."
20498 #: ../fish/guestfish.pod:655
20499 msgid "B<Z> or B<ZiB>"
20503 #: ../fish/guestfish.pod:657
20504 msgid "The size in zettabytes (multiplied by 2**70)."
20508 #: ../fish/guestfish.pod:659
20513 #: ../fish/guestfish.pod:661
20514 msgid "The size in SI 10**21 byte units."
20518 #: ../fish/guestfish.pod:663
20519 msgid "B<Y> or B<YiB>"
20523 #: ../fish/guestfish.pod:665
20524 msgid "The size in yottabytes (multiplied by 2**80)."
20528 #: ../fish/guestfish.pod:667
20533 #: ../fish/guestfish.pod:669
20534 msgid "The size in SI 10**24 byte units."
20538 #: ../fish/guestfish.pod:675
20541 " truncate-size /file 1G\n"
20546 #: ../fish/guestfish.pod:677
20547 msgid "would truncate the file to 1 gigabyte."
20551 #: ../fish/guestfish.pod:679
20553 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
20554 "the parameter to L</memsize> is specified in megabytes already). Adding a "
20555 "suffix will probably not do what you expect."
20559 #: ../fish/guestfish.pod:683
20560 msgid "OCTAL AND HEXADECIMAL NUMBERS"
20564 #: ../fish/guestfish.pod:685
20566 "For specifying the radix (base) use the C convention: C<0> to prefix an "
20567 "octal number or C<0x> to prefix a hexadecimal number. For example:"
20571 #: ../fish/guestfish.pod:688
20574 " 1234 decimal number 1234\n"
20575 " 02322 octal number, equivalent to decimal 1234\n"
20576 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
20581 #: ../fish/guestfish.pod:692
20583 "When using the C<chmod> command, you almost always want to specify an octal "
20584 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
20585 "L<chmod(1)> program):"
20589 #: ../fish/guestfish.pod:696
20592 " chmod 0777 /public # OK\n"
20593 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
20598 #: ../fish/guestfish.pod:699
20600 "Commands that return numbers usually print them in decimal, but some "
20601 "commands print numbers in other radices (eg. C<umask> prints the mode in "
20602 "octal, preceeded by C<0>)."
20606 #: ../fish/guestfish.pod:703
20607 msgid "WILDCARDS AND GLOBBING"
20611 #: ../fish/guestfish.pod:705
20613 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
20614 "(globbing) by default. So for example the following will not do what you "
20619 #: ../fish/guestfish.pod:709
20627 #: ../fish/guestfish.pod:711
20629 "Assuming you don't have a directory called literally C</home/*> then the "
20630 "above command will return an error."
20634 #: ../fish/guestfish.pod:714
20635 msgid "To perform wildcard expansion, use the C<glob> command."
20639 #: ../fish/guestfish.pod:716
20642 " glob rm-rf /home/*\n"
20647 #: ../fish/guestfish.pod:718
20649 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
20650 "many times), equivalent to:"
20654 #: ../fish/guestfish.pod:721
20657 " rm-rf /home/jim\n"
20658 " rm-rf /home/joe\n"
20659 " rm-rf /home/mary\n"
20664 #: ../fish/guestfish.pod:725
20665 msgid "C<glob> only works on simple guest paths and not on device names."
20669 #: ../fish/guestfish.pod:727
20671 "If you have several parameters, each containing a wildcard, then glob will "
20672 "perform a Cartesian product."
20676 #: ../fish/guestfish.pod:730
20681 #: ../fish/guestfish.pod:732
20683 "Any line which starts with a I<#> character is treated as a comment and "
20684 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
20685 "a command. For example:"
20689 #: ../fish/guestfish.pod:736
20692 " # this is a comment\n"
20693 " # this is a comment\n"
20694 " foo # NOT a comment\n"
20699 #: ../fish/guestfish.pod:740
20700 msgid "Blank lines are also ignored."
20704 #: ../fish/guestfish.pod:742
20705 msgid "RUNNING COMMANDS LOCALLY"
20709 #: ../fish/guestfish.pod:744
20711 "Any line which starts with a I<!> character is treated as a command sent to "
20712 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
20716 #: ../fish/guestfish.pod:748
20720 " tgz-out /remote local/remote-data.tar.gz\n"
20725 #: ../fish/guestfish.pod:751
20727 "will create a directory C<local> on the host, and then export the contents "
20728 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
20729 "(See C<tgz-out>)."
20733 #: ../fish/guestfish.pod:755
20735 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
20736 "effect, due to the way that subprocesses work in Unix."
20740 #: ../fish/guestfish.pod:758
20741 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
20745 #: ../fish/guestfish.pod:760
20747 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
20748 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
20749 "and executed as guestfish commands."
20753 #: ../fish/guestfish.pod:764
20755 "Thus you can use shell script to construct arbitrary guestfish commands "
20756 "which are then parsed by guestfish."
20760 #: ../fish/guestfish.pod:767
20762 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
20763 "through C</foo.100>) using guestfish commands alone. However this is simple "
20764 "if we use a shell script to create the guestfish commands for us:"
20768 #: ../fish/guestfish.pod:772
20771 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
20776 #: ../fish/guestfish.pod:774
20777 msgid "or with names like C</foo.001>:"
20781 #: ../fish/guestfish.pod:776
20784 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
20789 #: ../fish/guestfish.pod:778
20791 "When using guestfish interactively it can be helpful to just run the shell "
20792 "script first (ie. remove the initial C<E<lt>> character so it is just an "
20793 "ordinary I<!> local command), see what guestfish commands it would run, and "
20794 "when you are happy with those prepend the C<E<lt>> character to run the "
20795 "guestfish commands for real."
20799 #: ../fish/guestfish.pod:784
20804 #: ../fish/guestfish.pod:786
20806 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
20807 "command (a guestfish command) to the second command (any host command). For "
20812 #: ../fish/guestfish.pod:790
20815 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
20820 #: ../fish/guestfish.pod:792
20822 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
20823 "program). The above command would list all accounts in the guest filesystem "
20824 "which have UID 0, ie. root accounts including backdoors. Other examples:"
20828 #: ../fish/guestfish.pod:797
20831 " hexdump /bin/ls | head\n"
20832 " list-devices | tail -1\n"
20833 " tgz-out / - | tar ztf -\n"
20838 #: ../fish/guestfish.pod:801
20840 "The space before the pipe symbol is required, any space after the pipe "
20841 "symbol is optional. Everything after the pipe symbol is just passed "
20842 "straight to the host shell, so it can contain redirections, globs and "
20843 "anything else that makes sense on the host side."
20847 #: ../fish/guestfish.pod:806
20849 "To use a literal argument which begins with a pipe symbol, you have to quote "
20854 #: ../fish/guestfish.pod:809
20862 #: ../fish/guestfish.pod:811
20863 msgid "HOME DIRECTORIES"
20867 #: ../fish/guestfish.pod:813
20869 "If a parameter starts with the character C<~> then the tilde may be expanded "
20870 "as a home directory path (either C<~> for the current user's home directory, "
20871 "or C<~user> for another user)."
20875 #: ../fish/guestfish.pod:817
20877 "Note that home directory expansion happens for users known I<on the host>, "
20878 "not in the guest filesystem."
20882 #: ../fish/guestfish.pod:820
20884 "To use a literal argument which begins with a tilde, you have to quote it, "
20889 #: ../fish/guestfish.pod:823
20897 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
20898 msgid "ENCRYPTED DISKS"
20902 #: ../fish/guestfish.pod:827
20904 "Libguestfs has some support for Linux guests encrypted according to the "
20905 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
20906 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
20907 "LUKS is supported."
20911 #: ../fish/guestfish.pod:832
20912 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
20916 #: ../fish/guestfish.pod:834
20919 " ><fs> vfs-type /dev/sda2\n"
20925 #: ../fish/guestfish.pod:837
20927 "Then open those devices using L</luks-open>. This creates a device-mapper "
20928 "device called C</dev/mapper/luksdev>."
20932 #: ../fish/guestfish.pod:840
20935 " ><fs> luks-open /dev/sda2 luksdev\n"
20936 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
20941 #: ../fish/guestfish.pod:843
20943 "Finally you have to tell LVM to scan for volume groups on the newly created "
20948 #: ../fish/guestfish.pod:846
20952 " vg-activate-all true\n"
20957 #: ../fish/guestfish.pod:849
20958 msgid "The logical volume(s) can now be mounted in the usual way."
20962 #: ../fish/guestfish.pod:851
20964 "Before closing a LUKS device you must unmount any logical volumes on it and "
20965 "deactivate the volume groups by calling C<vg-activate false VG> on each "
20966 "one. Then you can close the mapper device:"
20970 #: ../fish/guestfish.pod:855
20973 " vg-activate false /dev/VG\n"
20974 " luks-close /dev/mapper/luksdev\n"
20979 #: ../fish/guestfish.pod:860
20981 "If a path is prefixed with C<win:> then you can use Windows-style drive "
20982 "letters and paths (with some limitations). The following commands are "
20987 #: ../fish/guestfish.pod:864
20990 " file /WINDOWS/system32/config/system.LOG\n"
20995 #: ../fish/guestfish.pod:866
20998 " file win:\\windows\\system32\\config\\system.log\n"
21003 #: ../fish/guestfish.pod:868
21006 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
21011 #: ../fish/guestfish.pod:870
21013 "The parameter is rewritten \"behind the scenes\" by looking up the position "
21014 "where the drive is mounted, prepending that to the path, changing all "
21015 "backslash characters to forward slash, then resolving the result using L</"
21016 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
21017 "the parameter might be rewritten like this:"
21021 #: ../fish/guestfish.pod:876
21024 " win:e:\\foo\\bar => /e/FOO/bar\n"
21029 #: ../fish/guestfish.pod:878
21030 msgid "This only works in argument positions that expect a path."
21034 #: ../fish/guestfish.pod:880
21035 msgid "UPLOADING AND DOWNLOADING FILES"
21039 #: ../fish/guestfish.pod:882
21041 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
21042 "others which upload from or download to a local file, you can use the "
21043 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
21047 #: ../fish/guestfish.pod:886
21055 #: ../fish/guestfish.pod:888
21057 "reads stdin and creates from that a file C</foo> in the disk image, and:"
21061 #: ../fish/guestfish.pod:891
21064 " tar-out /etc - | tar tf -\n"
21069 #: ../fish/guestfish.pod:893
21071 "writes the tarball to stdout and then pipes that into the external \"tar\" "
21072 "command (see L</PIPES>)."
21076 #: ../fish/guestfish.pod:896
21078 "When using C<-> to read from stdin, the input is read up to the end of "
21079 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
21080 "some arbitrary end marker:"
21084 #: ../fish/guestfish.pod:900
21087 " upload -<<END /foo\n"
21096 #: ../fish/guestfish.pod:906
21098 "Any string of characters can be used instead of C<END>. The end marker must "
21099 "appear on a line of its own, without any preceeding or following characters "
21100 "(not even spaces)."
21104 #: ../fish/guestfish.pod:910
21106 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
21107 "upload local files (so-called \"FileIn\" parameters in the generator)."
21111 #: ../fish/guestfish.pod:913
21112 msgid "EXIT ON ERROR BEHAVIOUR"
21116 #: ../fish/guestfish.pod:915
21118 "By default, guestfish will ignore any errors when in interactive mode (ie. "
21119 "taking commands from a human over a tty), and will exit on the first error "
21120 "in non-interactive mode (scripts, commands given on the command line)."
21124 #: ../fish/guestfish.pod:920
21126 "If you prefix a command with a I<-> character, then that command will not "
21127 "cause guestfish to exit, even if that (one) command returns an error."
21131 #: ../fish/guestfish.pod:924
21132 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
21136 #: ../fish/guestfish.pod:926
21138 "Guestfish can be remote-controlled over a socket. This is useful "
21139 "particularly in shell scripts where you want to make several different "
21140 "changes to a filesystem, but you don't want the overhead of starting up a "
21141 "guestfish process each time."
21145 #: ../fish/guestfish.pod:931
21146 msgid "Start a guestfish server process using:"
21150 #: ../fish/guestfish.pod:933
21153 " eval \"`guestfish --listen`\"\n"
21158 #: ../fish/guestfish.pod:935
21159 msgid "and then send it commands by doing:"
21163 #: ../fish/guestfish.pod:937
21166 " guestfish --remote cmd [...]\n"
21171 #: ../fish/guestfish.pod:939
21172 msgid "To cause the server to exit, send it the exit command:"
21176 #: ../fish/guestfish.pod:943
21178 "Note that the server will normally exit if there is an error in a command. "
21179 "You can change this in the usual way. See section L</EXIT ON ERROR "
21184 #: ../fish/guestfish.pod:947
21185 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
21189 #: ../fish/guestfish.pod:949
21191 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
21192 "is how the I<--remote> option knows where to send the commands. You can "
21193 "have several guestfish listener processes running using:"
21197 #: ../fish/guestfish.pod:953
21200 " eval \"`guestfish --listen`\"\n"
21201 " pid1=$GUESTFISH_PID\n"
21202 " eval \"`guestfish --listen`\"\n"
21203 " pid2=$GUESTFISH_PID\n"
21205 " guestfish --remote=$pid1 cmd\n"
21206 " guestfish --remote=$pid2 cmd\n"
21211 #: ../fish/guestfish.pod:961
21212 msgid "REMOTE CONTROL AND CSH"
21216 #: ../fish/guestfish.pod:963
21218 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
21223 #: ../fish/guestfish.pod:966
21226 " eval \"`guestfish --listen --csh`\"\n"
21231 #: ../fish/guestfish.pod:968
21232 msgid "REMOTE CONTROL DETAILS"
21236 #: ../fish/guestfish.pod:970
21238 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
21239 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
21240 "and C<$PID> is the process ID of the server."
21244 #: ../fish/guestfish.pod:974
21245 msgid "Guestfish client and server versions must match exactly."
21249 #: ../fish/guestfish.pod:976
21250 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
21254 #: ../fish/guestfish.pod:978
21256 "From Bash, you can use the following code which creates a guestfish "
21257 "instance, correctly quotes the command line, handles failure to start, and "
21258 "cleans up guestfish when the script exits:"
21262 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
21270 #: ../fish/guestfish.pod:986
21273 " guestfish[0]=\"guestfish\"\n"
21274 " guestfish[1]=\"--listen\"\n"
21275 " guestfish[2]=\"--ro\"\n"
21276 " guestfish[3]=\"-a\"\n"
21277 " guestfish[4]=\"disk.img\"\n"
21282 #: ../fish/guestfish.pod:992
21285 " GUESTFISH_PID=\n"
21286 " eval $(\"${guestfish[@]}\")\n"
21287 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
21288 " echo \"error: guestfish didn't start up, see error messages above\"\n"
21295 #: ../fish/guestfish.pod:999
21298 " cleanup_guestfish ()\n"
21300 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
21302 " trap cleanup_guestfish EXIT ERR\n"
21307 #: ../fish/guestfish.pod:1005
21310 " guestfish --remote -- run\n"
21315 #: ../fish/guestfish.pod:1007
21323 #: ../fish/guestfish.pod:1009
21324 msgid "REMOTE CONTROL RUN COMMAND HANGING"
21328 #: ../fish/guestfish.pod:1011
21330 "Using the C<run> (or C<launch>) command remotely in a command substitution "
21331 "context hangs, ie. don't do (note the backquotes):"
21335 #: ../fish/guestfish.pod:1014
21338 " a=`guestfish --remote run`\n"
21343 #: ../fish/guestfish.pod:1016
21345 "Since the C<run> command produces no output on stdout, this is not useful "
21346 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
21351 #: ../fish/guestfish.pod:1020
21352 msgid "PREPARED DISK IMAGES"
21356 #: ../fish/guestfish.pod:1022
21358 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
21359 "preformatted disk images that guestfish can make for you to save typing. "
21360 "This is particularly useful for testing purposes. This option is used "
21361 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
21362 "can be mixed with I<-a>)."
21366 #: ../fish/guestfish.pod:1028
21368 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
21369 "the second and so on. Existing files in the current directory are "
21374 #: ../fish/guestfish.pod:1032
21376 "The type briefly describes how the disk should be sized, partitioned, how "
21377 "filesystem(s) should be created, and how content should be added. "
21378 "Optionally the type can be followed by extra parameters, separated by C<:> "
21379 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
21380 "allocated disk, containing a single partition, with the partition formatted "
21381 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
21386 #: ../fish/guestfish.pod:1040
21387 msgid "To list the available types and any extra parameters they take, run:"
21391 #: ../fish/guestfish.pod:1044
21393 "Note that the prepared filesystem is not mounted. You would usually have to "
21394 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
21398 #: ../fish/guestfish.pod:1048
21400 "If any I<-N> or I<--new> options are given, the guest is automatically "
21405 #: ../fish/guestfish.pod:1053
21406 msgid "Create a 100MB disk with an ext4-formatted partition:"
21410 #: ../fish/guestfish.pod:1055
21413 " guestfish -N fs:ext4\n"
21418 #: ../fish/guestfish.pod:1057
21419 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
21423 #: ../fish/guestfish.pod:1059
21426 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
21431 #: ../fish/guestfish.pod:1061
21432 msgid "Create a blank 200MB disk:"
21436 #: ../fish/guestfish.pod:1063
21439 " guestfish -N disk:200M\n"
21444 #: ../fish/guestfish.pod:1065
21445 msgid "PROGRESS BARS"
21449 #: ../fish/guestfish.pod:1067
21451 "Some (not all) long-running commands send progress notification messages as "
21452 "they are running. Guestfish turns these messages into progress bars."
21456 #: ../fish/guestfish.pod:1071
21458 "When a command that supports progress bars takes longer than two seconds to "
21459 "run, and if progress bars are enabled, then you will see one appearing below "
21464 #: ../fish/guestfish.pod:1075
21467 " ><fs> copy-size /large-file /another-file 2048M\n"
21468 " / 10% [#####-----------------------------------------] 00:30\n"
21473 #: ../fish/guestfish.pod:1078
21475 "The spinner on the left hand side moves round once for every progress "
21476 "notification received from the backend. This is a (reasonably) golden "
21477 "assurance that the command is \"doing something\" even if the progress bar "
21478 "is not moving, because the command is able to send the progress "
21479 "notifications. When the bar reaches 100% and the command finishes, the "
21480 "spinner disappears."
21484 #: ../fish/guestfish.pod:1085
21486 "Progress bars are enabled by default when guestfish is used interactively. "
21487 "You can enable them even for non-interactive modes using I<--progress-bars>, "
21488 "and you can disable them completely using I<--no-progress-bars>."
21492 #: ../fish/guestfish.pod:1090
21493 msgid "GUESTFISH COMMANDS"
21497 #: ../fish/guestfish.pod:1092
21499 "The commands in this section are guestfish convenience commands, in other "
21500 "words, they are not part of the L<guestfs(3)> API."
21504 #: ../fish/guestfish.pod:1095
21509 #: ../fish/guestfish.pod:1097
21518 #: ../fish/guestfish.pod:1100
21519 msgid "Without any parameter, this provides general help."
21523 #: ../fish/guestfish.pod:1102
21524 msgid "With a C<cmd> parameter, this displays detailed help for that command."
21528 #: ../fish/guestfish.pod:1104
21529 msgid "quit | exit"
21533 #: ../fish/guestfish.pod:1106
21534 msgid "This exits guestfish. You can also use C<^D> key."
21538 #: ../fish/guestfish.pod:1108
21539 msgid "@FISH_COMMANDS@"
21543 #: ../fish/guestfish.pod:1110
21548 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
21553 #: ../fish/guestfish.pod:1116
21555 "guestfish returns 0 if the commands completed without error, or 1 if there "
21560 #: ../fish/guestfish.pod:1123
21565 #: ../fish/guestfish.pod:1125
21567 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
21572 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3213
21573 msgid "FEBOOTSTRAP_KERNEL"
21577 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3215
21578 msgid "FEBOOTSTRAP_MODULES"
21582 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3217
21584 "These two environment variables allow the kernel that libguestfs uses in the "
21585 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
21586 "most recent host kernel is chosen. For more information about kernel "
21587 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
21588 "available in febootstrap E<ge> 3.8."
21592 #: ../fish/guestfish.pod:1138
21593 msgid "GUESTFISH_DISPLAY_IMAGE"
21597 #: ../fish/guestfish.pod:1140
21599 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
21600 "If not set, it uses L<display(1)>."
21604 #: ../fish/guestfish.pod:1143
21605 msgid "GUESTFISH_PID"
21609 #: ../fish/guestfish.pod:1145
21611 "Used with the I<--remote> option to specify the remote guestfish process to "
21612 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
21616 #: ../fish/guestfish.pod:1149
21621 #: ../fish/guestfish.pod:1151
21623 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
21624 "not specified, the external L<hexedit(1)> program is used."
21628 #: ../fish/guestfish.pod:1155
21633 #: ../fish/guestfish.pod:1157
21635 "If compiled with GNU readline support, various files in the home directory "
21636 "can be used. See L</FILES>."
21640 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3223
21641 msgid "LIBGUESTFS_APPEND"
21645 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3225
21646 msgid "Pass additional options to the guest kernel."
21650 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3227
21651 msgid "LIBGUESTFS_DEBUG"
21655 #: ../fish/guestfish.pod:1166
21657 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
21658 "effect as using the B<-v> option."
21662 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3232
21663 msgid "LIBGUESTFS_MEMSIZE"
21667 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3234
21669 "Set the memory allocated to the qemu process, in megabytes. For example:"
21673 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3237
21676 " LIBGUESTFS_MEMSIZE=700\n"
21681 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3239
21682 msgid "LIBGUESTFS_PATH"
21686 #: ../fish/guestfish.pod:1178
21688 "Set the path that guestfish uses to search for kernel and initrd.img. See "
21689 "the discussion of paths in L<guestfs(3)>."
21693 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3244
21694 msgid "LIBGUESTFS_QEMU"
21698 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3246
21700 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
21701 "which was found at compile time by the configure script is used."
21705 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3252
21706 msgid "LIBGUESTFS_TRACE"
21710 #: ../fish/guestfish.pod:1189
21711 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
21715 #: ../fish/guestfish.pod:1191
21720 #: ../fish/guestfish.pod:1193
21722 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
21727 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236
21728 #: ../src/guestfs.pod:3257
21733 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3259
21735 "Location of temporary directory, defaults to C</tmp> except for the cached "
21736 "supermin appliance which defaults to C</var/tmp>."
21740 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3262
21742 "If libguestfs was compiled to use the supermin appliance then the real "
21743 "appliance is cached in this directory, shared between all handles belonging "
21744 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
21745 "use in case C</var/tmp> is not large enough."
21749 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297
21750 #: ../rescue/virt-rescue.pod:310
21755 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301
21756 #: ../rescue/virt-rescue.pod:314
21757 msgid "$HOME/.libguestfs-tools.rc"
21761 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303
21762 #: ../rescue/virt-rescue.pod:316
21763 msgid "/etc/libguestfs-tools.conf"
21767 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305
21768 #: ../rescue/virt-rescue.pod:318
21770 "This configuration file controls the default read-only or read-write mode "
21771 "(I<--ro> or I<--rw>)."
21775 #: ../fish/guestfish.pod:1220
21776 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
21780 #: ../fish/guestfish.pod:1222
21781 msgid "$HOME/.guestfish"
21785 #: ../fish/guestfish.pod:1224
21787 "If compiled with GNU readline support, then the command history is saved in "
21792 #: ../fish/guestfish.pod:1227
21793 msgid "$HOME/.inputrc"
21797 #: ../fish/guestfish.pod:1229
21798 msgid "/etc/inputrc"
21802 #: ../fish/guestfish.pod:1231
21804 "If compiled with GNU readline support, then these files can be used to "
21805 "configure readline. For further information, please see L<readline(3)/"
21806 "INITIALIZATION FILE>."
21810 #: ../fish/guestfish.pod:1235
21811 msgid "To write rules which only apply to guestfish, use:"
21815 #: ../fish/guestfish.pod:1237
21825 #: ../fish/guestfish.pod:1241
21827 "Variables that you can set in inputrc that change the behaviour of guestfish "
21828 "in useful ways include:"
21832 #: ../fish/guestfish.pod:1246
21833 msgid "completion-ignore-case (default: on)"
21837 #: ../fish/guestfish.pod:1248
21839 "By default, guestfish will ignore case when tab-completing paths on the "
21844 #: ../fish/guestfish.pod:1251
21847 " set completion-ignore-case off\n"
21852 #: ../fish/guestfish.pod:1253
21853 msgid "to make guestfish case sensitive."
21857 #: ../fish/guestfish.pod:1257
21862 #: ../fish/guestfish.pod:1259
21863 msgid "test2.img (etc)"
21867 #: ../fish/guestfish.pod:1261
21869 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
21870 "will be created in the file C<test1.img> in the current directory. The "
21871 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
21872 "the same name will be overwritten."
21876 #: ../fish/guestfish.pod:1270
21878 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
21879 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
21880 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
21881 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
21882 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, "
21883 "L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, "
21884 "L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
21888 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3355
21889 #: ../test-tool/libguestfs-test-tool.pod:112
21890 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
21894 #: ../fish/virt-copy-in.pod:5
21896 "virt-copy-in - Copy files and directories into a virtual machine disk image."
21900 #: ../fish/virt-copy-in.pod:9
21903 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
21908 #: ../fish/virt-copy-in.pod:11
21911 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
21916 #: ../fish/virt-copy-in.pod:15
21918 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
21919 "causing disk corruption. The virtual machine must be shut down before you "
21920 "use this command."
21924 #: ../fish/virt-copy-in.pod:21
21926 "C<virt-copy-in> copies files and directories from the local disk into a "
21927 "virtual machine disk image or named libvirt domain."
21931 #: ../fish/virt-copy-in.pod:24
21933 "You can give one of more filenames and directories on the command line. "
21934 "Directories are copied in recursively. The final parameter must be the "
21935 "destination directory in the disk image which must be an absolute path "
21936 "starting with a C</> character."
21940 #: ../fish/virt-copy-in.pod:33
21943 " virt-copy-in -d MyGuest resolv.conf /etc\n"
21948 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
21949 msgid "Upload a home directory to a guest:"
21953 #: ../fish/virt-copy-in.pod:37
21956 " virt-copy-in -d MyGuest skel /home\n"
21961 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
21962 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
21963 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
21967 #: ../fish/virt-copy-in.pod:41
21969 "This command is just a simple shell script wrapper around the L<guestfish(1)"
21970 "> C<copy-in> command. For anything more complex than a trivial copy, you "
21971 "are probably better off using guestfish directly."
21975 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
21976 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
21978 "Since the shell script just passes options straight to guestfish, read "
21979 "L<guestfish(1)> to see the full list of options."
21983 #: ../fish/virt-copy-in.pod:52
21985 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
21986 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
21990 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
21991 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
21992 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
21996 #: ../fish/virt-copy-out.pod:5
21998 "virt-copy-out - Copy files and directories out of a virtual machine disk "
22003 #: ../fish/virt-copy-out.pod:9
22006 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
22011 #: ../fish/virt-copy-out.pod:11
22014 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
22019 #: ../fish/virt-copy-out.pod:15
22021 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
22022 "image or named libvirt domain."
22026 #: ../fish/virt-copy-out.pod:18
22028 "You can give one of more filenames and directories on the command line. "
22029 "Directories are copied out recursively."
22033 #: ../fish/virt-copy-out.pod:23
22034 msgid "Download the home directories from a virtual machine:"
22038 #: ../fish/virt-copy-out.pod:25
22042 " virt-copy-out -d MyGuest /home homes\n"
22047 #: ../fish/virt-copy-out.pod:30
22049 "This command is just a simple shell script wrapper around the L<guestfish(1)"
22050 "> C<copy-out> command. For anything more complex than a trivial copy, you "
22051 "are probably better off using guestfish directly."
22055 #: ../fish/virt-copy-out.pod:41
22057 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
22058 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
22062 #: ../fish/virt-tar-in.pod:5
22063 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
22067 #: ../fish/virt-tar-in.pod:9
22070 " virt-tar-in -a disk.img data.tar /destination\n"
22075 #: ../fish/virt-tar-in.pod:11
22078 " virt-tar-in -d domain data.tar /destination\n"
22083 #: ../fish/virt-tar-in.pod:13
22086 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
22091 #: ../fish/virt-tar-in.pod:17
22093 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
22094 "causing disk corruption. The virtual machine must be shut down before you "
22095 "use this command."
22099 #: ../fish/virt-tar-in.pod:23
22101 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
22102 "image or named libvirt domain."
22106 #: ../fish/virt-tar-in.pod:26
22108 "The first parameter is the tar file. Use C<-> to read the tar file from "
22109 "standard input. The second parameter is the absolute target directory to "
22114 #: ../fish/virt-tar-in.pod:34
22117 " virt-tar-in -d MyGuest homes.tar /home\n"
22122 #: ../fish/virt-tar-in.pod:38
22124 "This command is just a simple shell script wrapper around the L<guestfish(1)"
22125 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
22126 "probably better off using guestfish directly."
22130 #: ../fish/virt-tar-in.pod:49
22132 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
22133 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
22138 #: ../fish/virt-tar-out.pod:5
22140 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
22144 #: ../fish/virt-tar-out.pod:9
22147 " virt-tar-out -a disk.img /dir files.tar\n"
22152 #: ../fish/virt-tar-out.pod:11
22155 " virt-tar-out -d domain /dir files.tar\n"
22160 #: ../fish/virt-tar-out.pod:13
22163 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
22168 #: ../fish/virt-tar-out.pod:17
22170 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
22174 #: ../fish/virt-tar-out.pod:20
22176 "The first parameter is the absolute path of the virtual machine directory. "
22177 "The second parameter is the tar file to write. Use C<-> to write to "
22182 #: ../fish/virt-tar-out.pod:26
22183 msgid "Download the home directories from a guest:"
22187 #: ../fish/virt-tar-out.pod:28
22190 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
22195 #: ../fish/virt-tar-out.pod:32
22197 "This command is just a simple shell script wrapper around the L<guestfish(1)"
22198 "> C<tar-out> command. For anything more complex than a trivial copy, you "
22199 "are probably better off using guestfish directly."
22203 #: ../fish/virt-tar-out.pod:43
22205 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
22206 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
22210 #: ../fuse/guestmount.pod:5
22212 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22216 #: ../fuse/guestmount.pod:9
22219 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22224 #: ../fuse/guestmount.pod:11
22227 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
22232 #: ../fuse/guestmount.pod:13
22235 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
22240 #: ../fuse/guestmount.pod:17
22242 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22243 "machines. If you do this, you risk disk corruption in the VM."
22247 #: ../fuse/guestmount.pod:22
22249 "The guestmount program can be used to mount virtual machine filesystems and "
22250 "other disk images on the host. It uses libguestfs for access to the guest "
22251 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22252 "a mountable device."
22256 #: ../fuse/guestmount.pod:27
22258 "Along with other options, you have to give at least one device (I<-a> "
22259 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
22260 "option) or use the I<-i> inspection option or the I<--live> option. How "
22261 "this works is better explained in the L<guestfish(1)> manual page, or by "
22262 "looking at the examples below."
22266 #: ../fuse/guestmount.pod:33
22268 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22269 "by you, and the filesystem will not be visible to any other users unless you "
22270 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22271 "the filesystem, use the C<fusermount -u> command."
22275 #: ../fuse/guestmount.pod:41
22277 "For a typical Windows guest which has its main filesystem on the first "
22282 #: ../fuse/guestmount.pod:44
22285 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22290 #: ../fuse/guestmount.pod:46
22292 "For a typical Linux guest which has a /boot filesystem on the first "
22293 "partition, and the root filesystem on a logical volume:"
22297 #: ../fuse/guestmount.pod:49
22300 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22305 #: ../fuse/guestmount.pod:51
22306 msgid "To get libguestfs to detect guest mountpoints for you:"
22310 #: ../fuse/guestmount.pod:53
22313 " guestmount -a guest.img -i --ro /mnt\n"
22318 #: ../fuse/guestmount.pod:55
22319 msgid "For a libvirt guest called \"Guest\" you could do:"
22323 #: ../fuse/guestmount.pod:57
22326 " guestmount -d Guest -i --ro /mnt\n"
22331 #: ../fuse/guestmount.pod:59
22333 "If you don't know what filesystems are contained in a guest or disk image, "
22334 "use L<virt-filesystems(1)> first:"
22338 #: ../fuse/guestmount.pod:62
22341 " virt-filesystems MyGuest\n"
22346 #: ../fuse/guestmount.pod:64
22348 "If you want to trace the libguestfs calls but without excessive debugging "
22349 "information, we recommend:"
22353 #: ../fuse/guestmount.pod:67
22356 " guestmount [...] --trace /mnt\n"
22361 #: ../fuse/guestmount.pod:69
22362 msgid "If you want to debug the program, we recommend:"
22366 #: ../fuse/guestmount.pod:71
22369 " guestmount [...] --trace --verbose /mnt\n"
22374 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:96
22375 #: ../resize/virt-resize.pod:621
22380 #: ../fuse/guestmount.pod:75
22381 msgid "Other users cannot see the filesystem by default"
22385 #: ../fuse/guestmount.pod:77
22387 "If you mount a filesystem as one user (eg. root), then other users will not "
22388 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
22389 "option when mounting:"
22393 #: ../fuse/guestmount.pod:81
22396 " sudo guestmount [...] -o allow_other /mnt\n"
22401 #: ../fuse/guestmount.pod:83
22402 msgid "Enabling FUSE"
22406 #: ../fuse/guestmount.pod:85
22408 "On some distros, you may need to add yourself to a special group (eg. "
22409 "C<fuse>) before you can use any FUSE filesystem. This is necessary on "
22410 "Debian and derivatives."
22414 #: ../fuse/guestmount.pod:89
22416 "On other distros, no special group is required. It is not necessary on "
22417 "Fedora or Red Hat Enterprise Linux."
22421 #: ../fuse/guestmount.pod:100
22422 msgid "Add a block device or virtual machine image."
22426 #: ../fuse/guestmount.pod:123
22427 msgid "B<--dir-cache-timeout N>"
22431 #: ../fuse/guestmount.pod:125
22433 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22434 "seconds. The readdir cache [actually, there are several semi-independent "
22435 "caches] is populated after a readdir(2) call with the stat and extended "
22436 "attributes of the files in the directory, in anticipation that they will be "
22437 "requested soon after."
22441 #: ../fuse/guestmount.pod:131
22443 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22444 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22445 "requests, only cache existing ones."
22449 #: ../fuse/guestmount.pod:151
22451 "If you have untrusted raw-format guest disk images, you should use this "
22452 "option to specify the disk format. This avoids a possible security problem "
22453 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
22454 "guestfs_add_drive_opts>."
22458 #: ../fuse/guestmount.pod:156
22459 msgid "B<--fuse-help>"
22463 #: ../fuse/guestmount.pod:158
22464 msgid "Display help on special FUSE options (see I<-o> below)."
22468 #: ../fuse/guestmount.pod:162
22469 msgid "Display brief help and exit."
22473 #: ../fuse/guestmount.pod:186
22475 "Mount the named partition or logical volume on the given mountpoint B<in the "
22476 "guest> (this has nothing to do with mountpoints in the host)."
22480 #: ../fuse/guestmount.pod:189
22482 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22483 "something on C</>."
22487 #: ../fuse/guestmount.pod:206
22489 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22490 "unmounted. If you specify this option, then we don't attempt to sync the "
22491 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22495 #: ../fuse/guestmount.pod:211
22496 msgid "B<-o option>"
22500 #: ../fuse/guestmount.pod:213
22501 msgid "B<--option option>"
22505 #: ../fuse/guestmount.pod:215
22506 msgid "Pass extra options to FUSE."
22510 #: ../fuse/guestmount.pod:217
22512 "To get a list of all the extra options supported by FUSE, use the command "
22513 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22514 "of them are a good idea."
22518 #: ../fuse/guestmount.pod:221
22521 " guestmount --fuse-help\n"
22526 #: ../fuse/guestmount.pod:223
22527 msgid "Some potentially useful FUSE options:"
22531 #: ../fuse/guestmount.pod:227
22532 msgid "B<-o allow_other>"
22536 #: ../fuse/guestmount.pod:229
22537 msgid "Allow other users to see the filesystem."
22541 #: ../fuse/guestmount.pod:231
22542 msgid "B<-o attr_timeout=N>"
22546 #: ../fuse/guestmount.pod:233
22547 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22551 #: ../fuse/guestmount.pod:235
22552 msgid "B<-o kernel_cache>"
22556 #: ../fuse/guestmount.pod:237
22558 "Allow the kernel to cache files (reduces the number of reads that have to go "
22559 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22560 "afford the extra memory usage."
22564 #: ../fuse/guestmount.pod:241
22565 msgid "B<-o uid=N> B<-o gid=N>"
22569 #: ../fuse/guestmount.pod:243
22571 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22572 "the chosen values."
22576 #: ../fuse/guestmount.pod:252
22578 "Add devices and mount everything read-only. Also disallow writes and make "
22579 "the disk appear read-only to FUSE."
22583 #: ../fuse/guestmount.pod:255
22585 "This is highly recommended if you are not going to edit the guest disk. If "
22586 "the guest is running and this option is I<not> supplied, then there is a "
22587 "strong risk of disk corruption in the guest. We try to prevent this from "
22588 "happening, but it is not always possible."
22592 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:199
22593 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
22597 #: ../fuse/guestmount.pod:264
22598 msgid "Enable SELinux support for the guest."
22602 #: ../fuse/guestmount.pod:270
22603 msgid "Enable verbose messages from underlying libguestfs."
22607 #: ../fuse/guestmount.pod:276
22608 msgid "Display the program version and exit."
22612 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308
22613 #: ../rescue/virt-rescue.pod:238 ../rescue/virt-rescue.pod:321
22614 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
22618 #: ../fuse/guestmount.pod:289
22623 #: ../fuse/guestmount.pod:291
22624 msgid "Trace libguestfs calls and entry into each FUSE function."
22628 #: ../fuse/guestmount.pod:293
22629 msgid "This also stops the daemon from forking into the background."
22633 #: ../fuse/guestmount.pod:319
22635 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22636 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
22641 #: ../fuse/guestmount.pod:334
22642 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
22646 #: ../inspector/virt-inspector.pod:5
22648 "virt-inspector - Display operating system version and other information "
22649 "about a virtual machine"
22653 #: ../inspector/virt-inspector.pod:9
22656 " virt-inspector [--options] -d domname\n"
22661 #: ../inspector/virt-inspector.pod:11
22664 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
22669 #: ../inspector/virt-inspector.pod:15
22672 " virt-inspector domname\n"
22677 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:148
22680 " virt-inspector disk.img [disk.img ...]\n"
22685 #: ../inspector/virt-inspector.pod:21
22687 "B<virt-inspector> examines a virtual machine or disk image and tries to "
22688 "determine the version of the operating system and other information about "
22689 "the virtual machine."
22693 #: ../inspector/virt-inspector.pod:25
22694 msgid "Virt-inspector produces XML output for feeding into other programs."
22698 #: ../inspector/virt-inspector.pod:27
22700 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
22701 "the libvirt domain (see: C<virsh list --all>)."
22705 #: ../inspector/virt-inspector.pod:30
22707 "You can also run virt-inspector directly on disk images from a single "
22708 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
22709 "has several block devices, in which case you should list several I<-a> "
22710 "options one after another, with the first corresponding to the guest's C</"
22711 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
22715 #: ../inspector/virt-inspector.pod:37
22717 "You can also run virt-inspector on install disks, live CDs, bootable USB "
22718 "keys and similar."
22722 #: ../inspector/virt-inspector.pod:40
22724 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22725 "inspect several virtual machines, you have to run virt-inspector several "
22726 "times (for example, from a shell script for-loop)."
22730 #: ../inspector/virt-inspector.pod:45
22732 "Because virt-inspector needs direct access to guest images, it won't "
22733 "normally work over remote libvirt connections."
22737 #: ../inspector/virt-inspector.pod:48
22739 "All of the information available from virt-inspector is also available "
22740 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
22741 "The same information can also be fetched using guestfish or via libguestfs "
22742 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
22743 "WITH OTHER PROGRAMMING LANGUAGES>)."
22747 #: ../inspector/virt-inspector.pod:81
22749 "Libvirt is only used if you specify a C<domname> on the command line. If "
22750 "you specify guest block devices directly (I<-a>), then libvirt is not used "
22755 #: ../inspector/virt-inspector.pod:94
22757 "When prompting for keys and passphrases, virt-inspector normally turns "
22758 "echoing off so you cannot see what you are typing. If you are not worried "
22759 "about Tempest attacks and there is no one else in the room you can specify "
22760 "this flag to see what you are typing."
22764 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
22765 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
22766 #: ../tools/virt-win-reg.pl:144
22768 "Specify the format of disk images given on the command line. If this is "
22769 "omitted then the format is autodetected from the content of the disk image."
22773 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
22774 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
22775 #: ../tools/virt-win-reg.pl:148
22777 "If disk images are requested from libvirt, then this program asks libvirt "
22778 "for this information. In this case, the value of the format parameter is "
22783 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:391
22784 #: ../resize/virt-resize.pod:483 ../sparsify/virt-sparsify.pod:132
22785 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
22786 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
22788 "If working with untrusted raw-format guest disk images, you should ensure "
22789 "the format is always specified."
22793 #: ../inspector/virt-inspector.pod:135
22794 msgid "B<--xpath> query"
22798 #: ../inspector/virt-inspector.pod:137
22800 "Perform an XPath query on the XML on stdin, and print the result on stdout. "
22801 "In this mode virt-inspector simply runs an XPath query; all other inspection "
22802 "functions are disabled. See L</XPATH QUERIES> below for some examples."
22806 #: ../inspector/virt-inspector.pod:146
22807 msgid "Previous versions of virt-inspector allowed you to write either:"
22811 #: ../inspector/virt-inspector.pod:152
22814 " virt-inspector guestname\n"
22819 #: ../inspector/virt-inspector.pod:160
22824 #: ../inspector/virt-inspector.pod:162
22826 "The virt-inspector XML is described precisely in a RELAX NG schema file "
22827 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
22828 "just an overview."
22832 #: ../inspector/virt-inspector.pod:166
22834 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
22835 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
22836 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
22837 "which is vanishingly rare in real world VMs."
22841 #: ../inspector/virt-inspector.pod:171
22842 msgid "E<lt>operatingsystemE<gt>"
22846 #: ../inspector/virt-inspector.pod:173
22848 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
22849 "describe the operating system, its architecture, the descriptive \"product "
22850 "name\" string, the type of OS and so on, as in this example:"
22854 #: ../inspector/virt-inspector.pod:177
22857 " <operatingsystems>\n"
22858 " <operatingsystem>\n"
22859 " <root>/dev/sda2</root>\n"
22860 " <name>windows</name>\n"
22861 " <arch>i386</arch>\n"
22862 " <distro>windows</distro>\n"
22863 " <product_name>Windows 7 Enterprise</product_name>\n"
22864 " <product_variant>Client</product_variant>\n"
22865 " <major_version>6</major_version>\n"
22866 " <minor_version>1</minor_version>\n"
22867 " <windows_systemroot>/Windows</windows_systemroot>\n"
22868 " <format>installed</format>\n"
22873 #: ../inspector/virt-inspector.pod:190
22875 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
22876 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
22877 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
22878 "architecture. The other fields are fairly self-explanatory, but because "
22879 "these fields are taken directly from the libguestfs inspection API you can "
22880 "find precise information from L<guestfs(3)/INSPECTION>."
22884 #: ../inspector/virt-inspector.pod:198
22886 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
22887 "of view of libguestfs (block devices may have completely different names "
22888 "inside the VM itself)."
22892 #: ../inspector/virt-inspector.pod:202
22893 msgid "E<lt>mountpointsE<gt>"
22897 #: ../inspector/virt-inspector.pod:204
22899 "Un*x-like guests typically have multiple filesystems which are mounted at "
22900 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
22901 "element which looks like this:"
22905 #: ../inspector/virt-inspector.pod:208
22908 " <operatingsystems>\n"
22909 " <operatingsystem>\n"
22912 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
22913 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
22914 " </mountpoints>\n"
22919 #: ../inspector/virt-inspector.pod:216
22921 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
22922 "and may have completely different names inside the guest. Only mountable "
22923 "filesystems appear in this list, not things like swap devices."
22927 #: ../inspector/virt-inspector.pod:221
22928 msgid "E<lt>filesystemsE<gt>"
22932 #: ../inspector/virt-inspector.pod:223
22934 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
22935 "filesystems belonging to the guest, including swap and empty partitions. "
22936 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
22937 "this OS or shared with this OS and other OSes)."
22941 #: ../inspector/virt-inspector.pod:229
22942 msgid "You might see something like this:"
22946 #: ../inspector/virt-inspector.pod:231
22949 " <operatingsystems>\n"
22950 " <operatingsystem>\n"
22953 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22954 " <type>ext4</type>\n"
22955 " <label>Fedora-13-x86_64</label>\n"
22956 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
22962 #: ../inspector/virt-inspector.pod:241
22964 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
22965 "the label, and the UUID."
22969 #: ../inspector/virt-inspector.pod:244
22970 msgid "E<lt>applicationsE<gt>"
22974 #: ../inspector/virt-inspector.pod:246
22976 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
22977 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
22982 #: ../inspector/virt-inspector.pod:250
22984 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
22985 "Typical values would be C<rpm> and C<deb>."
22989 #: ../inspector/virt-inspector.pod:253
22991 "E<lt>package_managementE<gt>, if present, describes the package manager. "
22992 "Typical values include C<yum>, C<up2date> and C<apt>"
22996 #: ../inspector/virt-inspector.pod:256
22997 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
23001 #: ../inspector/virt-inspector.pod:259
23004 " <operatingsystems>\n"
23005 " <operatingsystem>\n"
23007 " <applications>\n"
23009 " <name>coreutils</name>\n"
23010 " <version>8.5</version>\n"
23011 " <release>1</release>\n"
23012 " </application>\n"
23017 #: ../inspector/virt-inspector.pod:269
23019 "The version and release fields may not be available for some types guests. "
23020 "Other fields are possible, see L<guestfs(3)/"
23021 "guestfs_inspect_list_applications>."
23025 #: ../inspector/virt-inspector.pod:273
23026 msgid "E<lt>drive_mappingsE<gt>"
23030 #: ../inspector/virt-inspector.pod:275
23032 "For operating systems like Windows which use drive letters, virt-inspector "
23033 "is able to find out how drive letters map to filesystems."
23037 #: ../inspector/virt-inspector.pod:279
23040 " <operatingsystems>\n"
23041 " <operatingsystem>\n"
23043 " <drive_mappings>\n"
23044 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
23045 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
23046 " </drive_mappings>\n"
23051 #: ../inspector/virt-inspector.pod:287
23053 "In the example above, drive C maps to the filesystem on the second partition "
23054 "on the first disk, and drive E maps to the filesystem on the first partition "
23055 "on the second disk."
23059 #: ../inspector/virt-inspector.pod:291
23061 "Note that this only covers permanent local filesystem mappings, not things "
23062 "like network shares. Furthermore NTFS volume mount points may not be listed "
23067 #: ../inspector/virt-inspector.pod:295
23068 msgid "E<lt>iconE<gt>"
23072 #: ../inspector/virt-inspector.pod:297
23074 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
23075 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
23076 "very large and high quality."
23080 #: ../inspector/virt-inspector.pod:301
23083 " <operatingsystems>\n"
23084 " <operatingsystem>\n"
23087 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
23088 " [... many lines of base64 data ...]\n"
23094 #: ../inspector/virt-inspector.pod:309
23096 "To display the icon, you have to extract it and convert the base64 data back "
23097 "to a binary file. Use an XPath query or simply an editor to extract the "
23098 "data, then use the coreutils L<base64(1)> program to do the conversion back "
23103 #: ../inspector/virt-inspector.pod:314
23106 " base64 -i -d < icon.data > icon.png\n"
23111 #: ../inspector/virt-inspector.pod:316
23112 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
23116 #: ../inspector/virt-inspector.pod:318
23118 "Virt-inspector can detect some operating system installers on install disks, "
23119 "live CDs, bootable USB keys and more."
23123 #: ../inspector/virt-inspector.pod:321
23125 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
23126 "fields may be present to indicate a live CD, network installer, or one part "
23127 "of a multipart CD. For example:"
23131 #: ../inspector/virt-inspector.pod:325
23134 " <operatingsystems>\n"
23135 " <operatingsystem>\n"
23136 " <root>/dev/sda</root>\n"
23137 " <name>linux</name>\n"
23138 " <arch>i386</arch>\n"
23139 " <distro>ubuntu</distro>\n"
23140 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
23141 " <major_version>10</major_version>\n"
23142 " <minor_version>10</minor_version>\n"
23143 " <format>installer</format>\n"
23149 #: ../inspector/virt-inspector.pod:337
23150 msgid "XPATH QUERIES"
23154 #: ../inspector/virt-inspector.pod:339
23156 "Virt-inspector includes built in support for running XPath queries. The "
23157 "reason for including XPath support directly in virt-inspector is simply that "
23158 "there are no good and widely available command line programs that can do "
23159 "XPath queries. The only good one is L<xmlstarlet(1)> and that is not "
23160 "available on Red Hat Enterprise Linux."
23164 #: ../inspector/virt-inspector.pod:346
23166 "To perform an XPath query, use the I<--xpath> option. Note that in this "
23167 "mode, virt-inspector simply reads XML from stdin and outputs the query "
23168 "result on stdout. All other inspection features are disabled in this mode."
23172 #: ../inspector/virt-inspector.pod:353
23175 " $ virt-inspector -d Guest | virt-inspector --xpath '//filesystems'\n"
23177 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
23178 " <type>ext4</type>\n"
23184 #: ../inspector/virt-inspector.pod:359
23187 " $ virt-inspector -d Guest | \\\n"
23188 " virt-inspector --xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
23194 #: ../inspector/virt-inspector.pod:363
23197 " $ virt-inspector -d Guest | \\\n"
23198 " virt-inspector --xpath 'string(//icon)' | base64 -i -d | display -\n"
23199 " [displays the guest icon, if there is one]\n"
23204 #: ../inspector/virt-inspector.pod:374
23205 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
23209 #: ../inspector/virt-inspector.pod:376
23211 "Early versions of libguestfs shipped with a different virt-inspector program "
23212 "written in Perl (the current version is written in C). The XML output of "
23213 "the Perl virt-inspector was different and it could also output in other "
23214 "formats like text."
23218 #: ../inspector/virt-inspector.pod:381
23220 "The old virt-inspector is no longer supported or shipped with libguestfs."
23224 #: ../inspector/virt-inspector.pod:384
23226 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
23227 "versions of virt-inspector with different names:"
23231 #: ../inspector/virt-inspector.pod:387
23234 " virt-inspector Old Perl version.\n"
23235 " virt-inspector2 New C version.\n"
23240 #: ../inspector/virt-inspector.pod:397
23242 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
23243 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
23247 #: ../inspector/virt-inspector.pod:414
23248 msgid "Matthew Booth L<mbooth@redhat.com>"
23252 #: ../java/examples/guestfs-java.pod:5
23253 msgid "guestfs-java - How to use libguestfs from Java"
23257 #: ../java/examples/guestfs-java.pod:9
23260 " import com.redhat.et.libguestfs.*;\n"
23265 #: ../java/examples/guestfs-java.pod:11
23268 " GuestFS g = new GuestFS ();\n"
23269 " g.add_drive_opts (\"disk.img\", null);\n"
23275 #: ../java/examples/guestfs-java.pod:17
23277 "This manual page documents how to call libguestfs from the Java programming "
23278 "language. This page just documents the differences from the C API and gives "
23279 "some examples. If you are not familiar with using libguestfs, you also need "
23280 "to read L<guestfs(3)>."
23284 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
23285 msgid "CLOSING THE HANDLE"
23289 #: ../java/examples/guestfs-java.pod:24
23291 "The handle is closed when it is reaped by the garbage collector. Because "
23292 "libguestfs handles include a lot of state, it is also possible to close (and "
23293 "hence free) them explicitly by calling the C<close> method."
23297 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
23298 #: ../python/examples/guestfs-python.pod:21
23299 #: ../ruby/examples/guestfs-ruby.pod:22
23304 #: ../java/examples/guestfs-java.pod:31
23306 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
23307 "exception. This has a single parameter which is the error message (a "
23312 #: ../java/examples/guestfs-java.pod:35
23313 msgid "Calling any method on a closed handle raises the same exception."
23317 #: ../java/examples/guestfs-java.pod:47
23319 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
23320 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
23321 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
23325 #: ../ocaml/examples/guestfs-ocaml.pod:5
23326 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
23330 #: ../ocaml/examples/guestfs-ocaml.pod:9
23331 msgid "Module style:"
23335 #: ../ocaml/examples/guestfs-ocaml.pod:11
23338 " let g = Guestfs.create () in\n"
23339 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
23340 " Guestfs.launch g;\n"
23345 #: ../ocaml/examples/guestfs-ocaml.pod:15
23346 msgid "Object-oriented style:"
23350 #: ../ocaml/examples/guestfs-ocaml.pod:17
23353 " let g = new Guestfs.guestfs () in\n"
23354 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
23360 #: ../ocaml/examples/guestfs-ocaml.pod:21
23363 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
23365 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
23370 #: ../ocaml/examples/guestfs-ocaml.pod:27
23372 "This manual page documents how to call libguestfs from the OCaml programming "
23373 "language. This page just documents the differences from the C API and gives "
23374 "some examples. If you are not familiar with using libguestfs, you also need "
23375 "to read L<guestfs(3)>."
23379 #: ../ocaml/examples/guestfs-ocaml.pod:32
23380 msgid "PROGRAMMING STYLES"
23384 #: ../ocaml/examples/guestfs-ocaml.pod:34
23386 "There are two different programming styles supported by the OCaml bindings. "
23387 "You can use a module style, with each C function mapped to an OCaml function:"
23391 #: ../ocaml/examples/guestfs-ocaml.pod:38
23394 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
23399 #: ../ocaml/examples/guestfs-ocaml.pod:40
23404 #: ../ocaml/examples/guestfs-ocaml.pod:42
23407 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
23412 #: ../ocaml/examples/guestfs-ocaml.pod:44
23414 "Alternately you can use an object-oriented style, calling methods on the "
23415 "class C<Guestfs.guestfs>:"
23419 #: ../ocaml/examples/guestfs-ocaml.pod:47
23422 " method set_verbose : bool -> unit\n"
23427 #: ../ocaml/examples/guestfs-ocaml.pod:49
23429 "The object-oriented style is usually briefer, and the minor performance "
23430 "penalty isn't noticable in the general overhead of performing libguestfs "
23435 #: ../ocaml/examples/guestfs-ocaml.pod:55
23437 "The handle is closed when it is reaped by the garbage collector. Because "
23438 "libguestfs handles include a lot of state, it is also possible to close (and "
23439 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
23444 #: ../ocaml/examples/guestfs-ocaml.pod:62
23446 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
23447 "exception. This has a single parameter which is the error message (a "
23452 #: ../ocaml/examples/guestfs-ocaml.pod:66
23454 "Calling any function/method on a closed handle raises C<Guestfs."
23455 "Handle_closed>. The single parameter is the name of the function that you "
23460 #: ../ocaml/examples/guestfs-ocaml.pod:80
23462 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
23463 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
23464 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
23468 #: ../perl/examples/guestfs-perl.pod:5
23469 msgid "guestfs-perl - How to use libguestfs from Perl"
23473 #: ../perl/examples/guestfs-perl.pod:9
23476 " use Sys::Guestfs;\n"
23481 #: ../perl/examples/guestfs-perl.pod:11
23484 " my $h = Sys::Guestfs->new ();\n"
23485 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
23486 " $h->launch ();\n"
23487 " $h->mount_options ('', '/dev/sda1', '/');\n"
23488 " $h->touch ('/hello');\n"
23494 #: ../perl/examples/guestfs-perl.pod:20
23496 "This manual page documents how to call libguestfs from the Perl programming "
23497 "language. This page just documents the differences from the C API and gives "
23498 "some examples. If you are not familiar with using libguestfs, you also need "
23499 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
23503 #: ../perl/examples/guestfs-perl.pod:26
23508 #: ../perl/examples/guestfs-perl.pod:28
23510 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
23515 #: ../perl/examples/guestfs-perl.pod:41
23517 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
23518 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
23519 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
23523 #: ../python/examples/guestfs-python.pod:5
23524 msgid "guestfs-python - How to use libguestfs from Python"
23528 #: ../python/examples/guestfs-python.pod:9
23531 " import guestfs\n"
23532 " g = guestfs.GuestFS ()\n"
23533 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
23539 #: ../python/examples/guestfs-python.pod:16
23541 "This manual page documents how to call libguestfs from the Python "
23542 "programming language. This page just documents the differences from the C "
23543 "API and gives some examples. If you are not familiar with using libguestfs, "
23544 "you also need to read L<guestfs(3)>."
23548 #: ../python/examples/guestfs-python.pod:23
23550 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
23551 "single string argument which is the error message."
23555 #: ../python/examples/guestfs-python.pod:26
23556 msgid "MORE DOCUMENTATION"
23560 #: ../python/examples/guestfs-python.pod:28
23565 #: ../python/examples/guestfs-python.pod:30
23569 " >>> import guestfs\n"
23570 " >>> help (guestfs)\n"
23575 #: ../python/examples/guestfs-python.pod:44
23577 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
23578 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
23579 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
23583 #: ../rescue/virt-rescue.pod:5
23584 msgid "virt-rescue - Run a rescue shell on a virtual machine"
23588 #: ../rescue/virt-rescue.pod:9
23591 " virt-rescue [--options] -d domname\n"
23596 #: ../rescue/virt-rescue.pod:11
23599 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
23604 #: ../rescue/virt-rescue.pod:13
23607 " virt-rescue --suggest (-d domname | -a disk.img ...)\n"
23612 #: ../rescue/virt-rescue.pod:17
23615 " virt-rescue [--options] domname\n"
23620 #: ../rescue/virt-rescue.pod:19
23623 " virt-rescue [--options] disk.img [disk.img ...]\n"
23628 #: ../rescue/virt-rescue.pod:23
23630 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
23631 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
23632 "you from doing this, but doesn't catch all cases."
23636 #: ../rescue/virt-rescue.pod:27
23638 "However if you use the I<--ro> (read only) option, then you can attach a "
23639 "shell to a live virtual machine. The results might be strange or "
23640 "inconsistent at times but you won't get disk corruption."
23644 #: ../rescue/virt-rescue.pod:33
23646 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
23647 "need for a CD. virt-rescue gives you a rescue shell and some simple "
23648 "recovery tools which you can use to examine or rescue a virtual machine or "
23653 #: ../rescue/virt-rescue.pod:38
23655 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
23656 "on disk image(s):"
23660 #: ../rescue/virt-rescue.pod:41
23663 " virt-rescue -d GuestName\n"
23668 #: ../rescue/virt-rescue.pod:43
23671 " virt-rescue --ro -a /path/to/disk.img\n"
23676 #: ../rescue/virt-rescue.pod:45
23679 " virt-rescue -a /dev/sdc\n"
23684 #: ../rescue/virt-rescue.pod:47
23685 msgid "For live VMs you I<must> use the --ro option."
23689 #: ../rescue/virt-rescue.pod:49
23691 "When you run virt-rescue on a virtual machine or disk image, you are placed "
23692 "in an interactive bash shell where you can use many ordinary Linux "
23693 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
23694 "appliance. You must mount the virtual machine's filesystems by hand. There "
23695 "is an empty directory called C</sysroot> where you can mount filesystems."
23699 #: ../rescue/virt-rescue.pod:56
23701 "You can get virt-rescue to suggest mount commands for you by using the I<--"
23702 "suggest> option (in another terminal):"
23706 #: ../rescue/virt-rescue.pod:59
23709 " $ virt-rescue --suggest -d Fedora15\n"
23710 " Inspecting the virtual machine or disk image ...\n"
23715 #: ../rescue/virt-rescue.pod:62
23718 " This disk contains one or more operating systems. You can use these\n"
23719 " mount commands in virt-rescue (at the ><rescue> prompt) to mount the\n"
23725 #: ../rescue/virt-rescue.pod:66
23728 " # /dev/vg_f15x32/lv_root is the root of a linux operating system\n"
23729 " # type: linux, distro: fedora, version: 15.0\n"
23730 " # Fedora release 15 (Lovelock)\n"
23735 #: ../rescue/virt-rescue.pod:70
23738 " mount /dev/vg_f15x32/lv_root /sysroot/\n"
23739 " mount /dev/vda1 /sysroot/boot\n"
23740 " mount --bind /dev /sysroot/dev\n"
23741 " mount --bind /dev/pts /sysroot/dev/pts\n"
23742 " mount --bind /proc /sysroot/proc\n"
23743 " mount --bind /sys /sysroot/sys\n"
23748 #: ../rescue/virt-rescue.pod:77
23750 "Another way is to list the logical volumes (with L<lvs(8)>) and partitions "
23751 "(with L<parted(8)>) and mount them by hand:"
23755 #: ../rescue/virt-rescue.pod:80
23759 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
23760 " lv_root vg_f15x32 -wi-a- 8.83G\n"
23761 " lv_swap vg_f15x32 -wi-a- 992.00M\n"
23762 " ><rescue> mount /dev/vg_f15x32/lv_root /sysroot\n"
23763 " ><rescue> mount /dev/vda1 /sysroot/boot\n"
23764 " ><rescue> ls /sysroot\n"
23769 #: ../rescue/virt-rescue.pod:88
23771 "Another command to list available filesystems is L<virt-filesystems(1)>."
23775 #: ../rescue/virt-rescue.pod:91
23777 "To run commands in a Linux guest (for example, grub), you should chroot into "
23778 "the /sysroot directory first:"
23782 #: ../rescue/virt-rescue.pod:94
23785 " ><rescue> chroot /sysroot\n"
23790 #: ../rescue/virt-rescue.pod:98
23792 "Virt-rescue can be used on I<any> disk image file or device, not just a "
23793 "virtual machine. For example you can use it on a blank file if you want to "
23794 "partition that file (although we would recommend using L<guestfish(1)> "
23795 "instead as it is more suitable for this purpose). You can even use virt-"
23796 "rescue on things like SD cards."
23800 #: ../rescue/virt-rescue.pod:104
23802 "Virt-rescue does not require root. You only need to run it as root if you "
23803 "need root to open the disk image."
23807 #: ../rescue/virt-rescue.pod:107
23809 "This tool is just designed for quick interactive hacking on a virtual "
23810 "machine. For more structured access to a virtual machine disk image, you "
23811 "should use L<guestfs(3)>. To get a structured shell that you can use to "
23812 "make scripted changes to guests, use L<guestfish(1)>."
23816 #: ../rescue/virt-rescue.pod:131
23817 msgid "B<--append kernelopts>"
23821 #: ../rescue/virt-rescue.pod:133
23822 msgid "Pass additional options to the rescue kernel."
23826 #: ../rescue/virt-rescue.pod:163
23829 " virt-rescue --format=raw -a disk.img\n"
23834 #: ../rescue/virt-rescue.pod:167
23837 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
23842 #: ../rescue/virt-rescue.pod:176
23847 #: ../rescue/virt-rescue.pod:178
23848 msgid "B<--memsize MB>"
23852 #: ../rescue/virt-rescue.pod:180
23854 "Change the amount of memory allocated to the rescue system. The default is "
23855 "set by libguestfs and is small but adequate for running system tools. The "
23856 "occasional program might need more memory. The parameter is specified in "
23861 #: ../rescue/virt-rescue.pod:185
23862 msgid "B<--network>"
23866 #: ../rescue/virt-rescue.pod:187
23867 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
23871 #: ../rescue/virt-rescue.pod:193
23872 msgid "Open the image read-only."
23876 #: ../rescue/virt-rescue.pod:203
23878 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
23879 "SELINUX> before using this option."
23883 #: ../rescue/virt-rescue.pod:206
23888 #: ../rescue/virt-rescue.pod:208
23889 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
23893 #: ../rescue/virt-rescue.pod:210
23894 msgid "B<--suggest>"
23898 #: ../rescue/virt-rescue.pod:212
23900 "Inspect the disk image and suggest what mount commands should be used to "
23901 "mount the disks. You should use the I<--suggest> option in a second "
23902 "terminal, then paste the commands into another virt-rescue."
23906 #: ../rescue/virt-rescue.pod:216
23908 "This option implies I<--ro> and is safe to use even if the guest is up or if "
23909 "another virt-rescue is running."
23913 #: ../rescue/virt-rescue.pod:235
23915 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
23916 "are done read-write."
23920 #: ../rescue/virt-rescue.pod:248
23921 msgid "Previous versions of virt-rescue allowed you to write either:"
23925 #: ../rescue/virt-rescue.pod:250
23928 " virt-rescue disk.img [disk.img ...]\n"
23933 #: ../rescue/virt-rescue.pod:254
23936 " virt-rescue guestname\n"
23941 #: ../rescue/virt-rescue.pod:262
23946 #: ../rescue/virt-rescue.pod:264
23948 "Adding the I<--network> option enables QEMU user networking in the rescue "
23949 "appliance. There are some differences between user networking and ordinary "
23954 #: ../rescue/virt-rescue.pod:270
23955 msgid "ping does not work"
23959 #: ../rescue/virt-rescue.pod:272
23961 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
23962 "send the ping packets, and because virt-rescue must be able to run as non-"
23963 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
23964 "The ping command will appear to resolve addresses but will not be able to "
23965 "send or receive any packets. This does not mean that the network is not "
23970 #: ../rescue/virt-rescue.pod:279
23971 msgid "cannot receive connections"
23975 #: ../rescue/virt-rescue.pod:281
23976 msgid "QEMU user networking cannot receive incoming connections."
23980 #: ../rescue/virt-rescue.pod:283
23981 msgid "making TCP connections"
23985 #: ../rescue/virt-rescue.pod:285
23987 "The virt-rescue appliance needs to be small and so does not include many "
23988 "network tools. In particular there is no L<telnet(1)> command. You can "
23989 "make TCP connections from the shell using the magical C</dev/tcp/"
23990 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
23994 #: ../rescue/virt-rescue.pod:290
23997 " exec 3<>/dev/tcp/redhat.com/80\n"
23998 " echo \"GET /\" >&3\n"
24004 #: ../rescue/virt-rescue.pod:294
24005 msgid "See L<bash(1)> for more details."
24009 #: ../rescue/virt-rescue.pod:300
24011 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
24012 "ENVIRONMENT VARIABLES> for the complete list."
24016 #: ../rescue/virt-rescue.pod:327
24018 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-"
24019 "filesystems(1)>, L<http://libguestfs.org/>."
24023 #: ../resize/virt-resize.pod:5
24024 msgid "virt-resize - Resize a virtual machine disk"
24028 #: ../resize/virt-resize.pod:9
24031 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24032 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24033 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24038 #: ../resize/virt-resize.pod:15
24040 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24041 "larger or smaller overall, and resizing or deleting any partitions contained "
24046 #: ../resize/virt-resize.pod:19
24048 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24049 "not> be used on live virtual machines - for consistent results, shut the "
24050 "virtual machine down before resizing it."
24054 #: ../resize/virt-resize.pod:23
24056 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
24057 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
24061 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:597
24062 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:484
24063 #: ../src/guestfs.pod:1302 ../src/guestfs.pod:1441 ../src/guestfs.pod:2690
24068 #: ../resize/virt-resize.pod:33
24070 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24071 "fill the extra 5GB of space."
24075 #: ../resize/virt-resize.pod:36
24078 " virt-filesystems --long -h --all -a olddisk\n"
24083 #: ../resize/virt-resize.pod:38
24086 " truncate -r olddisk newdisk\n"
24087 " truncate -s +5G newdisk\n"
24092 #: ../resize/virt-resize.pod:41
24095 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24096 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24101 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:604
24102 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:490
24103 #: ../src/guestfs.pod:1306 ../src/guestfs.pod:1445 ../src/guestfs.pod:2715
24108 #: ../resize/virt-resize.pod:46
24110 "As above, but make the /boot partition 200MB bigger, while giving the "
24111 "remaining space to /dev/sda2:"
24115 #: ../resize/virt-resize.pod:49
24118 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
24119 " olddisk newdisk\n"
24124 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610
24125 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:501
24126 #: ../src/guestfs.pod:1451
24131 #: ../resize/virt-resize.pod:54
24133 "As in the first example, but expand a logical volume as the final step. "
24134 "This is what you would typically use for Linux guests that use LVM:"
24138 #: ../resize/virt-resize.pod:58
24141 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
24142 " olddisk newdisk\n"
24147 #: ../resize/virt-resize.pod:61
24152 #: ../resize/virt-resize.pod:63
24154 "As in the first example, but the output format will be qcow2 instead of a "
24159 #: ../resize/virt-resize.pod:66
24162 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
24163 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
24168 #: ../resize/virt-resize.pod:71
24169 msgid "DETAILED USAGE"
24173 #: ../resize/virt-resize.pod:73
24174 msgid "EXPANDING A VIRTUAL MACHINE DISK"
24178 #: ../resize/virt-resize.pod:77
24179 msgid "1. Shut down the virtual machine"
24183 #: ../resize/virt-resize.pod:79
24184 msgid "2. Locate input disk image"
24188 #: ../resize/virt-resize.pod:81
24190 "Locate the input disk image (ie. the file or device on the host containing "
24191 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
24192 "dumpxml> like this to find the disk image name:"
24196 #: ../resize/virt-resize.pod:85
24199 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
24200 " Found 1 nodes:\n"
24202 " <source dev=\"/dev/vg/lv_guest\" />\n"
24207 #: ../resize/virt-resize.pod:90
24208 msgid "3. Look at current sizing"
24212 #: ../resize/virt-resize.pod:92
24213 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
24217 #: ../resize/virt-resize.pod:95
24220 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
24221 " Name Type Size Parent\n"
24222 " /dev/sda1 partition 101M /dev/sda\n"
24223 " /dev/sda2 partition 7.9G /dev/sda\n"
24224 " /dev/sda device 8.0G -\n"
24229 #: ../resize/virt-resize.pod:101
24231 "(This example is a virtual machine with an 8 GB disk which we would like to "
24232 "expand up to 10 GB)."
24236 #: ../resize/virt-resize.pod:104
24237 msgid "4. Create output disk"
24241 #: ../resize/virt-resize.pod:106
24243 "Virt-resize cannot do in-place disk modifications. You have to have space "
24244 "to store the resized output disk."
24248 #: ../resize/virt-resize.pod:109
24250 "To store the resized disk image in a file, create a file of a suitable size:"
24254 #: ../resize/virt-resize.pod:112
24257 " # rm -f outdisk\n"
24258 " # truncate -s 10G outdisk\n"
24263 #: ../resize/virt-resize.pod:115
24264 msgid "Or use L<lvcreate(1)> to create a logical volume:"
24268 #: ../resize/virt-resize.pod:117
24271 " # lvcreate -L 10G -n lv_name vg_name\n"
24276 #: ../resize/virt-resize.pod:119
24277 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
24281 #: ../resize/virt-resize.pod:121
24284 " # virsh pool-list\n"
24285 " # virsh vol-create-as poolname newvol 10G\n"
24290 #: ../resize/virt-resize.pod:124
24295 #: ../resize/virt-resize.pod:126
24297 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
24298 "file) and the output disk. The output disk is the one created in the "
24303 #: ../resize/virt-resize.pod:130
24306 " # virt-resize indisk outdisk\n"
24311 #: ../resize/virt-resize.pod:132
24313 "This command just copies disk image C<indisk> to disk image C<outdisk> "
24314 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
24315 "larger, then an extra, empty partition is created at the end of the disk "
24316 "covering the extra space. If C<outdisk> is smaller, then it will give an "
24321 #: ../resize/virt-resize.pod:138
24323 "More realistically you'd want to expand existing partitions in the disk "
24324 "image by passing extra options (for the full list see the L</OPTIONS> "
24329 #: ../resize/virt-resize.pod:142
24331 "L</--expand> is the most useful option. It expands the named partition "
24332 "within the disk to fill any extra space:"
24336 #: ../resize/virt-resize.pod:145
24339 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
24344 #: ../resize/virt-resize.pod:147
24346 "(In this case, an extra partition is I<not> created at the end of the disk, "
24347 "because there will be no unused space)."
24351 #: ../resize/virt-resize.pod:150
24353 "L</--resize> is the other commonly used option. The following would "
24354 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
24355 "rest of the available space:"
24359 #: ../resize/virt-resize.pod:154
24362 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
24363 " indisk outdisk\n"
24368 #: ../resize/virt-resize.pod:157
24370 "If the expanded partition in the image contains a filesystem or LVM PV, then "
24371 "if virt-resize knows how, it will resize the contents, the equivalent of "
24372 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
24373 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
24374 "filesystems, so you would have to online resize them after booting the guest."
24378 #: ../resize/virt-resize.pod:164
24379 msgid "Other options are covered below."
24383 #: ../resize/virt-resize.pod:166
24388 #: ../resize/virt-resize.pod:168
24389 msgid "Thoroughly test the new disk image I<before> discarding the old one."
24393 #: ../resize/virt-resize.pod:170
24394 msgid "If you are using libvirt, edit the XML to point at the new disk:"
24398 #: ../resize/virt-resize.pod:172
24401 " # virsh edit guestname\n"
24406 #: ../resize/virt-resize.pod:174
24408 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
24409 "html#elementsDisks>"
24413 #: ../resize/virt-resize.pod:177
24414 msgid "Then start up the domain with the new, resized disk:"
24418 #: ../resize/virt-resize.pod:179
24421 " # virsh start guestname\n"
24426 #: ../resize/virt-resize.pod:181
24428 "and check that it still works. See also the L</NOTES> section below for "
24429 "additional information."
24433 #: ../resize/virt-resize.pod:184
24434 msgid "7. Resize LVs etc inside the guest"
24438 #: ../resize/virt-resize.pod:186
24439 msgid "(This can also be done offline using L<guestfish(1)>)"
24443 #: ../resize/virt-resize.pod:188
24445 "Once the guest has booted you should see the new space available, at least "
24446 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
24447 "may need to resize LVs inside PVs, and also resize filesystem types that "
24448 "virt-resize does not know how to expand."
24452 #: ../resize/virt-resize.pod:195
24453 msgid "SHRINKING A VIRTUAL MACHINE DISK"
24457 #: ../resize/virt-resize.pod:197
24459 "Shrinking is somewhat more complex than expanding, and only an overview is "
24464 #: ../resize/virt-resize.pod:200
24466 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
24467 "filesystems). The user has to shrink content before passing the disk image "
24468 "to virt-resize, and virt-resize will check that the content has been shrunk "
24473 #: ../resize/virt-resize.pod:205
24474 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
24478 #: ../resize/virt-resize.pod:207
24480 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
24481 "steps 3 and 4 above to allocate a new disk image."
24485 #: ../resize/virt-resize.pod:210
24487 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
24491 #: ../resize/virt-resize.pod:213
24492 msgid "IGNORING OR DELETING PARTITIONS"
24496 #: ../resize/virt-resize.pod:215
24498 "virt-resize also gives a convenient way to ignore or delete partitions when "
24499 "copying from the input disk to the output disk. Ignoring a partition speeds "
24500 "up the copy where you don't care about the existing contents of a "
24501 "partition. Deleting a partition removes it completely, but note that it "
24502 "also renumbers any partitions after the one which is deleted, which can "
24503 "leave some guests unbootable."
24507 #: ../resize/virt-resize.pod:222
24508 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
24512 #: ../resize/virt-resize.pod:224
24514 "If the input disk is in qcow2 format, then you may prefer that the output is "
24515 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
24516 "the fly. The output format is simply determined by the format of the empty "
24517 "output container that you provide. Thus to create qcow2 output, use:"
24521 #: ../resize/virt-resize.pod:230
24524 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
24529 #: ../resize/virt-resize.pod:232
24530 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
24534 #: ../resize/virt-resize.pod:234
24535 msgid "Similarly, to get non-sparse raw output use:"
24539 #: ../resize/virt-resize.pod:236
24542 " fallocate -l size outdisk\n"
24547 #: ../resize/virt-resize.pod:238
24549 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
24550 "dev/zero of=outdisk bs=1M count=..>)"
24554 #: ../resize/virt-resize.pod:241
24555 msgid "LOGICAL PARTITIONS"
24559 #: ../resize/virt-resize.pod:243
24561 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
24562 "tables) cannot be resized."
24566 #: ../resize/virt-resize.pod:246
24568 "To understand what is going on, firstly one of the four partitions C</dev/"
24569 "sda1-4> will have MBR partition type C<05> or C<0f>. This is called the "
24570 "B<extended partition>. Use L<virt-filesystems(1)> to see the MBR partition "
24575 #: ../resize/virt-resize.pod:251
24576 msgid "Logical partitions live inside the extended partition."
24580 #: ../resize/virt-resize.pod:253
24582 "The extended partition can be expanded, but not shrunk (unless you force it, "
24583 "which is not advisable). When the extended partition is copied across, all "
24584 "the logical partitions contained inside are copied over implicitly. Virt-"
24585 "resize does not look inside the extended partition, so it copies the logical "
24586 "partitions blindly."
24590 #: ../resize/virt-resize.pod:259
24592 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
24593 "line. Doing so will give an error."
24597 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
24598 msgid "Display help."
24602 #: ../resize/virt-resize.pod:270
24603 msgid "B<--align-first auto>"
24607 #: ../resize/virt-resize.pod:272
24608 msgid "B<--align-first never>"
24612 #: ../resize/virt-resize.pod:274
24613 msgid "B<--align-first always>"
24617 #: ../resize/virt-resize.pod:276
24619 "Align the first partition for improved performance (see also the I<--"
24620 "alignment> option)."
24624 #: ../resize/virt-resize.pod:279
24626 "The default is I<--align-first auto> which only aligns the first partition "
24627 "if it is safe to do so. That is, only when we know how to fix the "
24628 "bootloader automatically, and at the moment that can only be done for "
24633 #: ../resize/virt-resize.pod:284
24635 "I<--align-first never> means we never move the first partition. This is the "
24636 "safest option. Try this if the guest does not boot after resizing."
24640 #: ../resize/virt-resize.pod:288
24642 "I<--align-first always> means we always align the first partition (if it "
24643 "needs to be aligned). For some guests this will break the bootloader, "
24644 "making the guest unbootable."
24648 #: ../resize/virt-resize.pod:292
24649 msgid "B<--alignment N>"
24653 #: ../resize/virt-resize.pod:294
24655 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
24656 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
24660 #: ../resize/virt-resize.pod:298
24662 "Assuming 512 byte sector size inside the guest, here are some suitable "
24667 #: ../resize/virt-resize.pod:303
24668 msgid "I<--alignment 1> (512 bytes)"
24672 #: ../resize/virt-resize.pod:305
24674 "The partitions would be packed together as closely as possible, but would be "
24675 "completely unaligned. In some cases this can cause very poor performance. "
24676 "See L<virt-alignment-scan(1)> for further details."
24680 #: ../resize/virt-resize.pod:309
24681 msgid "I<--alignment 8> (4K)"
24685 #: ../resize/virt-resize.pod:311
24687 "This would be the minimum acceptable alignment for reasonable performance on "
24692 #: ../resize/virt-resize.pod:314
24693 msgid "I<--alignment 128> (64K)"
24697 #: ../resize/virt-resize.pod:316
24699 "This alignment provides good performance when the host is using high end "
24704 #: ../resize/virt-resize.pod:319
24705 msgid "I<--alignment 2048> (1M)"
24709 #: ../resize/virt-resize.pod:321
24711 "This is the standard alignment used by all newly installed guests since "
24716 #: ../resize/virt-resize.pod:326
24721 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177
24722 #: ../tools/virt-win-reg.pl:120
24727 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
24728 msgid "Enable debugging messages."
24732 #: ../resize/virt-resize.pod:332
24733 msgid "B<--delete part>"
24737 #: ../resize/virt-resize.pod:334
24739 "Delete the named partition. It would be more accurate to describe this as "
24740 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
24741 "the original disk image is left intact."
24745 #: ../resize/virt-resize.pod:338
24747 "Note that when you delete a partition, then anything contained in the "
24748 "partition is also deleted. Furthermore, this causes any partitions that "
24749 "come after to be I<renumbered>, which can easily make your guest unbootable."
24753 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404
24754 #: ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:145
24755 msgid "You can give this option multiple times."
24759 #: ../resize/virt-resize.pod:345
24760 msgid "B<--expand part>"
24764 #: ../resize/virt-resize.pod:347
24766 "Expand the named partition so it uses up all extra space (space left over "
24767 "after any other resize changes that you request have been done)."
24771 #: ../resize/virt-resize.pod:350
24773 "If virt-resize knows how, it will expand the direct content of the "
24774 "partition. For example, if the partition is an LVM PV, it will expand the "
24775 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
24776 "content it doesn't know about alone."
24780 #: ../resize/virt-resize.pod:355
24781 msgid "Currently virt-resize can resize:"
24785 #: ../resize/virt-resize.pod:361
24786 msgid "ext2, ext3 and ext4 filesystems."
24790 #: ../resize/virt-resize.pod:365
24791 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
24795 #: ../resize/virt-resize.pod:367
24797 "The filesystem must have been shut down consistently last time it was used. "
24798 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
24799 "consistency check, so at the first boot after resizing Windows will check "
24804 #: ../resize/virt-resize.pod:374
24806 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
24807 "inside the PV, but see the I<--LV-expand> option. The user could also "
24808 "resize LVs as desired after boot."
24812 #: ../resize/virt-resize.pod:380
24813 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
24817 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
24818 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
24822 #: ../resize/virt-resize.pod:386 ../sparsify/virt-sparsify.pod:125
24823 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
24824 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
24825 msgid "B<--format> raw"
24829 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:129
24831 "Specify the format of the input disk image. If this flag is not given then "
24832 "it is auto-detected from the image itself."
24836 #: ../resize/virt-resize.pod:394
24838 "Note that this option I<does not> affect the output format. See L</QCOW2 "
24839 "AND NON-SPARSE RAW FORMATS>."
24843 #: ../resize/virt-resize.pod:397
24844 msgid "B<--ignore part>"
24848 #: ../resize/virt-resize.pod:399
24850 "Ignore the named partition. Effectively this means the partition is "
24851 "allocated on the destination disk, but the content is not copied across from "
24852 "the source disk. The content of the partition will be blank (all zero "
24857 #: ../resize/virt-resize.pod:406
24858 msgid "B<--LV-expand logvol>"
24862 #: ../resize/virt-resize.pod:408
24864 "This takes the logical volume and, as a final step, expands it to fill all "
24865 "the space available in its volume group. A typical usage, assuming a Linux "
24866 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
24867 "lv_root> would be:"
24871 #: ../resize/virt-resize.pod:413
24874 " virt-resize indisk outdisk \\\n"
24875 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
24880 #: ../resize/virt-resize.pod:416
24882 "This would first expand the partition (and PV), and then expand the root "
24883 "device to fill the extra space in the PV."
24887 #: ../resize/virt-resize.pod:419
24889 "The contents of the LV are also resized if virt-resize knows how to do "
24890 "that. You can stop virt-resize from trying to expand the content by using "
24891 "the option I<--no-expand-content>."
24895 #: ../resize/virt-resize.pod:423
24896 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
24900 #: ../resize/virt-resize.pod:425
24902 "You can give this option multiple times, I<but> it doesn't make sense to do "
24903 "this unless the logical volumes you specify are all in different volume "
24908 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:147
24909 msgid "B<--machine-readable>"
24913 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:149
24915 "This option is used to make the output more machine friendly when being "
24916 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
24920 #: ../resize/virt-resize.pod:437
24921 msgid "B<--dryrun>"
24925 #: ../resize/virt-resize.pod:439
24926 msgid "Print a summary of what would be done, but don't do anything."
24930 #: ../resize/virt-resize.pod:441
24931 msgid "B<--no-copy-boot-loader>"
24935 #: ../resize/virt-resize.pod:443
24937 "By default, virt-resize copies over some sectors at the start of the disk "
24938 "(up to the beginning of the first partition). Commonly these sectors "
24939 "contain the Master Boot Record (MBR) and the boot loader, and are required "
24940 "in order for the guest to boot correctly."
24944 #: ../resize/virt-resize.pod:448
24946 "If you specify this flag, then this initial copy is not done. You may need "
24947 "to reinstall the boot loader in this case."
24951 #: ../resize/virt-resize.pod:451
24952 msgid "B<--no-extra-partition>"
24956 #: ../resize/virt-resize.pod:453
24958 "By default, virt-resize creates an extra partition if there is any extra, "
24959 "unused space after all resizing has happened. Use this option to prevent "
24960 "the extra partition from being created. If you do this then the extra space "
24961 "will be inaccessible until you run fdisk, parted, or some other partitioning "
24962 "tool in the guest."
24966 #: ../resize/virt-resize.pod:459
24968 "Note that if the surplus space is smaller than 10 MB, no extra partition "
24973 #: ../resize/virt-resize.pod:462
24974 msgid "B<--no-expand-content>"
24978 #: ../resize/virt-resize.pod:464
24980 "By default, virt-resize will try to expand the direct contents of "
24981 "partitions, if it knows how (see I<--expand> option above)."
24985 #: ../resize/virt-resize.pod:467
24987 "If you give the I<--no-expand-content> option then virt-resize will not "
24992 #: ../resize/virt-resize.pod:470
24993 msgid "B<--ntfsresize-force>"
24997 #: ../resize/virt-resize.pod:472
24999 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
25000 "the NTFS disk is marked as needing a consistency check. You have to use "
25001 "this option if you want to resize a Windows guest multiple times without "
25002 "booting into Windows between each resize."
25006 #: ../resize/virt-resize.pod:478
25007 msgid "B<--output-format> raw"
25011 #: ../resize/virt-resize.pod:480
25013 "Specify the format of the output disk image. If this flag is not given then "
25014 "it is auto-detected from the image itself."
25018 #: ../resize/virt-resize.pod:486
25020 "Note that this option I<does not create> the output format. This option "
25021 "just tells libguestfs what it is so it doesn't try to guess it. You still "
25022 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
25023 "SPARSE RAW FORMATS>."
25027 #: ../resize/virt-resize.pod:495
25028 msgid "Don't print the summary."
25032 #: ../resize/virt-resize.pod:497
25033 msgid "B<--resize part=size>"
25037 #: ../resize/virt-resize.pod:499
25039 "Resize the named partition (expanding or shrinking it) so that it has the "
25044 #: ../resize/virt-resize.pod:502
25046 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
25047 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
25048 "size; or as a relative number or percentage. For example:"
25052 #: ../resize/virt-resize.pod:508
25055 " --resize /dev/sda2=10G\n"
25060 #: ../resize/virt-resize.pod:510
25063 " --resize /dev/sda4=90%\n"
25068 #: ../resize/virt-resize.pod:512
25071 " --resize /dev/sda2=+1G\n"
25076 #: ../resize/virt-resize.pod:514
25079 " --resize /dev/sda2=-200M\n"
25084 #: ../resize/virt-resize.pod:516
25087 " --resize /dev/sda1=+128K\n"
25092 #: ../resize/virt-resize.pod:518
25095 " --resize /dev/sda1=+10%\n"
25100 #: ../resize/virt-resize.pod:520
25103 " --resize /dev/sda1=-10%\n"
25108 #: ../resize/virt-resize.pod:522
25110 "You can increase the size of any partition. Virt-resize will expand the "
25111 "direct content of the partition if it knows how (see I<--expand> below)."
25115 #: ../resize/virt-resize.pod:526
25117 "You can only I<decrease> the size of partitions that contain filesystems or "
25118 "PVs which have already been shrunk. Virt-resize will check this has been "
25119 "done before proceeding, or else will print an error (see also I<--resize-"
25124 #: ../resize/virt-resize.pod:533
25125 msgid "B<--resize-force part=size>"
25129 #: ../resize/virt-resize.pod:535
25131 "This is the same as I<--resize> except that it will let you decrease the "
25132 "size of any partition. Generally this means you will lose any data which "
25133 "was at the end of the partition you shrink, but you may not care about that "
25134 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25135 "as a swap partition)."
25139 #: ../resize/virt-resize.pod:541
25140 msgid "See also the I<--ignore> option."
25144 #: ../resize/virt-resize.pod:543
25145 msgid "B<--shrink part>"
25149 #: ../resize/virt-resize.pod:545
25151 "Shrink the named partition until the overall disk image fits in the "
25152 "destination. The named partition B<must> contain a filesystem or PV which "
25153 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25154 "online tools). Virt-resize will check this and give an error if it has not "
25159 #: ../resize/virt-resize.pod:551
25161 "The amount by which the overall disk must be shrunk (after carrying out all "
25162 "other operations requested by the user) is called the \"deficit\". For "
25163 "example, a straight copy (assume no other operations) from a 5GB disk image "
25164 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25165 "would give an error unless the user specified a partition to shrink and that "
25166 "partition had more than a gigabyte of free space."
25170 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:177
25171 msgid "MACHINE READABLE OUTPUT"
25175 #: ../resize/virt-resize.pod:571
25177 "The I<--machine-readable> option can be used to make the output more machine "
25178 "friendly, which is useful when calling virt-resize from other programs, GUIs "
25183 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:183
25184 msgid "There are two ways to use this option."
25188 #: ../resize/virt-resize.pod:577
25190 "Firstly use the option on its own to query the capabilities of the virt-"
25191 "resize binary. Typical output looks like this:"
25195 #: ../resize/virt-resize.pod:580
25198 " $ virt-resize --machine-readable\n"
25200 " ntfsresize-force\n"
25208 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:193
25210 "A list of features is printed, one per line, and the program exits with "
25215 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:196
25217 "Secondly use the option in conjunction with other options to make the "
25218 "regular program output more machine friendly."
25222 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:199
25223 msgid "At the moment this means:"
25227 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:205
25229 "Progress bar messages can be parsed from stdout by looking for this regular "
25234 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:208
25237 " ^[0-9]+/[0-9]+$\n"
25242 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:212
25244 "The calling program should treat messages sent to stdout (except for "
25245 "progress bar messages) as status messages. They can be logged and/or "
25246 "displayed to the user."
25250 #: ../resize/virt-resize.pod:612
25252 "The calling program should treat messages sent to stderr as error messages. "
25253 "In addition, virt-resize exits with a non-zero status code if there was a "
25258 #: ../resize/virt-resize.pod:618
25260 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
25261 "readable> option and will return an error."
25265 #: ../resize/virt-resize.pod:623
25266 msgid "\"Partition 1 does not end on cylinder boundary.\""
25270 #: ../resize/virt-resize.pod:625
25272 "Virt-resize aligns partitions to multiples of 128 sectors (see the I<--"
25273 "alignment> parameter). Usually this means the partitions will not be "
25274 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
25275 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
25276 "drives. Alignment of partitions to cylinders is not required by any modern "
25277 "operating system."
25281 #: ../resize/virt-resize.pod:632
25282 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25286 #: ../resize/virt-resize.pod:634
25288 "In Windows Vista and later versions, Microsoft switched to using a separate "
25289 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25290 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
25291 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
25292 "the second partition (ie. C: drive) should work."
25296 #: ../resize/virt-resize.pod:641
25298 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25299 "NTFS partitions have been expanded. This is just a safety check and (unless "
25300 "it find errors) is nothing to worry about."
25304 #: ../resize/virt-resize.pod:645
25305 msgid "GUEST BOOT STUCK AT \"GRUB\""
25309 #: ../resize/virt-resize.pod:647
25311 "If a Linux guest does not boot after resizing, and the boot is stuck after "
25312 "printing C<GRUB> on the console, try reinstalling grub."
25316 #: ../resize/virt-resize.pod:650
25319 " guestfish -i -a newdisk\n"
25320 " ><fs> cat /boot/grub/device.map\n"
25321 " # check the contents of this file are sensible or\n"
25322 " # edit the file if necessary\n"
25323 " ><fs> grub-install / /dev/vda\n"
25329 #: ../resize/virt-resize.pod:657
25331 "For more flexible guest reconfiguration, including if you need to specify "
25332 "other parameters to grub-install, use L<virt-rescue(1)>."
25336 #: ../resize/virt-resize.pod:660
25337 msgid "ALTERNATIVE TOOLS"
25341 #: ../resize/virt-resize.pod:662
25343 "There are several proprietary tools for resizing partitions. We won't "
25344 "mention any here."
25348 #: ../resize/virt-resize.pod:665
25350 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25351 "operations on disk images. They can resize and move partitions, but I don't "
25352 "think they can do anything with the contents, and they certainly don't "
25357 #: ../resize/virt-resize.pod:670
25359 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25360 "but at a much lower level. You will probably end up hand-calculating sector "
25361 "offsets, which is something that virt-resize was designed to avoid. If you "
25362 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25367 #: ../resize/virt-resize.pod:690
25369 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
25370 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
25371 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
25372 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
25373 "L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
25377 #: ../ruby/examples/guestfs-ruby.pod:5
25378 msgid "guestfs-ruby - How to use libguestfs from Ruby"
25382 #: ../ruby/examples/guestfs-ruby.pod:9
25385 " require 'guestfs'\n"
25386 " g = Guestfs::Guestfs.new()\n"
25387 " g.add_drive_opts(\"disk.img\",\n"
25388 " :readonly => 1, :format => \"raw\")\n"
25394 #: ../ruby/examples/guestfs-ruby.pod:17
25396 "This manual page documents how to call libguestfs from the Ruby programming "
25397 "language. This page just documents the differences from the C API and gives "
25398 "some examples. If you are not familiar with using libguestfs, you also need "
25399 "to read L<guestfs(3)>."
25403 #: ../ruby/examples/guestfs-ruby.pod:24
25405 "Errors from libguestfs functions are mapped into the C<Error> exception. "
25406 "This has a single parameter which is the error message (a string)."
25410 #: ../ruby/examples/guestfs-ruby.pod:38
25412 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
25413 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
25414 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
25418 #: ../sparsify/virt-sparsify.pod:5
25419 msgid "virt-sparsify - Make a virtual machine disk sparse"
25423 #: ../sparsify/virt-sparsify.pod:9
25426 " virt-sparsify [--options] indisk outdisk\n"
25431 #: ../sparsify/virt-sparsify.pod:13
25433 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
25434 "image) sparse a.k.a. thin-provisioned. This means that free space within "
25435 "the disk image can be converted back to free space on the host."
25439 #: ../sparsify/virt-sparsify.pod:18
25441 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
25442 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
25446 #: ../sparsify/virt-sparsify.pod:21
25448 "Virt-sparsify can also convert between some disk formats, for example "
25449 "converting a raw disk image to a thin-provisioned qcow2 image."
25453 #: ../sparsify/virt-sparsify.pod:24
25455 "Virt-sparsify can operate on any disk image, not just ones from virtual "
25456 "machines. If a virtual machine has more than one attached disk, you must "
25457 "sparsify each one separately."
25461 #: ../sparsify/virt-sparsify.pod:28
25462 msgid "IMPORTANT LIMITATIONS"
25466 #: ../sparsify/virt-sparsify.pod:34
25468 "Virt-sparsify does not do in-place modifications. It copies from a source "
25469 "image to a destination image, leaving the source unchanged. I<Check that "
25470 "the sparsification was successful before deleting the source image>."
25474 #: ../sparsify/virt-sparsify.pod:41
25475 msgid "The virtual machine I<must be shut down> before using this tool."
25479 #: ../sparsify/virt-sparsify.pod:45
25481 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
25482 "(1 temporary copy + 1 destination image). This is in the worst case and "
25483 "usually much less space is required."
25487 #: ../sparsify/virt-sparsify.pod:51
25489 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
25493 #: ../sparsify/virt-sparsify.pod:56
25494 msgid "Virt-sparsify cannot handle encrypted disks."
25498 #: ../sparsify/virt-sparsify.pod:60
25500 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
25501 "this space is often used for critical items like bootloaders so it's not "
25506 #: ../sparsify/virt-sparsify.pod:66
25508 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
25509 "to do this unless we can be sure there is no hibernation data, so at the "
25510 "moment swap partitions are ignored."
25514 #: ../sparsify/virt-sparsify.pod:72
25516 "You may also want to read the manual pages for the associated tools L<virt-"
25517 "filesystems(1)> and L<virt-df(1)> before starting."
25521 #: ../sparsify/virt-sparsify.pod:77
25522 msgid "Typical usage is:"
25526 #: ../sparsify/virt-sparsify.pod:79
25529 " virt-sparsify indisk outdisk\n"
25534 #: ../sparsify/virt-sparsify.pod:81
25536 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
25537 "is created, or overwritten if it already exists. The format of the input "
25538 "disk is detected (eg. qcow2) and the same format is used for the output disk."
25542 #: ../sparsify/virt-sparsify.pod:86
25543 msgid "To convert between formats, use the I<--convert> option:"
25547 #: ../sparsify/virt-sparsify.pod:88
25550 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
25555 #: ../sparsify/virt-sparsify.pod:90
25557 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
25558 "can find within the source disk image. You can get it to ignore (don't zero "
25559 "free space on) certain filesystems by doing:"
25563 #: ../sparsify/virt-sparsify.pod:94
25566 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
25571 #: ../sparsify/virt-sparsify.pod:96
25573 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
25577 #: ../sparsify/virt-sparsify.pod:107
25578 msgid "B<--convert> raw"
25582 #: ../sparsify/virt-sparsify.pod:109
25583 msgid "B<--convert> qcow2"
25587 #: ../sparsify/virt-sparsify.pod:111
25588 msgid "B<--convert> [other formats]"
25592 #: ../sparsify/virt-sparsify.pod:113
25594 "Use C<output-format> as the format for the destination image. If this is "
25595 "not specified, then the input format is used."
25599 #: ../sparsify/virt-sparsify.pod:116
25600 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
25604 #: ../sparsify/virt-sparsify.pod:118
25606 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
25607 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
25611 #: ../sparsify/virt-sparsify.pod:122
25613 "Specifying the I<--convert> option is usually a good idea, because then virt-"
25614 "sparsify doesn't need to try to guess the input format."
25618 #: ../sparsify/virt-sparsify.pod:127
25619 msgid "B<--format> qcow2"
25623 #: ../sparsify/virt-sparsify.pod:135
25624 msgid "B<--ignore> filesystem"
25628 #: ../sparsify/virt-sparsify.pod:137
25629 msgid "B<--ignore> volgroup"
25633 #: ../sparsify/virt-sparsify.pod:139
25635 "Ignore the named filesystem. Free space on the filesystem will not be "
25636 "zeroed, but existing blocks of zeroes will still be sparsified."
25640 #: ../sparsify/virt-sparsify.pod:142
25642 "In the second form, this ignores the named volume group. Use the volume "
25643 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
25647 #: ../sparsify/virt-sparsify.pod:157
25648 msgid "This disables progress bars and other unnecessary output."
25652 #: ../sparsify/virt-sparsify.pod:179
25654 "The I<--machine-readable> option can be used to make the output more machine "
25655 "friendly, which is useful when calling virt-sparsify from other programs, "
25660 #: ../sparsify/virt-sparsify.pod:185
25662 "Firstly use the option on its own to query the capabilities of the virt-"
25663 "sparsify binary. Typical output looks like this:"
25667 #: ../sparsify/virt-sparsify.pod:188
25670 " $ virt-sparsify --machine-readable\n"
25678 #: ../sparsify/virt-sparsify.pod:218
25680 "The calling program should treat messages sent to stderr as error messages. "
25681 "In addition, virt-sparsify exits with a non-zero status code if there was a "
25686 #: ../sparsify/virt-sparsify.pod:224
25688 "All versions of virt-sparsify have supported the I<--machine-readable> "
25693 #: ../sparsify/virt-sparsify.pod:238
25695 "Location of the temporary directory used for the potentially large temporary "
25700 #: ../sparsify/virt-sparsify.pod:241
25702 "You should ensure there is enough free space in the worst case for a full "
25703 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
25704 "to another directory that has enough space."
25708 #: ../sparsify/virt-sparsify.pod:245
25709 msgid "This defaults to C</tmp>."
25713 #: ../sparsify/virt-sparsify.pod:249
25715 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
25719 #: ../sparsify/virt-sparsify.pod:253
25721 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
25722 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
25723 "(1)>, L<http://libguestfs.org/>."
25727 #: ../src/guestfs-actions.pod:1
25728 msgid "guestfs_add_cdrom"
25732 #: ../src/guestfs-actions.pod:3
25736 " guestfs_add_cdrom (guestfs_h *g,\n"
25737 " const char *filename);\n"
25742 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:302
25743 #: ../src/guestfs-actions.pod:323
25745 "I<This function is deprecated.> In new code, use the L</"
25746 "guestfs_add_drive_opts> call instead."
25750 #: ../src/guestfs-actions.pod:24
25752 "This call checks for the existence of C<filename>. This stops you from "
25753 "specifying other types of drive which are supported by qemu such as C<nbd:> "
25754 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
25759 #: ../src/guestfs-actions.pod:31
25761 "If you just want to add an ISO file (often you use this as an efficient way "
25762 "to transfer large files into the guest), then you should probably use "
25763 "C<guestfs_add_drive_ro> instead."
25767 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:187
25768 #: ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:291
25769 #: ../src/guestfs-actions.pod:312 ../src/guestfs-actions.pod:333
25770 #: ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360
25771 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:500
25772 #: ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:559
25773 #: ../src/guestfs-actions.pod:587 ../src/guestfs-actions.pod:605
25774 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:705
25775 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:734
25776 #: ../src/guestfs-actions.pod:833 ../src/guestfs-actions.pod:851
25777 #: ../src/guestfs-actions.pod:865 ../src/guestfs-actions.pod:879
25778 #: ../src/guestfs-actions.pod:916 ../src/guestfs-actions.pod:1099
25779 #: ../src/guestfs-actions.pod:1119 ../src/guestfs-actions.pod:1137
25780 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:1286
25781 #: ../src/guestfs-actions.pod:1332 ../src/guestfs-actions.pod:1372
25782 #: ../src/guestfs-actions.pod:1425 ../src/guestfs-actions.pod:1478
25783 #: ../src/guestfs-actions.pod:1536 ../src/guestfs-actions.pod:1590
25784 #: ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1623
25785 #: ../src/guestfs-actions.pod:1651 ../src/guestfs-actions.pod:1721
25786 #: ../src/guestfs-actions.pod:1752 ../src/guestfs-actions.pod:1777
25787 #: ../src/guestfs-actions.pod:1819 ../src/guestfs-actions.pod:1932
25788 #: ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:2174
25789 #: ../src/guestfs-actions.pod:2196 ../src/guestfs-actions.pod:2283
25790 #: ../src/guestfs-actions.pod:2791 ../src/guestfs-actions.pod:2935
25791 #: ../src/guestfs-actions.pod:2996 ../src/guestfs-actions.pod:3031
25792 #: ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4103
25793 #: ../src/guestfs-actions.pod:4128 ../src/guestfs-actions.pod:4328
25794 #: ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4355
25795 #: ../src/guestfs-actions.pod:4369 ../src/guestfs-actions.pod:4384
25796 #: ../src/guestfs-actions.pod:4420 ../src/guestfs-actions.pod:4492
25797 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4529
25798 #: ../src/guestfs-actions.pod:4549 ../src/guestfs-actions.pod:4569
25799 #: ../src/guestfs-actions.pod:4604 ../src/guestfs-actions.pod:4623
25800 #: ../src/guestfs-actions.pod:4642 ../src/guestfs-actions.pod:4677
25801 #: ../src/guestfs-actions.pod:4689 ../src/guestfs-actions.pod:4722
25802 #: ../src/guestfs-actions.pod:4738 ../src/guestfs-actions.pod:4751
25803 #: ../src/guestfs-actions.pod:4766 ../src/guestfs-actions.pod:4783
25804 #: ../src/guestfs-actions.pod:4941 ../src/guestfs-actions.pod:5014
25805 #: ../src/guestfs-actions.pod:5034 ../src/guestfs-actions.pod:5047
25806 #: ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:5116
25807 #: ../src/guestfs-actions.pod:5134 ../src/guestfs-actions.pod:5150
25808 #: ../src/guestfs-actions.pod:5164 ../src/guestfs-actions.pod:5178
25809 #: ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:5210
25810 #: ../src/guestfs-actions.pod:5237 ../src/guestfs-actions.pod:5300
25811 #: ../src/guestfs-actions.pod:5373 ../src/guestfs-actions.pod:5404
25812 #: ../src/guestfs-actions.pod:5423 ../src/guestfs-actions.pod:5442
25813 #: ../src/guestfs-actions.pod:5454 ../src/guestfs-actions.pod:5471
25814 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5499
25815 #: ../src/guestfs-actions.pod:5514 ../src/guestfs-actions.pod:5546
25816 #: ../src/guestfs-actions.pod:5572 ../src/guestfs-actions.pod:5611
25817 #: ../src/guestfs-actions.pod:5631 ../src/guestfs-actions.pod:5645
25818 #: ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5711
25819 #: ../src/guestfs-actions.pod:5764 ../src/guestfs-actions.pod:5811
25820 #: ../src/guestfs-actions.pod:5854 ../src/guestfs-actions.pod:5882
25821 #: ../src/guestfs-actions.pod:5899 ../src/guestfs-actions.pod:5917
25822 #: ../src/guestfs-actions.pod:6054 ../src/guestfs-actions.pod:6111
25823 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6151
25824 #: ../src/guestfs-actions.pod:6203 ../src/guestfs-actions.pod:6269
25825 #: ../src/guestfs-actions.pod:6286 ../src/guestfs-actions.pod:6299
25826 #: ../src/guestfs-actions.pod:6313 ../src/guestfs-actions.pod:6602
25827 #: ../src/guestfs-actions.pod:6621 ../src/guestfs-actions.pod:6640
25828 #: ../src/guestfs-actions.pod:6654 ../src/guestfs-actions.pod:6666
25829 #: ../src/guestfs-actions.pod:6680 ../src/guestfs-actions.pod:6692
25830 #: ../src/guestfs-actions.pod:6706 ../src/guestfs-actions.pod:6722
25831 #: ../src/guestfs-actions.pod:6740 ../src/guestfs-actions.pod:6759
25832 #: ../src/guestfs-actions.pod:6778 ../src/guestfs-actions.pod:6808
25833 #: ../src/guestfs-actions.pod:6826 ../src/guestfs-actions.pod:6849
25834 #: ../src/guestfs-actions.pod:6867 ../src/guestfs-actions.pod:6886
25835 #: ../src/guestfs-actions.pod:6907 ../src/guestfs-actions.pod:6926
25836 #: ../src/guestfs-actions.pod:6943 ../src/guestfs-actions.pod:6962
25837 #: ../src/guestfs-actions.pod:6990 ../src/guestfs-actions.pod:7014
25838 #: ../src/guestfs-actions.pod:7033 ../src/guestfs-actions.pod:7049
25839 #: ../src/guestfs-actions.pod:7073 ../src/guestfs-actions.pod:7092
25840 #: ../src/guestfs-actions.pod:7107 ../src/guestfs-actions.pod:7126
25841 #: ../src/guestfs-actions.pod:7170 ../src/guestfs-actions.pod:7197
25842 #: ../src/guestfs-actions.pod:7227 ../src/guestfs-actions.pod:7339
25843 #: ../src/guestfs-actions.pod:7460 ../src/guestfs-actions.pod:7472
25844 #: ../src/guestfs-actions.pod:7485 ../src/guestfs-actions.pod:7498
25845 #: ../src/guestfs-actions.pod:7520 ../src/guestfs-actions.pod:7533
25846 #: ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7559
25847 #: ../src/guestfs-actions.pod:7574 ../src/guestfs-actions.pod:7633
25848 #: ../src/guestfs-actions.pod:7650 ../src/guestfs-actions.pod:7666
25849 #: ../src/guestfs-actions.pod:7682 ../src/guestfs-actions.pod:7699
25850 #: ../src/guestfs-actions.pod:7712 ../src/guestfs-actions.pod:7732
25851 #: ../src/guestfs-actions.pod:7832 ../src/guestfs-actions.pod:7888
25852 #: ../src/guestfs-actions.pod:7902 ../src/guestfs-actions.pod:7943
25853 #: ../src/guestfs-actions.pod:7956 ../src/guestfs-actions.pod:7974
25854 #: ../src/guestfs-actions.pod:8008 ../src/guestfs-actions.pod:8044
25855 #: ../src/guestfs-actions.pod:8160 ../src/guestfs-actions.pod:8175
25856 #: ../src/guestfs-actions.pod:8189 ../src/guestfs-actions.pod:8244
25857 #: ../src/guestfs-actions.pod:8257 ../src/guestfs-actions.pod:8302
25858 #: ../src/guestfs-actions.pod:8342 ../src/guestfs-actions.pod:8398
25859 #: ../src/guestfs-actions.pod:8418 ../src/guestfs-actions.pod:8451
25860 #: ../src/guestfs-actions.pod:8515 ../src/guestfs-actions.pod:8538
25861 #: ../src/guestfs-actions.pod:8564
25862 msgid "This function returns 0 on success or -1 on error."
25866 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:189
25867 #: ../src/guestfs-actions.pod:1334 ../src/guestfs-actions.pod:2397
25868 #: ../src/guestfs-actions.pod:2495 ../src/guestfs-actions.pod:2620
25869 #: ../src/guestfs-actions.pod:4090 ../src/guestfs-actions.pod:4110
25870 #: ../src/guestfs-actions.pod:5548 ../src/guestfs-actions.pod:6828
25871 #: ../src/guestfs-actions.pod:6945 ../src/guestfs-actions.pod:7094
25872 #: ../src/guestfs-actions.pod:7576 ../src/guestfs-actions.pod:7701
25873 #: ../src/guestfs-actions.pod:8344
25874 msgid "(Added in 0.3)"
25878 #: ../src/guestfs-actions.pod:41
25879 msgid "guestfs_add_domain"
25883 #: ../src/guestfs-actions.pod:43
25887 " guestfs_add_domain (guestfs_h *g,\n"
25888 " const char *dom,\n"
25894 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:198
25895 #: ../src/guestfs-actions.pod:890 ../src/guestfs-actions.pod:1214
25896 #: ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1344
25897 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1466
25898 #: ../src/guestfs-actions.pod:1519 ../src/guestfs-actions.pod:3288
25899 #: ../src/guestfs-actions.pod:4876 ../src/guestfs-actions.pod:5249
25900 #: ../src/guestfs-actions.pod:5558 ../src/guestfs-actions.pod:5775
25901 #: ../src/guestfs-actions.pod:7743
25903 "You may supply a list of optional arguments to this call. Use zero or more "
25904 "of the following pairs of parameters, and terminate the list with C<-1> on "
25905 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
25909 #: ../src/guestfs-actions.pod:53
25912 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
25913 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
25914 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
25915 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
25916 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
25917 " GUESTFS_ADD_DOMAIN_READONLYDISK, const char *readonlydisk,\n"
25922 #: ../src/guestfs-actions.pod:60
25924 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
25925 "It works by connecting to libvirt, requesting the domain and domain XML from "
25926 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
25931 #: ../src/guestfs-actions.pod:141
25933 "The other optional parameters are passed directly through to "
25934 "C<guestfs_add_drive_opts>."
25938 #: ../src/guestfs-actions.pod:144 ../src/guestfs-actions.pod:403
25939 #: ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:751
25940 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
25941 #: ../src/guestfs-actions.pod:819 ../src/guestfs-actions.pod:1797
25942 #: ../src/guestfs-actions.pod:2153 ../src/guestfs-actions.pod:2356
25943 #: ../src/guestfs-actions.pod:2467 ../src/guestfs-actions.pod:2518
25944 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2584
25945 #: ../src/guestfs-actions.pod:2607 ../src/guestfs-actions.pod:2922
25946 #: ../src/guestfs-actions.pod:3406 ../src/guestfs-actions.pod:3424
25947 #: ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:5951
25948 #: ../src/guestfs-actions.pod:6189 ../src/guestfs-actions.pod:6383
25949 #: ../src/guestfs-actions.pod:6409 ../src/guestfs-actions.pod:7929
25950 #: ../src/guestfs-actions.pod:8355 ../src/guestfs-actions.pod:8368
25951 #: ../src/guestfs-actions.pod:8381
25952 msgid "On error this function returns -1."
25956 #: ../src/guestfs-actions.pod:146
25957 msgid "(Added in 1.7.4)"
25961 #: ../src/guestfs-actions.pod:148
25962 msgid "guestfs_add_domain_va"
25966 #: ../src/guestfs-actions.pod:150
25970 " guestfs_add_domain_va (guestfs_h *g,\n"
25971 " const char *dom,\n"
25972 " va_list args);\n"
25977 #: ../src/guestfs-actions.pod:155
25978 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
25982 #: ../src/guestfs-actions.pod:157 ../src/guestfs-actions.pod:168
25983 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:278
25984 #: ../src/guestfs-actions.pod:929 ../src/guestfs-actions.pod:940
25985 #: ../src/guestfs-actions.pod:1242 ../src/guestfs-actions.pod:1255
25986 #: ../src/guestfs-actions.pod:1301 ../src/guestfs-actions.pod:1314
25987 #: ../src/guestfs-actions.pod:1391 ../src/guestfs-actions.pod:1403
25988 #: ../src/guestfs-actions.pod:1444 ../src/guestfs-actions.pod:1456
25989 #: ../src/guestfs-actions.pod:1497 ../src/guestfs-actions.pod:1509
25990 #: ../src/guestfs-actions.pod:1555 ../src/guestfs-actions.pod:1567
25991 #: ../src/guestfs-actions.pod:3372 ../src/guestfs-actions.pod:3384
25992 #: ../src/guestfs-actions.pod:4953 ../src/guestfs-actions.pod:4965
25993 #: ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:5326
25994 #: ../src/guestfs-actions.pod:5586 ../src/guestfs-actions.pod:5598
25995 #: ../src/guestfs-actions.pod:5824 ../src/guestfs-actions.pod:5835
25996 #: ../src/guestfs-actions.pod:7843 ../src/guestfs-actions.pod:7854
25997 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
26001 #: ../src/guestfs-actions.pod:159
26002 msgid "guestfs_add_domain_argv"
26006 #: ../src/guestfs-actions.pod:161
26010 " guestfs_add_domain_argv (guestfs_h *g,\n"
26011 " const char *dom,\n"
26012 " const struct guestfs_add_domain_argv *optargs);\n"
26017 #: ../src/guestfs-actions.pod:166
26018 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
26022 #: ../src/guestfs-actions.pod:170
26023 msgid "guestfs_add_drive"
26027 #: ../src/guestfs-actions.pod:172
26031 " guestfs_add_drive (guestfs_h *g,\n"
26032 " const char *filename);\n"
26037 #: ../src/guestfs-actions.pod:176
26039 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
26040 "optional parameters, so the disk is added writable, with the format being "
26041 "detected automatically."
26045 #: ../src/guestfs-actions.pod:180
26047 "Automatic detection of the format opens you up to a potential security hole "
26048 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
26049 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
26050 "you should think about replacing calls to this function with calls to "
26051 "C<guestfs_add_drive_opts>, and specifying the format."
26055 #: ../src/guestfs-actions.pod:191
26056 msgid "guestfs_add_drive_opts"
26060 #: ../src/guestfs-actions.pod:193
26064 " guestfs_add_drive_opts (guestfs_h *g,\n"
26065 " const char *filename,\n"
26071 #: ../src/guestfs-actions.pod:203
26074 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
26075 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
26076 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
26077 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
26082 #: ../src/guestfs-actions.pod:233
26084 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
26085 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
26086 "Possible formats include C<raw> and C<qcow2>."
26090 #: ../src/guestfs-actions.pod:244
26092 "This rarely-used option lets you emulate the behaviour of the deprecated "
26093 "C<guestfs_add_drive_with_if> call (q.v.)"
26097 #: ../src/guestfs-actions.pod:256
26098 msgid "(Added in 1.5.23)"
26102 #: ../src/guestfs-actions.pod:258
26103 msgid "guestfs_add_drive_opts_va"
26107 #: ../src/guestfs-actions.pod:260
26111 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
26112 " const char *filename,\n"
26113 " va_list args);\n"
26118 #: ../src/guestfs-actions.pod:265
26119 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
26123 #: ../src/guestfs-actions.pod:269
26124 msgid "guestfs_add_drive_opts_argv"
26128 #: ../src/guestfs-actions.pod:271
26132 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
26133 " const char *filename,\n"
26134 " const struct guestfs_add_drive_opts_argv *optargs);\n"
26139 #: ../src/guestfs-actions.pod:276
26140 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
26144 #: ../src/guestfs-actions.pod:280
26145 msgid "guestfs_add_drive_ro"
26149 #: ../src/guestfs-actions.pod:282
26153 " guestfs_add_drive_ro (guestfs_h *g,\n"
26154 " const char *filename);\n"
26159 #: ../src/guestfs-actions.pod:286
26161 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
26162 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
26163 "disk is added read-only, with the format being detected automatically."
26167 #: ../src/guestfs-actions.pod:293
26168 msgid "(Added in 1.0.38)"
26172 #: ../src/guestfs-actions.pod:295
26173 msgid "guestfs_add_drive_ro_with_if"
26177 #: ../src/guestfs-actions.pod:297
26181 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
26182 " const char *filename,\n"
26183 " const char *iface);\n"
26188 #: ../src/guestfs-actions.pod:309
26190 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
26191 "QEMU interface emulation to use at run time."
26195 #: ../src/guestfs-actions.pod:314 ../src/guestfs-actions.pod:335
26196 #: ../src/guestfs-actions.pod:2881
26197 msgid "(Added in 1.0.84)"
26201 #: ../src/guestfs-actions.pod:316
26202 msgid "guestfs_add_drive_with_if"
26206 #: ../src/guestfs-actions.pod:318
26210 " guestfs_add_drive_with_if (guestfs_h *g,\n"
26211 " const char *filename,\n"
26212 " const char *iface);\n"
26217 #: ../src/guestfs-actions.pod:330
26219 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
26220 "QEMU interface emulation to use at run time."
26224 #: ../src/guestfs-actions.pod:337
26225 msgid "guestfs_aug_clear"
26229 #: ../src/guestfs-actions.pod:339
26233 " guestfs_aug_clear (guestfs_h *g,\n"
26234 " const char *augpath);\n"
26239 #: ../src/guestfs-actions.pod:348 ../src/guestfs-actions.pod:2609
26240 msgid "(Added in 1.3.4)"
26244 #: ../src/guestfs-actions.pod:350
26245 msgid "guestfs_aug_close"
26249 #: ../src/guestfs-actions.pod:352
26253 " guestfs_aug_close (guestfs_h *g);\n"
26258 #: ../src/guestfs-actions.pod:355
26260 "Close the current Augeas handle and free up any resources used by it. After "
26261 "calling this, you have to call C<guestfs_aug_init> again before you can use "
26262 "any other Augeas functions."
26266 #: ../src/guestfs-actions.pod:362 ../src/guestfs-actions.pod:387
26267 #: ../src/guestfs-actions.pod:405 ../src/guestfs-actions.pod:419
26268 #: ../src/guestfs-actions.pod:482 ../src/guestfs-actions.pod:502
26269 #: ../src/guestfs-actions.pod:516 ../src/guestfs-actions.pod:547
26270 #: ../src/guestfs-actions.pod:561 ../src/guestfs-actions.pod:575
26271 #: ../src/guestfs-actions.pod:589 ../src/guestfs-actions.pod:607
26272 #: ../src/guestfs-actions.pod:6460
26273 msgid "(Added in 0.7)"
26277 #: ../src/guestfs-actions.pod:364
26278 msgid "guestfs_aug_defnode"
26282 #: ../src/guestfs-actions.pod:366
26285 " struct guestfs_int_bool *\n"
26286 " guestfs_aug_defnode (guestfs_h *g,\n"
26287 " const char *name,\n"
26288 " const char *expr,\n"
26289 " const char *val);\n"
26294 #: ../src/guestfs-actions.pod:375
26296 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
26297 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
26298 "containing that single node."
26302 #: ../src/guestfs-actions.pod:383
26304 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
26305 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
26309 #: ../src/guestfs-actions.pod:389
26310 msgid "guestfs_aug_defvar"
26314 #: ../src/guestfs-actions.pod:391
26318 " guestfs_aug_defvar (guestfs_h *g,\n"
26319 " const char *name,\n"
26320 " const char *expr);\n"
26325 #: ../src/guestfs-actions.pod:407
26326 msgid "guestfs_aug_get"
26330 #: ../src/guestfs-actions.pod:409
26334 " guestfs_aug_get (guestfs_h *g,\n"
26335 " const char *augpath);\n"
26340 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:980
26341 #: ../src/guestfs-actions.pod:998 ../src/guestfs-actions.pod:1058
26342 #: ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1177
26343 #: ../src/guestfs-actions.pod:1666 ../src/guestfs-actions.pod:1683
26344 #: ../src/guestfs-actions.pod:1702 ../src/guestfs-actions.pod:1836
26345 #: ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2136
26346 #: ../src/guestfs-actions.pod:2299 ../src/guestfs-actions.pod:2316
26347 #: ../src/guestfs-actions.pod:2383 ../src/guestfs-actions.pod:2426
26348 #: ../src/guestfs-actions.pod:2447 ../src/guestfs-actions.pod:2632
26349 #: ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:3050
26350 #: ../src/guestfs-actions.pod:3152 ../src/guestfs-actions.pod:3256
26351 #: ../src/guestfs-actions.pod:3275 ../src/guestfs-actions.pod:3490
26352 #: ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3539
26353 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3636
26354 #: ../src/guestfs-actions.pod:3656 ../src/guestfs-actions.pod:3676
26355 #: ../src/guestfs-actions.pod:4314 ../src/guestfs-actions.pod:4661
26356 #: ../src/guestfs-actions.pod:4828 ../src/guestfs-actions.pod:5076
26357 #: ../src/guestfs-actions.pod:5969 ../src/guestfs-actions.pod:6170
26358 #: ../src/guestfs-actions.pod:6358 ../src/guestfs-actions.pod:6536
26359 #: ../src/guestfs-actions.pod:6585 ../src/guestfs-actions.pod:7245
26360 #: ../src/guestfs-actions.pod:7261 ../src/guestfs-actions.pod:7285
26361 #: ../src/guestfs-actions.pod:7309 ../src/guestfs-actions.pod:8103
26362 #: ../src/guestfs-actions.pod:8122 ../src/guestfs-actions.pod:8140
26363 #: ../src/guestfs-actions.pod:8314 ../src/guestfs-actions.pod:8628
26365 "This function returns a string, or NULL on error. I<The caller must free "
26366 "the returned string after use>."
26370 #: ../src/guestfs-actions.pod:421
26371 msgid "guestfs_aug_init"
26375 #: ../src/guestfs-actions.pod:423
26379 " guestfs_aug_init (guestfs_h *g,\n"
26380 " const char *root,\n"
26386 #: ../src/guestfs-actions.pod:432
26387 msgid "You must call this before using any other C<guestfs_aug_*> commands."
26391 #: ../src/guestfs-actions.pod:457
26393 "This option is only useful when debugging Augeas lenses. Use of this option "
26394 "may require additional memory for the libguestfs appliance. You may need to "
26395 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
26396 "C<guestfs_set_memsize>."
26400 #: ../src/guestfs-actions.pod:472
26401 msgid "Do not load the tree in C<guestfs_aug_init>."
26405 #: ../src/guestfs-actions.pod:476
26406 msgid "To close the handle, you can call C<guestfs_aug_close>."
26410 #: ../src/guestfs-actions.pod:484
26411 msgid "guestfs_aug_insert"
26415 #: ../src/guestfs-actions.pod:486
26419 " guestfs_aug_insert (guestfs_h *g,\n"
26420 " const char *augpath,\n"
26421 " const char *label,\n"
26427 #: ../src/guestfs-actions.pod:504
26428 msgid "guestfs_aug_load"
26432 #: ../src/guestfs-actions.pod:506
26436 " guestfs_aug_load (guestfs_h *g);\n"
26441 #: ../src/guestfs-actions.pod:518
26442 msgid "guestfs_aug_ls"
26446 #: ../src/guestfs-actions.pod:520
26450 " guestfs_aug_ls (guestfs_h *g,\n"
26451 " const char *augpath);\n"
26456 #: ../src/guestfs-actions.pod:524
26458 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
26459 "sorting the resulting nodes into alphabetical order."
26463 #: ../src/guestfs-actions.pod:527 ../src/guestfs-actions.pod:543
26464 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:1196
26465 #: ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:1870
26466 #: ../src/guestfs-actions.pod:1973 ../src/guestfs-actions.pod:1992
26467 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2704
26468 #: ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:2739
26469 #: ../src/guestfs-actions.pod:2804 ../src/guestfs-actions.pod:2828
26470 #: ../src/guestfs-actions.pod:2899 ../src/guestfs-actions.pod:2948
26471 #: ../src/guestfs-actions.pod:3217 ../src/guestfs-actions.pod:3592
26472 #: ../src/guestfs-actions.pod:3872 ../src/guestfs-actions.pod:4186
26473 #: ../src/guestfs-actions.pod:4203 ../src/guestfs-actions.pod:4223
26474 #: ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4296
26475 #: ../src/guestfs-actions.pod:4401 ../src/guestfs-actions.pod:4800
26476 #: ../src/guestfs-actions.pod:5695 ../src/guestfs-actions.pod:6330
26477 #: ../src/guestfs-actions.pod:6456 ../src/guestfs-actions.pod:6570
26478 #: ../src/guestfs-actions.pod:7325 ../src/guestfs-actions.pod:7386
26479 #: ../src/guestfs-actions.pod:7441 ../src/guestfs-actions.pod:7587
26480 #: ../src/guestfs-actions.pod:7611 ../src/guestfs-actions.pod:8207
26481 #: ../src/guestfs-actions.pod:8227 ../src/guestfs-actions.pod:8274
26482 #: ../src/guestfs-actions.pod:8468 ../src/guestfs-actions.pod:8487
26483 #: ../src/guestfs-actions.pod:8578 ../src/guestfs-actions.pod:8597
26484 #: ../src/guestfs-actions.pod:8643 ../src/guestfs-actions.pod:8662
26486 "This function returns a NULL-terminated array of strings (like L<environ(3)"
26487 ">), or NULL if there was an error. I<The caller must free the strings and "
26488 "the array after use>."
26492 #: ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:1121
26493 #: ../src/guestfs-actions.pod:1139 ../src/guestfs-actions.pod:1908
26494 #: ../src/guestfs-actions.pod:3950 ../src/guestfs-actions.pod:3981
26495 #: ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:4691
26496 #: ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5049
26497 #: ../src/guestfs-actions.pod:5212 ../src/guestfs-actions.pod:5699
26498 #: ../src/guestfs-actions.pod:6271 ../src/guestfs-actions.pod:6668
26499 #: ../src/guestfs-actions.pod:6682 ../src/guestfs-actions.pod:6694
26500 #: ../src/guestfs-actions.pod:7172 ../src/guestfs-actions.pod:7945
26501 #: ../src/guestfs-actions.pod:7958 ../src/guestfs-actions.pod:8191
26502 #: ../src/guestfs-actions.pod:8456
26503 msgid "(Added in 0.8)"
26507 #: ../src/guestfs-actions.pod:533
26508 msgid "guestfs_aug_match"
26512 #: ../src/guestfs-actions.pod:535
26516 " guestfs_aug_match (guestfs_h *g,\n"
26517 " const char *augpath);\n"
26522 #: ../src/guestfs-actions.pod:549
26523 msgid "guestfs_aug_mv"
26527 #: ../src/guestfs-actions.pod:551
26531 " guestfs_aug_mv (guestfs_h *g,\n"
26532 " const char *src,\n"
26533 " const char *dest);\n"
26538 #: ../src/guestfs-actions.pod:563
26539 msgid "guestfs_aug_rm"
26543 #: ../src/guestfs-actions.pod:565
26547 " guestfs_aug_rm (guestfs_h *g,\n"
26548 " const char *augpath);\n"
26553 #: ../src/guestfs-actions.pod:577
26554 msgid "guestfs_aug_save"
26558 #: ../src/guestfs-actions.pod:579
26562 " guestfs_aug_save (guestfs_h *g);\n"
26567 #: ../src/guestfs-actions.pod:584
26569 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
26574 #: ../src/guestfs-actions.pod:591
26575 msgid "guestfs_aug_set"
26579 #: ../src/guestfs-actions.pod:593
26583 " guestfs_aug_set (guestfs_h *g,\n"
26584 " const char *augpath,\n"
26585 " const char *val);\n"
26590 #: ../src/guestfs-actions.pod:600
26592 "In the Augeas API, it is possible to clear a node by setting the value to "
26593 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
26594 "this call. Instead you must use the C<guestfs_aug_clear> call."
26598 #: ../src/guestfs-actions.pod:609
26599 msgid "guestfs_available"
26603 #: ../src/guestfs-actions.pod:611
26607 " guestfs_available (guestfs_h *g,\n"
26608 " char *const *groups);\n"
26613 #: ../src/guestfs-actions.pod:619
26615 "The libguestfs groups, and the functions that those groups correspond to, "
26616 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
26617 "runtime by calling C<guestfs_available_all_groups>."
26621 #: ../src/guestfs-actions.pod:643
26622 msgid "You must call C<guestfs_launch> before calling this function."
26626 #: ../src/guestfs-actions.pod:665
26628 "This call was added in version C<1.0.80>. In previous versions of "
26629 "libguestfs all you could do would be to speculatively execute a command to "
26630 "find out if the daemon implemented it. See also C<guestfs_version>."
26634 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:1653
26635 msgid "(Added in 1.0.80)"
26639 #: ../src/guestfs-actions.pod:676
26640 msgid "guestfs_available_all_groups"
26644 #: ../src/guestfs-actions.pod:678
26648 " guestfs_available_all_groups (guestfs_h *g);\n"
26653 #: ../src/guestfs-actions.pod:681
26655 "This command returns a list of all optional groups that this daemon knows "
26656 "about. Note this returns both supported and unsupported groups. To find "
26657 "out which ones the daemon can actually support you have to call "
26658 "C<guestfs_available> on each member of the returned list."
26662 #: ../src/guestfs-actions.pod:687
26663 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
26667 #: ../src/guestfs-actions.pod:693
26668 msgid "(Added in 1.3.15)"
26672 #: ../src/guestfs-actions.pod:695
26673 msgid "guestfs_base64_in"
26677 #: ../src/guestfs-actions.pod:697
26681 " guestfs_base64_in (guestfs_h *g,\n"
26682 " const char *base64file,\n"
26683 " const char *filename);\n"
26688 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:721
26689 msgid "(Added in 1.3.5)"
26693 #: ../src/guestfs-actions.pod:709
26694 msgid "guestfs_base64_out"
26698 #: ../src/guestfs-actions.pod:711
26702 " guestfs_base64_out (guestfs_h *g,\n"
26703 " const char *filename,\n"
26704 " const char *base64file);\n"
26709 #: ../src/guestfs-actions.pod:723
26710 msgid "guestfs_blockdev_flushbufs"
26714 #: ../src/guestfs-actions.pod:725
26718 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
26719 " const char *device);\n"
26724 #: ../src/guestfs-actions.pod:736 ../src/guestfs-actions.pod:753
26725 #: ../src/guestfs-actions.pod:768 ../src/guestfs-actions.pod:784
26726 #: ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:821
26727 #: ../src/guestfs-actions.pod:835 ../src/guestfs-actions.pod:853
26728 #: ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:881
26729 msgid "(Added in 0.9.3)"
26733 #: ../src/guestfs-actions.pod:738
26734 msgid "guestfs_blockdev_getbsz"
26738 #: ../src/guestfs-actions.pod:740
26742 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
26743 " const char *device);\n"
26748 #: ../src/guestfs-actions.pod:755
26749 msgid "guestfs_blockdev_getro"
26753 #: ../src/guestfs-actions.pod:757
26757 " guestfs_blockdev_getro (guestfs_h *g,\n"
26758 " const char *device);\n"
26763 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1891
26764 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:2395
26765 #: ../src/guestfs-actions.pod:2406 ../src/guestfs-actions.pod:2478
26766 #: ../src/guestfs-actions.pod:2504 ../src/guestfs-actions.pod:2544
26767 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2595
26768 #: ../src/guestfs-actions.pod:2618 ../src/guestfs-actions.pod:3693
26769 #: ../src/guestfs-actions.pod:3709 ../src/guestfs-actions.pod:3727
26770 #: ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3903
26771 #: ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:3932
26772 #: ../src/guestfs-actions.pod:3948 ../src/guestfs-actions.pod:3963
26773 #: ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:3993
26774 #: ../src/guestfs-actions.pod:4006 ../src/guestfs-actions.pod:4020
26775 #: ../src/guestfs-actions.pod:4035 ../src/guestfs-actions.pod:4050
26776 #: ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4077
26777 #: ../src/guestfs-actions.pod:5933
26778 msgid "This function returns a C truth value on success or -1 on error."
26782 #: ../src/guestfs-actions.pod:770
26783 msgid "guestfs_blockdev_getsize64"
26787 #: ../src/guestfs-actions.pod:772
26791 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
26792 " const char *device);\n"
26797 #: ../src/guestfs-actions.pod:778
26798 msgid "See also C<guestfs_blockdev_getsz>."
26802 #: ../src/guestfs-actions.pod:786
26803 msgid "guestfs_blockdev_getss"
26807 #: ../src/guestfs-actions.pod:788
26811 " guestfs_blockdev_getss (guestfs_h *g,\n"
26812 " const char *device);\n"
26817 #: ../src/guestfs-actions.pod:795
26819 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
26824 #: ../src/guestfs-actions.pod:804
26825 msgid "guestfs_blockdev_getsz"
26829 #: ../src/guestfs-actions.pod:806
26833 " guestfs_blockdev_getsz (guestfs_h *g,\n"
26834 " const char *device);\n"
26839 #: ../src/guestfs-actions.pod:813
26841 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
26842 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
26846 #: ../src/guestfs-actions.pod:823
26847 msgid "guestfs_blockdev_rereadpt"
26851 #: ../src/guestfs-actions.pod:825
26855 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
26856 " const char *device);\n"
26861 #: ../src/guestfs-actions.pod:837
26862 msgid "guestfs_blockdev_setbsz"
26866 #: ../src/guestfs-actions.pod:839
26870 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
26871 " const char *device,\n"
26872 " int blocksize);\n"
26877 #: ../src/guestfs-actions.pod:855
26878 msgid "guestfs_blockdev_setro"
26882 #: ../src/guestfs-actions.pod:857
26886 " guestfs_blockdev_setro (guestfs_h *g,\n"
26887 " const char *device);\n"
26892 #: ../src/guestfs-actions.pod:869
26893 msgid "guestfs_blockdev_setrw"
26897 #: ../src/guestfs-actions.pod:871
26901 " guestfs_blockdev_setrw (guestfs_h *g,\n"
26902 " const char *device);\n"
26907 #: ../src/guestfs-actions.pod:883
26908 msgid "guestfs_btrfs_filesystem_resize"
26912 #: ../src/guestfs-actions.pod:885
26916 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
26917 " const char *mountpoint,\n"
26923 #: ../src/guestfs-actions.pod:895
26926 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
26931 #: ../src/guestfs-actions.pod:918
26932 msgid "(Added in 1.11.17)"
26936 #: ../src/guestfs-actions.pod:920
26937 msgid "guestfs_btrfs_filesystem_resize_va"
26941 #: ../src/guestfs-actions.pod:922
26945 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
26946 " const char *mountpoint,\n"
26947 " va_list args);\n"
26952 #: ../src/guestfs-actions.pod:927
26953 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
26957 #: ../src/guestfs-actions.pod:931
26958 msgid "guestfs_btrfs_filesystem_resize_argv"
26962 #: ../src/guestfs-actions.pod:933
26966 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
26967 " const char *mountpoint,\n"
26968 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
26973 #: ../src/guestfs-actions.pod:938
26974 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
26978 #: ../src/guestfs-actions.pod:942
26979 msgid "guestfs_case_sensitive_path"
26983 #: ../src/guestfs-actions.pod:944
26987 " guestfs_case_sensitive_path (guestfs_h *g,\n"
26988 " const char *path);\n"
26993 #: ../src/guestfs-actions.pod:970
26995 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
26996 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
26997 "how the directories were originally created under Windows)."
27001 #: ../src/guestfs-actions.pod:978
27002 msgid "See also C<guestfs_realpath>."
27006 #: ../src/guestfs-actions.pod:983 ../src/guestfs-actions.pod:8125
27007 msgid "(Added in 1.0.75)"
27011 #: ../src/guestfs-actions.pod:985
27012 msgid "guestfs_cat"
27016 #: ../src/guestfs-actions.pod:987
27020 " guestfs_cat (guestfs_h *g,\n"
27021 " const char *path);\n"
27026 #: ../src/guestfs-actions.pod:993
27028 "Note that this function cannot correctly handle binary files (specifically, "
27029 "files containing C<\\0> character which is treated as end of string). For "
27030 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
27031 "functions which have a more complex interface."
27035 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:4207
27036 #: ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4317
27037 #: ../src/guestfs-actions.pod:4405 ../src/guestfs-actions.pod:4804
27038 #: ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:6334
27039 #: ../src/guestfs-actions.pod:6348 ../src/guestfs-actions.pod:8278
27040 #: ../src/guestfs-actions.pod:8292
27041 msgid "(Added in 0.4)"
27045 #: ../src/guestfs-actions.pod:1006
27046 msgid "guestfs_checksum"
27050 #: ../src/guestfs-actions.pod:1008
27054 " guestfs_checksum (guestfs_h *g,\n"
27055 " const char *csumtype,\n"
27056 " const char *path);\n"
27061 #: ../src/guestfs-actions.pod:1054
27062 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
27066 #: ../src/guestfs-actions.pod:1056
27067 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
27071 #: ../src/guestfs-actions.pod:1061 ../src/guestfs-actions.pod:1728
27072 #: ../src/guestfs-actions.pod:2586 ../src/guestfs-actions.pod:3905
27073 #: ../src/guestfs-actions.pod:3934 ../src/guestfs-actions.pod:3995
27074 #: ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:7981
27075 msgid "(Added in 1.0.2)"
27079 #: ../src/guestfs-actions.pod:1063
27080 msgid "guestfs_checksum_device"
27084 #: ../src/guestfs-actions.pod:1065
27088 " guestfs_checksum_device (guestfs_h *g,\n"
27089 " const char *csumtype,\n"
27090 " const char *device);\n"
27095 #: ../src/guestfs-actions.pod:1070
27097 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
27098 "device named C<device>. For the types of checksums supported see the "
27099 "C<guestfs_checksum> command."
27103 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:5766
27104 #: ../src/guestfs-actions.pod:5901 ../src/guestfs-actions.pod:5935
27105 #: ../src/guestfs-actions.pod:5953 ../src/guestfs-actions.pod:6135
27106 #: ../src/guestfs-actions.pod:7890 ../src/guestfs-actions.pod:7904
27107 #: ../src/guestfs-actions.pod:8304
27108 msgid "(Added in 1.3.2)"
27112 #: ../src/guestfs-actions.pod:1079
27113 msgid "guestfs_checksums_out"
27117 #: ../src/guestfs-actions.pod:1081
27121 " guestfs_checksums_out (guestfs_h *g,\n"
27122 " const char *csumtype,\n"
27123 " const char *directory,\n"
27124 " const char *sumsfile);\n"
27129 #: ../src/guestfs-actions.pod:1101
27130 msgid "(Added in 1.3.7)"
27134 #: ../src/guestfs-actions.pod:1103
27135 msgid "guestfs_chmod"
27139 #: ../src/guestfs-actions.pod:1105
27143 " guestfs_chmod (guestfs_h *g,\n"
27145 " const char *path);\n"
27150 #: ../src/guestfs-actions.pod:1123
27151 msgid "guestfs_chown"
27155 #: ../src/guestfs-actions.pod:1125
27159 " guestfs_chown (guestfs_h *g,\n"
27162 " const char *path);\n"
27167 #: ../src/guestfs-actions.pod:1141
27168 msgid "guestfs_command"
27172 #: ../src/guestfs-actions.pod:1143
27176 " guestfs_command (guestfs_h *g,\n"
27177 " char *const *arguments);\n"
27182 #: ../src/guestfs-actions.pod:1152
27184 "The single parameter is an argv-style list of arguments. The first element "
27185 "is the name of the program to run. Subsequent elements are parameters. The "
27186 "list must be non-empty (ie. must contain a program name). Note that the "
27187 "command runs directly, and is I<not> invoked via the shell (see "
27192 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1203
27193 #: ../src/guestfs-actions.pod:2027
27194 msgid "(Added in 0.9.1)"
27198 #: ../src/guestfs-actions.pod:1185
27199 msgid "guestfs_command_lines"
27203 #: ../src/guestfs-actions.pod:1187
27207 " guestfs_command_lines (guestfs_h *g,\n"
27208 " char *const *arguments);\n"
27213 #: ../src/guestfs-actions.pod:1191
27215 "This is the same as C<guestfs_command>, but splits the result into a list of "
27220 #: ../src/guestfs-actions.pod:1194
27221 msgid "See also: C<guestfs_sh_lines>"
27225 #: ../src/guestfs-actions.pod:1205
27226 msgid "guestfs_compress_device_out"
27230 #: ../src/guestfs-actions.pod:1207
27234 " guestfs_compress_device_out (guestfs_h *g,\n"
27235 " const char *ctype,\n"
27236 " const char *device,\n"
27237 " const char *zdevice,\n"
27243 #: ../src/guestfs-actions.pod:1219
27246 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
27251 #: ../src/guestfs-actions.pod:1224
27253 "The C<ctype> and optional C<level> parameters have the same meaning as in "
27254 "C<guestfs_compress_out>."
27258 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:1288
27259 #: ../src/guestfs-actions.pod:2572 ../src/guestfs-actions.pod:7051
27260 msgid "(Added in 1.13.15)"
27264 #: ../src/guestfs-actions.pod:1231
27265 msgid "guestfs_compress_device_out_va"
27269 #: ../src/guestfs-actions.pod:1233
27273 " guestfs_compress_device_out_va (guestfs_h *g,\n"
27274 " const char *ctype,\n"
27275 " const char *device,\n"
27276 " const char *zdevice,\n"
27277 " va_list args);\n"
27282 #: ../src/guestfs-actions.pod:1240
27283 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
27287 #: ../src/guestfs-actions.pod:1244
27288 msgid "guestfs_compress_device_out_argv"
27292 #: ../src/guestfs-actions.pod:1246
27296 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
27297 " const char *ctype,\n"
27298 " const char *device,\n"
27299 " const char *zdevice,\n"
27300 " const struct guestfs_compress_device_out_argv *optargs);\n"
27305 #: ../src/guestfs-actions.pod:1253
27306 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
27310 #: ../src/guestfs-actions.pod:1257
27311 msgid "guestfs_compress_out"
27315 #: ../src/guestfs-actions.pod:1259
27319 " guestfs_compress_out (guestfs_h *g,\n"
27320 " const char *ctype,\n"
27321 " const char *file,\n"
27322 " const char *zfile,\n"
27328 #: ../src/guestfs-actions.pod:1271
27331 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
27336 #: ../src/guestfs-actions.pod:1290
27337 msgid "guestfs_compress_out_va"
27341 #: ../src/guestfs-actions.pod:1292
27345 " guestfs_compress_out_va (guestfs_h *g,\n"
27346 " const char *ctype,\n"
27347 " const char *file,\n"
27348 " const char *zfile,\n"
27349 " va_list args);\n"
27354 #: ../src/guestfs-actions.pod:1299
27355 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
27359 #: ../src/guestfs-actions.pod:1303
27360 msgid "guestfs_compress_out_argv"
27364 #: ../src/guestfs-actions.pod:1305
27368 " guestfs_compress_out_argv (guestfs_h *g,\n"
27369 " const char *ctype,\n"
27370 " const char *file,\n"
27371 " const char *zfile,\n"
27372 " const struct guestfs_compress_out_argv *optargs);\n"
27377 #: ../src/guestfs-actions.pod:1312
27378 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
27382 #: ../src/guestfs-actions.pod:1316
27383 msgid "guestfs_config"
27387 #: ../src/guestfs-actions.pod:1318
27391 " guestfs_config (guestfs_h *g,\n"
27392 " const char *qemuparam,\n"
27393 " const char *qemuvalue);\n"
27398 #: ../src/guestfs-actions.pod:1336
27399 msgid "guestfs_copy_device_to_device"
27403 #: ../src/guestfs-actions.pod:1338
27407 " guestfs_copy_device_to_device (guestfs_h *g,\n"
27408 " const char *src,\n"
27409 " const char *dest,\n"
27415 #: ../src/guestfs-actions.pod:1349
27418 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
27419 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
27420 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
27425 #: ../src/guestfs-actions.pod:1353
27427 "The four calls C<guestfs_copy_device_to_device>, "
27428 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
27429 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
27430 "destination (device|file)."
27434 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1427
27435 #: ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1538
27436 #: ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:1723
27437 #: ../src/guestfs-actions.pod:1754 ../src/guestfs-actions.pod:1799
27438 #: ../src/guestfs-actions.pod:2176 ../src/guestfs-actions.pod:2198
27439 #: ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:7976
27440 #: ../src/guestfs-actions.pod:8010 ../src/guestfs-actions.pod:8517
27441 #: ../src/guestfs-actions.pod:8540
27443 "This long-running command can generate progress notification messages so "
27444 "that the caller can display a progress bar or indicator. To receive these "
27445 "messages, the caller must register a progress event callback. See L<guestfs"
27446 "(3)/GUESTFS_EVENT_PROGRESS>."
27450 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1432
27451 #: ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1543
27452 #: ../src/guestfs-actions.pod:6191
27453 msgid "(Added in 1.13.25)"
27457 #: ../src/guestfs-actions.pod:1381
27458 msgid "guestfs_copy_device_to_device_va"
27462 #: ../src/guestfs-actions.pod:1383
27466 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
27467 " const char *src,\n"
27468 " const char *dest,\n"
27469 " va_list args);\n"
27474 #: ../src/guestfs-actions.pod:1389
27475 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
27479 #: ../src/guestfs-actions.pod:1393
27480 msgid "guestfs_copy_device_to_device_argv"
27484 #: ../src/guestfs-actions.pod:1395
27488 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
27489 " const char *src,\n"
27490 " const char *dest,\n"
27491 " const struct guestfs_copy_device_to_device_argv *optargs);\n"
27496 #: ../src/guestfs-actions.pod:1401
27497 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
27501 #: ../src/guestfs-actions.pod:1405
27502 msgid "guestfs_copy_device_to_file"
27506 #: ../src/guestfs-actions.pod:1407
27510 " guestfs_copy_device_to_file (guestfs_h *g,\n"
27511 " const char *src,\n"
27512 " const char *dest,\n"
27518 #: ../src/guestfs-actions.pod:1418
27521 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
27522 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
27523 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
27528 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1475
27529 #: ../src/guestfs-actions.pod:1528
27531 "See C<guestfs_copy_device_to_device> for a general overview of this call."
27535 #: ../src/guestfs-actions.pod:1434
27536 msgid "guestfs_copy_device_to_file_va"
27540 #: ../src/guestfs-actions.pod:1436
27544 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
27545 " const char *src,\n"
27546 " const char *dest,\n"
27547 " va_list args);\n"
27552 #: ../src/guestfs-actions.pod:1442
27553 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
27557 #: ../src/guestfs-actions.pod:1446
27558 msgid "guestfs_copy_device_to_file_argv"
27562 #: ../src/guestfs-actions.pod:1448
27566 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
27567 " const char *src,\n"
27568 " const char *dest,\n"
27569 " const struct guestfs_copy_device_to_file_argv *optargs);\n"
27574 #: ../src/guestfs-actions.pod:1454
27575 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
27579 #: ../src/guestfs-actions.pod:1458
27580 msgid "guestfs_copy_file_to_device"
27584 #: ../src/guestfs-actions.pod:1460
27588 " guestfs_copy_file_to_device (guestfs_h *g,\n"
27589 " const char *src,\n"
27590 " const char *dest,\n"
27596 #: ../src/guestfs-actions.pod:1471
27599 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
27600 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
27601 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
27606 #: ../src/guestfs-actions.pod:1487
27607 msgid "guestfs_copy_file_to_device_va"
27611 #: ../src/guestfs-actions.pod:1489
27615 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
27616 " const char *src,\n"
27617 " const char *dest,\n"
27618 " va_list args);\n"
27623 #: ../src/guestfs-actions.pod:1495
27624 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
27628 #: ../src/guestfs-actions.pod:1499
27629 msgid "guestfs_copy_file_to_device_argv"
27633 #: ../src/guestfs-actions.pod:1501
27637 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
27638 " const char *src,\n"
27639 " const char *dest,\n"
27640 " const struct guestfs_copy_file_to_device_argv *optargs);\n"
27645 #: ../src/guestfs-actions.pod:1507
27646 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
27650 #: ../src/guestfs-actions.pod:1511
27651 msgid "guestfs_copy_file_to_file"
27655 #: ../src/guestfs-actions.pod:1513
27659 " guestfs_copy_file_to_file (guestfs_h *g,\n"
27660 " const char *src,\n"
27661 " const char *dest,\n"
27667 #: ../src/guestfs-actions.pod:1524
27670 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
27671 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
27672 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
27677 #: ../src/guestfs-actions.pod:1531
27679 "This is B<not> the function you want for copying files. This is for copying "
27680 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
27681 "C<guestfs_mv> for general file copying and moving functions."
27685 #: ../src/guestfs-actions.pod:1545
27686 msgid "guestfs_copy_file_to_file_va"
27690 #: ../src/guestfs-actions.pod:1547
27694 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
27695 " const char *src,\n"
27696 " const char *dest,\n"
27697 " va_list args);\n"
27702 #: ../src/guestfs-actions.pod:1553
27703 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
27707 #: ../src/guestfs-actions.pod:1557
27708 msgid "guestfs_copy_file_to_file_argv"
27712 #: ../src/guestfs-actions.pod:1559
27716 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
27717 " const char *src,\n"
27718 " const char *dest,\n"
27719 " const struct guestfs_copy_file_to_file_argv *optargs);\n"
27724 #: ../src/guestfs-actions.pod:1565
27725 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
27729 #: ../src/guestfs-actions.pod:1569
27730 msgid "guestfs_copy_size"
27734 #: ../src/guestfs-actions.pod:1571
27738 " guestfs_copy_size (guestfs_h *g,\n"
27739 " const char *src,\n"
27740 " const char *dest,\n"
27741 " int64_t size);\n"
27746 #: ../src/guestfs-actions.pod:1577 ../src/guestfs-actions.pod:1634
27748 "I<This function is deprecated.> In new code, use the L</"
27749 "guestfs_copy_device_to_device> call instead."
27753 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:4831
27754 #: ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:8211
27755 #: ../src/guestfs-actions.pod:8231 ../src/guestfs-actions.pod:8317
27756 msgid "(Added in 1.0.87)"
27760 #: ../src/guestfs-actions.pod:1599
27765 #: ../src/guestfs-actions.pod:1601
27769 " guestfs_cp (guestfs_h *g,\n"
27770 " const char *src,\n"
27771 " const char *dest);\n"
27776 #: ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1625
27777 #: ../src/guestfs-actions.pod:1705 ../src/guestfs-actions.pod:1779
27778 #: ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:5713
27779 #: ../src/guestfs-actions.pod:6205
27780 msgid "(Added in 1.0.18)"
27784 #: ../src/guestfs-actions.pod:1613
27785 msgid "guestfs_cp_a"
27789 #: ../src/guestfs-actions.pod:1615
27793 " guestfs_cp_a (guestfs_h *g,\n"
27794 " const char *src,\n"
27795 " const char *dest);\n"
27800 #: ../src/guestfs-actions.pod:1627
27805 #: ../src/guestfs-actions.pod:1629
27809 " guestfs_dd (guestfs_h *g,\n"
27810 " const char *src,\n"
27811 " const char *dest);\n"
27816 #: ../src/guestfs-actions.pod:1646
27818 "If the destination is a device, it must be as large or larger than the "
27819 "source file or device, otherwise the copy will fail. This command cannot do "
27820 "partial copies (see C<guestfs_copy_device_to_device>)."
27824 #: ../src/guestfs-actions.pod:1655
27829 #: ../src/guestfs-actions.pod:1657
27833 " guestfs_df (guestfs_h *g);\n"
27838 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1679
27840 "This command is mostly useful for interactive sessions. It is I<not> "
27841 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
27846 #: ../src/guestfs-actions.pod:1669 ../src/guestfs-actions.pod:1686
27847 #: ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:2811
27848 #: ../src/guestfs-actions.pod:2835 ../src/guestfs-actions.pod:2903
27849 #: ../src/guestfs-actions.pod:5079 ../src/guestfs-actions.pod:5613
27850 #: ../src/guestfs-actions.pod:7594 ../src/guestfs-actions.pod:7618
27851 #: ../src/guestfs-actions.pod:8357 ../src/guestfs-actions.pod:8370
27852 #: ../src/guestfs-actions.pod:8383
27853 msgid "(Added in 1.0.54)"
27857 #: ../src/guestfs-actions.pod:1671
27858 msgid "guestfs_df_h"
27862 #: ../src/guestfs-actions.pod:1673
27866 " guestfs_df_h (guestfs_h *g);\n"
27871 #: ../src/guestfs-actions.pod:1688
27872 msgid "guestfs_dmesg"
27876 #: ../src/guestfs-actions.pod:1690
27880 " guestfs_dmesg (guestfs_h *g);\n"
27885 #: ../src/guestfs-actions.pod:1697
27887 "Another way to get the same information is to enable verbose messages with "
27888 "C<guestfs_set_verbose> or by setting the environment variable "
27889 "C<LIBGUESTFS_DEBUG=1> before running the program."
27893 #: ../src/guestfs-actions.pod:1707
27894 msgid "guestfs_download"
27898 #: ../src/guestfs-actions.pod:1709
27902 " guestfs_download (guestfs_h *g,\n"
27903 " const char *remotefilename,\n"
27904 " const char *filename);\n"
27909 #: ../src/guestfs-actions.pod:1719
27910 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
27914 #: ../src/guestfs-actions.pod:1730
27915 msgid "guestfs_download_offset"
27919 #: ../src/guestfs-actions.pod:1732
27923 " guestfs_download_offset (guestfs_h *g,\n"
27924 " const char *remotefilename,\n"
27925 " const char *filename,\n"
27926 " int64_t offset,\n"
27927 " int64_t size);\n"
27932 #: ../src/guestfs-actions.pod:1745
27934 "Note that there is no limit on the amount of data that can be downloaded "
27935 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
27936 "full amount unless an error occurs."
27940 #: ../src/guestfs-actions.pod:1750
27941 msgid "See also C<guestfs_download>, C<guestfs_pread>."
27945 #: ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:8015
27946 msgid "(Added in 1.5.17)"
27950 #: ../src/guestfs-actions.pod:1761
27951 msgid "guestfs_drop_caches"
27955 #: ../src/guestfs-actions.pod:1763
27959 " guestfs_drop_caches (guestfs_h *g,\n"
27960 " int whattodrop);\n"
27965 #: ../src/guestfs-actions.pod:1781
27970 #: ../src/guestfs-actions.pod:1783
27974 " guestfs_du (guestfs_h *g,\n"
27975 " const char *path);\n"
27980 #: ../src/guestfs-actions.pod:1806
27981 msgid "guestfs_e2fsck_f"
27985 #: ../src/guestfs-actions.pod:1808
27989 " guestfs_e2fsck_f (guestfs_h *g,\n"
27990 " const char *device);\n"
27995 #: ../src/guestfs-actions.pod:1816
27997 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
27998 "Normally you should use C<guestfs_fsck>."
28002 #: ../src/guestfs-actions.pod:1821
28003 msgid "(Added in 1.0.29)"
28007 #: ../src/guestfs-actions.pod:1823
28008 msgid "guestfs_echo_daemon"
28012 #: ../src/guestfs-actions.pod:1825
28016 " guestfs_echo_daemon (guestfs_h *g,\n"
28017 " char *const *words);\n"
28022 #: ../src/guestfs-actions.pod:1834
28023 msgid "See also C<guestfs_ping_daemon>."
28027 #: ../src/guestfs-actions.pod:1839 ../src/guestfs-actions.pod:2597
28028 #: ../src/guestfs-actions.pod:7075
28029 msgid "(Added in 1.0.69)"
28033 #: ../src/guestfs-actions.pod:1841
28034 msgid "guestfs_egrep"
28038 #: ../src/guestfs-actions.pod:1843
28042 " guestfs_egrep (guestfs_h *g,\n"
28043 " const char *regex,\n"
28044 " const char *path);\n"
28049 #: ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:1877
28050 #: ../src/guestfs-actions.pod:1934 ../src/guestfs-actions.pod:1980
28051 #: ../src/guestfs-actions.pod:1999 ../src/guestfs-actions.pod:2727
28052 #: ../src/guestfs-actions.pod:2746 ../src/guestfs-actions.pod:2924
28053 #: ../src/guestfs-actions.pod:2937 ../src/guestfs-actions.pod:2952
28054 #: ../src/guestfs-actions.pod:2998 ../src/guestfs-actions.pod:3020
28055 #: ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:4330
28056 #: ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4357
28057 #: ../src/guestfs-actions.pod:4371 ../src/guestfs-actions.pod:5501
28058 #: ../src/guestfs-actions.pod:6539 ../src/guestfs-actions.pod:6588
28059 #: ../src/guestfs-actions.pod:7462 ../src/guestfs-actions.pod:7474
28060 #: ../src/guestfs-actions.pod:7487 ../src/guestfs-actions.pod:7500
28061 #: ../src/guestfs-actions.pod:7522 ../src/guestfs-actions.pod:7535
28062 #: ../src/guestfs-actions.pod:7548 ../src/guestfs-actions.pod:7561
28063 #: ../src/guestfs-actions.pod:8475 ../src/guestfs-actions.pod:8494
28064 #: ../src/guestfs-actions.pod:8585 ../src/guestfs-actions.pod:8604
28065 #: ../src/guestfs-actions.pod:8650 ../src/guestfs-actions.pod:8669
28066 msgid "(Added in 1.0.66)"
28070 #: ../src/guestfs-actions.pod:1860
28071 msgid "guestfs_egrepi"
28075 #: ../src/guestfs-actions.pod:1862
28079 " guestfs_egrepi (guestfs_h *g,\n"
28080 " const char *regex,\n"
28081 " const char *path);\n"
28086 #: ../src/guestfs-actions.pod:1879
28087 msgid "guestfs_equal"
28091 #: ../src/guestfs-actions.pod:1881
28095 " guestfs_equal (guestfs_h *g,\n"
28096 " const char *file1,\n"
28097 " const char *file2);\n"
28102 #: ../src/guestfs-actions.pod:1895
28103 msgid "guestfs_exists"
28107 #: ../src/guestfs-actions.pod:1897
28111 " guestfs_exists (guestfs_h *g,\n"
28112 " const char *path);\n"
28117 #: ../src/guestfs-actions.pod:1904
28118 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
28122 #: ../src/guestfs-actions.pod:1910
28123 msgid "guestfs_fallocate"
28127 #: ../src/guestfs-actions.pod:1912
28131 " guestfs_fallocate (guestfs_h *g,\n"
28132 " const char *path,\n"
28138 #: ../src/guestfs-actions.pod:1917
28140 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
28145 #: ../src/guestfs-actions.pod:1936
28146 msgid "guestfs_fallocate64"
28150 #: ../src/guestfs-actions.pod:1938
28154 " guestfs_fallocate64 (guestfs_h *g,\n"
28155 " const char *path,\n"
28161 #: ../src/guestfs-actions.pod:1947
28163 "Note that this call allocates disk blocks for the file. To create a sparse "
28164 "file use C<guestfs_truncate_size> instead."
28168 #: ../src/guestfs-actions.pod:1950
28170 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
28171 "oversight it only allowed 30 bit lengths to be specified, effectively "
28172 "limiting the maximum size of files created through that call to 1GB."
28176 #: ../src/guestfs-actions.pod:1961
28177 msgid "(Added in 1.3.17)"
28181 #: ../src/guestfs-actions.pod:1963
28182 msgid "guestfs_fgrep"
28186 #: ../src/guestfs-actions.pod:1965
28190 " guestfs_fgrep (guestfs_h *g,\n"
28191 " const char *pattern,\n"
28192 " const char *path);\n"
28197 #: ../src/guestfs-actions.pod:1982
28198 msgid "guestfs_fgrepi"
28202 #: ../src/guestfs-actions.pod:1984
28206 " guestfs_fgrepi (guestfs_h *g,\n"
28207 " const char *pattern,\n"
28208 " const char *path);\n"
28213 #: ../src/guestfs-actions.pod:2001
28214 msgid "guestfs_file"
28218 #: ../src/guestfs-actions.pod:2003
28222 " guestfs_file (guestfs_h *g,\n"
28223 " const char *path);\n"
28228 #: ../src/guestfs-actions.pod:2021
28230 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
28231 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
28235 #: ../src/guestfs-actions.pod:2029
28236 msgid "guestfs_file_architecture"
28240 #: ../src/guestfs-actions.pod:2031
28244 " guestfs_file_architecture (guestfs_h *g,\n"
28245 " const char *filename);\n"
28250 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:2302
28251 #: ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:3053
28252 #: ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:3221
28253 #: ../src/guestfs-actions.pod:3408 ../src/guestfs-actions.pod:3426
28254 #: ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3542
28255 #: ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3876
28256 #: ../src/guestfs-actions.pod:4008
28257 msgid "(Added in 1.5.3)"
28261 #: ../src/guestfs-actions.pod:2141
28262 msgid "guestfs_filesize"
28266 #: ../src/guestfs-actions.pod:2143
28270 " guestfs_filesize (guestfs_h *g,\n"
28271 " const char *file);\n"
28276 #: ../src/guestfs-actions.pod:2149
28278 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
28279 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
28280 "devices, use C<guestfs_blockdev_getsize64>."
28284 #: ../src/guestfs-actions.pod:2155
28285 msgid "(Added in 1.0.82)"
28289 #: ../src/guestfs-actions.pod:2157
28290 msgid "guestfs_fill"
28294 #: ../src/guestfs-actions.pod:2159
28298 " guestfs_fill (guestfs_h *g,\n"
28301 " const char *path);\n"
28306 #: ../src/guestfs-actions.pod:2169
28308 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
28309 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
28310 "bytes use C<guestfs_fill_pattern>."
28314 #: ../src/guestfs-actions.pod:2181
28315 msgid "(Added in 1.0.79)"
28319 #: ../src/guestfs-actions.pod:2183
28320 msgid "guestfs_fill_pattern"
28324 #: ../src/guestfs-actions.pod:2185
28328 " guestfs_fill_pattern (guestfs_h *g,\n"
28329 " const char *pattern,\n"
28331 " const char *path);\n"
28336 #: ../src/guestfs-actions.pod:2191
28338 "This function is like C<guestfs_fill> except that it creates a new file of "
28339 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
28340 "pattern is truncated if necessary to ensure the length of the file is "
28341 "exactly C<len> bytes."
28345 #: ../src/guestfs-actions.pod:2203
28346 msgid "(Added in 1.3.12)"
28350 #: ../src/guestfs-actions.pod:2205
28351 msgid "guestfs_find"
28355 #: ../src/guestfs-actions.pod:2207
28359 " guestfs_find (guestfs_h *g,\n"
28360 " const char *directory);\n"
28365 #: ../src/guestfs-actions.pod:2223
28367 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
28371 #: ../src/guestfs-actions.pod:2236
28372 msgid "See also C<guestfs_find0>."
28376 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:4768
28377 #: ../src/guestfs-actions.pod:6623
28378 msgid "(Added in 1.0.27)"
28382 #: ../src/guestfs-actions.pod:2247
28383 msgid "guestfs_find0"
28387 #: ../src/guestfs-actions.pod:2249
28391 " guestfs_find0 (guestfs_h *g,\n"
28392 " const char *directory,\n"
28393 " const char *files);\n"
28398 #: ../src/guestfs-actions.pod:2258
28400 "This command works the same way as C<guestfs_find> with the following "
28405 #: ../src/guestfs-actions.pod:2285
28406 msgid "(Added in 1.0.74)"
28410 #: ../src/guestfs-actions.pod:2287
28411 msgid "guestfs_findfs_label"
28415 #: ../src/guestfs-actions.pod:2289
28419 " guestfs_findfs_label (guestfs_h *g,\n"
28420 " const char *label);\n"
28425 #: ../src/guestfs-actions.pod:2297
28426 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
28430 #: ../src/guestfs-actions.pod:2304
28431 msgid "guestfs_findfs_uuid"
28435 #: ../src/guestfs-actions.pod:2306
28439 " guestfs_findfs_uuid (guestfs_h *g,\n"
28440 " const char *uuid);\n"
28445 #: ../src/guestfs-actions.pod:2314
28446 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
28450 #: ../src/guestfs-actions.pod:2321
28451 msgid "guestfs_fsck"
28455 #: ../src/guestfs-actions.pod:2323
28459 " guestfs_fsck (guestfs_h *g,\n"
28460 " const char *fstype,\n"
28461 " const char *device);\n"
28466 #: ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:8522
28467 msgid "(Added in 1.0.16)"
28471 #: ../src/guestfs-actions.pod:2360
28472 msgid "guestfs_get_append"
28476 #: ../src/guestfs-actions.pod:2362
28480 " guestfs_get_append (guestfs_h *g);\n"
28485 #: ../src/guestfs-actions.pod:2370
28487 "This function returns a string which may be NULL. There is no way to return "
28488 "an error from this function. The string is owned by the guest handle and "
28489 "must I<not> be freed."
28493 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:6301
28494 #: ../src/guestfs-actions.pod:6780 ../src/guestfs-actions.pod:7229
28495 #: ../src/guestfs-actions.pod:7248 ../src/guestfs-actions.pod:7264
28496 #: ../src/guestfs-actions.pod:7288 ../src/guestfs-actions.pod:8162
28497 #: ../src/guestfs-actions.pod:8177 ../src/guestfs-actions.pod:8566
28498 msgid "(Added in 1.0.26)"
28502 #: ../src/guestfs-actions.pod:2376
28503 msgid "guestfs_get_attach_method"
28507 #: ../src/guestfs-actions.pod:2378
28511 " guestfs_get_attach_method (guestfs_h *g);\n"
28516 #: ../src/guestfs-actions.pod:2381
28517 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
28521 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:6810
28522 msgid "(Added in 1.9.8)"
28526 #: ../src/guestfs-actions.pod:2388
28527 msgid "guestfs_get_autosync"
28531 #: ../src/guestfs-actions.pod:2390
28535 " guestfs_get_autosync (guestfs_h *g);\n"
28540 #: ../src/guestfs-actions.pod:2399
28541 msgid "guestfs_get_direct"
28545 #: ../src/guestfs-actions.pod:2401
28549 " guestfs_get_direct (guestfs_h *g);\n"
28554 #: ../src/guestfs-actions.pod:2408 ../src/guestfs-actions.pod:6851
28555 msgid "(Added in 1.0.72)"
28559 #: ../src/guestfs-actions.pod:2410
28560 msgid "guestfs_get_e2label"
28564 #: ../src/guestfs-actions.pod:2412
28568 " guestfs_get_e2label (guestfs_h *g,\n"
28569 " const char *device);\n"
28574 #: ../src/guestfs-actions.pod:2416
28576 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
28581 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2450
28582 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6888
28583 msgid "(Added in 1.0.15)"
28587 #: ../src/guestfs-actions.pod:2431
28588 msgid "guestfs_get_e2uuid"
28592 #: ../src/guestfs-actions.pod:2433
28596 " guestfs_get_e2uuid (guestfs_h *g,\n"
28597 " const char *device);\n"
28602 #: ../src/guestfs-actions.pod:2437
28604 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
28609 #: ../src/guestfs-actions.pod:2452
28610 msgid "guestfs_get_memsize"
28614 #: ../src/guestfs-actions.pod:2454
28618 " guestfs_get_memsize (guestfs_h *g);\n"
28623 #: ../src/guestfs-actions.pod:2460
28625 "If C<guestfs_set_memsize> was not called on this handle, and if "
28626 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
28627 "value for memsize."
28631 #: ../src/guestfs-actions.pod:2469 ../src/guestfs-actions.pod:5197
28632 #: ../src/guestfs-actions.pod:5406 ../src/guestfs-actions.pod:5425
28633 #: ../src/guestfs-actions.pod:5444 ../src/guestfs-actions.pod:5456
28634 #: ../src/guestfs-actions.pod:5473 ../src/guestfs-actions.pod:5486
28635 #: ../src/guestfs-actions.pod:6526 ../src/guestfs-actions.pod:6909
28636 #: ../src/guestfs-actions.pod:7199 ../src/guestfs-actions.pod:7931
28637 msgid "(Added in 1.0.55)"
28641 #: ../src/guestfs-actions.pod:2471
28642 msgid "guestfs_get_network"
28646 #: ../src/guestfs-actions.pod:2473
28650 " guestfs_get_network (guestfs_h *g);\n"
28655 #: ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:6928
28656 msgid "(Added in 1.5.4)"
28660 #: ../src/guestfs-actions.pod:2482
28661 msgid "guestfs_get_path"
28665 #: ../src/guestfs-actions.pod:2484
28669 " guestfs_get_path (guestfs_h *g);\n"
28674 #: ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2532
28676 "This function returns a string, or NULL on error. The string is owned by "
28677 "the guest handle and must I<not> be freed."
28681 #: ../src/guestfs-actions.pod:2497
28682 msgid "guestfs_get_pgroup"
28686 #: ../src/guestfs-actions.pod:2499
28690 " guestfs_get_pgroup (guestfs_h *g);\n"
28695 #: ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:6964
28696 #: ../src/guestfs-actions.pod:8423
28697 msgid "(Added in 1.11.18)"
28701 #: ../src/guestfs-actions.pod:2508
28702 msgid "guestfs_get_pid"
28706 #: ../src/guestfs-actions.pod:2510
28710 " guestfs_get_pid (guestfs_h *g);\n"
28715 #: ../src/guestfs-actions.pod:2520
28716 msgid "(Added in 1.0.56)"
28720 #: ../src/guestfs-actions.pod:2522
28721 msgid "guestfs_get_qemu"
28725 #: ../src/guestfs-actions.pod:2524
28729 " guestfs_get_qemu (guestfs_h *g);\n"
28734 #: ../src/guestfs-actions.pod:2535 ../src/guestfs-actions.pod:6992
28735 msgid "(Added in 1.0.6)"
28739 #: ../src/guestfs-actions.pod:2537
28740 msgid "guestfs_get_recovery_proc"
28744 #: ../src/guestfs-actions.pod:2539
28748 " guestfs_get_recovery_proc (guestfs_h *g);\n"
28753 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:4130
28754 #: ../src/guestfs-actions.pod:4472 ../src/guestfs-actions.pod:4866
28755 #: ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:6231
28756 #: ../src/guestfs-actions.pod:6574 ../src/guestfs-actions.pod:7016
28757 #: ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7734
28758 #: ../src/guestfs-actions.pod:8046
28759 msgid "(Added in 1.0.77)"
28763 #: ../src/guestfs-actions.pod:2548
28764 msgid "guestfs_get_selinux"
28768 #: ../src/guestfs-actions.pod:2550
28772 " guestfs_get_selinux (guestfs_h *g);\n"
28777 #: ../src/guestfs-actions.pod:2553
28779 "This returns the current setting of the selinux flag which is passed to the "
28780 "appliance at boot time. See C<guestfs_set_selinux>."
28784 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2635
28785 #: ../src/guestfs-actions.pod:7035 ../src/guestfs-actions.pod:7109
28786 msgid "(Added in 1.0.67)"
28790 #: ../src/guestfs-actions.pod:2563
28791 msgid "guestfs_get_smp"
28795 #: ../src/guestfs-actions.pod:2565
28799 " guestfs_get_smp (guestfs_h *g);\n"
28804 #: ../src/guestfs-actions.pod:2574
28805 msgid "guestfs_get_state"
28809 #: ../src/guestfs-actions.pod:2576
28813 " guestfs_get_state (guestfs_h *g);\n"
28818 #: ../src/guestfs-actions.pod:2588
28819 msgid "guestfs_get_trace"
28823 #: ../src/guestfs-actions.pod:2590
28827 " guestfs_get_trace (guestfs_h *g);\n"
28832 #: ../src/guestfs-actions.pod:2599
28833 msgid "guestfs_get_umask"
28837 #: ../src/guestfs-actions.pod:2601
28841 " guestfs_get_umask (guestfs_h *g);\n"
28846 #: ../src/guestfs-actions.pod:2604
28848 "Return the current umask. By default the umask is C<022> unless it has been "
28849 "set by calling C<guestfs_umask>."
28853 #: ../src/guestfs-actions.pod:2611
28854 msgid "guestfs_get_verbose"
28858 #: ../src/guestfs-actions.pod:2613
28862 " guestfs_get_verbose (guestfs_h *g);\n"
28867 #: ../src/guestfs-actions.pod:2622
28868 msgid "guestfs_getcon"
28872 #: ../src/guestfs-actions.pod:2624
28876 " guestfs_getcon (guestfs_h *g);\n"
28881 #: ../src/guestfs-actions.pod:2629
28883 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
28887 #: ../src/guestfs-actions.pod:2637
28888 msgid "guestfs_getxattr"
28892 #: ../src/guestfs-actions.pod:2639
28896 " guestfs_getxattr (guestfs_h *g,\n"
28897 " const char *path,\n"
28898 " const char *name,\n"
28899 " size_t *size_r);\n"
28904 #: ../src/guestfs-actions.pod:2645
28906 "Get a single extended attribute from file C<path> named C<name>. This call "
28907 "follows symlinks. If you want to lookup an extended attribute for the "
28908 "symlink itself, use C<guestfs_lgetxattr>."
28912 #: ../src/guestfs-actions.pod:2649 ../src/guestfs-actions.pod:4144
28914 "Normally it is better to get all extended attributes from a file in one go "
28915 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
28916 "implementations are buggy and do not provide a way to list out attributes. "
28917 "For these filesystems (notably ntfs-3g) you have to know the names of the "
28918 "extended attributes you want in advance and call this function."
28922 #: ../src/guestfs-actions.pod:2659
28923 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
28927 #: ../src/guestfs-actions.pod:2661 ../src/guestfs-actions.pod:2874
28928 #: ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:4156
28929 #: ../src/guestfs-actions.pod:6224 ../src/guestfs-actions.pod:6250
28930 #: ../src/guestfs-actions.pod:6431
28932 "This function returns a buffer, or NULL on error. The size of the returned "
28933 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
28938 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:4160
28939 msgid "(Added in 1.7.24)"
28943 #: ../src/guestfs-actions.pod:2667
28944 msgid "guestfs_getxattrs"
28948 #: ../src/guestfs-actions.pod:2669
28951 " struct guestfs_xattr_list *\n"
28952 " guestfs_getxattrs (guestfs_h *g,\n"
28953 " const char *path);\n"
28958 #: ../src/guestfs-actions.pod:2679
28959 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
28963 #: ../src/guestfs-actions.pod:2681 ../src/guestfs-actions.pod:4172
28964 #: ../src/guestfs-actions.pod:4862
28966 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
28967 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
28971 #: ../src/guestfs-actions.pod:2685 ../src/guestfs-actions.pod:4176
28972 #: ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4422
28973 #: ../src/guestfs-actions.pod:6604 ../src/guestfs-actions.pod:7128
28974 #: ../src/guestfs-actions.pod:8631
28975 msgid "(Added in 1.0.59)"
28979 #: ../src/guestfs-actions.pod:2687
28980 msgid "guestfs_glob_expand"
28984 #: ../src/guestfs-actions.pod:2689
28988 " guestfs_glob_expand (guestfs_h *g,\n"
28989 " const char *pattern);\n"
28994 #: ../src/guestfs-actions.pod:2708 ../src/guestfs-actions.pod:7312
28995 #: ../src/guestfs-actions.pod:7329
28996 msgid "(Added in 1.0.50)"
29000 #: ../src/guestfs-actions.pod:2710
29001 msgid "guestfs_grep"
29005 #: ../src/guestfs-actions.pod:2712
29009 " guestfs_grep (guestfs_h *g,\n"
29010 " const char *regex,\n"
29011 " const char *path);\n"
29016 #: ../src/guestfs-actions.pod:2729
29017 msgid "guestfs_grepi"
29021 #: ../src/guestfs-actions.pod:2731
29025 " guestfs_grepi (guestfs_h *g,\n"
29026 " const char *regex,\n"
29027 " const char *path);\n"
29032 #: ../src/guestfs-actions.pod:2748
29033 msgid "guestfs_grub_install"
29037 #: ../src/guestfs-actions.pod:2750
29041 " guestfs_grub_install (guestfs_h *g,\n"
29042 " const char *root,\n"
29043 " const char *device);\n"
29048 #: ../src/guestfs-actions.pod:2793
29049 msgid "(Added in 1.0.17)"
29053 #: ../src/guestfs-actions.pod:2795
29054 msgid "guestfs_head"
29058 #: ../src/guestfs-actions.pod:2797
29062 " guestfs_head (guestfs_h *g,\n"
29063 " const char *path);\n"
29068 #: ../src/guestfs-actions.pod:2813
29069 msgid "guestfs_head_n"
29073 #: ../src/guestfs-actions.pod:2815
29077 " guestfs_head_n (guestfs_h *g,\n"
29079 " const char *path);\n"
29084 #: ../src/guestfs-actions.pod:2837
29085 msgid "guestfs_hexdump"
29089 #: ../src/guestfs-actions.pod:2839
29093 " guestfs_hexdump (guestfs_h *g,\n"
29094 " const char *path);\n"
29099 #: ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:7393
29100 #: ../src/guestfs-actions.pod:7448
29101 msgid "(Added in 1.0.22)"
29105 #: ../src/guestfs-actions.pod:2854
29106 msgid "guestfs_initrd_cat"
29110 #: ../src/guestfs-actions.pod:2856
29114 " guestfs_initrd_cat (guestfs_h *g,\n"
29115 " const char *initrdpath,\n"
29116 " const char *filename,\n"
29117 " size_t *size_r);\n"
29122 #: ../src/guestfs-actions.pod:2872
29123 msgid "See also C<guestfs_initrd_list>."
29127 #: ../src/guestfs-actions.pod:2883
29128 msgid "guestfs_initrd_list"
29132 #: ../src/guestfs-actions.pod:2885
29136 " guestfs_initrd_list (guestfs_h *g,\n"
29137 " const char *path);\n"
29142 #: ../src/guestfs-actions.pod:2905
29143 msgid "guestfs_inotify_add_watch"
29147 #: ../src/guestfs-actions.pod:2907
29151 " guestfs_inotify_add_watch (guestfs_h *g,\n"
29152 " const char *path,\n"
29158 #: ../src/guestfs-actions.pod:2926
29159 msgid "guestfs_inotify_close"
29163 #: ../src/guestfs-actions.pod:2928
29167 " guestfs_inotify_close (guestfs_h *g);\n"
29172 #: ../src/guestfs-actions.pod:2939
29173 msgid "guestfs_inotify_files"
29177 #: ../src/guestfs-actions.pod:2941
29181 " guestfs_inotify_files (guestfs_h *g);\n"
29186 #: ../src/guestfs-actions.pod:2944
29188 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
29189 "returns a list of pathnames of objects that were touched. The returned "
29190 "pathnames are sorted and deduplicated."
29194 #: ../src/guestfs-actions.pod:2954
29195 msgid "guestfs_inotify_init"
29199 #: ../src/guestfs-actions.pod:2956
29203 " guestfs_inotify_init (guestfs_h *g,\n"
29204 " int maxevents);\n"
29209 #: ../src/guestfs-actions.pod:2964
29211 "C<maxevents> is the maximum number of events which will be queued up between "
29212 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
29213 "passed as C<0>, then the kernel (or previously set) default is used. For "
29214 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
29215 "throws away events, but records the fact that it threw them away by setting "
29216 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
29217 "C<guestfs_inotify_read>)."
29221 #: ../src/guestfs-actions.pod:2974
29223 "Before any events are generated, you have to add some watches to the "
29224 "internal watch list. See: C<guestfs_inotify_add_watch>, "
29225 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
29229 #: ../src/guestfs-actions.pod:2980
29231 "Queued up events should be read periodically by calling "
29232 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
29233 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
29234 "often enough then you risk the internal queue overflowing."
29238 #: ../src/guestfs-actions.pod:2987
29240 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
29241 "This also removes any watches automatically."
29245 #: ../src/guestfs-actions.pod:3000
29246 msgid "guestfs_inotify_read"
29250 #: ../src/guestfs-actions.pod:3002
29253 " struct guestfs_inotify_event_list *\n"
29254 " guestfs_inotify_read (guestfs_h *g);\n"
29259 #: ../src/guestfs-actions.pod:3016
29261 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
29262 "there was an error. I<The caller must call "
29263 "C<guestfs_free_inotify_event_list> after use>."
29267 #: ../src/guestfs-actions.pod:3022
29268 msgid "guestfs_inotify_rm_watch"
29272 #: ../src/guestfs-actions.pod:3024
29276 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
29282 #: ../src/guestfs-actions.pod:3028
29284 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
29288 #: ../src/guestfs-actions.pod:3035
29289 msgid "guestfs_inspect_get_arch"
29293 #: ../src/guestfs-actions.pod:3037
29297 " guestfs_inspect_get_arch (guestfs_h *g,\n"
29298 " const char *root);\n"
29303 #: ../src/guestfs-actions.pod:3041
29305 "This returns the architecture of the inspected operating system. The "
29306 "possible return values are listed under C<guestfs_file_architecture>."
29310 #: ../src/guestfs-actions.pod:3055
29311 msgid "guestfs_inspect_get_distro"
29315 #: ../src/guestfs-actions.pod:3057
29319 " guestfs_inspect_get_distro (guestfs_h *g,\n"
29320 " const char *root);\n"
29325 #: ../src/guestfs-actions.pod:3157
29326 msgid "guestfs_inspect_get_drive_mappings"
29330 #: ../src/guestfs-actions.pod:3159
29334 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
29335 " const char *root);\n"
29340 #: ../src/guestfs-actions.pod:3188
29342 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
29343 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
29347 #: ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3460
29348 #: ../src/guestfs-actions.pod:4263 ../src/guestfs-actions.pod:5000
29349 #: ../src/guestfs-actions.pod:5675 ../src/guestfs-actions.pod:7870
29351 "This function returns a NULL-terminated array of strings, or NULL if there "
29352 "was an error. The array of strings will always have length C<2n+1>, where "
29353 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
29354 "caller must free the strings and the array after use>."
29358 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3659
29359 msgid "(Added in 1.9.17)"
29363 #: ../src/guestfs-actions.pod:3200
29364 msgid "guestfs_inspect_get_filesystems"
29368 #: ../src/guestfs-actions.pod:3202
29372 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
29373 " const char *root);\n"
29378 #: ../src/guestfs-actions.pod:3214
29380 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
29381 "C<guestfs_inspect_get_mountpoints>."
29385 #: ../src/guestfs-actions.pod:3223
29386 msgid "guestfs_inspect_get_format"
29390 #: ../src/guestfs-actions.pod:3225
29394 " guestfs_inspect_get_format (guestfs_h *g,\n"
29395 " const char *root);\n"
29400 #: ../src/guestfs-actions.pod:3259 ../src/guestfs-actions.pod:3695
29401 #: ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3729
29402 #: ../src/guestfs-actions.pod:6642
29403 msgid "(Added in 1.9.4)"
29407 #: ../src/guestfs-actions.pod:3261
29408 msgid "guestfs_inspect_get_hostname"
29412 #: ../src/guestfs-actions.pod:3263
29416 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
29417 " const char *root);\n"
29422 #: ../src/guestfs-actions.pod:3278
29423 msgid "(Added in 1.7.9)"
29427 #: ../src/guestfs-actions.pod:3280
29428 msgid "guestfs_inspect_get_icon"
29432 #: ../src/guestfs-actions.pod:3282
29436 " guestfs_inspect_get_icon (guestfs_h *g,\n"
29437 " const char *root,\n"
29438 " size_t *size_r,\n"
29444 #: ../src/guestfs-actions.pod:3293
29447 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
29448 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
29453 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:4190
29454 #: ../src/guestfs-actions.pod:5574
29455 msgid "(Added in 1.11.12)"
29459 #: ../src/guestfs-actions.pod:3362
29460 msgid "guestfs_inspect_get_icon_va"
29464 #: ../src/guestfs-actions.pod:3364
29468 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
29469 " const char *root,\n"
29470 " size_t *size_r,\n"
29471 " va_list args);\n"
29476 #: ../src/guestfs-actions.pod:3370
29477 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
29481 #: ../src/guestfs-actions.pod:3374
29482 msgid "guestfs_inspect_get_icon_argv"
29486 #: ../src/guestfs-actions.pod:3376
29490 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
29491 " const char *root,\n"
29492 " size_t *size_r,\n"
29493 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
29498 #: ../src/guestfs-actions.pod:3382
29499 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
29503 #: ../src/guestfs-actions.pod:3386
29504 msgid "guestfs_inspect_get_major_version"
29508 #: ../src/guestfs-actions.pod:3388
29512 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
29513 " const char *root);\n"
29518 #: ../src/guestfs-actions.pod:3410
29519 msgid "guestfs_inspect_get_minor_version"
29523 #: ../src/guestfs-actions.pod:3412
29527 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
29528 " const char *root);\n"
29533 #: ../src/guestfs-actions.pod:3421
29535 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
29536 "C<guestfs_inspect_get_major_version>."
29540 #: ../src/guestfs-actions.pod:3428
29541 msgid "guestfs_inspect_get_mountpoints"
29545 #: ../src/guestfs-actions.pod:3430
29549 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
29550 " const char *root);\n"
29555 #: ../src/guestfs-actions.pod:3451
29557 "For operating systems like Windows which still use drive letters, this call "
29558 "will only return an entry for the first drive \"mounted on\" C</>. For "
29559 "information about the mapping of drive letters to partitions, see "
29560 "C<guestfs_inspect_get_drive_mappings>."
29564 #: ../src/guestfs-actions.pod:3457
29566 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
29567 "C<guestfs_inspect_get_filesystems>."
29571 #: ../src/guestfs-actions.pod:3468
29572 msgid "guestfs_inspect_get_package_format"
29576 #: ../src/guestfs-actions.pod:3470
29580 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
29581 " const char *root);\n"
29586 #: ../src/guestfs-actions.pod:3474
29588 "This function and C<guestfs_inspect_get_package_management> return the "
29589 "package format and package management tool used by the inspected operating "
29590 "system. For example for Fedora these functions would return C<rpm> (package "
29591 "format) and C<yum> (package management)."
29595 #: ../src/guestfs-actions.pod:3493 ../src/guestfs-actions.pod:3521
29596 msgid "(Added in 1.7.5)"
29600 #: ../src/guestfs-actions.pod:3495
29601 msgid "guestfs_inspect_get_package_management"
29605 #: ../src/guestfs-actions.pod:3497
29609 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
29610 " const char *root);\n"
29615 #: ../src/guestfs-actions.pod:3501
29617 "C<guestfs_inspect_get_package_format> and this function return the package "
29618 "format and package management tool used by the inspected operating system. "
29619 "For example for Fedora these functions would return C<rpm> (package format) "
29620 "and C<yum> (package management)."
29624 #: ../src/guestfs-actions.pod:3523
29625 msgid "guestfs_inspect_get_product_name"
29629 #: ../src/guestfs-actions.pod:3525
29633 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
29634 " const char *root);\n"
29639 #: ../src/guestfs-actions.pod:3544
29640 msgid "guestfs_inspect_get_product_variant"
29644 #: ../src/guestfs-actions.pod:3546
29648 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
29649 " const char *root);\n"
29654 #: ../src/guestfs-actions.pod:3569
29656 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
29657 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
29661 #: ../src/guestfs-actions.pod:3576
29662 msgid "(Added in 1.9.13)"
29666 #: ../src/guestfs-actions.pod:3578
29667 msgid "guestfs_inspect_get_roots"
29671 #: ../src/guestfs-actions.pod:3580
29675 " guestfs_inspect_get_roots (guestfs_h *g);\n"
29680 #: ../src/guestfs-actions.pod:3583
29682 "This function is a convenient way to get the list of root devices, as "
29683 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
29684 "the whole inspection process."
29688 #: ../src/guestfs-actions.pod:3587
29690 "This returns an empty list if either no root devices were found or the "
29691 "caller has not called C<guestfs_inspect_os>."
29695 #: ../src/guestfs-actions.pod:3596
29696 msgid "(Added in 1.7.3)"
29700 #: ../src/guestfs-actions.pod:3598
29701 msgid "guestfs_inspect_get_type"
29705 #: ../src/guestfs-actions.pod:3600
29709 " guestfs_inspect_get_type (guestfs_h *g,\n"
29710 " const char *root);\n"
29715 #: ../src/guestfs-actions.pod:3641
29716 msgid "guestfs_inspect_get_windows_current_control_set"
29720 #: ../src/guestfs-actions.pod:3643
29724 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
29725 " const char *root);\n"
29730 #: ../src/guestfs-actions.pod:3661
29731 msgid "guestfs_inspect_get_windows_systemroot"
29735 #: ../src/guestfs-actions.pod:3663
29739 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
29740 " const char *root);\n"
29745 #: ../src/guestfs-actions.pod:3679
29746 msgid "(Added in 1.5.25)"
29750 #: ../src/guestfs-actions.pod:3681
29751 msgid "guestfs_inspect_is_live"
29755 #: ../src/guestfs-actions.pod:3683
29759 " guestfs_inspect_is_live (guestfs_h *g,\n"
29760 " const char *root);\n"
29765 #: ../src/guestfs-actions.pod:3687
29767 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29768 "disk), then this returns true if a live image was detected on the disk."
29772 #: ../src/guestfs-actions.pod:3697
29773 msgid "guestfs_inspect_is_multipart"
29777 #: ../src/guestfs-actions.pod:3699
29781 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
29782 " const char *root);\n"
29787 #: ../src/guestfs-actions.pod:3703
29789 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29790 "disk), then this returns true if the disk is part of a set."
29794 #: ../src/guestfs-actions.pod:3713
29795 msgid "guestfs_inspect_is_netinst"
29799 #: ../src/guestfs-actions.pod:3715
29803 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
29804 " const char *root);\n"
29809 #: ../src/guestfs-actions.pod:3719
29811 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29812 "disk), then this returns true if the disk is a network installer, ie. not a "
29813 "self-contained install CD but one which is likely to require network access "
29814 "to complete the install."
29818 #: ../src/guestfs-actions.pod:3731
29819 msgid "guestfs_inspect_list_applications"
29823 #: ../src/guestfs-actions.pod:3733
29826 " struct guestfs_application_list *\n"
29827 " guestfs_inspect_list_applications (guestfs_h *g,\n"
29828 " const char *root);\n"
29833 #: ../src/guestfs-actions.pod:3739
29835 "I<Note:> This call works differently from other parts of the inspection "
29836 "API. You have to call C<guestfs_inspect_os>, then "
29837 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
29838 "this. Listing applications is a significantly more difficult operation "
29839 "which requires access to the full filesystem. Also note that unlike the "
29840 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
29841 "the libguestfs handle, this call actually reads parts of the mounted "
29842 "filesystems during the call."
29846 #: ../src/guestfs-actions.pod:3829
29848 "This function returns a C<struct guestfs_application_list *>, or NULL if "
29849 "there was an error. I<The caller must call C<guestfs_free_application_list> "
29854 #: ../src/guestfs-actions.pod:3833
29855 msgid "(Added in 1.7.8)"
29859 #: ../src/guestfs-actions.pod:3835
29860 msgid "guestfs_inspect_os"
29864 #: ../src/guestfs-actions.pod:3837
29868 " guestfs_inspect_os (guestfs_h *g);\n"
29873 #: ../src/guestfs-actions.pod:3853
29875 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
29876 "functions in order to query further information about each operating system, "
29877 "such as the name and version."
29881 #: ../src/guestfs-actions.pod:3858
29883 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
29884 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
29885 "the contents. This should be called with no disks currently mounted. The "
29886 "function may also use Augeas, so any existing Augeas handle will be closed."
29890 #: ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:4201
29891 #: ../src/guestfs-actions.pod:4294
29892 msgid "See also C<guestfs_list_filesystems>."
29896 #: ../src/guestfs-actions.pod:3878
29897 msgid "guestfs_is_blockdev"
29901 #: ../src/guestfs-actions.pod:3880
29905 " guestfs_is_blockdev (guestfs_h *g,\n"
29906 " const char *path);\n"
29911 #: ../src/guestfs-actions.pod:3887 ../src/guestfs-actions.pod:3916
29912 #: ../src/guestfs-actions.pod:3946 ../src/guestfs-actions.pod:3961
29913 #: ../src/guestfs-actions.pod:3977 ../src/guestfs-actions.pod:4033
29914 #: ../src/guestfs-actions.pod:4048
29915 msgid "See also C<guestfs_stat>."
29919 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3920
29920 #: ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:4037
29921 #: ../src/guestfs-actions.pod:4052
29922 msgid "(Added in 1.5.10)"
29926 #: ../src/guestfs-actions.pod:3893
29927 msgid "guestfs_is_busy"
29931 #: ../src/guestfs-actions.pod:3895
29935 " guestfs_is_busy (guestfs_h *g);\n"
29940 #: ../src/guestfs-actions.pod:3907
29941 msgid "guestfs_is_chardev"
29945 #: ../src/guestfs-actions.pod:3909
29949 " guestfs_is_chardev (guestfs_h *g,\n"
29950 " const char *path);\n"
29955 #: ../src/guestfs-actions.pod:3922
29956 msgid "guestfs_is_config"
29960 #: ../src/guestfs-actions.pod:3924
29964 " guestfs_is_config (guestfs_h *g);\n"
29969 #: ../src/guestfs-actions.pod:3936
29970 msgid "guestfs_is_dir"
29974 #: ../src/guestfs-actions.pod:3938
29978 " guestfs_is_dir (guestfs_h *g,\n"
29979 " const char *path);\n"
29984 #: ../src/guestfs-actions.pod:3952
29985 msgid "guestfs_is_fifo"
29989 #: ../src/guestfs-actions.pod:3954
29993 " guestfs_is_fifo (guestfs_h *g,\n"
29994 " const char *path);\n"
29999 #: ../src/guestfs-actions.pod:3967
30000 msgid "guestfs_is_file"
30004 #: ../src/guestfs-actions.pod:3969
30008 " guestfs_is_file (guestfs_h *g,\n"
30009 " const char *path);\n"
30014 #: ../src/guestfs-actions.pod:3983
30015 msgid "guestfs_is_launching"
30019 #: ../src/guestfs-actions.pod:3985
30023 " guestfs_is_launching (guestfs_h *g);\n"
30028 #: ../src/guestfs-actions.pod:3997
30029 msgid "guestfs_is_lv"
30033 #: ../src/guestfs-actions.pod:3999
30037 " guestfs_is_lv (guestfs_h *g,\n"
30038 " const char *device);\n"
30043 #: ../src/guestfs-actions.pod:4010
30044 msgid "guestfs_is_ready"
30048 #: ../src/guestfs-actions.pod:4012
30052 " guestfs_is_ready (guestfs_h *g);\n"
30057 #: ../src/guestfs-actions.pod:4024
30058 msgid "guestfs_is_socket"
30062 #: ../src/guestfs-actions.pod:4026
30066 " guestfs_is_socket (guestfs_h *g,\n"
30067 " const char *path);\n"
30072 #: ../src/guestfs-actions.pod:4039
30073 msgid "guestfs_is_symlink"
30077 #: ../src/guestfs-actions.pod:4041
30081 " guestfs_is_symlink (guestfs_h *g,\n"
30082 " const char *path);\n"
30087 #: ../src/guestfs-actions.pod:4054
30088 msgid "guestfs_is_zero"
30092 #: ../src/guestfs-actions.pod:4056
30096 " guestfs_is_zero (guestfs_h *g,\n"
30097 " const char *path);\n"
30102 #: ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:4079
30103 msgid "(Added in 1.11.8)"
30107 #: ../src/guestfs-actions.pod:4067
30108 msgid "guestfs_is_zero_device"
30112 #: ../src/guestfs-actions.pod:4069
30116 " guestfs_is_zero_device (guestfs_h *g,\n"
30117 " const char *device);\n"
30122 #: ../src/guestfs-actions.pod:4081
30123 msgid "guestfs_kill_subprocess"
30127 #: ../src/guestfs-actions.pod:4083
30131 " guestfs_kill_subprocess (guestfs_h *g);\n"
30136 #: ../src/guestfs-actions.pod:4092
30137 msgid "guestfs_launch"
30141 #: ../src/guestfs-actions.pod:4094
30145 " guestfs_launch (guestfs_h *g);\n"
30150 #: ../src/guestfs-actions.pod:4112
30151 msgid "guestfs_lchown"
30155 #: ../src/guestfs-actions.pod:4114
30159 " guestfs_lchown (guestfs_h *g,\n"
30162 " const char *path);\n"
30167 #: ../src/guestfs-actions.pod:4120
30169 "Change the file owner to C<owner> and group to C<group>. This is like "
30170 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
30171 "changed, not the target."
30175 #: ../src/guestfs-actions.pod:4132
30176 msgid "guestfs_lgetxattr"
30180 #: ../src/guestfs-actions.pod:4134
30184 " guestfs_lgetxattr (guestfs_h *g,\n"
30185 " const char *path,\n"
30186 " const char *name,\n"
30187 " size_t *size_r);\n"
30192 #: ../src/guestfs-actions.pod:4154
30193 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
30197 #: ../src/guestfs-actions.pod:4162
30198 msgid "guestfs_lgetxattrs"
30202 #: ../src/guestfs-actions.pod:4164
30205 " struct guestfs_xattr_list *\n"
30206 " guestfs_lgetxattrs (guestfs_h *g,\n"
30207 " const char *path);\n"
30212 #: ../src/guestfs-actions.pod:4168
30214 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
30215 "then it returns the extended attributes of the link itself."
30219 #: ../src/guestfs-actions.pod:4178
30220 msgid "guestfs_list_9p"
30224 #: ../src/guestfs-actions.pod:4180
30228 " guestfs_list_9p (guestfs_h *g);\n"
30233 #: ../src/guestfs-actions.pod:4192
30234 msgid "guestfs_list_devices"
30238 #: ../src/guestfs-actions.pod:4194
30242 " guestfs_list_devices (guestfs_h *g);\n"
30247 #: ../src/guestfs-actions.pod:4209
30248 msgid "guestfs_list_dm_devices"
30252 #: ../src/guestfs-actions.pod:4211
30256 " guestfs_list_dm_devices (guestfs_h *g);\n"
30261 #: ../src/guestfs-actions.pod:4216
30263 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
30264 "previous call to C<guestfs_luks_open>."
30268 #: ../src/guestfs-actions.pod:4219
30270 "Device mapper devices which correspond to logical volumes are I<not> "
30271 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
30276 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:5813
30277 msgid "(Added in 1.11.15)"
30281 #: ../src/guestfs-actions.pod:4229
30282 msgid "guestfs_list_filesystems"
30286 #: ../src/guestfs-actions.pod:4231
30290 " guestfs_list_filesystems (guestfs_h *g);\n"
30295 #: ../src/guestfs-actions.pod:4251
30297 "This command runs other libguestfs commands, which might include "
30298 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
30299 "soon after launch and only when nothing is mounted."
30303 #: ../src/guestfs-actions.pod:4255
30305 "Not all of the filesystems returned will be mountable. In particular, swap "
30306 "partitions are returned in the list. Also this command does not check that "
30307 "each filesystem found is valid and mountable, and some filesystems might be "
30308 "mountable but require special options. Filesystems may not all belong to a "
30309 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
30313 #: ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:6173
30314 msgid "(Added in 1.5.15)"
30318 #: ../src/guestfs-actions.pod:4271
30319 msgid "guestfs_list_md_devices"
30323 #: ../src/guestfs-actions.pod:4273
30327 " guestfs_list_md_devices (guestfs_h *g);\n"
30332 #: ../src/guestfs-actions.pod:4282
30333 msgid "guestfs_list_partitions"
30337 #: ../src/guestfs-actions.pod:4284
30341 " guestfs_list_partitions (guestfs_h *g);\n"
30346 #: ../src/guestfs-actions.pod:4291
30348 "This does not return logical volumes. For that you will need to call "
30353 #: ../src/guestfs-actions.pod:4302
30358 #: ../src/guestfs-actions.pod:4304
30362 " guestfs_ll (guestfs_h *g,\n"
30363 " const char *directory);\n"
30368 #: ../src/guestfs-actions.pod:4319
30373 #: ../src/guestfs-actions.pod:4321
30377 " guestfs_ln (guestfs_h *g,\n"
30378 " const char *target,\n"
30379 " const char *linkname);\n"
30384 #: ../src/guestfs-actions.pod:4332
30385 msgid "guestfs_ln_f"
30389 #: ../src/guestfs-actions.pod:4334
30393 " guestfs_ln_f (guestfs_h *g,\n"
30394 " const char *target,\n"
30395 " const char *linkname);\n"
30400 #: ../src/guestfs-actions.pod:4346
30401 msgid "guestfs_ln_s"
30405 #: ../src/guestfs-actions.pod:4348
30409 " guestfs_ln_s (guestfs_h *g,\n"
30410 " const char *target,\n"
30411 " const char *linkname);\n"
30416 #: ../src/guestfs-actions.pod:4359
30417 msgid "guestfs_ln_sf"
30421 #: ../src/guestfs-actions.pod:4361
30425 " guestfs_ln_sf (guestfs_h *g,\n"
30426 " const char *target,\n"
30427 " const char *linkname);\n"
30432 #: ../src/guestfs-actions.pod:4373
30433 msgid "guestfs_lremovexattr"
30437 #: ../src/guestfs-actions.pod:4375
30441 " guestfs_lremovexattr (guestfs_h *g,\n"
30442 " const char *xattr,\n"
30443 " const char *path);\n"
30448 #: ../src/guestfs-actions.pod:4380
30450 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
30451 "link, then it removes an extended attribute of the link itself."
30455 #: ../src/guestfs-actions.pod:4388
30460 #: ../src/guestfs-actions.pod:4390
30464 " guestfs_ls (guestfs_h *g,\n"
30465 " const char *directory);\n"
30470 #: ../src/guestfs-actions.pod:4398
30472 "This command is mostly useful for interactive sessions. Programs should "
30473 "probably use C<guestfs_readdir> instead."
30477 #: ../src/guestfs-actions.pod:4407
30478 msgid "guestfs_lsetxattr"
30482 #: ../src/guestfs-actions.pod:4409
30486 " guestfs_lsetxattr (guestfs_h *g,\n"
30487 " const char *xattr,\n"
30488 " const char *val,\n"
30490 " const char *path);\n"
30495 #: ../src/guestfs-actions.pod:4416
30497 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
30498 "then it sets an extended attribute of the link itself."
30502 #: ../src/guestfs-actions.pod:4424
30503 msgid "guestfs_lstat"
30507 #: ../src/guestfs-actions.pod:4426
30510 " struct guestfs_stat *\n"
30511 " guestfs_lstat (guestfs_h *g,\n"
30512 " const char *path);\n"
30517 #: ../src/guestfs-actions.pod:4432
30519 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
30520 "link, then the link is stat-ed, not the file it refers to."
30524 #: ../src/guestfs-actions.pod:4438 ../src/guestfs-actions.pod:7353
30526 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
30527 "error. I<The caller must call C<guestfs_free_stat> after use>."
30531 #: ../src/guestfs-actions.pod:4442 ../src/guestfs-actions.pod:7357
30532 #: ../src/guestfs-actions.pod:7375 ../src/guestfs-actions.pod:7876
30533 msgid "(Added in 0.9.2)"
30537 #: ../src/guestfs-actions.pod:4444
30538 msgid "guestfs_lstatlist"
30542 #: ../src/guestfs-actions.pod:4446
30545 " struct guestfs_stat_list *\n"
30546 " guestfs_lstatlist (guestfs_h *g,\n"
30547 " const char *path,\n"
30548 " char *const *names);\n"
30553 #: ../src/guestfs-actions.pod:4451
30555 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
30556 "files, where all files are in the directory C<path>. C<names> is the list "
30557 "of files from this directory."
30561 #: ../src/guestfs-actions.pod:4460
30563 "This call is intended for programs that want to efficiently list a directory "
30564 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
30565 "for a similarly efficient call for getting extended attributes. Very long "
30566 "directory listings might cause the protocol message size to be exceeded, "
30567 "causing this call to fail. The caller must split up such requests into "
30568 "smaller groups of names."
30572 #: ../src/guestfs-actions.pod:4468
30574 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
30575 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
30579 #: ../src/guestfs-actions.pod:4474
30580 msgid "guestfs_luks_add_key"
30584 #: ../src/guestfs-actions.pod:4476
30588 " guestfs_luks_add_key (guestfs_h *g,\n"
30589 " const char *device,\n"
30590 " const char *key,\n"
30591 " const char *newkey,\n"
30597 #: ../src/guestfs-actions.pod:4488
30599 "Note that if C<keyslot> already contains a key, then this command will "
30600 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
30604 #: ../src/guestfs-actions.pod:4494 ../src/guestfs-actions.pod:4531
30605 #: ../src/guestfs-actions.pod:4551 ../src/guestfs-actions.pod:4571
30606 #: ../src/guestfs-actions.pod:4606 ../src/guestfs-actions.pod:4625
30608 "This function takes a key or passphrase parameter which could contain "
30609 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
30614 #: ../src/guestfs-actions.pod:4498 ../src/guestfs-actions.pod:4535
30615 #: ../src/guestfs-actions.pod:4555 ../src/guestfs-actions.pod:4575
30616 msgid "(Added in 1.5.2)"
30620 #: ../src/guestfs-actions.pod:4500
30621 msgid "guestfs_luks_close"
30625 #: ../src/guestfs-actions.pod:4502
30629 " guestfs_luks_close (guestfs_h *g,\n"
30630 " const char *device);\n"
30635 #: ../src/guestfs-actions.pod:4506
30637 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
30638 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
30639 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
30640 "underlying block device."
30644 #: ../src/guestfs-actions.pod:4514 ../src/guestfs-actions.pod:4610
30645 #: ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4679
30646 #: ../src/guestfs-actions.pod:4724
30647 msgid "(Added in 1.5.1)"
30651 #: ../src/guestfs-actions.pod:4516
30652 msgid "guestfs_luks_format"
30656 #: ../src/guestfs-actions.pod:4518
30660 " guestfs_luks_format (guestfs_h *g,\n"
30661 " const char *device,\n"
30662 " const char *key,\n"
30668 #: ../src/guestfs-actions.pod:4537
30669 msgid "guestfs_luks_format_cipher"
30673 #: ../src/guestfs-actions.pod:4539
30677 " guestfs_luks_format_cipher (guestfs_h *g,\n"
30678 " const char *device,\n"
30679 " const char *key,\n"
30681 " const char *cipher);\n"
30686 #: ../src/guestfs-actions.pod:4546
30688 "This command is the same as C<guestfs_luks_format> but it also allows you to "
30689 "set the C<cipher> used."
30693 #: ../src/guestfs-actions.pod:4557
30694 msgid "guestfs_luks_kill_slot"
30698 #: ../src/guestfs-actions.pod:4559
30702 " guestfs_luks_kill_slot (guestfs_h *g,\n"
30703 " const char *device,\n"
30704 " const char *key,\n"
30710 #: ../src/guestfs-actions.pod:4577
30711 msgid "guestfs_luks_open"
30715 #: ../src/guestfs-actions.pod:4579
30719 " guestfs_luks_open (guestfs_h *g,\n"
30720 " const char *device,\n"
30721 " const char *key,\n"
30722 " const char *mapname);\n"
30727 #: ../src/guestfs-actions.pod:4597
30729 "If this block device contains LVM volume groups, then calling "
30730 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
30735 #: ../src/guestfs-actions.pod:4601
30736 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
30740 #: ../src/guestfs-actions.pod:4612
30741 msgid "guestfs_luks_open_ro"
30745 #: ../src/guestfs-actions.pod:4614
30749 " guestfs_luks_open_ro (guestfs_h *g,\n"
30750 " const char *device,\n"
30751 " const char *key,\n"
30752 " const char *mapname);\n"
30757 #: ../src/guestfs-actions.pod:4620
30759 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
30764 #: ../src/guestfs-actions.pod:4631
30765 msgid "guestfs_lvcreate"
30769 #: ../src/guestfs-actions.pod:4633
30773 " guestfs_lvcreate (guestfs_h *g,\n"
30774 " const char *logvol,\n"
30775 " const char *volgroup,\n"
30781 #: ../src/guestfs-actions.pod:4646
30782 msgid "guestfs_lvm_canonical_lv_name"
30786 #: ../src/guestfs-actions.pod:4648
30790 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
30791 " const char *lvname);\n"
30796 #: ../src/guestfs-actions.pod:4659
30797 msgid "See also C<guestfs_is_lv>."
30801 #: ../src/guestfs-actions.pod:4664
30802 msgid "(Added in 1.5.24)"
30806 #: ../src/guestfs-actions.pod:4666
30807 msgid "guestfs_lvm_clear_filter"
30811 #: ../src/guestfs-actions.pod:4668
30815 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
30820 #: ../src/guestfs-actions.pod:4671
30822 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
30823 "see every block device."
30827 #: ../src/guestfs-actions.pod:4681
30828 msgid "guestfs_lvm_remove_all"
30832 #: ../src/guestfs-actions.pod:4683
30836 " guestfs_lvm_remove_all (guestfs_h *g);\n"
30841 #: ../src/guestfs-actions.pod:4693
30842 msgid "guestfs_lvm_set_filter"
30846 #: ../src/guestfs-actions.pod:4695
30850 " guestfs_lvm_set_filter (guestfs_h *g,\n"
30851 " char *const *devices);\n"
30856 #: ../src/guestfs-actions.pod:4726
30857 msgid "guestfs_lvremove"
30861 #: ../src/guestfs-actions.pod:4728
30865 " guestfs_lvremove (guestfs_h *g,\n"
30866 " const char *device);\n"
30871 #: ../src/guestfs-actions.pod:4740 ../src/guestfs-actions.pod:6288
30872 #: ../src/guestfs-actions.pod:8246
30873 msgid "(Added in 1.0.13)"
30877 #: ../src/guestfs-actions.pod:4742
30878 msgid "guestfs_lvrename"
30882 #: ../src/guestfs-actions.pod:4744
30886 " guestfs_lvrename (guestfs_h *g,\n"
30887 " const char *logvol,\n"
30888 " const char *newlogvol);\n"
30893 #: ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:8259
30894 msgid "(Added in 1.0.83)"
30898 #: ../src/guestfs-actions.pod:4755
30899 msgid "guestfs_lvresize"
30903 #: ../src/guestfs-actions.pod:4757
30907 " guestfs_lvresize (guestfs_h *g,\n"
30908 " const char *device,\n"
30914 #: ../src/guestfs-actions.pod:4770
30915 msgid "guestfs_lvresize_free"
30919 #: ../src/guestfs-actions.pod:4772
30923 " guestfs_lvresize_free (guestfs_h *g,\n"
30924 " const char *lv,\n"
30930 #: ../src/guestfs-actions.pod:4785
30931 msgid "(Added in 1.3.3)"
30935 #: ../src/guestfs-actions.pod:4787
30936 msgid "guestfs_lvs"
30940 #: ../src/guestfs-actions.pod:4789
30944 " guestfs_lvs (guestfs_h *g);\n"
30949 #: ../src/guestfs-actions.pod:4798
30950 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
30954 #: ../src/guestfs-actions.pod:4806
30955 msgid "guestfs_lvs_full"
30959 #: ../src/guestfs-actions.pod:4808
30962 " struct guestfs_lvm_lv_list *\n"
30963 " guestfs_lvs_full (guestfs_h *g);\n"
30968 #: ../src/guestfs-actions.pod:4814
30970 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
30971 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
30975 #: ../src/guestfs-actions.pod:4820
30976 msgid "guestfs_lvuuid"
30980 #: ../src/guestfs-actions.pod:4822
30984 " guestfs_lvuuid (guestfs_h *g,\n"
30985 " const char *device);\n"
30990 #: ../src/guestfs-actions.pod:4833
30991 msgid "guestfs_lxattrlist"
30995 #: ../src/guestfs-actions.pod:4835
30998 " struct guestfs_xattr_list *\n"
30999 " guestfs_lxattrlist (guestfs_h *g,\n"
31000 " const char *path,\n"
31001 " char *const *names);\n"
31006 #: ../src/guestfs-actions.pod:4854
31008 "This call is intended for programs that want to efficiently list a directory "
31009 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
31010 "a similarly efficient call for getting standard stats. Very long directory "
31011 "listings might cause the protocol message size to be exceeded, causing this "
31012 "call to fail. The caller must split up such requests into smaller groups of "
31017 #: ../src/guestfs-actions.pod:4868
31018 msgid "guestfs_mdadm_create"
31022 #: ../src/guestfs-actions.pod:4870
31026 " guestfs_mdadm_create (guestfs_h *g,\n"
31027 " const char *name,\n"
31028 " char *const *devices,\n"
31034 #: ../src/guestfs-actions.pod:4881
31037 " GUESTFS_MDADM_CREATE_MISSINGBITMAP, int64_t missingbitmap,\n"
31038 " GUESTFS_MDADM_CREATE_NRDEVICES, int nrdevices,\n"
31039 " GUESTFS_MDADM_CREATE_SPARE, int spare,\n"
31040 " GUESTFS_MDADM_CREATE_CHUNK, int64_t chunk,\n"
31041 " GUESTFS_MDADM_CREATE_LEVEL, const char *level,\n"
31046 #: ../src/guestfs-actions.pod:4943
31047 msgid "guestfs_mdadm_create_va"
31051 #: ../src/guestfs-actions.pod:4945
31055 " guestfs_mdadm_create_va (guestfs_h *g,\n"
31056 " const char *name,\n"
31057 " char *const *devices,\n"
31058 " va_list args);\n"
31063 #: ../src/guestfs-actions.pod:4951
31064 msgid "This is the \"va_list variant\" of L</guestfs_mdadm_create>."
31068 #: ../src/guestfs-actions.pod:4955
31069 msgid "guestfs_mdadm_create_argv"
31073 #: ../src/guestfs-actions.pod:4957
31077 " guestfs_mdadm_create_argv (guestfs_h *g,\n"
31078 " const char *name,\n"
31079 " char *const *devices,\n"
31080 " const struct guestfs_mdadm_create_argv *optargs);\n"
31085 #: ../src/guestfs-actions.pod:4963
31086 msgid "This is the \"argv variant\" of L</guestfs_mdadm_create>."
31090 #: ../src/guestfs-actions.pod:4967
31091 msgid "guestfs_mdadm_detail"
31095 #: ../src/guestfs-actions.pod:4969
31099 " guestfs_mdadm_detail (guestfs_h *g,\n"
31100 " const char *md);\n"
31105 #: ../src/guestfs-actions.pod:5006
31106 msgid "guestfs_mkdir"
31110 #: ../src/guestfs-actions.pod:5008
31114 " guestfs_mkdir (guestfs_h *g,\n"
31115 " const char *path);\n"
31120 #: ../src/guestfs-actions.pod:5018
31121 msgid "guestfs_mkdir_mode"
31125 #: ../src/guestfs-actions.pod:5020
31129 " guestfs_mkdir_mode (guestfs_h *g,\n"
31130 " const char *path,\n"
31136 #: ../src/guestfs-actions.pod:5032
31137 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
31141 #: ../src/guestfs-actions.pod:5038
31142 msgid "guestfs_mkdir_p"
31146 #: ../src/guestfs-actions.pod:5040
31150 " guestfs_mkdir_p (guestfs_h *g,\n"
31151 " const char *path);\n"
31156 #: ../src/guestfs-actions.pod:5051
31157 msgid "guestfs_mkdtemp"
31161 #: ../src/guestfs-actions.pod:5053
31165 " guestfs_mkdtemp (guestfs_h *g,\n"
31166 " const char *template);\n"
31171 #: ../src/guestfs-actions.pod:5081
31172 msgid "guestfs_mke2fs_J"
31176 #: ../src/guestfs-actions.pod:5083
31180 " guestfs_mke2fs_J (guestfs_h *g,\n"
31181 " const char *fstype,\n"
31182 " int blocksize,\n"
31183 " const char *device,\n"
31184 " const char *journal);\n"
31189 #: ../src/guestfs-actions.pod:5096
31190 msgid "See also C<guestfs_mke2journal>."
31194 #: ../src/guestfs-actions.pod:5100 ../src/guestfs-actions.pod:5118
31195 #: ../src/guestfs-actions.pod:5136 ../src/guestfs-actions.pod:5152
31196 #: ../src/guestfs-actions.pod:5166 ../src/guestfs-actions.pod:5180
31197 #: ../src/guestfs-actions.pod:5239 ../src/guestfs-actions.pod:5516
31198 msgid "(Added in 1.0.68)"
31202 #: ../src/guestfs-actions.pod:5102
31203 msgid "guestfs_mke2fs_JL"
31207 #: ../src/guestfs-actions.pod:5104
31211 " guestfs_mke2fs_JL (guestfs_h *g,\n"
31212 " const char *fstype,\n"
31213 " int blocksize,\n"
31214 " const char *device,\n"
31215 " const char *label);\n"
31220 #: ../src/guestfs-actions.pod:5114
31221 msgid "See also C<guestfs_mke2journal_L>."
31225 #: ../src/guestfs-actions.pod:5120
31226 msgid "guestfs_mke2fs_JU"
31230 #: ../src/guestfs-actions.pod:5122
31234 " guestfs_mke2fs_JU (guestfs_h *g,\n"
31235 " const char *fstype,\n"
31236 " int blocksize,\n"
31237 " const char *device,\n"
31238 " const char *uuid);\n"
31243 #: ../src/guestfs-actions.pod:5132
31244 msgid "See also C<guestfs_mke2journal_U>."
31248 #: ../src/guestfs-actions.pod:5138
31249 msgid "guestfs_mke2journal"
31253 #: ../src/guestfs-actions.pod:5140
31257 " guestfs_mke2journal (guestfs_h *g,\n"
31258 " int blocksize,\n"
31259 " const char *device);\n"
31264 #: ../src/guestfs-actions.pod:5154
31265 msgid "guestfs_mke2journal_L"
31269 #: ../src/guestfs-actions.pod:5156
31273 " guestfs_mke2journal_L (guestfs_h *g,\n"
31274 " int blocksize,\n"
31275 " const char *label,\n"
31276 " const char *device);\n"
31281 #: ../src/guestfs-actions.pod:5168
31282 msgid "guestfs_mke2journal_U"
31286 #: ../src/guestfs-actions.pod:5170
31290 " guestfs_mke2journal_U (guestfs_h *g,\n"
31291 " int blocksize,\n"
31292 " const char *uuid,\n"
31293 " const char *device);\n"
31298 #: ../src/guestfs-actions.pod:5182
31299 msgid "guestfs_mkfifo"
31303 #: ../src/guestfs-actions.pod:5184
31307 " guestfs_mkfifo (guestfs_h *g,\n"
31309 " const char *path);\n"
31314 #: ../src/guestfs-actions.pod:5189
31316 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
31317 "is just a convenient wrapper around C<guestfs_mknod>."
31321 #: ../src/guestfs-actions.pod:5199
31322 msgid "guestfs_mkfs"
31326 #: ../src/guestfs-actions.pod:5201
31330 " guestfs_mkfs (guestfs_h *g,\n"
31331 " const char *fstype,\n"
31332 " const char *device);\n"
31337 #: ../src/guestfs-actions.pod:5214
31338 msgid "guestfs_mkfs_b"
31342 #: ../src/guestfs-actions.pod:5216
31346 " guestfs_mkfs_b (guestfs_h *g,\n"
31347 " const char *fstype,\n"
31348 " int blocksize,\n"
31349 " const char *device);\n"
31354 #: ../src/guestfs-actions.pod:5222
31356 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
31361 #: ../src/guestfs-actions.pod:5229
31363 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
31364 "block size of the resulting filesystem. Supported block sizes depend on the "
31365 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
31369 #: ../src/guestfs-actions.pod:5241
31370 msgid "guestfs_mkfs_opts"
31374 #: ../src/guestfs-actions.pod:5243
31378 " guestfs_mkfs_opts (guestfs_h *g,\n"
31379 " const char *fstype,\n"
31380 " const char *device,\n"
31386 #: ../src/guestfs-actions.pod:5254
31389 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
31390 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
31391 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
31392 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
31397 #: ../src/guestfs-actions.pod:5302
31398 msgid "(Added in 1.7.19)"
31402 #: ../src/guestfs-actions.pod:5304
31403 msgid "guestfs_mkfs_opts_va"
31407 #: ../src/guestfs-actions.pod:5306
31411 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
31412 " const char *fstype,\n"
31413 " const char *device,\n"
31414 " va_list args);\n"
31419 #: ../src/guestfs-actions.pod:5312
31420 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
31424 #: ../src/guestfs-actions.pod:5316
31425 msgid "guestfs_mkfs_opts_argv"
31429 #: ../src/guestfs-actions.pod:5318
31433 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
31434 " const char *fstype,\n"
31435 " const char *device,\n"
31436 " const struct guestfs_mkfs_opts_argv *optargs);\n"
31441 #: ../src/guestfs-actions.pod:5324
31442 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
31446 #: ../src/guestfs-actions.pod:5328
31447 msgid "guestfs_mkmountpoint"
31451 #: ../src/guestfs-actions.pod:5330
31455 " guestfs_mkmountpoint (guestfs_h *g,\n"
31456 " const char *exemptpath);\n"
31461 #: ../src/guestfs-actions.pod:5334
31463 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
31464 "that can be used to create extra mountpoints before mounting the first "
31469 #: ../src/guestfs-actions.pod:5358
31471 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
31472 "may get unexpected errors if you try to mix these calls. It is safest to "
31473 "manually unmount filesystems and remove mountpoints after use."
31477 #: ../src/guestfs-actions.pod:5362
31479 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
31480 "first, so for this to work for manual mountpoints, you must ensure that the "
31481 "innermost mountpoints have the longest pathnames, as in the example code "
31486 #: ../src/guestfs-actions.pod:5369
31488 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
31489 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
31490 "can also trigger these issues."
31494 #: ../src/guestfs-actions.pod:5375 ../src/guestfs-actions.pod:5681
31495 #: ../src/guestfs-actions.pod:6708
31496 msgid "(Added in 1.0.62)"
31500 #: ../src/guestfs-actions.pod:5377
31501 msgid "guestfs_mknod"
31505 #: ../src/guestfs-actions.pod:5379
31509 " guestfs_mknod (guestfs_h *g,\n"
31513 " const char *path);\n"
31518 #: ../src/guestfs-actions.pod:5394
31520 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
31521 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
31522 "regular file). These constants are available in the standard Linux header "
31523 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
31524 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
31525 "the appropriate constant for you."
31529 #: ../src/guestfs-actions.pod:5408
31530 msgid "guestfs_mknod_b"
31534 #: ../src/guestfs-actions.pod:5410
31538 " guestfs_mknod_b (guestfs_h *g,\n"
31542 " const char *path);\n"
31547 #: ../src/guestfs-actions.pod:5417
31549 "This call creates a block device node called C<path> with mode C<mode> and "
31550 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
31551 "wrapper around C<guestfs_mknod>."
31555 #: ../src/guestfs-actions.pod:5427
31556 msgid "guestfs_mknod_c"
31560 #: ../src/guestfs-actions.pod:5429
31564 " guestfs_mknod_c (guestfs_h *g,\n"
31568 " const char *path);\n"
31573 #: ../src/guestfs-actions.pod:5436
31575 "This call creates a char device node called C<path> with mode C<mode> and "
31576 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
31577 "wrapper around C<guestfs_mknod>."
31581 #: ../src/guestfs-actions.pod:5446
31582 msgid "guestfs_mkswap"
31586 #: ../src/guestfs-actions.pod:5448
31590 " guestfs_mkswap (guestfs_h *g,\n"
31591 " const char *device);\n"
31596 #: ../src/guestfs-actions.pod:5458
31597 msgid "guestfs_mkswap_L"
31601 #: ../src/guestfs-actions.pod:5460
31605 " guestfs_mkswap_L (guestfs_h *g,\n"
31606 " const char *label,\n"
31607 " const char *device);\n"
31612 #: ../src/guestfs-actions.pod:5475
31613 msgid "guestfs_mkswap_U"
31617 #: ../src/guestfs-actions.pod:5477
31621 " guestfs_mkswap_U (guestfs_h *g,\n"
31622 " const char *uuid,\n"
31623 " const char *device);\n"
31628 #: ../src/guestfs-actions.pod:5488
31629 msgid "guestfs_mkswap_file"
31633 #: ../src/guestfs-actions.pod:5490
31637 " guestfs_mkswap_file (guestfs_h *g,\n"
31638 " const char *path);\n"
31643 #: ../src/guestfs-actions.pod:5496
31645 "This command just writes a swap file signature to an existing file. To "
31646 "create the file itself, use something like C<guestfs_fallocate>."
31650 #: ../src/guestfs-actions.pod:5503
31651 msgid "guestfs_modprobe"
31655 #: ../src/guestfs-actions.pod:5505
31659 " guestfs_modprobe (guestfs_h *g,\n"
31660 " const char *modulename);\n"
31665 #: ../src/guestfs-actions.pod:5518
31666 msgid "guestfs_mount"
31670 #: ../src/guestfs-actions.pod:5520
31674 " guestfs_mount (guestfs_h *g,\n"
31675 " const char *device,\n"
31676 " const char *mountpoint);\n"
31681 #: ../src/guestfs-actions.pod:5539
31683 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
31684 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
31685 "problems for users. If your program might need to work with older versions "
31686 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
31687 "for the first parameter if you don't want any options)."
31691 #: ../src/guestfs-actions.pod:5550
31692 msgid "guestfs_mount_9p"
31696 #: ../src/guestfs-actions.pod:5552
31700 " guestfs_mount_9p (guestfs_h *g,\n"
31701 " const char *mounttag,\n"
31702 " const char *mountpoint,\n"
31708 #: ../src/guestfs-actions.pod:5563
31711 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
31716 #: ../src/guestfs-actions.pod:5576
31717 msgid "guestfs_mount_9p_va"
31721 #: ../src/guestfs-actions.pod:5578
31725 " guestfs_mount_9p_va (guestfs_h *g,\n"
31726 " const char *mounttag,\n"
31727 " const char *mountpoint,\n"
31728 " va_list args);\n"
31733 #: ../src/guestfs-actions.pod:5584
31734 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
31738 #: ../src/guestfs-actions.pod:5588
31739 msgid "guestfs_mount_9p_argv"
31743 #: ../src/guestfs-actions.pod:5590
31747 " guestfs_mount_9p_argv (guestfs_h *g,\n"
31748 " const char *mounttag,\n"
31749 " const char *mountpoint,\n"
31750 " const struct guestfs_mount_9p_argv *optargs);\n"
31755 #: ../src/guestfs-actions.pod:5596
31756 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
31760 #: ../src/guestfs-actions.pod:5600
31761 msgid "guestfs_mount_loop"
31765 #: ../src/guestfs-actions.pod:5602
31769 " guestfs_mount_loop (guestfs_h *g,\n"
31770 " const char *file,\n"
31771 " const char *mountpoint);\n"
31776 #: ../src/guestfs-actions.pod:5615
31777 msgid "guestfs_mount_options"
31781 #: ../src/guestfs-actions.pod:5617
31785 " guestfs_mount_options (guestfs_h *g,\n"
31786 " const char *options,\n"
31787 " const char *device,\n"
31788 " const char *mountpoint);\n"
31793 #: ../src/guestfs-actions.pod:5623
31795 "This is the same as the C<guestfs_mount> command, but it allows you to set "
31796 "the mount options as for the L<mount(8)> I<-o> flag."
31800 #: ../src/guestfs-actions.pod:5633 ../src/guestfs-actions.pod:5647
31801 #: ../src/guestfs-actions.pod:5664
31802 msgid "(Added in 1.0.10)"
31806 #: ../src/guestfs-actions.pod:5635
31807 msgid "guestfs_mount_ro"
31811 #: ../src/guestfs-actions.pod:5637
31815 " guestfs_mount_ro (guestfs_h *g,\n"
31816 " const char *device,\n"
31817 " const char *mountpoint);\n"
31822 #: ../src/guestfs-actions.pod:5642
31824 "This is the same as the C<guestfs_mount> command, but it mounts the "
31825 "filesystem with the read-only (I<-o ro>) flag."
31829 #: ../src/guestfs-actions.pod:5649
31830 msgid "guestfs_mount_vfs"
31834 #: ../src/guestfs-actions.pod:5651
31838 " guestfs_mount_vfs (guestfs_h *g,\n"
31839 " const char *options,\n"
31840 " const char *vfstype,\n"
31841 " const char *device,\n"
31842 " const char *mountpoint);\n"
31847 #: ../src/guestfs-actions.pod:5658
31849 "This is the same as the C<guestfs_mount> command, but it allows you to set "
31850 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
31855 #: ../src/guestfs-actions.pod:5666
31856 msgid "guestfs_mountpoints"
31860 #: ../src/guestfs-actions.pod:5668
31864 " guestfs_mountpoints (guestfs_h *g);\n"
31869 #: ../src/guestfs-actions.pod:5671
31871 "This call is similar to C<guestfs_mounts>. That call returns a list of "
31872 "devices. This one returns a hash table (map) of device name to directory "
31873 "where the device is mounted."
31877 #: ../src/guestfs-actions.pod:5683
31878 msgid "guestfs_mounts"
31882 #: ../src/guestfs-actions.pod:5685
31886 " guestfs_mounts (guestfs_h *g);\n"
31891 #: ../src/guestfs-actions.pod:5693
31892 msgid "See also: C<guestfs_mountpoints>"
31896 #: ../src/guestfs-actions.pod:5701
31901 #: ../src/guestfs-actions.pod:5703
31905 " guestfs_mv (guestfs_h *g,\n"
31906 " const char *src,\n"
31907 " const char *dest);\n"
31912 #: ../src/guestfs-actions.pod:5715
31913 msgid "guestfs_ntfs_3g_probe"
31917 #: ../src/guestfs-actions.pod:5717
31921 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
31923 " const char *device);\n"
31928 #: ../src/guestfs-actions.pod:5736
31929 msgid "(Added in 1.0.43)"
31933 #: ../src/guestfs-actions.pod:5738
31934 msgid "guestfs_ntfsresize"
31938 #: ../src/guestfs-actions.pod:5740
31942 " guestfs_ntfsresize (guestfs_h *g,\n"
31943 " const char *device);\n"
31948 #: ../src/guestfs-actions.pod:5744 ../src/guestfs-actions.pod:5844
31950 "I<This function is deprecated.> In new code, use the L</"
31951 "guestfs_ntfsresize_opts> call instead."
31955 #: ../src/guestfs-actions.pod:5768
31956 msgid "guestfs_ntfsresize_opts"
31960 #: ../src/guestfs-actions.pod:5770
31964 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
31965 " const char *device,\n"
31971 #: ../src/guestfs-actions.pod:5780
31974 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
31975 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
31980 #: ../src/guestfs-actions.pod:5800
31982 "After the resize operation, the filesystem is always marked as requiring a "
31983 "consistency check (for safety). You have to boot into Windows to perform "
31984 "this check and clear this condition. If you I<don't> set the C<force> "
31985 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
31986 "times on a single filesystem without booting into Windows between each "
31991 #: ../src/guestfs-actions.pod:5815
31992 msgid "guestfs_ntfsresize_opts_va"
31996 #: ../src/guestfs-actions.pod:5817
32000 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
32001 " const char *device,\n"
32002 " va_list args);\n"
32007 #: ../src/guestfs-actions.pod:5822
32008 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
32012 #: ../src/guestfs-actions.pod:5826
32013 msgid "guestfs_ntfsresize_opts_argv"
32017 #: ../src/guestfs-actions.pod:5828
32021 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
32022 " const char *device,\n"
32023 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
32028 #: ../src/guestfs-actions.pod:5833
32029 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
32033 #: ../src/guestfs-actions.pod:5837
32034 msgid "guestfs_ntfsresize_size"
32038 #: ../src/guestfs-actions.pod:5839
32042 " guestfs_ntfsresize_size (guestfs_h *g,\n"
32043 " const char *device,\n"
32044 " int64_t size);\n"
32049 #: ../src/guestfs-actions.pod:5851
32051 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
32052 "to specify the new size (in bytes) explicitly."
32056 #: ../src/guestfs-actions.pod:5856 ../src/guestfs-actions.pod:6315
32057 #: ../src/guestfs-actions.pod:6388 ../src/guestfs-actions.pod:6656
32058 #: ../src/guestfs-actions.pod:8403
32059 msgid "(Added in 1.3.14)"
32063 #: ../src/guestfs-actions.pod:5858
32064 msgid "guestfs_part_add"
32068 #: ../src/guestfs-actions.pod:5860
32072 " guestfs_part_add (guestfs_h *g,\n"
32073 " const char *device,\n"
32074 " const char *prlogex,\n"
32075 " int64_t startsect,\n"
32076 " int64_t endsect);\n"
32081 #: ../src/guestfs-actions.pod:5867
32083 "This command adds a partition to C<device>. If there is no partition table "
32084 "on the device, call C<guestfs_part_init> first."
32088 #: ../src/guestfs-actions.pod:5879
32090 "Creating a partition which covers the whole disk is not so easy. Use "
32091 "C<guestfs_part_disk> to do that."
32095 #: ../src/guestfs-actions.pod:5884 ../src/guestfs-actions.pod:5919
32096 #: ../src/guestfs-actions.pod:5972 ../src/guestfs-actions.pod:6056
32097 #: ../src/guestfs-actions.pod:6094 ../src/guestfs-actions.pod:6113
32098 #: ../src/guestfs-actions.pod:6153
32099 msgid "(Added in 1.0.78)"
32103 #: ../src/guestfs-actions.pod:5886
32104 msgid "guestfs_part_del"
32108 #: ../src/guestfs-actions.pod:5888
32112 " guestfs_part_del (guestfs_h *g,\n"
32113 " const char *device,\n"
32119 #: ../src/guestfs-actions.pod:5903
32120 msgid "guestfs_part_disk"
32124 #: ../src/guestfs-actions.pod:5905
32128 " guestfs_part_disk (guestfs_h *g,\n"
32129 " const char *device,\n"
32130 " const char *parttype);\n"
32135 #: ../src/guestfs-actions.pod:5910
32137 "This command is simply a combination of C<guestfs_part_init> followed by "
32138 "C<guestfs_part_add> to create a single primary partition covering the whole "
32143 #: ../src/guestfs-actions.pod:5914
32145 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
32146 "possible values are described in C<guestfs_part_init>."
32150 #: ../src/guestfs-actions.pod:5921
32151 msgid "guestfs_part_get_bootable"
32155 #: ../src/guestfs-actions.pod:5923
32159 " guestfs_part_get_bootable (guestfs_h *g,\n"
32160 " const char *device,\n"
32166 #: ../src/guestfs-actions.pod:5931
32167 msgid "See also C<guestfs_part_set_bootable>."
32171 #: ../src/guestfs-actions.pod:5937
32172 msgid "guestfs_part_get_mbr_id"
32176 #: ../src/guestfs-actions.pod:5939
32180 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
32181 " const char *device,\n"
32187 #: ../src/guestfs-actions.pod:5947 ../src/guestfs-actions.pod:6129
32189 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
32190 "undefined results for other partition table types (see "
32191 "C<guestfs_part_get_parttype>)."
32195 #: ../src/guestfs-actions.pod:5955
32196 msgid "guestfs_part_get_parttype"
32200 #: ../src/guestfs-actions.pod:5957
32204 " guestfs_part_get_parttype (guestfs_h *g,\n"
32205 " const char *device);\n"
32210 #: ../src/guestfs-actions.pod:5964
32212 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
32213 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
32214 "possible, although unusual. See C<guestfs_part_init> for a full list."
32218 #: ../src/guestfs-actions.pod:5974
32219 msgid "guestfs_part_init"
32223 #: ../src/guestfs-actions.pod:5976
32227 " guestfs_part_init (guestfs_h *g,\n"
32228 " const char *device,\n"
32229 " const char *parttype);\n"
32234 #: ../src/guestfs-actions.pod:5985
32236 "Initially there are no partitions. Following this, you should call "
32237 "C<guestfs_part_add> for each partition required."
32241 #: ../src/guestfs-actions.pod:6058
32242 msgid "guestfs_part_list"
32246 #: ../src/guestfs-actions.pod:6060
32249 " struct guestfs_partition_list *\n"
32250 " guestfs_part_list (guestfs_h *g,\n"
32251 " const char *device);\n"
32256 #: ../src/guestfs-actions.pod:6077
32258 "Start of the partition I<in bytes>. To get sectors you have to divide by "
32259 "the device's sector size, see C<guestfs_blockdev_getss>."
32263 #: ../src/guestfs-actions.pod:6090
32265 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
32266 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
32271 #: ../src/guestfs-actions.pod:6096
32272 msgid "guestfs_part_set_bootable"
32276 #: ../src/guestfs-actions.pod:6098
32280 " guestfs_part_set_bootable (guestfs_h *g,\n"
32281 " const char *device,\n"
32283 " int bootable);\n"
32288 #: ../src/guestfs-actions.pod:6115
32289 msgid "guestfs_part_set_mbr_id"
32293 #: ../src/guestfs-actions.pod:6117
32297 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
32298 " const char *device,\n"
32305 #: ../src/guestfs-actions.pod:6137
32306 msgid "guestfs_part_set_name"
32310 #: ../src/guestfs-actions.pod:6139
32314 " guestfs_part_set_name (guestfs_h *g,\n"
32315 " const char *device,\n"
32317 " const char *name);\n"
32322 #: ../src/guestfs-actions.pod:6155
32323 msgid "guestfs_part_to_dev"
32327 #: ../src/guestfs-actions.pod:6157
32331 " guestfs_part_to_dev (guestfs_h *g,\n"
32332 " const char *partition);\n"
32337 #: ../src/guestfs-actions.pod:6165 ../src/guestfs-actions.pod:6184
32339 "The named partition must exist, for example as a string returned from "
32340 "C<guestfs_list_partitions>."
32344 #: ../src/guestfs-actions.pod:6168
32345 msgid "See also C<guestfs_part_to_partnum>."
32349 #: ../src/guestfs-actions.pod:6175
32350 msgid "guestfs_part_to_partnum"
32354 #: ../src/guestfs-actions.pod:6177
32358 " guestfs_part_to_partnum (guestfs_h *g,\n"
32359 " const char *partition);\n"
32364 #: ../src/guestfs-actions.pod:6187
32365 msgid "See also C<guestfs_part_to_dev>."
32369 #: ../src/guestfs-actions.pod:6193
32370 msgid "guestfs_ping_daemon"
32374 #: ../src/guestfs-actions.pod:6195
32378 " guestfs_ping_daemon (guestfs_h *g);\n"
32383 #: ../src/guestfs-actions.pod:6207
32384 msgid "guestfs_pread"
32388 #: ../src/guestfs-actions.pod:6209
32392 " guestfs_pread (guestfs_h *g,\n"
32393 " const char *path,\n"
32395 " int64_t offset,\n"
32396 " size_t *size_r);\n"
32401 #: ../src/guestfs-actions.pod:6222
32402 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
32406 #: ../src/guestfs-actions.pod:6233
32407 msgid "guestfs_pread_device"
32411 #: ../src/guestfs-actions.pod:6235
32415 " guestfs_pread_device (guestfs_h *g,\n"
32416 " const char *device,\n"
32418 " int64_t offset,\n"
32419 " size_t *size_r);\n"
32424 #: ../src/guestfs-actions.pod:6248
32425 msgid "See also C<guestfs_pread>."
32429 #: ../src/guestfs-actions.pod:6257
32430 msgid "(Added in 1.5.21)"
32434 #: ../src/guestfs-actions.pod:6259
32435 msgid "guestfs_pvcreate"
32439 #: ../src/guestfs-actions.pod:6261
32443 " guestfs_pvcreate (guestfs_h *g,\n"
32444 " const char *device);\n"
32449 #: ../src/guestfs-actions.pod:6273
32450 msgid "guestfs_pvremove"
32454 #: ../src/guestfs-actions.pod:6275
32458 " guestfs_pvremove (guestfs_h *g,\n"
32459 " const char *device);\n"
32464 #: ../src/guestfs-actions.pod:6290
32465 msgid "guestfs_pvresize"
32469 #: ../src/guestfs-actions.pod:6292
32473 " guestfs_pvresize (guestfs_h *g,\n"
32474 " const char *device);\n"
32479 #: ../src/guestfs-actions.pod:6303
32480 msgid "guestfs_pvresize_size"
32484 #: ../src/guestfs-actions.pod:6305
32488 " guestfs_pvresize_size (guestfs_h *g,\n"
32489 " const char *device,\n"
32490 " int64_t size);\n"
32495 #: ../src/guestfs-actions.pod:6310
32497 "This command is the same as C<guestfs_pvresize> except that it allows you to "
32498 "specify the new size (in bytes) explicitly."
32502 #: ../src/guestfs-actions.pod:6317
32503 msgid "guestfs_pvs"
32507 #: ../src/guestfs-actions.pod:6319
32511 " guestfs_pvs (guestfs_h *g);\n"
32516 #: ../src/guestfs-actions.pod:6328
32517 msgid "See also C<guestfs_pvs_full>."
32521 #: ../src/guestfs-actions.pod:6336
32522 msgid "guestfs_pvs_full"
32526 #: ../src/guestfs-actions.pod:6338
32529 " struct guestfs_lvm_pv_list *\n"
32530 " guestfs_pvs_full (guestfs_h *g);\n"
32535 #: ../src/guestfs-actions.pod:6344
32537 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
32538 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
32542 #: ../src/guestfs-actions.pod:6350
32543 msgid "guestfs_pvuuid"
32547 #: ../src/guestfs-actions.pod:6352
32551 " guestfs_pvuuid (guestfs_h *g,\n"
32552 " const char *device);\n"
32557 #: ../src/guestfs-actions.pod:6363
32558 msgid "guestfs_pwrite"
32562 #: ../src/guestfs-actions.pod:6365
32566 " guestfs_pwrite (guestfs_h *g,\n"
32567 " const char *path,\n"
32568 " const char *content,\n"
32569 " size_t content_size,\n"
32570 " int64_t offset);\n"
32575 #: ../src/guestfs-actions.pod:6381
32576 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
32580 #: ../src/guestfs-actions.pod:6390
32581 msgid "guestfs_pwrite_device"
32585 #: ../src/guestfs-actions.pod:6392
32589 " guestfs_pwrite_device (guestfs_h *g,\n"
32590 " const char *device,\n"
32591 " const char *content,\n"
32592 " size_t content_size,\n"
32593 " int64_t offset);\n"
32598 #: ../src/guestfs-actions.pod:6407
32599 msgid "See also C<guestfs_pwrite>."
32603 #: ../src/guestfs-actions.pod:6414
32604 msgid "(Added in 1.5.20)"
32608 #: ../src/guestfs-actions.pod:6416
32609 msgid "guestfs_read_file"
32613 #: ../src/guestfs-actions.pod:6418
32617 " guestfs_read_file (guestfs_h *g,\n"
32618 " const char *path,\n"
32619 " size_t *size_r);\n"
32624 #: ../src/guestfs-actions.pod:6426
32626 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
32627 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
32628 "function is limited in the total size of file that can be handled."
32632 #: ../src/guestfs-actions.pod:6438
32633 msgid "(Added in 1.0.63)"
32637 #: ../src/guestfs-actions.pod:6440
32638 msgid "guestfs_read_lines"
32642 #: ../src/guestfs-actions.pod:6442
32646 " guestfs_read_lines (guestfs_h *g,\n"
32647 " const char *path);\n"
32652 #: ../src/guestfs-actions.pod:6451
32654 "Note that this function cannot correctly handle binary files (specifically, "
32655 "files containing C<\\0> character which is treated as end of line). For "
32656 "those you need to use the C<guestfs_read_file> function which has a more "
32657 "complex interface."
32661 #: ../src/guestfs-actions.pod:6462
32662 msgid "guestfs_readdir"
32666 #: ../src/guestfs-actions.pod:6464
32669 " struct guestfs_dirent_list *\n"
32670 " guestfs_readdir (guestfs_h *g,\n"
32671 " const char *dir);\n"
32676 #: ../src/guestfs-actions.pod:6518
32678 "This function is primarily intended for use by programs. To get a simple "
32679 "list of names, use C<guestfs_ls>. To get a printable directory for human "
32680 "consumption, use C<guestfs_ll>."
32684 #: ../src/guestfs-actions.pod:6522
32686 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
32687 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
32691 #: ../src/guestfs-actions.pod:6528
32692 msgid "guestfs_readlink"
32696 #: ../src/guestfs-actions.pod:6530
32700 " guestfs_readlink (guestfs_h *g,\n"
32701 " const char *path);\n"
32706 #: ../src/guestfs-actions.pod:6541
32707 msgid "guestfs_readlinklist"
32711 #: ../src/guestfs-actions.pod:6543
32715 " guestfs_readlinklist (guestfs_h *g,\n"
32716 " const char *path,\n"
32717 " char *const *names);\n"
32722 #: ../src/guestfs-actions.pod:6576
32723 msgid "guestfs_realpath"
32727 #: ../src/guestfs-actions.pod:6578
32731 " guestfs_realpath (guestfs_h *g,\n"
32732 " const char *path);\n"
32737 #: ../src/guestfs-actions.pod:6590
32738 msgid "guestfs_removexattr"
32742 #: ../src/guestfs-actions.pod:6592
32746 " guestfs_removexattr (guestfs_h *g,\n"
32747 " const char *xattr,\n"
32748 " const char *path);\n"
32753 #: ../src/guestfs-actions.pod:6600
32754 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
32758 #: ../src/guestfs-actions.pod:6606
32759 msgid "guestfs_resize2fs"
32763 #: ../src/guestfs-actions.pod:6608
32767 " guestfs_resize2fs (guestfs_h *g,\n"
32768 " const char *device);\n"
32773 #: ../src/guestfs-actions.pod:6615
32775 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
32776 "C<device> before calling this command. For unknown reasons C<resize2fs> "
32777 "sometimes gives an error about this and sometimes not. In any case, it is "
32778 "always safe to call C<guestfs_e2fsck_f> before calling this function."
32782 #: ../src/guestfs-actions.pod:6625
32783 msgid "guestfs_resize2fs_M"
32787 #: ../src/guestfs-actions.pod:6627
32791 " guestfs_resize2fs_M (guestfs_h *g,\n"
32792 " const char *device);\n"
32797 #: ../src/guestfs-actions.pod:6631
32799 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
32800 "resized to its minimum size. This works like the I<-M> option to the "
32801 "C<resize2fs> command."
32805 #: ../src/guestfs-actions.pod:6635
32807 "To get the resulting size of the filesystem you should call "
32808 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
32809 "These two numbers, multiplied together, give the resulting size of the "
32810 "minimal filesystem in bytes."
32814 #: ../src/guestfs-actions.pod:6644
32815 msgid "guestfs_resize2fs_size"
32819 #: ../src/guestfs-actions.pod:6646
32823 " guestfs_resize2fs_size (guestfs_h *g,\n"
32824 " const char *device,\n"
32825 " int64_t size);\n"
32830 #: ../src/guestfs-actions.pod:6651
32832 "This command is the same as C<guestfs_resize2fs> except that it allows you "
32833 "to specify the new size (in bytes) explicitly."
32837 #: ../src/guestfs-actions.pod:6658
32842 #: ../src/guestfs-actions.pod:6660
32846 " guestfs_rm (guestfs_h *g,\n"
32847 " const char *path);\n"
32852 #: ../src/guestfs-actions.pod:6670
32853 msgid "guestfs_rm_rf"
32857 #: ../src/guestfs-actions.pod:6672
32861 " guestfs_rm_rf (guestfs_h *g,\n"
32862 " const char *path);\n"
32867 #: ../src/guestfs-actions.pod:6684
32868 msgid "guestfs_rmdir"
32872 #: ../src/guestfs-actions.pod:6686
32876 " guestfs_rmdir (guestfs_h *g,\n"
32877 " const char *path);\n"
32882 #: ../src/guestfs-actions.pod:6696
32883 msgid "guestfs_rmmountpoint"
32887 #: ../src/guestfs-actions.pod:6698
32891 " guestfs_rmmountpoint (guestfs_h *g,\n"
32892 " const char *exemptpath);\n"
32897 #: ../src/guestfs-actions.pod:6702
32899 "This calls removes a mountpoint that was previously created with "
32900 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
32904 #: ../src/guestfs-actions.pod:6710
32905 msgid "guestfs_scrub_device"
32909 #: ../src/guestfs-actions.pod:6712
32913 " guestfs_scrub_device (guestfs_h *g,\n"
32914 " const char *device);\n"
32919 #: ../src/guestfs-actions.pod:6724 ../src/guestfs-actions.pod:6742
32920 #: ../src/guestfs-actions.pod:6761
32921 msgid "(Added in 1.0.52)"
32925 #: ../src/guestfs-actions.pod:6726
32926 msgid "guestfs_scrub_file"
32930 #: ../src/guestfs-actions.pod:6728
32934 " guestfs_scrub_file (guestfs_h *g,\n"
32935 " const char *file);\n"
32940 #: ../src/guestfs-actions.pod:6744
32941 msgid "guestfs_scrub_freespace"
32945 #: ../src/guestfs-actions.pod:6746
32949 " guestfs_scrub_freespace (guestfs_h *g,\n"
32950 " const char *dir);\n"
32955 #: ../src/guestfs-actions.pod:6750
32957 "This command creates the directory C<dir> and then fills it with files until "
32958 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
32959 "and deletes them. The intention is to scrub any free space on the partition "
32960 "containing C<dir>."
32964 #: ../src/guestfs-actions.pod:6763
32965 msgid "guestfs_set_append"
32969 #: ../src/guestfs-actions.pod:6765
32973 " guestfs_set_append (guestfs_h *g,\n"
32974 " const char *append);\n"
32979 #: ../src/guestfs-actions.pod:6782
32980 msgid "guestfs_set_attach_method"
32984 #: ../src/guestfs-actions.pod:6784
32988 " guestfs_set_attach_method (guestfs_h *g,\n"
32989 " const char *attachmethod);\n"
32994 #: ../src/guestfs-actions.pod:6812
32995 msgid "guestfs_set_autosync"
32999 #: ../src/guestfs-actions.pod:6814
33003 " guestfs_set_autosync (guestfs_h *g,\n"
33004 " int autosync);\n"
33009 #: ../src/guestfs-actions.pod:6830
33010 msgid "guestfs_set_direct"
33014 #: ../src/guestfs-actions.pod:6832
33018 " guestfs_set_direct (guestfs_h *g,\n"
33024 #: ../src/guestfs-actions.pod:6840
33026 "One consequence of this is that log messages aren't caught by the library "
33027 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
33032 #: ../src/guestfs-actions.pod:6853
33033 msgid "guestfs_set_e2label"
33037 #: ../src/guestfs-actions.pod:6855
33041 " guestfs_set_e2label (guestfs_h *g,\n"
33042 " const char *device,\n"
33043 " const char *label);\n"
33048 #: ../src/guestfs-actions.pod:6864
33050 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
33051 "the existing label on a filesystem."
33055 #: ../src/guestfs-actions.pod:6871
33056 msgid "guestfs_set_e2uuid"
33060 #: ../src/guestfs-actions.pod:6873
33064 " guestfs_set_e2uuid (guestfs_h *g,\n"
33065 " const char *device,\n"
33066 " const char *uuid);\n"
33071 #: ../src/guestfs-actions.pod:6883
33073 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
33074 "the existing UUID of a filesystem."
33078 #: ../src/guestfs-actions.pod:6890
33079 msgid "guestfs_set_memsize"
33083 #: ../src/guestfs-actions.pod:6892
33087 " guestfs_set_memsize (guestfs_h *g,\n"
33093 #: ../src/guestfs-actions.pod:6896
33095 "This sets the memory size in megabytes allocated to the qemu subprocess. "
33096 "This only has any effect if called before C<guestfs_launch>."
33100 #: ../src/guestfs-actions.pod:6911
33101 msgid "guestfs_set_network"
33105 #: ../src/guestfs-actions.pod:6913
33109 " guestfs_set_network (guestfs_h *g,\n"
33115 #: ../src/guestfs-actions.pod:6923
33117 "You must call this before calling C<guestfs_launch>, otherwise it has no "
33122 #: ../src/guestfs-actions.pod:6930
33123 msgid "guestfs_set_path"
33127 #: ../src/guestfs-actions.pod:6932
33131 " guestfs_set_path (guestfs_h *g,\n"
33132 " const char *searchpath);\n"
33137 #: ../src/guestfs-actions.pod:6947
33138 msgid "guestfs_set_pgroup"
33142 #: ../src/guestfs-actions.pod:6949
33146 " guestfs_set_pgroup (guestfs_h *g,\n"
33152 #: ../src/guestfs-actions.pod:6966
33153 msgid "guestfs_set_qemu"
33157 #: ../src/guestfs-actions.pod:6968
33161 " guestfs_set_qemu (guestfs_h *g,\n"
33162 " const char *qemu);\n"
33167 #: ../src/guestfs-actions.pod:6994
33168 msgid "guestfs_set_recovery_proc"
33172 #: ../src/guestfs-actions.pod:6996
33176 " guestfs_set_recovery_proc (guestfs_h *g,\n"
33177 " int recoveryproc);\n"
33182 #: ../src/guestfs-actions.pod:7000
33184 "If this is called with the parameter C<false> then C<guestfs_launch> does "
33185 "not create a recovery process. The purpose of the recovery process is to "
33186 "stop runaway qemu processes in the case where the main program aborts "
33191 #: ../src/guestfs-actions.pod:7005
33193 "This only has any effect if called before C<guestfs_launch>, and the default "
33198 #: ../src/guestfs-actions.pod:7018
33199 msgid "guestfs_set_selinux"
33203 #: ../src/guestfs-actions.pod:7020
33207 " guestfs_set_selinux (guestfs_h *g,\n"
33213 #: ../src/guestfs-actions.pod:7037
33214 msgid "guestfs_set_smp"
33218 #: ../src/guestfs-actions.pod:7039
33222 " guestfs_set_smp (guestfs_h *g,\n"
33228 #: ../src/guestfs-actions.pod:7047
33229 msgid "This function must be called before C<guestfs_launch>."
33233 #: ../src/guestfs-actions.pod:7053
33234 msgid "guestfs_set_trace"
33238 #: ../src/guestfs-actions.pod:7055
33242 " guestfs_set_trace (guestfs_h *g,\n"
33248 #: ../src/guestfs-actions.pod:7069
33250 "Trace messages are normally sent to C<stderr>, unless you register a "
33251 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
33255 #: ../src/guestfs-actions.pod:7077
33256 msgid "guestfs_set_verbose"
33260 #: ../src/guestfs-actions.pod:7079
33264 " guestfs_set_verbose (guestfs_h *g,\n"
33270 #: ../src/guestfs-actions.pod:7088
33272 "Verbose messages are normally sent to C<stderr>, unless you register a "
33273 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
33277 #: ../src/guestfs-actions.pod:7096
33278 msgid "guestfs_setcon"
33282 #: ../src/guestfs-actions.pod:7098
33286 " guestfs_setcon (guestfs_h *g,\n"
33287 " const char *context);\n"
33292 #: ../src/guestfs-actions.pod:7111
33293 msgid "guestfs_setxattr"
33297 #: ../src/guestfs-actions.pod:7113
33301 " guestfs_setxattr (guestfs_h *g,\n"
33302 " const char *xattr,\n"
33303 " const char *val,\n"
33305 " const char *path);\n"
33310 #: ../src/guestfs-actions.pod:7124
33311 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
33315 #: ../src/guestfs-actions.pod:7130
33316 msgid "guestfs_sfdisk"
33320 #: ../src/guestfs-actions.pod:7132
33324 " guestfs_sfdisk (guestfs_h *g,\n"
33325 " const char *device,\n"
33329 " char *const *lines);\n"
33334 #: ../src/guestfs-actions.pod:7140 ../src/guestfs-actions.pod:7181
33335 #: ../src/guestfs-actions.pod:7212
33337 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
33342 #: ../src/guestfs-actions.pod:7167
33344 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
33348 #: ../src/guestfs-actions.pod:7174
33349 msgid "guestfs_sfdiskM"
33353 #: ../src/guestfs-actions.pod:7176
33357 " guestfs_sfdiskM (guestfs_h *g,\n"
33358 " const char *device,\n"
33359 " char *const *lines);\n"
33364 #: ../src/guestfs-actions.pod:7188
33366 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
33367 "partition sizes are specified in megabytes only (rounded to the nearest "
33368 "cylinder) and you don't need to specify the cyls, heads and sectors "
33369 "parameters which were rarely if ever used anyway."
33373 #: ../src/guestfs-actions.pod:7194
33375 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
33376 "C<guestfs_part_disk>"
33380 #: ../src/guestfs-actions.pod:7201
33381 msgid "guestfs_sfdisk_N"
33385 #: ../src/guestfs-actions.pod:7203
33389 " guestfs_sfdisk_N (guestfs_h *g,\n"
33390 " const char *device,\n"
33395 " const char *line);\n"
33400 #: ../src/guestfs-actions.pod:7222
33402 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
33403 "for the cyls/heads/sectors parameters."
33407 #: ../src/guestfs-actions.pod:7225
33408 msgid "See also: C<guestfs_part_add>"
33412 #: ../src/guestfs-actions.pod:7231
33413 msgid "guestfs_sfdisk_disk_geometry"
33417 #: ../src/guestfs-actions.pod:7233
33421 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
33422 " const char *device);\n"
33427 #: ../src/guestfs-actions.pod:7237
33429 "This displays the disk geometry of C<device> read from the partition table. "
33430 "Especially in the case where the underlying block device has been resized, "
33431 "this can be different from the kernel's idea of the geometry (see "
33432 "C<guestfs_sfdisk_kernel_geometry>)."
33436 #: ../src/guestfs-actions.pod:7250
33437 msgid "guestfs_sfdisk_kernel_geometry"
33441 #: ../src/guestfs-actions.pod:7252
33445 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
33446 " const char *device);\n"
33451 #: ../src/guestfs-actions.pod:7266
33452 msgid "guestfs_sfdisk_l"
33456 #: ../src/guestfs-actions.pod:7268
33460 " guestfs_sfdisk_l (guestfs_h *g,\n"
33461 " const char *device);\n"
33466 #: ../src/guestfs-actions.pod:7272
33468 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
33473 #: ../src/guestfs-actions.pod:7283
33474 msgid "See also: C<guestfs_part_list>"
33478 #: ../src/guestfs-actions.pod:7290
33483 #: ../src/guestfs-actions.pod:7292
33487 " guestfs_sh (guestfs_h *g,\n"
33488 " const char *command);\n"
33493 #: ../src/guestfs-actions.pod:7299
33494 msgid "This is like C<guestfs_command>, but passes the command to:"
33498 #: ../src/guestfs-actions.pod:7307
33499 msgid "All the provisos about C<guestfs_command> apply to this call."
33503 #: ../src/guestfs-actions.pod:7314
33504 msgid "guestfs_sh_lines"
33508 #: ../src/guestfs-actions.pod:7316
33512 " guestfs_sh_lines (guestfs_h *g,\n"
33513 " const char *command);\n"
33518 #: ../src/guestfs-actions.pod:7320
33520 "This is the same as C<guestfs_sh>, but splits the result into a list of "
33525 #: ../src/guestfs-actions.pod:7323
33526 msgid "See also: C<guestfs_command_lines>"
33530 #: ../src/guestfs-actions.pod:7331
33531 msgid "guestfs_sleep"
33535 #: ../src/guestfs-actions.pod:7333
33539 " guestfs_sleep (guestfs_h *g,\n"
33545 #: ../src/guestfs-actions.pod:7341
33546 msgid "(Added in 1.0.41)"
33550 #: ../src/guestfs-actions.pod:7343 ../src/guestfs-structs.pod:109
33551 msgid "guestfs_stat"
33555 #: ../src/guestfs-actions.pod:7345
33558 " struct guestfs_stat *\n"
33559 " guestfs_stat (guestfs_h *g,\n"
33560 " const char *path);\n"
33565 #: ../src/guestfs-actions.pod:7359 ../src/guestfs-structs.pod:135
33566 msgid "guestfs_statvfs"
33570 #: ../src/guestfs-actions.pod:7361
33573 " struct guestfs_statvfs *\n"
33574 " guestfs_statvfs (guestfs_h *g,\n"
33575 " const char *path);\n"
33580 #: ../src/guestfs-actions.pod:7371
33582 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
33583 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
33587 #: ../src/guestfs-actions.pod:7377
33588 msgid "guestfs_strings"
33592 #: ../src/guestfs-actions.pod:7379
33596 " guestfs_strings (guestfs_h *g,\n"
33597 " const char *path);\n"
33602 #: ../src/guestfs-actions.pod:7395
33603 msgid "guestfs_strings_e"
33607 #: ../src/guestfs-actions.pod:7397
33611 " guestfs_strings_e (guestfs_h *g,\n"
33612 " const char *encoding,\n"
33613 " const char *path);\n"
33618 #: ../src/guestfs-actions.pod:7402
33620 "This is like the C<guestfs_strings> command, but allows you to specify the "
33621 "encoding of strings that are looked for in the source file C<path>."
33625 #: ../src/guestfs-actions.pod:7412
33627 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
33628 "ISO-8859-X (this is what C<guestfs_strings> uses)."
33632 #: ../src/guestfs-actions.pod:7450
33633 msgid "guestfs_swapoff_device"
33637 #: ../src/guestfs-actions.pod:7452
33641 " guestfs_swapoff_device (guestfs_h *g,\n"
33642 " const char *device);\n"
33647 #: ../src/guestfs-actions.pod:7456
33649 "This command disables the libguestfs appliance swap device or partition "
33650 "named C<device>. See C<guestfs_swapon_device>."
33654 #: ../src/guestfs-actions.pod:7464
33655 msgid "guestfs_swapoff_file"
33659 #: ../src/guestfs-actions.pod:7466
33663 " guestfs_swapoff_file (guestfs_h *g,\n"
33664 " const char *file);\n"
33669 #: ../src/guestfs-actions.pod:7476
33670 msgid "guestfs_swapoff_label"
33674 #: ../src/guestfs-actions.pod:7478
33678 " guestfs_swapoff_label (guestfs_h *g,\n"
33679 " const char *label);\n"
33684 #: ../src/guestfs-actions.pod:7489
33685 msgid "guestfs_swapoff_uuid"
33689 #: ../src/guestfs-actions.pod:7491
33693 " guestfs_swapoff_uuid (guestfs_h *g,\n"
33694 " const char *uuid);\n"
33699 #: ../src/guestfs-actions.pod:7502
33700 msgid "guestfs_swapon_device"
33704 #: ../src/guestfs-actions.pod:7504
33708 " guestfs_swapon_device (guestfs_h *g,\n"
33709 " const char *device);\n"
33714 #: ../src/guestfs-actions.pod:7508
33716 "This command enables the libguestfs appliance to use the swap device or "
33717 "partition named C<device>. The increased memory is made available for all "
33718 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
33722 #: ../src/guestfs-actions.pod:7524
33723 msgid "guestfs_swapon_file"
33727 #: ../src/guestfs-actions.pod:7526
33731 " guestfs_swapon_file (guestfs_h *g,\n"
33732 " const char *file);\n"
33737 #: ../src/guestfs-actions.pod:7530
33739 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
33744 #: ../src/guestfs-actions.pod:7537
33745 msgid "guestfs_swapon_label"
33749 #: ../src/guestfs-actions.pod:7539
33753 " guestfs_swapon_label (guestfs_h *g,\n"
33754 " const char *label);\n"
33759 #: ../src/guestfs-actions.pod:7543
33761 "This command enables swap to a labeled swap partition. See "
33762 "C<guestfs_swapon_device> for other notes."
33766 #: ../src/guestfs-actions.pod:7550
33767 msgid "guestfs_swapon_uuid"
33771 #: ../src/guestfs-actions.pod:7552
33775 " guestfs_swapon_uuid (guestfs_h *g,\n"
33776 " const char *uuid);\n"
33781 #: ../src/guestfs-actions.pod:7556
33783 "This command enables swap to a swap partition with the given UUID. See "
33784 "C<guestfs_swapon_device> for other notes."
33788 #: ../src/guestfs-actions.pod:7563
33789 msgid "guestfs_sync"
33793 #: ../src/guestfs-actions.pod:7565
33797 " guestfs_sync (guestfs_h *g);\n"
33802 #: ../src/guestfs-actions.pod:7578
33803 msgid "guestfs_tail"
33807 #: ../src/guestfs-actions.pod:7580
33811 " guestfs_tail (guestfs_h *g,\n"
33812 " const char *path);\n"
33817 #: ../src/guestfs-actions.pod:7596
33818 msgid "guestfs_tail_n"
33822 #: ../src/guestfs-actions.pod:7598
33826 " guestfs_tail_n (guestfs_h *g,\n"
33828 " const char *path);\n"
33833 #: ../src/guestfs-actions.pod:7620
33834 msgid "guestfs_tar_in"
33838 #: ../src/guestfs-actions.pod:7622
33842 " guestfs_tar_in (guestfs_h *g,\n"
33843 " const char *tarfile,\n"
33844 " const char *directory);\n"
33849 #: ../src/guestfs-actions.pod:7630
33851 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
33855 #: ../src/guestfs-actions.pod:7635 ../src/guestfs-actions.pod:7652
33856 #: ../src/guestfs-actions.pod:7668 ../src/guestfs-actions.pod:7684
33857 msgid "(Added in 1.0.3)"
33861 #: ../src/guestfs-actions.pod:7637
33862 msgid "guestfs_tar_out"
33866 #: ../src/guestfs-actions.pod:7639
33870 " guestfs_tar_out (guestfs_h *g,\n"
33871 " const char *directory,\n"
33872 " const char *tarfile);\n"
33877 #: ../src/guestfs-actions.pod:7647
33879 "To download a compressed tarball, use C<guestfs_tgz_out> or "
33880 "C<guestfs_txz_out>."
33884 #: ../src/guestfs-actions.pod:7654
33885 msgid "guestfs_tgz_in"
33889 #: ../src/guestfs-actions.pod:7656
33893 " guestfs_tgz_in (guestfs_h *g,\n"
33894 " const char *tarball,\n"
33895 " const char *directory);\n"
33900 #: ../src/guestfs-actions.pod:7664
33901 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
33905 #: ../src/guestfs-actions.pod:7670
33906 msgid "guestfs_tgz_out"
33910 #: ../src/guestfs-actions.pod:7672
33914 " guestfs_tgz_out (guestfs_h *g,\n"
33915 " const char *directory,\n"
33916 " const char *tarball);\n"
33921 #: ../src/guestfs-actions.pod:7680
33922 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
33926 #: ../src/guestfs-actions.pod:7686
33927 msgid "guestfs_touch"
33931 #: ../src/guestfs-actions.pod:7688
33935 " guestfs_touch (guestfs_h *g,\n"
33936 " const char *path);\n"
33941 #: ../src/guestfs-actions.pod:7703
33942 msgid "guestfs_truncate"
33946 #: ../src/guestfs-actions.pod:7705
33950 " guestfs_truncate (guestfs_h *g,\n"
33951 " const char *path);\n"
33956 #: ../src/guestfs-actions.pod:7716
33957 msgid "guestfs_truncate_size"
33961 #: ../src/guestfs-actions.pod:7718
33965 " guestfs_truncate_size (guestfs_h *g,\n"
33966 " const char *path,\n"
33967 " int64_t size);\n"
33972 #: ../src/guestfs-actions.pod:7726
33974 "If the current file size is less than C<size> then the file is extended to "
33975 "the required size with zero bytes. This creates a sparse file (ie. disk "
33976 "blocks are not allocated for the file until you write to it). To create a "
33977 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
33981 #: ../src/guestfs-actions.pod:7736
33982 msgid "guestfs_tune2fs"
33986 #: ../src/guestfs-actions.pod:7738
33990 " guestfs_tune2fs (guestfs_h *g,\n"
33991 " const char *device,\n"
33997 #: ../src/guestfs-actions.pod:7748
34000 " GUESTFS_TUNE2FS_FORCE, int force,\n"
34001 " GUESTFS_TUNE2FS_MAXMOUNTCOUNT, int maxmountcount,\n"
34002 " GUESTFS_TUNE2FS_MOUNTCOUNT, int mountcount,\n"
34003 " GUESTFS_TUNE2FS_ERRORBEHAVIOR, const char *errorbehavior,\n"
34004 " GUESTFS_TUNE2FS_GROUP, int64_t group,\n"
34005 " GUESTFS_TUNE2FS_INTERVALBETWEENCHECKS, int intervalbetweenchecks,\n"
34006 " GUESTFS_TUNE2FS_RESERVEDBLOCKSPERCENTAGE, int reservedblockspercentage,\n"
34007 " GUESTFS_TUNE2FS_LASTMOUNTEDDIRECTORY, const char *lastmounteddirectory,\n"
34008 " GUESTFS_TUNE2FS_RESERVEDBLOCKSCOUNT, int64_t reservedblockscount,\n"
34009 " GUESTFS_TUNE2FS_USER, int64_t user,\n"
34014 #: ../src/guestfs-actions.pod:7828
34016 "To get the current values of filesystem parameters, see "
34017 "C<guestfs_tune2fs_l>. For precise details of how tune2fs works, see the "
34018 "L<tune2fs(8)> man page."
34022 #: ../src/guestfs-actions.pod:7834
34023 msgid "guestfs_tune2fs_va"
34027 #: ../src/guestfs-actions.pod:7836
34031 " guestfs_tune2fs_va (guestfs_h *g,\n"
34032 " const char *device,\n"
34033 " va_list args);\n"
34038 #: ../src/guestfs-actions.pod:7841
34039 msgid "This is the \"va_list variant\" of L</guestfs_tune2fs>."
34043 #: ../src/guestfs-actions.pod:7845
34044 msgid "guestfs_tune2fs_argv"
34048 #: ../src/guestfs-actions.pod:7847
34052 " guestfs_tune2fs_argv (guestfs_h *g,\n"
34053 " const char *device,\n"
34054 " const struct guestfs_tune2fs_argv *optargs);\n"
34059 #: ../src/guestfs-actions.pod:7852
34060 msgid "This is the \"argv variant\" of L</guestfs_tune2fs>."
34064 #: ../src/guestfs-actions.pod:7856
34065 msgid "guestfs_tune2fs_l"
34069 #: ../src/guestfs-actions.pod:7858
34073 " guestfs_tune2fs_l (guestfs_h *g,\n"
34074 " const char *device);\n"
34079 #: ../src/guestfs-actions.pod:7878
34080 msgid "guestfs_txz_in"
34084 #: ../src/guestfs-actions.pod:7880
34088 " guestfs_txz_in (guestfs_h *g,\n"
34089 " const char *tarball,\n"
34090 " const char *directory);\n"
34095 #: ../src/guestfs-actions.pod:7892
34096 msgid "guestfs_txz_out"
34100 #: ../src/guestfs-actions.pod:7894
34104 " guestfs_txz_out (guestfs_h *g,\n"
34105 " const char *directory,\n"
34106 " const char *tarball);\n"
34111 #: ../src/guestfs-actions.pod:7906
34112 msgid "guestfs_umask"
34116 #: ../src/guestfs-actions.pod:7908
34120 " guestfs_umask (guestfs_h *g,\n"
34126 #: ../src/guestfs-actions.pod:7924
34128 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
34129 "C<guestfs_mkdir>."
34133 #: ../src/guestfs-actions.pod:7933
34134 msgid "guestfs_umount"
34138 #: ../src/guestfs-actions.pod:7935
34142 " guestfs_umount (guestfs_h *g,\n"
34143 " const char *pathordevice);\n"
34148 #: ../src/guestfs-actions.pod:7947
34149 msgid "guestfs_umount_all"
34153 #: ../src/guestfs-actions.pod:7949
34157 " guestfs_umount_all (guestfs_h *g);\n"
34162 #: ../src/guestfs-actions.pod:7960
34163 msgid "guestfs_upload"
34167 #: ../src/guestfs-actions.pod:7962
34171 " guestfs_upload (guestfs_h *g,\n"
34172 " const char *filename,\n"
34173 " const char *remotefilename);\n"
34178 #: ../src/guestfs-actions.pod:7972
34179 msgid "See also C<guestfs_download>."
34183 #: ../src/guestfs-actions.pod:7983
34184 msgid "guestfs_upload_offset"
34188 #: ../src/guestfs-actions.pod:7985
34192 " guestfs_upload_offset (guestfs_h *g,\n"
34193 " const char *filename,\n"
34194 " const char *remotefilename,\n"
34195 " int64_t offset);\n"
34200 #: ../src/guestfs-actions.pod:8001
34202 "Note that there is no limit on the amount of data that can be uploaded with "
34203 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
34204 "full amount unless an error occurs."
34208 #: ../src/guestfs-actions.pod:8006
34209 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
34213 #: ../src/guestfs-actions.pod:8017
34214 msgid "guestfs_utimens"
34218 #: ../src/guestfs-actions.pod:8019
34222 " guestfs_utimens (guestfs_h *g,\n"
34223 " const char *path,\n"
34224 " int64_t atsecs,\n"
34225 " int64_t atnsecs,\n"
34226 " int64_t mtsecs,\n"
34227 " int64_t mtnsecs);\n"
34232 #: ../src/guestfs-actions.pod:8048 ../src/guestfs-structs.pod:175
34233 msgid "guestfs_version"
34237 #: ../src/guestfs-actions.pod:8050
34240 " struct guestfs_version *\n"
34241 " guestfs_version (guestfs_h *g);\n"
34246 #: ../src/guestfs-actions.pod:8078
34248 "I<Note:> Don't use this call to test for availability of features. In "
34249 "enterprise distributions we backport features from later versions into "
34250 "earlier versions, making this an unreliable way to test for features. Use "
34251 "C<guestfs_available> instead."
34255 #: ../src/guestfs-actions.pod:8084
34257 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
34258 "error. I<The caller must call C<guestfs_free_version> after use>."
34262 #: ../src/guestfs-actions.pod:8088
34263 msgid "(Added in 1.0.58)"
34267 #: ../src/guestfs-actions.pod:8090
34268 msgid "guestfs_vfs_label"
34272 #: ../src/guestfs-actions.pod:8092
34276 " guestfs_vfs_label (guestfs_h *g,\n"
34277 " const char *device);\n"
34282 #: ../src/guestfs-actions.pod:8101
34283 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
34287 #: ../src/guestfs-actions.pod:8106 ../src/guestfs-actions.pod:8143
34288 msgid "(Added in 1.3.18)"
34292 #: ../src/guestfs-actions.pod:8108
34293 msgid "guestfs_vfs_type"
34297 #: ../src/guestfs-actions.pod:8110
34301 " guestfs_vfs_type (guestfs_h *g,\n"
34302 " const char *device);\n"
34307 #: ../src/guestfs-actions.pod:8127
34308 msgid "guestfs_vfs_uuid"
34312 #: ../src/guestfs-actions.pod:8129
34316 " guestfs_vfs_uuid (guestfs_h *g,\n"
34317 " const char *device);\n"
34322 #: ../src/guestfs-actions.pod:8138
34323 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
34327 #: ../src/guestfs-actions.pod:8145
34328 msgid "guestfs_vg_activate"
34332 #: ../src/guestfs-actions.pod:8147
34336 " guestfs_vg_activate (guestfs_h *g,\n"
34338 " char *const *volgroups);\n"
34343 #: ../src/guestfs-actions.pod:8164
34344 msgid "guestfs_vg_activate_all"
34348 #: ../src/guestfs-actions.pod:8166
34352 " guestfs_vg_activate_all (guestfs_h *g,\n"
34353 " int activate);\n"
34358 #: ../src/guestfs-actions.pod:8179
34359 msgid "guestfs_vgcreate"
34363 #: ../src/guestfs-actions.pod:8181
34367 " guestfs_vgcreate (guestfs_h *g,\n"
34368 " const char *volgroup,\n"
34369 " char *const *physvols);\n"
34374 #: ../src/guestfs-actions.pod:8193
34375 msgid "guestfs_vglvuuids"
34379 #: ../src/guestfs-actions.pod:8195
34383 " guestfs_vglvuuids (guestfs_h *g,\n"
34384 " const char *vgname);\n"
34389 #: ../src/guestfs-actions.pod:8202
34391 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
34392 "associate logical volumes and volume groups."
34396 #: ../src/guestfs-actions.pod:8205
34397 msgid "See also C<guestfs_vgpvuuids>."
34401 #: ../src/guestfs-actions.pod:8213
34402 msgid "guestfs_vgpvuuids"
34406 #: ../src/guestfs-actions.pod:8215
34410 " guestfs_vgpvuuids (guestfs_h *g,\n"
34411 " const char *vgname);\n"
34416 #: ../src/guestfs-actions.pod:8222
34418 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
34419 "associate physical volumes and volume groups."
34423 #: ../src/guestfs-actions.pod:8225
34424 msgid "See also C<guestfs_vglvuuids>."
34428 #: ../src/guestfs-actions.pod:8233
34429 msgid "guestfs_vgremove"
34433 #: ../src/guestfs-actions.pod:8235
34437 " guestfs_vgremove (guestfs_h *g,\n"
34438 " const char *vgname);\n"
34443 #: ../src/guestfs-actions.pod:8248
34444 msgid "guestfs_vgrename"
34448 #: ../src/guestfs-actions.pod:8250
34452 " guestfs_vgrename (guestfs_h *g,\n"
34453 " const char *volgroup,\n"
34454 " const char *newvolgroup);\n"
34459 #: ../src/guestfs-actions.pod:8261
34460 msgid "guestfs_vgs"
34464 #: ../src/guestfs-actions.pod:8263
34468 " guestfs_vgs (guestfs_h *g);\n"
34473 #: ../src/guestfs-actions.pod:8272
34474 msgid "See also C<guestfs_vgs_full>."
34478 #: ../src/guestfs-actions.pod:8280
34479 msgid "guestfs_vgs_full"
34483 #: ../src/guestfs-actions.pod:8282
34486 " struct guestfs_lvm_vg_list *\n"
34487 " guestfs_vgs_full (guestfs_h *g);\n"
34492 #: ../src/guestfs-actions.pod:8288
34494 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
34495 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
34499 #: ../src/guestfs-actions.pod:8294
34500 msgid "guestfs_vgscan"
34504 #: ../src/guestfs-actions.pod:8296
34508 " guestfs_vgscan (guestfs_h *g);\n"
34513 #: ../src/guestfs-actions.pod:8306
34514 msgid "guestfs_vguuid"
34518 #: ../src/guestfs-actions.pod:8308
34522 " guestfs_vguuid (guestfs_h *g,\n"
34523 " const char *vgname);\n"
34528 #: ../src/guestfs-actions.pod:8319
34529 msgid "guestfs_wait_ready"
34533 #: ../src/guestfs-actions.pod:8321
34537 " guestfs_wait_ready (guestfs_h *g);\n"
34542 #: ../src/guestfs-actions.pod:8324
34544 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
34549 #: ../src/guestfs-actions.pod:8331
34550 msgid "This function is a no op."
34554 #: ../src/guestfs-actions.pod:8333
34556 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
34557 "calling C<guestfs_launch> to wait for the launch to complete. However this "
34558 "is no longer necessary because C<guestfs_launch> now does the waiting."
34562 #: ../src/guestfs-actions.pod:8338
34564 "If you see any calls to this function in code then you can just remove them, "
34565 "unless you want to retain compatibility with older versions of the API."
34569 #: ../src/guestfs-actions.pod:8346
34570 msgid "guestfs_wc_c"
34574 #: ../src/guestfs-actions.pod:8348
34578 " guestfs_wc_c (guestfs_h *g,\n"
34579 " const char *path);\n"
34584 #: ../src/guestfs-actions.pod:8359
34585 msgid "guestfs_wc_l"
34589 #: ../src/guestfs-actions.pod:8361
34593 " guestfs_wc_l (guestfs_h *g,\n"
34594 " const char *path);\n"
34599 #: ../src/guestfs-actions.pod:8372
34600 msgid "guestfs_wc_w"
34604 #: ../src/guestfs-actions.pod:8374
34608 " guestfs_wc_w (guestfs_h *g,\n"
34609 " const char *path);\n"
34614 #: ../src/guestfs-actions.pod:8385
34615 msgid "guestfs_write"
34619 #: ../src/guestfs-actions.pod:8387
34623 " guestfs_write (guestfs_h *g,\n"
34624 " const char *path,\n"
34625 " const char *content,\n"
34626 " size_t content_size);\n"
34631 #: ../src/guestfs-actions.pod:8396
34632 msgid "See also C<guestfs_write_append>."
34636 #: ../src/guestfs-actions.pod:8405
34637 msgid "guestfs_write_append"
34641 #: ../src/guestfs-actions.pod:8407
34645 " guestfs_write_append (guestfs_h *g,\n"
34646 " const char *path,\n"
34647 " const char *content,\n"
34648 " size_t content_size);\n"
34653 #: ../src/guestfs-actions.pod:8416
34654 msgid "See also C<guestfs_write>."
34658 #: ../src/guestfs-actions.pod:8425
34659 msgid "guestfs_write_file"
34663 #: ../src/guestfs-actions.pod:8427
34667 " guestfs_write_file (guestfs_h *g,\n"
34668 " const char *path,\n"
34669 " const char *content,\n"
34675 #: ../src/guestfs-actions.pod:8433
34677 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
34682 #: ../src/guestfs-actions.pod:8458
34683 msgid "guestfs_zegrep"
34687 #: ../src/guestfs-actions.pod:8460
34691 " guestfs_zegrep (guestfs_h *g,\n"
34692 " const char *regex,\n"
34693 " const char *path);\n"
34698 #: ../src/guestfs-actions.pod:8477
34699 msgid "guestfs_zegrepi"
34703 #: ../src/guestfs-actions.pod:8479
34707 " guestfs_zegrepi (guestfs_h *g,\n"
34708 " const char *regex,\n"
34709 " const char *path);\n"
34714 #: ../src/guestfs-actions.pod:8496
34715 msgid "guestfs_zero"
34719 #: ../src/guestfs-actions.pod:8498
34723 " guestfs_zero (guestfs_h *g,\n"
34724 " const char *device);\n"
34729 #: ../src/guestfs-actions.pod:8512
34731 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
34732 "C<guestfs_is_zero_device>"
34736 #: ../src/guestfs-actions.pod:8524
34737 msgid "guestfs_zero_device"
34741 #: ../src/guestfs-actions.pod:8526
34745 " guestfs_zero_device (guestfs_h *g,\n"
34746 " const char *device);\n"
34751 #: ../src/guestfs-actions.pod:8530
34753 "This command writes zeroes over the entire C<device>. Compare with "
34754 "C<guestfs_zero> which just zeroes the first few blocks of a device."
34758 #: ../src/guestfs-actions.pod:8545
34759 msgid "(Added in 1.3.1)"
34763 #: ../src/guestfs-actions.pod:8547
34764 msgid "guestfs_zerofree"
34768 #: ../src/guestfs-actions.pod:8549
34772 " guestfs_zerofree (guestfs_h *g,\n"
34773 " const char *device);\n"
34778 #: ../src/guestfs-actions.pod:8568
34779 msgid "guestfs_zfgrep"
34783 #: ../src/guestfs-actions.pod:8570
34787 " guestfs_zfgrep (guestfs_h *g,\n"
34788 " const char *pattern,\n"
34789 " const char *path);\n"
34794 #: ../src/guestfs-actions.pod:8587
34795 msgid "guestfs_zfgrepi"
34799 #: ../src/guestfs-actions.pod:8589
34803 " guestfs_zfgrepi (guestfs_h *g,\n"
34804 " const char *pattern,\n"
34805 " const char *path);\n"
34810 #: ../src/guestfs-actions.pod:8606
34811 msgid "guestfs_zfile"
34815 #: ../src/guestfs-actions.pod:8608
34819 " guestfs_zfile (guestfs_h *g,\n"
34820 " const char *meth,\n"
34821 " const char *path);\n"
34826 #: ../src/guestfs-actions.pod:8613
34828 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
34833 #: ../src/guestfs-actions.pod:8625
34835 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
34840 #: ../src/guestfs-actions.pod:8633
34841 msgid "guestfs_zgrep"
34845 #: ../src/guestfs-actions.pod:8635
34849 " guestfs_zgrep (guestfs_h *g,\n"
34850 " const char *regex,\n"
34851 " const char *path);\n"
34856 #: ../src/guestfs-actions.pod:8652
34857 msgid "guestfs_zgrepi"
34861 #: ../src/guestfs-actions.pod:8654
34865 " guestfs_zgrepi (guestfs_h *g,\n"
34866 " const char *regex,\n"
34867 " const char *path);\n"
34872 #: ../src/guestfs-availability.pod:3
34877 #: ../src/guestfs-availability.pod:5
34879 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
34880 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
34881 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
34882 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
34883 "L</guestfs_aug_save> L</guestfs_aug_set>"
34887 #: ../src/guestfs-availability.pod:21
34892 #: ../src/guestfs-availability.pod:23
34893 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
34897 #: ../src/guestfs-availability.pod:26
34902 #: ../src/guestfs-availability.pod:28
34903 msgid "The following functions: L</guestfs_grub_install>"
34907 #: ../src/guestfs-availability.pod:31
34912 #: ../src/guestfs-availability.pod:33
34914 "The following functions: L</guestfs_inotify_add_watch> L</"
34915 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
34916 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
34920 #: ../src/guestfs-availability.pod:41
34921 msgid "B<linuxfsuuid>"
34925 #: ../src/guestfs-availability.pod:43
34927 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
34928 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
34932 #: ../src/guestfs-availability.pod:50
34933 msgid "B<linuxmodules>"
34937 #: ../src/guestfs-availability.pod:52
34938 msgid "The following functions: L</guestfs_modprobe>"
34942 #: ../src/guestfs-availability.pod:55
34943 msgid "B<linuxxattrs>"
34947 #: ../src/guestfs-availability.pod:57
34949 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
34950 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
34951 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
34952 "guestfs_setxattr>"
34956 #: ../src/guestfs-availability.pod:68
34961 #: ../src/guestfs-availability.pod:70
34963 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
34964 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
34965 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
34969 #: ../src/guestfs-availability.pod:79
34974 #: ../src/guestfs-availability.pod:81
34976 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
34977 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
34978 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
34979 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
34980 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
34981 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
34982 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
34986 #: ../src/guestfs-availability.pod:104
34991 #: ../src/guestfs-availability.pod:106
34993 "The following functions: L</guestfs_mdadm_create> L</guestfs_mdadm_detail>"
34997 #: ../src/guestfs-availability.pod:110
35002 #: ../src/guestfs-availability.pod:112
35004 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
35005 "guestfs_mknod_b> L</guestfs_mknod_c>"
35009 #: ../src/guestfs-availability.pod:118
35014 #: ../src/guestfs-availability.pod:120
35015 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
35019 #: ../src/guestfs-availability.pod:123
35020 msgid "B<ntfsprogs>"
35024 #: ../src/guestfs-availability.pod:125
35026 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
35027 "L</guestfs_ntfsresize_size>"
35031 #: ../src/guestfs-availability.pod:130
35032 msgid "B<realpath>"
35036 #: ../src/guestfs-availability.pod:132
35037 msgid "The following functions: L</guestfs_realpath>"
35041 #: ../src/guestfs-availability.pod:135
35046 #: ../src/guestfs-availability.pod:137
35048 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
35049 "guestfs_scrub_freespace>"
35053 #: ../src/guestfs-availability.pod:142
35058 #: ../src/guestfs-availability.pod:144
35059 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
35063 #: ../src/guestfs-availability.pod:148
35068 #: ../src/guestfs-availability.pod:150
35069 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
35073 #: ../src/guestfs-availability.pod:154
35074 msgid "B<zerofree>"
35078 #: ../src/guestfs-availability.pod:156
35079 msgid "The following functions: L</guestfs_zerofree>"
35083 #: ../src/guestfs-structs.pod:1
35084 msgid "guestfs_int_bool"
35088 #: ../src/guestfs-structs.pod:3
35091 " struct guestfs_int_bool {\n"
35099 #: ../src/guestfs-structs.pod:8
35102 " struct guestfs_int_bool_list {\n"
35103 " uint32_t len; /* Number of elements in list. */\n"
35104 " struct guestfs_int_bool *val; /* Elements. */\n"
35110 #: ../src/guestfs-structs.pod:13
35113 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
35114 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
35119 #: ../src/guestfs-structs.pod:16
35120 msgid "guestfs_lvm_pv"
35124 #: ../src/guestfs-structs.pod:18
35127 " struct guestfs_lvm_pv {\n"
35128 " char *pv_name;\n"
35129 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
35130 " char pv_uuid[32];\n"
35132 " uint64_t pv_size;\n"
35133 " uint64_t dev_size;\n"
35134 " uint64_t pv_free;\n"
35135 " uint64_t pv_used;\n"
35136 " char *pv_attr;\n"
35137 " int64_t pv_pe_count;\n"
35138 " int64_t pv_pe_alloc_count;\n"
35139 " char *pv_tags;\n"
35140 " uint64_t pe_start;\n"
35141 " int64_t pv_mda_count;\n"
35142 " uint64_t pv_mda_free;\n"
35148 #: ../src/guestfs-structs.pod:36
35151 " struct guestfs_lvm_pv_list {\n"
35152 " uint32_t len; /* Number of elements in list. */\n"
35153 " struct guestfs_lvm_pv *val; /* Elements. */\n"
35159 #: ../src/guestfs-structs.pod:41
35162 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
35163 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
35168 #: ../src/guestfs-structs.pod:44
35169 msgid "guestfs_lvm_vg"
35173 #: ../src/guestfs-structs.pod:46
35176 " struct guestfs_lvm_vg {\n"
35177 " char *vg_name;\n"
35178 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
35179 " char vg_uuid[32];\n"
35181 " char *vg_attr;\n"
35182 " uint64_t vg_size;\n"
35183 " uint64_t vg_free;\n"
35184 " char *vg_sysid;\n"
35185 " uint64_t vg_extent_size;\n"
35186 " int64_t vg_extent_count;\n"
35187 " int64_t vg_free_count;\n"
35188 " int64_t max_lv;\n"
35189 " int64_t max_pv;\n"
35190 " int64_t pv_count;\n"
35191 " int64_t lv_count;\n"
35192 " int64_t snap_count;\n"
35193 " int64_t vg_seqno;\n"
35194 " char *vg_tags;\n"
35195 " int64_t vg_mda_count;\n"
35196 " uint64_t vg_mda_free;\n"
35202 #: ../src/guestfs-structs.pod:69
35205 " struct guestfs_lvm_vg_list {\n"
35206 " uint32_t len; /* Number of elements in list. */\n"
35207 " struct guestfs_lvm_vg *val; /* Elements. */\n"
35213 #: ../src/guestfs-structs.pod:74
35216 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
35217 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
35222 #: ../src/guestfs-structs.pod:77
35223 msgid "guestfs_lvm_lv"
35227 #: ../src/guestfs-structs.pod:79
35230 " struct guestfs_lvm_lv {\n"
35231 " char *lv_name;\n"
35232 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
35233 " char lv_uuid[32];\n"
35234 " char *lv_attr;\n"
35235 " int64_t lv_major;\n"
35236 " int64_t lv_minor;\n"
35237 " int64_t lv_kernel_major;\n"
35238 " int64_t lv_kernel_minor;\n"
35239 " uint64_t lv_size;\n"
35240 " int64_t seg_count;\n"
35242 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
35243 " float snap_percent;\n"
35244 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
35245 " float copy_percent;\n"
35246 " char *move_pv;\n"
35247 " char *lv_tags;\n"
35248 " char *mirror_log;\n"
35249 " char *modules;\n"
35255 #: ../src/guestfs-structs.pod:101
35258 " struct guestfs_lvm_lv_list {\n"
35259 " uint32_t len; /* Number of elements in list. */\n"
35260 " struct guestfs_lvm_lv *val; /* Elements. */\n"
35266 #: ../src/guestfs-structs.pod:106
35269 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
35270 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
35275 #: ../src/guestfs-structs.pod:111
35278 " struct guestfs_stat {\n"
35282 " int64_t nlink;\n"
35287 " int64_t blksize;\n"
35288 " int64_t blocks;\n"
35289 " int64_t atime;\n"
35290 " int64_t mtime;\n"
35291 " int64_t ctime;\n"
35297 #: ../src/guestfs-structs.pod:127
35300 " struct guestfs_stat_list {\n"
35301 " uint32_t len; /* Number of elements in list. */\n"
35302 " struct guestfs_stat *val; /* Elements. */\n"
35308 #: ../src/guestfs-structs.pod:132
35311 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
35312 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
35317 #: ../src/guestfs-structs.pod:137
35320 " struct guestfs_statvfs {\n"
35321 " int64_t bsize;\n"
35322 " int64_t frsize;\n"
35323 " int64_t blocks;\n"
35324 " int64_t bfree;\n"
35325 " int64_t bavail;\n"
35326 " int64_t files;\n"
35327 " int64_t ffree;\n"
35328 " int64_t favail;\n"
35331 " int64_t namemax;\n"
35337 #: ../src/guestfs-structs.pod:151
35340 " struct guestfs_statvfs_list {\n"
35341 " uint32_t len; /* Number of elements in list. */\n"
35342 " struct guestfs_statvfs *val; /* Elements. */\n"
35348 #: ../src/guestfs-structs.pod:156
35351 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
35352 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
35357 #: ../src/guestfs-structs.pod:159
35358 msgid "guestfs_dirent"
35362 #: ../src/guestfs-structs.pod:161
35365 " struct guestfs_dirent {\n"
35374 #: ../src/guestfs-structs.pod:167
35377 " struct guestfs_dirent_list {\n"
35378 " uint32_t len; /* Number of elements in list. */\n"
35379 " struct guestfs_dirent *val; /* Elements. */\n"
35385 #: ../src/guestfs-structs.pod:172
35388 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
35389 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
35394 #: ../src/guestfs-structs.pod:177
35397 " struct guestfs_version {\n"
35398 " int64_t major;\n"
35399 " int64_t minor;\n"
35400 " int64_t release;\n"
35407 #: ../src/guestfs-structs.pod:184
35410 " struct guestfs_version_list {\n"
35411 " uint32_t len; /* Number of elements in list. */\n"
35412 " struct guestfs_version *val; /* Elements. */\n"
35418 #: ../src/guestfs-structs.pod:189
35421 " void guestfs_free_version (struct guestfs_free_version *);\n"
35422 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
35427 #: ../src/guestfs-structs.pod:192
35428 msgid "guestfs_xattr"
35432 #: ../src/guestfs-structs.pod:194
35435 " struct guestfs_xattr {\n"
35436 " char *attrname;\n"
35437 " /* The next two fields describe a byte array. */\n"
35438 " uint32_t attrval_len;\n"
35439 " char *attrval;\n"
35445 #: ../src/guestfs-structs.pod:201
35448 " struct guestfs_xattr_list {\n"
35449 " uint32_t len; /* Number of elements in list. */\n"
35450 " struct guestfs_xattr *val; /* Elements. */\n"
35456 #: ../src/guestfs-structs.pod:206
35459 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
35460 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
35465 #: ../src/guestfs-structs.pod:209
35466 msgid "guestfs_inotify_event"
35470 #: ../src/guestfs-structs.pod:211
35473 " struct guestfs_inotify_event {\n"
35474 " int64_t in_wd;\n"
35475 " uint32_t in_mask;\n"
35476 " uint32_t in_cookie;\n"
35477 " char *in_name;\n"
35483 #: ../src/guestfs-structs.pod:218
35486 " struct guestfs_inotify_event_list {\n"
35487 " uint32_t len; /* Number of elements in list. */\n"
35488 " struct guestfs_inotify_event *val; /* Elements. */\n"
35494 #: ../src/guestfs-structs.pod:223
35497 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
35498 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
35503 #: ../src/guestfs-structs.pod:226
35504 msgid "guestfs_partition"
35508 #: ../src/guestfs-structs.pod:228
35511 " struct guestfs_partition {\n"
35512 " int32_t part_num;\n"
35513 " uint64_t part_start;\n"
35514 " uint64_t part_end;\n"
35515 " uint64_t part_size;\n"
35521 #: ../src/guestfs-structs.pod:235
35524 " struct guestfs_partition_list {\n"
35525 " uint32_t len; /* Number of elements in list. */\n"
35526 " struct guestfs_partition *val; /* Elements. */\n"
35532 #: ../src/guestfs-structs.pod:240
35535 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
35536 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
35541 #: ../src/guestfs-structs.pod:243
35542 msgid "guestfs_application"
35546 #: ../src/guestfs-structs.pod:245
35549 " struct guestfs_application {\n"
35550 " char *app_name;\n"
35551 " char *app_display_name;\n"
35552 " int32_t app_epoch;\n"
35553 " char *app_version;\n"
35554 " char *app_release;\n"
35555 " char *app_install_path;\n"
35556 " char *app_trans_path;\n"
35557 " char *app_publisher;\n"
35558 " char *app_url;\n"
35559 " char *app_source_package;\n"
35560 " char *app_summary;\n"
35561 " char *app_description;\n"
35567 #: ../src/guestfs-structs.pod:260
35570 " struct guestfs_application_list {\n"
35571 " uint32_t len; /* Number of elements in list. */\n"
35572 " struct guestfs_application *val; /* Elements. */\n"
35578 #: ../src/guestfs-structs.pod:265
35581 " void guestfs_free_application (struct guestfs_free_application *);\n"
35582 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
35587 #: ../src/guestfs.pod:5
35588 msgid "guestfs - Library for accessing and modifying virtual machine images"
35592 #: ../src/guestfs.pod:11
35595 " guestfs_h *g = guestfs_create ();\n"
35596 " guestfs_add_drive (g, \"guest.img\");\n"
35597 " guestfs_launch (g);\n"
35598 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
35599 " guestfs_touch (g, \"/hello\");\n"
35600 " guestfs_umount (g, \"/\");\n"
35601 " guestfs_close (g);\n"
35604 " guestfs_h *g = guestfs_create ();\n"
35605 " guestfs_add_drive (g, \"guest.img\");\n"
35606 " guestfs_launch (g);\n"
35607 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
35608 " guestfs_touch (g, \"/hello\");\n"
35609 " guestfs_umount (g, \"/\");\n"
35610 " guestfs_close (g);\n"
35614 #: ../src/guestfs.pod:25
35616 "Libguestfs is a library for accessing and modifying guest disk images. "
35617 "Amongst the things this is good for: making batch configuration changes to "
35618 "guests, getting disk used/free statistics (see also: virt-df), migrating "
35619 "between virtualization systems (see also: virt-p2v), performing partial "
35620 "backups, performing partial guest clones, cloning guests and changing "
35621 "registry/UUID/hostname info, and much else besides."
35625 #: ../src/guestfs.pod:33
35627 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
35628 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
35629 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
35634 #: ../src/guestfs.pod:38
35636 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
35637 "what filesystem is in each LV, etc.). It can also run commands in the "
35638 "context of the guest. Also you can access filesystems over FUSE."
35642 #: ../src/guestfs.pod:43
35644 "Libguestfs is a library that can be linked with C and C++ management "
35645 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
35646 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
35651 #: ../src/guestfs.pod:48
35653 "You don't need to be root to use libguestfs, although obviously you do need "
35654 "enough permissions to access the disk images."
35658 #: ../src/guestfs.pod:51
35660 "Libguestfs is a large API because it can do many things. For a gentle "
35661 "introduction, please read the L</API OVERVIEW> section next."
35665 #: ../src/guestfs.pod:54
35667 "There are also some example programs in the L<guestfs-examples(3)> manual "
35672 #: ../src/guestfs.pod:57
35673 msgid "API OVERVIEW"
35677 #: ../src/guestfs.pod:59
35679 "This section provides a gentler overview of the libguestfs API. We also try "
35680 "to group API calls together, where that may not be obvious from reading "
35681 "about the individual calls in the main section of this manual."
35685 #: ../src/guestfs.pod:64
35690 #: ../src/guestfs.pod:66
35692 "Before you can use libguestfs calls, you have to create a handle. Then you "
35693 "must add at least one disk image to the handle, followed by launching the "
35694 "handle, then performing whatever operations you want, and finally closing "
35695 "the handle. By convention we use the single letter C<g> for the name of the "
35696 "handle variable, although of course you can use any name you want."
35700 #: ../src/guestfs.pod:73
35701 msgid "The general structure of all libguestfs-using programs looks like this:"
35705 #: ../src/guestfs.pod:76
35708 " guestfs_h *g = guestfs_create ();\n"
35713 #: ../src/guestfs.pod:78
35716 " /* Call guestfs_add_drive additional times if there are\n"
35717 " * multiple disk images.\n"
35719 " guestfs_add_drive (g, \"guest.img\");\n"
35724 #: ../src/guestfs.pod:83
35727 " /* Most manipulation calls won't work until you've launched\n"
35728 " * the handle 'g'. You have to do this _after_ adding drives\n"
35729 " * and _before_ other commands.\n"
35731 " guestfs_launch (g);\n"
35736 #: ../src/guestfs.pod:89
35739 " /* Now you can examine what partitions, LVs etc are available.\n"
35741 " char **partitions = guestfs_list_partitions (g);\n"
35742 " char **logvols = guestfs_lvs (g);\n"
35747 #: ../src/guestfs.pod:94
35750 " /* To access a filesystem in the image, you must mount it.\n"
35752 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
35757 #: ../src/guestfs.pod:98
35760 " /* Now you can perform filesystem actions on the guest\n"
35763 " guestfs_touch (g, \"/hello\");\n"
35768 #: ../src/guestfs.pod:103
35771 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
35772 " * it is done automatically when you close the handle. See\n"
35773 " * discussion of autosync in this page.\n"
35775 " guestfs_sync (g);\n"
35780 #: ../src/guestfs.pod:109
35783 " /* Close the handle 'g'. */\n"
35784 " guestfs_close (g);\n"
35789 #: ../src/guestfs.pod:112
35791 "The code above doesn't include any error checking. In real code you should "
35792 "check return values carefully for errors. In general all functions that "
35793 "return integers return C<-1> on error, and all functions that return "
35794 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
35795 "how to handle errors, and consult the documentation for each function call "
35796 "below to see precisely how they return error indications. See L<guestfs-"
35797 "examples(3)> for fully worked examples."
35801 #: ../src/guestfs.pod:121
35802 msgid "DISK IMAGES"
35806 #: ../src/guestfs.pod:123
35808 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
35809 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
35810 "actual block device, or simply an empty file of zeroes that you have created "
35811 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
35816 #: ../src/guestfs.pod:129
35818 "The call you should use in modern code for adding drives is L</"
35819 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
35820 "specifying that the format is raw, do:"
35824 #: ../src/guestfs.pod:133
35827 " guestfs_add_drive_opts (g, filename,\n"
35828 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
35834 #: ../src/guestfs.pod:137
35835 msgid "You can add a disk read-only using:"
35839 #: ../src/guestfs.pod:139
35842 " guestfs_add_drive_opts (g, filename,\n"
35843 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
35844 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35850 #: ../src/guestfs.pod:144
35852 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
35853 "libguestfs won't modify the file."
35857 #: ../src/guestfs.pod:147
35859 "Be extremely cautious if the disk image is in use, eg. if it is being used "
35860 "by a virtual machine. Adding it read-write will almost certainly cause disk "
35861 "corruption, but adding it read-only is safe."
35865 #: ../src/guestfs.pod:151
35867 "You must add at least one disk image, and you may add multiple disk images. "
35868 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
35869 "first one you added), C</dev/sdb> (for the second one you added), etc."
35873 #: ../src/guestfs.pod:156
35875 "Once L</guestfs_launch> has been called you cannot add any more images. You "
35876 "can call L</guestfs_list_devices> to get a list of the device names, in the "
35877 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
35881 #: ../src/guestfs.pod:161
35886 #: ../src/guestfs.pod:163
35888 "Before you can read or write files, create directories and so on in a disk "
35889 "image that contains filesystems, you have to mount those filesystems using "
35890 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
35891 "a disk image contains (for example) one partition with a filesystem on that "
35892 "partition, then you can mount it directly:"
35896 #: ../src/guestfs.pod:170
35899 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
35904 #: ../src/guestfs.pod:172
35906 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
35907 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
35908 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
35909 "that these are libguestfs virtual devices, and are nothing to do with host "
35914 #: ../src/guestfs.pod:178
35916 "If you are given a disk image and you don't know what it contains then you "
35917 "have to find out. Libguestfs can do that too: use L</"
35918 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
35919 "LVs, and either try mounting each to see what is mountable, or else examine "
35920 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
35921 "filesystems, use L</guestfs_list_filesystems>."
35925 #: ../src/guestfs.pod:186
35927 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
35928 "L</INSPECTION> below). But you might find it easier to look at higher level "
35929 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
35933 #: ../src/guestfs.pod:191
35935 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
35936 "several other variations of the C<guestfs_mount_*> call."
35940 #: ../src/guestfs.pod:194
35941 msgid "FILESYSTEM ACCESS AND MODIFICATION"
35945 #: ../src/guestfs.pod:196
35947 "The majority of the libguestfs API consists of fairly low-level calls for "
35948 "accessing and modifying the files, directories, symlinks etc on mounted "
35949 "filesystems. There are over a hundred such calls which you can find listed "
35950 "in detail below in this man page, and we don't even pretend to cover them "
35951 "all in this overview."
35955 #: ../src/guestfs.pod:202
35957 "Specify filenames as full paths, starting with C<\"/\"> and including the "
35962 #: ../src/guestfs.pod:205
35964 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
35965 "the file called C<\"etc/passwd\"> then you could do:"
35969 #: ../src/guestfs.pod:208
35972 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
35977 #: ../src/guestfs.pod:210
35979 "This would return C<data> as a newly allocated buffer containing the full "
35980 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
35981 "or C<NULL> if there was an error."
35985 #: ../src/guestfs.pod:214
35987 "As another example, to create a top-level directory on that filesystem "
35988 "called C<\"var\"> you would do:"
35992 #: ../src/guestfs.pod:217
35995 " guestfs_mkdir (g, \"/var\");\n"
36000 #: ../src/guestfs.pod:219
36001 msgid "To create a symlink you could do:"
36005 #: ../src/guestfs.pod:221
36008 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
36009 " \"/etc/rc3.d/S30portmap\");\n"
36014 #: ../src/guestfs.pod:224
36016 "Libguestfs will reject attempts to use relative paths and there is no "
36017 "concept of a current working directory."
36021 #: ../src/guestfs.pod:227
36023 "Libguestfs can return errors in many situations: for example if the "
36024 "filesystem isn't writable, or if a file or directory that you requested "
36025 "doesn't exist. If you are using the C API (documented here) you have to "
36026 "check for those error conditions after each call. (Other language bindings "
36027 "turn these errors into exceptions)."
36031 #: ../src/guestfs.pod:233
36033 "File writes are affected by the per-handle umask, set by calling L</"
36034 "guestfs_umask> and defaulting to 022. See L</UMASK>."
36038 #: ../src/guestfs.pod:236
36039 msgid "PARTITIONING"
36043 #: ../src/guestfs.pod:238
36045 "Libguestfs contains API calls to read, create and modify partition tables on "
36050 #: ../src/guestfs.pod:241
36052 "In the common case where you want to create a single partition covering the "
36053 "whole disk, you should use the L</guestfs_part_disk> call:"
36057 #: ../src/guestfs.pod:245
36060 " const char *parttype = \"mbr\";\n"
36061 " if (disk_is_larger_than_2TB)\n"
36062 " parttype = \"gpt\";\n"
36063 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
36068 #: ../src/guestfs.pod:250
36070 "Obviously this effectively wipes anything that was on that disk image before."
36074 #: ../src/guestfs.pod:253
36079 #: ../src/guestfs.pod:255
36081 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
36082 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
36083 "you familiarize yourself with the concepts of physical volumes, volume "
36084 "groups and logical volumes."
36088 #: ../src/guestfs.pod:260
36090 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
36091 "tldp.org/HOWTO/LVM-HOWTO/>."
36095 #: ../src/guestfs.pod:263
36096 msgid "DOWNLOADING"
36100 #: ../src/guestfs.pod:265
36102 "Use L</guestfs_cat> to download small, text only files. This call is "
36103 "limited to files which are less than 2 MB and which cannot contain any ASCII "
36104 "NUL (C<\\0>) characters. However the API is very simple to use."
36108 #: ../src/guestfs.pod:269
36110 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
36111 "bit data, since it returns a (pointer, size) pair. However it is still "
36112 "limited to \"small\" files, less than 2 MB."
36116 #: ../src/guestfs.pod:273
36118 "L</guestfs_download> can be used to download any file, with no limits on "
36119 "content or size (even files larger than 4 GB)."
36123 #: ../src/guestfs.pod:276
36125 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
36129 #: ../src/guestfs.pod:279
36134 #: ../src/guestfs.pod:281
36136 "It's often the case that you want to write a file or files to the disk image."
36140 #: ../src/guestfs.pod:284
36142 "To write a small file with fixed content, use L</guestfs_write>. To create "
36143 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
36144 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
36145 "of other functions for creating test files, for example L</guestfs_fill> and "
36146 "L</guestfs_fill_pattern>."
36150 #: ../src/guestfs.pod:290
36152 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
36153 "file content or size (even files larger than 4 GB)."
36157 #: ../src/guestfs.pod:293
36159 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
36163 #: ../src/guestfs.pod:295
36165 "However the fastest way to upload I<large numbers of arbitrary files> is to "
36166 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
36167 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
36168 "in a predictable way (eg. adding it last after all other drives) then you "
36169 "can get the device name from L</guestfs_list_devices> and mount it directly "
36170 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
36171 "portable between kernel versions, and they don't support labels or UUIDs. "
36172 "If you want to pre-build an image or you need to mount it using a label or "
36173 "UUID, use an ISO image instead."
36177 #: ../src/guestfs.pod:306
36182 #: ../src/guestfs.pod:308
36184 "There are various different commands for copying between files and devices "
36185 "and in and out of the guest filesystem. These are summarised in the table "
36190 #: ../src/guestfs.pod:314
36191 msgid "B<file> to B<file>"
36195 #: ../src/guestfs.pod:316
36197 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
36198 "directories recursively."
36202 #: ../src/guestfs.pod:319
36204 "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
36208 #: ../src/guestfs.pod:322
36209 msgid "B<file> to B<device>"
36213 #: ../src/guestfs.pod:324
36214 msgid "B<device> to B<file>"
36218 #: ../src/guestfs.pod:326
36219 msgid "B<device> to B<device>"
36223 #: ../src/guestfs.pod:328
36225 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or L</"
36226 "guestfs_copy_device_to_device>."
36230 #: ../src/guestfs.pod:331
36231 msgid "Example: duplicate the contents of an LV:"
36235 #: ../src/guestfs.pod:333
36238 " guestfs_copy_device_to_device (g,\n"
36239 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
36240 " /* -1 marks the end of the list of optional parameters */\n"
36246 #: ../src/guestfs.pod:338
36248 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
36249 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
36250 "optional C<size> parameter:"
36254 #: ../src/guestfs.pod:342
36257 " guestfs_copy_device_to_device (g,\n"
36258 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
36259 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
36265 #: ../src/guestfs.pod:347
36266 msgid "B<file on the host> to B<file or device>"
36270 #: ../src/guestfs.pod:349
36271 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
36275 #: ../src/guestfs.pod:351
36276 msgid "B<file or device> to B<file on the host>"
36280 #: ../src/guestfs.pod:353
36281 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
36285 #: ../src/guestfs.pod:357
36286 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
36290 #: ../src/guestfs.pod:359
36292 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
36293 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
36294 "appears you can only upload and download to files. However many Un*x-like "
36295 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
36296 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
36297 "and arbitrary file descriptor N."
36301 #: ../src/guestfs.pod:367
36302 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
36306 #: ../src/guestfs.pod:370
36309 " guestfs_download (g, filename, \"/dev/stdout\");\n"
36314 #: ../src/guestfs.pod:372
36315 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
36319 #: ../src/guestfs.pod:374
36322 " char devfd[64];\n"
36323 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
36324 " guestfs_tar_out (g, \"/\", devfd);\n"
36329 #: ../src/guestfs.pod:378
36330 msgid "LISTING FILES"
36334 #: ../src/guestfs.pod:380
36336 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
36337 "L<guestfish(1)>-equivalent command C<ll>)."
36341 #: ../src/guestfs.pod:383
36343 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
36344 "programs, as a flat list of strings."
36348 #: ../src/guestfs.pod:386
36350 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
36351 "directory, plus additional information about each one. It is more "
36352 "equivalent to using the L<readdir(3)> call on a local filesystem."
36356 #: ../src/guestfs.pod:390
36358 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
36362 #: ../src/guestfs.pod:393
36363 msgid "RUNNING COMMANDS"
36367 #: ../src/guestfs.pod:395
36369 "Although libguestfs is primarily an API for manipulating files inside guest "
36370 "images, we also provide some limited facilities for running commands inside "
36375 #: ../src/guestfs.pod:399
36376 msgid "There are many limitations to this:"
36380 #: ../src/guestfs.pod:405
36382 "The kernel version that the command runs under will be different from what "
36387 #: ../src/guestfs.pod:410
36389 "If the command needs to communicate with daemons, then most likely they "
36390 "won't be running."
36394 #: ../src/guestfs.pod:415
36395 msgid "The command will be running in limited memory."
36399 #: ../src/guestfs.pod:419
36401 "The network may not be available unless you enable it (see L</"
36402 "guestfs_set_network>)."
36406 #: ../src/guestfs.pod:424
36407 msgid "Only supports Linux guests (not Windows, BSD, etc)."
36411 #: ../src/guestfs.pod:428
36413 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
36417 #: ../src/guestfs.pod:433
36419 "For SELinux guests, you may need to enable SELinux and load policy first. "
36420 "See L</SELINUX> in this manpage."
36424 #: ../src/guestfs.pod:438
36426 "I<Security:> It is not safe to run commands from untrusted, possibly "
36427 "malicious guests. These commands may attempt to exploit your program by "
36428 "sending unexpected output. They could also try to exploit the Linux kernel "
36429 "or qemu provided by the libguestfs appliance. They could use the network "
36430 "provided by the libguestfs appliance to bypass ordinary network partitions "
36431 "and firewalls. They could use the elevated privileges or different SELinux "
36432 "context of your program to their advantage."
36436 #: ../src/guestfs.pod:447
36438 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
36439 "(a script which runs when the guest next boots normally), and to have this "
36440 "script run the commands you want in the normal context of the running guest, "
36441 "network security and so on. For information about other security issues, "
36442 "see L</SECURITY>."
36446 #: ../src/guestfs.pod:455
36448 "The two main API calls to run commands are L</guestfs_command> and L</"
36449 "guestfs_sh> (there are also variations)."
36453 #: ../src/guestfs.pod:458
36455 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
36456 "shell globs, redirections, etc will work."
36460 #: ../src/guestfs.pod:461
36461 msgid "CONFIGURATION FILES"
36465 #: ../src/guestfs.pod:463
36467 "To read and write configuration files in Linux guest filesystems, we "
36468 "strongly recommend using Augeas. For example, Augeas understands how to "
36469 "read and write, say, a Linux shadow password file or X.org configuration "
36470 "file, and so avoids you having to write that code."
36474 #: ../src/guestfs.pod:468
36476 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
36477 "document Augeas itself here because there is excellent documentation on the "
36478 "L<http://augeas.net/> website."
36482 #: ../src/guestfs.pod:472
36484 "If you don't want to use Augeas (you fool!) then try calling L</"
36485 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
36490 #: ../src/guestfs.pod:476
36495 #: ../src/guestfs.pod:478
36497 "We support SELinux guests. To ensure that labeling happens correctly in "
36498 "SELinux guests, you need to enable SELinux and load the guest's policy:"
36502 #: ../src/guestfs.pod:486
36503 msgid "Before launching, do:"
36507 #: ../src/guestfs.pod:488
36510 " guestfs_set_selinux (g, 1);\n"
36515 #: ../src/guestfs.pod:492
36517 "After mounting the guest's filesystem(s), load the policy. This is best "
36518 "done by running the L<load_policy(8)> command in the guest itself:"
36522 #: ../src/guestfs.pod:496
36525 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
36530 #: ../src/guestfs.pod:498
36532 "(Older versions of C<load_policy> require you to specify the name of the "
36537 #: ../src/guestfs.pod:503
36539 "Optionally, set the security context for the API. The correct security "
36540 "context to use can only be known by inspecting the guest. As an example:"
36544 #: ../src/guestfs.pod:507
36547 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
36552 #: ../src/guestfs.pod:511
36553 msgid "This will work for running commands and editing existing files."
36557 #: ../src/guestfs.pod:513
36559 "When new files are created, you may need to label them explicitly, for "
36560 "example by running the external command C<restorecon pathname>."
36564 #: ../src/guestfs.pod:517
36569 #: ../src/guestfs.pod:519
36571 "Certain calls are affected by the current file mode creation mask (the "
36572 "\"umask\"). In particular ones which create files or directories, such as "
36573 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
36574 "either the default mode that the file is created with or modifies the mode "
36579 #: ../src/guestfs.pod:525
36581 "The default umask is C<022>, so files are created with modes such as C<0644> "
36582 "and directories with C<0755>."
36586 #: ../src/guestfs.pod:528
36588 "There are two ways to avoid being affected by umask. Either set umask to 0 "
36589 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
36590 "guestfs_chmod> after creating each file or directory."
36594 #: ../src/guestfs.pod:532
36595 msgid "For more information about umask, see L<umask(2)>."
36599 #: ../src/guestfs.pod:536
36601 "Libguestfs allows you to access Linux guests which have been encrypted using "
36602 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
36603 "standard. This includes nearly all whole disk encryption systems used by "
36604 "modern Linux guests."
36608 #: ../src/guestfs.pod:542
36610 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
36611 "returns the string C<crypto_LUKS>)."
36615 #: ../src/guestfs.pod:545
36617 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
36618 "will require the passphrase!"
36622 #: ../src/guestfs.pod:548
36624 "Opening a LUKS device creates a new device mapper device called C</dev/"
36625 "mapper/mapname> (where C<mapname> is the string you supply to L</"
36626 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
36627 "from and encrypted to the underlying block device respectively."
36631 #: ../src/guestfs.pod:554
36633 "LVM volume groups on the device can be made visible by calling L</"
36634 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
36635 "(s) can now be mounted in the usual way."
36639 #: ../src/guestfs.pod:558
36641 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
36642 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
36643 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
36644 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
36645 "underlying encrypted block device)."
36649 #: ../src/guestfs.pod:565
36654 #: ../src/guestfs.pod:567
36656 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
36657 "contains operating systems, an install CD or a live CD. (These APIs used to "
36658 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
36659 "version 1.5.3 the most frequently used part of this library has been "
36660 "rewritten in C and moved into the core code)."
36664 #: ../src/guestfs.pod:574
36666 "Add all disks belonging to the unknown virtual machine and call L</"
36667 "guestfs_launch> in the usual way."
36671 #: ../src/guestfs.pod:577
36673 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
36674 "and certain heuristics, and returns a list of operating systems that were "
36675 "found. An empty list means none were found. A single element is the root "
36676 "filesystem of the operating system. For dual- or multi-boot guests, "
36677 "multiple roots can be returned, each one corresponding to a separate "
36678 "operating system. (Multi-boot virtual machines are extremely rare in the "
36679 "world of virtualization, but since this scenario can happen, we have built "
36680 "libguestfs to deal with it.)"
36684 #: ../src/guestfs.pod:586
36686 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
36687 "to get additional details about that operating system. For example, call L</"
36688 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
36689 "Windows and Linux-based operating systems respectively."
36693 #: ../src/guestfs.pod:592
36695 "Un*x-like and Linux-based operating systems usually consist of several "
36696 "filesystems which are mounted at boot time (for example, a separate boot "
36697 "partition mounted on C</boot>). The inspection rules are able to detect how "
36698 "filesystems correspond to mount points. Call "
36699 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
36700 "hash table like this example:"
36704 #: ../src/guestfs.pod:599
36707 " /boot => /dev/sda1\n"
36708 " / => /dev/vg_guest/lv_root\n"
36709 " /usr => /dev/vg_guest/lv_usr\n"
36714 #: ../src/guestfs.pod:603
36716 "The caller can then make calls to L</guestfs_mount_options> to mount the "
36717 "filesystems as suggested."
36721 #: ../src/guestfs.pod:606
36723 "Be careful to mount filesystems in the right order (eg. C</> before C</"
36724 "usr>). Sorting the keys of the hash by length, shortest first, should work."
36728 #: ../src/guestfs.pod:610
36730 "Inspection currently only works for some common operating systems. "
36731 "Contributors are welcome to send patches for other operating systems that we "
36732 "currently cannot detect."
36736 #: ../src/guestfs.pod:614
36738 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
36739 "for more details. The L</guestfs_inspect_os> function just ignores any "
36740 "encrypted devices."
36744 #: ../src/guestfs.pod:618
36746 "A note on the implementation: The call L</guestfs_inspect_os> performs "
36747 "inspection and caches the results in the guest handle. Subsequent calls to "
36748 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
36749 "read the disks. If you change the content of the guest disks, you can redo "
36750 "inspection by calling L</guestfs_inspect_os> again. (L</"
36751 "guestfs_inspect_list_applications> works a little differently from the other "
36752 "calls and does read the disks. See documentation for that function for "
36757 #: ../src/guestfs.pod:627
36758 msgid "INSPECTING INSTALL DISKS"
36762 #: ../src/guestfs.pod:629
36764 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
36769 #: ../src/guestfs.pod:632
36771 "Call L</guestfs_inspect_get_format> to return the format of the operating "
36772 "system, which currently can be C<installed> (a regular operating system) or "
36773 "C<installer> (some sort of install disk)."
36777 #: ../src/guestfs.pod:636
36779 "Further information is available about the operating system that can be "
36780 "installed using the regular inspection APIs like L</"
36781 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
36785 #: ../src/guestfs.pod:641
36787 "Some additional information specific to installer disks is also available "
36788 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
36789 "guestfs_inspect_is_multipart> calls."
36793 #: ../src/guestfs.pod:646
36794 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
36798 #: ../src/guestfs.pod:648
36800 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
36801 "ntfs-3g.org/> driver."
36805 #: ../src/guestfs.pod:651
36806 msgid "DRIVE LETTERS AND PATHS"
36810 #: ../src/guestfs.pod:653
36812 "DOS and Windows still use drive letters, and the filesystems are always "
36813 "treated as case insensitive by Windows itself, and therefore you might find "
36814 "a Windows configuration file referring to a path like C<c:\\windows"
36815 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
36816 "might be referred to as C</WINDOWS/System32>."
36820 #: ../src/guestfs.pod:659
36822 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
36823 "L</guestfs_inspect_get_drive_mappings>)"
36827 #: ../src/guestfs.pod:662
36829 "Dealing with separator characters (backslash vs forward slash) is outside "
36830 "the scope of libguestfs, but usually a simple character replacement will "
36835 #: ../src/guestfs.pod:666
36837 "To resolve the case insensitivity of paths, call L</"
36838 "guestfs_case_sensitive_path>."
36842 #: ../src/guestfs.pod:669
36843 msgid "ACCESSING THE WINDOWS REGISTRY"
36847 #: ../src/guestfs.pod:671
36849 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
36850 "files, through the library C<hivex> which is part of the libguestfs project "
36851 "although ships as a separate tarball. You have to locate and download the "
36852 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
36853 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
36854 "reg(1)> for more help on this issue."
36858 #: ../src/guestfs.pod:679
36859 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
36863 #: ../src/guestfs.pod:681
36865 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
36866 "provide something which looks like a Linux symlink. The way it tries to do "
36867 "the rewriting is described here:"
36871 #: ../src/guestfs.pod:685
36873 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
36878 #: ../src/guestfs.pod:687
36880 "The essential problem is that ntfs-3g simply does not have enough "
36881 "information to do a correct job. NTFS links can contain drive letters and "
36882 "references to external device GUIDs that ntfs-3g has no way of resolving. "
36883 "It is almost certainly the case that libguestfs callers should ignore what "
36884 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
36888 #: ../src/guestfs.pod:694
36890 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
36891 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
36892 "attribute, and read the raw reparse data from that (you can find the format "
36893 "documented in various places around the web)."
36897 #: ../src/guestfs.pod:699
36898 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
36902 #: ../src/guestfs.pod:701
36904 "There are other useful extended attributes that can be read from ntfs-3g "
36905 "filesystems (using L</guestfs_getxattr>). See:"
36909 #: ../src/guestfs.pod:704
36911 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
36915 #: ../src/guestfs.pod:706
36916 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
36920 #: ../src/guestfs.pod:708
36922 "Although we don't want to discourage you from using the C API, we will "
36923 "mention here that the same API is also available in other languages."
36927 #: ../src/guestfs.pod:711
36929 "The API is broadly identical in all supported languages. This means that "
36930 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
36931 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
36932 "OCaml. In other words, a straightforward, predictable isomorphism between "
36937 #: ../src/guestfs.pod:717
36939 "Error messages are automatically transformed into exceptions if the language "
36944 #: ../src/guestfs.pod:720
36946 "We don't try to \"object orientify\" parts of the API in OO languages, "
36947 "although contributors are welcome to write higher level APIs above what we "
36948 "provide in their favourite languages if they wish."
36952 #: ../src/guestfs.pod:726
36957 #: ../src/guestfs.pod:728
36959 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
36960 "identical to the C API. C++ classes and exceptions are not used."
36964 #: ../src/guestfs.pod:732
36969 #: ../src/guestfs.pod:734
36971 "The C# bindings are highly experimental. Please read the warnings at the "
36972 "top of C<csharp/Libguestfs.cs>."
36976 #: ../src/guestfs.pod:737
36981 #: ../src/guestfs.pod:739
36982 msgid "See L<guestfs-erlang(3)>."
36986 #: ../src/guestfs.pod:741
36991 #: ../src/guestfs.pod:743
36993 "This is the only language binding that is working but incomplete. Only "
36994 "calls which return simple integers have been bound in Haskell, and we are "
36995 "looking for help to complete this binding."
36999 #: ../src/guestfs.pod:747
37004 #: ../src/guestfs.pod:749
37006 "Full documentation is contained in the Javadoc which is distributed with "
37007 "libguestfs. For examples, see L<guestfs-java(3)>."
37011 #: ../src/guestfs.pod:752
37016 #: ../src/guestfs.pod:754
37017 msgid "See L<guestfs-ocaml(3)>."
37021 #: ../src/guestfs.pod:756
37026 #: ../src/guestfs.pod:758
37027 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
37031 #: ../src/guestfs.pod:760
37036 #: ../src/guestfs.pod:762
37038 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
37039 "the php-libguestfs package for your distribution."
37043 #: ../src/guestfs.pod:765
37044 msgid "The PHP binding only works correctly on 64 bit machines."
37048 #: ../src/guestfs.pod:767
37053 #: ../src/guestfs.pod:769
37054 msgid "See L<guestfs-python(3)>."
37058 #: ../src/guestfs.pod:771
37063 #: ../src/guestfs.pod:773
37064 msgid "See L<guestfs-ruby(3)>."
37068 #: ../src/guestfs.pod:775
37069 msgid "B<shell scripts>"
37073 #: ../src/guestfs.pod:777
37074 msgid "See L<guestfish(1)>."
37078 #: ../src/guestfs.pod:781
37079 msgid "LIBGUESTFS GOTCHAS"
37083 #: ../src/guestfs.pod:783
37085 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
37086 "system [...] that works in the way it is documented but is counterintuitive "
37087 "and almost invites mistakes.\""
37091 #: ../src/guestfs.pod:787
37093 "Since we developed libguestfs and the associated tools, there are several "
37094 "things we would have designed differently, but are now stuck with for "
37095 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
37096 "release, you can expect these to change. Beware of them."
37100 #: ../src/guestfs.pod:795
37101 msgid "Autosync / forgetting to sync."
37105 #: ../src/guestfs.pod:797
37107 "I<Update:> Autosync is enabled by default for all API users starting from "
37108 "libguestfs 1.5.24. This section only applies to older versions."
37112 #: ../src/guestfs.pod:800
37114 "When modifying a filesystem from C or another language, you B<must> unmount "
37115 "all filesystems and call L</guestfs_sync> explicitly before you close the "
37116 "libguestfs handle. You can also call:"
37120 #: ../src/guestfs.pod:804
37123 " guestfs_set_autosync (g, 1);\n"
37128 #: ../src/guestfs.pod:806
37130 "to have the unmount/sync done automatically for you when the handle 'g' is "
37131 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
37135 #: ../src/guestfs.pod:810
37137 "If you forget to do this, then it is entirely possible that your changes "
37138 "won't be written out, or will be partially written, or (very rarely) that "
37139 "you'll get disk corruption."
37143 #: ../src/guestfs.pod:814
37145 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
37146 "guestfish scripts that forget to sync will work just fine, which can make "
37147 "this very puzzling if you are trying to debug a problem."
37151 #: ../src/guestfs.pod:818
37152 msgid "Mount option C<-o sync> should not be the default."
37156 #: ../src/guestfs.pod:820
37158 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
37159 "libguestfs 1.13.16. This section only applies to older versions."
37163 #: ../src/guestfs.pod:823
37165 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
37166 "However C<-o sync> does not add any reliability benefit, but does have a "
37167 "very large performance impact."
37171 #: ../src/guestfs.pod:827
37173 "The work around is to use L</guestfs_mount_options> and set the mount "
37174 "options that you actually want to use."
37178 #: ../src/guestfs.pod:830
37179 msgid "Read-only should be the default."
37183 #: ../src/guestfs.pod:832
37185 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
37186 "specify I<--rw> if you want to make changes to the image."
37190 #: ../src/guestfs.pod:835
37191 msgid "This would reduce the potential to corrupt live VM images."
37195 #: ../src/guestfs.pod:837
37197 "Note that many filesystems change the disk when you just mount and unmount, "
37198 "even if you didn't perform any writes. You need to use L</"
37199 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
37203 #: ../src/guestfs.pod:841
37204 msgid "guestfish command line is hard to use."
37208 #: ../src/guestfs.pod:843
37210 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
37211 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
37212 "exist, so it fails. In earlier versions of guestfish the error message was "
37213 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
37214 "we should have used C<guestfish -c command> to run commands."
37218 #: ../src/guestfs.pod:850
37219 msgid "guestfish megabyte modifiers don't work right on all commands"
37223 #: ../src/guestfs.pod:852
37225 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
37226 "other modifiers). What guestfish actually does is to multiply the number "
37227 "part by the modifier part and pass the result to the C API. However this "
37228 "doesn't work for a few APIs which aren't expecting bytes, but are already "
37229 "expecting some other unit (eg. megabytes)."
37233 #: ../src/guestfs.pod:859
37234 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
37238 #: ../src/guestfs.pod:861
37241 " lvcreate LV VG 100M\n"
37246 #: ../src/guestfs.pod:863
37248 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
37249 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
37250 "megabytes * megabytes) logical volume. The error message you get from this "
37251 "is also a little obscure."
37255 #: ../src/guestfs.pod:868
37257 "This could be fixed in the generator by specially marking parameters and "
37258 "return values which take bytes or other units."
37262 #: ../src/guestfs.pod:871
37263 msgid "Ambiguity between devices and paths"
37267 #: ../src/guestfs.pod:873
37269 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
37270 "sdb2>) and a similar pathname. A file might just happen to be called "
37271 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
37275 #: ../src/guestfs.pod:878
37277 "In the current API we usually resolve this ambiguity by having two separate "
37278 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
37279 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
37280 "detecting if the path supplied begins with C</dev/>."
37284 #: ../src/guestfs.pod:884
37286 "To avoid both the ambiguity and the need to duplicate some calls, we could "
37287 "make paths/devices into structured names. One way to do this would be to "
37288 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
37289 "aspect of grub. Another way would be to use a structured type, equivalent "
37290 "to this OCaml type:"
37294 #: ../src/guestfs.pod:890
37297 " type path = Path of string | Device of int | Partition of int * int\n"
37302 #: ../src/guestfs.pod:892
37303 msgid "which would allow you to pass arguments like:"
37307 #: ../src/guestfs.pod:894
37310 " Path \"/foo/bar\"\n"
37311 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
37312 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
37313 " Path \"/dev/sdb2\" (* not a device *)\n"
37318 #: ../src/guestfs.pod:899
37320 "As you can see there are still problems to resolve even with this "
37321 "representation. Also consider how it might work in guestfish."
37325 #: ../src/guestfs.pod:904
37326 msgid "KEYS AND PASSPHRASES"
37330 #: ../src/guestfs.pod:906
37332 "Certain libguestfs calls take a parameter that contains sensitive key "
37333 "material, passed in as a C string."
37337 #: ../src/guestfs.pod:909
37339 "In the future we would hope to change the libguestfs implementation so that "
37340 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
37341 "swap. However this is I<not> done at the moment, because of the complexity "
37342 "of such an implementation."
37346 #: ../src/guestfs.pod:914
37348 "Therefore you should be aware that any key parameter you pass to libguestfs "
37349 "might end up being written out to the swap partition. If this is a concern, "
37350 "scrub the swap partition or don't use libguestfs on encrypted devices."
37354 #: ../src/guestfs.pod:919
37355 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
37359 #: ../src/guestfs.pod:921
37361 "All high-level libguestfs actions are synchronous. If you want to use "
37362 "libguestfs asynchronously then you must create a thread."
37366 #: ../src/guestfs.pod:924
37368 "Only use the handle from a single thread. Either use the handle exclusively "
37369 "from one thread, or provide your own mutex so that two threads cannot issue "
37370 "calls on the same handle at the same time."
37374 #: ../src/guestfs.pod:928
37376 "See the graphical program guestfs-browser for one possible architecture for "
37377 "multithreaded programs using libvirt and libguestfs."
37381 #: ../src/guestfs.pod:931
37386 #: ../src/guestfs.pod:933
37388 "Libguestfs needs a supermin appliance, which it finds by looking along an "
37393 #: ../src/guestfs.pod:936
37395 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
37396 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
37400 #: ../src/guestfs.pod:939
37402 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
37403 "to change the directories that libguestfs will search in. The value is a "
37404 "colon-separated list of paths. The current directory is I<not> searched "
37405 "unless the path contains an empty element or C<.>. For example "
37406 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
37407 "then C</usr/lib/guestfs>."
37411 #: ../src/guestfs.pod:946
37412 msgid "QEMU WRAPPERS"
37416 #: ../src/guestfs.pod:948
37418 "If you want to compile your own qemu, run qemu from a non-standard location, "
37419 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
37424 #: ../src/guestfs.pod:952
37426 "There is one important rule to remember: you I<must C<exec qemu>> as the "
37427 "last command in the shell script (so that qemu replaces the shell and "
37428 "becomes the direct child of the libguestfs-using program). If you don't do "
37429 "this, then the qemu process won't be cleaned up correctly."
37433 #: ../src/guestfs.pod:957
37435 "Here is an example of a wrapper, where I have built my own copy of qemu from "
37440 #: ../src/guestfs.pod:960
37444 " qemudir=/home/rjones/d/qemu\n"
37445 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
37450 #: ../src/guestfs.pod:964
37452 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
37453 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
37458 #: ../src/guestfs.pod:968
37461 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
37466 #: ../src/guestfs.pod:970
37468 "Note that libguestfs also calls qemu with the -help and -version options in "
37469 "order to determine features."
37473 #: ../src/guestfs.pod:973
37475 "Wrappers can also be used to edit the options passed to qemu. In the "
37476 "following example, the C<-machine ...> option (C<-machine> and the following "
37477 "argument) are removed from the command line and replaced with C<-machine pc,"
37478 "accel=tcg>. The while loop iterates over the options until it finds the "
37479 "right one to remove, putting the remaining options into the C<args> array."
37483 #: ../src/guestfs.pod:982
37487 " while [ $# -gt 0 ]; do\n"
37488 " case \"$1\" in\n"
37492 " args[i]=\"$1\"\n"
37501 #: ../src/guestfs.pod:994
37504 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
37509 #: ../src/guestfs.pod:996
37510 msgid "ATTACHING TO RUNNING DAEMONS"
37514 #: ../src/guestfs.pod:998
37516 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
37517 "babies. Use with caution."
37521 #: ../src/guestfs.pod:1001
37523 "I<Note (2):> This section explains how to attach to a running daemon from a "
37524 "low level perspective. For most users, simply using virt tools such as "
37525 "L<guestfish(1)> with the I<--live> option will \"just work\"."
37529 #: ../src/guestfs.pod:1005
37530 msgid "Using guestfs_set_attach_method"
37534 #: ../src/guestfs.pod:1007
37536 "By calling L</guestfs_set_attach_method> you can change how the library "
37537 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
37538 "ARCHITECTURE> for some background)."
37542 #: ../src/guestfs.pod:1011
37544 "The normal attach method is C<appliance>, where a small appliance is created "
37545 "containing the daemon, and then the library connects to this."
37549 #: ../src/guestfs.pod:1014
37551 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
37552 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
37553 "daemon over the Unix domain socket."
37557 #: ../src/guestfs.pod:1018
37559 "The normal use for this is to connect to a running virtual machine that "
37560 "contains a C<guestfsd> daemon, and send commands so you can read and write "
37561 "files inside the live virtual machine."
37565 #: ../src/guestfs.pod:1022
37566 msgid "Using guestfs_add_domain with live flag"
37570 #: ../src/guestfs.pod:1024
37572 "L</guestfs_add_domain> provides some help for getting the correct attach "
37573 "method. If you pass the C<live> option to this function, then (if the "
37574 "virtual machine is running) it will examine the libvirt XML looking for a "
37575 "virtio-serial channel to connect to:"
37579 #: ../src/guestfs.pod:1030
37586 " <channel type='unix'>\n"
37587 " <source mode='bind' path='/path/to/socket'/>\n"
37588 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
37597 #: ../src/guestfs.pod:1042
37599 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
37600 "method to C<unix:/path/to/socket>."
37604 #: ../src/guestfs.pod:1045
37606 "Some of the libguestfs tools (including guestfish) support a I<--live> "
37607 "option which is passed through to L</guestfs_add_domain> thus allowing you "
37608 "to attach to and modify live virtual machines."
37612 #: ../src/guestfs.pod:1049
37614 "The virtual machine needs to have been set up beforehand so that it has the "
37615 "virtio-serial channel and so that guestfsd is running inside it."
37619 #: ../src/guestfs.pod:1053
37620 msgid "ABI GUARANTEE"
37624 #: ../src/guestfs.pod:1055
37626 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
37627 "actions as outlined in this section. Although we will deprecate some "
37628 "actions, for example if they get replaced by newer calls, we will keep the "
37629 "old actions forever. This allows you the developer to program in confidence "
37630 "against the libguestfs API."
37634 #: ../src/guestfs.pod:1061
37635 msgid "BLOCK DEVICE NAMING"
37639 #: ../src/guestfs.pod:1063
37641 "In the kernel there is now quite a profusion of schemata for naming block "
37642 "devices (in this context, by I<block device> I mean a physical or virtual "
37643 "hard drive). The original Linux IDE driver used names starting with C</dev/"
37644 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
37645 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
37646 "for the old IDE driver (particularly for SATA devices) those devices also "
37647 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
37648 "paravirtualized drivers. This has created several different naming systems, "
37649 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
37653 #: ../src/guestfs.pod:1075
37655 "As discussed above, libguestfs uses a qemu appliance running an embedded "
37656 "Linux kernel to access block devices. We can run a variety of appliances "
37657 "based on a variety of Linux kernels."
37661 #: ../src/guestfs.pod:1079
37663 "This causes a problem for libguestfs because many API calls use device or "
37664 "partition names. Working scripts and the recipe (example) scripts that we "
37665 "make available over the internet could fail if the naming scheme changes."
37669 #: ../src/guestfs.pod:1084
37671 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
37672 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
37673 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
37674 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
37678 #: ../src/guestfs.pod:1090
37680 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
37681 "L</guestfs_list_partitions> and similar calls return the true names of the "
37682 "devices and partitions as known to the appliance."
37686 #: ../src/guestfs.pod:1095
37687 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
37691 #: ../src/guestfs.pod:1097
37693 "Usually this translation is transparent. However in some (very rare) cases "
37694 "you may need to know the exact algorithm. Such cases include where you use "
37695 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
37696 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
37700 #: ../src/guestfs.pod:1103
37702 "The algorithm is applied only to I<parameters> which are known to be either "
37703 "device or partition names. Return values from functions such as L</"
37704 "guestfs_list_devices> are never changed."
37708 #: ../src/guestfs.pod:1111
37709 msgid "Is the string a parameter which is a device or partition name?"
37713 #: ../src/guestfs.pod:1115
37714 msgid "Does the string begin with C</dev/sd>?"
37718 #: ../src/guestfs.pod:1119
37720 "Does the named device exist? If so, we use that device. However if I<not> "
37721 "then we continue with this algorithm."
37725 #: ../src/guestfs.pod:1124
37726 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
37730 #: ../src/guestfs.pod:1126
37731 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
37735 #: ../src/guestfs.pod:1128
37736 msgid "If that named device exists, use it. If not, continue."
37740 #: ../src/guestfs.pod:1132
37741 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
37745 #: ../src/guestfs.pod:1134
37746 msgid "If that named device exists, use it. If not, return an error."
37750 #: ../src/guestfs.pod:1138
37751 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
37755 #: ../src/guestfs.pod:1140
37757 "Although the standard naming scheme and automatic translation is useful for "
37758 "simple programs and guestfish scripts, for larger programs it is best not to "
37759 "rely on this mechanism."
37763 #: ../src/guestfs.pod:1144
37765 "Where possible for maximum future portability programs using libguestfs "
37766 "should use these future-proof techniques:"
37770 #: ../src/guestfs.pod:1151
37772 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
37773 "device names, and then use those names directly."
37777 #: ../src/guestfs.pod:1154
37779 "Since those device names exist by definition, they will never be translated."
37783 #: ../src/guestfs.pod:1159
37785 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
37786 "filesystem labels."
37790 #: ../src/guestfs.pod:1166
37792 "This section discusses security implications of using libguestfs, "
37793 "particularly with untrusted or malicious guests or disk images."
37797 #: ../src/guestfs.pod:1169
37798 msgid "GENERAL SECURITY CONSIDERATIONS"
37802 #: ../src/guestfs.pod:1171
37804 "Be careful with any files or data that you download from a guest (by "
37805 "\"download\" we mean not just the L</guestfs_download> command but any "
37806 "command that reads files, filenames, directories or anything else from a "
37807 "disk image). An attacker could manipulate the data to fool your program "
37808 "into doing the wrong thing. Consider cases such as:"
37812 #: ../src/guestfs.pod:1181
37813 msgid "the data (file etc) not being present"
37817 #: ../src/guestfs.pod:1185
37818 msgid "being present but empty"
37822 #: ../src/guestfs.pod:1189
37823 msgid "being much larger than normal"
37827 #: ../src/guestfs.pod:1193
37828 msgid "containing arbitrary 8 bit data"
37832 #: ../src/guestfs.pod:1197
37833 msgid "being in an unexpected character encoding"
37837 #: ../src/guestfs.pod:1201
37838 msgid "containing homoglyphs."
37842 #: ../src/guestfs.pod:1205
37843 msgid "SECURITY OF MOUNTING FILESYSTEMS"
37847 #: ../src/guestfs.pod:1207
37849 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
37850 "(VFS) module can sometimes be escalated into exploits by deliberately "
37851 "creating a malicious, malformed filesystem. These exploits are very severe "
37852 "for two reasons. Firstly there are very many filesystem drivers in the "
37853 "kernel, and many of them are infrequently used and not much developer "
37854 "attention has been paid to the code. Linux userspace helps potential "
37855 "crackers by detecting the filesystem type and automatically choosing the "
37856 "right VFS driver, even if that filesystem type is obscure or unexpected for "
37857 "the administrator. Secondly, a kernel-level exploit is like a local root "
37858 "exploit (worse in some ways), giving immediate and total access to the "
37859 "system right down to the hardware level."
37863 #: ../src/guestfs.pod:1220
37865 "That explains why you should never mount a filesystem from an untrusted "
37866 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
37867 "inside a qemu virtual machine, usually running as a non-root user. The "
37868 "attacker would need to write a filesystem which first exploited the kernel, "
37869 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
37870 "the libguestfs protocol, and finally to be as serious as the host kernel "
37871 "exploit it would need to escalate its privileges to root. This multi-step "
37872 "escalation, performed by a static piece of data, is thought to be extremely "
37873 "hard to do, although we never say 'never' about security issues."
37877 #: ../src/guestfs.pod:1231
37879 "In any case callers can reduce the attack surface by forcing the filesystem "
37880 "type when mounting (use L</guestfs_mount_vfs>)."
37884 #: ../src/guestfs.pod:1234
37885 msgid "PROTOCOL SECURITY"
37889 #: ../src/guestfs.pod:1236
37891 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
37892 "defined upper message size. However a program that uses libguestfs must "
37893 "also take care - for example you can write a program that downloads a binary "
37894 "from a disk image and executes it locally, and no amount of protocol "
37895 "security will save you from the consequences."
37899 #: ../src/guestfs.pod:1242
37900 msgid "INSPECTION SECURITY"
37904 #: ../src/guestfs.pod:1244
37906 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
37907 "directly from the guest, and these could contain any 8 bit data. Callers "
37908 "should be careful to escape these before printing them to a structured file "
37909 "(for example, use HTML escaping if creating a web page)."
37913 #: ../src/guestfs.pod:1250
37915 "Guest configuration may be altered in unusual ways by the administrator of "
37916 "the virtual machine, and may not reflect reality (particularly for untrusted "
37917 "or actively malicious guests). For example we parse the hostname from "
37918 "configuration files like C</etc/sysconfig/network> that we find in the "
37919 "guest, but the guest administrator can easily manipulate these files to "
37920 "provide the wrong hostname."
37924 #: ../src/guestfs.pod:1258
37926 "The inspection API parses guest configuration using two external libraries: "
37927 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
37928 "designed to be robust in the face of malicious data, although denial of "
37929 "service attacks are still possible, for example with oversized configuration "
37934 #: ../src/guestfs.pod:1264
37935 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
37939 #: ../src/guestfs.pod:1266
37941 "Be very cautious about running commands from the guest. By running a "
37942 "command in the guest, you are giving CPU time to a binary that you do not "
37943 "control, under the same user account as the library, albeit wrapped in qemu "
37944 "virtualization. More information and alternatives can be found in the "
37945 "section L</RUNNING COMMANDS>."
37949 #: ../src/guestfs.pod:1272
37950 msgid "CVE-2010-3851"
37954 #: ../src/guestfs.pod:1274
37955 msgid "https://bugzilla.redhat.com/642934"
37959 #: ../src/guestfs.pod:1276
37961 "This security bug concerns the automatic disk format detection that qemu "
37962 "does on disk images."
37966 #: ../src/guestfs.pod:1279
37968 "A raw disk image is just the raw bytes, there is no header. Other disk "
37969 "images like qcow2 contain a special header. Qemu deals with this by looking "
37970 "for one of the known headers, and if none is found then assuming the disk "
37971 "image must be raw."
37975 #: ../src/guestfs.pod:1284
37977 "This allows a guest which has been given a raw disk image to write some "
37978 "other header. At next boot (or when the disk image is accessed by "
37979 "libguestfs) qemu would do autodetection and think the disk image format was, "
37980 "say, qcow2 based on the header written by the guest."
37984 #: ../src/guestfs.pod:1289
37986 "This in itself would not be a problem, but qcow2 offers many features, one "
37987 "of which is to allow a disk image to refer to another image (called the "
37988 "\"backing disk\"). It does this by placing the path to the backing disk "
37989 "into the qcow2 header. This path is not validated and could point to any "
37990 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
37991 "\"holes\" in the qcow2 disk image, which of course is completely under the "
37992 "control of the attacker."
37996 #: ../src/guestfs.pod:1297
37998 "In libguestfs this is rather hard to exploit except under two circumstances:"
38002 #: ../src/guestfs.pod:1304
38003 msgid "You have enabled the network or have opened the disk in write mode."
38007 #: ../src/guestfs.pod:1308
38009 "You are also running untrusted code from the guest (see L</RUNNING "
38014 #: ../src/guestfs.pod:1313
38016 "The way to avoid this is to specify the expected disk format when adding "
38017 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
38018 "should always do this if the disk is raw format, and it's a good idea for "
38023 #: ../src/guestfs.pod:1318
38025 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
38026 "format is fetched from libvirt and passed through."
38030 #: ../src/guestfs.pod:1321
38032 "For libguestfs tools, use the I<--format> command line parameter as "
38037 #: ../src/guestfs.pod:1324
38038 msgid "CONNECTION MANAGEMENT"
38042 #: ../src/guestfs.pod:1326
38043 msgid "guestfs_h *"
38047 #: ../src/guestfs.pod:1328
38049 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
38050 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
38051 "handle and release all resources used."
38055 #: ../src/guestfs.pod:1332
38057 "For information on using multiple handles and threads, see the section L</"
38058 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
38062 #: ../src/guestfs.pod:1335
38063 msgid "guestfs_create"
38067 #: ../src/guestfs.pod:1337
38070 " guestfs_h *guestfs_create (void);\n"
38075 #: ../src/guestfs.pod:1339
38076 msgid "Create a connection handle."
38080 #: ../src/guestfs.pod:1341
38082 "On success this returns a non-NULL pointer to a handle. On error it returns "
38087 #: ../src/guestfs.pod:1344
38089 "You have to \"configure\" the handle after creating it. This includes "
38090 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
38091 "handle at least once."
38095 #: ../src/guestfs.pod:1348
38096 msgid "After configuring the handle, you have to call L</guestfs_launch>."
38100 #: ../src/guestfs.pod:1350
38102 "You may also want to configure error handling for the handle. See the L</"
38103 "ERROR HANDLING> section below."
38107 #: ../src/guestfs.pod:1353
38108 msgid "guestfs_close"
38112 #: ../src/guestfs.pod:1355
38115 " void guestfs_close (guestfs_h *g);\n"
38120 #: ../src/guestfs.pod:1357
38121 msgid "This closes the connection handle and frees up all resources used."
38125 #: ../src/guestfs.pod:1359
38127 "If autosync was set on the handle and the handle was launched, then this "
38128 "implicitly calls various functions to unmount filesystems and sync the "
38129 "disk. See L</guestfs_set_autosync> for more details."
38133 #: ../src/guestfs.pod:1363
38134 msgid "If a close callback was set on the handle, then it is called."
38138 #: ../src/guestfs.pod:1365
38139 msgid "ERROR HANDLING"
38143 #: ../src/guestfs.pod:1367
38145 "API functions can return errors. For example, almost all functions that "
38146 "return C<int> will return C<-1> to indicate an error."
38150 #: ../src/guestfs.pod:1370
38152 "Additional information is available for errors: an error message string and "
38153 "optionally an error number (errno) if the thing that failed was a system "
38158 #: ../src/guestfs.pod:1374
38160 "You can get at the additional information about the last error on the handle "
38161 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
38162 "up an error handler with L</guestfs_set_error_handler>."
38166 #: ../src/guestfs.pod:1379
38168 "When the handle is created, a default error handler is installed which "
38169 "prints the error message string to C<stderr>. For small short-running "
38170 "command line programs it is sufficient to do:"
38174 #: ../src/guestfs.pod:1383
38177 " if (guestfs_launch (g) == -1)\n"
38178 " exit (EXIT_FAILURE);\n"
38183 #: ../src/guestfs.pod:1386
38185 "since the default error handler will ensure that an error message has been "
38186 "printed to C<stderr> before the program exits."
38190 #: ../src/guestfs.pod:1389
38192 "For other programs the caller will almost certainly want to install an "
38193 "alternate error handler or do error handling in-line like this:"
38197 #: ../src/guestfs.pod:1392
38200 " /* This disables the default behaviour of printing errors\n"
38202 " guestfs_set_error_handler (g, NULL, NULL);\n"
38207 #: ../src/guestfs.pod:1396
38210 " if (guestfs_launch (g) == -1) {\n"
38211 " /* Examine the error message and print it etc. */\n"
38212 " char *msg = guestfs_last_error (g);\n"
38213 " int errnum = guestfs_last_errno (g);\n"
38214 " fprintf (stderr, \"%s\", msg);\n"
38215 " if (errnum != 0)\n"
38216 " fprintf (stderr, \": %s\", strerror (errnum));\n"
38217 " fprintf (stderr, \"\\n\");\n"
38224 #: ../src/guestfs.pod:1407
38226 "Out of memory errors are handled differently. The default action is to call "
38227 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
38228 "guestfs_set_out_of_memory_handler>."
38232 #: ../src/guestfs.pod:1411
38234 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
38235 "because there is no handle if this happens there is no way to get additional "
38236 "error information. However L</guestfs_create> is supposed to be a "
38237 "lightweight operation which can only fail because of insufficient memory (it "
38238 "returns NULL in this case)."
38242 #: ../src/guestfs.pod:1417
38243 msgid "guestfs_last_error"
38247 #: ../src/guestfs.pod:1419
38250 " const char *guestfs_last_error (guestfs_h *g);\n"
38255 #: ../src/guestfs.pod:1421
38257 "This returns the last error message that happened on C<g>. If there has not "
38258 "been an error since the handle was created, then this returns C<NULL>."
38262 #: ../src/guestfs.pod:1425
38264 "The lifetime of the returned string is until the next error occurs, or L</"
38265 "guestfs_close> is called."
38269 #: ../src/guestfs.pod:1428
38270 msgid "guestfs_last_errno"
38274 #: ../src/guestfs.pod:1430
38277 " int guestfs_last_errno (guestfs_h *g);\n"
38282 #: ../src/guestfs.pod:1432
38283 msgid "This returns the last error number (errno) that happened on C<g>."
38287 #: ../src/guestfs.pod:1434
38288 msgid "If successful, an errno integer not equal to zero is returned."
38292 #: ../src/guestfs.pod:1436
38294 "If no error, this returns 0. This call can return 0 in three situations:"
38298 #: ../src/guestfs.pod:1443
38299 msgid "There has not been any error on the handle."
38303 #: ../src/guestfs.pod:1447
38305 "There has been an error but the errno was meaningless. This corresponds to "
38306 "the case where the error did not come from a failed system call, but for "
38307 "some other reason."
38311 #: ../src/guestfs.pod:1453
38313 "There was an error from a failed system call, but for some reason the errno "
38314 "was not captured and returned. This usually indicates a bug in libguestfs."
38318 #: ../src/guestfs.pod:1459
38320 "Libguestfs tries to convert the errno from inside the applicance into a "
38321 "corresponding errno for the caller (not entirely trivial: the appliance "
38322 "might be running a completely different operating system from the library "
38323 "and error numbers are not standardized across Un*xen). If this could not be "
38324 "done, then the error is translated to C<EINVAL>. In practice this should "
38325 "only happen in very rare circumstances."
38329 #: ../src/guestfs.pod:1467
38330 msgid "guestfs_set_error_handler"
38334 #: ../src/guestfs.pod:1469
38337 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
38339 " const char *msg);\n"
38340 " void guestfs_set_error_handler (guestfs_h *g,\n"
38341 " guestfs_error_handler_cb cb,\n"
38342 " void *opaque);\n"
38347 #: ../src/guestfs.pod:1476
38349 "The callback C<cb> will be called if there is an error. The parameters "
38350 "passed to the callback are an opaque data pointer and the error message "
38355 #: ../src/guestfs.pod:1480
38357 "C<errno> is not passed to the callback. To get that the callback must call "
38358 "L</guestfs_last_errno>."
38362 #: ../src/guestfs.pod:1483
38364 "Note that the message string C<msg> is freed as soon as the callback "
38365 "function returns, so if you want to stash it somewhere you must make your "
38370 #: ../src/guestfs.pod:1487
38371 msgid "The default handler prints messages on C<stderr>."
38375 #: ../src/guestfs.pod:1489
38376 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
38380 #: ../src/guestfs.pod:1491
38381 msgid "guestfs_get_error_handler"
38385 #: ../src/guestfs.pod:1493
38388 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
38389 " void **opaque_rtn);\n"
38394 #: ../src/guestfs.pod:1496
38395 msgid "Returns the current error handler callback."
38399 #: ../src/guestfs.pod:1498
38400 msgid "guestfs_set_out_of_memory_handler"
38404 #: ../src/guestfs.pod:1500
38407 " typedef void (*guestfs_abort_cb) (void);\n"
38408 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
38409 " guestfs_abort_cb);\n"
38414 #: ../src/guestfs.pod:1504
38416 "The callback C<cb> will be called if there is an out of memory situation. "
38417 "I<Note this callback must not return>."
38421 #: ../src/guestfs.pod:1507
38422 msgid "The default is to call L<abort(3)>."
38426 #: ../src/guestfs.pod:1509
38428 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
38432 #: ../src/guestfs.pod:1512
38433 msgid "guestfs_get_out_of_memory_handler"
38437 #: ../src/guestfs.pod:1514
38440 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
38445 #: ../src/guestfs.pod:1516
38446 msgid "This returns the current out of memory handler."
38450 #: ../src/guestfs.pod:1518
38455 #: ../src/guestfs.pod:1522
38460 #: ../src/guestfs.pod:1524
38465 #: ../src/guestfs.pod:1526
38466 msgid "AVAILABILITY"
38470 #: ../src/guestfs.pod:1528
38471 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
38475 #: ../src/guestfs.pod:1530
38477 "Using L</guestfs_available> you can test availability of the following "
38478 "groups of functions. This test queries the appliance to see if the "
38479 "appliance you are currently using supports the functionality."
38483 #: ../src/guestfs.pod:1535
38484 msgid "@AVAILABILITY@"
38488 #: ../src/guestfs.pod:1537
38489 msgid "GUESTFISH supported COMMAND"
38493 #: ../src/guestfs.pod:1539
38495 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
38496 "prints out the available groups and whether they are supported by this build "
38497 "of libguestfs. Note however that you have to do C<run> first."
38501 #: ../src/guestfs.pod:1544
38502 msgid "SINGLE CALLS AT COMPILE TIME"
38506 #: ../src/guestfs.pod:1546
38508 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
38509 "function, such as:"
38513 #: ../src/guestfs.pod:1549
38516 " #define LIBGUESTFS_HAVE_DD 1\n"
38521 #: ../src/guestfs.pod:1551
38522 msgid "if L</guestfs_dd> is available."
38526 #: ../src/guestfs.pod:1553
38528 "Before version 1.5.8, if you needed to test whether a single libguestfs "
38529 "function is available at compile time, we recommended using build tools such "
38530 "as autoconf or cmake. For example in autotools you could use:"
38534 #: ../src/guestfs.pod:1558
38537 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
38538 " AC_CHECK_FUNCS([guestfs_dd])\n"
38543 #: ../src/guestfs.pod:1561
38545 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
38550 #: ../src/guestfs.pod:1564
38551 msgid "SINGLE CALLS AT RUN TIME"
38555 #: ../src/guestfs.pod:1566
38557 "Testing at compile time doesn't guarantee that a function really exists in "
38558 "the library. The reason is that you might be dynamically linked against a "
38559 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
38560 "This situation unfortunately results in a segmentation fault, which is a "
38561 "shortcoming of the C dynamic linking system itself."
38565 #: ../src/guestfs.pod:1573
38567 "You can use L<dlopen(3)> to test if a function is available at run time, as "
38568 "in this example program (note that you still need the compile time check as "
38573 #: ../src/guestfs.pod:1577
38576 " #include <stdio.h>\n"
38577 " #include <stdlib.h>\n"
38578 " #include <unistd.h>\n"
38579 " #include <dlfcn.h>\n"
38580 " #include <guestfs.h>\n"
38585 #: ../src/guestfs.pod:1583
38590 " #ifdef LIBGUESTFS_HAVE_DD\n"
38592 " int has_function;\n"
38597 #: ../src/guestfs.pod:1589
38600 " /* Test if the function guestfs_dd is really available. */\n"
38601 " dl = dlopen (NULL, RTLD_LAZY);\n"
38603 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
38604 " exit (EXIT_FAILURE);\n"
38606 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
38612 #: ../src/guestfs.pod:1598
38615 " if (!has_function)\n"
38616 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
38618 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
38619 " /* Now it's safe to call\n"
38620 " guestfs_dd (g, \"foo\", \"bar\");\n"
38624 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
38631 #: ../src/guestfs.pod:1611
38633 "You may think the above is an awful lot of hassle, and it is. There are "
38634 "other ways outside of the C linking system to ensure that this kind of "
38635 "incompatibility never arises, such as using package versioning:"
38639 #: ../src/guestfs.pod:1616
38642 " Requires: libguestfs >= 1.0.80\n"
38647 #: ../src/guestfs.pod:1618
38648 msgid "CALLS WITH OPTIONAL ARGUMENTS"
38652 #: ../src/guestfs.pod:1620
38654 "A recent feature of the API is the introduction of calls which take optional "
38655 "arguments. In C these are declared 3 ways. The main way is as a call which "
38656 "takes variable arguments (ie. C<...>), as in this example:"
38660 #: ../src/guestfs.pod:1625
38663 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
38668 #: ../src/guestfs.pod:1627
38670 "Call this with a list of optional arguments, terminated by C<-1>. So to "
38671 "call with no optional arguments specified:"
38675 #: ../src/guestfs.pod:1630
38678 " guestfs_add_drive_opts (g, filename, -1);\n"
38683 #: ../src/guestfs.pod:1632
38684 msgid "With a single optional argument:"
38688 #: ../src/guestfs.pod:1634
38691 " guestfs_add_drive_opts (g, filename,\n"
38692 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
38698 #: ../src/guestfs.pod:1638
38703 #: ../src/guestfs.pod:1640
38706 " guestfs_add_drive_opts (g, filename,\n"
38707 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
38708 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
38714 #: ../src/guestfs.pod:1645
38716 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
38721 #: ../src/guestfs.pod:1648
38722 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
38726 #: ../src/guestfs.pod:1650
38728 "The second variant has the same name with the suffix C<_va>, which works the "
38729 "same way but takes a C<va_list>. See the C manual for details. For the "
38730 "example function, this is declared:"
38734 #: ../src/guestfs.pod:1654
38737 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
38738 " va_list args);\n"
38743 #: ../src/guestfs.pod:1657
38744 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
38748 #: ../src/guestfs.pod:1659
38750 "The third variant is useful where you need to construct these calls. You "
38751 "pass in a structure where you fill in the optional fields. The structure "
38752 "has a bitmask as the first element which you must set to indicate which "
38753 "fields you have filled in. For our example function the structure and call "
38758 #: ../src/guestfs.pod:1665
38761 " struct guestfs_add_drive_opts_argv {\n"
38762 " uint64_t bitmask;\n"
38764 " const char *format;\n"
38767 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
38768 " const struct guestfs_add_drive_opts_argv *optargs);\n"
38773 #: ../src/guestfs.pod:1674
38774 msgid "You could call it like this:"
38778 #: ../src/guestfs.pod:1676
38781 " struct guestfs_add_drive_opts_argv optargs = {\n"
38782 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
38783 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
38784 " .readonly = 1,\n"
38785 " .format = \"qcow2\"\n"
38791 #: ../src/guestfs.pod:1683
38794 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
38799 #: ../src/guestfs.pod:1691
38800 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
38804 #: ../src/guestfs.pod:1696
38805 msgid "You do not need to fill in all fields of the structure."
38809 #: ../src/guestfs.pod:1700
38811 "There must be a one-to-one correspondence between fields of the structure "
38812 "that are filled in, and bits set in the bitmask."
38816 #: ../src/guestfs.pod:1705
38817 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
38821 #: ../src/guestfs.pod:1707
38823 "In other languages, optional arguments are expressed in the way that is "
38824 "natural for that language. We refer you to the language-specific "
38825 "documentation for more details on that."
38829 #: ../src/guestfs.pod:1711
38830 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
38834 #: ../src/guestfs.pod:1713
38835 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
38839 #: ../src/guestfs.pod:1715
38841 "B<Note:> This section documents the generic event mechanism introduced in "
38842 "libguestfs 1.10, which you should use in new code if possible. The old "
38843 "functions C<guestfs_set_log_message_callback>, "
38844 "C<guestfs_set_subprocess_quit_callback>, "
38845 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
38846 "C<guestfs_set_progress_callback> are no longer documented in this manual "
38847 "page. Because of the ABI guarantee, the old functions continue to work."
38851 #: ../src/guestfs.pod:1724
38853 "Handles generate events when certain things happen, such as log messages "
38854 "being generated, progress messages during long-running operations, or the "
38855 "handle being closed. The API calls described below let you register a "
38856 "callback to be called when events happen. You can register multiple "
38857 "callbacks (for the same, different or overlapping sets of events), and "
38858 "individually remove callbacks. If callbacks are not removed, then they "
38859 "remain in force until the handle is closed."
38863 #: ../src/guestfs.pod:1732
38865 "In the current implementation, events are only generated synchronously: that "
38866 "means that events (and hence callbacks) can only happen while you are in the "
38867 "middle of making another libguestfs call. The callback is called in the "
38872 #: ../src/guestfs.pod:1737
38874 "Events may contain a payload, usually nothing (void), an array of 64 bit "
38875 "unsigned integers, or a message buffer. Payloads are discussed later on."
38879 #: ../src/guestfs.pod:1741
38880 msgid "CLASSES OF EVENTS"
38884 #: ../src/guestfs.pod:1745
38885 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
38889 #: ../src/guestfs.pod:1748
38891 "The callback function will be called while the handle is being closed "
38892 "(synchronously from L</guestfs_close>)."
38896 #: ../src/guestfs.pod:1751
38898 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
38899 "handles that are open when the program exits. This means that this callback "
38900 "might be called indirectly from L<exit(3)>, which can cause unexpected "
38901 "problems in higher-level languages (eg. if your HLL interpreter has already "
38902 "been cleaned up by the time this is called, and if your callback then jumps "
38903 "into some HLL function)."
38907 #: ../src/guestfs.pod:1758
38909 "If no callback is registered: the handle is closed without any callback "
38914 #: ../src/guestfs.pod:1761
38915 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
38919 #: ../src/guestfs.pod:1764
38921 "The callback function will be called when the child process quits, either "
38922 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
38923 "corresponds to a transition from any state to the CONFIG state)."
38927 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
38928 msgid "If no callback is registered: the event is ignored."
38932 #: ../src/guestfs.pod:1770
38933 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
38937 #: ../src/guestfs.pod:1773
38939 "The callback function will be called when the child process becomes ready "
38940 "first time after it has been launched. (This corresponds to a transition "
38941 "from LAUNCHING to the READY state)."
38945 #: ../src/guestfs.pod:1779
38946 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
38950 #: ../src/guestfs.pod:1782
38952 "Some long-running operations can generate progress messages. If this "
38953 "callback is registered, then it will be called each time a progress message "
38954 "is generated (usually two seconds after the operation started, and three "
38955 "times per second thereafter until it completes, although the frequency may "
38956 "change in future versions)."
38960 #: ../src/guestfs.pod:1788
38962 "The callback receives in the payload four unsigned 64 bit numbers which are "
38963 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
38967 #: ../src/guestfs.pod:1791
38969 "The units of C<total> are not defined, although for some operations C<total> "
38970 "may relate in some way to the amount of data to be transferred (eg. in bytes "
38971 "or megabytes), and C<position> may be the portion which has been transferred."
38975 #: ../src/guestfs.pod:1796
38976 msgid "The only defined and stable parts of the API are:"
38980 #: ../src/guestfs.pod:1802
38982 "The callback can display to the user some type of progress bar or indicator "
38983 "which shows the ratio of C<position>:C<total>."
38987 #: ../src/guestfs.pod:1807
38988 msgid "0 E<lt>= C<position> E<lt>= C<total>"
38992 #: ../src/guestfs.pod:1811
38994 "If any progress notification is sent during a call, then a final progress "
38995 "notification is always sent when C<position> = C<total> (I<unless> the call "
38996 "fails with an error)."
39000 #: ../src/guestfs.pod:1815
39002 "This is to simplify caller code, so callers can easily set the progress "
39003 "indicator to \"100%\" at the end of the operation, without requiring special "
39004 "code to detect this case."
39008 #: ../src/guestfs.pod:1821
39010 "For some calls we are unable to estimate the progress of the call, but we "
39011 "can still generate progress messages to indicate activity. This is known as "
39012 "\"pulse mode\", and is directly supported by certain progress bar "
39013 "implementations (eg. GtkProgressBar)."
39017 #: ../src/guestfs.pod:1826
39019 "For these calls, zero or more progress messages are generated with "
39020 "C<position = 0> and C<total = 1>, followed by a final message with "
39021 "C<position = total = 1>."
39025 #: ../src/guestfs.pod:1830
39027 "As noted above, if the call fails with an error then the final message may "
39028 "not be generated."
39032 #: ../src/guestfs.pod:1835
39034 "The callback also receives the procedure number (C<proc_nr>) and serial "
39035 "number (C<serial>) of the call. These are only useful for debugging "
39036 "protocol issues, and the callback can normally ignore them. The callback "
39037 "may want to print these numbers in error messages or debugging messages."
39041 #: ../src/guestfs.pod:1841
39042 msgid "If no callback is registered: progress messages are discarded."
39046 #: ../src/guestfs.pod:1843
39047 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
39051 #: ../src/guestfs.pod:1846
39053 "The callback function is called whenever a log message is generated by qemu, "
39054 "the appliance kernel, guestfsd (daemon), or utility programs."
39058 #: ../src/guestfs.pod:1849
39060 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
39061 "guestfs_launch>) then additional debug messages are generated."
39065 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
39067 "If no callback is registered: the messages are discarded unless the verbose "
39068 "flag is set in which case they are sent to stderr. You can override the "
39069 "printing of verbose messages to stderr by setting up a callback."
39073 #: ../src/guestfs.pod:1857
39074 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
39078 #: ../src/guestfs.pod:1860
39080 "The callback function is called whenever a log message is generated by the "
39081 "library part of libguestfs."
39085 #: ../src/guestfs.pod:1863
39087 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
39088 "messages are generated."
39092 #: ../src/guestfs.pod:1871
39093 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
39097 #: ../src/guestfs.pod:1874
39099 "The callback function is called whenever a trace message is generated. This "
39100 "only applies if the trace flag (L</guestfs_set_trace>) is set."
39104 #: ../src/guestfs.pod:1877
39106 "If no callback is registered: the messages are sent to stderr. You can "
39107 "override the printing of trace messages to stderr by setting up a callback."
39111 #: ../src/guestfs.pod:1881
39112 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
39116 #: ../src/guestfs.pod:1884
39118 "The callback function is called whenever a libguestfs function is entered."
39122 #: ../src/guestfs.pod:1887
39124 "The payload is a string which contains the name of the function that we are "
39125 "entering (not including C<guestfs_> prefix)."
39129 #: ../src/guestfs.pod:1890
39131 "Note that libguestfs functions can call themselves, so you may see many "
39132 "events from a single call. A few libguestfs functions do not generate this "
39137 #: ../src/guestfs.pod:1898
39138 msgid "guestfs_set_event_callback"
39142 #: ../src/guestfs.pod:1900
39145 " int guestfs_set_event_callback (guestfs_h *g,\n"
39146 " guestfs_event_callback cb,\n"
39147 " uint64_t event_bitmask,\n"
39149 " void *opaque);\n"
39154 #: ../src/guestfs.pod:1906
39156 "This function registers a callback (C<cb>) for all event classes in the "
39157 "C<event_bitmask>."
39161 #: ../src/guestfs.pod:1909
39163 "For example, to register for all log message events, you could call this "
39164 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
39165 "To register a single callback for all possible classes of events, use "
39166 "C<GUESTFS_EVENT_ALL>."
39170 #: ../src/guestfs.pod:1915
39171 msgid "C<flags> should always be passed as 0."
39175 #: ../src/guestfs.pod:1917
39177 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
39178 "it for any purpose."
39182 #: ../src/guestfs.pod:1920
39184 "The return value is the event handle (an integer) which you can use to "
39185 "delete the callback (see below)."
39189 #: ../src/guestfs.pod:1923
39191 "If there is an error, this function returns C<-1>, and sets the error in the "
39192 "handle in the usual way (see L</guestfs_last_error> etc.)"
39196 #: ../src/guestfs.pod:1926
39198 "Callbacks remain in effect until they are deleted, or until the handle is "
39203 #: ../src/guestfs.pod:1929
39205 "In the case where multiple callbacks are registered for a particular event "
39206 "class, all of the callbacks are called. The order in which multiple "
39207 "callbacks are called is not defined."
39211 #: ../src/guestfs.pod:1933
39212 msgid "guestfs_delete_event_callback"
39216 #: ../src/guestfs.pod:1935
39219 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
39224 #: ../src/guestfs.pod:1937
39226 "Delete a callback that was previously registered. C<event_handle> should be "
39227 "the integer that was returned by a previous call to "
39228 "C<guestfs_set_event_callback> on the same handle."
39232 #: ../src/guestfs.pod:1941
39233 msgid "guestfs_event_callback"
39237 #: ../src/guestfs.pod:1943
39240 " typedef void (*guestfs_event_callback) (\n"
39243 " uint64_t event,\n"
39244 " int event_handle,\n"
39246 " const char *buf, size_t buf_len,\n"
39247 " const uint64_t *array, size_t array_len);\n"
39252 #: ../src/guestfs.pod:1952
39254 "This is the type of the event callback function that you have to provide."
39258 #: ../src/guestfs.pod:1955
39260 "The basic parameters are: the handle (C<g>), the opaque user pointer "
39261 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
39262 "handle, and C<flags> which in the current API you should ignore."
39266 #: ../src/guestfs.pod:1959
39268 "The remaining parameters contain the event payload (if any). Each event may "
39269 "contain a payload, which usually relates to the event class, but for future "
39270 "proofing your code should be written to handle any payload for any event "
39275 #: ../src/guestfs.pod:1964
39277 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
39278 "there is no message buffer). Note that this message buffer can contain "
39279 "arbitrary 8 bit data, including NUL bytes."
39283 #: ../src/guestfs.pod:1968
39285 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
39286 "moment this is only used for progress messages."
39290 #: ../src/guestfs.pod:1971
39291 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
39295 #: ../src/guestfs.pod:1973
39297 "One motivation for the generic event API was to allow GUI programs to "
39298 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
39299 "unconditionally to C<stderr>."
39303 #: ../src/guestfs.pod:1977
39305 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
39306 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
39307 "messages are not events; you must capture error messages separately)."
39311 #: ../src/guestfs.pod:1982
39313 "Programs have to set up a callback to capture the classes of events of "
39318 #: ../src/guestfs.pod:1985
39322 " guestfs_set_event_callback\n"
39323 " (g, message_callback,\n"
39324 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
39325 " GUESTFS_EVENT_TRACE,\n"
39326 " 0, NULL) == -1)\n"
39327 " if (eh == -1) {\n"
39328 " // handle error in the usual way\n"
39334 #: ../src/guestfs.pod:1995
39336 "The callback can then direct messages to the appropriate place. In this "
39337 "example, messages are directed to syslog:"
39341 #: ../src/guestfs.pod:1998
39345 " message_callback (\n"
39348 " uint64_t event,\n"
39349 " int event_handle,\n"
39351 " const char *buf, size_t buf_len,\n"
39352 " const uint64_t *array, size_t array_len)\n"
39354 " const int priority = LOG_USER|LOG_INFO;\n"
39355 " if (buf_len > 0)\n"
39356 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
39362 #: ../src/guestfs.pod:2013
39363 msgid "CANCELLING LONG TRANSFERS"
39367 #: ../src/guestfs.pod:2015
39369 "Some operations can be cancelled by the caller while they are in progress. "
39370 "Currently only operations that involve uploading or downloading data can be "
39371 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
39372 "parameters in the generator)."
39376 #: ../src/guestfs.pod:2020
39377 msgid "guestfs_user_cancel"
39381 #: ../src/guestfs.pod:2022
39384 " void guestfs_user_cancel (guestfs_h *g);\n"
39389 #: ../src/guestfs.pod:2024
39391 "C<guestfs_user_cancel> cancels the current upload or download operation."
39395 #: ../src/guestfs.pod:2027
39397 "Unlike most other libguestfs calls, this function is signal safe and thread "
39398 "safe. You can call it from a signal handler or from another thread, without "
39399 "needing to do any locking."
39403 #: ../src/guestfs.pod:2031
39405 "The transfer that was in progress (if there is one) will stop shortly "
39406 "afterwards, and will return an error. The errno (see L</"
39407 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
39408 "out if the operation was cancelled or failed because of another error."
39412 #: ../src/guestfs.pod:2037
39414 "No cleanup is performed: for example, if a file was being uploaded then "
39415 "after cancellation there may be a partially uploaded file. It is the "
39416 "caller's responsibility to clean up if necessary."
39420 #: ../src/guestfs.pod:2041
39421 msgid "There are two common places that you might call C<guestfs_user_cancel>."
39425 #: ../src/guestfs.pod:2043
39427 "In an interactive text-based program, you might call it from a C<SIGINT> "
39428 "signal handler so that pressing C<^C> cancels the current operation. (You "
39429 "also need to call L</guestfs_set_pgroup> so that child processes don't "
39430 "receive the C<^C> signal)."
39434 #: ../src/guestfs.pod:2048
39436 "In a graphical program, when the main thread is displaying a progress bar "
39437 "with a cancel button, wire up the cancel button to call this function."
39441 #: ../src/guestfs.pod:2052
39442 msgid "PRIVATE DATA AREA"
39446 #: ../src/guestfs.pod:2054
39448 "You can attach named pieces of private data to the libguestfs handle, fetch "
39449 "them by name, and walk over them, for the lifetime of the handle. This is "
39450 "called the private data area and is only available from the C API."
39454 #: ../src/guestfs.pod:2059
39455 msgid "To attach a named piece of data, use the following call:"
39459 #: ../src/guestfs.pod:2061
39462 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
39467 #: ../src/guestfs.pod:2063
39469 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
39470 "pointer (which can be C<NULL>). Any previous item with the same key is "
39475 #: ../src/guestfs.pod:2067
39477 "You can use any C<key> you want, but your key should I<not> start with an "
39478 "underscore character. Keys beginning with an underscore character are "
39479 "reserved for internal libguestfs purposes (eg. for implementing language "
39480 "bindings). It is recommended that you prefix the key with some unique "
39481 "string to avoid collisions with other users."
39485 #: ../src/guestfs.pod:2073
39486 msgid "To retrieve the pointer, use:"
39490 #: ../src/guestfs.pod:2075
39493 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
39498 #: ../src/guestfs.pod:2077
39500 "This function returns C<NULL> if either no data is found associated with "
39501 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
39506 #: ../src/guestfs.pod:2081
39508 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
39509 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
39510 "all. In particular, libguestfs does I<not> try to free the data when the "
39511 "handle is closed. If the data must be freed, then the caller must either "
39512 "free it before calling L</guestfs_close> or must set up a close callback to "
39513 "do it (see L</GUESTFS_EVENT_CLOSE>)."
39517 #: ../src/guestfs.pod:2088
39518 msgid "To walk over all entries, use these two functions:"
39522 #: ../src/guestfs.pod:2090
39525 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
39530 #: ../src/guestfs.pod:2092
39533 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
39538 #: ../src/guestfs.pod:2094
39540 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
39541 "not have any particular meaning -- keys are not returned in any defined "
39542 "order). A pointer to the key is returned in C<*key_rtn> and the "
39543 "corresponding data pointer is returned from the function. C<NULL> is "
39544 "returned if there are no keys stored in the handle."
39548 #: ../src/guestfs.pod:2100
39550 "C<guestfs_next_private> returns the next key, pointer pair. The return "
39551 "value of this function is also C<NULL> is there are no further entries to "
39556 #: ../src/guestfs.pod:2104
39557 msgid "Notes about walking over entries:"
39561 #: ../src/guestfs.pod:2110
39563 "You must not call C<guestfs_set_private> while walking over the entries."
39567 #: ../src/guestfs.pod:2115
39569 "The handle maintains an internal iterator which is reset when you call "
39570 "C<guestfs_first_private>. This internal iterator is invalidated when you "
39571 "call C<guestfs_set_private>."
39575 #: ../src/guestfs.pod:2121
39576 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
39580 #: ../src/guestfs.pod:2123
39583 " guestfs_set_private (g, key, NULL);\n"
39588 #: ../src/guestfs.pod:2125
39589 msgid "then that C<key> is not returned when walking."
39593 #: ../src/guestfs.pod:2129
39595 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
39596 "C<guestfs_next_private> or C<guestfs_set_private>."
39600 #: ../src/guestfs.pod:2135
39602 "The following example code shows how to print all keys and data pointers "
39603 "that are associated with the handle C<g>:"
39607 #: ../src/guestfs.pod:2138
39610 " const char *key;\n"
39611 " void *data = guestfs_first_private (g, &key);\n"
39612 " while (data != NULL)\n"
39614 " printf (\"key = %s, data = %p\\n\", key, data);\n"
39615 " data = guestfs_next_private (g, &key);\n"
39621 #: ../src/guestfs.pod:2146
39623 "More commonly you are only interested in keys that begin with an application-"
39624 "specific prefix C<foo_>. Modify the loop like so:"
39628 #: ../src/guestfs.pod:2149
39631 " const char *key;\n"
39632 " void *data = guestfs_first_private (g, &key);\n"
39633 " while (data != NULL)\n"
39635 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
39636 " printf (\"key = %s, data = %p\\n\", key, data);\n"
39637 " data = guestfs_next_private (g, &key);\n"
39643 #: ../src/guestfs.pod:2158
39645 "If you need to modify keys while walking, then you have to jump back to the "
39646 "beginning of the loop. For example, to delete all keys prefixed with "
39651 #: ../src/guestfs.pod:2162
39654 " const char *key;\n"
39657 " data = guestfs_first_private (g, &key);\n"
39658 " while (data != NULL)\n"
39660 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
39662 " guestfs_set_private (g, key, NULL);\n"
39663 " /* note that 'key' pointer is now invalid, and so is\n"
39664 " the internal iterator */\n"
39667 " data = guestfs_next_private (g, &key);\n"
39673 #: ../src/guestfs.pod:2178
39675 "Note that the above loop is guaranteed to terminate because the keys are "
39676 "being deleted, but other manipulations of keys within the loop might not "
39677 "terminate unless you also maintain an indication of which keys have been "
39682 #: ../src/guestfs.pod:2183
39687 #: ../src/guestfs.pod:2185
39689 "The libguestfs C library can be probed using systemtap or DTrace. This is "
39690 "true of any library, not just libguestfs. However libguestfs also contains "
39691 "static markers to help in probing internal operations."
39695 #: ../src/guestfs.pod:2189
39696 msgid "You can list all the static markers by doing:"
39700 #: ../src/guestfs.pod:2191
39703 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
39704 " .provider(\"guestfs\").mark(\"*\")'\n"
39709 #: ../src/guestfs.pod:2194
39711 "B<Note:> These static markers are I<not> part of the stable API and may "
39712 "change in future versions."
39716 #: ../src/guestfs.pod:2197
39717 msgid "SYSTEMTAP SCRIPT EXAMPLE"
39721 #: ../src/guestfs.pod:2199
39723 "This script contains examples of displaying both the static markers and some "
39724 "ordinary C entry points:"
39728 #: ../src/guestfs.pod:2202
39736 #: ../src/guestfs.pod:2204
39739 " function display_time () {\n"
39740 " now = gettimeofday_us ();\n"
39743 " delta = now - last;\n"
39749 #: ../src/guestfs.pod:2211
39752 " printf (\"%d (+%d):\", now, delta);\n"
39758 #: ../src/guestfs.pod:2214
39763 " printf (\"ready\\n\");\n"
39769 #: ../src/guestfs.pod:2219
39772 " /* Display all calls to static markers. */\n"
39773 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
39774 " .provider(\"guestfs\").mark(\"*\") ? {\n"
39775 " display_time();\n"
39776 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
39782 #: ../src/guestfs.pod:2226
39785 " /* Display all calls to guestfs_mkfs* functions. */\n"
39786 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
39787 " .function(\"guestfs_mkfs*\") ? {\n"
39788 " display_time();\n"
39789 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
39795 #: ../src/guestfs.pod:2233
39797 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
39798 "program. Note that you either have to be root, or you have to add yourself "
39799 "to several special stap groups. Consult the systemtap documentation for "
39800 "more information."
39804 #: ../src/guestfs.pod:2238
39807 " # stap /tmp/test.stap\n"
39813 #: ../src/guestfs.pod:2241
39814 msgid "In another terminal, run a guestfish command such as this:"
39818 #: ../src/guestfs.pod:2245
39819 msgid "In the first terminal, stap trace output similar to this is shown:"
39823 #: ../src/guestfs.pod:2247
39826 " 1318248056692655 (+0):\tlaunch_start\n"
39827 " 1318248056692850 (+195): launch_build_appliance_start\n"
39828 " 1318248056818285 (+125435): launch_build_appliance_end\n"
39829 " 1318248056838059 (+19774): launch_run_qemu\n"
39830 " 1318248061071167 (+4233108): launch_end\n"
39831 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f device=0x1024e60\n"
39836 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
39841 #: ../src/guestfs.pod:2256
39843 "<!-- old anchor for the next section --> <a name="
39844 "\"state_machine_and_low_level_event_api\"/>"
39848 #: ../src/guestfs.pod:2261
39849 msgid "ARCHITECTURE"
39853 #: ../src/guestfs.pod:2263
39855 "Internally, libguestfs is implemented by running an appliance (a special "
39856 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
39857 "process of the main program."
39861 #: ../src/guestfs.pod:2267
39864 " ___________________\n"
39866 " | main program |\n"
39868 " | | child process / appliance\n"
39869 " | | __________________________\n"
39871 " +-------------------+ RPC | +-----------------+ |\n"
39872 " | libguestfs <--------------------> guestfsd | |\n"
39873 " | | | +-----------------+ |\n"
39874 " \\___________________/ | | Linux kernel | |\n"
39875 " | +--^--------------+ |\n"
39876 " \\_________|________________/\n"
39878 " _______v______\n"
39881 " | disk image |\n"
39882 " \\______________/\n"
39887 #: ../src/guestfs.pod:2287
39889 "The library, linked to the main program, creates the child process and hence "
39890 "the appliance in the L</guestfs_launch> function."
39894 #: ../src/guestfs.pod:2290
39896 "Inside the appliance is a Linux kernel and a complete stack of userspace "
39897 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
39898 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
39899 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
39900 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
39901 "attached to the qemu process which translates device access by the "
39902 "appliance's Linux kernel into accesses to the image."
39906 #: ../src/guestfs.pod:2299
39908 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
39909 "Although the disk image you are attached to might also be used by some "
39910 "virtual machine, libguestfs doesn't know or care about this. (But you will "
39911 "care if both libguestfs's qemu process and your virtual machine are trying "
39912 "to update the disk image at the same time, since these usually results in "
39913 "massive disk corruption)."
39917 #: ../src/guestfs.pod:2306
39918 msgid "STATE MACHINE"
39922 #: ../src/guestfs.pod:2308
39923 msgid "libguestfs uses a state machine to model the child process:"
39927 #: ../src/guestfs.pod:2310
39931 " guestfs_create\n"
39939 " / | \\ \\ guestfs_launch\n"
39940 " / | _\\__V______\n"
39942 " / | | LAUNCHING |\n"
39943 " / | \\___________/\n"
39945 " / | guestfs_launch\n"
39947 " ______ / __|____V\n"
39948 " / \\ ------> / \\\n"
39949 " | BUSY | | READY |\n"
39950 " \\______/ <------ \\________/\n"
39955 #: ../src/guestfs.pod:2332
39957 "The normal transitions are (1) CONFIG (when the handle is created, but there "
39958 "is no child process), (2) LAUNCHING (when the child process is booting up), "
39959 "(3) alternating between READY and BUSY as commands are issued to, and "
39960 "carried out by, the child process."
39964 #: ../src/guestfs.pod:2337
39966 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
39967 "asynchronously at any time (eg. due to some internal error), and that causes "
39968 "the state to transition back to CONFIG."
39972 #: ../src/guestfs.pod:2341
39974 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
39975 "issued when in the CONFIG state."
39979 #: ../src/guestfs.pod:2344
39981 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
39982 "L</guestfs_launch> blocks until the child process is READY to accept "
39983 "commands (or until some failure or timeout). L</guestfs_launch> internally "
39984 "moves the state from CONFIG to LAUNCHING while it is running."
39988 #: ../src/guestfs.pod:2350
39990 "API actions such as L</guestfs_mount> can only be issued when in the READY "
39991 "state. These API calls block waiting for the command to be carried out (ie. "
39992 "the state to transition to BUSY and then back to READY). There are no non-"
39993 "blocking versions, and no way to issue more than one command per handle at "
39998 #: ../src/guestfs.pod:2356
40000 "Finally, the child process sends asynchronous messages back to the main "
40001 "program, such as kernel log messages. You can register a callback to "
40002 "receive these messages."
40006 #: ../src/guestfs.pod:2360
40011 #: ../src/guestfs.pod:2362
40012 msgid "APPLIANCE BOOT PROCESS"
40016 #: ../src/guestfs.pod:2364
40018 "This process has evolved and continues to evolve. The description here "
40019 "corresponds only to the current version of libguestfs and is provided for "
40020 "information only."
40024 #: ../src/guestfs.pod:2368
40026 "In order to follow the stages involved below, enable libguestfs debugging "
40027 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
40031 #: ../src/guestfs.pod:2373
40032 msgid "Create the appliance"
40036 #: ../src/guestfs.pod:2375
40038 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
40039 "initrd and the appliance."
40043 #: ../src/guestfs.pod:2378
40045 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
40046 "directory if C<TMPDIR> is set)."
40050 #: ../src/guestfs.pod:2381
40052 "For a complete description of how the appliance is created and cached, read "
40053 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
40057 #: ../src/guestfs.pod:2385
40058 msgid "Start qemu and boot the kernel"
40062 #: ../src/guestfs.pod:2387
40063 msgid "qemu is invoked to boot the kernel."
40067 #: ../src/guestfs.pod:2389
40068 msgid "Run the initrd"
40072 #: ../src/guestfs.pod:2391
40074 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
40075 "appliance. The purpose of the initrd is to load enough kernel modules in "
40076 "order that the appliance itself can be mounted and started."
40080 #: ../src/guestfs.pod:2395
40082 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
40087 #: ../src/guestfs.pod:2398
40089 "When the initrd has started you will see messages showing that kernel "
40090 "modules are being loaded, similar to this:"
40094 #: ../src/guestfs.pod:2401
40097 " febootstrap: ext2 mini initrd starting up\n"
40098 " febootstrap: mounting /sys\n"
40099 " febootstrap: internal insmod libcrc32c.ko\n"
40100 " febootstrap: internal insmod crc32c-intel.ko\n"
40105 #: ../src/guestfs.pod:2406
40106 msgid "Find and mount the appliance device"
40110 #: ../src/guestfs.pod:2408
40112 "The appliance is a sparse file containing an ext2 filesystem which contains "
40113 "a familiar (although reduced in size) Linux operating system. It would "
40114 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
40118 #: ../src/guestfs.pod:2412
40120 "The regular disks being inspected by libguestfs are the first devices "
40121 "exposed by qemu (eg. as C</dev/vda>)."
40125 #: ../src/guestfs.pod:2415
40127 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
40128 "there was only one regular disk)."
40132 #: ../src/guestfs.pod:2418
40134 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
40135 "and switch root into the appliance, and run C</init> from the appliance."
40139 #: ../src/guestfs.pod:2422
40140 msgid "If this works successfully you will see messages such as:"
40144 #: ../src/guestfs.pod:2424
40147 " febootstrap: picked /sys/block/vdb/dev as root device\n"
40148 " febootstrap: creating /dev/root as block special 252:16\n"
40149 " febootstrap: mounting new root on /root\n"
40150 " febootstrap: chroot\n"
40151 " Starting /init script ...\n"
40156 #: ../src/guestfs.pod:2430
40158 "Note that C<Starting /init script ...> indicates that the appliance's init "
40159 "script is now running."
40163 #: ../src/guestfs.pod:2433
40164 msgid "Initialize the appliance"
40168 #: ../src/guestfs.pod:2435
40170 "The appliance itself now initializes itself. This involves starting certain "
40171 "processes like C<udev>, possibly printing some debug information, and "
40172 "finally running the daemon (C<guestfsd>)."
40176 #: ../src/guestfs.pod:2439
40181 #: ../src/guestfs.pod:2441
40183 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
40188 #: ../src/guestfs.pod:2444
40191 " verbose daemon enabled\n"
40196 #: ../src/guestfs.pod:2446
40198 "The daemon expects to see a named virtio-serial port exposed by qemu and "
40199 "connected on the other end to the library."
40203 #: ../src/guestfs.pod:2449
40205 "The daemon connects to this port (and hence to the library) and sends a four "
40206 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
40207 "protocol (see below)."
40211 #: ../src/guestfs.pod:2455
40212 msgid "COMMUNICATION PROTOCOL"
40216 #: ../src/guestfs.pod:2457
40218 "Don't rely on using this protocol directly. This section documents how it "
40219 "currently works, but it may change at any time."
40223 #: ../src/guestfs.pod:2460
40225 "The protocol used to talk between the library and the daemon running inside "
40226 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
40227 "1014, RFC 1832, RFC 4506)."
40231 #: ../src/guestfs.pod:2464
40233 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
40234 "this file is automatically generated)."
40238 #: ../src/guestfs.pod:2467
40240 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
40241 "and C<FileOut> parameters, which are handled with very simple request/reply "
40242 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
40243 "parameters, which use the same request and reply messages, but they may also "
40244 "be followed by files sent using a chunked encoding."
40248 #: ../src/guestfs.pod:2474
40249 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
40253 #: ../src/guestfs.pod:2476
40254 msgid "For ordinary functions, the request message is:"
40258 #: ../src/guestfs.pod:2478
40261 " total length (header + arguments,\n"
40262 " but not including the length word itself)\n"
40263 " struct guestfs_message_header (encoded as XDR)\n"
40264 " struct guestfs_<foo>_args (encoded as XDR)\n"
40269 #: ../src/guestfs.pod:2483
40271 "The total length field allows the daemon to allocate a fixed size buffer "
40272 "into which it slurps the rest of the message. As a result, the total length "
40273 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
40274 "effective size of any request is limited to somewhere under this size."
40278 #: ../src/guestfs.pod:2489
40280 "Note also that many functions don't take any arguments, in which case the "
40281 "C<guestfs_I<foo>_args> is completely omitted."
40285 #: ../src/guestfs.pod:2492
40287 "The header contains the procedure number (C<guestfs_proc>) which is how the "
40288 "receiver knows what type of args structure to expect, or none at all."
40292 #: ../src/guestfs.pod:2496
40294 "For functions that take optional arguments, the optional arguments are "
40295 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
40296 "arguments. A bitmask in the header indicates which optional arguments are "
40297 "meaningful. The bitmask is also checked to see if it contains bits set "
40298 "which the daemon does not know about (eg. if more optional arguments were "
40299 "added in a later version of the library), and this causes the call to be "
40304 #: ../src/guestfs.pod:2504
40305 msgid "The reply message for ordinary functions is:"
40309 #: ../src/guestfs.pod:2506
40312 " total length (header + ret,\n"
40313 " but not including the length word itself)\n"
40314 " struct guestfs_message_header (encoded as XDR)\n"
40315 " struct guestfs_<foo>_ret (encoded as XDR)\n"
40320 #: ../src/guestfs.pod:2511
40322 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
40323 "functions that return no formal return values."
40327 #: ../src/guestfs.pod:2514
40329 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
40333 #: ../src/guestfs.pod:2517
40335 "In the case of an error, a flag is set in the header, and the reply message "
40336 "is slightly changed:"
40340 #: ../src/guestfs.pod:2520
40343 " total length (header + error,\n"
40344 " but not including the length word itself)\n"
40345 " struct guestfs_message_header (encoded as XDR)\n"
40346 " struct guestfs_message_error (encoded as XDR)\n"
40351 #: ../src/guestfs.pod:2525
40353 "The C<guestfs_message_error> structure contains the error message as a "
40358 #: ../src/guestfs.pod:2528
40359 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
40363 #: ../src/guestfs.pod:2530
40365 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
40366 "The normal request message is sent (see above). However this is followed by "
40367 "a sequence of file chunks."
40371 #: ../src/guestfs.pod:2534
40374 " total length (header + arguments,\n"
40375 " but not including the length word itself,\n"
40376 " and not including the chunks)\n"
40377 " struct guestfs_message_header (encoded as XDR)\n"
40378 " struct guestfs_<foo>_args (encoded as XDR)\n"
40379 " sequence of chunks for FileIn param #0\n"
40380 " sequence of chunks for FileIn param #1 etc.\n"
40385 #: ../src/guestfs.pod:2542
40386 msgid "The \"sequence of chunks\" is:"
40390 #: ../src/guestfs.pod:2544
40393 " length of chunk (not including length word itself)\n"
40394 " struct guestfs_chunk (encoded as XDR)\n"
40395 " length of chunk\n"
40396 " struct guestfs_chunk (encoded as XDR)\n"
40398 " length of chunk\n"
40399 " struct guestfs_chunk (with data.data_len == 0)\n"
40404 #: ../src/guestfs.pod:2552
40406 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
40407 "is set in the final chunk to indicate either successful completion or early "
40412 #: ../src/guestfs.pod:2556
40414 "At time of writing there are no functions that have more than one FileIn "
40415 "parameter. However this is (theoretically) supported, by sending the "
40416 "sequence of chunks for each FileIn parameter one after another (from left to "
40421 #: ../src/guestfs.pod:2561
40423 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
40424 "transfer. The library does this by sending a chunk with a special flag set "
40425 "to indicate cancellation. When the daemon sees this, it cancels the whole "
40426 "RPC, does I<not> send any reply, and goes back to reading the next request."
40430 #: ../src/guestfs.pod:2567
40432 "The daemon may also cancel. It does this by writing a special word "
40433 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
40434 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
40435 "cancel chunk). The special word is chosen so that even if cancellation "
40436 "happens right at the end of the transfer (after the library has finished "
40437 "writing and has started listening for the reply), the \"spurious\" cancel "
40438 "flag will not be confused with the reply message."
40442 #: ../src/guestfs.pod:2576
40444 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
40445 "limit), and also files where the size is not known in advance (eg. from "
40446 "pipes or sockets). However the chunks are rather small "
40447 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
40448 "to keep much in memory."
40452 #: ../src/guestfs.pod:2582
40453 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
40457 #: ../src/guestfs.pod:2584
40459 "The protocol for FileOut parameters is exactly the same as for FileIn "
40460 "parameters, but with the roles of daemon and library reversed."
40464 #: ../src/guestfs.pod:2587
40467 " total length (header + ret,\n"
40468 " but not including the length word itself,\n"
40469 " and not including the chunks)\n"
40470 " struct guestfs_message_header (encoded as XDR)\n"
40471 " struct guestfs_<foo>_ret (encoded as XDR)\n"
40472 " sequence of chunks for FileOut param #0\n"
40473 " sequence of chunks for FileOut param #1 etc.\n"
40478 #: ../src/guestfs.pod:2595
40479 msgid "INITIAL MESSAGE"
40483 #: ../src/guestfs.pod:2597
40485 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
40486 "which indicates that the guest and daemon is alive. This is what L</"
40487 "guestfs_launch> waits for."
40491 #: ../src/guestfs.pod:2601
40492 msgid "PROGRESS NOTIFICATION MESSAGES"
40496 #: ../src/guestfs.pod:2603
40498 "The daemon may send progress notification messages at any time. These are "
40499 "distinguished by the normal length word being replaced by "
40500 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
40504 #: ../src/guestfs.pod:2607
40506 "The library turns them into progress callbacks (see L</"
40507 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
40512 #: ../src/guestfs.pod:2611
40514 "The daemon self-limits the frequency of progress messages it sends (see "
40515 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
40520 #: ../src/guestfs.pod:2615
40521 msgid "LIBGUESTFS VERSION NUMBERS"
40525 #: ../src/guestfs.pod:2617
40527 "Since April 2010, libguestfs has started to make separate development and "
40528 "stable releases, along with corresponding branches in our git repository. "
40529 "These separate releases can be identified by version number:"
40533 #: ../src/guestfs.pod:2622
40536 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
40537 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
40543 " | `-------- sub-version\n"
40545 " `------ always '1' because we don't change the ABI\n"
40550 #: ../src/guestfs.pod:2633
40551 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
40555 #: ../src/guestfs.pod:2635
40557 "As time passes we cherry pick fixes from the development branch and backport "
40558 "those into the stable branch, the effect being that the stable branch should "
40559 "get more stable and less buggy over time. So the stable releases are ideal "
40560 "for people who don't need new features but would just like the software to "
40565 #: ../src/guestfs.pod:2641
40566 msgid "Our criteria for backporting changes are:"
40570 #: ../src/guestfs.pod:2647
40572 "Documentation changes which don't affect any code are backported unless the "
40573 "documentation refers to a future feature which is not in stable."
40577 #: ../src/guestfs.pod:2653
40579 "Bug fixes which are not controversial, fix obvious problems, and have been "
40580 "well tested are backported."
40584 #: ../src/guestfs.pod:2658
40586 "Simple rearrangements of code which shouldn't affect how it works get "
40587 "backported. This is so that the code in the two branches doesn't get too "
40588 "far out of step, allowing us to backport future fixes more easily."
40592 #: ../src/guestfs.pod:2664
40594 "We I<don't> backport new features, new APIs, new tools etc, except in one "
40595 "exceptional case: the new feature is required in order to implement an "
40596 "important bug fix."
40600 #: ../src/guestfs.pod:2670
40602 "A new stable branch starts when we think the new features in development are "
40603 "substantial and compelling enough over the current stable branch to warrant "
40604 "it. When that happens we create new stable and development versions 1.N.0 "
40605 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
40606 "stable at this point, but by backporting fixes from development, that branch "
40607 "will stabilize over time."
40611 #: ../src/guestfs.pod:2678
40612 msgid "EXTENDING LIBGUESTFS"
40616 #: ../src/guestfs.pod:2680
40617 msgid "ADDING A NEW API ACTION"
40621 #: ../src/guestfs.pod:2682
40623 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
40624 "documentation) are generated, and this makes it easy to extend the "
40629 #: ../src/guestfs.pod:2686
40630 msgid "To add a new API action there are two changes:"
40634 #: ../src/guestfs.pod:2692
40636 "You need to add a description of the call (name, parameters, return type, "
40637 "tests, documentation) to C<generator/generator_actions.ml>."
40641 #: ../src/guestfs.pod:2695
40643 "There are two sorts of API action, depending on whether the call goes "
40644 "through to the daemon in the appliance, or is serviced entirely by the "
40645 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
40646 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
40647 "an example of the latter, since a trace flag is maintained in the handle and "
40648 "all tracing is done on the library side."
40652 #: ../src/guestfs.pod:2703
40654 "Most new actions are of the first type, and get added to the "
40655 "C<daemon_functions> list. Each function has a unique procedure number used "
40656 "in the RPC protocol which is assigned to that action when we publish "
40657 "libguestfs and cannot be reused. Take the latest procedure number and "
40662 #: ../src/guestfs.pod:2709
40664 "For library-only actions of the second type, add to the "
40665 "C<non_daemon_functions> list. Since these functions are serviced by the "
40666 "library and do not travel over the RPC mechanism to the daemon, these "
40667 "functions do not need a procedure number, and so the procedure number is set "
40672 #: ../src/guestfs.pod:2717
40673 msgid "Implement the action (in C):"
40677 #: ../src/guestfs.pod:2719
40679 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
40680 "C<daemon/> directory."
40684 #: ../src/guestfs.pod:2722
40686 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
40687 "(note: double underscore) in the C<src/> directory."
40691 #: ../src/guestfs.pod:2725
40692 msgid "In either case, use another function as an example of what to do."
40696 #: ../src/guestfs.pod:2729
40697 msgid "After making these changes, use C<make> to compile."
40701 #: ../src/guestfs.pod:2731
40703 "Note that you don't need to implement the RPC, language bindings, manual "
40704 "pages or anything else. It's all automatically generated from the OCaml "
40709 #: ../src/guestfs.pod:2735
40710 msgid "ADDING TESTS FOR AN API ACTION"
40714 #: ../src/guestfs.pod:2737
40716 "You can supply zero or as many tests as you want per API call. The tests "
40717 "can either be added as part of the API description (C<generator/"
40718 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
40719 "into C<regressions/>. Note that adding a script to C<regressions/> is "
40720 "slower, so if possible use the first method."
40724 #: ../src/guestfs.pod:2743
40726 "The following describes the test environment used when you add an API test "
40727 "in C<generator_actions.ml>."
40731 #: ../src/guestfs.pod:2746
40732 msgid "The test environment has 4 block devices:"
40736 #: ../src/guestfs.pod:2750
40737 msgid "C</dev/sda> 500MB"
40741 #: ../src/guestfs.pod:2752
40742 msgid "General block device for testing."
40746 #: ../src/guestfs.pod:2754
40747 msgid "C</dev/sdb> 50MB"
40751 #: ../src/guestfs.pod:2756
40753 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
40758 #: ../src/guestfs.pod:2759
40759 msgid "C</dev/sdc> 10MB"
40763 #: ../src/guestfs.pod:2761
40764 msgid "Used in a few tests where two block devices are needed."
40768 #: ../src/guestfs.pod:2763
40769 msgid "C</dev/sdd>"
40773 #: ../src/guestfs.pod:2765
40774 msgid "ISO with fixed content (see C<images/test.iso>)."
40778 #: ../src/guestfs.pod:2769
40780 "To be able to run the tests in a reasonable amount of time, the libguestfs "
40781 "appliance and block devices are reused between tests. So don't try testing "
40782 "L</guestfs_kill_subprocess> :-x"
40786 #: ../src/guestfs.pod:2773
40788 "Each test starts with an initial scenario, selected using one of the "
40789 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
40790 "initialize the disks mentioned above in a particular way as documented in "
40791 "C<generator_types.ml>. You should not assume anything about the previous "
40792 "contents of other disks that are not initialized."
40796 #: ../src/guestfs.pod:2779
40798 "You can add a prerequisite clause to any individual test. This is a run-"
40799 "time check, which, if it fails, causes the test to be skipped. Useful if "
40800 "testing a command which might not work on all variations of libguestfs "
40801 "builds. A test that has prerequisite of C<Always> means to run "
40806 #: ../src/guestfs.pod:2785
40808 "In addition, packagers can skip individual tests by setting environment "
40809 "variables before running C<make check>."
40813 #: ../src/guestfs.pod:2788
40816 " SKIP_TEST_<CMD>_<NUM>=1\n"
40821 #: ../src/guestfs.pod:2790
40822 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
40826 #: ../src/guestfs.pod:2794
40829 " SKIP_TEST_<CMD>=1\n"
40834 #: ../src/guestfs.pod:2796
40835 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
40839 #: ../src/guestfs.pod:2798
40840 msgid "Packagers can run only certain tests by setting for example:"
40844 #: ../src/guestfs.pod:2800
40847 " TEST_ONLY=\"vfs_type zerofree\"\n"
40852 #: ../src/guestfs.pod:2802
40854 "See C<capitests/tests.c> for more details of how these environment variables "
40859 #: ../src/guestfs.pod:2805
40860 msgid "DEBUGGING NEW API ACTIONS"
40864 #: ../src/guestfs.pod:2807
40865 msgid "Test new actions work before submitting them."
40869 #: ../src/guestfs.pod:2809
40870 msgid "You can use guestfish to try out new commands."
40874 #: ../src/guestfs.pod:2811
40876 "Debugging the daemon is a problem because it runs inside a minimal "
40877 "environment. However you can fprintf messages in the daemon to stderr, and "
40878 "they will show up if you use C<guestfish -v>."
40882 #: ../src/guestfs.pod:2815
40883 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
40887 #: ../src/guestfs.pod:2817
40889 "Our C source code generally adheres to some basic code-formatting "
40890 "conventions. The existing code base is not totally consistent on this "
40891 "front, but we do prefer that contributed code be formatted similarly. In "
40892 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
40893 "indentation level, and other than that, follow the K&R style."
40897 #: ../src/guestfs.pod:2823
40899 "If you use Emacs, add the following to one of one of your start-up files (e."
40900 "g., ~/.emacs), to help ensure that you get indentation right:"
40904 #: ../src/guestfs.pod:2826
40907 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
40908 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
40909 " (add-hook 'find-file-hook\n"
40910 " '(lambda () (if (and buffer-file-name\n"
40911 " (string-match \"/libguestfs\\\\>\"\n"
40912 " (buffer-file-name))\n"
40913 " (not (string-equal mode-name \"Change Log\"))\n"
40914 " (not (string-equal mode-name \"Makefile\")))\n"
40915 " (setq indent-tabs-mode nil))))\n"
40920 #: ../src/guestfs.pod:2836
40923 " ;;; When editing C sources in libguestfs, use this style.\n"
40924 " (defun libguestfs-c-mode ()\n"
40925 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
40927 " (c-set-style \"K&R\")\n"
40928 " (setq c-indent-level 2)\n"
40929 " (setq c-basic-offset 2))\n"
40930 " (add-hook 'c-mode-hook\n"
40931 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
40932 " (buffer-file-name))\n"
40933 " (libguestfs-c-mode))))\n"
40938 #: ../src/guestfs.pod:2848
40939 msgid "Enable warnings when compiling (and fix any problems this finds):"
40943 #: ../src/guestfs.pod:2851
40946 " ./configure --enable-gcc-warnings\n"
40951 #: ../src/guestfs.pod:2853
40952 msgid "Useful targets are:"
40956 #: ../src/guestfs.pod:2855
40959 " make syntax-check # checks the syntax of the C code\n"
40960 " make check # runs the test suite\n"
40965 #: ../src/guestfs.pod:2858
40966 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
40970 #: ../src/guestfs.pod:2860
40972 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
40973 "which are used to do shell quoting."
40977 #: ../src/guestfs.pod:2865
40982 #: ../src/guestfs.pod:2867
40984 "Simple shell quoted string. Any spaces or other shell characters are "
40989 #: ../src/guestfs.pod:2870
40994 #: ../src/guestfs.pod:2872
40996 "Same as C<%Q> except the string is treated as a path which is prefixed by "
41001 #: ../src/guestfs.pod:2879
41004 " asprintf (&cmd, \"cat %R\", path);\n"
41009 #: ../src/guestfs.pod:2881
41010 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
41014 #: ../src/guestfs.pod:2883
41016 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
41017 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
41018 "they are not passed via the shell (instead, straight to exec). You probably "
41019 "want to use the C<sysroot_path()> function however."
41023 #: ../src/guestfs.pod:2889
41024 msgid "SUBMITTING YOUR NEW API ACTIONS"
41028 #: ../src/guestfs.pod:2891
41030 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
41031 "libguestfs> and CC to L<rjones@redhat.com>."
41035 #: ../src/guestfs.pod:2895
41036 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
41040 #: ../src/guestfs.pod:2897
41041 msgid "We support i18n (gettext anyhow) in the library."
41045 #: ../src/guestfs.pod:2899
41047 "However many messages come from the daemon, and we don't translate those at "
41048 "the moment. One reason is that the appliance generally has all locale files "
41049 "removed from it, because they take up a lot of space. So we'd have to readd "
41050 "some of those, as well as copying our PO files into the appliance."
41054 #: ../src/guestfs.pod:2905
41056 "Debugging messages are never translated, since they are intended for the "
41061 #: ../src/guestfs.pod:2908
41062 msgid "SOURCE CODE SUBDIRECTORIES"
41066 #: ../src/guestfs.pod:2912
41071 #: ../src/guestfs.pod:2914
41072 msgid "L<virt-alignment-scan(1)> command and documentation."
41076 #: ../src/guestfs.pod:2918
41077 msgid "The libguestfs appliance, build scripts and so on."
41081 #: ../src/guestfs.pod:2920
41082 msgid "C<capitests>"
41086 #: ../src/guestfs.pod:2922
41087 msgid "Automated tests of the C API."
41091 #: ../src/guestfs.pod:2924
41096 #: ../src/guestfs.pod:2926
41098 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
41103 #: ../src/guestfs.pod:2929
41108 #: ../src/guestfs.pod:2931
41110 "Safety and liveness tests of components that libguestfs depends upon (not of "
41111 "libguestfs itself). Mainly this is for qemu and the kernel."
41115 #: ../src/guestfs.pod:2934
41120 #: ../src/guestfs.pod:2936
41122 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
41123 "command and documentation."
41127 #: ../src/guestfs.pod:2939
41132 #: ../src/guestfs.pod:2941
41133 msgid "Outside contributions, experimental parts."
41137 #: ../src/guestfs.pod:2943
41142 #: ../src/guestfs.pod:2945
41144 "The daemon that runs inside the libguestfs appliance and carries out actions."
41148 #: ../src/guestfs.pod:2948
41153 #: ../src/guestfs.pod:2950
41154 msgid "L<virt-df(1)> command and documentation."
41158 #: ../src/guestfs.pod:2952
41163 #: ../src/guestfs.pod:2954
41164 msgid "L<virt-edit(1)> command and documentation."
41168 #: ../src/guestfs.pod:2956
41169 msgid "C<examples>"
41173 #: ../src/guestfs.pod:2958
41174 msgid "C API example code."
41178 #: ../src/guestfs.pod:2960
41183 #: ../src/guestfs.pod:2962
41185 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
41186 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
41187 "L<virt-tar-out(1)>."
41191 #: ../src/guestfs.pod:2966
41196 #: ../src/guestfs.pod:2968
41198 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
41202 #: ../src/guestfs.pod:2970
41203 msgid "C<generator>"
41207 #: ../src/guestfs.pod:2972
41209 "The crucially important generator, used to automatically generate large "
41210 "amounts of boilerplate C code for things like RPC and bindings."
41214 #: ../src/guestfs.pod:2975
41219 #: ../src/guestfs.pod:2977
41220 msgid "Files used by the test suite."
41224 #: ../src/guestfs.pod:2979
41225 msgid "Some \"phony\" guest images which we test against."
41229 #: ../src/guestfs.pod:2981
41230 msgid "C<inspector>"
41234 #: ../src/guestfs.pod:2983
41235 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
41239 #: ../src/guestfs.pod:2985
41244 #: ../src/guestfs.pod:2987
41245 msgid "Logo used on the website. The fish is called Arthur by the way."
41249 #: ../src/guestfs.pod:2989
41254 #: ../src/guestfs.pod:2991
41255 msgid "M4 macros used by autoconf."
41259 #: ../src/guestfs.pod:2993
41264 #: ../src/guestfs.pod:2995
41265 msgid "Translations of simple gettext strings."
41269 #: ../src/guestfs.pod:2997
41274 #: ../src/guestfs.pod:2999
41276 "The build infrastructure and PO files for translations of manpages and POD "
41277 "files. Eventually this will be combined with the C<po> directory, but that "
41278 "is rather complicated."
41282 #: ../src/guestfs.pod:3003
41283 msgid "C<regressions>"
41287 #: ../src/guestfs.pod:3005
41288 msgid "Regression tests."
41292 #: ../src/guestfs.pod:3007
41297 #: ../src/guestfs.pod:3009
41298 msgid "L<virt-rescue(1)> command and documentation."
41302 #: ../src/guestfs.pod:3011
41307 #: ../src/guestfs.pod:3013
41308 msgid "L<virt-resize(1)> command and documentation."
41312 #: ../src/guestfs.pod:3015
41313 msgid "C<sparsify>"
41317 #: ../src/guestfs.pod:3017
41318 msgid "L<virt-sparsify(1)> command and documentation."
41322 #: ../src/guestfs.pod:3019
41327 #: ../src/guestfs.pod:3021
41328 msgid "Source code to the C library."
41332 #: ../src/guestfs.pod:3023
41337 #: ../src/guestfs.pod:3025
41339 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
41343 #: ../src/guestfs.pod:3027
41344 msgid "C<test-tool>"
41348 #: ../src/guestfs.pod:3029
41350 "Test tool for end users to test if their qemu/kernel combination will work "
41355 #: ../src/guestfs.pod:3032
41360 #: ../src/guestfs.pod:3034
41365 #: ../src/guestfs.pod:3036
41370 #: ../src/guestfs.pod:3038
41375 #: ../src/guestfs.pod:3040
41380 #: ../src/guestfs.pod:3042
41385 #: ../src/guestfs.pod:3044
41390 #: ../src/guestfs.pod:3046
41395 #: ../src/guestfs.pod:3048
41400 #: ../src/guestfs.pod:3050
41401 msgid "Language bindings."
41405 #: ../src/guestfs.pod:3054
41406 msgid "MAKING A STABLE RELEASE"
41410 #: ../src/guestfs.pod:3056
41412 "When we make a stable release, there are several steps documented here. See "
41413 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
41418 #: ../src/guestfs.pod:3064
41420 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
41424 #: ../src/guestfs.pod:3069
41425 msgid "Finalize RELEASE-NOTES."
41429 #: ../src/guestfs.pod:3073
41430 msgid "Update ROADMAP."
41434 #: ../src/guestfs.pod:3077
41435 msgid "Run C<src/api-support/update-from-tarballs.sh>."
41439 #: ../src/guestfs.pod:3081
41440 msgid "Push and pull from Transifex."
41444 #: ../src/guestfs.pod:3085
41452 #: ../src/guestfs.pod:3087
41453 msgid "to push the latest POT files to Transifex. Then run:"
41457 #: ../src/guestfs.pod:3089
41465 #: ../src/guestfs.pod:3091
41466 msgid "which is a wrapper to pull the latest translated C<*.po> files."
41470 #: ../src/guestfs.pod:3095
41472 "Create new stable and development directories under L<http://libguestfs.org/"
41477 #: ../src/guestfs.pod:3100
41478 msgid "Create the branch in git:"
41482 #: ../src/guestfs.pod:3102
41485 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
41486 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
41487 " git branch stable-1.XX\n"
41488 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
41493 #: ../src/guestfs.pod:3109
41498 #: ../src/guestfs.pod:3111
41499 msgid "PROTOCOL LIMITS"
41503 #: ../src/guestfs.pod:3113
41505 "Internally libguestfs uses a message-based protocol to pass API calls and "
41506 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
41507 "plenty more detail about this). The maximum message size used by the "
41508 "protocol is slightly less than 4 MB. For some API calls you may need to be "
41509 "aware of this limit. The API calls which may be affected are individually "
41510 "documented, with a link back to this section of the documentation."
41514 #: ../src/guestfs.pod:3121
41516 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
41517 "a simple string. Because this string is at some point internally encoded as "
41518 "a message, the maximum size that it can return is slightly under 4 MB. If "
41519 "the requested file is larger than this then you will get an error."
41523 #: ../src/guestfs.pod:3127
41525 "In order to transfer large files into and out of the guest filesystem, you "
41526 "need to use particular calls that support this. The sections L</UPLOADING> "
41527 "and L</DOWNLOADING> document how to do this."
41531 #: ../src/guestfs.pod:3131
41533 "You might also consider mounting the disk image using our FUSE filesystem "
41534 "support (L<guestmount(1)>)."
41538 #: ../src/guestfs.pod:3134
41539 msgid "MAXIMUM NUMBER OF DISKS"
41543 #: ../src/guestfs.pod:3136
41544 msgid "When using virtio disks (the default) the current limit is B<25> disks."
41548 #: ../src/guestfs.pod:3139
41550 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
41551 "slots. However febootstrap only understands disks with names C</dev/vda> "
41552 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
41557 #: ../src/guestfs.pod:3144
41559 "We are working to substantially raise this limit in future versions but it "
41560 "requires complex changes to qemu."
41564 #: ../src/guestfs.pod:3147
41566 "In future versions of libguestfs it should also be possible to \"hot plug\" "
41567 "disks (add and remove disks after calling L</guestfs_launch>). This also "
41568 "requires changes to qemu."
41572 #: ../src/guestfs.pod:3151
41573 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
41577 #: ../src/guestfs.pod:3153
41578 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
41582 #: ../src/guestfs.pod:3155
41584 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
41585 "vda>, and C</dev/vda1> through C</dev/vda15>)."
41589 #: ../src/guestfs.pod:3158
41591 "If you attach a disk with more than 15 partitions, the extra partitions are "
41592 "ignored by libguestfs."
41596 #: ../src/guestfs.pod:3161
41597 msgid "MAXIMUM SIZE OF A DISK"
41601 #: ../src/guestfs.pod:3163
41602 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
41606 #: ../src/guestfs.pod:3165
41608 "We have tested block devices up to 1 exabyte (2**60 or "
41609 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
41614 #: ../src/guestfs.pod:3169
41616 "Although libguestfs probably does not impose any limit, the underlying host "
41617 "storage will. If you store disk images on a host ext4 filesystem, then the "
41618 "maximum size will be limited by the maximum ext4 file size (currently 16 "
41619 "TB). If you store disk images as host logical volumes then you are limited "
41620 "by the maximum size of an LV."
41624 #: ../src/guestfs.pod:3175
41626 "For the hugest disk image files, we recommend using XFS on the host for "
41631 #: ../src/guestfs.pod:3178
41632 msgid "MAXIMUM SIZE OF A PARTITION"
41636 #: ../src/guestfs.pod:3180
41638 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
41639 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
41640 "address a partition located beyond 2 TB on the disk."
41644 #: ../src/guestfs.pod:3184
41646 "It is recommended that you use GPT partitions on disks which are larger than "
41647 "this size. GPT uses 64 bit sector numbers and so can address partitions "
41648 "which are theoretically larger than the largest disk we could support."
41652 #: ../src/guestfs.pod:3189
41653 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
41657 #: ../src/guestfs.pod:3191
41659 "This depends on the filesystem type. libguestfs itself does not impose any "
41660 "known limit. Consult Wikipedia or the filesystem documentation to find out "
41661 "what these limits are."
41665 #: ../src/guestfs.pod:3195
41666 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
41670 #: ../src/guestfs.pod:3197
41672 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
41673 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
41674 "uploads and downloads."
41678 #: ../src/guestfs.pod:3201
41679 msgid "INSPECTION LIMITS"
41683 #: ../src/guestfs.pod:3203
41685 "The inspection code has several arbitrary limits on things like the size of "
41686 "Windows Registry hive it will read, and the length of product name. These "
41687 "are intended to stop a malicious guest from consuming arbitrary amounts of "
41688 "memory and disk space on the host, and should not be reached in practice. "
41689 "See the source code for more information."
41693 #: ../src/guestfs.pod:3229
41695 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
41696 "effect as calling C<guestfs_set_verbose (g, 1)>."
41700 #: ../src/guestfs.pod:3241
41702 "Set the path that libguestfs uses to search for a supermin appliance. See "
41703 "the discussion of paths in section L</PATH> above."
41707 #: ../src/guestfs.pod:3250
41708 msgid "See also L</QEMU WRAPPERS> above."
41712 #: ../src/guestfs.pod:3254
41714 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
41715 "effect as calling C<guestfs_set_trace (g, 1)>."
41719 #: ../src/guestfs.pod:3272
41721 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
41722 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
41723 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
41724 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
41725 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
41726 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
41727 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar"
41728 "(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<guestfs-"
41729 "testing(1)>, L<qemu(1)>, L<febootstrap(1)>, L<febootstrap-supermin-helper(8)"
41730 ">, L<hivex(3)>, L<stap(1)>, L<http://libguestfs.org/>."
41734 #: ../src/guestfs.pod:3309
41736 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
41737 "(8)>, L<disktype(1)>."
41741 #: ../src/guestfs.pod:3316 ../tools/virt-make-fs.pl:571
41742 #: ../tools/virt-win-reg.pl:772
41747 #: ../src/guestfs.pod:3318
41748 msgid "To get a list of bugs against libguestfs use this link:"
41752 #: ../src/guestfs.pod:3320
41754 "L<https://bugzilla.redhat.com/buglist.cgi?"
41755 "component=libguestfs&product=Virtualization+Tools>"
41759 #: ../src/guestfs.pod:3322
41760 msgid "To report a new bug against libguestfs use this link:"
41764 #: ../src/guestfs.pod:3324
41766 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
41767 "component=libguestfs&product=Virtualization+Tools>"
41771 #: ../src/guestfs.pod:3326
41772 msgid "When reporting a bug, please check:"
41776 #: ../src/guestfs.pod:3332
41777 msgid "That the bug hasn't been reported already."
41781 #: ../src/guestfs.pod:3336
41782 msgid "That you are testing a recent version."
41786 #: ../src/guestfs.pod:3340
41787 msgid "Describe the bug accurately, and give a way to reproduce it."
41791 #: ../src/guestfs.pod:3344
41793 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
41798 #: ../test-tool/libguestfs-test-tool.pod:5
41799 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
41803 #: ../test-tool/libguestfs-test-tool.pod:9
41806 " libguestfs-test-tool [--options]\n"
41811 #: ../test-tool/libguestfs-test-tool.pod:13
41813 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
41814 "to check basic libguestfs functionality is working. This is needed because "
41815 "libguestfs occasionally breaks for reasons beyond our control: usually "
41816 "because of changes in the underlying qemu or kernel packages, or the host "
41821 #: ../test-tool/libguestfs-test-tool.pod:19
41822 msgid "If you suspect a problem in libguestfs, then just run:"
41826 #: ../test-tool/libguestfs-test-tool.pod:21
41829 " libguestfs-test-tool\n"
41834 #: ../test-tool/libguestfs-test-tool.pod:23
41835 msgid "It will print lots of diagnostic messages."
41839 #: ../test-tool/libguestfs-test-tool.pod:25
41840 msgid "If it runs to completion successfully, you will see this near the end:"
41844 #: ../test-tool/libguestfs-test-tool.pod:27
41847 " ===== TEST FINISHED OK =====\n"
41852 #: ../test-tool/libguestfs-test-tool.pod:29
41853 msgid "and the test tool will exit with code 0."
41857 #: ../test-tool/libguestfs-test-tool.pod:31
41859 "If it fails (and/or exits with non-zero error code), please paste the "
41860 "I<complete, unedited> output of the test tool into a bug report. More "
41861 "information about reporting bugs can be found on the L<http://libguestfs.org/"
41866 #: ../test-tool/libguestfs-test-tool.pod:42
41867 msgid "Display short usage information and exit."
41871 #: ../test-tool/libguestfs-test-tool.pod:44
41872 msgid "B<--qemu qemu_binary>"
41876 #: ../test-tool/libguestfs-test-tool.pod:46
41878 "If you have downloaded another qemu binary, point this option at the full "
41879 "path of the binary to try it."
41883 #: ../test-tool/libguestfs-test-tool.pod:49
41884 msgid "B<--qemudir qemu_source_dir>"
41888 #: ../test-tool/libguestfs-test-tool.pod:51
41890 "If you have compiled qemu from source, point this option at the source "
41891 "directory to try it."
41895 #: ../test-tool/libguestfs-test-tool.pod:54
41900 #: ../test-tool/libguestfs-test-tool.pod:56
41901 msgid "B<--timeout N>"
41905 #: ../test-tool/libguestfs-test-tool.pod:58
41907 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
41908 "minutes) which does not usually need to be adjusted."
41912 #: ../test-tool/libguestfs-test-tool.pod:63
41913 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
41917 #: ../test-tool/libguestfs-test-tool.pod:65
41919 "If you have compiled another version of qemu from source and would like to "
41920 "try that, then you can use the I<--qemudir> option to point to the qemu "
41921 "source directory."
41925 #: ../test-tool/libguestfs-test-tool.pod:69
41927 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
41928 "option to point to the binary."
41932 #: ../test-tool/libguestfs-test-tool.pod:72
41934 "Note when using these options, you can ignore the business of qemu wrapper "
41935 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
41936 "wrapper script for you if one is needed."
41940 #: ../test-tool/libguestfs-test-tool.pod:76
41941 msgid "TRYING OUT A DIFFERENT KERNEL"
41945 #: ../test-tool/libguestfs-test-tool.pod:78
41947 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
41948 "libguestfs tries. You do this by setting the environment variables "
41949 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
41953 #: ../test-tool/libguestfs-test-tool.pod:82
41955 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
41960 #: ../test-tool/libguestfs-test-tool.pod:85
41961 msgid "SELF-DIAGNOSIS"
41965 #: ../test-tool/libguestfs-test-tool.pod:87
41967 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
41968 "produced by libguestfs-test-tool and/or possible errors."
41972 #: ../test-tool/libguestfs-test-tool.pod:92
41974 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
41975 "I<1> if there was an error."
41979 #: ../test-tool/libguestfs-test-tool.pod:97
41981 "For the full list of environment variables which may affect libguestfs, "
41982 "please see the L<guestfs(3)> manual page."
41986 #: ../test-tool/libguestfs-test-tool.pod:102
41987 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
41991 #: ../tools/virt-list-filesystems.pl:32
41993 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
41997 #: ../tools/virt-list-filesystems.pl:36
42000 " virt-list-filesystems [--options] domname\n"
42005 #: ../tools/virt-list-filesystems.pl:38
42008 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
42013 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
42015 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
42020 #: ../tools/virt-list-filesystems.pl:45
42022 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
42023 "are contained in a virtual machine or disk image."
42027 #: ../tools/virt-list-filesystems.pl:49
42029 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
42030 "functionality. For more complex cases you should look at the L<guestfish(1)"
42035 #: ../tools/virt-list-filesystems.pl:112
42037 "With this option, C<virt-list-filesystems> displays the type of each "
42038 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
42042 #: ../tools/virt-list-filesystems.pl:119
42047 #: ../tools/virt-list-filesystems.pl:123
42049 "Normally we only show mountable filesystems. If this option is given then "
42050 "swap devices are shown too."
42054 #: ../tools/virt-list-filesystems.pl:197
42056 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
42057 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
42058 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42062 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
42063 msgid "Copyright (C) 2009 Red Hat Inc."
42067 #: ../tools/virt-list-partitions.pl:32
42069 "virt-list-partitions - List partitions in a virtual machine or disk image"
42073 #: ../tools/virt-list-partitions.pl:36
42076 " virt-list-partitions [--options] domname\n"
42081 #: ../tools/virt-list-partitions.pl:38
42084 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
42089 #: ../tools/virt-list-partitions.pl:45
42091 "C<virt-list-partitions> is a command line tool to list the partitions that "
42092 "are contained in a virtual machine or disk image. It is mainly useful as a "
42093 "first step to using L<virt-resize(1)>."
42097 #: ../tools/virt-list-partitions.pl:50
42099 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
42100 "functionality. For more complex cases you should look at the L<guestfish(1)"
42105 #: ../tools/virt-list-partitions.pl:113
42106 msgid "Show sizes in human-readable form (eg. \"1G\")."
42110 #: ../tools/virt-list-partitions.pl:123
42112 "With this option, C<virt-list-partitions> displays the type and size of each "
42113 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
42117 #: ../tools/virt-list-partitions.pl:130
42122 #: ../tools/virt-list-partitions.pl:132
42127 #: ../tools/virt-list-partitions.pl:134
42129 "Display the total size of each block device (as a separate row or rows)."
42133 #: ../tools/virt-list-partitions.pl:267
42135 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
42136 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
42137 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42141 #: ../tools/virt-list-partitions.pl:283
42142 msgid "Copyright (C) 2009-2010 Red Hat Inc."
42146 #: ../tools/virt-make-fs.pl:37
42147 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
42151 #: ../tools/virt-make-fs.pl:41
42154 " virt-make-fs [--options] input.tar output.img\n"
42159 #: ../tools/virt-make-fs.pl:43
42162 " virt-make-fs [--options] input.tar.gz output.img\n"
42167 #: ../tools/virt-make-fs.pl:45
42170 " virt-make-fs [--options] directory output.img\n"
42175 #: ../tools/virt-make-fs.pl:49
42177 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
42178 "archive or some files in a directory. It is similar to tools like L<mkisofs"
42179 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
42180 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
42181 "you want to attach these filesystems to existing virtual machines (eg. to "
42182 "import large amounts of read-only data to a VM)."
42186 #: ../tools/virt-make-fs.pl:57
42187 msgid "Basic usage is:"
42191 #: ../tools/virt-make-fs.pl:59
42194 " virt-make-fs input output.img\n"
42199 #: ../tools/virt-make-fs.pl:61
42201 "where C<input> is either a directory containing files that you want to add, "
42202 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
42203 "C<output.img> is a disk image. The input type is detected automatically. "
42204 "The output disk image defaults to a raw ext2 sparse image unless you specify "
42205 "extra flags (see L</OPTIONS> below)."
42209 #: ../tools/virt-make-fs.pl:67
42210 msgid "FILESYSTEM TYPE"
42214 #: ../tools/virt-make-fs.pl:69
42216 "The default filesystem type is C<ext2>. Just about any filesystem type that "
42217 "libguestfs supports can be used (but I<not> read-only formats like "
42218 "ISO9660). Here are some of the more common choices:"
42222 #: ../tools/virt-make-fs.pl:75
42227 #: ../tools/virt-make-fs.pl:77
42229 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
42230 "you are not going to use the filesystem in a way that requires the journal, "
42231 "then this is just wasted overhead."
42235 #: ../tools/virt-make-fs.pl:81
42236 msgid "I<ntfs> or I<vfat>"
42240 #: ../tools/virt-make-fs.pl:83
42241 msgid "Useful if exporting data to a Windows guest."
42245 #: ../tools/virt-make-fs.pl:85
42247 "I<Note for vfat>: The tar archive or local directory must only contain files "
42248 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
42249 "program running within libguestfs is unable to change the ownership of non-"
42250 "root files, since vfat itself does not support this."
42254 #: ../tools/virt-make-fs.pl:90
42259 #: ../tools/virt-make-fs.pl:92
42261 "Lower overhead than C<ext2>, but certain limitations on filename length and "
42262 "total filesystem size."
42266 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116
42267 #: ../tools/virt-make-fs.pl:149
42272 #: ../tools/virt-make-fs.pl:99
42275 " virt-make-fs --type=minix input minixfs.img\n"
42280 #: ../tools/virt-make-fs.pl:101
42281 msgid "TO PARTITION OR NOT TO PARTITION"
42285 #: ../tools/virt-make-fs.pl:103
42286 msgid "Optionally virt-make-fs can add a partition table to the output disk."
42290 #: ../tools/virt-make-fs.pl:105
42292 "Adding a partition can make the disk image more compatible with certain "
42293 "virtualized operating systems which don't expect to see a filesystem "
42294 "directly located on a block device (Linux doesn't care and will happily "
42295 "handle both types)."
42299 #: ../tools/virt-make-fs.pl:110
42301 "On the other hand, if you have a partition table then the output image is no "
42302 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
42303 "directly on a partitioned disk image. (However libguestfs tools such as "
42304 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
42308 #: ../tools/virt-make-fs.pl:118
42309 msgid "Add an MBR partition:"
42313 #: ../tools/virt-make-fs.pl:120
42316 " virt-make-fs --partition -- input disk.img\n"
42321 #: ../tools/virt-make-fs.pl:122
42323 "If the output disk image could be terabyte-sized or larger, it's better to "
42324 "use an EFI/GPT-compatible partition table:"
42328 #: ../tools/virt-make-fs.pl:125
42331 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
42336 #: ../tools/virt-make-fs.pl:127
42337 msgid "EXTRA SPACE"
42341 #: ../tools/virt-make-fs.pl:129
42343 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
42344 "the files that it contains, but might have extra space. Depending on how "
42345 "you are going to use the output, you might think this extra space is wasted "
42346 "and want to minimize it, or you might want to leave space so that more files "
42347 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
42348 "but you can use the I<--size> flag to leave space in the filesystem if you "
42353 #: ../tools/virt-make-fs.pl:137
42355 "An alternative way to leave extra space but not make the output image any "
42356 "bigger is to use an alternative disk image format (instead of the default "
42357 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
42358 "image format (check your hypervisor supports this before using it). This "
42359 "allows you to choose a large I<--size> but the extra space won't actually be "
42360 "allocated in the image until you try to store something in it."
42364 #: ../tools/virt-make-fs.pl:145
42366 "Don't forget that you can also use local commands including L<resize2fs(8)> "
42367 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
42368 "to build another image from scratch."
42372 #: ../tools/virt-make-fs.pl:151
42375 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
42380 #: ../tools/virt-make-fs.pl:179
42381 msgid "Enable debugging information."
42385 #: ../tools/virt-make-fs.pl:185
42386 msgid "B<--size=E<lt>NE<gt>>"
42390 #: ../tools/virt-make-fs.pl:187
42391 msgid "B<--size=+E<lt>NE<gt>>"
42395 #: ../tools/virt-make-fs.pl:189
42396 msgid "B<-s E<lt>NE<gt>>"
42400 #: ../tools/virt-make-fs.pl:191
42401 msgid "B<-s +E<lt>NE<gt>>"
42405 #: ../tools/virt-make-fs.pl:193
42407 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
42411 #: ../tools/virt-make-fs.pl:196
42413 "If this option is I<not> given, then the output image will be just large "
42414 "enough to contain all the files, with not much wasted space."
42418 #: ../tools/virt-make-fs.pl:199
42420 "To choose a fixed size output disk, specify an absolute number followed by b/"
42421 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
42422 "Petabytes or Exabytes. This must be large enough to contain all the input "
42423 "files, else you will get an error."
42427 #: ../tools/virt-make-fs.pl:204
42429 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
42430 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
42431 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
42432 "the input files, and (approximately) an extra 200 MB free space."
42436 #: ../tools/virt-make-fs.pl:210
42438 "Note that virt-make-fs estimates free space, and therefore will not produce "
42439 "filesystems containing precisely the free space requested. (It is much more "
42440 "expensive and time-consuming to produce a filesystem which has precisely the "
42441 "desired free space)."
42445 #: ../tools/virt-make-fs.pl:219
42446 msgid "B<--format=E<lt>fmtE<gt>>"
42450 #: ../tools/virt-make-fs.pl:221
42451 msgid "B<-F E<lt>fmtE<gt>>"
42455 #: ../tools/virt-make-fs.pl:223
42456 msgid "Choose the output disk image format."
42460 #: ../tools/virt-make-fs.pl:225
42461 msgid "The default is C<raw> (raw sparse disk image)."
42465 #: ../tools/virt-make-fs.pl:227
42467 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
42468 "that would really make sense here is C<qcow2>."
42472 #: ../tools/virt-make-fs.pl:234
42473 msgid "B<--type=E<lt>fsE<gt>>"
42477 #: ../tools/virt-make-fs.pl:236
42478 msgid "B<-t E<lt>fsE<gt>>"
42482 #: ../tools/virt-make-fs.pl:238
42483 msgid "Choose the output filesystem type."
42487 #: ../tools/virt-make-fs.pl:240
42488 msgid "The default is C<ext2>."
42492 #: ../tools/virt-make-fs.pl:242
42494 "Any filesystem which is supported read-write by libguestfs can be used here."
42498 #: ../tools/virt-make-fs.pl:249
42499 msgid "B<--partition>"
42503 #: ../tools/virt-make-fs.pl:251
42504 msgid "B<--partition=E<lt>parttypeE<gt>>"
42508 #: ../tools/virt-make-fs.pl:253
42510 "If specified, this flag adds an MBR partition table to the output disk image."
42514 #: ../tools/virt-make-fs.pl:256
42516 "You can change the partition table type, eg. I<--partition=gpt> for large "
42521 #: ../tools/virt-make-fs.pl:259
42523 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
42524 "might consider the next parameter to be the partition type. For example:"
42528 #: ../tools/virt-make-fs.pl:263
42531 " virt-make-fs --partition input.tar output.img\n"
42536 #: ../tools/virt-make-fs.pl:265
42538 "would cause virt-make-fs to think you wanted to use a partition type of "
42539 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
42540 "dash) between options and the input and output arguments:"
42544 #: ../tools/virt-make-fs.pl:269
42547 " virt-make-fs --partition -- input.tar output.img\n"
42552 #: ../tools/virt-make-fs.pl:271
42553 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
42557 #: ../tools/virt-make-fs.pl:559
42559 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
42560 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
42561 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
42565 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
42567 "When reporting bugs, please enable debugging and capture the I<complete> "
42572 #: ../tools/virt-make-fs.pl:576
42575 " export LIBGUESTFS_DEBUG=1\n"
42576 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
42581 #: ../tools/virt-make-fs.pl:579
42583 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
42588 #: ../tools/virt-tar.pl:33
42589 msgid "virt-tar - Extract or upload files to a virtual machine"
42593 #: ../tools/virt-tar.pl:37
42596 " virt-tar [--options] -x domname directory tarball\n"
42601 #: ../tools/virt-tar.pl:39
42604 " virt-tar [--options] -u domname tarball directory\n"
42609 #: ../tools/virt-tar.pl:41
42612 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
42617 #: ../tools/virt-tar.pl:43
42620 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
42625 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
42630 #: ../tools/virt-tar.pl:47
42632 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
42633 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
42637 #: ../tools/virt-tar.pl:52
42638 msgid "Download C</home> from the VM into a local tarball:"
42642 #: ../tools/virt-tar.pl:54
42645 " virt-tar -x domname /home home.tar\n"
42650 #: ../tools/virt-tar.pl:56
42653 " virt-tar -zx domname /home home.tar.gz\n"
42658 #: ../tools/virt-tar.pl:58
42659 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
42663 #: ../tools/virt-tar.pl:60
42666 " virt-tar -u domname uploadstuff.tar /tmp\n"
42671 #: ../tools/virt-tar.pl:62
42674 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
42679 #: ../tools/virt-tar.pl:66
42681 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
42682 "virtual machines. If you do this, you risk disk corruption in the VM. "
42683 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
42687 #: ../tools/virt-tar.pl:71
42689 "You can use I<-x> (extract) on live virtual machines, but you might get "
42690 "inconsistent results or errors if there is filesystem activity inside the "
42691 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
42692 "work, but the only way to guarantee consistent results is if the virtual "
42693 "machine is shut down."
42697 #: ../tools/virt-tar.pl:79
42699 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
42700 "parts of a guest filesystem. There are many possibilities: making backups, "
42701 "uploading data files, snooping on guest activity, fixing or customizing "
42706 #: ../tools/virt-tar.pl:84
42708 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
42709 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
42710 "should look at the L<guestfish(1)> tool."
42714 #: ../tools/virt-tar.pl:88
42716 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
42717 "its contents (recursively) from the virtual machine into a local tarball. "
42718 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
42719 "virtual machine. You cannot use these two options together."
42723 #: ../tools/virt-tar.pl:94
42725 "In addition, you may need to use the I<-z> (gZip) option to enable "
42726 "compression. When uploading, you have to specify I<-z> if the upload file "
42727 "is compressed because virt-tar won't detect this on its own."
42731 #: ../tools/virt-tar.pl:98
42733 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
42734 "example it cannot do PKZip files or bzip2 compression. If you want that "
42735 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
42736 "the L<libguestfs(3)> API)."
42740 #: ../tools/virt-tar.pl:160
42741 msgid "B<--extract>"
42745 #: ../tools/virt-tar.pl:162
42746 msgid "B<--download>"
42750 #: ../tools/virt-tar.pl:164
42755 #: ../tools/virt-tar.pl:166
42756 msgid "B<--upload>"
42760 #: ../tools/virt-tar.pl:168
42762 "Use I<-x> to extract (download) a directory from a virtual machine to a "
42767 #: ../tools/virt-tar.pl:171
42769 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
42770 "Please read the L</WARNING> section above before using this option."
42774 #: ../tools/virt-tar.pl:175
42775 msgid "You must specify exactly one of these options."
42779 #: ../tools/virt-tar.pl:181
42784 #: ../tools/virt-tar.pl:183
42789 #: ../tools/virt-tar.pl:185
42790 msgid "Specify that the input or output tarball is gzip-compressed."
42794 #: ../tools/virt-tar.pl:298
42796 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
42797 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
42798 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
42803 #: ../tools/virt-win-reg.pl:37
42805 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
42809 #: ../tools/virt-win-reg.pl:41
42812 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
42817 #: ../tools/virt-win-reg.pl:43
42820 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
42825 #: ../tools/virt-win-reg.pl:45
42828 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
42833 #: ../tools/virt-win-reg.pl:47
42836 " virt-win-reg --merge domname [input.reg ...]\n"
42841 #: ../tools/virt-win-reg.pl:49
42844 " virt-win-reg [--options] disk.img ... # instead of domname\n"
42849 #: ../tools/virt-win-reg.pl:53
42851 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
42852 "virtual machines. If you do this, you I<will> get irreversible disk "
42853 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
42854 "but doesn't catch all cases."
42858 #: ../tools/virt-win-reg.pl:58
42860 "Modifying the Windows Registry is an inherently risky operation. The format "
42861 "is deliberately obscure and undocumented, and Registry changes can leave the "
42862 "system unbootable. Therefore when using the I<--merge> option, make sure "
42863 "you have a reliable backup first."
42867 #: ../tools/virt-win-reg.pl:65
42869 "This program can export and merge Windows Registry entries from a Windows "
42874 #: ../tools/virt-win-reg.pl:68
42876 "The first parameter is the libvirt guest name or the raw disk image of a "
42881 #: ../tools/virt-win-reg.pl:71
42883 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
42884 "exported (recursively). For example:"
42888 #: ../tools/virt-win-reg.pl:74
42891 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
42896 #: ../tools/virt-win-reg.pl:76
42898 "You can also display single values from within registry keys, for example:"
42902 #: ../tools/virt-win-reg.pl:79
42905 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
42906 " $ virt-win-reg Windows7 $cvkey ProductName\n"
42907 " Windows 7 Enterprise\n"
42912 #: ../tools/virt-win-reg.pl:83
42914 "With I<--merge>, you can merge a textual regedit file into the Windows "
42919 #: ../tools/virt-win-reg.pl:86
42922 " $ virt-win-reg --merge Windows7 changes.reg\n"
42927 #: ../tools/virt-win-reg.pl:90
42929 "This program is only meant for simple access to the registry. If you want "
42930 "to do complicated things with the registry, we suggest you download the "
42931 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
42932 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
42933 "L<hivexregedit(1)>."
42937 #: ../tools/virt-win-reg.pl:159
42942 #: ../tools/virt-win-reg.pl:161
42944 "In merge mode, this merges a textual regedit file into the Windows Registry "
42945 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
42946 "displays or exports Registry entries instead."
42950 #: ../tools/virt-win-reg.pl:165
42952 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
42953 "result in disk corruption. However exporting (without this flag) is always "
42958 #: ../tools/virt-win-reg.pl:173
42959 msgid "B<--encoding> UTF-16LE|ASCII"
42963 #: ../tools/virt-win-reg.pl:175
42965 "When merging (only), you may need to specify the encoding for strings to be "
42966 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
42967 "(3)/ENCODING STRINGS>."
42971 #: ../tools/virt-win-reg.pl:179
42973 "The default is to use UTF-16LE, which should work with recent versions of "
42978 #: ../tools/virt-win-reg.pl:186
42979 msgid "B<--unsafe-printable-strings>"
42983 #: ../tools/virt-win-reg.pl:188
42985 "When exporting (only), assume strings are UTF-16LE and print them as strings "
42986 "instead of hex sequences. Remove the final zero codepoint from strings if "
42991 #: ../tools/virt-win-reg.pl:192
42993 "This is unsafe and does not preserve the fidelity of strings in the original "
42994 "Registry for various reasons:"
42998 #: ../tools/virt-win-reg.pl:199
43000 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
43001 "other encodings will be corrupted by this transformation."
43005 #: ../tools/virt-win-reg.pl:204
43007 "Assumes that everything which has type 1 or 2 is really a string and that "
43008 "everything else is not a string, but the type field in real Registries is "
43013 #: ../tools/virt-win-reg.pl:210
43015 "Loses information about whether a zero codepoint followed the string in the "
43020 #: ../tools/virt-win-reg.pl:215
43022 "This all happens because the Registry itself contains no information about "
43023 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
43027 #: ../tools/virt-win-reg.pl:219
43029 "You should only use this option for quick hacking and debugging of the "
43030 "Registry contents, and I<never> use it if the output is going to be passed "
43031 "into another program or stored in another Registry."
43035 #: ../tools/virt-win-reg.pl:556
43036 msgid "SUPPORTED SYSTEMS"
43040 #: ../tools/virt-win-reg.pl:558
43042 "The program currently supports Windows NT-derived guests starting with "
43043 "Windows XP through to at least Windows 7."
43047 #: ../tools/virt-win-reg.pl:561
43048 msgid "The following Registry keys are supported:"
43052 #: ../tools/virt-win-reg.pl:565
43053 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
43057 #: ../tools/virt-win-reg.pl:567
43058 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
43062 #: ../tools/virt-win-reg.pl:569
43063 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
43067 #: ../tools/virt-win-reg.pl:571
43068 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
43072 #: ../tools/virt-win-reg.pl:573
43073 msgid "C<HKEY_USERS\\.DEFAULT>"
43077 #: ../tools/virt-win-reg.pl:575
43078 msgid "C<HKEY_USERS\\I<SID>>"
43082 #: ../tools/virt-win-reg.pl:577
43083 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
43087 #: ../tools/virt-win-reg.pl:579
43088 msgid "C<HKEY_USERS\\I<username>>"
43092 #: ../tools/virt-win-reg.pl:581
43094 "where I<username> is a local user name (this is a libguestfs extension)."
43098 #: ../tools/virt-win-reg.pl:585
43100 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
43105 #: ../tools/virt-win-reg.pl:588
43107 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
43108 "supported (there is no \"current user\")."
43112 #: ../tools/virt-win-reg.pl:591
43117 #: ../tools/virt-win-reg.pl:593
43119 "C<virt-win-reg> expects that regedit files have already been reencoded in "
43120 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
43121 "style line endings. Since Windows regedit files are often in UTF-16LE with "
43122 "Windows-style line endings, you may need to reencode the whole file before "
43123 "or after processing."
43127 #: ../tools/virt-win-reg.pl:599
43129 "To reencode a file from Windows format to Linux (before processing it with "
43130 "the I<--merge> option), you would do something like this:"
43134 #: ../tools/virt-win-reg.pl:602
43137 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
43142 #: ../tools/virt-win-reg.pl:604
43144 "To go in the opposite direction, after exporting and before sending the file "
43145 "to a Windows user, do something like this:"
43149 #: ../tools/virt-win-reg.pl:607
43152 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
43157 #: ../tools/virt-win-reg.pl:609
43158 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
43162 #: ../tools/virt-win-reg.pl:611
43164 "If you are unsure about the current encoding, use the L<file(1)> command. "
43165 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
43166 "style (CRLF) line endings, like this:"
43170 #: ../tools/virt-win-reg.pl:615
43173 " $ file software.reg\n"
43174 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
43175 " with CRLF line terminators\n"
43180 #: ../tools/virt-win-reg.pl:619
43181 msgid "This file would need conversion before you could I<--merge> it."
43185 #: ../tools/virt-win-reg.pl:621
43186 msgid "CurrentControlSet etc."
43190 #: ../tools/virt-win-reg.pl:623
43192 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
43193 "Registry at the level of the hive file, and therefore you cannot modify "
43198 #: ../tools/virt-win-reg.pl:627
43200 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
43201 "circumstances it might refer to another control set. The way to find out is "
43202 "to look at the C<HKLM\\SYSTEM\\Select> key:"
43206 #: ../tools/virt-win-reg.pl:631
43209 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
43210 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
43211 " \"Current\"=dword:00000001\n"
43212 " \"Default\"=dword:00000001\n"
43213 " \"Failed\"=dword:00000000\n"
43214 " \"LastKnownGood\"=dword:00000002\n"
43219 #: ../tools/virt-win-reg.pl:638
43220 msgid "\"Current\" is the one which Windows will choose when it boots."
43224 #: ../tools/virt-win-reg.pl:640
43226 "Similarly, other C<Current...> keys in the path may need to be replaced."
43230 #: ../tools/virt-win-reg.pl:643
43231 msgid "DELETING REGISTRY KEYS AND VALUES"
43235 #: ../tools/virt-win-reg.pl:645
43236 msgid "To delete a whole registry key, use the syntax:"
43240 #: ../tools/virt-win-reg.pl:647
43243 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
43248 #: ../tools/virt-win-reg.pl:649
43249 msgid "To delete a single value within a key, use the syntax:"
43253 #: ../tools/virt-win-reg.pl:651
43256 " [HKEY_LOCAL_MACHINE\\Foo]\n"
43262 #: ../tools/virt-win-reg.pl:654
43263 msgid "WINDOWS TIPS"
43267 #: ../tools/virt-win-reg.pl:656
43269 "Note that some of these tips modify the guest disk image. The guest I<must> "
43270 "be shut off, else you will get disk corruption."
43274 #: ../tools/virt-win-reg.pl:659
43275 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
43279 #: ../tools/virt-win-reg.pl:661
43281 "Prepare a DOS batch script, VBScript or executable. Upload this using "
43282 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
43283 "is uploaded into C<C:\\>:"
43287 #: ../tools/virt-win-reg.pl:665
43290 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
43295 #: ../tools/virt-win-reg.pl:667
43296 msgid "Prepare a regedit file containing the registry change:"
43300 #: ../tools/virt-win-reg.pl:669
43303 " cat > test.reg <<'EOF'\n"
43304 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
43305 " \"Test\"=\"c:\\\\test.bat\"\n"
43311 #: ../tools/virt-win-reg.pl:674
43313 "In this example we use the key C<RunOnce> which means that the script will "
43314 "run precisely once when the first user logs in. If you want it to run every "
43315 "time a user logs in, replace C<RunOnce> with C<Run>."
43319 #: ../tools/virt-win-reg.pl:678
43320 msgid "Now update the registry:"
43324 #: ../tools/virt-win-reg.pl:680
43327 " virt-win-reg --merge WindowsGuest test.reg\n"
43332 #: ../tools/virt-win-reg.pl:682
43333 msgid "INSTALLING A SERVICE"
43337 #: ../tools/virt-win-reg.pl:684
43339 "This section assumes you are familiar with Windows services, and you either "
43340 "have a program which handles the Windows Service Control Protocol directly "
43341 "or you want to run any program using a service wrapper like SrvAny or the "
43346 #: ../tools/virt-win-reg.pl:689
43348 "First upload the program and optionally the service wrapper. In this case "
43349 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
43353 #: ../tools/virt-win-reg.pl:693
43356 " guestfish -i -d WindowsGuest <<EOF\n"
43357 " upload rhsrvany.exe /rhsrvany.exe\n"
43358 " upload test.exe /test.exe\n"
43364 #: ../tools/virt-win-reg.pl:698
43366 "Prepare a regedit file containing the registry changes. In this example, "
43367 "the first registry change is needed for the service itself or the service "
43368 "wrapper (if used). The second registry change is only needed because I am "
43369 "using the RHSrvAny service wrapper."
43373 #: ../tools/virt-win-reg.pl:703
43376 " cat > service.reg <<'EOF'\n"
43377 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
43378 " \"Type\"=dword:00000010\n"
43379 " \"Start\"=dword:00000002\n"
43380 " \"ErrorControl\"=dword:00000001\n"
43381 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
43382 " \"DisplayName\"=\"RHSrvAny\"\n"
43383 " \"ObjectName\"=\"NetworkService\"\n"
43388 #: ../tools/virt-win-reg.pl:712
43391 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
43392 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
43393 " \"PWD\"=\"c:\\\\Temp\"\n"
43399 #: ../tools/virt-win-reg.pl:723
43401 "For use of C<ControlSet001> see the section above in this manual page. You "
43402 "may need to adjust this according to the control set that is in use by the "
43407 #: ../tools/virt-win-reg.pl:729
43409 "C<\"ObjectName\"> controls the privileges that the service will have. An "
43410 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
43411 "privileged account."
43415 #: ../tools/virt-win-reg.pl:735
43417 "For the meaning of the magic numbers, see this Microsoft KB article: "
43418 "L<http://support.microsoft.com/kb/103000>."
43422 #: ../tools/virt-win-reg.pl:740
43423 msgid "Update the registry:"
43427 #: ../tools/virt-win-reg.pl:742
43430 " virt-win-reg --merge WindowsGuest service.reg\n"
43435 #: ../tools/virt-win-reg.pl:746
43437 "Be careful when passing parameters containing C<\\> (backslash) in the "
43438 "shell. Usually you will have to use 'single quotes' or double backslashes "
43439 "(but not both) to protect them from the shell."
43443 #: ../tools/virt-win-reg.pl:750
43444 msgid "Paths and value names are case-insensitive."
43448 #: ../tools/virt-win-reg.pl:759
43450 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
43451 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
43452 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
43456 #: ../tools/virt-win-reg.pl:777
43459 " export LIBGUESTFS_DEBUG=1\n"
43460 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
43465 #: ../tools/virt-win-reg.pl:780
43467 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."