1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
5 # rjones <rjones@redhat.com>, 2011.
8 "Project-Id-Version: libguestfs\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2011-10-11 20:58+0200\n"
11 "PO-Revision-Date: 2011-07-17 20:50+0000\n"
12 "Last-Translator: rjones <rjones@redhat.com>\n"
13 "Language-Team: Japanese (http://www.transifex.net/projects/p/fedora/team/"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=1; plural=0\n"
22 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3
23 #: ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3
24 #: ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3
25 #: ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3
26 #: ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3
27 #: ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3
28 #: ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3
29 #: ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3
30 #: ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3
31 #: ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3
32 #: ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3
33 #: ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3
34 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
35 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
36 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
37 #: ../tools/virt-win-reg.pl:35
42 #: ../align/virt-alignment-scan.pod:5
43 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
47 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7
48 #: ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
49 #: ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
50 #: ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7
51 #: ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7
52 #: ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7
53 #: ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7
54 #: ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7
55 #: ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7
56 #: ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7
57 #: ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7
58 #: ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7
59 #: ../test-tool/libguestfs-test-tool.pod:7
60 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
61 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
62 #: ../tools/virt-win-reg.pl:39
67 #: ../align/virt-alignment-scan.pod:9
70 " virt-alignment-scan [--options] -d domname\n"
75 #: ../align/virt-alignment-scan.pod:11
78 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
83 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19
84 #: ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
85 #: ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
86 #: ../erlang/examples/guestfs-erlang.pod:16
87 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
88 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
89 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
90 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
91 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
92 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
93 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
94 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
95 #: ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23
96 #: ../test-tool/libguestfs-test-tool.pod:11
97 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
98 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
99 #: ../tools/virt-win-reg.pl:63
104 #: ../align/virt-alignment-scan.pod:15
106 "When older operating systems install themselves, the partitioning tools "
107 "place partitions at a sector misaligned with the underlying storage "
108 "(commonly the first partition starts on sector C<63>). Misaligned "
109 "partitions can result in an operating system issuing more I/O than should be "
114 #: ../align/virt-alignment-scan.pod:21
116 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
117 "machines and disk images and warns you if there are alignment problems."
121 #: ../align/virt-alignment-scan.pod:25
123 "Currently there is no virt tool for fixing alignment problems. You can only "
124 "reinstall the guest operating system. The following NetApp document "
125 "summarises the problem and possible solutions: L<http://media.netapp.com/"
126 "documents/tr-3747.pdf>"
130 #: ../align/virt-alignment-scan.pod:30
135 #: ../align/virt-alignment-scan.pod:32
136 msgid "To run this tool on a disk image directly, use the I<-a> option:"
140 #: ../align/virt-alignment-scan.pod:34
143 " $ virt-alignment-scan -a winxp.img\n"
144 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
149 #: ../align/virt-alignment-scan.pod:37
152 " $ virt-alignment-scan -a fedora16.img\n"
153 " /dev/sda1 1048576 1024K ok\n"
154 " /dev/sda2 2097152 2048K ok\n"
155 " /dev/sda3 526385152 2048K ok\n"
160 #: ../align/virt-alignment-scan.pod:42
162 "To run the tool on a guest known to libvirt, use the I<-d> option and "
163 "possibly the I<-c> option:"
167 #: ../align/virt-alignment-scan.pod:45
170 " # virt-alignment-scan -d RHEL5\n"
171 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
172 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
177 #: ../align/virt-alignment-scan.pod:49
180 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
181 " /dev/sda1 1048576 1024K ok\n"
182 " /dev/sda2 105906176 1024K ok\n"
183 " /dev/sdb1 65536 64K ok\n"
188 #: ../align/virt-alignment-scan.pod:54
190 "The output consists of 4 or more whitespace-separated columns. Only the "
191 "first 4 columns are signficant if you want to parse this from a program. "
196 #: ../align/virt-alignment-scan.pod:60
201 #: ../align/virt-alignment-scan.pod:62
203 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
204 "on the first block device)"
208 #: ../align/virt-alignment-scan.pod:65
213 #: ../align/virt-alignment-scan.pod:67
214 msgid "the start of the partition in bytes"
218 #: ../align/virt-alignment-scan.pod:69
223 #: ../align/virt-alignment-scan.pod:71
224 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
228 #: ../align/virt-alignment-scan.pod:73
233 #: ../align/virt-alignment-scan.pod:75
235 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
236 "can cause performance problems"
240 #: ../align/virt-alignment-scan.pod:78
245 #: ../align/virt-alignment-scan.pod:80
246 msgid "optional free-text explanation."
250 #: ../align/virt-alignment-scan.pod:84
252 "The exit code from the program changes depending on whether poorly aligned "
253 "partitions were found. See L</EXIT STATUS> below."
257 #: ../align/virt-alignment-scan.pod:87
258 msgid "If you just want the exit code with no output, use the I<-q> option."
262 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62
263 #: ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261
264 #: ../clone/virt-sysprep.pod:36 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
265 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
266 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
267 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83
268 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
269 #: ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99
270 #: ../test-tool/libguestfs-test-tool.pod:36
271 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
272 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
273 #: ../tools/virt-win-reg.pl:96
278 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66
279 #: ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265
280 #: ../clone/virt-sysprep.pod:40 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
281 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151
282 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
283 #: ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103
284 #: ../test-tool/libguestfs-test-tool.pod:40
285 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
286 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
287 #: ../tools/virt-win-reg.pl:104
292 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68
293 #: ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267
294 #: ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
295 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
296 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
297 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
298 #: ../tools/virt-win-reg.pl:106
299 msgid "Display brief help."
303 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70
304 #: ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269
305 #: ../clone/virt-sysprep.pod:44 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
306 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
311 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72
312 #: ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271
313 #: ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
314 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
315 msgid "B<--add> file"
319 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:48
320 msgid "Add I<file> which should be a disk image from a virtual machine."
324 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78
325 #: ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277
326 #: ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
327 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93
328 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
330 "The format of the disk image is auto-detected. To override this and force a "
331 "particular format use the I<--format=..> option."
335 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81
336 #: ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291
337 #: ../clone/virt-sysprep.pod:53 ../df/virt-df.pod:78
338 #: ../rescue/virt-rescue.pod:107
343 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83
344 #: ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293
345 #: ../clone/virt-sysprep.pod:55 ../df/virt-df.pod:80
346 #: ../rescue/virt-rescue.pod:109
347 msgid "B<--connect> URI"
351 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85
352 #: ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295
353 #: ../clone/virt-sysprep.pod:57 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
354 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
355 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
356 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
358 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
359 "to the default libvirt hypervisor."
363 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88
364 #: ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298
365 #: ../clone/virt-sysprep.pod:60 ../df/virt-df.pod:85
366 #: ../rescue/virt-rescue.pod:114
368 "If you specify guest block devices directly (I<-a>), then libvirt is not "
373 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91
374 #: ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307
375 #: ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
376 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
381 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93
382 #: ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309
383 #: ../clone/virt-sysprep.pod:65 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
384 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
385 msgid "B<--domain> guest"
389 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95
390 #: ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311
391 #: ../clone/virt-sysprep.pod:67 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
392 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
394 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
399 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105
400 #: ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328
401 #: ../clone/virt-sysprep.pod:89 ../df/virt-df.pod:101
402 #: ../fish/guestfish.pod:233 ../fuse/guestmount.pod:133
403 #: ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
404 msgid "B<--format=raw|qcow2|..>"
408 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107
409 #: ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330
410 #: ../clone/virt-sysprep.pod:91 ../df/virt-df.pod:103
411 #: ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235
412 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:101
413 #: ../rescue/virt-rescue.pod:126
418 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109
419 #: ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332
420 #: ../clone/virt-sysprep.pod:93 ../df/virt-df.pod:105
421 #: ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237
422 #: ../fuse/guestmount.pod:137 ../rescue/virt-rescue.pod:128
424 "The default for the I<-a> option is to auto-detect the format of the disk "
425 "image. Using this forces the disk format for I<-a> options which follow on "
426 "the command line. Using I<--format> with no argument switches back to auto-"
427 "detection for subsequent I<-a> options."
431 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114
432 #: ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337
433 #: ../clone/virt-sysprep.pod:98 ../df/virt-df.pod:110
434 #: ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242
435 #: ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336
436 #: ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2862
441 #: ../align/virt-alignment-scan.pod:134
444 " virt-alignment-scan --format=raw -a disk.img\n"
449 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118
450 #: ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341
451 #: ../clone/virt-sysprep.pod:102 ../df/virt-df.pod:114
452 #: ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246
453 #: ../rescue/virt-rescue.pod:137
454 msgid "forces raw format (no auto-detection) for C<disk.img>."
458 #: ../align/virt-alignment-scan.pod:138
461 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
466 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122
467 #: ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345
468 #: ../clone/virt-sysprep.pod:106 ../df/virt-df.pod:118
469 #: ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250
470 #: ../rescue/virt-rescue.pod:141
472 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
473 "detection for C<another.img>."
477 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125
478 #: ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348
479 #: ../clone/virt-sysprep.pod:109 ../df/virt-df.pod:121
480 #: ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
482 "If you have untrusted raw-format guest disk images, you should use this "
483 "option to specify the disk format. This avoids a possible security problem "
484 "with malicious guests (CVE-2010-3851)."
488 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:414
489 #: ../sparsify/virt-sparsify.pod:153
494 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:416
495 #: ../sparsify/virt-sparsify.pod:155
500 #: ../align/virt-alignment-scan.pod:151
502 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
507 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134
508 #: ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425
509 #: ../clone/virt-sysprep.pod:122 ../df/virt-df.pod:173
510 #: ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390
511 #: ../fuse/guestmount.pod:257 ../inspector/virt-inspector.pod:119
512 #: ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
517 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136
518 #: ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427
519 #: ../clone/virt-sysprep.pod:124 ../df/virt-df.pod:175
520 #: ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392
521 #: ../fuse/guestmount.pod:259 ../inspector/virt-inspector.pod:121
522 #: ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
527 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138
528 #: ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429
529 #: ../clone/virt-sysprep.pod:126 ../df/virt-df.pod:177
530 #: ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123
531 #: ../rescue/virt-rescue.pod:186 ../sparsify/virt-sparsify.pod:163
532 msgid "Enable verbose messages for debugging."
536 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140
537 #: ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431
538 #: ../clone/virt-sysprep.pod:128 ../df/virt-df.pod:179
539 #: ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397
540 #: ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pod:125
541 #: ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:484
542 #: ../sparsify/virt-sparsify.pod:165
547 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142
548 #: ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433
549 #: ../clone/virt-sysprep.pod:130 ../df/virt-df.pod:181
550 #: ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399
551 #: ../fuse/guestmount.pod:265 ../inspector/virt-inspector.pod:127
552 #: ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:486
553 #: ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69
554 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
555 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
560 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144
561 #: ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435
562 #: ../clone/virt-sysprep.pod:132 ../df/virt-df.pod:183
563 #: ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129
564 #: ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:488
565 #: ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71
566 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
567 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
568 msgid "Display version number and exit."
572 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146
573 #: ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437
574 #: ../clone/virt-sysprep.pod:134 ../df/virt-df.pod:185
575 #: ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412
576 #: ../fuse/guestmount.pod:278 ../inspector/virt-inspector.pod:131
577 #: ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171
578 #: ../tools/virt-tar.pl:158
583 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148
584 #: ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439
585 #: ../clone/virt-sysprep.pod:136 ../df/virt-df.pod:187
586 #: ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133
587 #: ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
588 msgid "Enable tracing of libguestfs API calls."
592 #: ../align/virt-alignment-scan.pod:172
593 msgid "RECOMMENDED ALIGNMENT"
597 #: ../align/virt-alignment-scan.pod:174
599 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
600 "first sector of the first partition at sector 63, with a 512 byte sector "
601 "size. This happens because of a historical accident. Drives have to report "
602 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
603 "completely meaningless on modern drives, but it happens that the geometry "
604 "reported always has 63 sectors per track. The operating system therefore "
605 "places the first partition at the start of the second \"track\", at sector "
610 #: ../align/virt-alignment-scan.pod:183
612 "When the guest OS is virtualized, the host operating system and hypervisor "
613 "may prefer accesses aligned to one of:"
617 #: ../align/virt-alignment-scan.pod:188
622 #: ../align/virt-alignment-scan.pod:190
624 "if the host OS uses local storage directly on hard drive partitions, and the "
625 "hard drive has 512 byte physical sectors."
629 #: ../align/virt-alignment-scan.pod:193
634 #: ../align/virt-alignment-scan.pod:195
636 "for local storage on new hard drives with 4Kbyte physical sectors; for file-"
637 "backed storage on filesystems with 4Kbyte block size; or for some types of "
638 "network-attached storage."
642 #: ../align/virt-alignment-scan.pod:199
647 #: ../align/virt-alignment-scan.pod:201
649 "for high-end network-attached storage. This is the optimal block size for "
650 "some NetApp hardware."
654 #: ../align/virt-alignment-scan.pod:204
659 #: ../align/virt-alignment-scan.pod:206
660 msgid "see L</1 MB PARTITION ALIGNMENT> below."
664 #: ../align/virt-alignment-scan.pod:210
666 "Partitions which are not aligned correctly to the underlying storage cause "
667 "extra I/O. For example:"
671 #: ../align/virt-alignment-scan.pod:213
675 " +--------------------------+------\n"
677 " | filesystem block |\n"
678 " ---+------------------+------+-------------------+-----+---\n"
679 " | host block | host block |\n"
681 " ---+-------------------------+-------------------------+---\n"
686 #: ../align/virt-alignment-scan.pod:222
688 "In this example, each time a 4K guest block is read, two blocks on the host "
689 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
690 "written, two host blocks must first be read, the old and new data combined, "
691 "and the two blocks written back (4x I/O)."
695 #: ../align/virt-alignment-scan.pod:227
696 msgid "LINUX HOST BLOCK AND I/O SIZE"
700 #: ../align/virt-alignment-scan.pod:229
702 "New versions of the Linux kernel expose the physical and logical block size, "
703 "and minimum and recommended I/O size."
707 #: ../align/virt-alignment-scan.pod:232
708 msgid "For a typical hard drive with 512 byte sectors:"
712 #: ../align/virt-alignment-scan.pod:234
715 " $ cat /sys/block/sda/queue/physical_block_size\n"
717 " $ cat /sys/block/sda/queue/logical_block_size\n"
719 " $ cat /sys/block/sda/queue/minimum_io_size\n"
721 " $ cat /sys/block/sda/queue/optimal_io_size\n"
727 #: ../align/virt-alignment-scan.pod:243
728 msgid "For a NetApp LUN:"
732 #: ../align/virt-alignment-scan.pod:245
735 " $ cat /sys/block/sdc/queue/logical_block_size\n"
737 " $ cat /sys/block/sdc/queue/physical_block_size\n"
739 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
741 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
747 #: ../align/virt-alignment-scan.pod:254
749 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
750 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
754 #: ../align/virt-alignment-scan.pod:258
756 "For detailed information about what these numbers mean, see L<http://docs."
757 "redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/"
758 "Storage_Administration_Guide/newstorage-iolimits.html>"
762 #: ../align/virt-alignment-scan.pod:261
764 "[Thanks to Mike Snitzer for providing NetApp data and additional "
769 #: ../align/virt-alignment-scan.pod:264
770 msgid "1 MB PARTITION ALIGNMENT"
774 #: ../align/virt-alignment-scan.pod:266
776 "Microsoft picked 1 MB as the default alignment for all partitions starting "
777 "with Windows 2008 Server, and Linux has followed this."
781 #: ../align/virt-alignment-scan.pod:269
783 "Assuming 512 byte sectors in the guest, you will now see the first partition "
784 "starting at sector 2048, and subsequent partitions (if any) will start at a "
785 "multiple of 2048 sectors."
789 #: ../align/virt-alignment-scan.pod:273
791 "1 MB alignment is compatible with all current alignment requirements (4K, "
792 "64K) and provides room for future growth in physical block sizes."
796 #: ../align/virt-alignment-scan.pod:276
797 msgid "SETTING ALIGNMENT"
801 #: ../align/virt-alignment-scan.pod:278
803 "Currently there is no virt tool for fixing alignment problems in guests. "
804 "This is a difficult problem to fix because simply moving partitions around "
805 "breaks the bootloader, necessitating either manual reinstallation of the "
806 "bootloader using a rescue disk, or complex and error-prone hacks."
810 #: ../align/virt-alignment-scan.pod:284
812 "L<virt-resize(1)> does not change the alignment of the first partition, but "
813 "it does align the second and subsequent partitions to a multiple of 64 or "
814 "128 sectors (depending on the version of virt-resize, 128 in virt-resize "
815 "E<ge> 1.13.19). For operating systems that have a separate boot partition, "
816 "virt-resize could be used to align the main OS partition, so that the "
817 "majority of OS accesses except at boot will be aligned."
821 #: ../align/virt-alignment-scan.pod:292
823 "The easiest way to correct partition alignment problems is to reinstall your "
824 "guest operating systems. If you install operating systems from templates, "
825 "ensure these have correct partition alignment too."
829 #: ../align/virt-alignment-scan.pod:297
831 "For older versions of Windows, the following NetApp document contains useful "
832 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
836 #: ../align/virt-alignment-scan.pod:300
838 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
839 "an explicit C<%pre> section that creates aligned partitions using L<parted(8)"
840 ">. Do not use the Kickstart C<part> command. The NetApp document above "
841 "contains an example."
845 #: ../align/virt-alignment-scan.pod:305 ../cat/virt-cat.pod:191
846 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483
847 #: ../clone/virt-sysprep.pod:359 ../df/virt-df.pod:215
848 #: ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352
849 #: ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:601
850 #: ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258
851 #: ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289
852 #: ../tools/virt-win-reg.pl:733
853 msgid "SHELL QUOTING"
857 #: ../align/virt-alignment-scan.pod:307 ../cat/virt-cat.pod:193
858 #: ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485
859 #: ../clone/virt-sysprep.pod:361 ../df/virt-df.pod:217
860 #: ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354
861 #: ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:603
862 #: ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260
863 #: ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291
864 #: ../tools/virt-win-reg.pl:741
866 "Libvirt guest names can contain arbitrary characters, some of which have "
867 "meaning to the shell such as C<#> and space. You may need to quote or "
868 "escape these characters on the command line. See the shell manual page L<sh"
873 #: ../align/virt-alignment-scan.pod:312 ../cat/virt-cat.pod:198
874 #: ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490
875 #: ../clone/virt-sysprep.pod:366 ../df/virt-df.pod:222
876 #: ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1113
877 #: ../fuse/guestmount.pod:303 ../inspector/virt-inspector.pod:375
878 #: ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:227
879 #: ../test-tool/libguestfs-test-tool.pod:90
884 #: ../align/virt-alignment-scan.pod:314
885 msgid "This program returns:"
889 #: ../align/virt-alignment-scan.pod:318 ../align/virt-alignment-scan.pod:324
890 #: ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:337
891 #: ../clone/virt-sysprep.pod:213 ../clone/virt-sysprep.pod:217
892 #: ../clone/virt-sysprep.pod:221 ../clone/virt-sysprep.pod:225
893 #: ../clone/virt-sysprep.pod:240 ../clone/virt-sysprep.pod:244
894 #: ../clone/virt-sysprep.pod:248 ../clone/virt-sysprep.pod:252
895 #: ../clone/virt-sysprep.pod:256 ../clone/virt-sysprep.pod:292
896 #: ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318
897 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
898 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
899 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
900 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
901 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
902 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
903 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
904 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
905 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
906 #: ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398
907 #: ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412
908 #: ../fish/guestfish-actions.pod:1139 ../fish/guestfish-actions.pod:1143
909 #: ../fish/guestfish-actions.pod:1147 ../fish/guestfish-actions.pod:1151
910 #: ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163
911 #: ../fish/guestfish-actions.pod:1167 ../fish/guestfish-actions.pod:1177
912 #: ../fish/guestfish-actions.pod:1181 ../fish/guestfish-actions.pod:1185
913 #: ../fish/guestfish-actions.pod:1275 ../fish/guestfish-actions.pod:1279
914 #: ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289
915 #: ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335
916 #: ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1596
917 #: ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:1610
918 #: ../fish/guestfish-actions.pod:2005 ../fish/guestfish-actions.pod:2011
919 #: ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2026
920 #: ../fish/guestfish-actions.pod:2033 ../fish/guestfish.pod:445
921 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
922 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
923 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282
924 #: ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295
925 #: ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32
926 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
927 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
928 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
929 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
930 #: ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596
931 #: ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610
932 #: ../src/guestfs-actions.pod:1778 ../src/guestfs-actions.pod:1782
933 #: ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:1790
934 #: ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1802
935 #: ../src/guestfs-actions.pod:1806 ../src/guestfs-actions.pod:1816
936 #: ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1824
937 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:1966
938 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:1976
939 #: ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2041
940 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2461
941 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2475
942 #: ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3018
943 #: ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3033
944 #: ../src/guestfs-actions.pod:3040 ../src/guestfs.pod:388
945 #: ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402
946 #: ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416
947 #: ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098
948 #: ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115
949 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164
950 #: ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176
951 #: ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674
952 #: ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785
953 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804
954 #: ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104
955 #: ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636
956 #: ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047
957 #: ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060
958 #: ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083
959 #: ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322
960 #: ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197
961 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
962 #: ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716
963 #: ../tools/virt-win-reg.pl:722
968 #: ../align/virt-alignment-scan.pod:320
973 #: ../align/virt-alignment-scan.pod:322
975 "successful exit, all partitions are aligned E<ge> 64K for best performance"
979 #: ../align/virt-alignment-scan.pod:326
984 #: ../align/virt-alignment-scan.pod:328
985 msgid "an error scanning the disk image or guest"
989 #: ../align/virt-alignment-scan.pod:332
994 #: ../align/virt-alignment-scan.pod:334
996 "successful exit, some partitions have alignment E<lt> 64K which can result "
997 "in poor performance on high end network storage"
1001 #: ../align/virt-alignment-scan.pod:339
1006 #: ../align/virt-alignment-scan.pod:341
1008 "successful exit, some partitions have alignment E<lt> 4K which can result in "
1009 "poor performance on most hypervisors"
1013 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:203
1014 #: ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495
1015 #: ../clone/virt-sysprep.pod:370 ../df/virt-df.pod:227
1016 #: ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97
1017 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
1018 #: ../fish/guestfish.pod:1267 ../fish/virt-copy-in.pod:50
1019 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
1020 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308
1021 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
1022 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
1023 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
1024 #: ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36
1025 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255
1026 #: ../test-tool/libguestfs-test-tool.pod:100
1027 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
1028 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
1029 #: ../tools/virt-win-reg.pl:746
1034 #: ../align/virt-alignment-scan.pod:348
1036 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
1037 "L<virt-resize(1)>, L<http://libguestfs.org/>."
1041 #: ../align/virt-alignment-scan.pod:355 ../cat/virt-cat.pod:212
1042 #: ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507
1043 #: ../clone/virt-sysprep.pod:384 ../df/virt-df.pod:235
1044 #: ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296
1045 #: ../resize/virt-resize.pod:635 ../sparsify/virt-sparsify.pod:264
1046 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
1047 #: ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311
1048 #: ../tools/virt-win-reg.pl:772
1053 #: ../align/virt-alignment-scan.pod:357 ../cat/virt-cat.pod:214
1054 #: ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509
1055 #: ../clone/virt-sysprep.pod:386 ../df/virt-df.pod:237
1056 #: ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395
1057 #: ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:637
1058 #: ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210
1059 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566
1060 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
1061 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
1065 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:216
1066 #: ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511
1067 #: ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:239
1068 #: ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114
1069 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
1070 #: ../fish/guestfish.pod:1299 ../fish/virt-copy-in.pod:64
1071 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
1072 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323
1073 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
1074 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
1075 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
1076 #: ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52
1077 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337
1078 #: ../test-tool/libguestfs-test-tool.pod:110
1079 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
1080 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
1081 #: ../tools/virt-win-reg.pl:776
1086 #: ../align/virt-alignment-scan.pod:361 ../clone/virt-sysprep.pod:390
1087 #: ../sparsify/virt-sparsify.pod:270
1088 msgid "Copyright (C) 2011 Red Hat Inc."
1092 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:220
1093 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515
1094 #: ../clone/virt-sysprep.pod:392 ../df/virt-df.pod:243
1095 #: ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1304
1096 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
1097 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
1098 #: ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:407
1099 #: ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:643
1100 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
1101 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
1102 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
1103 #: ../tools/virt-win-reg.pl:780
1105 "This program is free software; you can redistribute it and/or modify it "
1106 "under the terms of the GNU General Public License as published by the Free "
1107 "Software Foundation; either version 2 of the License, or (at your option) "
1108 "any later version."
1112 #: ../align/virt-alignment-scan.pod:368 ../cat/virt-cat.pod:225
1113 #: ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520
1114 #: ../clone/virt-sysprep.pod:397 ../df/virt-df.pod:248
1115 #: ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1309
1116 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
1117 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
1118 #: ../fuse/guestmount.pod:333 ../inspector/virt-inspector.pod:412
1119 #: ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:648
1120 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
1121 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
1122 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
1123 #: ../tools/virt-win-reg.pl:785
1125 "This program is distributed in the hope that it will be useful, but WITHOUT "
1126 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
1127 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
1132 #: ../align/virt-alignment-scan.pod:373 ../cat/virt-cat.pod:230
1133 #: ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525
1134 #: ../clone/virt-sysprep.pod:402 ../df/virt-df.pod:253
1135 #: ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1314
1136 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
1137 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
1138 #: ../fuse/guestmount.pod:338 ../inspector/virt-inspector.pod:417
1139 #: ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:653
1140 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
1141 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
1142 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
1143 #: ../tools/virt-win-reg.pl:790
1145 "You should have received a copy of the GNU General Public License along with "
1146 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
1147 "Ave, Cambridge, MA 02139, USA."
1151 #: ../cat/virt-cat.pod:5
1152 msgid "virt-cat - Display files in a virtual machine"
1156 #: ../cat/virt-cat.pod:9
1159 " virt-cat [--options] -d domname file [file ...]\n"
1164 #: ../cat/virt-cat.pod:11
1167 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
1172 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
1173 #: ../inspector/virt-inspector.pod:13
1178 #: ../cat/virt-cat.pod:15
1181 " virt-cat domname file\n"
1186 #: ../cat/virt-cat.pod:17
1189 " virt-cat disk.img file\n"
1194 #: ../cat/virt-cat.pod:21
1196 "C<virt-cat> is a command line tool to display the contents of C<file> where "
1197 "C<file> exists in the named virtual machine (or disk image)."
1201 #: ../cat/virt-cat.pod:24
1203 "Multiple filenames can be given, in which case they are concatenated "
1204 "together. Each filename must be a full path, starting at the root directory "
1205 "(starting with '/')."
1209 #: ../cat/virt-cat.pod:28
1211 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
1212 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
1213 "(see L</USING GUESTFISH> below)."
1217 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
1218 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
1219 #: ../fish/guestfish.pod:1050 ../fish/virt-copy-in.pod:29
1220 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
1221 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
1222 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
1223 #: ../tools/virt-tar.pl:50
1228 #: ../cat/virt-cat.pod:34
1230 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
1234 #: ../cat/virt-cat.pod:37
1237 " virt-cat -d mydomain /etc/fstab\n"
1242 #: ../cat/virt-cat.pod:39
1243 msgid "List syslog messages from a VM disk image file:"
1247 #: ../cat/virt-cat.pod:41
1250 " virt-cat -a disk.img /var/log/messages | tail\n"
1255 #: ../cat/virt-cat.pod:43
1256 msgid "Find out what DHCP IP address a VM acquired:"
1260 #: ../cat/virt-cat.pod:45
1263 " virt-cat -d mydomain /var/log/messages | \\\n"
1264 " grep 'dhclient: bound to' | tail\n"
1269 #: ../cat/virt-cat.pod:48
1270 msgid "Find out what packages were recently installed:"
1274 #: ../cat/virt-cat.pod:50
1277 " virt-cat -d mydomain /var/log/yum.log | tail\n"
1282 #: ../cat/virt-cat.pod:52
1283 msgid "Find out who is logged on inside a virtual machine:"
1287 #: ../cat/virt-cat.pod:54
1290 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
1296 #: ../cat/virt-cat.pod:57
1297 msgid "or who was logged on:"
1301 #: ../cat/virt-cat.pod:59
1304 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
1305 " last -f /tmp/wtmp\n"
1310 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
1311 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
1312 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
1314 "Add I<file> which should be a disk image from a virtual machine. If the "
1315 "virtual machine has multiple block devices, you must supply all of them with "
1316 "separate I<-a> options."
1320 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
1321 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
1322 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
1323 msgid "B<--echo-keys>"
1327 #: ../cat/virt-cat.pod:100
1329 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
1330 "so you cannot see what you are typing. If you are not worried about Tempest "
1331 "attacks and there is no one else in the room you can specify this flag to "
1332 "see what you are typing."
1336 #: ../cat/virt-cat.pod:116
1339 " virt-cat --format=raw -a disk.img file\n"
1344 #: ../cat/virt-cat.pod:120
1347 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1352 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1353 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1354 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
1355 msgid "B<--keys-from-stdin>"
1359 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1360 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1361 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
1363 "Read key or passphrase parameters from stdin. The default is to try to read "
1364 "passphrases from the user by opening C</dev/tty>."
1368 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1369 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
1370 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1374 #: ../cat/virt-cat.pod:154
1375 msgid "Previous versions of virt-cat allowed you to write either:"
1379 #: ../cat/virt-cat.pod:156
1382 " virt-cat disk.img [disk.img ...] file\n"
1387 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1388 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1393 #: ../cat/virt-cat.pod:160
1396 " virt-cat guestname file\n"
1401 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1402 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1404 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1405 "the confusing case where a disk image might have the same name as a guest."
1409 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1410 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1411 msgid "For compatibility the old style is still supported."
1415 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1416 msgid "USING GUESTFISH"
1420 #: ../cat/virt-cat.pod:170
1422 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1423 "C<virt-cat> doesn't work."
1427 #: ../cat/virt-cat.pod:173
1428 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1432 #: ../cat/virt-cat.pod:175
1435 " guestfish --ro -i -d domname download file -\n"
1440 #: ../cat/virt-cat.pod:177
1442 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1443 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1447 #: ../cat/virt-cat.pod:181
1449 "The command above uses libguestfs's guest inspection feature and so does not "
1450 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1451 "disk images that don't contain guests. To display a file from a disk image "
1456 #: ../cat/virt-cat.pod:186
1459 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1464 #: ../cat/virt-cat.pod:188
1466 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1467 "the disk image, and C<file> is the full path to the file."
1471 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
1472 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1473 #: ../fuse/guestmount.pod:305 ../inspector/virt-inspector.pod:377
1474 #: ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
1476 "This program returns 0 if successful, or non-zero if there was an error."
1480 #: ../cat/virt-cat.pod:205
1482 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1483 "tar-out(1)>, L<http://libguestfs.org/>."
1487 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
1488 #: ../resize/virt-resize.pod:641
1489 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1493 #: ../cat/virt-filesystems.pod:5
1495 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1496 "virtual machine or disk image"
1500 #: ../cat/virt-filesystems.pod:9
1503 " virt-filesystems [--options] -d domname\n"
1508 #: ../cat/virt-filesystems.pod:11
1511 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1516 #: ../cat/virt-filesystems.pod:15
1518 "This tool allows you to discover filesystems, partitions, logical volumes, "
1519 "and their sizes in a disk image or virtual machine. It is a replacement for "
1520 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1524 #: ../cat/virt-filesystems.pod:20
1526 "One use for this tool is from shell scripts to iterate over all filesystems "
1527 "from a disk image:"
1531 #: ../cat/virt-filesystems.pod:23
1534 " for fs in $(virt-filesystems -a disk.img); do\n"
1541 #: ../cat/virt-filesystems.pod:27
1543 "Another use is to list partitions before using another tool to modify those "
1544 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1545 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1549 #: ../cat/virt-filesystems.pod:32
1551 "Various command line options control what this program displays. You need "
1552 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1553 "guest respectively. If you just specify that then the program shows "
1554 "filesystems found, one per line, like this:"
1558 #: ../cat/virt-filesystems.pod:37
1561 " $ virt-filesystems -a disk.img\n"
1563 " /dev/vg_guest/lv_root\n"
1568 #: ../cat/virt-filesystems.pod:41
1570 "If you add I<-l> or I<--long> then the output includes extra information:"
1574 #: ../cat/virt-filesystems.pod:44
1577 " $ virt-filesystems -a disk.img -l\n"
1578 " Name Type VFS Label Size\n"
1579 " /dev/sda1 filesystem ext4 boot 524288000\n"
1580 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1585 #: ../cat/virt-filesystems.pod:49
1587 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1592 #: ../cat/virt-filesystems.pod:52
1595 " $ virt-filesystems -a disk.img --extra\n"
1597 " /dev/vg_guest/lv_root\n"
1598 " /dev/vg_guest/lv_swap\n"
1599 " /dev/vg_guest/lv_data\n"
1604 #: ../cat/virt-filesystems.pod:58
1606 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1610 #: ../cat/virt-filesystems.pod:60
1613 " $ virt-filesystems -a disk.img --partitions\n"
1620 #: ../cat/virt-filesystems.pod:64
1622 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1623 "volumes>, I<--block-devices> to list those items."
1627 #: ../cat/virt-filesystems.pod:67
1629 "You can use these options in combination as well (if you want a combination "
1630 "including filesystems, you have to add I<--filesystems>). Notice that some "
1631 "items fall into several categories (eg. C</dev/sda1> might be both a "
1632 "partition and a filesystem). These items are listed several times. To get "
1633 "a list which includes absolutely everything that virt-filesystems knows "
1634 "about, use the I<--all> option."
1638 #: ../cat/virt-filesystems.pod:74
1640 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1641 "uuid> option to display device and filesystem UUIDs in the long output."
1645 #: ../cat/virt-filesystems.pod:78
1647 "I<--all --long --uuid> is a useful combination to display all possible "
1648 "information about everything."
1652 #: ../cat/virt-filesystems.pod:81
1655 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1656 " Name Type VFS Label Size Parent UUID\n"
1657 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1658 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1659 " /dev/sda1 partition - - 100M /dev/sda -\n"
1660 " /dev/sda2 partition - - 20G /dev/sda -\n"
1661 " /dev/sda device - - 20G - -\n"
1666 #: ../cat/virt-filesystems.pod:89
1668 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1672 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1677 #: ../cat/virt-filesystems.pod:112
1679 "Display everything. This is currently the same as specifying these options: "
1680 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1681 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1682 "added to this list in future)."
1686 #: ../cat/virt-filesystems.pod:117
1687 msgid "See also I<--long>."
1691 #: ../cat/virt-filesystems.pod:119
1692 msgid "B<--blkdevs>"
1696 #: ../cat/virt-filesystems.pod:121
1697 msgid "B<--block-devices>"
1701 #: ../cat/virt-filesystems.pod:123
1702 msgid "Display block devices."
1706 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1711 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1713 "Write out the results in CSV format (comma-separated values). This format "
1714 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1715 "ABOUT CSV FORMAT> below."
1719 #: ../cat/virt-filesystems.pod:150
1721 "When prompting for keys and passphrases, virt-filesystems normally turns "
1722 "echoing off so you cannot see what you are typing. If you are not worried "
1723 "about Tempest attacks and there is no one else in the room you can specify "
1724 "this flag to see what you are typing."
1728 #: ../cat/virt-filesystems.pod:155
1733 #: ../cat/virt-filesystems.pod:157
1735 "This causes filesystems that are not ordinary, mountable filesystems to be "
1736 "displayed. This category includes swapspace, and filesystems that are empty "
1737 "or contain unknown data."
1741 #: ../cat/virt-filesystems.pod:161
1742 msgid "This option implies I<--filesystems>."
1746 #: ../cat/virt-filesystems.pod:163
1747 msgid "B<--filesystems>"
1751 #: ../cat/virt-filesystems.pod:165
1753 "Display mountable filesystems. If no display option was selected then this "
1754 "option is implied."
1758 #: ../cat/virt-filesystems.pod:168
1759 msgid "With I<--extra>, non-mountable filesystems are shown too."
1763 #: ../cat/virt-filesystems.pod:181
1766 " virt-filesystems --format=raw -a disk.img\n"
1771 #: ../cat/virt-filesystems.pod:185
1774 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1779 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1780 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1781 #: ../tools/virt-list-partitions.pl:109
1786 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1787 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1788 msgid "B<--human-readable>"
1792 #: ../cat/virt-filesystems.pod:198
1793 msgid "In I<--long> mode, display sizes in human-readable format."
1797 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1798 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1803 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1804 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1809 #: ../cat/virt-filesystems.pod:209
1810 msgid "Display extra columns of data (\"long format\")."
1814 #: ../cat/virt-filesystems.pod:211
1815 msgid "A title row is added unless you also specify I<--no-title>."
1819 #: ../cat/virt-filesystems.pod:213
1821 "The extra columns displayed depend on what output you select, and the "
1822 "ordering of columns may change in future versions. Use the title row, I<--"
1823 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1828 #: ../cat/virt-filesystems.pod:218
1830 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1831 "default is to show raw numbers of I<bytes>."
1835 #: ../cat/virt-filesystems.pod:221
1836 msgid "Use I<--uuid> to display UUIDs too."
1840 #: ../cat/virt-filesystems.pod:223
1845 #: ../cat/virt-filesystems.pod:225
1846 msgid "B<--logvols>"
1850 #: ../cat/virt-filesystems.pod:227
1851 msgid "B<--logical-volumes>"
1855 #: ../cat/virt-filesystems.pod:229
1857 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1858 "of whether the LVs contain filesystems."
1862 #: ../cat/virt-filesystems.pod:232
1863 msgid "B<--no-title>"
1867 #: ../cat/virt-filesystems.pod:234
1868 msgid "In I<--long> mode, don't add a title row."
1872 #: ../cat/virt-filesystems.pod:236
1874 "Note that the order of the columns is not fixed, and may change in future "
1875 "versions of virt-filesystems, so using this option may give you unexpected "
1880 #: ../cat/virt-filesystems.pod:240
1885 #: ../cat/virt-filesystems.pod:242
1886 msgid "B<--partitions>"
1890 #: ../cat/virt-filesystems.pod:244
1892 "Display partitions. In this mode, these are displayed irrespective of "
1893 "whether the partitions contain filesystems."
1897 #: ../cat/virt-filesystems.pod:247
1902 #: ../cat/virt-filesystems.pod:249
1903 msgid "B<--physvols>"
1907 #: ../cat/virt-filesystems.pod:251
1908 msgid "B<--physical-volumes>"
1912 #: ../cat/virt-filesystems.pod:253
1913 msgid "Display LVM physical volumes."
1917 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1922 #: ../cat/virt-filesystems.pod:257
1927 #: ../cat/virt-filesystems.pod:259
1928 msgid "In I<--long> mode, display UUIDs as well."
1932 #: ../cat/virt-filesystems.pod:273
1937 #: ../cat/virt-filesystems.pod:275
1938 msgid "B<--volgroups>"
1942 #: ../cat/virt-filesystems.pod:277
1943 msgid "B<--volume-groups>"
1947 #: ../cat/virt-filesystems.pod:279
1948 msgid "Display LVM volume groups."
1952 #: ../cat/virt-filesystems.pod:287
1957 #: ../cat/virt-filesystems.pod:289
1959 "Note that columns in the output are subject to reordering and change in "
1960 "future versions of this tool."
1964 #: ../cat/virt-filesystems.pod:294
1969 #: ../cat/virt-filesystems.pod:296
1970 msgid "The filesystem, partition, block device or LVM name."
1974 #: ../cat/virt-filesystems.pod:298
1976 "For device and partition names these are displayed as canonical libguestfs "
1977 "names, so that for example C</dev/sda2> is the second partition on the first "
1982 #: ../cat/virt-filesystems.pod:302
1984 "If the I<--long> option is B<not> specified, then only the name column is "
1985 "shown in the output."
1989 #: ../cat/virt-filesystems.pod:305
1994 #: ../cat/virt-filesystems.pod:307
1995 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1999 #: ../cat/virt-filesystems.pod:309
2004 #: ../cat/virt-filesystems.pod:311
2006 "If there is a filesystem, then this column displays the filesystem type if "
2007 "one could be detected, eg. C<ext4>."
2011 #: ../cat/virt-filesystems.pod:314
2016 #: ../cat/virt-filesystems.pod:316
2018 "If the object has a label (used for identifying and mounting filesystems) "
2019 "then this column contains the label."
2023 #: ../cat/virt-filesystems.pod:319
2028 #: ../cat/virt-filesystems.pod:321
2030 "The size of the object in bytes. If the I<--human> option is used then the "
2031 "size is displayed in a human-readable form."
2035 #: ../cat/virt-filesystems.pod:324
2040 #: ../cat/virt-filesystems.pod:326
2042 "The parent column records the parent relationship between objects. For "
2043 "example, if the object is a partition, then this column contains the name of "
2044 "the containing device. If the object is a logical volume, then this column "
2045 "is the name of the volume group."
2049 #: ../cat/virt-filesystems.pod:331
2054 #: ../cat/virt-filesystems.pod:333
2056 "If the object has a UUID (used for identifying and mounting filesystems and "
2057 "block devices) then this column contains the UUID as a string."
2061 #: ../cat/virt-filesystems.pod:337
2062 msgid "The UUID is only displayed if the I<--uuid> option is given."
2066 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
2067 #: ../df/virt-df.pod:191
2068 msgid "NOTE ABOUT CSV FORMAT"
2072 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
2073 #: ../df/virt-df.pod:193
2075 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
2076 "should be easy to parse, but it is definitely not easy to parse."
2080 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
2081 #: ../df/virt-df.pod:196
2083 "Myth: Just split fields at commas. Reality: This does I<not> work "
2084 "reliably. This example has two columns:"
2088 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
2089 #: ../df/virt-df.pod:199
2092 " \"foo,bar\",baz\n"
2097 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
2098 #: ../df/virt-df.pod:201
2100 "Myth: Read the file one line at a time. Reality: This does I<not> work "
2101 "reliably. This example has one row:"
2105 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
2106 #: ../df/virt-df.pod:204
2115 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
2116 #: ../df/virt-df.pod:207
2118 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
2119 "packaged in major Linux distributions)."
2123 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
2124 #: ../df/virt-df.pod:210
2126 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
2127 "or Python's built-in csv library)."
2131 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
2132 #: ../df/virt-df.pod:213
2133 msgid "Most spreadsheets and databases can import CSV directly."
2137 #: ../cat/virt-filesystems.pod:379
2139 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
2140 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
2145 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570
2146 #: ../tools/virt-win-reg.pl:778
2147 msgid "Copyright (C) 2010 Red Hat Inc."
2151 #: ../cat/virt-ls.pod:5
2152 msgid "virt-ls - List files in a virtual machine"
2156 #: ../cat/virt-ls.pod:9
2159 " virt-ls [--options] -d domname directory [directory ...]\n"
2164 #: ../cat/virt-ls.pod:11
2167 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
2172 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
2177 #: ../cat/virt-ls.pod:15
2180 " virt-ls [--options] domname directory\n"
2185 #: ../cat/virt-ls.pod:17
2188 " virt-ls [--options] disk.img [disk.img ...] directory\n"
2193 #: ../cat/virt-ls.pod:21
2195 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
2196 "more from a virtual machine or disk image."
2200 #: ../cat/virt-ls.pod:24
2202 "Multiple directory names can be given, in which case the output from each is "
2207 #: ../cat/virt-ls.pod:27
2209 "To list directories from a libvirt guest use the I<-d> option to specify the "
2210 "name of the guest. For a disk image, use the I<-a> option."
2214 #: ../cat/virt-ls.pod:31
2216 "C<virt-ls> can do many simple file listings. For more complicated cases you "
2217 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
2222 #: ../cat/virt-ls.pod:37
2223 msgid "Get a list of all files and directories in a virtual machine:"
2227 #: ../cat/virt-ls.pod:39
2230 " virt-ls -R -d guest /\n"
2235 #: ../cat/virt-ls.pod:41
2236 msgid "List all setuid or setgid programs in a Linux virtual machine:"
2240 #: ../cat/virt-ls.pod:43
2243 " virt-ls -lR -d guest / | grep '^- [42]'\n"
2248 #: ../cat/virt-ls.pod:45
2249 msgid "List all public-writable directories in a Linux virtual machine:"
2253 #: ../cat/virt-ls.pod:47
2256 " virt-ls -lR -d guest / | grep '^d ...7'\n"
2261 #: ../cat/virt-ls.pod:49
2262 msgid "List all Unix domain sockets in a Linux virtual machine:"
2266 #: ../cat/virt-ls.pod:51
2269 " virt-ls -lR -d guest / | grep '^s'\n"
2274 #: ../cat/virt-ls.pod:53
2275 msgid "List all regular files with filenames ending in '.png':"
2279 #: ../cat/virt-ls.pod:55
2282 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
2287 #: ../cat/virt-ls.pod:57
2288 msgid "To display files larger than 10MB in home directories:"
2292 #: ../cat/virt-ls.pod:59
2295 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
2300 #: ../cat/virt-ls.pod:61
2301 msgid "Find everything modified in the last 7 days:"
2305 #: ../cat/virt-ls.pod:63
2308 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
2313 #: ../cat/virt-ls.pod:65
2314 msgid "Find regular files modified in the last 24 hours:"
2318 #: ../cat/virt-ls.pod:67
2321 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2326 #: ../cat/virt-ls.pod:69
2327 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2331 #: ../cat/virt-ls.pod:71
2333 "Find the differences between files in a guest and an earlier snapshot of the "
2338 #: ../cat/virt-ls.pod:74
2341 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2342 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2343 " diff -u old new | less\n"
2348 #: ../cat/virt-ls.pod:78
2350 "The commands above won't find files where the content has changed but the "
2351 "metadata (eg. file size and modification date) is the same. To do that, you "
2352 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2353 "checksum> can be quite slow since it has to read and compute a checksum of "
2354 "every regular file in the virtual machine."
2358 #: ../cat/virt-ls.pod:84
2359 msgid "OUTPUT MODES"
2363 #: ../cat/virt-ls.pod:86
2365 "C<virt-ls> has four output modes, controlled by different combinations of "
2366 "the I<-l> and I<-R> options."
2370 #: ../cat/virt-ls.pod:89
2371 msgid "SIMPLE LISTING"
2375 #: ../cat/virt-ls.pod:91
2376 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2380 #: ../cat/virt-ls.pod:93
2383 " $ virt-ls -d guest /\n"
2391 #: ../cat/virt-ls.pod:98
2392 msgid "LONG LISTING"
2396 #: ../cat/virt-ls.pod:100
2398 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2399 "(more specifically, like the C<guestfs_ll> function)."
2403 #: ../cat/virt-ls.pod:103
2406 " $ virt-ls -l -d guest /\n"
2408 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2409 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2415 #: ../cat/virt-ls.pod:109
2417 "Note that while this is useful for displaying a directory, do not try "
2418 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2423 #: ../cat/virt-ls.pod:113
2424 msgid "RECURSIVE LISTING"
2428 #: ../cat/virt-ls.pod:115
2430 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2431 "and directories recursively:"
2435 #: ../cat/virt-ls.pod:118
2438 " $ virt-ls -R -d guest /tmp\n"
2446 #: ../cat/virt-ls.pod:123
2448 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2449 "converts C<\\0> characters to C<\\n>."
2453 #: ../cat/virt-ls.pod:126
2454 msgid "RECURSIVE LONG LISTING"
2458 #: ../cat/virt-ls.pod:128
2460 "Using I<-lR> options together changes the output to display directories "
2461 "recursively, with file stats, and optionally other features such as "
2462 "checksums and extended attributes."
2466 #: ../cat/virt-ls.pod:132
2468 "Most of the interesting features of C<virt-ls> are only available when using "
2473 #: ../cat/virt-ls.pod:135
2475 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2476 "you cannot use the output in another program (because filenames can contain "
2477 "spaces and other unsafe characters). If the guest was untrusted and someone "
2478 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2479 "on you by creating filenames with embedded newline characters. To B<safely> "
2480 "parse the output in another program, use the I<--csv> (Comma-Separated "
2485 #: ../cat/virt-ls.pod:143
2487 "Note that this output format is completely unrelated to the C<ls -lR> "
2492 #: ../cat/virt-ls.pod:146
2495 " $ virt-ls -lR -d guest /bin\n"
2496 " d 0555 4096 /bin\n"
2497 " - 0755 123 /bin/alsaunmute\n"
2498 " - 0755 28328 /bin/arch\n"
2499 " l 0777 4 /bin/awk -> gawk\n"
2500 " - 0755 27216 /bin/basename\n"
2501 " - 0755 943360 /bin/bash\n"
2507 #: ../cat/virt-ls.pod:155
2508 msgid "These basic fields are always shown:"
2512 #: ../cat/virt-ls.pod:159
2517 #: ../cat/virt-ls.pod:161
2519 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2520 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2521 "link), C<s> (socket) or C<u> (unknown)."
2525 #: ../cat/virt-ls.pod:171
2530 #: ../cat/virt-ls.pod:173
2531 msgid "The Unix permissions, displayed as a 4 digit octal number."
2535 #: ../cat/virt-ls.pod:175
2540 #: ../cat/virt-ls.pod:177
2542 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2543 "readable> option is given, in which case this is shown as a human-readable "
2548 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4245
2553 #: ../cat/virt-ls.pod:183
2554 msgid "The full path of the file or directory."
2558 #: ../cat/virt-ls.pod:185
2563 #: ../cat/virt-ls.pod:187
2564 msgid "For symbolic links only, the link target."
2568 #: ../cat/virt-ls.pod:191
2570 "In I<-lR> mode, additional command line options enable the display of more "
2575 #: ../cat/virt-ls.pod:194
2577 "With the I<--uids> flag, these additional fields are displayed before the "
2582 #: ../cat/virt-ls.pod:199
2587 #: ../cat/virt-ls.pod:201
2592 #: ../cat/virt-ls.pod:203
2594 "The UID and GID of the owner of the file (displayed numerically). Note "
2595 "these only make sense in the context of a Unix-like guest."
2599 #: ../cat/virt-ls.pod:208
2600 msgid "With the I<--times> flag, these additional fields are displayed:"
2604 #: ../cat/virt-ls.pod:212
2609 #: ../cat/virt-ls.pod:214
2610 msgid "The time of last access."
2614 #: ../cat/virt-ls.pod:216
2619 #: ../cat/virt-ls.pod:218
2620 msgid "The time of last modification."
2624 #: ../cat/virt-ls.pod:220
2629 #: ../cat/virt-ls.pod:222
2630 msgid "The time of last status change."
2634 #: ../cat/virt-ls.pod:226
2636 "The time fields are displayed as string dates and times, unless one of the "
2637 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2641 #: ../cat/virt-ls.pod:229
2642 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2646 #: ../cat/virt-ls.pod:233
2651 #: ../cat/virt-ls.pod:235
2653 "The device containing the file (displayed as major:minor). This may not "
2654 "match devices as known to the guest."
2658 #: ../cat/virt-ls.pod:238
2663 #: ../cat/virt-ls.pod:240
2664 msgid "The inode number."
2668 #: ../cat/virt-ls.pod:242
2673 #: ../cat/virt-ls.pod:244
2674 msgid "The number of hard links."
2678 #: ../cat/virt-ls.pod:246
2683 #: ../cat/virt-ls.pod:248
2685 "For block and char special files, the device (displayed as major:minor)."
2689 #: ../cat/virt-ls.pod:251
2694 #: ../cat/virt-ls.pod:253
2695 msgid "The number of 512 byte blocks allocated to the file."
2699 #: ../cat/virt-ls.pod:257
2701 "With the I<--checksum> flag, the checksum of the file contents is shown "
2702 "(only for regular files). Computing file checksums can take a considerable "
2707 #: ../cat/virt-ls.pod:280
2708 msgid "B<--checksum>"
2712 #: ../cat/virt-ls.pod:282
2713 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2717 #: ../cat/virt-ls.pod:284
2719 "Display checksum over file contents for regular files. With no argument, "
2720 "this defaults to using I<md5>. Using an argument, you can select the "
2721 "checksum type to use."
2725 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2726 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2727 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2729 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2734 #: ../cat/virt-ls.pod:316
2736 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2737 "so you cannot see what you are typing. If you are not worried about Tempest "
2738 "attacks and there is no one else in the room you can specify this flag to "
2739 "see what you are typing."
2743 #: ../cat/virt-ls.pod:321
2744 msgid "B<--extra-stats>"
2748 #: ../cat/virt-ls.pod:323
2749 msgid "Display extra stats."
2753 #: ../cat/virt-ls.pod:339
2756 " virt-ls --format=raw -a disk.img /dir\n"
2761 #: ../cat/virt-ls.pod:343
2764 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2769 #: ../cat/virt-ls.pod:356
2770 msgid "Display file sizes in human-readable format."
2774 #: ../cat/virt-ls.pod:370
2779 #: ../cat/virt-ls.pod:372
2780 msgid "B<--recursive>"
2784 #: ../cat/virt-ls.pod:374
2786 "Select the mode. With neither of these options, C<virt-ls> produces a "
2787 "simple, flat list of the files in the named directory. See L</SIMPLE "
2792 #: ../cat/virt-ls.pod:378
2794 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2799 #: ../cat/virt-ls.pod:381
2801 "C<virt-ls -R> produces a recursive list of files starting at the named "
2802 "directory. See L</RECURSIVE LISTING>."
2806 #: ../cat/virt-ls.pod:384
2808 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2809 "parsed. See L</RECURSIVE LONG LISTING>."
2813 #: ../cat/virt-ls.pod:387
2818 #: ../cat/virt-ls.pod:389
2819 msgid "Display time fields."
2823 #: ../cat/virt-ls.pod:394
2824 msgid "B<--time-days>"
2828 #: ../cat/virt-ls.pod:396
2829 msgid "Display time fields as days before now (negative if in the future)."
2833 #: ../cat/virt-ls.pod:398
2835 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2836 "of the file is between 0 and 86399 seconds."
2840 #: ../cat/virt-ls.pod:404
2841 msgid "B<--time-relative>"
2845 #: ../cat/virt-ls.pod:406
2846 msgid "Display time fields as seconds before now (negative if in the future)."
2850 #: ../cat/virt-ls.pod:411
2855 #: ../cat/virt-ls.pod:413
2856 msgid "Display time fields as seconds since the Unix epoch."
2860 #: ../cat/virt-ls.pod:418
2865 #: ../cat/virt-ls.pod:420
2866 msgid "Display UID and GID fields."
2870 #: ../cat/virt-ls.pod:445
2871 msgid "Previous versions of virt-ls allowed you to write either:"
2875 #: ../cat/virt-ls.pod:447
2878 " virt-ls disk.img [disk.img ...] /dir\n"
2883 #: ../cat/virt-ls.pod:451
2886 " virt-ls guestname /dir\n"
2891 #: ../cat/virt-ls.pod:497
2893 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2894 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2895 "L<http://libguestfs.org/>."
2899 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2900 #: ../rescue/virt-rescue.pod:302
2901 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2905 #: ../clone/virt-sysprep.pod:5
2907 "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2911 #: ../clone/virt-sysprep.pod:9
2914 " virt-sysprep [--options] -d domname\n"
2919 #: ../clone/virt-sysprep.pod:11
2922 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2927 #: ../clone/virt-sysprep.pod:15
2929 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2930 "can be made from it. Steps in this process include removing SSH host keys, "
2931 "removing persistent network MAC configuration, and removing user accounts. "
2932 "Each step can be enabled or disabled as required."
2936 #: ../clone/virt-sysprep.pod:21
2938 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2939 "customization by the system administrator."
2943 #: ../clone/virt-sysprep.pod:24
2945 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2946 "be shut down. If you want to preserve the existing contents of the guest, "
2947 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> below."
2951 #: ../clone/virt-sysprep.pod:29
2953 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2954 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2955 "machines in preparation for cloning them. Having said that, virt-sysprep "
2956 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2957 "Windows sysprepping in a future version, and we already have code to do it."
2961 #: ../clone/virt-sysprep.pod:70
2962 msgid "B<--enable=...>"
2966 #: ../clone/virt-sysprep.pod:72
2968 "Choose which sysprep operations to perform. Give a comma-separated list of "
2969 "operations, for example:"
2973 #: ../clone/virt-sysprep.pod:75
2976 " --enable=ssh-hostkeys,udev-persistent-net\n"
2981 #: ../clone/virt-sysprep.pod:77
2983 "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2987 #: ../clone/virt-sysprep.pod:79
2989 "If the I<--enable> option is not given, then we default to trying all "
2990 "possible sysprep operations. But some sysprep operations are skipped for "
2995 #: ../clone/virt-sysprep.pod:83
2997 "Use I<--list-operations> to list operations supported by a particular "
2998 "version of virt-sysprep."
3002 #: ../clone/virt-sysprep.pod:86
3004 "See L</OPERATIONS> below for a list and an explanation of each operation."
3008 #: ../clone/virt-sysprep.pod:100
3011 " virt-sysprep --format=raw -a disk.img\n"
3016 #: ../clone/virt-sysprep.pod:104
3019 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
3024 #: ../clone/virt-sysprep.pod:113
3025 msgid "B<--hostname> newhostname"
3029 #: ../clone/virt-sysprep.pod:115
3031 "Change the hostname. See the L</hostname> operation below. If not given, "
3032 "defaults to C<localhost.localdomain>."
3036 #: ../clone/virt-sysprep.pod:118
3037 msgid "B<--list-operations>"
3041 #: ../clone/virt-sysprep.pod:120
3042 msgid "List the operations supported by the virt-sysprep program."
3046 #: ../clone/virt-sysprep.pod:140
3051 #: ../clone/virt-sysprep.pod:142
3053 "If the I<--enable> option is I<not> given, then all sysprep operations in "
3054 "the list below are enabled, although some are skipped depending on the type "
3059 #: ../clone/virt-sysprep.pod:146
3061 "Operations can be individually enabled using the I<--enable> option. Use a "
3062 "comma-separated list, for example:"
3066 #: ../clone/virt-sysprep.pod:149
3069 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
3074 #: ../clone/virt-sysprep.pod:151
3076 "To list the operations supported by the current version of virt-sysprep, use "
3077 "I<--list-operations>."
3081 #: ../clone/virt-sysprep.pod:154
3086 #: ../clone/virt-sysprep.pod:156
3088 "This changes the hostname of the guest to the value given in the I<--"
3089 "hostname> parameter."
3093 #: ../clone/virt-sysprep.pod:159
3095 "If the I<--hostname> parameter is not given, then the hostname is changed to "
3096 "C<localhost.localdomain>."
3100 #: ../clone/virt-sysprep.pod:162
3105 #: ../clone/virt-sysprep.pod:164
3107 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
3108 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
3112 #: ../clone/virt-sysprep.pod:167
3113 msgid "ssh-hostkeys"
3117 #: ../clone/virt-sysprep.pod:169
3118 msgid "This erases the SSH host keys in the guest."
3122 #: ../clone/virt-sysprep.pod:171
3124 "The SSH host keys are regenerated (differently) next time the guest is "
3129 #: ../clone/virt-sysprep.pod:174
3131 "If, after cloning, the guest gets the same IP address, ssh will give you a "
3132 "stark warning about the host key changing:"
3136 #: ../clone/virt-sysprep.pod:177
3139 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3140 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
3141 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3142 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
3147 #: ../clone/virt-sysprep.pod:182
3148 msgid "udev-persistent-net"
3152 #: ../clone/virt-sysprep.pod:184
3154 "This erases udev persistent net rules which map the guest's existing MAC "
3155 "address to a fixed ethernet device (eg. eth0)."
3159 #: ../clone/virt-sysprep.pod:187
3161 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
3162 "address occupies the old name (eg. eth0), this means the fresh MAC address "
3163 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
3164 "Erasing the udev persistent net rules avoids this."
3168 #: ../clone/virt-sysprep.pod:192
3169 msgid "COPYING AND CLONING"
3173 #: ../clone/virt-sysprep.pod:194
3175 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3176 "prepare a template from which guests can be cloned. There are many "
3177 "different ways to achieve this using the virt tools, and this section is "
3178 "just an introduction."
3182 #: ../clone/virt-sysprep.pod:199
3183 msgid "A virtual machine (when switched off) consists of two parts:"
3187 #: ../clone/virt-sysprep.pod:203
3188 msgid "I<configuration>"
3192 #: ../clone/virt-sysprep.pod:205
3194 "The configuration or description of the guest. eg. The libvirt XML (see "
3195 "C<virsh dumpxml>), the running configuration of the guest, or another "
3196 "external format like OVF."
3200 #: ../clone/virt-sysprep.pod:209
3201 msgid "Some configuration items that might need to be changed:"
3205 #: ../clone/virt-sysprep.pod:215
3210 #: ../clone/virt-sysprep.pod:219 ../clone/virt-sysprep.pod:246
3215 #: ../clone/virt-sysprep.pod:223
3216 msgid "path to block device(s)"
3220 #: ../clone/virt-sysprep.pod:227
3221 msgid "network card MAC address"
3225 #: ../clone/virt-sysprep.pod:231
3226 msgid "I<block device(s)>"
3230 #: ../clone/virt-sysprep.pod:233
3232 "One or more hard disk images, themselves containing files, directories, "
3233 "applications, kernels, configuration, etc."
3237 #: ../clone/virt-sysprep.pod:236
3238 msgid "Some things inside the block devices that might need to be changed:"
3242 #: ../clone/virt-sysprep.pod:242
3243 msgid "hostname and other net configuration"
3247 #: ../clone/virt-sysprep.pod:250
3248 msgid "SSH host keys"
3252 #: ../clone/virt-sysprep.pod:254
3253 msgid "Windows unique security ID (SID)"
3257 #: ../clone/virt-sysprep.pod:258
3258 msgid "Puppet registration"
3262 #: ../clone/virt-sysprep.pod:264
3263 msgid "COPYING THE BLOCK DEVICE"
3267 #: ../clone/virt-sysprep.pod:266
3269 "Starting with an original guest, you probably wish to copy the guest block "
3270 "device and its configuration to make a template. Then once you are happy "
3271 "with the template, you will want to make many clones from it."
3275 #: ../clone/virt-sysprep.pod:271
3281 " original guest --------> template ---------->\n"
3282 " \\------> cloned\n"
3283 " \\-----> guests\n"
3289 #: ../clone/virt-sysprep.pod:279
3291 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3296 #: ../clone/virt-sysprep.pod:282
3300 " original guest --------> template ---------->\n"
3301 " \\------> cloned\n"
3302 " \\-----> guests\n"
3308 #: ../clone/virt-sysprep.pod:288
3309 msgid "There are some smarter (and faster) ways too:"
3313 #: ../clone/virt-sysprep.pod:294
3317 " template ---------->\n"
3318 " \\------> cloned\n"
3319 " \\-----> guests\n"
3325 #: ../clone/virt-sysprep.pod:300
3327 "Use the block device as a backing file and create a snapshot on top for each "
3328 "guest. The advantage is that you don't need to copy the block device (very "
3329 "fast) and only changes are stored (less storage required)."
3333 #: ../clone/virt-sysprep.pod:305
3335 "Note that writing to the backing file once you have created guests on top of "
3336 "it is not possible: you will corrupt the guests."
3340 #: ../clone/virt-sysprep.pod:308
3342 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 -"
3343 "o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3344 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3345 "also create cheap snapshots from files or LUNs."
3349 #: ../clone/virt-sysprep.pod:316
3350 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3354 #: ../clone/virt-sysprep.pod:320
3355 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3359 #: ../clone/virt-sysprep.pod:324
3364 #: ../clone/virt-sysprep.pod:326
3366 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3367 "and/or modify the external libvirt configuration of a guest. It will reset "
3368 "the name, UUID and MAC address of the guest in the libvirt XML."
3372 #: ../clone/virt-sysprep.pod:331
3374 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3375 "image. This was the original motivation to write virt-sysprep."
3379 #: ../clone/virt-sysprep.pod:334
3384 #: ../clone/virt-sysprep.pod:336
3388 " original guest --------> template\n"
3393 #: ../clone/virt-sysprep.pod:339
3395 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3396 "it easier to compress and/or faster to copy."
3400 #: ../clone/virt-sysprep.pod:342
3402 "Notice that since virt-sparsify also copies the image, you can use it to "
3403 "make the initial copy (instead of C<dd>)."
3407 #: ../clone/virt-sysprep.pod:345
3412 #: ../clone/virt-sysprep.pod:347
3416 " template ---------->\n"
3417 " \\------> cloned\n"
3418 " \\-----> guests\n"
3424 #: ../clone/virt-sysprep.pod:353
3426 "If you want to give people cloned guests, but let them pick the size of the "
3427 "guest themselves (eg. depending on how much they are prepared to pay for "
3428 "disk space), then instead of copying the template, you can run L<virt-resize"
3429 "(1)>. Virt-resize performs a copy and resize, and thus is ideal for cloning "
3430 "guests from a template."
3434 #: ../clone/virt-sysprep.pod:368
3435 msgid "This program returns 0 on success, or 1 if there was an error."
3439 #: ../clone/virt-sysprep.pod:372
3441 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, L<virt-"
3442 "resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<qemu-img(1)>, L<lvcreate(8)"
3443 ">, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3447 #: ../df/virt-df.pod:5
3448 msgid "virt-df - Display free space on virtual filesystems"
3452 #: ../df/virt-df.pod:9
3455 " virt-df [--options]\n"
3460 #: ../df/virt-df.pod:11
3463 " virt-df [--options] -d domname\n"
3468 #: ../df/virt-df.pod:13
3471 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3476 #: ../df/virt-df.pod:17
3479 " virt-df [--options] domname\n"
3484 #: ../df/virt-df.pod:19
3487 " virt-df [--options] disk.img [disk.img ...]\n"
3492 #: ../df/virt-df.pod:23
3494 "C<virt-df> is a command line tool to display free space on virtual machine "
3495 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3496 "allocated to a virtual machine, but can look inside disk images to see how "
3497 "much space is really being used."
3501 #: ../df/virt-df.pod:28
3503 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3504 "to get a list of all active and inactive guests, and performs a C<df>-type "
3505 "operation on each one in turn, printing out the results."
3509 #: ../df/virt-df.pod:32
3511 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
3512 "type operation on either the single named libvirt domain, or on the disk "
3513 "image(s) listed on the command line (which must all belong to a single VM). "
3514 "In this mode (with arguments), C<virt-df> will I<only work for a single "
3515 "guest>. If you want to run on multiple guests, then you have to invoke "
3516 "C<virt-df> multiple times."
3520 #: ../df/virt-df.pod:39
3522 "Use the I<--csv> option to get a format which can be easily parsed by other "
3523 "programs. Other options are similar to the standard L<df(1)> command."
3527 #: ../df/virt-df.pod:45
3529 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3530 "output human-readable:"
3534 #: ../df/virt-df.pod:48
3537 " # virt-df -d F14x64 -h\n"
3538 " Filesystem Size Used Available Use%\n"
3539 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3540 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3545 #: ../df/virt-df.pod:53
3546 msgid "Show disk usage for a disk image file called C<test.img>:"
3550 #: ../df/virt-df.pod:55
3553 " $ virt-df -a test1.img\n"
3554 " Filesystem 1K-blocks Used Available Use%\n"
3555 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3560 #: ../df/virt-df.pod:112
3563 " virt-df --format=raw -a disk.img\n"
3568 #: ../df/virt-df.pod:116
3571 " virt-df --format=raw -a disk.img --format -a another.img\n"
3576 #: ../df/virt-df.pod:129
3577 msgid "Print sizes in human-readable format."
3581 #: ../df/virt-df.pod:131
3582 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3586 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
3591 #: ../df/virt-df.pod:135
3596 #: ../df/virt-df.pod:137
3597 msgid "Print inodes instead of blocks."
3601 #: ../df/virt-df.pod:139
3602 msgid "B<--one-per-guest>"
3606 #: ../df/virt-df.pod:141
3608 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3609 "disks from several guests to a single libguestfs appliance."
3613 #: ../df/virt-df.pod:144
3614 msgid "You might use this option in the following circumstances:"
3618 #: ../df/virt-df.pod:150
3620 "If you think an untrusted guest might actively try to exploit the libguestfs "
3621 "appliance kernel, then this prevents one guest from interfering with the "
3622 "stats printed for another guest."
3626 #: ../df/virt-df.pod:156
3628 "If the kernel has a bug which stops it from accessing a filesystem in one "
3629 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3630 "and report stats for further guests."
3634 #: ../df/virt-df.pod:165
3636 "Print UUIDs instead of names. This is useful for following a guest even "
3637 "when the guest is migrated or renamed, or when two guests happen to have the "
3642 #: ../df/virt-df.pod:169
3644 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3645 "images, we still print the disk image name even when this option is "
3650 #: ../df/virt-df.pod:229
3652 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
3657 #: ../edit/virt-edit.pod:5
3658 msgid "virt-edit - Edit a file in a virtual machine"
3662 #: ../edit/virt-edit.pod:9
3665 " virt-edit [--options] -d domname file [file ...]\n"
3670 #: ../edit/virt-edit.pod:11
3673 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3678 #: ../edit/virt-edit.pod:13
3681 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3686 #: ../edit/virt-edit.pod:17
3689 " virt-edit domname file\n"
3694 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3697 " virt-edit disk.img [disk.img ...] file\n"
3702 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
3703 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
3704 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
3705 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3710 #: ../edit/virt-edit.pod:23
3712 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3713 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3714 "doing this, but doesn't catch all cases."
3718 #: ../edit/virt-edit.pod:29
3720 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3721 "exists in the named virtual machine (or disk image)."
3725 #: ../edit/virt-edit.pod:32
3727 "Multiple filenames can be given, in which case they are each edited in "
3728 "turn. Each filename must be a full path, starting at the root directory "
3729 "(starting with '/')."
3733 #: ../edit/virt-edit.pod:36
3734 msgid "If you want to just view a file, use L<virt-cat(1)>."
3738 #: ../edit/virt-edit.pod:38
3740 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
3741 "USING GUESTFISH> below)."
3745 #: ../edit/virt-edit.pod:41
3747 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3748 "that and much more."
3752 #: ../edit/virt-edit.pod:46
3753 msgid "Edit the named files interactively:"
3757 #: ../edit/virt-edit.pod:48
3760 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3765 #: ../edit/virt-edit.pod:50
3768 " virt-edit -d mydomain /etc/passwd\n"
3773 #: ../edit/virt-edit.pod:52
3774 msgid "For Windows guests, some Windows paths are understood:"
3778 #: ../edit/virt-edit.pod:54
3781 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3786 #: ../edit/virt-edit.pod:56
3788 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
3789 "INTERACTIVE EDITING> below). To change the init default level to 5:"
3793 #: ../edit/virt-edit.pod:60
3796 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3801 #: ../edit/virt-edit.pod:81
3802 msgid "B<-b> extension"
3806 #: ../edit/virt-edit.pod:83
3807 msgid "B<--backup> extension"
3811 #: ../edit/virt-edit.pod:85
3813 "Create a backup of the original file I<in the guest disk image>. The backup "
3814 "has the original filename with C<extension> added."
3818 #: ../edit/virt-edit.pod:88
3820 "Usually the first character of C<extension> would be a dot C<.> so you would "
3825 #: ../edit/virt-edit.pod:91
3828 " virt-edit -b .orig [etc]\n"
3833 #: ../edit/virt-edit.pod:93
3834 msgid "By default, no backup file is made."
3838 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
3839 #: ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74
3840 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
3841 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
3846 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
3847 #: ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76
3848 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
3849 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
3850 msgid "B<--connect URI>"
3854 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
3855 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
3856 #: ../tools/virt-win-reg.pl:135
3858 "If you specify guest block devices directly, then libvirt is not used at all."
3862 #: ../edit/virt-edit.pod:114
3864 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3865 "off so you cannot see what you are typing. If you are not worried about "
3866 "Tempest attacks and there is no one else in the room you can specify this "
3867 "flag to see what you are typing."
3871 #: ../edit/virt-edit.pod:119
3876 #: ../edit/virt-edit.pod:121
3877 msgid "B<--expr> EXPR"
3881 #: ../edit/virt-edit.pod:123
3883 "Instead of launching the external editor, non-interactively apply the Perl "
3884 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3889 #: ../edit/virt-edit.pod:127
3891 "Be careful to properly quote the expression to prevent it from being altered "
3896 #: ../edit/virt-edit.pod:130
3897 msgid "Note that this option is only available when Perl 5 is installed."
3901 #: ../edit/virt-edit.pod:132
3902 msgid "B<--format> raw|qcow2|..."
3906 #: ../edit/virt-edit.pod:143
3909 " virt-edit --format=raw -a disk.img file\n"
3914 #: ../edit/virt-edit.pod:147
3917 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3922 #: ../edit/virt-edit.pod:181
3923 msgid "Previous versions of virt-edit allowed you to write either:"
3927 #: ../edit/virt-edit.pod:187
3930 " virt-edit guestname file\n"
3935 #: ../edit/virt-edit.pod:195
3936 msgid "NON-INTERACTIVE EDITING"
3940 #: ../edit/virt-edit.pod:197
3942 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3943 "administrator can interactively edit the file."
3947 #: ../edit/virt-edit.pod:200
3949 "There are two ways also to use C<virt-edit> from scripts in order to make "
3950 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3951 "like this, it's less error-prone to write scripts directly using the "
3952 "libguestfs API and Augeas for configuration file editing.)"
3956 #: ../edit/virt-edit.pod:206
3958 "The first method is to temporarily set C<$EDITOR> to any script or program "
3959 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3960 "update C<tmpfile> in place however it likes."
3964 #: ../edit/virt-edit.pod:210
3966 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3967 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3968 "instances of C<foo> with C<bar> in a file:"
3972 #: ../edit/virt-edit.pod:214
3975 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3980 #: ../edit/virt-edit.pod:216
3982 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3983 "For example to delete root's password you could do:"
3987 #: ../edit/virt-edit.pod:219
3990 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3995 #: ../edit/virt-edit.pod:221
3997 "What really happens is that the snippet is evaluated as a Perl expression "
3998 "for each line of the file. The line, including the final C<\\n>, is passed "
3999 "in C<$_> and the expression should update C<$_> or leave it unchanged."
4003 #: ../edit/virt-edit.pod:226
4005 "To delete a line, set C<$_> to the empty string. For example, to delete the "
4006 "C<apache> user account from the password file you can do:"
4010 #: ../edit/virt-edit.pod:229
4013 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
4018 #: ../edit/virt-edit.pod:231
4020 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4021 "the end of the file is rather difficult this way since there is no concept "
4022 "of \"last line of the file\" - your expression just doesn't get called "
4023 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4028 #: ../edit/virt-edit.pod:237
4030 "The variable C<$lineno> contains the current line number. As is "
4031 "traditional, the first line in the file is number C<1>."
4035 #: ../edit/virt-edit.pod:240
4037 "The return value from the expression is ignored, but the expression may call "
4038 "C<die> in order to abort the whole program, leaving the original file "
4043 #: ../edit/virt-edit.pod:244
4045 "Remember when matching the end of a line that C<$_> may contain the final C<"
4046 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4047 "newline then neither of these. Thus to match or substitute some text at the "
4048 "end of a line, use this regular expression:"
4052 #: ../edit/virt-edit.pod:249
4055 " /some text(\\r?\\n)?$/\n"
4060 #: ../edit/virt-edit.pod:251
4062 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
4063 "$_> itself (since that would remove all newlines from the file):"
4067 #: ../edit/virt-edit.pod:255
4070 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4075 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
4076 msgid "WINDOWS PATHS"
4080 #: ../edit/virt-edit.pod:259
4082 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4083 "paths (eg. C<E:\\foo\\bar.txt>)."
4087 #: ../edit/virt-edit.pod:262
4088 msgid "If and only if the guest is running Windows then:"
4092 #: ../edit/virt-edit.pod:268
4094 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
4095 "to the correct filesystem."
4099 #: ../edit/virt-edit.pod:273
4101 "Any backslash (C<\\>) characters in the path are replaced with forward "
4102 "slashes so that libguestfs can process it."
4106 #: ../edit/virt-edit.pod:278
4108 "The path is resolved case insensitively to locate the file that should be "
4113 #: ../edit/virt-edit.pod:283
4114 msgid "There are some known shortcomings:"
4118 #: ../edit/virt-edit.pod:289
4119 msgid "Some NTFS symbolic links may not be followed correctly."
4123 #: ../edit/virt-edit.pod:293
4124 msgid "NTFS junction points that cross filesystems are not followed."
4128 #: ../edit/virt-edit.pod:299
4130 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4131 "C<virt-edit> doesn't work."
4135 #: ../edit/virt-edit.pod:302
4136 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4140 #: ../edit/virt-edit.pod:304
4143 " guestfish --rw -i -d domname edit /file\n"
4148 #: ../edit/virt-edit.pod:306
4150 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4155 #: ../edit/virt-edit.pod:309
4157 "The command above uses libguestfs's guest inspection feature and so does not "
4158 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4159 "disk images that don't contain guests. To edit a file on a disk image "
4164 #: ../edit/virt-edit.pod:314
4167 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4172 #: ../edit/virt-edit.pod:316
4174 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4175 "the disk image to edit, and C</file> is the full path to the file."
4179 #: ../edit/virt-edit.pod:320
4181 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4182 "C<write> or C<upload> instead:"
4186 #: ../edit/virt-edit.pod:323
4189 " guestfish --rw -i -d domname touch /newfile\n"
4194 #: ../edit/virt-edit.pod:325
4197 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4202 #: ../edit/virt-edit.pod:327
4205 " guestfish --rw -i -d domname upload localfile /newfile\n"
4210 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1118
4211 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
4212 #: ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4213 msgid "ENVIRONMENT VARIABLES"
4217 #: ../edit/virt-edit.pod:333
4222 #: ../edit/virt-edit.pod:335
4224 "If set, this string is used as the editor. It may contain arguments, eg. C<"
4229 #: ../edit/virt-edit.pod:338
4230 msgid "If not set, C<vi> is used."
4234 #: ../edit/virt-edit.pod:356
4236 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
4237 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
4238 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4242 #: ../erlang/examples/guestfs-erlang.pod:5
4243 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4247 #: ../erlang/examples/guestfs-erlang.pod:9
4250 " {ok, G} = guestfs:create(),\n"
4251 " ok = guestfs:add_drive_opts(G, Disk,\n"
4252 " [{format, \"raw\"}, {readonly, true}]),\n"
4253 " ok = guestfs:launch(G),\n"
4254 " [Device] = guestfs:list_devices(G),\n"
4255 " ok = guestfs:close(G).\n"
4260 #: ../erlang/examples/guestfs-erlang.pod:18
4262 "This manual page documents how to call libguestfs from the Erlang "
4263 "programming language. This page just documents the differences from the C "
4264 "API and gives some examples. If you are not familiar with using libguestfs, "
4265 "you also need to read L<guestfs(3)>."
4269 #: ../erlang/examples/guestfs-erlang.pod:23
4270 msgid "OPENING AND CLOSING THE HANDLE"
4274 #: ../erlang/examples/guestfs-erlang.pod:25
4276 "The Erlang bindings are implemented using an external program called C<erl-"
4277 "guestfs>. This program must be on the current PATH, or else you should "
4278 "specify the full path to the program:"
4282 #: ../erlang/examples/guestfs-erlang.pod:29
4285 " {ok, G} = guestfs:create().\n"
4290 #: ../erlang/examples/guestfs-erlang.pod:31
4293 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4298 #: ../erlang/examples/guestfs-erlang.pod:33
4299 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4303 #: ../erlang/examples/guestfs-erlang.pod:36
4304 msgid "To close the handle:"
4308 #: ../erlang/examples/guestfs-erlang.pod:38
4311 " ok = guestfs:close(G).\n"
4316 #: ../erlang/examples/guestfs-erlang.pod:40
4317 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4321 #: ../erlang/examples/guestfs-erlang.pod:42
4323 "For functions that take optional arguments, the first arguments are the non-"
4324 "optional ones. The last argument is a list of tuples supplying the "
4325 "remaining optional arguments."
4329 #: ../erlang/examples/guestfs-erlang.pod:46
4332 " ok = guestfs:add_drive_opts(G, Disk,\n"
4333 " [{format, \"raw\"}, {readonly, true}]).\n"
4338 #: ../erlang/examples/guestfs-erlang.pod:49
4339 msgid "If the last argument would be an empty list, you can also omit it:"
4343 #: ../erlang/examples/guestfs-erlang.pod:51
4346 " ok = guestfs:add_drive_opts(G, Disk).\n"
4351 #: ../erlang/examples/guestfs-erlang.pod:53
4352 msgid "RETURN VALUES AND ERRORS"
4356 #: ../erlang/examples/guestfs-erlang.pod:55
4358 "On success, most functions return a C<Result> term (which could be a list, "
4359 "string, tuple etc.). If there is nothing for the function to return, then "
4360 "the atom C<ok> is returned."
4364 #: ../erlang/examples/guestfs-erlang.pod:59
4365 msgid "On error, you would see one of the following tuples:"
4369 #: ../erlang/examples/guestfs-erlang.pod:63
4370 msgid "C<{error, Msg, Errno}>"
4374 #: ../erlang/examples/guestfs-erlang.pod:65
4375 msgid "This indicates an ordinary error from the function."
4379 #: ../erlang/examples/guestfs-erlang.pod:67
4381 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4386 #: ../erlang/examples/guestfs-erlang.pod:70
4387 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4391 #: ../erlang/examples/guestfs-erlang.pod:72
4392 msgid "C<{unknown, Function}>"
4396 #: ../erlang/examples/guestfs-erlang.pod:74
4398 "This indicates that the function you called is not known. Generally this "
4399 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4400 "which you should not do."
4404 #: ../erlang/examples/guestfs-erlang.pod:78
4405 msgid "C<Function> is the name of the unknown function."
4409 #: ../erlang/examples/guestfs-erlang.pod:80
4410 msgid "C<{unknownarg, Arg}>"
4414 #: ../erlang/examples/guestfs-erlang.pod:82
4416 "This indicates that you called a function with optional arguments, with an "
4417 "unknown argument name."
4421 #: ../erlang/examples/guestfs-erlang.pod:85
4422 msgid "C<Arg> is the name of the unknown argument."
4426 #: ../erlang/examples/guestfs-erlang.pod:89
4427 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
4428 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
4429 #: ../python/examples/guestfs-python.pod:34
4430 #: ../ruby/examples/guestfs-ruby.pod:28
4431 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4435 #: ../erlang/examples/guestfs-erlang.pod:91
4436 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
4437 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
4438 #: ../python/examples/guestfs-python.pod:36
4439 #: ../ruby/examples/guestfs-ruby.pod:30
4444 #: ../erlang/examples/guestfs-erlang.pod:93
4445 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
4446 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
4447 #: ../python/examples/guestfs-python.pod:38
4448 #: ../ruby/examples/guestfs-ruby.pod:32
4449 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4453 #: ../erlang/examples/guestfs-erlang.pod:95
4454 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
4455 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
4456 #: ../python/examples/guestfs-python.pod:40
4457 #: ../ruby/examples/guestfs-ruby.pod:34
4462 #: ../erlang/examples/guestfs-erlang.pod:99
4464 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4465 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4466 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
4470 #: ../erlang/examples/guestfs-erlang.pod:110
4471 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
4472 #: ../fish/guestfish.pod:1295 ../fish/virt-copy-in.pod:60
4473 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
4474 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:319
4475 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
4476 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
4477 #: ../python/examples/guestfs-python.pod:54
4478 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333
4479 #: ../test-tool/libguestfs-test-tool.pod:106
4484 #: ../erlang/examples/guestfs-erlang.pod:112
4485 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
4486 #: ../fish/guestfish.pod:1297 ../fish/virt-copy-in.pod:62
4487 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
4488 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:321
4489 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
4490 #: ../perl/examples/guestfs-perl.pod:54
4491 #: ../python/examples/guestfs-python.pod:56
4492 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335
4493 #: ../test-tool/libguestfs-test-tool.pod:108
4494 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4498 #: ../erlang/examples/guestfs-erlang.pod:116
4499 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4500 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4504 #: ../erlang/examples/guestfs-erlang.pod:118
4505 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
4506 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
4507 #: ../perl/examples/guestfs-perl.pod:60
4508 #: ../python/examples/guestfs-python.pod:62
4509 #: ../ruby/examples/guestfs-ruby.pod:56
4511 "The examples in this manual page may be freely copied, modified and "
4512 "distributed without any restrictions."
4516 #: ../erlang/examples/guestfs-erlang.pod:121
4517 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
4518 #: ../java/examples/guestfs-java.pod:69
4519 #: ../ocaml/examples/guestfs-ocaml.pod:102
4520 #: ../perl/examples/guestfs-perl.pod:63
4521 #: ../python/examples/guestfs-python.pod:65
4522 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4524 "This library is free software; you can redistribute it and/or modify it "
4525 "under the terms of the GNU Lesser General Public License as published by the "
4526 "Free Software Foundation; either version 2 of the License, or (at your "
4527 "option) any later version."
4531 #: ../erlang/examples/guestfs-erlang.pod:126
4532 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
4533 #: ../java/examples/guestfs-java.pod:74
4534 #: ../ocaml/examples/guestfs-ocaml.pod:107
4535 #: ../perl/examples/guestfs-perl.pod:68
4536 #: ../python/examples/guestfs-python.pod:70
4537 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4539 "This library is distributed in the hope that it will be useful, but WITHOUT "
4540 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4541 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4546 #: ../erlang/examples/guestfs-erlang.pod:131
4547 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
4548 #: ../java/examples/guestfs-java.pod:79
4549 #: ../ocaml/examples/guestfs-ocaml.pod:112
4550 #: ../perl/examples/guestfs-perl.pod:73
4551 #: ../python/examples/guestfs-python.pod:75
4552 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4554 "You should have received a copy of the GNU Lesser General Public License "
4555 "along with this library; if not, write to the Free Software Foundation, "
4556 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4560 #: ../examples/guestfs-examples.pod:5
4561 msgid "guestfs-examples - Examples of using libguestfs from C"
4565 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4568 " #include <guestfs.h>\n"
4573 #: ../examples/guestfs-examples.pod:11
4576 " guestfs_h *g = guestfs_create ();\n"
4577 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4578 " guestfs_launch (g);\n"
4583 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4586 " cc prog.c -o prog -lguestfs\n"
4588 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4593 #: ../examples/guestfs-examples.pod:21
4595 "This manual page contains examples of calling libguestfs from the C "
4596 "programming language. If you are not familiar with using libguestfs, you "
4597 "also need to read L<guestfs(3)>."
4601 #: ../examples/guestfs-examples.pod:35
4603 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
4604 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
4605 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4609 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
4610 #: ../python/examples/guestfs-python.pod:60
4611 #: ../ruby/examples/guestfs-ruby.pod:54
4612 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4616 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4621 #: ../examples/guestfs-recipes.pod:5
4623 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4624 "here. The only way which works for both sorts of output is to just write "
4625 "the URL directly. Do NOT use L<...> for URLs."
4629 #: ../examples/guestfs-recipes.pod:9
4631 "We break with tradition here and don't use ALL CAPS for the section "
4632 "headings, as this makes them much easier to read."
4636 #: ../examples/guestfs-recipes.pod:16
4637 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4641 #: ../examples/guestfs-recipes.pod:20
4643 "This page contains recipes for and links to things you can do using "
4644 "libguestfs, L<guestfish(1)> and the virt tools."
4648 #: ../examples/guestfs-recipes.pod:23
4649 msgid "Audit a virtual machine for setuid files"
4653 #: ../examples/guestfs-recipes.pod:25
4655 "The link below contains a small program which can be used to audit a Linux "
4656 "virtual machine to see what setuid and setgid files it contains."
4660 #: ../examples/guestfs-recipes.pod:28
4662 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
4667 #: ../examples/guestfs-recipes.pod:30
4668 msgid "Change the background image in a Windows XP VM"
4672 #: ../examples/guestfs-recipes.pod:32
4674 "The links below explain how to use L<guestfish(1)> to change the background "
4675 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4676 "be substantially different for each version of Windows."
4680 #: ../examples/guestfs-recipes.pod:37
4682 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
4683 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4687 #: ../examples/guestfs-recipes.pod:40
4688 msgid "Cloning a virtual machine (Linux)"
4692 #: ../examples/guestfs-recipes.pod:42
4694 "The guestfish technique described in the link below works well for most "
4695 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4700 #: ../examples/guestfs-recipes.pod:46
4702 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
4707 #: ../examples/guestfs-recipes.pod:48
4709 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4714 #: ../examples/guestfs-recipes.pod:51
4715 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4719 #: ../examples/guestfs-recipes.pod:53
4720 msgid "Cloning a virtual machine (Windows)"
4724 #: ../examples/guestfs-recipes.pod:55
4726 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4727 "straightforward. Currently there is code in the Aeolus Oz project which "
4728 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4729 "we may add sysprepping ability."
4733 #: ../examples/guestfs-recipes.pod:60
4735 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
4736 "list/2011-May/msg00019.html"
4740 #: ../examples/guestfs-recipes.pod:63
4741 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4745 #: ../examples/guestfs-recipes.pod:65
4746 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4750 #: ../examples/guestfs-recipes.pod:67
4753 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4758 #: ../examples/guestfs-recipes.pod:69
4759 msgid "To export just a subdirectory, eg. C</files>, do:"
4763 #: ../examples/guestfs-recipes.pod:71
4766 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4771 #: ../examples/guestfs-recipes.pod:73
4772 msgid "Create empty disk images"
4776 #: ../examples/guestfs-recipes.pod:75
4778 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4779 "The useful guide below explains the options available."
4783 #: ../examples/guestfs-recipes.pod:78
4785 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
4790 #: ../examples/guestfs-recipes.pod:80
4791 msgid "Dump raw filesystem content from inside a disk image or VM"
4795 #: ../examples/guestfs-recipes.pod:82
4797 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4798 "filesystem content from any filesystem in a disk image or a VM (even one "
4799 "which is encrypted or buried inside an LV):"
4803 #: ../examples/guestfs-recipes.pod:86
4806 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4811 #: ../examples/guestfs-recipes.pod:88
4814 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4819 #: ../examples/guestfs-recipes.pod:90
4820 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4824 #: ../examples/guestfs-recipes.pod:92
4825 msgid "Edit grub configuration in a VM"
4829 #: ../examples/guestfs-recipes.pod:94
4830 msgid "You can use this to:"
4834 #: ../examples/guestfs-recipes.pod:100
4835 msgid "Fix a virtual machine that does not boot."
4839 #: ../examples/guestfs-recipes.pod:104
4840 msgid "Change which kernel is used to boot the VM."
4844 #: ../examples/guestfs-recipes.pod:108
4845 msgid "Change kernel command line options."
4849 #: ../examples/guestfs-recipes.pod:112
4850 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4854 #: ../examples/guestfs-recipes.pod:114
4857 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4862 #: ../examples/guestfs-recipes.pod:116
4864 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4869 #: ../examples/guestfs-recipes.pod:119
4872 " virt-rescue -d BrokenGuest\n"
4877 #: ../examples/guestfs-recipes.pod:121
4878 msgid "Export any directory from a VM"
4882 #: ../examples/guestfs-recipes.pod:123
4884 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4888 #: ../examples/guestfs-recipes.pod:126
4891 " virt-copy-out -d Guest /home .\n"
4896 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
4897 #: ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592
4898 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:18
4899 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2457
4900 #: ../src/guestfs-actions.pod:3008 ../src/guestfs.pod:1670
4901 #: ../tools/virt-win-reg.pl:706
4906 #: ../examples/guestfs-recipes.pod:134
4908 "The final dot of the command is not a printing error. It means we want to "
4909 "copy out to the current directory."
4913 #: ../examples/guestfs-recipes.pod:139
4914 msgid "This creates a directory called C<home> under the current directory."
4918 #: ../examples/guestfs-recipes.pod:143
4920 "If the guest is a Windows guest then you can use drive letters and "
4921 "backslashes, but you must prefix the path with C<win:> and quote it to "
4922 "protect it from the shell, like this:"
4926 #: ../examples/guestfs-recipes.pod:147
4929 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4934 #: ../examples/guestfs-recipes.pod:149
4935 msgid "To get the output as a compressed tarball, do:"
4939 #: ../examples/guestfs-recipes.pod:151
4942 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4947 #: ../examples/guestfs-recipes.pod:153
4949 "Although it sounds tempting, this is usually not a reliable way to get a "
4950 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
4951 "org/FAQ.html#backup"
4955 #: ../examples/guestfs-recipes.pod:157
4956 msgid "Find out which user is using the most space"
4960 #: ../examples/guestfs-recipes.pod:159
4962 "This simple script examines a Linux guest to find out which user is using "
4963 "the most space in their home directory:"
4967 #: ../examples/guestfs-recipes.pod:162
4975 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4983 #: ../examples/guestfs-recipes.pod:166
4992 #: ../examples/guestfs-recipes.pod:169
4995 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
5000 #: ../examples/guestfs-recipes.pod:171
5003 " for d in $(guestfish --remote ls \"$dir\"); do\n"
5004 " echo -n \"$dir/$d\"\n"
5006 " guestfish --remote du \"$dir/$d\";\n"
5007 " done | sort -nr -k 2\n"
5012 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
5015 " guestfish --remote exit\n"
5020 #: ../examples/guestfs-recipes.pod:179
5021 msgid "Get DHCP address from a VM"
5025 #: ../examples/guestfs-recipes.pod:181
5027 "The link below explains the many different possible techniques for getting "
5028 "the last assigned DHCP address of a virtual machine."
5032 #: ../examples/guestfs-recipes.pod:184
5034 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
5035 "a-virtual-machine-disk-image/#content"
5039 #: ../examples/guestfs-recipes.pod:186
5041 "In the libguestfs source examples directory you will find the latest version "
5042 "of the C<virt-dhcp-address.c> program."
5046 #: ../examples/guestfs-recipes.pod:189
5047 msgid "Get the operating system product name string"
5051 #: ../examples/guestfs-recipes.pod:191
5052 msgid "Save the following script into a file called C<product-name.sh>:"
5056 #: ../examples/guestfs-recipes.pod:193
5061 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5062 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5063 " guestfish --remote inspect-get-product-name \"$root\"\n"
5064 " guestfish --remote exit\n"
5069 #: ../examples/guestfs-recipes.pod:200
5070 msgid "Make the script executable and run it on a named guest:"
5074 #: ../examples/guestfs-recipes.pod:202
5077 " # product-name.sh RHEL60x64\n"
5078 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
5083 #: ../examples/guestfs-recipes.pod:205
5085 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
5086 "C<xpath> command line tool or from your favourite programming language:"
5090 #: ../examples/guestfs-recipes.pod:209
5093 " # virt-inspector RHEL60x64 > xml\n"
5094 " # xpath '//product_name' < xml\n"
5097 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
5102 #: ../examples/guestfs-recipes.pod:215
5103 msgid "Get the default boot kernel for a Linux VM"
5107 #: ../examples/guestfs-recipes.pod:217
5109 "The link below contains a program to print the default boot kernel for a "
5114 #: ../examples/guestfs-recipes.pod:220
5116 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
5117 "kernel-for-a-vm/#content"
5121 #: ../examples/guestfs-recipes.pod:222
5123 "It uses Augeas, and the technique is generally applicable for many different "
5128 #: ../examples/guestfs-recipes.pod:229
5129 msgid "listing the user accounts in the guest"
5133 #: ../examples/guestfs-recipes.pod:233
5134 msgid "what repositories is it configured to use"
5138 #: ../examples/guestfs-recipes.pod:237
5139 msgid "what NTP servers does it connect to"
5143 #: ../examples/guestfs-recipes.pod:241
5144 msgid "what were the boot messages last time it booted"
5148 #: ../examples/guestfs-recipes.pod:245
5149 msgid "listing who was logged in recently"
5153 #: ../examples/guestfs-recipes.pod:249
5154 msgid "http://augeas.net/"
5158 #: ../examples/guestfs-recipes.pod:251
5159 msgid "Install RPMs in a guest"
5163 #: ../examples/guestfs-recipes.pod:253
5165 "The link below contains a method to install RPMs in a guest. In fact the "
5166 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5167 "installs them next time the guest is booted. You could use this technique "
5168 "to install vital security updates in an offline guest."
5172 #: ../examples/guestfs-recipes.pod:259
5174 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5178 #: ../examples/guestfs-recipes.pod:261
5179 msgid "List applications installed in a VM"
5183 #: ../examples/guestfs-recipes.pod:263
5184 msgid "Save the following to a file C<list-apps.sh>:"
5188 #: ../examples/guestfs-recipes.pod:265
5193 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5194 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5195 " guestfish --remote inspect-list-applications \"$root\"\n"
5196 " guestfish --remote exit\n"
5201 #: ../examples/guestfs-recipes.pod:272
5203 "Make the file executable and then you can run it on any named virtual "
5208 #: ../examples/guestfs-recipes.pod:275
5211 " # list-apps.sh WinGuest\n"
5213 " app_name: Mozilla Firefox (3.6.12)\n"
5214 " app_display_name: Mozilla Firefox (3.6.12)\n"
5216 " app_version: 3.6.12 (en-GB)\n"
5218 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5219 " app_trans_path:\n"
5220 " app_publisher: Mozilla\n"
5221 " app_url: http://www.mozilla.com/en-GB/\n"
5222 " app_source_package:\n"
5224 " app_description: Mozilla Firefox\n"
5227 " app_name: VLC media player\n"
5228 " app_display_name: VLC media player 1.1.5\n"
5230 " app_version: 1.1.5\n"
5232 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5233 " app_trans_path:\n"
5234 " app_publisher: VideoLAN\n"
5235 " app_url: http://www.videolan.org/\n"
5236 " app_source_package:\n"
5238 " app_description:\n"
5244 #: ../examples/guestfs-recipes.pod:305
5246 "If you want to run the script on disk images (instead of libvirt virtual "
5247 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
5252 #: ../examples/guestfs-recipes.pod:309
5253 msgid "List files and directories in a VM"
5257 #: ../examples/guestfs-recipes.pod:311
5258 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5262 #: ../examples/guestfs-recipes.pod:313
5265 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5270 #: ../examples/guestfs-recipes.pod:315
5271 msgid "List services in a Windows VM"
5275 #: ../examples/guestfs-recipes.pod:317
5277 "The link below contains a script that can be used to list out the services "
5278 "from a Windows VM, and whether those services run at boot time or are loaded "
5283 #: ../examples/guestfs-recipes.pod:321
5285 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
5290 #: ../examples/guestfs-recipes.pod:323
5291 msgid "Make a disk image sparse"
5295 #: ../examples/guestfs-recipes.pod:325
5297 "The link below contains some guides for making a disk image sparse (or "
5298 "reintroducing sparseness)."
5302 #: ../examples/guestfs-recipes.pod:328
5304 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5308 #: ../examples/guestfs-recipes.pod:330
5309 msgid "Monitor disk usage over time"
5313 #: ../examples/guestfs-recipes.pod:332
5315 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5316 "The link below contains a guide."
5320 #: ../examples/guestfs-recipes.pod:335
5321 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5325 #: ../examples/guestfs-recipes.pod:337
5326 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5330 #: ../examples/guestfs-recipes.pod:339
5332 "L<guestfish(1)> plus the tools described in the link below can be used to "
5333 "read out the Windows Event Log from any virtual machine running Windows "
5334 "Vista or a later version."
5338 #: ../examples/guestfs-recipes.pod:343
5340 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
5341 "guestfish/#content"
5345 #: ../examples/guestfs-recipes.pod:345
5346 msgid "Remove root password (Linux)"
5350 #: ../examples/guestfs-recipes.pod:347
5352 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5353 "files. One use is to remove the root password from a Linux guest:"
5357 #: ../examples/guestfs-recipes.pod:350
5360 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5365 #: ../examples/guestfs-recipes.pod:352
5366 msgid "Remove Administrator password (Windows)"
5370 #: ../examples/guestfs-recipes.pod:354
5372 "The link below contains one technique for removing the Administrator "
5373 "password from a Windows VM, or to be more precise, it gives you a command "
5374 "prompt the next time you log in which you can use to bypass any security:"
5378 #: ../examples/guestfs-recipes.pod:359
5380 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
5381 "administrator-password-with-guestfish/"
5385 #: ../examples/guestfs-recipes.pod:361
5386 msgid "Unpack a live CD"
5390 #: ../examples/guestfs-recipes.pod:363
5392 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5393 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5394 "layers, as outlined in the guide below."
5398 #: ../examples/guestfs-recipes.pod:367
5400 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
5405 #: ../examples/guestfs-recipes.pod:369
5406 msgid "Uploading and downloading files"
5410 #: ../examples/guestfs-recipes.pod:371
5412 "The link below contains general tips on uploading (copying in) and "
5413 "downloading (copying out) files from VMs."
5417 #: ../examples/guestfs-recipes.pod:374
5419 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5423 #: ../examples/guestfs-recipes.pod:376
5424 msgid "Use libguestfs tools on VMware ESX guests"
5428 #: ../examples/guestfs-recipes.pod:378
5430 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5431 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5435 #: ../examples/guestfs-recipes.pod:382
5437 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
5442 #: ../examples/guestfs-recipes.pod:386
5444 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
5445 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
5446 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
5450 #: ../examples/guestfs-recipes.pod:403
5451 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5455 #: ../fish/guestfish-actions.pod:1
5460 #: ../fish/guestfish-actions.pod:3
5463 " add-cdrom filename\n"
5468 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5469 msgid "This function adds a virtual CD-ROM disk image to the guest."
5473 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5474 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5478 #: ../fish/guestfish-actions.pod:15
5480 "This call checks for the existence of C<filename>. This stops you from "
5481 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5482 "and C<http:> URLs. To specify those, use the general L</config> call "
5487 #: ../fish/guestfish-actions.pod:22
5489 "If you just want to add an ISO file (often you use this as an efficient way "
5490 "to transfer large files into the guest), then you should probably use L</add-"
5491 "drive-ro> instead."
5495 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
5496 #: ../fish/guestfish-actions.pod:177
5498 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5503 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
5504 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:1026
5505 #: ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:1400
5506 #: ../fish/guestfish-actions.pod:3157 ../fish/guestfish-actions.pod:3468
5507 #: ../fish/guestfish-actions.pod:3516 ../fish/guestfish-actions.pod:4429
5508 #: ../fish/guestfish-actions.pod:4452 ../fish/guestfish-actions.pod:4474
5509 #: ../fish/guestfish-actions.pod:4512 ../fish/guestfish-actions.pod:5161
5510 #: ../fish/guestfish-actions.pod:5267 ../src/guestfs-actions.pod:10
5511 #: ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273
5512 #: ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:2118
5513 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:4771
5514 #: ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5393
5515 #: ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6719
5516 #: ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6816
5517 #: ../src/guestfs-actions.pod:7748 ../src/guestfs-actions.pod:7857
5518 #: ../src/guestfs-actions.pod:8040
5520 "Deprecated functions will not be removed from the API, but the fact that "
5521 "they are deprecated indicates that there are problems with correct use of "
5526 #: ../fish/guestfish-actions.pod:35
5531 #: ../fish/guestfish-actions.pod:37
5536 #: ../fish/guestfish-actions.pod:39
5539 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
5544 #: ../fish/guestfish-actions.pod:41
5546 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5547 "It works by connecting to libvirt, requesting the domain and domain XML from "
5548 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5552 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5554 "The number of disks added is returned. This operation is atomic: if an "
5555 "error is returned, then no disks are added."
5559 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5561 "This function does some minimal checks to make sure the libvirt domain is "
5562 "not running (unless C<readonly> is true). In a future version we will try "
5563 "to acquire the libvirt lock on each disk."
5567 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5569 "Disks must be accessible locally. This often means that adding disks from a "
5570 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5571 "unless those disks are accessible via the same device path locally too."
5575 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5577 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
5578 "libvirt.org/uri.html>). If this is not set then we connect to the default "
5579 "libvirt URI (or one set through an environment variable, see the libvirt "
5580 "documentation for full details)."
5584 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5586 "The optional C<live> flag controls whether this call will try to connect to "
5587 "a running virtual machine C<guestfsd> process if it sees a suitable "
5588 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5589 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5590 "DAEMONS> for more information."
5594 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5596 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5597 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5598 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5603 #: ../fish/guestfish-actions.pod:76
5605 "The other optional parameters are passed directly through to L</add-drive-"
5610 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
5611 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:784
5612 #: ../fish/guestfish-actions.pod:805 ../fish/guestfish-actions.pod:2040
5613 #: ../fish/guestfish-actions.pod:3206 ../fish/guestfish-actions.pod:3369
5614 #: ../fish/guestfish-actions.pod:3504
5616 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
5620 #: ../fish/guestfish-actions.pod:81
5625 #: ../fish/guestfish-actions.pod:83
5628 " add-drive filename\n"
5633 #: ../fish/guestfish-actions.pod:85
5635 "This function is the equivalent of calling L</add-drive-opts> with no "
5636 "optional parameters, so the disk is added writable, with the format being "
5637 "detected automatically."
5641 #: ../fish/guestfish-actions.pod:89
5643 "Automatic detection of the format opens you up to a potential security hole "
5644 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5645 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5646 "you should think about replacing calls to this function with calls to L</add-"
5647 "drive-opts>, and specifying the format."
5651 #: ../fish/guestfish-actions.pod:96
5652 msgid "add-drive-opts"
5656 #: ../fish/guestfish-actions.pod:98
5661 #: ../fish/guestfish-actions.pod:100
5664 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
5669 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
5671 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5672 "The first time you call this function, the disk appears as C</dev/sda>, the "
5673 "second time as C</dev/sdb>, and so on."
5677 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
5679 "You don't necessarily need to be root when using libguestfs. However you "
5680 "obviously do need sufficient permissions to access the filename for whatever "
5681 "operations you want to perform (ie. read access if you just want to read the "
5682 "image or write access if you want to modify the image)."
5686 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
5687 msgid "This call checks that C<filename> exists."
5691 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3168
5692 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4808
5693 msgid "The optional arguments are:"
5697 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
5702 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
5704 "If true then the image is treated as read-only. Writes are still allowed, "
5705 "but they are stored in a temporary snapshot overlay which is discarded at "
5706 "the end. The disk that you add is not modified."
5710 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
5715 #: ../fish/guestfish-actions.pod:127
5717 "This forces the image format. If you omit this (or use L</add-drive> or L</"
5718 "add-drive-ro>) then the format is automatically detected. Possible formats "
5719 "include C<raw> and C<qcow2>."
5723 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
5725 "Automatic detection of the format opens you up to a potential security hole "
5726 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5727 "RHBZ#642934. Specifying the format closes this security hole."
5731 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
5736 #: ../fish/guestfish-actions.pod:138
5738 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
5739 "add-drive-with-if> call (q.v.)"
5743 #: ../fish/guestfish-actions.pod:145
5744 msgid "add-drive-ro"
5748 #: ../fish/guestfish-actions.pod:147
5753 #: ../fish/guestfish-actions.pod:149
5756 " add-drive-ro filename\n"
5761 #: ../fish/guestfish-actions.pod:151
5763 "This function is the equivalent of calling L</add-drive-opts> with the "
5764 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5765 "is added read-only, with the format being detected automatically."
5769 #: ../fish/guestfish-actions.pod:156
5770 msgid "add-drive-ro-with-if"
5774 #: ../fish/guestfish-actions.pod:158
5777 " add-drive-ro-with-if filename iface\n"
5782 #: ../fish/guestfish-actions.pod:160
5784 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5785 "interface emulation to use at run time."
5789 #: ../fish/guestfish-actions.pod:170
5790 msgid "add-drive-with-if"
5794 #: ../fish/guestfish-actions.pod:172
5797 " add-drive-with-if filename iface\n"
5802 #: ../fish/guestfish-actions.pod:174
5804 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5805 "interface emulation to use at run time."
5809 #: ../fish/guestfish-actions.pod:184
5814 #: ../fish/guestfish-actions.pod:186
5817 " aug-clear augpath\n"
5822 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
5824 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5825 "L<augtool(1)> C<clear> command."
5829 #: ../fish/guestfish-actions.pod:191
5834 #: ../fish/guestfish-actions.pod:193
5842 #: ../fish/guestfish-actions.pod:195
5844 "Close the current Augeas handle and free up any resources used by it. After "
5845 "calling this, you have to call L</aug-init> again before you can use any "
5846 "other Augeas functions."
5850 #: ../fish/guestfish-actions.pod:200
5855 #: ../fish/guestfish-actions.pod:202
5858 " aug-defnode name expr val\n"
5863 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
5865 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5869 #: ../fish/guestfish-actions.pod:207
5871 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5872 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5873 "containing that single node."
5877 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
5879 "On success this returns a pair containing the number of nodes in the "
5880 "nodeset, and a boolean flag if a node was created."
5884 #: ../fish/guestfish-actions.pod:215
5889 #: ../fish/guestfish-actions.pod:217
5892 " aug-defvar name expr\n"
5897 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
5899 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5900 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5904 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
5906 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5907 "evaluates to something which is not a nodeset."
5911 #: ../fish/guestfish-actions.pod:226
5916 #: ../fish/guestfish-actions.pod:228
5919 " aug-get augpath\n"
5924 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
5926 "Look up the value associated with C<path>. If C<path> matches exactly one "
5927 "node, the C<value> is returned."
5931 #: ../fish/guestfish-actions.pod:233
5936 #: ../fish/guestfish-actions.pod:235
5939 " aug-init root flags\n"
5944 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
5946 "Create a new Augeas handle for editing configuration files. If there was "
5947 "any previous Augeas handle associated with this guestfs session, then it is "
5952 #: ../fish/guestfish-actions.pod:241
5953 msgid "You must call this before using any other L</aug-*> commands."
5957 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
5959 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5963 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
5965 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5966 "logical I<or> of the following integers:"
5970 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
5971 msgid "C<AUG_SAVE_BACKUP> = 1"
5975 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
5976 msgid "Keep the original file with a C<.augsave> extension."
5980 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
5981 msgid "C<AUG_SAVE_NEWFILE> = 2"
5985 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
5987 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5988 "original. Overrides C<AUG_SAVE_BACKUP>."
5992 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
5993 msgid "C<AUG_TYPE_CHECK> = 4"
5997 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
5998 msgid "Typecheck lenses."
6002 #: ../fish/guestfish-actions.pod:266
6004 "This option is only useful when debugging Augeas lenses. Use of this option "
6005 "may require additional memory for the libguestfs appliance. You may need to "
6006 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6010 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
6011 msgid "C<AUG_NO_STDINC> = 8"
6015 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
6016 msgid "Do not use standard load path for modules."
6020 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
6021 msgid "C<AUG_SAVE_NOOP> = 16"
6025 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
6026 msgid "Make save a no-op, just record what would have been changed."
6030 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
6031 msgid "C<AUG_NO_LOAD> = 32"
6035 #: ../fish/guestfish-actions.pod:281
6036 msgid "Do not load the tree in L</aug-init>."
6040 #: ../fish/guestfish-actions.pod:285
6041 msgid "To close the handle, you can call L</aug-close>."
6045 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
6046 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6050 #: ../fish/guestfish-actions.pod:289
6055 #: ../fish/guestfish-actions.pod:291
6058 " aug-insert augpath label true|false\n"
6063 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
6065 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6066 "or after C<path> (depending on the boolean flag C<before>)."
6070 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
6072 "C<path> must match exactly one existing node in the tree, and C<label> must "
6073 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6077 #: ../fish/guestfish-actions.pod:301
6082 #: ../fish/guestfish-actions.pod:303
6090 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
6091 msgid "Load files into the tree."
6095 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
6096 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6100 #: ../fish/guestfish-actions.pod:310
6105 #: ../fish/guestfish-actions.pod:312
6113 #: ../fish/guestfish-actions.pod:314
6115 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6116 "resulting nodes into alphabetical order."
6120 #: ../fish/guestfish-actions.pod:317
6125 #: ../fish/guestfish-actions.pod:319
6128 " aug-match augpath\n"
6133 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
6135 "Returns a list of paths which match the path expression C<path>. The "
6136 "returned paths are sufficiently qualified so that they match exactly one "
6137 "node in the current tree."
6141 #: ../fish/guestfish-actions.pod:325
6146 #: ../fish/guestfish-actions.pod:327
6149 " aug-mv src dest\n"
6154 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
6156 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6157 "C<dest> is overwritten if it exists."
6161 #: ../fish/guestfish-actions.pod:332
6166 #: ../fish/guestfish-actions.pod:334
6174 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
6175 msgid "Remove C<path> and all of its children."
6179 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
6180 msgid "On success this returns the number of entries which were removed."
6184 #: ../fish/guestfish-actions.pod:340
6189 #: ../fish/guestfish-actions.pod:342
6197 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
6198 msgid "This writes all pending changes to disk."
6202 #: ../fish/guestfish-actions.pod:346
6204 "The flags which were passed to L</aug-init> affect exactly how files are "
6209 #: ../fish/guestfish-actions.pod:349
6214 #: ../fish/guestfish-actions.pod:351
6217 " aug-set augpath val\n"
6222 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
6223 msgid "Set the value associated with C<path> to C<val>."
6227 #: ../fish/guestfish-actions.pod:355
6229 "In the Augeas API, it is possible to clear a node by setting the value to "
6230 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6231 "this call. Instead you must use the L</aug-clear> call."
6235 #: ../fish/guestfish-actions.pod:360
6240 #: ../fish/guestfish-actions.pod:362
6243 " available 'groups ...'\n"
6248 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
6250 "This command is used to check the availability of some groups of "
6251 "functionality in the appliance, which not all builds of the libguestfs "
6252 "appliance will be able to provide."
6256 #: ../fish/guestfish-actions.pod:368
6258 "The libguestfs groups, and the functions that those groups correspond to, "
6259 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6260 "runtime by calling L</available-all-groups>."
6264 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
6266 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
6267 "\"]> would check for the availability of the Linux inotify functions and "
6268 "Augeas (configuration file editing) functions."
6272 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
6273 msgid "The command returns no error if I<all> requested groups are available."
6277 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
6279 "It fails with an error if one or more of the requested groups is unavailable "
6284 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
6286 "If an unknown group name is included in the list of groups then an error is "
6291 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
6296 #: ../fish/guestfish-actions.pod:392
6297 msgid "You must call L</launch> before calling this function."
6301 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
6303 "The reason is because we don't know what groups are supported by the "
6304 "appliance/daemon until it is running and can be queried."
6308 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
6310 "If a group of functions is available, this does not necessarily mean that "
6311 "they will work. You still have to check for errors when calling individual "
6312 "API functions even if they are available."
6316 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
6318 "It is usually the job of distro packagers to build complete functionality "
6319 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6320 "with all requirements satisfied, will support everything."
6324 #: ../fish/guestfish-actions.pod:414
6326 "This call was added in version C<1.0.80>. In previous versions of "
6327 "libguestfs all you could do would be to speculatively execute a command to "
6328 "find out if the daemon implemented it. See also L</version>."
6332 #: ../fish/guestfish-actions.pod:421
6333 msgid "available-all-groups"
6337 #: ../fish/guestfish-actions.pod:423
6340 " available-all-groups\n"
6345 #: ../fish/guestfish-actions.pod:425
6347 "This command returns a list of all optional groups that this daemon knows "
6348 "about. Note this returns both supported and unsupported groups. To find "
6349 "out which ones the daemon can actually support you have to call L</"
6350 "available> on each member of the returned list."
6354 #: ../fish/guestfish-actions.pod:431
6355 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6359 #: ../fish/guestfish-actions.pod:433
6364 #: ../fish/guestfish-actions.pod:435
6367 " base64-in (base64file|-) filename\n"
6372 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
6374 "This command uploads base64-encoded data from C<base64file> to C<filename>."
6378 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449
6379 #: ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:782
6380 #: ../fish/guestfish-actions.pod:803 ../fish/guestfish-actions.pod:902
6381 #: ../fish/guestfish-actions.pod:921 ../fish/guestfish-actions.pod:1295
6382 #: ../fish/guestfish-actions.pod:4732 ../fish/guestfish-actions.pod:4744
6383 #: ../fish/guestfish-actions.pod:4755 ../fish/guestfish-actions.pod:4766
6384 #: ../fish/guestfish-actions.pod:4818 ../fish/guestfish-actions.pod:4827
6385 #: ../fish/guestfish-actions.pod:4881 ../fish/guestfish-actions.pod:4904
6386 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6390 #: ../fish/guestfish-actions.pod:442
6395 #: ../fish/guestfish-actions.pod:444
6398 " base64-out filename (base64file|-)\n"
6403 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
6405 "This command downloads the contents of C<filename>, writing it out to local "
6406 "file C<base64file> encoded as base64."
6410 #: ../fish/guestfish-actions.pod:451
6411 msgid "blockdev-flushbufs"
6415 #: ../fish/guestfish-actions.pod:453
6418 " blockdev-flushbufs device\n"
6423 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
6425 "This tells the kernel to flush internal buffers associated with C<device>."
6429 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469
6430 #: ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488
6431 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513
6432 #: ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532
6433 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548
6434 #: ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696
6435 #: ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727
6436 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764
6437 #: ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796
6438 #: ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
6439 msgid "This uses the L<blockdev(8)> command."
6443 #: ../fish/guestfish-actions.pod:460
6444 msgid "blockdev-getbsz"
6448 #: ../fish/guestfish-actions.pod:462
6451 " blockdev-getbsz device\n"
6456 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
6457 msgid "This returns the block size of a device."
6461 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529
6462 #: ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
6464 "(Note this is different from both I<size in blocks> and I<filesystem block "
6469 #: ../fish/guestfish-actions.pod:471
6470 msgid "blockdev-getro"
6474 #: ../fish/guestfish-actions.pod:473
6477 " blockdev-getro device\n"
6482 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
6484 "Returns a boolean indicating if the block device is read-only (true if read-"
6485 "only, false if not)."
6489 #: ../fish/guestfish-actions.pod:480
6490 msgid "blockdev-getsize64"
6494 #: ../fish/guestfish-actions.pod:482
6497 " blockdev-getsize64 device\n"
6502 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
6503 msgid "This returns the size of the device in bytes."
6507 #: ../fish/guestfish-actions.pod:486
6508 msgid "See also L</blockdev-getsz>."
6512 #: ../fish/guestfish-actions.pod:490
6513 msgid "blockdev-getss"
6517 #: ../fish/guestfish-actions.pod:492
6520 " blockdev-getss device\n"
6525 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
6527 "This returns the size of sectors on a block device. Usually 512, but can be "
6528 "larger for modern devices."
6532 #: ../fish/guestfish-actions.pod:497
6534 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6538 #: ../fish/guestfish-actions.pod:502
6539 msgid "blockdev-getsz"
6543 #: ../fish/guestfish-actions.pod:504
6546 " blockdev-getsz device\n"
6551 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
6553 "This returns the size of the device in units of 512-byte sectors (even if "
6554 "the sectorsize isn't 512 bytes ... weird)."
6558 #: ../fish/guestfish-actions.pod:509
6560 "See also L</blockdev-getss> for the real sector size of the device, and L</"
6561 "blockdev-getsize64> for the more useful I<size in bytes>."
6565 #: ../fish/guestfish-actions.pod:515
6566 msgid "blockdev-rereadpt"
6570 #: ../fish/guestfish-actions.pod:517
6573 " blockdev-rereadpt device\n"
6578 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
6579 msgid "Reread the partition table on C<device>."
6583 #: ../fish/guestfish-actions.pod:523
6584 msgid "blockdev-setbsz"
6588 #: ../fish/guestfish-actions.pod:525
6591 " blockdev-setbsz device blocksize\n"
6596 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
6597 msgid "This sets the block size of a device."
6601 #: ../fish/guestfish-actions.pod:534
6602 msgid "blockdev-setro"
6606 #: ../fish/guestfish-actions.pod:536
6609 " blockdev-setro device\n"
6614 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
6615 msgid "Sets the block device named C<device> to read-only."
6619 #: ../fish/guestfish-actions.pod:542
6620 msgid "blockdev-setrw"
6624 #: ../fish/guestfish-actions.pod:544
6627 " blockdev-setrw device\n"
6632 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
6633 msgid "Sets the block device named C<device> to read-write."
6637 #: ../fish/guestfish-actions.pod:550
6638 msgid "btrfs-filesystem-resize"
6642 #: ../fish/guestfish-actions.pod:552
6645 " btrfs-filesystem-resize mountpoint [size:..]\n"
6650 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
6651 msgid "This command resizes a btrfs filesystem."
6655 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
6657 "Note that unlike other resize calls, the filesystem has to be mounted and "
6658 "the parameter is the mountpoint not the device (this is a requirement of "
6663 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3479
6664 #: ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5332
6665 msgid "The optional parameters are:"
6669 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3483
6670 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5336
6675 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
6677 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6678 "resized to the maximum size."
6682 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
6683 msgid "See also L<btrfs(8)>."
6687 #: ../fish/guestfish-actions.pod:575
6688 msgid "case-sensitive-path"
6692 #: ../fish/guestfish-actions.pod:577
6695 " case-sensitive-path path\n"
6700 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
6702 "This can be used to resolve case insensitive paths on a filesystem which is "
6703 "case sensitive. The use case is to resolve paths which you have read from "
6704 "Windows configuration files or the Windows Registry, to the true path."
6708 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
6710 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6711 "(and probably others), which is that although the underlying filesystem is "
6712 "case-insensitive, the driver exports the filesystem to Linux as case-"
6717 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
6719 "One consequence of this is that special directories such as C<c:\\windows> "
6720 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6721 "precise details of how they were created. In Windows itself this would not "
6726 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
6728 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
6733 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
6735 "This function resolves the true case of each element in the path and returns "
6736 "the case-sensitive path."
6740 #: ../fish/guestfish-actions.pod:601
6742 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
6743 "WINDOWS/system32\"> (the exact return value would depend on details of how "
6744 "the directories were originally created under Windows)."
6748 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
6749 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6753 #: ../fish/guestfish-actions.pod:609
6754 msgid "See also L</realpath>."
6758 #: ../fish/guestfish-actions.pod:611
6763 #: ../fish/guestfish-actions.pod:613
6771 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3899
6772 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5975
6773 msgid "Return the contents of the file named C<path>."
6777 #: ../fish/guestfish-actions.pod:617
6779 "Note that this function cannot correctly handle binary files (specifically, "
6780 "files containing C<\\0> character which is treated as end of string). For "
6781 "those you need to use the L</read-file> or L</download> functions which have "
6782 "a more complex interface."
6786 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757
6787 #: ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:980
6788 #: ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1057
6789 #: ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1259
6790 #: ../fish/guestfish-actions.pod:1572 ../fish/guestfish-actions.pod:1582
6791 #: ../fish/guestfish-actions.pod:1632 ../fish/guestfish-actions.pod:1647
6792 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1676
6793 #: ../fish/guestfish-actions.pod:3769 ../fish/guestfish-actions.pod:3784
6794 #: ../fish/guestfish-actions.pod:3860 ../fish/guestfish-actions.pod:3877
6795 #: ../fish/guestfish-actions.pod:3892 ../fish/guestfish-actions.pod:4573
6796 #: ../fish/guestfish-actions.pod:4619 ../fish/guestfish-actions.pod:4704
6797 #: ../fish/guestfish-actions.pod:4719 ../fish/guestfish-actions.pod:5125
6798 #: ../fish/guestfish-actions.pod:5137 ../fish/guestfish-actions.pod:5155
6799 #: ../fish/guestfish-actions.pod:5172 ../fish/guestfish-actions.pod:5182
6800 #: ../fish/guestfish-actions.pod:5239 ../fish/guestfish-actions.pod:5249
6801 #: ../fish/guestfish-actions.pod:5278 ../fish/guestfish-actions.pod:5288
6802 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127
6803 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1554
6804 #: ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:1676
6805 #: ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1941
6806 #: ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2442
6807 #: ../src/guestfs-actions.pod:2507 ../src/guestfs-actions.pod:2531
6808 #: ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2577
6809 #: ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5783
6810 #: ../src/guestfs-actions.pod:5914 ../src/guestfs-actions.pod:5940
6811 #: ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6931
6812 #: ../src/guestfs-actions.pod:6986 ../src/guestfs-actions.pod:7132
6813 #: ../src/guestfs-actions.pod:7156 ../src/guestfs-actions.pod:7821
6814 #: ../src/guestfs-actions.pod:7841 ../src/guestfs-actions.pod:7874
6815 #: ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912
6816 #: ../src/guestfs-actions.pod:8006 ../src/guestfs-actions.pod:8025
6817 #: ../src/guestfs-actions.pod:8071 ../src/guestfs-actions.pod:8090
6819 "Because of the message protocol, there is a transfer limit of somewhere "
6820 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6824 #: ../fish/guestfish-actions.pod:625
6829 #: ../fish/guestfish-actions.pod:627
6832 " checksum csumtype path\n"
6837 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
6839 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6843 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
6845 "The type of checksum to compute is given by the C<csumtype> parameter which "
6846 "must have one of the following values:"
6850 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
6855 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
6857 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6862 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
6867 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
6868 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6872 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
6877 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
6878 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6882 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
6887 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
6888 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6892 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
6897 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
6898 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6902 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
6907 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
6908 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6912 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
6917 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
6918 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6922 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
6923 msgid "The checksum is returned as a printable string."
6927 #: ../fish/guestfish-actions.pod:670
6928 msgid "To get the checksum for a device, use L</checksum-device>."
6932 #: ../fish/guestfish-actions.pod:672
6933 msgid "To get the checksums for many files, use L</checksums-out>."
6937 #: ../fish/guestfish-actions.pod:674
6938 msgid "checksum-device"
6942 #: ../fish/guestfish-actions.pod:676
6945 " checksum-device csumtype device\n"
6950 #: ../fish/guestfish-actions.pod:678
6952 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6953 "device named C<device>. For the types of checksums supported see the L</"
6954 "checksum> command."
6958 #: ../fish/guestfish-actions.pod:682
6959 msgid "checksums-out"
6963 #: ../fish/guestfish-actions.pod:684
6966 " checksums-out csumtype directory (sumsfile|-)\n"
6971 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
6973 "This command computes the checksums of all regular files in C<directory> and "
6974 "then emits a list of those checksums to the local output file C<sumsfile>."
6978 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
6980 "This can be used for verifying the integrity of a virtual machine. However "
6981 "to be properly secure you should pay attention to the output of the checksum "
6982 "command (it uses the ones from GNU coreutils). In particular when the "
6983 "filename is not printable, coreutils uses a special backslash syntax. For "
6984 "more information, see the GNU coreutils info file."
6988 #: ../fish/guestfish-actions.pod:700
6993 #: ../fish/guestfish-actions.pod:702
6996 " chmod mode path\n"
7001 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
7003 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7008 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
7010 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7011 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7016 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3132
7017 #: ../fish/guestfish-actions.pod:3271 ../fish/guestfish-actions.pod:3281
7018 #: ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:1064
7019 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4948
7020 #: ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986
7021 msgid "The mode actually set is affected by the umask."
7025 #: ../fish/guestfish-actions.pod:713
7030 #: ../fish/guestfish-actions.pod:715
7033 " chown owner group path\n"
7038 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
7039 msgid "Change the file owner to C<owner> and group to C<group>."
7043 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2567
7044 #: ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3810
7046 "Only numeric uid and gid are supported. If you want to use names, you will "
7047 "need to locate and parse the password file yourself (Augeas support makes "
7048 "this relatively easy)."
7052 #: ../fish/guestfish-actions.pod:723
7057 #: ../fish/guestfish-actions.pod:725
7060 " command 'arguments ...'\n"
7065 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
7067 "This call runs a command from the guest filesystem. The filesystem must be "
7068 "mounted, and must contain a compatible operating system (ie. something "
7069 "Linux, with the same or compatible processor architecture)."
7073 #: ../fish/guestfish-actions.pod:732
7075 "The single parameter is an argv-style list of arguments. The first element "
7076 "is the name of the program to run. Subsequent elements are parameters. The "
7077 "list must be non-empty (ie. must contain a program name). Note that the "
7078 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7082 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
7083 msgid "The return value is anything printed to I<stdout> by the command."
7087 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
7089 "If the command returns a non-zero exit status, then this function returns an "
7090 "error message. The error message string is the content of I<stderr> from "
7095 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
7097 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
7098 "bin>. If you require a program from another location, you should provide "
7099 "the full path in the first parameter."
7103 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
7105 "Shared libraries and data files required by the program must be available on "
7106 "filesystems which are mounted in the correct places. It is the caller's "
7107 "responsibility to ensure all filesystems that are needed are mounted at the "
7112 #: ../fish/guestfish-actions.pod:760
7113 msgid "command-lines"
7117 #: ../fish/guestfish-actions.pod:762
7120 " command-lines 'arguments ...'\n"
7125 #: ../fish/guestfish-actions.pod:764
7127 "This is the same as L</command>, but splits the result into a list of lines."
7131 #: ../fish/guestfish-actions.pod:767
7132 msgid "See also: L</sh-lines>"
7136 #: ../fish/guestfish-actions.pod:772
7137 msgid "compress-device-out"
7141 #: ../fish/guestfish-actions.pod:774
7144 " compress-device-out ctype device (zdevice|-) [level:..]\n"
7149 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
7151 "This command compresses C<device> and writes it out to the local file "
7156 #: ../fish/guestfish-actions.pod:779
7158 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
7163 #: ../fish/guestfish-actions.pod:786
7164 msgid "compress-out"
7168 #: ../fish/guestfish-actions.pod:788
7171 " compress-out ctype file (zfile|-) [level:..]\n"
7176 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1220
7178 "This command compresses C<file> and writes it out to the local file C<zfile>."
7182 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1223
7184 "The compression program used is controlled by the C<ctype> parameter. "
7185 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7186 "Some compression types may not be supported by particular builds of "
7187 "libguestfs, in which case you will get an error containing the substring "
7188 "\"not supported\"."
7192 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1229
7194 "The optional C<level> parameter controls compression level. The meaning and "
7195 "default for this parameter depends on the compression program being used."
7199 #: ../fish/guestfish-actions.pod:807
7204 #: ../fish/guestfish-actions.pod:809
7207 " config qemuparam qemuvalue\n"
7212 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1270
7214 "This can be used to add arbitrary qemu command line parameters of the form "
7215 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7216 "setting some parameters which would interfere with parameters that we use."
7220 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1275
7221 msgid "The first character of C<param> string must be a C<-> (dash)."
7225 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1277
7226 msgid "C<value> can be NULL."
7230 #: ../fish/guestfish-actions.pod:820
7235 #: ../fish/guestfish-actions.pod:822
7238 " copy-size src dest size\n"
7243 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1291
7245 "This command copies exactly C<size> bytes from one source device or file "
7246 "C<src> to another destination device or file C<dest>."
7250 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1294
7252 "Note this will fail if the source is too short or if the destination is not "
7257 #: ../fish/guestfish-actions.pod:830
7262 #: ../fish/guestfish-actions.pod:832
7270 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1313
7272 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7273 "destination filename or destination directory."
7277 #: ../fish/guestfish-actions.pod:837
7282 #: ../fish/guestfish-actions.pod:839
7290 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1327
7292 "This copies a file or directory from C<src> to C<dest> recursively using the "
7297 #: ../fish/guestfish-actions.pod:844
7302 #: ../fish/guestfish-actions.pod:846
7310 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1341
7312 "This command copies from one source device or file C<src> to another "
7313 "destination device or file C<dest>. Normally you would use this to copy to "
7314 "or from a device or partition, for example to duplicate a filesystem."
7318 #: ../fish/guestfish-actions.pod:853
7320 "If the destination is a device, it must be as large or larger than the "
7321 "source file or device, otherwise the copy will fail. This command cannot do "
7322 "partial copies (see L</copy-size>)."
7326 #: ../fish/guestfish-actions.pod:857
7331 #: ../fish/guestfish-actions.pod:859
7339 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1359
7340 msgid "This command runs the C<df> command to report disk space used."
7344 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
7346 "This command is mostly useful for interactive sessions. It is I<not> "
7347 "intended that you try to parse the output string. Use L</statvfs> from "
7352 #: ../fish/guestfish-actions.pod:867
7357 #: ../fish/guestfish-actions.pod:869
7365 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1375
7367 "This command runs the C<df -h> command to report disk space used in human-"
7372 #: ../fish/guestfish-actions.pod:878
7377 #: ../fish/guestfish-actions.pod:880
7385 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1392
7387 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7388 "This is sometimes useful for extended debugging of problems."
7392 #: ../fish/guestfish-actions.pod:886
7394 "Another way to get the same information is to enable verbose messages with "
7395 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7396 "before running the program."
7400 #: ../fish/guestfish-actions.pod:891
7405 #: ../fish/guestfish-actions.pod:893
7408 " download remotefilename (filename|-)\n"
7413 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908
7414 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1438
7416 "Download file C<remotefilename> and save it as C<filename> on the local "
7421 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4877
7422 #: ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:7391
7423 msgid "C<filename> can also be a named pipe."
7427 #: ../fish/guestfish-actions.pod:900
7428 msgid "See also L</upload>, L</cat>."
7432 #: ../fish/guestfish-actions.pod:904
7433 msgid "download-offset"
7437 #: ../fish/guestfish-actions.pod:906
7440 " download-offset remotefilename (filename|-) offset size\n"
7445 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1441
7447 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7448 "region must be within the file or device)."
7452 #: ../fish/guestfish-actions.pod:914
7454 "Note that there is no limit on the amount of data that can be downloaded "
7455 "with this call, unlike with L</pread>, and this call always reads the full "
7456 "amount unless an error occurs."
7460 #: ../fish/guestfish-actions.pod:919
7461 msgid "See also L</download>, L</pread>."
7465 #: ../fish/guestfish-actions.pod:923
7470 #: ../fish/guestfish-actions.pod:925
7473 " drop-caches whattodrop\n"
7478 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1466
7480 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7481 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7482 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7486 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1471
7487 msgid "Setting C<whattodrop> to 3 should drop everything."
7491 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1473
7493 "This automatically calls L<sync(2)> before the operation, so that the "
7494 "maximum guest memory is freed."
7498 #: ../fish/guestfish-actions.pod:937
7503 #: ../fish/guestfish-actions.pod:939
7511 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1486
7513 "This command runs the C<du -s> command to estimate file space usage for "
7518 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1489
7520 "C<path> can be a file or a directory. If C<path> is a directory then the "
7521 "estimate includes the contents of the directory and all subdirectories "
7526 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1493
7528 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7532 #: ../fish/guestfish-actions.pod:951
7537 #: ../fish/guestfish-actions.pod:953
7540 " e2fsck-f device\n"
7545 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1511
7547 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7548 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7553 #: ../fish/guestfish-actions.pod:959
7555 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7556 "should use L</fsck>."
7560 #: ../fish/guestfish-actions.pod:962
7565 #: ../fish/guestfish-actions.pod:964
7568 " echo-daemon 'words ...'\n"
7573 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1528
7575 "This command concatenates the list of C<words> passed with single spaces "
7576 "between them and returns the resulting string."
7580 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1531
7581 msgid "You can use this command to test the connection through to the daemon."
7585 #: ../fish/guestfish-actions.pod:971
7586 msgid "See also L</ping-daemon>."
7590 #: ../fish/guestfish-actions.pod:973
7595 #: ../fish/guestfish-actions.pod:975
7598 " egrep regex path\n"
7603 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1547
7605 "This calls the external C<egrep> program and returns the matching lines."
7609 #: ../fish/guestfish-actions.pod:983
7614 #: ../fish/guestfish-actions.pod:985
7617 " egrepi regex path\n"
7622 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1566
7624 "This calls the external C<egrep -i> program and returns the matching lines."
7628 #: ../fish/guestfish-actions.pod:993
7633 #: ../fish/guestfish-actions.pod:995
7636 " equal file1 file2\n"
7641 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1585
7643 "This compares the two files C<file1> and C<file2> and returns true if their "
7644 "content is exactly equal, or false otherwise."
7648 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1588
7649 msgid "The external L<cmp(1)> program is used for the comparison."
7653 #: ../fish/guestfish-actions.pod:1002
7658 #: ../fish/guestfish-actions.pod:1004
7666 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1600
7668 "This returns C<true> if and only if there is a file, directory (or anything) "
7669 "with the given C<path> name."
7673 #: ../fish/guestfish-actions.pod:1009
7674 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7678 #: ../fish/guestfish-actions.pod:1011
7683 #: ../fish/guestfish-actions.pod:1013
7686 " fallocate path len\n"
7691 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034
7692 #: ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1642
7694 "This command preallocates a file (containing zero bytes) named C<path> of "
7695 "size C<len> bytes. If the file exists already, it is overwritten."
7699 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1627
7701 "Do not confuse this with the guestfish-specific C<alloc> command which "
7702 "allocates a file in the host and attaches it as a device."
7706 #: ../fish/guestfish-actions.pod:1023
7708 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7713 #: ../fish/guestfish-actions.pod:1030
7718 #: ../fish/guestfish-actions.pod:1032
7721 " fallocate64 path len\n"
7726 #: ../fish/guestfish-actions.pod:1038
7728 "Note that this call allocates disk blocks for the file. To create a sparse "
7729 "file use L</truncate-size> instead."
7733 #: ../fish/guestfish-actions.pod:1041
7735 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7736 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7737 "maximum size of files created through that call to 1GB."
7741 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1654
7743 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7744 "commands which create a file in the host and attach it as a device."
7748 #: ../fish/guestfish-actions.pod:1050
7753 #: ../fish/guestfish-actions.pod:1052
7756 " fgrep pattern path\n"
7761 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1669
7763 "This calls the external C<fgrep> program and returns the matching lines."
7767 #: ../fish/guestfish-actions.pod:1060
7772 #: ../fish/guestfish-actions.pod:1062
7775 " fgrepi pattern path\n"
7780 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1688
7782 "This calls the external C<fgrep -i> program and returns the matching lines."
7786 #: ../fish/guestfish-actions.pod:1070
7791 #: ../fish/guestfish-actions.pod:1072
7799 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1706
7801 "This call uses the standard L<file(1)> command to determine the type or "
7802 "contents of the file."
7806 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1709
7808 "This call will also transparently look inside various types of compressed "
7813 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1712
7815 "The exact command which runs is C<file -zb path>. Note in particular that "
7816 "the filename is not prepended to the output (the I<-b> option)."
7820 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1716
7822 "The output depends on the output of the underlying L<file(1)> command and it "
7823 "can change in future in ways beyond our control. In other words, the output "
7824 "is not guaranteed by the ABI."
7828 #: ../fish/guestfish-actions.pod:1088
7830 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7831 "(etc), L</is-zero>."
7835 #: ../fish/guestfish-actions.pod:1091
7836 msgid "file-architecture"
7840 #: ../fish/guestfish-actions.pod:1093
7843 " file-architecture filename\n"
7848 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1734
7850 "This detects the architecture of the binary C<filename>, and returns it if "
7855 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1737
7856 msgid "Currently defined architectures are:"
7860 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1741
7865 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1743
7867 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7868 "irrespective of the precise processor requirements of the binary."
7872 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1746
7877 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1748
7878 msgid "64 bit x86-64."
7882 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1750
7887 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1752
7888 msgid "32 bit SPARC."
7892 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1754
7897 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1756
7898 msgid "64 bit SPARC V9 and above."
7902 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1758
7907 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1760
7908 msgid "Intel Itanium."
7912 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1762
7917 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1764
7918 msgid "32 bit Power PC."
7922 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1766
7927 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1768
7928 msgid "64 bit Power PC."
7932 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1772
7933 msgid "Libguestfs may return other architecture strings in future."
7937 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1774
7938 msgid "The function works on at least the following types of files:"
7942 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1780
7943 msgid "many types of Un*x and Linux binary"
7947 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1784
7948 msgid "many types of Un*x and Linux shared library"
7952 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1788
7953 msgid "Windows Win32 and Win64 binaries"
7957 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1792
7958 msgid "Windows Win32 and Win64 DLLs"
7962 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1794
7963 msgid "Win32 binaries and DLLs return C<i386>."
7967 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1796
7968 msgid "Win64 binaries and DLLs return C<x86_64>."
7972 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1800
7973 msgid "Linux kernel modules"
7977 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1804
7978 msgid "Linux new-style initrd images"
7982 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1808
7983 msgid "some non-x86 Linux vmlinuz kernels"
7987 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1812
7988 msgid "What it can't do currently:"
7992 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1818
7993 msgid "static libraries (libfoo.a)"
7997 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1822
7998 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8002 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1826
8003 msgid "x86 Linux vmlinuz kernels"
8007 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1828
8009 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8010 "compressed code, and are horribly hard to unpack. If you want to find the "
8011 "architecture of a kernel, use the architecture of the associated initrd or "
8012 "kernel module(s) instead."
8016 #: ../fish/guestfish-actions.pod:1196
8021 #: ../fish/guestfish-actions.pod:1198
8029 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1846
8030 msgid "This command returns the size of C<file> in bytes."
8034 #: ../fish/guestfish-actions.pod:1202
8036 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
8037 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
8041 #: ../fish/guestfish-actions.pod:1206
8046 #: ../fish/guestfish-actions.pod:1208
8049 " fill c len path\n"
8054 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1864
8056 "This command creates a new file called C<path>. The initial content of the "
8057 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
8062 #: ../fish/guestfish-actions.pod:1214
8064 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8065 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8070 #: ../fish/guestfish-actions.pod:1219
8071 msgid "fill-pattern"
8075 #: ../fish/guestfish-actions.pod:1221
8078 " fill-pattern pattern len path\n"
8083 #: ../fish/guestfish-actions.pod:1223
8085 "This function is like L</fill> except that it creates a new file of length "
8086 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8087 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8092 #: ../fish/guestfish-actions.pod:1228
8097 #: ../fish/guestfish-actions.pod:1230
8105 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1910
8107 "This command lists out all files and directories, recursively, starting at "
8108 "C<directory>. It is essentially equivalent to running the shell command "
8109 "C<find directory -print> but some post-processing happens on the output, "
8114 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1915
8116 "This returns a list of strings I<without any prefix>. Thus if the directory "
8121 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1918
8131 #: ../fish/guestfish-actions.pod:1244
8132 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8136 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1925
8147 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1930
8148 msgid "If C<directory> is not a directory, then this command returns an error."
8152 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1933
8153 msgid "The returned list is sorted."
8157 #: ../fish/guestfish-actions.pod:1257
8158 msgid "See also L</find0>."
8162 #: ../fish/guestfish-actions.pod:1262
8167 #: ../fish/guestfish-actions.pod:1264
8170 " find0 directory (files|-)\n"
8175 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1953
8177 "This command lists out all files and directories, recursively, starting at "
8178 "C<directory>, placing the resulting list in the external file called "
8183 #: ../fish/guestfish-actions.pod:1270
8185 "This command works the same way as L</find> with the following exceptions:"
8189 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1964
8190 msgid "The resulting list is written to an external file."
8194 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1968
8196 "Items (filenames) in the result are separated by C<\\0> characters. See "
8197 "L<find(1)> option I<-print0>."
8201 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1973
8202 msgid "This command is not limited in the number of names that it can return."
8206 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1978
8207 msgid "The result list is not sorted."
8211 #: ../fish/guestfish-actions.pod:1297
8212 msgid "findfs-label"
8216 #: ../fish/guestfish-actions.pod:1299
8219 " findfs-label label\n"
8224 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1992
8226 "This command searches the filesystems and returns the one which has the "
8227 "given label. An error is returned if no such filesystem can be found."
8231 #: ../fish/guestfish-actions.pod:1305
8232 msgid "To find the label of a filesystem, use L</vfs-label>."
8236 #: ../fish/guestfish-actions.pod:1307
8241 #: ../fish/guestfish-actions.pod:1309
8244 " findfs-uuid uuid\n"
8249 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2009
8251 "This command searches the filesystems and returns the one which has the "
8252 "given UUID. An error is returned if no such filesystem can be found."
8256 #: ../fish/guestfish-actions.pod:1315
8257 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8261 #: ../fish/guestfish-actions.pod:1317
8266 #: ../fish/guestfish-actions.pod:1319
8269 " fsck fstype device\n"
8274 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2027
8276 "This runs the filesystem checker (fsck) on C<device> which should have "
8277 "filesystem type C<fstype>."
8281 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2030
8283 "The returned integer is the status. See L<fsck(8)> for the list of status "
8284 "codes from C<fsck>."
8288 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2039
8289 msgid "Multiple status codes can be summed together."
8293 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2043
8295 "A non-zero return code can mean \"success\", for example if errors have been "
8296 "corrected on the filesystem."
8300 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2048
8301 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8305 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2053
8307 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8311 #: ../fish/guestfish-actions.pod:1349
8316 #: ../fish/guestfish-actions.pod:1351
8324 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2064
8326 "Return the additional kernel options which are added to the guest kernel "
8331 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2067
8332 msgid "If C<NULL> then no options are added."
8336 #: ../fish/guestfish-actions.pod:1358
8337 msgid "get-attach-method"
8341 #: ../fish/guestfish-actions.pod:1360
8344 " get-attach-method\n"
8349 #: ../fish/guestfish-actions.pod:1362
8350 msgid "Return the current attach method. See L</set-attach-method>."
8354 #: ../fish/guestfish-actions.pod:1364
8355 msgid "get-autosync"
8359 #: ../fish/guestfish-actions.pod:1366
8367 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2092
8368 msgid "Get the autosync flag."
8372 #: ../fish/guestfish-actions.pod:1370
8377 #: ../fish/guestfish-actions.pod:1372
8385 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2103
8386 msgid "Return the direct appliance mode flag."
8390 #: ../fish/guestfish-actions.pod:1376
8395 #: ../fish/guestfish-actions.pod:1378
8398 " get-e2label device\n"
8403 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2122
8405 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8409 #: ../fish/guestfish-actions.pod:1383
8411 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8416 #: ../fish/guestfish-actions.pod:1390
8421 #: ../fish/guestfish-actions.pod:1392
8424 " get-e2uuid device\n"
8429 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2143
8431 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8435 #: ../fish/guestfish-actions.pod:1397
8437 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8442 #: ../fish/guestfish-actions.pod:1404
8447 #: ../fish/guestfish-actions.pod:1406
8455 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2156
8457 "This gets the memory size in megabytes allocated to the qemu subprocess."
8461 #: ../fish/guestfish-actions.pod:1411
8463 "If L</set-memsize> was not called on this handle, and if "
8464 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8465 "value for memsize."
8469 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472
8470 #: ../fish/guestfish-actions.pod:4225 ../fish/guestfish-actions.pod:4327
8471 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2255
8472 #: ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6562
8474 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8478 #: ../fish/guestfish-actions.pod:1418
8483 #: ../fish/guestfish-actions.pod:1420
8491 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2175
8492 msgid "This returns the enable network flag."
8496 #: ../fish/guestfish-actions.pod:1424
8501 #: ../fish/guestfish-actions.pod:1426
8509 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2186
8510 msgid "Return the current search path."
8514 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2188
8516 "This is always non-NULL. If it wasn't set already, then this will return "
8521 #: ../fish/guestfish-actions.pod:1433
8526 #: ../fish/guestfish-actions.pod:1435
8534 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2201
8535 msgid "This returns the process group flag."
8539 #: ../fish/guestfish-actions.pod:1439
8544 #: ../fish/guestfish-actions.pod:1441
8549 #: ../fish/guestfish-actions.pod:1443
8557 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2212
8559 "Return the process ID of the qemu subprocess. If there is no qemu "
8560 "subprocess, then this will return an error."
8564 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2215
8565 msgid "This is an internal call used for debugging and testing."
8569 #: ../fish/guestfish-actions.pod:1450
8574 #: ../fish/guestfish-actions.pod:1452
8582 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2226
8583 msgid "Return the current qemu binary."
8587 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2228
8589 "This is always non-NULL. If it wasn't set already, then this will return "
8590 "the default qemu binary name."
8594 #: ../fish/guestfish-actions.pod:1459
8595 msgid "get-recovery-proc"
8599 #: ../fish/guestfish-actions.pod:1461
8602 " get-recovery-proc\n"
8607 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2241
8608 msgid "Return the recovery process enabled flag."
8612 #: ../fish/guestfish-actions.pod:1465
8617 #: ../fish/guestfish-actions.pod:1467
8625 #: ../fish/guestfish-actions.pod:1469
8627 "This returns the current setting of the selinux flag which is passed to the "
8628 "appliance at boot time. See L</set-selinux>."
8632 #: ../fish/guestfish-actions.pod:1475
8637 #: ../fish/guestfish-actions.pod:1477
8645 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2267
8646 msgid "This returns the number of virtual CPUs assigned to the appliance."
8650 #: ../fish/guestfish-actions.pod:1481
8655 #: ../fish/guestfish-actions.pod:1483
8663 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2278
8665 "This returns the current state as an opaque integer. This is only useful "
8666 "for printing debug and internal error messages."
8670 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2434
8671 #: ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2490
8672 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:2281
8673 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3616
8674 #: ../src/guestfs-actions.pod:3677 ../src/guestfs-actions.pod:3704
8675 msgid "For more information on states, see L<guestfs(3)>."
8679 #: ../fish/guestfish-actions.pod:1490
8684 #: ../fish/guestfish-actions.pod:1492
8692 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2292
8693 msgid "Return the command trace flag."
8697 #: ../fish/guestfish-actions.pod:1496
8702 #: ../fish/guestfish-actions.pod:1498
8710 #: ../fish/guestfish-actions.pod:1500
8712 "Return the current umask. By default the umask is C<022> unless it has been "
8713 "set by calling L</umask>."
8717 #: ../fish/guestfish-actions.pod:1503
8722 #: ../fish/guestfish-actions.pod:1505
8730 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2315
8731 msgid "This returns the verbose messages flag."
8735 #: ../fish/guestfish-actions.pod:1509
8740 #: ../fish/guestfish-actions.pod:1511
8748 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2326
8749 msgid "This gets the SELinux security context of the daemon."
8753 #: ../fish/guestfish-actions.pod:1515
8754 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8758 #: ../fish/guestfish-actions.pod:1518
8763 #: ../fish/guestfish-actions.pod:1520
8766 " getxattr path name\n"
8771 #: ../fish/guestfish-actions.pod:1522
8773 "Get a single extended attribute from file C<path> named C<name>. This call "
8774 "follows symlinks. If you want to lookup an extended attribute for the "
8775 "symlink itself, use L</lgetxattr>."
8779 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2579
8781 "Normally it is better to get all extended attributes from a file in one go "
8782 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8783 "buggy and do not provide a way to list out attributes. For these "
8784 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8785 "attributes you want in advance and call this function."
8789 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2586
8790 #: ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3837
8792 "Extended attribute values are blobs of binary data. If there is no extended "
8793 "attribute named C<name>, this returns an error."
8797 #: ../fish/guestfish-actions.pod:1536
8798 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8802 #: ../fish/guestfish-actions.pod:1538
8807 #: ../fish/guestfish-actions.pod:1540
8815 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2372
8817 "This call lists the extended attributes of the file or directory C<path>."
8821 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2375
8823 "At the system call level, this is a combination of the L<listxattr(2)> and "
8824 "L<getxattr(2)> calls."
8828 #: ../fish/guestfish-actions.pod:1548
8829 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8833 #: ../fish/guestfish-actions.pod:1550
8838 #: ../fish/guestfish-actions.pod:1552
8841 " glob-expand pattern\n"
8846 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2392
8848 "This command searches for all the pathnames matching C<pattern> according to "
8849 "the wildcard expansion rules used by the shell."
8853 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2396
8855 "If no paths match, then this returns an empty list (note: not an error)."
8859 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2399
8861 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8862 "GLOB_BRACE>. See that manual page for more details."
8866 #: ../fish/guestfish-actions.pod:1565
8871 #: ../fish/guestfish-actions.pod:1567
8874 " grep regex path\n"
8879 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2416
8880 msgid "This calls the external C<grep> program and returns the matching lines."
8884 #: ../fish/guestfish-actions.pod:1575
8889 #: ../fish/guestfish-actions.pod:1577
8892 " grepi regex path\n"
8897 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2435
8899 "This calls the external C<grep -i> program and returns the matching lines."
8903 #: ../fish/guestfish-actions.pod:1585
8904 msgid "grub-install"
8908 #: ../fish/guestfish-actions.pod:1587
8911 " grub-install root device\n"
8916 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2454
8918 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8919 "with the root directory being C<root>."
8923 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2463
8925 "There is currently no way in the API to install grub2, which is used by most "
8926 "modern Linux guests. It is possible to run the grub2 command from the "
8927 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8931 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2470
8933 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8934 "compatible with itself, so this only works in rather narrow circumstances. "
8935 "Careful testing with each guest version is advisable."
8939 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2477
8941 "If grub-install reports the error \"No suitable drive was found in the "
8942 "generated device map.\" it may be that you need to create a C</boot/grub/"
8943 "device.map> file first that contains the mapping between grub device names "
8944 "and Linux device names. It is usually sufficient to create a file "
8949 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2484
8957 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2486
8958 msgid "replacing C</dev/vda> with the name of the installation device."
8962 #: ../fish/guestfish-actions.pod:1625
8967 #: ../fish/guestfish-actions.pod:1627
8975 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2500
8977 "This command returns up to the first 10 lines of a file as a list of strings."
8981 #: ../fish/guestfish-actions.pod:1635
8986 #: ../fish/guestfish-actions.pod:1637
8989 " head-n nrlines path\n"
8994 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2519
8996 "If the parameter C<nrlines> is a positive number, this returns the first "
8997 "C<nrlines> lines of the file C<path>."
9001 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2522
9003 "If the parameter C<nrlines> is a negative number, this returns lines from "
9004 "the file C<path>, excluding the last C<nrlines> lines."
9008 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4717
9009 #: ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:7150
9010 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9014 #: ../fish/guestfish-actions.pod:1650
9019 #: ../fish/guestfish-actions.pod:1652
9027 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2542
9029 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
9030 "readable, canonical hex dump of the file."
9034 #: ../fish/guestfish-actions.pod:1660
9039 #: ../fish/guestfish-actions.pod:1662
9042 " initrd-cat initrdpath filename\n"
9047 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2561
9049 "This command unpacks the file C<filename> from the initrd file called "
9050 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9055 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2565
9057 "For example, in guestfish you could use the following command to examine the "
9058 "boot script (usually called C</init>) contained in a Linux initrd or "
9063 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2569
9066 " initrd-cat /boot/initrd-<version>.img init\n"
9071 #: ../fish/guestfish-actions.pod:1674
9072 msgid "See also L</initrd-list>."
9076 #: ../fish/guestfish-actions.pod:1679
9081 #: ../fish/guestfish-actions.pod:1681
9084 " initrd-list path\n"
9089 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2588
9090 msgid "This command lists out files contained in an initrd."
9094 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2590
9096 "The files are listed without any initial C</> character. The files are "
9097 "listed in the order they appear (not necessarily alphabetical). Directory "
9098 "names are listed as separate items."
9102 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2594
9104 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9105 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9110 #: ../fish/guestfish-actions.pod:1693
9111 msgid "inotify-add-watch"
9115 #: ../fish/guestfish-actions.pod:1695
9118 " inotify-add-watch path mask\n"
9123 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2611
9124 msgid "Watch C<path> for the events listed in C<mask>."
9128 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2613
9130 "Note that if C<path> is a directory then events within that directory are "
9131 "watched, but this does I<not> happen recursively (in subdirectories)."
9135 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2617
9137 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9138 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9142 #: ../fish/guestfish-actions.pod:1707
9143 msgid "inotify-close"
9147 #: ../fish/guestfish-actions.pod:1709
9155 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2630
9157 "This closes the inotify handle which was previously opened by inotify_init. "
9158 "It removes all watches, throws away any pending events, and deallocates all "
9163 #: ../fish/guestfish-actions.pod:1715
9164 msgid "inotify-files"
9168 #: ../fish/guestfish-actions.pod:1717
9176 #: ../fish/guestfish-actions.pod:1719
9178 "This function is a helpful wrapper around L</inotify-read> which just "
9179 "returns a list of pathnames of objects that were touched. The returned "
9180 "pathnames are sorted and deduplicated."
9184 #: ../fish/guestfish-actions.pod:1723
9185 msgid "inotify-init"
9189 #: ../fish/guestfish-actions.pod:1725
9192 " inotify-init maxevents\n"
9197 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2659
9199 "This command creates a new inotify handle. The inotify subsystem can be "
9200 "used to notify events which happen to objects in the guest filesystem."
9204 #: ../fish/guestfish-actions.pod:1731
9206 "C<maxevents> is the maximum number of events which will be queued up between "
9207 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9208 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9209 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9210 "but records the fact that it threw them away by setting a flag "
9211 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9215 #: ../fish/guestfish-actions.pod:1741
9217 "Before any events are generated, you have to add some watches to the "
9218 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9219 "L</inotify-watch-all>."
9223 #: ../fish/guestfish-actions.pod:1747
9225 "Queued up events should be read periodically by calling L</inotify-read> (or "
9226 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9227 "If you don't read the events out often enough then you risk the internal "
9228 "queue overflowing."
9232 #: ../fish/guestfish-actions.pod:1754
9234 "The handle should be closed after use by calling L</inotify-close>. This "
9235 "also removes any watches automatically."
9239 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2690
9241 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9242 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9243 "that there is one global inotify handle per libguestfs instance."
9247 #: ../fish/guestfish-actions.pod:1763
9248 msgid "inotify-read"
9252 #: ../fish/guestfish-actions.pod:1765
9260 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2704
9262 "Return the complete queue of events that have happened since the previous "
9267 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2707
9268 msgid "If no events have happened, this returns an empty list."
9272 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2709
9274 "I<Note>: In order to make sure that all events have been read, you must call "
9275 "this function repeatedly until it returns an empty list. The reason is that "
9276 "the call will read events up to the maximum appliance-to-host message size "
9277 "and leave remaining events in the queue."
9281 #: ../fish/guestfish-actions.pod:1778
9282 msgid "inotify-rm-watch"
9286 #: ../fish/guestfish-actions.pod:1780
9289 " inotify-rm-watch wd\n"
9294 #: ../fish/guestfish-actions.pod:1782
9295 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9299 #: ../fish/guestfish-actions.pod:1785
9300 msgid "inspect-get-arch"
9304 #: ../fish/guestfish-actions.pod:1787
9307 " inspect-get-arch root\n"
9312 #: ../fish/guestfish-actions.pod:1789
9314 "This returns the architecture of the inspected operating system. The "
9315 "possible return values are listed under L</file-architecture>."
9319 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2744
9321 "If the architecture could not be determined, then the string C<unknown> is "
9326 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1883
9327 #: ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1974
9328 #: ../fish/guestfish-actions.pod:2058 ../fish/guestfish-actions.pod:2119
9329 #: ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2154
9330 #: ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2226
9331 #: ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252
9332 #: ../fish/guestfish-actions.pod:2262 ../fish/guestfish-actions.pod:2272
9333 #: ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2380
9334 #: ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:2747
9335 #: ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2945
9336 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3095
9337 #: ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3206
9338 #: ../src/guestfs-actions.pod:3227 ../src/guestfs-actions.pod:3280
9339 #: ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3340
9340 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3377
9341 #: ../src/guestfs-actions.pod:3393 ../src/guestfs-actions.pod:3411
9342 #: ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3554
9343 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9347 #: ../fish/guestfish-actions.pod:1798
9348 msgid "inspect-get-distro"
9352 #: ../fish/guestfish-actions.pod:1800
9355 " inspect-get-distro root\n"
9360 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2760
9362 "This returns the distro (distribution) of the inspected operating system."
9366 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2763
9367 msgid "Currently defined distros are:"
9371 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2767
9372 msgid "\"archlinux\""
9376 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2769
9381 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2771
9386 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2773
9391 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2775
9396 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2777
9401 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2779
9406 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2781
9411 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2783
9416 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2785
9421 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2787
9422 msgid "\"linuxmint\""
9426 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2789
9431 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2791
9432 msgid "\"mandriva\""
9436 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2793
9441 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2795
9446 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2797
9451 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2799
9456 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2801
9461 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2803
9462 msgid "\"redhat-based\""
9466 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2805
9467 msgid "Some Red Hat-derived distro."
9471 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2807
9476 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2809
9477 msgid "Red Hat Enterprise Linux."
9481 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2811
9482 msgid "\"scientificlinux\""
9486 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2813
9487 msgid "Scientific Linux."
9491 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2815
9492 msgid "\"slackware\""
9496 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2817
9501 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2819
9502 msgid "\"ttylinux\""
9506 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2821
9511 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2823
9516 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2825
9521 #: ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:1953
9522 #: ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:2827
9523 #: ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3311
9528 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2829
9529 msgid "The distro could not be determined."
9533 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:2209
9534 #: ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:3303
9539 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2833
9541 "Windows does not have distributions. This string is returned if the OS type "
9546 #: ../fish/guestfish-actions.pod:1880 ../fish/guestfish-actions.pod:1959
9547 #: ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2838
9548 #: ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:3317
9550 "Future versions of libguestfs may return other strings here. The caller "
9551 "should be prepared to handle any string."
9555 #: ../fish/guestfish-actions.pod:1885
9556 msgid "inspect-get-drive-mappings"
9560 #: ../fish/guestfish-actions.pod:1887
9563 " inspect-get-drive-mappings root\n"
9568 #: ../fish/guestfish-actions.pod:1889 ../src/guestfs-actions.pod:2854
9570 "This call is useful for Windows which uses a primitive system of assigning "
9571 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9572 "Windows Registry to find out how disks/partitions are mapped to drive "
9573 "letters, and returns a hash table as in the example below:"
9577 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2860
9587 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2864
9589 "Note that keys are drive letters. For Windows, the key is case insensitive "
9590 "and just contains the drive letter, without the customary colon separator "
9595 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2868
9597 "In future we may support other operating systems that also used drive "
9598 "letters, but the keys for those might not be case insensitive and might be "
9599 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9604 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2873
9606 "For Windows guests, currently only hard drive mappings are returned. "
9607 "Removable disks (eg. DVD-ROMs) are ignored."
9611 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2876
9613 "For guests that do not use drive mappings, or if the drive mappings could "
9614 "not be determined, this returns an empty hash table."
9618 #: ../fish/guestfish-actions.pod:1914
9620 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9621 "get-mountpoints>, L</inspect-get-filesystems>."
9625 #: ../fish/guestfish-actions.pod:1918
9626 msgid "inspect-get-filesystems"
9630 #: ../fish/guestfish-actions.pod:1920
9633 " inspect-get-filesystems root\n"
9638 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:2897
9640 "This returns a list of all the filesystems that we think are associated with "
9641 "this operating system. This includes the root filesystem, other ordinary "
9642 "filesystems, and non-mounted devices like swap partitions."
9646 #: ../fish/guestfish-actions.pod:1927 ../src/guestfs-actions.pod:2902
9648 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9649 "to be shared between operating systems."
9653 #: ../fish/guestfish-actions.pod:1930
9655 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9660 #: ../fish/guestfish-actions.pod:1933
9661 msgid "inspect-get-format"
9665 #: ../fish/guestfish-actions.pod:1935
9668 " inspect-get-format root\n"
9673 #: ../fish/guestfish-actions.pod:1937 ../src/guestfs-actions.pod:2920
9675 "This returns the format of the inspected operating system. You can use it "
9676 "to detect install images, live CDs and similar."
9680 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2923
9681 msgid "Currently defined formats are:"
9685 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:2927
9686 msgid "\"installed\""
9690 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2929
9691 msgid "This is an installed operating system."
9695 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2931
9696 msgid "\"installer\""
9700 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2933
9702 "The disk image being inspected is not an installed operating system, but a "
9703 "I<bootable> install disk, live CD, or similar."
9707 #: ../fish/guestfish-actions.pod:1955 ../src/guestfs-actions.pod:2938
9708 msgid "The format of this disk image is not known."
9712 #: ../fish/guestfish-actions.pod:1964
9713 msgid "inspect-get-hostname"
9717 #: ../fish/guestfish-actions.pod:1966
9720 " inspect-get-hostname root\n"
9725 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2958
9727 "This function returns the hostname of the operating system as found by "
9728 "inspection of the guest's configuration files."
9732 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:2961
9734 "If the hostname could not be determined, then the string C<unknown> is "
9739 #: ../fish/guestfish-actions.pod:1976
9740 msgid "inspect-get-icon"
9744 #: ../fish/guestfish-actions.pod:1978
9747 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9752 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:2987
9754 "This function returns an icon corresponding to the inspected operating "
9755 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9756 "to PNG if necessary)."
9760 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2991
9762 "If it was not possible to get an icon this function returns a zero-length "
9763 "(non-NULL) buffer. I<Callers must check for this case>."
9767 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:2994
9769 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9770 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9771 "this file will be returned. You can disable favicons by passing the "
9772 "optional C<favicon> boolean as false (default is true)."
9776 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3000
9778 "If finding the favicon fails, then we look in other places in the guest for "
9783 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3003
9785 "If the optional C<highquality> boolean is true then only high quality icons "
9786 "are returned, which means only icons of high resolution with an alpha "
9787 "channel. The default (false) is to return any icon we can, even if it is of "
9788 "substandard quality."
9792 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3014
9794 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9795 "before you call this, since it needs to read information from the guest "
9796 "filesystem during the call."
9800 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3020
9802 "B<Security:> The icon data comes from the untrusted guest, and should be "
9803 "treated with caution. PNG files have been known to contain exploits. "
9804 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9805 "trying to process or display the icon."
9809 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3028
9811 "The PNG image returned can be any size. It might not be square. Libguestfs "
9812 "tries to return the largest, highest quality icon available. The "
9813 "application must scale the icon to the required size."
9817 #: ../fish/guestfish-actions.pod:2028 ../src/guestfs-actions.pod:3035
9819 "Extracting icons from Windows guests requires the external C<wrestool> "
9820 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9821 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9822 "installed separately."
9826 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3042
9828 "Operating system icons are usually trademarks. Seek legal advice before "
9829 "using trademarks in applications."
9833 #: ../fish/guestfish-actions.pod:2042
9834 msgid "inspect-get-major-version"
9838 #: ../fish/guestfish-actions.pod:2044
9841 " inspect-get-major-version root\n"
9846 #: ../fish/guestfish-actions.pod:2046 ../src/guestfs-actions.pod:3083
9848 "This returns the major version number of the inspected operating system."
9852 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3086
9854 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9855 "popular public names used by the operating system. Notably the operating "
9856 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9857 "1). You can find out the real versions corresponding to releases of Windows "
9858 "by consulting Wikipedia or MSDN."
9862 #: ../fish/guestfish-actions.pod:2056 ../fish/guestfish-actions.pod:2067
9863 #: ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3110
9864 msgid "If the version could not be determined, then C<0> is returned."
9868 #: ../fish/guestfish-actions.pod:2060
9869 msgid "inspect-get-minor-version"
9873 #: ../fish/guestfish-actions.pod:2062
9876 " inspect-get-minor-version root\n"
9881 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3107
9883 "This returns the minor version number of the inspected operating system."
9887 #: ../fish/guestfish-actions.pod:2069
9889 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9890 "get-major-version>."
9894 #: ../fish/guestfish-actions.pod:2072
9895 msgid "inspect-get-mountpoints"
9899 #: ../fish/guestfish-actions.pod:2074
9902 " inspect-get-mountpoints root\n"
9907 #: ../fish/guestfish-actions.pod:2076 ../src/guestfs-actions.pod:3125
9909 "This returns a hash of where we think the filesystems associated with this "
9910 "operating system should be mounted. Callers should note that this is at "
9911 "best an educated guess made by reading configuration files such as C</etc/"
9912 "fstab>. I<In particular note> that this may return filesystems which are "
9913 "non-existent or not mountable and callers should be prepared to handle or "
9914 "ignore failures if they try to mount them."
9918 #: ../fish/guestfish-actions.pod:2085 ../src/guestfs-actions.pod:3134
9920 "Each element in the returned hashtable has a key which is the path of the "
9921 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9922 "mounted there (eg. C</dev/sda1>)."
9926 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3139
9928 "Non-mounted devices such as swap devices are I<not> returned in this list."
9932 #: ../fish/guestfish-actions.pod:2093
9934 "For operating systems like Windows which still use drive letters, this call "
9935 "will only return an entry for the first drive \"mounted on\" C</>. For "
9936 "information about the mapping of drive letters to partitions, see L</inspect-"
9937 "get-drive-mappings>."
9941 #: ../fish/guestfish-actions.pod:2099
9943 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9948 #: ../fish/guestfish-actions.pod:2102
9949 msgid "inspect-get-package-format"
9953 #: ../fish/guestfish-actions.pod:2104
9956 " inspect-get-package-format root\n"
9961 #: ../fish/guestfish-actions.pod:2106
9963 "This function and L</inspect-get-package-management> return the package "
9964 "format and package management tool used by the inspected operating system. "
9965 "For example for Fedora these functions would return C<rpm> (package format) "
9966 "and C<yum> (package management)."
9970 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3171
9972 "This returns the string C<unknown> if we could not determine the package "
9973 "format I<or> if the operating system does not have a real packaging system "
9978 #: ../fish/guestfish-actions.pod:2116 ../src/guestfs-actions.pod:3175
9980 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9981 "Future versions of libguestfs may return other strings."
9985 #: ../fish/guestfish-actions.pod:2121
9986 msgid "inspect-get-package-management"
9990 #: ../fish/guestfish-actions.pod:2123
9993 " inspect-get-package-management root\n"
9998 #: ../fish/guestfish-actions.pod:2125
10000 "L</inspect-get-package-format> and this function return the package format "
10001 "and package management tool used by the inspected operating system. For "
10002 "example for Fedora these functions would return C<rpm> (package format) and "
10003 "C<yum> (package management)."
10007 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3197
10009 "This returns the string C<unknown> if we could not determine the package "
10010 "management tool I<or> if the operating system does not have a real packaging "
10011 "system (eg. Windows)."
10015 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3201
10017 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10018 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
10019 "libguestfs may return other strings."
10023 #: ../fish/guestfish-actions.pod:2142
10024 msgid "inspect-get-product-name"
10028 #: ../fish/guestfish-actions.pod:2144
10031 " inspect-get-product-name root\n"
10036 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3219
10038 "This returns the product name of the inspected operating system. The "
10039 "product name is generally some freeform string which can be displayed to the "
10040 "user, but should not be parsed by programs."
10044 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:3224
10046 "If the product name could not be determined, then the string C<unknown> is "
10051 #: ../fish/guestfish-actions.pod:2156
10052 msgid "inspect-get-product-variant"
10056 #: ../fish/guestfish-actions.pod:2158
10059 " inspect-get-product-variant root\n"
10064 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3240
10065 msgid "This returns the product variant of the inspected operating system."
10069 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3243
10071 "For Windows guests, this returns the contents of the Registry key C<HKLM"
10072 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
10073 "is usually a string such as C<Client> or C<Server> (other values are "
10074 "possible). This can be used to distinguish consumer and enterprise versions "
10075 "of Windows that have the same version number (for example, Windows 7 and "
10076 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10077 "the latter is C<Server>)."
10081 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3252
10083 "For enterprise Linux guests, in future we intend this to return the product "
10084 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10085 "implemented at present."
10089 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3256
10091 "If the product variant could not be determined, then the string C<unknown> "
10096 #: ../fish/guestfish-actions.pod:2179
10098 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
10099 "get-product-name>, L</inspect-get-major-version>."
10103 #: ../fish/guestfish-actions.pod:2183
10104 msgid "inspect-get-roots"
10108 #: ../fish/guestfish-actions.pod:2185
10111 " inspect-get-roots\n"
10116 #: ../fish/guestfish-actions.pod:2187
10118 "This function is a convenient way to get the list of root devices, as "
10119 "returned from a previous call to L</inspect-os>, but without redoing the "
10120 "whole inspection process."
10124 #: ../fish/guestfish-actions.pod:2191
10126 "This returns an empty list if either no root devices were found or the "
10127 "caller has not called L</inspect-os>."
10131 #: ../fish/guestfish-actions.pod:2196
10132 msgid "inspect-get-type"
10136 #: ../fish/guestfish-actions.pod:2198
10139 " inspect-get-type root\n"
10144 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3294
10146 "This returns the type of the inspected operating system. Currently defined "
10151 #: ../fish/guestfish-actions.pod:2205 ../src/guestfs-actions.pod:3299
10156 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3301
10157 msgid "Any Linux-based operating system."
10161 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3305
10162 msgid "Any Microsoft Windows operating system."
10166 #: ../fish/guestfish-actions.pod:2213 ../src/guestfs-actions.pod:3307
10167 msgid "\"freebsd\""
10171 #: ../fish/guestfish-actions.pod:2215 ../src/guestfs-actions.pod:3309
10176 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3313
10177 msgid "The operating system type could not be determined."
10181 #: ../fish/guestfish-actions.pod:2228
10182 msgid "inspect-get-windows-current-control-set"
10186 #: ../fish/guestfish-actions.pod:2230
10189 " inspect-get-windows-current-control-set root\n"
10194 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3333
10196 "This returns the Windows CurrentControlSet of the inspected guest. The "
10197 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10201 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3336
10203 "This call assumes that the guest is Windows and that the Registry could be "
10204 "examined by inspection. If this is not the case then an error is returned."
10208 #: ../fish/guestfish-actions.pod:2241
10209 msgid "inspect-get-windows-systemroot"
10213 #: ../fish/guestfish-actions.pod:2243
10216 " inspect-get-windows-systemroot root\n"
10221 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3353
10223 "This returns the Windows systemroot of the inspected guest. The systemroot "
10224 "is a directory path such as C</WINDOWS>."
10228 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3356
10230 "This call assumes that the guest is Windows and that the systemroot could be "
10231 "determined by inspection. If this is not the case then an error is returned."
10235 #: ../fish/guestfish-actions.pod:2254
10236 msgid "inspect-is-live"
10240 #: ../fish/guestfish-actions.pod:2256
10243 " inspect-is-live root\n"
10248 #: ../fish/guestfish-actions.pod:2258
10250 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10251 "then this returns true if a live image was detected on the disk."
10255 #: ../fish/guestfish-actions.pod:2264
10256 msgid "inspect-is-multipart"
10260 #: ../fish/guestfish-actions.pod:2266
10263 " inspect-is-multipart root\n"
10268 #: ../fish/guestfish-actions.pod:2268
10270 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10271 "then this returns true if the disk is part of a set."
10275 #: ../fish/guestfish-actions.pod:2274
10276 msgid "inspect-is-netinst"
10280 #: ../fish/guestfish-actions.pod:2276
10283 " inspect-is-netinst root\n"
10288 #: ../fish/guestfish-actions.pod:2278
10290 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10291 "then this returns true if the disk is a network installer, ie. not a self-"
10292 "contained install CD but one which is likely to require network access to "
10293 "complete the install."
10297 #: ../fish/guestfish-actions.pod:2286
10298 msgid "inspect-list-applications"
10302 #: ../fish/guestfish-actions.pod:2288
10305 " inspect-list-applications root\n"
10310 #: ../fish/guestfish-actions.pod:2290 ../src/guestfs-actions.pod:3423
10311 msgid "Return the list of applications installed in the operating system."
10315 #: ../fish/guestfish-actions.pod:2292
10317 "I<Note:> This call works differently from other parts of the inspection "
10318 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10319 "then mount up the disks, before calling this. Listing applications is a "
10320 "significantly more difficult operation which requires access to the full "
10321 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10322 "are just returning data cached in the libguestfs handle, this call actually "
10323 "reads parts of the mounted filesystems during the call."
10327 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3435
10329 "This returns an empty list if the inspection code was not able to determine "
10330 "the list of applications."
10334 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3438
10335 msgid "The application structure contains the following fields:"
10339 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3442
10340 msgid "C<app_name>"
10344 #: ../fish/guestfish-actions.pod:2311 ../src/guestfs-actions.pod:3444
10346 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10347 "guests, this is the package name."
10351 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3447
10352 msgid "C<app_display_name>"
10356 #: ../fish/guestfish-actions.pod:2316 ../src/guestfs-actions.pod:3449
10358 "The display name of the application, sometimes localized to the install "
10359 "language of the guest operating system."
10363 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3452
10365 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10366 "to display something can use C<app_name> instead."
10370 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3455
10371 msgid "C<app_epoch>"
10375 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3457
10377 "For package managers which use epochs, this contains the epoch of the "
10378 "package (an integer). If unavailable, this is returned as C<0>."
10382 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3460
10383 msgid "C<app_version>"
10387 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3462
10389 "The version string of the application or package. If unavailable this is "
10390 "returned as an empty string C<\"\">."
10394 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3465
10395 msgid "C<app_release>"
10399 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3467
10401 "The release string of the application or package, for package managers that "
10402 "use this. If unavailable this is returned as an empty string C<\"\">."
10406 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3471
10407 msgid "C<app_install_path>"
10411 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3473
10413 "The installation path of the application (on operating systems such as "
10414 "Windows which use installation paths). This path is in the format used by "
10415 "the guest operating system, it is not a libguestfs path."
10419 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3478
10420 msgid "If unavailable this is returned as an empty string C<\"\">."
10424 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3480
10425 msgid "C<app_trans_path>"
10429 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3482
10431 "The install path translated into a libguestfs path. If unavailable this is "
10432 "returned as an empty string C<\"\">."
10436 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3485
10437 msgid "C<app_publisher>"
10441 #: ../fish/guestfish-actions.pod:2354 ../src/guestfs-actions.pod:3487
10443 "The name of the publisher of the application, for package managers that use "
10444 "this. If unavailable this is returned as an empty string C<\"\">."
10448 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3491
10453 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3493
10455 "The URL (eg. upstream URL) of the application. If unavailable this is "
10456 "returned as an empty string C<\"\">."
10460 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3496
10461 msgid "C<app_source_package>"
10465 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3498
10467 "For packaging systems which support this, the name of the source package. "
10468 "If unavailable this is returned as an empty string C<\"\">."
10472 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3501
10473 msgid "C<app_summary>"
10477 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3503
10479 "A short (usually one line) description of the application or package. If "
10480 "unavailable this is returned as an empty string C<\"\">."
10484 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3506
10485 msgid "C<app_description>"
10489 #: ../fish/guestfish-actions.pod:2375 ../src/guestfs-actions.pod:3508
10491 "A longer description of the application or package. If unavailable this is "
10492 "returned as an empty string C<\"\">."
10496 #: ../fish/guestfish-actions.pod:2382
10501 #: ../fish/guestfish-actions.pod:2384
10509 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3526
10511 "This function uses other libguestfs functions and certain heuristics to "
10512 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10513 "for operating systems."
10517 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3530
10518 msgid "The list returned is empty if no operating systems were found."
10522 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3532
10524 "If one operating system was found, then this returns a list with a single "
10525 "element, which is the name of the root filesystem of this operating system. "
10526 "It is also possible for this function to return a list containing more than "
10527 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10528 "element being the root filesystem of one of the operating systems."
10532 #: ../fish/guestfish-actions.pod:2399
10534 "You can pass the root string(s) returned to other L</inspect-get-*> "
10535 "functions in order to query further information about each operating system, "
10536 "such as the name and version."
10540 #: ../fish/guestfish-actions.pod:2404
10542 "This function uses other libguestfs features such as L</mount-ro> and L</"
10543 "umount-all> in order to mount and unmount filesystems and look at the "
10544 "contents. This should be called with no disks currently mounted. The "
10545 "function may also use Augeas, so any existing Augeas handle will be closed."
10549 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3550
10551 "This function cannot decrypt encrypted disks. The caller must do that first "
10552 "(supplying the necessary keys) if the disk is encrypted."
10556 #: ../fish/guestfish-actions.pod:2416 ../fish/guestfish-actions.pod:2614
10557 #: ../fish/guestfish-actions.pod:2673
10558 msgid "See also L</list-filesystems>."
10562 #: ../fish/guestfish-actions.pod:2418
10563 msgid "is-blockdev"
10567 #: ../fish/guestfish-actions.pod:2420
10570 " is-blockdev path\n"
10575 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3570
10577 "This returns C<true> if and only if there is a block device with the given "
10582 #: ../fish/guestfish-actions.pod:2425 ../fish/guestfish-actions.pod:2443
10583 #: ../fish/guestfish-actions.pod:2462 ../fish/guestfish-actions.pod:2471
10584 #: ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2515
10585 #: ../fish/guestfish-actions.pod:2524
10586 msgid "See also L</stat>."
10590 #: ../fish/guestfish-actions.pod:2427
10595 #: ../fish/guestfish-actions.pod:2429
10603 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3584
10605 "This returns true iff this handle is busy processing a command (in the "
10610 #: ../fish/guestfish-actions.pod:2436
10615 #: ../fish/guestfish-actions.pod:2438
10618 " is-chardev path\n"
10623 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3599
10625 "This returns C<true> if and only if there is a character device with the "
10626 "given C<path> name."
10630 #: ../fish/guestfish-actions.pod:2445
10635 #: ../fish/guestfish-actions.pod:2447
10643 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3613
10645 "This returns true iff this handle is being configured (in the C<CONFIG> "
10650 #: ../fish/guestfish-actions.pod:2454
10655 #: ../fish/guestfish-actions.pod:2456
10663 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3628
10665 "This returns C<true> if and only if there is a directory with the given "
10666 "C<path> name. Note that it returns false for other objects like files."
10670 #: ../fish/guestfish-actions.pod:2464
10675 #: ../fish/guestfish-actions.pod:2466
10683 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3644
10685 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10686 "given C<path> name."
10690 #: ../fish/guestfish-actions.pod:2473
10695 #: ../fish/guestfish-actions.pod:2475
10703 #: ../fish/guestfish-actions.pod:2477 ../src/guestfs-actions.pod:3659
10705 "This returns C<true> if and only if there is a regular file with the given "
10706 "C<path> name. Note that it returns false for other objects like directories."
10710 #: ../fish/guestfish-actions.pod:2483
10711 msgid "is-launching"
10715 #: ../fish/guestfish-actions.pod:2485
10723 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3674
10725 "This returns true iff this handle is launching the subprocess (in the "
10726 "C<LAUNCHING> state)."
10730 #: ../fish/guestfish-actions.pod:2492
10735 #: ../fish/guestfish-actions.pod:2494
10743 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3689
10745 "This command tests whether C<device> is a logical volume, and returns true "
10746 "iff this is the case."
10750 #: ../fish/guestfish-actions.pod:2499
10755 #: ../fish/guestfish-actions.pod:2501
10763 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3701
10765 "This returns true iff this handle is ready to accept commands (in the "
10770 #: ../fish/guestfish-actions.pod:2508
10775 #: ../fish/guestfish-actions.pod:2510
10778 " is-socket path\n"
10783 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3716
10785 "This returns C<true> if and only if there is a Unix domain socket with the "
10786 "given C<path> name."
10790 #: ../fish/guestfish-actions.pod:2517
10795 #: ../fish/guestfish-actions.pod:2519
10798 " is-symlink path\n"
10803 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3731
10805 "This returns C<true> if and only if there is a symbolic link with the given "
10810 #: ../fish/guestfish-actions.pod:2526
10815 #: ../fish/guestfish-actions.pod:2528
10823 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3746
10825 "This returns true iff the file exists and the file is empty or it contains "
10830 #: ../fish/guestfish-actions.pod:2533
10831 msgid "is-zero-device"
10835 #: ../fish/guestfish-actions.pod:2535
10838 " is-zero-device device\n"
10843 #: ../fish/guestfish-actions.pod:2537 ../src/guestfs-actions.pod:3759
10844 msgid "This returns true iff the device exists and contains all zero bytes."
10848 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3761
10849 msgid "Note that for large devices this can take a long time to run."
10853 #: ../fish/guestfish-actions.pod:2541
10854 msgid "kill-subprocess"
10858 #: ../fish/guestfish-actions.pod:2543
10861 " kill-subprocess\n"
10866 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3772
10867 msgid "This kills the qemu subprocess. You should never need to call this."
10871 #: ../fish/guestfish-actions.pod:2547
10876 #: ../fish/guestfish-actions.pod:2549
10881 #: ../fish/guestfish-actions.pod:2551
10889 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3783
10891 "Internally libguestfs is implemented by running a virtual machine using "
10896 #: ../fish/guestfish-actions.pod:2556 ../src/guestfs-actions.pod:3786
10898 "You should call this after configuring the handle (eg. adding drives) but "
10899 "before performing any actions."
10903 #: ../fish/guestfish-actions.pod:2559
10908 #: ../fish/guestfish-actions.pod:2561
10911 " lchown owner group path\n"
10916 #: ../fish/guestfish-actions.pod:2563
10918 "Change the file owner to C<owner> and group to C<group>. This is like L</"
10919 "chown> but if C<path> is a symlink then the link itself is changed, not the "
10924 #: ../fish/guestfish-actions.pod:2571
10929 #: ../fish/guestfish-actions.pod:2573
10932 " lgetxattr path name\n"
10937 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3826
10939 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10940 "is a symlink, then this call returns an extended attribute from the symlink."
10944 #: ../fish/guestfish-actions.pod:2589
10945 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10949 #: ../fish/guestfish-actions.pod:2591
10954 #: ../fish/guestfish-actions.pod:2593
10957 " lgetxattrs path\n"
10962 #: ../fish/guestfish-actions.pod:2595
10964 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10965 "it returns the extended attributes of the link itself."
10969 #: ../fish/guestfish-actions.pod:2599
10974 #: ../fish/guestfish-actions.pod:2601
10982 #: ../fish/guestfish-actions.pod:2603 ../src/guestfs-actions.pod:3869
10984 "List all 9p filesystems attached to the guest. A list of mount tags is "
10989 #: ../fish/guestfish-actions.pod:2606
10990 msgid "list-devices"
10994 #: ../fish/guestfish-actions.pod:2608
11002 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3883
11003 msgid "List all the block devices."
11007 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3885
11008 msgid "The full block device names are returned, eg. C</dev/sda>."
11012 #: ../fish/guestfish-actions.pod:2616
11013 msgid "list-dm-devices"
11017 #: ../fish/guestfish-actions.pod:2618
11020 " list-dm-devices\n"
11025 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3900
11026 msgid "List all device mapper devices."
11030 #: ../fish/guestfish-actions.pod:2622
11032 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11033 "previous call to L</luks-open>."
11037 #: ../fish/guestfish-actions.pod:2625
11039 "Device mapper devices which correspond to logical volumes are I<not> "
11040 "returned in this list. Call L</lvs> if you want to list logical volumes."
11044 #: ../fish/guestfish-actions.pod:2629
11045 msgid "list-filesystems"
11049 #: ../fish/guestfish-actions.pod:2631
11052 " list-filesystems\n"
11057 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3920
11059 "This inspection command looks for filesystems on partitions, block devices "
11060 "and logical volumes, returning a list of devices containing filesystems and "
11065 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3924
11067 "The return value is a hash, where the keys are the devices containing "
11068 "filesystems, and the values are the filesystem types. For example:"
11072 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3928
11075 " \"/dev/sda1\" => \"ntfs\"\n"
11076 " \"/dev/sda2\" => \"ext2\"\n"
11077 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11078 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11083 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3933
11085 "The value can have the special value \"unknown\", meaning the content of the "
11086 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11090 #: ../fish/guestfish-actions.pod:2650
11092 "This command runs other libguestfs commands, which might include L</mount> "
11093 "and L</umount>, and therefore you should use this soon after launch and only "
11094 "when nothing is mounted."
11098 #: ../fish/guestfish-actions.pod:2654
11100 "Not all of the filesystems returned will be mountable. In particular, swap "
11101 "partitions are returned in the list. Also this command does not check that "
11102 "each filesystem found is valid and mountable, and some filesystems might be "
11103 "mountable but require special options. Filesystems may not all belong to a "
11104 "single logical operating system (use L</inspect-os> to look for OSes)."
11108 #: ../fish/guestfish-actions.pod:2662
11109 msgid "list-partitions"
11113 #: ../fish/guestfish-actions.pod:2664
11116 " list-partitions\n"
11121 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:3962
11122 msgid "List all the partitions detected on all block devices."
11126 #: ../fish/guestfish-actions.pod:2668 ../src/guestfs-actions.pod:3964
11127 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11131 #: ../fish/guestfish-actions.pod:2670
11133 "This does not return logical volumes. For that you will need to call L</"
11138 #: ../fish/guestfish-actions.pod:2675
11143 #: ../fish/guestfish-actions.pod:2677
11151 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3983
11153 "List the files in C<directory> (relative to the root directory, there is no "
11154 "cwd) in the format of 'ls -la'."
11158 #: ../fish/guestfish-actions.pod:2682 ../src/guestfs-actions.pod:3986
11160 "This command is mostly useful for interactive sessions. It is I<not> "
11161 "intended that you try to parse the output string."
11165 #: ../fish/guestfish-actions.pod:2685
11170 #: ../fish/guestfish-actions.pod:2687
11173 " ln target linkname\n"
11178 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4001
11179 msgid "This command creates a hard link using the C<ln> command."
11183 #: ../fish/guestfish-actions.pod:2691
11188 #: ../fish/guestfish-actions.pod:2693
11191 " ln-f target linkname\n"
11196 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:4014
11198 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11199 "option removes the link (C<linkname>) if it exists already."
11203 #: ../fish/guestfish-actions.pod:2698
11208 #: ../fish/guestfish-actions.pod:2700
11211 " ln-s target linkname\n"
11216 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4028
11217 msgid "This command creates a symbolic link using the C<ln -s> command."
11221 #: ../fish/guestfish-actions.pod:2704
11226 #: ../fish/guestfish-actions.pod:2706
11229 " ln-sf target linkname\n"
11234 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4041
11236 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11237 "option removes the link (C<linkname>) if it exists already."
11241 #: ../fish/guestfish-actions.pod:2711
11242 msgid "lremovexattr"
11246 #: ../fish/guestfish-actions.pod:2713
11249 " lremovexattr xattr path\n"
11254 #: ../fish/guestfish-actions.pod:2715
11256 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11257 "it removes an extended attribute of the link itself."
11261 #: ../fish/guestfish-actions.pod:2719
11266 #: ../fish/guestfish-actions.pod:2721
11274 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4069
11276 "List the files in C<directory> (relative to the root directory, there is no "
11277 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
11281 #: ../fish/guestfish-actions.pod:2727
11283 "This command is mostly useful for interactive sessions. Programs should "
11284 "probably use L</readdir> instead."
11288 #: ../fish/guestfish-actions.pod:2730
11293 #: ../fish/guestfish-actions.pod:2732
11296 " lsetxattr xattr val vallen path\n"
11301 #: ../fish/guestfish-actions.pod:2734
11303 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11304 "sets an extended attribute of the link itself."
11308 #: ../fish/guestfish-actions.pod:2738
11313 #: ../fish/guestfish-actions.pod:2740
11321 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:4552
11322 #: ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:6890
11323 msgid "Returns file information for the given C<path>."
11327 #: ../fish/guestfish-actions.pod:2744
11329 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11330 "the link is stat-ed, not the file it refers to."
11334 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4111
11335 msgid "This is the same as the C<lstat(2)> system call."
11339 #: ../fish/guestfish-actions.pod:2750
11344 #: ../fish/guestfish-actions.pod:2752
11347 " lstatlist path 'names ...'\n"
11352 #: ../fish/guestfish-actions.pod:2754
11354 "This call allows you to perform the L</lstat> operation on multiple files, "
11355 "where all files are in the directory C<path>. C<names> is the list of files "
11356 "from this directory."
11360 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4130
11362 "On return you get a list of stat structs, with a one-to-one correspondence "
11363 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11364 "then the C<ino> field of that structure is set to C<-1>."
11368 #: ../fish/guestfish-actions.pod:2763
11370 "This call is intended for programs that want to efficiently list a directory "
11371 "contents without making many round-trips. See also L</lxattrlist> for a "
11372 "similarly efficient call for getting extended attributes. Very long "
11373 "directory listings might cause the protocol message size to be exceeded, "
11374 "causing this call to fail. The caller must split up such requests into "
11375 "smaller groups of names."
11379 #: ../fish/guestfish-actions.pod:2771
11380 msgid "luks-add-key"
11384 #: ../fish/guestfish-actions.pod:2773
11387 " luks-add-key device keyslot\n"
11392 #: ../fish/guestfish-actions.pod:2775 ../src/guestfs-actions.pod:4158
11394 "This command adds a new key on LUKS device C<device>. C<key> is any "
11395 "existing key, and is used to access the device. C<newkey> is the new key to "
11396 "add. C<keyslot> is the key slot that will be replaced."
11400 #: ../fish/guestfish-actions.pod:2780
11402 "Note that if C<keyslot> already contains a key, then this command will "
11403 "fail. You have to use L</luks-kill-slot> first to remove that key."
11407 #: ../fish/guestfish-actions.pod:2784 ../fish/guestfish-actions.pod:2806
11408 #: ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2833
11409 #: ../fish/guestfish-actions.pod:2859 ../fish/guestfish-actions.pod:2869
11411 "This command has one or more key or passphrase parameters. Guestfish will "
11412 "prompt for these separately."
11416 #: ../fish/guestfish-actions.pod:2787
11421 #: ../fish/guestfish-actions.pod:2789
11424 " luks-close device\n"
11429 #: ../fish/guestfish-actions.pod:2791
11431 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
11432 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
11433 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
11438 #: ../fish/guestfish-actions.pod:2797
11439 msgid "luks-format"
11443 #: ../fish/guestfish-actions.pod:2799
11446 " luks-format device keyslot\n"
11451 #: ../fish/guestfish-actions.pod:2801 ../src/guestfs-actions.pod:4199
11453 "This command erases existing data on C<device> and formats the device as a "
11454 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11455 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11459 #: ../fish/guestfish-actions.pod:2809 ../fish/guestfish-actions.pod:2822
11460 #: ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:3560
11461 #: ../fish/guestfish-actions.pod:4086 ../fish/guestfish-actions.pod:4423
11462 #: ../fish/guestfish-actions.pod:4446 ../fish/guestfish-actions.pod:4468
11463 #: ../fish/guestfish-actions.pod:5214 ../src/guestfs-actions.pod:4206
11464 #: ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4372
11465 #: ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:6253
11466 #: ../src/guestfs-actions.pod:6704 ../src/guestfs-actions.pod:6734
11467 #: ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:7966
11469 "B<This command is dangerous. Without careful use you can easily destroy all "
11474 #: ../fish/guestfish-actions.pod:2812
11475 msgid "luks-format-cipher"
11479 #: ../fish/guestfish-actions.pod:2814
11482 " luks-format-cipher device keyslot cipher\n"
11487 #: ../fish/guestfish-actions.pod:2816
11489 "This command is the same as L</luks-format> but it also allows you to set "
11490 "the C<cipher> used."
11494 #: ../fish/guestfish-actions.pod:2825
11495 msgid "luks-kill-slot"
11499 #: ../fish/guestfish-actions.pod:2827
11502 " luks-kill-slot device keyslot\n"
11507 #: ../fish/guestfish-actions.pod:2829 ../src/guestfs-actions.pod:4246
11509 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11510 "device C<device>. C<key> must be one of the I<other> keys."
11514 #: ../fish/guestfish-actions.pod:2836
11519 #: ../fish/guestfish-actions.pod:2838
11522 " luks-open device mapname\n"
11527 #: ../fish/guestfish-actions.pod:2840 ../src/guestfs-actions.pod:4266
11529 "This command opens a block device which has been encrypted according to the "
11530 "Linux Unified Key Setup (LUKS) standard."
11534 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4269
11535 msgid "C<device> is the encrypted block device or partition."
11539 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4271
11541 "The caller must supply one of the keys associated with the LUKS block "
11542 "device, in the C<key> parameter."
11546 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4274
11548 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11549 "writes to this block device are decrypted from and encrypted to the "
11550 "underlying C<device> respectively."
11554 #: ../fish/guestfish-actions.pod:2852
11556 "If this block device contains LVM volume groups, then calling L</vgscan> "
11557 "followed by L</vg-activate-all> will make them visible."
11561 #: ../fish/guestfish-actions.pod:2856
11562 msgid "Use L</list-dm-devices> to list all device mapper devices."
11566 #: ../fish/guestfish-actions.pod:2862
11567 msgid "luks-open-ro"
11571 #: ../fish/guestfish-actions.pod:2864
11574 " luks-open-ro device mapname\n"
11579 #: ../fish/guestfish-actions.pod:2866
11581 "This is the same as L</luks-open> except that a read-only mapping is created."
11585 #: ../fish/guestfish-actions.pod:2872
11590 #: ../fish/guestfish-actions.pod:2874
11593 " lvcreate logvol volgroup mbytes\n"
11598 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4320
11600 "This creates an LVM logical volume called C<logvol> on the volume group "
11601 "C<volgroup>, with C<size> megabytes."
11605 #: ../fish/guestfish-actions.pod:2879
11606 msgid "lvm-canonical-lv-name"
11610 #: ../fish/guestfish-actions.pod:2881
11613 " lvm-canonical-lv-name lvname\n"
11618 #: ../fish/guestfish-actions.pod:2883 ../src/guestfs-actions.pod:4333
11620 "This converts alternative naming schemes for LVs that you might find to the "
11621 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
11626 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4337
11628 "This command returns an error if the C<lvname> parameter does not refer to a "
11633 #: ../fish/guestfish-actions.pod:2890
11634 msgid "See also L</is-lv>."
11638 #: ../fish/guestfish-actions.pod:2892
11639 msgid "lvm-clear-filter"
11643 #: ../fish/guestfish-actions.pod:2894
11646 " lvm-clear-filter\n"
11651 #: ../fish/guestfish-actions.pod:2896
11653 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11658 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2930
11659 #: ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4397
11661 "This command also clears the LVM cache and performs a volume group scan."
11665 #: ../fish/guestfish-actions.pod:2902
11666 msgid "lvm-remove-all"
11670 #: ../fish/guestfish-actions.pod:2904
11673 " lvm-remove-all\n"
11678 #: ../fish/guestfish-actions.pod:2906 ../src/guestfs-actions.pod:4367
11680 "This command removes all LVM logical volumes, volume groups and physical "
11685 #: ../fish/guestfish-actions.pod:2912
11686 msgid "lvm-set-filter"
11690 #: ../fish/guestfish-actions.pod:2914
11693 " lvm-set-filter 'devices ...'\n"
11698 #: ../fish/guestfish-actions.pod:2916 ../src/guestfs-actions.pod:4383
11700 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11701 "block devices in the list C<devices>, and will ignore all other attached "
11706 #: ../fish/guestfish-actions.pod:2920 ../src/guestfs-actions.pod:4387
11708 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11709 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11710 "there are two types of duplication possible: either cloned PVs/VGs which "
11711 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11712 "same name. In normal operation you cannot create this situation, but you "
11713 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11714 "inside the LVM metadata."
11718 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4400
11719 msgid "You can filter whole block devices or individual partitions."
11723 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4402
11725 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11726 "filesystem), even if you are not filtering out that VG."
11730 #: ../fish/guestfish-actions.pod:2939
11735 #: ../fish/guestfish-actions.pod:2941
11738 " lvremove device\n"
11743 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4416
11745 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11746 "LV, such as C</dev/VG/LV>."
11750 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4419
11752 "You can also remove all LVs in a volume group by specifying the VG name, C</"
11757 #: ../fish/guestfish-actions.pod:2949
11762 #: ../fish/guestfish-actions.pod:2951
11765 " lvrename logvol newlogvol\n"
11770 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4433
11771 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11775 #: ../fish/guestfish-actions.pod:2955
11780 #: ../fish/guestfish-actions.pod:2957
11783 " lvresize device mbytes\n"
11788 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4446
11790 "This resizes (expands or shrinks) an existing LVM logical volume to "
11791 "C<mbytes>. When reducing, data in the reduced part is lost."
11795 #: ../fish/guestfish-actions.pod:2963
11796 msgid "lvresize-free"
11800 #: ../fish/guestfish-actions.pod:2965
11803 " lvresize-free lv percent\n"
11808 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4461
11810 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11811 "remaining free space in the volume group. Commonly you would call this with "
11812 "pc = 100 which expands the logical volume as much as possible, using all "
11813 "remaining free space in the volume group."
11817 #: ../fish/guestfish-actions.pod:2973
11822 #: ../fish/guestfish-actions.pod:2975
11830 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4476
11832 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11837 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4479
11839 "This returns a list of the logical volume device names (eg. C</dev/"
11840 "VolGroup00/LogVol00>)."
11844 #: ../fish/guestfish-actions.pod:2983
11845 msgid "See also L</lvs-full>, L</list-filesystems>."
11849 #: ../fish/guestfish-actions.pod:2985
11854 #: ../fish/guestfish-actions.pod:2987
11862 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4495
11864 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11865 "(8)> command. The \"full\" version includes all fields."
11869 #: ../fish/guestfish-actions.pod:2992
11874 #: ../fish/guestfish-actions.pod:2994
11882 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4510
11883 msgid "This command returns the UUID of the LVM LV C<device>."
11887 #: ../fish/guestfish-actions.pod:2998
11892 #: ../fish/guestfish-actions.pod:3000
11895 " lxattrlist path 'names ...'\n"
11900 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4524
11902 "This call allows you to get the extended attributes of multiple files, where "
11903 "all files are in the directory C<path>. C<names> is the list of files from "
11908 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4528
11910 "On return you get a flat list of xattr structs which must be interpreted "
11911 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11912 "C<attrval> in this struct is zero-length to indicate there was an error "
11913 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11914 "number (the number of following attributes for this file, which could be C<"
11915 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11916 "for the first named file. This repeats for the second and subsequent files."
11920 #: ../fish/guestfish-actions.pod:3016
11922 "This call is intended for programs that want to efficiently list a directory "
11923 "contents without making many round-trips. See also L</lstatlist> for a "
11924 "similarly efficient call for getting standard stats. Very long directory "
11925 "listings might cause the protocol message size to be exceeded, causing this "
11926 "call to fail. The caller must split up such requests into smaller groups of "
11931 #: ../fish/guestfish-actions.pod:3024
11936 #: ../fish/guestfish-actions.pod:3026
11944 #: ../fish/guestfish-actions.pod:3028 ../src/guestfs-actions.pod:4558
11945 msgid "Create a directory named C<path>."
11949 #: ../fish/guestfish-actions.pod:3030
11954 #: ../fish/guestfish-actions.pod:3032
11957 " mkdir-mode path mode\n"
11962 #: ../fish/guestfish-actions.pod:3034 ../src/guestfs-actions.pod:4571
11964 "This command creates a directory, setting the initial permissions of the "
11965 "directory to C<mode>."
11969 #: ../fish/guestfish-actions.pod:3037 ../src/guestfs-actions.pod:4574
11971 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11972 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11977 #: ../fish/guestfish-actions.pod:3041
11978 msgid "See also L</mkdir>, L</umask>"
11982 #: ../fish/guestfish-actions.pod:3043
11987 #: ../fish/guestfish-actions.pod:3045
11995 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4590
11997 "Create a directory named C<path>, creating any parent directories as "
11998 "necessary. This is like the C<mkdir -p> shell command."
12002 #: ../fish/guestfish-actions.pod:3050
12007 #: ../fish/guestfish-actions.pod:3052
12010 " mkdtemp template\n"
12015 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4603
12017 "This command creates a temporary directory. The C<template> parameter "
12018 "should be a full pathname for the temporary directory name with the final "
12019 "six characters being \"XXXXXX\"."
12023 #: ../fish/guestfish-actions.pod:3059 ../src/guestfs-actions.pod:4608
12025 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12026 "being suitable for Windows filesystems."
12030 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4611
12031 msgid "The name of the temporary directory that was created is returned."
12035 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4614
12036 msgid "The temporary directory is created with mode 0700 and is owned by root."
12040 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4617
12042 "The caller is responsible for deleting the temporary directory and its "
12043 "contents after use."
12047 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4620
12048 msgid "See also: L<mkdtemp(3)>"
12052 #: ../fish/guestfish-actions.pod:3073
12057 #: ../fish/guestfish-actions.pod:3075
12060 " mke2fs-J fstype blocksize device journal\n"
12065 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4636
12067 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12068 "C<journal>. It is equivalent to the command:"
12072 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4640
12075 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12080 #: ../fish/guestfish-actions.pod:3083
12081 msgid "See also L</mke2journal>."
12085 #: ../fish/guestfish-actions.pod:3085
12090 #: ../fish/guestfish-actions.pod:3087
12093 " mke2fs-JL fstype blocksize device label\n"
12098 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4657
12100 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12101 "the journal labeled C<label>."
12105 #: ../fish/guestfish-actions.pod:3092
12106 msgid "See also L</mke2journal-L>."
12110 #: ../fish/guestfish-actions.pod:3094
12115 #: ../fish/guestfish-actions.pod:3096
12118 " mke2fs-JU fstype blocksize device uuid\n"
12123 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4675
12125 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12126 "the journal with UUID C<uuid>."
12130 #: ../fish/guestfish-actions.pod:3101
12131 msgid "See also L</mke2journal-U>."
12135 #: ../fish/guestfish-actions.pod:3103
12136 msgid "mke2journal"
12140 #: ../fish/guestfish-actions.pod:3105
12143 " mke2journal blocksize device\n"
12148 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4691
12150 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12155 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4694
12158 " mke2fs -O journal_dev -b blocksize device\n"
12163 #: ../fish/guestfish-actions.pod:3112
12164 msgid "mke2journal-L"
12168 #: ../fish/guestfish-actions.pod:3114
12171 " mke2journal-L blocksize label device\n"
12176 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4708
12177 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12181 #: ../fish/guestfish-actions.pod:3118
12182 msgid "mke2journal-U"
12186 #: ../fish/guestfish-actions.pod:3120
12189 " mke2journal-U blocksize uuid device\n"
12194 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4722
12195 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12199 #: ../fish/guestfish-actions.pod:3124
12204 #: ../fish/guestfish-actions.pod:3126
12207 " mkfifo mode path\n"
12212 #: ../fish/guestfish-actions.pod:3128
12214 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12215 "is just a convenient wrapper around L</mknod>."
12219 #: ../fish/guestfish-actions.pod:3134
12224 #: ../fish/guestfish-actions.pod:3136
12227 " mkfs fstype device\n"
12232 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4752
12234 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12235 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12239 #: ../fish/guestfish-actions.pod:3142
12244 #: ../fish/guestfish-actions.pod:3144
12247 " mkfs-b fstype blocksize device\n"
12252 #: ../fish/guestfish-actions.pod:3146
12254 "This call is similar to L</mkfs>, but it allows you to control the block "
12255 "size of the resulting filesystem. Supported block sizes depend on the "
12256 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12260 #: ../fish/guestfish-actions.pod:3151 ../fish/guestfish-actions.pod:3178
12261 #: ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4818
12263 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12268 #: ../fish/guestfish-actions.pod:3154
12270 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12275 #: ../fish/guestfish-actions.pod:3161
12280 #: ../fish/guestfish-actions.pod:3163
12283 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
12288 #: ../fish/guestfish-actions.pod:3165 ../src/guestfs-actions.pod:4805
12290 "This function creates a filesystem on C<device>. The filesystem type is "
12291 "C<fstype>, for example C<ext3>."
12295 #: ../fish/guestfish-actions.pod:3172 ../src/guestfs-actions.pod:4812
12296 msgid "C<blocksize>"
12300 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4814
12302 "The filesystem block size. Supported block sizes depend on the filesystem "
12303 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12308 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4821
12309 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12313 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4823
12314 msgid "C<features>"
12318 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4825
12319 msgid "This passes the I<-O> parameter to the external mkfs program."
12323 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4827
12325 "For certain filesystem types, this allows extra filesystem features to be "
12326 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12330 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4831
12332 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12337 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4834
12342 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4836
12344 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12345 "sets the inode size (only for ext2/3/4 filesystems at present)."
12349 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4839
12350 msgid "C<sectorsize>"
12354 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4841
12356 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12357 "sets sector size for ufs filesystem."
12361 #: ../fish/guestfish-actions.pod:3208
12362 msgid "mkmountpoint"
12366 #: ../fish/guestfish-actions.pod:3210
12369 " mkmountpoint exemptpath\n"
12374 #: ../fish/guestfish-actions.pod:3212
12376 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12377 "to create extra mountpoints before mounting the first filesystem."
12381 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4884
12383 "These calls are I<only> necessary in some very limited circumstances, mainly "
12384 "the case where you want to mount a mix of unrelated and/or read-only "
12385 "filesystems together."
12389 #: ../fish/guestfish-actions.pod:3220 ../src/guestfs-actions.pod:4888
12391 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12392 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12393 "inside that. You can unpack this as follows in guestfish:"
12397 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4893
12400 " add-ro Fedora-11-i686-Live.iso\n"
12402 " mkmountpoint /cd\n"
12403 " mkmountpoint /sqsh\n"
12404 " mkmountpoint /ext3fs\n"
12405 " mount /dev/sda /cd\n"
12406 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12407 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12412 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4902
12413 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12417 #: ../fish/guestfish-actions.pod:3236
12419 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12420 "unexpected errors if you try to mix these calls. It is safest to manually "
12421 "unmount filesystems and remove mountpoints after use."
12425 #: ../fish/guestfish-actions.pod:3240
12427 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12428 "for this to work for manual mountpoints, you must ensure that the innermost "
12429 "mountpoints have the longest pathnames, as in the example code above."
12433 #: ../fish/guestfish-actions.pod:3245 ../src/guestfs-actions.pod:4913
12435 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12439 #: ../fish/guestfish-actions.pod:3247
12441 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12442 "L</umount-all> to be called when the handle is closed which can also trigger "
12447 #: ../fish/guestfish-actions.pod:3251
12452 #: ../fish/guestfish-actions.pod:3253
12455 " mknod mode devmajor devminor path\n"
12460 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:4932
12462 "This call creates block or character special devices, or named pipes (FIFOs)."
12466 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4935
12468 "The C<mode> parameter should be the mode, using the standard constants. "
12469 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12470 "used when creating block and character special devices."
12474 #: ../fish/guestfish-actions.pod:3263
12476 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12477 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12478 "regular file). These constants are available in the standard Linux header "
12479 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12480 "wrappers around this command which bitwise OR in the appropriate constant "
12485 #: ../fish/guestfish-actions.pod:3273
12490 #: ../fish/guestfish-actions.pod:3275
12493 " mknod-b mode devmajor devminor path\n"
12498 #: ../fish/guestfish-actions.pod:3277
12500 "This call creates a block device node called C<path> with mode C<mode> and "
12501 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12502 "wrapper around L</mknod>."
12506 #: ../fish/guestfish-actions.pod:3283
12511 #: ../fish/guestfish-actions.pod:3285
12514 " mknod-c mode devmajor devminor path\n"
12519 #: ../fish/guestfish-actions.pod:3287
12521 "This call creates a char device node called C<path> with mode C<mode> and "
12522 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12523 "wrapper around L</mknod>."
12527 #: ../fish/guestfish-actions.pod:3293
12532 #: ../fish/guestfish-actions.pod:3295
12540 #: ../fish/guestfish-actions.pod:3297 ../src/guestfs-actions.pod:4998
12541 msgid "Create a swap partition on C<device>."
12545 #: ../fish/guestfish-actions.pod:3299
12550 #: ../fish/guestfish-actions.pod:3301
12553 " mkswap-L label device\n"
12558 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5011
12559 msgid "Create a swap partition on C<device> with label C<label>."
12563 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5013
12565 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
12566 "sda>), just to a partition. This appears to be a limitation of the kernel "
12571 #: ../fish/guestfish-actions.pod:3309
12576 #: ../fish/guestfish-actions.pod:3311
12579 " mkswap-U uuid device\n"
12584 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5028
12585 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12589 #: ../fish/guestfish-actions.pod:3315
12590 msgid "mkswap-file"
12594 #: ../fish/guestfish-actions.pod:3317
12597 " mkswap-file path\n"
12602 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5040
12603 msgid "Create a swap file."
12607 #: ../fish/guestfish-actions.pod:3321
12609 "This command just writes a swap file signature to an existing file. To "
12610 "create the file itself, use something like L</fallocate>."
12614 #: ../fish/guestfish-actions.pod:3324
12619 #: ../fish/guestfish-actions.pod:3326
12622 " modprobe modulename\n"
12627 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5055
12628 msgid "This loads a kernel module in the appliance."
12632 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5057
12634 "The kernel module must have been whitelisted when libguestfs was built (see "
12635 "C<appliance/kmod.whitelist.in> in the source)."
12639 #: ../fish/guestfish-actions.pod:3333
12644 #: ../fish/guestfish-actions.pod:3335
12647 " mount device mountpoint\n"
12652 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5071
12654 "Mount a guest disk at a position in the filesystem. Block devices are named "
12655 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12656 "those block devices contain partitions, they will have the usual names (eg. "
12657 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12661 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5077
12663 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12664 "mounted on C</> before others can be mounted. Other filesystems can only be "
12665 "mounted on directories which already exist."
12669 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5082
12671 "The mounted filesystem is writable, if we have sufficient permissions on the "
12672 "underlying device."
12676 #: ../fish/guestfish-actions.pod:3351
12678 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12679 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12680 "problems for users. If your program might need to work with older versions "
12681 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12682 "first parameter if you don't want any options)."
12686 #: ../fish/guestfish-actions.pod:3358
12691 #: ../fish/guestfish-actions.pod:3360
12694 " mount-9p mounttag mountpoint [options:..]\n"
12699 #: ../fish/guestfish-actions.pod:3362 ../src/guestfs-actions.pod:5111
12701 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12706 #: ../fish/guestfish-actions.pod:3365 ../src/guestfs-actions.pod:5114
12708 "If required, C<trans=virtio> will be automatically added to the options. "
12709 "Any other options required can be passed in the optional C<options> "
12714 #: ../fish/guestfish-actions.pod:3371
12719 #: ../fish/guestfish-actions.pod:3373
12722 " mount-loop file mountpoint\n"
12727 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5153
12729 "This command lets you mount C<file> (a filesystem image in a file) on a "
12730 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12735 #: ../fish/guestfish-actions.pod:3379
12736 msgid "mount-options"
12740 #: ../fish/guestfish-actions.pod:3381
12743 " mount-options options device mountpoint\n"
12748 #: ../fish/guestfish-actions.pod:3383
12750 "This is the same as the L</mount> command, but it allows you to set the "
12751 "mount options as for the L<mount(8)> I<-o> flag."
12755 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5173
12757 "If the C<options> parameter is an empty string, then no options are passed "
12758 "(all options default to whatever the filesystem uses)."
12762 #: ../fish/guestfish-actions.pod:3391
12767 #: ../fish/guestfish-actions.pod:3393
12770 " mount-ro device mountpoint\n"
12775 #: ../fish/guestfish-actions.pod:3395
12777 "This is the same as the L</mount> command, but it mounts the filesystem with "
12778 "the read-only (I<-o ro>) flag."
12782 #: ../fish/guestfish-actions.pod:3398
12787 #: ../fish/guestfish-actions.pod:3400
12790 " mount-vfs options vfstype device mountpoint\n"
12795 #: ../fish/guestfish-actions.pod:3402
12797 "This is the same as the L</mount> command, but it allows you to set both the "
12798 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12802 #: ../fish/guestfish-actions.pod:3406
12803 msgid "mountpoints"
12807 #: ../fish/guestfish-actions.pod:3408
12815 #: ../fish/guestfish-actions.pod:3410
12817 "This call is similar to L</mounts>. That call returns a list of devices. "
12818 "This one returns a hash table (map) of device name to directory where the "
12819 "device is mounted."
12823 #: ../fish/guestfish-actions.pod:3414
12828 #: ../fish/guestfish-actions.pod:3416
12836 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5234
12838 "This returns the list of currently mounted filesystems. It returns the list "
12839 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12843 #: ../fish/guestfish-actions.pod:3421 ../src/guestfs-actions.pod:5237
12844 msgid "Some internal mounts are not shown."
12848 #: ../fish/guestfish-actions.pod:3423
12849 msgid "See also: L</mountpoints>"
12853 #: ../fish/guestfish-actions.pod:3425
12858 #: ../fish/guestfish-actions.pod:3427
12866 #: ../fish/guestfish-actions.pod:3429 ../src/guestfs-actions.pod:5254
12868 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12869 "destination filename or destination directory."
12873 #: ../fish/guestfish-actions.pod:3432
12874 msgid "ntfs-3g-probe"
12878 #: ../fish/guestfish-actions.pod:3434
12881 " ntfs-3g-probe true|false device\n"
12886 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5268
12888 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12889 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12890 "write, and some cannot be mounted at all)."
12894 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5272
12896 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12897 "can be mounted read-write. Set it to false if you want to test if the "
12898 "volume can be mounted read-only."
12902 #: ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5276
12904 "The return value is an integer which C<0> if the operation would succeed, or "
12905 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12909 #: ../fish/guestfish-actions.pod:3448
12914 #: ../fish/guestfish-actions.pod:3450
12917 " ntfsresize device\n"
12922 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:3476
12923 #: ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5329
12925 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12926 "size of the underlying device."
12930 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5300
12932 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12933 "consistency check (for safety). You have to boot into Windows to perform "
12934 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12935 "resize filesystems which have been marked in this way. So in effect it is "
12936 "not possible to call ntfsresize multiple times on a single filesystem "
12937 "without booting into Windows between each resize."
12941 #: ../fish/guestfish-actions.pod:3463 ../fish/guestfish-actions.pod:3502
12942 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5355
12943 msgid "See also L<ntfsresize(8)>."
12947 #: ../fish/guestfish-actions.pod:3465 ../fish/guestfish-actions.pod:3513
12949 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12954 #: ../fish/guestfish-actions.pod:3472
12955 msgid "ntfsresize-opts"
12959 #: ../fish/guestfish-actions.pod:3474
12962 " ntfsresize-opts device [size:..] [force:..]\n"
12967 #: ../fish/guestfish-actions.pod:3485 ../src/guestfs-actions.pod:5338
12969 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12970 "resized to fit the container (eg. partition)."
12974 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5341
12979 #: ../fish/guestfish-actions.pod:3490 ../src/guestfs-actions.pod:5343
12981 "If this option is true, then force the resize of the filesystem even if the "
12982 "filesystem is marked as requiring a consistency check."
12986 #: ../fish/guestfish-actions.pod:3493
12988 "After the resize operation, the filesystem is always marked as requiring a "
12989 "consistency check (for safety). You have to boot into Windows to perform "
12990 "this check and clear this condition. If you I<don't> set the C<force> "
12991 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12992 "a single filesystem without booting into Windows between each resize."
12996 #: ../fish/guestfish-actions.pod:3506
12997 msgid "ntfsresize-size"
13001 #: ../fish/guestfish-actions.pod:3508
13004 " ntfsresize-size device size\n"
13009 #: ../fish/guestfish-actions.pod:3510
13011 "This command is the same as L</ntfsresize> except that it allows you to "
13012 "specify the new size (in bytes) explicitly."
13016 #: ../fish/guestfish-actions.pod:3520
13021 #: ../fish/guestfish-actions.pod:3522
13024 " part-add device prlogex startsect endsect\n"
13029 #: ../fish/guestfish-actions.pod:3524
13031 "This command adds a partition to C<device>. If there is no partition table "
13032 "on the device, call L</part-init> first."
13036 #: ../fish/guestfish-actions.pod:3527 ../src/guestfs-actions.pod:5416
13038 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13039 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13040 "C<logical>) and C<e> (or C<extended>) partition types."
13044 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5421
13046 "C<startsect> and C<endsect> are the start and end of the partition in "
13047 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13048 "from the end of the disk (C<-1> is the last sector)."
13052 #: ../fish/guestfish-actions.pod:3536
13054 "Creating a partition which covers the whole disk is not so easy. Use L</"
13055 "part-disk> to do that."
13059 #: ../fish/guestfish-actions.pod:3539
13064 #: ../fish/guestfish-actions.pod:3541
13067 " part-del device partnum\n"
13072 #: ../fish/guestfish-actions.pod:3543 ../src/guestfs-actions.pod:5439
13073 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13077 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5441
13079 "Note that in the case of MBR partitioning, deleting an extended partition "
13080 "also deletes any logical partitions it contains."
13084 #: ../fish/guestfish-actions.pod:3549
13089 #: ../fish/guestfish-actions.pod:3551
13092 " part-disk device parttype\n"
13097 #: ../fish/guestfish-actions.pod:3553
13099 "This command is simply a combination of L</part-init> followed by L</part-"
13100 "add> to create a single primary partition covering the whole disk."
13104 #: ../fish/guestfish-actions.pod:3557
13106 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13107 "possible values are described in L</part-init>."
13111 #: ../fish/guestfish-actions.pod:3563
13112 msgid "part-get-bootable"
13116 #: ../fish/guestfish-actions.pod:3565
13119 " part-get-bootable device partnum\n"
13124 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5477
13126 "This command returns true if the partition C<partnum> on C<device> has the "
13127 "bootable flag set."
13131 #: ../fish/guestfish-actions.pod:3570
13132 msgid "See also L</part-set-bootable>."
13136 #: ../fish/guestfish-actions.pod:3572
13137 msgid "part-get-mbr-id"
13141 #: ../fish/guestfish-actions.pod:3574
13144 " part-get-mbr-id device partnum\n"
13149 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5493
13151 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13152 "partition C<partnum>."
13156 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3723
13158 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13159 "undefined results for other partition table types (see L</part-get-"
13164 #: ../fish/guestfish-actions.pod:3583
13165 msgid "part-get-parttype"
13169 #: ../fish/guestfish-actions.pod:3585
13172 " part-get-parttype device\n"
13177 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5510
13179 "This command examines the partition table on C<device> and returns the "
13180 "partition table type (format) being used."
13184 #: ../fish/guestfish-actions.pod:3590
13186 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13187 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13188 "possible, although unusual. See L</part-init> for a full list."
13192 #: ../fish/guestfish-actions.pod:3595
13197 #: ../fish/guestfish-actions.pod:3597
13200 " part-init device parttype\n"
13205 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5530
13207 "This creates an empty partition table on C<device> of one of the partition "
13208 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13209 "(for large disks)."
13213 #: ../fish/guestfish-actions.pod:3603
13215 "Initially there are no partitions. Following this, you should call L</part-"
13216 "add> for each partition required."
13220 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5537
13221 msgid "Possible values for C<parttype> are:"
13225 #: ../fish/guestfish-actions.pod:3610 ../src/guestfs-actions.pod:5541
13230 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5543
13235 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5545
13236 msgid "Intel EFI / GPT partition table."
13240 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5547
13242 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13243 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13244 "the C<mbr> format."
13248 #: ../fish/guestfish-actions.pod:3620 ../src/guestfs-actions.pod:5551
13253 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5553
13258 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5555
13260 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13261 "Windows. This partition type will B<only> work for device sizes up to 2 "
13262 "TB. For large disks we recommend using C<gpt>."
13266 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5562
13268 "Other partition table types that may work but are not supported include:"
13272 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5567
13277 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5569
13278 msgid "AIX disk labels."
13282 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5571
13287 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5573
13292 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5575
13293 msgid "Amiga \"Rigid Disk Block\" format."
13297 #: ../fish/guestfish-actions.pod:3646 ../src/guestfs-actions.pod:5577
13302 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5579
13303 msgid "BSD disk labels."
13307 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5581
13312 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5583
13313 msgid "DASD, used on IBM mainframes."
13317 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5585
13322 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5587
13323 msgid "MIPS/SGI volumes."
13327 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5589
13332 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5591
13333 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13337 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5593
13342 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5595
13343 msgid "NEC PC-98 format, common in Japan apparently."
13347 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5597
13352 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5599
13353 msgid "Sun disk labels."
13357 #: ../fish/guestfish-actions.pod:3672
13362 #: ../fish/guestfish-actions.pod:3674
13365 " part-list device\n"
13370 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5613
13372 "This command parses the partition table on C<device> and returns the list of "
13373 "partitions found."
13377 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5616
13378 msgid "The fields in the returned structure are:"
13382 #: ../fish/guestfish-actions.pod:3683 ../src/guestfs-actions.pod:5620
13383 msgid "B<part_num>"
13387 #: ../fish/guestfish-actions.pod:3685 ../src/guestfs-actions.pod:5622
13388 msgid "Partition number, counting from 1."
13392 #: ../fish/guestfish-actions.pod:3687 ../src/guestfs-actions.pod:5624
13393 msgid "B<part_start>"
13397 #: ../fish/guestfish-actions.pod:3689
13399 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13400 "the device's sector size, see L</blockdev-getss>."
13404 #: ../fish/guestfish-actions.pod:3692 ../src/guestfs-actions.pod:5629
13405 msgid "B<part_end>"
13409 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5631
13410 msgid "End of the partition in bytes."
13414 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5633
13415 msgid "B<part_size>"
13419 #: ../fish/guestfish-actions.pod:3698 ../src/guestfs-actions.pod:5635
13420 msgid "Size of the partition in bytes."
13424 #: ../fish/guestfish-actions.pod:3702
13425 msgid "part-set-bootable"
13429 #: ../fish/guestfish-actions.pod:3704
13432 " part-set-bootable device partnum true|false\n"
13437 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5653
13439 "This sets the bootable flag on partition numbered C<partnum> on device "
13440 "C<device>. Note that partitions are numbered from 1."
13444 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5656
13446 "The bootable flag is used by some operating systems (notably Windows) to "
13447 "determine which partition to boot from. It is by no means universally "
13452 #: ../fish/guestfish-actions.pod:3713
13453 msgid "part-set-mbr-id"
13457 #: ../fish/guestfish-actions.pod:3715
13460 " part-set-mbr-id device partnum idbyte\n"
13465 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5672
13467 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13468 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13469 "documentation are in fact hexadecimal numbers, but usually documented "
13470 "without any leading \"0x\" which might be confusing."
13474 #: ../fish/guestfish-actions.pod:3727
13475 msgid "part-set-name"
13479 #: ../fish/guestfish-actions.pod:3729
13482 " part-set-name device partnum name\n"
13487 #: ../fish/guestfish-actions.pod:3731 ../src/guestfs-actions.pod:5694
13489 "This sets the partition name on partition numbered C<partnum> on device "
13490 "C<device>. Note that partitions are numbered from 1."
13494 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5697
13496 "The partition name can only be set on certain types of partition table. "
13497 "This works on C<gpt> but not on C<mbr> partitions."
13501 #: ../fish/guestfish-actions.pod:3737
13502 msgid "part-to-dev"
13506 #: ../fish/guestfish-actions.pod:3739
13509 " part-to-dev partition\n"
13514 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5710
13516 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13517 "partition number, returning the device name (eg. \"/dev/sdb\")."
13521 #: ../fish/guestfish-actions.pod:3745
13523 "The named partition must exist, for example as a string returned from L</"
13524 "list-partitions>."
13528 #: ../fish/guestfish-actions.pod:3748
13529 msgid "ping-daemon"
13533 #: ../fish/guestfish-actions.pod:3750
13541 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5727
13543 "This is a test probe into the guestfs daemon running inside the qemu "
13544 "subprocess. Calling this function checks that the daemon responds to the "
13545 "ping message, without affecting the daemon or attached block device(s) in "
13550 #: ../fish/guestfish-actions.pod:3757
13555 #: ../fish/guestfish-actions.pod:3759
13558 " pread path count offset\n"
13563 #: ../fish/guestfish-actions.pod:3761 ../src/guestfs-actions.pod:5745
13565 "This command lets you read part of a file. It reads C<count> bytes of the "
13566 "file, starting at C<offset>, from file C<path>."
13570 #: ../fish/guestfish-actions.pod:3764 ../fish/guestfish-actions.pod:3779
13571 #: ../src/guestfs-actions.pod:5748 ../src/guestfs-actions.pod:5774
13573 "This may read fewer bytes than requested. For further details see the "
13574 "L<pread(2)> system call."
13578 #: ../fish/guestfish-actions.pod:3767
13579 msgid "See also L</pwrite>, L</pread-device>."
13583 #: ../fish/guestfish-actions.pod:3772
13584 msgid "pread-device"
13588 #: ../fish/guestfish-actions.pod:3774
13591 " pread-device device count offset\n"
13596 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5771
13598 "This command lets you read part of a file. It reads C<count> bytes of "
13599 "C<device>, starting at C<offset>."
13603 #: ../fish/guestfish-actions.pod:3782
13604 msgid "See also L</pread>."
13608 #: ../fish/guestfish-actions.pod:3787
13613 #: ../fish/guestfish-actions.pod:3789
13616 " pvcreate device\n"
13621 #: ../fish/guestfish-actions.pod:3791 ../src/guestfs-actions.pod:5794
13623 "This creates an LVM physical volume on the named C<device>, where C<device> "
13624 "should usually be a partition name such as C</dev/sda1>."
13628 #: ../fish/guestfish-actions.pod:3795
13633 #: ../fish/guestfish-actions.pod:3797
13636 " pvremove device\n"
13641 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5808
13643 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13648 #: ../fish/guestfish-actions.pod:3802 ../src/guestfs-actions.pod:5811
13650 "The implementation uses the C<pvremove> command which refuses to wipe "
13651 "physical volumes that contain any volume groups, so you have to remove those "
13656 #: ../fish/guestfish-actions.pod:3806
13661 #: ../fish/guestfish-actions.pod:3808
13664 " pvresize device\n"
13669 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5825
13671 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13672 "the new size of the underlying device."
13676 #: ../fish/guestfish-actions.pod:3813
13677 msgid "pvresize-size"
13681 #: ../fish/guestfish-actions.pod:3815
13684 " pvresize-size device size\n"
13689 #: ../fish/guestfish-actions.pod:3817
13691 "This command is the same as L</pvresize> except that it allows you to "
13692 "specify the new size (in bytes) explicitly."
13696 #: ../fish/guestfish-actions.pod:3820
13701 #: ../fish/guestfish-actions.pod:3822
13709 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5851
13711 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13716 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5854
13718 "This returns a list of just the device names that contain PVs (eg. C</dev/"
13723 #: ../fish/guestfish-actions.pod:3830
13724 msgid "See also L</pvs-full>."
13728 #: ../fish/guestfish-actions.pod:3832
13733 #: ../fish/guestfish-actions.pod:3834
13741 #: ../fish/guestfish-actions.pod:3836 ../src/guestfs-actions.pod:5870
13743 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13744 "(8)> command. The \"full\" version includes all fields."
13748 #: ../fish/guestfish-actions.pod:3839
13753 #: ../fish/guestfish-actions.pod:3841
13761 #: ../fish/guestfish-actions.pod:3843 ../src/guestfs-actions.pod:5885
13762 msgid "This command returns the UUID of the LVM PV C<device>."
13766 #: ../fish/guestfish-actions.pod:3845
13771 #: ../fish/guestfish-actions.pod:3847
13774 " pwrite path content offset\n"
13779 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5901
13781 "This command writes to part of a file. It writes the data buffer C<content> "
13782 "to the file C<path> starting at offset C<offset>."
13786 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:5904
13788 "This command implements the L<pwrite(2)> system call, and like that system "
13789 "call it may not write the full data requested. The return value is the "
13790 "number of bytes that were actually written to the file. This could even be "
13791 "0, although short writes are unlikely for regular files in ordinary "
13796 #: ../fish/guestfish-actions.pod:3858
13797 msgid "See also L</pread>, L</pwrite-device>."
13801 #: ../fish/guestfish-actions.pod:3863
13802 msgid "pwrite-device"
13806 #: ../fish/guestfish-actions.pod:3865
13809 " pwrite-device device content offset\n"
13814 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5928
13816 "This command writes to part of a device. It writes the data buffer "
13817 "C<content> to C<device> starting at offset C<offset>."
13821 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5931
13823 "This command implements the L<pwrite(2)> system call, and like that system "
13824 "call it may not write the full data requested (although short writes to disk "
13825 "devices and partitions are probably impossible with standard Linux kernels)."
13829 #: ../fish/guestfish-actions.pod:3875
13830 msgid "See also L</pwrite>."
13834 #: ../fish/guestfish-actions.pod:3880
13839 #: ../fish/guestfish-actions.pod:3882
13842 " read-file path\n"
13847 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5952
13848 msgid "This calls returns the contents of the file C<path> as a buffer."
13852 #: ../fish/guestfish-actions.pod:3887
13854 "Unlike L</cat>, this function can correctly handle files that contain "
13855 "embedded ASCII NUL characters. However unlike L</download>, this function "
13856 "is limited in the total size of file that can be handled."
13860 #: ../fish/guestfish-actions.pod:3895
13865 #: ../fish/guestfish-actions.pod:3897
13868 " read-lines path\n"
13873 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5977
13875 "The file contents are returned as a list of lines. Trailing C<LF> and "
13876 "C<CRLF> character sequences are I<not> returned."
13880 #: ../fish/guestfish-actions.pod:3904
13882 "Note that this function cannot correctly handle binary files (specifically, "
13883 "files containing C<\\0> character which is treated as end of line). For "
13884 "those you need to use the L</read-file> function which has a more complex "
13889 #: ../fish/guestfish-actions.pod:3909
13894 #: ../fish/guestfish-actions.pod:3911
13902 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5997
13903 msgid "This returns the list of directory entries in directory C<dir>."
13907 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5999
13909 "All entries in the directory are returned, including C<.> and C<..>. The "
13910 "entries are I<not> sorted, but returned in the same order as the underlying "
13915 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6003
13917 "Also this call returns basic file type information about each file. The "
13918 "C<ftyp> field will contain one of the following characters:"
13922 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:6008
13927 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6010
13928 msgid "Block special"
13932 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6012
13937 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6014
13938 msgid "Char special"
13942 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6016
13947 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6018
13952 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6020
13957 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6022
13958 msgid "FIFO (named pipe)"
13962 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6024
13967 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6026
13968 msgid "Symbolic link"
13972 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6028
13977 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6030
13978 msgid "Regular file"
13982 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6032
13987 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6034
13992 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6036
13997 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6038
13998 msgid "Unknown file type"
14002 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6040
14007 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6042
14009 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14013 #: ../fish/guestfish-actions.pod:3963
14015 "This function is primarily intended for use by programs. To get a simple "
14016 "list of names, use L</ls>. To get a printable directory for human "
14017 "consumption, use L</ll>."
14021 #: ../fish/guestfish-actions.pod:3967
14026 #: ../fish/guestfish-actions.pod:3969
14034 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6063
14035 msgid "This command reads the target of a symbolic link."
14039 #: ../fish/guestfish-actions.pod:3973
14040 msgid "readlinklist"
14044 #: ../fish/guestfish-actions.pod:3975
14047 " readlinklist path 'names ...'\n"
14052 #: ../fish/guestfish-actions.pod:3977 ../src/guestfs-actions.pod:6077
14054 "This call allows you to do a C<readlink> operation on multiple files, where "
14055 "all files are in the directory C<path>. C<names> is the list of files from "
14060 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6081
14062 "On return you get a list of strings, with a one-to-one correspondence to the "
14063 "C<names> list. Each string is the value of the symbolic link."
14067 #: ../fish/guestfish-actions.pod:3985 ../src/guestfs-actions.pod:6085
14069 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14070 "result string is the empty string C<\"\">. However the whole operation is "
14071 "completed even if there were C<readlink(2)> errors, and so you can call this "
14072 "function with names where you don't know if they are symbolic links already "
14073 "(albeit slightly less efficient)."
14077 #: ../fish/guestfish-actions.pod:3992 ../src/guestfs-actions.pod:6092
14079 "This call is intended for programs that want to efficiently list a directory "
14080 "contents without making many round-trips. Very long directory listings "
14081 "might cause the protocol message size to be exceeded, causing this call to "
14082 "fail. The caller must split up such requests into smaller groups of names."
14086 #: ../fish/guestfish-actions.pod:3999
14091 #: ../fish/guestfish-actions.pod:4001
14099 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6111
14101 "Return the canonicalized absolute pathname of C<path>. The returned path "
14102 "has no C<.>, C<..> or symbolic link path elements."
14106 #: ../fish/guestfish-actions.pod:4006
14107 msgid "removexattr"
14111 #: ../fish/guestfish-actions.pod:4008
14114 " removexattr xattr path\n"
14119 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6126
14121 "This call removes the extended attribute named C<xattr> of the file C<path>."
14125 #: ../fish/guestfish-actions.pod:4013
14126 msgid "See also: L</lremovexattr>, L<attr(5)>."
14130 #: ../fish/guestfish-actions.pod:4015
14135 #: ../fish/guestfish-actions.pod:4017
14138 " resize2fs device\n"
14143 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6141
14145 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14146 "underlying device."
14150 #: ../fish/guestfish-actions.pod:4022
14152 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14153 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14154 "gives an error about this and sometimes not. In any case, it is always safe "
14155 "to call L</e2fsck-f> before calling this function."
14159 #: ../fish/guestfish-actions.pod:4028
14160 msgid "resize2fs-M"
14164 #: ../fish/guestfish-actions.pod:4030
14167 " resize2fs-M device\n"
14172 #: ../fish/guestfish-actions.pod:4032
14174 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14175 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14180 #: ../fish/guestfish-actions.pod:4036
14182 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14183 "and read the C<Block size> and C<Block count> values. These two numbers, "
14184 "multiplied together, give the resulting size of the minimal filesystem in "
14189 #: ../fish/guestfish-actions.pod:4041
14190 msgid "resize2fs-size"
14194 #: ../fish/guestfish-actions.pod:4043
14197 " resize2fs-size device size\n"
14202 #: ../fish/guestfish-actions.pod:4045
14204 "This command is the same as L</resize2fs> except that it allows you to "
14205 "specify the new size (in bytes) explicitly."
14209 #: ../fish/guestfish-actions.pod:4048
14214 #: ../fish/guestfish-actions.pod:4050
14222 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6193
14223 msgid "Remove the single file C<path>."
14227 #: ../fish/guestfish-actions.pod:4054
14232 #: ../fish/guestfish-actions.pod:4056
14240 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6205
14242 "Remove the file or directory C<path>, recursively removing the contents if "
14243 "its a directory. This is like the C<rm -rf> shell command."
14247 #: ../fish/guestfish-actions.pod:4062
14252 #: ../fish/guestfish-actions.pod:4064
14260 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6219
14261 msgid "Remove the single directory C<path>."
14265 #: ../fish/guestfish-actions.pod:4068
14266 msgid "rmmountpoint"
14270 #: ../fish/guestfish-actions.pod:4070
14273 " rmmountpoint exemptpath\n"
14278 #: ../fish/guestfish-actions.pod:4072
14280 "This calls removes a mountpoint that was previously created with L</"
14281 "mkmountpoint>. See L</mkmountpoint> for full details."
14285 #: ../fish/guestfish-actions.pod:4076
14286 msgid "scrub-device"
14290 #: ../fish/guestfish-actions.pod:4078
14293 " scrub-device device\n"
14298 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6245
14300 "This command writes patterns over C<device> to make data retrieval more "
14305 #: ../fish/guestfish-actions.pod:4083 ../fish/guestfish-actions.pod:4098
14306 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6248
14307 #: ../src/guestfs-actions.pod:6269 ../src/guestfs-actions.pod:6288
14309 "It is an interface to the L<scrub(1)> program. See that manual page for "
14314 #: ../fish/guestfish-actions.pod:4089
14319 #: ../fish/guestfish-actions.pod:4091
14322 " scrub-file file\n"
14327 #: ../fish/guestfish-actions.pod:4093 ../src/guestfs-actions.pod:6264
14329 "This command writes patterns over a file to make data retrieval more "
14334 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6267
14335 msgid "The file is I<removed> after scrubbing."
14339 #: ../fish/guestfish-actions.pod:4101
14340 msgid "scrub-freespace"
14344 #: ../fish/guestfish-actions.pod:4103
14347 " scrub-freespace dir\n"
14352 #: ../fish/guestfish-actions.pod:4105
14354 "This command creates the directory C<dir> and then fills it with files until "
14355 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14356 "deletes them. The intention is to scrub any free space on the partition "
14357 "containing C<dir>."
14361 #: ../fish/guestfish-actions.pod:4114
14366 #: ../fish/guestfish-actions.pod:4116
14371 #: ../fish/guestfish-actions.pod:4118
14374 " set-append append\n"
14379 #: ../fish/guestfish-actions.pod:4120 ../src/guestfs-actions.pod:6301
14381 "This function is used to add additional options to the guest kernel command "
14386 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6304
14388 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14389 "environment variable."
14393 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6307
14395 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14396 "(libguestfs always adds a few of its own)."
14400 #: ../fish/guestfish-actions.pod:4129
14401 msgid "set-attach-method"
14405 #: ../fish/guestfish-actions.pod:4131
14406 msgid "attach-method"
14410 #: ../fish/guestfish-actions.pod:4133
14413 " set-attach-method attachmethod\n"
14418 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6320
14420 "Set the method that libguestfs uses to connect to the back end guestfsd "
14421 "daemon. Possible methods are:"
14425 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6325
14426 #: ../src/guestfs.pod:2901
14427 msgid "C<appliance>"
14431 #: ../fish/guestfish-actions.pod:4142 ../src/guestfs-actions.pod:6327
14433 "Launch an appliance and connect to it. This is the ordinary method and the "
14438 #: ../fish/guestfish-actions.pod:4145 ../src/guestfs-actions.pod:6330
14439 msgid "C<unix:I<path>>"
14443 #: ../fish/guestfish-actions.pod:4147 ../src/guestfs-actions.pod:6332
14444 msgid "Connect to the Unix domain socket I<path>."
14448 #: ../fish/guestfish-actions.pod:4149 ../src/guestfs-actions.pod:6334
14450 "This method lets you connect to an existing daemon or (using virtio-serial) "
14451 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14452 "RUNNING DAEMONS>."
14456 #: ../fish/guestfish-actions.pod:4155
14457 msgid "set-autosync"
14461 #: ../fish/guestfish-actions.pod:4157
14466 #: ../fish/guestfish-actions.pod:4159
14469 " set-autosync true|false\n"
14474 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6350
14476 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14477 "effort attempt to make filesystems consistent and synchronized when the "
14478 "handle is closed (also if the program exits without closing handles)."
14482 #: ../fish/guestfish-actions.pod:4166 ../src/guestfs-actions.pod:6355
14484 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14485 "disabled by default)."
14489 #: ../fish/guestfish-actions.pod:4169
14494 #: ../fish/guestfish-actions.pod:4171
14499 #: ../fish/guestfish-actions.pod:4173
14502 " set-direct true|false\n"
14507 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6368
14509 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14510 "passed directly through to the appliance once it is launched."
14514 #: ../fish/guestfish-actions.pod:4179
14516 "One consequence of this is that log messages aren't caught by the library "
14517 "and handled by L</set-log-message-callback>, but go straight to stdout."
14521 #: ../fish/guestfish-actions.pod:4183 ../src/guestfs-actions.pod:6376
14522 msgid "You probably don't want to use this unless you know what you are doing."
14526 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6379
14527 msgid "The default is disabled."
14531 #: ../fish/guestfish-actions.pod:4188
14532 msgid "set-e2label"
14536 #: ../fish/guestfish-actions.pod:4190
14539 " set-e2label device label\n"
14544 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6392
14546 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14547 "C<label>. Filesystem labels are limited to 16 characters."
14551 #: ../fish/guestfish-actions.pod:4196
14553 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14554 "label on a filesystem."
14558 #: ../fish/guestfish-actions.pod:4199
14563 #: ../fish/guestfish-actions.pod:4201
14566 " set-e2uuid device uuid\n"
14571 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6410
14573 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14574 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14575 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14579 #: ../fish/guestfish-actions.pod:4208
14581 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14582 "UUID of a filesystem."
14586 #: ../fish/guestfish-actions.pod:4211
14587 msgid "set-memsize"
14591 #: ../fish/guestfish-actions.pod:4213
14596 #: ../fish/guestfish-actions.pod:4215
14599 " set-memsize memsize\n"
14604 #: ../fish/guestfish-actions.pod:4217
14606 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14607 "This only has any effect if called before L</launch>."
14611 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6432
14613 "You can also change this by setting the environment variable "
14614 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14618 #: ../fish/guestfish-actions.pod:4228
14619 msgid "set-network"
14623 #: ../fish/guestfish-actions.pod:4230
14628 #: ../fish/guestfish-actions.pod:4232
14631 " set-network true|false\n"
14636 #: ../fish/guestfish-actions.pod:4234 ../src/guestfs-actions.pod:6449
14638 "If C<network> is true, then the network is enabled in the libguestfs "
14639 "appliance. The default is false."
14643 #: ../fish/guestfish-actions.pod:4237 ../src/guestfs-actions.pod:6452
14645 "This affects whether commands are able to access the network (see L<guestfs"
14646 "(3)/RUNNING COMMANDS>)."
14650 #: ../fish/guestfish-actions.pod:4240
14652 "You must call this before calling L</launch>, otherwise it has no effect."
14656 #: ../fish/guestfish-actions.pod:4243
14661 #: ../fish/guestfish-actions.pod:4247
14664 " set-path searchpath\n"
14669 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6468
14670 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14674 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6470
14676 "The default is C<$libdir/guestfs> unless overridden by setting "
14677 "C<LIBGUESTFS_PATH> environment variable."
14681 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6473
14682 msgid "Setting C<path> to C<NULL> restores the default path."
14686 #: ../fish/guestfish-actions.pod:4256
14691 #: ../fish/guestfish-actions.pod:4258
14696 #: ../fish/guestfish-actions.pod:4260
14699 " set-pgroup true|false\n"
14704 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6485
14706 "If C<pgroup> is true, child processes are placed into their own process "
14711 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6488
14713 "The practical upshot of this is that signals like C<SIGINT> (from users "
14714 "pressing C<^C>) won't be received by the child process."
14718 #: ../fish/guestfish-actions.pod:4268 ../src/guestfs-actions.pod:6491
14720 "The default for this flag is false, because usually you want C<^C> to kill "
14725 #: ../fish/guestfish-actions.pod:4271
14730 #: ../fish/guestfish-actions.pod:4273
14735 #: ../fish/guestfish-actions.pod:4275
14743 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6504
14744 msgid "Set the qemu binary that we will use."
14748 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6506
14750 "The default is chosen when the library was compiled by the configure script."
14754 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6509
14756 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14761 #: ../fish/guestfish-actions.pod:4285 ../src/guestfs-actions.pod:6512
14762 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14766 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6514
14768 "Note that you should call this function as early as possible after creating "
14769 "the handle. This is because some pre-launch operations depend on testing "
14770 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14771 "don't retest features, and so you might see inconsistent results. Using the "
14772 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14773 "the qemu binary at the same time as the handle is created."
14777 #: ../fish/guestfish-actions.pod:4295
14778 msgid "set-recovery-proc"
14782 #: ../fish/guestfish-actions.pod:4297
14783 msgid "recovery-proc"
14787 #: ../fish/guestfish-actions.pod:4299
14790 " set-recovery-proc true|false\n"
14795 #: ../fish/guestfish-actions.pod:4301
14797 "If this is called with the parameter C<false> then L</launch> does not "
14798 "create a recovery process. The purpose of the recovery process is to stop "
14799 "runaway qemu processes in the case where the main program aborts abruptly."
14803 #: ../fish/guestfish-actions.pod:4306
14805 "This only has any effect if called before L</launch>, and the default is "
14810 #: ../fish/guestfish-actions.pod:4309 ../src/guestfs-actions.pod:6540
14812 "About the only time when you would want to disable this is if the main "
14813 "process will fork itself into the background (\"daemonize\" itself). In "
14814 "this case the recovery process thinks that the main program has disappeared "
14815 "and so kills qemu, which is not very helpful."
14819 #: ../fish/guestfish-actions.pod:4315
14820 msgid "set-selinux"
14824 #: ../fish/guestfish-actions.pod:4317
14829 #: ../fish/guestfish-actions.pod:4319
14832 " set-selinux true|false\n"
14837 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6556
14839 "This sets the selinux flag that is passed to the appliance at boot time. "
14840 "The default is C<selinux=0> (disabled)."
14844 #: ../fish/guestfish-actions.pod:4324 ../src/guestfs-actions.pod:6559
14846 "Note that if SELinux is enabled, it is always in Permissive mode "
14847 "(C<enforcing=0>)."
14851 #: ../fish/guestfish-actions.pod:4330
14856 #: ../fish/guestfish-actions.pod:4332
14861 #: ../fish/guestfish-actions.pod:4334
14869 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6575
14871 "Change the number of virtual CPUs assigned to the appliance. The default is "
14872 "C<1>. Increasing this may improve performance, though often it has no "
14877 #: ../fish/guestfish-actions.pod:4340
14878 msgid "This function must be called before L</launch>."
14882 #: ../fish/guestfish-actions.pod:4342
14887 #: ../fish/guestfish-actions.pod:4344
14892 #: ../fish/guestfish-actions.pod:4346
14895 " set-trace true|false\n"
14900 #: ../fish/guestfish-actions.pod:4348 ../src/guestfs-actions.pod:6591
14902 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14903 "return values are traced."
14907 #: ../fish/guestfish-actions.pod:4351 ../src/guestfs-actions.pod:6594
14909 "If you want to trace C API calls into libguestfs (and other libraries) then "
14910 "possibly a better way is to use the external ltrace(1) command."
14914 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6598
14916 "Command traces are disabled unless the environment variable "
14917 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14921 #: ../fish/guestfish-actions.pod:4358
14923 "Trace messages are normally sent to C<stderr>, unless you register a "
14924 "callback to send them somewhere else (see L</set-event-callback>)."
14928 #: ../fish/guestfish-actions.pod:4362
14929 msgid "set-verbose"
14933 #: ../fish/guestfish-actions.pod:4364
14938 #: ../fish/guestfish-actions.pod:4366
14941 " set-verbose true|false\n"
14946 #: ../fish/guestfish-actions.pod:4368 ../src/guestfs-actions.pod:6615
14947 msgid "If C<verbose> is true, this turns on verbose messages."
14951 #: ../fish/guestfish-actions.pod:4370 ../src/guestfs-actions.pod:6617
14953 "Verbose messages are disabled unless the environment variable "
14954 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14958 #: ../fish/guestfish-actions.pod:4373
14960 "Verbose messages are normally sent to C<stderr>, unless you register a "
14961 "callback to send them somewhere else (see L</set-event-callback>)."
14965 #: ../fish/guestfish-actions.pod:4377
14970 #: ../fish/guestfish-actions.pod:4379
14973 " setcon context\n"
14978 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6634
14980 "This sets the SELinux security context of the daemon to the string "
14985 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6637
14986 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14990 #: ../fish/guestfish-actions.pod:4386
14995 #: ../fish/guestfish-actions.pod:4388
14998 " setxattr xattr val vallen path\n"
15003 #: ../fish/guestfish-actions.pod:4390 ../src/guestfs-actions.pod:6652
15005 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15006 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15010 #: ../fish/guestfish-actions.pod:4394
15011 msgid "See also: L</lsetxattr>, L<attr(5)>."
15015 #: ../fish/guestfish-actions.pod:4396
15020 #: ../fish/guestfish-actions.pod:4398
15023 " sfdisk device cyls heads sectors 'lines ...'\n"
15028 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6679
15030 "This is a direct interface to the L<sfdisk(8)> program for creating "
15031 "partitions on block devices."
15035 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6682
15036 msgid "C<device> should be a block device, for example C</dev/sda>."
15040 #: ../fish/guestfish-actions.pod:4405 ../src/guestfs-actions.pod:6684
15042 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15043 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
15044 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15045 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15046 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15047 "the kernel) cannot work out the right geometry and you will need to tell it."
15051 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6692
15053 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15054 "refer to the L<sfdisk(8)> manpage."
15058 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6695
15060 "To create a single partition occupying the whole disk, you would pass "
15061 "C<lines> as a single element list, when the single element being the string "
15066 #: ../fish/guestfish-actions.pod:4420
15067 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
15071 #: ../fish/guestfish-actions.pod:4426 ../fish/guestfish-actions.pod:4449
15072 #: ../fish/guestfish-actions.pod:4471
15074 "I<This function is deprecated.> In new code, use the L</part_add> call "
15079 #: ../fish/guestfish-actions.pod:4433
15084 #: ../fish/guestfish-actions.pod:4435
15087 " sfdiskM device 'lines ...'\n"
15092 #: ../fish/guestfish-actions.pod:4437
15094 "This is a simplified interface to the L</sfdisk> command, where partition "
15095 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
15096 "you don't need to specify the cyls, heads and sectors parameters which were "
15097 "rarely if ever used anyway."
15101 #: ../fish/guestfish-actions.pod:4443
15102 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
15106 #: ../fish/guestfish-actions.pod:4456
15111 #: ../fish/guestfish-actions.pod:4458
15114 " sfdisk-N device partnum cyls heads sectors line\n"
15119 #: ../fish/guestfish-actions.pod:4460 ../src/guestfs-actions.pod:6757
15121 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15122 "(note: C<n> counts from 1)."
15126 #: ../fish/guestfish-actions.pod:4463
15128 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15129 "cyls/heads/sectors parameters."
15133 #: ../fish/guestfish-actions.pod:4466
15134 msgid "See also: L</part-add>"
15138 #: ../fish/guestfish-actions.pod:4478
15139 msgid "sfdisk-disk-geometry"
15143 #: ../fish/guestfish-actions.pod:4480
15146 " sfdisk-disk-geometry device\n"
15151 #: ../fish/guestfish-actions.pod:4482
15153 "This displays the disk geometry of C<device> read from the partition table. "
15154 "Especially in the case where the underlying block device has been resized, "
15155 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
15156 "kernel-geometry>)."
15160 #: ../fish/guestfish-actions.pod:4487 ../fish/guestfish-actions.pod:4496
15161 #: ../src/guestfs-actions.pod:6783 ../src/guestfs-actions.pod:6799
15162 msgid "The result is in human-readable format, and not designed to be parsed."
15166 #: ../fish/guestfish-actions.pod:4490
15167 msgid "sfdisk-kernel-geometry"
15171 #: ../fish/guestfish-actions.pod:4492
15174 " sfdisk-kernel-geometry device\n"
15179 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6797
15180 msgid "This displays the kernel's idea of the geometry of C<device>."
15184 #: ../fish/guestfish-actions.pod:4499
15189 #: ../fish/guestfish-actions.pod:4501
15192 " sfdisk-l device\n"
15197 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6820
15199 "This displays the partition table on C<device>, in the human-readable output "
15200 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15204 #: ../fish/guestfish-actions.pod:4507
15205 msgid "See also: L</part-list>"
15209 #: ../fish/guestfish-actions.pod:4509
15211 "I<This function is deprecated.> In new code, use the L</part_list> call "
15216 #: ../fish/guestfish-actions.pod:4516
15221 #: ../fish/guestfish-actions.pod:4518
15229 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6837
15231 "This call runs a command from the guest filesystem via the guest's C</bin/"
15236 #: ../fish/guestfish-actions.pod:4523
15237 msgid "This is like L</command>, but passes the command to:"
15241 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6842
15244 " /bin/sh -c \"command\"\n"
15249 #: ../fish/guestfish-actions.pod:4527 ../src/guestfs-actions.pod:6844
15251 "Depending on the guest's shell, this usually results in wildcards being "
15252 "expanded, shell expressions being interpolated and so on."
15256 #: ../fish/guestfish-actions.pod:4531
15257 msgid "All the provisos about L</command> apply to this call."
15261 #: ../fish/guestfish-actions.pod:4533
15266 #: ../fish/guestfish-actions.pod:4535
15269 " sh-lines command\n"
15274 #: ../fish/guestfish-actions.pod:4537
15275 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15279 #: ../fish/guestfish-actions.pod:4540
15280 msgid "See also: L</command-lines>"
15284 #: ../fish/guestfish-actions.pod:4542
15289 #: ../fish/guestfish-actions.pod:4544
15297 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6878
15298 msgid "Sleep for C<secs> seconds."
15302 #: ../fish/guestfish-actions.pod:4548
15307 #: ../fish/guestfish-actions.pod:4550
15315 #: ../fish/guestfish-actions.pod:4554 ../src/guestfs-actions.pod:6892
15316 msgid "This is the same as the C<stat(2)> system call."
15320 #: ../fish/guestfish-actions.pod:4556
15325 #: ../fish/guestfish-actions.pod:4558
15333 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6906
15335 "Returns file system statistics for any mounted file system. C<path> should "
15336 "be a file or directory in the mounted file system (typically it is the mount "
15337 "point itself, but it doesn't need to be)."
15341 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6910
15342 msgid "This is the same as the C<statvfs(2)> system call."
15346 #: ../fish/guestfish-actions.pod:4566
15351 #: ../fish/guestfish-actions.pod:4568
15359 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6924
15361 "This runs the L<strings(1)> command on a file and returns the list of "
15362 "printable strings found."
15366 #: ../fish/guestfish-actions.pod:4576
15371 #: ../fish/guestfish-actions.pod:4578
15374 " strings-e encoding path\n"
15379 #: ../fish/guestfish-actions.pod:4580
15381 "This is like the L</strings> command, but allows you to specify the encoding "
15382 "of strings that are looked for in the source file C<path>."
15386 #: ../fish/guestfish-actions.pod:4584 ../src/guestfs-actions.pod:6947
15387 msgid "Allowed encodings are:"
15391 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6951
15396 #: ../fish/guestfish-actions.pod:4590
15398 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15399 "ISO-8859-X (this is what L</strings> uses)."
15403 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6956
15408 #: ../fish/guestfish-actions.pod:4595 ../src/guestfs-actions.pod:6958
15409 msgid "Single 8-bit-byte characters."
15413 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:6960
15418 #: ../fish/guestfish-actions.pod:4599 ../src/guestfs-actions.pod:6962
15419 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15423 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6965
15424 msgid "l (lower case letter L)"
15428 #: ../fish/guestfish-actions.pod:4604 ../src/guestfs-actions.pod:6967
15430 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15431 "examining binaries in Windows guests."
15435 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:6970
15440 #: ../fish/guestfish-actions.pod:4609 ../src/guestfs-actions.pod:6972
15441 msgid "32-bit big endian such as UCS-4BE."
15445 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6974
15450 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6976
15451 msgid "32-bit little endian such as UCS-4LE."
15455 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6980
15456 msgid "The returned strings are transcoded to UTF-8."
15460 #: ../fish/guestfish-actions.pod:4622
15461 msgid "swapoff-device"
15465 #: ../fish/guestfish-actions.pod:4624
15468 " swapoff-device device\n"
15473 #: ../fish/guestfish-actions.pod:4626
15475 "This command disables the libguestfs appliance swap device or partition "
15476 "named C<device>. See L</swapon-device>."
15480 #: ../fish/guestfish-actions.pod:4630
15481 msgid "swapoff-file"
15485 #: ../fish/guestfish-actions.pod:4632
15488 " swapoff-file file\n"
15493 #: ../fish/guestfish-actions.pod:4634 ../src/guestfs-actions.pod:7011
15494 msgid "This command disables the libguestfs appliance swap on file."
15498 #: ../fish/guestfish-actions.pod:4636
15499 msgid "swapoff-label"
15503 #: ../fish/guestfish-actions.pod:4638
15506 " swapoff-label label\n"
15511 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:7023
15513 "This command disables the libguestfs appliance swap on labeled swap "
15518 #: ../fish/guestfish-actions.pod:4643
15519 msgid "swapoff-uuid"
15523 #: ../fish/guestfish-actions.pod:4645
15526 " swapoff-uuid uuid\n"
15531 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:7036
15533 "This command disables the libguestfs appliance swap partition with the given "
15538 #: ../fish/guestfish-actions.pod:4650
15539 msgid "swapon-device"
15543 #: ../fish/guestfish-actions.pod:4652
15546 " swapon-device device\n"
15551 #: ../fish/guestfish-actions.pod:4654
15553 "This command enables the libguestfs appliance to use the swap device or "
15554 "partition named C<device>. The increased memory is made available for all "
15555 "commands, for example those run using L</command> or L</sh>."
15559 #: ../fish/guestfish-actions.pod:4659 ../src/guestfs-actions.pod:7054
15561 "Note that you should not swap to existing guest swap partitions unless you "
15562 "know what you are doing. They may contain hibernation information, or other "
15563 "information that the guest doesn't want you to trash. You also risk leaking "
15564 "information about the host to the guest this way. Instead, attach a new "
15565 "host device to the guest and swap on that."
15569 #: ../fish/guestfish-actions.pod:4666
15570 msgid "swapon-file"
15574 #: ../fish/guestfish-actions.pod:4668
15577 " swapon-file file\n"
15582 #: ../fish/guestfish-actions.pod:4670
15584 "This command enables swap to a file. See L</swapon-device> for other notes."
15588 #: ../fish/guestfish-actions.pod:4673
15589 msgid "swapon-label"
15593 #: ../fish/guestfish-actions.pod:4675
15596 " swapon-label label\n"
15601 #: ../fish/guestfish-actions.pod:4677
15603 "This command enables swap to a labeled swap partition. See L</swapon-"
15604 "device> for other notes."
15608 #: ../fish/guestfish-actions.pod:4680
15609 msgid "swapon-uuid"
15613 #: ../fish/guestfish-actions.pod:4682
15616 " swapon-uuid uuid\n"
15621 #: ../fish/guestfish-actions.pod:4684
15623 "This command enables swap to a swap partition with the given UUID. See L</"
15624 "swapon-device> for other notes."
15628 #: ../fish/guestfish-actions.pod:4687
15633 #: ../fish/guestfish-actions.pod:4689
15641 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7109
15643 "This syncs the disk, so that any writes are flushed through to the "
15644 "underlying disk image."
15648 #: ../fish/guestfish-actions.pod:4694 ../src/guestfs-actions.pod:7112
15650 "You should always call this if you have modified a disk image, before "
15651 "closing the handle."
15655 #: ../fish/guestfish-actions.pod:4697
15660 #: ../fish/guestfish-actions.pod:4699
15668 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7125
15670 "This command returns up to the last 10 lines of a file as a list of strings."
15674 #: ../fish/guestfish-actions.pod:4707
15679 #: ../fish/guestfish-actions.pod:4709
15682 " tail-n nrlines path\n"
15687 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7144
15689 "If the parameter C<nrlines> is a positive number, this returns the last "
15690 "C<nrlines> lines of the file C<path>."
15694 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7147
15696 "If the parameter C<nrlines> is a negative number, this returns lines from "
15697 "the file C<path>, starting with the C<-nrlines>th line."
15701 #: ../fish/guestfish-actions.pod:4722
15706 #: ../fish/guestfish-actions.pod:4724
15709 " tar-in (tarfile|-) directory\n"
15714 #: ../fish/guestfish-actions.pod:4726 ../src/guestfs-actions.pod:7168
15716 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15717 "tar file) into C<directory>."
15721 #: ../fish/guestfish-actions.pod:4729
15722 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15726 #: ../fish/guestfish-actions.pod:4734
15731 #: ../fish/guestfish-actions.pod:4736
15734 " tar-out directory (tarfile|-)\n"
15739 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7185
15741 "This command packs the contents of C<directory> and downloads it to local "
15746 #: ../fish/guestfish-actions.pod:4741
15747 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15751 #: ../fish/guestfish-actions.pod:4746
15756 #: ../fish/guestfish-actions.pod:4748
15759 " tgz-in (tarball|-) directory\n"
15764 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7202
15766 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15767 "tar file) into C<directory>."
15771 #: ../fish/guestfish-actions.pod:4753
15772 msgid "To upload an uncompressed tarball, use L</tar-in>."
15776 #: ../fish/guestfish-actions.pod:4757
15781 #: ../fish/guestfish-actions.pod:4759
15784 " tgz-out directory (tarball|-)\n"
15789 #: ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7218
15791 "This command packs the contents of C<directory> and downloads it to local "
15796 #: ../fish/guestfish-actions.pod:4764
15797 msgid "To download an uncompressed tarball, use L</tar-out>."
15801 #: ../fish/guestfish-actions.pod:4768
15806 #: ../fish/guestfish-actions.pod:4770
15814 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7233
15816 "Touch acts like the L<touch(1)> command. It can be used to update the "
15817 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15822 #: ../fish/guestfish-actions.pod:4776 ../src/guestfs-actions.pod:7237
15824 "This command only works on regular files, and will fail on other file types "
15825 "such as directories, symbolic links, block special etc."
15829 #: ../fish/guestfish-actions.pod:4779
15834 #: ../fish/guestfish-actions.pod:4781
15842 #: ../fish/guestfish-actions.pod:4783 ../src/guestfs-actions.pod:7250
15844 "This command truncates C<path> to a zero-length file. The file must exist "
15849 #: ../fish/guestfish-actions.pod:4786
15850 msgid "truncate-size"
15854 #: ../fish/guestfish-actions.pod:4788
15857 " truncate-size path size\n"
15862 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7264
15864 "This command truncates C<path> to size C<size> bytes. The file must exist "
15869 #: ../fish/guestfish-actions.pod:4793
15871 "If the current file size is less than C<size> then the file is extended to "
15872 "the required size with zero bytes. This creates a sparse file (ie. disk "
15873 "blocks are not allocated for the file until you write to it). To create a "
15874 "non-sparse file of zeroes, use L</fallocate64> instead."
15878 #: ../fish/guestfish-actions.pod:4799
15883 #: ../fish/guestfish-actions.pod:4801
15886 " tune2fs-l device\n"
15891 #: ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:7283
15893 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15898 #: ../fish/guestfish-actions.pod:4806 ../src/guestfs-actions.pod:7286
15900 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15901 "for more details. The list of fields returned isn't clearly defined, and "
15902 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15903 "and the filesystem itself."
15907 #: ../fish/guestfish-actions.pod:4811
15912 #: ../fish/guestfish-actions.pod:4813
15915 " txz-in (tarball|-) directory\n"
15920 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7306
15922 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15923 "tar file) into C<directory>."
15927 #: ../fish/guestfish-actions.pod:4820
15932 #: ../fish/guestfish-actions.pod:4822
15935 " txz-out directory (tarball|-)\n"
15940 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7320
15942 "This command packs the contents of C<directory> and downloads it to local "
15943 "file C<tarball> (as an xz compressed tar archive)."
15947 #: ../fish/guestfish-actions.pod:4829
15952 #: ../fish/guestfish-actions.pod:4831
15960 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7333
15962 "This function sets the mask used for creating new files and device nodes to "
15967 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7336
15969 "Typical umask values would be C<022> which creates new files with "
15970 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15971 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15975 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7341
15977 "The default umask is C<022>. This is important because it means that "
15978 "directories and device nodes will be created with C<0644> or C<0755> mode "
15979 "even if you specify C<0777>."
15983 #: ../fish/guestfish-actions.pod:4845
15984 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15988 #: ../fish/guestfish-actions.pod:4848 ../src/guestfs-actions.pod:7348
15989 msgid "This call returns the previous umask."
15993 #: ../fish/guestfish-actions.pod:4850
15998 #: ../fish/guestfish-actions.pod:4852
16003 #: ../fish/guestfish-actions.pod:4854
16006 " umount pathordevice\n"
16011 #: ../fish/guestfish-actions.pod:4856 ../src/guestfs-actions.pod:7360
16013 "This unmounts the given filesystem. The filesystem may be specified either "
16014 "by its mountpoint (path) or the device which contains the filesystem."
16018 #: ../fish/guestfish-actions.pod:4860
16023 #: ../fish/guestfish-actions.pod:4862
16024 msgid "unmount-all"
16028 #: ../fish/guestfish-actions.pod:4864
16036 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7373
16037 msgid "This unmounts all mounted filesystems."
16041 #: ../fish/guestfish-actions.pod:4868 ../src/guestfs-actions.pod:7375
16042 msgid "Some internal mounts are not unmounted by this call."
16046 #: ../fish/guestfish-actions.pod:4870
16051 #: ../fish/guestfish-actions.pod:4872
16054 " upload (filename|-) remotefilename\n"
16059 #: ../fish/guestfish-actions.pod:4874 ../fish/guestfish-actions.pod:4887
16060 #: ../src/guestfs-actions.pod:7388 ../src/guestfs-actions.pod:7412
16061 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16065 #: ../fish/guestfish-actions.pod:4879
16066 msgid "See also L</download>."
16070 #: ../fish/guestfish-actions.pod:4883
16071 msgid "upload-offset"
16075 #: ../fish/guestfish-actions.pod:4885
16078 " upload-offset (filename|-) remotefilename offset\n"
16083 #: ../fish/guestfish-actions.pod:4890 ../src/guestfs-actions.pod:7415
16085 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
16086 "The intention is to overwrite parts of existing files or devices, although "
16087 "if a non-existant file is specified then it is created with a \"hole\" "
16088 "before C<offset>. The size of the data written is implicit in the size of "
16089 "the source C<filename>."
16093 #: ../fish/guestfish-actions.pod:4897
16095 "Note that there is no limit on the amount of data that can be uploaded with "
16096 "this call, unlike with L</pwrite>, and this call always writes the full "
16097 "amount unless an error occurs."
16101 #: ../fish/guestfish-actions.pod:4902
16102 msgid "See also L</upload>, L</pwrite>."
16106 #: ../fish/guestfish-actions.pod:4906
16111 #: ../fish/guestfish-actions.pod:4908
16114 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
16119 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7448
16120 msgid "This command sets the timestamps of a file with nanosecond precision."
16124 #: ../fish/guestfish-actions.pod:4913 ../src/guestfs-actions.pod:7451
16126 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16131 #: ../fish/guestfish-actions.pod:4916 ../src/guestfs-actions.pod:7454
16133 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16134 "nanoseconds from the epoch."
16138 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7457
16140 "If the C<*nsecs> field contains the special value C<-1> then the "
16141 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16142 "ignored in this case)."
16146 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7461
16148 "If the C<*nsecs> field contains the special value C<-2> then the "
16149 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16154 #: ../fish/guestfish-actions.pod:4927
16159 #: ../fish/guestfish-actions.pod:4929
16167 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7474
16169 "Return the libguestfs version number that the program is linked against."
16173 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7477
16175 "Note that because of dynamic linking this is not necessarily the version of "
16176 "libguestfs that you compiled against. You can compile the program, and then "
16177 "at runtime dynamically link against a completely different C<libguestfs.so> "
16182 #: ../fish/guestfish-actions.pod:4939 ../src/guestfs-actions.pod:7482
16184 "This call was added in version C<1.0.58>. In previous versions of "
16185 "libguestfs there was no way to get the version number. From C code you can "
16186 "use dynamic linker functions to find out if this symbol exists (if it "
16187 "doesn't, then it's an earlier version)."
16191 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7488
16193 "The call returns a structure with four elements. The first three (C<major>, "
16194 "C<minor> and C<release>) are numbers and correspond to the usual version "
16195 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16196 "but may be used for distro-specific information."
16200 #: ../fish/guestfish-actions.pod:4951 ../src/guestfs-actions.pod:7494
16202 "To construct the original version string: C<$major.$minor.$release$extra>"
16206 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7497
16207 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16211 #: ../fish/guestfish-actions.pod:4956
16213 "I<Note:> Don't use this call to test for availability of features. In "
16214 "enterprise distributions we backport features from later versions into "
16215 "earlier versions, making this an unreliable way to test for features. Use "
16216 "L</available> instead."
16220 #: ../fish/guestfish-actions.pod:4962
16225 #: ../fish/guestfish-actions.pod:4964
16228 " vfs-label device\n"
16233 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7517
16234 msgid "This returns the filesystem label of the filesystem on C<device>."
16238 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7520
16239 msgid "If the filesystem is unlabeled, this returns the empty string."
16243 #: ../fish/guestfish-actions.pod:4971
16244 msgid "To find a filesystem from the label, use L</findfs-label>."
16248 #: ../fish/guestfish-actions.pod:4973
16253 #: ../fish/guestfish-actions.pod:4975
16256 " vfs-type device\n"
16261 #: ../fish/guestfish-actions.pod:4977 ../src/guestfs-actions.pod:7535
16263 "This command gets the filesystem type corresponding to the filesystem on "
16268 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7538
16270 "For most filesystems, the result is the name of the Linux VFS module which "
16271 "would be used to mount this filesystem if you mounted it without specifying "
16272 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16276 #: ../fish/guestfish-actions.pod:4985
16281 #: ../fish/guestfish-actions.pod:4987
16284 " vfs-uuid device\n"
16289 #: ../fish/guestfish-actions.pod:4989 ../src/guestfs-actions.pod:7554
16290 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16294 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7557
16295 msgid "If the filesystem does not have a UUID, this returns the empty string."
16299 #: ../fish/guestfish-actions.pod:4994
16300 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16304 #: ../fish/guestfish-actions.pod:4996
16305 msgid "vg-activate"
16309 #: ../fish/guestfish-actions.pod:4998
16312 " vg-activate true|false 'volgroups ...'\n"
16317 #: ../fish/guestfish-actions.pod:5000 ../src/guestfs-actions.pod:7573
16319 "This command activates or (if C<activate> is false) deactivates all logical "
16320 "volumes in the listed volume groups C<volgroups>."
16324 #: ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:7576
16325 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16329 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7578
16331 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16332 "activated or deactivated."
16336 #: ../fish/guestfish-actions.pod:5008
16337 msgid "vg-activate-all"
16341 #: ../fish/guestfish-actions.pod:5010
16344 " vg-activate-all true|false\n"
16349 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7591
16351 "This command activates or (if C<activate> is false) deactivates all logical "
16352 "volumes in all volume groups."
16356 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7594
16357 msgid "This command is the same as running C<vgchange -a y|n>"
16361 #: ../fish/guestfish-actions.pod:5017
16366 #: ../fish/guestfish-actions.pod:5019
16369 " vgcreate volgroup 'physvols ...'\n"
16374 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7607
16376 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16377 "of physical volumes C<physvols>."
16381 #: ../fish/guestfish-actions.pod:5024
16386 #: ../fish/guestfish-actions.pod:5026
16389 " vglvuuids vgname\n"
16394 #: ../fish/guestfish-actions.pod:5028 ../src/guestfs-actions.pod:7620
16396 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16397 "volumes created in this volume group."
16401 #: ../fish/guestfish-actions.pod:5031
16403 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16404 "logical volumes and volume groups."
16408 #: ../fish/guestfish-actions.pod:5034
16409 msgid "See also L</vgpvuuids>."
16413 #: ../fish/guestfish-actions.pod:5036
16418 #: ../fish/guestfish-actions.pod:5038
16421 " vgpvuuids vgname\n"
16426 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7640
16428 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16429 "volumes that this volume group resides on."
16433 #: ../fish/guestfish-actions.pod:5043
16435 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16436 "physical volumes and volume groups."
16440 #: ../fish/guestfish-actions.pod:5046
16441 msgid "See also L</vglvuuids>."
16445 #: ../fish/guestfish-actions.pod:5048
16450 #: ../fish/guestfish-actions.pod:5050
16453 " vgremove vgname\n"
16458 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7660
16459 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16463 #: ../fish/guestfish-actions.pod:5054 ../src/guestfs-actions.pod:7662
16465 "This also forcibly removes all logical volumes in the volume group (if any)."
16469 #: ../fish/guestfish-actions.pod:5057
16474 #: ../fish/guestfish-actions.pod:5059
16477 " vgrename volgroup newvolgroup\n"
16482 #: ../fish/guestfish-actions.pod:5061 ../src/guestfs-actions.pod:7676
16483 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16487 #: ../fish/guestfish-actions.pod:5063
16492 #: ../fish/guestfish-actions.pod:5065
16500 #: ../fish/guestfish-actions.pod:5067 ../src/guestfs-actions.pod:7687
16502 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16507 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7690
16509 "This returns a list of just the volume group names that were detected (eg. "
16514 #: ../fish/guestfish-actions.pod:5073
16515 msgid "See also L</vgs-full>."
16519 #: ../fish/guestfish-actions.pod:5075
16524 #: ../fish/guestfish-actions.pod:5077
16532 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7706
16534 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16535 "> command. The \"full\" version includes all fields."
16539 #: ../fish/guestfish-actions.pod:5082
16544 #: ../fish/guestfish-actions.pod:5084
16552 #: ../fish/guestfish-actions.pod:5086 ../src/guestfs-actions.pod:7720
16554 "This rescans all block devices and rebuilds the list of LVM physical "
16555 "volumes, volume groups and logical volumes."
16559 #: ../fish/guestfish-actions.pod:5089
16564 #: ../fish/guestfish-actions.pod:5091
16572 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7733
16573 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16577 #: ../fish/guestfish-actions.pod:5095
16582 #: ../fish/guestfish-actions.pod:5097
16590 #: ../fish/guestfish-actions.pod:5099 ../src/guestfs-actions.pod:7773
16592 "This command counts the characters in a file, using the C<wc -c> external "
16597 #: ../fish/guestfish-actions.pod:5102
16602 #: ../fish/guestfish-actions.pod:5104
16610 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7786
16612 "This command counts the lines in a file, using the C<wc -l> external command."
16616 #: ../fish/guestfish-actions.pod:5109
16621 #: ../fish/guestfish-actions.pod:5111
16629 #: ../fish/guestfish-actions.pod:5113 ../src/guestfs-actions.pod:7799
16631 "This command counts the words in a file, using the C<wc -w> external command."
16635 #: ../fish/guestfish-actions.pod:5116
16640 #: ../fish/guestfish-actions.pod:5118
16643 " write path content\n"
16648 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7814
16650 "This call creates a file called C<path>. The content of the file is the "
16651 "string C<content> (which can contain any 8 bit data)."
16655 #: ../fish/guestfish-actions.pod:5123
16656 msgid "See also L</write-append>."
16660 #: ../fish/guestfish-actions.pod:5128
16661 msgid "write-append"
16665 #: ../fish/guestfish-actions.pod:5130
16668 " write-append path content\n"
16673 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7834
16675 "This call appends C<content> to the end of file C<path>. If C<path> does "
16676 "not exist, then a new file is created."
16680 #: ../fish/guestfish-actions.pod:5135
16681 msgid "See also L</write>."
16685 #: ../fish/guestfish-actions.pod:5140
16690 #: ../fish/guestfish-actions.pod:5142
16693 " write-file path content size\n"
16698 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7861
16700 "This call creates a file called C<path>. The contents of the file is the "
16701 "string C<content> (which can contain any 8 bit data), with length C<size>."
16705 #: ../fish/guestfish-actions.pod:5148 ../src/guestfs-actions.pod:7865
16707 "As a special case, if C<size> is C<0> then the length is calculated using "
16708 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16712 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7869
16714 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16715 "I<not> work, even if the length is specified."
16719 #: ../fish/guestfish-actions.pod:5158
16721 "I<This function is deprecated.> In new code, use the L</write> call instead."
16725 #: ../fish/guestfish-actions.pod:5165
16730 #: ../fish/guestfish-actions.pod:5167
16733 " zegrep regex path\n"
16738 #: ../fish/guestfish-actions.pod:5169 ../src/guestfs-actions.pod:7886
16740 "This calls the external C<zegrep> program and returns the matching lines."
16744 #: ../fish/guestfish-actions.pod:5175
16749 #: ../fish/guestfish-actions.pod:5177
16752 " zegrepi regex path\n"
16757 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7905
16759 "This calls the external C<zegrep -i> program and returns the matching lines."
16763 #: ../fish/guestfish-actions.pod:5185
16768 #: ../fish/guestfish-actions.pod:5187
16776 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7923
16777 msgid "This command writes zeroes over the first few blocks of C<device>."
16781 #: ../fish/guestfish-actions.pod:5191 ../src/guestfs-actions.pod:7925
16783 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16784 "securely wipe the device). It should be sufficient to remove any partition "
16785 "tables, filesystem superblocks and so on."
16789 #: ../fish/guestfish-actions.pod:5195 ../fish/guestfish-actions.pod:5210
16790 #: ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:7955
16792 "If blocks are already zero, then this command avoids writing zeroes. This "
16793 "prevents the underlying device from becoming non-sparse or growing "
16798 #: ../fish/guestfish-actions.pod:5199
16799 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16803 #: ../fish/guestfish-actions.pod:5202
16804 msgid "zero-device"
16808 #: ../fish/guestfish-actions.pod:5204
16811 " zero-device device\n"
16816 #: ../fish/guestfish-actions.pod:5206
16818 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16819 "which just zeroes the first few blocks of a device."
16823 #: ../fish/guestfish-actions.pod:5217
16828 #: ../fish/guestfish-actions.pod:5219
16831 " zerofree device\n"
16836 #: ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:7977
16838 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16839 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16840 "possible to compress the filesystem more effectively."
16844 #: ../fish/guestfish-actions.pod:5226 ../src/guestfs-actions.pod:7982
16845 msgid "You should B<not> run this program if the filesystem is mounted."
16849 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:7985
16851 "It is possible that using this program can damage the filesystem or data on "
16856 #: ../fish/guestfish-actions.pod:5232
16861 #: ../fish/guestfish-actions.pod:5234
16864 " zfgrep pattern path\n"
16869 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:7999
16871 "This calls the external C<zfgrep> program and returns the matching lines."
16875 #: ../fish/guestfish-actions.pod:5242
16880 #: ../fish/guestfish-actions.pod:5244
16883 " zfgrepi pattern path\n"
16888 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8018
16890 "This calls the external C<zfgrep -i> program and returns the matching lines."
16894 #: ../fish/guestfish-actions.pod:5252
16899 #: ../fish/guestfish-actions.pod:5254
16902 " zfile meth path\n"
16907 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8044
16909 "This command runs C<file> after first decompressing C<path> using C<method>."
16913 #: ../fish/guestfish-actions.pod:5259 ../src/guestfs-actions.pod:8047
16914 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16918 #: ../fish/guestfish-actions.pod:5261
16920 "Since 1.0.63, use L</file> instead which can now process compressed files."
16924 #: ../fish/guestfish-actions.pod:5264
16926 "I<This function is deprecated.> In new code, use the L</file> call instead."
16930 #: ../fish/guestfish-actions.pod:5271
16935 #: ../fish/guestfish-actions.pod:5273
16938 " zgrep regex path\n"
16943 #: ../fish/guestfish-actions.pod:5275 ../src/guestfs-actions.pod:8064
16945 "This calls the external C<zgrep> program and returns the matching lines."
16949 #: ../fish/guestfish-actions.pod:5281
16954 #: ../fish/guestfish-actions.pod:5283
16957 " zgrepi regex path\n"
16962 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8083
16964 "This calls the external C<zgrep -i> program and returns the matching lines."
16968 #: ../fish/guestfish-commands.pod:1
16973 #: ../fish/guestfish-commands.pod:3
16978 #: ../fish/guestfish-commands.pod:5
16981 " alloc filename size\n"
16986 #: ../fish/guestfish-commands.pod:7
16988 "This creates an empty (zeroed) file of the given size, and then adds so it "
16989 "can be further examined."
16993 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16994 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16998 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16999 msgid "Size can be specified using standard suffixes, eg. C<1M>."
17003 #: ../fish/guestfish-commands.pod:14
17005 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
17006 "image, see L</PREPARED DISK IMAGES>."
17010 #: ../fish/guestfish-commands.pod:17
17015 #: ../fish/guestfish-commands.pod:19
17018 " copy-in local [local ...] /remotedir\n"
17023 #: ../fish/guestfish-commands.pod:21
17025 "C<copy-in> copies local files or directories recursively into the disk "
17026 "image, placing them in the directory called C</remotedir> (which must "
17027 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
17028 "other commands as necessary."
17032 #: ../fish/guestfish-commands.pod:26
17034 "Multiple local files and directories can be specified, but the last "
17035 "parameter must always be a remote directory. Wildcards cannot be used."
17039 #: ../fish/guestfish-commands.pod:30
17044 #: ../fish/guestfish-commands.pod:32
17047 " copy-out remote [remote ...] localdir\n"
17052 #: ../fish/guestfish-commands.pod:34
17054 "C<copy-out> copies remote files or directories recursively out of the disk "
17055 "image, placing them on the host disk in a local directory called C<localdir> "
17056 "(which must exist). This guestfish meta-command turns into a sequence of L</"
17057 "download>, L</tar-out> and other commands as necessary."
17061 #: ../fish/guestfish-commands.pod:40
17063 "Multiple remote files and directories can be specified, but the last "
17064 "parameter must always be a local directory. To download to the current "
17065 "directory, use C<.> as in:"
17069 #: ../fish/guestfish-commands.pod:44
17072 " copy-out /home .\n"
17077 #: ../fish/guestfish-commands.pod:46
17079 "Wildcards cannot be used in the ordinary command, but you can use them with "
17080 "the help of L</glob> like this:"
17084 #: ../fish/guestfish-commands.pod:49
17087 " glob copy-out /home/* .\n"
17092 #: ../fish/guestfish-commands.pod:51
17097 #: ../fish/guestfish-commands.pod:53
17100 " display filename\n"
17105 #: ../fish/guestfish-commands.pod:55
17107 "Use C<display> (a graphical display program) to display an image file. It "
17108 "downloads the file, and runs C<display> on it."
17112 #: ../fish/guestfish-commands.pod:58
17114 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
17115 "environment variable. For example to use the GNOME display program:"
17119 #: ../fish/guestfish-commands.pod:61
17122 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
17127 #: ../fish/guestfish-commands.pod:63
17128 msgid "See also L<display(1)>."
17132 #: ../fish/guestfish-commands.pod:65
17137 #: ../fish/guestfish-commands.pod:67
17140 " echo [params ...]\n"
17145 #: ../fish/guestfish-commands.pod:69
17146 msgid "This echos the parameters to the terminal."
17150 #: ../fish/guestfish-commands.pod:71
17155 #: ../fish/guestfish-commands.pod:73
17160 #: ../fish/guestfish-commands.pod:75
17165 #: ../fish/guestfish-commands.pod:77
17173 #: ../fish/guestfish-commands.pod:79
17175 "This is used to edit a file. It downloads the file, edits it locally using "
17176 "your editor, then uploads the result."
17180 #: ../fish/guestfish-commands.pod:82
17182 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17183 "or C<emacs> you will get those corresponding editors."
17187 #: ../fish/guestfish-commands.pod:86
17192 #: ../fish/guestfish-commands.pod:88
17195 " glob command args...\n"
17200 #: ../fish/guestfish-commands.pod:90
17202 "Expand wildcards in any paths in the args list, and run C<command> "
17203 "repeatedly on each matching path."
17207 #: ../fish/guestfish-commands.pod:93
17208 msgid "See L</WILDCARDS AND GLOBBING>."
17212 #: ../fish/guestfish-commands.pod:95
17217 #: ../fish/guestfish-commands.pod:97
17220 " hexedit <filename|device>\n"
17221 " hexedit <filename|device> <max>\n"
17222 " hexedit <filename|device> <start> <max>\n"
17227 #: ../fish/guestfish-commands.pod:101
17229 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17234 #: ../fish/guestfish-commands.pod:104
17236 "This command works by downloading potentially the whole file or device, "
17237 "editing it locally, then uploading it. If the file or device is large, you "
17238 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17239 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17240 "usual modifiers allowed such as C<1M> (1 megabyte)."
17244 #: ../fish/guestfish-commands.pod:111
17245 msgid "For example to edit the first few sectors of a disk you might do:"
17249 #: ../fish/guestfish-commands.pod:114
17252 " hexedit /dev/sda 1M\n"
17257 #: ../fish/guestfish-commands.pod:116
17259 "which would allow you to edit anywhere within the first megabyte of the disk."
17263 #: ../fish/guestfish-commands.pod:119
17264 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17268 #: ../fish/guestfish-commands.pod:121
17271 " hexedit /dev/sda1 0x400 0x400\n"
17276 #: ../fish/guestfish-commands.pod:123
17277 msgid "(assuming the superblock is in the standard location)."
17281 #: ../fish/guestfish-commands.pod:125
17283 "This command requires the external L<hexedit(1)> program. You can specify "
17284 "another program to use by setting the C<HEXEDITOR> environment variable."
17288 #: ../fish/guestfish-commands.pod:129
17289 msgid "See also L</hexdump>."
17293 #: ../fish/guestfish-commands.pod:131
17298 #: ../fish/guestfish-commands.pod:133
17306 #: ../fish/guestfish-commands.pod:135
17308 "Change the local directory, ie. the current directory of guestfish itself."
17312 #: ../fish/guestfish-commands.pod:138
17313 msgid "Note that C<!cd> won't do what you might expect."
17317 #: ../fish/guestfish-commands.pod:140
17322 #: ../fish/guestfish-commands.pod:142
17327 #: ../fish/guestfish-commands.pod:144
17335 #: ../fish/guestfish-commands.pod:146
17336 msgid "Opens the manual page for guestfish."
17340 #: ../fish/guestfish-commands.pod:148
17345 #: ../fish/guestfish-commands.pod:150
17350 #: ../fish/guestfish-commands.pod:152
17358 #: ../fish/guestfish-commands.pod:154
17366 #: ../fish/guestfish-commands.pod:156
17367 msgid "This is used to view a file."
17371 #: ../fish/guestfish-commands.pod:158
17373 "The default viewer is C<$PAGER>. However if you use the alternate command "
17374 "C<less> you will get the C<less> command specifically."
17378 #: ../fish/guestfish-commands.pod:161
17383 #: ../fish/guestfish-commands.pod:163
17391 #: ../fish/guestfish-commands.pod:165
17393 "Close and reopen the libguestfs handle. It is not necessary to use this "
17394 "normally, because the handle is closed properly when guestfish exits. "
17395 "However this is occasionally useful for testing."
17399 #: ../fish/guestfish-commands.pod:169
17404 #: ../fish/guestfish-commands.pod:171
17407 " setenv VAR value\n"
17412 #: ../fish/guestfish-commands.pod:173
17413 msgid "Set the environment variable C<VAR> to the string C<value>."
17417 #: ../fish/guestfish-commands.pod:175
17419 "To print the value of an environment variable use a shell command such as:"
17423 #: ../fish/guestfish-commands.pod:178
17431 #: ../fish/guestfish-commands.pod:180
17436 #: ../fish/guestfish-commands.pod:182
17439 " sparse filename size\n"
17444 #: ../fish/guestfish-commands.pod:184
17446 "This creates an empty sparse file of the given size, and then adds so it can "
17447 "be further examined."
17451 #: ../fish/guestfish-commands.pod:187
17453 "In all respects it works the same as the L</alloc> command, except that the "
17454 "image file is allocated sparsely, which means that disk blocks are not "
17455 "assigned to the file until they are needed. Sparse disk files only use "
17456 "space when written to, but they are slower and there is a danger you could "
17457 "run out of real disk space during a write operation."
17461 #: ../fish/guestfish-commands.pod:197
17466 #: ../fish/guestfish-commands.pod:199
17474 #: ../fish/guestfish-commands.pod:201
17476 "This command returns a list of the optional groups known to the daemon, and "
17477 "indicates which ones are supported by this build of the libguestfs appliance."
17481 #: ../fish/guestfish-commands.pod:205
17482 msgid "See also L<guestfs(3)/AVAILABILITY>."
17486 #: ../fish/guestfish-commands.pod:207
17491 #: ../fish/guestfish-commands.pod:209
17494 " time command args...\n"
17499 #: ../fish/guestfish-commands.pod:211
17501 "Run the command as usual, but print the elapsed time afterwards. This can "
17502 "be useful for benchmarking operations."
17506 #: ../fish/guestfish-commands.pod:214
17511 #: ../fish/guestfish-commands.pod:216
17519 #: ../fish/guestfish-commands.pod:218
17520 msgid "Remove C<VAR> from the environment."
17524 #: ../fish/guestfish.pod:5
17525 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17529 #: ../fish/guestfish.pod:9
17532 " guestfish [--options] [commands]\n"
17537 #: ../fish/guestfish.pod:11
17545 #: ../fish/guestfish.pod:13
17548 " guestfish [--ro|--rw] -a disk.img\n"
17553 #: ../fish/guestfish.pod:15
17556 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17561 #: ../fish/guestfish.pod:17
17564 " guestfish -d libvirt-domain\n"
17569 #: ../fish/guestfish.pod:19
17572 " guestfish [--ro|--rw] -a disk.img -i\n"
17577 #: ../fish/guestfish.pod:21
17580 " guestfish -d libvirt-domain -i\n"
17585 #: ../fish/guestfish.pod:25
17587 "Using guestfish in read/write mode on live virtual machines can be "
17588 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17589 "option to use guestfish safely if the disk image or virtual machine might be "
17594 #: ../fish/guestfish.pod:32
17596 "Guestfish is a shell and command-line tool for examining and modifying "
17597 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17598 "functionality of the guestfs API, see L<guestfs(3)>."
17602 #: ../fish/guestfish.pod:36
17604 "Guestfish gives you structured access to the libguestfs API, from shell "
17605 "scripts or the command line or interactively. If you want to rescue a "
17606 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17611 #: ../fish/guestfish.pod:43
17612 msgid "As an interactive shell"
17616 #: ../fish/guestfish.pod:45
17624 #: ../fish/guestfish.pod:47
17627 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17628 " editing virtual machine filesystems.\n"
17633 #: ../fish/guestfish.pod:50
17636 " Type: 'help' for a list of commands\n"
17637 " 'man' to read the manual\n"
17638 " 'quit' to quit the shell\n"
17643 #: ../fish/guestfish.pod:54
17646 " ><fs> add-ro disk.img\n"
17648 " ><fs> list-filesystems\n"
17649 " /dev/sda1: ext4\n"
17650 " /dev/vg_guest/lv_root: ext4\n"
17651 " /dev/vg_guest/lv_swap: swap\n"
17652 " ><fs> mount /dev/vg_guest/lv_root /\n"
17653 " ><fs> cat /etc/fstab\n"
17655 " # Created by anaconda\n"
17662 #: ../fish/guestfish.pod:67
17663 msgid "From shell scripts"
17667 #: ../fish/guestfish.pod:69
17668 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17672 #: ../fish/guestfish.pod:71
17675 " guestfish <<_EOF_\n"
17678 " mount /dev/vg_guest/lv_root /\n"
17679 " write /etc/motd \"Welcome, new users\"\n"
17685 #: ../fish/guestfish.pod:78
17686 msgid "List the LVM logical volumes in a disk image:"
17690 #: ../fish/guestfish.pod:80
17693 " guestfish -a disk.img --ro <<_EOF_\n"
17701 #: ../fish/guestfish.pod:85
17702 msgid "List all the filesystems in a disk image:"
17706 #: ../fish/guestfish.pod:87
17709 " guestfish -a disk.img --ro <<_EOF_\n"
17711 " list-filesystems\n"
17717 #: ../fish/guestfish.pod:92
17718 msgid "On one command line"
17722 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17723 msgid "Update C</etc/resolv.conf> in a guest:"
17727 #: ../fish/guestfish.pod:96
17731 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17732 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17737 #: ../fish/guestfish.pod:100
17738 msgid "Edit C</boot/grub/grub.conf> interactively:"
17742 #: ../fish/guestfish.pod:102
17745 " guestfish --rw --add disk.img \\\n"
17746 " --mount /dev/vg_guest/lv_root \\\n"
17747 " --mount /dev/sda1:/boot \\\n"
17748 " edit /boot/grub/grub.conf\n"
17753 #: ../fish/guestfish.pod:107
17754 msgid "Mount disks automatically"
17758 #: ../fish/guestfish.pod:109
17760 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17764 #: ../fish/guestfish.pod:112
17767 " guestfish --ro -a disk.img -i cat /etc/group\n"
17772 #: ../fish/guestfish.pod:114
17775 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17780 #: ../fish/guestfish.pod:116
17781 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17785 #: ../fish/guestfish.pod:118
17788 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17793 #: ../fish/guestfish.pod:120
17794 msgid "As a script interpreter"
17798 #: ../fish/guestfish.pod:122
17799 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17803 #: ../fish/guestfish.pod:124
17806 " #!/usr/bin/guestfish -f\n"
17807 " sparse test1.img 100M\n"
17809 " part-disk /dev/sda mbr\n"
17810 " mkfs ext2 /dev/sda1\n"
17815 #: ../fish/guestfish.pod:130
17816 msgid "Start with a prepared disk"
17820 #: ../fish/guestfish.pod:132
17822 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17823 "single ext2-formatted partition:"
17827 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
17830 " guestfish -N fs\n"
17835 #: ../fish/guestfish.pod:137
17836 msgid "To list what is available do:"
17840 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1041
17843 " guestfish -N help | less\n"
17848 #: ../fish/guestfish.pod:141
17849 msgid "Remote control"
17853 #: ../fish/guestfish.pod:143
17856 " eval \"`guestfish --listen`\"\n"
17857 " guestfish --remote add-ro disk.img\n"
17858 " guestfish --remote run\n"
17859 " guestfish --remote lvs\n"
17864 #: ../fish/guestfish.pod:154
17865 msgid "Displays general help on options."
17869 #: ../fish/guestfish.pod:158
17870 msgid "B<--cmd-help>"
17874 #: ../fish/guestfish.pod:160
17875 msgid "Lists all available guestfish commands."
17879 #: ../fish/guestfish.pod:162
17884 #: ../fish/guestfish.pod:164
17885 msgid "B<--cmd-help cmd>"
17889 #: ../fish/guestfish.pod:166
17890 msgid "Displays detailed help on a single command C<cmd>."
17894 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
17895 msgid "B<-a image>"
17899 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
17900 msgid "B<--add image>"
17904 #: ../fish/guestfish.pod:172
17905 msgid "Add a block device or virtual machine image to the shell."
17909 #: ../fish/guestfish.pod:177
17911 "Using this flag is mostly equivalent to using the C<add> command, with "
17912 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17913 "the I<--format=...> flag was given."
17917 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
17919 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17920 "URI to use. The default is to use the default libvirt connection."
17924 #: ../fish/guestfish.pod:189
17929 #: ../fish/guestfish.pod:191
17931 "If using the I<--listen> option and a csh-like shell, use this option. See "
17932 "section L</REMOTE CONTROL AND CSH> below."
17936 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
17937 msgid "B<-d libvirt-domain>"
17941 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
17942 msgid "B<--domain libvirt-domain>"
17946 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
17948 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17949 "used, then any libvirt domain can be used. However in write mode, only "
17950 "libvirt domains which are shut down can be named here."
17954 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
17955 msgid "Domain UUIDs can be used instead of names."
17959 #: ../fish/guestfish.pod:204
17961 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17962 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17963 "if the I<--format:...> flag was given."
17967 #: ../fish/guestfish.pod:208
17972 #: ../fish/guestfish.pod:210
17973 msgid "B<--no-dest-paths>"
17977 #: ../fish/guestfish.pod:212
17979 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17980 "to hit the tab key to complete paths on the guest filesystem, but this "
17981 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17982 "allow this feature to be disabled."
17986 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
17988 "When prompting for keys and passphrases, guestfish normally turns echoing "
17989 "off so you cannot see what you are typing. If you are not worried about "
17990 "Tempest attacks and there is no one else in the room you can specify this "
17991 "flag to see what you are typing."
17995 #: ../fish/guestfish.pod:224
18000 #: ../fish/guestfish.pod:226
18001 msgid "B<--file file>"
18005 #: ../fish/guestfish.pod:228
18006 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
18010 #: ../fish/guestfish.pod:231
18013 " #!/usr/bin/guestfish -f\n"
18018 #: ../fish/guestfish.pod:244
18021 " guestfish --format=raw -a disk.img\n"
18026 #: ../fish/guestfish.pod:248
18029 " guestfish --format=raw -a disk.img --format -a another.img\n"
18034 #: ../fish/guestfish.pod:253
18036 "If you have untrusted raw-format guest disk images, you should use this "
18037 "option to specify the disk format. This avoids a possible security problem "
18038 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
18042 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
18043 msgid "B<--inspector>"
18047 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
18049 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
18050 "system and mount filesystems as they would be mounted on the real virtual "
18055 #: ../fish/guestfish.pod:266
18056 msgid "Typical usage is either:"
18060 #: ../fish/guestfish.pod:268
18063 " guestfish -d myguest -i\n"
18068 #: ../fish/guestfish.pod:270
18069 msgid "(for an inactive libvirt domain called I<myguest>), or:"
18073 #: ../fish/guestfish.pod:272
18076 " guestfish --ro -d myguest -i\n"
18081 #: ../fish/guestfish.pod:274
18082 msgid "(for active domains, readonly), or specify the block device directly:"
18086 #: ../fish/guestfish.pod:276
18089 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
18094 #: ../fish/guestfish.pod:278
18096 "Note that the command line syntax changed slightly over older versions of "
18097 "guestfish. You can still use the old syntax:"
18101 #: ../fish/guestfish.pod:281
18104 " guestfish [--ro] -i disk.img\n"
18109 #: ../fish/guestfish.pod:283
18112 " guestfish [--ro] -i libvirt-domain\n"
18117 #: ../fish/guestfish.pod:285
18119 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
18120 "then using other commands to mount the filesystems that were found."
18124 #: ../fish/guestfish.pod:294
18125 msgid "B<--listen>"
18129 #: ../fish/guestfish.pod:296
18131 "Fork into the background and listen for remote commands. See section L</"
18132 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18136 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
18141 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
18143 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
18144 "ATTACHING TO RUNNING DAEMONS>)."
18148 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
18149 msgid "B<-m dev[:mountpoint[:options]]>"
18153 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
18154 msgid "B<--mount dev[:mountpoint[:options]]>"
18158 #: ../fish/guestfish.pod:308
18159 msgid "Mount the named partition or logical volume on the given mountpoint."
18163 #: ../fish/guestfish.pod:310
18164 msgid "If the mountpoint is omitted, it defaults to C</>."
18168 #: ../fish/guestfish.pod:312
18169 msgid "You have to mount something on C</> before most commands will work."
18173 #: ../fish/guestfish.pod:314
18175 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18180 #: ../fish/guestfish.pod:317
18182 "If you don't know what filesystems a disk image contains, you can either run "
18183 "guestfish without this option, then list the partitions, filesystems and LVs "
18184 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18185 "commands), or you can use the L<virt-filesystems(1)> program."
18189 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
18191 "The third (and rarely used) part of the mount parameter is the list of mount "
18192 "options used to mount the underlying filesystem. If this is not given, then "
18193 "the mount options are either the empty string or C<ro> (the latter if the "
18194 "I<--ro> flag is used). By specifying the mount options, you override this "
18195 "default choice. Probably the only time you would use this is to enable ACLs "
18196 "and/or extended attributes if the filesystem can support them:"
18200 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
18203 " -m /dev/sda1:/:acl,user_xattr\n"
18208 #: ../fish/guestfish.pod:333
18209 msgid "Using this flag is equivalent to using the C<mount-options> command."
18213 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193
18214 #: ../resize/virt-resize.pod:358
18219 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
18220 msgid "B<--no-sync>"
18224 #: ../fish/guestfish.pod:339
18226 "Disable autosync. This is enabled by default. See the discussion of "
18227 "autosync in the L<guestfs(3)> manpage."
18231 #: ../fish/guestfish.pod:342
18236 #: ../fish/guestfish.pod:344
18237 msgid "B<--new type>"
18241 #: ../fish/guestfish.pod:346
18246 #: ../fish/guestfish.pod:348
18248 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18249 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18250 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18255 #: ../fish/guestfish.pod:353
18256 msgid "B<--progress-bars>"
18260 #: ../fish/guestfish.pod:355
18261 msgid "Enable progress bars, even when guestfish is used non-interactively."
18265 #: ../fish/guestfish.pod:357
18267 "Progress bars are enabled by default when guestfish is used as an "
18268 "interactive shell."
18272 #: ../fish/guestfish.pod:360
18273 msgid "B<--no-progress-bars>"
18277 #: ../fish/guestfish.pod:362
18278 msgid "Disable progress bars."
18282 #: ../fish/guestfish.pod:364
18283 msgid "B<--remote[=pid]>"
18287 #: ../fish/guestfish.pod:366
18289 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18290 "CONTROL GUESTFISH OVER A SOCKET> below."
18294 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239
18295 #: ../rescue/virt-rescue.pod:161
18300 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
18301 #: ../rescue/virt-rescue.pod:163
18306 #: ../fish/guestfish.pod:373
18308 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18309 "mounts are done read-only."
18313 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18315 "The option must always be used if the disk image or virtual machine might be "
18316 "running, and is generally recommended in cases where you don't need write "
18317 "access to the disk."
18321 #: ../fish/guestfish.pod:380
18323 "Note that prepared disk images created with I<-N> are not affected by this "
18324 "option. Also commands like C<add> are not affected - you have to specify "
18325 "the C<readonly:true> option explicitly if you need it."
18329 #: ../fish/guestfish.pod:384
18330 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18334 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253
18335 #: ../rescue/virt-rescue.pod:173
18336 msgid "B<--selinux>"
18340 #: ../fish/guestfish.pod:388
18341 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18345 #: ../fish/guestfish.pod:394
18347 "Enable very verbose messages. This is particularly useful if you find a bug."
18351 #: ../fish/guestfish.pod:401
18352 msgid "Display the guestfish / libguestfs version number and exit."
18356 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269
18357 #: ../rescue/virt-rescue.pod:194
18362 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
18363 #: ../rescue/virt-rescue.pod:196
18368 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
18370 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18371 "mounts are done read-write."
18375 #: ../fish/guestfish.pod:410
18376 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18380 #: ../fish/guestfish.pod:414
18381 msgid "Echo each command before executing it."
18385 #: ../fish/guestfish.pod:418
18386 msgid "COMMANDS ON COMMAND LINE"
18390 #: ../fish/guestfish.pod:420
18392 "Any additional (non-option) arguments are treated as commands to execute."
18396 #: ../fish/guestfish.pod:423
18398 "Commands to execute should be separated by a colon (C<:>), where the colon "
18399 "is a separate parameter. Thus:"
18403 #: ../fish/guestfish.pod:426
18406 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18411 #: ../fish/guestfish.pod:428
18413 "If there are no additional arguments, then we enter a shell, either an "
18414 "interactive shell with a prompt (if the input is a terminal) or a non-"
18415 "interactive shell."
18419 #: ../fish/guestfish.pod:432
18421 "In either command line mode or non-interactive shell, the first command that "
18422 "gives an error causes the whole shell to exit. In interactive mode (with a "
18423 "prompt) if a command fails, you can continue to enter commands."
18427 #: ../fish/guestfish.pod:437
18428 msgid "USING launch (OR run)"
18432 #: ../fish/guestfish.pod:439
18434 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18435 "then launch it, then mount any disks you need, and finally issue actions/"
18436 "commands. So the general order of the day is:"
18440 #: ../fish/guestfish.pod:447
18441 msgid "add or -a/--add"
18445 #: ../fish/guestfish.pod:451
18446 msgid "launch (aka run)"
18450 #: ../fish/guestfish.pod:455
18451 msgid "mount or -m/--mount"
18455 #: ../fish/guestfish.pod:459
18456 msgid "any other commands"
18460 #: ../fish/guestfish.pod:463
18462 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18463 "guest before mounting or performing any other commands."
18467 #: ../fish/guestfish.pod:466
18469 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18470 "I<--new> options were given then C<run> is done automatically, simply "
18471 "because guestfish can't perform the action you asked for without doing this."
18475 #: ../fish/guestfish.pod:471
18476 msgid "OPENING DISKS FOR READ AND WRITE"
18480 #: ../fish/guestfish.pod:473
18482 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18483 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18484 "I<-i> and I<-m> open disk images read-only or for writing."
18488 #: ../fish/guestfish.pod:478
18490 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18491 "opening disk images supplied on the command line for write. To open a disk "
18492 "image read-only you have to do I<-a image --ro>."
18496 #: ../fish/guestfish.pod:482
18498 "This matters: If you accidentally open a live VM disk image writable then "
18499 "you will cause irreversible disk corruption."
18503 #: ../fish/guestfish.pod:485
18505 "In a future libguestfs we intend to change the default the other way. Disk "
18506 "images will be opened read-only. You will have to either specify "
18507 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18508 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18509 "access for disk images specified by those other command line options."
18513 #: ../fish/guestfish.pod:492
18515 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18516 "which does nothing (it is already the default). However it is highly "
18517 "recommended that you use this option to indicate that you need write access, "
18518 "and prepare your scripts for the day when this option will be required for "
18523 #: ../fish/guestfish.pod:498
18525 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18526 "other libguestfs program apart from guestfish and guestmount."
18530 #: ../fish/guestfish.pod:501
18535 #: ../fish/guestfish.pod:503
18537 "You can quote ordinary parameters using either single or double quotes. For "
18542 #: ../fish/guestfish.pod:506
18545 " add \"file with a space.img\"\n"
18550 #: ../fish/guestfish.pod:508
18553 " rm '/file name'\n"
18558 #: ../fish/guestfish.pod:510
18566 #: ../fish/guestfish.pod:512
18568 "A few commands require a list of strings to be passed. For these, use a "
18569 "whitespace-separated list, enclosed in quotes. Strings containing "
18570 "whitespace to be passed through must be enclosed in single quotes. A "
18571 "literal single quote must be escaped with a backslash."
18575 #: ../fish/guestfish.pod:517
18578 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18579 " command \"/bin/echo 'foo bar'\"\n"
18580 " command \"/bin/echo \\'foo\\'\"\n"
18585 #: ../fish/guestfish.pod:521
18586 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18590 #: ../fish/guestfish.pod:523
18592 "In double-quoted arguments (only) use backslash to insert special characters:"
18596 #: ../fish/guestfish.pod:528
18601 #: ../fish/guestfish.pod:530
18602 msgid "Alert (bell) character."
18606 #: ../fish/guestfish.pod:532
18611 #: ../fish/guestfish.pod:534
18612 msgid "Backspace character."
18616 #: ../fish/guestfish.pod:536
18621 #: ../fish/guestfish.pod:538
18622 msgid "Form feed character."
18626 #: ../fish/guestfish.pod:540
18631 #: ../fish/guestfish.pod:542
18632 msgid "Newline character."
18636 #: ../fish/guestfish.pod:544
18641 #: ../fish/guestfish.pod:546
18642 msgid "Carriage return character."
18646 #: ../fish/guestfish.pod:548
18651 #: ../fish/guestfish.pod:550
18652 msgid "Horizontal tab character."
18656 #: ../fish/guestfish.pod:552
18661 #: ../fish/guestfish.pod:554
18662 msgid "Vertical tab character."
18666 #: ../fish/guestfish.pod:556
18671 #: ../fish/guestfish.pod:558
18672 msgid "A literal double quote character."
18676 #: ../fish/guestfish.pod:560
18681 #: ../fish/guestfish.pod:562
18683 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18688 #: ../fish/guestfish.pod:565
18693 #: ../fish/guestfish.pod:567
18695 "A character with hex value I<hh>. There must be precisely 2 hex digits."
18699 #: ../fish/guestfish.pod:570
18701 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18706 #: ../fish/guestfish.pod:573
18711 #: ../fish/guestfish.pod:575
18712 msgid "A literal backslash character."
18716 #: ../fish/guestfish.pod:579
18717 msgid "OPTIONAL ARGUMENTS"
18721 #: ../fish/guestfish.pod:581
18723 "Some commands take optional arguments. These arguments appear in this "
18724 "documentation as C<[argname:..]>. You can use them as in these examples:"
18728 #: ../fish/guestfish.pod:585
18731 " add-drive-opts filename\n"
18736 #: ../fish/guestfish.pod:587
18739 " add-drive-opts filename readonly:true\n"
18744 #: ../fish/guestfish.pod:589
18747 " add-drive-opts filename format:qcow2 readonly:false\n"
18752 #: ../fish/guestfish.pod:591
18754 "Each optional argument can appear at most once. All optional arguments must "
18755 "appear after the required ones."
18759 #: ../fish/guestfish.pod:594
18764 #: ../fish/guestfish.pod:596
18766 "This section applies to all commands which can take integers as parameters."
18770 #: ../fish/guestfish.pod:599
18771 msgid "SIZE SUFFIX"
18775 #: ../fish/guestfish.pod:601
18777 "When the command takes a parameter measured in bytes, you can use one of the "
18778 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18782 #: ../fish/guestfish.pod:607
18783 msgid "B<k> or B<K> or B<KiB>"
18787 #: ../fish/guestfish.pod:609
18788 msgid "The size in kilobytes (multiplied by 1024)."
18792 #: ../fish/guestfish.pod:611
18797 #: ../fish/guestfish.pod:613
18798 msgid "The size in SI 1000 byte units."
18802 #: ../fish/guestfish.pod:615
18803 msgid "B<M> or B<MiB>"
18807 #: ../fish/guestfish.pod:617
18808 msgid "The size in megabytes (multiplied by 1048576)."
18812 #: ../fish/guestfish.pod:619
18817 #: ../fish/guestfish.pod:621
18818 msgid "The size in SI 1000000 byte units."
18822 #: ../fish/guestfish.pod:623
18823 msgid "B<G> or B<GiB>"
18827 #: ../fish/guestfish.pod:625
18828 msgid "The size in gigabytes (multiplied by 2**30)."
18832 #: ../fish/guestfish.pod:627
18837 #: ../fish/guestfish.pod:629
18838 msgid "The size in SI 10**9 byte units."
18842 #: ../fish/guestfish.pod:631
18843 msgid "B<T> or B<TiB>"
18847 #: ../fish/guestfish.pod:633
18848 msgid "The size in terabytes (multiplied by 2**40)."
18852 #: ../fish/guestfish.pod:635
18857 #: ../fish/guestfish.pod:637
18858 msgid "The size in SI 10**12 byte units."
18862 #: ../fish/guestfish.pod:639
18863 msgid "B<P> or B<PiB>"
18867 #: ../fish/guestfish.pod:641
18868 msgid "The size in petabytes (multiplied by 2**50)."
18872 #: ../fish/guestfish.pod:643
18877 #: ../fish/guestfish.pod:645
18878 msgid "The size in SI 10**15 byte units."
18882 #: ../fish/guestfish.pod:647
18883 msgid "B<E> or B<EiB>"
18887 #: ../fish/guestfish.pod:649
18888 msgid "The size in exabytes (multiplied by 2**60)."
18892 #: ../fish/guestfish.pod:651
18897 #: ../fish/guestfish.pod:653
18898 msgid "The size in SI 10**18 byte units."
18902 #: ../fish/guestfish.pod:655
18903 msgid "B<Z> or B<ZiB>"
18907 #: ../fish/guestfish.pod:657
18908 msgid "The size in zettabytes (multiplied by 2**70)."
18912 #: ../fish/guestfish.pod:659
18917 #: ../fish/guestfish.pod:661
18918 msgid "The size in SI 10**21 byte units."
18922 #: ../fish/guestfish.pod:663
18923 msgid "B<Y> or B<YiB>"
18927 #: ../fish/guestfish.pod:665
18928 msgid "The size in yottabytes (multiplied by 2**80)."
18932 #: ../fish/guestfish.pod:667
18937 #: ../fish/guestfish.pod:669
18938 msgid "The size in SI 10**24 byte units."
18942 #: ../fish/guestfish.pod:675
18945 " truncate-size /file 1G\n"
18950 #: ../fish/guestfish.pod:677
18951 msgid "would truncate the file to 1 gigabyte."
18955 #: ../fish/guestfish.pod:679
18957 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18958 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18959 "suffix will probably not do what you expect."
18963 #: ../fish/guestfish.pod:683
18964 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18968 #: ../fish/guestfish.pod:685
18970 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18971 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18975 #: ../fish/guestfish.pod:688
18978 " 1234 decimal number 1234\n"
18979 " 02322 octal number, equivalent to decimal 1234\n"
18980 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18985 #: ../fish/guestfish.pod:692
18987 "When using the C<chmod> command, you almost always want to specify an octal "
18988 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18989 "L<chmod(1)> program):"
18993 #: ../fish/guestfish.pod:696
18996 " chmod 0777 /public # OK\n"
18997 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
19002 #: ../fish/guestfish.pod:699
19004 "Commands that return numbers usually print them in decimal, but some "
19005 "commands print numbers in other radices (eg. C<umask> prints the mode in "
19006 "octal, preceeded by C<0>)."
19010 #: ../fish/guestfish.pod:703
19011 msgid "WILDCARDS AND GLOBBING"
19015 #: ../fish/guestfish.pod:705
19017 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
19018 "(globbing) by default. So for example the following will not do what you "
19023 #: ../fish/guestfish.pod:709
19031 #: ../fish/guestfish.pod:711
19033 "Assuming you don't have a directory called literally C</home/*> then the "
19034 "above command will return an error."
19038 #: ../fish/guestfish.pod:714
19039 msgid "To perform wildcard expansion, use the C<glob> command."
19043 #: ../fish/guestfish.pod:716
19046 " glob rm-rf /home/*\n"
19051 #: ../fish/guestfish.pod:718
19053 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
19054 "many times), equivalent to:"
19058 #: ../fish/guestfish.pod:721
19061 " rm-rf /home/jim\n"
19062 " rm-rf /home/joe\n"
19063 " rm-rf /home/mary\n"
19068 #: ../fish/guestfish.pod:725
19069 msgid "C<glob> only works on simple guest paths and not on device names."
19073 #: ../fish/guestfish.pod:727
19075 "If you have several parameters, each containing a wildcard, then glob will "
19076 "perform a Cartesian product."
19080 #: ../fish/guestfish.pod:730
19085 #: ../fish/guestfish.pod:732
19087 "Any line which starts with a I<#> character is treated as a comment and "
19088 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
19089 "a command. For example:"
19093 #: ../fish/guestfish.pod:736
19096 " # this is a comment\n"
19097 " # this is a comment\n"
19098 " foo # NOT a comment\n"
19103 #: ../fish/guestfish.pod:740
19104 msgid "Blank lines are also ignored."
19108 #: ../fish/guestfish.pod:742
19109 msgid "RUNNING COMMANDS LOCALLY"
19113 #: ../fish/guestfish.pod:744
19115 "Any line which starts with a I<!> character is treated as a command sent to "
19116 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
19120 #: ../fish/guestfish.pod:748
19124 " tgz-out /remote local/remote-data.tar.gz\n"
19129 #: ../fish/guestfish.pod:751
19131 "will create a directory C<local> on the host, and then export the contents "
19132 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
19133 "(See C<tgz-out>)."
19137 #: ../fish/guestfish.pod:755
19139 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
19140 "effect, due to the way that subprocesses work in Unix."
19144 #: ../fish/guestfish.pod:758
19145 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
19149 #: ../fish/guestfish.pod:760
19151 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19152 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19153 "and executed as guestfish commands."
19157 #: ../fish/guestfish.pod:764
19159 "Thus you can use shell script to construct arbitrary guestfish commands "
19160 "which are then parsed by guestfish."
19164 #: ../fish/guestfish.pod:767
19166 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19167 "through C</foo.100>) using guestfish commands alone. However this is simple "
19168 "if we use a shell script to create the guestfish commands for us:"
19172 #: ../fish/guestfish.pod:772
19175 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19180 #: ../fish/guestfish.pod:774
19181 msgid "or with names like C</foo.001>:"
19185 #: ../fish/guestfish.pod:776
19188 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19193 #: ../fish/guestfish.pod:778
19195 "When using guestfish interactively it can be helpful to just run the shell "
19196 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19197 "ordinary I<!> local command), see what guestfish commands it would run, and "
19198 "when you are happy with those prepend the C<E<lt>> character to run the "
19199 "guestfish commands for real."
19203 #: ../fish/guestfish.pod:784
19208 #: ../fish/guestfish.pod:786
19210 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19211 "command (a guestfish command) to the second command (any host command). For "
19216 #: ../fish/guestfish.pod:790
19219 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19224 #: ../fish/guestfish.pod:792
19226 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19227 "program). The above command would list all accounts in the guest filesystem "
19228 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19232 #: ../fish/guestfish.pod:797
19235 " hexdump /bin/ls | head\n"
19236 " list-devices | tail -1\n"
19237 " tgz-out / - | tar ztf -\n"
19242 #: ../fish/guestfish.pod:801
19244 "The space before the pipe symbol is required, any space after the pipe "
19245 "symbol is optional. Everything after the pipe symbol is just passed "
19246 "straight to the host shell, so it can contain redirections, globs and "
19247 "anything else that makes sense on the host side."
19251 #: ../fish/guestfish.pod:806
19253 "To use a literal argument which begins with a pipe symbol, you have to quote "
19258 #: ../fish/guestfish.pod:809
19266 #: ../fish/guestfish.pod:811
19267 msgid "HOME DIRECTORIES"
19271 #: ../fish/guestfish.pod:813
19273 "If a parameter starts with the character C<~> then the tilde may be expanded "
19274 "as a home directory path (either C<~> for the current user's home directory, "
19275 "or C<~user> for another user)."
19279 #: ../fish/guestfish.pod:817
19281 "Note that home directory expansion happens for users known I<on the host>, "
19282 "not in the guest filesystem."
19286 #: ../fish/guestfish.pod:820
19288 "To use a literal argument which begins with a tilde, you have to quote it, "
19293 #: ../fish/guestfish.pod:823
19301 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
19302 msgid "ENCRYPTED DISKS"
19306 #: ../fish/guestfish.pod:827
19308 "Libguestfs has some support for Linux guests encrypted according to the "
19309 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19310 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
19311 "LUKS is supported."
19315 #: ../fish/guestfish.pod:832
19316 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19320 #: ../fish/guestfish.pod:834
19323 " ><fs> vfs-type /dev/sda2\n"
19329 #: ../fish/guestfish.pod:837
19331 "Then open those devices using L</luks-open>. This creates a device-mapper "
19332 "device called C</dev/mapper/luksdev>."
19336 #: ../fish/guestfish.pod:840
19339 " ><fs> luks-open /dev/sda2 luksdev\n"
19340 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19345 #: ../fish/guestfish.pod:843
19347 "Finally you have to tell LVM to scan for volume groups on the newly created "
19352 #: ../fish/guestfish.pod:846
19356 " vg-activate-all true\n"
19361 #: ../fish/guestfish.pod:849
19362 msgid "The logical volume(s) can now be mounted in the usual way."
19366 #: ../fish/guestfish.pod:851
19368 "Before closing a LUKS device you must unmount any logical volumes on it and "
19369 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19370 "one. Then you can close the mapper device:"
19374 #: ../fish/guestfish.pod:855
19377 " vg-activate false /dev/VG\n"
19378 " luks-close /dev/mapper/luksdev\n"
19383 #: ../fish/guestfish.pod:860
19385 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19386 "letters and paths (with some limitations). The following commands are "
19391 #: ../fish/guestfish.pod:864
19394 " file /WINDOWS/system32/config/system.LOG\n"
19399 #: ../fish/guestfish.pod:866
19402 " file win:\\windows\\system32\\config\\system.log\n"
19407 #: ../fish/guestfish.pod:868
19410 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19415 #: ../fish/guestfish.pod:870
19417 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19418 "where the drive is mounted, prepending that to the path, changing all "
19419 "backslash characters to forward slash, then resolving the result using L</"
19420 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
19421 "the parameter might be rewritten like this:"
19425 #: ../fish/guestfish.pod:876
19428 " win:e:\\foo\\bar => /e/FOO/bar\n"
19433 #: ../fish/guestfish.pod:878
19434 msgid "This only works in argument positions that expect a path."
19438 #: ../fish/guestfish.pod:880
19439 msgid "UPLOADING AND DOWNLOADING FILES"
19443 #: ../fish/guestfish.pod:882
19445 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19446 "others which upload from or download to a local file, you can use the "
19447 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19451 #: ../fish/guestfish.pod:886
19459 #: ../fish/guestfish.pod:888
19461 "reads stdin and creates from that a file C</foo> in the disk image, and:"
19465 #: ../fish/guestfish.pod:891
19468 " tar-out /etc - | tar tf -\n"
19473 #: ../fish/guestfish.pod:893
19475 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19476 "command (see L</PIPES>)."
19480 #: ../fish/guestfish.pod:896
19482 "When using C<-> to read from stdin, the input is read up to the end of "
19483 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19484 "some arbitrary end marker:"
19488 #: ../fish/guestfish.pod:900
19491 " upload -<<END /foo\n"
19500 #: ../fish/guestfish.pod:906
19502 "Any string of characters can be used instead of C<END>. The end marker must "
19503 "appear on a line of its own, without any preceeding or following characters "
19504 "(not even spaces)."
19508 #: ../fish/guestfish.pod:910
19510 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19511 "upload local files (so-called \"FileIn\" parameters in the generator)."
19515 #: ../fish/guestfish.pod:913
19516 msgid "EXIT ON ERROR BEHAVIOUR"
19520 #: ../fish/guestfish.pod:915
19522 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19523 "taking commands from a human over a tty), and will exit on the first error "
19524 "in non-interactive mode (scripts, commands given on the command line)."
19528 #: ../fish/guestfish.pod:920
19530 "If you prefix a command with a I<-> character, then that command will not "
19531 "cause guestfish to exit, even if that (one) command returns an error."
19535 #: ../fish/guestfish.pod:924
19536 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19540 #: ../fish/guestfish.pod:926
19542 "Guestfish can be remote-controlled over a socket. This is useful "
19543 "particularly in shell scripts where you want to make several different "
19544 "changes to a filesystem, but you don't want the overhead of starting up a "
19545 "guestfish process each time."
19549 #: ../fish/guestfish.pod:931
19550 msgid "Start a guestfish server process using:"
19554 #: ../fish/guestfish.pod:933
19557 " eval \"`guestfish --listen`\"\n"
19562 #: ../fish/guestfish.pod:935
19563 msgid "and then send it commands by doing:"
19567 #: ../fish/guestfish.pod:937
19570 " guestfish --remote cmd [...]\n"
19575 #: ../fish/guestfish.pod:939
19576 msgid "To cause the server to exit, send it the exit command:"
19580 #: ../fish/guestfish.pod:943
19582 "Note that the server will normally exit if there is an error in a command. "
19583 "You can change this in the usual way. See section L</EXIT ON ERROR "
19588 #: ../fish/guestfish.pod:947
19589 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19593 #: ../fish/guestfish.pod:949
19595 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19596 "is how the I<--remote> option knows where to send the commands. You can "
19597 "have several guestfish listener processes running using:"
19601 #: ../fish/guestfish.pod:953
19604 " eval \"`guestfish --listen`\"\n"
19605 " pid1=$GUESTFISH_PID\n"
19606 " eval \"`guestfish --listen`\"\n"
19607 " pid2=$GUESTFISH_PID\n"
19609 " guestfish --remote=$pid1 cmd\n"
19610 " guestfish --remote=$pid2 cmd\n"
19615 #: ../fish/guestfish.pod:961
19616 msgid "REMOTE CONTROL AND CSH"
19620 #: ../fish/guestfish.pod:963
19622 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19627 #: ../fish/guestfish.pod:966
19630 " eval \"`guestfish --listen --csh`\"\n"
19635 #: ../fish/guestfish.pod:968
19636 msgid "REMOTE CONTROL DETAILS"
19640 #: ../fish/guestfish.pod:970
19642 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
19643 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
19644 "and C<$PID> is the process ID of the server."
19648 #: ../fish/guestfish.pod:974
19649 msgid "Guestfish client and server versions must match exactly."
19653 #: ../fish/guestfish.pod:976
19654 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19658 #: ../fish/guestfish.pod:978
19660 "From Bash, you can use the following code which creates a guestfish "
19661 "instance, correctly quotes the command line, handles failure to start, and "
19662 "cleans up guestfish when the script exits:"
19666 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19674 #: ../fish/guestfish.pod:986
19677 " guestfish[0]=\"guestfish\"\n"
19678 " guestfish[1]=\"--listen\"\n"
19679 " guestfish[2]=\"--ro\"\n"
19680 " guestfish[3]=\"-a\"\n"
19681 " guestfish[4]=\"disk.img\"\n"
19686 #: ../fish/guestfish.pod:992
19689 " GUESTFISH_PID=\n"
19690 " eval $(\"${guestfish[@]}\")\n"
19691 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19692 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19699 #: ../fish/guestfish.pod:999
19702 " kill_guestfish ()\n"
19704 " kill $GUESTFISH_PID >/dev/null 2>&1 ||:\n"
19706 " trap kill_guestfish EXIT\n"
19711 #: ../fish/guestfish.pod:1005
19714 " guestfish --remote run\n"
19720 #: ../fish/guestfish.pod:1008
19721 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19725 #: ../fish/guestfish.pod:1010
19727 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19728 "context hangs, ie. don't do (note the backquotes):"
19732 #: ../fish/guestfish.pod:1013
19735 " a=`guestfish --remote run`\n"
19740 #: ../fish/guestfish.pod:1015
19742 "Since the C<run> command produces no output on stdout, this is not useful "
19743 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
19748 #: ../fish/guestfish.pod:1019
19749 msgid "PREPARED DISK IMAGES"
19753 #: ../fish/guestfish.pod:1021
19755 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19756 "preformatted disk images that guestfish can make for you to save typing. "
19757 "This is particularly useful for testing purposes. This option is used "
19758 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19759 "can be mixed with I<-a>)."
19763 #: ../fish/guestfish.pod:1027
19765 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19766 "the second and so on. Existing files in the current directory are "
19771 #: ../fish/guestfish.pod:1031
19773 "The type briefly describes how the disk should be sized, partitioned, how "
19774 "filesystem(s) should be created, and how content should be added. "
19775 "Optionally the type can be followed by extra parameters, separated by C<:> "
19776 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
19777 "allocated disk, containing a single partition, with the partition formatted "
19778 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
19783 #: ../fish/guestfish.pod:1039
19784 msgid "To list the available types and any extra parameters they take, run:"
19788 #: ../fish/guestfish.pod:1043
19790 "Note that the prepared filesystem is not mounted. You would usually have to "
19791 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19795 #: ../fish/guestfish.pod:1047
19797 "If any I<-N> or I<--new> options are given, the guest is automatically "
19802 #: ../fish/guestfish.pod:1052
19803 msgid "Create a 100MB disk with an ext4-formatted partition:"
19807 #: ../fish/guestfish.pod:1054
19810 " guestfish -N fs:ext4\n"
19815 #: ../fish/guestfish.pod:1056
19816 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19820 #: ../fish/guestfish.pod:1058
19823 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19828 #: ../fish/guestfish.pod:1060
19829 msgid "Create a blank 200MB disk:"
19833 #: ../fish/guestfish.pod:1062
19836 " guestfish -N disk:200M\n"
19841 #: ../fish/guestfish.pod:1064
19842 msgid "PROGRESS BARS"
19846 #: ../fish/guestfish.pod:1066
19848 "Some (not all) long-running commands send progress notification messages as "
19849 "they are running. Guestfish turns these messages into progress bars."
19853 #: ../fish/guestfish.pod:1070
19855 "When a command that supports progress bars takes longer than two seconds to "
19856 "run, and if progress bars are enabled, then you will see one appearing below "
19861 #: ../fish/guestfish.pod:1074
19864 " ><fs> copy-size /large-file /another-file 2048M\n"
19865 " / 10% [#####-----------------------------------------] 00:30\n"
19870 #: ../fish/guestfish.pod:1077
19872 "The spinner on the left hand side moves round once for every progress "
19873 "notification received from the backend. This is a (reasonably) golden "
19874 "assurance that the command is \"doing something\" even if the progress bar "
19875 "is not moving, because the command is able to send the progress "
19876 "notifications. When the bar reaches 100% and the command finishes, the "
19877 "spinner disappears."
19881 #: ../fish/guestfish.pod:1084
19883 "Progress bars are enabled by default when guestfish is used interactively. "
19884 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19885 "and you can disable them completely using I<--no-progress-bars>."
19889 #: ../fish/guestfish.pod:1089
19890 msgid "GUESTFISH COMMANDS"
19894 #: ../fish/guestfish.pod:1091
19896 "The commands in this section are guestfish convenience commands, in other "
19897 "words, they are not part of the L<guestfs(3)> API."
19901 #: ../fish/guestfish.pod:1094
19906 #: ../fish/guestfish.pod:1096
19915 #: ../fish/guestfish.pod:1099
19916 msgid "Without any parameter, this provides general help."
19920 #: ../fish/guestfish.pod:1101
19921 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19925 #: ../fish/guestfish.pod:1103
19926 msgid "quit | exit"
19930 #: ../fish/guestfish.pod:1105
19931 msgid "This exits guestfish. You can also use C<^D> key."
19935 #: ../fish/guestfish.pod:1107
19936 msgid "@FISH_COMMANDS@"
19940 #: ../fish/guestfish.pod:1109
19945 #: ../fish/guestfish.pod:1111 ../src/guestfs.pod:1505
19950 #: ../fish/guestfish.pod:1115
19952 "guestfish returns 0 if the commands completed without error, or 1 if there "
19957 #: ../fish/guestfish.pod:1122
19962 #: ../fish/guestfish.pod:1124
19964 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19969 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3198
19970 msgid "FEBOOTSTRAP_KERNEL"
19974 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3200
19975 msgid "FEBOOTSTRAP_MODULES"
19979 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3202
19981 "These two environment variables allow the kernel that libguestfs uses in the "
19982 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19983 "most recent host kernel is chosen. For more information about kernel "
19984 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19985 "available in febootstrap E<ge> 3.8."
19989 #: ../fish/guestfish.pod:1137
19990 msgid "GUESTFISH_DISPLAY_IMAGE"
19994 #: ../fish/guestfish.pod:1139
19996 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19997 "If not set, it uses L<display(1)>."
20001 #: ../fish/guestfish.pod:1142
20002 msgid "GUESTFISH_PID"
20006 #: ../fish/guestfish.pod:1144
20008 "Used with the I<--remote> option to specify the remote guestfish process to "
20009 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
20013 #: ../fish/guestfish.pod:1148
20018 #: ../fish/guestfish.pod:1150
20020 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
20021 "not specified, the external L<hexedit(1)> program is used."
20025 #: ../fish/guestfish.pod:1154
20030 #: ../fish/guestfish.pod:1156
20032 "If compiled with GNU readline support, various files in the home directory "
20033 "can be used. See L</FILES>."
20037 #: ../fish/guestfish.pod:1159 ../src/guestfs.pod:3208
20038 msgid "LIBGUESTFS_APPEND"
20042 #: ../fish/guestfish.pod:1161 ../src/guestfs.pod:3210
20043 msgid "Pass additional options to the guest kernel."
20047 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3212
20048 msgid "LIBGUESTFS_DEBUG"
20052 #: ../fish/guestfish.pod:1165
20054 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
20055 "effect as using the B<-v> option."
20059 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3217
20060 msgid "LIBGUESTFS_MEMSIZE"
20064 #: ../fish/guestfish.pod:1170 ../src/guestfs.pod:3219
20066 "Set the memory allocated to the qemu process, in megabytes. For example:"
20070 #: ../fish/guestfish.pod:1173 ../src/guestfs.pod:3222
20073 " LIBGUESTFS_MEMSIZE=700\n"
20078 #: ../fish/guestfish.pod:1175 ../src/guestfs.pod:3224
20079 msgid "LIBGUESTFS_PATH"
20083 #: ../fish/guestfish.pod:1177
20085 "Set the path that guestfish uses to search for kernel and initrd.img. See "
20086 "the discussion of paths in L<guestfs(3)>."
20090 #: ../fish/guestfish.pod:1180 ../src/guestfs.pod:3229
20091 msgid "LIBGUESTFS_QEMU"
20095 #: ../fish/guestfish.pod:1182 ../src/guestfs.pod:3231
20097 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
20098 "which was found at compile time by the configure script is used."
20102 #: ../fish/guestfish.pod:1186 ../src/guestfs.pod:3237
20103 msgid "LIBGUESTFS_TRACE"
20107 #: ../fish/guestfish.pod:1188
20108 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
20112 #: ../fish/guestfish.pod:1190
20117 #: ../fish/guestfish.pod:1192
20119 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
20124 #: ../fish/guestfish.pod:1195 ../sparsify/virt-sparsify.pod:236
20125 #: ../src/guestfs.pod:3242
20130 #: ../fish/guestfish.pod:1197 ../src/guestfs.pod:3244
20132 "Location of temporary directory, defaults to C</tmp> except for the cached "
20133 "supermin appliance which defaults to C</var/tmp>."
20137 #: ../fish/guestfish.pod:1200 ../src/guestfs.pod:3247
20139 "If libguestfs was compiled to use the supermin appliance then the real "
20140 "appliance is cached in this directory, shared between all handles belonging "
20141 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
20142 "use in case C</var/tmp> is not large enough."
20146 #: ../fish/guestfish.pod:1208 ../fuse/guestmount.pod:288
20147 #: ../rescue/virt-rescue.pod:273
20152 #: ../fish/guestfish.pod:1212 ../fuse/guestmount.pod:292
20153 #: ../rescue/virt-rescue.pod:277
20154 msgid "$HOME/.libguestfs-tools.rc"
20158 #: ../fish/guestfish.pod:1214 ../fuse/guestmount.pod:294
20159 #: ../rescue/virt-rescue.pod:279
20160 msgid "/etc/libguestfs-tools.conf"
20164 #: ../fish/guestfish.pod:1216 ../fuse/guestmount.pod:296
20165 #: ../rescue/virt-rescue.pod:281
20167 "This configuration file controls the default read-only or read-write mode "
20168 "(I<--ro> or I<--rw>)."
20172 #: ../fish/guestfish.pod:1219
20173 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20177 #: ../fish/guestfish.pod:1221
20178 msgid "$HOME/.guestfish"
20182 #: ../fish/guestfish.pod:1223
20184 "If compiled with GNU readline support, then the command history is saved in "
20189 #: ../fish/guestfish.pod:1226
20190 msgid "$HOME/.inputrc"
20194 #: ../fish/guestfish.pod:1228
20195 msgid "/etc/inputrc"
20199 #: ../fish/guestfish.pod:1230
20201 "If compiled with GNU readline support, then these files can be used to "
20202 "configure readline. For further information, please see L<readline(3)/"
20203 "INITIALIZATION FILE>."
20207 #: ../fish/guestfish.pod:1234
20208 msgid "To write rules which only apply to guestfish, use:"
20212 #: ../fish/guestfish.pod:1236
20222 #: ../fish/guestfish.pod:1240
20224 "Variables that you can set in inputrc that change the behaviour of guestfish "
20225 "in useful ways include:"
20229 #: ../fish/guestfish.pod:1245
20230 msgid "completion-ignore-case (default: on)"
20234 #: ../fish/guestfish.pod:1247
20236 "By default, guestfish will ignore case when tab-completing paths on the "
20241 #: ../fish/guestfish.pod:1250
20244 " set completion-ignore-case off\n"
20249 #: ../fish/guestfish.pod:1252
20250 msgid "to make guestfish case sensitive."
20254 #: ../fish/guestfish.pod:1256
20259 #: ../fish/guestfish.pod:1258
20260 msgid "test2.img (etc)"
20264 #: ../fish/guestfish.pod:1260
20266 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20267 "will be created in the file C<test1.img> in the current directory. The "
20268 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20269 "the same name will be overwritten."
20273 #: ../fish/guestfish.pod:1269
20275 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
20276 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
20277 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
20278 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
20279 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, "
20280 "L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, "
20281 "L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
20285 #: ../fish/guestfish.pod:1301 ../src/guestfs.pod:3339
20286 #: ../test-tool/libguestfs-test-tool.pod:112
20287 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20291 #: ../fish/virt-copy-in.pod:5
20293 "virt-copy-in - Copy files and directories into a virtual machine disk image."
20297 #: ../fish/virt-copy-in.pod:9
20300 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20305 #: ../fish/virt-copy-in.pod:11
20308 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20313 #: ../fish/virt-copy-in.pod:15
20315 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20316 "causing disk corruption. The virtual machine must be shut down before you "
20317 "use this command."
20321 #: ../fish/virt-copy-in.pod:21
20323 "C<virt-copy-in> copies files and directories from the local disk into a "
20324 "virtual machine disk image or named libvirt domain."
20328 #: ../fish/virt-copy-in.pod:24
20330 "You can give one of more filenames and directories on the command line. "
20331 "Directories are copied in recursively. The final parameter must be the "
20332 "destination directory in the disk image which must be an absolute path "
20333 "starting with a C</> character."
20337 #: ../fish/virt-copy-in.pod:33
20340 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20345 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20346 msgid "Upload a home directory to a guest:"
20350 #: ../fish/virt-copy-in.pod:37
20353 " virt-copy-in -d MyGuest skel /home\n"
20358 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
20359 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20360 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20364 #: ../fish/virt-copy-in.pod:41
20366 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20367 "> C<copy-in> command. For anything more complex than a trivial copy, you "
20368 "are probably better off using guestfish directly."
20372 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
20373 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20375 "Since the shell script just passes options straight to guestfish, read "
20376 "L<guestfish(1)> to see the full list of options."
20380 #: ../fish/virt-copy-in.pod:52
20382 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20383 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20387 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
20388 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20389 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20393 #: ../fish/virt-copy-out.pod:5
20395 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20400 #: ../fish/virt-copy-out.pod:9
20403 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20408 #: ../fish/virt-copy-out.pod:11
20411 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20416 #: ../fish/virt-copy-out.pod:15
20418 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20419 "image or named libvirt domain."
20423 #: ../fish/virt-copy-out.pod:18
20425 "You can give one of more filenames and directories on the command line. "
20426 "Directories are copied out recursively."
20430 #: ../fish/virt-copy-out.pod:23
20431 msgid "Download the home directories from a virtual machine:"
20435 #: ../fish/virt-copy-out.pod:25
20439 " virt-copy-out -d MyGuest /home homes\n"
20444 #: ../fish/virt-copy-out.pod:30
20446 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20447 "> C<copy-out> command. For anything more complex than a trivial copy, you "
20448 "are probably better off using guestfish directly."
20452 #: ../fish/virt-copy-out.pod:41
20454 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
20455 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20459 #: ../fish/virt-tar-in.pod:5
20460 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20464 #: ../fish/virt-tar-in.pod:9
20467 " virt-tar-in -a disk.img data.tar /destination\n"
20472 #: ../fish/virt-tar-in.pod:11
20475 " virt-tar-in -d domain data.tar /destination\n"
20480 #: ../fish/virt-tar-in.pod:13
20483 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20488 #: ../fish/virt-tar-in.pod:17
20490 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20491 "causing disk corruption. The virtual machine must be shut down before you "
20492 "use this command."
20496 #: ../fish/virt-tar-in.pod:23
20498 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20499 "image or named libvirt domain."
20503 #: ../fish/virt-tar-in.pod:26
20505 "The first parameter is the tar file. Use C<-> to read the tar file from "
20506 "standard input. The second parameter is the absolute target directory to "
20511 #: ../fish/virt-tar-in.pod:34
20514 " virt-tar-in -d MyGuest homes.tar /home\n"
20519 #: ../fish/virt-tar-in.pod:38
20521 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20522 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
20523 "probably better off using guestfish directly."
20527 #: ../fish/virt-tar-in.pod:49
20529 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20530 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
20535 #: ../fish/virt-tar-out.pod:5
20537 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20541 #: ../fish/virt-tar-out.pod:9
20544 " virt-tar-out -a disk.img /dir files.tar\n"
20549 #: ../fish/virt-tar-out.pod:11
20552 " virt-tar-out -d domain /dir files.tar\n"
20557 #: ../fish/virt-tar-out.pod:13
20560 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20565 #: ../fish/virt-tar-out.pod:17
20567 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20571 #: ../fish/virt-tar-out.pod:20
20573 "The first parameter is the absolute path of the virtual machine directory. "
20574 "The second parameter is the tar file to write. Use C<-> to write to "
20579 #: ../fish/virt-tar-out.pod:26
20580 msgid "Download the home directories from a guest:"
20584 #: ../fish/virt-tar-out.pod:28
20587 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20592 #: ../fish/virt-tar-out.pod:32
20594 "This command is just a simple shell script wrapper around the L<guestfish(1)"
20595 "> C<tar-out> command. For anything more complex than a trivial copy, you "
20596 "are probably better off using guestfish directly."
20600 #: ../fish/virt-tar-out.pod:43
20602 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20603 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20607 #: ../fuse/guestmount.pod:5
20609 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20613 #: ../fuse/guestmount.pod:9
20616 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20621 #: ../fuse/guestmount.pod:11
20624 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20629 #: ../fuse/guestmount.pod:13
20632 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20637 #: ../fuse/guestmount.pod:17
20639 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20640 "machines. If you do this, you risk disk corruption in the VM."
20644 #: ../fuse/guestmount.pod:22
20646 "The guestmount program can be used to mount virtual machine filesystems and "
20647 "other disk images on the host. It uses libguestfs for access to the guest "
20648 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20649 "a mountable device."
20653 #: ../fuse/guestmount.pod:27
20655 "Along with other options, you have to give at least one device (I<-a> "
20656 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20657 "option) or use the I<-i> inspection option. How this works is better "
20658 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20663 #: ../fuse/guestmount.pod:33
20665 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20666 "by you, and the filesystem will not be visible to any other users unless you "
20667 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20668 "the filesystem, use the C<fusermount -u> command."
20672 #: ../fuse/guestmount.pod:41
20674 "For a typical Windows guest which has its main filesystem on the first "
20679 #: ../fuse/guestmount.pod:44
20682 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20687 #: ../fuse/guestmount.pod:46
20689 "For a typical Linux guest which has a /boot filesystem on the first "
20690 "partition, and the root filesystem on a logical volume:"
20694 #: ../fuse/guestmount.pod:49
20697 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20702 #: ../fuse/guestmount.pod:51
20703 msgid "To get libguestfs to detect guest mountpoints for you:"
20707 #: ../fuse/guestmount.pod:53
20710 " guestmount -a guest.img -i --ro /mnt\n"
20715 #: ../fuse/guestmount.pod:55
20716 msgid "For a libvirt guest called \"Guest\" you could do:"
20720 #: ../fuse/guestmount.pod:57
20723 " guestmount -d Guest -i --ro /mnt\n"
20728 #: ../fuse/guestmount.pod:59
20730 "If you don't know what filesystems are contained in a guest or disk image, "
20731 "use L<virt-filesystems(1)> first:"
20735 #: ../fuse/guestmount.pod:62
20738 " virt-filesystems MyGuest\n"
20743 #: ../fuse/guestmount.pod:64
20745 "If you want to trace the libguestfs calls but without excessive debugging "
20746 "information, we recommend:"
20750 #: ../fuse/guestmount.pod:67
20753 " guestmount [...] --trace /mnt\n"
20758 #: ../fuse/guestmount.pod:69
20759 msgid "If you want to debug the program, we recommend:"
20763 #: ../fuse/guestmount.pod:71
20766 " guestmount [...] --trace --verbose /mnt\n"
20771 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
20772 #: ../resize/virt-resize.pod:544
20777 #: ../fuse/guestmount.pod:75
20778 msgid "Other users cannot see the filesystem by default"
20782 #: ../fuse/guestmount.pod:77
20784 "If you mount a filesystem as one user (eg. root), then other users will not "
20785 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20786 "option when mounting:"
20790 #: ../fuse/guestmount.pod:81
20793 " sudo guestmount [...] -o allow_other /mnt\n"
20798 #: ../fuse/guestmount.pod:91
20799 msgid "Add a block device or virtual machine image."
20803 #: ../fuse/guestmount.pod:114
20804 msgid "B<--dir-cache-timeout N>"
20808 #: ../fuse/guestmount.pod:116
20810 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20811 "seconds. The readdir cache [actually, there are several semi-independent "
20812 "caches] is populated after a readdir(2) call with the stat and extended "
20813 "attributes of the files in the directory, in anticipation that they will be "
20814 "requested soon after."
20818 #: ../fuse/guestmount.pod:122
20820 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20821 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20822 "requests, only cache existing ones."
20826 #: ../fuse/guestmount.pod:142
20828 "If you have untrusted raw-format guest disk images, you should use this "
20829 "option to specify the disk format. This avoids a possible security problem "
20830 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
20831 "guestfs_add_drive_opts>."
20835 #: ../fuse/guestmount.pod:147
20836 msgid "B<--fuse-help>"
20840 #: ../fuse/guestmount.pod:149
20841 msgid "Display help on special FUSE options (see I<-o> below)."
20845 #: ../fuse/guestmount.pod:153
20846 msgid "Display brief help and exit."
20850 #: ../fuse/guestmount.pod:177
20852 "Mount the named partition or logical volume on the given mountpoint B<in the "
20853 "guest> (this has nothing to do with mountpoints in the host)."
20857 #: ../fuse/guestmount.pod:180
20859 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20860 "something on C</>."
20864 #: ../fuse/guestmount.pod:197
20866 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20867 "unmounted. If you specify this option, then we don't attempt to sync the "
20868 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20872 #: ../fuse/guestmount.pod:202
20873 msgid "B<-o option>"
20877 #: ../fuse/guestmount.pod:204
20878 msgid "B<--option option>"
20882 #: ../fuse/guestmount.pod:206
20883 msgid "Pass extra options to FUSE."
20887 #: ../fuse/guestmount.pod:208
20889 "To get a list of all the extra options supported by FUSE, use the command "
20890 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20891 "of them are a good idea."
20895 #: ../fuse/guestmount.pod:212
20898 " guestmount --fuse-help\n"
20903 #: ../fuse/guestmount.pod:214
20904 msgid "Some potentially useful FUSE options:"
20908 #: ../fuse/guestmount.pod:218
20909 msgid "B<-o allow_other>"
20913 #: ../fuse/guestmount.pod:220
20914 msgid "Allow other users to see the filesystem."
20918 #: ../fuse/guestmount.pod:222
20919 msgid "B<-o attr_timeout=N>"
20923 #: ../fuse/guestmount.pod:224
20924 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20928 #: ../fuse/guestmount.pod:226
20929 msgid "B<-o kernel_cache>"
20933 #: ../fuse/guestmount.pod:228
20935 "Allow the kernel to cache files (reduces the number of reads that have to go "
20936 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20937 "afford the extra memory usage."
20941 #: ../fuse/guestmount.pod:232
20942 msgid "B<-o uid=N> B<-o gid=N>"
20946 #: ../fuse/guestmount.pod:234
20948 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20949 "the chosen values."
20953 #: ../fuse/guestmount.pod:243
20955 "Add devices and mount everything read-only. Also disallow writes and make "
20956 "the disk appear read-only to FUSE."
20960 #: ../fuse/guestmount.pod:246
20962 "This is highly recommended if you are not going to edit the guest disk. If "
20963 "the guest is running and this option is I<not> supplied, then there is a "
20964 "strong risk of disk corruption in the guest. We try to prevent this from "
20965 "happening, but it is not always possible."
20969 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
20970 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20974 #: ../fuse/guestmount.pod:255
20975 msgid "Enable SELinux support for the guest."
20979 #: ../fuse/guestmount.pod:261
20980 msgid "Enable verbose messages from underlying libguestfs."
20984 #: ../fuse/guestmount.pod:267
20985 msgid "Display the program version and exit."
20989 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
20990 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20991 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20995 #: ../fuse/guestmount.pod:280
21000 #: ../fuse/guestmount.pod:282
21001 msgid "Trace libguestfs calls and entry into each FUSE function."
21005 #: ../fuse/guestmount.pod:284
21006 msgid "This also stops the daemon from forking into the background."
21010 #: ../fuse/guestmount.pod:310
21012 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21013 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
21018 #: ../fuse/guestmount.pod:325
21019 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
21023 #: ../inspector/virt-inspector.pod:5
21025 "virt-inspector - Display operating system version and other information "
21026 "about a virtual machine"
21030 #: ../inspector/virt-inspector.pod:9
21033 " virt-inspector [--options] -d domname\n"
21038 #: ../inspector/virt-inspector.pod:11
21041 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
21046 #: ../inspector/virt-inspector.pod:15
21049 " virt-inspector domname\n"
21054 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
21057 " virt-inspector disk.img [disk.img ...]\n"
21062 #: ../inspector/virt-inspector.pod:21
21064 "B<virt-inspector> examines a virtual machine or disk image and tries to "
21065 "determine the version of the operating system and other information about "
21066 "the virtual machine."
21070 #: ../inspector/virt-inspector.pod:25
21071 msgid "Virt-inspector produces XML output for feeding into other programs."
21075 #: ../inspector/virt-inspector.pod:27
21077 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
21078 "the libvirt domain (see: C<virsh list --all>)."
21082 #: ../inspector/virt-inspector.pod:30
21084 "You can also run virt-inspector directly on disk images from a single "
21085 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
21086 "has several block devices, in which case you should list several I<-a> "
21087 "options one after another, with the first corresponding to the guest's C</"
21088 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
21092 #: ../inspector/virt-inspector.pod:37
21094 "You can also run virt-inspector on install disks, live CDs, bootable USB "
21095 "keys and similar."
21099 #: ../inspector/virt-inspector.pod:40
21101 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
21102 "inspect several virtual machines, you have to run virt-inspector several "
21103 "times (for example, from a shell script for-loop)."
21107 #: ../inspector/virt-inspector.pod:45
21109 "Because virt-inspector needs direct access to guest images, it won't "
21110 "normally work over remote libvirt connections."
21114 #: ../inspector/virt-inspector.pod:48
21116 "All of the information available from virt-inspector is also available "
21117 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
21118 "The same information can also be fetched using guestfish or via libguestfs "
21119 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
21120 "WITH OTHER PROGRAMMING LANGUAGES>)."
21124 #: ../inspector/virt-inspector.pod:81
21126 "Libvirt is only used if you specify a C<domname> on the command line. If "
21127 "you specify guest block devices directly (I<-a>), then libvirt is not used "
21132 #: ../inspector/virt-inspector.pod:94
21134 "When prompting for keys and passphrases, virt-inspector normally turns "
21135 "echoing off so you cannot see what you are typing. If you are not worried "
21136 "about Tempest attacks and there is no one else in the room you can specify "
21137 "this flag to see what you are typing."
21141 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
21142 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
21143 #: ../tools/virt-win-reg.pl:144
21145 "Specify the format of disk images given on the command line. If this is "
21146 "omitted then the format is autodetected from the content of the disk image."
21150 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
21151 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
21152 #: ../tools/virt-win-reg.pl:148
21154 "If disk images are requested from libvirt, then this program asks libvirt "
21155 "for this information. In this case, the value of the format parameter is "
21160 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
21161 #: ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132
21162 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
21163 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
21165 "If working with untrusted raw-format guest disk images, you should ensure "
21166 "the format is always specified."
21170 #: ../inspector/virt-inspector.pod:139
21171 msgid "Previous versions of virt-inspector allowed you to write either:"
21175 #: ../inspector/virt-inspector.pod:145
21178 " virt-inspector guestname\n"
21183 #: ../inspector/virt-inspector.pod:153
21188 #: ../inspector/virt-inspector.pod:155
21190 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21191 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21192 "just an overview."
21196 #: ../inspector/virt-inspector.pod:159
21198 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21199 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21200 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21201 "which is vanishingly rare in real world VMs."
21205 #: ../inspector/virt-inspector.pod:164
21206 msgid "E<lt>operatingsystemE<gt>"
21210 #: ../inspector/virt-inspector.pod:166
21212 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21213 "describe the operating system, its architecture, the descriptive \"product "
21214 "name\" string, the type of OS and so on, as in this example:"
21218 #: ../inspector/virt-inspector.pod:170
21221 " <operatingsystems>\n"
21222 " <operatingsystem>\n"
21223 " <root>/dev/sda2</root>\n"
21224 " <name>windows</name>\n"
21225 " <arch>i386</arch>\n"
21226 " <distro>windows</distro>\n"
21227 " <product_name>Windows 7 Enterprise</product_name>\n"
21228 " <product_variant>Client</product_variant>\n"
21229 " <major_version>6</major_version>\n"
21230 " <minor_version>1</minor_version>\n"
21231 " <windows_systemroot>/Windows</windows_systemroot>\n"
21232 " <format>installed</format>\n"
21237 #: ../inspector/virt-inspector.pod:183
21239 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21240 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21241 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21242 "architecture. The other fields are fairly self-explanatory, but because "
21243 "these fields are taken directly from the libguestfs inspection API you can "
21244 "find precise information from L<guestfs(3)/INSPECTION>."
21248 #: ../inspector/virt-inspector.pod:191
21250 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21251 "of view of libguestfs (block devices may have completely different names "
21252 "inside the VM itself)."
21256 #: ../inspector/virt-inspector.pod:195
21257 msgid "E<lt>mountpointsE<gt>"
21261 #: ../inspector/virt-inspector.pod:197
21263 "Un*x-like guests typically have multiple filesystems which are mounted at "
21264 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21265 "element which looks like this:"
21269 #: ../inspector/virt-inspector.pod:201
21272 " <operatingsystems>\n"
21273 " <operatingsystem>\n"
21276 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21277 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21278 " </mountpoints>\n"
21283 #: ../inspector/virt-inspector.pod:209
21285 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21286 "and may have completely different names inside the guest. Only mountable "
21287 "filesystems appear in this list, not things like swap devices."
21291 #: ../inspector/virt-inspector.pod:214
21292 msgid "E<lt>filesystemsE<gt>"
21296 #: ../inspector/virt-inspector.pod:216
21298 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21299 "filesystems belonging to the guest, including swap and empty partitions. "
21300 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21301 "this OS or shared with this OS and other OSes)."
21305 #: ../inspector/virt-inspector.pod:222
21306 msgid "You might see something like this:"
21310 #: ../inspector/virt-inspector.pod:224
21313 " <operatingsystems>\n"
21314 " <operatingsystem>\n"
21317 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21318 " <type>ext4</type>\n"
21319 " <label>Fedora-13-x86_64</label>\n"
21320 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21326 #: ../inspector/virt-inspector.pod:234
21328 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21329 "the label, and the UUID."
21333 #: ../inspector/virt-inspector.pod:237
21334 msgid "E<lt>applicationsE<gt>"
21338 #: ../inspector/virt-inspector.pod:239
21340 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21341 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21346 #: ../inspector/virt-inspector.pod:243
21348 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21349 "Typical values would be C<rpm> and C<deb>."
21353 #: ../inspector/virt-inspector.pod:246
21355 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21356 "Typical values include C<yum>, C<up2date> and C<apt>"
21360 #: ../inspector/virt-inspector.pod:249
21361 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21365 #: ../inspector/virt-inspector.pod:252
21368 " <operatingsystems>\n"
21369 " <operatingsystem>\n"
21371 " <applications>\n"
21373 " <name>coreutils</name>\n"
21374 " <version>8.5</version>\n"
21375 " <release>1</release>\n"
21376 " </application>\n"
21381 #: ../inspector/virt-inspector.pod:262
21383 "The version and release fields may not be available for some types guests. "
21384 "Other fields are possible, see L<guestfs(3)/"
21385 "guestfs_inspect_list_applications>."
21389 #: ../inspector/virt-inspector.pod:266
21390 msgid "E<lt>drive_mappingsE<gt>"
21394 #: ../inspector/virt-inspector.pod:268
21396 "For operating systems like Windows which use drive letters, virt-inspector "
21397 "is able to find out how drive letters map to filesystems."
21401 #: ../inspector/virt-inspector.pod:272
21404 " <operatingsystems>\n"
21405 " <operatingsystem>\n"
21407 " <drive_mappings>\n"
21408 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21409 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21410 " </drive_mappings>\n"
21415 #: ../inspector/virt-inspector.pod:280
21417 "In the example above, drive C maps to the filesystem on the second partition "
21418 "on the first disk, and drive E maps to the filesystem on the first partition "
21419 "on the second disk."
21423 #: ../inspector/virt-inspector.pod:284
21425 "Note that this only covers permanent local filesystem mappings, not things "
21426 "like network shares. Furthermore NTFS volume mount points may not be listed "
21431 #: ../inspector/virt-inspector.pod:288
21432 msgid "E<lt>iconE<gt>"
21436 #: ../inspector/virt-inspector.pod:290
21438 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21439 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21440 "very large and high quality."
21444 #: ../inspector/virt-inspector.pod:294
21447 " <operatingsystems>\n"
21448 " <operatingsystem>\n"
21451 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21452 " [... many lines of base64 data ...]\n"
21458 #: ../inspector/virt-inspector.pod:302
21460 "To display the icon, you have to extract it and convert the base64 data back "
21461 "to a binary file. Use an XPath query or simply an editor to extract the "
21462 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21467 #: ../inspector/virt-inspector.pod:307
21470 " base64 -i -d < icon.data > icon.png\n"
21475 #: ../inspector/virt-inspector.pod:309
21476 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21480 #: ../inspector/virt-inspector.pod:311
21482 "Virt-inspector can detect some operating system installers on install disks, "
21483 "live CDs, bootable USB keys and more."
21487 #: ../inspector/virt-inspector.pod:314
21489 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21490 "fields may be present to indicate a live CD, network installer, or one part "
21491 "of a multipart CD. For example:"
21495 #: ../inspector/virt-inspector.pod:318
21498 " <operatingsystems>\n"
21499 " <operatingsystem>\n"
21500 " <root>/dev/sda</root>\n"
21501 " <name>linux</name>\n"
21502 " <arch>i386</arch>\n"
21503 " <distro>ubuntu</distro>\n"
21504 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
21505 " <major_version>10</major_version>\n"
21506 " <minor_version>10</minor_version>\n"
21507 " <format>installer</format>\n"
21513 #: ../inspector/virt-inspector.pod:330
21514 msgid "USING XPATH"
21518 #: ../inspector/virt-inspector.pod:332
21520 "You can use the XPath query language to select parts of the XML. We "
21521 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
21525 #: ../inspector/virt-inspector.pod:338
21528 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21530 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21531 " <type>ext4</type>\n"
21537 #: ../inspector/virt-inspector.pod:344
21540 " $ virt-inspector -d Guest | \\\n"
21541 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21547 #: ../inspector/virt-inspector.pod:348
21550 " $ virt-inspector -d Guest | \\\n"
21551 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21552 " [displays the guest icon, if there is one]\n"
21557 #: ../inspector/virt-inspector.pod:359
21558 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21562 #: ../inspector/virt-inspector.pod:361
21564 "Early versions of libguestfs shipped with a different virt-inspector program "
21565 "written in Perl (the current version is written in C). The XML output of "
21566 "the Perl virt-inspector was different and it could also output in other "
21567 "formats like text."
21571 #: ../inspector/virt-inspector.pod:366
21573 "The old virt-inspector is no longer supported or shipped with libguestfs."
21577 #: ../inspector/virt-inspector.pod:369
21579 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21580 "versions of virt-inspector with different names:"
21584 #: ../inspector/virt-inspector.pod:372
21587 " virt-inspector Old Perl version.\n"
21588 " virt-inspector2 New C version.\n"
21593 #: ../inspector/virt-inspector.pod:382
21595 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
21596 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21600 #: ../inspector/virt-inspector.pod:399
21601 msgid "Matthew Booth L<mbooth@redhat.com>"
21605 #: ../java/examples/guestfs-java.pod:5
21606 msgid "guestfs-java - How to use libguestfs from Java"
21610 #: ../java/examples/guestfs-java.pod:9
21613 " import com.redhat.et.libguestfs.*;\n"
21618 #: ../java/examples/guestfs-java.pod:11
21621 " GuestFS g = new GuestFS ();\n"
21622 " g.add_drive_opts (\"disk.img\", null);\n"
21628 #: ../java/examples/guestfs-java.pod:17
21630 "This manual page documents how to call libguestfs from the Java programming "
21631 "language. This page just documents the differences from the C API and gives "
21632 "some examples. If you are not familiar with using libguestfs, you also need "
21633 "to read L<guestfs(3)>."
21637 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21638 msgid "CLOSING THE HANDLE"
21642 #: ../java/examples/guestfs-java.pod:24
21644 "The handle is closed when it is reaped by the garbage collector. Because "
21645 "libguestfs handles include a lot of state, it is also possible to close (and "
21646 "hence free) them explicitly by calling the C<close> method."
21650 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
21651 #: ../python/examples/guestfs-python.pod:21
21652 #: ../ruby/examples/guestfs-ruby.pod:22
21657 #: ../java/examples/guestfs-java.pod:31
21659 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21660 "exception. This has a single parameter which is the error message (a "
21665 #: ../java/examples/guestfs-java.pod:35
21666 msgid "Calling any method on a closed handle raises the same exception."
21670 #: ../java/examples/guestfs-java.pod:47
21672 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
21673 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
21674 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
21678 #: ../ocaml/examples/guestfs-ocaml.pod:5
21679 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21683 #: ../ocaml/examples/guestfs-ocaml.pod:9
21684 msgid "Module style:"
21688 #: ../ocaml/examples/guestfs-ocaml.pod:11
21691 " let g = Guestfs.create () in\n"
21692 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21693 " Guestfs.launch g;\n"
21698 #: ../ocaml/examples/guestfs-ocaml.pod:15
21699 msgid "Object-oriented style:"
21703 #: ../ocaml/examples/guestfs-ocaml.pod:17
21706 " let g = new Guestfs.guestfs () in\n"
21707 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21713 #: ../ocaml/examples/guestfs-ocaml.pod:21
21716 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21718 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21723 #: ../ocaml/examples/guestfs-ocaml.pod:27
21725 "This manual page documents how to call libguestfs from the OCaml programming "
21726 "language. This page just documents the differences from the C API and gives "
21727 "some examples. If you are not familiar with using libguestfs, you also need "
21728 "to read L<guestfs(3)>."
21732 #: ../ocaml/examples/guestfs-ocaml.pod:32
21733 msgid "PROGRAMMING STYLES"
21737 #: ../ocaml/examples/guestfs-ocaml.pod:34
21739 "There are two different programming styles supported by the OCaml bindings. "
21740 "You can use a module style, with each C function mapped to an OCaml function:"
21744 #: ../ocaml/examples/guestfs-ocaml.pod:38
21747 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21752 #: ../ocaml/examples/guestfs-ocaml.pod:40
21757 #: ../ocaml/examples/guestfs-ocaml.pod:42
21760 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21765 #: ../ocaml/examples/guestfs-ocaml.pod:44
21767 "Alternately you can use an object-oriented style, calling methods on the "
21768 "class C<Guestfs.guestfs>:"
21772 #: ../ocaml/examples/guestfs-ocaml.pod:47
21775 " method set_verbose : bool -> unit\n"
21780 #: ../ocaml/examples/guestfs-ocaml.pod:49
21782 "The object-oriented style is usually briefer, and the minor performance "
21783 "penalty isn't noticable in the general overhead of performing libguestfs "
21788 #: ../ocaml/examples/guestfs-ocaml.pod:55
21790 "The handle is closed when it is reaped by the garbage collector. Because "
21791 "libguestfs handles include a lot of state, it is also possible to close (and "
21792 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21797 #: ../ocaml/examples/guestfs-ocaml.pod:62
21799 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21800 "exception. This has a single parameter which is the error message (a "
21805 #: ../ocaml/examples/guestfs-ocaml.pod:66
21807 "Calling any function/method on a closed handle raises C<Guestfs."
21808 "Handle_closed>. The single parameter is the name of the function that you "
21813 #: ../ocaml/examples/guestfs-ocaml.pod:80
21815 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
21816 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
21817 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
21821 #: ../perl/examples/guestfs-perl.pod:5
21822 msgid "guestfs-perl - How to use libguestfs from Perl"
21826 #: ../perl/examples/guestfs-perl.pod:9
21829 " use Sys::Guestfs;\n"
21834 #: ../perl/examples/guestfs-perl.pod:11
21837 " my $h = Sys::Guestfs->new ();\n"
21838 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21839 " $h->launch ();\n"
21840 " $h->mount_options ('', '/dev/sda1', '/');\n"
21841 " $h->touch ('/hello');\n"
21847 #: ../perl/examples/guestfs-perl.pod:20
21849 "This manual page documents how to call libguestfs from the Perl programming "
21850 "language. This page just documents the differences from the C API and gives "
21851 "some examples. If you are not familiar with using libguestfs, you also need "
21852 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21856 #: ../perl/examples/guestfs-perl.pod:26
21861 #: ../perl/examples/guestfs-perl.pod:28
21863 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
21868 #: ../perl/examples/guestfs-perl.pod:41
21870 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
21871 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
21872 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21876 #: ../python/examples/guestfs-python.pod:5
21877 msgid "guestfs-python - How to use libguestfs from Python"
21881 #: ../python/examples/guestfs-python.pod:9
21884 " import guestfs\n"
21885 " g = guestfs.GuestFS ()\n"
21886 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21892 #: ../python/examples/guestfs-python.pod:16
21894 "This manual page documents how to call libguestfs from the Python "
21895 "programming language. This page just documents the differences from the C "
21896 "API and gives some examples. If you are not familiar with using libguestfs, "
21897 "you also need to read L<guestfs(3)>."
21901 #: ../python/examples/guestfs-python.pod:23
21903 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21904 "single string argument which is the error message."
21908 #: ../python/examples/guestfs-python.pod:26
21909 msgid "MORE DOCUMENTATION"
21913 #: ../python/examples/guestfs-python.pod:28
21918 #: ../python/examples/guestfs-python.pod:30
21922 " >>> import guestfs\n"
21923 " >>> help (guestfs)\n"
21928 #: ../python/examples/guestfs-python.pod:44
21930 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
21931 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
21932 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21936 #: ../rescue/virt-rescue.pod:5
21937 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21941 #: ../rescue/virt-rescue.pod:9
21944 " virt-rescue [--options] -d domname\n"
21949 #: ../rescue/virt-rescue.pod:11
21952 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21957 #: ../rescue/virt-rescue.pod:15
21960 " virt-rescue [--options] domname\n"
21965 #: ../rescue/virt-rescue.pod:17
21968 " virt-rescue [--options] disk.img [disk.img ...]\n"
21973 #: ../rescue/virt-rescue.pod:21
21975 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21976 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21977 "you from doing this, but doesn't catch all cases."
21981 #: ../rescue/virt-rescue.pod:25
21983 "However if you use the I<--ro> (read only) option, then you can attach a "
21984 "shell to a live virtual machine. The results might be strange or "
21985 "inconsistent at times but you won't get disk corruption."
21989 #: ../rescue/virt-rescue.pod:31
21991 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21992 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21993 "recovery tools which you can use to examine or rescue a virtual machine or "
21998 #: ../rescue/virt-rescue.pod:36
22000 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
22001 "on disk image(s):"
22005 #: ../rescue/virt-rescue.pod:39
22008 " virt-rescue -d GuestName\n"
22013 #: ../rescue/virt-rescue.pod:41
22016 " virt-rescue --ro -a /path/to/disk.img\n"
22021 #: ../rescue/virt-rescue.pod:43
22024 " virt-rescue -a /dev/sdc\n"
22029 #: ../rescue/virt-rescue.pod:45
22030 msgid "For live VMs you I<must> use the --ro option."
22034 #: ../rescue/virt-rescue.pod:47
22036 "When you run virt-rescue on a virtual machine or disk image, you are placed "
22037 "in an interactive bash shell where you can use many ordinary Linux "
22038 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
22039 "appliance. You must mount the virtual machine's filesystems by hand. There "
22040 "is an empty directory called C</sysroot> where you can mount filesystems."
22044 #: ../rescue/virt-rescue.pod:54
22046 "In the example below, we list logical volumes, then choose one to mount "
22047 "under C</sysroot>:"
22051 #: ../rescue/virt-rescue.pod:57
22055 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
22056 " lv_root vg_f11x64 -wi-a- 8.83G\n"
22057 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
22058 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
22059 " ><rescue> ls /sysroot\n"
22064 #: ../rescue/virt-rescue.pod:64
22066 "If you don't know what filesystems are available on the virtual machine then "
22067 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
22071 #: ../rescue/virt-rescue.pod:70
22073 "Virt-rescue can be used on I<any> disk image file or device, not just a "
22074 "virtual machine. For example you can use it on a blank file if you want to "
22075 "partition that file (although we would recommend using L<guestfish(1)> "
22076 "instead as it is more suitable for this purpose). You can even use virt-"
22077 "rescue on things like SD cards."
22081 #: ../rescue/virt-rescue.pod:76
22083 "Virt-rescue does not require root. You only need to run it as root if you "
22084 "need root to open the disk image."
22088 #: ../rescue/virt-rescue.pod:79
22090 "This tool is just designed for quick interactive hacking on a virtual "
22091 "machine. For more structured access to a virtual machine disk image, you "
22092 "should use L<guestfs(3)>. To get a structured shell that you can use to "
22093 "make scripted changes to guests, use L<guestfish(1)>."
22097 #: ../rescue/virt-rescue.pod:103
22098 msgid "B<--append kernelopts>"
22102 #: ../rescue/virt-rescue.pod:105
22103 msgid "Pass additional options to the rescue kernel."
22107 #: ../rescue/virt-rescue.pod:135
22110 " virt-rescue --format=raw -a disk.img\n"
22115 #: ../rescue/virt-rescue.pod:139
22118 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
22123 #: ../rescue/virt-rescue.pod:148
22128 #: ../rescue/virt-rescue.pod:150
22129 msgid "B<--memsize MB>"
22133 #: ../rescue/virt-rescue.pod:152
22135 "Change the amount of memory allocated to the rescue system. The default is "
22136 "set by libguestfs and is small but adequate for running system tools. The "
22137 "occasional program might need more memory. The parameter is specified in "
22142 #: ../rescue/virt-rescue.pod:157
22143 msgid "B<--network>"
22147 #: ../rescue/virt-rescue.pod:159
22148 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22152 #: ../rescue/virt-rescue.pod:165
22153 msgid "Open the image read-only."
22157 #: ../rescue/virt-rescue.pod:175
22159 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
22160 "SELINUX> before using this option."
22164 #: ../rescue/virt-rescue.pod:178
22169 #: ../rescue/virt-rescue.pod:180
22170 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22174 #: ../rescue/virt-rescue.pod:198
22176 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22177 "are done read-write."
22181 #: ../rescue/virt-rescue.pod:211
22182 msgid "Previous versions of virt-rescue allowed you to write either:"
22186 #: ../rescue/virt-rescue.pod:213
22189 " virt-rescue disk.img [disk.img ...]\n"
22194 #: ../rescue/virt-rescue.pod:217
22197 " virt-rescue guestname\n"
22202 #: ../rescue/virt-rescue.pod:225
22207 #: ../rescue/virt-rescue.pod:227
22209 "Adding the I<--network> option enables QEMU user networking in the rescue "
22210 "appliance. There are some differences between user networking and ordinary "
22215 #: ../rescue/virt-rescue.pod:233
22216 msgid "ping does not work"
22220 #: ../rescue/virt-rescue.pod:235
22222 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22223 "send the ping packets, and because virt-rescue must be able to run as non-"
22224 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
22225 "The ping command will appear to resolve addresses but will not be able to "
22226 "send or receive any packets. This does not mean that the network is not "
22231 #: ../rescue/virt-rescue.pod:242
22232 msgid "cannot receive connections"
22236 #: ../rescue/virt-rescue.pod:244
22237 msgid "QEMU user networking cannot receive incoming connections."
22241 #: ../rescue/virt-rescue.pod:246
22242 msgid "making TCP connections"
22246 #: ../rescue/virt-rescue.pod:248
22248 "The virt-rescue appliance needs to be small and so does not include many "
22249 "network tools. In particular there is no L<telnet(1)> command. You can "
22250 "make TCP connections from the shell using the magical C</dev/tcp/"
22251 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22255 #: ../rescue/virt-rescue.pod:253
22258 " exec 3<>/dev/tcp/redhat.com/80\n"
22259 " echo \"GET /\" >&3\n"
22265 #: ../rescue/virt-rescue.pod:257
22266 msgid "See L<bash(1)> for more details."
22270 #: ../rescue/virt-rescue.pod:263
22272 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
22273 "ENVIRONMENT VARIABLES> for the complete list."
22277 #: ../rescue/virt-rescue.pod:290
22279 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
22280 "libguestfs.org/>."
22284 #: ../resize/virt-resize.pod:5
22285 msgid "virt-resize - Resize a virtual machine disk"
22289 #: ../resize/virt-resize.pod:9
22292 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22293 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22294 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22299 #: ../resize/virt-resize.pod:15
22301 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22302 "larger or smaller overall, and resizing or deleting any partitions contained "
22307 #: ../resize/virt-resize.pod:19
22309 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22310 "not> be used on live virtual machines - for consistent results, shut the "
22311 "virtual machine down before resizing it."
22315 #: ../resize/virt-resize.pod:23
22317 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22318 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22322 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520
22323 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469
22324 #: ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
22329 #: ../resize/virt-resize.pod:33
22331 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22332 "fill the extra 5GB of space."
22336 #: ../resize/virt-resize.pod:36
22339 " virt-filesystems --long -h --all -a olddisk\n"
22344 #: ../resize/virt-resize.pod:38
22347 " truncate -r olddisk newdisk\n"
22348 " truncate -s +5G newdisk\n"
22353 #: ../resize/virt-resize.pod:41
22356 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22357 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22362 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527
22363 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475
22364 #: ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
22369 #: ../resize/virt-resize.pod:46
22371 "As above, but make the /boot partition 200MB bigger, while giving the "
22372 "remaining space to /dev/sda2:"
22376 #: ../resize/virt-resize.pod:49
22379 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22380 " olddisk newdisk\n"
22385 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533
22386 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486
22387 #: ../src/guestfs.pod:1436
22392 #: ../resize/virt-resize.pod:54
22394 "As in the first example, but expand a logical volume as the final step. "
22395 "This is what you would typically use for Linux guests that use LVM:"
22399 #: ../resize/virt-resize.pod:58
22402 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22403 " olddisk newdisk\n"
22408 #: ../resize/virt-resize.pod:61
22413 #: ../resize/virt-resize.pod:63
22415 "As in the first example, but the output format will be qcow2 instead of a "
22420 #: ../resize/virt-resize.pod:66
22423 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22424 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22429 #: ../resize/virt-resize.pod:71
22430 msgid "DETAILED USAGE"
22434 #: ../resize/virt-resize.pod:73
22435 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22439 #: ../resize/virt-resize.pod:77
22440 msgid "1. Shut down the virtual machine"
22444 #: ../resize/virt-resize.pod:79
22445 msgid "2. Locate input disk image"
22449 #: ../resize/virt-resize.pod:81
22451 "Locate the input disk image (ie. the file or device on the host containing "
22452 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22453 "dumpxml> like this to find the disk image name:"
22457 #: ../resize/virt-resize.pod:85
22460 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22461 " Found 1 nodes:\n"
22463 " <source dev=\"/dev/vg/lv_guest\" />\n"
22468 #: ../resize/virt-resize.pod:90
22469 msgid "3. Look at current sizing"
22473 #: ../resize/virt-resize.pod:92
22474 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22478 #: ../resize/virt-resize.pod:95
22481 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22482 " Name Type Size Parent\n"
22483 " /dev/sda1 partition 101M /dev/sda\n"
22484 " /dev/sda2 partition 7.9G /dev/sda\n"
22485 " /dev/sda device 8.0G -\n"
22490 #: ../resize/virt-resize.pod:101
22492 "(This example is a virtual machine with an 8 GB disk which we would like to "
22493 "expand up to 10 GB)."
22497 #: ../resize/virt-resize.pod:104
22498 msgid "4. Create output disk"
22502 #: ../resize/virt-resize.pod:106
22504 "Virt-resize cannot do in-place disk modifications. You have to have space "
22505 "to store the resized output disk."
22509 #: ../resize/virt-resize.pod:109
22511 "To store the resized disk image in a file, create a file of a suitable size:"
22515 #: ../resize/virt-resize.pod:112
22518 " # rm -f outdisk\n"
22519 " # truncate -s 10G outdisk\n"
22524 #: ../resize/virt-resize.pod:115
22525 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22529 #: ../resize/virt-resize.pod:117
22532 " # lvcreate -L 10G -n lv_name vg_name\n"
22537 #: ../resize/virt-resize.pod:119
22538 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22542 #: ../resize/virt-resize.pod:121
22545 " # virsh pool-list\n"
22546 " # virsh vol-create-as poolname newvol 10G\n"
22551 #: ../resize/virt-resize.pod:124
22556 #: ../resize/virt-resize.pod:126
22558 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22559 "file) and the output disk. The output disk is the one created in the "
22564 #: ../resize/virt-resize.pod:130
22567 " # virt-resize indisk outdisk\n"
22572 #: ../resize/virt-resize.pod:132
22574 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22575 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22576 "larger, then an extra, empty partition is created at the end of the disk "
22577 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22582 #: ../resize/virt-resize.pod:138
22584 "More realistically you'd want to expand existing partitions in the disk "
22585 "image by passing extra options (for the full list see the L</OPTIONS> "
22590 #: ../resize/virt-resize.pod:142
22592 "L</--expand> is the most useful option. It expands the named partition "
22593 "within the disk to fill any extra space:"
22597 #: ../resize/virt-resize.pod:145
22600 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22605 #: ../resize/virt-resize.pod:147
22607 "(In this case, an extra partition is I<not> created at the end of the disk, "
22608 "because there will be no unused space)."
22612 #: ../resize/virt-resize.pod:150
22614 "L</--resize> is the other commonly used option. The following would "
22615 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22616 "rest of the available space:"
22620 #: ../resize/virt-resize.pod:154
22623 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22624 " indisk outdisk\n"
22629 #: ../resize/virt-resize.pod:157
22631 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22632 "if virt-resize knows how, it will resize the contents, the equivalent of "
22633 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22634 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22635 "filesystems, so you would have to online resize them after booting the guest."
22639 #: ../resize/virt-resize.pod:164
22640 msgid "Other options are covered below."
22644 #: ../resize/virt-resize.pod:166
22649 #: ../resize/virt-resize.pod:168
22650 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22654 #: ../resize/virt-resize.pod:170
22655 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22659 #: ../resize/virt-resize.pod:172
22662 " # virsh edit guestname\n"
22667 #: ../resize/virt-resize.pod:174
22669 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
22670 "html#elementsDisks>"
22674 #: ../resize/virt-resize.pod:177
22675 msgid "Then start up the domain with the new, resized disk:"
22679 #: ../resize/virt-resize.pod:179
22682 " # virsh start guestname\n"
22687 #: ../resize/virt-resize.pod:181
22689 "and check that it still works. See also the L</NOTES> section below for "
22690 "additional information."
22694 #: ../resize/virt-resize.pod:184
22695 msgid "7. Resize LVs etc inside the guest"
22699 #: ../resize/virt-resize.pod:186
22700 msgid "(This can also be done offline using L<guestfish(1)>)"
22704 #: ../resize/virt-resize.pod:188
22706 "Once the guest has booted you should see the new space available, at least "
22707 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22708 "may need to resize LVs inside PVs, and also resize filesystem types that "
22709 "virt-resize does not know how to expand."
22713 #: ../resize/virt-resize.pod:195
22714 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22718 #: ../resize/virt-resize.pod:197
22720 "Shrinking is somewhat more complex than expanding, and only an overview is "
22725 #: ../resize/virt-resize.pod:200
22727 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22728 "filesystems). The user has to shrink content before passing the disk image "
22729 "to virt-resize, and virt-resize will check that the content has been shrunk "
22734 #: ../resize/virt-resize.pod:205
22735 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22739 #: ../resize/virt-resize.pod:207
22741 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22742 "steps 3 and 4 above to allocate a new disk image."
22746 #: ../resize/virt-resize.pod:210
22748 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22752 #: ../resize/virt-resize.pod:213
22753 msgid "IGNORING OR DELETING PARTITIONS"
22757 #: ../resize/virt-resize.pod:215
22759 "virt-resize also gives a convenient way to ignore or delete partitions when "
22760 "copying from the input disk to the output disk. Ignoring a partition speeds "
22761 "up the copy where you don't care about the existing contents of a "
22762 "partition. Deleting a partition removes it completely, but note that it "
22763 "also renumbers any partitions after the one which is deleted, which can "
22764 "leave some guests unbootable."
22768 #: ../resize/virt-resize.pod:222
22769 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22773 #: ../resize/virt-resize.pod:224
22775 "If the input disk is in qcow2 format, then you may prefer that the output is "
22776 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22777 "the fly. The output format is simply determined by the format of the empty "
22778 "output container that you provide. Thus to create qcow2 output, use:"
22782 #: ../resize/virt-resize.pod:230
22785 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22790 #: ../resize/virt-resize.pod:232
22791 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22795 #: ../resize/virt-resize.pod:234
22796 msgid "Similarly, to get non-sparse raw output use:"
22800 #: ../resize/virt-resize.pod:236
22803 " fallocate -l size outdisk\n"
22808 #: ../resize/virt-resize.pod:238
22810 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
22811 "dev/zero of=outdisk bs=1M count=..>)"
22815 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
22816 msgid "Display help."
22820 #: ../resize/virt-resize.pod:249
22825 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
22826 #: ../tools/virt-win-reg.pl:120
22831 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
22832 msgid "Enable debugging messages."
22836 #: ../resize/virt-resize.pod:255
22837 msgid "B<--delete part>"
22841 #: ../resize/virt-resize.pod:257
22843 "Delete the named partition. It would be more accurate to describe this as "
22844 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22845 "the original disk image is left intact."
22849 #: ../resize/virt-resize.pod:261
22851 "Note that when you delete a partition, then anything contained in the "
22852 "partition is also deleted. Furthermore, this causes any partitions that "
22853 "come after to be I<renumbered>, which can easily make your guest unbootable."
22857 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
22858 #: ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
22859 msgid "You can give this option multiple times."
22863 #: ../resize/virt-resize.pod:268
22864 msgid "B<--expand part>"
22868 #: ../resize/virt-resize.pod:270
22870 "Expand the named partition so it uses up all extra space (space left over "
22871 "after any other resize changes that you request have been done)."
22875 #: ../resize/virt-resize.pod:273
22877 "If virt-resize knows how, it will expand the direct content of the "
22878 "partition. For example, if the partition is an LVM PV, it will expand the "
22879 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22880 "content it doesn't know about alone."
22884 #: ../resize/virt-resize.pod:278
22885 msgid "Currently virt-resize can resize:"
22889 #: ../resize/virt-resize.pod:284
22890 msgid "ext2, ext3 and ext4 filesystems."
22894 #: ../resize/virt-resize.pod:288
22895 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22899 #: ../resize/virt-resize.pod:290
22901 "The filesystem must have been shut down consistently last time it was used. "
22902 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22903 "consistency check, so at the first boot after resizing Windows will check "
22908 #: ../resize/virt-resize.pod:297
22910 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22911 "inside the PV, but see the I<--LV-expand> option. The user could also "
22912 "resize LVs as desired after boot."
22916 #: ../resize/virt-resize.pod:303
22917 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22921 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
22922 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22926 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125
22927 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
22928 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
22929 msgid "B<--format> raw"
22933 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
22935 "Specify the format of the input disk image. If this flag is not given then "
22936 "it is auto-detected from the image itself."
22940 #: ../resize/virt-resize.pod:317
22942 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22943 "AND NON-SPARSE RAW FORMATS>."
22947 #: ../resize/virt-resize.pod:320
22948 msgid "B<--ignore part>"
22952 #: ../resize/virt-resize.pod:322
22954 "Ignore the named partition. Effectively this means the partition is "
22955 "allocated on the destination disk, but the content is not copied across from "
22956 "the source disk. The content of the partition will be blank (all zero "
22961 #: ../resize/virt-resize.pod:329
22962 msgid "B<--LV-expand logvol>"
22966 #: ../resize/virt-resize.pod:331
22968 "This takes the logical volume and, as a final step, expands it to fill all "
22969 "the space available in its volume group. A typical usage, assuming a Linux "
22970 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
22971 "lv_root> would be:"
22975 #: ../resize/virt-resize.pod:336
22978 " virt-resize indisk outdisk \\\n"
22979 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22984 #: ../resize/virt-resize.pod:339
22986 "This would first expand the partition (and PV), and then expand the root "
22987 "device to fill the extra space in the PV."
22991 #: ../resize/virt-resize.pod:342
22993 "The contents of the LV are also resized if virt-resize knows how to do "
22994 "that. You can stop virt-resize from trying to expand the content by using "
22995 "the option I<--no-expand-content>."
22999 #: ../resize/virt-resize.pod:346
23000 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23004 #: ../resize/virt-resize.pod:348
23006 "You can give this option multiple times, I<but> it doesn't make sense to do "
23007 "this unless the logical volumes you specify are all in different volume "
23012 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
23013 msgid "B<--machine-readable>"
23017 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
23019 "This option is used to make the output more machine friendly when being "
23020 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23024 #: ../resize/virt-resize.pod:360
23025 msgid "B<--dryrun>"
23029 #: ../resize/virt-resize.pod:362
23030 msgid "Print a summary of what would be done, but don't do anything."
23034 #: ../resize/virt-resize.pod:364
23035 msgid "B<--no-copy-boot-loader>"
23039 #: ../resize/virt-resize.pod:366
23041 "By default, virt-resize copies over some sectors at the start of the disk "
23042 "(up to the beginning of the first partition). Commonly these sectors "
23043 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23044 "in order for the guest to boot correctly."
23048 #: ../resize/virt-resize.pod:371
23050 "If you specify this flag, then this initial copy is not done. You may need "
23051 "to reinstall the boot loader in this case."
23055 #: ../resize/virt-resize.pod:374
23056 msgid "B<--no-extra-partition>"
23060 #: ../resize/virt-resize.pod:376
23062 "By default, virt-resize creates an extra partition if there is any extra, "
23063 "unused space after all resizing has happened. Use this option to prevent "
23064 "the extra partition from being created. If you do this then the extra space "
23065 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23066 "tool in the guest."
23070 #: ../resize/virt-resize.pod:382
23072 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23077 #: ../resize/virt-resize.pod:385
23078 msgid "B<--no-expand-content>"
23082 #: ../resize/virt-resize.pod:387
23084 "By default, virt-resize will try to expand the direct contents of "
23085 "partitions, if it knows how (see I<--expand> option above)."
23089 #: ../resize/virt-resize.pod:390
23091 "If you give the I<--no-expand-content> option then virt-resize will not "
23096 #: ../resize/virt-resize.pod:393
23097 msgid "B<--ntfsresize-force>"
23101 #: ../resize/virt-resize.pod:395
23103 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23104 "the NTFS disk is marked as needing a consistency check. You have to use "
23105 "this option if you want to resize a Windows guest multiple times without "
23106 "booting into Windows between each resize."
23110 #: ../resize/virt-resize.pod:401
23111 msgid "B<--output-format> raw"
23115 #: ../resize/virt-resize.pod:403
23117 "Specify the format of the output disk image. If this flag is not given then "
23118 "it is auto-detected from the image itself."
23122 #: ../resize/virt-resize.pod:409
23124 "Note that this option I<does not create> the output format. This option "
23125 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23126 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
23127 "SPARSE RAW FORMATS>."
23131 #: ../resize/virt-resize.pod:418
23132 msgid "Don't print the summary."
23136 #: ../resize/virt-resize.pod:420
23137 msgid "B<--resize part=size>"
23141 #: ../resize/virt-resize.pod:422
23143 "Resize the named partition (expanding or shrinking it) so that it has the "
23148 #: ../resize/virt-resize.pod:425
23150 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23151 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23152 "size; or as a relative number or percentage. For example:"
23156 #: ../resize/virt-resize.pod:431
23159 " --resize /dev/sda2=10G\n"
23164 #: ../resize/virt-resize.pod:433
23167 " --resize /dev/sda4=90%\n"
23172 #: ../resize/virt-resize.pod:435
23175 " --resize /dev/sda2=+1G\n"
23180 #: ../resize/virt-resize.pod:437
23183 " --resize /dev/sda2=-200M\n"
23188 #: ../resize/virt-resize.pod:439
23191 " --resize /dev/sda1=+128K\n"
23196 #: ../resize/virt-resize.pod:441
23199 " --resize /dev/sda1=+10%\n"
23204 #: ../resize/virt-resize.pod:443
23207 " --resize /dev/sda1=-10%\n"
23212 #: ../resize/virt-resize.pod:445
23214 "You can increase the size of any partition. Virt-resize will expand the "
23215 "direct content of the partition if it knows how (see I<--expand> below)."
23219 #: ../resize/virt-resize.pod:449
23221 "You can only I<decrease> the size of partitions that contain filesystems or "
23222 "PVs which have already been shrunk. Virt-resize will check this has been "
23223 "done before proceeding, or else will print an error (see also I<--resize-"
23228 #: ../resize/virt-resize.pod:456
23229 msgid "B<--resize-force part=size>"
23233 #: ../resize/virt-resize.pod:458
23235 "This is the same as I<--resize> except that it will let you decrease the "
23236 "size of any partition. Generally this means you will lose any data which "
23237 "was at the end of the partition you shrink, but you may not care about that "
23238 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23239 "as a swap partition)."
23243 #: ../resize/virt-resize.pod:464
23244 msgid "See also the I<--ignore> option."
23248 #: ../resize/virt-resize.pod:466
23249 msgid "B<--shrink part>"
23253 #: ../resize/virt-resize.pod:468
23255 "Shrink the named partition until the overall disk image fits in the "
23256 "destination. The named partition B<must> contain a filesystem or PV which "
23257 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23258 "online tools). Virt-resize will check this and give an error if it has not "
23263 #: ../resize/virt-resize.pod:474
23265 "The amount by which the overall disk must be shrunk (after carrying out all "
23266 "other operations requested by the user) is called the \"deficit\". For "
23267 "example, a straight copy (assume no other operations) from a 5GB disk image "
23268 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23269 "would give an error unless the user specified a partition to shrink and that "
23270 "partition had more than a gigabyte of free space."
23274 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
23275 msgid "MACHINE READABLE OUTPUT"
23279 #: ../resize/virt-resize.pod:494
23281 "The I<--machine-readable> option can be used to make the output more machine "
23282 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23287 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
23288 msgid "There are two ways to use this option."
23292 #: ../resize/virt-resize.pod:500
23294 "Firstly use the option on its own to query the capabilities of the virt-"
23295 "resize binary. Typical output looks like this:"
23299 #: ../resize/virt-resize.pod:503
23302 " $ virt-resize --machine-readable\n"
23304 " ntfsresize-force\n"
23312 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
23314 "A list of features is printed, one per line, and the program exits with "
23319 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
23321 "Secondly use the option in conjunction with other options to make the "
23322 "regular program output more machine friendly."
23326 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
23327 msgid "At the moment this means:"
23331 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
23333 "Progress bar messages can be parsed from stdout by looking for this regular "
23338 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
23341 " ^[0-9]+/[0-9]+$\n"
23346 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
23348 "The calling program should treat messages sent to stdout (except for "
23349 "progress bar messages) as status messages. They can be logged and/or "
23350 "displayed to the user."
23354 #: ../resize/virt-resize.pod:535
23356 "The calling program should treat messages sent to stderr as error messages. "
23357 "In addition, virt-resize exits with a non-zero status code if there was a "
23362 #: ../resize/virt-resize.pod:541
23364 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
23365 "readable> option and will return an error."
23369 #: ../resize/virt-resize.pod:546
23370 msgid "\"Partition 1 does not end on cylinder boundary.\""
23374 #: ../resize/virt-resize.pod:548
23376 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
23377 "means the partitions will not be aligned to the ancient CHS geometry. "
23378 "However CHS geometry is meaningless for disks manufactured since the early "
23379 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
23380 "cylinders is not required by any modern operating system."
23384 #: ../resize/virt-resize.pod:555
23385 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23389 #: ../resize/virt-resize.pod:557
23391 "In Windows Vista and later versions, Microsoft switched to using a separate "
23392 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23393 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
23394 "the boot partition. Doing so seems to break the guest completely. However "
23395 "expanding the second partition (ie. C: drive) should work."
23399 #: ../resize/virt-resize.pod:564
23401 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23402 "NTFS partitions have been expanded. This is just a safety check and (unless "
23403 "it find errors) is nothing to worry about."
23407 #: ../resize/virt-resize.pod:568
23408 msgid "GUEST BOOT STUCK AT \"GRUB\""
23412 #: ../resize/virt-resize.pod:570
23414 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23415 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
23416 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
23417 "although we think is to do with partition alignment."
23421 #: ../resize/virt-resize.pod:575
23424 " guestfish -i -a newdisk\n"
23425 " ><fs> cat /boot/grub/device.map\n"
23426 " # check the contents of this file are sensible or\n"
23427 " # edit the file if necessary\n"
23428 " ><fs> grub-install / /dev/vda\n"
23434 #: ../resize/virt-resize.pod:582
23436 "For more flexible guest reconfiguration, including if you need to specify "
23437 "other parameters to grub-install, use L<virt-rescue(1)>."
23441 #: ../resize/virt-resize.pod:585
23442 msgid "ALTERNATIVE TOOLS"
23446 #: ../resize/virt-resize.pod:587
23448 "There are several proprietary tools for resizing partitions. We won't "
23449 "mention any here."
23453 #: ../resize/virt-resize.pod:590
23455 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23456 "operations on disk images. They can resize and move partitions, but I don't "
23457 "think they can do anything with the contents, and they certainly don't "
23462 #: ../resize/virt-resize.pod:595
23464 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23465 "but at a much lower level. You will probably end up hand-calculating sector "
23466 "offsets, which is something that virt-resize was designed to avoid. If you "
23467 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23472 #: ../resize/virt-resize.pod:615
23474 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
23475 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
23476 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
23477 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
23478 "L<http://libguestfs.org/>."
23482 #: ../ruby/examples/guestfs-ruby.pod:5
23483 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23487 #: ../ruby/examples/guestfs-ruby.pod:9
23490 " require 'guestfs'\n"
23491 " g = Guestfs::Guestfs.new()\n"
23492 " g.add_drive_opts(\"disk.img\",\n"
23493 " :readonly => 1, :format => \"raw\")\n"
23499 #: ../ruby/examples/guestfs-ruby.pod:17
23501 "This manual page documents how to call libguestfs from the Ruby programming "
23502 "language. This page just documents the differences from the C API and gives "
23503 "some examples. If you are not familiar with using libguestfs, you also need "
23504 "to read L<guestfs(3)>."
23508 #: ../ruby/examples/guestfs-ruby.pod:24
23510 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23511 "This has a single parameter which is the error message (a string)."
23515 #: ../ruby/examples/guestfs-ruby.pod:38
23517 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
23518 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
23519 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23523 #: ../sparsify/virt-sparsify.pod:5
23524 msgid "virt-sparsify - Make a virtual machine disk sparse"
23528 #: ../sparsify/virt-sparsify.pod:9
23531 " virt-sparsify [--options] indisk outdisk\n"
23536 #: ../sparsify/virt-sparsify.pod:13
23538 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23539 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23540 "the disk image can be converted back to free space on the host."
23544 #: ../sparsify/virt-sparsify.pod:18
23546 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
23547 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23551 #: ../sparsify/virt-sparsify.pod:21
23553 "Virt-sparsify can also convert between some disk formats, for example "
23554 "converting a raw disk image to a thin-provisioned qcow2 image."
23558 #: ../sparsify/virt-sparsify.pod:24
23560 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23561 "machines. If a virtual machine has more than one attached disk, you must "
23562 "sparsify each one separately."
23566 #: ../sparsify/virt-sparsify.pod:28
23567 msgid "IMPORTANT LIMITATIONS"
23571 #: ../sparsify/virt-sparsify.pod:34
23573 "Virt-sparsify does not do in-place modifications. It copies from a source "
23574 "image to a destination image, leaving the source unchanged. I<Check that "
23575 "the sparsification was successful before deleting the source image>."
23579 #: ../sparsify/virt-sparsify.pod:41
23580 msgid "The virtual machine I<must be shut down> before using this tool."
23584 #: ../sparsify/virt-sparsify.pod:45
23586 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23587 "(1 temporary copy + 1 destination image). This is in the worst case and "
23588 "usually much less space is required."
23592 #: ../sparsify/virt-sparsify.pod:51
23594 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23598 #: ../sparsify/virt-sparsify.pod:56
23599 msgid "Virt-sparsify cannot handle encrypted disks."
23603 #: ../sparsify/virt-sparsify.pod:60
23605 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23606 "this space is often used for critical items like bootloaders so it's not "
23611 #: ../sparsify/virt-sparsify.pod:66
23613 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23614 "to do this unless we can be sure there is no hibernation data, so at the "
23615 "moment swap partitions are ignored."
23619 #: ../sparsify/virt-sparsify.pod:72
23621 "You may also want to read the manual pages for the associated tools L<virt-"
23622 "filesystems(1)> and L<virt-df(1)> before starting."
23626 #: ../sparsify/virt-sparsify.pod:77
23627 msgid "Typical usage is:"
23631 #: ../sparsify/virt-sparsify.pod:79
23634 " virt-sparsify indisk outdisk\n"
23639 #: ../sparsify/virt-sparsify.pod:81
23641 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23642 "is created, or overwritten if it already exists. The format of the input "
23643 "disk is detected (eg. qcow2) and the same format is used for the output disk."
23647 #: ../sparsify/virt-sparsify.pod:86
23648 msgid "To convert between formats, use the I<--convert> option:"
23652 #: ../sparsify/virt-sparsify.pod:88
23655 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23660 #: ../sparsify/virt-sparsify.pod:90
23662 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23663 "can find within the source disk image. You can get it to ignore (don't zero "
23664 "free space on) certain filesystems by doing:"
23668 #: ../sparsify/virt-sparsify.pod:94
23671 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23676 #: ../sparsify/virt-sparsify.pod:96
23678 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23682 #: ../sparsify/virt-sparsify.pod:107
23683 msgid "B<--convert> raw"
23687 #: ../sparsify/virt-sparsify.pod:109
23688 msgid "B<--convert> qcow2"
23692 #: ../sparsify/virt-sparsify.pod:111
23693 msgid "B<--convert> [other formats]"
23697 #: ../sparsify/virt-sparsify.pod:113
23699 "Use C<output-format> as the format for the destination image. If this is "
23700 "not specified, then the input format is used."
23704 #: ../sparsify/virt-sparsify.pod:116
23705 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23709 #: ../sparsify/virt-sparsify.pod:118
23711 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
23712 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23716 #: ../sparsify/virt-sparsify.pod:122
23718 "Specifying the I<--convert> option is usually a good idea, because then virt-"
23719 "sparsify doesn't need to try to guess the input format."
23723 #: ../sparsify/virt-sparsify.pod:127
23724 msgid "B<--format> qcow2"
23728 #: ../sparsify/virt-sparsify.pod:135
23729 msgid "B<--ignore> filesystem"
23733 #: ../sparsify/virt-sparsify.pod:137
23734 msgid "B<--ignore> volgroup"
23738 #: ../sparsify/virt-sparsify.pod:139
23740 "Ignore the named filesystem. Free space on the filesystem will not be "
23741 "zeroed, but existing blocks of zeroes will still be sparsified."
23745 #: ../sparsify/virt-sparsify.pod:142
23747 "In the second form, this ignores the named volume group. Use the volume "
23748 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23752 #: ../sparsify/virt-sparsify.pod:157
23753 msgid "This disables progress bars and other unnecessary output."
23757 #: ../sparsify/virt-sparsify.pod:179
23759 "The I<--machine-readable> option can be used to make the output more machine "
23760 "friendly, which is useful when calling virt-sparsify from other programs, "
23765 #: ../sparsify/virt-sparsify.pod:185
23767 "Firstly use the option on its own to query the capabilities of the virt-"
23768 "sparsify binary. Typical output looks like this:"
23772 #: ../sparsify/virt-sparsify.pod:188
23775 " $ virt-sparsify --machine-readable\n"
23783 #: ../sparsify/virt-sparsify.pod:218
23785 "The calling program should treat messages sent to stderr as error messages. "
23786 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23791 #: ../sparsify/virt-sparsify.pod:224
23793 "All versions of virt-sparsify have supported the I<--machine-readable> "
23798 #: ../sparsify/virt-sparsify.pod:238
23800 "Location of the temporary directory used for the potentially large temporary "
23805 #: ../sparsify/virt-sparsify.pod:241
23807 "You should ensure there is enough free space in the worst case for a full "
23808 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23809 "to another directory that has enough space."
23813 #: ../sparsify/virt-sparsify.pod:245
23814 msgid "This defaults to C</tmp>."
23818 #: ../sparsify/virt-sparsify.pod:249
23820 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23824 #: ../sparsify/virt-sparsify.pod:253
23826 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23827 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
23828 "(1)>, L<http://libguestfs.org/>."
23832 #: ../src/guestfs-actions.pod:1
23833 msgid "guestfs_add_cdrom"
23837 #: ../src/guestfs-actions.pod:3
23841 " guestfs_add_cdrom (guestfs_h *g,\n"
23842 " const char *filename);\n"
23847 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249
23848 #: ../src/guestfs-actions.pod:270
23850 "I<This function is deprecated.> In new code, use the L</"
23851 "guestfs_add_drive_opts> call instead."
23855 #: ../src/guestfs-actions.pod:24
23857 "This call checks for the existence of C<filename>. This stops you from "
23858 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23859 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23864 #: ../src/guestfs-actions.pod:31
23866 "If you just want to add an ISO file (often you use this as an efficient way "
23867 "to transfer large files into the guest), then you should probably use "
23868 "C<guestfs_add_drive_ro> instead."
23872 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
23873 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
23874 #: ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280
23875 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
23876 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
23877 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
23878 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
23879 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
23880 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
23881 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
23882 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
23883 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
23884 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
23885 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1233
23886 #: ../src/guestfs-actions.pod:1279 ../src/guestfs-actions.pod:1297
23887 #: ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:1330
23888 #: ../src/guestfs-actions.pod:1350 ../src/guestfs-actions.pod:1420
23889 #: ../src/guestfs-actions.pod:1451 ../src/guestfs-actions.pod:1476
23890 #: ../src/guestfs-actions.pod:1518 ../src/guestfs-actions.pod:1631
23891 #: ../src/guestfs-actions.pod:1658 ../src/guestfs-actions.pod:1873
23892 #: ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:1982
23893 #: ../src/guestfs-actions.pod:2490 ../src/guestfs-actions.pod:2634
23894 #: ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2730
23895 #: ../src/guestfs-actions.pod:3774 ../src/guestfs-actions.pod:3789
23896 #: ../src/guestfs-actions.pod:3814 ../src/guestfs-actions.pod:4003
23897 #: ../src/guestfs-actions.pod:4017 ../src/guestfs-actions.pod:4030
23898 #: ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:4059
23899 #: ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4167
23900 #: ../src/guestfs-actions.pod:4187 ../src/guestfs-actions.pod:4204
23901 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:4250
23902 #: ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4304
23903 #: ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4358
23904 #: ../src/guestfs-actions.pod:4370 ../src/guestfs-actions.pod:4406
23905 #: ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4435
23906 #: ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4467
23907 #: ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:4580
23908 #: ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4644
23909 #: ../src/guestfs-actions.pod:4662 ../src/guestfs-actions.pod:4680
23910 #: ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:4710
23911 #: ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4741
23912 #: ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4783
23913 #: ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4919
23914 #: ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4969
23915 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5000
23916 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5030
23917 #: ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5060
23918 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5118
23919 #: ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5177
23920 #: ../src/guestfs-actions.pod:5191 ../src/guestfs-actions.pod:5208
23921 #: ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5310
23922 #: ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5400
23923 #: ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5445
23924 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5603
23925 #: ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5682
23926 #: ../src/guestfs-actions.pod:5700 ../src/guestfs-actions.pod:5732
23927 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5815
23928 #: ../src/guestfs-actions.pod:5828 ../src/guestfs-actions.pod:5842
23929 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
23930 #: ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6183
23931 #: ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6209
23932 #: ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6235
23933 #: ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6272
23934 #: ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310
23935 #: ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6358
23936 #: ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6399
23937 #: ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6439
23938 #: ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6475
23939 #: ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6522
23940 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565
23941 #: ../src/guestfs-actions.pod:6581 ../src/guestfs-actions.pod:6605
23942 #: ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6639
23943 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6702
23944 #: ../src/guestfs-actions.pod:6732 ../src/guestfs-actions.pod:6765
23945 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:7001
23946 #: ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7026
23947 #: ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7061
23948 #: ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7087
23949 #: ../src/guestfs-actions.pod:7100 ../src/guestfs-actions.pod:7115
23950 #: ../src/guestfs-actions.pod:7174 ../src/guestfs-actions.pod:7191
23951 #: ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7223
23952 #: ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7253
23953 #: ../src/guestfs-actions.pod:7273 ../src/guestfs-actions.pod:7309
23954 #: ../src/guestfs-actions.pod:7323 ../src/guestfs-actions.pod:7364
23955 #: ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7395
23956 #: ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7465
23957 #: ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7596
23958 #: ../src/guestfs-actions.pod:7610 ../src/guestfs-actions.pod:7665
23959 #: ../src/guestfs-actions.pod:7678 ../src/guestfs-actions.pod:7723
23960 #: ../src/guestfs-actions.pod:7763 ../src/guestfs-actions.pod:7819
23961 #: ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7872
23962 #: ../src/guestfs-actions.pod:7936 ../src/guestfs-actions.pod:7959
23963 #: ../src/guestfs-actions.pod:7988
23964 msgid "This function returns 0 on success or -1 on error."
23968 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
23969 #: ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:2096
23970 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2319
23971 #: ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:3796
23972 #: ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:6360
23973 #: ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6626
23974 #: ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7242
23975 #: ../src/guestfs-actions.pod:7765
23976 msgid "(Added in 0.3)"
23980 #: ../src/guestfs-actions.pod:41
23981 msgid "guestfs_add_domain"
23985 #: ../src/guestfs-actions.pod:43
23989 " guestfs_add_domain (guestfs_h *g,\n"
23990 " const char *dom,\n"
23996 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
23997 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:1161
23998 #: ../src/guestfs-actions.pod:1213 ../src/guestfs-actions.pod:2979
23999 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5104
24000 #: ../src/guestfs-actions.pod:5321
24002 "You may supply a list of optional arguments to this call. Use zero or more "
24003 "of the following pairs of parameters, and terminate the list with C<-1> on "
24004 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
24008 #: ../src/guestfs-actions.pod:53
24011 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
24012 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
24013 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
24014 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
24015 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
24020 #: ../src/guestfs-actions.pod:59
24022 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24023 "It works by connecting to libvirt, requesting the domain and domain XML from "
24024 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
24029 #: ../src/guestfs-actions.pod:94
24031 "The other optional parameters are passed directly through to "
24032 "C<guestfs_add_drive_opts>."
24036 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
24037 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
24038 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
24039 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1496
24040 #: ../src/guestfs-actions.pod:1852 ../src/guestfs-actions.pod:2055
24041 #: ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2217
24042 #: ../src/guestfs-actions.pod:2269 ../src/guestfs-actions.pod:2283
24043 #: ../src/guestfs-actions.pod:2306 ../src/guestfs-actions.pod:2621
24044 #: ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3115
24045 #: ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5500
24046 #: ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5938
24047 #: ../src/guestfs-actions.pod:7350 ../src/guestfs-actions.pod:7776
24048 #: ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7802
24049 msgid "On error this function returns -1."
24053 #: ../src/guestfs-actions.pod:99
24054 msgid "(Added in 1.7.4)"
24058 #: ../src/guestfs-actions.pod:101
24059 msgid "guestfs_add_domain_va"
24063 #: ../src/guestfs-actions.pod:103
24067 " guestfs_add_domain_va (guestfs_h *g,\n"
24068 " const char *dom,\n"
24069 " va_list args);\n"
24074 #: ../src/guestfs-actions.pod:108
24075 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
24079 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
24080 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
24081 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
24082 #: ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1202
24083 #: ../src/guestfs-actions.pod:1248 ../src/guestfs-actions.pod:1261
24084 #: ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3075
24085 #: ../src/guestfs-actions.pod:4860 ../src/guestfs-actions.pod:4872
24086 #: ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:5144
24087 #: ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5381
24088 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
24092 #: ../src/guestfs-actions.pod:112
24093 msgid "guestfs_add_domain_argv"
24097 #: ../src/guestfs-actions.pod:114
24101 " guestfs_add_domain_argv (guestfs_h *g,\n"
24102 " const char *dom,\n"
24103 " const struct guestfs_add_domain_argv *optargs);\n"
24108 #: ../src/guestfs-actions.pod:119
24109 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
24113 #: ../src/guestfs-actions.pod:123
24114 msgid "guestfs_add_drive"
24118 #: ../src/guestfs-actions.pod:125
24122 " guestfs_add_drive (guestfs_h *g,\n"
24123 " const char *filename);\n"
24128 #: ../src/guestfs-actions.pod:129
24130 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24131 "optional parameters, so the disk is added writable, with the format being "
24132 "detected automatically."
24136 #: ../src/guestfs-actions.pod:133
24138 "Automatic detection of the format opens you up to a potential security hole "
24139 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24140 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24141 "you should think about replacing calls to this function with calls to "
24142 "C<guestfs_add_drive_opts>, and specifying the format."
24146 #: ../src/guestfs-actions.pod:144
24147 msgid "guestfs_add_drive_opts"
24151 #: ../src/guestfs-actions.pod:146
24155 " guestfs_add_drive_opts (guestfs_h *g,\n"
24156 " const char *filename,\n"
24162 #: ../src/guestfs-actions.pod:156
24165 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24166 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24167 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24172 #: ../src/guestfs-actions.pod:185
24174 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24175 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24176 "Possible formats include C<raw> and C<qcow2>."
24180 #: ../src/guestfs-actions.pod:196
24182 "This rarely-used option lets you emulate the behaviour of the deprecated "
24183 "C<guestfs_add_drive_with_if> call (q.v.)"
24187 #: ../src/guestfs-actions.pod:203
24188 msgid "(Added in 1.5.23)"
24192 #: ../src/guestfs-actions.pod:205
24193 msgid "guestfs_add_drive_opts_va"
24197 #: ../src/guestfs-actions.pod:207
24201 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24202 " const char *filename,\n"
24203 " va_list args);\n"
24208 #: ../src/guestfs-actions.pod:212
24209 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24213 #: ../src/guestfs-actions.pod:216
24214 msgid "guestfs_add_drive_opts_argv"
24218 #: ../src/guestfs-actions.pod:218
24222 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24223 " const char *filename,\n"
24224 " const struct guestfs_add_drive_opts_argv *optargs);\n"
24229 #: ../src/guestfs-actions.pod:223
24230 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24234 #: ../src/guestfs-actions.pod:227
24235 msgid "guestfs_add_drive_ro"
24239 #: ../src/guestfs-actions.pod:229
24243 " guestfs_add_drive_ro (guestfs_h *g,\n"
24244 " const char *filename);\n"
24249 #: ../src/guestfs-actions.pod:233
24251 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24252 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24253 "disk is added read-only, with the format being detected automatically."
24257 #: ../src/guestfs-actions.pod:240
24258 msgid "(Added in 1.0.38)"
24262 #: ../src/guestfs-actions.pod:242
24263 msgid "guestfs_add_drive_ro_with_if"
24267 #: ../src/guestfs-actions.pod:244
24271 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24272 " const char *filename,\n"
24273 " const char *iface);\n"
24278 #: ../src/guestfs-actions.pod:256
24280 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24281 "QEMU interface emulation to use at run time."
24285 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
24286 #: ../src/guestfs-actions.pod:2580
24287 msgid "(Added in 1.0.84)"
24291 #: ../src/guestfs-actions.pod:263
24292 msgid "guestfs_add_drive_with_if"
24296 #: ../src/guestfs-actions.pod:265
24300 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24301 " const char *filename,\n"
24302 " const char *iface);\n"
24307 #: ../src/guestfs-actions.pod:277
24309 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24310 "QEMU interface emulation to use at run time."
24314 #: ../src/guestfs-actions.pod:284
24315 msgid "guestfs_aug_clear"
24319 #: ../src/guestfs-actions.pod:286
24323 " guestfs_aug_clear (guestfs_h *g,\n"
24324 " const char *augpath);\n"
24329 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2308
24330 msgid "(Added in 1.3.4)"
24334 #: ../src/guestfs-actions.pod:297
24335 msgid "guestfs_aug_close"
24339 #: ../src/guestfs-actions.pod:299
24343 " guestfs_aug_close (guestfs_h *g);\n"
24348 #: ../src/guestfs-actions.pod:302
24350 "Close the current Augeas handle and free up any resources used by it. After "
24351 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24352 "any other Augeas functions."
24356 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
24357 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
24358 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
24359 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
24360 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
24361 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
24362 #: ../src/guestfs-actions.pod:5989
24363 msgid "(Added in 0.7)"
24367 #: ../src/guestfs-actions.pod:311
24368 msgid "guestfs_aug_defnode"
24372 #: ../src/guestfs-actions.pod:313
24375 " struct guestfs_int_bool *\n"
24376 " guestfs_aug_defnode (guestfs_h *g,\n"
24377 " const char *name,\n"
24378 " const char *expr,\n"
24379 " const char *val);\n"
24384 #: ../src/guestfs-actions.pod:322
24386 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24387 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24388 "containing that single node."
24392 #: ../src/guestfs-actions.pod:330
24394 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24395 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24399 #: ../src/guestfs-actions.pod:336
24400 msgid "guestfs_aug_defvar"
24404 #: ../src/guestfs-actions.pod:338
24408 " guestfs_aug_defvar (guestfs_h *g,\n"
24409 " const char *name,\n"
24410 " const char *expr);\n"
24415 #: ../src/guestfs-actions.pod:354
24416 msgid "guestfs_aug_get"
24420 #: ../src/guestfs-actions.pod:356
24424 " guestfs_aug_get (guestfs_h *g,\n"
24425 " const char *augpath);\n"
24430 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
24431 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
24432 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
24433 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1382
24434 #: ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1535
24435 #: ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1835
24436 #: ../src/guestfs-actions.pod:1998 ../src/guestfs-actions.pod:2015
24437 #: ../src/guestfs-actions.pod:2082 ../src/guestfs-actions.pod:2125
24438 #: ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:2331
24439 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2749
24440 #: ../src/guestfs-actions.pod:2843 ../src/guestfs-actions.pod:2947
24441 #: ../src/guestfs-actions.pod:2966 ../src/guestfs-actions.pod:3180
24442 #: ../src/guestfs-actions.pod:3208 ../src/guestfs-actions.pod:3229
24443 #: ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3322
24444 #: ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3362
24445 #: ../src/guestfs-actions.pod:3989 ../src/guestfs-actions.pod:4342
24446 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4622
24447 #: ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:5717
24448 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:6065
24449 #: ../src/guestfs-actions.pod:6114 ../src/guestfs-actions.pod:6786
24450 #: ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6826
24451 #: ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:7524
24452 #: ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7561
24453 #: ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:8052
24455 "This function returns a string, or NULL on error. I<The caller must free "
24456 "the returned string after use>."
24460 #: ../src/guestfs-actions.pod:368
24461 msgid "guestfs_aug_init"
24465 #: ../src/guestfs-actions.pod:370
24469 " guestfs_aug_init (guestfs_h *g,\n"
24470 " const char *root,\n"
24476 #: ../src/guestfs-actions.pod:379
24477 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24481 #: ../src/guestfs-actions.pod:404
24483 "This option is only useful when debugging Augeas lenses. Use of this option "
24484 "may require additional memory for the libguestfs appliance. You may need to "
24485 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24486 "C<guestfs_set_memsize>."
24490 #: ../src/guestfs-actions.pod:419
24491 msgid "Do not load the tree in C<guestfs_aug_init>."
24495 #: ../src/guestfs-actions.pod:423
24496 msgid "To close the handle, you can call C<guestfs_aug_close>."
24500 #: ../src/guestfs-actions.pod:431
24501 msgid "guestfs_aug_insert"
24505 #: ../src/guestfs-actions.pod:433
24509 " guestfs_aug_insert (guestfs_h *g,\n"
24510 " const char *augpath,\n"
24511 " const char *label,\n"
24517 #: ../src/guestfs-actions.pod:451
24518 msgid "guestfs_aug_load"
24522 #: ../src/guestfs-actions.pod:453
24526 " guestfs_aug_load (guestfs_h *g);\n"
24531 #: ../src/guestfs-actions.pod:465
24532 msgid "guestfs_aug_ls"
24536 #: ../src/guestfs-actions.pod:467
24540 " guestfs_aug_ls (guestfs_h *g,\n"
24541 " const char *augpath);\n"
24546 #: ../src/guestfs-actions.pod:471
24548 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24549 "sorting the resulting nodes into alphabetical order."
24553 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
24554 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
24555 #: ../src/guestfs-actions.pod:1550 ../src/guestfs-actions.pod:1569
24556 #: ../src/guestfs-actions.pod:1672 ../src/guestfs-actions.pod:1691
24557 #: ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2403
24558 #: ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2438
24559 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2527
24560 #: ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2647
24561 #: ../src/guestfs-actions.pod:2908 ../src/guestfs-actions.pod:3282
24562 #: ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3872
24563 #: ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3909
24564 #: ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4076
24565 #: ../src/guestfs-actions.pod:4484 ../src/guestfs-actions.pod:5241
24566 #: ../src/guestfs-actions.pod:5859 ../src/guestfs-actions.pod:5985
24567 #: ../src/guestfs-actions.pod:6099 ../src/guestfs-actions.pod:6866
24568 #: ../src/guestfs-actions.pod:6927 ../src/guestfs-actions.pod:6982
24569 #: ../src/guestfs-actions.pod:7128 ../src/guestfs-actions.pod:7152
24570 #: ../src/guestfs-actions.pod:7628 ../src/guestfs-actions.pod:7648
24571 #: ../src/guestfs-actions.pod:7695 ../src/guestfs-actions.pod:7889
24572 #: ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:8002
24573 #: ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8067
24574 #: ../src/guestfs-actions.pod:8086
24576 "This function returns a NULL-terminated array of strings (like L<environ(3)"
24577 ">), or NULL if there was an error. I<The caller must free the strings and "
24578 "the array after use>."
24582 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
24583 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1607
24584 #: ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3667
24585 #: ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4375
24586 #: ../src/guestfs-actions.pod:4562 ../src/guestfs-actions.pod:4595
24587 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:5245
24588 #: ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:6197
24589 #: ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6223
24590 #: ../src/guestfs-actions.pod:6707 ../src/guestfs-actions.pod:7366
24591 #: ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7612
24592 #: ../src/guestfs-actions.pod:7877
24593 msgid "(Added in 0.8)"
24597 #: ../src/guestfs-actions.pod:480
24598 msgid "guestfs_aug_match"
24602 #: ../src/guestfs-actions.pod:482
24606 " guestfs_aug_match (guestfs_h *g,\n"
24607 " const char *augpath);\n"
24612 #: ../src/guestfs-actions.pod:496
24613 msgid "guestfs_aug_mv"
24617 #: ../src/guestfs-actions.pod:498
24621 " guestfs_aug_mv (guestfs_h *g,\n"
24622 " const char *src,\n"
24623 " const char *dest);\n"
24628 #: ../src/guestfs-actions.pod:510
24629 msgid "guestfs_aug_rm"
24633 #: ../src/guestfs-actions.pod:512
24637 " guestfs_aug_rm (guestfs_h *g,\n"
24638 " const char *augpath);\n"
24643 #: ../src/guestfs-actions.pod:524
24644 msgid "guestfs_aug_save"
24648 #: ../src/guestfs-actions.pod:526
24652 " guestfs_aug_save (guestfs_h *g);\n"
24657 #: ../src/guestfs-actions.pod:531
24659 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24664 #: ../src/guestfs-actions.pod:538
24665 msgid "guestfs_aug_set"
24669 #: ../src/guestfs-actions.pod:540
24673 " guestfs_aug_set (guestfs_h *g,\n"
24674 " const char *augpath,\n"
24675 " const char *val);\n"
24680 #: ../src/guestfs-actions.pod:547
24682 "In the Augeas API, it is possible to clear a node by setting the value to "
24683 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24684 "this call. Instead you must use the C<guestfs_aug_clear> call."
24688 #: ../src/guestfs-actions.pod:556
24689 msgid "guestfs_available"
24693 #: ../src/guestfs-actions.pod:558
24697 " guestfs_available (guestfs_h *g,\n"
24698 " char *const *groups);\n"
24703 #: ../src/guestfs-actions.pod:566
24705 "The libguestfs groups, and the functions that those groups correspond to, "
24706 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24707 "runtime by calling C<guestfs_available_all_groups>."
24711 #: ../src/guestfs-actions.pod:590
24712 msgid "You must call C<guestfs_launch> before calling this function."
24716 #: ../src/guestfs-actions.pod:612
24718 "This call was added in version C<1.0.80>. In previous versions of "
24719 "libguestfs all you could do would be to speculatively execute a command to "
24720 "find out if the daemon implemented it. See also C<guestfs_version>."
24724 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1352
24725 msgid "(Added in 1.0.80)"
24729 #: ../src/guestfs-actions.pod:623
24730 msgid "guestfs_available_all_groups"
24734 #: ../src/guestfs-actions.pod:625
24738 " guestfs_available_all_groups (guestfs_h *g);\n"
24743 #: ../src/guestfs-actions.pod:628
24745 "This command returns a list of all optional groups that this daemon knows "
24746 "about. Note this returns both supported and unsupported groups. To find "
24747 "out which ones the daemon can actually support you have to call "
24748 "C<guestfs_available> on each member of the returned list."
24752 #: ../src/guestfs-actions.pod:634
24753 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24757 #: ../src/guestfs-actions.pod:640
24758 msgid "(Added in 1.3.15)"
24762 #: ../src/guestfs-actions.pod:642
24763 msgid "guestfs_base64_in"
24767 #: ../src/guestfs-actions.pod:644
24771 " guestfs_base64_in (guestfs_h *g,\n"
24772 " const char *base64file,\n"
24773 " const char *filename);\n"
24778 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
24779 msgid "(Added in 1.3.5)"
24783 #: ../src/guestfs-actions.pod:656
24784 msgid "guestfs_base64_out"
24788 #: ../src/guestfs-actions.pod:658
24792 " guestfs_base64_out (guestfs_h *g,\n"
24793 " const char *filename,\n"
24794 " const char *base64file);\n"
24799 #: ../src/guestfs-actions.pod:670
24800 msgid "guestfs_blockdev_flushbufs"
24804 #: ../src/guestfs-actions.pod:672
24808 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24809 " const char *device);\n"
24814 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
24815 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
24816 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
24817 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
24818 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
24819 msgid "(Added in 0.9.3)"
24823 #: ../src/guestfs-actions.pod:685
24824 msgid "guestfs_blockdev_getbsz"
24828 #: ../src/guestfs-actions.pod:687
24832 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24833 " const char *device);\n"
24838 #: ../src/guestfs-actions.pod:702
24839 msgid "guestfs_blockdev_getro"
24843 #: ../src/guestfs-actions.pod:704
24847 " guestfs_blockdev_getro (guestfs_h *g,\n"
24848 " const char *device);\n"
24853 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1590
24854 #: ../src/guestfs-actions.pod:1605 ../src/guestfs-actions.pod:2094
24855 #: ../src/guestfs-actions.pod:2105 ../src/guestfs-actions.pod:2177
24856 #: ../src/guestfs-actions.pod:2203 ../src/guestfs-actions.pod:2243
24857 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:2294
24858 #: ../src/guestfs-actions.pod:2317 ../src/guestfs-actions.pod:3379
24859 #: ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3413
24860 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3589
24861 #: ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:3618
24862 #: ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3649
24863 #: ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:3679
24864 #: ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3706
24865 #: ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:3736
24866 #: ../src/guestfs-actions.pod:3749 ../src/guestfs-actions.pod:3763
24867 #: ../src/guestfs-actions.pod:5482
24868 msgid "This function returns a C truth value on success or -1 on error."
24872 #: ../src/guestfs-actions.pod:717
24873 msgid "guestfs_blockdev_getsize64"
24877 #: ../src/guestfs-actions.pod:719
24881 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24882 " const char *device);\n"
24887 #: ../src/guestfs-actions.pod:725
24888 msgid "See also C<guestfs_blockdev_getsz>."
24892 #: ../src/guestfs-actions.pod:733
24893 msgid "guestfs_blockdev_getss"
24897 #: ../src/guestfs-actions.pod:735
24901 " guestfs_blockdev_getss (guestfs_h *g,\n"
24902 " const char *device);\n"
24907 #: ../src/guestfs-actions.pod:742
24909 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24914 #: ../src/guestfs-actions.pod:751
24915 msgid "guestfs_blockdev_getsz"
24919 #: ../src/guestfs-actions.pod:753
24923 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24924 " const char *device);\n"
24929 #: ../src/guestfs-actions.pod:760
24931 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24932 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24936 #: ../src/guestfs-actions.pod:770
24937 msgid "guestfs_blockdev_rereadpt"
24941 #: ../src/guestfs-actions.pod:772
24945 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24946 " const char *device);\n"
24951 #: ../src/guestfs-actions.pod:784
24952 msgid "guestfs_blockdev_setbsz"
24956 #: ../src/guestfs-actions.pod:786
24960 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24961 " const char *device,\n"
24962 " int blocksize);\n"
24967 #: ../src/guestfs-actions.pod:802
24968 msgid "guestfs_blockdev_setro"
24972 #: ../src/guestfs-actions.pod:804
24976 " guestfs_blockdev_setro (guestfs_h *g,\n"
24977 " const char *device);\n"
24982 #: ../src/guestfs-actions.pod:816
24983 msgid "guestfs_blockdev_setrw"
24987 #: ../src/guestfs-actions.pod:818
24991 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24992 " const char *device);\n"
24997 #: ../src/guestfs-actions.pod:830
24998 msgid "guestfs_btrfs_filesystem_resize"
25002 #: ../src/guestfs-actions.pod:832
25006 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
25007 " const char *mountpoint,\n"
25013 #: ../src/guestfs-actions.pod:842
25016 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
25021 #: ../src/guestfs-actions.pod:865
25022 msgid "(Added in 1.11.17)"
25026 #: ../src/guestfs-actions.pod:867
25027 msgid "guestfs_btrfs_filesystem_resize_va"
25031 #: ../src/guestfs-actions.pod:869
25035 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
25036 " const char *mountpoint,\n"
25037 " va_list args);\n"
25042 #: ../src/guestfs-actions.pod:874
25043 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
25047 #: ../src/guestfs-actions.pod:878
25048 msgid "guestfs_btrfs_filesystem_resize_argv"
25052 #: ../src/guestfs-actions.pod:880
25056 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
25057 " const char *mountpoint,\n"
25058 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
25063 #: ../src/guestfs-actions.pod:885
25064 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
25068 #: ../src/guestfs-actions.pod:889
25069 msgid "guestfs_case_sensitive_path"
25073 #: ../src/guestfs-actions.pod:891
25077 " guestfs_case_sensitive_path (guestfs_h *g,\n"
25078 " const char *path);\n"
25083 #: ../src/guestfs-actions.pod:917
25085 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
25086 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
25087 "how the directories were originally created under Windows)."
25091 #: ../src/guestfs-actions.pod:925
25092 msgid "See also C<guestfs_realpath>."
25096 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7546
25097 msgid "(Added in 1.0.75)"
25101 #: ../src/guestfs-actions.pod:932
25102 msgid "guestfs_cat"
25106 #: ../src/guestfs-actions.pod:934
25110 " guestfs_cat (guestfs_h *g,\n"
25111 " const char *path);\n"
25116 #: ../src/guestfs-actions.pod:940
25118 "Note that this function cannot correctly handle binary files (specifically, "
25119 "files containing C<\\0> character which is treated as end of string). For "
25120 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
25121 "functions which have a more complex interface."
25125 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3893
25126 #: ../src/guestfs-actions.pod:3975 ../src/guestfs-actions.pod:3992
25127 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4488
25128 #: ../src/guestfs-actions.pod:4502 ../src/guestfs-actions.pod:5863
25129 #: ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:7699
25130 #: ../src/guestfs-actions.pod:7713
25131 msgid "(Added in 0.4)"
25135 #: ../src/guestfs-actions.pod:953
25136 msgid "guestfs_checksum"
25140 #: ../src/guestfs-actions.pod:955
25144 " guestfs_checksum (guestfs_h *g,\n"
25145 " const char *csumtype,\n"
25146 " const char *path);\n"
25151 #: ../src/guestfs-actions.pod:1001
25152 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
25156 #: ../src/guestfs-actions.pod:1003
25157 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
25161 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1427
25162 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:3591
25163 #: ../src/guestfs-actions.pod:3620 ../src/guestfs-actions.pod:3681
25164 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:7402
25165 msgid "(Added in 1.0.2)"
25169 #: ../src/guestfs-actions.pod:1010
25170 msgid "guestfs_checksum_device"
25174 #: ../src/guestfs-actions.pod:1012
25178 " guestfs_checksum_device (guestfs_h *g,\n"
25179 " const char *csumtype,\n"
25180 " const char *device);\n"
25185 #: ../src/guestfs-actions.pod:1017
25187 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25188 "device named C<device>. For the types of checksums supported see the "
25189 "C<guestfs_checksum> command."
25193 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5312
25194 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5484
25195 #: ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5684
25196 #: ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7325
25197 #: ../src/guestfs-actions.pod:7725
25198 msgid "(Added in 1.3.2)"
25202 #: ../src/guestfs-actions.pod:1026
25203 msgid "guestfs_checksums_out"
25207 #: ../src/guestfs-actions.pod:1028
25211 " guestfs_checksums_out (guestfs_h *g,\n"
25212 " const char *csumtype,\n"
25213 " const char *directory,\n"
25214 " const char *sumsfile);\n"
25219 #: ../src/guestfs-actions.pod:1048
25220 msgid "(Added in 1.3.7)"
25224 #: ../src/guestfs-actions.pod:1050
25225 msgid "guestfs_chmod"
25229 #: ../src/guestfs-actions.pod:1052
25233 " guestfs_chmod (guestfs_h *g,\n"
25235 " const char *path);\n"
25240 #: ../src/guestfs-actions.pod:1070
25241 msgid "guestfs_chown"
25245 #: ../src/guestfs-actions.pod:1072
25249 " guestfs_chown (guestfs_h *g,\n"
25252 " const char *path);\n"
25257 #: ../src/guestfs-actions.pod:1088
25258 msgid "guestfs_command"
25262 #: ../src/guestfs-actions.pod:1090
25266 " guestfs_command (guestfs_h *g,\n"
25267 " char *const *arguments);\n"
25272 #: ../src/guestfs-actions.pod:1099
25274 "The single parameter is an argv-style list of arguments. The first element "
25275 "is the name of the program to run. Subsequent elements are parameters. The "
25276 "list must be non-empty (ie. must contain a program name). Note that the "
25277 "command runs directly, and is I<not> invoked via the shell (see "
25282 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
25283 #: ../src/guestfs-actions.pod:1726
25284 msgid "(Added in 0.9.1)"
25288 #: ../src/guestfs-actions.pod:1132
25289 msgid "guestfs_command_lines"
25293 #: ../src/guestfs-actions.pod:1134
25297 " guestfs_command_lines (guestfs_h *g,\n"
25298 " char *const *arguments);\n"
25303 #: ../src/guestfs-actions.pod:1138
25305 "This is the same as C<guestfs_command>, but splits the result into a list of "
25310 #: ../src/guestfs-actions.pod:1141
25311 msgid "See also: C<guestfs_sh_lines>"
25315 #: ../src/guestfs-actions.pod:1152
25316 msgid "guestfs_compress_device_out"
25320 #: ../src/guestfs-actions.pod:1154
25324 " guestfs_compress_device_out (guestfs_h *g,\n"
25325 " const char *ctype,\n"
25326 " const char *device,\n"
25327 " const char *zdevice,\n"
25333 #: ../src/guestfs-actions.pod:1166
25336 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25341 #: ../src/guestfs-actions.pod:1171
25343 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25344 "C<guestfs_compress_out>."
25348 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1235
25349 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:6583
25350 msgid "(Added in 1.13.15)"
25354 #: ../src/guestfs-actions.pod:1178
25355 msgid "guestfs_compress_device_out_va"
25359 #: ../src/guestfs-actions.pod:1180
25363 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25364 " const char *ctype,\n"
25365 " const char *device,\n"
25366 " const char *zdevice,\n"
25367 " va_list args);\n"
25372 #: ../src/guestfs-actions.pod:1187
25373 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25377 #: ../src/guestfs-actions.pod:1191
25378 msgid "guestfs_compress_device_out_argv"
25382 #: ../src/guestfs-actions.pod:1193
25386 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25387 " const char *ctype,\n"
25388 " const char *device,\n"
25389 " const char *zdevice,\n"
25390 " const struct guestfs_compress_device_out_argv *optargs);\n"
25395 #: ../src/guestfs-actions.pod:1200
25396 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25400 #: ../src/guestfs-actions.pod:1204
25401 msgid "guestfs_compress_out"
25405 #: ../src/guestfs-actions.pod:1206
25409 " guestfs_compress_out (guestfs_h *g,\n"
25410 " const char *ctype,\n"
25411 " const char *file,\n"
25412 " const char *zfile,\n"
25418 #: ../src/guestfs-actions.pod:1218
25421 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25426 #: ../src/guestfs-actions.pod:1237
25427 msgid "guestfs_compress_out_va"
25431 #: ../src/guestfs-actions.pod:1239
25435 " guestfs_compress_out_va (guestfs_h *g,\n"
25436 " const char *ctype,\n"
25437 " const char *file,\n"
25438 " const char *zfile,\n"
25439 " va_list args);\n"
25444 #: ../src/guestfs-actions.pod:1246
25445 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25449 #: ../src/guestfs-actions.pod:1250
25450 msgid "guestfs_compress_out_argv"
25454 #: ../src/guestfs-actions.pod:1252
25458 " guestfs_compress_out_argv (guestfs_h *g,\n"
25459 " const char *ctype,\n"
25460 " const char *file,\n"
25461 " const char *zfile,\n"
25462 " const struct guestfs_compress_out_argv *optargs);\n"
25467 #: ../src/guestfs-actions.pod:1259
25468 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25472 #: ../src/guestfs-actions.pod:1263
25473 msgid "guestfs_config"
25477 #: ../src/guestfs-actions.pod:1265
25481 " guestfs_config (guestfs_h *g,\n"
25482 " const char *qemuparam,\n"
25483 " const char *qemuvalue);\n"
25488 #: ../src/guestfs-actions.pod:1283
25489 msgid "guestfs_copy_size"
25493 #: ../src/guestfs-actions.pod:1285
25497 " guestfs_copy_size (guestfs_h *g,\n"
25498 " const char *src,\n"
25499 " const char *dest,\n"
25500 " int64_t size);\n"
25505 #: ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1422
25506 #: ../src/guestfs-actions.pod:1453 ../src/guestfs-actions.pod:1498
25507 #: ../src/guestfs-actions.pod:1875 ../src/guestfs-actions.pod:1897
25508 #: ../src/guestfs-actions.pod:3791 ../src/guestfs-actions.pod:7397
25509 #: ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7938
25510 #: ../src/guestfs-actions.pod:7961
25512 "This long-running command can generate progress notification messages so "
25513 "that the caller can display a progress bar or indicator. To receive these "
25514 "messages, the caller must register a progress event callback. See L<guestfs"
25515 "(3)/GUESTFS_EVENT_PROGRESS>."
25519 #: ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:4515
25520 #: ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:7632
25521 #: ../src/guestfs-actions.pod:7652 ../src/guestfs-actions.pod:7738
25522 msgid "(Added in 1.0.87)"
25526 #: ../src/guestfs-actions.pod:1306
25531 #: ../src/guestfs-actions.pod:1308
25535 " guestfs_cp (guestfs_h *g,\n"
25536 " const char *src,\n"
25537 " const char *dest);\n"
25542 #: ../src/guestfs-actions.pod:1318 ../src/guestfs-actions.pod:1332
25543 #: ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1478
25544 #: ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:5259
25545 #: ../src/guestfs-actions.pod:5734
25546 msgid "(Added in 1.0.18)"
25550 #: ../src/guestfs-actions.pod:1320
25551 msgid "guestfs_cp_a"
25555 #: ../src/guestfs-actions.pod:1322
25559 " guestfs_cp_a (guestfs_h *g,\n"
25560 " const char *src,\n"
25561 " const char *dest);\n"
25566 #: ../src/guestfs-actions.pod:1334
25571 #: ../src/guestfs-actions.pod:1336
25575 " guestfs_dd (guestfs_h *g,\n"
25576 " const char *src,\n"
25577 " const char *dest);\n"
25582 #: ../src/guestfs-actions.pod:1346
25584 "If the destination is a device, it must be as large or larger than the "
25585 "source file or device, otherwise the copy will fail. This command cannot do "
25586 "partial copies (see C<guestfs_copy_size>)."
25590 #: ../src/guestfs-actions.pod:1354
25595 #: ../src/guestfs-actions.pod:1356
25599 " guestfs_df (guestfs_h *g);\n"
25604 #: ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378
25606 "This command is mostly useful for interactive sessions. It is I<not> "
25607 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25612 #: ../src/guestfs-actions.pod:1368 ../src/guestfs-actions.pod:1385
25613 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:2510
25614 #: ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2602
25615 #: ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:5159
25616 #: ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7159
25617 #: ../src/guestfs-actions.pod:7778 ../src/guestfs-actions.pod:7791
25618 #: ../src/guestfs-actions.pod:7804
25619 msgid "(Added in 1.0.54)"
25623 #: ../src/guestfs-actions.pod:1370
25624 msgid "guestfs_df_h"
25628 #: ../src/guestfs-actions.pod:1372
25632 " guestfs_df_h (guestfs_h *g);\n"
25637 #: ../src/guestfs-actions.pod:1387
25638 msgid "guestfs_dmesg"
25642 #: ../src/guestfs-actions.pod:1389
25646 " guestfs_dmesg (guestfs_h *g);\n"
25651 #: ../src/guestfs-actions.pod:1396
25653 "Another way to get the same information is to enable verbose messages with "
25654 "C<guestfs_set_verbose> or by setting the environment variable "
25655 "C<LIBGUESTFS_DEBUG=1> before running the program."
25659 #: ../src/guestfs-actions.pod:1406
25660 msgid "guestfs_download"
25664 #: ../src/guestfs-actions.pod:1408
25668 " guestfs_download (guestfs_h *g,\n"
25669 " const char *remotefilename,\n"
25670 " const char *filename);\n"
25675 #: ../src/guestfs-actions.pod:1418
25676 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25680 #: ../src/guestfs-actions.pod:1429
25681 msgid "guestfs_download_offset"
25685 #: ../src/guestfs-actions.pod:1431
25689 " guestfs_download_offset (guestfs_h *g,\n"
25690 " const char *remotefilename,\n"
25691 " const char *filename,\n"
25692 " int64_t offset,\n"
25693 " int64_t size);\n"
25698 #: ../src/guestfs-actions.pod:1444
25700 "Note that there is no limit on the amount of data that can be downloaded "
25701 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25702 "full amount unless an error occurs."
25706 #: ../src/guestfs-actions.pod:1449
25707 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25711 #: ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:7436
25712 msgid "(Added in 1.5.17)"
25716 #: ../src/guestfs-actions.pod:1460
25717 msgid "guestfs_drop_caches"
25721 #: ../src/guestfs-actions.pod:1462
25725 " guestfs_drop_caches (guestfs_h *g,\n"
25726 " int whattodrop);\n"
25731 #: ../src/guestfs-actions.pod:1480
25736 #: ../src/guestfs-actions.pod:1482
25740 " guestfs_du (guestfs_h *g,\n"
25741 " const char *path);\n"
25746 #: ../src/guestfs-actions.pod:1505
25747 msgid "guestfs_e2fsck_f"
25751 #: ../src/guestfs-actions.pod:1507
25755 " guestfs_e2fsck_f (guestfs_h *g,\n"
25756 " const char *device);\n"
25761 #: ../src/guestfs-actions.pod:1515
25763 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25764 "Normally you should use C<guestfs_fsck>."
25768 #: ../src/guestfs-actions.pod:1520
25769 msgid "(Added in 1.0.29)"
25773 #: ../src/guestfs-actions.pod:1522
25774 msgid "guestfs_echo_daemon"
25778 #: ../src/guestfs-actions.pod:1524
25782 " guestfs_echo_daemon (guestfs_h *g,\n"
25783 " char *const *words);\n"
25788 #: ../src/guestfs-actions.pod:1533
25789 msgid "See also C<guestfs_ping_daemon>."
25793 #: ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:2296
25794 #: ../src/guestfs-actions.pod:6607
25795 msgid "(Added in 1.0.69)"
25799 #: ../src/guestfs-actions.pod:1540
25800 msgid "guestfs_egrep"
25804 #: ../src/guestfs-actions.pod:1542
25808 " guestfs_egrep (guestfs_h *g,\n"
25809 " const char *regex,\n"
25810 " const char *path);\n"
25815 #: ../src/guestfs-actions.pod:1557 ../src/guestfs-actions.pod:1576
25816 #: ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1679
25817 #: ../src/guestfs-actions.pod:1698 ../src/guestfs-actions.pod:2426
25818 #: ../src/guestfs-actions.pod:2445 ../src/guestfs-actions.pod:2623
25819 #: ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2651
25820 #: ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2719
25821 #: ../src/guestfs-actions.pod:2732 ../src/guestfs-actions.pod:4005
25822 #: ../src/guestfs-actions.pod:4019 ../src/guestfs-actions.pod:4032
25823 #: ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:5047
25824 #: ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6117
25825 #: ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7015
25826 #: ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041
25827 #: ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7076
25828 #: ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102
25829 #: ../src/guestfs-actions.pod:7896 ../src/guestfs-actions.pod:7915
25830 #: ../src/guestfs-actions.pod:8009 ../src/guestfs-actions.pod:8028
25831 #: ../src/guestfs-actions.pod:8074 ../src/guestfs-actions.pod:8093
25832 msgid "(Added in 1.0.66)"
25836 #: ../src/guestfs-actions.pod:1559
25837 msgid "guestfs_egrepi"
25841 #: ../src/guestfs-actions.pod:1561
25845 " guestfs_egrepi (guestfs_h *g,\n"
25846 " const char *regex,\n"
25847 " const char *path);\n"
25852 #: ../src/guestfs-actions.pod:1578
25853 msgid "guestfs_equal"
25857 #: ../src/guestfs-actions.pod:1580
25861 " guestfs_equal (guestfs_h *g,\n"
25862 " const char *file1,\n"
25863 " const char *file2);\n"
25868 #: ../src/guestfs-actions.pod:1594
25869 msgid "guestfs_exists"
25873 #: ../src/guestfs-actions.pod:1596
25877 " guestfs_exists (guestfs_h *g,\n"
25878 " const char *path);\n"
25883 #: ../src/guestfs-actions.pod:1603
25884 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25888 #: ../src/guestfs-actions.pod:1609
25889 msgid "guestfs_fallocate"
25893 #: ../src/guestfs-actions.pod:1611
25897 " guestfs_fallocate (guestfs_h *g,\n"
25898 " const char *path,\n"
25904 #: ../src/guestfs-actions.pod:1616
25906 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25911 #: ../src/guestfs-actions.pod:1635
25912 msgid "guestfs_fallocate64"
25916 #: ../src/guestfs-actions.pod:1637
25920 " guestfs_fallocate64 (guestfs_h *g,\n"
25921 " const char *path,\n"
25927 #: ../src/guestfs-actions.pod:1646
25929 "Note that this call allocates disk blocks for the file. To create a sparse "
25930 "file use C<guestfs_truncate_size> instead."
25934 #: ../src/guestfs-actions.pod:1649
25936 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25937 "oversight it only allowed 30 bit lengths to be specified, effectively "
25938 "limiting the maximum size of files created through that call to 1GB."
25942 #: ../src/guestfs-actions.pod:1660
25943 msgid "(Added in 1.3.17)"
25947 #: ../src/guestfs-actions.pod:1662
25948 msgid "guestfs_fgrep"
25952 #: ../src/guestfs-actions.pod:1664
25956 " guestfs_fgrep (guestfs_h *g,\n"
25957 " const char *pattern,\n"
25958 " const char *path);\n"
25963 #: ../src/guestfs-actions.pod:1681
25964 msgid "guestfs_fgrepi"
25968 #: ../src/guestfs-actions.pod:1683
25972 " guestfs_fgrepi (guestfs_h *g,\n"
25973 " const char *pattern,\n"
25974 " const char *path);\n"
25979 #: ../src/guestfs-actions.pod:1700
25980 msgid "guestfs_file"
25984 #: ../src/guestfs-actions.pod:1702
25988 " guestfs_file (guestfs_h *g,\n"
25989 " const char *path);\n"
25994 #: ../src/guestfs-actions.pod:1720
25996 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25997 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26001 #: ../src/guestfs-actions.pod:1728
26002 msgid "guestfs_file_architecture"
26006 #: ../src/guestfs-actions.pod:1730
26010 " guestfs_file_architecture (guestfs_h *g,\n"
26011 " const char *filename);\n"
26016 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2001
26017 #: ../src/guestfs-actions.pod:2018 ../src/guestfs-actions.pod:2752
26018 #: ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2912
26019 #: ../src/guestfs-actions.pod:3099 ../src/guestfs-actions.pod:3117
26020 #: ../src/guestfs-actions.pod:3157 ../src/guestfs-actions.pod:3232
26021 #: ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:3562
26022 #: ../src/guestfs-actions.pod:3694
26023 msgid "(Added in 1.5.3)"
26027 #: ../src/guestfs-actions.pod:1840
26028 msgid "guestfs_filesize"
26032 #: ../src/guestfs-actions.pod:1842
26036 " guestfs_filesize (guestfs_h *g,\n"
26037 " const char *file);\n"
26042 #: ../src/guestfs-actions.pod:1848
26044 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26045 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26046 "devices, use C<guestfs_blockdev_getsize64>."
26050 #: ../src/guestfs-actions.pod:1854
26051 msgid "(Added in 1.0.82)"
26055 #: ../src/guestfs-actions.pod:1856
26056 msgid "guestfs_fill"
26060 #: ../src/guestfs-actions.pod:1858
26064 " guestfs_fill (guestfs_h *g,\n"
26067 " const char *path);\n"
26072 #: ../src/guestfs-actions.pod:1868
26074 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26075 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26076 "bytes use C<guestfs_fill_pattern>."
26080 #: ../src/guestfs-actions.pod:1880
26081 msgid "(Added in 1.0.79)"
26085 #: ../src/guestfs-actions.pod:1882
26086 msgid "guestfs_fill_pattern"
26090 #: ../src/guestfs-actions.pod:1884
26094 " guestfs_fill_pattern (guestfs_h *g,\n"
26095 " const char *pattern,\n"
26097 " const char *path);\n"
26102 #: ../src/guestfs-actions.pod:1890
26104 "This function is like C<guestfs_fill> except that it creates a new file of "
26105 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26106 "pattern is truncated if necessary to ensure the length of the file is "
26107 "exactly C<len> bytes."
26111 #: ../src/guestfs-actions.pod:1902
26112 msgid "(Added in 1.3.12)"
26116 #: ../src/guestfs-actions.pod:1904
26117 msgid "guestfs_find"
26121 #: ../src/guestfs-actions.pod:1906
26125 " guestfs_find (guestfs_h *g,\n"
26126 " const char *directory);\n"
26131 #: ../src/guestfs-actions.pod:1922
26133 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26137 #: ../src/guestfs-actions.pod:1935
26138 msgid "See also C<guestfs_find0>."
26142 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4452
26143 #: ../src/guestfs-actions.pod:6152
26144 msgid "(Added in 1.0.27)"
26148 #: ../src/guestfs-actions.pod:1946
26149 msgid "guestfs_find0"
26153 #: ../src/guestfs-actions.pod:1948
26157 " guestfs_find0 (guestfs_h *g,\n"
26158 " const char *directory,\n"
26159 " const char *files);\n"
26164 #: ../src/guestfs-actions.pod:1957
26166 "This command works the same way as C<guestfs_find> with the following "
26171 #: ../src/guestfs-actions.pod:1984
26172 msgid "(Added in 1.0.74)"
26176 #: ../src/guestfs-actions.pod:1986
26177 msgid "guestfs_findfs_label"
26181 #: ../src/guestfs-actions.pod:1988
26185 " guestfs_findfs_label (guestfs_h *g,\n"
26186 " const char *label);\n"
26191 #: ../src/guestfs-actions.pod:1996
26192 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26196 #: ../src/guestfs-actions.pod:2003
26197 msgid "guestfs_findfs_uuid"
26201 #: ../src/guestfs-actions.pod:2005
26205 " guestfs_findfs_uuid (guestfs_h *g,\n"
26206 " const char *uuid);\n"
26211 #: ../src/guestfs-actions.pod:2013
26212 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26216 #: ../src/guestfs-actions.pod:2020
26217 msgid "guestfs_fsck"
26221 #: ../src/guestfs-actions.pod:2022
26225 " guestfs_fsck (guestfs_h *g,\n"
26226 " const char *fstype,\n"
26227 " const char *device);\n"
26232 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:7943
26233 msgid "(Added in 1.0.16)"
26237 #: ../src/guestfs-actions.pod:2059
26238 msgid "guestfs_get_append"
26242 #: ../src/guestfs-actions.pod:2061
26246 " guestfs_get_append (guestfs_h *g);\n"
26251 #: ../src/guestfs-actions.pod:2069
26253 "This function returns a string which may be NULL. There is no way to return "
26254 "an error from this function. The string is owned by the guest handle and "
26255 "must I<not> be freed."
26259 #: ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5830
26260 #: ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6770
26261 #: ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6805
26262 #: ../src/guestfs-actions.pod:6829 ../src/guestfs-actions.pod:7583
26263 #: ../src/guestfs-actions.pod:7598 ../src/guestfs-actions.pod:7990
26264 msgid "(Added in 1.0.26)"
26268 #: ../src/guestfs-actions.pod:2075
26269 msgid "guestfs_get_attach_method"
26273 #: ../src/guestfs-actions.pod:2077
26277 " guestfs_get_attach_method (guestfs_h *g);\n"
26282 #: ../src/guestfs-actions.pod:2080
26283 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26287 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:6342
26288 msgid "(Added in 1.9.8)"
26292 #: ../src/guestfs-actions.pod:2087
26293 msgid "guestfs_get_autosync"
26297 #: ../src/guestfs-actions.pod:2089
26301 " guestfs_get_autosync (guestfs_h *g);\n"
26306 #: ../src/guestfs-actions.pod:2098
26307 msgid "guestfs_get_direct"
26311 #: ../src/guestfs-actions.pod:2100
26315 " guestfs_get_direct (guestfs_h *g);\n"
26320 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:6383
26321 msgid "(Added in 1.0.72)"
26325 #: ../src/guestfs-actions.pod:2109
26326 msgid "guestfs_get_e2label"
26330 #: ../src/guestfs-actions.pod:2111
26334 " guestfs_get_e2label (guestfs_h *g,\n"
26335 " const char *device);\n"
26340 #: ../src/guestfs-actions.pod:2115
26342 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26347 #: ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2149
26348 #: ../src/guestfs-actions.pod:6401 ../src/guestfs-actions.pod:6420
26349 msgid "(Added in 1.0.15)"
26353 #: ../src/guestfs-actions.pod:2130
26354 msgid "guestfs_get_e2uuid"
26358 #: ../src/guestfs-actions.pod:2132
26362 " guestfs_get_e2uuid (guestfs_h *g,\n"
26363 " const char *device);\n"
26368 #: ../src/guestfs-actions.pod:2136
26370 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26375 #: ../src/guestfs-actions.pod:2151
26376 msgid "guestfs_get_memsize"
26380 #: ../src/guestfs-actions.pod:2153
26384 " guestfs_get_memsize (guestfs_h *g);\n"
26389 #: ../src/guestfs-actions.pod:2159
26391 "If C<guestfs_set_memsize> was not called on this handle, and if "
26392 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26393 "value for memsize."
26397 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:4743
26398 #: ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:4971
26399 #: ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5002
26400 #: ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5032
26401 #: ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6441
26402 #: ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:7352
26403 msgid "(Added in 1.0.55)"
26407 #: ../src/guestfs-actions.pod:2170
26408 msgid "guestfs_get_network"
26412 #: ../src/guestfs-actions.pod:2172
26416 " guestfs_get_network (guestfs_h *g);\n"
26421 #: ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:6460
26422 msgid "(Added in 1.5.4)"
26426 #: ../src/guestfs-actions.pod:2181
26427 msgid "guestfs_get_path"
26431 #: ../src/guestfs-actions.pod:2183
26435 " guestfs_get_path (guestfs_h *g);\n"
26440 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2231
26442 "This function returns a string, or NULL on error. The string is owned by "
26443 "the guest handle and must I<not> be freed."
26447 #: ../src/guestfs-actions.pod:2196
26448 msgid "guestfs_get_pgroup"
26452 #: ../src/guestfs-actions.pod:2198
26456 " guestfs_get_pgroup (guestfs_h *g);\n"
26461 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6496
26462 #: ../src/guestfs-actions.pod:7844
26463 msgid "(Added in 1.11.18)"
26467 #: ../src/guestfs-actions.pod:2207
26468 msgid "guestfs_get_pid"
26472 #: ../src/guestfs-actions.pod:2209
26476 " guestfs_get_pid (guestfs_h *g);\n"
26481 #: ../src/guestfs-actions.pod:2219
26482 msgid "(Added in 1.0.56)"
26486 #: ../src/guestfs-actions.pod:2221
26487 msgid "guestfs_get_qemu"
26491 #: ../src/guestfs-actions.pod:2223
26495 " guestfs_get_qemu (guestfs_h *g);\n"
26500 #: ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:6524
26501 msgid "(Added in 1.0.6)"
26505 #: ../src/guestfs-actions.pod:2236
26506 msgid "guestfs_get_recovery_proc"
26510 #: ../src/guestfs-actions.pod:2238
26514 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26519 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:3816
26520 #: ../src/guestfs-actions.pod:4147 ../src/guestfs-actions.pod:4550
26521 #: ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:5760
26522 #: ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6548
26523 #: ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7275
26524 #: ../src/guestfs-actions.pod:7467
26525 msgid "(Added in 1.0.77)"
26529 #: ../src/guestfs-actions.pod:2247
26530 msgid "guestfs_get_selinux"
26534 #: ../src/guestfs-actions.pod:2249
26538 " guestfs_get_selinux (guestfs_h *g);\n"
26543 #: ../src/guestfs-actions.pod:2252
26545 "This returns the current setting of the selinux flag which is passed to the "
26546 "appliance at boot time. See C<guestfs_set_selinux>."
26550 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2334
26551 #: ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:6641
26552 msgid "(Added in 1.0.67)"
26556 #: ../src/guestfs-actions.pod:2262
26557 msgid "guestfs_get_smp"
26561 #: ../src/guestfs-actions.pod:2264
26565 " guestfs_get_smp (guestfs_h *g);\n"
26570 #: ../src/guestfs-actions.pod:2273
26571 msgid "guestfs_get_state"
26575 #: ../src/guestfs-actions.pod:2275
26579 " guestfs_get_state (guestfs_h *g);\n"
26584 #: ../src/guestfs-actions.pod:2287
26585 msgid "guestfs_get_trace"
26589 #: ../src/guestfs-actions.pod:2289
26593 " guestfs_get_trace (guestfs_h *g);\n"
26598 #: ../src/guestfs-actions.pod:2298
26599 msgid "guestfs_get_umask"
26603 #: ../src/guestfs-actions.pod:2300
26607 " guestfs_get_umask (guestfs_h *g);\n"
26612 #: ../src/guestfs-actions.pod:2303
26614 "Return the current umask. By default the umask is C<022> unless it has been "
26615 "set by calling C<guestfs_umask>."
26619 #: ../src/guestfs-actions.pod:2310
26620 msgid "guestfs_get_verbose"
26624 #: ../src/guestfs-actions.pod:2312
26628 " guestfs_get_verbose (guestfs_h *g);\n"
26633 #: ../src/guestfs-actions.pod:2321
26634 msgid "guestfs_getcon"
26638 #: ../src/guestfs-actions.pod:2323
26642 " guestfs_getcon (guestfs_h *g);\n"
26647 #: ../src/guestfs-actions.pod:2328
26649 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26653 #: ../src/guestfs-actions.pod:2336
26654 msgid "guestfs_getxattr"
26658 #: ../src/guestfs-actions.pod:2338
26662 " guestfs_getxattr (guestfs_h *g,\n"
26663 " const char *path,\n"
26664 " const char *name,\n"
26665 " size_t *size_r);\n"
26670 #: ../src/guestfs-actions.pod:2344
26672 "Get a single extended attribute from file C<path> named C<name>. This call "
26673 "follows symlinks. If you want to lookup an extended attribute for the "
26674 "symlink itself, use C<guestfs_lgetxattr>."
26678 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:3830
26680 "Normally it is better to get all extended attributes from a file in one go "
26681 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26682 "implementations are buggy and do not provide a way to list out attributes. "
26683 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26684 "extended attributes you want in advance and call this function."
26688 #: ../src/guestfs-actions.pod:2358
26689 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26693 #: ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2573
26694 #: ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3842
26695 #: ../src/guestfs-actions.pod:5753 ../src/guestfs-actions.pod:5779
26696 #: ../src/guestfs-actions.pod:5960
26698 "This function returns a buffer, or NULL on error. The size of the returned "
26699 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26704 #: ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:3846
26705 msgid "(Added in 1.7.24)"
26709 #: ../src/guestfs-actions.pod:2366
26710 msgid "guestfs_getxattrs"
26714 #: ../src/guestfs-actions.pod:2368
26717 " struct guestfs_xattr_list *\n"
26718 " guestfs_getxattrs (guestfs_h *g,\n"
26719 " const char *path);\n"
26724 #: ../src/guestfs-actions.pod:2378
26725 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26729 #: ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:3858
26730 #: ../src/guestfs-actions.pod:4546
26732 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26733 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26737 #: ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:3862
26738 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4097
26739 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6660
26740 #: ../src/guestfs-actions.pod:8055
26741 msgid "(Added in 1.0.59)"
26745 #: ../src/guestfs-actions.pod:2386
26746 msgid "guestfs_glob_expand"
26750 #: ../src/guestfs-actions.pod:2388
26754 " guestfs_glob_expand (guestfs_h *g,\n"
26755 " const char *pattern);\n"
26760 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6853
26761 #: ../src/guestfs-actions.pod:6870
26762 msgid "(Added in 1.0.50)"
26766 #: ../src/guestfs-actions.pod:2409
26767 msgid "guestfs_grep"
26771 #: ../src/guestfs-actions.pod:2411
26775 " guestfs_grep (guestfs_h *g,\n"
26776 " const char *regex,\n"
26777 " const char *path);\n"
26782 #: ../src/guestfs-actions.pod:2428
26783 msgid "guestfs_grepi"
26787 #: ../src/guestfs-actions.pod:2430
26791 " guestfs_grepi (guestfs_h *g,\n"
26792 " const char *regex,\n"
26793 " const char *path);\n"
26798 #: ../src/guestfs-actions.pod:2447
26799 msgid "guestfs_grub_install"
26803 #: ../src/guestfs-actions.pod:2449
26807 " guestfs_grub_install (guestfs_h *g,\n"
26808 " const char *root,\n"
26809 " const char *device);\n"
26814 #: ../src/guestfs-actions.pod:2492
26815 msgid "(Added in 1.0.17)"
26819 #: ../src/guestfs-actions.pod:2494
26820 msgid "guestfs_head"
26824 #: ../src/guestfs-actions.pod:2496
26828 " guestfs_head (guestfs_h *g,\n"
26829 " const char *path);\n"
26834 #: ../src/guestfs-actions.pod:2512
26835 msgid "guestfs_head_n"
26839 #: ../src/guestfs-actions.pod:2514
26843 " guestfs_head_n (guestfs_h *g,\n"
26845 " const char *path);\n"
26850 #: ../src/guestfs-actions.pod:2536
26851 msgid "guestfs_hexdump"
26855 #: ../src/guestfs-actions.pod:2538
26859 " guestfs_hexdump (guestfs_h *g,\n"
26860 " const char *path);\n"
26865 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:6934
26866 #: ../src/guestfs-actions.pod:6989
26867 msgid "(Added in 1.0.22)"
26871 #: ../src/guestfs-actions.pod:2553
26872 msgid "guestfs_initrd_cat"
26876 #: ../src/guestfs-actions.pod:2555
26880 " guestfs_initrd_cat (guestfs_h *g,\n"
26881 " const char *initrdpath,\n"
26882 " const char *filename,\n"
26883 " size_t *size_r);\n"
26888 #: ../src/guestfs-actions.pod:2571
26889 msgid "See also C<guestfs_initrd_list>."
26893 #: ../src/guestfs-actions.pod:2582
26894 msgid "guestfs_initrd_list"
26898 #: ../src/guestfs-actions.pod:2584
26902 " guestfs_initrd_list (guestfs_h *g,\n"
26903 " const char *path);\n"
26908 #: ../src/guestfs-actions.pod:2604
26909 msgid "guestfs_inotify_add_watch"
26913 #: ../src/guestfs-actions.pod:2606
26917 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26918 " const char *path,\n"
26924 #: ../src/guestfs-actions.pod:2625
26925 msgid "guestfs_inotify_close"
26929 #: ../src/guestfs-actions.pod:2627
26933 " guestfs_inotify_close (guestfs_h *g);\n"
26938 #: ../src/guestfs-actions.pod:2638
26939 msgid "guestfs_inotify_files"
26943 #: ../src/guestfs-actions.pod:2640
26947 " guestfs_inotify_files (guestfs_h *g);\n"
26952 #: ../src/guestfs-actions.pod:2643
26954 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26955 "returns a list of pathnames of objects that were touched. The returned "
26956 "pathnames are sorted and deduplicated."
26960 #: ../src/guestfs-actions.pod:2653
26961 msgid "guestfs_inotify_init"
26965 #: ../src/guestfs-actions.pod:2655
26969 " guestfs_inotify_init (guestfs_h *g,\n"
26970 " int maxevents);\n"
26975 #: ../src/guestfs-actions.pod:2663
26977 "C<maxevents> is the maximum number of events which will be queued up between "
26978 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26979 "passed as C<0>, then the kernel (or previously set) default is used. For "
26980 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26981 "throws away events, but records the fact that it threw them away by setting "
26982 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26983 "C<guestfs_inotify_read>)."
26987 #: ../src/guestfs-actions.pod:2673
26989 "Before any events are generated, you have to add some watches to the "
26990 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26991 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26995 #: ../src/guestfs-actions.pod:2679
26997 "Queued up events should be read periodically by calling "
26998 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26999 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27000 "often enough then you risk the internal queue overflowing."
27004 #: ../src/guestfs-actions.pod:2686
27006 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27007 "This also removes any watches automatically."
27011 #: ../src/guestfs-actions.pod:2699
27012 msgid "guestfs_inotify_read"
27016 #: ../src/guestfs-actions.pod:2701
27019 " struct guestfs_inotify_event_list *\n"
27020 " guestfs_inotify_read (guestfs_h *g);\n"
27025 #: ../src/guestfs-actions.pod:2715
27027 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
27028 "there was an error. I<The caller must call "
27029 "C<guestfs_free_inotify_event_list> after use>."
27033 #: ../src/guestfs-actions.pod:2721
27034 msgid "guestfs_inotify_rm_watch"
27038 #: ../src/guestfs-actions.pod:2723
27042 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27048 #: ../src/guestfs-actions.pod:2727
27050 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
27054 #: ../src/guestfs-actions.pod:2734
27055 msgid "guestfs_inspect_get_arch"
27059 #: ../src/guestfs-actions.pod:2736
27063 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27064 " const char *root);\n"
27069 #: ../src/guestfs-actions.pod:2740
27071 "This returns the architecture of the inspected operating system. The "
27072 "possible return values are listed under C<guestfs_file_architecture>."
27076 #: ../src/guestfs-actions.pod:2754
27077 msgid "guestfs_inspect_get_distro"
27081 #: ../src/guestfs-actions.pod:2756
27085 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27086 " const char *root);\n"
27091 #: ../src/guestfs-actions.pod:2848
27092 msgid "guestfs_inspect_get_drive_mappings"
27096 #: ../src/guestfs-actions.pod:2850
27100 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27101 " const char *root);\n"
27106 #: ../src/guestfs-actions.pod:2879
27108 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27109 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27113 #: ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:3151
27114 #: ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5221
27115 #: ../src/guestfs-actions.pod:7291
27117 "This function returns a NULL-terminated array of strings, or NULL if there "
27118 "was an error. The array of strings will always have length C<2n+1>, where "
27119 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27120 "caller must free the strings and the array after use>."
27124 #: ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:3345
27125 msgid "(Added in 1.9.17)"
27129 #: ../src/guestfs-actions.pod:2891
27130 msgid "guestfs_inspect_get_filesystems"
27134 #: ../src/guestfs-actions.pod:2893
27138 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27139 " const char *root);\n"
27144 #: ../src/guestfs-actions.pod:2905
27146 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27147 "C<guestfs_inspect_get_mountpoints>."
27151 #: ../src/guestfs-actions.pod:2914
27152 msgid "guestfs_inspect_get_format"
27156 #: ../src/guestfs-actions.pod:2916
27160 " guestfs_inspect_get_format (guestfs_h *g,\n"
27161 " const char *root);\n"
27166 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3381
27167 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3415
27168 #: ../src/guestfs-actions.pod:6171
27169 msgid "(Added in 1.9.4)"
27173 #: ../src/guestfs-actions.pod:2952
27174 msgid "guestfs_inspect_get_hostname"
27178 #: ../src/guestfs-actions.pod:2954
27182 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27183 " const char *root);\n"
27188 #: ../src/guestfs-actions.pod:2969
27189 msgid "(Added in 1.7.9)"
27193 #: ../src/guestfs-actions.pod:2971
27194 msgid "guestfs_inspect_get_icon"
27198 #: ../src/guestfs-actions.pod:2973
27202 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27203 " const char *root,\n"
27204 " size_t *size_r,\n"
27210 #: ../src/guestfs-actions.pod:2984
27213 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27214 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27219 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3876
27220 #: ../src/guestfs-actions.pod:5120
27221 msgid "(Added in 1.11.12)"
27225 #: ../src/guestfs-actions.pod:3053
27226 msgid "guestfs_inspect_get_icon_va"
27230 #: ../src/guestfs-actions.pod:3055
27234 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27235 " const char *root,\n"
27236 " size_t *size_r,\n"
27237 " va_list args);\n"
27242 #: ../src/guestfs-actions.pod:3061
27243 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27247 #: ../src/guestfs-actions.pod:3065
27248 msgid "guestfs_inspect_get_icon_argv"
27252 #: ../src/guestfs-actions.pod:3067
27256 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27257 " const char *root,\n"
27258 " size_t *size_r,\n"
27259 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
27264 #: ../src/guestfs-actions.pod:3073
27265 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27269 #: ../src/guestfs-actions.pod:3077
27270 msgid "guestfs_inspect_get_major_version"
27274 #: ../src/guestfs-actions.pod:3079
27278 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27279 " const char *root);\n"
27284 #: ../src/guestfs-actions.pod:3101
27285 msgid "guestfs_inspect_get_minor_version"
27289 #: ../src/guestfs-actions.pod:3103
27293 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27294 " const char *root);\n"
27299 #: ../src/guestfs-actions.pod:3112
27301 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27302 "C<guestfs_inspect_get_major_version>."
27306 #: ../src/guestfs-actions.pod:3119
27307 msgid "guestfs_inspect_get_mountpoints"
27311 #: ../src/guestfs-actions.pod:3121
27315 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27316 " const char *root);\n"
27321 #: ../src/guestfs-actions.pod:3142
27323 "For operating systems like Windows which still use drive letters, this call "
27324 "will only return an entry for the first drive \"mounted on\" C</>. For "
27325 "information about the mapping of drive letters to partitions, see "
27326 "C<guestfs_inspect_get_drive_mappings>."
27330 #: ../src/guestfs-actions.pod:3148
27332 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27333 "C<guestfs_inspect_get_filesystems>."
27337 #: ../src/guestfs-actions.pod:3159
27338 msgid "guestfs_inspect_get_package_format"
27342 #: ../src/guestfs-actions.pod:3161
27346 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27347 " const char *root);\n"
27352 #: ../src/guestfs-actions.pod:3165
27354 "This function and C<guestfs_inspect_get_package_management> return the "
27355 "package format and package management tool used by the inspected operating "
27356 "system. For example for Fedora these functions would return C<rpm> (package "
27357 "format) and C<yum> (package management)."
27361 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:3211
27362 msgid "(Added in 1.7.5)"
27366 #: ../src/guestfs-actions.pod:3185
27367 msgid "guestfs_inspect_get_package_management"
27371 #: ../src/guestfs-actions.pod:3187
27375 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27376 " const char *root);\n"
27381 #: ../src/guestfs-actions.pod:3191
27383 "C<guestfs_inspect_get_package_format> and this function return the package "
27384 "format and package management tool used by the inspected operating system. "
27385 "For example for Fedora these functions would return C<rpm> (package format) "
27386 "and C<yum> (package management)."
27390 #: ../src/guestfs-actions.pod:3213
27391 msgid "guestfs_inspect_get_product_name"
27395 #: ../src/guestfs-actions.pod:3215
27399 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27400 " const char *root);\n"
27405 #: ../src/guestfs-actions.pod:3234
27406 msgid "guestfs_inspect_get_product_variant"
27410 #: ../src/guestfs-actions.pod:3236
27414 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27415 " const char *root);\n"
27420 #: ../src/guestfs-actions.pod:3259
27422 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27423 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27427 #: ../src/guestfs-actions.pod:3266
27428 msgid "(Added in 1.9.13)"
27432 #: ../src/guestfs-actions.pod:3268
27433 msgid "guestfs_inspect_get_roots"
27437 #: ../src/guestfs-actions.pod:3270
27441 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27446 #: ../src/guestfs-actions.pod:3273
27448 "This function is a convenient way to get the list of root devices, as "
27449 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27450 "the whole inspection process."
27454 #: ../src/guestfs-actions.pod:3277
27456 "This returns an empty list if either no root devices were found or the "
27457 "caller has not called C<guestfs_inspect_os>."
27461 #: ../src/guestfs-actions.pod:3286
27462 msgid "(Added in 1.7.3)"
27466 #: ../src/guestfs-actions.pod:3288
27467 msgid "guestfs_inspect_get_type"
27471 #: ../src/guestfs-actions.pod:3290
27475 " guestfs_inspect_get_type (guestfs_h *g,\n"
27476 " const char *root);\n"
27481 #: ../src/guestfs-actions.pod:3327
27482 msgid "guestfs_inspect_get_windows_current_control_set"
27486 #: ../src/guestfs-actions.pod:3329
27490 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27491 " const char *root);\n"
27496 #: ../src/guestfs-actions.pod:3347
27497 msgid "guestfs_inspect_get_windows_systemroot"
27501 #: ../src/guestfs-actions.pod:3349
27505 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27506 " const char *root);\n"
27511 #: ../src/guestfs-actions.pod:3365
27512 msgid "(Added in 1.5.25)"
27516 #: ../src/guestfs-actions.pod:3367
27517 msgid "guestfs_inspect_is_live"
27521 #: ../src/guestfs-actions.pod:3369
27525 " guestfs_inspect_is_live (guestfs_h *g,\n"
27526 " const char *root);\n"
27531 #: ../src/guestfs-actions.pod:3373
27533 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27534 "disk), then this returns true if a live image was detected on the disk."
27538 #: ../src/guestfs-actions.pod:3383
27539 msgid "guestfs_inspect_is_multipart"
27543 #: ../src/guestfs-actions.pod:3385
27547 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27548 " const char *root);\n"
27553 #: ../src/guestfs-actions.pod:3389
27555 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27556 "disk), then this returns true if the disk is part of a set."
27560 #: ../src/guestfs-actions.pod:3399
27561 msgid "guestfs_inspect_is_netinst"
27565 #: ../src/guestfs-actions.pod:3401
27569 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27570 " const char *root);\n"
27575 #: ../src/guestfs-actions.pod:3405
27577 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27578 "disk), then this returns true if the disk is a network installer, ie. not a "
27579 "self-contained install CD but one which is likely to require network access "
27580 "to complete the install."
27584 #: ../src/guestfs-actions.pod:3417
27585 msgid "guestfs_inspect_list_applications"
27589 #: ../src/guestfs-actions.pod:3419
27592 " struct guestfs_application_list *\n"
27593 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27594 " const char *root);\n"
27599 #: ../src/guestfs-actions.pod:3425
27601 "I<Note:> This call works differently from other parts of the inspection "
27602 "API. You have to call C<guestfs_inspect_os>, then "
27603 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27604 "this. Listing applications is a significantly more difficult operation "
27605 "which requires access to the full filesystem. Also note that unlike the "
27606 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27607 "the libguestfs handle, this call actually reads parts of the mounted "
27608 "filesystems during the call."
27612 #: ../src/guestfs-actions.pod:3515
27614 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27615 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27620 #: ../src/guestfs-actions.pod:3519
27621 msgid "(Added in 1.7.8)"
27625 #: ../src/guestfs-actions.pod:3521
27626 msgid "guestfs_inspect_os"
27630 #: ../src/guestfs-actions.pod:3523
27634 " guestfs_inspect_os (guestfs_h *g);\n"
27639 #: ../src/guestfs-actions.pod:3539
27641 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27642 "functions in order to query further information about each operating system, "
27643 "such as the name and version."
27647 #: ../src/guestfs-actions.pod:3544
27649 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27650 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27651 "the contents. This should be called with no disks currently mounted. The "
27652 "function may also use Augeas, so any existing Augeas handle will be closed."
27656 #: ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3887
27657 #: ../src/guestfs-actions.pod:3969
27658 msgid "See also C<guestfs_list_filesystems>."
27662 #: ../src/guestfs-actions.pod:3564
27663 msgid "guestfs_is_blockdev"
27667 #: ../src/guestfs-actions.pod:3566
27671 " guestfs_is_blockdev (guestfs_h *g,\n"
27672 " const char *path);\n"
27677 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3602
27678 #: ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3647
27679 #: ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3719
27680 #: ../src/guestfs-actions.pod:3734
27681 msgid "See also C<guestfs_stat>."
27685 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3606
27686 #: ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3723
27687 #: ../src/guestfs-actions.pod:3738
27688 msgid "(Added in 1.5.10)"
27692 #: ../src/guestfs-actions.pod:3579
27693 msgid "guestfs_is_busy"
27697 #: ../src/guestfs-actions.pod:3581
27701 " guestfs_is_busy (guestfs_h *g);\n"
27706 #: ../src/guestfs-actions.pod:3593
27707 msgid "guestfs_is_chardev"
27711 #: ../src/guestfs-actions.pod:3595
27715 " guestfs_is_chardev (guestfs_h *g,\n"
27716 " const char *path);\n"
27721 #: ../src/guestfs-actions.pod:3608
27722 msgid "guestfs_is_config"
27726 #: ../src/guestfs-actions.pod:3610
27730 " guestfs_is_config (guestfs_h *g);\n"
27735 #: ../src/guestfs-actions.pod:3622
27736 msgid "guestfs_is_dir"
27740 #: ../src/guestfs-actions.pod:3624
27744 " guestfs_is_dir (guestfs_h *g,\n"
27745 " const char *path);\n"
27750 #: ../src/guestfs-actions.pod:3638
27751 msgid "guestfs_is_fifo"
27755 #: ../src/guestfs-actions.pod:3640
27759 " guestfs_is_fifo (guestfs_h *g,\n"
27760 " const char *path);\n"
27765 #: ../src/guestfs-actions.pod:3653
27766 msgid "guestfs_is_file"
27770 #: ../src/guestfs-actions.pod:3655
27774 " guestfs_is_file (guestfs_h *g,\n"
27775 " const char *path);\n"
27780 #: ../src/guestfs-actions.pod:3669
27781 msgid "guestfs_is_launching"
27785 #: ../src/guestfs-actions.pod:3671
27789 " guestfs_is_launching (guestfs_h *g);\n"
27794 #: ../src/guestfs-actions.pod:3683
27795 msgid "guestfs_is_lv"
27799 #: ../src/guestfs-actions.pod:3685
27803 " guestfs_is_lv (guestfs_h *g,\n"
27804 " const char *device);\n"
27809 #: ../src/guestfs-actions.pod:3696
27810 msgid "guestfs_is_ready"
27814 #: ../src/guestfs-actions.pod:3698
27818 " guestfs_is_ready (guestfs_h *g);\n"
27823 #: ../src/guestfs-actions.pod:3710
27824 msgid "guestfs_is_socket"
27828 #: ../src/guestfs-actions.pod:3712
27832 " guestfs_is_socket (guestfs_h *g,\n"
27833 " const char *path);\n"
27838 #: ../src/guestfs-actions.pod:3725
27839 msgid "guestfs_is_symlink"
27843 #: ../src/guestfs-actions.pod:3727
27847 " guestfs_is_symlink (guestfs_h *g,\n"
27848 " const char *path);\n"
27853 #: ../src/guestfs-actions.pod:3740
27854 msgid "guestfs_is_zero"
27858 #: ../src/guestfs-actions.pod:3742
27862 " guestfs_is_zero (guestfs_h *g,\n"
27863 " const char *path);\n"
27868 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3765
27869 msgid "(Added in 1.11.8)"
27873 #: ../src/guestfs-actions.pod:3753
27874 msgid "guestfs_is_zero_device"
27878 #: ../src/guestfs-actions.pod:3755
27882 " guestfs_is_zero_device (guestfs_h *g,\n"
27883 " const char *device);\n"
27888 #: ../src/guestfs-actions.pod:3767
27889 msgid "guestfs_kill_subprocess"
27893 #: ../src/guestfs-actions.pod:3769
27897 " guestfs_kill_subprocess (guestfs_h *g);\n"
27902 #: ../src/guestfs-actions.pod:3778
27903 msgid "guestfs_launch"
27907 #: ../src/guestfs-actions.pod:3780
27911 " guestfs_launch (guestfs_h *g);\n"
27916 #: ../src/guestfs-actions.pod:3798
27917 msgid "guestfs_lchown"
27921 #: ../src/guestfs-actions.pod:3800
27925 " guestfs_lchown (guestfs_h *g,\n"
27928 " const char *path);\n"
27933 #: ../src/guestfs-actions.pod:3806
27935 "Change the file owner to C<owner> and group to C<group>. This is like "
27936 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27937 "changed, not the target."
27941 #: ../src/guestfs-actions.pod:3818
27942 msgid "guestfs_lgetxattr"
27946 #: ../src/guestfs-actions.pod:3820
27950 " guestfs_lgetxattr (guestfs_h *g,\n"
27951 " const char *path,\n"
27952 " const char *name,\n"
27953 " size_t *size_r);\n"
27958 #: ../src/guestfs-actions.pod:3840
27959 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27963 #: ../src/guestfs-actions.pod:3848
27964 msgid "guestfs_lgetxattrs"
27968 #: ../src/guestfs-actions.pod:3850
27971 " struct guestfs_xattr_list *\n"
27972 " guestfs_lgetxattrs (guestfs_h *g,\n"
27973 " const char *path);\n"
27978 #: ../src/guestfs-actions.pod:3854
27980 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27981 "then it returns the extended attributes of the link itself."
27985 #: ../src/guestfs-actions.pod:3864
27986 msgid "guestfs_list_9p"
27990 #: ../src/guestfs-actions.pod:3866
27994 " guestfs_list_9p (guestfs_h *g);\n"
27999 #: ../src/guestfs-actions.pod:3878
28000 msgid "guestfs_list_devices"
28004 #: ../src/guestfs-actions.pod:3880
28008 " guestfs_list_devices (guestfs_h *g);\n"
28013 #: ../src/guestfs-actions.pod:3895
28014 msgid "guestfs_list_dm_devices"
28018 #: ../src/guestfs-actions.pod:3897
28022 " guestfs_list_dm_devices (guestfs_h *g);\n"
28027 #: ../src/guestfs-actions.pod:3902
28029 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
28030 "previous call to C<guestfs_luks_open>."
28034 #: ../src/guestfs-actions.pod:3905
28036 "Device mapper devices which correspond to logical volumes are I<not> "
28037 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28042 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5359
28043 msgid "(Added in 1.11.15)"
28047 #: ../src/guestfs-actions.pod:3915
28048 msgid "guestfs_list_filesystems"
28052 #: ../src/guestfs-actions.pod:3917
28056 " guestfs_list_filesystems (guestfs_h *g);\n"
28061 #: ../src/guestfs-actions.pod:3937
28063 "This command runs other libguestfs commands, which might include "
28064 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28065 "soon after launch and only when nothing is mounted."
28069 #: ../src/guestfs-actions.pod:3941
28071 "Not all of the filesystems returned will be mountable. In particular, swap "
28072 "partitions are returned in the list. Also this command does not check that "
28073 "each filesystem found is valid and mountable, and some filesystems might be "
28074 "mountable but require special options. Filesystems may not all belong to a "
28075 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
28079 #: ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:5720
28080 msgid "(Added in 1.5.15)"
28084 #: ../src/guestfs-actions.pod:3957
28085 msgid "guestfs_list_partitions"
28089 #: ../src/guestfs-actions.pod:3959
28093 " guestfs_list_partitions (guestfs_h *g);\n"
28098 #: ../src/guestfs-actions.pod:3966
28100 "This does not return logical volumes. For that you will need to call "
28105 #: ../src/guestfs-actions.pod:3977
28110 #: ../src/guestfs-actions.pod:3979
28114 " guestfs_ll (guestfs_h *g,\n"
28115 " const char *directory);\n"
28120 #: ../src/guestfs-actions.pod:3994
28125 #: ../src/guestfs-actions.pod:3996
28129 " guestfs_ln (guestfs_h *g,\n"
28130 " const char *target,\n"
28131 " const char *linkname);\n"
28136 #: ../src/guestfs-actions.pod:4007
28137 msgid "guestfs_ln_f"
28141 #: ../src/guestfs-actions.pod:4009
28145 " guestfs_ln_f (guestfs_h *g,\n"
28146 " const char *target,\n"
28147 " const char *linkname);\n"
28152 #: ../src/guestfs-actions.pod:4021
28153 msgid "guestfs_ln_s"
28157 #: ../src/guestfs-actions.pod:4023
28161 " guestfs_ln_s (guestfs_h *g,\n"
28162 " const char *target,\n"
28163 " const char *linkname);\n"
28168 #: ../src/guestfs-actions.pod:4034
28169 msgid "guestfs_ln_sf"
28173 #: ../src/guestfs-actions.pod:4036
28177 " guestfs_ln_sf (guestfs_h *g,\n"
28178 " const char *target,\n"
28179 " const char *linkname);\n"
28184 #: ../src/guestfs-actions.pod:4048
28185 msgid "guestfs_lremovexattr"
28189 #: ../src/guestfs-actions.pod:4050
28193 " guestfs_lremovexattr (guestfs_h *g,\n"
28194 " const char *xattr,\n"
28195 " const char *path);\n"
28200 #: ../src/guestfs-actions.pod:4055
28202 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28203 "link, then it removes an extended attribute of the link itself."
28207 #: ../src/guestfs-actions.pod:4063
28212 #: ../src/guestfs-actions.pod:4065
28216 " guestfs_ls (guestfs_h *g,\n"
28217 " const char *directory);\n"
28222 #: ../src/guestfs-actions.pod:4073
28224 "This command is mostly useful for interactive sessions. Programs should "
28225 "probably use C<guestfs_readdir> instead."
28229 #: ../src/guestfs-actions.pod:4082
28230 msgid "guestfs_lsetxattr"
28234 #: ../src/guestfs-actions.pod:4084
28238 " guestfs_lsetxattr (guestfs_h *g,\n"
28239 " const char *xattr,\n"
28240 " const char *val,\n"
28242 " const char *path);\n"
28247 #: ../src/guestfs-actions.pod:4091
28249 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28250 "then it sets an extended attribute of the link itself."
28254 #: ../src/guestfs-actions.pod:4099
28255 msgid "guestfs_lstat"
28259 #: ../src/guestfs-actions.pod:4101
28262 " struct guestfs_stat *\n"
28263 " guestfs_lstat (guestfs_h *g,\n"
28264 " const char *path);\n"
28269 #: ../src/guestfs-actions.pod:4107
28271 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28272 "link, then the link is stat-ed, not the file it refers to."
28276 #: ../src/guestfs-actions.pod:4113 ../src/guestfs-actions.pod:6894
28278 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28279 "error. I<The caller must call C<guestfs_free_stat> after use>."
28283 #: ../src/guestfs-actions.pod:4117 ../src/guestfs-actions.pod:6898
28284 #: ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:7297
28285 msgid "(Added in 0.9.2)"
28289 #: ../src/guestfs-actions.pod:4119
28290 msgid "guestfs_lstatlist"
28294 #: ../src/guestfs-actions.pod:4121
28297 " struct guestfs_stat_list *\n"
28298 " guestfs_lstatlist (guestfs_h *g,\n"
28299 " const char *path,\n"
28300 " char *const *names);\n"
28305 #: ../src/guestfs-actions.pod:4126
28307 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28308 "files, where all files are in the directory C<path>. C<names> is the list "
28309 "of files from this directory."
28313 #: ../src/guestfs-actions.pod:4135
28315 "This call is intended for programs that want to efficiently list a directory "
28316 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28317 "for a similarly efficient call for getting extended attributes. Very long "
28318 "directory listings might cause the protocol message size to be exceeded, "
28319 "causing this call to fail. The caller must split up such requests into "
28320 "smaller groups of names."
28324 #: ../src/guestfs-actions.pod:4143
28326 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28327 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28331 #: ../src/guestfs-actions.pod:4149
28332 msgid "guestfs_luks_add_key"
28336 #: ../src/guestfs-actions.pod:4151
28340 " guestfs_luks_add_key (guestfs_h *g,\n"
28341 " const char *device,\n"
28342 " const char *key,\n"
28343 " const char *newkey,\n"
28349 #: ../src/guestfs-actions.pod:4163
28351 "Note that if C<keyslot> already contains a key, then this command will "
28352 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28356 #: ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:4209
28357 #: ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4252
28358 #: ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4306
28360 "This function takes a key or passphrase parameter which could contain "
28361 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28366 #: ../src/guestfs-actions.pod:4173 ../src/guestfs-actions.pod:4213
28367 #: ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4256
28368 msgid "(Added in 1.5.2)"
28372 #: ../src/guestfs-actions.pod:4175
28373 msgid "guestfs_luks_close"
28377 #: ../src/guestfs-actions.pod:4177
28381 " guestfs_luks_close (guestfs_h *g,\n"
28382 " const char *device);\n"
28387 #: ../src/guestfs-actions.pod:4181
28389 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28390 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28391 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28392 "underlying block device."
28396 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4291
28397 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4360
28398 #: ../src/guestfs-actions.pod:4408
28399 msgid "(Added in 1.5.1)"
28403 #: ../src/guestfs-actions.pod:4191
28404 msgid "guestfs_luks_format"
28408 #: ../src/guestfs-actions.pod:4193
28412 " guestfs_luks_format (guestfs_h *g,\n"
28413 " const char *device,\n"
28414 " const char *key,\n"
28420 #: ../src/guestfs-actions.pod:4215
28421 msgid "guestfs_luks_format_cipher"
28425 #: ../src/guestfs-actions.pod:4217
28429 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28430 " const char *device,\n"
28431 " const char *key,\n"
28433 " const char *cipher);\n"
28438 #: ../src/guestfs-actions.pod:4224
28440 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28441 "set the C<cipher> used."
28445 #: ../src/guestfs-actions.pod:4238
28446 msgid "guestfs_luks_kill_slot"
28450 #: ../src/guestfs-actions.pod:4240
28454 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28455 " const char *device,\n"
28456 " const char *key,\n"
28462 #: ../src/guestfs-actions.pod:4258
28463 msgid "guestfs_luks_open"
28467 #: ../src/guestfs-actions.pod:4260
28471 " guestfs_luks_open (guestfs_h *g,\n"
28472 " const char *device,\n"
28473 " const char *key,\n"
28474 " const char *mapname);\n"
28479 #: ../src/guestfs-actions.pod:4278
28481 "If this block device contains LVM volume groups, then calling "
28482 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28487 #: ../src/guestfs-actions.pod:4282
28488 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28492 #: ../src/guestfs-actions.pod:4293
28493 msgid "guestfs_luks_open_ro"
28497 #: ../src/guestfs-actions.pod:4295
28501 " guestfs_luks_open_ro (guestfs_h *g,\n"
28502 " const char *device,\n"
28503 " const char *key,\n"
28504 " const char *mapname);\n"
28509 #: ../src/guestfs-actions.pod:4301
28511 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28516 #: ../src/guestfs-actions.pod:4312
28517 msgid "guestfs_lvcreate"
28521 #: ../src/guestfs-actions.pod:4314
28525 " guestfs_lvcreate (guestfs_h *g,\n"
28526 " const char *logvol,\n"
28527 " const char *volgroup,\n"
28533 #: ../src/guestfs-actions.pod:4327
28534 msgid "guestfs_lvm_canonical_lv_name"
28538 #: ../src/guestfs-actions.pod:4329
28542 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28543 " const char *lvname);\n"
28548 #: ../src/guestfs-actions.pod:4340
28549 msgid "See also C<guestfs_is_lv>."
28553 #: ../src/guestfs-actions.pod:4345
28554 msgid "(Added in 1.5.24)"
28558 #: ../src/guestfs-actions.pod:4347
28559 msgid "guestfs_lvm_clear_filter"
28563 #: ../src/guestfs-actions.pod:4349
28567 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28572 #: ../src/guestfs-actions.pod:4352
28574 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28575 "see every block device."
28579 #: ../src/guestfs-actions.pod:4362
28580 msgid "guestfs_lvm_remove_all"
28584 #: ../src/guestfs-actions.pod:4364
28588 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28593 #: ../src/guestfs-actions.pod:4377
28594 msgid "guestfs_lvm_set_filter"
28598 #: ../src/guestfs-actions.pod:4379
28602 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28603 " char *const *devices);\n"
28608 #: ../src/guestfs-actions.pod:4410
28609 msgid "guestfs_lvremove"
28613 #: ../src/guestfs-actions.pod:4412
28617 " guestfs_lvremove (guestfs_h *g,\n"
28618 " const char *device);\n"
28623 #: ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:5817
28624 #: ../src/guestfs-actions.pod:7667
28625 msgid "(Added in 1.0.13)"
28629 #: ../src/guestfs-actions.pod:4426
28630 msgid "guestfs_lvrename"
28634 #: ../src/guestfs-actions.pod:4428
28638 " guestfs_lvrename (guestfs_h *g,\n"
28639 " const char *logvol,\n"
28640 " const char *newlogvol);\n"
28645 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:7680
28646 msgid "(Added in 1.0.83)"
28650 #: ../src/guestfs-actions.pod:4439
28651 msgid "guestfs_lvresize"
28655 #: ../src/guestfs-actions.pod:4441
28659 " guestfs_lvresize (guestfs_h *g,\n"
28660 " const char *device,\n"
28666 #: ../src/guestfs-actions.pod:4454
28667 msgid "guestfs_lvresize_free"
28671 #: ../src/guestfs-actions.pod:4456
28675 " guestfs_lvresize_free (guestfs_h *g,\n"
28676 " const char *lv,\n"
28682 #: ../src/guestfs-actions.pod:4469
28683 msgid "(Added in 1.3.3)"
28687 #: ../src/guestfs-actions.pod:4471
28688 msgid "guestfs_lvs"
28692 #: ../src/guestfs-actions.pod:4473
28696 " guestfs_lvs (guestfs_h *g);\n"
28701 #: ../src/guestfs-actions.pod:4482
28702 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28706 #: ../src/guestfs-actions.pod:4490
28707 msgid "guestfs_lvs_full"
28711 #: ../src/guestfs-actions.pod:4492
28714 " struct guestfs_lvm_lv_list *\n"
28715 " guestfs_lvs_full (guestfs_h *g);\n"
28720 #: ../src/guestfs-actions.pod:4498
28722 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28723 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
28727 #: ../src/guestfs-actions.pod:4504
28728 msgid "guestfs_lvuuid"
28732 #: ../src/guestfs-actions.pod:4506
28736 " guestfs_lvuuid (guestfs_h *g,\n"
28737 " const char *device);\n"
28742 #: ../src/guestfs-actions.pod:4517
28743 msgid "guestfs_lxattrlist"
28747 #: ../src/guestfs-actions.pod:4519
28750 " struct guestfs_xattr_list *\n"
28751 " guestfs_lxattrlist (guestfs_h *g,\n"
28752 " const char *path,\n"
28753 " char *const *names);\n"
28758 #: ../src/guestfs-actions.pod:4538
28760 "This call is intended for programs that want to efficiently list a directory "
28761 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28762 "a similarly efficient call for getting standard stats. Very long directory "
28763 "listings might cause the protocol message size to be exceeded, causing this "
28764 "call to fail. The caller must split up such requests into smaller groups of "
28769 #: ../src/guestfs-actions.pod:4552
28770 msgid "guestfs_mkdir"
28774 #: ../src/guestfs-actions.pod:4554
28778 " guestfs_mkdir (guestfs_h *g,\n"
28779 " const char *path);\n"
28784 #: ../src/guestfs-actions.pod:4564
28785 msgid "guestfs_mkdir_mode"
28789 #: ../src/guestfs-actions.pod:4566
28793 " guestfs_mkdir_mode (guestfs_h *g,\n"
28794 " const char *path,\n"
28800 #: ../src/guestfs-actions.pod:4578
28801 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28805 #: ../src/guestfs-actions.pod:4584
28806 msgid "guestfs_mkdir_p"
28810 #: ../src/guestfs-actions.pod:4586
28814 " guestfs_mkdir_p (guestfs_h *g,\n"
28815 " const char *path);\n"
28820 #: ../src/guestfs-actions.pod:4597
28821 msgid "guestfs_mkdtemp"
28825 #: ../src/guestfs-actions.pod:4599
28829 " guestfs_mkdtemp (guestfs_h *g,\n"
28830 " const char *template);\n"
28835 #: ../src/guestfs-actions.pod:4627
28836 msgid "guestfs_mke2fs_J"
28840 #: ../src/guestfs-actions.pod:4629
28844 " guestfs_mke2fs_J (guestfs_h *g,\n"
28845 " const char *fstype,\n"
28846 " int blocksize,\n"
28847 " const char *device,\n"
28848 " const char *journal);\n"
28853 #: ../src/guestfs-actions.pod:4642
28854 msgid "See also C<guestfs_mke2journal>."
28858 #: ../src/guestfs-actions.pod:4646 ../src/guestfs-actions.pod:4664
28859 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4698
28860 #: ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4726
28861 #: ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:5062
28862 msgid "(Added in 1.0.68)"
28866 #: ../src/guestfs-actions.pod:4648
28867 msgid "guestfs_mke2fs_JL"
28871 #: ../src/guestfs-actions.pod:4650
28875 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28876 " const char *fstype,\n"
28877 " int blocksize,\n"
28878 " const char *device,\n"
28879 " const char *label);\n"
28884 #: ../src/guestfs-actions.pod:4660
28885 msgid "See also C<guestfs_mke2journal_L>."
28889 #: ../src/guestfs-actions.pod:4666
28890 msgid "guestfs_mke2fs_JU"
28894 #: ../src/guestfs-actions.pod:4668
28898 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28899 " const char *fstype,\n"
28900 " int blocksize,\n"
28901 " const char *device,\n"
28902 " const char *uuid);\n"
28907 #: ../src/guestfs-actions.pod:4678
28908 msgid "See also C<guestfs_mke2journal_U>."
28912 #: ../src/guestfs-actions.pod:4684
28913 msgid "guestfs_mke2journal"
28917 #: ../src/guestfs-actions.pod:4686
28921 " guestfs_mke2journal (guestfs_h *g,\n"
28922 " int blocksize,\n"
28923 " const char *device);\n"
28928 #: ../src/guestfs-actions.pod:4700
28929 msgid "guestfs_mke2journal_L"
28933 #: ../src/guestfs-actions.pod:4702
28937 " guestfs_mke2journal_L (guestfs_h *g,\n"
28938 " int blocksize,\n"
28939 " const char *label,\n"
28940 " const char *device);\n"
28945 #: ../src/guestfs-actions.pod:4714
28946 msgid "guestfs_mke2journal_U"
28950 #: ../src/guestfs-actions.pod:4716
28954 " guestfs_mke2journal_U (guestfs_h *g,\n"
28955 " int blocksize,\n"
28956 " const char *uuid,\n"
28957 " const char *device);\n"
28962 #: ../src/guestfs-actions.pod:4728
28963 msgid "guestfs_mkfifo"
28967 #: ../src/guestfs-actions.pod:4730
28971 " guestfs_mkfifo (guestfs_h *g,\n"
28973 " const char *path);\n"
28978 #: ../src/guestfs-actions.pod:4735
28980 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28981 "is just a convenient wrapper around C<guestfs_mknod>."
28985 #: ../src/guestfs-actions.pod:4745
28986 msgid "guestfs_mkfs"
28990 #: ../src/guestfs-actions.pod:4747
28994 " guestfs_mkfs (guestfs_h *g,\n"
28995 " const char *fstype,\n"
28996 " const char *device);\n"
29001 #: ../src/guestfs-actions.pod:4760
29002 msgid "guestfs_mkfs_b"
29006 #: ../src/guestfs-actions.pod:4762
29010 " guestfs_mkfs_b (guestfs_h *g,\n"
29011 " const char *fstype,\n"
29012 " int blocksize,\n"
29013 " const char *device);\n"
29018 #: ../src/guestfs-actions.pod:4768
29020 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
29025 #: ../src/guestfs-actions.pod:4775
29027 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
29028 "block size of the resulting filesystem. Supported block sizes depend on the "
29029 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
29033 #: ../src/guestfs-actions.pod:4787
29034 msgid "guestfs_mkfs_opts"
29038 #: ../src/guestfs-actions.pod:4789
29042 " guestfs_mkfs_opts (guestfs_h *g,\n"
29043 " const char *fstype,\n"
29044 " const char *device,\n"
29050 #: ../src/guestfs-actions.pod:4800
29053 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29054 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29055 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29056 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29061 #: ../src/guestfs-actions.pod:4848
29062 msgid "(Added in 1.7.19)"
29066 #: ../src/guestfs-actions.pod:4850
29067 msgid "guestfs_mkfs_opts_va"
29071 #: ../src/guestfs-actions.pod:4852
29075 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29076 " const char *fstype,\n"
29077 " const char *device,\n"
29078 " va_list args);\n"
29083 #: ../src/guestfs-actions.pod:4858
29084 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29088 #: ../src/guestfs-actions.pod:4862
29089 msgid "guestfs_mkfs_opts_argv"
29093 #: ../src/guestfs-actions.pod:4864
29097 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29098 " const char *fstype,\n"
29099 " const char *device,\n"
29100 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29105 #: ../src/guestfs-actions.pod:4870
29106 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29110 #: ../src/guestfs-actions.pod:4874
29111 msgid "guestfs_mkmountpoint"
29115 #: ../src/guestfs-actions.pod:4876
29119 " guestfs_mkmountpoint (guestfs_h *g,\n"
29120 " const char *exemptpath);\n"
29125 #: ../src/guestfs-actions.pod:4880
29127 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29128 "that can be used to create extra mountpoints before mounting the first "
29133 #: ../src/guestfs-actions.pod:4904
29135 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29136 "may get unexpected errors if you try to mix these calls. It is safest to "
29137 "manually unmount filesystems and remove mountpoints after use."
29141 #: ../src/guestfs-actions.pod:4908
29143 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29144 "first, so for this to work for manual mountpoints, you must ensure that the "
29145 "innermost mountpoints have the longest pathnames, as in the example code "
29150 #: ../src/guestfs-actions.pod:4915
29152 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29153 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29154 "can also trigger these issues."
29158 #: ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5227
29159 #: ../src/guestfs-actions.pod:6237
29160 msgid "(Added in 1.0.62)"
29164 #: ../src/guestfs-actions.pod:4923
29165 msgid "guestfs_mknod"
29169 #: ../src/guestfs-actions.pod:4925
29173 " guestfs_mknod (guestfs_h *g,\n"
29177 " const char *path);\n"
29182 #: ../src/guestfs-actions.pod:4940
29184 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29185 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29186 "regular file). These constants are available in the standard Linux header "
29187 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29188 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29189 "the appropriate constant for you."
29193 #: ../src/guestfs-actions.pod:4954
29194 msgid "guestfs_mknod_b"
29198 #: ../src/guestfs-actions.pod:4956
29202 " guestfs_mknod_b (guestfs_h *g,\n"
29206 " const char *path);\n"
29211 #: ../src/guestfs-actions.pod:4963
29213 "This call creates a block device node called C<path> with mode C<mode> and "
29214 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29215 "wrapper around C<guestfs_mknod>."
29219 #: ../src/guestfs-actions.pod:4973
29220 msgid "guestfs_mknod_c"
29224 #: ../src/guestfs-actions.pod:4975
29228 " guestfs_mknod_c (guestfs_h *g,\n"
29232 " const char *path);\n"
29237 #: ../src/guestfs-actions.pod:4982
29239 "This call creates a char device node called C<path> with mode C<mode> and "
29240 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29241 "wrapper around C<guestfs_mknod>."
29245 #: ../src/guestfs-actions.pod:4992
29246 msgid "guestfs_mkswap"
29250 #: ../src/guestfs-actions.pod:4994
29254 " guestfs_mkswap (guestfs_h *g,\n"
29255 " const char *device);\n"
29260 #: ../src/guestfs-actions.pod:5004
29261 msgid "guestfs_mkswap_L"
29265 #: ../src/guestfs-actions.pod:5006
29269 " guestfs_mkswap_L (guestfs_h *g,\n"
29270 " const char *label,\n"
29271 " const char *device);\n"
29276 #: ../src/guestfs-actions.pod:5021
29277 msgid "guestfs_mkswap_U"
29281 #: ../src/guestfs-actions.pod:5023
29285 " guestfs_mkswap_U (guestfs_h *g,\n"
29286 " const char *uuid,\n"
29287 " const char *device);\n"
29292 #: ../src/guestfs-actions.pod:5034
29293 msgid "guestfs_mkswap_file"
29297 #: ../src/guestfs-actions.pod:5036
29301 " guestfs_mkswap_file (guestfs_h *g,\n"
29302 " const char *path);\n"
29307 #: ../src/guestfs-actions.pod:5042
29309 "This command just writes a swap file signature to an existing file. To "
29310 "create the file itself, use something like C<guestfs_fallocate>."
29314 #: ../src/guestfs-actions.pod:5049
29315 msgid "guestfs_modprobe"
29319 #: ../src/guestfs-actions.pod:5051
29323 " guestfs_modprobe (guestfs_h *g,\n"
29324 " const char *modulename);\n"
29329 #: ../src/guestfs-actions.pod:5064
29330 msgid "guestfs_mount"
29334 #: ../src/guestfs-actions.pod:5066
29338 " guestfs_mount (guestfs_h *g,\n"
29339 " const char *device,\n"
29340 " const char *mountpoint);\n"
29345 #: ../src/guestfs-actions.pod:5085
29347 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29348 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29349 "problems for users. If your program might need to work with older versions "
29350 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29351 "for the first parameter if you don't want any options)."
29355 #: ../src/guestfs-actions.pod:5096
29356 msgid "guestfs_mount_9p"
29360 #: ../src/guestfs-actions.pod:5098
29364 " guestfs_mount_9p (guestfs_h *g,\n"
29365 " const char *mounttag,\n"
29366 " const char *mountpoint,\n"
29372 #: ../src/guestfs-actions.pod:5109
29375 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29380 #: ../src/guestfs-actions.pod:5122
29381 msgid "guestfs_mount_9p_va"
29385 #: ../src/guestfs-actions.pod:5124
29389 " guestfs_mount_9p_va (guestfs_h *g,\n"
29390 " const char *mounttag,\n"
29391 " const char *mountpoint,\n"
29392 " va_list args);\n"
29397 #: ../src/guestfs-actions.pod:5130
29398 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29402 #: ../src/guestfs-actions.pod:5134
29403 msgid "guestfs_mount_9p_argv"
29407 #: ../src/guestfs-actions.pod:5136
29411 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29412 " const char *mounttag,\n"
29413 " const char *mountpoint,\n"
29414 " const struct guestfs_mount_9p_argv *optargs);\n"
29419 #: ../src/guestfs-actions.pod:5142
29420 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29424 #: ../src/guestfs-actions.pod:5146
29425 msgid "guestfs_mount_loop"
29429 #: ../src/guestfs-actions.pod:5148
29433 " guestfs_mount_loop (guestfs_h *g,\n"
29434 " const char *file,\n"
29435 " const char *mountpoint);\n"
29440 #: ../src/guestfs-actions.pod:5161
29441 msgid "guestfs_mount_options"
29445 #: ../src/guestfs-actions.pod:5163
29449 " guestfs_mount_options (guestfs_h *g,\n"
29450 " const char *options,\n"
29451 " const char *device,\n"
29452 " const char *mountpoint);\n"
29457 #: ../src/guestfs-actions.pod:5169
29459 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29460 "the mount options as for the L<mount(8)> I<-o> flag."
29464 #: ../src/guestfs-actions.pod:5179 ../src/guestfs-actions.pod:5193
29465 #: ../src/guestfs-actions.pod:5210
29466 msgid "(Added in 1.0.10)"
29470 #: ../src/guestfs-actions.pod:5181
29471 msgid "guestfs_mount_ro"
29475 #: ../src/guestfs-actions.pod:5183
29479 " guestfs_mount_ro (guestfs_h *g,\n"
29480 " const char *device,\n"
29481 " const char *mountpoint);\n"
29486 #: ../src/guestfs-actions.pod:5188
29488 "This is the same as the C<guestfs_mount> command, but it mounts the "
29489 "filesystem with the read-only (I<-o ro>) flag."
29493 #: ../src/guestfs-actions.pod:5195
29494 msgid "guestfs_mount_vfs"
29498 #: ../src/guestfs-actions.pod:5197
29502 " guestfs_mount_vfs (guestfs_h *g,\n"
29503 " const char *options,\n"
29504 " const char *vfstype,\n"
29505 " const char *device,\n"
29506 " const char *mountpoint);\n"
29511 #: ../src/guestfs-actions.pod:5204
29513 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29514 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
29519 #: ../src/guestfs-actions.pod:5212
29520 msgid "guestfs_mountpoints"
29524 #: ../src/guestfs-actions.pod:5214
29528 " guestfs_mountpoints (guestfs_h *g);\n"
29533 #: ../src/guestfs-actions.pod:5217
29535 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29536 "devices. This one returns a hash table (map) of device name to directory "
29537 "where the device is mounted."
29541 #: ../src/guestfs-actions.pod:5229
29542 msgid "guestfs_mounts"
29546 #: ../src/guestfs-actions.pod:5231
29550 " guestfs_mounts (guestfs_h *g);\n"
29555 #: ../src/guestfs-actions.pod:5239
29556 msgid "See also: C<guestfs_mountpoints>"
29560 #: ../src/guestfs-actions.pod:5247
29565 #: ../src/guestfs-actions.pod:5249
29569 " guestfs_mv (guestfs_h *g,\n"
29570 " const char *src,\n"
29571 " const char *dest);\n"
29576 #: ../src/guestfs-actions.pod:5261
29577 msgid "guestfs_ntfs_3g_probe"
29581 #: ../src/guestfs-actions.pod:5263
29585 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29587 " const char *device);\n"
29592 #: ../src/guestfs-actions.pod:5282
29593 msgid "(Added in 1.0.43)"
29597 #: ../src/guestfs-actions.pod:5284
29598 msgid "guestfs_ntfsresize"
29602 #: ../src/guestfs-actions.pod:5286
29606 " guestfs_ntfsresize (guestfs_h *g,\n"
29607 " const char *device);\n"
29612 #: ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5390
29614 "I<This function is deprecated.> In new code, use the L</"
29615 "guestfs_ntfsresize_opts> call instead."
29619 #: ../src/guestfs-actions.pod:5314
29620 msgid "guestfs_ntfsresize_opts"
29624 #: ../src/guestfs-actions.pod:5316
29628 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29629 " const char *device,\n"
29635 #: ../src/guestfs-actions.pod:5326
29638 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29639 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29644 #: ../src/guestfs-actions.pod:5346
29646 "After the resize operation, the filesystem is always marked as requiring a "
29647 "consistency check (for safety). You have to boot into Windows to perform "
29648 "this check and clear this condition. If you I<don't> set the C<force> "
29649 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29650 "times on a single filesystem without booting into Windows between each "
29655 #: ../src/guestfs-actions.pod:5361
29656 msgid "guestfs_ntfsresize_opts_va"
29660 #: ../src/guestfs-actions.pod:5363
29664 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
29665 " const char *device,\n"
29666 " va_list args);\n"
29671 #: ../src/guestfs-actions.pod:5368
29672 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
29676 #: ../src/guestfs-actions.pod:5372
29677 msgid "guestfs_ntfsresize_opts_argv"
29681 #: ../src/guestfs-actions.pod:5374
29685 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29686 " const char *device,\n"
29687 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
29692 #: ../src/guestfs-actions.pod:5379
29693 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29697 #: ../src/guestfs-actions.pod:5383
29698 msgid "guestfs_ntfsresize_size"
29702 #: ../src/guestfs-actions.pod:5385
29706 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29707 " const char *device,\n"
29708 " int64_t size);\n"
29713 #: ../src/guestfs-actions.pod:5397
29715 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29716 "to specify the new size (in bytes) explicitly."
29720 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5844
29721 #: ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6185
29722 #: ../src/guestfs-actions.pod:7824
29723 msgid "(Added in 1.3.14)"
29727 #: ../src/guestfs-actions.pod:5404
29728 msgid "guestfs_part_add"
29732 #: ../src/guestfs-actions.pod:5406
29736 " guestfs_part_add (guestfs_h *g,\n"
29737 " const char *device,\n"
29738 " const char *prlogex,\n"
29739 " int64_t startsect,\n"
29740 " int64_t endsect);\n"
29745 #: ../src/guestfs-actions.pod:5413
29747 "This command adds a partition to C<device>. If there is no partition table "
29748 "on the device, call C<guestfs_part_init> first."
29752 #: ../src/guestfs-actions.pod:5425
29754 "Creating a partition which covers the whole disk is not so easy. Use "
29755 "C<guestfs_part_disk> to do that."
29759 #: ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:5468
29760 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5605
29761 #: ../src/guestfs-actions.pod:5643 ../src/guestfs-actions.pod:5662
29762 #: ../src/guestfs-actions.pod:5702
29763 msgid "(Added in 1.0.78)"
29767 #: ../src/guestfs-actions.pod:5432
29768 msgid "guestfs_part_del"
29772 #: ../src/guestfs-actions.pod:5434
29776 " guestfs_part_del (guestfs_h *g,\n"
29777 " const char *device,\n"
29783 #: ../src/guestfs-actions.pod:5449
29784 msgid "guestfs_part_disk"
29788 #: ../src/guestfs-actions.pod:5451
29792 " guestfs_part_disk (guestfs_h *g,\n"
29793 " const char *device,\n"
29794 " const char *parttype);\n"
29799 #: ../src/guestfs-actions.pod:5456
29801 "This command is simply a combination of C<guestfs_part_init> followed by "
29802 "C<guestfs_part_add> to create a single primary partition covering the whole "
29807 #: ../src/guestfs-actions.pod:5460
29809 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29810 "possible values are described in C<guestfs_part_init>."
29814 #: ../src/guestfs-actions.pod:5470
29815 msgid "guestfs_part_get_bootable"
29819 #: ../src/guestfs-actions.pod:5472
29823 " guestfs_part_get_bootable (guestfs_h *g,\n"
29824 " const char *device,\n"
29830 #: ../src/guestfs-actions.pod:5480
29831 msgid "See also C<guestfs_part_set_bootable>."
29835 #: ../src/guestfs-actions.pod:5486
29836 msgid "guestfs_part_get_mbr_id"
29840 #: ../src/guestfs-actions.pod:5488
29844 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29845 " const char *device,\n"
29851 #: ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5678
29853 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29854 "undefined results for other partition table types (see "
29855 "C<guestfs_part_get_parttype>)."
29859 #: ../src/guestfs-actions.pod:5504
29860 msgid "guestfs_part_get_parttype"
29864 #: ../src/guestfs-actions.pod:5506
29868 " guestfs_part_get_parttype (guestfs_h *g,\n"
29869 " const char *device);\n"
29874 #: ../src/guestfs-actions.pod:5513
29876 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29877 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29878 "possible, although unusual. See C<guestfs_part_init> for a full list."
29882 #: ../src/guestfs-actions.pod:5523
29883 msgid "guestfs_part_init"
29887 #: ../src/guestfs-actions.pod:5525
29891 " guestfs_part_init (guestfs_h *g,\n"
29892 " const char *device,\n"
29893 " const char *parttype);\n"
29898 #: ../src/guestfs-actions.pod:5534
29900 "Initially there are no partitions. Following this, you should call "
29901 "C<guestfs_part_add> for each partition required."
29905 #: ../src/guestfs-actions.pod:5607
29906 msgid "guestfs_part_list"
29910 #: ../src/guestfs-actions.pod:5609
29913 " struct guestfs_partition_list *\n"
29914 " guestfs_part_list (guestfs_h *g,\n"
29915 " const char *device);\n"
29920 #: ../src/guestfs-actions.pod:5626
29922 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29923 "the device's sector size, see C<guestfs_blockdev_getss>."
29927 #: ../src/guestfs-actions.pod:5639
29929 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29930 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29935 #: ../src/guestfs-actions.pod:5645
29936 msgid "guestfs_part_set_bootable"
29940 #: ../src/guestfs-actions.pod:5647
29944 " guestfs_part_set_bootable (guestfs_h *g,\n"
29945 " const char *device,\n"
29947 " int bootable);\n"
29952 #: ../src/guestfs-actions.pod:5664
29953 msgid "guestfs_part_set_mbr_id"
29957 #: ../src/guestfs-actions.pod:5666
29961 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29962 " const char *device,\n"
29969 #: ../src/guestfs-actions.pod:5686
29970 msgid "guestfs_part_set_name"
29974 #: ../src/guestfs-actions.pod:5688
29978 " guestfs_part_set_name (guestfs_h *g,\n"
29979 " const char *device,\n"
29981 " const char *name);\n"
29986 #: ../src/guestfs-actions.pod:5704
29987 msgid "guestfs_part_to_dev"
29991 #: ../src/guestfs-actions.pod:5706
29995 " guestfs_part_to_dev (guestfs_h *g,\n"
29996 " const char *partition);\n"
30001 #: ../src/guestfs-actions.pod:5714
30003 "The named partition must exist, for example as a string returned from "
30004 "C<guestfs_list_partitions>."
30008 #: ../src/guestfs-actions.pod:5722
30009 msgid "guestfs_ping_daemon"
30013 #: ../src/guestfs-actions.pod:5724
30017 " guestfs_ping_daemon (guestfs_h *g);\n"
30022 #: ../src/guestfs-actions.pod:5736
30023 msgid "guestfs_pread"
30027 #: ../src/guestfs-actions.pod:5738
30031 " guestfs_pread (guestfs_h *g,\n"
30032 " const char *path,\n"
30034 " int64_t offset,\n"
30035 " size_t *size_r);\n"
30040 #: ../src/guestfs-actions.pod:5751
30041 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30045 #: ../src/guestfs-actions.pod:5762
30046 msgid "guestfs_pread_device"
30050 #: ../src/guestfs-actions.pod:5764
30054 " guestfs_pread_device (guestfs_h *g,\n"
30055 " const char *device,\n"
30057 " int64_t offset,\n"
30058 " size_t *size_r);\n"
30063 #: ../src/guestfs-actions.pod:5777
30064 msgid "See also C<guestfs_pread>."
30068 #: ../src/guestfs-actions.pod:5786
30069 msgid "(Added in 1.5.21)"
30073 #: ../src/guestfs-actions.pod:5788
30074 msgid "guestfs_pvcreate"
30078 #: ../src/guestfs-actions.pod:5790
30082 " guestfs_pvcreate (guestfs_h *g,\n"
30083 " const char *device);\n"
30088 #: ../src/guestfs-actions.pod:5802
30089 msgid "guestfs_pvremove"
30093 #: ../src/guestfs-actions.pod:5804
30097 " guestfs_pvremove (guestfs_h *g,\n"
30098 " const char *device);\n"
30103 #: ../src/guestfs-actions.pod:5819
30104 msgid "guestfs_pvresize"
30108 #: ../src/guestfs-actions.pod:5821
30112 " guestfs_pvresize (guestfs_h *g,\n"
30113 " const char *device);\n"
30118 #: ../src/guestfs-actions.pod:5832
30119 msgid "guestfs_pvresize_size"
30123 #: ../src/guestfs-actions.pod:5834
30127 " guestfs_pvresize_size (guestfs_h *g,\n"
30128 " const char *device,\n"
30129 " int64_t size);\n"
30134 #: ../src/guestfs-actions.pod:5839
30136 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30137 "specify the new size (in bytes) explicitly."
30141 #: ../src/guestfs-actions.pod:5846
30142 msgid "guestfs_pvs"
30146 #: ../src/guestfs-actions.pod:5848
30150 " guestfs_pvs (guestfs_h *g);\n"
30155 #: ../src/guestfs-actions.pod:5857
30156 msgid "See also C<guestfs_pvs_full>."
30160 #: ../src/guestfs-actions.pod:5865
30161 msgid "guestfs_pvs_full"
30165 #: ../src/guestfs-actions.pod:5867
30168 " struct guestfs_lvm_pv_list *\n"
30169 " guestfs_pvs_full (guestfs_h *g);\n"
30174 #: ../src/guestfs-actions.pod:5873
30176 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30177 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
30181 #: ../src/guestfs-actions.pod:5879
30182 msgid "guestfs_pvuuid"
30186 #: ../src/guestfs-actions.pod:5881
30190 " guestfs_pvuuid (guestfs_h *g,\n"
30191 " const char *device);\n"
30196 #: ../src/guestfs-actions.pod:5892
30197 msgid "guestfs_pwrite"
30201 #: ../src/guestfs-actions.pod:5894
30205 " guestfs_pwrite (guestfs_h *g,\n"
30206 " const char *path,\n"
30207 " const char *content,\n"
30208 " size_t content_size,\n"
30209 " int64_t offset);\n"
30214 #: ../src/guestfs-actions.pod:5910
30215 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30219 #: ../src/guestfs-actions.pod:5919
30220 msgid "guestfs_pwrite_device"
30224 #: ../src/guestfs-actions.pod:5921
30228 " guestfs_pwrite_device (guestfs_h *g,\n"
30229 " const char *device,\n"
30230 " const char *content,\n"
30231 " size_t content_size,\n"
30232 " int64_t offset);\n"
30237 #: ../src/guestfs-actions.pod:5936
30238 msgid "See also C<guestfs_pwrite>."
30242 #: ../src/guestfs-actions.pod:5943
30243 msgid "(Added in 1.5.20)"
30247 #: ../src/guestfs-actions.pod:5945
30248 msgid "guestfs_read_file"
30252 #: ../src/guestfs-actions.pod:5947
30256 " guestfs_read_file (guestfs_h *g,\n"
30257 " const char *path,\n"
30258 " size_t *size_r);\n"
30263 #: ../src/guestfs-actions.pod:5955
30265 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30266 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30267 "function is limited in the total size of file that can be handled."
30271 #: ../src/guestfs-actions.pod:5967
30272 msgid "(Added in 1.0.63)"
30276 #: ../src/guestfs-actions.pod:5969
30277 msgid "guestfs_read_lines"
30281 #: ../src/guestfs-actions.pod:5971
30285 " guestfs_read_lines (guestfs_h *g,\n"
30286 " const char *path);\n"
30291 #: ../src/guestfs-actions.pod:5980
30293 "Note that this function cannot correctly handle binary files (specifically, "
30294 "files containing C<\\0> character which is treated as end of line). For "
30295 "those you need to use the C<guestfs_read_file> function which has a more "
30296 "complex interface."
30300 #: ../src/guestfs-actions.pod:5991
30301 msgid "guestfs_readdir"
30305 #: ../src/guestfs-actions.pod:5993
30308 " struct guestfs_dirent_list *\n"
30309 " guestfs_readdir (guestfs_h *g,\n"
30310 " const char *dir);\n"
30315 #: ../src/guestfs-actions.pod:6047
30317 "This function is primarily intended for use by programs. To get a simple "
30318 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30319 "consumption, use C<guestfs_ll>."
30323 #: ../src/guestfs-actions.pod:6051
30325 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30326 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
30330 #: ../src/guestfs-actions.pod:6057
30331 msgid "guestfs_readlink"
30335 #: ../src/guestfs-actions.pod:6059
30339 " guestfs_readlink (guestfs_h *g,\n"
30340 " const char *path);\n"
30345 #: ../src/guestfs-actions.pod:6070
30346 msgid "guestfs_readlinklist"
30350 #: ../src/guestfs-actions.pod:6072
30354 " guestfs_readlinklist (guestfs_h *g,\n"
30355 " const char *path,\n"
30356 " char *const *names);\n"
30361 #: ../src/guestfs-actions.pod:6105
30362 msgid "guestfs_realpath"
30366 #: ../src/guestfs-actions.pod:6107
30370 " guestfs_realpath (guestfs_h *g,\n"
30371 " const char *path);\n"
30376 #: ../src/guestfs-actions.pod:6119
30377 msgid "guestfs_removexattr"
30381 #: ../src/guestfs-actions.pod:6121
30385 " guestfs_removexattr (guestfs_h *g,\n"
30386 " const char *xattr,\n"
30387 " const char *path);\n"
30392 #: ../src/guestfs-actions.pod:6129
30393 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30397 #: ../src/guestfs-actions.pod:6135
30398 msgid "guestfs_resize2fs"
30402 #: ../src/guestfs-actions.pod:6137
30406 " guestfs_resize2fs (guestfs_h *g,\n"
30407 " const char *device);\n"
30412 #: ../src/guestfs-actions.pod:6144
30414 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30415 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30416 "sometimes gives an error about this and sometimes not. In any case, it is "
30417 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30421 #: ../src/guestfs-actions.pod:6154
30422 msgid "guestfs_resize2fs_M"
30426 #: ../src/guestfs-actions.pod:6156
30430 " guestfs_resize2fs_M (guestfs_h *g,\n"
30431 " const char *device);\n"
30436 #: ../src/guestfs-actions.pod:6160
30438 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30439 "resized to its minimum size. This works like the I<-M> option to the "
30440 "C<resize2fs> command."
30444 #: ../src/guestfs-actions.pod:6164
30446 "To get the resulting size of the filesystem you should call "
30447 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30448 "These two numbers, multiplied together, give the resulting size of the "
30449 "minimal filesystem in bytes."
30453 #: ../src/guestfs-actions.pod:6173
30454 msgid "guestfs_resize2fs_size"
30458 #: ../src/guestfs-actions.pod:6175
30462 " guestfs_resize2fs_size (guestfs_h *g,\n"
30463 " const char *device,\n"
30464 " int64_t size);\n"
30469 #: ../src/guestfs-actions.pod:6180
30471 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30472 "to specify the new size (in bytes) explicitly."
30476 #: ../src/guestfs-actions.pod:6187
30481 #: ../src/guestfs-actions.pod:6189
30485 " guestfs_rm (guestfs_h *g,\n"
30486 " const char *path);\n"
30491 #: ../src/guestfs-actions.pod:6199
30492 msgid "guestfs_rm_rf"
30496 #: ../src/guestfs-actions.pod:6201
30500 " guestfs_rm_rf (guestfs_h *g,\n"
30501 " const char *path);\n"
30506 #: ../src/guestfs-actions.pod:6213
30507 msgid "guestfs_rmdir"
30511 #: ../src/guestfs-actions.pod:6215
30515 " guestfs_rmdir (guestfs_h *g,\n"
30516 " const char *path);\n"
30521 #: ../src/guestfs-actions.pod:6225
30522 msgid "guestfs_rmmountpoint"
30526 #: ../src/guestfs-actions.pod:6227
30530 " guestfs_rmmountpoint (guestfs_h *g,\n"
30531 " const char *exemptpath);\n"
30536 #: ../src/guestfs-actions.pod:6231
30538 "This calls removes a mountpoint that was previously created with "
30539 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30543 #: ../src/guestfs-actions.pod:6239
30544 msgid "guestfs_scrub_device"
30548 #: ../src/guestfs-actions.pod:6241
30552 " guestfs_scrub_device (guestfs_h *g,\n"
30553 " const char *device);\n"
30558 #: ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6274
30559 #: ../src/guestfs-actions.pod:6293
30560 msgid "(Added in 1.0.52)"
30564 #: ../src/guestfs-actions.pod:6258
30565 msgid "guestfs_scrub_file"
30569 #: ../src/guestfs-actions.pod:6260
30573 " guestfs_scrub_file (guestfs_h *g,\n"
30574 " const char *file);\n"
30579 #: ../src/guestfs-actions.pod:6276
30580 msgid "guestfs_scrub_freespace"
30584 #: ../src/guestfs-actions.pod:6278
30588 " guestfs_scrub_freespace (guestfs_h *g,\n"
30589 " const char *dir);\n"
30594 #: ../src/guestfs-actions.pod:6282
30596 "This command creates the directory C<dir> and then fills it with files until "
30597 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30598 "and deletes them. The intention is to scrub any free space on the partition "
30599 "containing C<dir>."
30603 #: ../src/guestfs-actions.pod:6295
30604 msgid "guestfs_set_append"
30608 #: ../src/guestfs-actions.pod:6297
30612 " guestfs_set_append (guestfs_h *g,\n"
30613 " const char *append);\n"
30618 #: ../src/guestfs-actions.pod:6314
30619 msgid "guestfs_set_attach_method"
30623 #: ../src/guestfs-actions.pod:6316
30627 " guestfs_set_attach_method (guestfs_h *g,\n"
30628 " const char *attachmethod);\n"
30633 #: ../src/guestfs-actions.pod:6344
30634 msgid "guestfs_set_autosync"
30638 #: ../src/guestfs-actions.pod:6346
30642 " guestfs_set_autosync (guestfs_h *g,\n"
30643 " int autosync);\n"
30648 #: ../src/guestfs-actions.pod:6362
30649 msgid "guestfs_set_direct"
30653 #: ../src/guestfs-actions.pod:6364
30657 " guestfs_set_direct (guestfs_h *g,\n"
30663 #: ../src/guestfs-actions.pod:6372
30665 "One consequence of this is that log messages aren't caught by the library "
30666 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
30671 #: ../src/guestfs-actions.pod:6385
30672 msgid "guestfs_set_e2label"
30676 #: ../src/guestfs-actions.pod:6387
30680 " guestfs_set_e2label (guestfs_h *g,\n"
30681 " const char *device,\n"
30682 " const char *label);\n"
30687 #: ../src/guestfs-actions.pod:6396
30689 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30690 "the existing label on a filesystem."
30694 #: ../src/guestfs-actions.pod:6403
30695 msgid "guestfs_set_e2uuid"
30699 #: ../src/guestfs-actions.pod:6405
30703 " guestfs_set_e2uuid (guestfs_h *g,\n"
30704 " const char *device,\n"
30705 " const char *uuid);\n"
30710 #: ../src/guestfs-actions.pod:6415
30712 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30713 "the existing UUID of a filesystem."
30717 #: ../src/guestfs-actions.pod:6422
30718 msgid "guestfs_set_memsize"
30722 #: ../src/guestfs-actions.pod:6424
30726 " guestfs_set_memsize (guestfs_h *g,\n"
30732 #: ../src/guestfs-actions.pod:6428
30734 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30735 "This only has any effect if called before C<guestfs_launch>."
30739 #: ../src/guestfs-actions.pod:6443
30740 msgid "guestfs_set_network"
30744 #: ../src/guestfs-actions.pod:6445
30748 " guestfs_set_network (guestfs_h *g,\n"
30754 #: ../src/guestfs-actions.pod:6455
30756 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30761 #: ../src/guestfs-actions.pod:6462
30762 msgid "guestfs_set_path"
30766 #: ../src/guestfs-actions.pod:6464
30770 " guestfs_set_path (guestfs_h *g,\n"
30771 " const char *searchpath);\n"
30776 #: ../src/guestfs-actions.pod:6479
30777 msgid "guestfs_set_pgroup"
30781 #: ../src/guestfs-actions.pod:6481
30785 " guestfs_set_pgroup (guestfs_h *g,\n"
30791 #: ../src/guestfs-actions.pod:6498
30792 msgid "guestfs_set_qemu"
30796 #: ../src/guestfs-actions.pod:6500
30800 " guestfs_set_qemu (guestfs_h *g,\n"
30801 " const char *qemu);\n"
30806 #: ../src/guestfs-actions.pod:6526
30807 msgid "guestfs_set_recovery_proc"
30811 #: ../src/guestfs-actions.pod:6528
30815 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30816 " int recoveryproc);\n"
30821 #: ../src/guestfs-actions.pod:6532
30823 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30824 "not create a recovery process. The purpose of the recovery process is to "
30825 "stop runaway qemu processes in the case where the main program aborts "
30830 #: ../src/guestfs-actions.pod:6537
30832 "This only has any effect if called before C<guestfs_launch>, and the default "
30837 #: ../src/guestfs-actions.pod:6550
30838 msgid "guestfs_set_selinux"
30842 #: ../src/guestfs-actions.pod:6552
30846 " guestfs_set_selinux (guestfs_h *g,\n"
30852 #: ../src/guestfs-actions.pod:6569
30853 msgid "guestfs_set_smp"
30857 #: ../src/guestfs-actions.pod:6571
30861 " guestfs_set_smp (guestfs_h *g,\n"
30867 #: ../src/guestfs-actions.pod:6579
30868 msgid "This function must be called before C<guestfs_launch>."
30872 #: ../src/guestfs-actions.pod:6585
30873 msgid "guestfs_set_trace"
30877 #: ../src/guestfs-actions.pod:6587
30881 " guestfs_set_trace (guestfs_h *g,\n"
30887 #: ../src/guestfs-actions.pod:6601
30889 "Trace messages are normally sent to C<stderr>, unless you register a "
30890 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30894 #: ../src/guestfs-actions.pod:6609
30895 msgid "guestfs_set_verbose"
30899 #: ../src/guestfs-actions.pod:6611
30903 " guestfs_set_verbose (guestfs_h *g,\n"
30909 #: ../src/guestfs-actions.pod:6620
30911 "Verbose messages are normally sent to C<stderr>, unless you register a "
30912 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30916 #: ../src/guestfs-actions.pod:6628
30917 msgid "guestfs_setcon"
30921 #: ../src/guestfs-actions.pod:6630
30925 " guestfs_setcon (guestfs_h *g,\n"
30926 " const char *context);\n"
30931 #: ../src/guestfs-actions.pod:6643
30932 msgid "guestfs_setxattr"
30936 #: ../src/guestfs-actions.pod:6645
30940 " guestfs_setxattr (guestfs_h *g,\n"
30941 " const char *xattr,\n"
30942 " const char *val,\n"
30944 " const char *path);\n"
30949 #: ../src/guestfs-actions.pod:6656
30950 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30954 #: ../src/guestfs-actions.pod:6662
30955 msgid "guestfs_sfdisk"
30959 #: ../src/guestfs-actions.pod:6664
30963 " guestfs_sfdisk (guestfs_h *g,\n"
30964 " const char *device,\n"
30968 " char *const *lines);\n"
30973 #: ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6716
30974 #: ../src/guestfs-actions.pod:6750
30976 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30981 #: ../src/guestfs-actions.pod:6699
30983 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30987 #: ../src/guestfs-actions.pod:6709
30988 msgid "guestfs_sfdiskM"
30992 #: ../src/guestfs-actions.pod:6711
30996 " guestfs_sfdiskM (guestfs_h *g,\n"
30997 " const char *device,\n"
30998 " char *const *lines);\n"
31003 #: ../src/guestfs-actions.pod:6723
31005 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
31006 "partition sizes are specified in megabytes only (rounded to the nearest "
31007 "cylinder) and you don't need to specify the cyls, heads and sectors "
31008 "parameters which were rarely if ever used anyway."
31012 #: ../src/guestfs-actions.pod:6729
31014 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
31015 "C<guestfs_part_disk>"
31019 #: ../src/guestfs-actions.pod:6739
31020 msgid "guestfs_sfdisk_N"
31024 #: ../src/guestfs-actions.pod:6741
31028 " guestfs_sfdisk_N (guestfs_h *g,\n"
31029 " const char *device,\n"
31034 " const char *line);\n"
31039 #: ../src/guestfs-actions.pod:6760
31041 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31042 "for the cyls/heads/sectors parameters."
31046 #: ../src/guestfs-actions.pod:6763
31047 msgid "See also: C<guestfs_part_add>"
31051 #: ../src/guestfs-actions.pod:6772
31052 msgid "guestfs_sfdisk_disk_geometry"
31056 #: ../src/guestfs-actions.pod:6774
31060 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31061 " const char *device);\n"
31066 #: ../src/guestfs-actions.pod:6778
31068 "This displays the disk geometry of C<device> read from the partition table. "
31069 "Especially in the case where the underlying block device has been resized, "
31070 "this can be different from the kernel's idea of the geometry (see "
31071 "C<guestfs_sfdisk_kernel_geometry>)."
31075 #: ../src/guestfs-actions.pod:6791
31076 msgid "guestfs_sfdisk_kernel_geometry"
31080 #: ../src/guestfs-actions.pod:6793
31084 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31085 " const char *device);\n"
31090 #: ../src/guestfs-actions.pod:6807
31091 msgid "guestfs_sfdisk_l"
31095 #: ../src/guestfs-actions.pod:6809
31099 " guestfs_sfdisk_l (guestfs_h *g,\n"
31100 " const char *device);\n"
31105 #: ../src/guestfs-actions.pod:6813
31107 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31112 #: ../src/guestfs-actions.pod:6824
31113 msgid "See also: C<guestfs_part_list>"
31117 #: ../src/guestfs-actions.pod:6831
31122 #: ../src/guestfs-actions.pod:6833
31126 " guestfs_sh (guestfs_h *g,\n"
31127 " const char *command);\n"
31132 #: ../src/guestfs-actions.pod:6840
31133 msgid "This is like C<guestfs_command>, but passes the command to:"
31137 #: ../src/guestfs-actions.pod:6848
31138 msgid "All the provisos about C<guestfs_command> apply to this call."
31142 #: ../src/guestfs-actions.pod:6855
31143 msgid "guestfs_sh_lines"
31147 #: ../src/guestfs-actions.pod:6857
31151 " guestfs_sh_lines (guestfs_h *g,\n"
31152 " const char *command);\n"
31157 #: ../src/guestfs-actions.pod:6861
31159 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31164 #: ../src/guestfs-actions.pod:6864
31165 msgid "See also: C<guestfs_command_lines>"
31169 #: ../src/guestfs-actions.pod:6872
31170 msgid "guestfs_sleep"
31174 #: ../src/guestfs-actions.pod:6874
31178 " guestfs_sleep (guestfs_h *g,\n"
31184 #: ../src/guestfs-actions.pod:6882
31185 msgid "(Added in 1.0.41)"
31189 #: ../src/guestfs-actions.pod:6884 ../src/guestfs-structs.pod:109
31190 msgid "guestfs_stat"
31194 #: ../src/guestfs-actions.pod:6886
31197 " struct guestfs_stat *\n"
31198 " guestfs_stat (guestfs_h *g,\n"
31199 " const char *path);\n"
31204 #: ../src/guestfs-actions.pod:6900 ../src/guestfs-structs.pod:135
31205 msgid "guestfs_statvfs"
31209 #: ../src/guestfs-actions.pod:6902
31212 " struct guestfs_statvfs *\n"
31213 " guestfs_statvfs (guestfs_h *g,\n"
31214 " const char *path);\n"
31219 #: ../src/guestfs-actions.pod:6912
31221 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31222 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31226 #: ../src/guestfs-actions.pod:6918
31227 msgid "guestfs_strings"
31231 #: ../src/guestfs-actions.pod:6920
31235 " guestfs_strings (guestfs_h *g,\n"
31236 " const char *path);\n"
31241 #: ../src/guestfs-actions.pod:6936
31242 msgid "guestfs_strings_e"
31246 #: ../src/guestfs-actions.pod:6938
31250 " guestfs_strings_e (guestfs_h *g,\n"
31251 " const char *encoding,\n"
31252 " const char *path);\n"
31257 #: ../src/guestfs-actions.pod:6943
31259 "This is like the C<guestfs_strings> command, but allows you to specify the "
31260 "encoding of strings that are looked for in the source file C<path>."
31264 #: ../src/guestfs-actions.pod:6953
31266 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31267 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31271 #: ../src/guestfs-actions.pod:6991
31272 msgid "guestfs_swapoff_device"
31276 #: ../src/guestfs-actions.pod:6993
31280 " guestfs_swapoff_device (guestfs_h *g,\n"
31281 " const char *device);\n"
31286 #: ../src/guestfs-actions.pod:6997
31288 "This command disables the libguestfs appliance swap device or partition "
31289 "named C<device>. See C<guestfs_swapon_device>."
31293 #: ../src/guestfs-actions.pod:7005
31294 msgid "guestfs_swapoff_file"
31298 #: ../src/guestfs-actions.pod:7007
31302 " guestfs_swapoff_file (guestfs_h *g,\n"
31303 " const char *file);\n"
31308 #: ../src/guestfs-actions.pod:7017
31309 msgid "guestfs_swapoff_label"
31313 #: ../src/guestfs-actions.pod:7019
31317 " guestfs_swapoff_label (guestfs_h *g,\n"
31318 " const char *label);\n"
31323 #: ../src/guestfs-actions.pod:7030
31324 msgid "guestfs_swapoff_uuid"
31328 #: ../src/guestfs-actions.pod:7032
31332 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31333 " const char *uuid);\n"
31338 #: ../src/guestfs-actions.pod:7043
31339 msgid "guestfs_swapon_device"
31343 #: ../src/guestfs-actions.pod:7045
31347 " guestfs_swapon_device (guestfs_h *g,\n"
31348 " const char *device);\n"
31353 #: ../src/guestfs-actions.pod:7049
31355 "This command enables the libguestfs appliance to use the swap device or "
31356 "partition named C<device>. The increased memory is made available for all "
31357 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31361 #: ../src/guestfs-actions.pod:7065
31362 msgid "guestfs_swapon_file"
31366 #: ../src/guestfs-actions.pod:7067
31370 " guestfs_swapon_file (guestfs_h *g,\n"
31371 " const char *file);\n"
31376 #: ../src/guestfs-actions.pod:7071
31378 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31383 #: ../src/guestfs-actions.pod:7078
31384 msgid "guestfs_swapon_label"
31388 #: ../src/guestfs-actions.pod:7080
31392 " guestfs_swapon_label (guestfs_h *g,\n"
31393 " const char *label);\n"
31398 #: ../src/guestfs-actions.pod:7084
31400 "This command enables swap to a labeled swap partition. See "
31401 "C<guestfs_swapon_device> for other notes."
31405 #: ../src/guestfs-actions.pod:7091
31406 msgid "guestfs_swapon_uuid"
31410 #: ../src/guestfs-actions.pod:7093
31414 " guestfs_swapon_uuid (guestfs_h *g,\n"
31415 " const char *uuid);\n"
31420 #: ../src/guestfs-actions.pod:7097
31422 "This command enables swap to a swap partition with the given UUID. See "
31423 "C<guestfs_swapon_device> for other notes."
31427 #: ../src/guestfs-actions.pod:7104
31428 msgid "guestfs_sync"
31432 #: ../src/guestfs-actions.pod:7106
31436 " guestfs_sync (guestfs_h *g);\n"
31441 #: ../src/guestfs-actions.pod:7119
31442 msgid "guestfs_tail"
31446 #: ../src/guestfs-actions.pod:7121
31450 " guestfs_tail (guestfs_h *g,\n"
31451 " const char *path);\n"
31456 #: ../src/guestfs-actions.pod:7137
31457 msgid "guestfs_tail_n"
31461 #: ../src/guestfs-actions.pod:7139
31465 " guestfs_tail_n (guestfs_h *g,\n"
31467 " const char *path);\n"
31472 #: ../src/guestfs-actions.pod:7161
31473 msgid "guestfs_tar_in"
31477 #: ../src/guestfs-actions.pod:7163
31481 " guestfs_tar_in (guestfs_h *g,\n"
31482 " const char *tarfile,\n"
31483 " const char *directory);\n"
31488 #: ../src/guestfs-actions.pod:7171
31490 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31494 #: ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7193
31495 #: ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7225
31496 msgid "(Added in 1.0.3)"
31500 #: ../src/guestfs-actions.pod:7178
31501 msgid "guestfs_tar_out"
31505 #: ../src/guestfs-actions.pod:7180
31509 " guestfs_tar_out (guestfs_h *g,\n"
31510 " const char *directory,\n"
31511 " const char *tarfile);\n"
31516 #: ../src/guestfs-actions.pod:7188
31518 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31519 "C<guestfs_txz_out>."
31523 #: ../src/guestfs-actions.pod:7195
31524 msgid "guestfs_tgz_in"
31528 #: ../src/guestfs-actions.pod:7197
31532 " guestfs_tgz_in (guestfs_h *g,\n"
31533 " const char *tarball,\n"
31534 " const char *directory);\n"
31539 #: ../src/guestfs-actions.pod:7205
31540 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31544 #: ../src/guestfs-actions.pod:7211
31545 msgid "guestfs_tgz_out"
31549 #: ../src/guestfs-actions.pod:7213
31553 " guestfs_tgz_out (guestfs_h *g,\n"
31554 " const char *directory,\n"
31555 " const char *tarball);\n"
31560 #: ../src/guestfs-actions.pod:7221
31561 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
31565 #: ../src/guestfs-actions.pod:7227
31566 msgid "guestfs_touch"
31570 #: ../src/guestfs-actions.pod:7229
31574 " guestfs_touch (guestfs_h *g,\n"
31575 " const char *path);\n"
31580 #: ../src/guestfs-actions.pod:7244
31581 msgid "guestfs_truncate"
31585 #: ../src/guestfs-actions.pod:7246
31589 " guestfs_truncate (guestfs_h *g,\n"
31590 " const char *path);\n"
31595 #: ../src/guestfs-actions.pod:7257
31596 msgid "guestfs_truncate_size"
31600 #: ../src/guestfs-actions.pod:7259
31604 " guestfs_truncate_size (guestfs_h *g,\n"
31605 " const char *path,\n"
31606 " int64_t size);\n"
31611 #: ../src/guestfs-actions.pod:7267
31613 "If the current file size is less than C<size> then the file is extended to "
31614 "the required size with zero bytes. This creates a sparse file (ie. disk "
31615 "blocks are not allocated for the file until you write to it). To create a "
31616 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31620 #: ../src/guestfs-actions.pod:7277
31621 msgid "guestfs_tune2fs_l"
31625 #: ../src/guestfs-actions.pod:7279
31629 " guestfs_tune2fs_l (guestfs_h *g,\n"
31630 " const char *device);\n"
31635 #: ../src/guestfs-actions.pod:7299
31636 msgid "guestfs_txz_in"
31640 #: ../src/guestfs-actions.pod:7301
31644 " guestfs_txz_in (guestfs_h *g,\n"
31645 " const char *tarball,\n"
31646 " const char *directory);\n"
31651 #: ../src/guestfs-actions.pod:7313
31652 msgid "guestfs_txz_out"
31656 #: ../src/guestfs-actions.pod:7315
31660 " guestfs_txz_out (guestfs_h *g,\n"
31661 " const char *directory,\n"
31662 " const char *tarball);\n"
31667 #: ../src/guestfs-actions.pod:7327
31668 msgid "guestfs_umask"
31672 #: ../src/guestfs-actions.pod:7329
31676 " guestfs_umask (guestfs_h *g,\n"
31682 #: ../src/guestfs-actions.pod:7345
31684 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
31685 "C<guestfs_mkdir>."
31689 #: ../src/guestfs-actions.pod:7354
31690 msgid "guestfs_umount"
31694 #: ../src/guestfs-actions.pod:7356
31698 " guestfs_umount (guestfs_h *g,\n"
31699 " const char *pathordevice);\n"
31704 #: ../src/guestfs-actions.pod:7368
31705 msgid "guestfs_umount_all"
31709 #: ../src/guestfs-actions.pod:7370
31713 " guestfs_umount_all (guestfs_h *g);\n"
31718 #: ../src/guestfs-actions.pod:7381
31719 msgid "guestfs_upload"
31723 #: ../src/guestfs-actions.pod:7383
31727 " guestfs_upload (guestfs_h *g,\n"
31728 " const char *filename,\n"
31729 " const char *remotefilename);\n"
31734 #: ../src/guestfs-actions.pod:7393
31735 msgid "See also C<guestfs_download>."
31739 #: ../src/guestfs-actions.pod:7404
31740 msgid "guestfs_upload_offset"
31744 #: ../src/guestfs-actions.pod:7406
31748 " guestfs_upload_offset (guestfs_h *g,\n"
31749 " const char *filename,\n"
31750 " const char *remotefilename,\n"
31751 " int64_t offset);\n"
31756 #: ../src/guestfs-actions.pod:7422
31758 "Note that there is no limit on the amount of data that can be uploaded with "
31759 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31760 "full amount unless an error occurs."
31764 #: ../src/guestfs-actions.pod:7427
31765 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31769 #: ../src/guestfs-actions.pod:7438
31770 msgid "guestfs_utimens"
31774 #: ../src/guestfs-actions.pod:7440
31778 " guestfs_utimens (guestfs_h *g,\n"
31779 " const char *path,\n"
31780 " int64_t atsecs,\n"
31781 " int64_t atnsecs,\n"
31782 " int64_t mtsecs,\n"
31783 " int64_t mtnsecs);\n"
31788 #: ../src/guestfs-actions.pod:7469 ../src/guestfs-structs.pod:175
31789 msgid "guestfs_version"
31793 #: ../src/guestfs-actions.pod:7471
31796 " struct guestfs_version *\n"
31797 " guestfs_version (guestfs_h *g);\n"
31802 #: ../src/guestfs-actions.pod:7499
31804 "I<Note:> Don't use this call to test for availability of features. In "
31805 "enterprise distributions we backport features from later versions into "
31806 "earlier versions, making this an unreliable way to test for features. Use "
31807 "C<guestfs_available> instead."
31811 #: ../src/guestfs-actions.pod:7505
31813 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31814 "error. I<The caller must call C<guestfs_free_version> after use>."
31818 #: ../src/guestfs-actions.pod:7509
31819 msgid "(Added in 1.0.58)"
31823 #: ../src/guestfs-actions.pod:7511
31824 msgid "guestfs_vfs_label"
31828 #: ../src/guestfs-actions.pod:7513
31832 " guestfs_vfs_label (guestfs_h *g,\n"
31833 " const char *device);\n"
31838 #: ../src/guestfs-actions.pod:7522
31839 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31843 #: ../src/guestfs-actions.pod:7527 ../src/guestfs-actions.pod:7564
31844 msgid "(Added in 1.3.18)"
31848 #: ../src/guestfs-actions.pod:7529
31849 msgid "guestfs_vfs_type"
31853 #: ../src/guestfs-actions.pod:7531
31857 " guestfs_vfs_type (guestfs_h *g,\n"
31858 " const char *device);\n"
31863 #: ../src/guestfs-actions.pod:7548
31864 msgid "guestfs_vfs_uuid"
31868 #: ../src/guestfs-actions.pod:7550
31872 " guestfs_vfs_uuid (guestfs_h *g,\n"
31873 " const char *device);\n"
31878 #: ../src/guestfs-actions.pod:7559
31879 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31883 #: ../src/guestfs-actions.pod:7566
31884 msgid "guestfs_vg_activate"
31888 #: ../src/guestfs-actions.pod:7568
31892 " guestfs_vg_activate (guestfs_h *g,\n"
31894 " char *const *volgroups);\n"
31899 #: ../src/guestfs-actions.pod:7585
31900 msgid "guestfs_vg_activate_all"
31904 #: ../src/guestfs-actions.pod:7587
31908 " guestfs_vg_activate_all (guestfs_h *g,\n"
31909 " int activate);\n"
31914 #: ../src/guestfs-actions.pod:7600
31915 msgid "guestfs_vgcreate"
31919 #: ../src/guestfs-actions.pod:7602
31923 " guestfs_vgcreate (guestfs_h *g,\n"
31924 " const char *volgroup,\n"
31925 " char *const *physvols);\n"
31930 #: ../src/guestfs-actions.pod:7614
31931 msgid "guestfs_vglvuuids"
31935 #: ../src/guestfs-actions.pod:7616
31939 " guestfs_vglvuuids (guestfs_h *g,\n"
31940 " const char *vgname);\n"
31945 #: ../src/guestfs-actions.pod:7623
31947 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31948 "associate logical volumes and volume groups."
31952 #: ../src/guestfs-actions.pod:7626
31953 msgid "See also C<guestfs_vgpvuuids>."
31957 #: ../src/guestfs-actions.pod:7634
31958 msgid "guestfs_vgpvuuids"
31962 #: ../src/guestfs-actions.pod:7636
31966 " guestfs_vgpvuuids (guestfs_h *g,\n"
31967 " const char *vgname);\n"
31972 #: ../src/guestfs-actions.pod:7643
31974 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31975 "associate physical volumes and volume groups."
31979 #: ../src/guestfs-actions.pod:7646
31980 msgid "See also C<guestfs_vglvuuids>."
31984 #: ../src/guestfs-actions.pod:7654
31985 msgid "guestfs_vgremove"
31989 #: ../src/guestfs-actions.pod:7656
31993 " guestfs_vgremove (guestfs_h *g,\n"
31994 " const char *vgname);\n"
31999 #: ../src/guestfs-actions.pod:7669
32000 msgid "guestfs_vgrename"
32004 #: ../src/guestfs-actions.pod:7671
32008 " guestfs_vgrename (guestfs_h *g,\n"
32009 " const char *volgroup,\n"
32010 " const char *newvolgroup);\n"
32015 #: ../src/guestfs-actions.pod:7682
32016 msgid "guestfs_vgs"
32020 #: ../src/guestfs-actions.pod:7684
32024 " guestfs_vgs (guestfs_h *g);\n"
32029 #: ../src/guestfs-actions.pod:7693
32030 msgid "See also C<guestfs_vgs_full>."
32034 #: ../src/guestfs-actions.pod:7701
32035 msgid "guestfs_vgs_full"
32039 #: ../src/guestfs-actions.pod:7703
32042 " struct guestfs_lvm_vg_list *\n"
32043 " guestfs_vgs_full (guestfs_h *g);\n"
32048 #: ../src/guestfs-actions.pod:7709
32050 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32051 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
32055 #: ../src/guestfs-actions.pod:7715
32056 msgid "guestfs_vgscan"
32060 #: ../src/guestfs-actions.pod:7717
32064 " guestfs_vgscan (guestfs_h *g);\n"
32069 #: ../src/guestfs-actions.pod:7727
32070 msgid "guestfs_vguuid"
32074 #: ../src/guestfs-actions.pod:7729
32078 " guestfs_vguuid (guestfs_h *g,\n"
32079 " const char *vgname);\n"
32084 #: ../src/guestfs-actions.pod:7740
32085 msgid "guestfs_wait_ready"
32089 #: ../src/guestfs-actions.pod:7742
32093 " guestfs_wait_ready (guestfs_h *g);\n"
32098 #: ../src/guestfs-actions.pod:7745
32100 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32105 #: ../src/guestfs-actions.pod:7752
32106 msgid "This function is a no op."
32110 #: ../src/guestfs-actions.pod:7754
32112 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32113 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32114 "is no longer necessary because C<guestfs_launch> now does the waiting."
32118 #: ../src/guestfs-actions.pod:7759
32120 "If you see any calls to this function in code then you can just remove them, "
32121 "unless you want to retain compatibility with older versions of the API."
32125 #: ../src/guestfs-actions.pod:7767
32126 msgid "guestfs_wc_c"
32130 #: ../src/guestfs-actions.pod:7769
32134 " guestfs_wc_c (guestfs_h *g,\n"
32135 " const char *path);\n"
32140 #: ../src/guestfs-actions.pod:7780
32141 msgid "guestfs_wc_l"
32145 #: ../src/guestfs-actions.pod:7782
32149 " guestfs_wc_l (guestfs_h *g,\n"
32150 " const char *path);\n"
32155 #: ../src/guestfs-actions.pod:7793
32156 msgid "guestfs_wc_w"
32160 #: ../src/guestfs-actions.pod:7795
32164 " guestfs_wc_w (guestfs_h *g,\n"
32165 " const char *path);\n"
32170 #: ../src/guestfs-actions.pod:7806
32171 msgid "guestfs_write"
32175 #: ../src/guestfs-actions.pod:7808
32179 " guestfs_write (guestfs_h *g,\n"
32180 " const char *path,\n"
32181 " const char *content,\n"
32182 " size_t content_size);\n"
32187 #: ../src/guestfs-actions.pod:7817
32188 msgid "See also C<guestfs_write_append>."
32192 #: ../src/guestfs-actions.pod:7826
32193 msgid "guestfs_write_append"
32197 #: ../src/guestfs-actions.pod:7828
32201 " guestfs_write_append (guestfs_h *g,\n"
32202 " const char *path,\n"
32203 " const char *content,\n"
32204 " size_t content_size);\n"
32209 #: ../src/guestfs-actions.pod:7837
32210 msgid "See also C<guestfs_write>."
32214 #: ../src/guestfs-actions.pod:7846
32215 msgid "guestfs_write_file"
32219 #: ../src/guestfs-actions.pod:7848
32223 " guestfs_write_file (guestfs_h *g,\n"
32224 " const char *path,\n"
32225 " const char *content,\n"
32231 #: ../src/guestfs-actions.pod:7854
32233 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32238 #: ../src/guestfs-actions.pod:7879
32239 msgid "guestfs_zegrep"
32243 #: ../src/guestfs-actions.pod:7881
32247 " guestfs_zegrep (guestfs_h *g,\n"
32248 " const char *regex,\n"
32249 " const char *path);\n"
32254 #: ../src/guestfs-actions.pod:7898
32255 msgid "guestfs_zegrepi"
32259 #: ../src/guestfs-actions.pod:7900
32263 " guestfs_zegrepi (guestfs_h *g,\n"
32264 " const char *regex,\n"
32265 " const char *path);\n"
32270 #: ../src/guestfs-actions.pod:7917
32271 msgid "guestfs_zero"
32275 #: ../src/guestfs-actions.pod:7919
32279 " guestfs_zero (guestfs_h *g,\n"
32280 " const char *device);\n"
32285 #: ../src/guestfs-actions.pod:7933
32287 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32288 "C<guestfs_is_zero_device>"
32292 #: ../src/guestfs-actions.pod:7945
32293 msgid "guestfs_zero_device"
32297 #: ../src/guestfs-actions.pod:7947
32301 " guestfs_zero_device (guestfs_h *g,\n"
32302 " const char *device);\n"
32307 #: ../src/guestfs-actions.pod:7951
32309 "This command writes zeroes over the entire C<device>. Compare with "
32310 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32314 #: ../src/guestfs-actions.pod:7969
32315 msgid "(Added in 1.3.1)"
32319 #: ../src/guestfs-actions.pod:7971
32320 msgid "guestfs_zerofree"
32324 #: ../src/guestfs-actions.pod:7973
32328 " guestfs_zerofree (guestfs_h *g,\n"
32329 " const char *device);\n"
32334 #: ../src/guestfs-actions.pod:7992
32335 msgid "guestfs_zfgrep"
32339 #: ../src/guestfs-actions.pod:7994
32343 " guestfs_zfgrep (guestfs_h *g,\n"
32344 " const char *pattern,\n"
32345 " const char *path);\n"
32350 #: ../src/guestfs-actions.pod:8011
32351 msgid "guestfs_zfgrepi"
32355 #: ../src/guestfs-actions.pod:8013
32359 " guestfs_zfgrepi (guestfs_h *g,\n"
32360 " const char *pattern,\n"
32361 " const char *path);\n"
32366 #: ../src/guestfs-actions.pod:8030
32367 msgid "guestfs_zfile"
32371 #: ../src/guestfs-actions.pod:8032
32375 " guestfs_zfile (guestfs_h *g,\n"
32376 " const char *meth,\n"
32377 " const char *path);\n"
32382 #: ../src/guestfs-actions.pod:8037
32384 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32389 #: ../src/guestfs-actions.pod:8049
32391 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32396 #: ../src/guestfs-actions.pod:8057
32397 msgid "guestfs_zgrep"
32401 #: ../src/guestfs-actions.pod:8059
32405 " guestfs_zgrep (guestfs_h *g,\n"
32406 " const char *regex,\n"
32407 " const char *path);\n"
32412 #: ../src/guestfs-actions.pod:8076
32413 msgid "guestfs_zgrepi"
32417 #: ../src/guestfs-actions.pod:8078
32421 " guestfs_zgrepi (guestfs_h *g,\n"
32422 " const char *regex,\n"
32423 " const char *path);\n"
32428 #: ../src/guestfs-availability.pod:3
32433 #: ../src/guestfs-availability.pod:5
32435 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
32436 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
32437 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
32438 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
32439 "L</guestfs_aug_save> L</guestfs_aug_set>"
32443 #: ../src/guestfs-availability.pod:21
32448 #: ../src/guestfs-availability.pod:23
32449 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32453 #: ../src/guestfs-availability.pod:26
32458 #: ../src/guestfs-availability.pod:28
32459 msgid "The following functions: L</guestfs_grub_install>"
32463 #: ../src/guestfs-availability.pod:31
32468 #: ../src/guestfs-availability.pod:33
32470 "The following functions: L</guestfs_inotify_add_watch> L</"
32471 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
32472 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32476 #: ../src/guestfs-availability.pod:41
32477 msgid "B<linuxfsuuid>"
32481 #: ../src/guestfs-availability.pod:43
32483 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
32484 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32488 #: ../src/guestfs-availability.pod:50
32489 msgid "B<linuxmodules>"
32493 #: ../src/guestfs-availability.pod:52
32494 msgid "The following functions: L</guestfs_modprobe>"
32498 #: ../src/guestfs-availability.pod:55
32499 msgid "B<linuxxattrs>"
32503 #: ../src/guestfs-availability.pod:57
32505 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
32506 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
32507 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
32508 "guestfs_setxattr>"
32512 #: ../src/guestfs-availability.pod:68
32517 #: ../src/guestfs-availability.pod:70
32519 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
32520 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
32521 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32525 #: ../src/guestfs-availability.pod:79
32530 #: ../src/guestfs-availability.pod:81
32532 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
32533 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
32534 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
32535 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
32536 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
32537 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
32538 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
32542 #: ../src/guestfs-availability.pod:104
32547 #: ../src/guestfs-availability.pod:106
32549 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
32550 "guestfs_mknod_b> L</guestfs_mknod_c>"
32554 #: ../src/guestfs-availability.pod:112
32559 #: ../src/guestfs-availability.pod:114
32560 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
32564 #: ../src/guestfs-availability.pod:117
32565 msgid "B<ntfsprogs>"
32569 #: ../src/guestfs-availability.pod:119
32571 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
32572 "L</guestfs_ntfsresize_size>"
32576 #: ../src/guestfs-availability.pod:124
32577 msgid "B<realpath>"
32581 #: ../src/guestfs-availability.pod:126
32582 msgid "The following functions: L</guestfs_realpath>"
32586 #: ../src/guestfs-availability.pod:129
32591 #: ../src/guestfs-availability.pod:131
32593 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
32594 "guestfs_scrub_freespace>"
32598 #: ../src/guestfs-availability.pod:136
32603 #: ../src/guestfs-availability.pod:138
32604 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32608 #: ../src/guestfs-availability.pod:142
32613 #: ../src/guestfs-availability.pod:144
32614 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32618 #: ../src/guestfs-availability.pod:148
32619 msgid "B<zerofree>"
32623 #: ../src/guestfs-availability.pod:150
32624 msgid "The following functions: L</guestfs_zerofree>"
32628 #: ../src/guestfs-structs.pod:1
32629 msgid "guestfs_int_bool"
32633 #: ../src/guestfs-structs.pod:3
32636 " struct guestfs_int_bool {\n"
32644 #: ../src/guestfs-structs.pod:8
32647 " struct guestfs_int_bool_list {\n"
32648 " uint32_t len; /* Number of elements in list. */\n"
32649 " struct guestfs_int_bool *val; /* Elements. */\n"
32655 #: ../src/guestfs-structs.pod:13
32658 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32659 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32664 #: ../src/guestfs-structs.pod:16
32665 msgid "guestfs_lvm_pv"
32669 #: ../src/guestfs-structs.pod:18
32672 " struct guestfs_lvm_pv {\n"
32673 " char *pv_name;\n"
32674 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
32675 " char pv_uuid[32];\n"
32677 " uint64_t pv_size;\n"
32678 " uint64_t dev_size;\n"
32679 " uint64_t pv_free;\n"
32680 " uint64_t pv_used;\n"
32681 " char *pv_attr;\n"
32682 " int64_t pv_pe_count;\n"
32683 " int64_t pv_pe_alloc_count;\n"
32684 " char *pv_tags;\n"
32685 " uint64_t pe_start;\n"
32686 " int64_t pv_mda_count;\n"
32687 " uint64_t pv_mda_free;\n"
32693 #: ../src/guestfs-structs.pod:36
32696 " struct guestfs_lvm_pv_list {\n"
32697 " uint32_t len; /* Number of elements in list. */\n"
32698 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32704 #: ../src/guestfs-structs.pod:41
32707 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32708 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32713 #: ../src/guestfs-structs.pod:44
32714 msgid "guestfs_lvm_vg"
32718 #: ../src/guestfs-structs.pod:46
32721 " struct guestfs_lvm_vg {\n"
32722 " char *vg_name;\n"
32723 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
32724 " char vg_uuid[32];\n"
32726 " char *vg_attr;\n"
32727 " uint64_t vg_size;\n"
32728 " uint64_t vg_free;\n"
32729 " char *vg_sysid;\n"
32730 " uint64_t vg_extent_size;\n"
32731 " int64_t vg_extent_count;\n"
32732 " int64_t vg_free_count;\n"
32733 " int64_t max_lv;\n"
32734 " int64_t max_pv;\n"
32735 " int64_t pv_count;\n"
32736 " int64_t lv_count;\n"
32737 " int64_t snap_count;\n"
32738 " int64_t vg_seqno;\n"
32739 " char *vg_tags;\n"
32740 " int64_t vg_mda_count;\n"
32741 " uint64_t vg_mda_free;\n"
32747 #: ../src/guestfs-structs.pod:69
32750 " struct guestfs_lvm_vg_list {\n"
32751 " uint32_t len; /* Number of elements in list. */\n"
32752 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32758 #: ../src/guestfs-structs.pod:74
32761 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32762 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32767 #: ../src/guestfs-structs.pod:77
32768 msgid "guestfs_lvm_lv"
32772 #: ../src/guestfs-structs.pod:79
32775 " struct guestfs_lvm_lv {\n"
32776 " char *lv_name;\n"
32777 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
32778 " char lv_uuid[32];\n"
32779 " char *lv_attr;\n"
32780 " int64_t lv_major;\n"
32781 " int64_t lv_minor;\n"
32782 " int64_t lv_kernel_major;\n"
32783 " int64_t lv_kernel_minor;\n"
32784 " uint64_t lv_size;\n"
32785 " int64_t seg_count;\n"
32787 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32788 " float snap_percent;\n"
32789 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32790 " float copy_percent;\n"
32791 " char *move_pv;\n"
32792 " char *lv_tags;\n"
32793 " char *mirror_log;\n"
32794 " char *modules;\n"
32800 #: ../src/guestfs-structs.pod:101
32803 " struct guestfs_lvm_lv_list {\n"
32804 " uint32_t len; /* Number of elements in list. */\n"
32805 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32811 #: ../src/guestfs-structs.pod:106
32814 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32815 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32820 #: ../src/guestfs-structs.pod:111
32823 " struct guestfs_stat {\n"
32827 " int64_t nlink;\n"
32832 " int64_t blksize;\n"
32833 " int64_t blocks;\n"
32834 " int64_t atime;\n"
32835 " int64_t mtime;\n"
32836 " int64_t ctime;\n"
32842 #: ../src/guestfs-structs.pod:127
32845 " struct guestfs_stat_list {\n"
32846 " uint32_t len; /* Number of elements in list. */\n"
32847 " struct guestfs_stat *val; /* Elements. */\n"
32853 #: ../src/guestfs-structs.pod:132
32856 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32857 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32862 #: ../src/guestfs-structs.pod:137
32865 " struct guestfs_statvfs {\n"
32866 " int64_t bsize;\n"
32867 " int64_t frsize;\n"
32868 " int64_t blocks;\n"
32869 " int64_t bfree;\n"
32870 " int64_t bavail;\n"
32871 " int64_t files;\n"
32872 " int64_t ffree;\n"
32873 " int64_t favail;\n"
32876 " int64_t namemax;\n"
32882 #: ../src/guestfs-structs.pod:151
32885 " struct guestfs_statvfs_list {\n"
32886 " uint32_t len; /* Number of elements in list. */\n"
32887 " struct guestfs_statvfs *val; /* Elements. */\n"
32893 #: ../src/guestfs-structs.pod:156
32896 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32897 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32902 #: ../src/guestfs-structs.pod:159
32903 msgid "guestfs_dirent"
32907 #: ../src/guestfs-structs.pod:161
32910 " struct guestfs_dirent {\n"
32919 #: ../src/guestfs-structs.pod:167
32922 " struct guestfs_dirent_list {\n"
32923 " uint32_t len; /* Number of elements in list. */\n"
32924 " struct guestfs_dirent *val; /* Elements. */\n"
32930 #: ../src/guestfs-structs.pod:172
32933 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32934 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32939 #: ../src/guestfs-structs.pod:177
32942 " struct guestfs_version {\n"
32943 " int64_t major;\n"
32944 " int64_t minor;\n"
32945 " int64_t release;\n"
32952 #: ../src/guestfs-structs.pod:184
32955 " struct guestfs_version_list {\n"
32956 " uint32_t len; /* Number of elements in list. */\n"
32957 " struct guestfs_version *val; /* Elements. */\n"
32963 #: ../src/guestfs-structs.pod:189
32966 " void guestfs_free_version (struct guestfs_free_version *);\n"
32967 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32972 #: ../src/guestfs-structs.pod:192
32973 msgid "guestfs_xattr"
32977 #: ../src/guestfs-structs.pod:194
32980 " struct guestfs_xattr {\n"
32981 " char *attrname;\n"
32982 " /* The next two fields describe a byte array. */\n"
32983 " uint32_t attrval_len;\n"
32984 " char *attrval;\n"
32990 #: ../src/guestfs-structs.pod:201
32993 " struct guestfs_xattr_list {\n"
32994 " uint32_t len; /* Number of elements in list. */\n"
32995 " struct guestfs_xattr *val; /* Elements. */\n"
33001 #: ../src/guestfs-structs.pod:206
33004 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
33005 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
33010 #: ../src/guestfs-structs.pod:209
33011 msgid "guestfs_inotify_event"
33015 #: ../src/guestfs-structs.pod:211
33018 " struct guestfs_inotify_event {\n"
33019 " int64_t in_wd;\n"
33020 " uint32_t in_mask;\n"
33021 " uint32_t in_cookie;\n"
33022 " char *in_name;\n"
33028 #: ../src/guestfs-structs.pod:218
33031 " struct guestfs_inotify_event_list {\n"
33032 " uint32_t len; /* Number of elements in list. */\n"
33033 " struct guestfs_inotify_event *val; /* Elements. */\n"
33039 #: ../src/guestfs-structs.pod:223
33042 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33043 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
33048 #: ../src/guestfs-structs.pod:226
33049 msgid "guestfs_partition"
33053 #: ../src/guestfs-structs.pod:228
33056 " struct guestfs_partition {\n"
33057 " int32_t part_num;\n"
33058 " uint64_t part_start;\n"
33059 " uint64_t part_end;\n"
33060 " uint64_t part_size;\n"
33066 #: ../src/guestfs-structs.pod:235
33069 " struct guestfs_partition_list {\n"
33070 " uint32_t len; /* Number of elements in list. */\n"
33071 " struct guestfs_partition *val; /* Elements. */\n"
33077 #: ../src/guestfs-structs.pod:240
33080 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33081 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33086 #: ../src/guestfs-structs.pod:243
33087 msgid "guestfs_application"
33091 #: ../src/guestfs-structs.pod:245
33094 " struct guestfs_application {\n"
33095 " char *app_name;\n"
33096 " char *app_display_name;\n"
33097 " int32_t app_epoch;\n"
33098 " char *app_version;\n"
33099 " char *app_release;\n"
33100 " char *app_install_path;\n"
33101 " char *app_trans_path;\n"
33102 " char *app_publisher;\n"
33103 " char *app_url;\n"
33104 " char *app_source_package;\n"
33105 " char *app_summary;\n"
33106 " char *app_description;\n"
33112 #: ../src/guestfs-structs.pod:260
33115 " struct guestfs_application_list {\n"
33116 " uint32_t len; /* Number of elements in list. */\n"
33117 " struct guestfs_application *val; /* Elements. */\n"
33123 #: ../src/guestfs-structs.pod:265
33126 " void guestfs_free_application (struct guestfs_free_application *);\n"
33127 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
33132 #: ../src/guestfs.pod:5
33133 msgid "guestfs - Library for accessing and modifying virtual machine images"
33137 #: ../src/guestfs.pod:11
33140 " guestfs_h *g = guestfs_create ();\n"
33141 " guestfs_add_drive (g, \"guest.img\");\n"
33142 " guestfs_launch (g);\n"
33143 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33144 " guestfs_touch (g, \"/hello\");\n"
33145 " guestfs_umount (g, \"/\");\n"
33146 " guestfs_close (g);\n"
33151 #: ../src/guestfs.pod:25
33153 "Libguestfs is a library for accessing and modifying guest disk images. "
33154 "Amongst the things this is good for: making batch configuration changes to "
33155 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33156 "between virtualization systems (see also: virt-p2v), performing partial "
33157 "backups, performing partial guest clones, cloning guests and changing "
33158 "registry/UUID/hostname info, and much else besides."
33162 #: ../src/guestfs.pod:33
33164 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33165 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33166 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33171 #: ../src/guestfs.pod:38
33173 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33174 "what filesystem is in each LV, etc.). It can also run commands in the "
33175 "context of the guest. Also you can access filesystems over FUSE."
33179 #: ../src/guestfs.pod:43
33181 "Libguestfs is a library that can be linked with C and C++ management "
33182 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33183 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33188 #: ../src/guestfs.pod:48
33190 "You don't need to be root to use libguestfs, although obviously you do need "
33191 "enough permissions to access the disk images."
33195 #: ../src/guestfs.pod:51
33197 "Libguestfs is a large API because it can do many things. For a gentle "
33198 "introduction, please read the L</API OVERVIEW> section next."
33202 #: ../src/guestfs.pod:54
33204 "There are also some example programs in the L<guestfs-examples(3)> manual "
33209 #: ../src/guestfs.pod:57
33210 msgid "API OVERVIEW"
33214 #: ../src/guestfs.pod:59
33216 "This section provides a gentler overview of the libguestfs API. We also try "
33217 "to group API calls together, where that may not be obvious from reading "
33218 "about the individual calls in the main section of this manual."
33222 #: ../src/guestfs.pod:64
33227 #: ../src/guestfs.pod:66
33229 "Before you can use libguestfs calls, you have to create a handle. Then you "
33230 "must add at least one disk image to the handle, followed by launching the "
33231 "handle, then performing whatever operations you want, and finally closing "
33232 "the handle. By convention we use the single letter C<g> for the name of the "
33233 "handle variable, although of course you can use any name you want."
33237 #: ../src/guestfs.pod:73
33238 msgid "The general structure of all libguestfs-using programs looks like this:"
33242 #: ../src/guestfs.pod:76
33245 " guestfs_h *g = guestfs_create ();\n"
33250 #: ../src/guestfs.pod:78
33253 " /* Call guestfs_add_drive additional times if there are\n"
33254 " * multiple disk images.\n"
33256 " guestfs_add_drive (g, \"guest.img\");\n"
33261 #: ../src/guestfs.pod:83
33264 " /* Most manipulation calls won't work until you've launched\n"
33265 " * the handle 'g'. You have to do this _after_ adding drives\n"
33266 " * and _before_ other commands.\n"
33268 " guestfs_launch (g);\n"
33273 #: ../src/guestfs.pod:89
33276 " /* Now you can examine what partitions, LVs etc are available.\n"
33278 " char **partitions = guestfs_list_partitions (g);\n"
33279 " char **logvols = guestfs_lvs (g);\n"
33284 #: ../src/guestfs.pod:94
33287 " /* To access a filesystem in the image, you must mount it.\n"
33289 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33294 #: ../src/guestfs.pod:98
33297 " /* Now you can perform filesystem actions on the guest\n"
33300 " guestfs_touch (g, \"/hello\");\n"
33305 #: ../src/guestfs.pod:103
33308 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33309 " * it is done automatically when you close the handle. See\n"
33310 " * discussion of autosync in this page.\n"
33312 " guestfs_sync (g);\n"
33317 #: ../src/guestfs.pod:109
33320 " /* Close the handle 'g'. */\n"
33321 " guestfs_close (g);\n"
33326 #: ../src/guestfs.pod:112
33328 "The code above doesn't include any error checking. In real code you should "
33329 "check return values carefully for errors. In general all functions that "
33330 "return integers return C<-1> on error, and all functions that return "
33331 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33332 "how to handle errors, and consult the documentation for each function call "
33333 "below to see precisely how they return error indications. See L<guestfs-"
33334 "examples(3)> for fully worked examples."
33338 #: ../src/guestfs.pod:121
33339 msgid "DISK IMAGES"
33343 #: ../src/guestfs.pod:123
33345 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33346 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33347 "actual block device, or simply an empty file of zeroes that you have created "
33348 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33353 #: ../src/guestfs.pod:129
33355 "The call you should use in modern code for adding drives is L</"
33356 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33357 "specifying that the format is raw, do:"
33361 #: ../src/guestfs.pod:133
33364 " guestfs_add_drive_opts (g, filename,\n"
33365 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33371 #: ../src/guestfs.pod:137
33372 msgid "You can add a disk read-only using:"
33376 #: ../src/guestfs.pod:139
33379 " guestfs_add_drive_opts (g, filename,\n"
33380 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33381 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33387 #: ../src/guestfs.pod:144
33389 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33390 "libguestfs won't modify the file."
33394 #: ../src/guestfs.pod:147
33396 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33397 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33398 "corruption, but adding it read-only is safe."
33402 #: ../src/guestfs.pod:151
33404 "You must add at least one disk image, and you may add multiple disk images. "
33405 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33406 "first one you added), C</dev/sdb> (for the second one you added), etc."
33410 #: ../src/guestfs.pod:156
33412 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33413 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33414 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33418 #: ../src/guestfs.pod:161
33423 #: ../src/guestfs.pod:163
33425 "Before you can read or write files, create directories and so on in a disk "
33426 "image that contains filesystems, you have to mount those filesystems using "
33427 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33428 "a disk image contains (for example) one partition with a filesystem on that "
33429 "partition, then you can mount it directly:"
33433 #: ../src/guestfs.pod:170
33436 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33441 #: ../src/guestfs.pod:172
33443 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33444 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33445 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33446 "that these are libguestfs virtual devices, and are nothing to do with host "
33451 #: ../src/guestfs.pod:178
33453 "If you are given a disk image and you don't know what it contains then you "
33454 "have to find out. Libguestfs can do that too: use L</"
33455 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
33456 "LVs, and either try mounting each to see what is mountable, or else examine "
33457 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33458 "filesystems, use L</guestfs_list_filesystems>."
33462 #: ../src/guestfs.pod:186
33464 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33465 "L</INSPECTION> below). But you might find it easier to look at higher level "
33466 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33470 #: ../src/guestfs.pod:191
33472 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33473 "several other variations of the C<guestfs_mount_*> call."
33477 #: ../src/guestfs.pod:194
33478 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33482 #: ../src/guestfs.pod:196
33484 "The majority of the libguestfs API consists of fairly low-level calls for "
33485 "accessing and modifying the files, directories, symlinks etc on mounted "
33486 "filesystems. There are over a hundred such calls which you can find listed "
33487 "in detail below in this man page, and we don't even pretend to cover them "
33488 "all in this overview."
33492 #: ../src/guestfs.pod:202
33494 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33499 #: ../src/guestfs.pod:205
33501 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33502 "the file called C<\"etc/passwd\"> then you could do:"
33506 #: ../src/guestfs.pod:208
33509 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33514 #: ../src/guestfs.pod:210
33516 "This would return C<data> as a newly allocated buffer containing the full "
33517 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33518 "or C<NULL> if there was an error."
33522 #: ../src/guestfs.pod:214
33524 "As another example, to create a top-level directory on that filesystem "
33525 "called C<\"var\"> you would do:"
33529 #: ../src/guestfs.pod:217
33532 " guestfs_mkdir (g, \"/var\");\n"
33537 #: ../src/guestfs.pod:219
33538 msgid "To create a symlink you could do:"
33542 #: ../src/guestfs.pod:221
33545 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33546 " \"/etc/rc3.d/S30portmap\");\n"
33551 #: ../src/guestfs.pod:224
33553 "Libguestfs will reject attempts to use relative paths and there is no "
33554 "concept of a current working directory."
33558 #: ../src/guestfs.pod:227
33560 "Libguestfs can return errors in many situations: for example if the "
33561 "filesystem isn't writable, or if a file or directory that you requested "
33562 "doesn't exist. If you are using the C API (documented here) you have to "
33563 "check for those error conditions after each call. (Other language bindings "
33564 "turn these errors into exceptions)."
33568 #: ../src/guestfs.pod:233
33570 "File writes are affected by the per-handle umask, set by calling L</"
33571 "guestfs_umask> and defaulting to 022. See L</UMASK>."
33575 #: ../src/guestfs.pod:236
33576 msgid "PARTITIONING"
33580 #: ../src/guestfs.pod:238
33582 "Libguestfs contains API calls to read, create and modify partition tables on "
33587 #: ../src/guestfs.pod:241
33589 "In the common case where you want to create a single partition covering the "
33590 "whole disk, you should use the L</guestfs_part_disk> call:"
33594 #: ../src/guestfs.pod:245
33597 " const char *parttype = \"mbr\";\n"
33598 " if (disk_is_larger_than_2TB)\n"
33599 " parttype = \"gpt\";\n"
33600 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33605 #: ../src/guestfs.pod:250
33607 "Obviously this effectively wipes anything that was on that disk image before."
33611 #: ../src/guestfs.pod:253
33616 #: ../src/guestfs.pod:255
33618 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
33619 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
33620 "you familiarize yourself with the concepts of physical volumes, volume "
33621 "groups and logical volumes."
33625 #: ../src/guestfs.pod:260
33627 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
33628 "tldp.org/HOWTO/LVM-HOWTO/>."
33632 #: ../src/guestfs.pod:263
33633 msgid "DOWNLOADING"
33637 #: ../src/guestfs.pod:265
33639 "Use L</guestfs_cat> to download small, text only files. This call is "
33640 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33641 "NUL (C<\\0>) characters. However the API is very simple to use."
33645 #: ../src/guestfs.pod:269
33647 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33648 "bit data, since it returns a (pointer, size) pair. However it is still "
33649 "limited to \"small\" files, less than 2 MB."
33653 #: ../src/guestfs.pod:273
33655 "L</guestfs_download> can be used to download any file, with no limits on "
33656 "content or size (even files larger than 4 GB)."
33660 #: ../src/guestfs.pod:276
33662 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
33666 #: ../src/guestfs.pod:279
33671 #: ../src/guestfs.pod:281
33673 "It's often the case that you want to write a file or files to the disk image."
33677 #: ../src/guestfs.pod:284
33679 "To write a small file with fixed content, use L</guestfs_write>. To create "
33680 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
33681 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
33682 "of other functions for creating test files, for example L</guestfs_fill> and "
33683 "L</guestfs_fill_pattern>."
33687 #: ../src/guestfs.pod:290
33689 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33690 "file content or size (even files larger than 4 GB)."
33694 #: ../src/guestfs.pod:293
33696 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33700 #: ../src/guestfs.pod:295
33702 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33703 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
33704 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
33705 "in a predictable way (eg. adding it last after all other drives) then you "
33706 "can get the device name from L</guestfs_list_devices> and mount it directly "
33707 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
33708 "portable between kernel versions, and they don't support labels or UUIDs. "
33709 "If you want to pre-build an image or you need to mount it using a label or "
33710 "UUID, use an ISO image instead."
33714 #: ../src/guestfs.pod:306
33719 #: ../src/guestfs.pod:308
33721 "There are various different commands for copying between files and devices "
33722 "and in and out of the guest filesystem. These are summarised in the table "
33727 #: ../src/guestfs.pod:314
33728 msgid "B<file> to B<file>"
33732 #: ../src/guestfs.pod:316
33734 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33735 "directories recursively."
33739 #: ../src/guestfs.pod:319
33740 msgid "B<file or device> to B<file or device>"
33744 #: ../src/guestfs.pod:321
33746 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
33747 "devices in the guest."
33751 #: ../src/guestfs.pod:324
33752 msgid "Example: duplicate the contents of an LV:"
33756 #: ../src/guestfs.pod:326
33759 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
33764 #: ../src/guestfs.pod:328
33766 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33767 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
33768 "guestfs_copy_size>."
33772 #: ../src/guestfs.pod:332
33773 msgid "B<file on the host> to B<file or device>"
33777 #: ../src/guestfs.pod:334
33778 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33782 #: ../src/guestfs.pod:336
33783 msgid "B<file or device> to B<file on the host>"
33787 #: ../src/guestfs.pod:338
33788 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33792 #: ../src/guestfs.pod:342
33793 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33797 #: ../src/guestfs.pod:344
33799 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
33800 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33801 "appears you can only upload and download to files. However many Un*x-like "
33802 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
33803 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
33804 "and arbitrary file descriptor N."
33808 #: ../src/guestfs.pod:352
33809 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33813 #: ../src/guestfs.pod:355
33816 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33821 #: ../src/guestfs.pod:357
33822 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33826 #: ../src/guestfs.pod:359
33829 " char devfd[64];\n"
33830 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33831 " guestfs_tar_out (g, \"/\", devfd);\n"
33836 #: ../src/guestfs.pod:363
33837 msgid "LISTING FILES"
33841 #: ../src/guestfs.pod:365
33843 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33844 "L<guestfish(1)>-equivalent command C<ll>)."
33848 #: ../src/guestfs.pod:368
33850 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33851 "programs, as a flat list of strings."
33855 #: ../src/guestfs.pod:371
33857 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33858 "directory, plus additional information about each one. It is more "
33859 "equivalent to using the L<readdir(3)> call on a local filesystem."
33863 #: ../src/guestfs.pod:375
33865 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
33869 #: ../src/guestfs.pod:378
33870 msgid "RUNNING COMMANDS"
33874 #: ../src/guestfs.pod:380
33876 "Although libguestfs is primarily an API for manipulating files inside guest "
33877 "images, we also provide some limited facilities for running commands inside "
33882 #: ../src/guestfs.pod:384
33883 msgid "There are many limitations to this:"
33887 #: ../src/guestfs.pod:390
33889 "The kernel version that the command runs under will be different from what "
33894 #: ../src/guestfs.pod:395
33896 "If the command needs to communicate with daemons, then most likely they "
33897 "won't be running."
33901 #: ../src/guestfs.pod:400
33902 msgid "The command will be running in limited memory."
33906 #: ../src/guestfs.pod:404
33908 "The network may not be available unless you enable it (see L</"
33909 "guestfs_set_network>)."
33913 #: ../src/guestfs.pod:409
33914 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33918 #: ../src/guestfs.pod:413
33920 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33924 #: ../src/guestfs.pod:418
33926 "For SELinux guests, you may need to enable SELinux and load policy first. "
33927 "See L</SELINUX> in this manpage."
33931 #: ../src/guestfs.pod:423
33933 "I<Security:> It is not safe to run commands from untrusted, possibly "
33934 "malicious guests. These commands may attempt to exploit your program by "
33935 "sending unexpected output. They could also try to exploit the Linux kernel "
33936 "or qemu provided by the libguestfs appliance. They could use the network "
33937 "provided by the libguestfs appliance to bypass ordinary network partitions "
33938 "and firewalls. They could use the elevated privileges or different SELinux "
33939 "context of your program to their advantage."
33943 #: ../src/guestfs.pod:432
33945 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33946 "(a script which runs when the guest next boots normally), and to have this "
33947 "script run the commands you want in the normal context of the running guest, "
33948 "network security and so on. For information about other security issues, "
33949 "see L</SECURITY>."
33953 #: ../src/guestfs.pod:440
33955 "The two main API calls to run commands are L</guestfs_command> and L</"
33956 "guestfs_sh> (there are also variations)."
33960 #: ../src/guestfs.pod:443
33962 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33963 "shell globs, redirections, etc will work."
33967 #: ../src/guestfs.pod:446
33968 msgid "CONFIGURATION FILES"
33972 #: ../src/guestfs.pod:448
33974 "To read and write configuration files in Linux guest filesystems, we "
33975 "strongly recommend using Augeas. For example, Augeas understands how to "
33976 "read and write, say, a Linux shadow password file or X.org configuration "
33977 "file, and so avoids you having to write that code."
33981 #: ../src/guestfs.pod:453
33983 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33984 "document Augeas itself here because there is excellent documentation on the "
33985 "L<http://augeas.net/> website."
33989 #: ../src/guestfs.pod:457
33991 "If you don't want to use Augeas (you fool!) then try calling L</"
33992 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
33997 #: ../src/guestfs.pod:461
34002 #: ../src/guestfs.pod:463
34004 "We support SELinux guests. To ensure that labeling happens correctly in "
34005 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34009 #: ../src/guestfs.pod:471
34010 msgid "Before launching, do:"
34014 #: ../src/guestfs.pod:473
34017 " guestfs_set_selinux (g, 1);\n"
34022 #: ../src/guestfs.pod:477
34024 "After mounting the guest's filesystem(s), load the policy. This is best "
34025 "done by running the L<load_policy(8)> command in the guest itself:"
34029 #: ../src/guestfs.pod:481
34032 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34037 #: ../src/guestfs.pod:483
34039 "(Older versions of C<load_policy> require you to specify the name of the "
34044 #: ../src/guestfs.pod:488
34046 "Optionally, set the security context for the API. The correct security "
34047 "context to use can only be known by inspecting the guest. As an example:"
34051 #: ../src/guestfs.pod:492
34054 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34059 #: ../src/guestfs.pod:496
34060 msgid "This will work for running commands and editing existing files."
34064 #: ../src/guestfs.pod:498
34066 "When new files are created, you may need to label them explicitly, for "
34067 "example by running the external command C<restorecon pathname>."
34071 #: ../src/guestfs.pod:502
34076 #: ../src/guestfs.pod:504
34078 "Certain calls are affected by the current file mode creation mask (the "
34079 "\"umask\"). In particular ones which create files or directories, such as "
34080 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34081 "either the default mode that the file is created with or modifies the mode "
34086 #: ../src/guestfs.pod:510
34088 "The default umask is C<022>, so files are created with modes such as C<0644> "
34089 "and directories with C<0755>."
34093 #: ../src/guestfs.pod:513
34095 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34096 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
34097 "guestfs_chmod> after creating each file or directory."
34101 #: ../src/guestfs.pod:517
34102 msgid "For more information about umask, see L<umask(2)>."
34106 #: ../src/guestfs.pod:521
34108 "Libguestfs allows you to access Linux guests which have been encrypted using "
34109 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34110 "standard. This includes nearly all whole disk encryption systems used by "
34111 "modern Linux guests."
34115 #: ../src/guestfs.pod:527
34117 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34118 "returns the string C<crypto_LUKS>)."
34122 #: ../src/guestfs.pod:530
34124 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34125 "will require the passphrase!"
34129 #: ../src/guestfs.pod:533
34131 "Opening a LUKS device creates a new device mapper device called C</dev/"
34132 "mapper/mapname> (where C<mapname> is the string you supply to L</"
34133 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
34134 "from and encrypted to the underlying block device respectively."
34138 #: ../src/guestfs.pod:539
34140 "LVM volume groups on the device can be made visible by calling L</"
34141 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
34142 "(s) can now be mounted in the usual way."
34146 #: ../src/guestfs.pod:543
34148 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34149 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34150 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
34151 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34152 "underlying encrypted block device)."
34156 #: ../src/guestfs.pod:550
34161 #: ../src/guestfs.pod:552
34163 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34164 "contains operating systems, an install CD or a live CD. (These APIs used to "
34165 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34166 "version 1.5.3 the most frequently used part of this library has been "
34167 "rewritten in C and moved into the core code)."
34171 #: ../src/guestfs.pod:559
34173 "Add all disks belonging to the unknown virtual machine and call L</"
34174 "guestfs_launch> in the usual way."
34178 #: ../src/guestfs.pod:562
34180 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34181 "and certain heuristics, and returns a list of operating systems that were "
34182 "found. An empty list means none were found. A single element is the root "
34183 "filesystem of the operating system. For dual- or multi-boot guests, "
34184 "multiple roots can be returned, each one corresponding to a separate "
34185 "operating system. (Multi-boot virtual machines are extremely rare in the "
34186 "world of virtualization, but since this scenario can happen, we have built "
34187 "libguestfs to deal with it.)"
34191 #: ../src/guestfs.pod:571
34193 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34194 "to get additional details about that operating system. For example, call L</"
34195 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34196 "Windows and Linux-based operating systems respectively."
34200 #: ../src/guestfs.pod:577
34202 "Un*x-like and Linux-based operating systems usually consist of several "
34203 "filesystems which are mounted at boot time (for example, a separate boot "
34204 "partition mounted on C</boot>). The inspection rules are able to detect how "
34205 "filesystems correspond to mount points. Call "
34206 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34207 "hash table like this example:"
34211 #: ../src/guestfs.pod:584
34214 " /boot => /dev/sda1\n"
34215 " / => /dev/vg_guest/lv_root\n"
34216 " /usr => /dev/vg_guest/lv_usr\n"
34221 #: ../src/guestfs.pod:588
34223 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34224 "filesystems as suggested."
34228 #: ../src/guestfs.pod:591
34230 "Be careful to mount filesystems in the right order (eg. C</> before C</"
34231 "usr>). Sorting the keys of the hash by length, shortest first, should work."
34235 #: ../src/guestfs.pod:595
34237 "Inspection currently only works for some common operating systems. "
34238 "Contributors are welcome to send patches for other operating systems that we "
34239 "currently cannot detect."
34243 #: ../src/guestfs.pod:599
34245 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34246 "for more details. The L</guestfs_inspect_os> function just ignores any "
34247 "encrypted devices."
34251 #: ../src/guestfs.pod:603
34253 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34254 "inspection and caches the results in the guest handle. Subsequent calls to "
34255 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
34256 "read the disks. If you change the content of the guest disks, you can redo "
34257 "inspection by calling L</guestfs_inspect_os> again. (L</"
34258 "guestfs_inspect_list_applications> works a little differently from the other "
34259 "calls and does read the disks. See documentation for that function for "
34264 #: ../src/guestfs.pod:612
34265 msgid "INSPECTING INSTALL DISKS"
34269 #: ../src/guestfs.pod:614
34271 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34276 #: ../src/guestfs.pod:617
34278 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34279 "system, which currently can be C<installed> (a regular operating system) or "
34280 "C<installer> (some sort of install disk)."
34284 #: ../src/guestfs.pod:621
34286 "Further information is available about the operating system that can be "
34287 "installed using the regular inspection APIs like L</"
34288 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
34292 #: ../src/guestfs.pod:626
34294 "Some additional information specific to installer disks is also available "
34295 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
34296 "guestfs_inspect_is_multipart> calls."
34300 #: ../src/guestfs.pod:631
34301 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34305 #: ../src/guestfs.pod:633
34307 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
34308 "ntfs-3g.org/> driver."
34312 #: ../src/guestfs.pod:636
34313 msgid "DRIVE LETTERS AND PATHS"
34317 #: ../src/guestfs.pod:638
34319 "DOS and Windows still use drive letters, and the filesystems are always "
34320 "treated as case insensitive by Windows itself, and therefore you might find "
34321 "a Windows configuration file referring to a path like C<c:\\windows"
34322 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
34323 "might be referred to as C</WINDOWS/System32>."
34327 #: ../src/guestfs.pod:644
34329 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34330 "L</guestfs_inspect_get_drive_mappings>)"
34334 #: ../src/guestfs.pod:647
34336 "Dealing with separator characters (backslash vs forward slash) is outside "
34337 "the scope of libguestfs, but usually a simple character replacement will "
34342 #: ../src/guestfs.pod:651
34344 "To resolve the case insensitivity of paths, call L</"
34345 "guestfs_case_sensitive_path>."
34349 #: ../src/guestfs.pod:654
34350 msgid "ACCESSING THE WINDOWS REGISTRY"
34354 #: ../src/guestfs.pod:656
34356 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34357 "files, through the library C<hivex> which is part of the libguestfs project "
34358 "although ships as a separate tarball. You have to locate and download the "
34359 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34360 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
34361 "reg(1)> for more help on this issue."
34365 #: ../src/guestfs.pod:664
34366 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34370 #: ../src/guestfs.pod:666
34372 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34373 "provide something which looks like a Linux symlink. The way it tries to do "
34374 "the rewriting is described here:"
34378 #: ../src/guestfs.pod:670
34380 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
34385 #: ../src/guestfs.pod:672
34387 "The essential problem is that ntfs-3g simply does not have enough "
34388 "information to do a correct job. NTFS links can contain drive letters and "
34389 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34390 "It is almost certainly the case that libguestfs callers should ignore what "
34391 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34395 #: ../src/guestfs.pod:679
34397 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
34398 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34399 "attribute, and read the raw reparse data from that (you can find the format "
34400 "documented in various places around the web)."
34404 #: ../src/guestfs.pod:684
34405 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34409 #: ../src/guestfs.pod:686
34411 "There are other useful extended attributes that can be read from ntfs-3g "
34412 "filesystems (using L</guestfs_getxattr>). See:"
34416 #: ../src/guestfs.pod:689
34418 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34422 #: ../src/guestfs.pod:691
34423 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34427 #: ../src/guestfs.pod:693
34429 "Although we don't want to discourage you from using the C API, we will "
34430 "mention here that the same API is also available in other languages."
34434 #: ../src/guestfs.pod:696
34436 "The API is broadly identical in all supported languages. This means that "
34437 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34438 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34439 "OCaml. In other words, a straightforward, predictable isomorphism between "
34444 #: ../src/guestfs.pod:702
34446 "Error messages are automatically transformed into exceptions if the language "
34451 #: ../src/guestfs.pod:705
34453 "We don't try to \"object orientify\" parts of the API in OO languages, "
34454 "although contributors are welcome to write higher level APIs above what we "
34455 "provide in their favourite languages if they wish."
34459 #: ../src/guestfs.pod:711
34464 #: ../src/guestfs.pod:713
34466 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34467 "identical to the C API. C++ classes and exceptions are not used."
34471 #: ../src/guestfs.pod:717
34476 #: ../src/guestfs.pod:719
34478 "The C# bindings are highly experimental. Please read the warnings at the "
34479 "top of C<csharp/Libguestfs.cs>."
34483 #: ../src/guestfs.pod:722
34488 #: ../src/guestfs.pod:724
34489 msgid "See L<guestfs-erlang(3)>."
34493 #: ../src/guestfs.pod:726
34498 #: ../src/guestfs.pod:728
34500 "This is the only language binding that is working but incomplete. Only "
34501 "calls which return simple integers have been bound in Haskell, and we are "
34502 "looking for help to complete this binding."
34506 #: ../src/guestfs.pod:732
34511 #: ../src/guestfs.pod:734
34513 "Full documentation is contained in the Javadoc which is distributed with "
34514 "libguestfs. For examples, see L<guestfs-java(3)>."
34518 #: ../src/guestfs.pod:737
34523 #: ../src/guestfs.pod:739
34524 msgid "See L<guestfs-ocaml(3)>."
34528 #: ../src/guestfs.pod:741
34533 #: ../src/guestfs.pod:743
34534 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34538 #: ../src/guestfs.pod:745
34543 #: ../src/guestfs.pod:747
34545 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34546 "the php-libguestfs package for your distribution."
34550 #: ../src/guestfs.pod:750
34551 msgid "The PHP binding only works correctly on 64 bit machines."
34555 #: ../src/guestfs.pod:752
34560 #: ../src/guestfs.pod:754
34561 msgid "See L<guestfs-python(3)>."
34565 #: ../src/guestfs.pod:756
34570 #: ../src/guestfs.pod:758
34571 msgid "See L<guestfs-ruby(3)>."
34575 #: ../src/guestfs.pod:760
34576 msgid "B<shell scripts>"
34580 #: ../src/guestfs.pod:762
34581 msgid "See L<guestfish(1)>."
34585 #: ../src/guestfs.pod:766
34586 msgid "LIBGUESTFS GOTCHAS"
34590 #: ../src/guestfs.pod:768
34592 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34593 "system [...] that works in the way it is documented but is counterintuitive "
34594 "and almost invites mistakes.\""
34598 #: ../src/guestfs.pod:772
34600 "Since we developed libguestfs and the associated tools, there are several "
34601 "things we would have designed differently, but are now stuck with for "
34602 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34603 "release, you can expect these to change. Beware of them."
34607 #: ../src/guestfs.pod:780
34608 msgid "Autosync / forgetting to sync."
34612 #: ../src/guestfs.pod:782
34614 "I<Update:> Autosync is enabled by default for all API users starting from "
34615 "libguestfs 1.5.24. This section only applies to older versions."
34619 #: ../src/guestfs.pod:785
34621 "When modifying a filesystem from C or another language, you B<must> unmount "
34622 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34623 "libguestfs handle. You can also call:"
34627 #: ../src/guestfs.pod:789
34630 " guestfs_set_autosync (g, 1);\n"
34635 #: ../src/guestfs.pod:791
34637 "to have the unmount/sync done automatically for you when the handle 'g' is "
34638 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
34642 #: ../src/guestfs.pod:795
34644 "If you forget to do this, then it is entirely possible that your changes "
34645 "won't be written out, or will be partially written, or (very rarely) that "
34646 "you'll get disk corruption."
34650 #: ../src/guestfs.pod:799
34652 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34653 "guestfish scripts that forget to sync will work just fine, which can make "
34654 "this very puzzling if you are trying to debug a problem."
34658 #: ../src/guestfs.pod:803
34659 msgid "Mount option C<-o sync> should not be the default."
34663 #: ../src/guestfs.pod:805
34665 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
34666 "libguestfs 1.13.16. This section only applies to older versions."
34670 #: ../src/guestfs.pod:808
34672 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
34673 "However C<-o sync> does not add any reliability benefit, but does have a "
34674 "very large performance impact."
34678 #: ../src/guestfs.pod:812
34680 "The work around is to use L</guestfs_mount_options> and set the mount "
34681 "options that you actually want to use."
34685 #: ../src/guestfs.pod:815
34686 msgid "Read-only should be the default."
34690 #: ../src/guestfs.pod:817
34692 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34693 "specify I<--rw> if you want to make changes to the image."
34697 #: ../src/guestfs.pod:820
34698 msgid "This would reduce the potential to corrupt live VM images."
34702 #: ../src/guestfs.pod:822
34704 "Note that many filesystems change the disk when you just mount and unmount, "
34705 "even if you didn't perform any writes. You need to use L</"
34706 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
34710 #: ../src/guestfs.pod:826
34711 msgid "guestfish command line is hard to use."
34715 #: ../src/guestfs.pod:828
34717 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34718 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34719 "exist, so it fails. In earlier versions of guestfish the error message was "
34720 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34721 "we should have used C<guestfish -c command> to run commands."
34725 #: ../src/guestfs.pod:835
34726 msgid "guestfish megabyte modifiers don't work right on all commands"
34730 #: ../src/guestfs.pod:837
34732 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34733 "other modifiers). What guestfish actually does is to multiply the number "
34734 "part by the modifier part and pass the result to the C API. However this "
34735 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34736 "expecting some other unit (eg. megabytes)."
34740 #: ../src/guestfs.pod:844
34741 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34745 #: ../src/guestfs.pod:846
34748 " lvcreate LV VG 100M\n"
34753 #: ../src/guestfs.pod:848
34755 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34756 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34757 "megabytes * megabytes) logical volume. The error message you get from this "
34758 "is also a little obscure."
34762 #: ../src/guestfs.pod:853
34764 "This could be fixed in the generator by specially marking parameters and "
34765 "return values which take bytes or other units."
34769 #: ../src/guestfs.pod:856
34770 msgid "Ambiguity between devices and paths"
34774 #: ../src/guestfs.pod:858
34776 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
34777 "sdb2>) and a similar pathname. A file might just happen to be called "
34778 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34782 #: ../src/guestfs.pod:863
34784 "In the current API we usually resolve this ambiguity by having two separate "
34785 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34786 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34787 "detecting if the path supplied begins with C</dev/>."
34791 #: ../src/guestfs.pod:869
34793 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34794 "make paths/devices into structured names. One way to do this would be to "
34795 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34796 "aspect of grub. Another way would be to use a structured type, equivalent "
34797 "to this OCaml type:"
34801 #: ../src/guestfs.pod:875
34804 " type path = Path of string | Device of int | Partition of int * int\n"
34809 #: ../src/guestfs.pod:877
34810 msgid "which would allow you to pass arguments like:"
34814 #: ../src/guestfs.pod:879
34817 " Path \"/foo/bar\"\n"
34818 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34819 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34820 " Path \"/dev/sdb2\" (* not a device *)\n"
34825 #: ../src/guestfs.pod:884
34827 "As you can see there are still problems to resolve even with this "
34828 "representation. Also consider how it might work in guestfish."
34832 #: ../src/guestfs.pod:889
34833 msgid "KEYS AND PASSPHRASES"
34837 #: ../src/guestfs.pod:891
34839 "Certain libguestfs calls take a parameter that contains sensitive key "
34840 "material, passed in as a C string."
34844 #: ../src/guestfs.pod:894
34846 "In the future we would hope to change the libguestfs implementation so that "
34847 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34848 "swap. However this is I<not> done at the moment, because of the complexity "
34849 "of such an implementation."
34853 #: ../src/guestfs.pod:899
34855 "Therefore you should be aware that any key parameter you pass to libguestfs "
34856 "might end up being written out to the swap partition. If this is a concern, "
34857 "scrub the swap partition or don't use libguestfs on encrypted devices."
34861 #: ../src/guestfs.pod:904
34862 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34866 #: ../src/guestfs.pod:906
34868 "All high-level libguestfs actions are synchronous. If you want to use "
34869 "libguestfs asynchronously then you must create a thread."
34873 #: ../src/guestfs.pod:909
34875 "Only use the handle from a single thread. Either use the handle exclusively "
34876 "from one thread, or provide your own mutex so that two threads cannot issue "
34877 "calls on the same handle at the same time."
34881 #: ../src/guestfs.pod:913
34883 "See the graphical program guestfs-browser for one possible architecture for "
34884 "multithreaded programs using libvirt and libguestfs."
34888 #: ../src/guestfs.pod:916
34893 #: ../src/guestfs.pod:918
34895 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34900 #: ../src/guestfs.pod:921
34902 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
34903 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34907 #: ../src/guestfs.pod:924
34909 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34910 "to change the directories that libguestfs will search in. The value is a "
34911 "colon-separated list of paths. The current directory is I<not> searched "
34912 "unless the path contains an empty element or C<.>. For example "
34913 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34914 "then C</usr/lib/guestfs>."
34918 #: ../src/guestfs.pod:931
34919 msgid "QEMU WRAPPERS"
34923 #: ../src/guestfs.pod:933
34925 "If you want to compile your own qemu, run qemu from a non-standard location, "
34926 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34931 #: ../src/guestfs.pod:937
34933 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34934 "last command in the shell script (so that qemu replaces the shell and "
34935 "becomes the direct child of the libguestfs-using program). If you don't do "
34936 "this, then the qemu process won't be cleaned up correctly."
34940 #: ../src/guestfs.pod:942
34942 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34947 #: ../src/guestfs.pod:945
34951 " qemudir=/home/rjones/d/qemu\n"
34952 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
34957 #: ../src/guestfs.pod:949
34959 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34960 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34965 #: ../src/guestfs.pod:953
34968 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34973 #: ../src/guestfs.pod:955
34975 "Note that libguestfs also calls qemu with the -help and -version options in "
34976 "order to determine features."
34980 #: ../src/guestfs.pod:958
34982 "Wrappers can also be used to edit the options passed to qemu. In the "
34983 "following example, the C<-machine ...> option (C<-machine> and the following "
34984 "argument) are removed from the command line and replaced with C<-machine pc,"
34985 "accel=tcg>. The while loop iterates over the options until it finds the "
34986 "right one to remove, putting the remaining options into the C<args> array."
34990 #: ../src/guestfs.pod:967
34994 " while [ $# -gt 0 ]; do\n"
34995 " case \"$1\" in\n"
34999 " args[i]=\"$1\"\n"
35008 #: ../src/guestfs.pod:979
35011 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35016 #: ../src/guestfs.pod:981
35017 msgid "ATTACHING TO RUNNING DAEMONS"
35021 #: ../src/guestfs.pod:983
35023 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35024 "babies. Use with caution."
35028 #: ../src/guestfs.pod:986
35030 "I<Note (2):> This section explains how to attach to a running daemon from a "
35031 "low level perspective. For most users, simply using virt tools such as "
35032 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35036 #: ../src/guestfs.pod:990
35037 msgid "Using guestfs_set_attach_method"
35041 #: ../src/guestfs.pod:992
35043 "By calling L</guestfs_set_attach_method> you can change how the library "
35044 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
35045 "ARCHITECTURE> for some background)."
35049 #: ../src/guestfs.pod:996
35051 "The normal attach method is C<appliance>, where a small appliance is created "
35052 "containing the daemon, and then the library connects to this."
35056 #: ../src/guestfs.pod:999
35058 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35059 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35060 "daemon over the Unix domain socket."
35064 #: ../src/guestfs.pod:1003
35066 "The normal use for this is to connect to a running virtual machine that "
35067 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35068 "files inside the live virtual machine."
35072 #: ../src/guestfs.pod:1007
35073 msgid "Using guestfs_add_domain with live flag"
35077 #: ../src/guestfs.pod:1009
35079 "L</guestfs_add_domain> provides some help for getting the correct attach "
35080 "method. If you pass the C<live> option to this function, then (if the "
35081 "virtual machine is running) it will examine the libvirt XML looking for a "
35082 "virtio-serial channel to connect to:"
35086 #: ../src/guestfs.pod:1015
35093 " <channel type='unix'>\n"
35094 " <source mode='bind' path='/path/to/socket'/>\n"
35095 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35104 #: ../src/guestfs.pod:1027
35106 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35107 "method to C<unix:/path/to/socket>."
35111 #: ../src/guestfs.pod:1030
35113 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35114 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35115 "to attach to and modify live virtual machines."
35119 #: ../src/guestfs.pod:1034
35121 "The virtual machine needs to have been set up beforehand so that it has the "
35122 "virtio-serial channel and so that guestfsd is running inside it."
35126 #: ../src/guestfs.pod:1038
35127 msgid "ABI GUARANTEE"
35131 #: ../src/guestfs.pod:1040
35133 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35134 "actions as outlined in this section. Although we will deprecate some "
35135 "actions, for example if they get replaced by newer calls, we will keep the "
35136 "old actions forever. This allows you the developer to program in confidence "
35137 "against the libguestfs API."
35141 #: ../src/guestfs.pod:1046
35142 msgid "BLOCK DEVICE NAMING"
35146 #: ../src/guestfs.pod:1048
35148 "In the kernel there is now quite a profusion of schemata for naming block "
35149 "devices (in this context, by I<block device> I mean a physical or virtual "
35150 "hard drive). The original Linux IDE driver used names starting with C</dev/"
35151 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
35152 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
35153 "for the old IDE driver (particularly for SATA devices) those devices also "
35154 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
35155 "paravirtualized drivers. This has created several different naming systems, "
35156 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
35160 #: ../src/guestfs.pod:1060
35162 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35163 "Linux kernel to access block devices. We can run a variety of appliances "
35164 "based on a variety of Linux kernels."
35168 #: ../src/guestfs.pod:1064
35170 "This causes a problem for libguestfs because many API calls use device or "
35171 "partition names. Working scripts and the recipe (example) scripts that we "
35172 "make available over the internet could fail if the naming scheme changes."
35176 #: ../src/guestfs.pod:1069
35178 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35179 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35180 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35181 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35185 #: ../src/guestfs.pod:1075
35187 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35188 "L</guestfs_list_partitions> and similar calls return the true names of the "
35189 "devices and partitions as known to the appliance."
35193 #: ../src/guestfs.pod:1080
35194 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35198 #: ../src/guestfs.pod:1082
35200 "Usually this translation is transparent. However in some (very rare) cases "
35201 "you may need to know the exact algorithm. Such cases include where you use "
35202 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
35203 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
35207 #: ../src/guestfs.pod:1088
35209 "The algorithm is applied only to I<parameters> which are known to be either "
35210 "device or partition names. Return values from functions such as L</"
35211 "guestfs_list_devices> are never changed."
35215 #: ../src/guestfs.pod:1096
35216 msgid "Is the string a parameter which is a device or partition name?"
35220 #: ../src/guestfs.pod:1100
35221 msgid "Does the string begin with C</dev/sd>?"
35225 #: ../src/guestfs.pod:1104
35227 "Does the named device exist? If so, we use that device. However if I<not> "
35228 "then we continue with this algorithm."
35232 #: ../src/guestfs.pod:1109
35233 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35237 #: ../src/guestfs.pod:1111
35238 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35242 #: ../src/guestfs.pod:1113
35243 msgid "If that named device exists, use it. If not, continue."
35247 #: ../src/guestfs.pod:1117
35248 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35252 #: ../src/guestfs.pod:1119
35253 msgid "If that named device exists, use it. If not, return an error."
35257 #: ../src/guestfs.pod:1123
35258 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35262 #: ../src/guestfs.pod:1125
35264 "Although the standard naming scheme and automatic translation is useful for "
35265 "simple programs and guestfish scripts, for larger programs it is best not to "
35266 "rely on this mechanism."
35270 #: ../src/guestfs.pod:1129
35272 "Where possible for maximum future portability programs using libguestfs "
35273 "should use these future-proof techniques:"
35277 #: ../src/guestfs.pod:1136
35279 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35280 "device names, and then use those names directly."
35284 #: ../src/guestfs.pod:1139
35286 "Since those device names exist by definition, they will never be translated."
35290 #: ../src/guestfs.pod:1144
35292 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35293 "filesystem labels."
35297 #: ../src/guestfs.pod:1149
35302 #: ../src/guestfs.pod:1151
35304 "This section discusses security implications of using libguestfs, "
35305 "particularly with untrusted or malicious guests or disk images."
35309 #: ../src/guestfs.pod:1154
35310 msgid "GENERAL SECURITY CONSIDERATIONS"
35314 #: ../src/guestfs.pod:1156
35316 "Be careful with any files or data that you download from a guest (by "
35317 "\"download\" we mean not just the L</guestfs_download> command but any "
35318 "command that reads files, filenames, directories or anything else from a "
35319 "disk image). An attacker could manipulate the data to fool your program "
35320 "into doing the wrong thing. Consider cases such as:"
35324 #: ../src/guestfs.pod:1166
35325 msgid "the data (file etc) not being present"
35329 #: ../src/guestfs.pod:1170
35330 msgid "being present but empty"
35334 #: ../src/guestfs.pod:1174
35335 msgid "being much larger than normal"
35339 #: ../src/guestfs.pod:1178
35340 msgid "containing arbitrary 8 bit data"
35344 #: ../src/guestfs.pod:1182
35345 msgid "being in an unexpected character encoding"
35349 #: ../src/guestfs.pod:1186
35350 msgid "containing homoglyphs."
35354 #: ../src/guestfs.pod:1190
35355 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35359 #: ../src/guestfs.pod:1192
35361 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35362 "(VFS) module can sometimes be escalated into exploits by deliberately "
35363 "creating a malicious, malformed filesystem. These exploits are very severe "
35364 "for two reasons. Firstly there are very many filesystem drivers in the "
35365 "kernel, and many of them are infrequently used and not much developer "
35366 "attention has been paid to the code. Linux userspace helps potential "
35367 "crackers by detecting the filesystem type and automatically choosing the "
35368 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35369 "the administrator. Secondly, a kernel-level exploit is like a local root "
35370 "exploit (worse in some ways), giving immediate and total access to the "
35371 "system right down to the hardware level."
35375 #: ../src/guestfs.pod:1205
35377 "That explains why you should never mount a filesystem from an untrusted "
35378 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35379 "inside a qemu virtual machine, usually running as a non-root user. The "
35380 "attacker would need to write a filesystem which first exploited the kernel, "
35381 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35382 "the libguestfs protocol, and finally to be as serious as the host kernel "
35383 "exploit it would need to escalate its privileges to root. This multi-step "
35384 "escalation, performed by a static piece of data, is thought to be extremely "
35385 "hard to do, although we never say 'never' about security issues."
35389 #: ../src/guestfs.pod:1216
35391 "In any case callers can reduce the attack surface by forcing the filesystem "
35392 "type when mounting (use L</guestfs_mount_vfs>)."
35396 #: ../src/guestfs.pod:1219
35397 msgid "PROTOCOL SECURITY"
35401 #: ../src/guestfs.pod:1221
35403 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35404 "defined upper message size. However a program that uses libguestfs must "
35405 "also take care - for example you can write a program that downloads a binary "
35406 "from a disk image and executes it locally, and no amount of protocol "
35407 "security will save you from the consequences."
35411 #: ../src/guestfs.pod:1227
35412 msgid "INSPECTION SECURITY"
35416 #: ../src/guestfs.pod:1229
35418 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35419 "directly from the guest, and these could contain any 8 bit data. Callers "
35420 "should be careful to escape these before printing them to a structured file "
35421 "(for example, use HTML escaping if creating a web page)."
35425 #: ../src/guestfs.pod:1235
35427 "Guest configuration may be altered in unusual ways by the administrator of "
35428 "the virtual machine, and may not reflect reality (particularly for untrusted "
35429 "or actively malicious guests). For example we parse the hostname from "
35430 "configuration files like C</etc/sysconfig/network> that we find in the "
35431 "guest, but the guest administrator can easily manipulate these files to "
35432 "provide the wrong hostname."
35436 #: ../src/guestfs.pod:1243
35438 "The inspection API parses guest configuration using two external libraries: "
35439 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35440 "designed to be robust in the face of malicious data, although denial of "
35441 "service attacks are still possible, for example with oversized configuration "
35446 #: ../src/guestfs.pod:1249
35447 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35451 #: ../src/guestfs.pod:1251
35453 "Be very cautious about running commands from the guest. By running a "
35454 "command in the guest, you are giving CPU time to a binary that you do not "
35455 "control, under the same user account as the library, albeit wrapped in qemu "
35456 "virtualization. More information and alternatives can be found in the "
35457 "section L</RUNNING COMMANDS>."
35461 #: ../src/guestfs.pod:1257
35462 msgid "CVE-2010-3851"
35466 #: ../src/guestfs.pod:1259
35467 msgid "https://bugzilla.redhat.com/642934"
35471 #: ../src/guestfs.pod:1261
35473 "This security bug concerns the automatic disk format detection that qemu "
35474 "does on disk images."
35478 #: ../src/guestfs.pod:1264
35480 "A raw disk image is just the raw bytes, there is no header. Other disk "
35481 "images like qcow2 contain a special header. Qemu deals with this by looking "
35482 "for one of the known headers, and if none is found then assuming the disk "
35483 "image must be raw."
35487 #: ../src/guestfs.pod:1269
35489 "This allows a guest which has been given a raw disk image to write some "
35490 "other header. At next boot (or when the disk image is accessed by "
35491 "libguestfs) qemu would do autodetection and think the disk image format was, "
35492 "say, qcow2 based on the header written by the guest."
35496 #: ../src/guestfs.pod:1274
35498 "This in itself would not be a problem, but qcow2 offers many features, one "
35499 "of which is to allow a disk image to refer to another image (called the "
35500 "\"backing disk\"). It does this by placing the path to the backing disk "
35501 "into the qcow2 header. This path is not validated and could point to any "
35502 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35503 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35504 "control of the attacker."
35508 #: ../src/guestfs.pod:1282
35510 "In libguestfs this is rather hard to exploit except under two circumstances:"
35514 #: ../src/guestfs.pod:1289
35515 msgid "You have enabled the network or have opened the disk in write mode."
35519 #: ../src/guestfs.pod:1293
35521 "You are also running untrusted code from the guest (see L</RUNNING "
35526 #: ../src/guestfs.pod:1298
35528 "The way to avoid this is to specify the expected disk format when adding "
35529 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35530 "should always do this if the disk is raw format, and it's a good idea for "
35535 #: ../src/guestfs.pod:1303
35537 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35538 "format is fetched from libvirt and passed through."
35542 #: ../src/guestfs.pod:1306
35544 "For libguestfs tools, use the I<--format> command line parameter as "
35549 #: ../src/guestfs.pod:1309
35550 msgid "CONNECTION MANAGEMENT"
35554 #: ../src/guestfs.pod:1311
35555 msgid "guestfs_h *"
35559 #: ../src/guestfs.pod:1313
35561 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
35562 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
35563 "handle and release all resources used."
35567 #: ../src/guestfs.pod:1317
35569 "For information on using multiple handles and threads, see the section L</"
35570 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
35574 #: ../src/guestfs.pod:1320
35575 msgid "guestfs_create"
35579 #: ../src/guestfs.pod:1322
35582 " guestfs_h *guestfs_create (void);\n"
35587 #: ../src/guestfs.pod:1324
35588 msgid "Create a connection handle."
35592 #: ../src/guestfs.pod:1326
35594 "On success this returns a non-NULL pointer to a handle. On error it returns "
35599 #: ../src/guestfs.pod:1329
35601 "You have to \"configure\" the handle after creating it. This includes "
35602 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35603 "handle at least once."
35607 #: ../src/guestfs.pod:1333
35608 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35612 #: ../src/guestfs.pod:1335
35614 "You may also want to configure error handling for the handle. See the L</"
35615 "ERROR HANDLING> section below."
35619 #: ../src/guestfs.pod:1338
35620 msgid "guestfs_close"
35624 #: ../src/guestfs.pod:1340
35627 " void guestfs_close (guestfs_h *g);\n"
35632 #: ../src/guestfs.pod:1342
35633 msgid "This closes the connection handle and frees up all resources used."
35637 #: ../src/guestfs.pod:1344
35639 "If autosync was set on the handle and the handle was launched, then this "
35640 "implicitly calls various functions to unmount filesystems and sync the "
35641 "disk. See L</guestfs_set_autosync> for more details."
35645 #: ../src/guestfs.pod:1348
35646 msgid "If a close callback was set on the handle, then it is called."
35650 #: ../src/guestfs.pod:1350
35651 msgid "ERROR HANDLING"
35655 #: ../src/guestfs.pod:1352
35657 "API functions can return errors. For example, almost all functions that "
35658 "return C<int> will return C<-1> to indicate an error."
35662 #: ../src/guestfs.pod:1355
35664 "Additional information is available for errors: an error message string and "
35665 "optionally an error number (errno) if the thing that failed was a system "
35670 #: ../src/guestfs.pod:1359
35672 "You can get at the additional information about the last error on the handle "
35673 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
35674 "up an error handler with L</guestfs_set_error_handler>."
35678 #: ../src/guestfs.pod:1364
35680 "When the handle is created, a default error handler is installed which "
35681 "prints the error message string to C<stderr>. For small short-running "
35682 "command line programs it is sufficient to do:"
35686 #: ../src/guestfs.pod:1368
35689 " if (guestfs_launch (g) == -1)\n"
35690 " exit (EXIT_FAILURE);\n"
35695 #: ../src/guestfs.pod:1371
35697 "since the default error handler will ensure that an error message has been "
35698 "printed to C<stderr> before the program exits."
35702 #: ../src/guestfs.pod:1374
35704 "For other programs the caller will almost certainly want to install an "
35705 "alternate error handler or do error handling in-line like this:"
35709 #: ../src/guestfs.pod:1377
35712 " /* This disables the default behaviour of printing errors\n"
35714 " guestfs_set_error_handler (g, NULL, NULL);\n"
35719 #: ../src/guestfs.pod:1381
35722 " if (guestfs_launch (g) == -1) {\n"
35723 " /* Examine the error message and print it etc. */\n"
35724 " char *msg = guestfs_last_error (g);\n"
35725 " int errnum = guestfs_last_errno (g);\n"
35726 " fprintf (stderr, \"%s\", msg);\n"
35727 " if (errnum != 0)\n"
35728 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35729 " fprintf (stderr, \"\\n\");\n"
35736 #: ../src/guestfs.pod:1392
35738 "Out of memory errors are handled differently. The default action is to call "
35739 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
35740 "guestfs_set_out_of_memory_handler>."
35744 #: ../src/guestfs.pod:1396
35746 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35747 "because there is no handle if this happens there is no way to get additional "
35748 "error information. However L</guestfs_create> is supposed to be a "
35749 "lightweight operation which can only fail because of insufficient memory (it "
35750 "returns NULL in this case)."
35754 #: ../src/guestfs.pod:1402
35755 msgid "guestfs_last_error"
35759 #: ../src/guestfs.pod:1404
35762 " const char *guestfs_last_error (guestfs_h *g);\n"
35767 #: ../src/guestfs.pod:1406
35769 "This returns the last error message that happened on C<g>. If there has not "
35770 "been an error since the handle was created, then this returns C<NULL>."
35774 #: ../src/guestfs.pod:1410
35776 "The lifetime of the returned string is until the next error occurs, or L</"
35777 "guestfs_close> is called."
35781 #: ../src/guestfs.pod:1413
35782 msgid "guestfs_last_errno"
35786 #: ../src/guestfs.pod:1415
35789 " int guestfs_last_errno (guestfs_h *g);\n"
35794 #: ../src/guestfs.pod:1417
35795 msgid "This returns the last error number (errno) that happened on C<g>."
35799 #: ../src/guestfs.pod:1419
35800 msgid "If successful, an errno integer not equal to zero is returned."
35804 #: ../src/guestfs.pod:1421
35806 "If no error, this returns 0. This call can return 0 in three situations:"
35810 #: ../src/guestfs.pod:1428
35811 msgid "There has not been any error on the handle."
35815 #: ../src/guestfs.pod:1432
35817 "There has been an error but the errno was meaningless. This corresponds to "
35818 "the case where the error did not come from a failed system call, but for "
35819 "some other reason."
35823 #: ../src/guestfs.pod:1438
35825 "There was an error from a failed system call, but for some reason the errno "
35826 "was not captured and returned. This usually indicates a bug in libguestfs."
35830 #: ../src/guestfs.pod:1444
35832 "Libguestfs tries to convert the errno from inside the applicance into a "
35833 "corresponding errno for the caller (not entirely trivial: the appliance "
35834 "might be running a completely different operating system from the library "
35835 "and error numbers are not standardized across Un*xen). If this could not be "
35836 "done, then the error is translated to C<EINVAL>. In practice this should "
35837 "only happen in very rare circumstances."
35841 #: ../src/guestfs.pod:1452
35842 msgid "guestfs_set_error_handler"
35846 #: ../src/guestfs.pod:1454
35849 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35851 " const char *msg);\n"
35852 " void guestfs_set_error_handler (guestfs_h *g,\n"
35853 " guestfs_error_handler_cb cb,\n"
35854 " void *opaque);\n"
35859 #: ../src/guestfs.pod:1461
35861 "The callback C<cb> will be called if there is an error. The parameters "
35862 "passed to the callback are an opaque data pointer and the error message "
35867 #: ../src/guestfs.pod:1465
35869 "C<errno> is not passed to the callback. To get that the callback must call "
35870 "L</guestfs_last_errno>."
35874 #: ../src/guestfs.pod:1468
35876 "Note that the message string C<msg> is freed as soon as the callback "
35877 "function returns, so if you want to stash it somewhere you must make your "
35882 #: ../src/guestfs.pod:1472
35883 msgid "The default handler prints messages on C<stderr>."
35887 #: ../src/guestfs.pod:1474
35888 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35892 #: ../src/guestfs.pod:1476
35893 msgid "guestfs_get_error_handler"
35897 #: ../src/guestfs.pod:1478
35900 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35901 " void **opaque_rtn);\n"
35906 #: ../src/guestfs.pod:1481
35907 msgid "Returns the current error handler callback."
35911 #: ../src/guestfs.pod:1483
35912 msgid "guestfs_set_out_of_memory_handler"
35916 #: ../src/guestfs.pod:1485
35919 " typedef void (*guestfs_abort_cb) (void);\n"
35920 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35921 " guestfs_abort_cb);\n"
35926 #: ../src/guestfs.pod:1489
35928 "The callback C<cb> will be called if there is an out of memory situation. "
35929 "I<Note this callback must not return>."
35933 #: ../src/guestfs.pod:1492
35934 msgid "The default is to call L<abort(3)>."
35938 #: ../src/guestfs.pod:1494
35940 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35944 #: ../src/guestfs.pod:1497
35945 msgid "guestfs_get_out_of_memory_handler"
35949 #: ../src/guestfs.pod:1499
35952 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35957 #: ../src/guestfs.pod:1501
35958 msgid "This returns the current out of memory handler."
35962 #: ../src/guestfs.pod:1503
35967 #: ../src/guestfs.pod:1507
35972 #: ../src/guestfs.pod:1509
35977 #: ../src/guestfs.pod:1511
35978 msgid "AVAILABILITY"
35982 #: ../src/guestfs.pod:1513
35983 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35987 #: ../src/guestfs.pod:1515
35989 "Using L</guestfs_available> you can test availability of the following "
35990 "groups of functions. This test queries the appliance to see if the "
35991 "appliance you are currently using supports the functionality."
35995 #: ../src/guestfs.pod:1520
35996 msgid "@AVAILABILITY@"
36000 #: ../src/guestfs.pod:1522
36001 msgid "GUESTFISH supported COMMAND"
36005 #: ../src/guestfs.pod:1524
36007 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36008 "prints out the available groups and whether they are supported by this build "
36009 "of libguestfs. Note however that you have to do C<run> first."
36013 #: ../src/guestfs.pod:1529
36014 msgid "SINGLE CALLS AT COMPILE TIME"
36018 #: ../src/guestfs.pod:1531
36020 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36021 "function, such as:"
36025 #: ../src/guestfs.pod:1534
36028 " #define LIBGUESTFS_HAVE_DD 1\n"
36033 #: ../src/guestfs.pod:1536
36034 msgid "if L</guestfs_dd> is available."
36038 #: ../src/guestfs.pod:1538
36040 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36041 "function is available at compile time, we recommended using build tools such "
36042 "as autoconf or cmake. For example in autotools you could use:"
36046 #: ../src/guestfs.pod:1543
36049 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36050 " AC_CHECK_FUNCS([guestfs_dd])\n"
36055 #: ../src/guestfs.pod:1546
36057 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36062 #: ../src/guestfs.pod:1549
36063 msgid "SINGLE CALLS AT RUN TIME"
36067 #: ../src/guestfs.pod:1551
36069 "Testing at compile time doesn't guarantee that a function really exists in "
36070 "the library. The reason is that you might be dynamically linked against a "
36071 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36072 "This situation unfortunately results in a segmentation fault, which is a "
36073 "shortcoming of the C dynamic linking system itself."
36077 #: ../src/guestfs.pod:1558
36079 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36080 "in this example program (note that you still need the compile time check as "
36085 #: ../src/guestfs.pod:1562
36088 " #include <stdio.h>\n"
36089 " #include <stdlib.h>\n"
36090 " #include <unistd.h>\n"
36091 " #include <dlfcn.h>\n"
36092 " #include <guestfs.h>\n"
36097 #: ../src/guestfs.pod:1568
36102 " #ifdef LIBGUESTFS_HAVE_DD\n"
36104 " int has_function;\n"
36109 #: ../src/guestfs.pod:1574
36112 " /* Test if the function guestfs_dd is really available. */\n"
36113 " dl = dlopen (NULL, RTLD_LAZY);\n"
36115 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36116 " exit (EXIT_FAILURE);\n"
36118 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36124 #: ../src/guestfs.pod:1583
36127 " if (!has_function)\n"
36128 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36130 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36131 " /* Now it's safe to call\n"
36132 " guestfs_dd (g, \"foo\", \"bar\");\n"
36136 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36143 #: ../src/guestfs.pod:1596
36145 "You may think the above is an awful lot of hassle, and it is. There are "
36146 "other ways outside of the C linking system to ensure that this kind of "
36147 "incompatibility never arises, such as using package versioning:"
36151 #: ../src/guestfs.pod:1601
36154 " Requires: libguestfs >= 1.0.80\n"
36159 #: ../src/guestfs.pod:1603
36160 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36164 #: ../src/guestfs.pod:1605
36166 "A recent feature of the API is the introduction of calls which take optional "
36167 "arguments. In C these are declared 3 ways. The main way is as a call which "
36168 "takes variable arguments (ie. C<...>), as in this example:"
36172 #: ../src/guestfs.pod:1610
36175 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36180 #: ../src/guestfs.pod:1612
36182 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36183 "call with no optional arguments specified:"
36187 #: ../src/guestfs.pod:1615
36190 " guestfs_add_drive_opts (g, filename, -1);\n"
36195 #: ../src/guestfs.pod:1617
36196 msgid "With a single optional argument:"
36200 #: ../src/guestfs.pod:1619
36203 " guestfs_add_drive_opts (g, filename,\n"
36204 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36210 #: ../src/guestfs.pod:1623
36215 #: ../src/guestfs.pod:1625
36218 " guestfs_add_drive_opts (g, filename,\n"
36219 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36220 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36226 #: ../src/guestfs.pod:1630
36228 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36233 #: ../src/guestfs.pod:1633
36234 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36238 #: ../src/guestfs.pod:1635
36240 "The second variant has the same name with the suffix C<_va>, which works the "
36241 "same way but takes a C<va_list>. See the C manual for details. For the "
36242 "example function, this is declared:"
36246 #: ../src/guestfs.pod:1639
36249 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36250 " va_list args);\n"
36255 #: ../src/guestfs.pod:1642
36256 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36260 #: ../src/guestfs.pod:1644
36262 "The third variant is useful where you need to construct these calls. You "
36263 "pass in a structure where you fill in the optional fields. The structure "
36264 "has a bitmask as the first element which you must set to indicate which "
36265 "fields you have filled in. For our example function the structure and call "
36270 #: ../src/guestfs.pod:1650
36273 " struct guestfs_add_drive_opts_argv {\n"
36274 " uint64_t bitmask;\n"
36276 " const char *format;\n"
36279 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36280 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36285 #: ../src/guestfs.pod:1659
36286 msgid "You could call it like this:"
36290 #: ../src/guestfs.pod:1661
36293 " struct guestfs_add_drive_opts_argv optargs = {\n"
36294 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36295 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36296 " .readonly = 1,\n"
36297 " .format = \"qcow2\"\n"
36303 #: ../src/guestfs.pod:1668
36306 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36311 #: ../src/guestfs.pod:1676
36312 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36316 #: ../src/guestfs.pod:1681
36317 msgid "You do not need to fill in all fields of the structure."
36321 #: ../src/guestfs.pod:1685
36323 "There must be a one-to-one correspondence between fields of the structure "
36324 "that are filled in, and bits set in the bitmask."
36328 #: ../src/guestfs.pod:1690
36329 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36333 #: ../src/guestfs.pod:1692
36335 "In other languages, optional arguments are expressed in the way that is "
36336 "natural for that language. We refer you to the language-specific "
36337 "documentation for more details on that."
36341 #: ../src/guestfs.pod:1696
36342 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36346 #: ../src/guestfs.pod:1698
36347 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36351 #: ../src/guestfs.pod:1700
36353 "B<Note:> This section documents the generic event mechanism introduced in "
36354 "libguestfs 1.10, which you should use in new code if possible. The old "
36355 "functions C<guestfs_set_log_message_callback>, "
36356 "C<guestfs_set_subprocess_quit_callback>, "
36357 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36358 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36359 "page. Because of the ABI guarantee, the old functions continue to work."
36363 #: ../src/guestfs.pod:1709
36365 "Handles generate events when certain things happen, such as log messages "
36366 "being generated, progress messages during long-running operations, or the "
36367 "handle being closed. The API calls described below let you register a "
36368 "callback to be called when events happen. You can register multiple "
36369 "callbacks (for the same, different or overlapping sets of events), and "
36370 "individually remove callbacks. If callbacks are not removed, then they "
36371 "remain in force until the handle is closed."
36375 #: ../src/guestfs.pod:1717
36377 "In the current implementation, events are only generated synchronously: that "
36378 "means that events (and hence callbacks) can only happen while you are in the "
36379 "middle of making another libguestfs call. The callback is called in the "
36384 #: ../src/guestfs.pod:1722
36386 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36387 "unsigned integers, or a message buffer. Payloads are discussed later on."
36391 #: ../src/guestfs.pod:1726
36392 msgid "CLASSES OF EVENTS"
36396 #: ../src/guestfs.pod:1730
36397 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36401 #: ../src/guestfs.pod:1733
36403 "The callback function will be called while the handle is being closed "
36404 "(synchronously from L</guestfs_close>)."
36408 #: ../src/guestfs.pod:1736
36410 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36411 "handles that are open when the program exits. This means that this callback "
36412 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36413 "problems in higher-level languages (eg. if your HLL interpreter has already "
36414 "been cleaned up by the time this is called, and if your callback then jumps "
36415 "into some HLL function)."
36419 #: ../src/guestfs.pod:1743
36421 "If no callback is registered: the handle is closed without any callback "
36426 #: ../src/guestfs.pod:1746
36427 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36431 #: ../src/guestfs.pod:1749
36433 "The callback function will be called when the child process quits, either "
36434 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36435 "corresponds to a transition from any state to the CONFIG state)."
36439 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
36440 msgid "If no callback is registered: the event is ignored."
36444 #: ../src/guestfs.pod:1755
36445 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36449 #: ../src/guestfs.pod:1758
36451 "The callback function will be called when the child process becomes ready "
36452 "first time after it has been launched. (This corresponds to a transition "
36453 "from LAUNCHING to the READY state)."
36457 #: ../src/guestfs.pod:1764
36458 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36462 #: ../src/guestfs.pod:1767
36464 "Some long-running operations can generate progress messages. If this "
36465 "callback is registered, then it will be called each time a progress message "
36466 "is generated (usually two seconds after the operation started, and three "
36467 "times per second thereafter until it completes, although the frequency may "
36468 "change in future versions)."
36472 #: ../src/guestfs.pod:1773
36474 "The callback receives in the payload four unsigned 64 bit numbers which are "
36475 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36479 #: ../src/guestfs.pod:1776
36481 "The units of C<total> are not defined, although for some operations C<total> "
36482 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36483 "or megabytes), and C<position> may be the portion which has been transferred."
36487 #: ../src/guestfs.pod:1781
36488 msgid "The only defined and stable parts of the API are:"
36492 #: ../src/guestfs.pod:1787
36494 "The callback can display to the user some type of progress bar or indicator "
36495 "which shows the ratio of C<position>:C<total>."
36499 #: ../src/guestfs.pod:1792
36500 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36504 #: ../src/guestfs.pod:1796
36506 "If any progress notification is sent during a call, then a final progress "
36507 "notification is always sent when C<position> = C<total> (I<unless> the call "
36508 "fails with an error)."
36512 #: ../src/guestfs.pod:1800
36514 "This is to simplify caller code, so callers can easily set the progress "
36515 "indicator to \"100%\" at the end of the operation, without requiring special "
36516 "code to detect this case."
36520 #: ../src/guestfs.pod:1806
36522 "For some calls we are unable to estimate the progress of the call, but we "
36523 "can still generate progress messages to indicate activity. This is known as "
36524 "\"pulse mode\", and is directly supported by certain progress bar "
36525 "implementations (eg. GtkProgressBar)."
36529 #: ../src/guestfs.pod:1811
36531 "For these calls, zero or more progress messages are generated with "
36532 "C<position = 0> and C<total = 1>, followed by a final message with "
36533 "C<position = total = 1>."
36537 #: ../src/guestfs.pod:1815
36539 "As noted above, if the call fails with an error then the final message may "
36540 "not be generated."
36544 #: ../src/guestfs.pod:1820
36546 "The callback also receives the procedure number (C<proc_nr>) and serial "
36547 "number (C<serial>) of the call. These are only useful for debugging "
36548 "protocol issues, and the callback can normally ignore them. The callback "
36549 "may want to print these numbers in error messages or debugging messages."
36553 #: ../src/guestfs.pod:1826
36554 msgid "If no callback is registered: progress messages are discarded."
36558 #: ../src/guestfs.pod:1828
36559 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
36563 #: ../src/guestfs.pod:1831
36565 "The callback function is called whenever a log message is generated by qemu, "
36566 "the appliance kernel, guestfsd (daemon), or utility programs."
36570 #: ../src/guestfs.pod:1834
36572 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
36573 "guestfs_launch>) then additional debug messages are generated."
36577 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
36579 "If no callback is registered: the messages are discarded unless the verbose "
36580 "flag is set in which case they are sent to stderr. You can override the "
36581 "printing of verbose messages to stderr by setting up a callback."
36585 #: ../src/guestfs.pod:1842
36586 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36590 #: ../src/guestfs.pod:1845
36592 "The callback function is called whenever a log message is generated by the "
36593 "library part of libguestfs."
36597 #: ../src/guestfs.pod:1848
36599 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36600 "messages are generated."
36604 #: ../src/guestfs.pod:1856
36605 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36609 #: ../src/guestfs.pod:1859
36611 "The callback function is called whenever a trace message is generated. This "
36612 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36616 #: ../src/guestfs.pod:1862
36618 "If no callback is registered: the messages are sent to stderr. You can "
36619 "override the printing of trace messages to stderr by setting up a callback."
36623 #: ../src/guestfs.pod:1866
36624 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36628 #: ../src/guestfs.pod:1869
36630 "The callback function is called whenever a libguestfs function is entered."
36634 #: ../src/guestfs.pod:1872
36636 "The payload is a string which contains the name of the function that we are "
36637 "entering (not including C<guestfs_> prefix)."
36641 #: ../src/guestfs.pod:1875
36643 "Note that libguestfs functions can call themselves, so you may see many "
36644 "events from a single call. A few libguestfs functions do not generate this "
36649 #: ../src/guestfs.pod:1883
36650 msgid "guestfs_set_event_callback"
36654 #: ../src/guestfs.pod:1885
36657 " int guestfs_set_event_callback (guestfs_h *g,\n"
36658 " guestfs_event_callback cb,\n"
36659 " uint64_t event_bitmask,\n"
36661 " void *opaque);\n"
36666 #: ../src/guestfs.pod:1891
36668 "This function registers a callback (C<cb>) for all event classes in the "
36669 "C<event_bitmask>."
36673 #: ../src/guestfs.pod:1894
36675 "For example, to register for all log message events, you could call this "
36676 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
36677 "To register a single callback for all possible classes of events, use "
36678 "C<GUESTFS_EVENT_ALL>."
36682 #: ../src/guestfs.pod:1900
36683 msgid "C<flags> should always be passed as 0."
36687 #: ../src/guestfs.pod:1902
36689 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36690 "it for any purpose."
36694 #: ../src/guestfs.pod:1905
36696 "The return value is the event handle (an integer) which you can use to "
36697 "delete the callback (see below)."
36701 #: ../src/guestfs.pod:1908
36703 "If there is an error, this function returns C<-1>, and sets the error in the "
36704 "handle in the usual way (see L</guestfs_last_error> etc.)"
36708 #: ../src/guestfs.pod:1911
36710 "Callbacks remain in effect until they are deleted, or until the handle is "
36715 #: ../src/guestfs.pod:1914
36717 "In the case where multiple callbacks are registered for a particular event "
36718 "class, all of the callbacks are called. The order in which multiple "
36719 "callbacks are called is not defined."
36723 #: ../src/guestfs.pod:1918
36724 msgid "guestfs_delete_event_callback"
36728 #: ../src/guestfs.pod:1920
36731 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36736 #: ../src/guestfs.pod:1922
36738 "Delete a callback that was previously registered. C<event_handle> should be "
36739 "the integer that was returned by a previous call to "
36740 "C<guestfs_set_event_callback> on the same handle."
36744 #: ../src/guestfs.pod:1926
36745 msgid "guestfs_event_callback"
36749 #: ../src/guestfs.pod:1928
36752 " typedef void (*guestfs_event_callback) (\n"
36755 " uint64_t event,\n"
36756 " int event_handle,\n"
36758 " const char *buf, size_t buf_len,\n"
36759 " const uint64_t *array, size_t array_len);\n"
36764 #: ../src/guestfs.pod:1937
36766 "This is the type of the event callback function that you have to provide."
36770 #: ../src/guestfs.pod:1940
36772 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36773 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36774 "handle, and C<flags> which in the current API you should ignore."
36778 #: ../src/guestfs.pod:1944
36780 "The remaining parameters contain the event payload (if any). Each event may "
36781 "contain a payload, which usually relates to the event class, but for future "
36782 "proofing your code should be written to handle any payload for any event "
36787 #: ../src/guestfs.pod:1949
36789 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36790 "there is no message buffer). Note that this message buffer can contain "
36791 "arbitrary 8 bit data, including NUL bytes."
36795 #: ../src/guestfs.pod:1953
36797 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36798 "moment this is only used for progress messages."
36802 #: ../src/guestfs.pod:1956
36803 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36807 #: ../src/guestfs.pod:1958
36809 "One motivation for the generic event API was to allow GUI programs to "
36810 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36811 "unconditionally to C<stderr>."
36815 #: ../src/guestfs.pod:1962
36817 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36818 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36819 "messages are not events; you must capture error messages separately)."
36823 #: ../src/guestfs.pod:1967
36825 "Programs have to set up a callback to capture the classes of events of "
36830 #: ../src/guestfs.pod:1970
36834 " guestfs_set_event_callback\n"
36835 " (g, message_callback,\n"
36836 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36837 " GUESTFS_EVENT_TRACE,\n"
36838 " 0, NULL) == -1)\n"
36839 " if (eh == -1) {\n"
36840 " // handle error in the usual way\n"
36846 #: ../src/guestfs.pod:1980
36848 "The callback can then direct messages to the appropriate place. In this "
36849 "example, messages are directed to syslog:"
36853 #: ../src/guestfs.pod:1983
36857 " message_callback (\n"
36860 " uint64_t event,\n"
36861 " int event_handle,\n"
36863 " const char *buf, size_t buf_len,\n"
36864 " const uint64_t *array, size_t array_len)\n"
36866 " const int priority = LOG_USER|LOG_INFO;\n"
36867 " if (buf_len > 0)\n"
36868 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36874 #: ../src/guestfs.pod:1998
36875 msgid "CANCELLING LONG TRANSFERS"
36879 #: ../src/guestfs.pod:2000
36881 "Some operations can be cancelled by the caller while they are in progress. "
36882 "Currently only operations that involve uploading or downloading data can be "
36883 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36884 "parameters in the generator)."
36888 #: ../src/guestfs.pod:2005
36889 msgid "guestfs_user_cancel"
36893 #: ../src/guestfs.pod:2007
36896 " void guestfs_user_cancel (guestfs_h *g);\n"
36901 #: ../src/guestfs.pod:2009
36903 "C<guestfs_user_cancel> cancels the current upload or download operation."
36907 #: ../src/guestfs.pod:2012
36909 "Unlike most other libguestfs calls, this function is signal safe and thread "
36910 "safe. You can call it from a signal handler or from another thread, without "
36911 "needing to do any locking."
36915 #: ../src/guestfs.pod:2016
36917 "The transfer that was in progress (if there is one) will stop shortly "
36918 "afterwards, and will return an error. The errno (see L</"
36919 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36920 "out if the operation was cancelled or failed because of another error."
36924 #: ../src/guestfs.pod:2022
36926 "No cleanup is performed: for example, if a file was being uploaded then "
36927 "after cancellation there may be a partially uploaded file. It is the "
36928 "caller's responsibility to clean up if necessary."
36932 #: ../src/guestfs.pod:2026
36933 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36937 #: ../src/guestfs.pod:2028
36939 "In an interactive text-based program, you might call it from a C<SIGINT> "
36940 "signal handler so that pressing C<^C> cancels the current operation. (You "
36941 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36942 "receive the C<^C> signal)."
36946 #: ../src/guestfs.pod:2033
36948 "In a graphical program, when the main thread is displaying a progress bar "
36949 "with a cancel button, wire up the cancel button to call this function."
36953 #: ../src/guestfs.pod:2037
36954 msgid "PRIVATE DATA AREA"
36958 #: ../src/guestfs.pod:2039
36960 "You can attach named pieces of private data to the libguestfs handle, fetch "
36961 "them by name, and walk over them, for the lifetime of the handle. This is "
36962 "called the private data area and is only available from the C API."
36966 #: ../src/guestfs.pod:2044
36967 msgid "To attach a named piece of data, use the following call:"
36971 #: ../src/guestfs.pod:2046
36974 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36979 #: ../src/guestfs.pod:2048
36981 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36982 "pointer (which can be C<NULL>). Any previous item with the same key is "
36987 #: ../src/guestfs.pod:2052
36989 "You can use any C<key> you want, but your key should I<not> start with an "
36990 "underscore character. Keys beginning with an underscore character are "
36991 "reserved for internal libguestfs purposes (eg. for implementing language "
36992 "bindings). It is recommended that you prefix the key with some unique "
36993 "string to avoid collisions with other users."
36997 #: ../src/guestfs.pod:2058
36998 msgid "To retrieve the pointer, use:"
37002 #: ../src/guestfs.pod:2060
37005 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37010 #: ../src/guestfs.pod:2062
37012 "This function returns C<NULL> if either no data is found associated with "
37013 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37018 #: ../src/guestfs.pod:2066
37020 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37021 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37022 "all. In particular, libguestfs does I<not> try to free the data when the "
37023 "handle is closed. If the data must be freed, then the caller must either "
37024 "free it before calling L</guestfs_close> or must set up a close callback to "
37025 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37029 #: ../src/guestfs.pod:2073
37030 msgid "To walk over all entries, use these two functions:"
37034 #: ../src/guestfs.pod:2075
37037 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37042 #: ../src/guestfs.pod:2077
37045 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37050 #: ../src/guestfs.pod:2079
37052 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37053 "not have any particular meaning -- keys are not returned in any defined "
37054 "order). A pointer to the key is returned in C<*key_rtn> and the "
37055 "corresponding data pointer is returned from the function. C<NULL> is "
37056 "returned if there are no keys stored in the handle."
37060 #: ../src/guestfs.pod:2085
37062 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37063 "value of this function is also C<NULL> is there are no further entries to "
37068 #: ../src/guestfs.pod:2089
37069 msgid "Notes about walking over entries:"
37073 #: ../src/guestfs.pod:2095
37075 "You must not call C<guestfs_set_private> while walking over the entries."
37079 #: ../src/guestfs.pod:2100
37081 "The handle maintains an internal iterator which is reset when you call "
37082 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37083 "call C<guestfs_set_private>."
37087 #: ../src/guestfs.pod:2106
37088 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37092 #: ../src/guestfs.pod:2108
37095 " guestfs_set_private (g, key, NULL);\n"
37100 #: ../src/guestfs.pod:2110
37101 msgid "then that C<key> is not returned when walking."
37105 #: ../src/guestfs.pod:2114
37107 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37108 "C<guestfs_next_private> or C<guestfs_set_private>."
37112 #: ../src/guestfs.pod:2120
37114 "The following example code shows how to print all keys and data pointers "
37115 "that are associated with the handle C<g>:"
37119 #: ../src/guestfs.pod:2123
37122 " const char *key;\n"
37123 " void *data = guestfs_first_private (g, &key);\n"
37124 " while (data != NULL)\n"
37126 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37127 " data = guestfs_next_private (g, &key);\n"
37133 #: ../src/guestfs.pod:2131
37135 "More commonly you are only interested in keys that begin with an application-"
37136 "specific prefix C<foo_>. Modify the loop like so:"
37140 #: ../src/guestfs.pod:2134
37143 " const char *key;\n"
37144 " void *data = guestfs_first_private (g, &key);\n"
37145 " while (data != NULL)\n"
37147 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37148 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37149 " data = guestfs_next_private (g, &key);\n"
37155 #: ../src/guestfs.pod:2143
37157 "If you need to modify keys while walking, then you have to jump back to the "
37158 "beginning of the loop. For example, to delete all keys prefixed with "
37163 #: ../src/guestfs.pod:2147
37166 " const char *key;\n"
37169 " data = guestfs_first_private (g, &key);\n"
37170 " while (data != NULL)\n"
37172 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37174 " guestfs_set_private (g, key, NULL);\n"
37175 " /* note that 'key' pointer is now invalid, and so is\n"
37176 " the internal iterator */\n"
37179 " data = guestfs_next_private (g, &key);\n"
37185 #: ../src/guestfs.pod:2163
37187 "Note that the above loop is guaranteed to terminate because the keys are "
37188 "being deleted, but other manipulations of keys within the loop might not "
37189 "terminate unless you also maintain an indication of which keys have been "
37194 #: ../src/guestfs.pod:2168
37199 #: ../src/guestfs.pod:2170
37201 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37202 "true of any library, not just libguestfs. However libguestfs also contains "
37203 "static markers to help in probing internal operations."
37207 #: ../src/guestfs.pod:2174
37208 msgid "You can list all the static markers by doing:"
37212 #: ../src/guestfs.pod:2176
37215 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37216 " .provider(\"guestfs\").mark(\"*\")'\n"
37221 #: ../src/guestfs.pod:2179
37223 "B<Note:> These static markers are I<not> part of the stable API and may "
37224 "change in future versions."
37228 #: ../src/guestfs.pod:2182
37229 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37233 #: ../src/guestfs.pod:2184
37235 "This script contains examples of displaying both the static markers and some "
37236 "ordinary C entry points:"
37240 #: ../src/guestfs.pod:2187
37248 #: ../src/guestfs.pod:2189
37251 " function display_time () {\n"
37252 " now = gettimeofday_us ();\n"
37255 " delta = now - last;\n"
37261 #: ../src/guestfs.pod:2196
37264 " printf (\"%d (+%d):\", now, delta);\n"
37270 #: ../src/guestfs.pod:2199
37275 " printf (\"ready\\n\");\n"
37281 #: ../src/guestfs.pod:2204
37284 " /* Display all calls to static markers. */\n"
37285 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37286 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37287 " display_time();\n"
37288 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37294 #: ../src/guestfs.pod:2211
37297 " /* Display all calls to guestfs_mkfs* functions. */\n"
37298 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37299 " .function(\"guestfs_mkfs*\") ? {\n"
37300 " display_time();\n"
37301 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37307 #: ../src/guestfs.pod:2218
37309 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37310 "program. Note that you either have to be root, or you have to add yourself "
37311 "to several special stap groups. Consult the systemtap documentation for "
37312 "more information."
37316 #: ../src/guestfs.pod:2223
37319 " # stap /tmp/test.stap\n"
37325 #: ../src/guestfs.pod:2226
37326 msgid "In another terminal, run a guestfish command such as this:"
37330 #: ../src/guestfs.pod:2230
37331 msgid "In the first terminal, stap trace output similar to this is shown:"
37335 #: ../src/guestfs.pod:2232
37338 " 1318248056692655 (+0):\tlaunch_start\n"
37339 " 1318248056692850 (+195): launch_build_appliance_start\n"
37340 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37341 " 1318248056838059 (+19774): launch_run_qemu\n"
37342 " 1318248061071167 (+4233108): launch_end\n"
37343 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f device=0x1024e60\n"
37348 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
37353 #: ../src/guestfs.pod:2241
37355 "<!-- old anchor for the next section --> <a name="
37356 "\"state_machine_and_low_level_event_api\"/>"
37360 #: ../src/guestfs.pod:2246
37361 msgid "ARCHITECTURE"
37365 #: ../src/guestfs.pod:2248
37367 "Internally, libguestfs is implemented by running an appliance (a special "
37368 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37369 "process of the main program."
37373 #: ../src/guestfs.pod:2252
37376 " ___________________\n"
37378 " | main program |\n"
37380 " | | child process / appliance\n"
37381 " | | __________________________\n"
37383 " +-------------------+ RPC | +-----------------+ |\n"
37384 " | libguestfs <--------------------> guestfsd | |\n"
37385 " | | | +-----------------+ |\n"
37386 " \\___________________/ | | Linux kernel | |\n"
37387 " | +--^--------------+ |\n"
37388 " \\_________|________________/\n"
37390 " _______v______\n"
37393 " | disk image |\n"
37394 " \\______________/\n"
37399 #: ../src/guestfs.pod:2272
37401 "The library, linked to the main program, creates the child process and hence "
37402 "the appliance in the L</guestfs_launch> function."
37406 #: ../src/guestfs.pod:2275
37408 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37409 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37410 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37411 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37412 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37413 "attached to the qemu process which translates device access by the "
37414 "appliance's Linux kernel into accesses to the image."
37418 #: ../src/guestfs.pod:2284
37420 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37421 "Although the disk image you are attached to might also be used by some "
37422 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37423 "care if both libguestfs's qemu process and your virtual machine are trying "
37424 "to update the disk image at the same time, since these usually results in "
37425 "massive disk corruption)."
37429 #: ../src/guestfs.pod:2291
37430 msgid "STATE MACHINE"
37434 #: ../src/guestfs.pod:2293
37435 msgid "libguestfs uses a state machine to model the child process:"
37439 #: ../src/guestfs.pod:2295
37443 " guestfs_create\n"
37451 " / | \\ \\ guestfs_launch\n"
37452 " / | _\\__V______\n"
37454 " / | | LAUNCHING |\n"
37455 " / | \\___________/\n"
37457 " / | guestfs_launch\n"
37459 " ______ / __|____V\n"
37460 " / \\ ------> / \\\n"
37461 " | BUSY | | READY |\n"
37462 " \\______/ <------ \\________/\n"
37467 #: ../src/guestfs.pod:2317
37469 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37470 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37471 "(3) alternating between READY and BUSY as commands are issued to, and "
37472 "carried out by, the child process."
37476 #: ../src/guestfs.pod:2322
37478 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37479 "asynchronously at any time (eg. due to some internal error), and that causes "
37480 "the state to transition back to CONFIG."
37484 #: ../src/guestfs.pod:2326
37486 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37487 "issued when in the CONFIG state."
37491 #: ../src/guestfs.pod:2329
37493 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37494 "L</guestfs_launch> blocks until the child process is READY to accept "
37495 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37496 "moves the state from CONFIG to LAUNCHING while it is running."
37500 #: ../src/guestfs.pod:2335
37502 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37503 "state. These API calls block waiting for the command to be carried out (ie. "
37504 "the state to transition to BUSY and then back to READY). There are no non-"
37505 "blocking versions, and no way to issue more than one command per handle at "
37510 #: ../src/guestfs.pod:2341
37512 "Finally, the child process sends asynchronous messages back to the main "
37513 "program, such as kernel log messages. You can register a callback to "
37514 "receive these messages."
37518 #: ../src/guestfs.pod:2345
37523 #: ../src/guestfs.pod:2347
37524 msgid "APPLIANCE BOOT PROCESS"
37528 #: ../src/guestfs.pod:2349
37530 "This process has evolved and continues to evolve. The description here "
37531 "corresponds only to the current version of libguestfs and is provided for "
37532 "information only."
37536 #: ../src/guestfs.pod:2353
37538 "In order to follow the stages involved below, enable libguestfs debugging "
37539 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37543 #: ../src/guestfs.pod:2358
37544 msgid "Create the appliance"
37548 #: ../src/guestfs.pod:2360
37550 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37551 "initrd and the appliance."
37555 #: ../src/guestfs.pod:2363
37557 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37558 "directory if C<TMPDIR> is set)."
37562 #: ../src/guestfs.pod:2366
37564 "For a complete description of how the appliance is created and cached, read "
37565 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
37569 #: ../src/guestfs.pod:2370
37570 msgid "Start qemu and boot the kernel"
37574 #: ../src/guestfs.pod:2372
37575 msgid "qemu is invoked to boot the kernel."
37579 #: ../src/guestfs.pod:2374
37580 msgid "Run the initrd"
37584 #: ../src/guestfs.pod:2376
37586 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37587 "appliance. The purpose of the initrd is to load enough kernel modules in "
37588 "order that the appliance itself can be mounted and started."
37592 #: ../src/guestfs.pod:2380
37594 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
37599 #: ../src/guestfs.pod:2383
37601 "When the initrd has started you will see messages showing that kernel "
37602 "modules are being loaded, similar to this:"
37606 #: ../src/guestfs.pod:2386
37609 " febootstrap: ext2 mini initrd starting up\n"
37610 " febootstrap: mounting /sys\n"
37611 " febootstrap: internal insmod libcrc32c.ko\n"
37612 " febootstrap: internal insmod crc32c-intel.ko\n"
37617 #: ../src/guestfs.pod:2391
37618 msgid "Find and mount the appliance device"
37622 #: ../src/guestfs.pod:2393
37624 "The appliance is a sparse file containing an ext2 filesystem which contains "
37625 "a familiar (although reduced in size) Linux operating system. It would "
37626 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37630 #: ../src/guestfs.pod:2397
37632 "The regular disks being inspected by libguestfs are the first devices "
37633 "exposed by qemu (eg. as C</dev/vda>)."
37637 #: ../src/guestfs.pod:2400
37639 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37640 "there was only one regular disk)."
37644 #: ../src/guestfs.pod:2403
37646 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37647 "and switch root into the appliance, and run C</init> from the appliance."
37651 #: ../src/guestfs.pod:2407
37652 msgid "If this works successfully you will see messages such as:"
37656 #: ../src/guestfs.pod:2409
37659 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37660 " febootstrap: creating /dev/root as block special 252:16\n"
37661 " febootstrap: mounting new root on /root\n"
37662 " febootstrap: chroot\n"
37663 " Starting /init script ...\n"
37668 #: ../src/guestfs.pod:2415
37670 "Note that C<Starting /init script ...> indicates that the appliance's init "
37671 "script is now running."
37675 #: ../src/guestfs.pod:2418
37676 msgid "Initialize the appliance"
37680 #: ../src/guestfs.pod:2420
37682 "The appliance itself now initializes itself. This involves starting certain "
37683 "processes like C<udev>, possibly printing some debug information, and "
37684 "finally running the daemon (C<guestfsd>)."
37688 #: ../src/guestfs.pod:2424
37693 #: ../src/guestfs.pod:2426
37695 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37700 #: ../src/guestfs.pod:2429
37703 " verbose daemon enabled\n"
37708 #: ../src/guestfs.pod:2431
37710 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37711 "connected on the other end to the library."
37715 #: ../src/guestfs.pod:2434
37717 "The daemon connects to this port (and hence to the library) and sends a four "
37718 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37719 "protocol (see below)."
37723 #: ../src/guestfs.pod:2440
37724 msgid "COMMUNICATION PROTOCOL"
37728 #: ../src/guestfs.pod:2442
37730 "Don't rely on using this protocol directly. This section documents how it "
37731 "currently works, but it may change at any time."
37735 #: ../src/guestfs.pod:2445
37737 "The protocol used to talk between the library and the daemon running inside "
37738 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37739 "1014, RFC 1832, RFC 4506)."
37743 #: ../src/guestfs.pod:2449
37745 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37746 "this file is automatically generated)."
37750 #: ../src/guestfs.pod:2452
37752 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37753 "and C<FileOut> parameters, which are handled with very simple request/reply "
37754 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37755 "parameters, which use the same request and reply messages, but they may also "
37756 "be followed by files sent using a chunked encoding."
37760 #: ../src/guestfs.pod:2459
37761 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37765 #: ../src/guestfs.pod:2461
37766 msgid "For ordinary functions, the request message is:"
37770 #: ../src/guestfs.pod:2463
37773 " total length (header + arguments,\n"
37774 " but not including the length word itself)\n"
37775 " struct guestfs_message_header (encoded as XDR)\n"
37776 " struct guestfs_<foo>_args (encoded as XDR)\n"
37781 #: ../src/guestfs.pod:2468
37783 "The total length field allows the daemon to allocate a fixed size buffer "
37784 "into which it slurps the rest of the message. As a result, the total length "
37785 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37786 "effective size of any request is limited to somewhere under this size."
37790 #: ../src/guestfs.pod:2474
37792 "Note also that many functions don't take any arguments, in which case the "
37793 "C<guestfs_I<foo>_args> is completely omitted."
37797 #: ../src/guestfs.pod:2477
37799 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37800 "receiver knows what type of args structure to expect, or none at all."
37804 #: ../src/guestfs.pod:2481
37806 "For functions that take optional arguments, the optional arguments are "
37807 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37808 "arguments. A bitmask in the header indicates which optional arguments are "
37809 "meaningful. The bitmask is also checked to see if it contains bits set "
37810 "which the daemon does not know about (eg. if more optional arguments were "
37811 "added in a later version of the library), and this causes the call to be "
37816 #: ../src/guestfs.pod:2489
37817 msgid "The reply message for ordinary functions is:"
37821 #: ../src/guestfs.pod:2491
37824 " total length (header + ret,\n"
37825 " but not including the length word itself)\n"
37826 " struct guestfs_message_header (encoded as XDR)\n"
37827 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37832 #: ../src/guestfs.pod:2496
37834 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37835 "functions that return no formal return values."
37839 #: ../src/guestfs.pod:2499
37841 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37845 #: ../src/guestfs.pod:2502
37847 "In the case of an error, a flag is set in the header, and the reply message "
37848 "is slightly changed:"
37852 #: ../src/guestfs.pod:2505
37855 " total length (header + error,\n"
37856 " but not including the length word itself)\n"
37857 " struct guestfs_message_header (encoded as XDR)\n"
37858 " struct guestfs_message_error (encoded as XDR)\n"
37863 #: ../src/guestfs.pod:2510
37865 "The C<guestfs_message_error> structure contains the error message as a "
37870 #: ../src/guestfs.pod:2513
37871 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37875 #: ../src/guestfs.pod:2515
37877 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37878 "The normal request message is sent (see above). However this is followed by "
37879 "a sequence of file chunks."
37883 #: ../src/guestfs.pod:2519
37886 " total length (header + arguments,\n"
37887 " but not including the length word itself,\n"
37888 " and not including the chunks)\n"
37889 " struct guestfs_message_header (encoded as XDR)\n"
37890 " struct guestfs_<foo>_args (encoded as XDR)\n"
37891 " sequence of chunks for FileIn param #0\n"
37892 " sequence of chunks for FileIn param #1 etc.\n"
37897 #: ../src/guestfs.pod:2527
37898 msgid "The \"sequence of chunks\" is:"
37902 #: ../src/guestfs.pod:2529
37905 " length of chunk (not including length word itself)\n"
37906 " struct guestfs_chunk (encoded as XDR)\n"
37907 " length of chunk\n"
37908 " struct guestfs_chunk (encoded as XDR)\n"
37910 " length of chunk\n"
37911 " struct guestfs_chunk (with data.data_len == 0)\n"
37916 #: ../src/guestfs.pod:2537
37918 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37919 "is set in the final chunk to indicate either successful completion or early "
37924 #: ../src/guestfs.pod:2541
37926 "At time of writing there are no functions that have more than one FileIn "
37927 "parameter. However this is (theoretically) supported, by sending the "
37928 "sequence of chunks for each FileIn parameter one after another (from left to "
37933 #: ../src/guestfs.pod:2546
37935 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
37936 "transfer. The library does this by sending a chunk with a special flag set "
37937 "to indicate cancellation. When the daemon sees this, it cancels the whole "
37938 "RPC, does I<not> send any reply, and goes back to reading the next request."
37942 #: ../src/guestfs.pod:2552
37944 "The daemon may also cancel. It does this by writing a special word "
37945 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
37946 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
37947 "cancel chunk). The special word is chosen so that even if cancellation "
37948 "happens right at the end of the transfer (after the library has finished "
37949 "writing and has started listening for the reply), the \"spurious\" cancel "
37950 "flag will not be confused with the reply message."
37954 #: ../src/guestfs.pod:2561
37956 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
37957 "limit), and also files where the size is not known in advance (eg. from "
37958 "pipes or sockets). However the chunks are rather small "
37959 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
37960 "to keep much in memory."
37964 #: ../src/guestfs.pod:2567
37965 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
37969 #: ../src/guestfs.pod:2569
37971 "The protocol for FileOut parameters is exactly the same as for FileIn "
37972 "parameters, but with the roles of daemon and library reversed."
37976 #: ../src/guestfs.pod:2572
37979 " total length (header + ret,\n"
37980 " but not including the length word itself,\n"
37981 " and not including the chunks)\n"
37982 " struct guestfs_message_header (encoded as XDR)\n"
37983 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37984 " sequence of chunks for FileOut param #0\n"
37985 " sequence of chunks for FileOut param #1 etc.\n"
37990 #: ../src/guestfs.pod:2580
37991 msgid "INITIAL MESSAGE"
37995 #: ../src/guestfs.pod:2582
37997 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
37998 "which indicates that the guest and daemon is alive. This is what L</"
37999 "guestfs_launch> waits for."
38003 #: ../src/guestfs.pod:2586
38004 msgid "PROGRESS NOTIFICATION MESSAGES"
38008 #: ../src/guestfs.pod:2588
38010 "The daemon may send progress notification messages at any time. These are "
38011 "distinguished by the normal length word being replaced by "
38012 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38016 #: ../src/guestfs.pod:2592
38018 "The library turns them into progress callbacks (see L</"
38019 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
38024 #: ../src/guestfs.pod:2596
38026 "The daemon self-limits the frequency of progress messages it sends (see "
38027 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38032 #: ../src/guestfs.pod:2600
38033 msgid "LIBGUESTFS VERSION NUMBERS"
38037 #: ../src/guestfs.pod:2602
38039 "Since April 2010, libguestfs has started to make separate development and "
38040 "stable releases, along with corresponding branches in our git repository. "
38041 "These separate releases can be identified by version number:"
38045 #: ../src/guestfs.pod:2607
38048 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38049 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38055 " | `-------- sub-version\n"
38057 " `------ always '1' because we don't change the ABI\n"
38062 #: ../src/guestfs.pod:2618
38063 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38067 #: ../src/guestfs.pod:2620
38069 "As time passes we cherry pick fixes from the development branch and backport "
38070 "those into the stable branch, the effect being that the stable branch should "
38071 "get more stable and less buggy over time. So the stable releases are ideal "
38072 "for people who don't need new features but would just like the software to "
38077 #: ../src/guestfs.pod:2626
38078 msgid "Our criteria for backporting changes are:"
38082 #: ../src/guestfs.pod:2632
38084 "Documentation changes which don't affect any code are backported unless the "
38085 "documentation refers to a future feature which is not in stable."
38089 #: ../src/guestfs.pod:2638
38091 "Bug fixes which are not controversial, fix obvious problems, and have been "
38092 "well tested are backported."
38096 #: ../src/guestfs.pod:2643
38098 "Simple rearrangements of code which shouldn't affect how it works get "
38099 "backported. This is so that the code in the two branches doesn't get too "
38100 "far out of step, allowing us to backport future fixes more easily."
38104 #: ../src/guestfs.pod:2649
38106 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38107 "exceptional case: the new feature is required in order to implement an "
38108 "important bug fix."
38112 #: ../src/guestfs.pod:2655
38114 "A new stable branch starts when we think the new features in development are "
38115 "substantial and compelling enough over the current stable branch to warrant "
38116 "it. When that happens we create new stable and development versions 1.N.0 "
38117 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38118 "stable at this point, but by backporting fixes from development, that branch "
38119 "will stabilize over time."
38123 #: ../src/guestfs.pod:2663
38124 msgid "EXTENDING LIBGUESTFS"
38128 #: ../src/guestfs.pod:2665
38129 msgid "ADDING A NEW API ACTION"
38133 #: ../src/guestfs.pod:2667
38135 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38136 "documentation) are generated, and this makes it easy to extend the "
38141 #: ../src/guestfs.pod:2671
38142 msgid "To add a new API action there are two changes:"
38146 #: ../src/guestfs.pod:2677
38148 "You need to add a description of the call (name, parameters, return type, "
38149 "tests, documentation) to C<generator/generator_actions.ml>."
38153 #: ../src/guestfs.pod:2680
38155 "There are two sorts of API action, depending on whether the call goes "
38156 "through to the daemon in the appliance, or is serviced entirely by the "
38157 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38158 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38159 "an example of the latter, since a trace flag is maintained in the handle and "
38160 "all tracing is done on the library side."
38164 #: ../src/guestfs.pod:2688
38166 "Most new actions are of the first type, and get added to the "
38167 "C<daemon_functions> list. Each function has a unique procedure number used "
38168 "in the RPC protocol which is assigned to that action when we publish "
38169 "libguestfs and cannot be reused. Take the latest procedure number and "
38174 #: ../src/guestfs.pod:2694
38176 "For library-only actions of the second type, add to the "
38177 "C<non_daemon_functions> list. Since these functions are serviced by the "
38178 "library and do not travel over the RPC mechanism to the daemon, these "
38179 "functions do not need a procedure number, and so the procedure number is set "
38184 #: ../src/guestfs.pod:2702
38185 msgid "Implement the action (in C):"
38189 #: ../src/guestfs.pod:2704
38191 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38192 "C<daemon/> directory."
38196 #: ../src/guestfs.pod:2707
38198 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38199 "(note: double underscore) in the C<src/> directory."
38203 #: ../src/guestfs.pod:2710
38204 msgid "In either case, use another function as an example of what to do."
38208 #: ../src/guestfs.pod:2714
38209 msgid "After making these changes, use C<make> to compile."
38213 #: ../src/guestfs.pod:2716
38215 "Note that you don't need to implement the RPC, language bindings, manual "
38216 "pages or anything else. It's all automatically generated from the OCaml "
38221 #: ../src/guestfs.pod:2720
38222 msgid "ADDING TESTS FOR AN API ACTION"
38226 #: ../src/guestfs.pod:2722
38228 "You can supply zero or as many tests as you want per API call. The tests "
38229 "can either be added as part of the API description (C<generator/"
38230 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
38231 "into C<regressions/>. Note that adding a script to C<regressions/> is "
38232 "slower, so if possible use the first method."
38236 #: ../src/guestfs.pod:2728
38238 "The following describes the test environment used when you add an API test "
38239 "in C<generator_actions.ml>."
38243 #: ../src/guestfs.pod:2731
38244 msgid "The test environment has 4 block devices:"
38248 #: ../src/guestfs.pod:2735
38249 msgid "C</dev/sda> 500MB"
38253 #: ../src/guestfs.pod:2737
38254 msgid "General block device for testing."
38258 #: ../src/guestfs.pod:2739
38259 msgid "C</dev/sdb> 50MB"
38263 #: ../src/guestfs.pod:2741
38265 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38270 #: ../src/guestfs.pod:2744
38271 msgid "C</dev/sdc> 10MB"
38275 #: ../src/guestfs.pod:2746
38276 msgid "Used in a few tests where two block devices are needed."
38280 #: ../src/guestfs.pod:2748
38281 msgid "C</dev/sdd>"
38285 #: ../src/guestfs.pod:2750
38286 msgid "ISO with fixed content (see C<images/test.iso>)."
38290 #: ../src/guestfs.pod:2754
38292 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38293 "appliance and block devices are reused between tests. So don't try testing "
38294 "L</guestfs_kill_subprocess> :-x"
38298 #: ../src/guestfs.pod:2758
38300 "Each test starts with an initial scenario, selected using one of the "
38301 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38302 "initialize the disks mentioned above in a particular way as documented in "
38303 "C<generator_types.ml>. You should not assume anything about the previous "
38304 "contents of other disks that are not initialized."
38308 #: ../src/guestfs.pod:2764
38310 "You can add a prerequisite clause to any individual test. This is a run-"
38311 "time check, which, if it fails, causes the test to be skipped. Useful if "
38312 "testing a command which might not work on all variations of libguestfs "
38313 "builds. A test that has prerequisite of C<Always> means to run "
38318 #: ../src/guestfs.pod:2770
38320 "In addition, packagers can skip individual tests by setting environment "
38321 "variables before running C<make check>."
38325 #: ../src/guestfs.pod:2773
38328 " SKIP_TEST_<CMD>_<NUM>=1\n"
38333 #: ../src/guestfs.pod:2775
38334 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38338 #: ../src/guestfs.pod:2777
38343 #: ../src/guestfs.pod:2779
38346 " SKIP_TEST_<CMD>=1\n"
38351 #: ../src/guestfs.pod:2781
38352 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38356 #: ../src/guestfs.pod:2783
38357 msgid "Packagers can run only certain tests by setting for example:"
38361 #: ../src/guestfs.pod:2785
38364 " TEST_ONLY=\"vfs_type zerofree\"\n"
38369 #: ../src/guestfs.pod:2787
38371 "See C<capitests/tests.c> for more details of how these environment variables "
38376 #: ../src/guestfs.pod:2790
38377 msgid "DEBUGGING NEW API ACTIONS"
38381 #: ../src/guestfs.pod:2792
38382 msgid "Test new actions work before submitting them."
38386 #: ../src/guestfs.pod:2794
38387 msgid "You can use guestfish to try out new commands."
38391 #: ../src/guestfs.pod:2796
38393 "Debugging the daemon is a problem because it runs inside a minimal "
38394 "environment. However you can fprintf messages in the daemon to stderr, and "
38395 "they will show up if you use C<guestfish -v>."
38399 #: ../src/guestfs.pod:2800
38400 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38404 #: ../src/guestfs.pod:2802
38406 "Our C source code generally adheres to some basic code-formatting "
38407 "conventions. The existing code base is not totally consistent on this "
38408 "front, but we do prefer that contributed code be formatted similarly. In "
38409 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38410 "indentation level, and other than that, follow the K&R style."
38414 #: ../src/guestfs.pod:2808
38416 "If you use Emacs, add the following to one of one of your start-up files (e."
38417 "g., ~/.emacs), to help ensure that you get indentation right:"
38421 #: ../src/guestfs.pod:2811
38424 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38425 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38426 " (add-hook 'find-file-hook\n"
38427 " '(lambda () (if (and buffer-file-name\n"
38428 " (string-match \"/libguestfs\\\\>\"\n"
38429 " (buffer-file-name))\n"
38430 " (not (string-equal mode-name \"Change Log\"))\n"
38431 " (not (string-equal mode-name \"Makefile\")))\n"
38432 " (setq indent-tabs-mode nil))))\n"
38437 #: ../src/guestfs.pod:2821
38440 " ;;; When editing C sources in libguestfs, use this style.\n"
38441 " (defun libguestfs-c-mode ()\n"
38442 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38444 " (c-set-style \"K&R\")\n"
38445 " (setq c-indent-level 2)\n"
38446 " (setq c-basic-offset 2))\n"
38447 " (add-hook 'c-mode-hook\n"
38448 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38449 " (buffer-file-name))\n"
38450 " (libguestfs-c-mode))))\n"
38455 #: ../src/guestfs.pod:2833
38456 msgid "Enable warnings when compiling (and fix any problems this finds):"
38460 #: ../src/guestfs.pod:2836
38463 " ./configure --enable-gcc-warnings\n"
38468 #: ../src/guestfs.pod:2838
38469 msgid "Useful targets are:"
38473 #: ../src/guestfs.pod:2840
38476 " make syntax-check # checks the syntax of the C code\n"
38477 " make check # runs the test suite\n"
38482 #: ../src/guestfs.pod:2843
38483 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38487 #: ../src/guestfs.pod:2845
38489 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38490 "which are used to do shell quoting."
38494 #: ../src/guestfs.pod:2850
38499 #: ../src/guestfs.pod:2852
38501 "Simple shell quoted string. Any spaces or other shell characters are "
38506 #: ../src/guestfs.pod:2855
38511 #: ../src/guestfs.pod:2857
38513 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38518 #: ../src/guestfs.pod:2864
38521 " asprintf (&cmd, \"cat %R\", path);\n"
38526 #: ../src/guestfs.pod:2866
38527 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38531 #: ../src/guestfs.pod:2868
38533 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
38534 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
38535 "they are not passed via the shell (instead, straight to exec). You probably "
38536 "want to use the C<sysroot_path()> function however."
38540 #: ../src/guestfs.pod:2874
38541 msgid "SUBMITTING YOUR NEW API ACTIONS"
38545 #: ../src/guestfs.pod:2876
38547 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
38548 "libguestfs> and CC to L<rjones@redhat.com>."
38552 #: ../src/guestfs.pod:2880
38553 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38557 #: ../src/guestfs.pod:2882
38558 msgid "We support i18n (gettext anyhow) in the library."
38562 #: ../src/guestfs.pod:2884
38564 "However many messages come from the daemon, and we don't translate those at "
38565 "the moment. One reason is that the appliance generally has all locale files "
38566 "removed from it, because they take up a lot of space. So we'd have to readd "
38567 "some of those, as well as copying our PO files into the appliance."
38571 #: ../src/guestfs.pod:2890
38573 "Debugging messages are never translated, since they are intended for the "
38578 #: ../src/guestfs.pod:2893
38579 msgid "SOURCE CODE SUBDIRECTORIES"
38583 #: ../src/guestfs.pod:2897
38588 #: ../src/guestfs.pod:2899
38589 msgid "L<virt-alignment-scan(1)> command and documentation."
38593 #: ../src/guestfs.pod:2903
38594 msgid "The libguestfs appliance, build scripts and so on."
38598 #: ../src/guestfs.pod:2905
38599 msgid "C<capitests>"
38603 #: ../src/guestfs.pod:2907
38604 msgid "Automated tests of the C API."
38608 #: ../src/guestfs.pod:2909
38613 #: ../src/guestfs.pod:2911
38615 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38620 #: ../src/guestfs.pod:2914
38625 #: ../src/guestfs.pod:2916
38627 "Safety and liveness tests of components that libguestfs depends upon (not of "
38628 "libguestfs itself). Mainly this is for qemu and the kernel."
38632 #: ../src/guestfs.pod:2919
38637 #: ../src/guestfs.pod:2921
38639 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38640 "command and documentation."
38644 #: ../src/guestfs.pod:2924
38649 #: ../src/guestfs.pod:2926
38650 msgid "Outside contributions, experimental parts."
38654 #: ../src/guestfs.pod:2928
38659 #: ../src/guestfs.pod:2930
38661 "The daemon that runs inside the libguestfs appliance and carries out actions."
38665 #: ../src/guestfs.pod:2933
38670 #: ../src/guestfs.pod:2935
38671 msgid "L<virt-df(1)> command and documentation."
38675 #: ../src/guestfs.pod:2937
38680 #: ../src/guestfs.pod:2939
38681 msgid "L<virt-edit(1)> command and documentation."
38685 #: ../src/guestfs.pod:2941
38686 msgid "C<examples>"
38690 #: ../src/guestfs.pod:2943
38691 msgid "C API example code."
38695 #: ../src/guestfs.pod:2945
38700 #: ../src/guestfs.pod:2947
38702 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38703 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38704 "L<virt-tar-out(1)>."
38708 #: ../src/guestfs.pod:2951
38713 #: ../src/guestfs.pod:2953
38715 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38719 #: ../src/guestfs.pod:2955
38720 msgid "C<generator>"
38724 #: ../src/guestfs.pod:2957
38726 "The crucially important generator, used to automatically generate large "
38727 "amounts of boilerplate C code for things like RPC and bindings."
38731 #: ../src/guestfs.pod:2960
38736 #: ../src/guestfs.pod:2962
38737 msgid "Files used by the test suite."
38741 #: ../src/guestfs.pod:2964
38742 msgid "Some \"phony\" guest images which we test against."
38746 #: ../src/guestfs.pod:2966
38747 msgid "C<inspector>"
38751 #: ../src/guestfs.pod:2968
38752 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38756 #: ../src/guestfs.pod:2970
38761 #: ../src/guestfs.pod:2972
38762 msgid "Logo used on the website. The fish is called Arthur by the way."
38766 #: ../src/guestfs.pod:2974
38771 #: ../src/guestfs.pod:2976
38772 msgid "M4 macros used by autoconf."
38776 #: ../src/guestfs.pod:2978
38781 #: ../src/guestfs.pod:2980
38782 msgid "Translations of simple gettext strings."
38786 #: ../src/guestfs.pod:2982
38791 #: ../src/guestfs.pod:2984
38793 "The build infrastructure and PO files for translations of manpages and POD "
38794 "files. Eventually this will be combined with the C<po> directory, but that "
38795 "is rather complicated."
38799 #: ../src/guestfs.pod:2988
38800 msgid "C<regressions>"
38804 #: ../src/guestfs.pod:2990
38805 msgid "Regression tests."
38809 #: ../src/guestfs.pod:2992
38814 #: ../src/guestfs.pod:2994
38815 msgid "L<virt-rescue(1)> command and documentation."
38819 #: ../src/guestfs.pod:2996
38824 #: ../src/guestfs.pod:2998
38825 msgid "L<virt-resize(1)> command and documentation."
38829 #: ../src/guestfs.pod:3000
38830 msgid "C<sparsify>"
38834 #: ../src/guestfs.pod:3002
38835 msgid "L<virt-sparsify(1)> command and documentation."
38839 #: ../src/guestfs.pod:3004
38844 #: ../src/guestfs.pod:3006
38845 msgid "Source code to the C library."
38849 #: ../src/guestfs.pod:3008
38854 #: ../src/guestfs.pod:3010
38856 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38860 #: ../src/guestfs.pod:3012
38861 msgid "C<test-tool>"
38865 #: ../src/guestfs.pod:3014
38867 "Test tool for end users to test if their qemu/kernel combination will work "
38872 #: ../src/guestfs.pod:3017
38877 #: ../src/guestfs.pod:3019
38882 #: ../src/guestfs.pod:3021
38887 #: ../src/guestfs.pod:3023
38892 #: ../src/guestfs.pod:3025
38897 #: ../src/guestfs.pod:3027
38902 #: ../src/guestfs.pod:3029
38907 #: ../src/guestfs.pod:3031
38912 #: ../src/guestfs.pod:3033
38917 #: ../src/guestfs.pod:3035
38918 msgid "Language bindings."
38922 #: ../src/guestfs.pod:3039
38923 msgid "MAKING A STABLE RELEASE"
38927 #: ../src/guestfs.pod:3041
38929 "When we make a stable release, there are several steps documented here. See "
38930 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
38935 #: ../src/guestfs.pod:3049
38937 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
38941 #: ../src/guestfs.pod:3054
38942 msgid "Finalize RELEASE-NOTES."
38946 #: ../src/guestfs.pod:3058
38947 msgid "Update ROADMAP."
38951 #: ../src/guestfs.pod:3062
38952 msgid "Run C<src/api-support/update-from-tarballs.sh>."
38956 #: ../src/guestfs.pod:3066
38957 msgid "Push and pull from Transifex."
38961 #: ../src/guestfs.pod:3068
38966 #: ../src/guestfs.pod:3070
38974 #: ../src/guestfs.pod:3072
38975 msgid "to push the latest POT files to Transifex. Then run:"
38979 #: ../src/guestfs.pod:3074
38987 #: ../src/guestfs.pod:3076
38988 msgid "which is a wrapper to pull the latest translated C<*.po> files."
38992 #: ../src/guestfs.pod:3080
38994 "Create new stable and development directories under L<http://libguestfs.org/"
38999 #: ../src/guestfs.pod:3085
39000 msgid "Create the branch in git:"
39004 #: ../src/guestfs.pod:3087
39007 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39008 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39009 " git branch stable-1.XX\n"
39010 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39015 #: ../src/guestfs.pod:3094
39020 #: ../src/guestfs.pod:3096
39021 msgid "PROTOCOL LIMITS"
39025 #: ../src/guestfs.pod:3098
39027 "Internally libguestfs uses a message-based protocol to pass API calls and "
39028 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39029 "plenty more detail about this). The maximum message size used by the "
39030 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39031 "aware of this limit. The API calls which may be affected are individually "
39032 "documented, with a link back to this section of the documentation."
39036 #: ../src/guestfs.pod:3106
39038 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39039 "a simple string. Because this string is at some point internally encoded as "
39040 "a message, the maximum size that it can return is slightly under 4 MB. If "
39041 "the requested file is larger than this then you will get an error."
39045 #: ../src/guestfs.pod:3112
39047 "In order to transfer large files into and out of the guest filesystem, you "
39048 "need to use particular calls that support this. The sections L</UPLOADING> "
39049 "and L</DOWNLOADING> document how to do this."
39053 #: ../src/guestfs.pod:3116
39055 "You might also consider mounting the disk image using our FUSE filesystem "
39056 "support (L<guestmount(1)>)."
39060 #: ../src/guestfs.pod:3119
39061 msgid "MAXIMUM NUMBER OF DISKS"
39065 #: ../src/guestfs.pod:3121
39066 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39070 #: ../src/guestfs.pod:3124
39072 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39073 "slots. However febootstrap only understands disks with names C</dev/vda> "
39074 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39079 #: ../src/guestfs.pod:3129
39081 "We are working to substantially raise this limit in future versions but it "
39082 "requires complex changes to qemu."
39086 #: ../src/guestfs.pod:3132
39088 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39089 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39090 "requires changes to qemu."
39094 #: ../src/guestfs.pod:3136
39095 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39099 #: ../src/guestfs.pod:3138
39100 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39104 #: ../src/guestfs.pod:3140
39106 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
39107 "vda>, and C</dev/vda1> through C</dev/vda15>)."
39111 #: ../src/guestfs.pod:3143
39113 "If you attach a disk with more than 15 partitions, the extra partitions are "
39114 "ignored by libguestfs."
39118 #: ../src/guestfs.pod:3146
39119 msgid "MAXIMUM SIZE OF A DISK"
39123 #: ../src/guestfs.pod:3148
39124 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39128 #: ../src/guestfs.pod:3150
39130 "We have tested block devices up to 1 exabyte (2**60 or "
39131 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39136 #: ../src/guestfs.pod:3154
39138 "Although libguestfs probably does not impose any limit, the underlying host "
39139 "storage will. If you store disk images on a host ext4 filesystem, then the "
39140 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39141 "TB). If you store disk images as host logical volumes then you are limited "
39142 "by the maximum size of an LV."
39146 #: ../src/guestfs.pod:3160
39148 "For the hugest disk image files, we recommend using XFS on the host for "
39153 #: ../src/guestfs.pod:3163
39154 msgid "MAXIMUM SIZE OF A PARTITION"
39158 #: ../src/guestfs.pod:3165
39160 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39161 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39162 "address a partition located beyond 2 TB on the disk."
39166 #: ../src/guestfs.pod:3169
39168 "It is recommended that you use GPT partitions on disks which are larger than "
39169 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39170 "which are theoretically larger than the largest disk we could support."
39174 #: ../src/guestfs.pod:3174
39175 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39179 #: ../src/guestfs.pod:3176
39181 "This depends on the filesystem type. libguestfs itself does not impose any "
39182 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39183 "what these limits are."
39187 #: ../src/guestfs.pod:3180
39188 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39192 #: ../src/guestfs.pod:3182
39194 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
39195 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39196 "uploads and downloads."
39200 #: ../src/guestfs.pod:3186
39201 msgid "INSPECTION LIMITS"
39205 #: ../src/guestfs.pod:3188
39207 "The inspection code has several arbitrary limits on things like the size of "
39208 "Windows Registry hive it will read, and the length of product name. These "
39209 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39210 "memory and disk space on the host, and should not be reached in practice. "
39211 "See the source code for more information."
39215 #: ../src/guestfs.pod:3214
39217 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39218 "effect as calling C<guestfs_set_verbose (g, 1)>."
39222 #: ../src/guestfs.pod:3226
39224 "Set the path that libguestfs uses to search for a supermin appliance. See "
39225 "the discussion of paths in section L</PATH> above."
39229 #: ../src/guestfs.pod:3235
39230 msgid "See also L</QEMU WRAPPERS> above."
39234 #: ../src/guestfs.pod:3239
39236 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39237 "effect as calling C<guestfs_set_trace (g, 1)>."
39241 #: ../src/guestfs.pod:3257
39243 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
39244 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
39245 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
39246 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
39247 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39248 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
39249 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar"
39250 "(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
39251 "L<febootstrap(1)>, L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)"
39252 ">, L<http://libguestfs.org/>."
39256 #: ../src/guestfs.pod:3293
39258 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
39259 "(8)>, L<disktype(1)>."
39263 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553
39264 #: ../tools/virt-win-reg.pl:761
39269 #: ../src/guestfs.pod:3302
39270 msgid "To get a list of bugs against libguestfs use this link:"
39274 #: ../src/guestfs.pod:3304
39276 "L<https://bugzilla.redhat.com/buglist.cgi?"
39277 "component=libguestfs&product=Virtualization+Tools>"
39281 #: ../src/guestfs.pod:3306
39282 msgid "To report a new bug against libguestfs use this link:"
39286 #: ../src/guestfs.pod:3308
39288 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
39289 "component=libguestfs&product=Virtualization+Tools>"
39293 #: ../src/guestfs.pod:3310
39294 msgid "When reporting a bug, please check:"
39298 #: ../src/guestfs.pod:3316
39299 msgid "That the bug hasn't been reported already."
39303 #: ../src/guestfs.pod:3320
39304 msgid "That you are testing a recent version."
39308 #: ../src/guestfs.pod:3324
39309 msgid "Describe the bug accurately, and give a way to reproduce it."
39313 #: ../src/guestfs.pod:3328
39315 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39320 #: ../test-tool/libguestfs-test-tool.pod:5
39321 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39325 #: ../test-tool/libguestfs-test-tool.pod:9
39328 " libguestfs-test-tool [--options]\n"
39333 #: ../test-tool/libguestfs-test-tool.pod:13
39335 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39336 "to check basic libguestfs functionality is working. This is needed because "
39337 "libguestfs occasionally breaks for reasons beyond our control: usually "
39338 "because of changes in the underlying qemu or kernel packages, or the host "
39343 #: ../test-tool/libguestfs-test-tool.pod:19
39344 msgid "If you suspect a problem in libguestfs, then just run:"
39348 #: ../test-tool/libguestfs-test-tool.pod:21
39351 " libguestfs-test-tool\n"
39356 #: ../test-tool/libguestfs-test-tool.pod:23
39357 msgid "It will print lots of diagnostic messages."
39361 #: ../test-tool/libguestfs-test-tool.pod:25
39362 msgid "If it runs to completion successfully, you will see this near the end:"
39366 #: ../test-tool/libguestfs-test-tool.pod:27
39369 " ===== TEST FINISHED OK =====\n"
39374 #: ../test-tool/libguestfs-test-tool.pod:29
39375 msgid "and the test tool will exit with code 0."
39379 #: ../test-tool/libguestfs-test-tool.pod:31
39381 "If it fails (and/or exits with non-zero error code), please paste the "
39382 "I<complete, unedited> output of the test tool into a bug report. More "
39383 "information about reporting bugs can be found on the L<http://libguestfs.org/"
39388 #: ../test-tool/libguestfs-test-tool.pod:42
39389 msgid "Display short usage information and exit."
39393 #: ../test-tool/libguestfs-test-tool.pod:44
39394 msgid "B<--qemu qemu_binary>"
39398 #: ../test-tool/libguestfs-test-tool.pod:46
39400 "If you have downloaded another qemu binary, point this option at the full "
39401 "path of the binary to try it."
39405 #: ../test-tool/libguestfs-test-tool.pod:49
39406 msgid "B<--qemudir qemu_source_dir>"
39410 #: ../test-tool/libguestfs-test-tool.pod:51
39412 "If you have compiled qemu from source, point this option at the source "
39413 "directory to try it."
39417 #: ../test-tool/libguestfs-test-tool.pod:54
39422 #: ../test-tool/libguestfs-test-tool.pod:56
39423 msgid "B<--timeout N>"
39427 #: ../test-tool/libguestfs-test-tool.pod:58
39429 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39430 "minutes) which does not usually need to be adjusted."
39434 #: ../test-tool/libguestfs-test-tool.pod:63
39435 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39439 #: ../test-tool/libguestfs-test-tool.pod:65
39441 "If you have compiled another version of qemu from source and would like to "
39442 "try that, then you can use the I<--qemudir> option to point to the qemu "
39443 "source directory."
39447 #: ../test-tool/libguestfs-test-tool.pod:69
39449 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39450 "option to point to the binary."
39454 #: ../test-tool/libguestfs-test-tool.pod:72
39456 "Note when using these options, you can ignore the business of qemu wrapper "
39457 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39458 "wrapper script for you if one is needed."
39462 #: ../test-tool/libguestfs-test-tool.pod:76
39463 msgid "TRYING OUT A DIFFERENT KERNEL"
39467 #: ../test-tool/libguestfs-test-tool.pod:78
39469 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39470 "libguestfs tries. You do this by setting the environment variables "
39471 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39475 #: ../test-tool/libguestfs-test-tool.pod:82
39477 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39482 #: ../test-tool/libguestfs-test-tool.pod:85
39483 msgid "SELF-DIAGNOSIS"
39487 #: ../test-tool/libguestfs-test-tool.pod:87
39489 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39490 "produced by libguestfs-test-tool and/or possible errors."
39494 #: ../test-tool/libguestfs-test-tool.pod:92
39496 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39497 "I<1> if there was an error."
39501 #: ../test-tool/libguestfs-test-tool.pod:97
39503 "For the full list of environment variables which may affect libguestfs, "
39504 "please see the L<guestfs(3)> manual page."
39508 #: ../test-tool/libguestfs-test-tool.pod:102
39509 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39513 #: ../tools/virt-list-filesystems.pl:32
39515 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39519 #: ../tools/virt-list-filesystems.pl:36
39522 " virt-list-filesystems [--options] domname\n"
39527 #: ../tools/virt-list-filesystems.pl:38
39530 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39535 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39537 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39542 #: ../tools/virt-list-filesystems.pl:45
39544 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39545 "are contained in a virtual machine or disk image."
39549 #: ../tools/virt-list-filesystems.pl:49
39551 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39552 "functionality. For more complex cases you should look at the L<guestfish(1)"
39557 #: ../tools/virt-list-filesystems.pl:112
39559 "With this option, C<virt-list-filesystems> displays the type of each "
39560 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
39564 #: ../tools/virt-list-filesystems.pl:119
39569 #: ../tools/virt-list-filesystems.pl:123
39571 "Normally we only show mountable filesystems. If this option is given then "
39572 "swap devices are shown too."
39576 #: ../tools/virt-list-filesystems.pl:197
39578 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
39579 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
39580 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39584 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
39585 msgid "Copyright (C) 2009 Red Hat Inc."
39589 #: ../tools/virt-list-partitions.pl:32
39591 "virt-list-partitions - List partitions in a virtual machine or disk image"
39595 #: ../tools/virt-list-partitions.pl:36
39598 " virt-list-partitions [--options] domname\n"
39603 #: ../tools/virt-list-partitions.pl:38
39606 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39611 #: ../tools/virt-list-partitions.pl:45
39613 "C<virt-list-partitions> is a command line tool to list the partitions that "
39614 "are contained in a virtual machine or disk image. It is mainly useful as a "
39615 "first step to using L<virt-resize(1)>."
39619 #: ../tools/virt-list-partitions.pl:50
39621 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39622 "functionality. For more complex cases you should look at the L<guestfish(1)"
39627 #: ../tools/virt-list-partitions.pl:113
39628 msgid "Show sizes in human-readable form (eg. \"1G\")."
39632 #: ../tools/virt-list-partitions.pl:123
39634 "With this option, C<virt-list-partitions> displays the type and size of each "
39635 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39639 #: ../tools/virt-list-partitions.pl:130
39644 #: ../tools/virt-list-partitions.pl:132
39649 #: ../tools/virt-list-partitions.pl:134
39651 "Display the total size of each block device (as a separate row or rows)."
39655 #: ../tools/virt-list-partitions.pl:267
39657 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
39658 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
39659 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39663 #: ../tools/virt-list-partitions.pl:283
39664 msgid "Copyright (C) 2009-2010 Red Hat Inc."
39668 #: ../tools/virt-make-fs.pl:37
39669 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
39673 #: ../tools/virt-make-fs.pl:41
39676 " virt-make-fs [--options] input.tar output.img\n"
39681 #: ../tools/virt-make-fs.pl:43
39684 " virt-make-fs [--options] input.tar.gz output.img\n"
39689 #: ../tools/virt-make-fs.pl:45
39692 " virt-make-fs [--options] directory output.img\n"
39697 #: ../tools/virt-make-fs.pl:49
39699 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39700 "archive or some files in a directory. It is similar to tools like L<mkisofs"
39701 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
39702 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
39703 "you want to attach these filesystems to existing virtual machines (eg. to "
39704 "import large amounts of read-only data to a VM)."
39708 #: ../tools/virt-make-fs.pl:57
39709 msgid "Basic usage is:"
39713 #: ../tools/virt-make-fs.pl:59
39716 " virt-make-fs input output\n"
39721 #: ../tools/virt-make-fs.pl:61
39723 "where C<input> is either a directory containing files that you want to add, "
39724 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39725 "C<output> is a disk image. The input type is detected automatically. The "
39726 "output disk image defaults to a raw ext2 image unless you specify extra "
39727 "flags (see L</OPTIONS> below)."
39731 #: ../tools/virt-make-fs.pl:67
39732 msgid "EXTRA SPACE"
39736 #: ../tools/virt-make-fs.pl:69
39738 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39739 "the files that it contains, but might have extra space. Depending on how "
39740 "you are going to use the output, you might think this extra space is wasted "
39741 "and want to minimize it, or you might want to leave space so that more files "
39742 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39743 "but you can use the I<--size> flag to leave space in the filesystem if you "
39748 #: ../tools/virt-make-fs.pl:77
39750 "An alternative way to leave extra space but not make the output image any "
39751 "bigger is to use an alternative disk image format (instead of the default "
39752 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39753 "image format (check your hypervisor supports this before using it). This "
39754 "allows you to choose a large I<--size> but the extra space won't actually be "
39755 "allocated in the image until you try to store something in it."
39759 #: ../tools/virt-make-fs.pl:85
39761 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39762 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39763 "to build another image from scratch."
39767 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
39768 #: ../tools/virt-make-fs.pl:142
39773 #: ../tools/virt-make-fs.pl:91
39776 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39781 #: ../tools/virt-make-fs.pl:93
39782 msgid "FILESYSTEM TYPE"
39786 #: ../tools/virt-make-fs.pl:95
39788 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39789 "libguestfs supports can be used (but I<not> read-only formats like "
39790 "ISO9660). Here are some of the more common choices:"
39794 #: ../tools/virt-make-fs.pl:101
39799 #: ../tools/virt-make-fs.pl:103
39801 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39802 "you are not going to use the filesystem in a way that requires the journal, "
39803 "then this is just wasted overhead."
39807 #: ../tools/virt-make-fs.pl:107
39808 msgid "I<ntfs> or I<vfat>"
39812 #: ../tools/virt-make-fs.pl:109
39813 msgid "Useful if exporting data to a Windows guest."
39817 #: ../tools/virt-make-fs.pl:111
39819 "I<Note for vfat>: The tar archive or local directory must only contain files "
39820 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39821 "program running within libguestfs is unable to change the ownership of non-"
39822 "root files, since vfat itself does not support this."
39826 #: ../tools/virt-make-fs.pl:116
39831 #: ../tools/virt-make-fs.pl:118
39833 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39834 "total filesystem size."
39838 #: ../tools/virt-make-fs.pl:125
39841 " virt-make-fs --type=minix input minixfs.img\n"
39846 #: ../tools/virt-make-fs.pl:127
39847 msgid "TO PARTITION OR NOT TO PARTITION"
39851 #: ../tools/virt-make-fs.pl:129
39852 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39856 #: ../tools/virt-make-fs.pl:131
39858 "Adding a partition can make the disk image more compatible with certain "
39859 "virtualized operating systems which don't expect to see a filesystem "
39860 "directly located on a block device (Linux doesn't care and will happily "
39861 "handle both types)."
39865 #: ../tools/virt-make-fs.pl:136
39867 "On the other hand, if you have a partition table then the output image is no "
39868 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39869 "directly on a partitioned disk image. (However libguestfs tools such as "
39870 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39874 #: ../tools/virt-make-fs.pl:144
39875 msgid "Add an MBR partition:"
39879 #: ../tools/virt-make-fs.pl:146
39882 " virt-make-fs --partition -- input disk.img\n"
39887 #: ../tools/virt-make-fs.pl:148
39889 "If the output disk image could be terabyte-sized or larger, it's better to "
39890 "use an EFI/GPT-compatible partition table:"
39894 #: ../tools/virt-make-fs.pl:151
39897 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39902 #: ../tools/virt-make-fs.pl:179
39903 msgid "Enable debugging information."
39907 #: ../tools/virt-make-fs.pl:185
39908 msgid "B<--size=E<lt>NE<gt>>"
39912 #: ../tools/virt-make-fs.pl:187
39913 msgid "B<--size=+E<lt>NE<gt>>"
39917 #: ../tools/virt-make-fs.pl:189
39918 msgid "B<-s E<lt>NE<gt>>"
39922 #: ../tools/virt-make-fs.pl:191
39923 msgid "B<-s +E<lt>NE<gt>>"
39927 #: ../tools/virt-make-fs.pl:193
39929 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39933 #: ../tools/virt-make-fs.pl:196
39935 "If this option is I<not> given, then the output image will be just large "
39936 "enough to contain all the files, with not much wasted space."
39940 #: ../tools/virt-make-fs.pl:199
39942 "To choose a fixed size output disk, specify an absolute number followed by b/"
39943 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39944 "Petabytes or Exabytes. This must be large enough to contain all the input "
39945 "files, else you will get an error."
39949 #: ../tools/virt-make-fs.pl:204
39951 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
39952 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39953 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
39954 "the input files, and (approximately) an extra 200 MB free space."
39958 #: ../tools/virt-make-fs.pl:210
39960 "Note that virt-make-fs estimates free space, and therefore will not produce "
39961 "filesystems containing precisely the free space requested. (It is much more "
39962 "expensive and time-consuming to produce a filesystem which has precisely the "
39963 "desired free space)."
39967 #: ../tools/virt-make-fs.pl:219
39968 msgid "B<--format=E<lt>fmtE<gt>>"
39972 #: ../tools/virt-make-fs.pl:221
39973 msgid "B<-F E<lt>fmtE<gt>>"
39977 #: ../tools/virt-make-fs.pl:223
39978 msgid "Choose the output disk image format."
39982 #: ../tools/virt-make-fs.pl:225
39983 msgid "The default is C<raw> (raw disk image)."
39987 #: ../tools/virt-make-fs.pl:227
39989 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
39990 "that would really make sense here is C<qcow2>."
39994 #: ../tools/virt-make-fs.pl:234
39995 msgid "B<--type=E<lt>fsE<gt>>"
39999 #: ../tools/virt-make-fs.pl:236
40000 msgid "B<-t E<lt>fsE<gt>>"
40004 #: ../tools/virt-make-fs.pl:238
40005 msgid "Choose the output filesystem type."
40009 #: ../tools/virt-make-fs.pl:240
40010 msgid "The default is C<ext2>."
40014 #: ../tools/virt-make-fs.pl:242
40016 "Any filesystem which is supported read-write by libguestfs can be used here."
40020 #: ../tools/virt-make-fs.pl:249
40021 msgid "B<--partition>"
40025 #: ../tools/virt-make-fs.pl:251
40026 msgid "B<--partition=E<lt>parttypeE<gt>>"
40030 #: ../tools/virt-make-fs.pl:253
40032 "If specified, this flag adds an MBR partition table to the output disk image."
40036 #: ../tools/virt-make-fs.pl:256
40038 "You can change the partition table type, eg. I<--partition=gpt> for large "
40043 #: ../tools/virt-make-fs.pl:259
40045 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40046 "might consider the next parameter to be the partition type. For example:"
40050 #: ../tools/virt-make-fs.pl:263
40053 " virt-make-fs --partition input.tar ...\n"
40058 #: ../tools/virt-make-fs.pl:265
40060 "would cause virt-make-fs to think you wanted to use a partition type of "
40061 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40062 "dash) between options and the input file argument:"
40066 #: ../tools/virt-make-fs.pl:269
40069 " virt-make-fs --partition -- input.tar ...\n"
40074 #: ../tools/virt-make-fs.pl:541
40076 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40077 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
40078 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40082 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
40084 "When reporting bugs, please enable debugging and capture the I<complete> "
40089 #: ../tools/virt-make-fs.pl:558
40092 " export LIBGUESTFS_DEBUG=1\n"
40093 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40098 #: ../tools/virt-make-fs.pl:561
40100 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
40105 #: ../tools/virt-tar.pl:33
40106 msgid "virt-tar - Extract or upload files to a virtual machine"
40110 #: ../tools/virt-tar.pl:37
40113 " virt-tar [--options] -x domname directory tarball\n"
40118 #: ../tools/virt-tar.pl:39
40121 " virt-tar [--options] -u domname tarball directory\n"
40126 #: ../tools/virt-tar.pl:41
40129 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40134 #: ../tools/virt-tar.pl:43
40137 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40142 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40147 #: ../tools/virt-tar.pl:47
40149 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
40150 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
40154 #: ../tools/virt-tar.pl:52
40155 msgid "Download C</home> from the VM into a local tarball:"
40159 #: ../tools/virt-tar.pl:54
40162 " virt-tar -x domname /home home.tar\n"
40167 #: ../tools/virt-tar.pl:56
40170 " virt-tar -zx domname /home home.tar.gz\n"
40175 #: ../tools/virt-tar.pl:58
40176 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40180 #: ../tools/virt-tar.pl:60
40183 " virt-tar -u domname uploadstuff.tar /tmp\n"
40188 #: ../tools/virt-tar.pl:62
40191 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40196 #: ../tools/virt-tar.pl:66
40198 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40199 "virtual machines. If you do this, you risk disk corruption in the VM. "
40200 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40204 #: ../tools/virt-tar.pl:71
40206 "You can use I<-x> (extract) on live virtual machines, but you might get "
40207 "inconsistent results or errors if there is filesystem activity inside the "
40208 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40209 "work, but the only way to guarantee consistent results is if the virtual "
40210 "machine is shut down."
40214 #: ../tools/virt-tar.pl:79
40216 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40217 "parts of a guest filesystem. There are many possibilities: making backups, "
40218 "uploading data files, snooping on guest activity, fixing or customizing "
40223 #: ../tools/virt-tar.pl:84
40225 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40226 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40227 "should look at the L<guestfish(1)> tool."
40231 #: ../tools/virt-tar.pl:88
40233 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40234 "its contents (recursively) from the virtual machine into a local tarball. "
40235 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40236 "virtual machine. You cannot use these two options together."
40240 #: ../tools/virt-tar.pl:94
40242 "In addition, you may need to use the I<-z> (gZip) option to enable "
40243 "compression. When uploading, you have to specify I<-z> if the upload file "
40244 "is compressed because virt-tar won't detect this on its own."
40248 #: ../tools/virt-tar.pl:98
40250 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40251 "example it cannot do PKZip files or bzip2 compression. If you want that "
40252 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40253 "the L<libguestfs(3)> API)."
40257 #: ../tools/virt-tar.pl:160
40258 msgid "B<--extract>"
40262 #: ../tools/virt-tar.pl:162
40263 msgid "B<--download>"
40267 #: ../tools/virt-tar.pl:164
40272 #: ../tools/virt-tar.pl:166
40273 msgid "B<--upload>"
40277 #: ../tools/virt-tar.pl:168
40279 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40284 #: ../tools/virt-tar.pl:171
40286 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40287 "Please read the L</WARNING> section above before using this option."
40291 #: ../tools/virt-tar.pl:175
40292 msgid "You must specify exactly one of these options."
40296 #: ../tools/virt-tar.pl:181
40301 #: ../tools/virt-tar.pl:183
40306 #: ../tools/virt-tar.pl:185
40307 msgid "Specify that the input or output tarball is gzip-compressed."
40311 #: ../tools/virt-tar.pl:298
40313 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
40314 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
40315 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
40320 #: ../tools/virt-win-reg.pl:37
40322 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
40326 #: ../tools/virt-win-reg.pl:41
40329 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40334 #: ../tools/virt-win-reg.pl:43
40337 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40342 #: ../tools/virt-win-reg.pl:45
40345 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40350 #: ../tools/virt-win-reg.pl:47
40353 " virt-win-reg --merge domname [input.reg ...]\n"
40358 #: ../tools/virt-win-reg.pl:49
40361 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40366 #: ../tools/virt-win-reg.pl:53
40368 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40369 "virtual machines. If you do this, you I<will> get irreversible disk "
40370 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40371 "but doesn't catch all cases."
40375 #: ../tools/virt-win-reg.pl:58
40377 "Modifying the Windows Registry is an inherently risky operation. The format "
40378 "is deliberately obscure and undocumented, and Registry changes can leave the "
40379 "system unbootable. Therefore when using the I<--merge> option, make sure "
40380 "you have a reliable backup first."
40384 #: ../tools/virt-win-reg.pl:65
40386 "This program can export and merge Windows Registry entries from a Windows "
40391 #: ../tools/virt-win-reg.pl:68
40393 "The first parameter is the libvirt guest name or the raw disk image of a "
40398 #: ../tools/virt-win-reg.pl:71
40400 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
40401 "exported (recursively). For example:"
40405 #: ../tools/virt-win-reg.pl:74
40408 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40413 #: ../tools/virt-win-reg.pl:76
40415 "You can also display single values from within registry keys, for example:"
40419 #: ../tools/virt-win-reg.pl:79
40422 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40423 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40424 " Windows 7 Enterprise\n"
40429 #: ../tools/virt-win-reg.pl:83
40431 "With I<--merge>, you can merge a textual regedit file into the Windows "
40436 #: ../tools/virt-win-reg.pl:86
40439 " $ virt-win-reg --merge Windows7 changes.reg\n"
40444 #: ../tools/virt-win-reg.pl:90
40446 "This program is only meant for simple access to the registry. If you want "
40447 "to do complicated things with the registry, we suggest you download the "
40448 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40449 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40450 "L<hivexregedit(1)>."
40454 #: ../tools/virt-win-reg.pl:159
40459 #: ../tools/virt-win-reg.pl:161
40461 "In merge mode, this merges a textual regedit file into the Windows Registry "
40462 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40463 "displays or exports Registry entries instead."
40467 #: ../tools/virt-win-reg.pl:165
40469 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40470 "result in disk corruption. However exporting (without this flag) is always "
40475 #: ../tools/virt-win-reg.pl:173
40476 msgid "B<--encoding> UTF-16LE|ASCII"
40480 #: ../tools/virt-win-reg.pl:175
40482 "When merging (only), you may need to specify the encoding for strings to be "
40483 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
40484 "(3)/ENCODING STRINGS>."
40488 #: ../tools/virt-win-reg.pl:179
40490 "The default is to use UTF-16LE, which should work with recent versions of "
40495 #: ../tools/virt-win-reg.pl:186
40496 msgid "B<--unsafe-printable-strings>"
40500 #: ../tools/virt-win-reg.pl:188
40502 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40503 "instead of hex sequences. Remove the final zero codepoint from strings if "
40508 #: ../tools/virt-win-reg.pl:192
40510 "This is unsafe and does not preserve the fidelity of strings in the original "
40511 "Registry for various reasons:"
40515 #: ../tools/virt-win-reg.pl:199
40517 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40518 "other encodings will be corrupted by this transformation."
40522 #: ../tools/virt-win-reg.pl:204
40524 "Assumes that everything which has type 1 or 2 is really a string and that "
40525 "everything else is not a string, but the type field in real Registries is "
40530 #: ../tools/virt-win-reg.pl:210
40532 "Loses information about whether a zero codepoint followed the string in the "
40537 #: ../tools/virt-win-reg.pl:215
40539 "This all happens because the Registry itself contains no information about "
40540 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40544 #: ../tools/virt-win-reg.pl:219
40546 "You should only use this option for quick hacking and debugging of the "
40547 "Registry contents, and I<never> use it if the output is going to be passed "
40548 "into another program or stored in another Registry."
40552 #: ../tools/virt-win-reg.pl:556
40553 msgid "SUPPORTED SYSTEMS"
40557 #: ../tools/virt-win-reg.pl:558
40559 "The program currently supports Windows NT-derived guests starting with "
40560 "Windows XP through to at least Windows 7."
40564 #: ../tools/virt-win-reg.pl:561
40565 msgid "The following Registry keys are supported:"
40569 #: ../tools/virt-win-reg.pl:565
40570 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
40574 #: ../tools/virt-win-reg.pl:567
40575 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
40579 #: ../tools/virt-win-reg.pl:569
40580 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
40584 #: ../tools/virt-win-reg.pl:571
40585 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
40589 #: ../tools/virt-win-reg.pl:573
40590 msgid "C<HKEY_USERS\\.DEFAULT>"
40594 #: ../tools/virt-win-reg.pl:575
40595 msgid "C<HKEY_USERS\\I<SID>>"
40599 #: ../tools/virt-win-reg.pl:577
40600 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40604 #: ../tools/virt-win-reg.pl:579
40605 msgid "C<HKEY_USERS\\I<username>>"
40609 #: ../tools/virt-win-reg.pl:581
40611 "where I<username> is a local user name (this is a libguestfs extension)."
40615 #: ../tools/virt-win-reg.pl:585
40617 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40622 #: ../tools/virt-win-reg.pl:588
40624 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40625 "supported (there is no \"current user\")."
40629 #: ../tools/virt-win-reg.pl:591
40634 #: ../tools/virt-win-reg.pl:593
40636 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40637 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
40638 "style line endings. Since Windows regedit files are often in UTF-16LE with "
40639 "Windows-style line endings, you may need to reencode the whole file before "
40640 "or after processing."
40644 #: ../tools/virt-win-reg.pl:599
40646 "To reencode a file from Windows format to Linux (before processing it with "
40647 "the I<--merge> option), you would do something like this:"
40651 #: ../tools/virt-win-reg.pl:602
40654 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40659 #: ../tools/virt-win-reg.pl:604
40661 "To go in the opposite direction, after exporting and before sending the file "
40662 "to a Windows user, do something like this:"
40666 #: ../tools/virt-win-reg.pl:607
40669 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
40674 #: ../tools/virt-win-reg.pl:609
40675 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
40679 #: ../tools/virt-win-reg.pl:611
40681 "If you are unsure about the current encoding, use the L<file(1)> command. "
40682 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
40683 "style (CRLF) line endings, like this:"
40687 #: ../tools/virt-win-reg.pl:615
40690 " $ file software.reg\n"
40691 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
40692 " with CRLF line terminators\n"
40697 #: ../tools/virt-win-reg.pl:619
40698 msgid "This file would need conversion before you could I<--merge> it."
40702 #: ../tools/virt-win-reg.pl:621
40703 msgid "CurrentControlSet etc."
40707 #: ../tools/virt-win-reg.pl:623
40709 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40710 "Registry at the level of the hive file, and therefore you cannot modify "
40715 #: ../tools/virt-win-reg.pl:627
40717 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40718 "circumstances it might refer to another control set. The way to find out is "
40719 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40723 #: ../tools/virt-win-reg.pl:631
40726 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40727 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40728 " \"Current\"=dword:00000001\n"
40729 " \"Default\"=dword:00000001\n"
40730 " \"Failed\"=dword:00000000\n"
40731 " \"LastKnownGood\"=dword:00000002\n"
40736 #: ../tools/virt-win-reg.pl:638
40737 msgid "\"Current\" is the one which Windows will choose when it boots."
40741 #: ../tools/virt-win-reg.pl:640
40743 "Similarly, other C<Current...> keys in the path may need to be replaced."
40747 #: ../tools/virt-win-reg.pl:643
40748 msgid "WINDOWS TIPS"
40752 #: ../tools/virt-win-reg.pl:645
40754 "Note that some of these tips modify the guest disk image. The guest I<must> "
40755 "be shut off, else you will get disk corruption."
40759 #: ../tools/virt-win-reg.pl:648
40760 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40764 #: ../tools/virt-win-reg.pl:650
40766 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40767 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40768 "is uploaded into C<C:\\>:"
40772 #: ../tools/virt-win-reg.pl:654
40775 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40780 #: ../tools/virt-win-reg.pl:656
40781 msgid "Prepare a regedit file containing the registry change:"
40785 #: ../tools/virt-win-reg.pl:658
40788 " cat > test.reg <<'EOF'\n"
40789 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40790 " \"Test\"=\"c:\\\\test.bat\"\n"
40796 #: ../tools/virt-win-reg.pl:663
40798 "In this example we use the key C<RunOnce> which means that the script will "
40799 "run precisely once when the first user logs in. If you want it to run every "
40800 "time a user logs in, replace C<RunOnce> with C<Run>."
40804 #: ../tools/virt-win-reg.pl:667
40805 msgid "Now update the registry:"
40809 #: ../tools/virt-win-reg.pl:669
40812 " virt-win-reg --merge WindowsGuest test.reg\n"
40817 #: ../tools/virt-win-reg.pl:671
40818 msgid "INSTALLING A SERVICE"
40822 #: ../tools/virt-win-reg.pl:673
40824 "This section assumes you are familiar with Windows services, and you either "
40825 "have a program which handles the Windows Service Control Protocol directly "
40826 "or you want to run any program using a service wrapper like SrvAny or the "
40831 #: ../tools/virt-win-reg.pl:678
40833 "First upload the program and optionally the service wrapper. In this case "
40834 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
40838 #: ../tools/virt-win-reg.pl:682
40841 " guestfish -i -d WindowsGuest <<EOF\n"
40842 " upload rhsrvany.exe /rhsrvany.exe\n"
40843 " upload test.exe /test.exe\n"
40849 #: ../tools/virt-win-reg.pl:687
40851 "Prepare a regedit file containing the registry changes. In this example, "
40852 "the first registry change is needed for the service itself or the service "
40853 "wrapper (if used). The second registry change is only needed because I am "
40854 "using the RHSrvAny service wrapper."
40858 #: ../tools/virt-win-reg.pl:692
40861 " cat > service.reg <<'EOF'\n"
40862 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40863 " \"Type\"=dword:00000010\n"
40864 " \"Start\"=dword:00000002\n"
40865 " \"ErrorControl\"=dword:00000001\n"
40866 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40867 " \"DisplayName\"=\"RHSrvAny\"\n"
40868 " \"ObjectName\"=\"NetworkService\"\n"
40873 #: ../tools/virt-win-reg.pl:701
40876 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40877 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40878 " \"PWD\"=\"c:\\\\Temp\"\n"
40884 #: ../tools/virt-win-reg.pl:712
40886 "For use of C<ControlSet001> see the section above in this manual page. You "
40887 "may need to adjust this according to the control set that is in use by the "
40892 #: ../tools/virt-win-reg.pl:718
40894 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40895 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40896 "privileged account."
40900 #: ../tools/virt-win-reg.pl:724
40902 "For the meaning of the magic numbers, see this Microsoft KB article: "
40903 "L<http://support.microsoft.com/kb/103000>."
40907 #: ../tools/virt-win-reg.pl:729
40908 msgid "Update the registry:"
40912 #: ../tools/virt-win-reg.pl:731
40915 " virt-win-reg --merge WindowsGuest service.reg\n"
40920 #: ../tools/virt-win-reg.pl:735
40922 "Be careful when passing parameters containing C<\\> (backslash) in the "
40923 "shell. Usually you will have to use 'single quotes' or double backslashes "
40924 "(but not both) to protect them from the shell."
40928 #: ../tools/virt-win-reg.pl:739
40929 msgid "Paths and value names are case-insensitive."
40933 #: ../tools/virt-win-reg.pl:748
40935 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
40936 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
40937 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40941 #: ../tools/virt-win-reg.pl:766
40944 " export LIBGUESTFS_DEBUG=1\n"
40945 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
40950 #: ../tools/virt-win-reg.pl:769
40952 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."