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-05 18:11+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 ../df/virt-df.pod:3
24 #: ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3
25 #: ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14
26 #: ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3
27 #: ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3
28 #: ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3
29 #: ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3
30 #: ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3
31 #: ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3
32 #: ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3
33 #: ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3
34 #: ../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 ../df/virt-df.pod:7
49 #: ../edit/virt-edit.pod:7 ../erlang/examples/guestfs-erlang.pod:7
50 #: ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7
51 #: ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7
52 #: ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7
53 #: ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7
54 #: ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7
55 #: ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7
56 #: ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7
57 #: ../ruby/examples/guestfs-ruby.pod:7 ../sparsify/virt-sparsify.pod:7
58 #: ../src/guestfs.pod:7 ../test-tool/libguestfs-test-tool.pod:7
59 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
60 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
61 #: ../tools/virt-win-reg.pl:39
66 #: ../align/virt-alignment-scan.pod:9
69 " virt-alignment-scan [--options]\n"
74 #: ../align/virt-alignment-scan.pod:11
77 " virt-alignment-scan [--options] -d domname\n"
82 #: ../align/virt-alignment-scan.pod:13
85 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
90 #: ../align/virt-alignment-scan.pod:15 ../cat/virt-cat.pod:19
91 #: ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../df/virt-df.pod:21
92 #: ../edit/virt-edit.pod:27 ../erlang/examples/guestfs-erlang.pod:16
93 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
94 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
95 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
96 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
97 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
98 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
99 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
100 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
101 #: ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23
102 #: ../test-tool/libguestfs-test-tool.pod:11
103 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
104 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
105 #: ../tools/virt-win-reg.pl:63
110 #: ../align/virt-alignment-scan.pod:17
112 "When older operating systems install themselves, the partitioning tools "
113 "place partitions at a sector misaligned with the underlying storage "
114 "(commonly the first partition starts on sector C<63>). Misaligned "
115 "partitions can result in an operating system issuing more I/O than should be "
120 #: ../align/virt-alignment-scan.pod:23
122 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
123 "machines and disk images and warns you if there are alignment problems."
127 #: ../align/virt-alignment-scan.pod:27
129 "Currently there is no virt tool for fixing alignment problems, except to "
130 "reinstall the operating system. The following NetApp document summarises "
131 "the problem and possible solutions: L<http://media.netapp.com/documents/"
136 #: ../align/virt-alignment-scan.pod:32
141 #: ../align/virt-alignment-scan.pod:34
142 msgid "To run this tool on a disk image directly, use the I<-a> option:"
146 #: ../align/virt-alignment-scan.pod:36
149 " $ virt-alignment-scan -a winxp.img\n"
150 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
155 #: ../align/virt-alignment-scan.pod:39
158 " $ virt-alignment-scan -a fedora16.img\n"
159 " /dev/sda1 1048576 1024K ok\n"
160 " /dev/sda2 2097152 2048K ok\n"
161 " /dev/sda3 526385152 2048K ok\n"
166 #: ../align/virt-alignment-scan.pod:44
168 "To run the tool on a guest known to libvirt, use the I<-d> option and "
169 "possibly the I<-c> option:"
173 #: ../align/virt-alignment-scan.pod:47
176 " # virt-alignment-scan -d RHEL5\n"
177 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
178 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
183 #: ../align/virt-alignment-scan.pod:51
186 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
187 " /dev/sda1 1048576 1024K ok\n"
188 " /dev/sda2 105906176 1024K ok\n"
189 " /dev/sdb1 65536 64K ok\n"
194 #: ../align/virt-alignment-scan.pod:56
196 "The output consists of 4 or more whitespace-separated columns. Only the "
197 "first 4 columns are signficant if you want to parse this from a program. "
202 #: ../align/virt-alignment-scan.pod:62
207 #: ../align/virt-alignment-scan.pod:64
209 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
210 "on the first block device)"
214 #: ../align/virt-alignment-scan.pod:67
219 #: ../align/virt-alignment-scan.pod:69
220 msgid "the start of the partition in bytes"
224 #: ../align/virt-alignment-scan.pod:71
229 #: ../align/virt-alignment-scan.pod:73
230 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
234 #: ../align/virt-alignment-scan.pod:75
239 #: ../align/virt-alignment-scan.pod:77
241 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
242 "can cause performance problems"
246 #: ../align/virt-alignment-scan.pod:80
251 #: ../align/virt-alignment-scan.pod:82
252 msgid "optional free-text explanation."
256 #: ../align/virt-alignment-scan.pod:86
258 "The exit code from the program changes depending on whether poorly aligned "
259 "partitions were found. See L</EXIT STATUS> below."
263 #: ../align/virt-alignment-scan.pod:89
264 msgid "If you just want the exit code with no output, use the I<-q> option."
268 #: ../align/virt-alignment-scan.pod:91 ../cat/virt-cat.pod:62
269 #: ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../df/virt-df.pod:59
270 #: ../edit/virt-edit.pod:62 ../fish/guestfish.pod:148
271 #: ../fish/virt-copy-in.pod:45 ../fish/virt-copy-out.pod:34
272 #: ../fish/virt-tar-in.pod:42 ../fish/virt-tar-out.pod:36
273 #: ../fuse/guestmount.pod:83 ../inspector/virt-inspector.pod:55
274 #: ../rescue/virt-rescue.pod:84 ../resize/virt-resize.pod:241
275 #: ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36
276 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
277 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
278 #: ../tools/virt-win-reg.pl:96
283 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:66
284 #: ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../df/virt-df.pod:63
285 #: ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152
286 #: ../fuse/guestmount.pod:151 ../inspector/virt-inspector.pod:59
287 #: ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:245
288 #: ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40
289 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
290 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
291 #: ../tools/virt-win-reg.pl:104
296 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:68
297 #: ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../df/virt-df.pod:65
298 #: ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61
299 #: ../rescue/virt-rescue.pod:90 ../tools/virt-list-filesystems.pl:63
300 #: ../tools/virt-list-partitions.pl:64 ../tools/virt-make-fs.pl:163
301 #: ../tools/virt-tar.pl:113 ../tools/virt-win-reg.pl:106
302 msgid "Display brief help."
306 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:70
307 #: ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../df/virt-df.pod:67
308 #: ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63
309 #: ../rescue/virt-rescue.pod:92
314 #: ../align/virt-alignment-scan.pod:101 ../cat/virt-cat.pod:72
315 #: ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../df/virt-df.pod:69
316 #: ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65
317 #: ../rescue/virt-rescue.pod:94
318 msgid "B<--add> file"
322 #: ../align/virt-alignment-scan.pod:103
323 msgid "Add I<file> which should be a disk image from a virtual machine."
327 #: ../align/virt-alignment-scan.pod:105 ../cat/virt-cat.pod:78
328 #: ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../df/virt-df.pod:75
329 #: ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174
330 #: ../fuse/guestmount.pod:93 ../inspector/virt-inspector.pod:71
331 #: ../rescue/virt-rescue.pod:100
333 "The format of the disk image is auto-detected. To override this and force a "
334 "particular format use the I<--format=..> option."
338 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:81
339 #: ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../df/virt-df.pod:78
340 #: ../rescue/virt-rescue.pod:107
345 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:83
346 #: ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../df/virt-df.pod:80
347 #: ../rescue/virt-rescue.pod:109
348 msgid "B<--connect> URI"
352 #: ../align/virt-alignment-scan.pod:112 ../cat/virt-cat.pod:85
353 #: ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../df/virt-df.pod:82
354 #: ../edit/virt-edit.pod:99 ../inspector/virt-inspector.pod:78
355 #: ../rescue/virt-rescue.pod:111 ../tools/virt-list-filesystems.pl:81
356 #: ../tools/virt-list-partitions.pl:82 ../tools/virt-tar.pl:131
357 #: ../tools/virt-win-reg.pl:132
359 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
360 "to the default libvirt hypervisor."
364 #: ../align/virt-alignment-scan.pod:115 ../cat/virt-cat.pod:88
365 #: ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../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:118 ../cat/virt-cat.pod:91
374 #: ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../df/virt-df.pod:94
375 #: ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85
376 #: ../rescue/virt-rescue.pod:117
381 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:93
382 #: ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../df/virt-df.pod:96
383 #: ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87
384 #: ../rescue/virt-rescue.pod:119
385 msgid "B<--domain> guest"
389 #: ../align/virt-alignment-scan.pod:122 ../cat/virt-cat.pod:95
390 #: ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../df/virt-df.pod:98
391 #: ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89
392 #: ../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:125 ../cat/virt-cat.pod:105
400 #: ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328
401 #: ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:133
402 #: ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
403 msgid "B<--format=raw|qcow2|..>"
407 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:107
408 #: ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330
409 #: ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235
410 #: ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:101
411 #: ../rescue/virt-rescue.pod:126
416 #: ../align/virt-alignment-scan.pod:129 ../cat/virt-cat.pod:109
417 #: ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332
418 #: ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237
419 #: ../fuse/guestmount.pod:137 ../rescue/virt-rescue.pod:128
421 "The default for the I<-a> option is to auto-detect the format of the disk "
422 "image. Using this forces the disk format for I<-a> options which follow on "
423 "the command line. Using I<--format> with no argument switches back to auto-"
424 "detection for subsequent I<-a> options."
428 #: ../align/virt-alignment-scan.pod:134 ../cat/virt-cat.pod:114
429 #: ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337
430 #: ../df/virt-df.pod:110 ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242
431 #: ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336
432 #: ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2791
437 #: ../align/virt-alignment-scan.pod:136
440 " virt-alignment-scan --format=raw -a disk.img\n"
445 #: ../align/virt-alignment-scan.pod:138 ../cat/virt-cat.pod:118
446 #: ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341
447 #: ../df/virt-df.pod:114 ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246
448 #: ../rescue/virt-rescue.pod:137
449 msgid "forces raw format (no auto-detection) for C<disk.img>."
453 #: ../align/virt-alignment-scan.pod:140
456 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
461 #: ../align/virt-alignment-scan.pod:142 ../cat/virt-cat.pod:122
462 #: ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345
463 #: ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250
464 #: ../rescue/virt-rescue.pod:141
466 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
467 "detection for C<another.img>."
471 #: ../align/virt-alignment-scan.pod:145 ../cat/virt-cat.pod:125
472 #: ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348
473 #: ../df/virt-df.pod:121 ../edit/virt-edit.pod:152
474 #: ../rescue/virt-rescue.pod:144
476 "If you have untrusted raw-format guest disk images, you should use this "
477 "option to specify the disk format. This avoids a possible security problem "
478 "with malicious guests (CVE-2010-3851)."
482 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:414
483 #: ../sparsify/virt-sparsify.pod:153
488 #: ../align/virt-alignment-scan.pod:151 ../resize/virt-resize.pod:416
489 #: ../sparsify/virt-sparsify.pod:155
494 #: ../align/virt-alignment-scan.pod:153
496 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
501 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:134
502 #: ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425
503 #: ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390
504 #: ../fuse/guestmount.pod:257 ../inspector/virt-inspector.pod:119
505 #: ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
510 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:136
511 #: ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427
512 #: ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392
513 #: ../fuse/guestmount.pod:259 ../inspector/virt-inspector.pod:121
514 #: ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
519 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:138
520 #: ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429
521 #: ../df/virt-df.pod:177 ../edit/virt-edit.pod:165
522 #: ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186
523 #: ../sparsify/virt-sparsify.pod:163
524 msgid "Enable verbose messages for debugging."
528 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:140
529 #: ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431
530 #: ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397
531 #: ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pod:125
532 #: ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:484
533 #: ../sparsify/virt-sparsify.pod:165
538 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:142
539 #: ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433
540 #: ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399
541 #: ../fuse/guestmount.pod:265 ../inspector/virt-inspector.pod:127
542 #: ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:486
543 #: ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69
544 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
545 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
550 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:144
551 #: ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435
552 #: ../df/virt-df.pod:183 ../edit/virt-edit.pod:171
553 #: ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192
554 #: ../resize/virt-resize.pod:488 ../sparsify/virt-sparsify.pod:169
555 #: ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72
556 #: ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121
557 #: ../tools/virt-win-reg.pl:114
558 msgid "Display version number and exit."
562 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:146
563 #: ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437
564 #: ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412
565 #: ../fuse/guestmount.pod:278 ../inspector/virt-inspector.pod:131
566 #: ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171
567 #: ../tools/virt-tar.pl:158
572 #: ../align/virt-alignment-scan.pod:170 ../cat/virt-cat.pod:148
573 #: ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439
574 #: ../df/virt-df.pod:187 ../edit/virt-edit.pod:175
575 #: ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205
576 #: ../sparsify/virt-sparsify.pod:173
577 msgid "Enable tracing of libguestfs API calls."
581 #: ../align/virt-alignment-scan.pod:174 ../cat/virt-cat.pod:191
582 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483
583 #: ../df/virt-df.pod:215 ../edit/virt-edit.pod:342
584 #: ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266
585 #: ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188
586 #: ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532
587 #: ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
588 msgid "SHELL QUOTING"
592 #: ../align/virt-alignment-scan.pod:176 ../cat/virt-cat.pod:193
593 #: ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485
594 #: ../df/virt-df.pod:217 ../edit/virt-edit.pod:344
595 #: ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268
596 #: ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190
597 #: ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534
598 #: ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
600 "Libvirt guest names can contain arbitrary characters, some of which have "
601 "meaning to the shell such as C<#> and space. You may need to quote or "
602 "escape these characters on the command line. See the shell manual page L<sh"
607 #: ../align/virt-alignment-scan.pod:181 ../cat/virt-cat.pod:198
608 #: ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490
609 #: ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1081
610 #: ../fuse/guestmount.pod:303 ../inspector/virt-inspector.pod:375
611 #: ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:227
612 #: ../test-tool/libguestfs-test-tool.pod:90
617 #: ../align/virt-alignment-scan.pod:183
618 msgid "This program returns:"
622 #: ../align/virt-alignment-scan.pod:187
627 #: ../align/virt-alignment-scan.pod:189
629 "successful exit, all partitions are aligned E<ge> 64K for best performance"
633 #: ../align/virt-alignment-scan.pod:191
638 #: ../align/virt-alignment-scan.pod:193
639 msgid "an error scanning the disk image or guest"
643 #: ../align/virt-alignment-scan.pod:195
648 #: ../align/virt-alignment-scan.pod:197
650 "successful exit, some partitions have alignment E<lt> 64K which can result "
651 "in poor performance on high end network storage"
655 #: ../align/virt-alignment-scan.pod:200
660 #: ../align/virt-alignment-scan.pod:202
662 "successful exit, some partitions have alignment E<lt> 4K which can result in "
663 "poor performance on most hypervisors"
667 #: ../align/virt-alignment-scan.pod:207 ../cat/virt-cat.pod:203
668 #: ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495
669 #: ../df/virt-df.pod:227 ../edit/virt-edit.pod:354
670 #: ../erlang/examples/guestfs-erlang.pod:97
671 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
672 #: ../fish/guestfish.pod:1235 ../fish/virt-copy-in.pod:50
673 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
674 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308
675 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
676 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
677 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
678 #: ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36
679 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3179
680 #: ../test-tool/libguestfs-test-tool.pod:100
681 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
682 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
683 #: ../tools/virt-win-reg.pl:746
688 #: ../align/virt-alignment-scan.pod:209
690 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://libguestfs."
695 #: ../align/virt-alignment-scan.pod:214 ../cat/virt-cat.pod:212
696 #: ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507
697 #: ../df/virt-df.pod:235 ../edit/virt-edit.pod:368
698 #: ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:635
699 #: ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208
700 #: ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:564
701 #: ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:772
706 #: ../align/virt-alignment-scan.pod:216 ../cat/virt-cat.pod:214
707 #: ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509
708 #: ../df/virt-df.pod:237 ../edit/virt-edit.pod:370
709 #: ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298
710 #: ../resize/virt-resize.pod:637 ../sparsify/virt-sparsify.pod:266
711 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279
712 #: ../tools/virt-make-fs.pl:566 ../tools/virt-tar.pl:313
713 #: ../tools/virt-win-reg.pl:774
714 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
718 #: ../align/virt-alignment-scan.pod:218 ../cat/virt-cat.pod:216
719 #: ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511
720 #: ../df/virt-df.pod:239 ../edit/virt-edit.pod:372
721 #: ../erlang/examples/guestfs-erlang.pod:114
722 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
723 #: ../fish/guestfish.pod:1266 ../fish/virt-copy-in.pod:64
724 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
725 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323
726 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
727 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
728 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
729 #: ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52
730 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3259
731 #: ../test-tool/libguestfs-test-tool.pod:110
732 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
733 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
734 #: ../tools/virt-win-reg.pl:776
739 #: ../align/virt-alignment-scan.pod:220 ../sparsify/virt-sparsify.pod:270
740 msgid "Copyright (C) 2011 Red Hat Inc."
744 #: ../align/virt-alignment-scan.pod:222 ../cat/virt-cat.pod:220
745 #: ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515
746 #: ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1271
747 #: ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58
748 #: ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60
749 #: ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:407
750 #: ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:643
751 #: ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115
752 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
753 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
754 #: ../tools/virt-win-reg.pl:780
756 "This program is free software; you can redistribute it and/or modify it "
757 "under the terms of the GNU General Public License as published by the Free "
758 "Software Foundation; either version 2 of the License, or (at your option) "
763 #: ../align/virt-alignment-scan.pod:227 ../cat/virt-cat.pod:225
764 #: ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520
765 #: ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1276
766 #: ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63
767 #: ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65
768 #: ../fuse/guestmount.pod:333 ../inspector/virt-inspector.pod:412
769 #: ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:648
770 #: ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120
771 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
772 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
773 #: ../tools/virt-win-reg.pl:785
775 "This program is distributed in the hope that it will be useful, but WITHOUT "
776 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
777 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
782 #: ../align/virt-alignment-scan.pod:232 ../cat/virt-cat.pod:230
783 #: ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525
784 #: ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1281
785 #: ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68
786 #: ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70
787 #: ../fuse/guestmount.pod:338 ../inspector/virt-inspector.pod:417
788 #: ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:653
789 #: ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125
790 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
791 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
792 #: ../tools/virt-win-reg.pl:790
794 "You should have received a copy of the GNU General Public License along with "
795 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
796 "Ave, Cambridge, MA 02139, USA."
800 #: ../cat/virt-cat.pod:5
801 msgid "virt-cat - Display files in a virtual machine"
805 #: ../cat/virt-cat.pod:9
808 " virt-cat [--options] -d domname file [file ...]\n"
813 #: ../cat/virt-cat.pod:11
816 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
821 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
822 #: ../inspector/virt-inspector.pod:13
827 #: ../cat/virt-cat.pod:15
830 " virt-cat domname file\n"
835 #: ../cat/virt-cat.pod:17
838 " virt-cat disk.img file\n"
843 #: ../cat/virt-cat.pod:21
845 "C<virt-cat> is a command line tool to display the contents of C<file> where "
846 "C<file> exists in the named virtual machine (or disk image)."
850 #: ../cat/virt-cat.pod:24
852 "Multiple filenames can be given, in which case they are concatenated "
853 "together. Each filename must be a full path, starting at the root directory "
854 "(starting with '/')."
858 #: ../cat/virt-cat.pod:28
860 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
861 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
862 "(see L</USING GUESTFISH> below)."
866 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
867 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
868 #: ../fish/guestfish.pod:1018 ../fish/virt-copy-in.pod:29
869 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
870 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
871 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
872 #: ../tools/virt-tar.pl:50
877 #: ../cat/virt-cat.pod:34
879 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
883 #: ../cat/virt-cat.pod:37
886 " virt-cat -d mydomain /etc/fstab\n"
891 #: ../cat/virt-cat.pod:39
892 msgid "List syslog messages from a VM disk image file:"
896 #: ../cat/virt-cat.pod:41
899 " virt-cat -a disk.img /var/log/messages | tail\n"
904 #: ../cat/virt-cat.pod:43
905 msgid "Find out what DHCP IP address a VM acquired:"
909 #: ../cat/virt-cat.pod:45
912 " virt-cat -d mydomain /var/log/messages | \\\n"
913 " grep 'dhclient: bound to' | tail\n"
918 #: ../cat/virt-cat.pod:48
919 msgid "Find out what packages were recently installed:"
923 #: ../cat/virt-cat.pod:50
926 " virt-cat -d mydomain /var/log/yum.log | tail\n"
931 #: ../cat/virt-cat.pod:52
932 msgid "Find out who is logged on inside a virtual machine:"
936 #: ../cat/virt-cat.pod:54
939 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
945 #: ../cat/virt-cat.pod:57
946 msgid "or who was logged on:"
950 #: ../cat/virt-cat.pod:59
953 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
954 " last -f /tmp/wtmp\n"
959 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
960 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
961 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
963 "Add I<file> which should be a disk image from a virtual machine. If the "
964 "virtual machine has multiple block devices, you must supply all of them with "
965 "separate I<-a> options."
969 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
970 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
971 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
972 msgid "B<--echo-keys>"
976 #: ../cat/virt-cat.pod:100
978 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
979 "so you cannot see what you are typing. If you are not worried about Tempest "
980 "attacks and there is no one else in the room you can specify this flag to "
981 "see what you are typing."
985 #: ../cat/virt-cat.pod:116
988 " virt-cat --format=raw -a disk.img file\n"
993 #: ../cat/virt-cat.pod:120
996 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
1001 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
1002 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
1003 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
1004 msgid "B<--keys-from-stdin>"
1008 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
1009 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
1010 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
1012 "Read key or passphrase parameters from stdin. The default is to try to read "
1013 "passphrases from the user by opening C</dev/tty>."
1017 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
1018 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
1019 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1023 #: ../cat/virt-cat.pod:154
1024 msgid "Previous versions of virt-cat allowed you to write either:"
1028 #: ../cat/virt-cat.pod:156
1031 " virt-cat disk.img [disk.img ...] file\n"
1036 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
1037 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1042 #: ../cat/virt-cat.pod:160
1045 " virt-cat guestname file\n"
1050 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
1051 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1053 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1054 "the confusing case where a disk image might have the same name as a guest."
1058 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
1059 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1060 msgid "For compatibility the old style is still supported."
1064 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1065 msgid "USING GUESTFISH"
1069 #: ../cat/virt-cat.pod:170
1071 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1072 "C<virt-cat> doesn't work."
1076 #: ../cat/virt-cat.pod:173
1077 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1081 #: ../cat/virt-cat.pod:175
1084 " guestfish --ro -i -d domname download file -\n"
1089 #: ../cat/virt-cat.pod:177
1091 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1092 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1096 #: ../cat/virt-cat.pod:181
1098 "The command above uses libguestfs's guest inspection feature and so does not "
1099 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1100 "disk images that don't contain guests. To display a file from a disk image "
1105 #: ../cat/virt-cat.pod:186
1108 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1113 #: ../cat/virt-cat.pod:188
1115 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1116 "the disk image, and C<file> is the full path to the file."
1120 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
1121 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
1122 #: ../fuse/guestmount.pod:305 ../inspector/virt-inspector.pod:377
1123 #: ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
1125 "This program returns 0 if successful, or non-zero if there was an error."
1129 #: ../cat/virt-cat.pod:205
1131 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
1132 "tar-out(1)>, L<http://libguestfs.org/>."
1136 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
1137 #: ../resize/virt-resize.pod:641
1138 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1142 #: ../cat/virt-filesystems.pod:5
1144 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1145 "virtual machine or disk image"
1149 #: ../cat/virt-filesystems.pod:9
1152 " virt-filesystems [--options] -d domname\n"
1157 #: ../cat/virt-filesystems.pod:11
1160 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1165 #: ../cat/virt-filesystems.pod:15
1167 "This tool allows you to discover filesystems, partitions, logical volumes, "
1168 "and their sizes in a disk image or virtual machine. It is a replacement for "
1169 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1173 #: ../cat/virt-filesystems.pod:20
1175 "One use for this tool is from shell scripts to iterate over all filesystems "
1176 "from a disk image:"
1180 #: ../cat/virt-filesystems.pod:23
1183 " for fs in $(virt-filesystems -a disk.img); do\n"
1190 #: ../cat/virt-filesystems.pod:27
1192 "Another use is to list partitions before using another tool to modify those "
1193 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1194 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1198 #: ../cat/virt-filesystems.pod:32
1200 "Various command line options control what this program displays. You need "
1201 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1202 "guest respectively. If you just specify that then the program shows "
1203 "filesystems found, one per line, like this:"
1207 #: ../cat/virt-filesystems.pod:37
1210 " $ virt-filesystems -a disk.img\n"
1212 " /dev/vg_guest/lv_root\n"
1217 #: ../cat/virt-filesystems.pod:41
1219 "If you add I<-l> or I<--long> then the output includes extra information:"
1223 #: ../cat/virt-filesystems.pod:44
1226 " $ virt-filesystems -a disk.img -l\n"
1227 " Name Type VFS Label Size\n"
1228 " /dev/sda1 filesystem ext4 boot 524288000\n"
1229 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1234 #: ../cat/virt-filesystems.pod:49
1236 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1241 #: ../cat/virt-filesystems.pod:52
1244 " $ virt-filesystems -a disk.img --extra\n"
1246 " /dev/vg_guest/lv_root\n"
1247 " /dev/vg_guest/lv_swap\n"
1248 " /dev/vg_guest/lv_data\n"
1253 #: ../cat/virt-filesystems.pod:58
1255 "If you add I<--partitions> then partitions are shown instead of filesystems:"
1259 #: ../cat/virt-filesystems.pod:60
1262 " $ virt-filesystems -a disk.img --partitions\n"
1269 #: ../cat/virt-filesystems.pod:64
1271 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
1272 "volumes>, I<--block-devices> to list those items."
1276 #: ../cat/virt-filesystems.pod:67
1278 "You can use these options in combination as well (if you want a combination "
1279 "including filesystems, you have to add I<--filesystems>). Notice that some "
1280 "items fall into several categories (eg. C</dev/sda1> might be both a "
1281 "partition and a filesystem). These items are listed several times. To get "
1282 "a list which includes absolutely everything that virt-filesystems knows "
1283 "about, use the I<--all> option."
1287 #: ../cat/virt-filesystems.pod:74
1289 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
1290 "uuid> option to display device and filesystem UUIDs in the long output."
1294 #: ../cat/virt-filesystems.pod:78
1296 "I<--all --long --uuid> is a useful combination to display all possible "
1297 "information about everything."
1301 #: ../cat/virt-filesystems.pod:81
1304 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1305 " Name Type VFS Label Size Parent UUID\n"
1306 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1307 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1308 " /dev/sda1 partition - - 100M /dev/sda -\n"
1309 " /dev/sda2 partition - - 20G /dev/sda -\n"
1310 " /dev/sda device - - 20G - -\n"
1315 #: ../cat/virt-filesystems.pod:89
1317 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1321 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1326 #: ../cat/virt-filesystems.pod:112
1328 "Display everything. This is currently the same as specifying these options: "
1329 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1330 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1331 "added to this list in future)."
1335 #: ../cat/virt-filesystems.pod:117
1336 msgid "See also I<--long>."
1340 #: ../cat/virt-filesystems.pod:119
1341 msgid "B<--blkdevs>"
1345 #: ../cat/virt-filesystems.pod:121
1346 msgid "B<--block-devices>"
1350 #: ../cat/virt-filesystems.pod:123
1351 msgid "Display block devices."
1355 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1360 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1362 "Write out the results in CSV format (comma-separated values). This format "
1363 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1364 "ABOUT CSV FORMAT> below."
1368 #: ../cat/virt-filesystems.pod:150
1370 "When prompting for keys and passphrases, virt-filesystems normally turns "
1371 "echoing off so you cannot see what you are typing. If you are not worried "
1372 "about Tempest attacks and there is no one else in the room you can specify "
1373 "this flag to see what you are typing."
1377 #: ../cat/virt-filesystems.pod:155
1382 #: ../cat/virt-filesystems.pod:157
1384 "This causes filesystems that are not ordinary, mountable filesystems to be "
1385 "displayed. This category includes swapspace, and filesystems that are empty "
1386 "or contain unknown data."
1390 #: ../cat/virt-filesystems.pod:161
1391 msgid "This option implies I<--filesystems>."
1395 #: ../cat/virt-filesystems.pod:163
1396 msgid "B<--filesystems>"
1400 #: ../cat/virt-filesystems.pod:165
1402 "Display mountable filesystems. If no display option was selected then this "
1403 "option is implied."
1407 #: ../cat/virt-filesystems.pod:168
1408 msgid "With I<--extra>, non-mountable filesystems are shown too."
1412 #: ../cat/virt-filesystems.pod:181
1415 " virt-filesystems --format=raw -a disk.img\n"
1420 #: ../cat/virt-filesystems.pod:185
1423 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1428 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1429 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1430 #: ../tools/virt-list-partitions.pl:109
1435 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1436 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1437 msgid "B<--human-readable>"
1441 #: ../cat/virt-filesystems.pod:198
1442 msgid "In I<--long> mode, display sizes in human-readable format."
1446 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1447 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1452 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1453 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1458 #: ../cat/virt-filesystems.pod:209
1459 msgid "Display extra columns of data (\"long format\")."
1463 #: ../cat/virt-filesystems.pod:211
1464 msgid "A title row is added unless you also specify I<--no-title>."
1468 #: ../cat/virt-filesystems.pod:213
1470 "The extra columns displayed depend on what output you select, and the "
1471 "ordering of columns may change in future versions. Use the title row, I<--"
1472 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1477 #: ../cat/virt-filesystems.pod:218
1479 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1480 "default is to show raw numbers of I<bytes>."
1484 #: ../cat/virt-filesystems.pod:221
1485 msgid "Use I<--uuid> to display UUIDs too."
1489 #: ../cat/virt-filesystems.pod:223
1494 #: ../cat/virt-filesystems.pod:225
1495 msgid "B<--logvols>"
1499 #: ../cat/virt-filesystems.pod:227
1500 msgid "B<--logical-volumes>"
1504 #: ../cat/virt-filesystems.pod:229
1506 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1507 "of whether the LVs contain filesystems."
1511 #: ../cat/virt-filesystems.pod:232
1512 msgid "B<--no-title>"
1516 #: ../cat/virt-filesystems.pod:234
1517 msgid "In I<--long> mode, don't add a title row."
1521 #: ../cat/virt-filesystems.pod:236
1523 "Note that the order of the columns is not fixed, and may change in future "
1524 "versions of virt-filesystems, so using this option may give you unexpected "
1529 #: ../cat/virt-filesystems.pod:240
1534 #: ../cat/virt-filesystems.pod:242
1535 msgid "B<--partitions>"
1539 #: ../cat/virt-filesystems.pod:244
1541 "Display partitions. In this mode, these are displayed irrespective of "
1542 "whether the partitions contain filesystems."
1546 #: ../cat/virt-filesystems.pod:247
1551 #: ../cat/virt-filesystems.pod:249
1552 msgid "B<--physvols>"
1556 #: ../cat/virt-filesystems.pod:251
1557 msgid "B<--physical-volumes>"
1561 #: ../cat/virt-filesystems.pod:253
1562 msgid "Display LVM physical volumes."
1566 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1571 #: ../cat/virt-filesystems.pod:257
1576 #: ../cat/virt-filesystems.pod:259
1577 msgid "In I<--long> mode, display UUIDs as well."
1581 #: ../cat/virt-filesystems.pod:273
1586 #: ../cat/virt-filesystems.pod:275
1587 msgid "B<--volgroups>"
1591 #: ../cat/virt-filesystems.pod:277
1592 msgid "B<--volume-groups>"
1596 #: ../cat/virt-filesystems.pod:279
1597 msgid "Display LVM volume groups."
1601 #: ../cat/virt-filesystems.pod:287
1606 #: ../cat/virt-filesystems.pod:289
1608 "Note that columns in the output are subject to reordering and change in "
1609 "future versions of this tool."
1613 #: ../cat/virt-filesystems.pod:294
1618 #: ../cat/virt-filesystems.pod:296
1619 msgid "The filesystem, partition, block device or LVM name."
1623 #: ../cat/virt-filesystems.pod:298
1625 "For device and partition names these are displayed as canonical libguestfs "
1626 "names, so that for example C</dev/sda2> is the second partition on the first "
1631 #: ../cat/virt-filesystems.pod:302
1633 "If the I<--long> option is B<not> specified, then only the name column is "
1634 "shown in the output."
1638 #: ../cat/virt-filesystems.pod:305
1643 #: ../cat/virt-filesystems.pod:307
1644 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1648 #: ../cat/virt-filesystems.pod:309
1653 #: ../cat/virt-filesystems.pod:311
1655 "If there is a filesystem, then this column displays the filesystem type if "
1656 "one could be detected, eg. C<ext4>."
1660 #: ../cat/virt-filesystems.pod:314
1665 #: ../cat/virt-filesystems.pod:316
1667 "If the object has a label (used for identifying and mounting filesystems) "
1668 "then this column contains the label."
1672 #: ../cat/virt-filesystems.pod:319
1677 #: ../cat/virt-filesystems.pod:321
1679 "The size of the object in bytes. If the I<--human> option is used then the "
1680 "size is displayed in a human-readable form."
1684 #: ../cat/virt-filesystems.pod:324
1689 #: ../cat/virt-filesystems.pod:326
1691 "The parent column records the parent relationship between objects. For "
1692 "example, if the object is a partition, then this column contains the name of "
1693 "the containing device. If the object is a logical volume, then this column "
1694 "is the name of the volume group."
1698 #: ../cat/virt-filesystems.pod:331
1703 #: ../cat/virt-filesystems.pod:333
1705 "If the object has a UUID (used for identifying and mounting filesystems and "
1706 "block devices) then this column contains the UUID as a string."
1710 #: ../cat/virt-filesystems.pod:337
1711 msgid "The UUID is only displayed if the I<--uuid> option is given."
1715 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
1716 #: ../df/virt-df.pod:191
1717 msgid "NOTE ABOUT CSV FORMAT"
1721 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
1722 #: ../df/virt-df.pod:193
1724 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1725 "should be easy to parse, but it is definitely not easy to parse."
1729 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
1730 #: ../df/virt-df.pod:196
1732 "Myth: Just split fields at commas. Reality: This does I<not> work "
1733 "reliably. This example has two columns:"
1737 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
1738 #: ../df/virt-df.pod:199
1741 " \"foo,bar\",baz\n"
1746 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
1747 #: ../df/virt-df.pod:201
1749 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1750 "reliably. This example has one row:"
1754 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
1755 #: ../df/virt-df.pod:204
1764 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
1765 #: ../df/virt-df.pod:207
1767 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1768 "packaged in major Linux distributions)."
1772 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
1773 #: ../df/virt-df.pod:210
1775 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1776 "or Python's built-in csv library)."
1780 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
1781 #: ../df/virt-df.pod:213
1782 msgid "Most spreadsheets and databases can import CSV directly."
1786 #: ../cat/virt-filesystems.pod:379
1788 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
1789 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
1794 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570
1795 #: ../tools/virt-win-reg.pl:778
1796 msgid "Copyright (C) 2010 Red Hat Inc."
1800 #: ../cat/virt-ls.pod:5
1801 msgid "virt-ls - List files in a virtual machine"
1805 #: ../cat/virt-ls.pod:9
1808 " virt-ls [--options] -d domname directory [directory ...]\n"
1813 #: ../cat/virt-ls.pod:11
1816 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
1821 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1826 #: ../cat/virt-ls.pod:15
1829 " virt-ls [--options] domname directory\n"
1834 #: ../cat/virt-ls.pod:17
1837 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1842 #: ../cat/virt-ls.pod:21
1844 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1845 "more from a virtual machine or disk image."
1849 #: ../cat/virt-ls.pod:24
1851 "Multiple directory names can be given, in which case the output from each is "
1856 #: ../cat/virt-ls.pod:27
1858 "To list directories from a libvirt guest use the I<-d> option to specify the "
1859 "name of the guest. For a disk image, use the I<-a> option."
1863 #: ../cat/virt-ls.pod:31
1865 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1866 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
1871 #: ../cat/virt-ls.pod:37
1872 msgid "Get a list of all files and directories in a virtual machine:"
1876 #: ../cat/virt-ls.pod:39
1879 " virt-ls -R -d guest /\n"
1884 #: ../cat/virt-ls.pod:41
1885 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1889 #: ../cat/virt-ls.pod:43
1892 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1897 #: ../cat/virt-ls.pod:45
1898 msgid "List all public-writable directories in a Linux virtual machine:"
1902 #: ../cat/virt-ls.pod:47
1905 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1910 #: ../cat/virt-ls.pod:49
1911 msgid "List all Unix domain sockets in a Linux virtual machine:"
1915 #: ../cat/virt-ls.pod:51
1918 " virt-ls -lR -d guest / | grep '^s'\n"
1923 #: ../cat/virt-ls.pod:53
1924 msgid "List all regular files with filenames ending in '.png':"
1928 #: ../cat/virt-ls.pod:55
1931 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1936 #: ../cat/virt-ls.pod:57
1937 msgid "To display files larger than 10MB in home directories:"
1941 #: ../cat/virt-ls.pod:59
1944 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1949 #: ../cat/virt-ls.pod:61
1950 msgid "Find everything modified in the last 7 days:"
1954 #: ../cat/virt-ls.pod:63
1957 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1962 #: ../cat/virt-ls.pod:65
1963 msgid "Find regular files modified in the last 24 hours:"
1967 #: ../cat/virt-ls.pod:67
1970 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1975 #: ../cat/virt-ls.pod:69
1976 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1980 #: ../cat/virt-ls.pod:71
1982 "Find the differences between files in a guest and an earlier snapshot of the "
1987 #: ../cat/virt-ls.pod:74
1990 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1991 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1992 " diff -u old new | less\n"
1997 #: ../cat/virt-ls.pod:78
1999 "The commands above won't find files where the content has changed but the "
2000 "metadata (eg. file size and modification date) is the same. To do that, you "
2001 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
2002 "checksum> can be quite slow since it has to read and compute a checksum of "
2003 "every regular file in the virtual machine."
2007 #: ../cat/virt-ls.pod:84
2008 msgid "OUTPUT MODES"
2012 #: ../cat/virt-ls.pod:86
2014 "C<virt-ls> has four output modes, controlled by different combinations of "
2015 "the I<-l> and I<-R> options."
2019 #: ../cat/virt-ls.pod:89
2020 msgid "SIMPLE LISTING"
2024 #: ../cat/virt-ls.pod:91
2025 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2029 #: ../cat/virt-ls.pod:93
2032 " $ virt-ls -d guest /\n"
2040 #: ../cat/virt-ls.pod:98
2041 msgid "LONG LISTING"
2045 #: ../cat/virt-ls.pod:100
2047 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2048 "(more specifically, like the C<guestfs_ll> function)."
2052 #: ../cat/virt-ls.pod:103
2055 " $ virt-ls -l -d guest /\n"
2057 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2058 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2064 #: ../cat/virt-ls.pod:109
2066 "Note that while this is useful for displaying a directory, do not try "
2067 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2072 #: ../cat/virt-ls.pod:113
2073 msgid "RECURSIVE LISTING"
2077 #: ../cat/virt-ls.pod:115
2079 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2080 "and directories recursively:"
2084 #: ../cat/virt-ls.pod:118
2087 " $ virt-ls -R -d guest /tmp\n"
2095 #: ../cat/virt-ls.pod:123
2097 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2098 "converts C<\\0> characters to C<\\n>."
2102 #: ../cat/virt-ls.pod:126
2103 msgid "RECURSIVE LONG LISTING"
2107 #: ../cat/virt-ls.pod:128
2109 "Using I<-lR> options together changes the output to display directories "
2110 "recursively, with file stats, and optionally other features such as "
2111 "checksums and extended attributes."
2115 #: ../cat/virt-ls.pod:132
2117 "Most of the interesting features of C<virt-ls> are only available when using "
2122 #: ../cat/virt-ls.pod:135
2124 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2125 "you cannot use the output in another program (because filenames can contain "
2126 "spaces and other unsafe characters). If the guest was untrusted and someone "
2127 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2128 "on you by creating filenames with embedded newline characters. To B<safely> "
2129 "parse the output in another program, use the I<--csv> (Comma-Separated "
2134 #: ../cat/virt-ls.pod:143
2136 "Note that this output format is completely unrelated to the C<ls -lR> "
2141 #: ../cat/virt-ls.pod:146
2144 " $ virt-ls -lR -d guest /bin\n"
2145 " d 0555 4096 /bin\n"
2146 " - 0755 123 /bin/alsaunmute\n"
2147 " - 0755 28328 /bin/arch\n"
2148 " l 0777 4 /bin/awk -> gawk\n"
2149 " - 0755 27216 /bin/basename\n"
2150 " - 0755 943360 /bin/bash\n"
2156 #: ../cat/virt-ls.pod:155
2157 msgid "These basic fields are always shown:"
2161 #: ../cat/virt-ls.pod:159
2166 #: ../cat/virt-ls.pod:161
2168 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2169 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2170 "link), C<s> (socket) or C<u> (unknown)."
2174 #: ../cat/virt-ls.pod:171
2179 #: ../cat/virt-ls.pod:173
2180 msgid "The Unix permissions, displayed as a 4 digit octal number."
2184 #: ../cat/virt-ls.pod:175
2189 #: ../cat/virt-ls.pod:177
2191 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
2192 "readable> option is given, in which case this is shown as a human-readable "
2197 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4245
2202 #: ../cat/virt-ls.pod:183
2203 msgid "The full path of the file or directory."
2207 #: ../cat/virt-ls.pod:185
2212 #: ../cat/virt-ls.pod:187
2213 msgid "For symbolic links only, the link target."
2217 #: ../cat/virt-ls.pod:191
2219 "In I<-lR> mode, additional command line options enable the display of more "
2224 #: ../cat/virt-ls.pod:194
2226 "With the I<--uids> flag, these additional fields are displayed before the "
2231 #: ../cat/virt-ls.pod:199
2236 #: ../cat/virt-ls.pod:201
2241 #: ../cat/virt-ls.pod:203
2243 "The UID and GID of the owner of the file (displayed numerically). Note "
2244 "these only make sense in the context of a Unix-like guest."
2248 #: ../cat/virt-ls.pod:208
2249 msgid "With the I<--times> flag, these additional fields are displayed:"
2253 #: ../cat/virt-ls.pod:212
2258 #: ../cat/virt-ls.pod:214
2259 msgid "The time of last access."
2263 #: ../cat/virt-ls.pod:216
2268 #: ../cat/virt-ls.pod:218
2269 msgid "The time of last modification."
2273 #: ../cat/virt-ls.pod:220
2278 #: ../cat/virt-ls.pod:222
2279 msgid "The time of last status change."
2283 #: ../cat/virt-ls.pod:226
2285 "The time fields are displayed as string dates and times, unless one of the "
2286 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2290 #: ../cat/virt-ls.pod:229
2291 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2295 #: ../cat/virt-ls.pod:233
2300 #: ../cat/virt-ls.pod:235
2302 "The device containing the file (displayed as major:minor). This may not "
2303 "match devices as known to the guest."
2307 #: ../cat/virt-ls.pod:238
2312 #: ../cat/virt-ls.pod:240
2313 msgid "The inode number."
2317 #: ../cat/virt-ls.pod:242
2322 #: ../cat/virt-ls.pod:244
2323 msgid "The number of hard links."
2327 #: ../cat/virt-ls.pod:246
2332 #: ../cat/virt-ls.pod:248
2334 "For block and char special files, the device (displayed as major:minor)."
2338 #: ../cat/virt-ls.pod:251
2343 #: ../cat/virt-ls.pod:253
2344 msgid "The number of 512 byte blocks allocated to the file."
2348 #: ../cat/virt-ls.pod:257
2350 "With the I<--checksum> flag, the checksum of the file contents is shown "
2351 "(only for regular files). Computing file checksums can take a considerable "
2356 #: ../cat/virt-ls.pod:280
2357 msgid "B<--checksum>"
2361 #: ../cat/virt-ls.pod:282
2362 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2366 #: ../cat/virt-ls.pod:284
2368 "Display checksum over file contents for regular files. With no argument, "
2369 "this defaults to using I<md5>. Using an argument, you can select the "
2370 "checksum type to use."
2374 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2375 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2376 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2378 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2383 #: ../cat/virt-ls.pod:316
2385 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2386 "so you cannot see what you are typing. If you are not worried about Tempest "
2387 "attacks and there is no one else in the room you can specify this flag to "
2388 "see what you are typing."
2392 #: ../cat/virt-ls.pod:321
2393 msgid "B<--extra-stats>"
2397 #: ../cat/virt-ls.pod:323
2398 msgid "Display extra stats."
2402 #: ../cat/virt-ls.pod:339
2405 " virt-ls --format=raw -a disk.img /dir\n"
2410 #: ../cat/virt-ls.pod:343
2413 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2418 #: ../cat/virt-ls.pod:356
2419 msgid "Display file sizes in human-readable format."
2423 #: ../cat/virt-ls.pod:370
2428 #: ../cat/virt-ls.pod:372
2429 msgid "B<--recursive>"
2433 #: ../cat/virt-ls.pod:374
2435 "Select the mode. With neither of these options, C<virt-ls> produces a "
2436 "simple, flat list of the files in the named directory. See L</SIMPLE "
2441 #: ../cat/virt-ls.pod:378
2443 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2448 #: ../cat/virt-ls.pod:381
2450 "C<virt-ls -R> produces a recursive list of files starting at the named "
2451 "directory. See L</RECURSIVE LISTING>."
2455 #: ../cat/virt-ls.pod:384
2457 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2458 "parsed. See L</RECURSIVE LONG LISTING>."
2462 #: ../cat/virt-ls.pod:387
2467 #: ../cat/virt-ls.pod:389
2468 msgid "Display time fields."
2472 #: ../cat/virt-ls.pod:394
2473 msgid "B<--time-days>"
2477 #: ../cat/virt-ls.pod:396
2478 msgid "Display time fields as days before now (negative if in the future)."
2482 #: ../cat/virt-ls.pod:398
2484 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2485 "of the file is between 0 and 86399 seconds."
2489 #: ../cat/virt-ls.pod:404
2490 msgid "B<--time-relative>"
2494 #: ../cat/virt-ls.pod:406
2495 msgid "Display time fields as seconds before now (negative if in the future)."
2499 #: ../cat/virt-ls.pod:411
2504 #: ../cat/virt-ls.pod:413
2505 msgid "Display time fields as seconds since the Unix epoch."
2509 #: ../cat/virt-ls.pod:418
2514 #: ../cat/virt-ls.pod:420
2515 msgid "Display UID and GID fields."
2519 #: ../cat/virt-ls.pod:445
2520 msgid "Previous versions of virt-ls allowed you to write either:"
2524 #: ../cat/virt-ls.pod:447
2527 " virt-ls disk.img [disk.img ...] /dir\n"
2532 #: ../cat/virt-ls.pod:451
2535 " virt-ls guestname /dir\n"
2540 #: ../cat/virt-ls.pod:497
2542 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2543 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2544 "L<http://libguestfs.org/>."
2548 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2549 #: ../rescue/virt-rescue.pod:302
2550 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2554 #: ../df/virt-df.pod:5
2555 msgid "virt-df - Display free space on virtual filesystems"
2559 #: ../df/virt-df.pod:9
2562 " virt-df [--options]\n"
2567 #: ../df/virt-df.pod:11
2570 " virt-df [--options] -d domname\n"
2575 #: ../df/virt-df.pod:13
2578 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
2583 #: ../df/virt-df.pod:17
2586 " virt-df [--options] domname\n"
2591 #: ../df/virt-df.pod:19
2594 " virt-df [--options] disk.img [disk.img ...]\n"
2599 #: ../df/virt-df.pod:23
2601 "C<virt-df> is a command line tool to display free space on virtual machine "
2602 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2603 "allocated to a virtual machine, but can look inside disk images to see how "
2604 "much space is really being used."
2608 #: ../df/virt-df.pod:28
2610 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2611 "to get a list of all active and inactive guests, and performs a C<df>-type "
2612 "operation on each one in turn, printing out the results."
2616 #: ../df/virt-df.pod:32
2618 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
2619 "type operation on either the single named libvirt domain, or on the disk "
2620 "image(s) listed on the command line (which must all belong to a single VM). "
2621 "In this mode (with arguments), C<virt-df> will I<only work for a single "
2622 "guest>. If you want to run on multiple guests, then you have to invoke "
2623 "C<virt-df> multiple times."
2627 #: ../df/virt-df.pod:39
2629 "Use the I<--csv> option to get a format which can be easily parsed by other "
2630 "programs. Other options are similar to the standard L<df(1)> command."
2634 #: ../df/virt-df.pod:45
2636 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2637 "output human-readable:"
2641 #: ../df/virt-df.pod:48
2644 " # virt-df -d F14x64 -h\n"
2645 " Filesystem Size Used Available Use%\n"
2646 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2647 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2652 #: ../df/virt-df.pod:53
2653 msgid "Show disk usage for a disk image file called C<test.img>:"
2657 #: ../df/virt-df.pod:55
2660 " $ virt-df -a test1.img\n"
2661 " Filesystem 1K-blocks Used Available Use%\n"
2662 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2667 #: ../df/virt-df.pod:112
2670 " virt-df --format=raw -a disk.img\n"
2675 #: ../df/virt-df.pod:116
2678 " virt-df --format=raw -a disk.img --format -a another.img\n"
2683 #: ../df/virt-df.pod:129
2684 msgid "Print sizes in human-readable format."
2688 #: ../df/virt-df.pod:131
2689 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2693 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2698 #: ../df/virt-df.pod:135
2703 #: ../df/virt-df.pod:137
2704 msgid "Print inodes instead of blocks."
2708 #: ../df/virt-df.pod:139
2709 msgid "B<--one-per-guest>"
2713 #: ../df/virt-df.pod:141
2715 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2716 "disks from several guests to a single libguestfs appliance."
2720 #: ../df/virt-df.pod:144
2721 msgid "You might use this option in the following circumstances:"
2725 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
2726 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
2727 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
2728 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
2729 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
2730 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
2731 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
2732 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
2733 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
2734 #: ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398
2735 #: ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412
2736 #: ../fish/guestfish-actions.pod:1139 ../fish/guestfish-actions.pod:1143
2737 #: ../fish/guestfish-actions.pod:1147 ../fish/guestfish-actions.pod:1151
2738 #: ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163
2739 #: ../fish/guestfish-actions.pod:1167 ../fish/guestfish-actions.pod:1177
2740 #: ../fish/guestfish-actions.pod:1181 ../fish/guestfish-actions.pod:1185
2741 #: ../fish/guestfish-actions.pod:1275 ../fish/guestfish-actions.pod:1279
2742 #: ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289
2743 #: ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335
2744 #: ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1596
2745 #: ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:1610
2746 #: ../fish/guestfish-actions.pod:2005 ../fish/guestfish-actions.pod:2011
2747 #: ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2026
2748 #: ../fish/guestfish-actions.pod:2033 ../fish/guestfish.pod:445
2749 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
2750 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
2751 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282
2752 #: ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295
2753 #: ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32
2754 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
2755 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
2756 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
2757 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
2758 #: ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596
2759 #: ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610
2760 #: ../src/guestfs-actions.pod:1778 ../src/guestfs-actions.pod:1782
2761 #: ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:1790
2762 #: ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1802
2763 #: ../src/guestfs-actions.pod:1806 ../src/guestfs-actions.pod:1816
2764 #: ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1824
2765 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:1966
2766 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:1976
2767 #: ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2041
2768 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2461
2769 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2475
2770 #: ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3018
2771 #: ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3033
2772 #: ../src/guestfs-actions.pod:3040 ../src/guestfs.pod:388
2773 #: ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402
2774 #: ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416
2775 #: ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098
2776 #: ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115
2777 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164
2778 #: ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176
2779 #: ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674
2780 #: ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785
2781 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804
2782 #: ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104
2783 #: ../src/guestfs.pod:2112 ../src/guestfs.pod:2559 ../src/guestfs.pod:2565
2784 #: ../src/guestfs.pod:2570 ../src/guestfs.pod:2576 ../src/guestfs.pod:2971
2785 #: ../src/guestfs.pod:2976 ../src/guestfs.pod:2980 ../src/guestfs.pod:2984
2786 #: ../src/guestfs.pod:2988 ../src/guestfs.pod:3002 ../src/guestfs.pod:3007
2787 #: ../src/guestfs.pod:3236 ../src/guestfs.pod:3240 ../src/guestfs.pod:3244
2788 #: ../src/guestfs.pod:3248 ../tools/virt-win-reg.pl:197
2789 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
2790 #: ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716
2791 #: ../tools/virt-win-reg.pl:722
2796 #: ../df/virt-df.pod:150
2798 "If you think an untrusted guest might actively try to exploit the libguestfs "
2799 "appliance kernel, then this prevents one guest from interfering with the "
2800 "stats printed for another guest."
2804 #: ../df/virt-df.pod:156
2806 "If the kernel has a bug which stops it from accessing a filesystem in one "
2807 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2808 "and report stats for further guests."
2812 #: ../df/virt-df.pod:165
2814 "Print UUIDs instead of names. This is useful for following a guest even "
2815 "when the guest is migrated or renamed, or when two guests happen to have the "
2820 #: ../df/virt-df.pod:169
2822 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2823 "images, we still print the disk image name even when this option is "
2828 #: ../df/virt-df.pod:229
2830 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
2835 #: ../edit/virt-edit.pod:5
2836 msgid "virt-edit - Edit a file in a virtual machine"
2840 #: ../edit/virt-edit.pod:9
2843 " virt-edit [--options] -d domname file [file ...]\n"
2848 #: ../edit/virt-edit.pod:11
2851 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2856 #: ../edit/virt-edit.pod:13
2859 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2864 #: ../edit/virt-edit.pod:17
2867 " virt-edit domname file\n"
2872 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2875 " virt-edit disk.img [disk.img ...] file\n"
2880 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
2881 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
2882 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
2883 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
2888 #: ../edit/virt-edit.pod:23
2890 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2891 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2892 "doing this, but doesn't catch all cases."
2896 #: ../edit/virt-edit.pod:29
2898 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2899 "exists in the named virtual machine (or disk image)."
2903 #: ../edit/virt-edit.pod:32
2905 "Multiple filenames can be given, in which case they are each edited in "
2906 "turn. Each filename must be a full path, starting at the root directory "
2907 "(starting with '/')."
2911 #: ../edit/virt-edit.pod:36
2912 msgid "If you want to just view a file, use L<virt-cat(1)>."
2916 #: ../edit/virt-edit.pod:38
2918 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
2919 "USING GUESTFISH> below)."
2923 #: ../edit/virt-edit.pod:41
2925 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2926 "that and much more."
2930 #: ../edit/virt-edit.pod:46
2931 msgid "Edit the named files interactively:"
2935 #: ../edit/virt-edit.pod:48
2938 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2943 #: ../edit/virt-edit.pod:50
2946 " virt-edit -d mydomain /etc/passwd\n"
2951 #: ../edit/virt-edit.pod:52
2952 msgid "For Windows guests, some Windows paths are understood:"
2956 #: ../edit/virt-edit.pod:54
2959 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2964 #: ../edit/virt-edit.pod:56
2966 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
2967 "INTERACTIVE EDITING> below). To change the init default level to 5:"
2971 #: ../edit/virt-edit.pod:60
2974 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2979 #: ../edit/virt-edit.pod:81
2980 msgid "B<-b> extension"
2984 #: ../edit/virt-edit.pod:83
2985 msgid "B<--backup> extension"
2989 #: ../edit/virt-edit.pod:85
2991 "Create a backup of the original file I<in the guest disk image>. The backup "
2992 "has the original filename with C<extension> added."
2996 #: ../edit/virt-edit.pod:88
2998 "Usually the first character of C<extension> would be a dot C<.> so you would "
3003 #: ../edit/virt-edit.pod:91
3006 " virt-edit -b .orig [etc]\n"
3011 #: ../edit/virt-edit.pod:93
3012 msgid "By default, no backup file is made."
3016 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
3017 #: ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74
3018 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
3019 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
3024 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
3025 #: ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76
3026 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
3027 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
3028 msgid "B<--connect URI>"
3032 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
3033 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
3034 #: ../tools/virt-win-reg.pl:135
3036 "If you specify guest block devices directly, then libvirt is not used at all."
3040 #: ../edit/virt-edit.pod:114
3042 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3043 "off so you cannot see what you are typing. If you are not worried about "
3044 "Tempest attacks and there is no one else in the room you can specify this "
3045 "flag to see what you are typing."
3049 #: ../edit/virt-edit.pod:119
3054 #: ../edit/virt-edit.pod:121
3055 msgid "B<--expr> EXPR"
3059 #: ../edit/virt-edit.pod:123
3061 "Instead of launching the external editor, non-interactively apply the Perl "
3062 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3067 #: ../edit/virt-edit.pod:127
3069 "Be careful to properly quote the expression to prevent it from being altered "
3074 #: ../edit/virt-edit.pod:130
3075 msgid "Note that this option is only available when Perl 5 is installed."
3079 #: ../edit/virt-edit.pod:132
3080 msgid "B<--format> raw|qcow2|..."
3084 #: ../edit/virt-edit.pod:143
3087 " virt-edit --format=raw -a disk.img file\n"
3092 #: ../edit/virt-edit.pod:147
3095 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3100 #: ../edit/virt-edit.pod:181
3101 msgid "Previous versions of virt-edit allowed you to write either:"
3105 #: ../edit/virt-edit.pod:187
3108 " virt-edit guestname file\n"
3113 #: ../edit/virt-edit.pod:195
3114 msgid "NON-INTERACTIVE EDITING"
3118 #: ../edit/virt-edit.pod:197
3120 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3121 "administrator can interactively edit the file."
3125 #: ../edit/virt-edit.pod:200
3127 "There are two ways also to use C<virt-edit> from scripts in order to make "
3128 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3129 "like this, it's less error-prone to write scripts directly using the "
3130 "libguestfs API and Augeas for configuration file editing.)"
3134 #: ../edit/virt-edit.pod:206
3136 "The first method is to temporarily set C<$EDITOR> to any script or program "
3137 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3138 "update C<tmpfile> in place however it likes."
3142 #: ../edit/virt-edit.pod:210
3144 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3145 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3146 "instances of C<foo> with C<bar> in a file:"
3150 #: ../edit/virt-edit.pod:214
3153 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3158 #: ../edit/virt-edit.pod:216
3160 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3161 "For example to delete root's password you could do:"
3165 #: ../edit/virt-edit.pod:219
3168 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3173 #: ../edit/virt-edit.pod:221
3175 "What really happens is that the snippet is evaluated as a Perl expression "
3176 "for each line of the file. The line, including the final C<\\n>, is passed "
3177 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3181 #: ../edit/virt-edit.pod:226
3183 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3184 "C<apache> user account from the password file you can do:"
3188 #: ../edit/virt-edit.pod:229
3191 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3196 #: ../edit/virt-edit.pod:231
3198 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3199 "the end of the file is rather difficult this way since there is no concept "
3200 "of \"last line of the file\" - your expression just doesn't get called "
3201 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3206 #: ../edit/virt-edit.pod:237
3208 "The variable C<$lineno> contains the current line number. As is "
3209 "traditional, the first line in the file is number C<1>."
3213 #: ../edit/virt-edit.pod:240
3215 "The return value from the expression is ignored, but the expression may call "
3216 "C<die> in order to abort the whole program, leaving the original file "
3221 #: ../edit/virt-edit.pod:244
3223 "Remember when matching the end of a line that C<$_> may contain the final C<"
3224 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3225 "newline then neither of these. Thus to match or substitute some text at the "
3226 "end of a line, use this regular expression:"
3230 #: ../edit/virt-edit.pod:249
3233 " /some text(\\r?\\n)?$/\n"
3238 #: ../edit/virt-edit.pod:251
3240 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
3241 "$_> itself (since that would remove all newlines from the file):"
3245 #: ../edit/virt-edit.pod:255
3248 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3253 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
3254 msgid "WINDOWS PATHS"
3258 #: ../edit/virt-edit.pod:259
3260 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3261 "paths (eg. C<E:\\foo\\bar.txt>)."
3265 #: ../edit/virt-edit.pod:262
3266 msgid "If and only if the guest is running Windows then:"
3270 #: ../edit/virt-edit.pod:268
3272 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
3273 "to the correct filesystem."
3277 #: ../edit/virt-edit.pod:273
3279 "Any backslash (C<\\>) characters in the path are replaced with forward "
3280 "slashes so that libguestfs can process it."
3284 #: ../edit/virt-edit.pod:278
3286 "The path is resolved case insensitively to locate the file that should be "
3291 #: ../edit/virt-edit.pod:283
3292 msgid "There are some known shortcomings:"
3296 #: ../edit/virt-edit.pod:289
3297 msgid "Some NTFS symbolic links may not be followed correctly."
3301 #: ../edit/virt-edit.pod:293
3302 msgid "NTFS junction points that cross filesystems are not followed."
3306 #: ../edit/virt-edit.pod:299
3308 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
3309 "C<virt-edit> doesn't work."
3313 #: ../edit/virt-edit.pod:302
3314 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3318 #: ../edit/virt-edit.pod:304
3321 " guestfish --rw -i -d domname edit /file\n"
3326 #: ../edit/virt-edit.pod:306
3328 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
3333 #: ../edit/virt-edit.pod:309
3335 "The command above uses libguestfs's guest inspection feature and so does not "
3336 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
3337 "disk images that don't contain guests. To edit a file on a disk image "
3342 #: ../edit/virt-edit.pod:314
3345 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
3350 #: ../edit/virt-edit.pod:316
3352 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
3353 "the disk image to edit, and C</file> is the full path to the file."
3357 #: ../edit/virt-edit.pod:320
3359 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
3360 "C<write> or C<upload> instead:"
3364 #: ../edit/virt-edit.pod:323
3367 " guestfish --rw -i -d domname touch /newfile\n"
3372 #: ../edit/virt-edit.pod:325
3375 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3380 #: ../edit/virt-edit.pod:327
3383 " guestfish --rw -i -d domname upload localfile /newfile\n"
3388 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1086
3389 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
3390 #: ../src/guestfs.pod:3118 ../test-tool/libguestfs-test-tool.pod:95
3391 msgid "ENVIRONMENT VARIABLES"
3395 #: ../edit/virt-edit.pod:333
3400 #: ../edit/virt-edit.pod:335
3402 "If set, this string is used as the editor. It may contain arguments, eg. C<"
3407 #: ../edit/virt-edit.pod:338
3408 msgid "If not set, C<vi> is used."
3412 #: ../edit/virt-edit.pod:356
3414 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
3415 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
3416 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3420 #: ../erlang/examples/guestfs-erlang.pod:5
3421 msgid "guestfs-erlang - How to use libguestfs from Erlang"
3425 #: ../erlang/examples/guestfs-erlang.pod:9
3428 " {ok, G} = guestfs:create(),\n"
3429 " ok = guestfs:add_drive_opts(G, Disk,\n"
3430 " [{format, \"raw\"}, {readonly, true}]),\n"
3431 " ok = guestfs:launch(G),\n"
3432 " [Device] = guestfs:list_devices(G),\n"
3433 " ok = guestfs:close(G).\n"
3438 #: ../erlang/examples/guestfs-erlang.pod:18
3440 "This manual page documents how to call libguestfs from the Erlang "
3441 "programming language. This page just documents the differences from the C "
3442 "API and gives some examples. If you are not familiar with using libguestfs, "
3443 "you also need to read L<guestfs(3)>."
3447 #: ../erlang/examples/guestfs-erlang.pod:23
3448 msgid "OPENING AND CLOSING THE HANDLE"
3452 #: ../erlang/examples/guestfs-erlang.pod:25
3454 "The Erlang bindings are implemented using an external program called C<erl-"
3455 "guestfs>. This program must be on the current PATH, or else you should "
3456 "specify the full path to the program:"
3460 #: ../erlang/examples/guestfs-erlang.pod:29
3463 " {ok, G} = guestfs:create().\n"
3468 #: ../erlang/examples/guestfs-erlang.pod:31
3471 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
3476 #: ../erlang/examples/guestfs-erlang.pod:33
3477 msgid "C<G> is the libguestfs handle which you should pass to other functions."
3481 #: ../erlang/examples/guestfs-erlang.pod:36
3482 msgid "To close the handle:"
3486 #: ../erlang/examples/guestfs-erlang.pod:38
3489 " ok = guestfs:close(G).\n"
3494 #: ../erlang/examples/guestfs-erlang.pod:40
3495 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
3499 #: ../erlang/examples/guestfs-erlang.pod:42
3501 "For functions that take optional arguments, the first arguments are the non-"
3502 "optional ones. The last argument is a list of tuples supplying the "
3503 "remaining optional arguments."
3507 #: ../erlang/examples/guestfs-erlang.pod:46
3510 " ok = guestfs:add_drive_opts(G, Disk,\n"
3511 " [{format, \"raw\"}, {readonly, true}]).\n"
3516 #: ../erlang/examples/guestfs-erlang.pod:49
3517 msgid "If the last argument would be an empty list, you can also omit it:"
3521 #: ../erlang/examples/guestfs-erlang.pod:51
3524 " ok = guestfs:add_drive_opts(G, Disk).\n"
3529 #: ../erlang/examples/guestfs-erlang.pod:53
3530 msgid "RETURN VALUES AND ERRORS"
3534 #: ../erlang/examples/guestfs-erlang.pod:55
3536 "On success, most functions return a C<Result> term (which could be a list, "
3537 "string, tuple etc.). If there is nothing for the function to return, then "
3538 "the atom C<ok> is returned."
3542 #: ../erlang/examples/guestfs-erlang.pod:59
3543 msgid "On error, you would see one of the following tuples:"
3547 #: ../erlang/examples/guestfs-erlang.pod:63
3548 msgid "C<{error, Msg, Errno}>"
3552 #: ../erlang/examples/guestfs-erlang.pod:65
3553 msgid "This indicates an ordinary error from the function."
3557 #: ../erlang/examples/guestfs-erlang.pod:67
3559 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
3564 #: ../erlang/examples/guestfs-erlang.pod:70
3565 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
3569 #: ../erlang/examples/guestfs-erlang.pod:72
3570 msgid "C<{unknown, Function}>"
3574 #: ../erlang/examples/guestfs-erlang.pod:74
3576 "This indicates that the function you called is not known. Generally this "
3577 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
3578 "which you should not do."
3582 #: ../erlang/examples/guestfs-erlang.pod:78
3583 msgid "C<Function> is the name of the unknown function."
3587 #: ../erlang/examples/guestfs-erlang.pod:80
3588 msgid "C<{unknownarg, Arg}>"
3592 #: ../erlang/examples/guestfs-erlang.pod:82
3594 "This indicates that you called a function with optional arguments, with an "
3595 "unknown argument name."
3599 #: ../erlang/examples/guestfs-erlang.pod:85
3600 msgid "C<Arg> is the name of the unknown argument."
3604 #: ../erlang/examples/guestfs-erlang.pod:89
3605 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
3606 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
3607 #: ../python/examples/guestfs-python.pod:34
3608 #: ../ruby/examples/guestfs-ruby.pod:28
3609 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
3613 #: ../erlang/examples/guestfs-erlang.pod:91
3614 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
3615 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
3616 #: ../python/examples/guestfs-python.pod:36
3617 #: ../ruby/examples/guestfs-ruby.pod:30
3622 #: ../erlang/examples/guestfs-erlang.pod:93
3623 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
3624 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
3625 #: ../python/examples/guestfs-python.pod:38
3626 #: ../ruby/examples/guestfs-ruby.pod:32
3627 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
3631 #: ../erlang/examples/guestfs-erlang.pod:95
3632 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
3633 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
3634 #: ../python/examples/guestfs-python.pod:40
3635 #: ../ruby/examples/guestfs-ruby.pod:34
3640 #: ../erlang/examples/guestfs-erlang.pod:99
3642 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
3643 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
3644 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
3648 #: ../erlang/examples/guestfs-erlang.pod:110
3649 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
3650 #: ../fish/guestfish.pod:1262 ../fish/virt-copy-in.pod:60
3651 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
3652 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:319
3653 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
3654 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
3655 #: ../python/examples/guestfs-python.pod:54
3656 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3255
3657 #: ../test-tool/libguestfs-test-tool.pod:106
3662 #: ../erlang/examples/guestfs-erlang.pod:112
3663 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
3664 #: ../fish/guestfish.pod:1264 ../fish/virt-copy-in.pod:62
3665 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
3666 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:321
3667 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
3668 #: ../perl/examples/guestfs-perl.pod:54
3669 #: ../python/examples/guestfs-python.pod:56
3670 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3257
3671 #: ../test-tool/libguestfs-test-tool.pod:108
3672 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3676 #: ../erlang/examples/guestfs-erlang.pod:116
3677 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
3678 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
3682 #: ../erlang/examples/guestfs-erlang.pod:118
3683 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
3684 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
3685 #: ../perl/examples/guestfs-perl.pod:60
3686 #: ../python/examples/guestfs-python.pod:62
3687 #: ../ruby/examples/guestfs-ruby.pod:56
3689 "The examples in this manual page may be freely copied, modified and "
3690 "distributed without any restrictions."
3694 #: ../erlang/examples/guestfs-erlang.pod:121
3695 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
3696 #: ../java/examples/guestfs-java.pod:69
3697 #: ../ocaml/examples/guestfs-ocaml.pod:102
3698 #: ../perl/examples/guestfs-perl.pod:63
3699 #: ../python/examples/guestfs-python.pod:65
3700 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3264
3702 "This library is free software; you can redistribute it and/or modify it "
3703 "under the terms of the GNU Lesser General Public License as published by the "
3704 "Free Software Foundation; either version 2 of the License, or (at your "
3705 "option) any later version."
3709 #: ../erlang/examples/guestfs-erlang.pod:126
3710 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
3711 #: ../java/examples/guestfs-java.pod:74
3712 #: ../ocaml/examples/guestfs-ocaml.pod:107
3713 #: ../perl/examples/guestfs-perl.pod:68
3714 #: ../python/examples/guestfs-python.pod:70
3715 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3269
3717 "This library is distributed in the hope that it will be useful, but WITHOUT "
3718 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3719 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3724 #: ../erlang/examples/guestfs-erlang.pod:131
3725 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
3726 #: ../java/examples/guestfs-java.pod:79
3727 #: ../ocaml/examples/guestfs-ocaml.pod:112
3728 #: ../perl/examples/guestfs-perl.pod:73
3729 #: ../python/examples/guestfs-python.pod:75
3730 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3274
3732 "You should have received a copy of the GNU Lesser General Public License "
3733 "along with this library; if not, write to the Free Software Foundation, "
3734 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3738 #: ../examples/guestfs-examples.pod:5
3739 msgid "guestfs-examples - Examples of using libguestfs from C"
3743 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3746 " #include <guestfs.h>\n"
3751 #: ../examples/guestfs-examples.pod:11
3754 " guestfs_h *g = guestfs_create ();\n"
3755 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3756 " guestfs_launch (g);\n"
3761 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3764 " cc prog.c -o prog -lguestfs\n"
3766 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3771 #: ../examples/guestfs-examples.pod:21
3773 "This manual page contains examples of calling libguestfs from the C "
3774 "programming language. If you are not familiar with using libguestfs, you "
3775 "also need to read L<guestfs(3)>."
3779 #: ../examples/guestfs-examples.pod:35
3781 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
3782 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
3783 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
3787 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
3788 #: ../python/examples/guestfs-python.pod:60
3789 #: ../ruby/examples/guestfs-ruby.pod:54
3790 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3794 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3799 #: ../examples/guestfs-recipes.pod:5
3801 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3802 "here. The only way which works for both sorts of output is to just write "
3803 "the URL directly. Do NOT use L<...> for URLs."
3807 #: ../examples/guestfs-recipes.pod:9
3809 "We break with tradition here and don't use ALL CAPS for the section "
3810 "headings, as this makes them much easier to read."
3814 #: ../examples/guestfs-recipes.pod:16
3815 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3819 #: ../examples/guestfs-recipes.pod:20
3821 "This page contains recipes for and links to things you can do using "
3822 "libguestfs, L<guestfish(1)> and the virt tools."
3826 #: ../examples/guestfs-recipes.pod:23
3827 msgid "Audit a virtual machine for setuid files"
3831 #: ../examples/guestfs-recipes.pod:25
3833 "The link below contains a small program which can be used to audit a Linux "
3834 "virtual machine to see what setuid and setgid files it contains."
3838 #: ../examples/guestfs-recipes.pod:28
3840 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
3845 #: ../examples/guestfs-recipes.pod:30
3846 msgid "Change the background image in a Windows XP VM"
3850 #: ../examples/guestfs-recipes.pod:32
3852 "The links below explain how to use L<guestfish(1)> to change the background "
3853 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3854 "be substantially different for each version of Windows."
3858 #: ../examples/guestfs-recipes.pod:37
3860 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
3861 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3865 #: ../examples/guestfs-recipes.pod:40
3866 msgid "Cloning a virtual machine (Linux)"
3870 #: ../examples/guestfs-recipes.pod:42
3872 "The guestfish technique described in the link below works well for most "
3873 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3878 #: ../examples/guestfs-recipes.pod:46
3880 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
3885 #: ../examples/guestfs-recipes.pod:48
3887 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3892 #: ../examples/guestfs-recipes.pod:51
3893 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3897 #: ../examples/guestfs-recipes.pod:53
3898 msgid "Cloning a virtual machine (Windows)"
3902 #: ../examples/guestfs-recipes.pod:55
3904 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3905 "straightforward. Currently there is code in the Aeolus Oz project which "
3906 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3907 "we may add sysprepping ability."
3911 #: ../examples/guestfs-recipes.pod:60
3913 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
3914 "list/2011-May/msg00019.html"
3918 #: ../examples/guestfs-recipes.pod:63
3919 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3923 #: ../examples/guestfs-recipes.pod:65
3924 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3928 #: ../examples/guestfs-recipes.pod:67
3931 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3936 #: ../examples/guestfs-recipes.pod:69
3937 msgid "To export just a subdirectory, eg. C</files>, do:"
3941 #: ../examples/guestfs-recipes.pod:71
3944 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3949 #: ../examples/guestfs-recipes.pod:73
3950 msgid "Create empty disk images"
3954 #: ../examples/guestfs-recipes.pod:75
3956 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3957 "The useful guide below explains the options available."
3961 #: ../examples/guestfs-recipes.pod:78
3963 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
3968 #: ../examples/guestfs-recipes.pod:80
3969 msgid "Dump raw filesystem content from inside a disk image or VM"
3973 #: ../examples/guestfs-recipes.pod:82
3975 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3976 "filesystem content from any filesystem in a disk image or a VM (even one "
3977 "which is encrypted or buried inside an LV):"
3981 #: ../examples/guestfs-recipes.pod:86
3984 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3989 #: ../examples/guestfs-recipes.pod:88
3992 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3997 #: ../examples/guestfs-recipes.pod:90
3998 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4002 #: ../examples/guestfs-recipes.pod:92
4003 msgid "Edit grub configuration in a VM"
4007 #: ../examples/guestfs-recipes.pod:94
4008 msgid "You can use this to:"
4012 #: ../examples/guestfs-recipes.pod:100
4013 msgid "Fix a virtual machine that does not boot."
4017 #: ../examples/guestfs-recipes.pod:104
4018 msgid "Change which kernel is used to boot the VM."
4022 #: ../examples/guestfs-recipes.pod:108
4023 msgid "Change kernel command line options."
4027 #: ../examples/guestfs-recipes.pod:112
4028 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4032 #: ../examples/guestfs-recipes.pod:114
4035 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4040 #: ../examples/guestfs-recipes.pod:116
4042 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4047 #: ../examples/guestfs-recipes.pod:119
4050 " virt-rescue -d BrokenGuest\n"
4055 #: ../examples/guestfs-recipes.pod:121
4056 msgid "Export any directory from a VM"
4060 #: ../examples/guestfs-recipes.pod:123
4062 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4066 #: ../examples/guestfs-recipes.pod:126
4069 " virt-copy-out -d Guest /home .\n"
4074 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
4075 #: ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592
4076 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:18
4077 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2457
4078 #: ../src/guestfs-actions.pod:3008 ../src/guestfs.pod:1670
4079 #: ../tools/virt-win-reg.pl:706
4084 #: ../examples/guestfs-recipes.pod:134
4086 "The final dot of the command is not a printing error. It means we want to "
4087 "copy out to the current directory."
4091 #: ../examples/guestfs-recipes.pod:139
4092 msgid "This creates a directory called C<home> under the current directory."
4096 #: ../examples/guestfs-recipes.pod:143
4098 "If the guest is a Windows guest then you can use drive letters and "
4099 "backslashes, but you must prefix the path with C<win:> and quote it to "
4100 "protect it from the shell, like this:"
4104 #: ../examples/guestfs-recipes.pod:147
4107 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4112 #: ../examples/guestfs-recipes.pod:149
4113 msgid "To get the output as a compressed tarball, do:"
4117 #: ../examples/guestfs-recipes.pod:151
4120 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4125 #: ../examples/guestfs-recipes.pod:153
4127 "Although it sounds tempting, this is usually not a reliable way to get a "
4128 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
4129 "org/FAQ.html#backup"
4133 #: ../examples/guestfs-recipes.pod:157
4134 msgid "Find out which user is using the most space"
4138 #: ../examples/guestfs-recipes.pod:159
4140 "This simple script examines a Linux guest to find out which user is using "
4141 "the most space in their home directory:"
4145 #: ../examples/guestfs-recipes.pod:162
4153 #: ../examples/guestfs-recipes.pod:164
4161 #: ../examples/guestfs-recipes.pod:166
4170 #: ../examples/guestfs-recipes.pod:169
4173 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4178 #: ../examples/guestfs-recipes.pod:171
4181 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4182 " echo -n \"$dir/$d\"\n"
4184 " guestfish --remote du \"$dir/$d\";\n"
4185 " done | sort -nr -k 2\n"
4190 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4193 " guestfish --remote exit\n"
4198 #: ../examples/guestfs-recipes.pod:179
4199 msgid "Get DHCP address from a VM"
4203 #: ../examples/guestfs-recipes.pod:181
4205 "The link below explains the many different possible techniques for getting "
4206 "the last assigned DHCP address of a virtual machine."
4210 #: ../examples/guestfs-recipes.pod:184
4212 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
4213 "a-virtual-machine-disk-image/#content"
4217 #: ../examples/guestfs-recipes.pod:186
4219 "In the libguestfs source examples directory you will find the latest version "
4220 "of the C<virt-dhcp-address.c> program."
4224 #: ../examples/guestfs-recipes.pod:189
4225 msgid "Get the operating system product name string"
4229 #: ../examples/guestfs-recipes.pod:191
4230 msgid "Save the following script into a file called C<product-name.sh>:"
4234 #: ../examples/guestfs-recipes.pod:193
4239 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4240 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4241 " guestfish --remote inspect-get-product-name \"$root\"\n"
4242 " guestfish --remote exit\n"
4247 #: ../examples/guestfs-recipes.pod:200
4248 msgid "Make the script executable and run it on a named guest:"
4252 #: ../examples/guestfs-recipes.pod:202
4255 " # product-name.sh RHEL60x64\n"
4256 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4261 #: ../examples/guestfs-recipes.pod:205
4263 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4264 "C<xpath> command line tool or from your favourite programming language:"
4268 #: ../examples/guestfs-recipes.pod:209
4271 " # virt-inspector RHEL60x64 > xml\n"
4272 " # xpath '//product_name' < xml\n"
4275 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
4280 #: ../examples/guestfs-recipes.pod:215
4281 msgid "Get the default boot kernel for a Linux VM"
4285 #: ../examples/guestfs-recipes.pod:217
4287 "The link below contains a program to print the default boot kernel for a "
4292 #: ../examples/guestfs-recipes.pod:220
4294 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
4295 "kernel-for-a-vm/#content"
4299 #: ../examples/guestfs-recipes.pod:222
4301 "It uses Augeas, and the technique is generally applicable for many different "
4306 #: ../examples/guestfs-recipes.pod:229
4307 msgid "listing the user accounts in the guest"
4311 #: ../examples/guestfs-recipes.pod:233
4312 msgid "what repositories is it configured to use"
4316 #: ../examples/guestfs-recipes.pod:237
4317 msgid "what NTP servers does it connect to"
4321 #: ../examples/guestfs-recipes.pod:241
4322 msgid "what were the boot messages last time it booted"
4326 #: ../examples/guestfs-recipes.pod:245
4327 msgid "listing who was logged in recently"
4331 #: ../examples/guestfs-recipes.pod:249
4332 msgid "http://augeas.net/"
4336 #: ../examples/guestfs-recipes.pod:251
4337 msgid "Install RPMs in a guest"
4341 #: ../examples/guestfs-recipes.pod:253
4343 "The link below contains a method to install RPMs in a guest. In fact the "
4344 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4345 "installs them next time the guest is booted. You could use this technique "
4346 "to install vital security updates in an offline guest."
4350 #: ../examples/guestfs-recipes.pod:259
4352 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4356 #: ../examples/guestfs-recipes.pod:261
4357 msgid "List applications installed in a VM"
4361 #: ../examples/guestfs-recipes.pod:263
4362 msgid "Save the following to a file C<list-apps.sh>:"
4366 #: ../examples/guestfs-recipes.pod:265
4371 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4372 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4373 " guestfish --remote inspect-list-applications \"$root\"\n"
4374 " guestfish --remote exit\n"
4379 #: ../examples/guestfs-recipes.pod:272
4381 "Make the file executable and then you can run it on any named virtual "
4386 #: ../examples/guestfs-recipes.pod:275
4389 " # list-apps.sh WinGuest\n"
4391 " app_name: Mozilla Firefox (3.6.12)\n"
4392 " app_display_name: Mozilla Firefox (3.6.12)\n"
4394 " app_version: 3.6.12 (en-GB)\n"
4396 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4397 " app_trans_path:\n"
4398 " app_publisher: Mozilla\n"
4399 " app_url: http://www.mozilla.com/en-GB/\n"
4400 " app_source_package:\n"
4402 " app_description: Mozilla Firefox\n"
4405 " app_name: VLC media player\n"
4406 " app_display_name: VLC media player 1.1.5\n"
4408 " app_version: 1.1.5\n"
4410 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
4411 " app_trans_path:\n"
4412 " app_publisher: VideoLAN\n"
4413 " app_url: http://www.videolan.org/\n"
4414 " app_source_package:\n"
4416 " app_description:\n"
4422 #: ../examples/guestfs-recipes.pod:305
4424 "If you want to run the script on disk images (instead of libvirt virtual "
4425 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
4430 #: ../examples/guestfs-recipes.pod:309
4431 msgid "List files and directories in a VM"
4435 #: ../examples/guestfs-recipes.pod:311
4436 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
4440 #: ../examples/guestfs-recipes.pod:313
4443 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
4448 #: ../examples/guestfs-recipes.pod:315
4449 msgid "List services in a Windows VM"
4453 #: ../examples/guestfs-recipes.pod:317
4455 "The link below contains a script that can be used to list out the services "
4456 "from a Windows VM, and whether those services run at boot time or are loaded "
4461 #: ../examples/guestfs-recipes.pod:321
4463 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
4468 #: ../examples/guestfs-recipes.pod:323
4469 msgid "Make a disk image sparse"
4473 #: ../examples/guestfs-recipes.pod:325
4475 "The link below contains some guides for making a disk image sparse (or "
4476 "reintroducing sparseness)."
4480 #: ../examples/guestfs-recipes.pod:328
4482 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
4486 #: ../examples/guestfs-recipes.pod:330
4487 msgid "Monitor disk usage over time"
4491 #: ../examples/guestfs-recipes.pod:332
4493 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
4494 "The link below contains a guide."
4498 #: ../examples/guestfs-recipes.pod:335
4499 msgid "http://virt-tools.org/learning/advanced-virt-df/"
4503 #: ../examples/guestfs-recipes.pod:337
4504 msgid "Reading the Windows Event Log from Windows Vista (or later)"
4508 #: ../examples/guestfs-recipes.pod:339
4510 "L<guestfish(1)> plus the tools described in the link below can be used to "
4511 "read out the Windows Event Log from any virtual machine running Windows "
4512 "Vista or a later version."
4516 #: ../examples/guestfs-recipes.pod:343
4518 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
4519 "guestfish/#content"
4523 #: ../examples/guestfs-recipes.pod:345
4524 msgid "Remove root password (Linux)"
4528 #: ../examples/guestfs-recipes.pod:347
4530 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
4531 "files. One use is to remove the root password from a Linux guest:"
4535 #: ../examples/guestfs-recipes.pod:350
4538 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4543 #: ../examples/guestfs-recipes.pod:352
4544 msgid "Remove Administrator password (Windows)"
4548 #: ../examples/guestfs-recipes.pod:354
4550 "The link below contains one technique for removing the Administrator "
4551 "password from a Windows VM, or to be more precise, it gives you a command "
4552 "prompt the next time you log in which you can use to bypass any security:"
4556 #: ../examples/guestfs-recipes.pod:359
4558 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
4559 "administrator-password-with-guestfish/"
4563 #: ../examples/guestfs-recipes.pod:361
4564 msgid "Unpack a live CD"
4568 #: ../examples/guestfs-recipes.pod:363
4570 "Linux live CDs often contain multiple layers of disk images wrapped like a "
4571 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4572 "layers, as outlined in the guide below."
4576 #: ../examples/guestfs-recipes.pod:367
4578 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
4583 #: ../examples/guestfs-recipes.pod:369
4584 msgid "Uploading and downloading files"
4588 #: ../examples/guestfs-recipes.pod:371
4590 "The link below contains general tips on uploading (copying in) and "
4591 "downloading (copying out) files from VMs."
4595 #: ../examples/guestfs-recipes.pod:374
4597 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4601 #: ../examples/guestfs-recipes.pod:376
4602 msgid "Use libguestfs tools on VMware ESX guests"
4606 #: ../examples/guestfs-recipes.pod:378
4608 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4609 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4613 #: ../examples/guestfs-recipes.pod:382
4615 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
4620 #: ../examples/guestfs-recipes.pod:386
4622 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
4623 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
4624 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4628 #: ../examples/guestfs-recipes.pod:403
4629 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4633 #: ../fish/guestfish-actions.pod:1
4638 #: ../fish/guestfish-actions.pod:3
4641 " add-cdrom filename\n"
4646 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
4647 msgid "This function adds a virtual CD-ROM disk image to the guest."
4651 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
4652 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4656 #: ../fish/guestfish-actions.pod:15
4658 "This call checks for the existence of C<filename>. This stops you from "
4659 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4660 "and C<http:> URLs. To specify those, use the general L</config> call "
4665 #: ../fish/guestfish-actions.pod:22
4667 "If you just want to add an ISO file (often you use this as an efficient way "
4668 "to transfer large files into the guest), then you should probably use L</add-"
4669 "drive-ro> instead."
4673 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
4674 #: ../fish/guestfish-actions.pod:177
4676 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
4681 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
4682 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:1026
4683 #: ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:1400
4684 #: ../fish/guestfish-actions.pod:3157 ../fish/guestfish-actions.pod:3468
4685 #: ../fish/guestfish-actions.pod:3516 ../fish/guestfish-actions.pod:4429
4686 #: ../fish/guestfish-actions.pod:4452 ../fish/guestfish-actions.pod:4474
4687 #: ../fish/guestfish-actions.pod:4512 ../fish/guestfish-actions.pod:5161
4688 #: ../fish/guestfish-actions.pod:5267 ../src/guestfs-actions.pod:10
4689 #: ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273
4690 #: ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:2118
4691 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:4771
4692 #: ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5393
4693 #: ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6719
4694 #: ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6816
4695 #: ../src/guestfs-actions.pod:7748 ../src/guestfs-actions.pod:7857
4696 #: ../src/guestfs-actions.pod:8040
4698 "Deprecated functions will not be removed from the API, but the fact that "
4699 "they are deprecated indicates that there are problems with correct use of "
4704 #: ../fish/guestfish-actions.pod:35
4709 #: ../fish/guestfish-actions.pod:37
4714 #: ../fish/guestfish-actions.pod:39
4717 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
4722 #: ../fish/guestfish-actions.pod:41
4724 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4725 "It works by connecting to libvirt, requesting the domain and domain XML from "
4726 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
4730 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
4732 "The number of disks added is returned. This operation is atomic: if an "
4733 "error is returned, then no disks are added."
4737 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
4739 "This function does some minimal checks to make sure the libvirt domain is "
4740 "not running (unless C<readonly> is true). In a future version we will try "
4741 "to acquire the libvirt lock on each disk."
4745 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
4747 "Disks must be accessible locally. This often means that adding disks from a "
4748 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4749 "unless those disks are accessible via the same device path locally too."
4753 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
4755 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4756 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4757 "libvirt URI (or one set through an environment variable, see the libvirt "
4758 "documentation for full details)."
4762 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
4764 "The optional C<live> flag controls whether this call will try to connect to "
4765 "a running virtual machine C<guestfsd> process if it sees a suitable "
4766 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4767 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4768 "DAEMONS> for more information."
4772 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4774 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4775 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4776 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4781 #: ../fish/guestfish-actions.pod:76
4783 "The other optional parameters are passed directly through to L</add-drive-"
4788 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
4789 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:784
4790 #: ../fish/guestfish-actions.pod:805 ../fish/guestfish-actions.pod:2040
4791 #: ../fish/guestfish-actions.pod:3206 ../fish/guestfish-actions.pod:3369
4792 #: ../fish/guestfish-actions.pod:3504
4794 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
4798 #: ../fish/guestfish-actions.pod:81
4803 #: ../fish/guestfish-actions.pod:83
4806 " add-drive filename\n"
4811 #: ../fish/guestfish-actions.pod:85
4813 "This function is the equivalent of calling L</add-drive-opts> with no "
4814 "optional parameters, so the disk is added writable, with the format being "
4815 "detected automatically."
4819 #: ../fish/guestfish-actions.pod:89
4821 "Automatic detection of the format opens you up to a potential security hole "
4822 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4823 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4824 "you should think about replacing calls to this function with calls to L</add-"
4825 "drive-opts>, and specifying the format."
4829 #: ../fish/guestfish-actions.pod:96
4830 msgid "add-drive-opts"
4834 #: ../fish/guestfish-actions.pod:98
4839 #: ../fish/guestfish-actions.pod:100
4842 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4847 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4849 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4850 "The first time you call this function, the disk appears as C</dev/sda>, the "
4851 "second time as C</dev/sdb>, and so on."
4855 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4857 "You don't necessarily need to be root when using libguestfs. However you "
4858 "obviously do need sufficient permissions to access the filename for whatever "
4859 "operations you want to perform (ie. read access if you just want to read the "
4860 "image or write access if you want to modify the image)."
4864 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4865 msgid "This call checks that C<filename> exists."
4869 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3168
4870 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4808
4871 msgid "The optional arguments are:"
4875 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4880 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4882 "If true then the image is treated as read-only. Writes are still allowed, "
4883 "but they are stored in a temporary snapshot overlay which is discarded at "
4884 "the end. The disk that you add is not modified."
4888 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4893 #: ../fish/guestfish-actions.pod:127
4895 "This forces the image format. If you omit this (or use L</add-drive> or L</"
4896 "add-drive-ro>) then the format is automatically detected. Possible formats "
4897 "include C<raw> and C<qcow2>."
4901 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4903 "Automatic detection of the format opens you up to a potential security hole "
4904 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4905 "RHBZ#642934. Specifying the format closes this security hole."
4909 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4914 #: ../fish/guestfish-actions.pod:138
4916 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
4917 "add-drive-with-if> call (q.v.)"
4921 #: ../fish/guestfish-actions.pod:145
4922 msgid "add-drive-ro"
4926 #: ../fish/guestfish-actions.pod:147
4931 #: ../fish/guestfish-actions.pod:149
4934 " add-drive-ro filename\n"
4939 #: ../fish/guestfish-actions.pod:151
4941 "This function is the equivalent of calling L</add-drive-opts> with the "
4942 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4943 "is added read-only, with the format being detected automatically."
4947 #: ../fish/guestfish-actions.pod:156
4948 msgid "add-drive-ro-with-if"
4952 #: ../fish/guestfish-actions.pod:158
4955 " add-drive-ro-with-if filename iface\n"
4960 #: ../fish/guestfish-actions.pod:160
4962 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4963 "interface emulation to use at run time."
4967 #: ../fish/guestfish-actions.pod:170
4968 msgid "add-drive-with-if"
4972 #: ../fish/guestfish-actions.pod:172
4975 " add-drive-with-if filename iface\n"
4980 #: ../fish/guestfish-actions.pod:174
4982 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4983 "interface emulation to use at run time."
4987 #: ../fish/guestfish-actions.pod:184
4992 #: ../fish/guestfish-actions.pod:186
4995 " aug-clear augpath\n"
5000 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
5002 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5003 "L<augtool(1)> C<clear> command."
5007 #: ../fish/guestfish-actions.pod:191
5012 #: ../fish/guestfish-actions.pod:193
5020 #: ../fish/guestfish-actions.pod:195
5022 "Close the current Augeas handle and free up any resources used by it. After "
5023 "calling this, you have to call L</aug-init> again before you can use any "
5024 "other Augeas functions."
5028 #: ../fish/guestfish-actions.pod:200
5033 #: ../fish/guestfish-actions.pod:202
5036 " aug-defnode name expr val\n"
5041 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
5043 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5047 #: ../fish/guestfish-actions.pod:207
5049 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5050 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5051 "containing that single node."
5055 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
5057 "On success this returns a pair containing the number of nodes in the "
5058 "nodeset, and a boolean flag if a node was created."
5062 #: ../fish/guestfish-actions.pod:215
5067 #: ../fish/guestfish-actions.pod:217
5070 " aug-defvar name expr\n"
5075 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
5077 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5078 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5082 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
5084 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5085 "evaluates to something which is not a nodeset."
5089 #: ../fish/guestfish-actions.pod:226
5094 #: ../fish/guestfish-actions.pod:228
5097 " aug-get augpath\n"
5102 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
5104 "Look up the value associated with C<path>. If C<path> matches exactly one "
5105 "node, the C<value> is returned."
5109 #: ../fish/guestfish-actions.pod:233
5114 #: ../fish/guestfish-actions.pod:235
5117 " aug-init root flags\n"
5122 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
5124 "Create a new Augeas handle for editing configuration files. If there was "
5125 "any previous Augeas handle associated with this guestfs session, then it is "
5130 #: ../fish/guestfish-actions.pod:241
5131 msgid "You must call this before using any other L</aug-*> commands."
5135 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
5137 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5141 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
5143 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5144 "logical I<or> of the following integers:"
5148 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
5149 msgid "C<AUG_SAVE_BACKUP> = 1"
5153 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
5154 msgid "Keep the original file with a C<.augsave> extension."
5158 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
5159 msgid "C<AUG_SAVE_NEWFILE> = 2"
5163 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
5165 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5166 "original. Overrides C<AUG_SAVE_BACKUP>."
5170 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
5171 msgid "C<AUG_TYPE_CHECK> = 4"
5175 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
5176 msgid "Typecheck lenses."
5180 #: ../fish/guestfish-actions.pod:266
5182 "This option is only useful when debugging Augeas lenses. Use of this option "
5183 "may require additional memory for the libguestfs appliance. You may need to "
5184 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5188 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
5189 msgid "C<AUG_NO_STDINC> = 8"
5193 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
5194 msgid "Do not use standard load path for modules."
5198 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
5199 msgid "C<AUG_SAVE_NOOP> = 16"
5203 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
5204 msgid "Make save a no-op, just record what would have been changed."
5208 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
5209 msgid "C<AUG_NO_LOAD> = 32"
5213 #: ../fish/guestfish-actions.pod:281
5214 msgid "Do not load the tree in L</aug-init>."
5218 #: ../fish/guestfish-actions.pod:285
5219 msgid "To close the handle, you can call L</aug-close>."
5223 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
5224 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5228 #: ../fish/guestfish-actions.pod:289
5233 #: ../fish/guestfish-actions.pod:291
5236 " aug-insert augpath label true|false\n"
5241 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
5243 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5244 "or after C<path> (depending on the boolean flag C<before>)."
5248 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
5250 "C<path> must match exactly one existing node in the tree, and C<label> must "
5251 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5255 #: ../fish/guestfish-actions.pod:301
5260 #: ../fish/guestfish-actions.pod:303
5268 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
5269 msgid "Load files into the tree."
5273 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
5274 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5278 #: ../fish/guestfish-actions.pod:310
5283 #: ../fish/guestfish-actions.pod:312
5291 #: ../fish/guestfish-actions.pod:314
5293 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5294 "resulting nodes into alphabetical order."
5298 #: ../fish/guestfish-actions.pod:317
5303 #: ../fish/guestfish-actions.pod:319
5306 " aug-match augpath\n"
5311 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
5313 "Returns a list of paths which match the path expression C<path>. The "
5314 "returned paths are sufficiently qualified so that they match exactly one "
5315 "node in the current tree."
5319 #: ../fish/guestfish-actions.pod:325
5324 #: ../fish/guestfish-actions.pod:327
5327 " aug-mv src dest\n"
5332 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
5334 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5335 "C<dest> is overwritten if it exists."
5339 #: ../fish/guestfish-actions.pod:332
5344 #: ../fish/guestfish-actions.pod:334
5352 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
5353 msgid "Remove C<path> and all of its children."
5357 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
5358 msgid "On success this returns the number of entries which were removed."
5362 #: ../fish/guestfish-actions.pod:340
5367 #: ../fish/guestfish-actions.pod:342
5375 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
5376 msgid "This writes all pending changes to disk."
5380 #: ../fish/guestfish-actions.pod:346
5382 "The flags which were passed to L</aug-init> affect exactly how files are "
5387 #: ../fish/guestfish-actions.pod:349
5392 #: ../fish/guestfish-actions.pod:351
5395 " aug-set augpath val\n"
5400 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
5401 msgid "Set the value associated with C<path> to C<val>."
5405 #: ../fish/guestfish-actions.pod:355
5407 "In the Augeas API, it is possible to clear a node by setting the value to "
5408 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5409 "this call. Instead you must use the L</aug-clear> call."
5413 #: ../fish/guestfish-actions.pod:360
5418 #: ../fish/guestfish-actions.pod:362
5421 " available 'groups ...'\n"
5426 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
5428 "This command is used to check the availability of some groups of "
5429 "functionality in the appliance, which not all builds of the libguestfs "
5430 "appliance will be able to provide."
5434 #: ../fish/guestfish-actions.pod:368
5436 "The libguestfs groups, and the functions that those groups correspond to, "
5437 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5438 "runtime by calling L</available-all-groups>."
5442 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
5444 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5445 "\"]> would check for the availability of the Linux inotify functions and "
5446 "Augeas (configuration file editing) functions."
5450 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
5451 msgid "The command returns no error if I<all> requested groups are available."
5455 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
5457 "It fails with an error if one or more of the requested groups is unavailable "
5462 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
5464 "If an unknown group name is included in the list of groups then an error is "
5469 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
5474 #: ../fish/guestfish-actions.pod:392
5475 msgid "You must call L</launch> before calling this function."
5479 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
5481 "The reason is because we don't know what groups are supported by the "
5482 "appliance/daemon until it is running and can be queried."
5486 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
5488 "If a group of functions is available, this does not necessarily mean that "
5489 "they will work. You still have to check for errors when calling individual "
5490 "API functions even if they are available."
5494 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
5496 "It is usually the job of distro packagers to build complete functionality "
5497 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5498 "with all requirements satisfied, will support everything."
5502 #: ../fish/guestfish-actions.pod:414
5504 "This call was added in version C<1.0.80>. In previous versions of "
5505 "libguestfs all you could do would be to speculatively execute a command to "
5506 "find out if the daemon implemented it. See also L</version>."
5510 #: ../fish/guestfish-actions.pod:421
5511 msgid "available-all-groups"
5515 #: ../fish/guestfish-actions.pod:423
5518 " available-all-groups\n"
5523 #: ../fish/guestfish-actions.pod:425
5525 "This command returns a list of all optional groups that this daemon knows "
5526 "about. Note this returns both supported and unsupported groups. To find "
5527 "out which ones the daemon can actually support you have to call L</"
5528 "available> on each member of the returned list."
5532 #: ../fish/guestfish-actions.pod:431
5533 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
5537 #: ../fish/guestfish-actions.pod:433
5542 #: ../fish/guestfish-actions.pod:435
5545 " base64-in (base64file|-) filename\n"
5550 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
5552 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5556 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449
5557 #: ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:782
5558 #: ../fish/guestfish-actions.pod:803 ../fish/guestfish-actions.pod:902
5559 #: ../fish/guestfish-actions.pod:921 ../fish/guestfish-actions.pod:1295
5560 #: ../fish/guestfish-actions.pod:4732 ../fish/guestfish-actions.pod:4744
5561 #: ../fish/guestfish-actions.pod:4755 ../fish/guestfish-actions.pod:4766
5562 #: ../fish/guestfish-actions.pod:4818 ../fish/guestfish-actions.pod:4827
5563 #: ../fish/guestfish-actions.pod:4881 ../fish/guestfish-actions.pod:4904
5564 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
5568 #: ../fish/guestfish-actions.pod:442
5573 #: ../fish/guestfish-actions.pod:444
5576 " base64-out filename (base64file|-)\n"
5581 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
5583 "This command downloads the contents of C<filename>, writing it out to local "
5584 "file C<base64file> encoded as base64."
5588 #: ../fish/guestfish-actions.pod:451
5589 msgid "blockdev-flushbufs"
5593 #: ../fish/guestfish-actions.pod:453
5596 " blockdev-flushbufs device\n"
5601 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
5603 "This tells the kernel to flush internal buffers associated with C<device>."
5607 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469
5608 #: ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488
5609 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513
5610 #: ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532
5611 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548
5612 #: ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696
5613 #: ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727
5614 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764
5615 #: ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796
5616 #: ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
5617 msgid "This uses the L<blockdev(8)> command."
5621 #: ../fish/guestfish-actions.pod:460
5622 msgid "blockdev-getbsz"
5626 #: ../fish/guestfish-actions.pod:462
5629 " blockdev-getbsz device\n"
5634 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
5635 msgid "This returns the block size of a device."
5639 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529
5640 #: ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
5642 "(Note this is different from both I<size in blocks> and I<filesystem block "
5647 #: ../fish/guestfish-actions.pod:471
5648 msgid "blockdev-getro"
5652 #: ../fish/guestfish-actions.pod:473
5655 " blockdev-getro device\n"
5660 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
5662 "Returns a boolean indicating if the block device is read-only (true if read-"
5663 "only, false if not)."
5667 #: ../fish/guestfish-actions.pod:480
5668 msgid "blockdev-getsize64"
5672 #: ../fish/guestfish-actions.pod:482
5675 " blockdev-getsize64 device\n"
5680 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
5681 msgid "This returns the size of the device in bytes."
5685 #: ../fish/guestfish-actions.pod:486
5686 msgid "See also L</blockdev-getsz>."
5690 #: ../fish/guestfish-actions.pod:490
5691 msgid "blockdev-getss"
5695 #: ../fish/guestfish-actions.pod:492
5698 " blockdev-getss device\n"
5703 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
5705 "This returns the size of sectors on a block device. Usually 512, but can be "
5706 "larger for modern devices."
5710 #: ../fish/guestfish-actions.pod:497
5712 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5716 #: ../fish/guestfish-actions.pod:502
5717 msgid "blockdev-getsz"
5721 #: ../fish/guestfish-actions.pod:504
5724 " blockdev-getsz device\n"
5729 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
5731 "This returns the size of the device in units of 512-byte sectors (even if "
5732 "the sectorsize isn't 512 bytes ... weird)."
5736 #: ../fish/guestfish-actions.pod:509
5738 "See also L</blockdev-getss> for the real sector size of the device, and L</"
5739 "blockdev-getsize64> for the more useful I<size in bytes>."
5743 #: ../fish/guestfish-actions.pod:515
5744 msgid "blockdev-rereadpt"
5748 #: ../fish/guestfish-actions.pod:517
5751 " blockdev-rereadpt device\n"
5756 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
5757 msgid "Reread the partition table on C<device>."
5761 #: ../fish/guestfish-actions.pod:523
5762 msgid "blockdev-setbsz"
5766 #: ../fish/guestfish-actions.pod:525
5769 " blockdev-setbsz device blocksize\n"
5774 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
5775 msgid "This sets the block size of a device."
5779 #: ../fish/guestfish-actions.pod:534
5780 msgid "blockdev-setro"
5784 #: ../fish/guestfish-actions.pod:536
5787 " blockdev-setro device\n"
5792 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
5793 msgid "Sets the block device named C<device> to read-only."
5797 #: ../fish/guestfish-actions.pod:542
5798 msgid "blockdev-setrw"
5802 #: ../fish/guestfish-actions.pod:544
5805 " blockdev-setrw device\n"
5810 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
5811 msgid "Sets the block device named C<device> to read-write."
5815 #: ../fish/guestfish-actions.pod:550
5816 msgid "btrfs-filesystem-resize"
5820 #: ../fish/guestfish-actions.pod:552
5823 " btrfs-filesystem-resize mountpoint [size:..]\n"
5828 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
5829 msgid "This command resizes a btrfs filesystem."
5833 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
5835 "Note that unlike other resize calls, the filesystem has to be mounted and "
5836 "the parameter is the mountpoint not the device (this is a requirement of "
5841 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3479
5842 #: ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5332
5843 msgid "The optional parameters are:"
5847 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3483
5848 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5336
5853 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5855 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5856 "resized to the maximum size."
5860 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
5861 msgid "See also L<btrfs(8)>."
5865 #: ../fish/guestfish-actions.pod:575
5866 msgid "case-sensitive-path"
5870 #: ../fish/guestfish-actions.pod:577
5873 " case-sensitive-path path\n"
5878 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5880 "This can be used to resolve case insensitive paths on a filesystem which is "
5881 "case sensitive. The use case is to resolve paths which you have read from "
5882 "Windows configuration files or the Windows Registry, to the true path."
5886 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5888 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5889 "(and probably others), which is that although the underlying filesystem is "
5890 "case-insensitive, the driver exports the filesystem to Linux as case-"
5895 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
5897 "One consequence of this is that special directories such as C<c:\\windows> "
5898 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5899 "precise details of how they were created. In Windows itself this would not "
5904 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
5906 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5911 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
5913 "This function resolves the true case of each element in the path and returns "
5914 "the case-sensitive path."
5918 #: ../fish/guestfish-actions.pod:601
5920 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
5921 "WINDOWS/system32\"> (the exact return value would depend on details of how "
5922 "the directories were originally created under Windows)."
5926 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
5927 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5931 #: ../fish/guestfish-actions.pod:609
5932 msgid "See also L</realpath>."
5936 #: ../fish/guestfish-actions.pod:611
5941 #: ../fish/guestfish-actions.pod:613
5949 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3899
5950 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5975
5951 msgid "Return the contents of the file named C<path>."
5955 #: ../fish/guestfish-actions.pod:617
5957 "Note that this function cannot correctly handle binary files (specifically, "
5958 "files containing C<\\0> character which is treated as end of string). For "
5959 "those you need to use the L</read-file> or L</download> functions which have "
5960 "a more complex interface."
5964 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757
5965 #: ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:980
5966 #: ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1057
5967 #: ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1259
5968 #: ../fish/guestfish-actions.pod:1572 ../fish/guestfish-actions.pod:1582
5969 #: ../fish/guestfish-actions.pod:1632 ../fish/guestfish-actions.pod:1647
5970 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1676
5971 #: ../fish/guestfish-actions.pod:3769 ../fish/guestfish-actions.pod:3784
5972 #: ../fish/guestfish-actions.pod:3860 ../fish/guestfish-actions.pod:3877
5973 #: ../fish/guestfish-actions.pod:3892 ../fish/guestfish-actions.pod:4573
5974 #: ../fish/guestfish-actions.pod:4619 ../fish/guestfish-actions.pod:4704
5975 #: ../fish/guestfish-actions.pod:4719 ../fish/guestfish-actions.pod:5125
5976 #: ../fish/guestfish-actions.pod:5137 ../fish/guestfish-actions.pod:5155
5977 #: ../fish/guestfish-actions.pod:5172 ../fish/guestfish-actions.pod:5182
5978 #: ../fish/guestfish-actions.pod:5239 ../fish/guestfish-actions.pod:5249
5979 #: ../fish/guestfish-actions.pod:5278 ../fish/guestfish-actions.pod:5288
5980 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127
5981 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1554
5982 #: ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:1676
5983 #: ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1941
5984 #: ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2442
5985 #: ../src/guestfs-actions.pod:2507 ../src/guestfs-actions.pod:2531
5986 #: ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2577
5987 #: ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5783
5988 #: ../src/guestfs-actions.pod:5914 ../src/guestfs-actions.pod:5940
5989 #: ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6931
5990 #: ../src/guestfs-actions.pod:6986 ../src/guestfs-actions.pod:7132
5991 #: ../src/guestfs-actions.pod:7156 ../src/guestfs-actions.pod:7821
5992 #: ../src/guestfs-actions.pod:7841 ../src/guestfs-actions.pod:7874
5993 #: ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912
5994 #: ../src/guestfs-actions.pod:8006 ../src/guestfs-actions.pod:8025
5995 #: ../src/guestfs-actions.pod:8071 ../src/guestfs-actions.pod:8090
5997 "Because of the message protocol, there is a transfer limit of somewhere "
5998 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6002 #: ../fish/guestfish-actions.pod:625
6007 #: ../fish/guestfish-actions.pod:627
6010 " checksum csumtype path\n"
6015 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
6017 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6021 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
6023 "The type of checksum to compute is given by the C<csumtype> parameter which "
6024 "must have one of the following values:"
6028 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
6033 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
6035 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6040 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
6045 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
6046 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6050 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
6055 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
6056 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6060 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
6065 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
6066 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6070 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
6075 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
6076 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6080 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
6085 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
6086 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6090 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
6095 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
6096 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6100 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
6101 msgid "The checksum is returned as a printable string."
6105 #: ../fish/guestfish-actions.pod:670
6106 msgid "To get the checksum for a device, use L</checksum-device>."
6110 #: ../fish/guestfish-actions.pod:672
6111 msgid "To get the checksums for many files, use L</checksums-out>."
6115 #: ../fish/guestfish-actions.pod:674
6116 msgid "checksum-device"
6120 #: ../fish/guestfish-actions.pod:676
6123 " checksum-device csumtype device\n"
6128 #: ../fish/guestfish-actions.pod:678
6130 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6131 "device named C<device>. For the types of checksums supported see the L</"
6132 "checksum> command."
6136 #: ../fish/guestfish-actions.pod:682
6137 msgid "checksums-out"
6141 #: ../fish/guestfish-actions.pod:684
6144 " checksums-out csumtype directory (sumsfile|-)\n"
6149 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
6151 "This command computes the checksums of all regular files in C<directory> and "
6152 "then emits a list of those checksums to the local output file C<sumsfile>."
6156 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
6158 "This can be used for verifying the integrity of a virtual machine. However "
6159 "to be properly secure you should pay attention to the output of the checksum "
6160 "command (it uses the ones from GNU coreutils). In particular when the "
6161 "filename is not printable, coreutils uses a special backslash syntax. For "
6162 "more information, see the GNU coreutils info file."
6166 #: ../fish/guestfish-actions.pod:700
6171 #: ../fish/guestfish-actions.pod:702
6174 " chmod mode path\n"
6179 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
6181 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6186 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
6188 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6189 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6194 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3132
6195 #: ../fish/guestfish-actions.pod:3271 ../fish/guestfish-actions.pod:3281
6196 #: ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:1064
6197 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4948
6198 #: ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986
6199 msgid "The mode actually set is affected by the umask."
6203 #: ../fish/guestfish-actions.pod:713
6208 #: ../fish/guestfish-actions.pod:715
6211 " chown owner group path\n"
6216 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
6217 msgid "Change the file owner to C<owner> and group to C<group>."
6221 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2567
6222 #: ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3810
6224 "Only numeric uid and gid are supported. If you want to use names, you will "
6225 "need to locate and parse the password file yourself (Augeas support makes "
6226 "this relatively easy)."
6230 #: ../fish/guestfish-actions.pod:723
6235 #: ../fish/guestfish-actions.pod:725
6238 " command 'arguments ...'\n"
6243 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
6245 "This call runs a command from the guest filesystem. The filesystem must be "
6246 "mounted, and must contain a compatible operating system (ie. something "
6247 "Linux, with the same or compatible processor architecture)."
6251 #: ../fish/guestfish-actions.pod:732
6253 "The single parameter is an argv-style list of arguments. The first element "
6254 "is the name of the program to run. Subsequent elements are parameters. The "
6255 "list must be non-empty (ie. must contain a program name). Note that the "
6256 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6260 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
6261 msgid "The return value is anything printed to I<stdout> by the command."
6265 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
6267 "If the command returns a non-zero exit status, then this function returns an "
6268 "error message. The error message string is the content of I<stderr> from "
6273 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
6275 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6276 "bin>. If you require a program from another location, you should provide "
6277 "the full path in the first parameter."
6281 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
6283 "Shared libraries and data files required by the program must be available on "
6284 "filesystems which are mounted in the correct places. It is the caller's "
6285 "responsibility to ensure all filesystems that are needed are mounted at the "
6290 #: ../fish/guestfish-actions.pod:760
6291 msgid "command-lines"
6295 #: ../fish/guestfish-actions.pod:762
6298 " command-lines 'arguments ...'\n"
6303 #: ../fish/guestfish-actions.pod:764
6305 "This is the same as L</command>, but splits the result into a list of lines."
6309 #: ../fish/guestfish-actions.pod:767
6310 msgid "See also: L</sh-lines>"
6314 #: ../fish/guestfish-actions.pod:772
6315 msgid "compress-device-out"
6319 #: ../fish/guestfish-actions.pod:774
6322 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6327 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
6329 "This command compresses C<device> and writes it out to the local file "
6334 #: ../fish/guestfish-actions.pod:779
6336 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
6341 #: ../fish/guestfish-actions.pod:786
6342 msgid "compress-out"
6346 #: ../fish/guestfish-actions.pod:788
6349 " compress-out ctype file (zfile|-) [level:..]\n"
6354 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1220
6356 "This command compresses C<file> and writes it out to the local file C<zfile>."
6360 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1223
6362 "The compression program used is controlled by the C<ctype> parameter. "
6363 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6364 "Some compression types may not be supported by particular builds of "
6365 "libguestfs, in which case you will get an error containing the substring "
6366 "\"not supported\"."
6370 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1229
6372 "The optional C<level> parameter controls compression level. The meaning and "
6373 "default for this parameter depends on the compression program being used."
6377 #: ../fish/guestfish-actions.pod:807
6382 #: ../fish/guestfish-actions.pod:809
6385 " config qemuparam qemuvalue\n"
6390 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1270
6392 "This can be used to add arbitrary qemu command line parameters of the form "
6393 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6394 "setting some parameters which would interfere with parameters that we use."
6398 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1275
6399 msgid "The first character of C<param> string must be a C<-> (dash)."
6403 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1277
6404 msgid "C<value> can be NULL."
6408 #: ../fish/guestfish-actions.pod:820
6413 #: ../fish/guestfish-actions.pod:822
6416 " copy-size src dest size\n"
6421 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1291
6423 "This command copies exactly C<size> bytes from one source device or file "
6424 "C<src> to another destination device or file C<dest>."
6428 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1294
6430 "Note this will fail if the source is too short or if the destination is not "
6435 #: ../fish/guestfish-actions.pod:830
6440 #: ../fish/guestfish-actions.pod:832
6448 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1313
6450 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6451 "destination filename or destination directory."
6455 #: ../fish/guestfish-actions.pod:837
6460 #: ../fish/guestfish-actions.pod:839
6468 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1327
6470 "This copies a file or directory from C<src> to C<dest> recursively using the "
6475 #: ../fish/guestfish-actions.pod:844
6480 #: ../fish/guestfish-actions.pod:846
6488 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1341
6490 "This command copies from one source device or file C<src> to another "
6491 "destination device or file C<dest>. Normally you would use this to copy to "
6492 "or from a device or partition, for example to duplicate a filesystem."
6496 #: ../fish/guestfish-actions.pod:853
6498 "If the destination is a device, it must be as large or larger than the "
6499 "source file or device, otherwise the copy will fail. This command cannot do "
6500 "partial copies (see L</copy-size>)."
6504 #: ../fish/guestfish-actions.pod:857
6509 #: ../fish/guestfish-actions.pod:859
6517 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1359
6518 msgid "This command runs the C<df> command to report disk space used."
6522 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
6524 "This command is mostly useful for interactive sessions. It is I<not> "
6525 "intended that you try to parse the output string. Use L</statvfs> from "
6530 #: ../fish/guestfish-actions.pod:867
6535 #: ../fish/guestfish-actions.pod:869
6543 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1375
6545 "This command runs the C<df -h> command to report disk space used in human-"
6550 #: ../fish/guestfish-actions.pod:878
6555 #: ../fish/guestfish-actions.pod:880
6563 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1392
6565 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6566 "This is sometimes useful for extended debugging of problems."
6570 #: ../fish/guestfish-actions.pod:886
6572 "Another way to get the same information is to enable verbose messages with "
6573 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
6574 "before running the program."
6578 #: ../fish/guestfish-actions.pod:891
6583 #: ../fish/guestfish-actions.pod:893
6586 " download remotefilename (filename|-)\n"
6591 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908
6592 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1438
6594 "Download file C<remotefilename> and save it as C<filename> on the local "
6599 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4877
6600 #: ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:7391
6601 msgid "C<filename> can also be a named pipe."
6605 #: ../fish/guestfish-actions.pod:900
6606 msgid "See also L</upload>, L</cat>."
6610 #: ../fish/guestfish-actions.pod:904
6611 msgid "download-offset"
6615 #: ../fish/guestfish-actions.pod:906
6618 " download-offset remotefilename (filename|-) offset size\n"
6623 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1441
6625 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6626 "region must be within the file or device)."
6630 #: ../fish/guestfish-actions.pod:914
6632 "Note that there is no limit on the amount of data that can be downloaded "
6633 "with this call, unlike with L</pread>, and this call always reads the full "
6634 "amount unless an error occurs."
6638 #: ../fish/guestfish-actions.pod:919
6639 msgid "See also L</download>, L</pread>."
6643 #: ../fish/guestfish-actions.pod:923
6648 #: ../fish/guestfish-actions.pod:925
6651 " drop-caches whattodrop\n"
6656 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1466
6658 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6659 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6660 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6664 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1471
6665 msgid "Setting C<whattodrop> to 3 should drop everything."
6669 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1473
6671 "This automatically calls L<sync(2)> before the operation, so that the "
6672 "maximum guest memory is freed."
6676 #: ../fish/guestfish-actions.pod:937
6681 #: ../fish/guestfish-actions.pod:939
6689 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1486
6691 "This command runs the C<du -s> command to estimate file space usage for "
6696 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1489
6698 "C<path> can be a file or a directory. If C<path> is a directory then the "
6699 "estimate includes the contents of the directory and all subdirectories "
6704 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1493
6706 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6710 #: ../fish/guestfish-actions.pod:951
6715 #: ../fish/guestfish-actions.pod:953
6718 " e2fsck-f device\n"
6723 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1511
6725 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6726 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6731 #: ../fish/guestfish-actions.pod:959
6733 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6734 "should use L</fsck>."
6738 #: ../fish/guestfish-actions.pod:962
6743 #: ../fish/guestfish-actions.pod:964
6746 " echo-daemon 'words ...'\n"
6751 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1528
6753 "This command concatenates the list of C<words> passed with single spaces "
6754 "between them and returns the resulting string."
6758 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1531
6759 msgid "You can use this command to test the connection through to the daemon."
6763 #: ../fish/guestfish-actions.pod:971
6764 msgid "See also L</ping-daemon>."
6768 #: ../fish/guestfish-actions.pod:973
6773 #: ../fish/guestfish-actions.pod:975
6776 " egrep regex path\n"
6781 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1547
6783 "This calls the external C<egrep> program and returns the matching lines."
6787 #: ../fish/guestfish-actions.pod:983
6792 #: ../fish/guestfish-actions.pod:985
6795 " egrepi regex path\n"
6800 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1566
6802 "This calls the external C<egrep -i> program and returns the matching lines."
6806 #: ../fish/guestfish-actions.pod:993
6811 #: ../fish/guestfish-actions.pod:995
6814 " equal file1 file2\n"
6819 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1585
6821 "This compares the two files C<file1> and C<file2> and returns true if their "
6822 "content is exactly equal, or false otherwise."
6826 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1588
6827 msgid "The external L<cmp(1)> program is used for the comparison."
6831 #: ../fish/guestfish-actions.pod:1002
6836 #: ../fish/guestfish-actions.pod:1004
6844 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1600
6846 "This returns C<true> if and only if there is a file, directory (or anything) "
6847 "with the given C<path> name."
6851 #: ../fish/guestfish-actions.pod:1009
6852 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6856 #: ../fish/guestfish-actions.pod:1011
6861 #: ../fish/guestfish-actions.pod:1013
6864 " fallocate path len\n"
6869 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034
6870 #: ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1642
6872 "This command preallocates a file (containing zero bytes) named C<path> of "
6873 "size C<len> bytes. If the file exists already, it is overwritten."
6877 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1627
6879 "Do not confuse this with the guestfish-specific C<alloc> command which "
6880 "allocates a file in the host and attaches it as a device."
6884 #: ../fish/guestfish-actions.pod:1023
6886 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
6891 #: ../fish/guestfish-actions.pod:1030
6896 #: ../fish/guestfish-actions.pod:1032
6899 " fallocate64 path len\n"
6904 #: ../fish/guestfish-actions.pod:1038
6906 "Note that this call allocates disk blocks for the file. To create a sparse "
6907 "file use L</truncate-size> instead."
6911 #: ../fish/guestfish-actions.pod:1041
6913 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6914 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6915 "maximum size of files created through that call to 1GB."
6919 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1654
6921 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6922 "commands which create a file in the host and attach it as a device."
6926 #: ../fish/guestfish-actions.pod:1050
6931 #: ../fish/guestfish-actions.pod:1052
6934 " fgrep pattern path\n"
6939 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1669
6941 "This calls the external C<fgrep> program and returns the matching lines."
6945 #: ../fish/guestfish-actions.pod:1060
6950 #: ../fish/guestfish-actions.pod:1062
6953 " fgrepi pattern path\n"
6958 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1688
6960 "This calls the external C<fgrep -i> program and returns the matching lines."
6964 #: ../fish/guestfish-actions.pod:1070
6969 #: ../fish/guestfish-actions.pod:1072
6977 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1706
6979 "This call uses the standard L<file(1)> command to determine the type or "
6980 "contents of the file."
6984 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1709
6986 "This call will also transparently look inside various types of compressed "
6991 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1712
6993 "The exact command which runs is C<file -zb path>. Note in particular that "
6994 "the filename is not prepended to the output (the I<-b> option)."
6998 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1716
7000 "The output depends on the output of the underlying L<file(1)> command and it "
7001 "can change in future in ways beyond our control. In other words, the output "
7002 "is not guaranteed by the ABI."
7006 #: ../fish/guestfish-actions.pod:1088
7008 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7009 "(etc), L</is-zero>."
7013 #: ../fish/guestfish-actions.pod:1091
7014 msgid "file-architecture"
7018 #: ../fish/guestfish-actions.pod:1093
7021 " file-architecture filename\n"
7026 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1734
7028 "This detects the architecture of the binary C<filename>, and returns it if "
7033 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1737
7034 msgid "Currently defined architectures are:"
7038 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1741
7043 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1743
7045 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7046 "irrespective of the precise processor requirements of the binary."
7050 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1746
7055 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1748
7056 msgid "64 bit x86-64."
7060 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1750
7065 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1752
7066 msgid "32 bit SPARC."
7070 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1754
7075 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1756
7076 msgid "64 bit SPARC V9 and above."
7080 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1758
7085 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1760
7086 msgid "Intel Itanium."
7090 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1762
7095 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1764
7096 msgid "32 bit Power PC."
7100 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1766
7105 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1768
7106 msgid "64 bit Power PC."
7110 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1772
7111 msgid "Libguestfs may return other architecture strings in future."
7115 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1774
7116 msgid "The function works on at least the following types of files:"
7120 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1780
7121 msgid "many types of Un*x and Linux binary"
7125 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1784
7126 msgid "many types of Un*x and Linux shared library"
7130 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1788
7131 msgid "Windows Win32 and Win64 binaries"
7135 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1792
7136 msgid "Windows Win32 and Win64 DLLs"
7140 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1794
7141 msgid "Win32 binaries and DLLs return C<i386>."
7145 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1796
7146 msgid "Win64 binaries and DLLs return C<x86_64>."
7150 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1800
7151 msgid "Linux kernel modules"
7155 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1804
7156 msgid "Linux new-style initrd images"
7160 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1808
7161 msgid "some non-x86 Linux vmlinuz kernels"
7165 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1812
7166 msgid "What it can't do currently:"
7170 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1818
7171 msgid "static libraries (libfoo.a)"
7175 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1822
7176 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7180 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1826
7181 msgid "x86 Linux vmlinuz kernels"
7185 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1828
7187 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7188 "compressed code, and are horribly hard to unpack. If you want to find the "
7189 "architecture of a kernel, use the architecture of the associated initrd or "
7190 "kernel module(s) instead."
7194 #: ../fish/guestfish-actions.pod:1196
7199 #: ../fish/guestfish-actions.pod:1198
7207 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1846
7208 msgid "This command returns the size of C<file> in bytes."
7212 #: ../fish/guestfish-actions.pod:1202
7214 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
7215 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
7219 #: ../fish/guestfish-actions.pod:1206
7224 #: ../fish/guestfish-actions.pod:1208
7227 " fill c len path\n"
7232 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1864
7234 "This command creates a new file called C<path>. The initial content of the "
7235 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7240 #: ../fish/guestfish-actions.pod:1214
7242 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7243 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7248 #: ../fish/guestfish-actions.pod:1219
7249 msgid "fill-pattern"
7253 #: ../fish/guestfish-actions.pod:1221
7256 " fill-pattern pattern len path\n"
7261 #: ../fish/guestfish-actions.pod:1223
7263 "This function is like L</fill> except that it creates a new file of length "
7264 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7265 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7270 #: ../fish/guestfish-actions.pod:1228
7275 #: ../fish/guestfish-actions.pod:1230
7283 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1910
7285 "This command lists out all files and directories, recursively, starting at "
7286 "C<directory>. It is essentially equivalent to running the shell command "
7287 "C<find directory -print> but some post-processing happens on the output, "
7292 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1915
7294 "This returns a list of strings I<without any prefix>. Thus if the directory "
7299 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1918
7309 #: ../fish/guestfish-actions.pod:1244
7310 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7314 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1925
7325 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1930
7326 msgid "If C<directory> is not a directory, then this command returns an error."
7330 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1933
7331 msgid "The returned list is sorted."
7335 #: ../fish/guestfish-actions.pod:1257
7336 msgid "See also L</find0>."
7340 #: ../fish/guestfish-actions.pod:1262
7345 #: ../fish/guestfish-actions.pod:1264
7348 " find0 directory (files|-)\n"
7353 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1953
7355 "This command lists out all files and directories, recursively, starting at "
7356 "C<directory>, placing the resulting list in the external file called "
7361 #: ../fish/guestfish-actions.pod:1270
7363 "This command works the same way as L</find> with the following exceptions:"
7367 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1964
7368 msgid "The resulting list is written to an external file."
7372 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1968
7374 "Items (filenames) in the result are separated by C<\\0> characters. See "
7375 "L<find(1)> option I<-print0>."
7379 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1973
7380 msgid "This command is not limited in the number of names that it can return."
7384 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1978
7385 msgid "The result list is not sorted."
7389 #: ../fish/guestfish-actions.pod:1297
7390 msgid "findfs-label"
7394 #: ../fish/guestfish-actions.pod:1299
7397 " findfs-label label\n"
7402 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1992
7404 "This command searches the filesystems and returns the one which has the "
7405 "given label. An error is returned if no such filesystem can be found."
7409 #: ../fish/guestfish-actions.pod:1305
7410 msgid "To find the label of a filesystem, use L</vfs-label>."
7414 #: ../fish/guestfish-actions.pod:1307
7419 #: ../fish/guestfish-actions.pod:1309
7422 " findfs-uuid uuid\n"
7427 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2009
7429 "This command searches the filesystems and returns the one which has the "
7430 "given UUID. An error is returned if no such filesystem can be found."
7434 #: ../fish/guestfish-actions.pod:1315
7435 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7439 #: ../fish/guestfish-actions.pod:1317
7444 #: ../fish/guestfish-actions.pod:1319
7447 " fsck fstype device\n"
7452 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2027
7454 "This runs the filesystem checker (fsck) on C<device> which should have "
7455 "filesystem type C<fstype>."
7459 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2030
7461 "The returned integer is the status. See L<fsck(8)> for the list of status "
7462 "codes from C<fsck>."
7466 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2039
7467 msgid "Multiple status codes can be summed together."
7471 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2043
7473 "A non-zero return code can mean \"success\", for example if errors have been "
7474 "corrected on the filesystem."
7478 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2048
7479 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7483 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2053
7485 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7489 #: ../fish/guestfish-actions.pod:1349
7494 #: ../fish/guestfish-actions.pod:1351
7502 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2064
7504 "Return the additional kernel options which are added to the guest kernel "
7509 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2067
7510 msgid "If C<NULL> then no options are added."
7514 #: ../fish/guestfish-actions.pod:1358
7515 msgid "get-attach-method"
7519 #: ../fish/guestfish-actions.pod:1360
7522 " get-attach-method\n"
7527 #: ../fish/guestfish-actions.pod:1362
7528 msgid "Return the current attach method. See L</set-attach-method>."
7532 #: ../fish/guestfish-actions.pod:1364
7533 msgid "get-autosync"
7537 #: ../fish/guestfish-actions.pod:1366
7545 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2092
7546 msgid "Get the autosync flag."
7550 #: ../fish/guestfish-actions.pod:1370
7555 #: ../fish/guestfish-actions.pod:1372
7563 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2103
7564 msgid "Return the direct appliance mode flag."
7568 #: ../fish/guestfish-actions.pod:1376
7573 #: ../fish/guestfish-actions.pod:1378
7576 " get-e2label device\n"
7581 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2122
7583 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7587 #: ../fish/guestfish-actions.pod:1383
7589 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
7594 #: ../fish/guestfish-actions.pod:1390
7599 #: ../fish/guestfish-actions.pod:1392
7602 " get-e2uuid device\n"
7607 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2143
7609 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7613 #: ../fish/guestfish-actions.pod:1397
7615 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
7620 #: ../fish/guestfish-actions.pod:1404
7625 #: ../fish/guestfish-actions.pod:1406
7633 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2156
7635 "This gets the memory size in megabytes allocated to the qemu subprocess."
7639 #: ../fish/guestfish-actions.pod:1411
7641 "If L</set-memsize> was not called on this handle, and if "
7642 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7643 "value for memsize."
7647 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472
7648 #: ../fish/guestfish-actions.pod:4225 ../fish/guestfish-actions.pod:4327
7649 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2255
7650 #: ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6562
7652 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7656 #: ../fish/guestfish-actions.pod:1418
7661 #: ../fish/guestfish-actions.pod:1420
7669 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2175
7670 msgid "This returns the enable network flag."
7674 #: ../fish/guestfish-actions.pod:1424
7679 #: ../fish/guestfish-actions.pod:1426
7687 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2186
7688 msgid "Return the current search path."
7692 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2188
7694 "This is always non-NULL. If it wasn't set already, then this will return "
7699 #: ../fish/guestfish-actions.pod:1433
7704 #: ../fish/guestfish-actions.pod:1435
7712 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2201
7713 msgid "This returns the process group flag."
7717 #: ../fish/guestfish-actions.pod:1439
7722 #: ../fish/guestfish-actions.pod:1441
7727 #: ../fish/guestfish-actions.pod:1443
7735 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2212
7737 "Return the process ID of the qemu subprocess. If there is no qemu "
7738 "subprocess, then this will return an error."
7742 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2215
7743 msgid "This is an internal call used for debugging and testing."
7747 #: ../fish/guestfish-actions.pod:1450
7752 #: ../fish/guestfish-actions.pod:1452
7760 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2226
7761 msgid "Return the current qemu binary."
7765 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2228
7767 "This is always non-NULL. If it wasn't set already, then this will return "
7768 "the default qemu binary name."
7772 #: ../fish/guestfish-actions.pod:1459
7773 msgid "get-recovery-proc"
7777 #: ../fish/guestfish-actions.pod:1461
7780 " get-recovery-proc\n"
7785 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2241
7786 msgid "Return the recovery process enabled flag."
7790 #: ../fish/guestfish-actions.pod:1465
7795 #: ../fish/guestfish-actions.pod:1467
7803 #: ../fish/guestfish-actions.pod:1469
7805 "This returns the current setting of the selinux flag which is passed to the "
7806 "appliance at boot time. See L</set-selinux>."
7810 #: ../fish/guestfish-actions.pod:1475
7815 #: ../fish/guestfish-actions.pod:1477
7823 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2267
7824 msgid "This returns the number of virtual CPUs assigned to the appliance."
7828 #: ../fish/guestfish-actions.pod:1481
7833 #: ../fish/guestfish-actions.pod:1483
7841 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2278
7843 "This returns the current state as an opaque integer. This is only useful "
7844 "for printing debug and internal error messages."
7848 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2434
7849 #: ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2490
7850 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:2281
7851 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3616
7852 #: ../src/guestfs-actions.pod:3677 ../src/guestfs-actions.pod:3704
7853 msgid "For more information on states, see L<guestfs(3)>."
7857 #: ../fish/guestfish-actions.pod:1490
7862 #: ../fish/guestfish-actions.pod:1492
7870 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2292
7871 msgid "Return the command trace flag."
7875 #: ../fish/guestfish-actions.pod:1496
7880 #: ../fish/guestfish-actions.pod:1498
7888 #: ../fish/guestfish-actions.pod:1500
7890 "Return the current umask. By default the umask is C<022> unless it has been "
7891 "set by calling L</umask>."
7895 #: ../fish/guestfish-actions.pod:1503
7900 #: ../fish/guestfish-actions.pod:1505
7908 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2315
7909 msgid "This returns the verbose messages flag."
7913 #: ../fish/guestfish-actions.pod:1509
7918 #: ../fish/guestfish-actions.pod:1511
7926 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2326
7927 msgid "This gets the SELinux security context of the daemon."
7931 #: ../fish/guestfish-actions.pod:1515
7932 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7936 #: ../fish/guestfish-actions.pod:1518
7941 #: ../fish/guestfish-actions.pod:1520
7944 " getxattr path name\n"
7949 #: ../fish/guestfish-actions.pod:1522
7951 "Get a single extended attribute from file C<path> named C<name>. This call "
7952 "follows symlinks. If you want to lookup an extended attribute for the "
7953 "symlink itself, use L</lgetxattr>."
7957 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2579
7959 "Normally it is better to get all extended attributes from a file in one go "
7960 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7961 "buggy and do not provide a way to list out attributes. For these "
7962 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7963 "attributes you want in advance and call this function."
7967 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2586
7968 #: ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3837
7970 "Extended attribute values are blobs of binary data. If there is no extended "
7971 "attribute named C<name>, this returns an error."
7975 #: ../fish/guestfish-actions.pod:1536
7976 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7980 #: ../fish/guestfish-actions.pod:1538
7985 #: ../fish/guestfish-actions.pod:1540
7993 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2372
7995 "This call lists the extended attributes of the file or directory C<path>."
7999 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2375
8001 "At the system call level, this is a combination of the L<listxattr(2)> and "
8002 "L<getxattr(2)> calls."
8006 #: ../fish/guestfish-actions.pod:1548
8007 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8011 #: ../fish/guestfish-actions.pod:1550
8016 #: ../fish/guestfish-actions.pod:1552
8019 " glob-expand pattern\n"
8024 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2392
8026 "This command searches for all the pathnames matching C<pattern> according to "
8027 "the wildcard expansion rules used by the shell."
8031 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2396
8033 "If no paths match, then this returns an empty list (note: not an error)."
8037 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2399
8039 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8040 "GLOB_BRACE>. See that manual page for more details."
8044 #: ../fish/guestfish-actions.pod:1565
8049 #: ../fish/guestfish-actions.pod:1567
8052 " grep regex path\n"
8057 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2416
8058 msgid "This calls the external C<grep> program and returns the matching lines."
8062 #: ../fish/guestfish-actions.pod:1575
8067 #: ../fish/guestfish-actions.pod:1577
8070 " grepi regex path\n"
8075 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2435
8077 "This calls the external C<grep -i> program and returns the matching lines."
8081 #: ../fish/guestfish-actions.pod:1585
8082 msgid "grub-install"
8086 #: ../fish/guestfish-actions.pod:1587
8089 " grub-install root device\n"
8094 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2454
8096 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8097 "with the root directory being C<root>."
8101 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2463
8103 "There is currently no way in the API to install grub2, which is used by most "
8104 "modern Linux guests. It is possible to run the grub2 command from the "
8105 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8109 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2470
8111 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8112 "compatible with itself, so this only works in rather narrow circumstances. "
8113 "Careful testing with each guest version is advisable."
8117 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2477
8119 "If grub-install reports the error \"No suitable drive was found in the "
8120 "generated device map.\" it may be that you need to create a C</boot/grub/"
8121 "device.map> file first that contains the mapping between grub device names "
8122 "and Linux device names. It is usually sufficient to create a file "
8127 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2484
8135 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2486
8136 msgid "replacing C</dev/vda> with the name of the installation device."
8140 #: ../fish/guestfish-actions.pod:1625
8145 #: ../fish/guestfish-actions.pod:1627
8153 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2500
8155 "This command returns up to the first 10 lines of a file as a list of strings."
8159 #: ../fish/guestfish-actions.pod:1635
8164 #: ../fish/guestfish-actions.pod:1637
8167 " head-n nrlines path\n"
8172 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2519
8174 "If the parameter C<nrlines> is a positive number, this returns the first "
8175 "C<nrlines> lines of the file C<path>."
8179 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2522
8181 "If the parameter C<nrlines> is a negative number, this returns lines from "
8182 "the file C<path>, excluding the last C<nrlines> lines."
8186 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4717
8187 #: ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:7150
8188 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8192 #: ../fish/guestfish-actions.pod:1650
8197 #: ../fish/guestfish-actions.pod:1652
8205 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2542
8207 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8208 "readable, canonical hex dump of the file."
8212 #: ../fish/guestfish-actions.pod:1660
8217 #: ../fish/guestfish-actions.pod:1662
8220 " initrd-cat initrdpath filename\n"
8225 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2561
8227 "This command unpacks the file C<filename> from the initrd file called "
8228 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8233 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2565
8235 "For example, in guestfish you could use the following command to examine the "
8236 "boot script (usually called C</init>) contained in a Linux initrd or "
8241 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2569
8244 " initrd-cat /boot/initrd-<version>.img init\n"
8249 #: ../fish/guestfish-actions.pod:1674
8250 msgid "See also L</initrd-list>."
8254 #: ../fish/guestfish-actions.pod:1679
8259 #: ../fish/guestfish-actions.pod:1681
8262 " initrd-list path\n"
8267 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2588
8268 msgid "This command lists out files contained in an initrd."
8272 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2590
8274 "The files are listed without any initial C</> character. The files are "
8275 "listed in the order they appear (not necessarily alphabetical). Directory "
8276 "names are listed as separate items."
8280 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2594
8282 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8283 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8288 #: ../fish/guestfish-actions.pod:1693
8289 msgid "inotify-add-watch"
8293 #: ../fish/guestfish-actions.pod:1695
8296 " inotify-add-watch path mask\n"
8301 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2611
8302 msgid "Watch C<path> for the events listed in C<mask>."
8306 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2613
8308 "Note that if C<path> is a directory then events within that directory are "
8309 "watched, but this does I<not> happen recursively (in subdirectories)."
8313 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2617
8315 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8316 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8320 #: ../fish/guestfish-actions.pod:1707
8321 msgid "inotify-close"
8325 #: ../fish/guestfish-actions.pod:1709
8333 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2630
8335 "This closes the inotify handle which was previously opened by inotify_init. "
8336 "It removes all watches, throws away any pending events, and deallocates all "
8341 #: ../fish/guestfish-actions.pod:1715
8342 msgid "inotify-files"
8346 #: ../fish/guestfish-actions.pod:1717
8354 #: ../fish/guestfish-actions.pod:1719
8356 "This function is a helpful wrapper around L</inotify-read> which just "
8357 "returns a list of pathnames of objects that were touched. The returned "
8358 "pathnames are sorted and deduplicated."
8362 #: ../fish/guestfish-actions.pod:1723
8363 msgid "inotify-init"
8367 #: ../fish/guestfish-actions.pod:1725
8370 " inotify-init maxevents\n"
8375 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2659
8377 "This command creates a new inotify handle. The inotify subsystem can be "
8378 "used to notify events which happen to objects in the guest filesystem."
8382 #: ../fish/guestfish-actions.pod:1731
8384 "C<maxevents> is the maximum number of events which will be queued up between "
8385 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8386 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8387 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8388 "but records the fact that it threw them away by setting a flag "
8389 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8393 #: ../fish/guestfish-actions.pod:1741
8395 "Before any events are generated, you have to add some watches to the "
8396 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8397 "L</inotify-watch-all>."
8401 #: ../fish/guestfish-actions.pod:1747
8403 "Queued up events should be read periodically by calling L</inotify-read> (or "
8404 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8405 "If you don't read the events out often enough then you risk the internal "
8406 "queue overflowing."
8410 #: ../fish/guestfish-actions.pod:1754
8412 "The handle should be closed after use by calling L</inotify-close>. This "
8413 "also removes any watches automatically."
8417 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2690
8419 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8420 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8421 "that there is one global inotify handle per libguestfs instance."
8425 #: ../fish/guestfish-actions.pod:1763
8426 msgid "inotify-read"
8430 #: ../fish/guestfish-actions.pod:1765
8438 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2704
8440 "Return the complete queue of events that have happened since the previous "
8445 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2707
8446 msgid "If no events have happened, this returns an empty list."
8450 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2709
8452 "I<Note>: In order to make sure that all events have been read, you must call "
8453 "this function repeatedly until it returns an empty list. The reason is that "
8454 "the call will read events up to the maximum appliance-to-host message size "
8455 "and leave remaining events in the queue."
8459 #: ../fish/guestfish-actions.pod:1778
8460 msgid "inotify-rm-watch"
8464 #: ../fish/guestfish-actions.pod:1780
8467 " inotify-rm-watch wd\n"
8472 #: ../fish/guestfish-actions.pod:1782
8473 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8477 #: ../fish/guestfish-actions.pod:1785
8478 msgid "inspect-get-arch"
8482 #: ../fish/guestfish-actions.pod:1787
8485 " inspect-get-arch root\n"
8490 #: ../fish/guestfish-actions.pod:1789
8492 "This returns the architecture of the inspected operating system. The "
8493 "possible return values are listed under L</file-architecture>."
8497 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2744
8499 "If the architecture could not be determined, then the string C<unknown> is "
8504 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1883
8505 #: ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1974
8506 #: ../fish/guestfish-actions.pod:2058 ../fish/guestfish-actions.pod:2119
8507 #: ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2154
8508 #: ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2226
8509 #: ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252
8510 #: ../fish/guestfish-actions.pod:2262 ../fish/guestfish-actions.pod:2272
8511 #: ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2380
8512 #: ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:2747
8513 #: ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2945
8514 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3095
8515 #: ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3206
8516 #: ../src/guestfs-actions.pod:3227 ../src/guestfs-actions.pod:3280
8517 #: ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3340
8518 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3377
8519 #: ../src/guestfs-actions.pod:3393 ../src/guestfs-actions.pod:3411
8520 #: ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3554
8521 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8525 #: ../fish/guestfish-actions.pod:1798
8526 msgid "inspect-get-distro"
8530 #: ../fish/guestfish-actions.pod:1800
8533 " inspect-get-distro root\n"
8538 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2760
8540 "This returns the distro (distribution) of the inspected operating system."
8544 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2763
8545 msgid "Currently defined distros are:"
8549 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2767
8550 msgid "\"archlinux\""
8554 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2769
8559 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2771
8564 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2773
8569 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2775
8574 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2777
8579 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2779
8584 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2781
8589 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2783
8594 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2785
8599 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2787
8600 msgid "\"linuxmint\""
8604 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2789
8609 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2791
8610 msgid "\"mandriva\""
8614 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2793
8619 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2795
8624 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2797
8629 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2799
8634 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2801
8639 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2803
8640 msgid "\"redhat-based\""
8644 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2805
8645 msgid "Some Red Hat-derived distro."
8649 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2807
8654 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2809
8655 msgid "Red Hat Enterprise Linux."
8659 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2811
8660 msgid "\"scientificlinux\""
8664 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2813
8665 msgid "Scientific Linux."
8669 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2815
8670 msgid "\"slackware\""
8674 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2817
8679 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2819
8680 msgid "\"ttylinux\""
8684 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2821
8689 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2823
8694 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2825
8699 #: ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:1953
8700 #: ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:2827
8701 #: ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3311
8706 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2829
8707 msgid "The distro could not be determined."
8711 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:2209
8712 #: ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:3303
8717 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2833
8719 "Windows does not have distributions. This string is returned if the OS type "
8724 #: ../fish/guestfish-actions.pod:1880 ../fish/guestfish-actions.pod:1959
8725 #: ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2838
8726 #: ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:3317
8728 "Future versions of libguestfs may return other strings here. The caller "
8729 "should be prepared to handle any string."
8733 #: ../fish/guestfish-actions.pod:1885
8734 msgid "inspect-get-drive-mappings"
8738 #: ../fish/guestfish-actions.pod:1887
8741 " inspect-get-drive-mappings root\n"
8746 #: ../fish/guestfish-actions.pod:1889 ../src/guestfs-actions.pod:2854
8748 "This call is useful for Windows which uses a primitive system of assigning "
8749 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8750 "Windows Registry to find out how disks/partitions are mapped to drive "
8751 "letters, and returns a hash table as in the example below:"
8755 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2860
8765 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2864
8767 "Note that keys are drive letters. For Windows, the key is case insensitive "
8768 "and just contains the drive letter, without the customary colon separator "
8773 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2868
8775 "In future we may support other operating systems that also used drive "
8776 "letters, but the keys for those might not be case insensitive and might be "
8777 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8782 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2873
8784 "For Windows guests, currently only hard drive mappings are returned. "
8785 "Removable disks (eg. DVD-ROMs) are ignored."
8789 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2876
8791 "For guests that do not use drive mappings, or if the drive mappings could "
8792 "not be determined, this returns an empty hash table."
8796 #: ../fish/guestfish-actions.pod:1914
8798 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8799 "get-mountpoints>, L</inspect-get-filesystems>."
8803 #: ../fish/guestfish-actions.pod:1918
8804 msgid "inspect-get-filesystems"
8808 #: ../fish/guestfish-actions.pod:1920
8811 " inspect-get-filesystems root\n"
8816 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:2897
8818 "This returns a list of all the filesystems that we think are associated with "
8819 "this operating system. This includes the root filesystem, other ordinary "
8820 "filesystems, and non-mounted devices like swap partitions."
8824 #: ../fish/guestfish-actions.pod:1927 ../src/guestfs-actions.pod:2902
8826 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8827 "to be shared between operating systems."
8831 #: ../fish/guestfish-actions.pod:1930
8833 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8838 #: ../fish/guestfish-actions.pod:1933
8839 msgid "inspect-get-format"
8843 #: ../fish/guestfish-actions.pod:1935
8846 " inspect-get-format root\n"
8851 #: ../fish/guestfish-actions.pod:1937 ../src/guestfs-actions.pod:2920
8853 "This returns the format of the inspected operating system. You can use it "
8854 "to detect install images, live CDs and similar."
8858 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2923
8859 msgid "Currently defined formats are:"
8863 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:2927
8864 msgid "\"installed\""
8868 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2929
8869 msgid "This is an installed operating system."
8873 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2931
8874 msgid "\"installer\""
8878 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2933
8880 "The disk image being inspected is not an installed operating system, but a "
8881 "I<bootable> install disk, live CD, or similar."
8885 #: ../fish/guestfish-actions.pod:1955 ../src/guestfs-actions.pod:2938
8886 msgid "The format of this disk image is not known."
8890 #: ../fish/guestfish-actions.pod:1964
8891 msgid "inspect-get-hostname"
8895 #: ../fish/guestfish-actions.pod:1966
8898 " inspect-get-hostname root\n"
8903 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2958
8905 "This function returns the hostname of the operating system as found by "
8906 "inspection of the guest's configuration files."
8910 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:2961
8912 "If the hostname could not be determined, then the string C<unknown> is "
8917 #: ../fish/guestfish-actions.pod:1976
8918 msgid "inspect-get-icon"
8922 #: ../fish/guestfish-actions.pod:1978
8925 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8930 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:2987
8932 "This function returns an icon corresponding to the inspected operating "
8933 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8934 "to PNG if necessary)."
8938 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2991
8940 "If it was not possible to get an icon this function returns a zero-length "
8941 "(non-NULL) buffer. I<Callers must check for this case>."
8945 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:2994
8947 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8948 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8949 "this file will be returned. You can disable favicons by passing the "
8950 "optional C<favicon> boolean as false (default is true)."
8954 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3000
8956 "If finding the favicon fails, then we look in other places in the guest for "
8961 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3003
8963 "If the optional C<highquality> boolean is true then only high quality icons "
8964 "are returned, which means only icons of high resolution with an alpha "
8965 "channel. The default (false) is to return any icon we can, even if it is of "
8966 "substandard quality."
8970 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3014
8972 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8973 "before you call this, since it needs to read information from the guest "
8974 "filesystem during the call."
8978 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3020
8980 "B<Security:> The icon data comes from the untrusted guest, and should be "
8981 "treated with caution. PNG files have been known to contain exploits. "
8982 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8983 "trying to process or display the icon."
8987 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3028
8989 "The PNG image returned can be any size. It might not be square. Libguestfs "
8990 "tries to return the largest, highest quality icon available. The "
8991 "application must scale the icon to the required size."
8995 #: ../fish/guestfish-actions.pod:2028 ../src/guestfs-actions.pod:3035
8997 "Extracting icons from Windows guests requires the external C<wrestool> "
8998 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8999 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9000 "installed separately."
9004 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3042
9006 "Operating system icons are usually trademarks. Seek legal advice before "
9007 "using trademarks in applications."
9011 #: ../fish/guestfish-actions.pod:2042
9012 msgid "inspect-get-major-version"
9016 #: ../fish/guestfish-actions.pod:2044
9019 " inspect-get-major-version root\n"
9024 #: ../fish/guestfish-actions.pod:2046 ../src/guestfs-actions.pod:3083
9026 "This returns the major version number of the inspected operating system."
9030 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3086
9032 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9033 "popular public names used by the operating system. Notably the operating "
9034 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9035 "1). You can find out the real versions corresponding to releases of Windows "
9036 "by consulting Wikipedia or MSDN."
9040 #: ../fish/guestfish-actions.pod:2056 ../fish/guestfish-actions.pod:2067
9041 #: ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3110
9042 msgid "If the version could not be determined, then C<0> is returned."
9046 #: ../fish/guestfish-actions.pod:2060
9047 msgid "inspect-get-minor-version"
9051 #: ../fish/guestfish-actions.pod:2062
9054 " inspect-get-minor-version root\n"
9059 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3107
9061 "This returns the minor version number of the inspected operating system."
9065 #: ../fish/guestfish-actions.pod:2069
9067 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9068 "get-major-version>."
9072 #: ../fish/guestfish-actions.pod:2072
9073 msgid "inspect-get-mountpoints"
9077 #: ../fish/guestfish-actions.pod:2074
9080 " inspect-get-mountpoints root\n"
9085 #: ../fish/guestfish-actions.pod:2076 ../src/guestfs-actions.pod:3125
9087 "This returns a hash of where we think the filesystems associated with this "
9088 "operating system should be mounted. Callers should note that this is at "
9089 "best an educated guess made by reading configuration files such as C</etc/"
9090 "fstab>. I<In particular note> that this may return filesystems which are "
9091 "non-existent or not mountable and callers should be prepared to handle or "
9092 "ignore failures if they try to mount them."
9096 #: ../fish/guestfish-actions.pod:2085 ../src/guestfs-actions.pod:3134
9098 "Each element in the returned hashtable has a key which is the path of the "
9099 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9100 "mounted there (eg. C</dev/sda1>)."
9104 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3139
9106 "Non-mounted devices such as swap devices are I<not> returned in this list."
9110 #: ../fish/guestfish-actions.pod:2093
9112 "For operating systems like Windows which still use drive letters, this call "
9113 "will only return an entry for the first drive \"mounted on\" C</>. For "
9114 "information about the mapping of drive letters to partitions, see L</inspect-"
9115 "get-drive-mappings>."
9119 #: ../fish/guestfish-actions.pod:2099
9121 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9126 #: ../fish/guestfish-actions.pod:2102
9127 msgid "inspect-get-package-format"
9131 #: ../fish/guestfish-actions.pod:2104
9134 " inspect-get-package-format root\n"
9139 #: ../fish/guestfish-actions.pod:2106
9141 "This function and L</inspect-get-package-management> return the package "
9142 "format and package management tool used by the inspected operating system. "
9143 "For example for Fedora these functions would return C<rpm> (package format) "
9144 "and C<yum> (package management)."
9148 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3171
9150 "This returns the string C<unknown> if we could not determine the package "
9151 "format I<or> if the operating system does not have a real packaging system "
9156 #: ../fish/guestfish-actions.pod:2116 ../src/guestfs-actions.pod:3175
9158 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9159 "Future versions of libguestfs may return other strings."
9163 #: ../fish/guestfish-actions.pod:2121
9164 msgid "inspect-get-package-management"
9168 #: ../fish/guestfish-actions.pod:2123
9171 " inspect-get-package-management root\n"
9176 #: ../fish/guestfish-actions.pod:2125
9178 "L</inspect-get-package-format> and this function return the package format "
9179 "and package management tool used by the inspected operating system. For "
9180 "example for Fedora these functions would return C<rpm> (package format) and "
9181 "C<yum> (package management)."
9185 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3197
9187 "This returns the string C<unknown> if we could not determine the package "
9188 "management tool I<or> if the operating system does not have a real packaging "
9189 "system (eg. Windows)."
9193 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3201
9195 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9196 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9197 "libguestfs may return other strings."
9201 #: ../fish/guestfish-actions.pod:2142
9202 msgid "inspect-get-product-name"
9206 #: ../fish/guestfish-actions.pod:2144
9209 " inspect-get-product-name root\n"
9214 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3219
9216 "This returns the product name of the inspected operating system. The "
9217 "product name is generally some freeform string which can be displayed to the "
9218 "user, but should not be parsed by programs."
9222 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:3224
9224 "If the product name could not be determined, then the string C<unknown> is "
9229 #: ../fish/guestfish-actions.pod:2156
9230 msgid "inspect-get-product-variant"
9234 #: ../fish/guestfish-actions.pod:2158
9237 " inspect-get-product-variant root\n"
9242 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3240
9243 msgid "This returns the product variant of the inspected operating system."
9247 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3243
9249 "For Windows guests, this returns the contents of the Registry key C<HKLM"
9250 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
9251 "is usually a string such as C<Client> or C<Server> (other values are "
9252 "possible). This can be used to distinguish consumer and enterprise versions "
9253 "of Windows that have the same version number (for example, Windows 7 and "
9254 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9255 "the latter is C<Server>)."
9259 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3252
9261 "For enterprise Linux guests, in future we intend this to return the product "
9262 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9263 "implemented at present."
9267 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3256
9269 "If the product variant could not be determined, then the string C<unknown> "
9274 #: ../fish/guestfish-actions.pod:2179
9276 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
9277 "get-product-name>, L</inspect-get-major-version>."
9281 #: ../fish/guestfish-actions.pod:2183
9282 msgid "inspect-get-roots"
9286 #: ../fish/guestfish-actions.pod:2185
9289 " inspect-get-roots\n"
9294 #: ../fish/guestfish-actions.pod:2187
9296 "This function is a convenient way to get the list of root devices, as "
9297 "returned from a previous call to L</inspect-os>, but without redoing the "
9298 "whole inspection process."
9302 #: ../fish/guestfish-actions.pod:2191
9304 "This returns an empty list if either no root devices were found or the "
9305 "caller has not called L</inspect-os>."
9309 #: ../fish/guestfish-actions.pod:2196
9310 msgid "inspect-get-type"
9314 #: ../fish/guestfish-actions.pod:2198
9317 " inspect-get-type root\n"
9322 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3294
9324 "This returns the type of the inspected operating system. Currently defined "
9329 #: ../fish/guestfish-actions.pod:2205 ../src/guestfs-actions.pod:3299
9334 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3301
9335 msgid "Any Linux-based operating system."
9339 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3305
9340 msgid "Any Microsoft Windows operating system."
9344 #: ../fish/guestfish-actions.pod:2213 ../src/guestfs-actions.pod:3307
9349 #: ../fish/guestfish-actions.pod:2215 ../src/guestfs-actions.pod:3309
9354 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3313
9355 msgid "The operating system type could not be determined."
9359 #: ../fish/guestfish-actions.pod:2228
9360 msgid "inspect-get-windows-current-control-set"
9364 #: ../fish/guestfish-actions.pod:2230
9367 " inspect-get-windows-current-control-set root\n"
9372 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3333
9374 "This returns the Windows CurrentControlSet of the inspected guest. The "
9375 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9379 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3336
9381 "This call assumes that the guest is Windows and that the Registry could be "
9382 "examined by inspection. If this is not the case then an error is returned."
9386 #: ../fish/guestfish-actions.pod:2241
9387 msgid "inspect-get-windows-systemroot"
9391 #: ../fish/guestfish-actions.pod:2243
9394 " inspect-get-windows-systemroot root\n"
9399 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3353
9401 "This returns the Windows systemroot of the inspected guest. The systemroot "
9402 "is a directory path such as C</WINDOWS>."
9406 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3356
9408 "This call assumes that the guest is Windows and that the systemroot could be "
9409 "determined by inspection. If this is not the case then an error is returned."
9413 #: ../fish/guestfish-actions.pod:2254
9414 msgid "inspect-is-live"
9418 #: ../fish/guestfish-actions.pod:2256
9421 " inspect-is-live root\n"
9426 #: ../fish/guestfish-actions.pod:2258
9428 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9429 "then this returns true if a live image was detected on the disk."
9433 #: ../fish/guestfish-actions.pod:2264
9434 msgid "inspect-is-multipart"
9438 #: ../fish/guestfish-actions.pod:2266
9441 " inspect-is-multipart root\n"
9446 #: ../fish/guestfish-actions.pod:2268
9448 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9449 "then this returns true if the disk is part of a set."
9453 #: ../fish/guestfish-actions.pod:2274
9454 msgid "inspect-is-netinst"
9458 #: ../fish/guestfish-actions.pod:2276
9461 " inspect-is-netinst root\n"
9466 #: ../fish/guestfish-actions.pod:2278
9468 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9469 "then this returns true if the disk is a network installer, ie. not a self-"
9470 "contained install CD but one which is likely to require network access to "
9471 "complete the install."
9475 #: ../fish/guestfish-actions.pod:2286
9476 msgid "inspect-list-applications"
9480 #: ../fish/guestfish-actions.pod:2288
9483 " inspect-list-applications root\n"
9488 #: ../fish/guestfish-actions.pod:2290 ../src/guestfs-actions.pod:3423
9489 msgid "Return the list of applications installed in the operating system."
9493 #: ../fish/guestfish-actions.pod:2292
9495 "I<Note:> This call works differently from other parts of the inspection "
9496 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9497 "then mount up the disks, before calling this. Listing applications is a "
9498 "significantly more difficult operation which requires access to the full "
9499 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9500 "are just returning data cached in the libguestfs handle, this call actually "
9501 "reads parts of the mounted filesystems during the call."
9505 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3435
9507 "This returns an empty list if the inspection code was not able to determine "
9508 "the list of applications."
9512 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3438
9513 msgid "The application structure contains the following fields:"
9517 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3442
9522 #: ../fish/guestfish-actions.pod:2311 ../src/guestfs-actions.pod:3444
9524 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9525 "guests, this is the package name."
9529 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3447
9530 msgid "C<app_display_name>"
9534 #: ../fish/guestfish-actions.pod:2316 ../src/guestfs-actions.pod:3449
9536 "The display name of the application, sometimes localized to the install "
9537 "language of the guest operating system."
9541 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3452
9543 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9544 "to display something can use C<app_name> instead."
9548 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3455
9549 msgid "C<app_epoch>"
9553 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3457
9555 "For package managers which use epochs, this contains the epoch of the "
9556 "package (an integer). If unavailable, this is returned as C<0>."
9560 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3460
9561 msgid "C<app_version>"
9565 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3462
9567 "The version string of the application or package. If unavailable this is "
9568 "returned as an empty string C<\"\">."
9572 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3465
9573 msgid "C<app_release>"
9577 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3467
9579 "The release string of the application or package, for package managers that "
9580 "use this. If unavailable this is returned as an empty string C<\"\">."
9584 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3471
9585 msgid "C<app_install_path>"
9589 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3473
9591 "The installation path of the application (on operating systems such as "
9592 "Windows which use installation paths). This path is in the format used by "
9593 "the guest operating system, it is not a libguestfs path."
9597 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3478
9598 msgid "If unavailable this is returned as an empty string C<\"\">."
9602 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3480
9603 msgid "C<app_trans_path>"
9607 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3482
9609 "The install path translated into a libguestfs path. If unavailable this is "
9610 "returned as an empty string C<\"\">."
9614 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3485
9615 msgid "C<app_publisher>"
9619 #: ../fish/guestfish-actions.pod:2354 ../src/guestfs-actions.pod:3487
9621 "The name of the publisher of the application, for package managers that use "
9622 "this. If unavailable this is returned as an empty string C<\"\">."
9626 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3491
9631 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3493
9633 "The URL (eg. upstream URL) of the application. If unavailable this is "
9634 "returned as an empty string C<\"\">."
9638 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3496
9639 msgid "C<app_source_package>"
9643 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3498
9645 "For packaging systems which support this, the name of the source package. "
9646 "If unavailable this is returned as an empty string C<\"\">."
9650 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3501
9651 msgid "C<app_summary>"
9655 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3503
9657 "A short (usually one line) description of the application or package. If "
9658 "unavailable this is returned as an empty string C<\"\">."
9662 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3506
9663 msgid "C<app_description>"
9667 #: ../fish/guestfish-actions.pod:2375 ../src/guestfs-actions.pod:3508
9669 "A longer description of the application or package. If unavailable this is "
9670 "returned as an empty string C<\"\">."
9674 #: ../fish/guestfish-actions.pod:2382
9679 #: ../fish/guestfish-actions.pod:2384
9687 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3526
9689 "This function uses other libguestfs functions and certain heuristics to "
9690 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9691 "for operating systems."
9695 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3530
9696 msgid "The list returned is empty if no operating systems were found."
9700 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3532
9702 "If one operating system was found, then this returns a list with a single "
9703 "element, which is the name of the root filesystem of this operating system. "
9704 "It is also possible for this function to return a list containing more than "
9705 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9706 "element being the root filesystem of one of the operating systems."
9710 #: ../fish/guestfish-actions.pod:2399
9712 "You can pass the root string(s) returned to other L</inspect-get-*> "
9713 "functions in order to query further information about each operating system, "
9714 "such as the name and version."
9718 #: ../fish/guestfish-actions.pod:2404
9720 "This function uses other libguestfs features such as L</mount-ro> and L</"
9721 "umount-all> in order to mount and unmount filesystems and look at the "
9722 "contents. This should be called with no disks currently mounted. The "
9723 "function may also use Augeas, so any existing Augeas handle will be closed."
9727 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3550
9729 "This function cannot decrypt encrypted disks. The caller must do that first "
9730 "(supplying the necessary keys) if the disk is encrypted."
9734 #: ../fish/guestfish-actions.pod:2416 ../fish/guestfish-actions.pod:2614
9735 #: ../fish/guestfish-actions.pod:2673
9736 msgid "See also L</list-filesystems>."
9740 #: ../fish/guestfish-actions.pod:2418
9745 #: ../fish/guestfish-actions.pod:2420
9748 " is-blockdev path\n"
9753 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3570
9755 "This returns C<true> if and only if there is a block device with the given "
9760 #: ../fish/guestfish-actions.pod:2425 ../fish/guestfish-actions.pod:2443
9761 #: ../fish/guestfish-actions.pod:2462 ../fish/guestfish-actions.pod:2471
9762 #: ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2515
9763 #: ../fish/guestfish-actions.pod:2524
9764 msgid "See also L</stat>."
9768 #: ../fish/guestfish-actions.pod:2427
9773 #: ../fish/guestfish-actions.pod:2429
9781 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3584
9783 "This returns true iff this handle is busy processing a command (in the "
9788 #: ../fish/guestfish-actions.pod:2436
9793 #: ../fish/guestfish-actions.pod:2438
9796 " is-chardev path\n"
9801 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3599
9803 "This returns C<true> if and only if there is a character device with the "
9804 "given C<path> name."
9808 #: ../fish/guestfish-actions.pod:2445
9813 #: ../fish/guestfish-actions.pod:2447
9821 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3613
9823 "This returns true iff this handle is being configured (in the C<CONFIG> "
9828 #: ../fish/guestfish-actions.pod:2454
9833 #: ../fish/guestfish-actions.pod:2456
9841 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3628
9843 "This returns C<true> if and only if there is a directory with the given "
9844 "C<path> name. Note that it returns false for other objects like files."
9848 #: ../fish/guestfish-actions.pod:2464
9853 #: ../fish/guestfish-actions.pod:2466
9861 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3644
9863 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9864 "given C<path> name."
9868 #: ../fish/guestfish-actions.pod:2473
9873 #: ../fish/guestfish-actions.pod:2475
9881 #: ../fish/guestfish-actions.pod:2477 ../src/guestfs-actions.pod:3659
9883 "This returns C<true> if and only if there is a regular file with the given "
9884 "C<path> name. Note that it returns false for other objects like directories."
9888 #: ../fish/guestfish-actions.pod:2483
9889 msgid "is-launching"
9893 #: ../fish/guestfish-actions.pod:2485
9901 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3674
9903 "This returns true iff this handle is launching the subprocess (in the "
9904 "C<LAUNCHING> state)."
9908 #: ../fish/guestfish-actions.pod:2492
9913 #: ../fish/guestfish-actions.pod:2494
9921 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3689
9923 "This command tests whether C<device> is a logical volume, and returns true "
9924 "iff this is the case."
9928 #: ../fish/guestfish-actions.pod:2499
9933 #: ../fish/guestfish-actions.pod:2501
9941 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3701
9943 "This returns true iff this handle is ready to accept commands (in the "
9948 #: ../fish/guestfish-actions.pod:2508
9953 #: ../fish/guestfish-actions.pod:2510
9961 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3716
9963 "This returns C<true> if and only if there is a Unix domain socket with the "
9964 "given C<path> name."
9968 #: ../fish/guestfish-actions.pod:2517
9973 #: ../fish/guestfish-actions.pod:2519
9976 " is-symlink path\n"
9981 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3731
9983 "This returns C<true> if and only if there is a symbolic link with the given "
9988 #: ../fish/guestfish-actions.pod:2526
9993 #: ../fish/guestfish-actions.pod:2528
10001 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3746
10003 "This returns true iff the file exists and the file is empty or it contains "
10008 #: ../fish/guestfish-actions.pod:2533
10009 msgid "is-zero-device"
10013 #: ../fish/guestfish-actions.pod:2535
10016 " is-zero-device device\n"
10021 #: ../fish/guestfish-actions.pod:2537 ../src/guestfs-actions.pod:3759
10022 msgid "This returns true iff the device exists and contains all zero bytes."
10026 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3761
10027 msgid "Note that for large devices this can take a long time to run."
10031 #: ../fish/guestfish-actions.pod:2541
10032 msgid "kill-subprocess"
10036 #: ../fish/guestfish-actions.pod:2543
10039 " kill-subprocess\n"
10044 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3772
10045 msgid "This kills the qemu subprocess. You should never need to call this."
10049 #: ../fish/guestfish-actions.pod:2547
10054 #: ../fish/guestfish-actions.pod:2549
10059 #: ../fish/guestfish-actions.pod:2551
10067 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3783
10069 "Internally libguestfs is implemented by running a virtual machine using "
10074 #: ../fish/guestfish-actions.pod:2556 ../src/guestfs-actions.pod:3786
10076 "You should call this after configuring the handle (eg. adding drives) but "
10077 "before performing any actions."
10081 #: ../fish/guestfish-actions.pod:2559
10086 #: ../fish/guestfish-actions.pod:2561
10089 " lchown owner group path\n"
10094 #: ../fish/guestfish-actions.pod:2563
10096 "Change the file owner to C<owner> and group to C<group>. This is like L</"
10097 "chown> but if C<path> is a symlink then the link itself is changed, not the "
10102 #: ../fish/guestfish-actions.pod:2571
10107 #: ../fish/guestfish-actions.pod:2573
10110 " lgetxattr path name\n"
10115 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3826
10117 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10118 "is a symlink, then this call returns an extended attribute from the symlink."
10122 #: ../fish/guestfish-actions.pod:2589
10123 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10127 #: ../fish/guestfish-actions.pod:2591
10132 #: ../fish/guestfish-actions.pod:2593
10135 " lgetxattrs path\n"
10140 #: ../fish/guestfish-actions.pod:2595
10142 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10143 "it returns the extended attributes of the link itself."
10147 #: ../fish/guestfish-actions.pod:2599
10152 #: ../fish/guestfish-actions.pod:2601
10160 #: ../fish/guestfish-actions.pod:2603 ../src/guestfs-actions.pod:3869
10162 "List all 9p filesystems attached to the guest. A list of mount tags is "
10167 #: ../fish/guestfish-actions.pod:2606
10168 msgid "list-devices"
10172 #: ../fish/guestfish-actions.pod:2608
10180 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3883
10181 msgid "List all the block devices."
10185 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3885
10186 msgid "The full block device names are returned, eg. C</dev/sda>."
10190 #: ../fish/guestfish-actions.pod:2616
10191 msgid "list-dm-devices"
10195 #: ../fish/guestfish-actions.pod:2618
10198 " list-dm-devices\n"
10203 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3900
10204 msgid "List all device mapper devices."
10208 #: ../fish/guestfish-actions.pod:2622
10210 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10211 "previous call to L</luks-open>."
10215 #: ../fish/guestfish-actions.pod:2625
10217 "Device mapper devices which correspond to logical volumes are I<not> "
10218 "returned in this list. Call L</lvs> if you want to list logical volumes."
10222 #: ../fish/guestfish-actions.pod:2629
10223 msgid "list-filesystems"
10227 #: ../fish/guestfish-actions.pod:2631
10230 " list-filesystems\n"
10235 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3920
10237 "This inspection command looks for filesystems on partitions, block devices "
10238 "and logical volumes, returning a list of devices containing filesystems and "
10243 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3924
10245 "The return value is a hash, where the keys are the devices containing "
10246 "filesystems, and the values are the filesystem types. For example:"
10250 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3928
10253 " \"/dev/sda1\" => \"ntfs\"\n"
10254 " \"/dev/sda2\" => \"ext2\"\n"
10255 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10256 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10261 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3933
10263 "The value can have the special value \"unknown\", meaning the content of the "
10264 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10268 #: ../fish/guestfish-actions.pod:2650
10270 "This command runs other libguestfs commands, which might include L</mount> "
10271 "and L</umount>, and therefore you should use this soon after launch and only "
10272 "when nothing is mounted."
10276 #: ../fish/guestfish-actions.pod:2654
10278 "Not all of the filesystems returned will be mountable. In particular, swap "
10279 "partitions are returned in the list. Also this command does not check that "
10280 "each filesystem found is valid and mountable, and some filesystems might be "
10281 "mountable but require special options. Filesystems may not all belong to a "
10282 "single logical operating system (use L</inspect-os> to look for OSes)."
10286 #: ../fish/guestfish-actions.pod:2662
10287 msgid "list-partitions"
10291 #: ../fish/guestfish-actions.pod:2664
10294 " list-partitions\n"
10299 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:3962
10300 msgid "List all the partitions detected on all block devices."
10304 #: ../fish/guestfish-actions.pod:2668 ../src/guestfs-actions.pod:3964
10305 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10309 #: ../fish/guestfish-actions.pod:2670
10311 "This does not return logical volumes. For that you will need to call L</"
10316 #: ../fish/guestfish-actions.pod:2675
10321 #: ../fish/guestfish-actions.pod:2677
10329 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3983
10331 "List the files in C<directory> (relative to the root directory, there is no "
10332 "cwd) in the format of 'ls -la'."
10336 #: ../fish/guestfish-actions.pod:2682 ../src/guestfs-actions.pod:3986
10338 "This command is mostly useful for interactive sessions. It is I<not> "
10339 "intended that you try to parse the output string."
10343 #: ../fish/guestfish-actions.pod:2685
10348 #: ../fish/guestfish-actions.pod:2687
10351 " ln target linkname\n"
10356 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4001
10357 msgid "This command creates a hard link using the C<ln> command."
10361 #: ../fish/guestfish-actions.pod:2691
10366 #: ../fish/guestfish-actions.pod:2693
10369 " ln-f target linkname\n"
10374 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:4014
10376 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10377 "option removes the link (C<linkname>) if it exists already."
10381 #: ../fish/guestfish-actions.pod:2698
10386 #: ../fish/guestfish-actions.pod:2700
10389 " ln-s target linkname\n"
10394 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4028
10395 msgid "This command creates a symbolic link using the C<ln -s> command."
10399 #: ../fish/guestfish-actions.pod:2704
10404 #: ../fish/guestfish-actions.pod:2706
10407 " ln-sf target linkname\n"
10412 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4041
10414 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10415 "option removes the link (C<linkname>) if it exists already."
10419 #: ../fish/guestfish-actions.pod:2711
10420 msgid "lremovexattr"
10424 #: ../fish/guestfish-actions.pod:2713
10427 " lremovexattr xattr path\n"
10432 #: ../fish/guestfish-actions.pod:2715
10434 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10435 "it removes an extended attribute of the link itself."
10439 #: ../fish/guestfish-actions.pod:2719
10444 #: ../fish/guestfish-actions.pod:2721
10452 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4069
10454 "List the files in C<directory> (relative to the root directory, there is no "
10455 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10459 #: ../fish/guestfish-actions.pod:2727
10461 "This command is mostly useful for interactive sessions. Programs should "
10462 "probably use L</readdir> instead."
10466 #: ../fish/guestfish-actions.pod:2730
10471 #: ../fish/guestfish-actions.pod:2732
10474 " lsetxattr xattr val vallen path\n"
10479 #: ../fish/guestfish-actions.pod:2734
10481 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10482 "sets an extended attribute of the link itself."
10486 #: ../fish/guestfish-actions.pod:2738
10491 #: ../fish/guestfish-actions.pod:2740
10499 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:4552
10500 #: ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:6890
10501 msgid "Returns file information for the given C<path>."
10505 #: ../fish/guestfish-actions.pod:2744
10507 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10508 "the link is stat-ed, not the file it refers to."
10512 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4111
10513 msgid "This is the same as the C<lstat(2)> system call."
10517 #: ../fish/guestfish-actions.pod:2750
10522 #: ../fish/guestfish-actions.pod:2752
10525 " lstatlist path 'names ...'\n"
10530 #: ../fish/guestfish-actions.pod:2754
10532 "This call allows you to perform the L</lstat> operation on multiple files, "
10533 "where all files are in the directory C<path>. C<names> is the list of files "
10534 "from this directory."
10538 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4130
10540 "On return you get a list of stat structs, with a one-to-one correspondence "
10541 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10542 "then the C<ino> field of that structure is set to C<-1>."
10546 #: ../fish/guestfish-actions.pod:2763
10548 "This call is intended for programs that want to efficiently list a directory "
10549 "contents without making many round-trips. See also L</lxattrlist> for a "
10550 "similarly efficient call for getting extended attributes. Very long "
10551 "directory listings might cause the protocol message size to be exceeded, "
10552 "causing this call to fail. The caller must split up such requests into "
10553 "smaller groups of names."
10557 #: ../fish/guestfish-actions.pod:2771
10558 msgid "luks-add-key"
10562 #: ../fish/guestfish-actions.pod:2773
10565 " luks-add-key device keyslot\n"
10570 #: ../fish/guestfish-actions.pod:2775 ../src/guestfs-actions.pod:4158
10572 "This command adds a new key on LUKS device C<device>. C<key> is any "
10573 "existing key, and is used to access the device. C<newkey> is the new key to "
10574 "add. C<keyslot> is the key slot that will be replaced."
10578 #: ../fish/guestfish-actions.pod:2780
10580 "Note that if C<keyslot> already contains a key, then this command will "
10581 "fail. You have to use L</luks-kill-slot> first to remove that key."
10585 #: ../fish/guestfish-actions.pod:2784 ../fish/guestfish-actions.pod:2806
10586 #: ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2833
10587 #: ../fish/guestfish-actions.pod:2859 ../fish/guestfish-actions.pod:2869
10589 "This command has one or more key or passphrase parameters. Guestfish will "
10590 "prompt for these separately."
10594 #: ../fish/guestfish-actions.pod:2787
10599 #: ../fish/guestfish-actions.pod:2789
10602 " luks-close device\n"
10607 #: ../fish/guestfish-actions.pod:2791
10609 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
10610 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
10611 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
10616 #: ../fish/guestfish-actions.pod:2797
10617 msgid "luks-format"
10621 #: ../fish/guestfish-actions.pod:2799
10624 " luks-format device keyslot\n"
10629 #: ../fish/guestfish-actions.pod:2801 ../src/guestfs-actions.pod:4199
10631 "This command erases existing data on C<device> and formats the device as a "
10632 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10633 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10637 #: ../fish/guestfish-actions.pod:2809 ../fish/guestfish-actions.pod:2822
10638 #: ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:3560
10639 #: ../fish/guestfish-actions.pod:4086 ../fish/guestfish-actions.pod:4423
10640 #: ../fish/guestfish-actions.pod:4446 ../fish/guestfish-actions.pod:4468
10641 #: ../fish/guestfish-actions.pod:5214 ../src/guestfs-actions.pod:4206
10642 #: ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4372
10643 #: ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:6253
10644 #: ../src/guestfs-actions.pod:6704 ../src/guestfs-actions.pod:6734
10645 #: ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:7966
10647 "B<This command is dangerous. Without careful use you can easily destroy all "
10652 #: ../fish/guestfish-actions.pod:2812
10653 msgid "luks-format-cipher"
10657 #: ../fish/guestfish-actions.pod:2814
10660 " luks-format-cipher device keyslot cipher\n"
10665 #: ../fish/guestfish-actions.pod:2816
10667 "This command is the same as L</luks-format> but it also allows you to set "
10668 "the C<cipher> used."
10672 #: ../fish/guestfish-actions.pod:2825
10673 msgid "luks-kill-slot"
10677 #: ../fish/guestfish-actions.pod:2827
10680 " luks-kill-slot device keyslot\n"
10685 #: ../fish/guestfish-actions.pod:2829 ../src/guestfs-actions.pod:4246
10687 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10688 "device C<device>. C<key> must be one of the I<other> keys."
10692 #: ../fish/guestfish-actions.pod:2836
10697 #: ../fish/guestfish-actions.pod:2838
10700 " luks-open device mapname\n"
10705 #: ../fish/guestfish-actions.pod:2840 ../src/guestfs-actions.pod:4266
10707 "This command opens a block device which has been encrypted according to the "
10708 "Linux Unified Key Setup (LUKS) standard."
10712 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4269
10713 msgid "C<device> is the encrypted block device or partition."
10717 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4271
10719 "The caller must supply one of the keys associated with the LUKS block "
10720 "device, in the C<key> parameter."
10724 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4274
10726 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10727 "writes to this block device are decrypted from and encrypted to the "
10728 "underlying C<device> respectively."
10732 #: ../fish/guestfish-actions.pod:2852
10734 "If this block device contains LVM volume groups, then calling L</vgscan> "
10735 "followed by L</vg-activate-all> will make them visible."
10739 #: ../fish/guestfish-actions.pod:2856
10740 msgid "Use L</list-dm-devices> to list all device mapper devices."
10744 #: ../fish/guestfish-actions.pod:2862
10745 msgid "luks-open-ro"
10749 #: ../fish/guestfish-actions.pod:2864
10752 " luks-open-ro device mapname\n"
10757 #: ../fish/guestfish-actions.pod:2866
10759 "This is the same as L</luks-open> except that a read-only mapping is created."
10763 #: ../fish/guestfish-actions.pod:2872
10768 #: ../fish/guestfish-actions.pod:2874
10771 " lvcreate logvol volgroup mbytes\n"
10776 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4320
10778 "This creates an LVM logical volume called C<logvol> on the volume group "
10779 "C<volgroup>, with C<size> megabytes."
10783 #: ../fish/guestfish-actions.pod:2879
10784 msgid "lvm-canonical-lv-name"
10788 #: ../fish/guestfish-actions.pod:2881
10791 " lvm-canonical-lv-name lvname\n"
10796 #: ../fish/guestfish-actions.pod:2883 ../src/guestfs-actions.pod:4333
10798 "This converts alternative naming schemes for LVs that you might find to the "
10799 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10804 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4337
10806 "This command returns an error if the C<lvname> parameter does not refer to a "
10811 #: ../fish/guestfish-actions.pod:2890
10812 msgid "See also L</is-lv>."
10816 #: ../fish/guestfish-actions.pod:2892
10817 msgid "lvm-clear-filter"
10821 #: ../fish/guestfish-actions.pod:2894
10824 " lvm-clear-filter\n"
10829 #: ../fish/guestfish-actions.pod:2896
10831 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
10836 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2930
10837 #: ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4397
10839 "This command also clears the LVM cache and performs a volume group scan."
10843 #: ../fish/guestfish-actions.pod:2902
10844 msgid "lvm-remove-all"
10848 #: ../fish/guestfish-actions.pod:2904
10851 " lvm-remove-all\n"
10856 #: ../fish/guestfish-actions.pod:2906 ../src/guestfs-actions.pod:4367
10858 "This command removes all LVM logical volumes, volume groups and physical "
10863 #: ../fish/guestfish-actions.pod:2912
10864 msgid "lvm-set-filter"
10868 #: ../fish/guestfish-actions.pod:2914
10871 " lvm-set-filter 'devices ...'\n"
10876 #: ../fish/guestfish-actions.pod:2916 ../src/guestfs-actions.pod:4383
10878 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10879 "block devices in the list C<devices>, and will ignore all other attached "
10884 #: ../fish/guestfish-actions.pod:2920 ../src/guestfs-actions.pod:4387
10886 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10887 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10888 "there are two types of duplication possible: either cloned PVs/VGs which "
10889 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10890 "same name. In normal operation you cannot create this situation, but you "
10891 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10892 "inside the LVM metadata."
10896 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4400
10897 msgid "You can filter whole block devices or individual partitions."
10901 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4402
10903 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10904 "filesystem), even if you are not filtering out that VG."
10908 #: ../fish/guestfish-actions.pod:2939
10913 #: ../fish/guestfish-actions.pod:2941
10916 " lvremove device\n"
10921 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4416
10923 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10924 "LV, such as C</dev/VG/LV>."
10928 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4419
10930 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10935 #: ../fish/guestfish-actions.pod:2949
10940 #: ../fish/guestfish-actions.pod:2951
10943 " lvrename logvol newlogvol\n"
10948 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4433
10949 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10953 #: ../fish/guestfish-actions.pod:2955
10958 #: ../fish/guestfish-actions.pod:2957
10961 " lvresize device mbytes\n"
10966 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4446
10968 "This resizes (expands or shrinks) an existing LVM logical volume to "
10969 "C<mbytes>. When reducing, data in the reduced part is lost."
10973 #: ../fish/guestfish-actions.pod:2963
10974 msgid "lvresize-free"
10978 #: ../fish/guestfish-actions.pod:2965
10981 " lvresize-free lv percent\n"
10986 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4461
10988 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10989 "remaining free space in the volume group. Commonly you would call this with "
10990 "pc = 100 which expands the logical volume as much as possible, using all "
10991 "remaining free space in the volume group."
10995 #: ../fish/guestfish-actions.pod:2973
11000 #: ../fish/guestfish-actions.pod:2975
11008 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4476
11010 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11015 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4479
11017 "This returns a list of the logical volume device names (eg. C</dev/"
11018 "VolGroup00/LogVol00>)."
11022 #: ../fish/guestfish-actions.pod:2983
11023 msgid "See also L</lvs-full>, L</list-filesystems>."
11027 #: ../fish/guestfish-actions.pod:2985
11032 #: ../fish/guestfish-actions.pod:2987
11040 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4495
11042 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11043 "(8)> command. The \"full\" version includes all fields."
11047 #: ../fish/guestfish-actions.pod:2992
11052 #: ../fish/guestfish-actions.pod:2994
11060 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4510
11061 msgid "This command returns the UUID of the LVM LV C<device>."
11065 #: ../fish/guestfish-actions.pod:2998
11070 #: ../fish/guestfish-actions.pod:3000
11073 " lxattrlist path 'names ...'\n"
11078 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4524
11080 "This call allows you to get the extended attributes of multiple files, where "
11081 "all files are in the directory C<path>. C<names> is the list of files from "
11086 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4528
11088 "On return you get a flat list of xattr structs which must be interpreted "
11089 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11090 "C<attrval> in this struct is zero-length to indicate there was an error "
11091 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11092 "number (the number of following attributes for this file, which could be C<"
11093 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11094 "for the first named file. This repeats for the second and subsequent files."
11098 #: ../fish/guestfish-actions.pod:3016
11100 "This call is intended for programs that want to efficiently list a directory "
11101 "contents without making many round-trips. See also L</lstatlist> for a "
11102 "similarly efficient call for getting standard stats. Very long directory "
11103 "listings might cause the protocol message size to be exceeded, causing this "
11104 "call to fail. The caller must split up such requests into smaller groups of "
11109 #: ../fish/guestfish-actions.pod:3024
11114 #: ../fish/guestfish-actions.pod:3026
11122 #: ../fish/guestfish-actions.pod:3028 ../src/guestfs-actions.pod:4558
11123 msgid "Create a directory named C<path>."
11127 #: ../fish/guestfish-actions.pod:3030
11132 #: ../fish/guestfish-actions.pod:3032
11135 " mkdir-mode path mode\n"
11140 #: ../fish/guestfish-actions.pod:3034 ../src/guestfs-actions.pod:4571
11142 "This command creates a directory, setting the initial permissions of the "
11143 "directory to C<mode>."
11147 #: ../fish/guestfish-actions.pod:3037 ../src/guestfs-actions.pod:4574
11149 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11150 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11155 #: ../fish/guestfish-actions.pod:3041
11156 msgid "See also L</mkdir>, L</umask>"
11160 #: ../fish/guestfish-actions.pod:3043
11165 #: ../fish/guestfish-actions.pod:3045
11173 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4590
11175 "Create a directory named C<path>, creating any parent directories as "
11176 "necessary. This is like the C<mkdir -p> shell command."
11180 #: ../fish/guestfish-actions.pod:3050
11185 #: ../fish/guestfish-actions.pod:3052
11188 " mkdtemp template\n"
11193 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4603
11195 "This command creates a temporary directory. The C<template> parameter "
11196 "should be a full pathname for the temporary directory name with the final "
11197 "six characters being \"XXXXXX\"."
11201 #: ../fish/guestfish-actions.pod:3059 ../src/guestfs-actions.pod:4608
11203 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11204 "being suitable for Windows filesystems."
11208 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4611
11209 msgid "The name of the temporary directory that was created is returned."
11213 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4614
11214 msgid "The temporary directory is created with mode 0700 and is owned by root."
11218 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4617
11220 "The caller is responsible for deleting the temporary directory and its "
11221 "contents after use."
11225 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4620
11226 msgid "See also: L<mkdtemp(3)>"
11230 #: ../fish/guestfish-actions.pod:3073
11235 #: ../fish/guestfish-actions.pod:3075
11238 " mke2fs-J fstype blocksize device journal\n"
11243 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4636
11245 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11246 "C<journal>. It is equivalent to the command:"
11250 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4640
11253 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11258 #: ../fish/guestfish-actions.pod:3083
11259 msgid "See also L</mke2journal>."
11263 #: ../fish/guestfish-actions.pod:3085
11268 #: ../fish/guestfish-actions.pod:3087
11271 " mke2fs-JL fstype blocksize device label\n"
11276 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4657
11278 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11279 "the journal labeled C<label>."
11283 #: ../fish/guestfish-actions.pod:3092
11284 msgid "See also L</mke2journal-L>."
11288 #: ../fish/guestfish-actions.pod:3094
11293 #: ../fish/guestfish-actions.pod:3096
11296 " mke2fs-JU fstype blocksize device uuid\n"
11301 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4675
11303 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11304 "the journal with UUID C<uuid>."
11308 #: ../fish/guestfish-actions.pod:3101
11309 msgid "See also L</mke2journal-U>."
11313 #: ../fish/guestfish-actions.pod:3103
11314 msgid "mke2journal"
11318 #: ../fish/guestfish-actions.pod:3105
11321 " mke2journal blocksize device\n"
11326 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4691
11328 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11333 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4694
11336 " mke2fs -O journal_dev -b blocksize device\n"
11341 #: ../fish/guestfish-actions.pod:3112
11342 msgid "mke2journal-L"
11346 #: ../fish/guestfish-actions.pod:3114
11349 " mke2journal-L blocksize label device\n"
11354 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4708
11355 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11359 #: ../fish/guestfish-actions.pod:3118
11360 msgid "mke2journal-U"
11364 #: ../fish/guestfish-actions.pod:3120
11367 " mke2journal-U blocksize uuid device\n"
11372 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4722
11373 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11377 #: ../fish/guestfish-actions.pod:3124
11382 #: ../fish/guestfish-actions.pod:3126
11385 " mkfifo mode path\n"
11390 #: ../fish/guestfish-actions.pod:3128
11392 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11393 "is just a convenient wrapper around L</mknod>."
11397 #: ../fish/guestfish-actions.pod:3134
11402 #: ../fish/guestfish-actions.pod:3136
11405 " mkfs fstype device\n"
11410 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4752
11412 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11413 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11417 #: ../fish/guestfish-actions.pod:3142
11422 #: ../fish/guestfish-actions.pod:3144
11425 " mkfs-b fstype blocksize device\n"
11430 #: ../fish/guestfish-actions.pod:3146
11432 "This call is similar to L</mkfs>, but it allows you to control the block "
11433 "size of the resulting filesystem. Supported block sizes depend on the "
11434 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11438 #: ../fish/guestfish-actions.pod:3151 ../fish/guestfish-actions.pod:3178
11439 #: ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4818
11441 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11446 #: ../fish/guestfish-actions.pod:3154
11448 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11453 #: ../fish/guestfish-actions.pod:3161
11458 #: ../fish/guestfish-actions.pod:3163
11461 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
11466 #: ../fish/guestfish-actions.pod:3165 ../src/guestfs-actions.pod:4805
11468 "This function creates a filesystem on C<device>. The filesystem type is "
11469 "C<fstype>, for example C<ext3>."
11473 #: ../fish/guestfish-actions.pod:3172 ../src/guestfs-actions.pod:4812
11474 msgid "C<blocksize>"
11478 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4814
11480 "The filesystem block size. Supported block sizes depend on the filesystem "
11481 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11486 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4821
11487 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11491 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4823
11492 msgid "C<features>"
11496 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4825
11497 msgid "This passes the I<-O> parameter to the external mkfs program."
11501 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4827
11503 "For certain filesystem types, this allows extra filesystem features to be "
11504 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11508 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4831
11510 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11515 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4834
11520 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4836
11522 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
11523 "sets the inode size (only for ext2/3/4 filesystems at present)."
11527 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4839
11528 msgid "C<sectorsize>"
11532 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4841
11534 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
11535 "sets sector size for ufs filesystem."
11539 #: ../fish/guestfish-actions.pod:3208
11540 msgid "mkmountpoint"
11544 #: ../fish/guestfish-actions.pod:3210
11547 " mkmountpoint exemptpath\n"
11552 #: ../fish/guestfish-actions.pod:3212
11554 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
11555 "to create extra mountpoints before mounting the first filesystem."
11559 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4884
11561 "These calls are I<only> necessary in some very limited circumstances, mainly "
11562 "the case where you want to mount a mix of unrelated and/or read-only "
11563 "filesystems together."
11567 #: ../fish/guestfish-actions.pod:3220 ../src/guestfs-actions.pod:4888
11569 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11570 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11571 "inside that. You can unpack this as follows in guestfish:"
11575 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4893
11578 " add-ro Fedora-11-i686-Live.iso\n"
11580 " mkmountpoint /cd\n"
11581 " mkmountpoint /sqsh\n"
11582 " mkmountpoint /ext3fs\n"
11583 " mount /dev/sda /cd\n"
11584 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11585 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11590 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4902
11591 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11595 #: ../fish/guestfish-actions.pod:3236
11597 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
11598 "unexpected errors if you try to mix these calls. It is safest to manually "
11599 "unmount filesystems and remove mountpoints after use."
11603 #: ../fish/guestfish-actions.pod:3240
11605 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
11606 "for this to work for manual mountpoints, you must ensure that the innermost "
11607 "mountpoints have the longest pathnames, as in the example code above."
11611 #: ../fish/guestfish-actions.pod:3245 ../src/guestfs-actions.pod:4913
11613 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11617 #: ../fish/guestfish-actions.pod:3247
11619 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
11620 "L</umount-all> to be called when the handle is closed which can also trigger "
11625 #: ../fish/guestfish-actions.pod:3251
11630 #: ../fish/guestfish-actions.pod:3253
11633 " mknod mode devmajor devminor path\n"
11638 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:4932
11640 "This call creates block or character special devices, or named pipes (FIFOs)."
11644 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4935
11646 "The C<mode> parameter should be the mode, using the standard constants. "
11647 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11648 "used when creating block and character special devices."
11652 #: ../fish/guestfish-actions.pod:3263
11654 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11655 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11656 "regular file). These constants are available in the standard Linux header "
11657 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
11658 "wrappers around this command which bitwise OR in the appropriate constant "
11663 #: ../fish/guestfish-actions.pod:3273
11668 #: ../fish/guestfish-actions.pod:3275
11671 " mknod-b mode devmajor devminor path\n"
11676 #: ../fish/guestfish-actions.pod:3277
11678 "This call creates a block device node called C<path> with mode C<mode> and "
11679 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11680 "wrapper around L</mknod>."
11684 #: ../fish/guestfish-actions.pod:3283
11689 #: ../fish/guestfish-actions.pod:3285
11692 " mknod-c mode devmajor devminor path\n"
11697 #: ../fish/guestfish-actions.pod:3287
11699 "This call creates a char device node called C<path> with mode C<mode> and "
11700 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11701 "wrapper around L</mknod>."
11705 #: ../fish/guestfish-actions.pod:3293
11710 #: ../fish/guestfish-actions.pod:3295
11718 #: ../fish/guestfish-actions.pod:3297 ../src/guestfs-actions.pod:4998
11719 msgid "Create a swap partition on C<device>."
11723 #: ../fish/guestfish-actions.pod:3299
11728 #: ../fish/guestfish-actions.pod:3301
11731 " mkswap-L label device\n"
11736 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5011
11737 msgid "Create a swap partition on C<device> with label C<label>."
11741 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5013
11743 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11744 "sda>), just to a partition. This appears to be a limitation of the kernel "
11749 #: ../fish/guestfish-actions.pod:3309
11754 #: ../fish/guestfish-actions.pod:3311
11757 " mkswap-U uuid device\n"
11762 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5028
11763 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11767 #: ../fish/guestfish-actions.pod:3315
11768 msgid "mkswap-file"
11772 #: ../fish/guestfish-actions.pod:3317
11775 " mkswap-file path\n"
11780 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5040
11781 msgid "Create a swap file."
11785 #: ../fish/guestfish-actions.pod:3321
11787 "This command just writes a swap file signature to an existing file. To "
11788 "create the file itself, use something like L</fallocate>."
11792 #: ../fish/guestfish-actions.pod:3324
11797 #: ../fish/guestfish-actions.pod:3326
11800 " modprobe modulename\n"
11805 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5055
11806 msgid "This loads a kernel module in the appliance."
11810 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5057
11812 "The kernel module must have been whitelisted when libguestfs was built (see "
11813 "C<appliance/kmod.whitelist.in> in the source)."
11817 #: ../fish/guestfish-actions.pod:3333
11822 #: ../fish/guestfish-actions.pod:3335
11825 " mount device mountpoint\n"
11830 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5071
11832 "Mount a guest disk at a position in the filesystem. Block devices are named "
11833 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11834 "those block devices contain partitions, they will have the usual names (eg. "
11835 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11839 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5077
11841 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11842 "mounted on C</> before others can be mounted. Other filesystems can only be "
11843 "mounted on directories which already exist."
11847 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5082
11849 "The mounted filesystem is writable, if we have sufficient permissions on the "
11850 "underlying device."
11854 #: ../fish/guestfish-actions.pod:3351
11856 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
11857 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
11858 "problems for users. If your program might need to work with older versions "
11859 "of libguestfs, use L</mount-options> instead (using an empty string for the "
11860 "first parameter if you don't want any options)."
11864 #: ../fish/guestfish-actions.pod:3358
11869 #: ../fish/guestfish-actions.pod:3360
11872 " mount-9p mounttag mountpoint [options:..]\n"
11877 #: ../fish/guestfish-actions.pod:3362 ../src/guestfs-actions.pod:5111
11879 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
11884 #: ../fish/guestfish-actions.pod:3365 ../src/guestfs-actions.pod:5114
11886 "If required, C<trans=virtio> will be automatically added to the options. "
11887 "Any other options required can be passed in the optional C<options> "
11892 #: ../fish/guestfish-actions.pod:3371
11897 #: ../fish/guestfish-actions.pod:3373
11900 " mount-loop file mountpoint\n"
11905 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5153
11907 "This command lets you mount C<file> (a filesystem image in a file) on a "
11908 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11913 #: ../fish/guestfish-actions.pod:3379
11914 msgid "mount-options"
11918 #: ../fish/guestfish-actions.pod:3381
11921 " mount-options options device mountpoint\n"
11926 #: ../fish/guestfish-actions.pod:3383
11928 "This is the same as the L</mount> command, but it allows you to set the "
11929 "mount options as for the L<mount(8)> I<-o> flag."
11933 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5173
11935 "If the C<options> parameter is an empty string, then no options are passed "
11936 "(all options default to whatever the filesystem uses)."
11940 #: ../fish/guestfish-actions.pod:3391
11945 #: ../fish/guestfish-actions.pod:3393
11948 " mount-ro device mountpoint\n"
11953 #: ../fish/guestfish-actions.pod:3395
11955 "This is the same as the L</mount> command, but it mounts the filesystem with "
11956 "the read-only (I<-o ro>) flag."
11960 #: ../fish/guestfish-actions.pod:3398
11965 #: ../fish/guestfish-actions.pod:3400
11968 " mount-vfs options vfstype device mountpoint\n"
11973 #: ../fish/guestfish-actions.pod:3402
11975 "This is the same as the L</mount> command, but it allows you to set both the "
11976 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11980 #: ../fish/guestfish-actions.pod:3406
11981 msgid "mountpoints"
11985 #: ../fish/guestfish-actions.pod:3408
11993 #: ../fish/guestfish-actions.pod:3410
11995 "This call is similar to L</mounts>. That call returns a list of devices. "
11996 "This one returns a hash table (map) of device name to directory where the "
11997 "device is mounted."
12001 #: ../fish/guestfish-actions.pod:3414
12006 #: ../fish/guestfish-actions.pod:3416
12014 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5234
12016 "This returns the list of currently mounted filesystems. It returns the list "
12017 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12021 #: ../fish/guestfish-actions.pod:3421 ../src/guestfs-actions.pod:5237
12022 msgid "Some internal mounts are not shown."
12026 #: ../fish/guestfish-actions.pod:3423
12027 msgid "See also: L</mountpoints>"
12031 #: ../fish/guestfish-actions.pod:3425
12036 #: ../fish/guestfish-actions.pod:3427
12044 #: ../fish/guestfish-actions.pod:3429 ../src/guestfs-actions.pod:5254
12046 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12047 "destination filename or destination directory."
12051 #: ../fish/guestfish-actions.pod:3432
12052 msgid "ntfs-3g-probe"
12056 #: ../fish/guestfish-actions.pod:3434
12059 " ntfs-3g-probe true|false device\n"
12064 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5268
12066 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12067 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12068 "write, and some cannot be mounted at all)."
12072 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5272
12074 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12075 "can be mounted read-write. Set it to false if you want to test if the "
12076 "volume can be mounted read-only."
12080 #: ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5276
12082 "The return value is an integer which C<0> if the operation would succeed, or "
12083 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12087 #: ../fish/guestfish-actions.pod:3448
12092 #: ../fish/guestfish-actions.pod:3450
12095 " ntfsresize device\n"
12100 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:3476
12101 #: ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5329
12103 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12104 "size of the underlying device."
12108 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5300
12110 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12111 "consistency check (for safety). You have to boot into Windows to perform "
12112 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12113 "resize filesystems which have been marked in this way. So in effect it is "
12114 "not possible to call ntfsresize multiple times on a single filesystem "
12115 "without booting into Windows between each resize."
12119 #: ../fish/guestfish-actions.pod:3463 ../fish/guestfish-actions.pod:3502
12120 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5355
12121 msgid "See also L<ntfsresize(8)>."
12125 #: ../fish/guestfish-actions.pod:3465 ../fish/guestfish-actions.pod:3513
12127 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12132 #: ../fish/guestfish-actions.pod:3472
12133 msgid "ntfsresize-opts"
12137 #: ../fish/guestfish-actions.pod:3474
12140 " ntfsresize-opts device [size:..] [force:..]\n"
12145 #: ../fish/guestfish-actions.pod:3485 ../src/guestfs-actions.pod:5338
12147 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12148 "resized to fit the container (eg. partition)."
12152 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5341
12157 #: ../fish/guestfish-actions.pod:3490 ../src/guestfs-actions.pod:5343
12159 "If this option is true, then force the resize of the filesystem even if the "
12160 "filesystem is marked as requiring a consistency check."
12164 #: ../fish/guestfish-actions.pod:3493
12166 "After the resize operation, the filesystem is always marked as requiring a "
12167 "consistency check (for safety). You have to boot into Windows to perform "
12168 "this check and clear this condition. If you I<don't> set the C<force> "
12169 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12170 "a single filesystem without booting into Windows between each resize."
12174 #: ../fish/guestfish-actions.pod:3506
12175 msgid "ntfsresize-size"
12179 #: ../fish/guestfish-actions.pod:3508
12182 " ntfsresize-size device size\n"
12187 #: ../fish/guestfish-actions.pod:3510
12189 "This command is the same as L</ntfsresize> except that it allows you to "
12190 "specify the new size (in bytes) explicitly."
12194 #: ../fish/guestfish-actions.pod:3520
12199 #: ../fish/guestfish-actions.pod:3522
12202 " part-add device prlogex startsect endsect\n"
12207 #: ../fish/guestfish-actions.pod:3524
12209 "This command adds a partition to C<device>. If there is no partition table "
12210 "on the device, call L</part-init> first."
12214 #: ../fish/guestfish-actions.pod:3527 ../src/guestfs-actions.pod:5416
12216 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12217 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12218 "C<logical>) and C<e> (or C<extended>) partition types."
12222 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5421
12224 "C<startsect> and C<endsect> are the start and end of the partition in "
12225 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12226 "from the end of the disk (C<-1> is the last sector)."
12230 #: ../fish/guestfish-actions.pod:3536
12232 "Creating a partition which covers the whole disk is not so easy. Use L</"
12233 "part-disk> to do that."
12237 #: ../fish/guestfish-actions.pod:3539
12242 #: ../fish/guestfish-actions.pod:3541
12245 " part-del device partnum\n"
12250 #: ../fish/guestfish-actions.pod:3543 ../src/guestfs-actions.pod:5439
12251 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12255 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5441
12257 "Note that in the case of MBR partitioning, deleting an extended partition "
12258 "also deletes any logical partitions it contains."
12262 #: ../fish/guestfish-actions.pod:3549
12267 #: ../fish/guestfish-actions.pod:3551
12270 " part-disk device parttype\n"
12275 #: ../fish/guestfish-actions.pod:3553
12277 "This command is simply a combination of L</part-init> followed by L</part-"
12278 "add> to create a single primary partition covering the whole disk."
12282 #: ../fish/guestfish-actions.pod:3557
12284 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12285 "possible values are described in L</part-init>."
12289 #: ../fish/guestfish-actions.pod:3563
12290 msgid "part-get-bootable"
12294 #: ../fish/guestfish-actions.pod:3565
12297 " part-get-bootable device partnum\n"
12302 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5477
12304 "This command returns true if the partition C<partnum> on C<device> has the "
12305 "bootable flag set."
12309 #: ../fish/guestfish-actions.pod:3570
12310 msgid "See also L</part-set-bootable>."
12314 #: ../fish/guestfish-actions.pod:3572
12315 msgid "part-get-mbr-id"
12319 #: ../fish/guestfish-actions.pod:3574
12322 " part-get-mbr-id device partnum\n"
12327 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5493
12329 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12330 "partition C<partnum>."
12334 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3723
12336 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12337 "undefined results for other partition table types (see L</part-get-"
12342 #: ../fish/guestfish-actions.pod:3583
12343 msgid "part-get-parttype"
12347 #: ../fish/guestfish-actions.pod:3585
12350 " part-get-parttype device\n"
12355 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5510
12357 "This command examines the partition table on C<device> and returns the "
12358 "partition table type (format) being used."
12362 #: ../fish/guestfish-actions.pod:3590
12364 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12365 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12366 "possible, although unusual. See L</part-init> for a full list."
12370 #: ../fish/guestfish-actions.pod:3595
12375 #: ../fish/guestfish-actions.pod:3597
12378 " part-init device parttype\n"
12383 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5530
12385 "This creates an empty partition table on C<device> of one of the partition "
12386 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12387 "(for large disks)."
12391 #: ../fish/guestfish-actions.pod:3603
12393 "Initially there are no partitions. Following this, you should call L</part-"
12394 "add> for each partition required."
12398 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5537
12399 msgid "Possible values for C<parttype> are:"
12403 #: ../fish/guestfish-actions.pod:3610 ../src/guestfs-actions.pod:5541
12408 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5543
12413 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5545
12414 msgid "Intel EFI / GPT partition table."
12418 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5547
12420 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12421 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12422 "the C<mbr> format."
12426 #: ../fish/guestfish-actions.pod:3620 ../src/guestfs-actions.pod:5551
12431 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5553
12436 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5555
12438 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12439 "Windows. This partition type will B<only> work for device sizes up to 2 "
12440 "TB. For large disks we recommend using C<gpt>."
12444 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5562
12446 "Other partition table types that may work but are not supported include:"
12450 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5567
12455 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5569
12456 msgid "AIX disk labels."
12460 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5571
12465 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5573
12470 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5575
12471 msgid "Amiga \"Rigid Disk Block\" format."
12475 #: ../fish/guestfish-actions.pod:3646 ../src/guestfs-actions.pod:5577
12480 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5579
12481 msgid "BSD disk labels."
12485 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5581
12490 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5583
12491 msgid "DASD, used on IBM mainframes."
12495 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5585
12500 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5587
12501 msgid "MIPS/SGI volumes."
12505 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5589
12510 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5591
12511 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12515 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5593
12520 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5595
12521 msgid "NEC PC-98 format, common in Japan apparently."
12525 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5597
12530 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5599
12531 msgid "Sun disk labels."
12535 #: ../fish/guestfish-actions.pod:3672
12540 #: ../fish/guestfish-actions.pod:3674
12543 " part-list device\n"
12548 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5613
12550 "This command parses the partition table on C<device> and returns the list of "
12551 "partitions found."
12555 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5616
12556 msgid "The fields in the returned structure are:"
12560 #: ../fish/guestfish-actions.pod:3683 ../src/guestfs-actions.pod:5620
12561 msgid "B<part_num>"
12565 #: ../fish/guestfish-actions.pod:3685 ../src/guestfs-actions.pod:5622
12566 msgid "Partition number, counting from 1."
12570 #: ../fish/guestfish-actions.pod:3687 ../src/guestfs-actions.pod:5624
12571 msgid "B<part_start>"
12575 #: ../fish/guestfish-actions.pod:3689
12577 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12578 "the device's sector size, see L</blockdev-getss>."
12582 #: ../fish/guestfish-actions.pod:3692 ../src/guestfs-actions.pod:5629
12583 msgid "B<part_end>"
12587 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5631
12588 msgid "End of the partition in bytes."
12592 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5633
12593 msgid "B<part_size>"
12597 #: ../fish/guestfish-actions.pod:3698 ../src/guestfs-actions.pod:5635
12598 msgid "Size of the partition in bytes."
12602 #: ../fish/guestfish-actions.pod:3702
12603 msgid "part-set-bootable"
12607 #: ../fish/guestfish-actions.pod:3704
12610 " part-set-bootable device partnum true|false\n"
12615 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5653
12617 "This sets the bootable flag on partition numbered C<partnum> on device "
12618 "C<device>. Note that partitions are numbered from 1."
12622 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5656
12624 "The bootable flag is used by some operating systems (notably Windows) to "
12625 "determine which partition to boot from. It is by no means universally "
12630 #: ../fish/guestfish-actions.pod:3713
12631 msgid "part-set-mbr-id"
12635 #: ../fish/guestfish-actions.pod:3715
12638 " part-set-mbr-id device partnum idbyte\n"
12643 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5672
12645 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12646 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12647 "documentation are in fact hexadecimal numbers, but usually documented "
12648 "without any leading \"0x\" which might be confusing."
12652 #: ../fish/guestfish-actions.pod:3727
12653 msgid "part-set-name"
12657 #: ../fish/guestfish-actions.pod:3729
12660 " part-set-name device partnum name\n"
12665 #: ../fish/guestfish-actions.pod:3731 ../src/guestfs-actions.pod:5694
12667 "This sets the partition name on partition numbered C<partnum> on device "
12668 "C<device>. Note that partitions are numbered from 1."
12672 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5697
12674 "The partition name can only be set on certain types of partition table. "
12675 "This works on C<gpt> but not on C<mbr> partitions."
12679 #: ../fish/guestfish-actions.pod:3737
12680 msgid "part-to-dev"
12684 #: ../fish/guestfish-actions.pod:3739
12687 " part-to-dev partition\n"
12692 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5710
12694 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12695 "partition number, returning the device name (eg. \"/dev/sdb\")."
12699 #: ../fish/guestfish-actions.pod:3745
12701 "The named partition must exist, for example as a string returned from L</"
12702 "list-partitions>."
12706 #: ../fish/guestfish-actions.pod:3748
12707 msgid "ping-daemon"
12711 #: ../fish/guestfish-actions.pod:3750
12719 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5727
12721 "This is a test probe into the guestfs daemon running inside the qemu "
12722 "subprocess. Calling this function checks that the daemon responds to the "
12723 "ping message, without affecting the daemon or attached block device(s) in "
12728 #: ../fish/guestfish-actions.pod:3757
12733 #: ../fish/guestfish-actions.pod:3759
12736 " pread path count offset\n"
12741 #: ../fish/guestfish-actions.pod:3761 ../src/guestfs-actions.pod:5745
12743 "This command lets you read part of a file. It reads C<count> bytes of the "
12744 "file, starting at C<offset>, from file C<path>."
12748 #: ../fish/guestfish-actions.pod:3764 ../fish/guestfish-actions.pod:3779
12749 #: ../src/guestfs-actions.pod:5748 ../src/guestfs-actions.pod:5774
12751 "This may read fewer bytes than requested. For further details see the "
12752 "L<pread(2)> system call."
12756 #: ../fish/guestfish-actions.pod:3767
12757 msgid "See also L</pwrite>, L</pread-device>."
12761 #: ../fish/guestfish-actions.pod:3772
12762 msgid "pread-device"
12766 #: ../fish/guestfish-actions.pod:3774
12769 " pread-device device count offset\n"
12774 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5771
12776 "This command lets you read part of a file. It reads C<count> bytes of "
12777 "C<device>, starting at C<offset>."
12781 #: ../fish/guestfish-actions.pod:3782
12782 msgid "See also L</pread>."
12786 #: ../fish/guestfish-actions.pod:3787
12791 #: ../fish/guestfish-actions.pod:3789
12794 " pvcreate device\n"
12799 #: ../fish/guestfish-actions.pod:3791 ../src/guestfs-actions.pod:5794
12801 "This creates an LVM physical volume on the named C<device>, where C<device> "
12802 "should usually be a partition name such as C</dev/sda1>."
12806 #: ../fish/guestfish-actions.pod:3795
12811 #: ../fish/guestfish-actions.pod:3797
12814 " pvremove device\n"
12819 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5808
12821 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12826 #: ../fish/guestfish-actions.pod:3802 ../src/guestfs-actions.pod:5811
12828 "The implementation uses the C<pvremove> command which refuses to wipe "
12829 "physical volumes that contain any volume groups, so you have to remove those "
12834 #: ../fish/guestfish-actions.pod:3806
12839 #: ../fish/guestfish-actions.pod:3808
12842 " pvresize device\n"
12847 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5825
12849 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12850 "the new size of the underlying device."
12854 #: ../fish/guestfish-actions.pod:3813
12855 msgid "pvresize-size"
12859 #: ../fish/guestfish-actions.pod:3815
12862 " pvresize-size device size\n"
12867 #: ../fish/guestfish-actions.pod:3817
12869 "This command is the same as L</pvresize> except that it allows you to "
12870 "specify the new size (in bytes) explicitly."
12874 #: ../fish/guestfish-actions.pod:3820
12879 #: ../fish/guestfish-actions.pod:3822
12887 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5851
12889 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12894 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5854
12896 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12901 #: ../fish/guestfish-actions.pod:3830
12902 msgid "See also L</pvs-full>."
12906 #: ../fish/guestfish-actions.pod:3832
12911 #: ../fish/guestfish-actions.pod:3834
12919 #: ../fish/guestfish-actions.pod:3836 ../src/guestfs-actions.pod:5870
12921 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12922 "(8)> command. The \"full\" version includes all fields."
12926 #: ../fish/guestfish-actions.pod:3839
12931 #: ../fish/guestfish-actions.pod:3841
12939 #: ../fish/guestfish-actions.pod:3843 ../src/guestfs-actions.pod:5885
12940 msgid "This command returns the UUID of the LVM PV C<device>."
12944 #: ../fish/guestfish-actions.pod:3845
12949 #: ../fish/guestfish-actions.pod:3847
12952 " pwrite path content offset\n"
12957 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5901
12959 "This command writes to part of a file. It writes the data buffer C<content> "
12960 "to the file C<path> starting at offset C<offset>."
12964 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:5904
12966 "This command implements the L<pwrite(2)> system call, and like that system "
12967 "call it may not write the full data requested. The return value is the "
12968 "number of bytes that were actually written to the file. This could even be "
12969 "0, although short writes are unlikely for regular files in ordinary "
12974 #: ../fish/guestfish-actions.pod:3858
12975 msgid "See also L</pread>, L</pwrite-device>."
12979 #: ../fish/guestfish-actions.pod:3863
12980 msgid "pwrite-device"
12984 #: ../fish/guestfish-actions.pod:3865
12987 " pwrite-device device content offset\n"
12992 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5928
12994 "This command writes to part of a device. It writes the data buffer "
12995 "C<content> to C<device> starting at offset C<offset>."
12999 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5931
13001 "This command implements the L<pwrite(2)> system call, and like that system "
13002 "call it may not write the full data requested (although short writes to disk "
13003 "devices and partitions are probably impossible with standard Linux kernels)."
13007 #: ../fish/guestfish-actions.pod:3875
13008 msgid "See also L</pwrite>."
13012 #: ../fish/guestfish-actions.pod:3880
13017 #: ../fish/guestfish-actions.pod:3882
13020 " read-file path\n"
13025 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5952
13026 msgid "This calls returns the contents of the file C<path> as a buffer."
13030 #: ../fish/guestfish-actions.pod:3887
13032 "Unlike L</cat>, this function can correctly handle files that contain "
13033 "embedded ASCII NUL characters. However unlike L</download>, this function "
13034 "is limited in the total size of file that can be handled."
13038 #: ../fish/guestfish-actions.pod:3895
13043 #: ../fish/guestfish-actions.pod:3897
13046 " read-lines path\n"
13051 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5977
13053 "The file contents are returned as a list of lines. Trailing C<LF> and "
13054 "C<CRLF> character sequences are I<not> returned."
13058 #: ../fish/guestfish-actions.pod:3904
13060 "Note that this function cannot correctly handle binary files (specifically, "
13061 "files containing C<\\0> character which is treated as end of line). For "
13062 "those you need to use the L</read-file> function which has a more complex "
13067 #: ../fish/guestfish-actions.pod:3909
13072 #: ../fish/guestfish-actions.pod:3911
13080 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5997
13081 msgid "This returns the list of directory entries in directory C<dir>."
13085 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5999
13087 "All entries in the directory are returned, including C<.> and C<..>. The "
13088 "entries are I<not> sorted, but returned in the same order as the underlying "
13093 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6003
13095 "Also this call returns basic file type information about each file. The "
13096 "C<ftyp> field will contain one of the following characters:"
13100 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:6008
13105 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6010
13106 msgid "Block special"
13110 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6012
13115 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6014
13116 msgid "Char special"
13120 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6016
13125 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6018
13130 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6020
13135 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6022
13136 msgid "FIFO (named pipe)"
13140 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6024
13145 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6026
13146 msgid "Symbolic link"
13150 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6028
13155 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6030
13156 msgid "Regular file"
13160 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6032
13165 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6034
13170 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6036
13175 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6038
13176 msgid "Unknown file type"
13180 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6040
13185 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6042
13187 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13191 #: ../fish/guestfish-actions.pod:3963
13193 "This function is primarily intended for use by programs. To get a simple "
13194 "list of names, use L</ls>. To get a printable directory for human "
13195 "consumption, use L</ll>."
13199 #: ../fish/guestfish-actions.pod:3967
13204 #: ../fish/guestfish-actions.pod:3969
13212 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6063
13213 msgid "This command reads the target of a symbolic link."
13217 #: ../fish/guestfish-actions.pod:3973
13218 msgid "readlinklist"
13222 #: ../fish/guestfish-actions.pod:3975
13225 " readlinklist path 'names ...'\n"
13230 #: ../fish/guestfish-actions.pod:3977 ../src/guestfs-actions.pod:6077
13232 "This call allows you to do a C<readlink> operation on multiple files, where "
13233 "all files are in the directory C<path>. C<names> is the list of files from "
13238 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6081
13240 "On return you get a list of strings, with a one-to-one correspondence to the "
13241 "C<names> list. Each string is the value of the symbolic link."
13245 #: ../fish/guestfish-actions.pod:3985 ../src/guestfs-actions.pod:6085
13247 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13248 "result string is the empty string C<\"\">. However the whole operation is "
13249 "completed even if there were C<readlink(2)> errors, and so you can call this "
13250 "function with names where you don't know if they are symbolic links already "
13251 "(albeit slightly less efficient)."
13255 #: ../fish/guestfish-actions.pod:3992 ../src/guestfs-actions.pod:6092
13257 "This call is intended for programs that want to efficiently list a directory "
13258 "contents without making many round-trips. Very long directory listings "
13259 "might cause the protocol message size to be exceeded, causing this call to "
13260 "fail. The caller must split up such requests into smaller groups of names."
13264 #: ../fish/guestfish-actions.pod:3999
13269 #: ../fish/guestfish-actions.pod:4001
13277 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6111
13279 "Return the canonicalized absolute pathname of C<path>. The returned path "
13280 "has no C<.>, C<..> or symbolic link path elements."
13284 #: ../fish/guestfish-actions.pod:4006
13285 msgid "removexattr"
13289 #: ../fish/guestfish-actions.pod:4008
13292 " removexattr xattr path\n"
13297 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6126
13299 "This call removes the extended attribute named C<xattr> of the file C<path>."
13303 #: ../fish/guestfish-actions.pod:4013
13304 msgid "See also: L</lremovexattr>, L<attr(5)>."
13308 #: ../fish/guestfish-actions.pod:4015
13313 #: ../fish/guestfish-actions.pod:4017
13316 " resize2fs device\n"
13321 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6141
13323 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13324 "underlying device."
13328 #: ../fish/guestfish-actions.pod:4022
13330 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13331 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13332 "gives an error about this and sometimes not. In any case, it is always safe "
13333 "to call L</e2fsck-f> before calling this function."
13337 #: ../fish/guestfish-actions.pod:4028
13338 msgid "resize2fs-M"
13342 #: ../fish/guestfish-actions.pod:4030
13345 " resize2fs-M device\n"
13350 #: ../fish/guestfish-actions.pod:4032
13352 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13353 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13358 #: ../fish/guestfish-actions.pod:4036
13360 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13361 "and read the C<Block size> and C<Block count> values. These two numbers, "
13362 "multiplied together, give the resulting size of the minimal filesystem in "
13367 #: ../fish/guestfish-actions.pod:4041
13368 msgid "resize2fs-size"
13372 #: ../fish/guestfish-actions.pod:4043
13375 " resize2fs-size device size\n"
13380 #: ../fish/guestfish-actions.pod:4045
13382 "This command is the same as L</resize2fs> except that it allows you to "
13383 "specify the new size (in bytes) explicitly."
13387 #: ../fish/guestfish-actions.pod:4048
13392 #: ../fish/guestfish-actions.pod:4050
13400 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6193
13401 msgid "Remove the single file C<path>."
13405 #: ../fish/guestfish-actions.pod:4054
13410 #: ../fish/guestfish-actions.pod:4056
13418 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6205
13420 "Remove the file or directory C<path>, recursively removing the contents if "
13421 "its a directory. This is like the C<rm -rf> shell command."
13425 #: ../fish/guestfish-actions.pod:4062
13430 #: ../fish/guestfish-actions.pod:4064
13438 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6219
13439 msgid "Remove the single directory C<path>."
13443 #: ../fish/guestfish-actions.pod:4068
13444 msgid "rmmountpoint"
13448 #: ../fish/guestfish-actions.pod:4070
13451 " rmmountpoint exemptpath\n"
13456 #: ../fish/guestfish-actions.pod:4072
13458 "This calls removes a mountpoint that was previously created with L</"
13459 "mkmountpoint>. See L</mkmountpoint> for full details."
13463 #: ../fish/guestfish-actions.pod:4076
13464 msgid "scrub-device"
13468 #: ../fish/guestfish-actions.pod:4078
13471 " scrub-device device\n"
13476 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6245
13478 "This command writes patterns over C<device> to make data retrieval more "
13483 #: ../fish/guestfish-actions.pod:4083 ../fish/guestfish-actions.pod:4098
13484 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6248
13485 #: ../src/guestfs-actions.pod:6269 ../src/guestfs-actions.pod:6288
13487 "It is an interface to the L<scrub(1)> program. See that manual page for "
13492 #: ../fish/guestfish-actions.pod:4089
13497 #: ../fish/guestfish-actions.pod:4091
13500 " scrub-file file\n"
13505 #: ../fish/guestfish-actions.pod:4093 ../src/guestfs-actions.pod:6264
13507 "This command writes patterns over a file to make data retrieval more "
13512 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6267
13513 msgid "The file is I<removed> after scrubbing."
13517 #: ../fish/guestfish-actions.pod:4101
13518 msgid "scrub-freespace"
13522 #: ../fish/guestfish-actions.pod:4103
13525 " scrub-freespace dir\n"
13530 #: ../fish/guestfish-actions.pod:4105
13532 "This command creates the directory C<dir> and then fills it with files until "
13533 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
13534 "deletes them. The intention is to scrub any free space on the partition "
13535 "containing C<dir>."
13539 #: ../fish/guestfish-actions.pod:4114
13544 #: ../fish/guestfish-actions.pod:4116
13549 #: ../fish/guestfish-actions.pod:4118
13552 " set-append append\n"
13557 #: ../fish/guestfish-actions.pod:4120 ../src/guestfs-actions.pod:6301
13559 "This function is used to add additional options to the guest kernel command "
13564 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6304
13566 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13567 "environment variable."
13571 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6307
13573 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13574 "(libguestfs always adds a few of its own)."
13578 #: ../fish/guestfish-actions.pod:4129
13579 msgid "set-attach-method"
13583 #: ../fish/guestfish-actions.pod:4131
13584 msgid "attach-method"
13588 #: ../fish/guestfish-actions.pod:4133
13591 " set-attach-method attachmethod\n"
13596 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6320
13598 "Set the method that libguestfs uses to connect to the back end guestfsd "
13599 "daemon. Possible methods are:"
13603 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6325
13604 #: ../src/guestfs.pod:2830
13605 msgid "C<appliance>"
13609 #: ../fish/guestfish-actions.pod:4142 ../src/guestfs-actions.pod:6327
13611 "Launch an appliance and connect to it. This is the ordinary method and the "
13616 #: ../fish/guestfish-actions.pod:4145 ../src/guestfs-actions.pod:6330
13617 msgid "C<unix:I<path>>"
13621 #: ../fish/guestfish-actions.pod:4147 ../src/guestfs-actions.pod:6332
13622 msgid "Connect to the Unix domain socket I<path>."
13626 #: ../fish/guestfish-actions.pod:4149 ../src/guestfs-actions.pod:6334
13628 "This method lets you connect to an existing daemon or (using virtio-serial) "
13629 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
13630 "RUNNING DAEMONS>."
13634 #: ../fish/guestfish-actions.pod:4155
13635 msgid "set-autosync"
13639 #: ../fish/guestfish-actions.pod:4157
13644 #: ../fish/guestfish-actions.pod:4159
13647 " set-autosync true|false\n"
13652 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6350
13654 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13655 "effort attempt to make filesystems consistent and synchronized when the "
13656 "handle is closed (also if the program exits without closing handles)."
13660 #: ../fish/guestfish-actions.pod:4166 ../src/guestfs-actions.pod:6355
13662 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13663 "disabled by default)."
13667 #: ../fish/guestfish-actions.pod:4169
13672 #: ../fish/guestfish-actions.pod:4171
13677 #: ../fish/guestfish-actions.pod:4173
13680 " set-direct true|false\n"
13685 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6368
13687 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13688 "passed directly through to the appliance once it is launched."
13692 #: ../fish/guestfish-actions.pod:4179
13694 "One consequence of this is that log messages aren't caught by the library "
13695 "and handled by L</set-log-message-callback>, but go straight to stdout."
13699 #: ../fish/guestfish-actions.pod:4183 ../src/guestfs-actions.pod:6376
13700 msgid "You probably don't want to use this unless you know what you are doing."
13704 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6379
13705 msgid "The default is disabled."
13709 #: ../fish/guestfish-actions.pod:4188
13710 msgid "set-e2label"
13714 #: ../fish/guestfish-actions.pod:4190
13717 " set-e2label device label\n"
13722 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6392
13724 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13725 "C<label>. Filesystem labels are limited to 16 characters."
13729 #: ../fish/guestfish-actions.pod:4196
13731 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13732 "label on a filesystem."
13736 #: ../fish/guestfish-actions.pod:4199
13741 #: ../fish/guestfish-actions.pod:4201
13744 " set-e2uuid device uuid\n"
13749 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6410
13751 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13752 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13753 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13757 #: ../fish/guestfish-actions.pod:4208
13759 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13760 "UUID of a filesystem."
13764 #: ../fish/guestfish-actions.pod:4211
13765 msgid "set-memsize"
13769 #: ../fish/guestfish-actions.pod:4213
13774 #: ../fish/guestfish-actions.pod:4215
13777 " set-memsize memsize\n"
13782 #: ../fish/guestfish-actions.pod:4217
13784 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13785 "This only has any effect if called before L</launch>."
13789 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6432
13791 "You can also change this by setting the environment variable "
13792 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13796 #: ../fish/guestfish-actions.pod:4228
13797 msgid "set-network"
13801 #: ../fish/guestfish-actions.pod:4230
13806 #: ../fish/guestfish-actions.pod:4232
13809 " set-network true|false\n"
13814 #: ../fish/guestfish-actions.pod:4234 ../src/guestfs-actions.pod:6449
13816 "If C<network> is true, then the network is enabled in the libguestfs "
13817 "appliance. The default is false."
13821 #: ../fish/guestfish-actions.pod:4237 ../src/guestfs-actions.pod:6452
13823 "This affects whether commands are able to access the network (see L<guestfs"
13824 "(3)/RUNNING COMMANDS>)."
13828 #: ../fish/guestfish-actions.pod:4240
13830 "You must call this before calling L</launch>, otherwise it has no effect."
13834 #: ../fish/guestfish-actions.pod:4243
13839 #: ../fish/guestfish-actions.pod:4247
13842 " set-path searchpath\n"
13847 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6468
13848 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13852 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6470
13854 "The default is C<$libdir/guestfs> unless overridden by setting "
13855 "C<LIBGUESTFS_PATH> environment variable."
13859 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6473
13860 msgid "Setting C<path> to C<NULL> restores the default path."
13864 #: ../fish/guestfish-actions.pod:4256
13869 #: ../fish/guestfish-actions.pod:4258
13874 #: ../fish/guestfish-actions.pod:4260
13877 " set-pgroup true|false\n"
13882 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6485
13884 "If C<pgroup> is true, child processes are placed into their own process "
13889 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6488
13891 "The practical upshot of this is that signals like C<SIGINT> (from users "
13892 "pressing C<^C>) won't be received by the child process."
13896 #: ../fish/guestfish-actions.pod:4268 ../src/guestfs-actions.pod:6491
13898 "The default for this flag is false, because usually you want C<^C> to kill "
13903 #: ../fish/guestfish-actions.pod:4271
13908 #: ../fish/guestfish-actions.pod:4273
13913 #: ../fish/guestfish-actions.pod:4275
13921 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6504
13922 msgid "Set the qemu binary that we will use."
13926 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6506
13928 "The default is chosen when the library was compiled by the configure script."
13932 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6509
13934 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13939 #: ../fish/guestfish-actions.pod:4285 ../src/guestfs-actions.pod:6512
13940 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13944 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6514
13946 "Note that you should call this function as early as possible after creating "
13947 "the handle. This is because some pre-launch operations depend on testing "
13948 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13949 "don't retest features, and so you might see inconsistent results. Using the "
13950 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13951 "the qemu binary at the same time as the handle is created."
13955 #: ../fish/guestfish-actions.pod:4295
13956 msgid "set-recovery-proc"
13960 #: ../fish/guestfish-actions.pod:4297
13961 msgid "recovery-proc"
13965 #: ../fish/guestfish-actions.pod:4299
13968 " set-recovery-proc true|false\n"
13973 #: ../fish/guestfish-actions.pod:4301
13975 "If this is called with the parameter C<false> then L</launch> does not "
13976 "create a recovery process. The purpose of the recovery process is to stop "
13977 "runaway qemu processes in the case where the main program aborts abruptly."
13981 #: ../fish/guestfish-actions.pod:4306
13983 "This only has any effect if called before L</launch>, and the default is "
13988 #: ../fish/guestfish-actions.pod:4309 ../src/guestfs-actions.pod:6540
13990 "About the only time when you would want to disable this is if the main "
13991 "process will fork itself into the background (\"daemonize\" itself). In "
13992 "this case the recovery process thinks that the main program has disappeared "
13993 "and so kills qemu, which is not very helpful."
13997 #: ../fish/guestfish-actions.pod:4315
13998 msgid "set-selinux"
14002 #: ../fish/guestfish-actions.pod:4317
14007 #: ../fish/guestfish-actions.pod:4319
14010 " set-selinux true|false\n"
14015 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6556
14017 "This sets the selinux flag that is passed to the appliance at boot time. "
14018 "The default is C<selinux=0> (disabled)."
14022 #: ../fish/guestfish-actions.pod:4324 ../src/guestfs-actions.pod:6559
14024 "Note that if SELinux is enabled, it is always in Permissive mode "
14025 "(C<enforcing=0>)."
14029 #: ../fish/guestfish-actions.pod:4330
14034 #: ../fish/guestfish-actions.pod:4332
14039 #: ../fish/guestfish-actions.pod:4334
14047 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6575
14049 "Change the number of virtual CPUs assigned to the appliance. The default is "
14050 "C<1>. Increasing this may improve performance, though often it has no "
14055 #: ../fish/guestfish-actions.pod:4340
14056 msgid "This function must be called before L</launch>."
14060 #: ../fish/guestfish-actions.pod:4342
14065 #: ../fish/guestfish-actions.pod:4344
14070 #: ../fish/guestfish-actions.pod:4346
14073 " set-trace true|false\n"
14078 #: ../fish/guestfish-actions.pod:4348 ../src/guestfs-actions.pod:6591
14080 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14081 "return values are traced."
14085 #: ../fish/guestfish-actions.pod:4351 ../src/guestfs-actions.pod:6594
14087 "If you want to trace C API calls into libguestfs (and other libraries) then "
14088 "possibly a better way is to use the external ltrace(1) command."
14092 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6598
14094 "Command traces are disabled unless the environment variable "
14095 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14099 #: ../fish/guestfish-actions.pod:4358
14101 "Trace messages are normally sent to C<stderr>, unless you register a "
14102 "callback to send them somewhere else (see L</set-event-callback>)."
14106 #: ../fish/guestfish-actions.pod:4362
14107 msgid "set-verbose"
14111 #: ../fish/guestfish-actions.pod:4364
14116 #: ../fish/guestfish-actions.pod:4366
14119 " set-verbose true|false\n"
14124 #: ../fish/guestfish-actions.pod:4368 ../src/guestfs-actions.pod:6615
14125 msgid "If C<verbose> is true, this turns on verbose messages."
14129 #: ../fish/guestfish-actions.pod:4370 ../src/guestfs-actions.pod:6617
14131 "Verbose messages are disabled unless the environment variable "
14132 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14136 #: ../fish/guestfish-actions.pod:4373
14138 "Verbose messages are normally sent to C<stderr>, unless you register a "
14139 "callback to send them somewhere else (see L</set-event-callback>)."
14143 #: ../fish/guestfish-actions.pod:4377
14148 #: ../fish/guestfish-actions.pod:4379
14151 " setcon context\n"
14156 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6634
14158 "This sets the SELinux security context of the daemon to the string "
14163 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6637
14164 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14168 #: ../fish/guestfish-actions.pod:4386
14173 #: ../fish/guestfish-actions.pod:4388
14176 " setxattr xattr val vallen path\n"
14181 #: ../fish/guestfish-actions.pod:4390 ../src/guestfs-actions.pod:6652
14183 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14184 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14188 #: ../fish/guestfish-actions.pod:4394
14189 msgid "See also: L</lsetxattr>, L<attr(5)>."
14193 #: ../fish/guestfish-actions.pod:4396
14198 #: ../fish/guestfish-actions.pod:4398
14201 " sfdisk device cyls heads sectors 'lines ...'\n"
14206 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6679
14208 "This is a direct interface to the L<sfdisk(8)> program for creating "
14209 "partitions on block devices."
14213 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6682
14214 msgid "C<device> should be a block device, for example C</dev/sda>."
14218 #: ../fish/guestfish-actions.pod:4405 ../src/guestfs-actions.pod:6684
14220 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14221 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14222 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14223 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14224 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14225 "the kernel) cannot work out the right geometry and you will need to tell it."
14229 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6692
14231 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14232 "refer to the L<sfdisk(8)> manpage."
14236 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6695
14238 "To create a single partition occupying the whole disk, you would pass "
14239 "C<lines> as a single element list, when the single element being the string "
14244 #: ../fish/guestfish-actions.pod:4420
14245 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14249 #: ../fish/guestfish-actions.pod:4426 ../fish/guestfish-actions.pod:4449
14250 #: ../fish/guestfish-actions.pod:4471
14252 "I<This function is deprecated.> In new code, use the L</part_add> call "
14257 #: ../fish/guestfish-actions.pod:4433
14262 #: ../fish/guestfish-actions.pod:4435
14265 " sfdiskM device 'lines ...'\n"
14270 #: ../fish/guestfish-actions.pod:4437
14272 "This is a simplified interface to the L</sfdisk> command, where partition "
14273 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14274 "you don't need to specify the cyls, heads and sectors parameters which were "
14275 "rarely if ever used anyway."
14279 #: ../fish/guestfish-actions.pod:4443
14280 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14284 #: ../fish/guestfish-actions.pod:4456
14289 #: ../fish/guestfish-actions.pod:4458
14292 " sfdisk-N device partnum cyls heads sectors line\n"
14297 #: ../fish/guestfish-actions.pod:4460 ../src/guestfs-actions.pod:6757
14299 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14300 "(note: C<n> counts from 1)."
14304 #: ../fish/guestfish-actions.pod:4463
14306 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14307 "cyls/heads/sectors parameters."
14311 #: ../fish/guestfish-actions.pod:4466
14312 msgid "See also: L</part-add>"
14316 #: ../fish/guestfish-actions.pod:4478
14317 msgid "sfdisk-disk-geometry"
14321 #: ../fish/guestfish-actions.pod:4480
14324 " sfdisk-disk-geometry device\n"
14329 #: ../fish/guestfish-actions.pod:4482
14331 "This displays the disk geometry of C<device> read from the partition table. "
14332 "Especially in the case where the underlying block device has been resized, "
14333 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
14334 "kernel-geometry>)."
14338 #: ../fish/guestfish-actions.pod:4487 ../fish/guestfish-actions.pod:4496
14339 #: ../src/guestfs-actions.pod:6783 ../src/guestfs-actions.pod:6799
14340 msgid "The result is in human-readable format, and not designed to be parsed."
14344 #: ../fish/guestfish-actions.pod:4490
14345 msgid "sfdisk-kernel-geometry"
14349 #: ../fish/guestfish-actions.pod:4492
14352 " sfdisk-kernel-geometry device\n"
14357 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6797
14358 msgid "This displays the kernel's idea of the geometry of C<device>."
14362 #: ../fish/guestfish-actions.pod:4499
14367 #: ../fish/guestfish-actions.pod:4501
14370 " sfdisk-l device\n"
14375 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6820
14377 "This displays the partition table on C<device>, in the human-readable output "
14378 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14382 #: ../fish/guestfish-actions.pod:4507
14383 msgid "See also: L</part-list>"
14387 #: ../fish/guestfish-actions.pod:4509
14389 "I<This function is deprecated.> In new code, use the L</part_list> call "
14394 #: ../fish/guestfish-actions.pod:4516
14399 #: ../fish/guestfish-actions.pod:4518
14407 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6837
14409 "This call runs a command from the guest filesystem via the guest's C</bin/"
14414 #: ../fish/guestfish-actions.pod:4523
14415 msgid "This is like L</command>, but passes the command to:"
14419 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6842
14422 " /bin/sh -c \"command\"\n"
14427 #: ../fish/guestfish-actions.pod:4527 ../src/guestfs-actions.pod:6844
14429 "Depending on the guest's shell, this usually results in wildcards being "
14430 "expanded, shell expressions being interpolated and so on."
14434 #: ../fish/guestfish-actions.pod:4531
14435 msgid "All the provisos about L</command> apply to this call."
14439 #: ../fish/guestfish-actions.pod:4533
14444 #: ../fish/guestfish-actions.pod:4535
14447 " sh-lines command\n"
14452 #: ../fish/guestfish-actions.pod:4537
14453 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14457 #: ../fish/guestfish-actions.pod:4540
14458 msgid "See also: L</command-lines>"
14462 #: ../fish/guestfish-actions.pod:4542
14467 #: ../fish/guestfish-actions.pod:4544
14475 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6878
14476 msgid "Sleep for C<secs> seconds."
14480 #: ../fish/guestfish-actions.pod:4548
14485 #: ../fish/guestfish-actions.pod:4550
14493 #: ../fish/guestfish-actions.pod:4554 ../src/guestfs-actions.pod:6892
14494 msgid "This is the same as the C<stat(2)> system call."
14498 #: ../fish/guestfish-actions.pod:4556
14503 #: ../fish/guestfish-actions.pod:4558
14511 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6906
14513 "Returns file system statistics for any mounted file system. C<path> should "
14514 "be a file or directory in the mounted file system (typically it is the mount "
14515 "point itself, but it doesn't need to be)."
14519 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6910
14520 msgid "This is the same as the C<statvfs(2)> system call."
14524 #: ../fish/guestfish-actions.pod:4566
14529 #: ../fish/guestfish-actions.pod:4568
14537 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6924
14539 "This runs the L<strings(1)> command on a file and returns the list of "
14540 "printable strings found."
14544 #: ../fish/guestfish-actions.pod:4576
14549 #: ../fish/guestfish-actions.pod:4578
14552 " strings-e encoding path\n"
14557 #: ../fish/guestfish-actions.pod:4580
14559 "This is like the L</strings> command, but allows you to specify the encoding "
14560 "of strings that are looked for in the source file C<path>."
14564 #: ../fish/guestfish-actions.pod:4584 ../src/guestfs-actions.pod:6947
14565 msgid "Allowed encodings are:"
14569 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6951
14574 #: ../fish/guestfish-actions.pod:4590
14576 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14577 "ISO-8859-X (this is what L</strings> uses)."
14581 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6956
14586 #: ../fish/guestfish-actions.pod:4595 ../src/guestfs-actions.pod:6958
14587 msgid "Single 8-bit-byte characters."
14591 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:6960
14596 #: ../fish/guestfish-actions.pod:4599 ../src/guestfs-actions.pod:6962
14597 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14601 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6965
14602 msgid "l (lower case letter L)"
14606 #: ../fish/guestfish-actions.pod:4604 ../src/guestfs-actions.pod:6967
14608 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14609 "examining binaries in Windows guests."
14613 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:6970
14618 #: ../fish/guestfish-actions.pod:4609 ../src/guestfs-actions.pod:6972
14619 msgid "32-bit big endian such as UCS-4BE."
14623 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6974
14628 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6976
14629 msgid "32-bit little endian such as UCS-4LE."
14633 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6980
14634 msgid "The returned strings are transcoded to UTF-8."
14638 #: ../fish/guestfish-actions.pod:4622
14639 msgid "swapoff-device"
14643 #: ../fish/guestfish-actions.pod:4624
14646 " swapoff-device device\n"
14651 #: ../fish/guestfish-actions.pod:4626
14653 "This command disables the libguestfs appliance swap device or partition "
14654 "named C<device>. See L</swapon-device>."
14658 #: ../fish/guestfish-actions.pod:4630
14659 msgid "swapoff-file"
14663 #: ../fish/guestfish-actions.pod:4632
14666 " swapoff-file file\n"
14671 #: ../fish/guestfish-actions.pod:4634 ../src/guestfs-actions.pod:7011
14672 msgid "This command disables the libguestfs appliance swap on file."
14676 #: ../fish/guestfish-actions.pod:4636
14677 msgid "swapoff-label"
14681 #: ../fish/guestfish-actions.pod:4638
14684 " swapoff-label label\n"
14689 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:7023
14691 "This command disables the libguestfs appliance swap on labeled swap "
14696 #: ../fish/guestfish-actions.pod:4643
14697 msgid "swapoff-uuid"
14701 #: ../fish/guestfish-actions.pod:4645
14704 " swapoff-uuid uuid\n"
14709 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:7036
14711 "This command disables the libguestfs appliance swap partition with the given "
14716 #: ../fish/guestfish-actions.pod:4650
14717 msgid "swapon-device"
14721 #: ../fish/guestfish-actions.pod:4652
14724 " swapon-device device\n"
14729 #: ../fish/guestfish-actions.pod:4654
14731 "This command enables the libguestfs appliance to use the swap device or "
14732 "partition named C<device>. The increased memory is made available for all "
14733 "commands, for example those run using L</command> or L</sh>."
14737 #: ../fish/guestfish-actions.pod:4659 ../src/guestfs-actions.pod:7054
14739 "Note that you should not swap to existing guest swap partitions unless you "
14740 "know what you are doing. They may contain hibernation information, or other "
14741 "information that the guest doesn't want you to trash. You also risk leaking "
14742 "information about the host to the guest this way. Instead, attach a new "
14743 "host device to the guest and swap on that."
14747 #: ../fish/guestfish-actions.pod:4666
14748 msgid "swapon-file"
14752 #: ../fish/guestfish-actions.pod:4668
14755 " swapon-file file\n"
14760 #: ../fish/guestfish-actions.pod:4670
14762 "This command enables swap to a file. See L</swapon-device> for other notes."
14766 #: ../fish/guestfish-actions.pod:4673
14767 msgid "swapon-label"
14771 #: ../fish/guestfish-actions.pod:4675
14774 " swapon-label label\n"
14779 #: ../fish/guestfish-actions.pod:4677
14781 "This command enables swap to a labeled swap partition. See L</swapon-"
14782 "device> for other notes."
14786 #: ../fish/guestfish-actions.pod:4680
14787 msgid "swapon-uuid"
14791 #: ../fish/guestfish-actions.pod:4682
14794 " swapon-uuid uuid\n"
14799 #: ../fish/guestfish-actions.pod:4684
14801 "This command enables swap to a swap partition with the given UUID. See L</"
14802 "swapon-device> for other notes."
14806 #: ../fish/guestfish-actions.pod:4687
14811 #: ../fish/guestfish-actions.pod:4689
14819 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7109
14821 "This syncs the disk, so that any writes are flushed through to the "
14822 "underlying disk image."
14826 #: ../fish/guestfish-actions.pod:4694 ../src/guestfs-actions.pod:7112
14828 "You should always call this if you have modified a disk image, before "
14829 "closing the handle."
14833 #: ../fish/guestfish-actions.pod:4697
14838 #: ../fish/guestfish-actions.pod:4699
14846 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7125
14848 "This command returns up to the last 10 lines of a file as a list of strings."
14852 #: ../fish/guestfish-actions.pod:4707
14857 #: ../fish/guestfish-actions.pod:4709
14860 " tail-n nrlines path\n"
14865 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7144
14867 "If the parameter C<nrlines> is a positive number, this returns the last "
14868 "C<nrlines> lines of the file C<path>."
14872 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7147
14874 "If the parameter C<nrlines> is a negative number, this returns lines from "
14875 "the file C<path>, starting with the C<-nrlines>th line."
14879 #: ../fish/guestfish-actions.pod:4722
14884 #: ../fish/guestfish-actions.pod:4724
14887 " tar-in (tarfile|-) directory\n"
14892 #: ../fish/guestfish-actions.pod:4726 ../src/guestfs-actions.pod:7168
14894 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14895 "tar file) into C<directory>."
14899 #: ../fish/guestfish-actions.pod:4729
14900 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14904 #: ../fish/guestfish-actions.pod:4734
14909 #: ../fish/guestfish-actions.pod:4736
14912 " tar-out directory (tarfile|-)\n"
14917 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7185
14919 "This command packs the contents of C<directory> and downloads it to local "
14924 #: ../fish/guestfish-actions.pod:4741
14925 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14929 #: ../fish/guestfish-actions.pod:4746
14934 #: ../fish/guestfish-actions.pod:4748
14937 " tgz-in (tarball|-) directory\n"
14942 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7202
14944 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14945 "tar file) into C<directory>."
14949 #: ../fish/guestfish-actions.pod:4753
14950 msgid "To upload an uncompressed tarball, use L</tar-in>."
14954 #: ../fish/guestfish-actions.pod:4757
14959 #: ../fish/guestfish-actions.pod:4759
14962 " tgz-out directory (tarball|-)\n"
14967 #: ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7218
14969 "This command packs the contents of C<directory> and downloads it to local "
14974 #: ../fish/guestfish-actions.pod:4764
14975 msgid "To download an uncompressed tarball, use L</tar-out>."
14979 #: ../fish/guestfish-actions.pod:4768
14984 #: ../fish/guestfish-actions.pod:4770
14992 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7233
14994 "Touch acts like the L<touch(1)> command. It can be used to update the "
14995 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15000 #: ../fish/guestfish-actions.pod:4776 ../src/guestfs-actions.pod:7237
15002 "This command only works on regular files, and will fail on other file types "
15003 "such as directories, symbolic links, block special etc."
15007 #: ../fish/guestfish-actions.pod:4779
15012 #: ../fish/guestfish-actions.pod:4781
15020 #: ../fish/guestfish-actions.pod:4783 ../src/guestfs-actions.pod:7250
15022 "This command truncates C<path> to a zero-length file. The file must exist "
15027 #: ../fish/guestfish-actions.pod:4786
15028 msgid "truncate-size"
15032 #: ../fish/guestfish-actions.pod:4788
15035 " truncate-size path size\n"
15040 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7264
15042 "This command truncates C<path> to size C<size> bytes. The file must exist "
15047 #: ../fish/guestfish-actions.pod:4793
15049 "If the current file size is less than C<size> then the file is extended to "
15050 "the required size with zero bytes. This creates a sparse file (ie. disk "
15051 "blocks are not allocated for the file until you write to it). To create a "
15052 "non-sparse file of zeroes, use L</fallocate64> instead."
15056 #: ../fish/guestfish-actions.pod:4799
15061 #: ../fish/guestfish-actions.pod:4801
15064 " tune2fs-l device\n"
15069 #: ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:7283
15071 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15076 #: ../fish/guestfish-actions.pod:4806 ../src/guestfs-actions.pod:7286
15078 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15079 "for more details. The list of fields returned isn't clearly defined, and "
15080 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15081 "and the filesystem itself."
15085 #: ../fish/guestfish-actions.pod:4811
15090 #: ../fish/guestfish-actions.pod:4813
15093 " txz-in (tarball|-) directory\n"
15098 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7306
15100 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15101 "tar file) into C<directory>."
15105 #: ../fish/guestfish-actions.pod:4820
15110 #: ../fish/guestfish-actions.pod:4822
15113 " txz-out directory (tarball|-)\n"
15118 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7320
15120 "This command packs the contents of C<directory> and downloads it to local "
15121 "file C<tarball> (as an xz compressed tar archive)."
15125 #: ../fish/guestfish-actions.pod:4829
15130 #: ../fish/guestfish-actions.pod:4831
15138 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7333
15140 "This function sets the mask used for creating new files and device nodes to "
15145 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7336
15147 "Typical umask values would be C<022> which creates new files with "
15148 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15149 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15153 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7341
15155 "The default umask is C<022>. This is important because it means that "
15156 "directories and device nodes will be created with C<0644> or C<0755> mode "
15157 "even if you specify C<0777>."
15161 #: ../fish/guestfish-actions.pod:4845
15162 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15166 #: ../fish/guestfish-actions.pod:4848 ../src/guestfs-actions.pod:7348
15167 msgid "This call returns the previous umask."
15171 #: ../fish/guestfish-actions.pod:4850
15176 #: ../fish/guestfish-actions.pod:4852
15181 #: ../fish/guestfish-actions.pod:4854
15184 " umount pathordevice\n"
15189 #: ../fish/guestfish-actions.pod:4856 ../src/guestfs-actions.pod:7360
15191 "This unmounts the given filesystem. The filesystem may be specified either "
15192 "by its mountpoint (path) or the device which contains the filesystem."
15196 #: ../fish/guestfish-actions.pod:4860
15201 #: ../fish/guestfish-actions.pod:4862
15202 msgid "unmount-all"
15206 #: ../fish/guestfish-actions.pod:4864
15214 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7373
15215 msgid "This unmounts all mounted filesystems."
15219 #: ../fish/guestfish-actions.pod:4868 ../src/guestfs-actions.pod:7375
15220 msgid "Some internal mounts are not unmounted by this call."
15224 #: ../fish/guestfish-actions.pod:4870
15229 #: ../fish/guestfish-actions.pod:4872
15232 " upload (filename|-) remotefilename\n"
15237 #: ../fish/guestfish-actions.pod:4874 ../fish/guestfish-actions.pod:4887
15238 #: ../src/guestfs-actions.pod:7388 ../src/guestfs-actions.pod:7412
15239 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15243 #: ../fish/guestfish-actions.pod:4879
15244 msgid "See also L</download>."
15248 #: ../fish/guestfish-actions.pod:4883
15249 msgid "upload-offset"
15253 #: ../fish/guestfish-actions.pod:4885
15256 " upload-offset (filename|-) remotefilename offset\n"
15261 #: ../fish/guestfish-actions.pod:4890 ../src/guestfs-actions.pod:7415
15263 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15264 "The intention is to overwrite parts of existing files or devices, although "
15265 "if a non-existant file is specified then it is created with a \"hole\" "
15266 "before C<offset>. The size of the data written is implicit in the size of "
15267 "the source C<filename>."
15271 #: ../fish/guestfish-actions.pod:4897
15273 "Note that there is no limit on the amount of data that can be uploaded with "
15274 "this call, unlike with L</pwrite>, and this call always writes the full "
15275 "amount unless an error occurs."
15279 #: ../fish/guestfish-actions.pod:4902
15280 msgid "See also L</upload>, L</pwrite>."
15284 #: ../fish/guestfish-actions.pod:4906
15289 #: ../fish/guestfish-actions.pod:4908
15292 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15297 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7448
15298 msgid "This command sets the timestamps of a file with nanosecond precision."
15302 #: ../fish/guestfish-actions.pod:4913 ../src/guestfs-actions.pod:7451
15304 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15309 #: ../fish/guestfish-actions.pod:4916 ../src/guestfs-actions.pod:7454
15311 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15312 "nanoseconds from the epoch."
15316 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7457
15318 "If the C<*nsecs> field contains the special value C<-1> then the "
15319 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15320 "ignored in this case)."
15324 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7461
15326 "If the C<*nsecs> field contains the special value C<-2> then the "
15327 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15332 #: ../fish/guestfish-actions.pod:4927
15337 #: ../fish/guestfish-actions.pod:4929
15345 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7474
15347 "Return the libguestfs version number that the program is linked against."
15351 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7477
15353 "Note that because of dynamic linking this is not necessarily the version of "
15354 "libguestfs that you compiled against. You can compile the program, and then "
15355 "at runtime dynamically link against a completely different C<libguestfs.so> "
15360 #: ../fish/guestfish-actions.pod:4939 ../src/guestfs-actions.pod:7482
15362 "This call was added in version C<1.0.58>. In previous versions of "
15363 "libguestfs there was no way to get the version number. From C code you can "
15364 "use dynamic linker functions to find out if this symbol exists (if it "
15365 "doesn't, then it's an earlier version)."
15369 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7488
15371 "The call returns a structure with four elements. The first three (C<major>, "
15372 "C<minor> and C<release>) are numbers and correspond to the usual version "
15373 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15374 "but may be used for distro-specific information."
15378 #: ../fish/guestfish-actions.pod:4951 ../src/guestfs-actions.pod:7494
15380 "To construct the original version string: C<$major.$minor.$release$extra>"
15384 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7497
15385 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15389 #: ../fish/guestfish-actions.pod:4956
15391 "I<Note:> Don't use this call to test for availability of features. In "
15392 "enterprise distributions we backport features from later versions into "
15393 "earlier versions, making this an unreliable way to test for features. Use "
15394 "L</available> instead."
15398 #: ../fish/guestfish-actions.pod:4962
15403 #: ../fish/guestfish-actions.pod:4964
15406 " vfs-label device\n"
15411 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7517
15412 msgid "This returns the filesystem label of the filesystem on C<device>."
15416 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7520
15417 msgid "If the filesystem is unlabeled, this returns the empty string."
15421 #: ../fish/guestfish-actions.pod:4971
15422 msgid "To find a filesystem from the label, use L</findfs-label>."
15426 #: ../fish/guestfish-actions.pod:4973
15431 #: ../fish/guestfish-actions.pod:4975
15434 " vfs-type device\n"
15439 #: ../fish/guestfish-actions.pod:4977 ../src/guestfs-actions.pod:7535
15441 "This command gets the filesystem type corresponding to the filesystem on "
15446 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7538
15448 "For most filesystems, the result is the name of the Linux VFS module which "
15449 "would be used to mount this filesystem if you mounted it without specifying "
15450 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15454 #: ../fish/guestfish-actions.pod:4985
15459 #: ../fish/guestfish-actions.pod:4987
15462 " vfs-uuid device\n"
15467 #: ../fish/guestfish-actions.pod:4989 ../src/guestfs-actions.pod:7554
15468 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15472 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7557
15473 msgid "If the filesystem does not have a UUID, this returns the empty string."
15477 #: ../fish/guestfish-actions.pod:4994
15478 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15482 #: ../fish/guestfish-actions.pod:4996
15483 msgid "vg-activate"
15487 #: ../fish/guestfish-actions.pod:4998
15490 " vg-activate true|false 'volgroups ...'\n"
15495 #: ../fish/guestfish-actions.pod:5000 ../src/guestfs-actions.pod:7573
15497 "This command activates or (if C<activate> is false) deactivates all logical "
15498 "volumes in the listed volume groups C<volgroups>."
15502 #: ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:7576
15503 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15507 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7578
15509 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15510 "activated or deactivated."
15514 #: ../fish/guestfish-actions.pod:5008
15515 msgid "vg-activate-all"
15519 #: ../fish/guestfish-actions.pod:5010
15522 " vg-activate-all true|false\n"
15527 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7591
15529 "This command activates or (if C<activate> is false) deactivates all logical "
15530 "volumes in all volume groups."
15534 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7594
15535 msgid "This command is the same as running C<vgchange -a y|n>"
15539 #: ../fish/guestfish-actions.pod:5017
15544 #: ../fish/guestfish-actions.pod:5019
15547 " vgcreate volgroup 'physvols ...'\n"
15552 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7607
15554 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15555 "of physical volumes C<physvols>."
15559 #: ../fish/guestfish-actions.pod:5024
15564 #: ../fish/guestfish-actions.pod:5026
15567 " vglvuuids vgname\n"
15572 #: ../fish/guestfish-actions.pod:5028 ../src/guestfs-actions.pod:7620
15574 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15575 "volumes created in this volume group."
15579 #: ../fish/guestfish-actions.pod:5031
15581 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
15582 "logical volumes and volume groups."
15586 #: ../fish/guestfish-actions.pod:5034
15587 msgid "See also L</vgpvuuids>."
15591 #: ../fish/guestfish-actions.pod:5036
15596 #: ../fish/guestfish-actions.pod:5038
15599 " vgpvuuids vgname\n"
15604 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7640
15606 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15607 "volumes that this volume group resides on."
15611 #: ../fish/guestfish-actions.pod:5043
15613 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
15614 "physical volumes and volume groups."
15618 #: ../fish/guestfish-actions.pod:5046
15619 msgid "See also L</vglvuuids>."
15623 #: ../fish/guestfish-actions.pod:5048
15628 #: ../fish/guestfish-actions.pod:5050
15631 " vgremove vgname\n"
15636 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7660
15637 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15641 #: ../fish/guestfish-actions.pod:5054 ../src/guestfs-actions.pod:7662
15643 "This also forcibly removes all logical volumes in the volume group (if any)."
15647 #: ../fish/guestfish-actions.pod:5057
15652 #: ../fish/guestfish-actions.pod:5059
15655 " vgrename volgroup newvolgroup\n"
15660 #: ../fish/guestfish-actions.pod:5061 ../src/guestfs-actions.pod:7676
15661 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15665 #: ../fish/guestfish-actions.pod:5063
15670 #: ../fish/guestfish-actions.pod:5065
15678 #: ../fish/guestfish-actions.pod:5067 ../src/guestfs-actions.pod:7687
15680 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15685 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7690
15687 "This returns a list of just the volume group names that were detected (eg. "
15692 #: ../fish/guestfish-actions.pod:5073
15693 msgid "See also L</vgs-full>."
15697 #: ../fish/guestfish-actions.pod:5075
15702 #: ../fish/guestfish-actions.pod:5077
15710 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7706
15712 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15713 "> command. The \"full\" version includes all fields."
15717 #: ../fish/guestfish-actions.pod:5082
15722 #: ../fish/guestfish-actions.pod:5084
15730 #: ../fish/guestfish-actions.pod:5086 ../src/guestfs-actions.pod:7720
15732 "This rescans all block devices and rebuilds the list of LVM physical "
15733 "volumes, volume groups and logical volumes."
15737 #: ../fish/guestfish-actions.pod:5089
15742 #: ../fish/guestfish-actions.pod:5091
15750 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7733
15751 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15755 #: ../fish/guestfish-actions.pod:5095
15760 #: ../fish/guestfish-actions.pod:5097
15768 #: ../fish/guestfish-actions.pod:5099 ../src/guestfs-actions.pod:7773
15770 "This command counts the characters in a file, using the C<wc -c> external "
15775 #: ../fish/guestfish-actions.pod:5102
15780 #: ../fish/guestfish-actions.pod:5104
15788 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7786
15790 "This command counts the lines in a file, using the C<wc -l> external command."
15794 #: ../fish/guestfish-actions.pod:5109
15799 #: ../fish/guestfish-actions.pod:5111
15807 #: ../fish/guestfish-actions.pod:5113 ../src/guestfs-actions.pod:7799
15809 "This command counts the words in a file, using the C<wc -w> external command."
15813 #: ../fish/guestfish-actions.pod:5116
15818 #: ../fish/guestfish-actions.pod:5118
15821 " write path content\n"
15826 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7814
15828 "This call creates a file called C<path>. The content of the file is the "
15829 "string C<content> (which can contain any 8 bit data)."
15833 #: ../fish/guestfish-actions.pod:5123
15834 msgid "See also L</write-append>."
15838 #: ../fish/guestfish-actions.pod:5128
15839 msgid "write-append"
15843 #: ../fish/guestfish-actions.pod:5130
15846 " write-append path content\n"
15851 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7834
15853 "This call appends C<content> to the end of file C<path>. If C<path> does "
15854 "not exist, then a new file is created."
15858 #: ../fish/guestfish-actions.pod:5135
15859 msgid "See also L</write>."
15863 #: ../fish/guestfish-actions.pod:5140
15868 #: ../fish/guestfish-actions.pod:5142
15871 " write-file path content size\n"
15876 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7861
15878 "This call creates a file called C<path>. The contents of the file is the "
15879 "string C<content> (which can contain any 8 bit data), with length C<size>."
15883 #: ../fish/guestfish-actions.pod:5148 ../src/guestfs-actions.pod:7865
15885 "As a special case, if C<size> is C<0> then the length is calculated using "
15886 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15890 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7869
15892 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15893 "I<not> work, even if the length is specified."
15897 #: ../fish/guestfish-actions.pod:5158
15899 "I<This function is deprecated.> In new code, use the L</write> call instead."
15903 #: ../fish/guestfish-actions.pod:5165
15908 #: ../fish/guestfish-actions.pod:5167
15911 " zegrep regex path\n"
15916 #: ../fish/guestfish-actions.pod:5169 ../src/guestfs-actions.pod:7886
15918 "This calls the external C<zegrep> program and returns the matching lines."
15922 #: ../fish/guestfish-actions.pod:5175
15927 #: ../fish/guestfish-actions.pod:5177
15930 " zegrepi regex path\n"
15935 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7905
15937 "This calls the external C<zegrep -i> program and returns the matching lines."
15941 #: ../fish/guestfish-actions.pod:5185
15946 #: ../fish/guestfish-actions.pod:5187
15954 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7923
15955 msgid "This command writes zeroes over the first few blocks of C<device>."
15959 #: ../fish/guestfish-actions.pod:5191 ../src/guestfs-actions.pod:7925
15961 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15962 "securely wipe the device). It should be sufficient to remove any partition "
15963 "tables, filesystem superblocks and so on."
15967 #: ../fish/guestfish-actions.pod:5195 ../fish/guestfish-actions.pod:5210
15968 #: ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:7955
15970 "If blocks are already zero, then this command avoids writing zeroes. This "
15971 "prevents the underlying device from becoming non-sparse or growing "
15976 #: ../fish/guestfish-actions.pod:5199
15977 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15981 #: ../fish/guestfish-actions.pod:5202
15982 msgid "zero-device"
15986 #: ../fish/guestfish-actions.pod:5204
15989 " zero-device device\n"
15994 #: ../fish/guestfish-actions.pod:5206
15996 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15997 "which just zeroes the first few blocks of a device."
16001 #: ../fish/guestfish-actions.pod:5217
16006 #: ../fish/guestfish-actions.pod:5219
16009 " zerofree device\n"
16014 #: ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:7977
16016 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16017 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16018 "possible to compress the filesystem more effectively."
16022 #: ../fish/guestfish-actions.pod:5226 ../src/guestfs-actions.pod:7982
16023 msgid "You should B<not> run this program if the filesystem is mounted."
16027 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:7985
16029 "It is possible that using this program can damage the filesystem or data on "
16034 #: ../fish/guestfish-actions.pod:5232
16039 #: ../fish/guestfish-actions.pod:5234
16042 " zfgrep pattern path\n"
16047 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:7999
16049 "This calls the external C<zfgrep> program and returns the matching lines."
16053 #: ../fish/guestfish-actions.pod:5242
16058 #: ../fish/guestfish-actions.pod:5244
16061 " zfgrepi pattern path\n"
16066 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8018
16068 "This calls the external C<zfgrep -i> program and returns the matching lines."
16072 #: ../fish/guestfish-actions.pod:5252
16077 #: ../fish/guestfish-actions.pod:5254
16080 " zfile meth path\n"
16085 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8044
16087 "This command runs C<file> after first decompressing C<path> using C<method>."
16091 #: ../fish/guestfish-actions.pod:5259 ../src/guestfs-actions.pod:8047
16092 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16096 #: ../fish/guestfish-actions.pod:5261
16098 "Since 1.0.63, use L</file> instead which can now process compressed files."
16102 #: ../fish/guestfish-actions.pod:5264
16104 "I<This function is deprecated.> In new code, use the L</file> call instead."
16108 #: ../fish/guestfish-actions.pod:5271
16113 #: ../fish/guestfish-actions.pod:5273
16116 " zgrep regex path\n"
16121 #: ../fish/guestfish-actions.pod:5275 ../src/guestfs-actions.pod:8064
16123 "This calls the external C<zgrep> program and returns the matching lines."
16127 #: ../fish/guestfish-actions.pod:5281
16132 #: ../fish/guestfish-actions.pod:5283
16135 " zgrepi regex path\n"
16140 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8083
16142 "This calls the external C<zgrep -i> program and returns the matching lines."
16146 #: ../fish/guestfish-commands.pod:1
16151 #: ../fish/guestfish-commands.pod:3
16156 #: ../fish/guestfish-commands.pod:5
16159 " alloc filename size\n"
16164 #: ../fish/guestfish-commands.pod:7
16166 "This creates an empty (zeroed) file of the given size, and then adds so it "
16167 "can be further examined."
16171 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16172 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16176 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16177 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16181 #: ../fish/guestfish-commands.pod:14
16183 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16184 "image, see L</PREPARED DISK IMAGES>."
16188 #: ../fish/guestfish-commands.pod:17
16193 #: ../fish/guestfish-commands.pod:19
16196 " copy-in local [local ...] /remotedir\n"
16201 #: ../fish/guestfish-commands.pod:21
16203 "C<copy-in> copies local files or directories recursively into the disk "
16204 "image, placing them in the directory called C</remotedir> (which must "
16205 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16206 "other commands as necessary."
16210 #: ../fish/guestfish-commands.pod:26
16212 "Multiple local files and directories can be specified, but the last "
16213 "parameter must always be a remote directory. Wildcards cannot be used."
16217 #: ../fish/guestfish-commands.pod:30
16222 #: ../fish/guestfish-commands.pod:32
16225 " copy-out remote [remote ...] localdir\n"
16230 #: ../fish/guestfish-commands.pod:34
16232 "C<copy-out> copies remote files or directories recursively out of the disk "
16233 "image, placing them on the host disk in a local directory called C<localdir> "
16234 "(which must exist). This guestfish meta-command turns into a sequence of L</"
16235 "download>, L</tar-out> and other commands as necessary."
16239 #: ../fish/guestfish-commands.pod:40
16241 "Multiple remote files and directories can be specified, but the last "
16242 "parameter must always be a local directory. To download to the current "
16243 "directory, use C<.> as in:"
16247 #: ../fish/guestfish-commands.pod:44
16250 " copy-out /home .\n"
16255 #: ../fish/guestfish-commands.pod:46
16257 "Wildcards cannot be used in the ordinary command, but you can use them with "
16258 "the help of L</glob> like this:"
16262 #: ../fish/guestfish-commands.pod:49
16265 " glob copy-out /home/* .\n"
16270 #: ../fish/guestfish-commands.pod:51
16275 #: ../fish/guestfish-commands.pod:53
16278 " display filename\n"
16283 #: ../fish/guestfish-commands.pod:55
16285 "Use C<display> (a graphical display program) to display an image file. It "
16286 "downloads the file, and runs C<display> on it."
16290 #: ../fish/guestfish-commands.pod:58
16292 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16293 "environment variable. For example to use the GNOME display program:"
16297 #: ../fish/guestfish-commands.pod:61
16300 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16305 #: ../fish/guestfish-commands.pod:63
16306 msgid "See also L<display(1)>."
16310 #: ../fish/guestfish-commands.pod:65
16315 #: ../fish/guestfish-commands.pod:67
16318 " echo [params ...]\n"
16323 #: ../fish/guestfish-commands.pod:69
16324 msgid "This echos the parameters to the terminal."
16328 #: ../fish/guestfish-commands.pod:71
16333 #: ../fish/guestfish-commands.pod:73
16338 #: ../fish/guestfish-commands.pod:75
16343 #: ../fish/guestfish-commands.pod:77
16351 #: ../fish/guestfish-commands.pod:79
16353 "This is used to edit a file. It downloads the file, edits it locally using "
16354 "your editor, then uploads the result."
16358 #: ../fish/guestfish-commands.pod:82
16360 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16361 "or C<emacs> you will get those corresponding editors."
16365 #: ../fish/guestfish-commands.pod:86
16370 #: ../fish/guestfish-commands.pod:88
16373 " glob command args...\n"
16378 #: ../fish/guestfish-commands.pod:90
16380 "Expand wildcards in any paths in the args list, and run C<command> "
16381 "repeatedly on each matching path."
16385 #: ../fish/guestfish-commands.pod:93
16386 msgid "See L</WILDCARDS AND GLOBBING>."
16390 #: ../fish/guestfish-commands.pod:95
16395 #: ../fish/guestfish-commands.pod:97
16398 " hexedit <filename|device>\n"
16399 " hexedit <filename|device> <max>\n"
16400 " hexedit <filename|device> <start> <max>\n"
16405 #: ../fish/guestfish-commands.pod:101
16407 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16412 #: ../fish/guestfish-commands.pod:104
16414 "This command works by downloading potentially the whole file or device, "
16415 "editing it locally, then uploading it. If the file or device is large, you "
16416 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16417 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16418 "usual modifiers allowed such as C<1M> (1 megabyte)."
16422 #: ../fish/guestfish-commands.pod:111
16423 msgid "For example to edit the first few sectors of a disk you might do:"
16427 #: ../fish/guestfish-commands.pod:114
16430 " hexedit /dev/sda 1M\n"
16435 #: ../fish/guestfish-commands.pod:116
16437 "which would allow you to edit anywhere within the first megabyte of the disk."
16441 #: ../fish/guestfish-commands.pod:119
16442 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16446 #: ../fish/guestfish-commands.pod:121
16449 " hexedit /dev/sda1 0x400 0x400\n"
16454 #: ../fish/guestfish-commands.pod:123
16455 msgid "(assuming the superblock is in the standard location)."
16459 #: ../fish/guestfish-commands.pod:125
16461 "This command requires the external L<hexedit(1)> program. You can specify "
16462 "another program to use by setting the C<HEXEDITOR> environment variable."
16466 #: ../fish/guestfish-commands.pod:129
16467 msgid "See also L</hexdump>."
16471 #: ../fish/guestfish-commands.pod:131
16476 #: ../fish/guestfish-commands.pod:133
16484 #: ../fish/guestfish-commands.pod:135
16486 "Change the local directory, ie. the current directory of guestfish itself."
16490 #: ../fish/guestfish-commands.pod:138
16491 msgid "Note that C<!cd> won't do what you might expect."
16495 #: ../fish/guestfish-commands.pod:140
16500 #: ../fish/guestfish-commands.pod:142
16505 #: ../fish/guestfish-commands.pod:144
16513 #: ../fish/guestfish-commands.pod:146
16514 msgid "Opens the manual page for guestfish."
16518 #: ../fish/guestfish-commands.pod:148
16523 #: ../fish/guestfish-commands.pod:150
16528 #: ../fish/guestfish-commands.pod:152
16536 #: ../fish/guestfish-commands.pod:154
16544 #: ../fish/guestfish-commands.pod:156
16545 msgid "This is used to view a file."
16549 #: ../fish/guestfish-commands.pod:158
16551 "The default viewer is C<$PAGER>. However if you use the alternate command "
16552 "C<less> you will get the C<less> command specifically."
16556 #: ../fish/guestfish-commands.pod:161
16561 #: ../fish/guestfish-commands.pod:163
16569 #: ../fish/guestfish-commands.pod:165
16571 "Close and reopen the libguestfs handle. It is not necessary to use this "
16572 "normally, because the handle is closed properly when guestfish exits. "
16573 "However this is occasionally useful for testing."
16577 #: ../fish/guestfish-commands.pod:169
16582 #: ../fish/guestfish-commands.pod:171
16585 " setenv VAR value\n"
16590 #: ../fish/guestfish-commands.pod:173
16591 msgid "Set the environment variable C<VAR> to the string C<value>."
16595 #: ../fish/guestfish-commands.pod:175
16597 "To print the value of an environment variable use a shell command such as:"
16601 #: ../fish/guestfish-commands.pod:178
16609 #: ../fish/guestfish-commands.pod:180
16614 #: ../fish/guestfish-commands.pod:182
16617 " sparse filename size\n"
16622 #: ../fish/guestfish-commands.pod:184
16624 "This creates an empty sparse file of the given size, and then adds so it can "
16625 "be further examined."
16629 #: ../fish/guestfish-commands.pod:187
16631 "In all respects it works the same as the L</alloc> command, except that the "
16632 "image file is allocated sparsely, which means that disk blocks are not "
16633 "assigned to the file until they are needed. Sparse disk files only use "
16634 "space when written to, but they are slower and there is a danger you could "
16635 "run out of real disk space during a write operation."
16639 #: ../fish/guestfish-commands.pod:197
16644 #: ../fish/guestfish-commands.pod:199
16652 #: ../fish/guestfish-commands.pod:201
16654 "This command returns a list of the optional groups known to the daemon, and "
16655 "indicates which ones are supported by this build of the libguestfs appliance."
16659 #: ../fish/guestfish-commands.pod:205
16660 msgid "See also L<guestfs(3)/AVAILABILITY>."
16664 #: ../fish/guestfish-commands.pod:207
16669 #: ../fish/guestfish-commands.pod:209
16672 " time command args...\n"
16677 #: ../fish/guestfish-commands.pod:211
16679 "Run the command as usual, but print the elapsed time afterwards. This can "
16680 "be useful for benchmarking operations."
16684 #: ../fish/guestfish-commands.pod:214
16689 #: ../fish/guestfish-commands.pod:216
16697 #: ../fish/guestfish-commands.pod:218
16698 msgid "Remove C<VAR> from the environment."
16702 #: ../fish/guestfish.pod:5
16703 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16707 #: ../fish/guestfish.pod:9
16710 " guestfish [--options] [commands]\n"
16715 #: ../fish/guestfish.pod:11
16723 #: ../fish/guestfish.pod:13
16726 " guestfish [--ro|--rw] -a disk.img\n"
16731 #: ../fish/guestfish.pod:15
16734 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16739 #: ../fish/guestfish.pod:17
16742 " guestfish -d libvirt-domain\n"
16747 #: ../fish/guestfish.pod:19
16750 " guestfish [--ro|--rw] -a disk.img -i\n"
16755 #: ../fish/guestfish.pod:21
16758 " guestfish -d libvirt-domain -i\n"
16763 #: ../fish/guestfish.pod:25
16765 "Using guestfish in read/write mode on live virtual machines can be "
16766 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16767 "option to use guestfish safely if the disk image or virtual machine might be "
16772 #: ../fish/guestfish.pod:32
16774 "Guestfish is a shell and command-line tool for examining and modifying "
16775 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16776 "functionality of the guestfs API, see L<guestfs(3)>."
16780 #: ../fish/guestfish.pod:36
16782 "Guestfish gives you structured access to the libguestfs API, from shell "
16783 "scripts or the command line or interactively. If you want to rescue a "
16784 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16789 #: ../fish/guestfish.pod:43
16790 msgid "As an interactive shell"
16794 #: ../fish/guestfish.pod:45
16802 #: ../fish/guestfish.pod:47
16805 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16806 " editing virtual machine filesystems.\n"
16811 #: ../fish/guestfish.pod:50
16814 " Type: 'help' for a list of commands\n"
16815 " 'man' to read the manual\n"
16816 " 'quit' to quit the shell\n"
16821 #: ../fish/guestfish.pod:54
16824 " ><fs> add-ro disk.img\n"
16826 " ><fs> list-filesystems\n"
16827 " /dev/sda1: ext4\n"
16828 " /dev/vg_guest/lv_root: ext4\n"
16829 " /dev/vg_guest/lv_swap: swap\n"
16830 " ><fs> mount /dev/vg_guest/lv_root /\n"
16831 " ><fs> cat /etc/fstab\n"
16833 " # Created by anaconda\n"
16840 #: ../fish/guestfish.pod:67
16841 msgid "From shell scripts"
16845 #: ../fish/guestfish.pod:69
16846 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16850 #: ../fish/guestfish.pod:71
16853 " guestfish <<_EOF_\n"
16856 " mount /dev/vg_guest/lv_root /\n"
16857 " write /etc/motd \"Welcome, new users\"\n"
16863 #: ../fish/guestfish.pod:78
16864 msgid "List the LVM logical volumes in a disk image:"
16868 #: ../fish/guestfish.pod:80
16871 " guestfish -a disk.img --ro <<_EOF_\n"
16879 #: ../fish/guestfish.pod:85
16880 msgid "List all the filesystems in a disk image:"
16884 #: ../fish/guestfish.pod:87
16887 " guestfish -a disk.img --ro <<_EOF_\n"
16889 " list-filesystems\n"
16895 #: ../fish/guestfish.pod:92
16896 msgid "On one command line"
16900 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
16901 msgid "Update C</etc/resolv.conf> in a guest:"
16905 #: ../fish/guestfish.pod:96
16909 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16910 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16915 #: ../fish/guestfish.pod:100
16916 msgid "Edit C</boot/grub/grub.conf> interactively:"
16920 #: ../fish/guestfish.pod:102
16923 " guestfish --rw --add disk.img \\\n"
16924 " --mount /dev/vg_guest/lv_root \\\n"
16925 " --mount /dev/sda1:/boot \\\n"
16926 " edit /boot/grub/grub.conf\n"
16931 #: ../fish/guestfish.pod:107
16932 msgid "Mount disks automatically"
16936 #: ../fish/guestfish.pod:109
16938 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16942 #: ../fish/guestfish.pod:112
16945 " guestfish --ro -a disk.img -i cat /etc/group\n"
16950 #: ../fish/guestfish.pod:114
16953 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16958 #: ../fish/guestfish.pod:116
16959 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16963 #: ../fish/guestfish.pod:118
16966 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16971 #: ../fish/guestfish.pod:120
16972 msgid "As a script interpreter"
16976 #: ../fish/guestfish.pod:122
16977 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16981 #: ../fish/guestfish.pod:124
16984 " #!/usr/bin/guestfish -f\n"
16985 " sparse test1.img 100M\n"
16987 " part-disk /dev/sda mbr\n"
16988 " mkfs ext2 /dev/sda1\n"
16993 #: ../fish/guestfish.pod:130
16994 msgid "Start with a prepared disk"
16998 #: ../fish/guestfish.pod:132
17000 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17001 "single ext2-formatted partition:"
17005 #: ../fish/guestfish.pod:135
17008 " guestfish -N fs\n"
17013 #: ../fish/guestfish.pod:137
17014 msgid "To list what is available do:"
17018 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
17021 " guestfish -N help | less\n"
17026 #: ../fish/guestfish.pod:141
17027 msgid "Remote control"
17031 #: ../fish/guestfish.pod:143
17034 " eval \"`guestfish --listen`\"\n"
17035 " guestfish --remote add-ro disk.img\n"
17036 " guestfish --remote run\n"
17037 " guestfish --remote lvs\n"
17042 #: ../fish/guestfish.pod:154
17043 msgid "Displays general help on options."
17047 #: ../fish/guestfish.pod:158
17048 msgid "B<--cmd-help>"
17052 #: ../fish/guestfish.pod:160
17053 msgid "Lists all available guestfish commands."
17057 #: ../fish/guestfish.pod:162
17062 #: ../fish/guestfish.pod:164
17063 msgid "B<--cmd-help cmd>"
17067 #: ../fish/guestfish.pod:166
17068 msgid "Displays detailed help on a single command C<cmd>."
17072 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
17073 msgid "B<-a image>"
17077 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
17078 msgid "B<--add image>"
17082 #: ../fish/guestfish.pod:172
17083 msgid "Add a block device or virtual machine image to the shell."
17087 #: ../fish/guestfish.pod:177
17089 "Using this flag is mostly equivalent to using the C<add> command, with "
17090 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17091 "the I<--format=...> flag was given."
17095 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
17097 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17098 "URI to use. The default is to use the default libvirt connection."
17102 #: ../fish/guestfish.pod:189
17107 #: ../fish/guestfish.pod:191
17109 "If using the I<--listen> option and a csh-like shell, use this option. See "
17110 "section L</REMOTE CONTROL AND CSH> below."
17114 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
17115 msgid "B<-d libvirt-domain>"
17119 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
17120 msgid "B<--domain libvirt-domain>"
17124 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
17126 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17127 "used, then any libvirt domain can be used. However in write mode, only "
17128 "libvirt domains which are shut down can be named here."
17132 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
17133 msgid "Domain UUIDs can be used instead of names."
17137 #: ../fish/guestfish.pod:204
17139 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17140 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17141 "if the I<--format:...> flag was given."
17145 #: ../fish/guestfish.pod:208
17150 #: ../fish/guestfish.pod:210
17151 msgid "B<--no-dest-paths>"
17155 #: ../fish/guestfish.pod:212
17157 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17158 "to hit the tab key to complete paths on the guest filesystem, but this "
17159 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17160 "allow this feature to be disabled."
17164 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
17166 "When prompting for keys and passphrases, guestfish normally turns echoing "
17167 "off so you cannot see what you are typing. If you are not worried about "
17168 "Tempest attacks and there is no one else in the room you can specify this "
17169 "flag to see what you are typing."
17173 #: ../fish/guestfish.pod:224
17178 #: ../fish/guestfish.pod:226
17179 msgid "B<--file file>"
17183 #: ../fish/guestfish.pod:228
17184 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17188 #: ../fish/guestfish.pod:231
17191 " #!/usr/bin/guestfish -f\n"
17196 #: ../fish/guestfish.pod:244
17199 " guestfish --format=raw -a disk.img\n"
17204 #: ../fish/guestfish.pod:248
17207 " guestfish --format=raw -a disk.img --format -a another.img\n"
17212 #: ../fish/guestfish.pod:253
17214 "If you have untrusted raw-format guest disk images, you should use this "
17215 "option to specify the disk format. This avoids a possible security problem "
17216 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17220 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
17221 msgid "B<--inspector>"
17225 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
17227 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17228 "system and mount filesystems as they would be mounted on the real virtual "
17233 #: ../fish/guestfish.pod:266
17234 msgid "Typical usage is either:"
17238 #: ../fish/guestfish.pod:268
17241 " guestfish -d myguest -i\n"
17246 #: ../fish/guestfish.pod:270
17247 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17251 #: ../fish/guestfish.pod:272
17254 " guestfish --ro -d myguest -i\n"
17259 #: ../fish/guestfish.pod:274
17260 msgid "(for active domains, readonly), or specify the block device directly:"
17264 #: ../fish/guestfish.pod:276
17267 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17272 #: ../fish/guestfish.pod:278
17274 "Note that the command line syntax changed slightly over older versions of "
17275 "guestfish. You can still use the old syntax:"
17279 #: ../fish/guestfish.pod:281
17282 " guestfish [--ro] -i disk.img\n"
17287 #: ../fish/guestfish.pod:283
17290 " guestfish [--ro] -i libvirt-domain\n"
17295 #: ../fish/guestfish.pod:285
17297 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17298 "then using other commands to mount the filesystems that were found."
17302 #: ../fish/guestfish.pod:294
17303 msgid "B<--listen>"
17307 #: ../fish/guestfish.pod:296
17309 "Fork into the background and listen for remote commands. See section L</"
17310 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17314 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
17319 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
17321 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
17322 "ATTACHING TO RUNNING DAEMONS>)."
17326 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
17327 msgid "B<-m dev[:mountpoint[:options]]>"
17331 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
17332 msgid "B<--mount dev[:mountpoint[:options]]>"
17336 #: ../fish/guestfish.pod:308
17337 msgid "Mount the named partition or logical volume on the given mountpoint."
17341 #: ../fish/guestfish.pod:310
17342 msgid "If the mountpoint is omitted, it defaults to C</>."
17346 #: ../fish/guestfish.pod:312
17347 msgid "You have to mount something on C</> before most commands will work."
17351 #: ../fish/guestfish.pod:314
17353 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17358 #: ../fish/guestfish.pod:317
17360 "If you don't know what filesystems a disk image contains, you can either run "
17361 "guestfish without this option, then list the partitions, filesystems and LVs "
17362 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17363 "commands), or you can use the L<virt-filesystems(1)> program."
17367 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
17369 "The third (and rarely used) part of the mount parameter is the list of mount "
17370 "options used to mount the underlying filesystem. If this is not given, then "
17371 "the mount options are either the empty string or C<ro> (the latter if the "
17372 "I<--ro> flag is used). By specifying the mount options, you override this "
17373 "default choice. Probably the only time you would use this is to enable ACLs "
17374 "and/or extended attributes if the filesystem can support them:"
17378 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
17381 " -m /dev/sda1:/:acl,user_xattr\n"
17386 #: ../fish/guestfish.pod:333
17387 msgid "Using this flag is equivalent to using the C<mount-options> command."
17391 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193
17392 #: ../resize/virt-resize.pod:358
17397 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
17398 msgid "B<--no-sync>"
17402 #: ../fish/guestfish.pod:339
17404 "Disable autosync. This is enabled by default. See the discussion of "
17405 "autosync in the L<guestfs(3)> manpage."
17409 #: ../fish/guestfish.pod:342
17414 #: ../fish/guestfish.pod:344
17415 msgid "B<--new type>"
17419 #: ../fish/guestfish.pod:346
17424 #: ../fish/guestfish.pod:348
17426 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17427 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17428 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17433 #: ../fish/guestfish.pod:353
17434 msgid "B<--progress-bars>"
17438 #: ../fish/guestfish.pod:355
17439 msgid "Enable progress bars, even when guestfish is used non-interactively."
17443 #: ../fish/guestfish.pod:357
17445 "Progress bars are enabled by default when guestfish is used as an "
17446 "interactive shell."
17450 #: ../fish/guestfish.pod:360
17451 msgid "B<--no-progress-bars>"
17455 #: ../fish/guestfish.pod:362
17456 msgid "Disable progress bars."
17460 #: ../fish/guestfish.pod:364
17461 msgid "B<--remote[=pid]>"
17465 #: ../fish/guestfish.pod:366
17467 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17468 "CONTROL GUESTFISH OVER A SOCKET> below."
17472 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239
17473 #: ../rescue/virt-rescue.pod:161
17478 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
17479 #: ../rescue/virt-rescue.pod:163
17484 #: ../fish/guestfish.pod:373
17486 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17487 "mounts are done read-only."
17491 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17493 "The option must always be used if the disk image or virtual machine might be "
17494 "running, and is generally recommended in cases where you don't need write "
17495 "access to the disk."
17499 #: ../fish/guestfish.pod:380
17501 "Note that prepared disk images created with I<-N> are not affected by this "
17502 "option. Also commands like C<add> are not affected - you have to specify "
17503 "the C<readonly:true> option explicitly if you need it."
17507 #: ../fish/guestfish.pod:384
17508 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17512 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253
17513 #: ../rescue/virt-rescue.pod:173
17514 msgid "B<--selinux>"
17518 #: ../fish/guestfish.pod:388
17519 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17523 #: ../fish/guestfish.pod:394
17525 "Enable very verbose messages. This is particularly useful if you find a bug."
17529 #: ../fish/guestfish.pod:401
17530 msgid "Display the guestfish / libguestfs version number and exit."
17534 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269
17535 #: ../rescue/virt-rescue.pod:194
17540 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
17541 #: ../rescue/virt-rescue.pod:196
17546 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
17548 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17549 "mounts are done read-write."
17553 #: ../fish/guestfish.pod:410
17554 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
17558 #: ../fish/guestfish.pod:414
17559 msgid "Echo each command before executing it."
17563 #: ../fish/guestfish.pod:418
17564 msgid "COMMANDS ON COMMAND LINE"
17568 #: ../fish/guestfish.pod:420
17570 "Any additional (non-option) arguments are treated as commands to execute."
17574 #: ../fish/guestfish.pod:423
17576 "Commands to execute should be separated by a colon (C<:>), where the colon "
17577 "is a separate parameter. Thus:"
17581 #: ../fish/guestfish.pod:426
17584 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17589 #: ../fish/guestfish.pod:428
17591 "If there are no additional arguments, then we enter a shell, either an "
17592 "interactive shell with a prompt (if the input is a terminal) or a non-"
17593 "interactive shell."
17597 #: ../fish/guestfish.pod:432
17599 "In either command line mode or non-interactive shell, the first command that "
17600 "gives an error causes the whole shell to exit. In interactive mode (with a "
17601 "prompt) if a command fails, you can continue to enter commands."
17605 #: ../fish/guestfish.pod:437
17606 msgid "USING launch (OR run)"
17610 #: ../fish/guestfish.pod:439
17612 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17613 "then launch it, then mount any disks you need, and finally issue actions/"
17614 "commands. So the general order of the day is:"
17618 #: ../fish/guestfish.pod:447
17619 msgid "add or -a/--add"
17623 #: ../fish/guestfish.pod:451
17624 msgid "launch (aka run)"
17628 #: ../fish/guestfish.pod:455
17629 msgid "mount or -m/--mount"
17633 #: ../fish/guestfish.pod:459
17634 msgid "any other commands"
17638 #: ../fish/guestfish.pod:463
17640 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17641 "guest before mounting or performing any other commands."
17645 #: ../fish/guestfish.pod:466
17647 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17648 "I<--new> options were given then C<run> is done automatically, simply "
17649 "because guestfish can't perform the action you asked for without doing this."
17653 #: ../fish/guestfish.pod:471
17654 msgid "OPENING DISKS FOR READ AND WRITE"
17658 #: ../fish/guestfish.pod:473
17660 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
17661 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
17662 "I<-i> and I<-m> open disk images read-only or for writing."
17666 #: ../fish/guestfish.pod:478
17668 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
17669 "opening disk images supplied on the command line for write. To open a disk "
17670 "image read-only you have to do I<-a image --ro>."
17674 #: ../fish/guestfish.pod:482
17676 "This matters: If you accidentally open a live VM disk image writable then "
17677 "you will cause irreversible disk corruption."
17681 #: ../fish/guestfish.pod:485
17683 "In a future libguestfs we intend to change the default the other way. Disk "
17684 "images will be opened read-only. You will have to either specify "
17685 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
17686 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
17687 "access for disk images specified by those other command line options."
17691 #: ../fish/guestfish.pod:492
17693 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
17694 "which does nothing (it is already the default). However it is highly "
17695 "recommended that you use this option to indicate that you need write access, "
17696 "and prepare your scripts for the day when this option will be required for "
17701 #: ../fish/guestfish.pod:498
17703 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17704 "other libguestfs program apart from guestfish and guestmount."
17708 #: ../fish/guestfish.pod:501
17713 #: ../fish/guestfish.pod:503
17715 "You can quote ordinary parameters using either single or double quotes. For "
17720 #: ../fish/guestfish.pod:506
17723 " add \"file with a space.img\"\n"
17728 #: ../fish/guestfish.pod:508
17731 " rm '/file name'\n"
17736 #: ../fish/guestfish.pod:510
17744 #: ../fish/guestfish.pod:512
17746 "A few commands require a list of strings to be passed. For these, use a "
17747 "whitespace-separated list, enclosed in quotes. Strings containing "
17748 "whitespace to be passed through must be enclosed in single quotes. A "
17749 "literal single quote must be escaped with a backslash."
17753 #: ../fish/guestfish.pod:517
17756 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17757 " command \"/bin/echo 'foo bar'\"\n"
17758 " command \"/bin/echo \\'foo\\'\"\n"
17763 #: ../fish/guestfish.pod:521
17764 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17768 #: ../fish/guestfish.pod:523
17770 "In double-quoted arguments (only) use backslash to insert special characters:"
17774 #: ../fish/guestfish.pod:528
17779 #: ../fish/guestfish.pod:530
17780 msgid "Alert (bell) character."
17784 #: ../fish/guestfish.pod:532
17789 #: ../fish/guestfish.pod:534
17790 msgid "Backspace character."
17794 #: ../fish/guestfish.pod:536
17799 #: ../fish/guestfish.pod:538
17800 msgid "Form feed character."
17804 #: ../fish/guestfish.pod:540
17809 #: ../fish/guestfish.pod:542
17810 msgid "Newline character."
17814 #: ../fish/guestfish.pod:544
17819 #: ../fish/guestfish.pod:546
17820 msgid "Carriage return character."
17824 #: ../fish/guestfish.pod:548
17829 #: ../fish/guestfish.pod:550
17830 msgid "Horizontal tab character."
17834 #: ../fish/guestfish.pod:552
17839 #: ../fish/guestfish.pod:554
17840 msgid "Vertical tab character."
17844 #: ../fish/guestfish.pod:556
17849 #: ../fish/guestfish.pod:558
17850 msgid "A literal double quote character."
17854 #: ../fish/guestfish.pod:560
17859 #: ../fish/guestfish.pod:562
17861 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
17866 #: ../fish/guestfish.pod:565
17871 #: ../fish/guestfish.pod:567
17873 "A character with hex value I<hh>. There must be precisely 2 hex digits."
17877 #: ../fish/guestfish.pod:570
17879 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
17884 #: ../fish/guestfish.pod:573
17889 #: ../fish/guestfish.pod:575
17890 msgid "A literal backslash character."
17894 #: ../fish/guestfish.pod:579
17895 msgid "OPTIONAL ARGUMENTS"
17899 #: ../fish/guestfish.pod:581
17901 "Some commands take optional arguments. These arguments appear in this "
17902 "documentation as C<[argname:..]>. You can use them as in these examples:"
17906 #: ../fish/guestfish.pod:585
17909 " add-drive-opts filename\n"
17914 #: ../fish/guestfish.pod:587
17917 " add-drive-opts filename readonly:true\n"
17922 #: ../fish/guestfish.pod:589
17925 " add-drive-opts filename format:qcow2 readonly:false\n"
17930 #: ../fish/guestfish.pod:591
17932 "Each optional argument can appear at most once. All optional arguments must "
17933 "appear after the required ones."
17937 #: ../fish/guestfish.pod:594
17942 #: ../fish/guestfish.pod:596
17944 "This section applies to all commands which can take integers as parameters."
17948 #: ../fish/guestfish.pod:599
17949 msgid "SIZE SUFFIX"
17953 #: ../fish/guestfish.pod:601
17955 "When the command takes a parameter measured in bytes, you can use one of the "
17956 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17960 #: ../fish/guestfish.pod:607
17961 msgid "B<k> or B<K> or B<KiB>"
17965 #: ../fish/guestfish.pod:609
17966 msgid "The size in kilobytes (multiplied by 1024)."
17970 #: ../fish/guestfish.pod:611
17975 #: ../fish/guestfish.pod:613
17976 msgid "The size in SI 1000 byte units."
17980 #: ../fish/guestfish.pod:615
17981 msgid "B<M> or B<MiB>"
17985 #: ../fish/guestfish.pod:617
17986 msgid "The size in megabytes (multiplied by 1048576)."
17990 #: ../fish/guestfish.pod:619
17995 #: ../fish/guestfish.pod:621
17996 msgid "The size in SI 1000000 byte units."
18000 #: ../fish/guestfish.pod:623
18001 msgid "B<G> or B<GiB>"
18005 #: ../fish/guestfish.pod:625
18006 msgid "The size in gigabytes (multiplied by 2**30)."
18010 #: ../fish/guestfish.pod:627
18015 #: ../fish/guestfish.pod:629
18016 msgid "The size in SI 10**9 byte units."
18020 #: ../fish/guestfish.pod:631
18021 msgid "B<T> or B<TiB>"
18025 #: ../fish/guestfish.pod:633
18026 msgid "The size in terabytes (multiplied by 2**40)."
18030 #: ../fish/guestfish.pod:635
18035 #: ../fish/guestfish.pod:637
18036 msgid "The size in SI 10**12 byte units."
18040 #: ../fish/guestfish.pod:639
18041 msgid "B<P> or B<PiB>"
18045 #: ../fish/guestfish.pod:641
18046 msgid "The size in petabytes (multiplied by 2**50)."
18050 #: ../fish/guestfish.pod:643
18055 #: ../fish/guestfish.pod:645
18056 msgid "The size in SI 10**15 byte units."
18060 #: ../fish/guestfish.pod:647
18061 msgid "B<E> or B<EiB>"
18065 #: ../fish/guestfish.pod:649
18066 msgid "The size in exabytes (multiplied by 2**60)."
18070 #: ../fish/guestfish.pod:651
18075 #: ../fish/guestfish.pod:653
18076 msgid "The size in SI 10**18 byte units."
18080 #: ../fish/guestfish.pod:655
18081 msgid "B<Z> or B<ZiB>"
18085 #: ../fish/guestfish.pod:657
18086 msgid "The size in zettabytes (multiplied by 2**70)."
18090 #: ../fish/guestfish.pod:659
18095 #: ../fish/guestfish.pod:661
18096 msgid "The size in SI 10**21 byte units."
18100 #: ../fish/guestfish.pod:663
18101 msgid "B<Y> or B<YiB>"
18105 #: ../fish/guestfish.pod:665
18106 msgid "The size in yottabytes (multiplied by 2**80)."
18110 #: ../fish/guestfish.pod:667
18115 #: ../fish/guestfish.pod:669
18116 msgid "The size in SI 10**24 byte units."
18120 #: ../fish/guestfish.pod:675
18123 " truncate-size /file 1G\n"
18128 #: ../fish/guestfish.pod:677
18129 msgid "would truncate the file to 1 gigabyte."
18133 #: ../fish/guestfish.pod:679
18135 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18136 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18137 "suffix will probably not do what you expect."
18141 #: ../fish/guestfish.pod:683
18142 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18146 #: ../fish/guestfish.pod:685
18148 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18149 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18153 #: ../fish/guestfish.pod:688
18156 " 1234 decimal number 1234\n"
18157 " 02322 octal number, equivalent to decimal 1234\n"
18158 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18163 #: ../fish/guestfish.pod:692
18165 "When using the C<chmod> command, you almost always want to specify an octal "
18166 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18167 "L<chmod(1)> program):"
18171 #: ../fish/guestfish.pod:696
18174 " chmod 0777 /public # OK\n"
18175 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18180 #: ../fish/guestfish.pod:699
18182 "Commands that return numbers usually print them in decimal, but some "
18183 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18184 "octal, preceeded by C<0>)."
18188 #: ../fish/guestfish.pod:703
18189 msgid "WILDCARDS AND GLOBBING"
18193 #: ../fish/guestfish.pod:705
18195 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18196 "(globbing) by default. So for example the following will not do what you "
18201 #: ../fish/guestfish.pod:709
18209 #: ../fish/guestfish.pod:711
18211 "Assuming you don't have a directory called literally C</home/*> then the "
18212 "above command will return an error."
18216 #: ../fish/guestfish.pod:714
18217 msgid "To perform wildcard expansion, use the C<glob> command."
18221 #: ../fish/guestfish.pod:716
18224 " glob rm-rf /home/*\n"
18229 #: ../fish/guestfish.pod:718
18231 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18232 "many times), equivalent to:"
18236 #: ../fish/guestfish.pod:721
18239 " rm-rf /home/jim\n"
18240 " rm-rf /home/joe\n"
18241 " rm-rf /home/mary\n"
18246 #: ../fish/guestfish.pod:725
18247 msgid "C<glob> only works on simple guest paths and not on device names."
18251 #: ../fish/guestfish.pod:727
18253 "If you have several parameters, each containing a wildcard, then glob will "
18254 "perform a Cartesian product."
18258 #: ../fish/guestfish.pod:730
18263 #: ../fish/guestfish.pod:732
18265 "Any line which starts with a I<#> character is treated as a comment and "
18266 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18267 "a command. For example:"
18271 #: ../fish/guestfish.pod:736
18274 " # this is a comment\n"
18275 " # this is a comment\n"
18276 " foo # NOT a comment\n"
18281 #: ../fish/guestfish.pod:740
18282 msgid "Blank lines are also ignored."
18286 #: ../fish/guestfish.pod:742
18287 msgid "RUNNING COMMANDS LOCALLY"
18291 #: ../fish/guestfish.pod:744
18293 "Any line which starts with a I<!> character is treated as a command sent to "
18294 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18298 #: ../fish/guestfish.pod:748
18302 " tgz-out /remote local/remote-data.tar.gz\n"
18307 #: ../fish/guestfish.pod:751
18309 "will create a directory C<local> on the host, and then export the contents "
18310 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18311 "(See C<tgz-out>)."
18315 #: ../fish/guestfish.pod:755
18317 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18318 "effect, due to the way that subprocesses work in Unix."
18322 #: ../fish/guestfish.pod:758
18323 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18327 #: ../fish/guestfish.pod:760
18329 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18330 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18331 "and executed as guestfish commands."
18335 #: ../fish/guestfish.pod:764
18337 "Thus you can use shell script to construct arbitrary guestfish commands "
18338 "which are then parsed by guestfish."
18342 #: ../fish/guestfish.pod:767
18344 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18345 "through C</foo.100>) using guestfish commands alone. However this is simple "
18346 "if we use a shell script to create the guestfish commands for us:"
18350 #: ../fish/guestfish.pod:772
18353 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18358 #: ../fish/guestfish.pod:774
18359 msgid "or with names like C</foo.001>:"
18363 #: ../fish/guestfish.pod:776
18366 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18371 #: ../fish/guestfish.pod:778
18373 "When using guestfish interactively it can be helpful to just run the shell "
18374 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18375 "ordinary I<!> local command), see what guestfish commands it would run, and "
18376 "when you are happy with those prepend the C<E<lt>> character to run the "
18377 "guestfish commands for real."
18381 #: ../fish/guestfish.pod:784
18386 #: ../fish/guestfish.pod:786
18388 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18389 "command (a guestfish command) to the second command (any host command). For "
18394 #: ../fish/guestfish.pod:790
18397 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18402 #: ../fish/guestfish.pod:792
18404 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18405 "program). The above command would list all accounts in the guest filesystem "
18406 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18410 #: ../fish/guestfish.pod:797
18413 " hexdump /bin/ls | head\n"
18414 " list-devices | tail -1\n"
18415 " tgz-out / - | tar ztf -\n"
18420 #: ../fish/guestfish.pod:801
18422 "The space before the pipe symbol is required, any space after the pipe "
18423 "symbol is optional. Everything after the pipe symbol is just passed "
18424 "straight to the host shell, so it can contain redirections, globs and "
18425 "anything else that makes sense on the host side."
18429 #: ../fish/guestfish.pod:806
18431 "To use a literal argument which begins with a pipe symbol, you have to quote "
18436 #: ../fish/guestfish.pod:809
18444 #: ../fish/guestfish.pod:811
18445 msgid "HOME DIRECTORIES"
18449 #: ../fish/guestfish.pod:813
18451 "If a parameter starts with the character C<~> then the tilde may be expanded "
18452 "as a home directory path (either C<~> for the current user's home directory, "
18453 "or C<~user> for another user)."
18457 #: ../fish/guestfish.pod:817
18459 "Note that home directory expansion happens for users known I<on the host>, "
18460 "not in the guest filesystem."
18464 #: ../fish/guestfish.pod:820
18466 "To use a literal argument which begins with a tilde, you have to quote it, "
18471 #: ../fish/guestfish.pod:823
18479 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18480 msgid "ENCRYPTED DISKS"
18484 #: ../fish/guestfish.pod:827
18486 "Libguestfs has some support for Linux guests encrypted according to the "
18487 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18488 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18489 "LUKS is supported."
18493 #: ../fish/guestfish.pod:832
18494 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18498 #: ../fish/guestfish.pod:834
18501 " ><fs> vfs-type /dev/sda2\n"
18507 #: ../fish/guestfish.pod:837
18509 "Then open those devices using L</luks-open>. This creates a device-mapper "
18510 "device called C</dev/mapper/luksdev>."
18514 #: ../fish/guestfish.pod:840
18517 " ><fs> luks-open /dev/sda2 luksdev\n"
18518 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18523 #: ../fish/guestfish.pod:843
18525 "Finally you have to tell LVM to scan for volume groups on the newly created "
18530 #: ../fish/guestfish.pod:846
18534 " vg-activate-all true\n"
18539 #: ../fish/guestfish.pod:849
18540 msgid "The logical volume(s) can now be mounted in the usual way."
18544 #: ../fish/guestfish.pod:851
18546 "Before closing a LUKS device you must unmount any logical volumes on it and "
18547 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18548 "one. Then you can close the mapper device:"
18552 #: ../fish/guestfish.pod:855
18555 " vg-activate false /dev/VG\n"
18556 " luks-close /dev/mapper/luksdev\n"
18561 #: ../fish/guestfish.pod:860
18563 "If a path is prefixed with C<win:> then you can use Windows-style drive "
18564 "letters and paths (with some limitations). The following commands are "
18569 #: ../fish/guestfish.pod:864
18572 " file /WINDOWS/system32/config/system.LOG\n"
18577 #: ../fish/guestfish.pod:866
18580 " file win:\\windows\\system32\\config\\system.log\n"
18585 #: ../fish/guestfish.pod:868
18588 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
18593 #: ../fish/guestfish.pod:870
18595 "The parameter is rewritten \"behind the scenes\" by looking up the position "
18596 "where the drive is mounted, prepending that to the path, changing all "
18597 "backslash characters to forward slash, then resolving the result using L</"
18598 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
18599 "the parameter might be rewritten like this:"
18603 #: ../fish/guestfish.pod:876
18606 " win:e:\\foo\\bar => /e/FOO/bar\n"
18611 #: ../fish/guestfish.pod:878
18612 msgid "This only works in argument positions that expect a path."
18616 #: ../fish/guestfish.pod:880
18617 msgid "UPLOADING AND DOWNLOADING FILES"
18621 #: ../fish/guestfish.pod:882
18623 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18624 "others which upload from or download to a local file, you can use the "
18625 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18629 #: ../fish/guestfish.pod:886
18637 #: ../fish/guestfish.pod:888
18639 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18643 #: ../fish/guestfish.pod:891
18646 " tar-out /etc - | tar tf -\n"
18651 #: ../fish/guestfish.pod:893
18653 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18654 "command (see L</PIPES>)."
18658 #: ../fish/guestfish.pod:896
18660 "When using C<-> to read from stdin, the input is read up to the end of "
18661 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18662 "some arbitrary end marker:"
18666 #: ../fish/guestfish.pod:900
18669 " upload -<<END /foo\n"
18678 #: ../fish/guestfish.pod:906
18680 "Any string of characters can be used instead of C<END>. The end marker must "
18681 "appear on a line of its own, without any preceeding or following characters "
18682 "(not even spaces)."
18686 #: ../fish/guestfish.pod:910
18688 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18689 "upload local files (so-called \"FileIn\" parameters in the generator)."
18693 #: ../fish/guestfish.pod:913
18694 msgid "EXIT ON ERROR BEHAVIOUR"
18698 #: ../fish/guestfish.pod:915
18700 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18701 "taking commands from a human over a tty), and will exit on the first error "
18702 "in non-interactive mode (scripts, commands given on the command line)."
18706 #: ../fish/guestfish.pod:920
18708 "If you prefix a command with a I<-> character, then that command will not "
18709 "cause guestfish to exit, even if that (one) command returns an error."
18713 #: ../fish/guestfish.pod:924
18714 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18718 #: ../fish/guestfish.pod:926
18720 "Guestfish can be remote-controlled over a socket. This is useful "
18721 "particularly in shell scripts where you want to make several different "
18722 "changes to a filesystem, but you don't want the overhead of starting up a "
18723 "guestfish process each time."
18727 #: ../fish/guestfish.pod:931
18728 msgid "Start a guestfish server process using:"
18732 #: ../fish/guestfish.pod:933
18735 " eval \"`guestfish --listen`\"\n"
18740 #: ../fish/guestfish.pod:935
18741 msgid "and then send it commands by doing:"
18745 #: ../fish/guestfish.pod:937
18748 " guestfish --remote cmd [...]\n"
18753 #: ../fish/guestfish.pod:939
18754 msgid "To cause the server to exit, send it the exit command:"
18758 #: ../fish/guestfish.pod:943
18760 "Note that the server will normally exit if there is an error in a command. "
18761 "You can change this in the usual way. See section L</EXIT ON ERROR "
18766 #: ../fish/guestfish.pod:947
18767 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18771 #: ../fish/guestfish.pod:949
18773 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18774 "is how the I<--remote> option knows where to send the commands. You can "
18775 "have several guestfish listener processes running using:"
18779 #: ../fish/guestfish.pod:953
18782 " eval \"`guestfish --listen`\"\n"
18783 " pid1=$GUESTFISH_PID\n"
18784 " eval \"`guestfish --listen`\"\n"
18785 " pid2=$GUESTFISH_PID\n"
18787 " guestfish --remote=$pid1 cmd\n"
18788 " guestfish --remote=$pid2 cmd\n"
18793 #: ../fish/guestfish.pod:961
18794 msgid "REMOTE CONTROL AND CSH"
18798 #: ../fish/guestfish.pod:963
18800 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18805 #: ../fish/guestfish.pod:966
18808 " eval \"`guestfish --listen --csh`\"\n"
18813 #: ../fish/guestfish.pod:968
18814 msgid "REMOTE CONTROL DETAILS"
18818 #: ../fish/guestfish.pod:970
18820 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18821 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18822 "and C<$PID> is the process ID of the server."
18826 #: ../fish/guestfish.pod:974
18827 msgid "Guestfish client and server versions must match exactly."
18831 #: ../fish/guestfish.pod:976
18832 msgid "REMOTE CONTROL RUN COMMAND HANGING"
18836 #: ../fish/guestfish.pod:978
18838 "Using the C<run> (or C<launch>) command remotely in a command substitution "
18839 "context hangs, ie. don't do (note the backquotes):"
18843 #: ../fish/guestfish.pod:981
18846 " a=`guestfish --remote run`\n"
18851 #: ../fish/guestfish.pod:983
18853 "Since the C<run> command produces no output on stdout, this is not useful "
18854 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
18859 #: ../fish/guestfish.pod:987
18860 msgid "PREPARED DISK IMAGES"
18864 #: ../fish/guestfish.pod:989
18866 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18867 "preformatted disk images that guestfish can make for you to save typing. "
18868 "This is particularly useful for testing purposes. This option is used "
18869 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18870 "can be mixed with I<-a>)."
18874 #: ../fish/guestfish.pod:995
18876 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18877 "the second and so on. Existing files in the current directory are "
18882 #: ../fish/guestfish.pod:999
18884 "The type briefly describes how the disk should be sized, partitioned, how "
18885 "filesystem(s) should be created, and how content should be added. "
18886 "Optionally the type can be followed by extra parameters, separated by C<:> "
18887 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18888 "allocated disk, containing a single partition, with the partition formatted "
18889 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18894 #: ../fish/guestfish.pod:1007
18895 msgid "To list the available types and any extra parameters they take, run:"
18899 #: ../fish/guestfish.pod:1011
18901 "Note that the prepared filesystem is not mounted. You would usually have to "
18902 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18906 #: ../fish/guestfish.pod:1015
18908 "If any I<-N> or I<--new> options are given, the guest is automatically "
18913 #: ../fish/guestfish.pod:1020
18914 msgid "Create a 100MB disk with an ext4-formatted partition:"
18918 #: ../fish/guestfish.pod:1022
18921 " guestfish -N fs:ext4\n"
18926 #: ../fish/guestfish.pod:1024
18927 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18931 #: ../fish/guestfish.pod:1026
18934 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18939 #: ../fish/guestfish.pod:1028
18940 msgid "Create a blank 200MB disk:"
18944 #: ../fish/guestfish.pod:1030
18947 " guestfish -N disk:200M\n"
18952 #: ../fish/guestfish.pod:1032
18953 msgid "PROGRESS BARS"
18957 #: ../fish/guestfish.pod:1034
18959 "Some (not all) long-running commands send progress notification messages as "
18960 "they are running. Guestfish turns these messages into progress bars."
18964 #: ../fish/guestfish.pod:1038
18966 "When a command that supports progress bars takes longer than two seconds to "
18967 "run, and if progress bars are enabled, then you will see one appearing below "
18972 #: ../fish/guestfish.pod:1042
18975 " ><fs> copy-size /large-file /another-file 2048M\n"
18976 " / 10% [#####-----------------------------------------] 00:30\n"
18981 #: ../fish/guestfish.pod:1045
18983 "The spinner on the left hand side moves round once for every progress "
18984 "notification received from the backend. This is a (reasonably) golden "
18985 "assurance that the command is \"doing something\" even if the progress bar "
18986 "is not moving, because the command is able to send the progress "
18987 "notifications. When the bar reaches 100% and the command finishes, the "
18988 "spinner disappears."
18992 #: ../fish/guestfish.pod:1052
18994 "Progress bars are enabled by default when guestfish is used interactively. "
18995 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18996 "and you can disable them completely using I<--no-progress-bars>."
19000 #: ../fish/guestfish.pod:1057
19001 msgid "GUESTFISH COMMANDS"
19005 #: ../fish/guestfish.pod:1059
19007 "The commands in this section are guestfish convenience commands, in other "
19008 "words, they are not part of the L<guestfs(3)> API."
19012 #: ../fish/guestfish.pod:1062
19017 #: ../fish/guestfish.pod:1064
19026 #: ../fish/guestfish.pod:1067
19027 msgid "Without any parameter, this provides general help."
19031 #: ../fish/guestfish.pod:1069
19032 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19036 #: ../fish/guestfish.pod:1071
19037 msgid "quit | exit"
19041 #: ../fish/guestfish.pod:1073
19042 msgid "This exits guestfish. You can also use C<^D> key."
19046 #: ../fish/guestfish.pod:1075
19047 msgid "@FISH_COMMANDS@"
19051 #: ../fish/guestfish.pod:1077
19056 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1505
19061 #: ../fish/guestfish.pod:1083
19063 "guestfish returns 0 if the commands completed without error, or 1 if there "
19068 #: ../fish/guestfish.pod:1090
19073 #: ../fish/guestfish.pod:1092
19075 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19080 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3122
19081 msgid "FEBOOTSTRAP_KERNEL"
19085 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3124
19086 msgid "FEBOOTSTRAP_MODULES"
19090 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3126
19092 "These two environment variables allow the kernel that libguestfs uses in the "
19093 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19094 "most recent host kernel is chosen. For more information about kernel "
19095 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19096 "available in febootstrap E<ge> 3.8."
19100 #: ../fish/guestfish.pod:1105
19101 msgid "GUESTFISH_DISPLAY_IMAGE"
19105 #: ../fish/guestfish.pod:1107
19107 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19108 "If not set, it uses L<display(1)>."
19112 #: ../fish/guestfish.pod:1110
19113 msgid "GUESTFISH_PID"
19117 #: ../fish/guestfish.pod:1112
19119 "Used with the I<--remote> option to specify the remote guestfish process to "
19120 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19124 #: ../fish/guestfish.pod:1116
19129 #: ../fish/guestfish.pod:1118
19131 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19132 "not specified, the external L<hexedit(1)> program is used."
19136 #: ../fish/guestfish.pod:1122
19141 #: ../fish/guestfish.pod:1124
19143 "If compiled with GNU readline support, various files in the home directory "
19144 "can be used. See L</FILES>."
19148 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3132
19149 msgid "LIBGUESTFS_APPEND"
19153 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3134
19154 msgid "Pass additional options to the guest kernel."
19158 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3136
19159 msgid "LIBGUESTFS_DEBUG"
19163 #: ../fish/guestfish.pod:1133
19165 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19166 "effect as using the B<-v> option."
19170 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3141
19171 msgid "LIBGUESTFS_MEMSIZE"
19175 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3143
19177 "Set the memory allocated to the qemu process, in megabytes. For example:"
19181 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3146
19184 " LIBGUESTFS_MEMSIZE=700\n"
19189 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3148
19190 msgid "LIBGUESTFS_PATH"
19194 #: ../fish/guestfish.pod:1145
19196 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19197 "the discussion of paths in L<guestfs(3)>."
19201 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3153
19202 msgid "LIBGUESTFS_QEMU"
19206 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3155
19208 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19209 "which was found at compile time by the configure script is used."
19213 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3161
19214 msgid "LIBGUESTFS_TRACE"
19218 #: ../fish/guestfish.pod:1156
19219 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19223 #: ../fish/guestfish.pod:1158
19228 #: ../fish/guestfish.pod:1160
19230 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19235 #: ../fish/guestfish.pod:1163 ../sparsify/virt-sparsify.pod:236
19236 #: ../src/guestfs.pod:3166
19241 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3168
19243 "Location of temporary directory, defaults to C</tmp> except for the cached "
19244 "supermin appliance which defaults to C</var/tmp>."
19248 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3171
19250 "If libguestfs was compiled to use the supermin appliance then the real "
19251 "appliance is cached in this directory, shared between all handles belonging "
19252 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19253 "use in case C</var/tmp> is not large enough."
19257 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288
19258 #: ../rescue/virt-rescue.pod:273
19263 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292
19264 #: ../rescue/virt-rescue.pod:277
19265 msgid "$HOME/.libguestfs-tools.rc"
19269 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294
19270 #: ../rescue/virt-rescue.pod:279
19271 msgid "/etc/libguestfs-tools.conf"
19275 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296
19276 #: ../rescue/virt-rescue.pod:281
19278 "This configuration file controls the default read-only or read-write mode "
19279 "(I<--ro> or I<--rw>)."
19283 #: ../fish/guestfish.pod:1187
19284 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19288 #: ../fish/guestfish.pod:1189
19289 msgid "$HOME/.guestfish"
19293 #: ../fish/guestfish.pod:1191
19295 "If compiled with GNU readline support, then the command history is saved in "
19300 #: ../fish/guestfish.pod:1194
19301 msgid "$HOME/.inputrc"
19305 #: ../fish/guestfish.pod:1196
19306 msgid "/etc/inputrc"
19310 #: ../fish/guestfish.pod:1198
19312 "If compiled with GNU readline support, then these files can be used to "
19313 "configure readline. For further information, please see L<readline(3)/"
19314 "INITIALIZATION FILE>."
19318 #: ../fish/guestfish.pod:1202
19319 msgid "To write rules which only apply to guestfish, use:"
19323 #: ../fish/guestfish.pod:1204
19333 #: ../fish/guestfish.pod:1208
19335 "Variables that you can set in inputrc that change the behaviour of guestfish "
19336 "in useful ways include:"
19340 #: ../fish/guestfish.pod:1213
19341 msgid "completion-ignore-case (default: on)"
19345 #: ../fish/guestfish.pod:1215
19347 "By default, guestfish will ignore case when tab-completing paths on the "
19352 #: ../fish/guestfish.pod:1218
19355 " set completion-ignore-case off\n"
19360 #: ../fish/guestfish.pod:1220
19361 msgid "to make guestfish case sensitive."
19365 #: ../fish/guestfish.pod:1224
19370 #: ../fish/guestfish.pod:1226
19371 msgid "test2.img (etc)"
19375 #: ../fish/guestfish.pod:1228
19377 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19378 "will be created in the file C<test1.img> in the current directory. The "
19379 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19380 "the same name will be overwritten."
19384 #: ../fish/guestfish.pod:1237
19386 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, L<virt-"
19387 "cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit"
19388 "(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems"
19389 "(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
19390 "rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-tar(1)>, L<virt-"
19391 "tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit"
19392 "(1)>, L<febootstrap-supermin-helper(8)>."
19396 #: ../fish/guestfish.pod:1268 ../src/guestfs.pod:3261
19397 #: ../test-tool/libguestfs-test-tool.pod:112
19398 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19402 #: ../fish/virt-copy-in.pod:5
19404 "virt-copy-in - Copy files and directories into a virtual machine disk image."
19408 #: ../fish/virt-copy-in.pod:9
19411 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19416 #: ../fish/virt-copy-in.pod:11
19419 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19424 #: ../fish/virt-copy-in.pod:15
19426 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19427 "causing disk corruption. The virtual machine must be shut down before you "
19428 "use this command."
19432 #: ../fish/virt-copy-in.pod:21
19434 "C<virt-copy-in> copies files and directories from the local disk into a "
19435 "virtual machine disk image or named libvirt domain."
19439 #: ../fish/virt-copy-in.pod:24
19441 "You can give one of more filenames and directories on the command line. "
19442 "Directories are copied in recursively. The final parameter must be the "
19443 "destination directory in the disk image which must be an absolute path "
19444 "starting with a C</> character."
19448 #: ../fish/virt-copy-in.pod:33
19451 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19456 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19457 msgid "Upload a home directory to a guest:"
19461 #: ../fish/virt-copy-in.pod:37
19464 " virt-copy-in -d MyGuest skel /home\n"
19469 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
19470 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19471 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19475 #: ../fish/virt-copy-in.pod:41
19477 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19478 "> C<copy-in> command. For anything more complex than a trivial copy, you "
19479 "are probably better off using guestfish directly."
19483 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
19484 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19486 "Since the shell script just passes options straight to guestfish, read "
19487 "L<guestfish(1)> to see the full list of options."
19491 #: ../fish/virt-copy-in.pod:52
19493 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
19494 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19498 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
19499 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
19500 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19504 #: ../fish/virt-copy-out.pod:5
19506 "virt-copy-out - Copy files and directories out of a virtual machine disk "
19511 #: ../fish/virt-copy-out.pod:9
19514 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
19519 #: ../fish/virt-copy-out.pod:11
19522 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
19527 #: ../fish/virt-copy-out.pod:15
19529 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
19530 "image or named libvirt domain."
19534 #: ../fish/virt-copy-out.pod:18
19536 "You can give one of more filenames and directories on the command line. "
19537 "Directories are copied out recursively."
19541 #: ../fish/virt-copy-out.pod:23
19542 msgid "Download the home directories from a virtual machine:"
19546 #: ../fish/virt-copy-out.pod:25
19550 " virt-copy-out -d MyGuest /home homes\n"
19555 #: ../fish/virt-copy-out.pod:30
19557 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19558 "> C<copy-out> command. For anything more complex than a trivial copy, you "
19559 "are probably better off using guestfish directly."
19563 #: ../fish/virt-copy-out.pod:41
19565 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
19566 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19570 #: ../fish/virt-tar-in.pod:5
19571 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
19575 #: ../fish/virt-tar-in.pod:9
19578 " virt-tar-in -a disk.img data.tar /destination\n"
19583 #: ../fish/virt-tar-in.pod:11
19586 " virt-tar-in -d domain data.tar /destination\n"
19591 #: ../fish/virt-tar-in.pod:13
19594 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
19599 #: ../fish/virt-tar-in.pod:17
19601 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
19602 "causing disk corruption. The virtual machine must be shut down before you "
19603 "use this command."
19607 #: ../fish/virt-tar-in.pod:23
19609 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
19610 "image or named libvirt domain."
19614 #: ../fish/virt-tar-in.pod:26
19616 "The first parameter is the tar file. Use C<-> to read the tar file from "
19617 "standard input. The second parameter is the absolute target directory to "
19622 #: ../fish/virt-tar-in.pod:34
19625 " virt-tar-in -d MyGuest homes.tar /home\n"
19630 #: ../fish/virt-tar-in.pod:38
19632 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19633 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
19634 "probably better off using guestfish directly."
19638 #: ../fish/virt-tar-in.pod:49
19640 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19641 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
19646 #: ../fish/virt-tar-out.pod:5
19648 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
19652 #: ../fish/virt-tar-out.pod:9
19655 " virt-tar-out -a disk.img /dir files.tar\n"
19660 #: ../fish/virt-tar-out.pod:11
19663 " virt-tar-out -d domain /dir files.tar\n"
19668 #: ../fish/virt-tar-out.pod:13
19671 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
19676 #: ../fish/virt-tar-out.pod:17
19678 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
19682 #: ../fish/virt-tar-out.pod:20
19684 "The first parameter is the absolute path of the virtual machine directory. "
19685 "The second parameter is the tar file to write. Use C<-> to write to "
19690 #: ../fish/virt-tar-out.pod:26
19691 msgid "Download the home directories from a guest:"
19695 #: ../fish/virt-tar-out.pod:28
19698 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
19703 #: ../fish/virt-tar-out.pod:32
19705 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19706 "> C<tar-out> command. For anything more complex than a trivial copy, you "
19707 "are probably better off using guestfish directly."
19711 #: ../fish/virt-tar-out.pod:43
19713 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19714 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19718 #: ../fuse/guestmount.pod:5
19720 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19724 #: ../fuse/guestmount.pod:9
19727 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19732 #: ../fuse/guestmount.pod:11
19735 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19740 #: ../fuse/guestmount.pod:13
19743 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19748 #: ../fuse/guestmount.pod:17
19750 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19751 "machines. If you do this, you risk disk corruption in the VM."
19755 #: ../fuse/guestmount.pod:22
19757 "The guestmount program can be used to mount virtual machine filesystems and "
19758 "other disk images on the host. It uses libguestfs for access to the guest "
19759 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19760 "a mountable device."
19764 #: ../fuse/guestmount.pod:27
19766 "Along with other options, you have to give at least one device (I<-a> "
19767 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19768 "option) or use the I<-i> inspection option. How this works is better "
19769 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19774 #: ../fuse/guestmount.pod:33
19776 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19777 "by you, and the filesystem will not be visible to any other users unless you "
19778 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19779 "the filesystem, use the C<fusermount -u> command."
19783 #: ../fuse/guestmount.pod:41
19785 "For a typical Windows guest which has its main filesystem on the first "
19790 #: ../fuse/guestmount.pod:44
19793 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19798 #: ../fuse/guestmount.pod:46
19800 "For a typical Linux guest which has a /boot filesystem on the first "
19801 "partition, and the root filesystem on a logical volume:"
19805 #: ../fuse/guestmount.pod:49
19808 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19813 #: ../fuse/guestmount.pod:51
19814 msgid "To get libguestfs to detect guest mountpoints for you:"
19818 #: ../fuse/guestmount.pod:53
19821 " guestmount -a guest.img -i --ro /mnt\n"
19826 #: ../fuse/guestmount.pod:55
19827 msgid "For a libvirt guest called \"Guest\" you could do:"
19831 #: ../fuse/guestmount.pod:57
19834 " guestmount -d Guest -i --ro /mnt\n"
19839 #: ../fuse/guestmount.pod:59
19841 "If you don't know what filesystems are contained in a guest or disk image, "
19842 "use L<virt-filesystems(1)> first:"
19846 #: ../fuse/guestmount.pod:62
19849 " virt-filesystems MyGuest\n"
19854 #: ../fuse/guestmount.pod:64
19856 "If you want to trace the libguestfs calls but without excessive debugging "
19857 "information, we recommend:"
19861 #: ../fuse/guestmount.pod:67
19864 " guestmount [...] --trace /mnt\n"
19869 #: ../fuse/guestmount.pod:69
19870 msgid "If you want to debug the program, we recommend:"
19874 #: ../fuse/guestmount.pod:71
19877 " guestmount [...] --trace --verbose /mnt\n"
19882 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19883 #: ../resize/virt-resize.pod:544
19888 #: ../fuse/guestmount.pod:75
19889 msgid "Other users cannot see the filesystem by default"
19893 #: ../fuse/guestmount.pod:77
19895 "If you mount a filesystem as one user (eg. root), then other users will not "
19896 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19897 "option when mounting:"
19901 #: ../fuse/guestmount.pod:81
19904 " sudo guestmount [...] -o allow_other /mnt\n"
19909 #: ../fuse/guestmount.pod:91
19910 msgid "Add a block device or virtual machine image."
19914 #: ../fuse/guestmount.pod:114
19915 msgid "B<--dir-cache-timeout N>"
19919 #: ../fuse/guestmount.pod:116
19921 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19922 "seconds. The readdir cache [actually, there are several semi-independent "
19923 "caches] is populated after a readdir(2) call with the stat and extended "
19924 "attributes of the files in the directory, in anticipation that they will be "
19925 "requested soon after."
19929 #: ../fuse/guestmount.pod:122
19931 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19932 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19933 "requests, only cache existing ones."
19937 #: ../fuse/guestmount.pod:142
19939 "If you have untrusted raw-format guest disk images, you should use this "
19940 "option to specify the disk format. This avoids a possible security problem "
19941 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19942 "guestfs_add_drive_opts>."
19946 #: ../fuse/guestmount.pod:147
19947 msgid "B<--fuse-help>"
19951 #: ../fuse/guestmount.pod:149
19952 msgid "Display help on special FUSE options (see I<-o> below)."
19956 #: ../fuse/guestmount.pod:153
19957 msgid "Display brief help and exit."
19961 #: ../fuse/guestmount.pod:177
19963 "Mount the named partition or logical volume on the given mountpoint B<in the "
19964 "guest> (this has nothing to do with mountpoints in the host)."
19968 #: ../fuse/guestmount.pod:180
19970 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19971 "something on C</>."
19975 #: ../fuse/guestmount.pod:197
19977 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19978 "unmounted. If you specify this option, then we don't attempt to sync the "
19979 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19983 #: ../fuse/guestmount.pod:202
19984 msgid "B<-o option>"
19988 #: ../fuse/guestmount.pod:204
19989 msgid "B<--option option>"
19993 #: ../fuse/guestmount.pod:206
19994 msgid "Pass extra options to FUSE."
19998 #: ../fuse/guestmount.pod:208
20000 "To get a list of all the extra options supported by FUSE, use the command "
20001 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20002 "of them are a good idea."
20006 #: ../fuse/guestmount.pod:212
20009 " guestmount --fuse-help\n"
20014 #: ../fuse/guestmount.pod:214
20015 msgid "Some potentially useful FUSE options:"
20019 #: ../fuse/guestmount.pod:218
20020 msgid "B<-o allow_other>"
20024 #: ../fuse/guestmount.pod:220
20025 msgid "Allow other users to see the filesystem."
20029 #: ../fuse/guestmount.pod:222
20030 msgid "B<-o attr_timeout=N>"
20034 #: ../fuse/guestmount.pod:224
20035 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20039 #: ../fuse/guestmount.pod:226
20040 msgid "B<-o kernel_cache>"
20044 #: ../fuse/guestmount.pod:228
20046 "Allow the kernel to cache files (reduces the number of reads that have to go "
20047 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20048 "afford the extra memory usage."
20052 #: ../fuse/guestmount.pod:232
20053 msgid "B<-o uid=N> B<-o gid=N>"
20057 #: ../fuse/guestmount.pod:234
20059 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20060 "the chosen values."
20064 #: ../fuse/guestmount.pod:243
20066 "Add devices and mount everything read-only. Also disallow writes and make "
20067 "the disk appear read-only to FUSE."
20071 #: ../fuse/guestmount.pod:246
20073 "This is highly recommended if you are not going to edit the guest disk. If "
20074 "the guest is running and this option is I<not> supplied, then there is a "
20075 "strong risk of disk corruption in the guest. We try to prevent this from "
20076 "happening, but it is not always possible."
20080 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
20081 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20085 #: ../fuse/guestmount.pod:255
20086 msgid "Enable SELinux support for the guest."
20090 #: ../fuse/guestmount.pod:261
20091 msgid "Enable verbose messages from underlying libguestfs."
20095 #: ../fuse/guestmount.pod:267
20096 msgid "Display the program version and exit."
20100 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
20101 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20102 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20106 #: ../fuse/guestmount.pod:280
20111 #: ../fuse/guestmount.pod:282
20112 msgid "Trace libguestfs calls and entry into each FUSE function."
20116 #: ../fuse/guestmount.pod:284
20117 msgid "This also stops the daemon from forking into the background."
20121 #: ../fuse/guestmount.pod:310
20123 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20124 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
20129 #: ../fuse/guestmount.pod:325
20130 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20134 #: ../inspector/virt-inspector.pod:5
20136 "virt-inspector - Display operating system version and other information "
20137 "about a virtual machine"
20141 #: ../inspector/virt-inspector.pod:9
20144 " virt-inspector [--options] -d domname\n"
20149 #: ../inspector/virt-inspector.pod:11
20152 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20157 #: ../inspector/virt-inspector.pod:15
20160 " virt-inspector domname\n"
20165 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20168 " virt-inspector disk.img [disk.img ...]\n"
20173 #: ../inspector/virt-inspector.pod:21
20175 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20176 "determine the version of the operating system and other information about "
20177 "the virtual machine."
20181 #: ../inspector/virt-inspector.pod:25
20182 msgid "Virt-inspector produces XML output for feeding into other programs."
20186 #: ../inspector/virt-inspector.pod:27
20188 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20189 "the libvirt domain (see: C<virsh list --all>)."
20193 #: ../inspector/virt-inspector.pod:30
20195 "You can also run virt-inspector directly on disk images from a single "
20196 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20197 "has several block devices, in which case you should list several I<-a> "
20198 "options one after another, with the first corresponding to the guest's C</"
20199 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
20203 #: ../inspector/virt-inspector.pod:37
20205 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20206 "keys and similar."
20210 #: ../inspector/virt-inspector.pod:40
20212 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20213 "inspect several virtual machines, you have to run virt-inspector several "
20214 "times (for example, from a shell script for-loop)."
20218 #: ../inspector/virt-inspector.pod:45
20220 "Because virt-inspector needs direct access to guest images, it won't "
20221 "normally work over remote libvirt connections."
20225 #: ../inspector/virt-inspector.pod:48
20227 "All of the information available from virt-inspector is also available "
20228 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20229 "The same information can also be fetched using guestfish or via libguestfs "
20230 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20231 "WITH OTHER PROGRAMMING LANGUAGES>)."
20235 #: ../inspector/virt-inspector.pod:81
20237 "Libvirt is only used if you specify a C<domname> on the command line. If "
20238 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20243 #: ../inspector/virt-inspector.pod:94
20245 "When prompting for keys and passphrases, virt-inspector normally turns "
20246 "echoing off so you cannot see what you are typing. If you are not worried "
20247 "about Tempest attacks and there is no one else in the room you can specify "
20248 "this flag to see what you are typing."
20252 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
20253 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
20254 #: ../tools/virt-win-reg.pl:144
20256 "Specify the format of disk images given on the command line. If this is "
20257 "omitted then the format is autodetected from the content of the disk image."
20261 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
20262 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
20263 #: ../tools/virt-win-reg.pl:148
20265 "If disk images are requested from libvirt, then this program asks libvirt "
20266 "for this information. In this case, the value of the format parameter is "
20271 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
20272 #: ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132
20273 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
20274 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
20276 "If working with untrusted raw-format guest disk images, you should ensure "
20277 "the format is always specified."
20281 #: ../inspector/virt-inspector.pod:139
20282 msgid "Previous versions of virt-inspector allowed you to write either:"
20286 #: ../inspector/virt-inspector.pod:145
20289 " virt-inspector guestname\n"
20294 #: ../inspector/virt-inspector.pod:153
20299 #: ../inspector/virt-inspector.pod:155
20301 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20302 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20303 "just an overview."
20307 #: ../inspector/virt-inspector.pod:159
20309 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20310 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20311 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20312 "which is vanishingly rare in real world VMs."
20316 #: ../inspector/virt-inspector.pod:164
20317 msgid "E<lt>operatingsystemE<gt>"
20321 #: ../inspector/virt-inspector.pod:166
20323 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20324 "describe the operating system, its architecture, the descriptive \"product "
20325 "name\" string, the type of OS and so on, as in this example:"
20329 #: ../inspector/virt-inspector.pod:170
20332 " <operatingsystems>\n"
20333 " <operatingsystem>\n"
20334 " <root>/dev/sda2</root>\n"
20335 " <name>windows</name>\n"
20336 " <arch>i386</arch>\n"
20337 " <distro>windows</distro>\n"
20338 " <product_name>Windows 7 Enterprise</product_name>\n"
20339 " <product_variant>Client</product_variant>\n"
20340 " <major_version>6</major_version>\n"
20341 " <minor_version>1</minor_version>\n"
20342 " <windows_systemroot>/Windows</windows_systemroot>\n"
20343 " <format>installed</format>\n"
20348 #: ../inspector/virt-inspector.pod:183
20350 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20351 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20352 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20353 "architecture. The other fields are fairly self-explanatory, but because "
20354 "these fields are taken directly from the libguestfs inspection API you can "
20355 "find precise information from L<guestfs(3)/INSPECTION>."
20359 #: ../inspector/virt-inspector.pod:191
20361 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20362 "of view of libguestfs (block devices may have completely different names "
20363 "inside the VM itself)."
20367 #: ../inspector/virt-inspector.pod:195
20368 msgid "E<lt>mountpointsE<gt>"
20372 #: ../inspector/virt-inspector.pod:197
20374 "Un*x-like guests typically have multiple filesystems which are mounted at "
20375 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20376 "element which looks like this:"
20380 #: ../inspector/virt-inspector.pod:201
20383 " <operatingsystems>\n"
20384 " <operatingsystem>\n"
20387 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20388 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20389 " </mountpoints>\n"
20394 #: ../inspector/virt-inspector.pod:209
20396 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20397 "and may have completely different names inside the guest. Only mountable "
20398 "filesystems appear in this list, not things like swap devices."
20402 #: ../inspector/virt-inspector.pod:214
20403 msgid "E<lt>filesystemsE<gt>"
20407 #: ../inspector/virt-inspector.pod:216
20409 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20410 "filesystems belonging to the guest, including swap and empty partitions. "
20411 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20412 "this OS or shared with this OS and other OSes)."
20416 #: ../inspector/virt-inspector.pod:222
20417 msgid "You might see something like this:"
20421 #: ../inspector/virt-inspector.pod:224
20424 " <operatingsystems>\n"
20425 " <operatingsystem>\n"
20428 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20429 " <type>ext4</type>\n"
20430 " <label>Fedora-13-x86_64</label>\n"
20431 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20437 #: ../inspector/virt-inspector.pod:234
20439 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20440 "the label, and the UUID."
20444 #: ../inspector/virt-inspector.pod:237
20445 msgid "E<lt>applicationsE<gt>"
20449 #: ../inspector/virt-inspector.pod:239
20451 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20452 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20457 #: ../inspector/virt-inspector.pod:243
20459 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20460 "Typical values would be C<rpm> and C<deb>."
20464 #: ../inspector/virt-inspector.pod:246
20466 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20467 "Typical values include C<yum>, C<up2date> and C<apt>"
20471 #: ../inspector/virt-inspector.pod:249
20472 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20476 #: ../inspector/virt-inspector.pod:252
20479 " <operatingsystems>\n"
20480 " <operatingsystem>\n"
20482 " <applications>\n"
20484 " <name>coreutils</name>\n"
20485 " <version>8.5</version>\n"
20486 " <release>1</release>\n"
20487 " </application>\n"
20492 #: ../inspector/virt-inspector.pod:262
20494 "The version and release fields may not be available for some types guests. "
20495 "Other fields are possible, see L<guestfs(3)/"
20496 "guestfs_inspect_list_applications>."
20500 #: ../inspector/virt-inspector.pod:266
20501 msgid "E<lt>drive_mappingsE<gt>"
20505 #: ../inspector/virt-inspector.pod:268
20507 "For operating systems like Windows which use drive letters, virt-inspector "
20508 "is able to find out how drive letters map to filesystems."
20512 #: ../inspector/virt-inspector.pod:272
20515 " <operatingsystems>\n"
20516 " <operatingsystem>\n"
20518 " <drive_mappings>\n"
20519 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
20520 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
20521 " </drive_mappings>\n"
20526 #: ../inspector/virt-inspector.pod:280
20528 "In the example above, drive C maps to the filesystem on the second partition "
20529 "on the first disk, and drive E maps to the filesystem on the first partition "
20530 "on the second disk."
20534 #: ../inspector/virt-inspector.pod:284
20536 "Note that this only covers permanent local filesystem mappings, not things "
20537 "like network shares. Furthermore NTFS volume mount points may not be listed "
20542 #: ../inspector/virt-inspector.pod:288
20543 msgid "E<lt>iconE<gt>"
20547 #: ../inspector/virt-inspector.pod:290
20549 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
20550 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
20551 "very large and high quality."
20555 #: ../inspector/virt-inspector.pod:294
20558 " <operatingsystems>\n"
20559 " <operatingsystem>\n"
20562 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
20563 " [... many lines of base64 data ...]\n"
20569 #: ../inspector/virt-inspector.pod:302
20571 "To display the icon, you have to extract it and convert the base64 data back "
20572 "to a binary file. Use an XPath query or simply an editor to extract the "
20573 "data, then use the coreutils L<base64(1)> program to do the conversion back "
20578 #: ../inspector/virt-inspector.pod:307
20581 " base64 -i -d < icon.data > icon.png\n"
20586 #: ../inspector/virt-inspector.pod:309
20587 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
20591 #: ../inspector/virt-inspector.pod:311
20593 "Virt-inspector can detect some operating system installers on install disks, "
20594 "live CDs, bootable USB keys and more."
20598 #: ../inspector/virt-inspector.pod:314
20600 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
20601 "fields may be present to indicate a live CD, network installer, or one part "
20602 "of a multipart CD. For example:"
20606 #: ../inspector/virt-inspector.pod:318
20609 " <operatingsystems>\n"
20610 " <operatingsystem>\n"
20611 " <root>/dev/sda</root>\n"
20612 " <name>linux</name>\n"
20613 " <arch>i386</arch>\n"
20614 " <distro>ubuntu</distro>\n"
20615 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
20616 " <major_version>10</major_version>\n"
20617 " <minor_version>10</minor_version>\n"
20618 " <format>installer</format>\n"
20624 #: ../inspector/virt-inspector.pod:330
20625 msgid "USING XPATH"
20629 #: ../inspector/virt-inspector.pod:332
20631 "You can use the XPath query language to select parts of the XML. We "
20632 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
20636 #: ../inspector/virt-inspector.pod:338
20639 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
20641 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20642 " <type>ext4</type>\n"
20648 #: ../inspector/virt-inspector.pod:344
20651 " $ virt-inspector -d Guest | \\\n"
20652 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
20658 #: ../inspector/virt-inspector.pod:348
20661 " $ virt-inspector -d Guest | \\\n"
20662 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
20663 " [displays the guest icon, if there is one]\n"
20668 #: ../inspector/virt-inspector.pod:359
20669 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
20673 #: ../inspector/virt-inspector.pod:361
20675 "Early versions of libguestfs shipped with a different virt-inspector program "
20676 "written in Perl (the current version is written in C). The XML output of "
20677 "the Perl virt-inspector was different and it could also output in other "
20678 "formats like text."
20682 #: ../inspector/virt-inspector.pod:366
20684 "The old virt-inspector is no longer supported or shipped with libguestfs."
20688 #: ../inspector/virt-inspector.pod:369
20690 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
20691 "versions of virt-inspector with different names:"
20695 #: ../inspector/virt-inspector.pod:372
20698 " virt-inspector Old Perl version.\n"
20699 " virt-inspector2 New C version.\n"
20704 #: ../inspector/virt-inspector.pod:382
20706 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
20707 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
20711 #: ../inspector/virt-inspector.pod:399
20712 msgid "Matthew Booth L<mbooth@redhat.com>"
20716 #: ../java/examples/guestfs-java.pod:5
20717 msgid "guestfs-java - How to use libguestfs from Java"
20721 #: ../java/examples/guestfs-java.pod:9
20724 " import com.redhat.et.libguestfs.*;\n"
20729 #: ../java/examples/guestfs-java.pod:11
20732 " GuestFS g = new GuestFS ();\n"
20733 " g.add_drive_opts (\"disk.img\", null);\n"
20739 #: ../java/examples/guestfs-java.pod:17
20741 "This manual page documents how to call libguestfs from the Java programming "
20742 "language. This page just documents the differences from the C API and gives "
20743 "some examples. If you are not familiar with using libguestfs, you also need "
20744 "to read L<guestfs(3)>."
20748 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20749 msgid "CLOSING THE HANDLE"
20753 #: ../java/examples/guestfs-java.pod:24
20755 "The handle is closed when it is reaped by the garbage collector. Because "
20756 "libguestfs handles include a lot of state, it is also possible to close (and "
20757 "hence free) them explicitly by calling the C<close> method."
20761 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20762 #: ../python/examples/guestfs-python.pod:21
20763 #: ../ruby/examples/guestfs-ruby.pod:22
20768 #: ../java/examples/guestfs-java.pod:31
20770 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20771 "exception. This has a single parameter which is the error message (a "
20776 #: ../java/examples/guestfs-java.pod:35
20777 msgid "Calling any method on a closed handle raises the same exception."
20781 #: ../java/examples/guestfs-java.pod:47
20783 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
20784 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20785 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
20789 #: ../ocaml/examples/guestfs-ocaml.pod:5
20790 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20794 #: ../ocaml/examples/guestfs-ocaml.pod:9
20795 msgid "Module style:"
20799 #: ../ocaml/examples/guestfs-ocaml.pod:11
20802 " let g = Guestfs.create () in\n"
20803 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20804 " Guestfs.launch g;\n"
20809 #: ../ocaml/examples/guestfs-ocaml.pod:15
20810 msgid "Object-oriented style:"
20814 #: ../ocaml/examples/guestfs-ocaml.pod:17
20817 " let g = new Guestfs.guestfs () in\n"
20818 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20824 #: ../ocaml/examples/guestfs-ocaml.pod:21
20827 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20829 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20834 #: ../ocaml/examples/guestfs-ocaml.pod:27
20836 "This manual page documents how to call libguestfs from the OCaml programming "
20837 "language. This page just documents the differences from the C API and gives "
20838 "some examples. If you are not familiar with using libguestfs, you also need "
20839 "to read L<guestfs(3)>."
20843 #: ../ocaml/examples/guestfs-ocaml.pod:32
20844 msgid "PROGRAMMING STYLES"
20848 #: ../ocaml/examples/guestfs-ocaml.pod:34
20850 "There are two different programming styles supported by the OCaml bindings. "
20851 "You can use a module style, with each C function mapped to an OCaml function:"
20855 #: ../ocaml/examples/guestfs-ocaml.pod:38
20858 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20863 #: ../ocaml/examples/guestfs-ocaml.pod:40
20868 #: ../ocaml/examples/guestfs-ocaml.pod:42
20871 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20876 #: ../ocaml/examples/guestfs-ocaml.pod:44
20878 "Alternately you can use an object-oriented style, calling methods on the "
20879 "class C<Guestfs.guestfs>:"
20883 #: ../ocaml/examples/guestfs-ocaml.pod:47
20886 " method set_verbose : bool -> unit\n"
20891 #: ../ocaml/examples/guestfs-ocaml.pod:49
20893 "The object-oriented style is usually briefer, and the minor performance "
20894 "penalty isn't noticable in the general overhead of performing libguestfs "
20899 #: ../ocaml/examples/guestfs-ocaml.pod:55
20901 "The handle is closed when it is reaped by the garbage collector. Because "
20902 "libguestfs handles include a lot of state, it is also possible to close (and "
20903 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20908 #: ../ocaml/examples/guestfs-ocaml.pod:62
20910 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20911 "exception. This has a single parameter which is the error message (a "
20916 #: ../ocaml/examples/guestfs-ocaml.pod:66
20918 "Calling any function/method on a closed handle raises C<Guestfs."
20919 "Handle_closed>. The single parameter is the name of the function that you "
20924 #: ../ocaml/examples/guestfs-ocaml.pod:80
20926 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
20927 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20928 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
20932 #: ../perl/examples/guestfs-perl.pod:5
20933 msgid "guestfs-perl - How to use libguestfs from Perl"
20937 #: ../perl/examples/guestfs-perl.pod:9
20940 " use Sys::Guestfs;\n"
20945 #: ../perl/examples/guestfs-perl.pod:11
20948 " my $h = Sys::Guestfs->new ();\n"
20949 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20950 " $h->launch ();\n"
20951 " $h->mount_options ('', '/dev/sda1', '/');\n"
20952 " $h->touch ('/hello');\n"
20958 #: ../perl/examples/guestfs-perl.pod:20
20960 "This manual page documents how to call libguestfs from the Perl programming "
20961 "language. This page just documents the differences from the C API and gives "
20962 "some examples. If you are not familiar with using libguestfs, you also need "
20963 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20967 #: ../perl/examples/guestfs-perl.pod:26
20972 #: ../perl/examples/guestfs-perl.pod:28
20974 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20979 #: ../perl/examples/guestfs-perl.pod:41
20981 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
20982 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
20983 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20987 #: ../python/examples/guestfs-python.pod:5
20988 msgid "guestfs-python - How to use libguestfs from Python"
20992 #: ../python/examples/guestfs-python.pod:9
20995 " import guestfs\n"
20996 " g = guestfs.GuestFS ()\n"
20997 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21003 #: ../python/examples/guestfs-python.pod:16
21005 "This manual page documents how to call libguestfs from the Python "
21006 "programming language. This page just documents the differences from the C "
21007 "API and gives some examples. If you are not familiar with using libguestfs, "
21008 "you also need to read L<guestfs(3)>."
21012 #: ../python/examples/guestfs-python.pod:23
21014 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21015 "single string argument which is the error message."
21019 #: ../python/examples/guestfs-python.pod:26
21020 msgid "MORE DOCUMENTATION"
21024 #: ../python/examples/guestfs-python.pod:28
21029 #: ../python/examples/guestfs-python.pod:30
21033 " >>> import guestfs\n"
21034 " >>> help (guestfs)\n"
21039 #: ../python/examples/guestfs-python.pod:44
21041 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
21042 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
21043 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21047 #: ../rescue/virt-rescue.pod:5
21048 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21052 #: ../rescue/virt-rescue.pod:9
21055 " virt-rescue [--options] -d domname\n"
21060 #: ../rescue/virt-rescue.pod:11
21063 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21068 #: ../rescue/virt-rescue.pod:15
21071 " virt-rescue [--options] domname\n"
21076 #: ../rescue/virt-rescue.pod:17
21079 " virt-rescue [--options] disk.img [disk.img ...]\n"
21084 #: ../rescue/virt-rescue.pod:21
21086 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21087 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21088 "you from doing this, but doesn't catch all cases."
21092 #: ../rescue/virt-rescue.pod:25
21094 "However if you use the I<--ro> (read only) option, then you can attach a "
21095 "shell to a live virtual machine. The results might be strange or "
21096 "inconsistent at times but you won't get disk corruption."
21100 #: ../rescue/virt-rescue.pod:31
21102 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21103 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21104 "recovery tools which you can use to examine or rescue a virtual machine or "
21109 #: ../rescue/virt-rescue.pod:36
21111 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21112 "on disk image(s):"
21116 #: ../rescue/virt-rescue.pod:39
21119 " virt-rescue -d GuestName\n"
21124 #: ../rescue/virt-rescue.pod:41
21127 " virt-rescue --ro -a /path/to/disk.img\n"
21132 #: ../rescue/virt-rescue.pod:43
21135 " virt-rescue -a /dev/sdc\n"
21140 #: ../rescue/virt-rescue.pod:45
21141 msgid "For live VMs you I<must> use the --ro option."
21145 #: ../rescue/virt-rescue.pod:47
21147 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21148 "in an interactive bash shell where you can use many ordinary Linux "
21149 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21150 "appliance. You must mount the virtual machine's filesystems by hand. There "
21151 "is an empty directory called C</sysroot> where you can mount filesystems."
21155 #: ../rescue/virt-rescue.pod:54
21157 "In the example below, we list logical volumes, then choose one to mount "
21158 "under C</sysroot>:"
21162 #: ../rescue/virt-rescue.pod:57
21166 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21167 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21168 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21169 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21170 " ><rescue> ls /sysroot\n"
21175 #: ../rescue/virt-rescue.pod:64
21177 "If you don't know what filesystems are available on the virtual machine then "
21178 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21182 #: ../rescue/virt-rescue.pod:70
21184 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21185 "virtual machine. For example you can use it on a blank file if you want to "
21186 "partition that file (although we would recommend using L<guestfish(1)> "
21187 "instead as it is more suitable for this purpose). You can even use virt-"
21188 "rescue on things like SD cards."
21192 #: ../rescue/virt-rescue.pod:76
21194 "Virt-rescue does not require root. You only need to run it as root if you "
21195 "need root to open the disk image."
21199 #: ../rescue/virt-rescue.pod:79
21201 "This tool is just designed for quick interactive hacking on a virtual "
21202 "machine. For more structured access to a virtual machine disk image, you "
21203 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21204 "make scripted changes to guests, use L<guestfish(1)>."
21208 #: ../rescue/virt-rescue.pod:103
21209 msgid "B<--append kernelopts>"
21213 #: ../rescue/virt-rescue.pod:105
21214 msgid "Pass additional options to the rescue kernel."
21218 #: ../rescue/virt-rescue.pod:135
21221 " virt-rescue --format=raw -a disk.img\n"
21226 #: ../rescue/virt-rescue.pod:139
21229 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21234 #: ../rescue/virt-rescue.pod:148
21239 #: ../rescue/virt-rescue.pod:150
21240 msgid "B<--memsize MB>"
21244 #: ../rescue/virt-rescue.pod:152
21246 "Change the amount of memory allocated to the rescue system. The default is "
21247 "set by libguestfs and is small but adequate for running system tools. The "
21248 "occasional program might need more memory. The parameter is specified in "
21253 #: ../rescue/virt-rescue.pod:157
21254 msgid "B<--network>"
21258 #: ../rescue/virt-rescue.pod:159
21259 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21263 #: ../rescue/virt-rescue.pod:165
21264 msgid "Open the image read-only."
21268 #: ../rescue/virt-rescue.pod:175
21270 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
21271 "SELINUX> before using this option."
21275 #: ../rescue/virt-rescue.pod:178
21280 #: ../rescue/virt-rescue.pod:180
21281 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21285 #: ../rescue/virt-rescue.pod:198
21287 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21288 "are done read-write."
21292 #: ../rescue/virt-rescue.pod:211
21293 msgid "Previous versions of virt-rescue allowed you to write either:"
21297 #: ../rescue/virt-rescue.pod:213
21300 " virt-rescue disk.img [disk.img ...]\n"
21305 #: ../rescue/virt-rescue.pod:217
21308 " virt-rescue guestname\n"
21313 #: ../rescue/virt-rescue.pod:225
21318 #: ../rescue/virt-rescue.pod:227
21320 "Adding the I<--network> option enables QEMU user networking in the rescue "
21321 "appliance. There are some differences between user networking and ordinary "
21326 #: ../rescue/virt-rescue.pod:233
21327 msgid "ping does not work"
21331 #: ../rescue/virt-rescue.pod:235
21333 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21334 "send the ping packets, and because virt-rescue must be able to run as non-"
21335 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
21336 "The ping command will appear to resolve addresses but will not be able to "
21337 "send or receive any packets. This does not mean that the network is not "
21342 #: ../rescue/virt-rescue.pod:242
21343 msgid "cannot receive connections"
21347 #: ../rescue/virt-rescue.pod:244
21348 msgid "QEMU user networking cannot receive incoming connections."
21352 #: ../rescue/virt-rescue.pod:246
21353 msgid "making TCP connections"
21357 #: ../rescue/virt-rescue.pod:248
21359 "The virt-rescue appliance needs to be small and so does not include many "
21360 "network tools. In particular there is no L<telnet(1)> command. You can "
21361 "make TCP connections from the shell using the magical C</dev/tcp/"
21362 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21366 #: ../rescue/virt-rescue.pod:253
21369 " exec 3<>/dev/tcp/redhat.com/80\n"
21370 " echo \"GET /\" >&3\n"
21376 #: ../rescue/virt-rescue.pod:257
21377 msgid "See L<bash(1)> for more details."
21381 #: ../rescue/virt-rescue.pod:263
21383 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
21384 "ENVIRONMENT VARIABLES> for the complete list."
21388 #: ../rescue/virt-rescue.pod:290
21390 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
21391 "libguestfs.org/>."
21395 #: ../resize/virt-resize.pod:5
21396 msgid "virt-resize - Resize a virtual machine disk"
21400 #: ../resize/virt-resize.pod:9
21403 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21404 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21405 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21410 #: ../resize/virt-resize.pod:15
21412 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21413 "larger or smaller overall, and resizing or deleting any partitions contained "
21418 #: ../resize/virt-resize.pod:19
21420 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21421 "not> be used on live virtual machines - for consistent results, shut the "
21422 "virtual machine down before resizing it."
21426 #: ../resize/virt-resize.pod:23
21428 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21429 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21433 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520
21434 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469
21435 #: ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2604
21440 #: ../resize/virt-resize.pod:33
21442 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21443 "fill the extra 5GB of space."
21447 #: ../resize/virt-resize.pod:36
21450 " virt-filesystems --long -h --all -a olddisk\n"
21455 #: ../resize/virt-resize.pod:38
21458 " truncate -r olddisk newdisk\n"
21459 " truncate -s +5G newdisk\n"
21464 #: ../resize/virt-resize.pod:41
21467 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21468 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21473 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527
21474 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475
21475 #: ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2629
21480 #: ../resize/virt-resize.pod:46
21482 "As above, but make the /boot partition 200MB bigger, while giving the "
21483 "remaining space to /dev/sda2:"
21487 #: ../resize/virt-resize.pod:49
21490 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21491 " olddisk newdisk\n"
21496 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533
21497 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486
21498 #: ../src/guestfs.pod:1436
21503 #: ../resize/virt-resize.pod:54
21505 "As in the first example, but expand a logical volume as the final step. "
21506 "This is what you would typically use for Linux guests that use LVM:"
21510 #: ../resize/virt-resize.pod:58
21513 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
21514 " olddisk newdisk\n"
21519 #: ../resize/virt-resize.pod:61
21524 #: ../resize/virt-resize.pod:63
21526 "As in the first example, but the output format will be qcow2 instead of a "
21531 #: ../resize/virt-resize.pod:66
21534 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
21535 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
21540 #: ../resize/virt-resize.pod:71
21541 msgid "DETAILED USAGE"
21545 #: ../resize/virt-resize.pod:73
21546 msgid "EXPANDING A VIRTUAL MACHINE DISK"
21550 #: ../resize/virt-resize.pod:77
21551 msgid "1. Shut down the virtual machine"
21555 #: ../resize/virt-resize.pod:79
21556 msgid "2. Locate input disk image"
21560 #: ../resize/virt-resize.pod:81
21562 "Locate the input disk image (ie. the file or device on the host containing "
21563 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
21564 "dumpxml> like this to find the disk image name:"
21568 #: ../resize/virt-resize.pod:85
21571 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
21572 " Found 1 nodes:\n"
21574 " <source dev=\"/dev/vg/lv_guest\" />\n"
21579 #: ../resize/virt-resize.pod:90
21580 msgid "3. Look at current sizing"
21584 #: ../resize/virt-resize.pod:92
21585 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
21589 #: ../resize/virt-resize.pod:95
21592 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
21593 " Name Type Size Parent\n"
21594 " /dev/sda1 partition 101M /dev/sda\n"
21595 " /dev/sda2 partition 7.9G /dev/sda\n"
21596 " /dev/sda device 8.0G -\n"
21601 #: ../resize/virt-resize.pod:101
21603 "(This example is a virtual machine with an 8 GB disk which we would like to "
21604 "expand up to 10 GB)."
21608 #: ../resize/virt-resize.pod:104
21609 msgid "4. Create output disk"
21613 #: ../resize/virt-resize.pod:106
21615 "Virt-resize cannot do in-place disk modifications. You have to have space "
21616 "to store the resized output disk."
21620 #: ../resize/virt-resize.pod:109
21622 "To store the resized disk image in a file, create a file of a suitable size:"
21626 #: ../resize/virt-resize.pod:112
21629 " # rm -f outdisk\n"
21630 " # truncate -s 10G outdisk\n"
21635 #: ../resize/virt-resize.pod:115
21636 msgid "Or use L<lvcreate(1)> to create a logical volume:"
21640 #: ../resize/virt-resize.pod:117
21643 " # lvcreate -L 10G -n lv_name vg_name\n"
21648 #: ../resize/virt-resize.pod:119
21649 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
21653 #: ../resize/virt-resize.pod:121
21656 " # virsh pool-list\n"
21657 " # virsh vol-create-as poolname newvol 10G\n"
21662 #: ../resize/virt-resize.pod:124
21667 #: ../resize/virt-resize.pod:126
21669 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
21670 "file) and the output disk. The output disk is the one created in the "
21675 #: ../resize/virt-resize.pod:130
21678 " # virt-resize indisk outdisk\n"
21683 #: ../resize/virt-resize.pod:132
21685 "This command just copies disk image C<indisk> to disk image C<outdisk> "
21686 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
21687 "larger, then an extra, empty partition is created at the end of the disk "
21688 "covering the extra space. If C<outdisk> is smaller, then it will give an "
21693 #: ../resize/virt-resize.pod:138
21695 "More realistically you'd want to expand existing partitions in the disk "
21696 "image by passing extra options (for the full list see the L</OPTIONS> "
21701 #: ../resize/virt-resize.pod:142
21703 "L</--expand> is the most useful option. It expands the named partition "
21704 "within the disk to fill any extra space:"
21708 #: ../resize/virt-resize.pod:145
21711 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
21716 #: ../resize/virt-resize.pod:147
21718 "(In this case, an extra partition is I<not> created at the end of the disk, "
21719 "because there will be no unused space)."
21723 #: ../resize/virt-resize.pod:150
21725 "L</--resize> is the other commonly used option. The following would "
21726 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21727 "rest of the available space:"
21731 #: ../resize/virt-resize.pod:154
21734 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21735 " indisk outdisk\n"
21740 #: ../resize/virt-resize.pod:157
21742 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21743 "if virt-resize knows how, it will resize the contents, the equivalent of "
21744 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21745 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21746 "filesystems, so you would have to online resize them after booting the guest."
21750 #: ../resize/virt-resize.pod:164
21751 msgid "Other options are covered below."
21755 #: ../resize/virt-resize.pod:166
21760 #: ../resize/virt-resize.pod:168
21761 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21765 #: ../resize/virt-resize.pod:170
21766 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21770 #: ../resize/virt-resize.pod:172
21773 " # virsh edit guestname\n"
21778 #: ../resize/virt-resize.pod:174
21780 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21781 "html#elementsDisks>"
21785 #: ../resize/virt-resize.pod:177
21786 msgid "Then start up the domain with the new, resized disk:"
21790 #: ../resize/virt-resize.pod:179
21793 " # virsh start guestname\n"
21798 #: ../resize/virt-resize.pod:181
21800 "and check that it still works. See also the L</NOTES> section below for "
21801 "additional information."
21805 #: ../resize/virt-resize.pod:184
21806 msgid "7. Resize LVs etc inside the guest"
21810 #: ../resize/virt-resize.pod:186
21811 msgid "(This can also be done offline using L<guestfish(1)>)"
21815 #: ../resize/virt-resize.pod:188
21817 "Once the guest has booted you should see the new space available, at least "
21818 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21819 "may need to resize LVs inside PVs, and also resize filesystem types that "
21820 "virt-resize does not know how to expand."
21824 #: ../resize/virt-resize.pod:195
21825 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21829 #: ../resize/virt-resize.pod:197
21831 "Shrinking is somewhat more complex than expanding, and only an overview is "
21836 #: ../resize/virt-resize.pod:200
21838 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21839 "filesystems). The user has to shrink content before passing the disk image "
21840 "to virt-resize, and virt-resize will check that the content has been shrunk "
21845 #: ../resize/virt-resize.pod:205
21846 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21850 #: ../resize/virt-resize.pod:207
21852 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21853 "steps 3 and 4 above to allocate a new disk image."
21857 #: ../resize/virt-resize.pod:210
21859 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21863 #: ../resize/virt-resize.pod:213
21864 msgid "IGNORING OR DELETING PARTITIONS"
21868 #: ../resize/virt-resize.pod:215
21870 "virt-resize also gives a convenient way to ignore or delete partitions when "
21871 "copying from the input disk to the output disk. Ignoring a partition speeds "
21872 "up the copy where you don't care about the existing contents of a "
21873 "partition. Deleting a partition removes it completely, but note that it "
21874 "also renumbers any partitions after the one which is deleted, which can "
21875 "leave some guests unbootable."
21879 #: ../resize/virt-resize.pod:222
21880 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21884 #: ../resize/virt-resize.pod:224
21886 "If the input disk is in qcow2 format, then you may prefer that the output is "
21887 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21888 "the fly. The output format is simply determined by the format of the empty "
21889 "output container that you provide. Thus to create qcow2 output, use:"
21893 #: ../resize/virt-resize.pod:230
21896 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21901 #: ../resize/virt-resize.pod:232
21902 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21906 #: ../resize/virt-resize.pod:234
21907 msgid "Similarly, to get non-sparse raw output use:"
21911 #: ../resize/virt-resize.pod:236
21914 " fallocate -l size outdisk\n"
21919 #: ../resize/virt-resize.pod:238
21921 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21922 "dev/zero of=outdisk bs=1M count=..>)"
21926 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
21927 msgid "Display help."
21931 #: ../resize/virt-resize.pod:249
21936 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21937 #: ../tools/virt-win-reg.pl:120
21942 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21943 msgid "Enable debugging messages."
21947 #: ../resize/virt-resize.pod:255
21948 msgid "B<--delete part>"
21952 #: ../resize/virt-resize.pod:257
21954 "Delete the named partition. It would be more accurate to describe this as "
21955 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21956 "the original disk image is left intact."
21960 #: ../resize/virt-resize.pod:261
21962 "Note that when you delete a partition, then anything contained in the "
21963 "partition is also deleted. Furthermore, this causes any partitions that "
21964 "come after to be I<renumbered>, which can easily make your guest unbootable."
21968 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21969 #: ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
21970 msgid "You can give this option multiple times."
21974 #: ../resize/virt-resize.pod:268
21975 msgid "B<--expand part>"
21979 #: ../resize/virt-resize.pod:270
21981 "Expand the named partition so it uses up all extra space (space left over "
21982 "after any other resize changes that you request have been done)."
21986 #: ../resize/virt-resize.pod:273
21988 "If virt-resize knows how, it will expand the direct content of the "
21989 "partition. For example, if the partition is an LVM PV, it will expand the "
21990 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21991 "content it doesn't know about alone."
21995 #: ../resize/virt-resize.pod:278
21996 msgid "Currently virt-resize can resize:"
22000 #: ../resize/virt-resize.pod:284
22001 msgid "ext2, ext3 and ext4 filesystems."
22005 #: ../resize/virt-resize.pod:288
22006 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22010 #: ../resize/virt-resize.pod:290
22012 "The filesystem must have been shut down consistently last time it was used. "
22013 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22014 "consistency check, so at the first boot after resizing Windows will check "
22019 #: ../resize/virt-resize.pod:297
22021 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22022 "inside the PV, but see the I<--LV-expand> option. The user could also "
22023 "resize LVs as desired after boot."
22027 #: ../resize/virt-resize.pod:303
22028 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22032 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
22033 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22037 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125
22038 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
22039 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
22040 msgid "B<--format> raw"
22044 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
22046 "Specify the format of the input disk image. If this flag is not given then "
22047 "it is auto-detected from the image itself."
22051 #: ../resize/virt-resize.pod:317
22053 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22054 "AND NON-SPARSE RAW FORMATS>."
22058 #: ../resize/virt-resize.pod:320
22059 msgid "B<--ignore part>"
22063 #: ../resize/virt-resize.pod:322
22065 "Ignore the named partition. Effectively this means the partition is "
22066 "allocated on the destination disk, but the content is not copied across from "
22067 "the source disk. The content of the partition will be blank (all zero "
22072 #: ../resize/virt-resize.pod:329
22073 msgid "B<--LV-expand logvol>"
22077 #: ../resize/virt-resize.pod:331
22079 "This takes the logical volume and, as a final step, expands it to fill all "
22080 "the space available in its volume group. A typical usage, assuming a Linux "
22081 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
22082 "lv_root> would be:"
22086 #: ../resize/virt-resize.pod:336
22089 " virt-resize indisk outdisk \\\n"
22090 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22095 #: ../resize/virt-resize.pod:339
22097 "This would first expand the partition (and PV), and then expand the root "
22098 "device to fill the extra space in the PV."
22102 #: ../resize/virt-resize.pod:342
22104 "The contents of the LV are also resized if virt-resize knows how to do "
22105 "that. You can stop virt-resize from trying to expand the content by using "
22106 "the option I<--no-expand-content>."
22110 #: ../resize/virt-resize.pod:346
22111 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22115 #: ../resize/virt-resize.pod:348
22117 "You can give this option multiple times, I<but> it doesn't make sense to do "
22118 "this unless the logical volumes you specify are all in different volume "
22123 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
22124 msgid "B<--machine-readable>"
22128 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
22130 "This option is used to make the output more machine friendly when being "
22131 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22135 #: ../resize/virt-resize.pod:360
22136 msgid "B<--dryrun>"
22140 #: ../resize/virt-resize.pod:362
22141 msgid "Print a summary of what would be done, but don't do anything."
22145 #: ../resize/virt-resize.pod:364
22146 msgid "B<--no-copy-boot-loader>"
22150 #: ../resize/virt-resize.pod:366
22152 "By default, virt-resize copies over some sectors at the start of the disk "
22153 "(up to the beginning of the first partition). Commonly these sectors "
22154 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22155 "in order for the guest to boot correctly."
22159 #: ../resize/virt-resize.pod:371
22161 "If you specify this flag, then this initial copy is not done. You may need "
22162 "to reinstall the boot loader in this case."
22166 #: ../resize/virt-resize.pod:374
22167 msgid "B<--no-extra-partition>"
22171 #: ../resize/virt-resize.pod:376
22173 "By default, virt-resize creates an extra partition if there is any extra, "
22174 "unused space after all resizing has happened. Use this option to prevent "
22175 "the extra partition from being created. If you do this then the extra space "
22176 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22177 "tool in the guest."
22181 #: ../resize/virt-resize.pod:382
22183 "Note that if the surplus space is smaller than 10 MB, no extra partition "
22188 #: ../resize/virt-resize.pod:385
22189 msgid "B<--no-expand-content>"
22193 #: ../resize/virt-resize.pod:387
22195 "By default, virt-resize will try to expand the direct contents of "
22196 "partitions, if it knows how (see I<--expand> option above)."
22200 #: ../resize/virt-resize.pod:390
22202 "If you give the I<--no-expand-content> option then virt-resize will not "
22207 #: ../resize/virt-resize.pod:393
22208 msgid "B<--ntfsresize-force>"
22212 #: ../resize/virt-resize.pod:395
22214 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
22215 "the NTFS disk is marked as needing a consistency check. You have to use "
22216 "this option if you want to resize a Windows guest multiple times without "
22217 "booting into Windows between each resize."
22221 #: ../resize/virt-resize.pod:401
22222 msgid "B<--output-format> raw"
22226 #: ../resize/virt-resize.pod:403
22228 "Specify the format of the output disk image. If this flag is not given then "
22229 "it is auto-detected from the image itself."
22233 #: ../resize/virt-resize.pod:409
22235 "Note that this option I<does not create> the output format. This option "
22236 "just tells libguestfs what it is so it doesn't try to guess it. You still "
22237 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
22238 "SPARSE RAW FORMATS>."
22242 #: ../resize/virt-resize.pod:418
22243 msgid "Don't print the summary."
22247 #: ../resize/virt-resize.pod:420
22248 msgid "B<--resize part=size>"
22252 #: ../resize/virt-resize.pod:422
22254 "Resize the named partition (expanding or shrinking it) so that it has the "
22259 #: ../resize/virt-resize.pod:425
22261 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
22262 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
22263 "size; or as a relative number or percentage. For example:"
22267 #: ../resize/virt-resize.pod:431
22270 " --resize /dev/sda2=10G\n"
22275 #: ../resize/virt-resize.pod:433
22278 " --resize /dev/sda4=90%\n"
22283 #: ../resize/virt-resize.pod:435
22286 " --resize /dev/sda2=+1G\n"
22291 #: ../resize/virt-resize.pod:437
22294 " --resize /dev/sda2=-200M\n"
22299 #: ../resize/virt-resize.pod:439
22302 " --resize /dev/sda1=+128K\n"
22307 #: ../resize/virt-resize.pod:441
22310 " --resize /dev/sda1=+10%\n"
22315 #: ../resize/virt-resize.pod:443
22318 " --resize /dev/sda1=-10%\n"
22323 #: ../resize/virt-resize.pod:445
22325 "You can increase the size of any partition. Virt-resize will expand the "
22326 "direct content of the partition if it knows how (see I<--expand> below)."
22330 #: ../resize/virt-resize.pod:449
22332 "You can only I<decrease> the size of partitions that contain filesystems or "
22333 "PVs which have already been shrunk. Virt-resize will check this has been "
22334 "done before proceeding, or else will print an error (see also I<--resize-"
22339 #: ../resize/virt-resize.pod:456
22340 msgid "B<--resize-force part=size>"
22344 #: ../resize/virt-resize.pod:458
22346 "This is the same as I<--resize> except that it will let you decrease the "
22347 "size of any partition. Generally this means you will lose any data which "
22348 "was at the end of the partition you shrink, but you may not care about that "
22349 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22350 "as a swap partition)."
22354 #: ../resize/virt-resize.pod:464
22355 msgid "See also the I<--ignore> option."
22359 #: ../resize/virt-resize.pod:466
22360 msgid "B<--shrink part>"
22364 #: ../resize/virt-resize.pod:468
22366 "Shrink the named partition until the overall disk image fits in the "
22367 "destination. The named partition B<must> contain a filesystem or PV which "
22368 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22369 "online tools). Virt-resize will check this and give an error if it has not "
22374 #: ../resize/virt-resize.pod:474
22376 "The amount by which the overall disk must be shrunk (after carrying out all "
22377 "other operations requested by the user) is called the \"deficit\". For "
22378 "example, a straight copy (assume no other operations) from a 5GB disk image "
22379 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22380 "would give an error unless the user specified a partition to shrink and that "
22381 "partition had more than a gigabyte of free space."
22385 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
22386 msgid "MACHINE READABLE OUTPUT"
22390 #: ../resize/virt-resize.pod:494
22392 "The I<--machine-readable> option can be used to make the output more machine "
22393 "friendly, which is useful when calling virt-resize from other programs, GUIs "
22398 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
22399 msgid "There are two ways to use this option."
22403 #: ../resize/virt-resize.pod:500
22405 "Firstly use the option on its own to query the capabilities of the virt-"
22406 "resize binary. Typical output looks like this:"
22410 #: ../resize/virt-resize.pod:503
22413 " $ virt-resize --machine-readable\n"
22415 " ntfsresize-force\n"
22423 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
22425 "A list of features is printed, one per line, and the program exits with "
22430 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
22432 "Secondly use the option in conjunction with other options to make the "
22433 "regular program output more machine friendly."
22437 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
22438 msgid "At the moment this means:"
22442 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
22444 "Progress bar messages can be parsed from stdout by looking for this regular "
22449 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
22452 " ^[0-9]+/[0-9]+$\n"
22457 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
22459 "The calling program should treat messages sent to stdout (except for "
22460 "progress bar messages) as status messages. They can be logged and/or "
22461 "displayed to the user."
22465 #: ../resize/virt-resize.pod:535
22467 "The calling program should treat messages sent to stderr as error messages. "
22468 "In addition, virt-resize exits with a non-zero status code if there was a "
22473 #: ../resize/virt-resize.pod:541
22475 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
22476 "readable> option and will return an error."
22480 #: ../resize/virt-resize.pod:546
22481 msgid "\"Partition 1 does not end on cylinder boundary.\""
22485 #: ../resize/virt-resize.pod:548
22487 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
22488 "means the partitions will not be aligned to the ancient CHS geometry. "
22489 "However CHS geometry is meaningless for disks manufactured since the early "
22490 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
22491 "cylinders is not required by any modern operating system."
22495 #: ../resize/virt-resize.pod:555
22496 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
22500 #: ../resize/virt-resize.pod:557
22502 "In Windows Vista and later versions, Microsoft switched to using a separate "
22503 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
22504 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
22505 "the boot partition. Doing so seems to break the guest completely. However "
22506 "expanding the second partition (ie. C: drive) should work."
22510 #: ../resize/virt-resize.pod:564
22512 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
22513 "NTFS partitions have been expanded. This is just a safety check and (unless "
22514 "it find errors) is nothing to worry about."
22518 #: ../resize/virt-resize.pod:568
22519 msgid "GUEST BOOT STUCK AT \"GRUB\""
22523 #: ../resize/virt-resize.pod:570
22525 "If a Linux guest does not boot after resizing, and the boot is stuck after "
22526 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
22527 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
22528 "although we think is to do with partition alignment."
22532 #: ../resize/virt-resize.pod:575
22535 " guestfish -i -a newdisk\n"
22536 " ><fs> cat /boot/grub/device.map\n"
22537 " # check the contents of this file are sensible or\n"
22538 " # edit the file if necessary\n"
22539 " ><fs> grub-install / /dev/vda\n"
22545 #: ../resize/virt-resize.pod:582
22547 "For more flexible guest reconfiguration, including if you need to specify "
22548 "other parameters to grub-install, use L<virt-rescue(1)>."
22552 #: ../resize/virt-resize.pod:585
22553 msgid "ALTERNATIVE TOOLS"
22557 #: ../resize/virt-resize.pod:587
22559 "There are several proprietary tools for resizing partitions. We won't "
22560 "mention any here."
22564 #: ../resize/virt-resize.pod:590
22566 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
22567 "operations on disk images. They can resize and move partitions, but I don't "
22568 "think they can do anything with the contents, and they certainly don't "
22573 #: ../resize/virt-resize.pod:595
22575 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
22576 "but at a much lower level. You will probably end up hand-calculating sector "
22577 "offsets, which is something that virt-resize was designed to avoid. If you "
22578 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
22583 #: ../resize/virt-resize.pod:615
22585 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
22586 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
22587 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
22588 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
22589 "L<http://libguestfs.org/>."
22593 #: ../ruby/examples/guestfs-ruby.pod:5
22594 msgid "guestfs-ruby - How to use libguestfs from Ruby"
22598 #: ../ruby/examples/guestfs-ruby.pod:9
22601 " require 'guestfs'\n"
22602 " g = Guestfs::Guestfs.new()\n"
22603 " g.add_drive_opts(\"disk.img\",\n"
22604 " :readonly => 1, :format => \"raw\")\n"
22610 #: ../ruby/examples/guestfs-ruby.pod:17
22612 "This manual page documents how to call libguestfs from the Ruby programming "
22613 "language. This page just documents the differences from the C API and gives "
22614 "some examples. If you are not familiar with using libguestfs, you also need "
22615 "to read L<guestfs(3)>."
22619 #: ../ruby/examples/guestfs-ruby.pod:24
22621 "Errors from libguestfs functions are mapped into the C<Error> exception. "
22622 "This has a single parameter which is the error message (a string)."
22626 #: ../ruby/examples/guestfs-ruby.pod:38
22628 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22629 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
22630 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
22634 #: ../sparsify/virt-sparsify.pod:5
22635 msgid "virt-sparsify - Make a virtual machine disk sparse"
22639 #: ../sparsify/virt-sparsify.pod:9
22642 " virt-sparsify [--options] indisk outdisk\n"
22647 #: ../sparsify/virt-sparsify.pod:13
22649 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
22650 "image) sparse a.k.a. thin-provisioned. This means that free space within "
22651 "the disk image can be converted back to free space on the host."
22655 #: ../sparsify/virt-sparsify.pod:18
22657 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
22658 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
22662 #: ../sparsify/virt-sparsify.pod:21
22664 "Virt-sparsify can also convert between some disk formats, for example "
22665 "converting a raw disk image to a thin-provisioned qcow2 image."
22669 #: ../sparsify/virt-sparsify.pod:24
22671 "Virt-sparsify can operate on any disk image, not just ones from virtual "
22672 "machines. If a virtual machine has more than one attached disk, you must "
22673 "sparsify each one separately."
22677 #: ../sparsify/virt-sparsify.pod:28
22678 msgid "IMPORTANT LIMITATIONS"
22682 #: ../sparsify/virt-sparsify.pod:34
22684 "Virt-sparsify does not do in-place modifications. It copies from a source "
22685 "image to a destination image, leaving the source unchanged. I<Check that "
22686 "the sparsification was successful before deleting the source image>."
22690 #: ../sparsify/virt-sparsify.pod:41
22691 msgid "The virtual machine I<must be shut down> before using this tool."
22695 #: ../sparsify/virt-sparsify.pod:45
22697 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
22698 "(1 temporary copy + 1 destination image). This is in the worst case and "
22699 "usually much less space is required."
22703 #: ../sparsify/virt-sparsify.pod:51
22705 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
22709 #: ../sparsify/virt-sparsify.pod:56
22710 msgid "Virt-sparsify cannot handle encrypted disks."
22714 #: ../sparsify/virt-sparsify.pod:60
22716 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
22717 "this space is often used for critical items like bootloaders so it's not "
22722 #: ../sparsify/virt-sparsify.pod:66
22724 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
22725 "to do this unless we can be sure there is no hibernation data, so at the "
22726 "moment swap partitions are ignored."
22730 #: ../sparsify/virt-sparsify.pod:72
22732 "You may also want to read the manual pages for the associated tools L<virt-"
22733 "filesystems(1)> and L<virt-df(1)> before starting."
22737 #: ../sparsify/virt-sparsify.pod:77
22738 msgid "Typical usage is:"
22742 #: ../sparsify/virt-sparsify.pod:79
22745 " virt-sparsify indisk outdisk\n"
22750 #: ../sparsify/virt-sparsify.pod:81
22752 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
22753 "is created, or overwritten if it already exists. The format of the input "
22754 "disk is detected (eg. qcow2) and the same format is used for the output disk."
22758 #: ../sparsify/virt-sparsify.pod:86
22759 msgid "To convert between formats, use the I<--convert> option:"
22763 #: ../sparsify/virt-sparsify.pod:88
22766 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
22771 #: ../sparsify/virt-sparsify.pod:90
22773 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
22774 "can find within the source disk image. You can get it to ignore (don't zero "
22775 "free space on) certain filesystems by doing:"
22779 #: ../sparsify/virt-sparsify.pod:94
22782 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
22787 #: ../sparsify/virt-sparsify.pod:96
22789 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
22793 #: ../sparsify/virt-sparsify.pod:107
22794 msgid "B<--convert> raw"
22798 #: ../sparsify/virt-sparsify.pod:109
22799 msgid "B<--convert> qcow2"
22803 #: ../sparsify/virt-sparsify.pod:111
22804 msgid "B<--convert> [other formats]"
22808 #: ../sparsify/virt-sparsify.pod:113
22810 "Use C<output-format> as the format for the destination image. If this is "
22811 "not specified, then the input format is used."
22815 #: ../sparsify/virt-sparsify.pod:116
22816 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
22820 #: ../sparsify/virt-sparsify.pod:118
22822 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
22823 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
22827 #: ../sparsify/virt-sparsify.pod:122
22829 "Specifying the I<--convert> option is usually a good idea, because then virt-"
22830 "sparsify doesn't need to try to guess the input format."
22834 #: ../sparsify/virt-sparsify.pod:127
22835 msgid "B<--format> qcow2"
22839 #: ../sparsify/virt-sparsify.pod:135
22840 msgid "B<--ignore> filesystem"
22844 #: ../sparsify/virt-sparsify.pod:137
22845 msgid "B<--ignore> volgroup"
22849 #: ../sparsify/virt-sparsify.pod:139
22851 "Ignore the named filesystem. Free space on the filesystem will not be "
22852 "zeroed, but existing blocks of zeroes will still be sparsified."
22856 #: ../sparsify/virt-sparsify.pod:142
22858 "In the second form, this ignores the named volume group. Use the volume "
22859 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
22863 #: ../sparsify/virt-sparsify.pod:157
22864 msgid "This disables progress bars and other unnecessary output."
22868 #: ../sparsify/virt-sparsify.pod:179
22870 "The I<--machine-readable> option can be used to make the output more machine "
22871 "friendly, which is useful when calling virt-sparsify from other programs, "
22876 #: ../sparsify/virt-sparsify.pod:185
22878 "Firstly use the option on its own to query the capabilities of the virt-"
22879 "sparsify binary. Typical output looks like this:"
22883 #: ../sparsify/virt-sparsify.pod:188
22886 " $ virt-sparsify --machine-readable\n"
22894 #: ../sparsify/virt-sparsify.pod:218
22896 "The calling program should treat messages sent to stderr as error messages. "
22897 "In addition, virt-sparsify exits with a non-zero status code if there was a "
22902 #: ../sparsify/virt-sparsify.pod:224
22904 "All versions of virt-sparsify have supported the I<--machine-readable> "
22909 #: ../sparsify/virt-sparsify.pod:238
22911 "Location of the temporary directory used for the potentially large temporary "
22916 #: ../sparsify/virt-sparsify.pod:241
22918 "You should ensure there is enough free space in the worst case for a full "
22919 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
22920 "to another directory that has enough space."
22924 #: ../sparsify/virt-sparsify.pod:245
22925 msgid "This defaults to C</tmp>."
22929 #: ../sparsify/virt-sparsify.pod:249
22931 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
22935 #: ../sparsify/virt-sparsify.pod:253
22937 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
22938 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
22939 "(1)>, L<http://libguestfs.org/>."
22943 #: ../src/guestfs-actions.pod:1
22944 msgid "guestfs_add_cdrom"
22948 #: ../src/guestfs-actions.pod:3
22952 " guestfs_add_cdrom (guestfs_h *g,\n"
22953 " const char *filename);\n"
22958 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249
22959 #: ../src/guestfs-actions.pod:270
22961 "I<This function is deprecated.> In new code, use the L</"
22962 "guestfs_add_drive_opts> call instead."
22966 #: ../src/guestfs-actions.pod:24
22968 "This call checks for the existence of C<filename>. This stops you from "
22969 "specifying other types of drive which are supported by qemu such as C<nbd:> "
22970 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
22975 #: ../src/guestfs-actions.pod:31
22977 "If you just want to add an ISO file (often you use this as an efficient way "
22978 "to transfer large files into the guest), then you should probably use "
22979 "C<guestfs_add_drive_ro> instead."
22983 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
22984 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
22985 #: ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280
22986 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
22987 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
22988 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
22989 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
22990 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
22991 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
22992 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
22993 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
22994 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
22995 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
22996 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1233
22997 #: ../src/guestfs-actions.pod:1279 ../src/guestfs-actions.pod:1297
22998 #: ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:1330
22999 #: ../src/guestfs-actions.pod:1350 ../src/guestfs-actions.pod:1420
23000 #: ../src/guestfs-actions.pod:1451 ../src/guestfs-actions.pod:1476
23001 #: ../src/guestfs-actions.pod:1518 ../src/guestfs-actions.pod:1631
23002 #: ../src/guestfs-actions.pod:1658 ../src/guestfs-actions.pod:1873
23003 #: ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:1982
23004 #: ../src/guestfs-actions.pod:2490 ../src/guestfs-actions.pod:2634
23005 #: ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2730
23006 #: ../src/guestfs-actions.pod:3774 ../src/guestfs-actions.pod:3789
23007 #: ../src/guestfs-actions.pod:3814 ../src/guestfs-actions.pod:4003
23008 #: ../src/guestfs-actions.pod:4017 ../src/guestfs-actions.pod:4030
23009 #: ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:4059
23010 #: ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4167
23011 #: ../src/guestfs-actions.pod:4187 ../src/guestfs-actions.pod:4204
23012 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:4250
23013 #: ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4304
23014 #: ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4358
23015 #: ../src/guestfs-actions.pod:4370 ../src/guestfs-actions.pod:4406
23016 #: ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4435
23017 #: ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4467
23018 #: ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:4580
23019 #: ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4644
23020 #: ../src/guestfs-actions.pod:4662 ../src/guestfs-actions.pod:4680
23021 #: ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:4710
23022 #: ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4741
23023 #: ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4783
23024 #: ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4919
23025 #: ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4969
23026 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5000
23027 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5030
23028 #: ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5060
23029 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5118
23030 #: ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5177
23031 #: ../src/guestfs-actions.pod:5191 ../src/guestfs-actions.pod:5208
23032 #: ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5310
23033 #: ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5400
23034 #: ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5445
23035 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5603
23036 #: ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5682
23037 #: ../src/guestfs-actions.pod:5700 ../src/guestfs-actions.pod:5732
23038 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5815
23039 #: ../src/guestfs-actions.pod:5828 ../src/guestfs-actions.pod:5842
23040 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
23041 #: ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6183
23042 #: ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6209
23043 #: ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6235
23044 #: ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6272
23045 #: ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310
23046 #: ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6358
23047 #: ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6399
23048 #: ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6439
23049 #: ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6475
23050 #: ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6522
23051 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565
23052 #: ../src/guestfs-actions.pod:6581 ../src/guestfs-actions.pod:6605
23053 #: ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6639
23054 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6702
23055 #: ../src/guestfs-actions.pod:6732 ../src/guestfs-actions.pod:6765
23056 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:7001
23057 #: ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7026
23058 #: ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7061
23059 #: ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7087
23060 #: ../src/guestfs-actions.pod:7100 ../src/guestfs-actions.pod:7115
23061 #: ../src/guestfs-actions.pod:7174 ../src/guestfs-actions.pod:7191
23062 #: ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7223
23063 #: ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7253
23064 #: ../src/guestfs-actions.pod:7273 ../src/guestfs-actions.pod:7309
23065 #: ../src/guestfs-actions.pod:7323 ../src/guestfs-actions.pod:7364
23066 #: ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7395
23067 #: ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7465
23068 #: ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7596
23069 #: ../src/guestfs-actions.pod:7610 ../src/guestfs-actions.pod:7665
23070 #: ../src/guestfs-actions.pod:7678 ../src/guestfs-actions.pod:7723
23071 #: ../src/guestfs-actions.pod:7763 ../src/guestfs-actions.pod:7819
23072 #: ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7872
23073 #: ../src/guestfs-actions.pod:7936 ../src/guestfs-actions.pod:7959
23074 #: ../src/guestfs-actions.pod:7988
23075 msgid "This function returns 0 on success or -1 on error."
23079 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
23080 #: ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:2096
23081 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2319
23082 #: ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:3796
23083 #: ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:6360
23084 #: ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6626
23085 #: ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7242
23086 #: ../src/guestfs-actions.pod:7765
23087 msgid "(Added in 0.3)"
23091 #: ../src/guestfs-actions.pod:41
23092 msgid "guestfs_add_domain"
23096 #: ../src/guestfs-actions.pod:43
23100 " guestfs_add_domain (guestfs_h *g,\n"
23101 " const char *dom,\n"
23107 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
23108 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:1161
23109 #: ../src/guestfs-actions.pod:1213 ../src/guestfs-actions.pod:2979
23110 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5104
23111 #: ../src/guestfs-actions.pod:5321
23113 "You may supply a list of optional arguments to this call. Use zero or more "
23114 "of the following pairs of parameters, and terminate the list with C<-1> on "
23115 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23119 #: ../src/guestfs-actions.pod:53
23122 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23123 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23124 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23125 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23126 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23131 #: ../src/guestfs-actions.pod:59
23133 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23134 "It works by connecting to libvirt, requesting the domain and domain XML from "
23135 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23140 #: ../src/guestfs-actions.pod:94
23142 "The other optional parameters are passed directly through to "
23143 "C<guestfs_add_drive_opts>."
23147 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
23148 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
23149 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
23150 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1496
23151 #: ../src/guestfs-actions.pod:1852 ../src/guestfs-actions.pod:2055
23152 #: ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2217
23153 #: ../src/guestfs-actions.pod:2269 ../src/guestfs-actions.pod:2283
23154 #: ../src/guestfs-actions.pod:2306 ../src/guestfs-actions.pod:2621
23155 #: ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3115
23156 #: ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5500
23157 #: ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5938
23158 #: ../src/guestfs-actions.pod:7350 ../src/guestfs-actions.pod:7776
23159 #: ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7802
23160 msgid "On error this function returns -1."
23164 #: ../src/guestfs-actions.pod:99
23165 msgid "(Added in 1.7.4)"
23169 #: ../src/guestfs-actions.pod:101
23170 msgid "guestfs_add_domain_va"
23174 #: ../src/guestfs-actions.pod:103
23178 " guestfs_add_domain_va (guestfs_h *g,\n"
23179 " const char *dom,\n"
23180 " va_list args);\n"
23185 #: ../src/guestfs-actions.pod:108
23186 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23190 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
23191 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
23192 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
23193 #: ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1202
23194 #: ../src/guestfs-actions.pod:1248 ../src/guestfs-actions.pod:1261
23195 #: ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3075
23196 #: ../src/guestfs-actions.pod:4860 ../src/guestfs-actions.pod:4872
23197 #: ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:5144
23198 #: ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5381
23199 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23203 #: ../src/guestfs-actions.pod:112
23204 msgid "guestfs_add_domain_argv"
23208 #: ../src/guestfs-actions.pod:114
23212 " guestfs_add_domain_argv (guestfs_h *g,\n"
23213 " const char *dom,\n"
23214 " const struct guestfs_add_domain_argv *optargs);\n"
23219 #: ../src/guestfs-actions.pod:119
23220 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23224 #: ../src/guestfs-actions.pod:123
23225 msgid "guestfs_add_drive"
23229 #: ../src/guestfs-actions.pod:125
23233 " guestfs_add_drive (guestfs_h *g,\n"
23234 " const char *filename);\n"
23239 #: ../src/guestfs-actions.pod:129
23241 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23242 "optional parameters, so the disk is added writable, with the format being "
23243 "detected automatically."
23247 #: ../src/guestfs-actions.pod:133
23249 "Automatic detection of the format opens you up to a potential security hole "
23250 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23251 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23252 "you should think about replacing calls to this function with calls to "
23253 "C<guestfs_add_drive_opts>, and specifying the format."
23257 #: ../src/guestfs-actions.pod:144
23258 msgid "guestfs_add_drive_opts"
23262 #: ../src/guestfs-actions.pod:146
23266 " guestfs_add_drive_opts (guestfs_h *g,\n"
23267 " const char *filename,\n"
23273 #: ../src/guestfs-actions.pod:156
23276 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23277 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23278 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23283 #: ../src/guestfs-actions.pod:185
23285 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23286 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23287 "Possible formats include C<raw> and C<qcow2>."
23291 #: ../src/guestfs-actions.pod:196
23293 "This rarely-used option lets you emulate the behaviour of the deprecated "
23294 "C<guestfs_add_drive_with_if> call (q.v.)"
23298 #: ../src/guestfs-actions.pod:203
23299 msgid "(Added in 1.5.23)"
23303 #: ../src/guestfs-actions.pod:205
23304 msgid "guestfs_add_drive_opts_va"
23308 #: ../src/guestfs-actions.pod:207
23312 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23313 " const char *filename,\n"
23314 " va_list args);\n"
23319 #: ../src/guestfs-actions.pod:212
23320 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23324 #: ../src/guestfs-actions.pod:216
23325 msgid "guestfs_add_drive_opts_argv"
23329 #: ../src/guestfs-actions.pod:218
23333 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23334 " const char *filename,\n"
23335 " const struct guestfs_add_drive_opts_argv *optargs);\n"
23340 #: ../src/guestfs-actions.pod:223
23341 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23345 #: ../src/guestfs-actions.pod:227
23346 msgid "guestfs_add_drive_ro"
23350 #: ../src/guestfs-actions.pod:229
23354 " guestfs_add_drive_ro (guestfs_h *g,\n"
23355 " const char *filename);\n"
23360 #: ../src/guestfs-actions.pod:233
23362 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23363 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23364 "disk is added read-only, with the format being detected automatically."
23368 #: ../src/guestfs-actions.pod:240
23369 msgid "(Added in 1.0.38)"
23373 #: ../src/guestfs-actions.pod:242
23374 msgid "guestfs_add_drive_ro_with_if"
23378 #: ../src/guestfs-actions.pod:244
23382 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23383 " const char *filename,\n"
23384 " const char *iface);\n"
23389 #: ../src/guestfs-actions.pod:256
23391 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23392 "QEMU interface emulation to use at run time."
23396 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
23397 #: ../src/guestfs-actions.pod:2580
23398 msgid "(Added in 1.0.84)"
23402 #: ../src/guestfs-actions.pod:263
23403 msgid "guestfs_add_drive_with_if"
23407 #: ../src/guestfs-actions.pod:265
23411 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23412 " const char *filename,\n"
23413 " const char *iface);\n"
23418 #: ../src/guestfs-actions.pod:277
23420 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23421 "QEMU interface emulation to use at run time."
23425 #: ../src/guestfs-actions.pod:284
23426 msgid "guestfs_aug_clear"
23430 #: ../src/guestfs-actions.pod:286
23434 " guestfs_aug_clear (guestfs_h *g,\n"
23435 " const char *augpath);\n"
23440 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2308
23441 msgid "(Added in 1.3.4)"
23445 #: ../src/guestfs-actions.pod:297
23446 msgid "guestfs_aug_close"
23450 #: ../src/guestfs-actions.pod:299
23454 " guestfs_aug_close (guestfs_h *g);\n"
23459 #: ../src/guestfs-actions.pod:302
23461 "Close the current Augeas handle and free up any resources used by it. After "
23462 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23463 "any other Augeas functions."
23467 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
23468 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
23469 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
23470 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
23471 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
23472 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
23473 #: ../src/guestfs-actions.pod:5989
23474 msgid "(Added in 0.7)"
23478 #: ../src/guestfs-actions.pod:311
23479 msgid "guestfs_aug_defnode"
23483 #: ../src/guestfs-actions.pod:313
23486 " struct guestfs_int_bool *\n"
23487 " guestfs_aug_defnode (guestfs_h *g,\n"
23488 " const char *name,\n"
23489 " const char *expr,\n"
23490 " const char *val);\n"
23495 #: ../src/guestfs-actions.pod:322
23497 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23498 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23499 "containing that single node."
23503 #: ../src/guestfs-actions.pod:330
23505 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23506 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23510 #: ../src/guestfs-actions.pod:336
23511 msgid "guestfs_aug_defvar"
23515 #: ../src/guestfs-actions.pod:338
23519 " guestfs_aug_defvar (guestfs_h *g,\n"
23520 " const char *name,\n"
23521 " const char *expr);\n"
23526 #: ../src/guestfs-actions.pod:354
23527 msgid "guestfs_aug_get"
23531 #: ../src/guestfs-actions.pod:356
23535 " guestfs_aug_get (guestfs_h *g,\n"
23536 " const char *augpath);\n"
23541 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
23542 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
23543 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
23544 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1382
23545 #: ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1535
23546 #: ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1835
23547 #: ../src/guestfs-actions.pod:1998 ../src/guestfs-actions.pod:2015
23548 #: ../src/guestfs-actions.pod:2082 ../src/guestfs-actions.pod:2125
23549 #: ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:2331
23550 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2749
23551 #: ../src/guestfs-actions.pod:2843 ../src/guestfs-actions.pod:2947
23552 #: ../src/guestfs-actions.pod:2966 ../src/guestfs-actions.pod:3180
23553 #: ../src/guestfs-actions.pod:3208 ../src/guestfs-actions.pod:3229
23554 #: ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3322
23555 #: ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3362
23556 #: ../src/guestfs-actions.pod:3989 ../src/guestfs-actions.pod:4342
23557 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4622
23558 #: ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:5717
23559 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:6065
23560 #: ../src/guestfs-actions.pod:6114 ../src/guestfs-actions.pod:6786
23561 #: ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6826
23562 #: ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:7524
23563 #: ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7561
23564 #: ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:8052
23566 "This function returns a string, or NULL on error. I<The caller must free "
23567 "the returned string after use>."
23571 #: ../src/guestfs-actions.pod:368
23572 msgid "guestfs_aug_init"
23576 #: ../src/guestfs-actions.pod:370
23580 " guestfs_aug_init (guestfs_h *g,\n"
23581 " const char *root,\n"
23587 #: ../src/guestfs-actions.pod:379
23588 msgid "You must call this before using any other C<guestfs_aug_*> commands."
23592 #: ../src/guestfs-actions.pod:404
23594 "This option is only useful when debugging Augeas lenses. Use of this option "
23595 "may require additional memory for the libguestfs appliance. You may need to "
23596 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
23597 "C<guestfs_set_memsize>."
23601 #: ../src/guestfs-actions.pod:419
23602 msgid "Do not load the tree in C<guestfs_aug_init>."
23606 #: ../src/guestfs-actions.pod:423
23607 msgid "To close the handle, you can call C<guestfs_aug_close>."
23611 #: ../src/guestfs-actions.pod:431
23612 msgid "guestfs_aug_insert"
23616 #: ../src/guestfs-actions.pod:433
23620 " guestfs_aug_insert (guestfs_h *g,\n"
23621 " const char *augpath,\n"
23622 " const char *label,\n"
23628 #: ../src/guestfs-actions.pod:451
23629 msgid "guestfs_aug_load"
23633 #: ../src/guestfs-actions.pod:453
23637 " guestfs_aug_load (guestfs_h *g);\n"
23642 #: ../src/guestfs-actions.pod:465
23643 msgid "guestfs_aug_ls"
23647 #: ../src/guestfs-actions.pod:467
23651 " guestfs_aug_ls (guestfs_h *g,\n"
23652 " const char *augpath);\n"
23657 #: ../src/guestfs-actions.pod:471
23659 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
23660 "sorting the resulting nodes into alphabetical order."
23664 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
23665 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
23666 #: ../src/guestfs-actions.pod:1550 ../src/guestfs-actions.pod:1569
23667 #: ../src/guestfs-actions.pod:1672 ../src/guestfs-actions.pod:1691
23668 #: ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2403
23669 #: ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2438
23670 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2527
23671 #: ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2647
23672 #: ../src/guestfs-actions.pod:2908 ../src/guestfs-actions.pod:3282
23673 #: ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3872
23674 #: ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3909
23675 #: ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4076
23676 #: ../src/guestfs-actions.pod:4484 ../src/guestfs-actions.pod:5241
23677 #: ../src/guestfs-actions.pod:5859 ../src/guestfs-actions.pod:5985
23678 #: ../src/guestfs-actions.pod:6099 ../src/guestfs-actions.pod:6866
23679 #: ../src/guestfs-actions.pod:6927 ../src/guestfs-actions.pod:6982
23680 #: ../src/guestfs-actions.pod:7128 ../src/guestfs-actions.pod:7152
23681 #: ../src/guestfs-actions.pod:7628 ../src/guestfs-actions.pod:7648
23682 #: ../src/guestfs-actions.pod:7695 ../src/guestfs-actions.pod:7889
23683 #: ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:8002
23684 #: ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8067
23685 #: ../src/guestfs-actions.pod:8086
23687 "This function returns a NULL-terminated array of strings (like L<environ(3)"
23688 ">), or NULL if there was an error. I<The caller must free the strings and "
23689 "the array after use>."
23693 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
23694 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1607
23695 #: ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3667
23696 #: ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4375
23697 #: ../src/guestfs-actions.pod:4562 ../src/guestfs-actions.pod:4595
23698 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:5245
23699 #: ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:6197
23700 #: ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6223
23701 #: ../src/guestfs-actions.pod:6707 ../src/guestfs-actions.pod:7366
23702 #: ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7612
23703 #: ../src/guestfs-actions.pod:7877
23704 msgid "(Added in 0.8)"
23708 #: ../src/guestfs-actions.pod:480
23709 msgid "guestfs_aug_match"
23713 #: ../src/guestfs-actions.pod:482
23717 " guestfs_aug_match (guestfs_h *g,\n"
23718 " const char *augpath);\n"
23723 #: ../src/guestfs-actions.pod:496
23724 msgid "guestfs_aug_mv"
23728 #: ../src/guestfs-actions.pod:498
23732 " guestfs_aug_mv (guestfs_h *g,\n"
23733 " const char *src,\n"
23734 " const char *dest);\n"
23739 #: ../src/guestfs-actions.pod:510
23740 msgid "guestfs_aug_rm"
23744 #: ../src/guestfs-actions.pod:512
23748 " guestfs_aug_rm (guestfs_h *g,\n"
23749 " const char *augpath);\n"
23754 #: ../src/guestfs-actions.pod:524
23755 msgid "guestfs_aug_save"
23759 #: ../src/guestfs-actions.pod:526
23763 " guestfs_aug_save (guestfs_h *g);\n"
23768 #: ../src/guestfs-actions.pod:531
23770 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
23775 #: ../src/guestfs-actions.pod:538
23776 msgid "guestfs_aug_set"
23780 #: ../src/guestfs-actions.pod:540
23784 " guestfs_aug_set (guestfs_h *g,\n"
23785 " const char *augpath,\n"
23786 " const char *val);\n"
23791 #: ../src/guestfs-actions.pod:547
23793 "In the Augeas API, it is possible to clear a node by setting the value to "
23794 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
23795 "this call. Instead you must use the C<guestfs_aug_clear> call."
23799 #: ../src/guestfs-actions.pod:556
23800 msgid "guestfs_available"
23804 #: ../src/guestfs-actions.pod:558
23808 " guestfs_available (guestfs_h *g,\n"
23809 " char *const *groups);\n"
23814 #: ../src/guestfs-actions.pod:566
23816 "The libguestfs groups, and the functions that those groups correspond to, "
23817 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
23818 "runtime by calling C<guestfs_available_all_groups>."
23822 #: ../src/guestfs-actions.pod:590
23823 msgid "You must call C<guestfs_launch> before calling this function."
23827 #: ../src/guestfs-actions.pod:612
23829 "This call was added in version C<1.0.80>. In previous versions of "
23830 "libguestfs all you could do would be to speculatively execute a command to "
23831 "find out if the daemon implemented it. See also C<guestfs_version>."
23835 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1352
23836 msgid "(Added in 1.0.80)"
23840 #: ../src/guestfs-actions.pod:623
23841 msgid "guestfs_available_all_groups"
23845 #: ../src/guestfs-actions.pod:625
23849 " guestfs_available_all_groups (guestfs_h *g);\n"
23854 #: ../src/guestfs-actions.pod:628
23856 "This command returns a list of all optional groups that this daemon knows "
23857 "about. Note this returns both supported and unsupported groups. To find "
23858 "out which ones the daemon can actually support you have to call "
23859 "C<guestfs_available> on each member of the returned list."
23863 #: ../src/guestfs-actions.pod:634
23864 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
23868 #: ../src/guestfs-actions.pod:640
23869 msgid "(Added in 1.3.15)"
23873 #: ../src/guestfs-actions.pod:642
23874 msgid "guestfs_base64_in"
23878 #: ../src/guestfs-actions.pod:644
23882 " guestfs_base64_in (guestfs_h *g,\n"
23883 " const char *base64file,\n"
23884 " const char *filename);\n"
23889 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
23890 msgid "(Added in 1.3.5)"
23894 #: ../src/guestfs-actions.pod:656
23895 msgid "guestfs_base64_out"
23899 #: ../src/guestfs-actions.pod:658
23903 " guestfs_base64_out (guestfs_h *g,\n"
23904 " const char *filename,\n"
23905 " const char *base64file);\n"
23910 #: ../src/guestfs-actions.pod:670
23911 msgid "guestfs_blockdev_flushbufs"
23915 #: ../src/guestfs-actions.pod:672
23919 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
23920 " const char *device);\n"
23925 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
23926 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
23927 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
23928 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
23929 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
23930 msgid "(Added in 0.9.3)"
23934 #: ../src/guestfs-actions.pod:685
23935 msgid "guestfs_blockdev_getbsz"
23939 #: ../src/guestfs-actions.pod:687
23943 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
23944 " const char *device);\n"
23949 #: ../src/guestfs-actions.pod:702
23950 msgid "guestfs_blockdev_getro"
23954 #: ../src/guestfs-actions.pod:704
23958 " guestfs_blockdev_getro (guestfs_h *g,\n"
23959 " const char *device);\n"
23964 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1590
23965 #: ../src/guestfs-actions.pod:1605 ../src/guestfs-actions.pod:2094
23966 #: ../src/guestfs-actions.pod:2105 ../src/guestfs-actions.pod:2177
23967 #: ../src/guestfs-actions.pod:2203 ../src/guestfs-actions.pod:2243
23968 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:2294
23969 #: ../src/guestfs-actions.pod:2317 ../src/guestfs-actions.pod:3379
23970 #: ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3413
23971 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3589
23972 #: ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:3618
23973 #: ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3649
23974 #: ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:3679
23975 #: ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3706
23976 #: ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:3736
23977 #: ../src/guestfs-actions.pod:3749 ../src/guestfs-actions.pod:3763
23978 #: ../src/guestfs-actions.pod:5482
23979 msgid "This function returns a C truth value on success or -1 on error."
23983 #: ../src/guestfs-actions.pod:717
23984 msgid "guestfs_blockdev_getsize64"
23988 #: ../src/guestfs-actions.pod:719
23992 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
23993 " const char *device);\n"
23998 #: ../src/guestfs-actions.pod:725
23999 msgid "See also C<guestfs_blockdev_getsz>."
24003 #: ../src/guestfs-actions.pod:733
24004 msgid "guestfs_blockdev_getss"
24008 #: ../src/guestfs-actions.pod:735
24012 " guestfs_blockdev_getss (guestfs_h *g,\n"
24013 " const char *device);\n"
24018 #: ../src/guestfs-actions.pod:742
24020 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24025 #: ../src/guestfs-actions.pod:751
24026 msgid "guestfs_blockdev_getsz"
24030 #: ../src/guestfs-actions.pod:753
24034 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24035 " const char *device);\n"
24040 #: ../src/guestfs-actions.pod:760
24042 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24043 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24047 #: ../src/guestfs-actions.pod:770
24048 msgid "guestfs_blockdev_rereadpt"
24052 #: ../src/guestfs-actions.pod:772
24056 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24057 " const char *device);\n"
24062 #: ../src/guestfs-actions.pod:784
24063 msgid "guestfs_blockdev_setbsz"
24067 #: ../src/guestfs-actions.pod:786
24071 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24072 " const char *device,\n"
24073 " int blocksize);\n"
24078 #: ../src/guestfs-actions.pod:802
24079 msgid "guestfs_blockdev_setro"
24083 #: ../src/guestfs-actions.pod:804
24087 " guestfs_blockdev_setro (guestfs_h *g,\n"
24088 " const char *device);\n"
24093 #: ../src/guestfs-actions.pod:816
24094 msgid "guestfs_blockdev_setrw"
24098 #: ../src/guestfs-actions.pod:818
24102 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24103 " const char *device);\n"
24108 #: ../src/guestfs-actions.pod:830
24109 msgid "guestfs_btrfs_filesystem_resize"
24113 #: ../src/guestfs-actions.pod:832
24117 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24118 " const char *mountpoint,\n"
24124 #: ../src/guestfs-actions.pod:842
24127 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24132 #: ../src/guestfs-actions.pod:865
24133 msgid "(Added in 1.11.17)"
24137 #: ../src/guestfs-actions.pod:867
24138 msgid "guestfs_btrfs_filesystem_resize_va"
24142 #: ../src/guestfs-actions.pod:869
24146 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24147 " const char *mountpoint,\n"
24148 " va_list args);\n"
24153 #: ../src/guestfs-actions.pod:874
24154 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24158 #: ../src/guestfs-actions.pod:878
24159 msgid "guestfs_btrfs_filesystem_resize_argv"
24163 #: ../src/guestfs-actions.pod:880
24167 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24168 " const char *mountpoint,\n"
24169 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24174 #: ../src/guestfs-actions.pod:885
24175 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24179 #: ../src/guestfs-actions.pod:889
24180 msgid "guestfs_case_sensitive_path"
24184 #: ../src/guestfs-actions.pod:891
24188 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24189 " const char *path);\n"
24194 #: ../src/guestfs-actions.pod:917
24196 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
24197 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24198 "how the directories were originally created under Windows)."
24202 #: ../src/guestfs-actions.pod:925
24203 msgid "See also C<guestfs_realpath>."
24207 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7546
24208 msgid "(Added in 1.0.75)"
24212 #: ../src/guestfs-actions.pod:932
24213 msgid "guestfs_cat"
24217 #: ../src/guestfs-actions.pod:934
24221 " guestfs_cat (guestfs_h *g,\n"
24222 " const char *path);\n"
24227 #: ../src/guestfs-actions.pod:940
24229 "Note that this function cannot correctly handle binary files (specifically, "
24230 "files containing C<\\0> character which is treated as end of string). For "
24231 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24232 "functions which have a more complex interface."
24236 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3893
24237 #: ../src/guestfs-actions.pod:3975 ../src/guestfs-actions.pod:3992
24238 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4488
24239 #: ../src/guestfs-actions.pod:4502 ../src/guestfs-actions.pod:5863
24240 #: ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:7699
24241 #: ../src/guestfs-actions.pod:7713
24242 msgid "(Added in 0.4)"
24246 #: ../src/guestfs-actions.pod:953
24247 msgid "guestfs_checksum"
24251 #: ../src/guestfs-actions.pod:955
24255 " guestfs_checksum (guestfs_h *g,\n"
24256 " const char *csumtype,\n"
24257 " const char *path);\n"
24262 #: ../src/guestfs-actions.pod:1001
24263 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24267 #: ../src/guestfs-actions.pod:1003
24268 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24272 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1427
24273 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:3591
24274 #: ../src/guestfs-actions.pod:3620 ../src/guestfs-actions.pod:3681
24275 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:7402
24276 msgid "(Added in 1.0.2)"
24280 #: ../src/guestfs-actions.pod:1010
24281 msgid "guestfs_checksum_device"
24285 #: ../src/guestfs-actions.pod:1012
24289 " guestfs_checksum_device (guestfs_h *g,\n"
24290 " const char *csumtype,\n"
24291 " const char *device);\n"
24296 #: ../src/guestfs-actions.pod:1017
24298 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24299 "device named C<device>. For the types of checksums supported see the "
24300 "C<guestfs_checksum> command."
24304 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5312
24305 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5484
24306 #: ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5684
24307 #: ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7325
24308 #: ../src/guestfs-actions.pod:7725
24309 msgid "(Added in 1.3.2)"
24313 #: ../src/guestfs-actions.pod:1026
24314 msgid "guestfs_checksums_out"
24318 #: ../src/guestfs-actions.pod:1028
24322 " guestfs_checksums_out (guestfs_h *g,\n"
24323 " const char *csumtype,\n"
24324 " const char *directory,\n"
24325 " const char *sumsfile);\n"
24330 #: ../src/guestfs-actions.pod:1048
24331 msgid "(Added in 1.3.7)"
24335 #: ../src/guestfs-actions.pod:1050
24336 msgid "guestfs_chmod"
24340 #: ../src/guestfs-actions.pod:1052
24344 " guestfs_chmod (guestfs_h *g,\n"
24346 " const char *path);\n"
24351 #: ../src/guestfs-actions.pod:1070
24352 msgid "guestfs_chown"
24356 #: ../src/guestfs-actions.pod:1072
24360 " guestfs_chown (guestfs_h *g,\n"
24363 " const char *path);\n"
24368 #: ../src/guestfs-actions.pod:1088
24369 msgid "guestfs_command"
24373 #: ../src/guestfs-actions.pod:1090
24377 " guestfs_command (guestfs_h *g,\n"
24378 " char *const *arguments);\n"
24383 #: ../src/guestfs-actions.pod:1099
24385 "The single parameter is an argv-style list of arguments. The first element "
24386 "is the name of the program to run. Subsequent elements are parameters. The "
24387 "list must be non-empty (ie. must contain a program name). Note that the "
24388 "command runs directly, and is I<not> invoked via the shell (see "
24393 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
24394 #: ../src/guestfs-actions.pod:1726
24395 msgid "(Added in 0.9.1)"
24399 #: ../src/guestfs-actions.pod:1132
24400 msgid "guestfs_command_lines"
24404 #: ../src/guestfs-actions.pod:1134
24408 " guestfs_command_lines (guestfs_h *g,\n"
24409 " char *const *arguments);\n"
24414 #: ../src/guestfs-actions.pod:1138
24416 "This is the same as C<guestfs_command>, but splits the result into a list of "
24421 #: ../src/guestfs-actions.pod:1141
24422 msgid "See also: C<guestfs_sh_lines>"
24426 #: ../src/guestfs-actions.pod:1152
24427 msgid "guestfs_compress_device_out"
24431 #: ../src/guestfs-actions.pod:1154
24435 " guestfs_compress_device_out (guestfs_h *g,\n"
24436 " const char *ctype,\n"
24437 " const char *device,\n"
24438 " const char *zdevice,\n"
24444 #: ../src/guestfs-actions.pod:1166
24447 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24452 #: ../src/guestfs-actions.pod:1171
24454 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24455 "C<guestfs_compress_out>."
24459 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1235
24460 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:6583
24461 msgid "(Added in 1.13.15)"
24465 #: ../src/guestfs-actions.pod:1178
24466 msgid "guestfs_compress_device_out_va"
24470 #: ../src/guestfs-actions.pod:1180
24474 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24475 " const char *ctype,\n"
24476 " const char *device,\n"
24477 " const char *zdevice,\n"
24478 " va_list args);\n"
24483 #: ../src/guestfs-actions.pod:1187
24484 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24488 #: ../src/guestfs-actions.pod:1191
24489 msgid "guestfs_compress_device_out_argv"
24493 #: ../src/guestfs-actions.pod:1193
24497 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24498 " const char *ctype,\n"
24499 " const char *device,\n"
24500 " const char *zdevice,\n"
24501 " const struct guestfs_compress_device_out_argv *optargs);\n"
24506 #: ../src/guestfs-actions.pod:1200
24507 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24511 #: ../src/guestfs-actions.pod:1204
24512 msgid "guestfs_compress_out"
24516 #: ../src/guestfs-actions.pod:1206
24520 " guestfs_compress_out (guestfs_h *g,\n"
24521 " const char *ctype,\n"
24522 " const char *file,\n"
24523 " const char *zfile,\n"
24529 #: ../src/guestfs-actions.pod:1218
24532 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24537 #: ../src/guestfs-actions.pod:1237
24538 msgid "guestfs_compress_out_va"
24542 #: ../src/guestfs-actions.pod:1239
24546 " guestfs_compress_out_va (guestfs_h *g,\n"
24547 " const char *ctype,\n"
24548 " const char *file,\n"
24549 " const char *zfile,\n"
24550 " va_list args);\n"
24555 #: ../src/guestfs-actions.pod:1246
24556 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24560 #: ../src/guestfs-actions.pod:1250
24561 msgid "guestfs_compress_out_argv"
24565 #: ../src/guestfs-actions.pod:1252
24569 " guestfs_compress_out_argv (guestfs_h *g,\n"
24570 " const char *ctype,\n"
24571 " const char *file,\n"
24572 " const char *zfile,\n"
24573 " const struct guestfs_compress_out_argv *optargs);\n"
24578 #: ../src/guestfs-actions.pod:1259
24579 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24583 #: ../src/guestfs-actions.pod:1263
24584 msgid "guestfs_config"
24588 #: ../src/guestfs-actions.pod:1265
24592 " guestfs_config (guestfs_h *g,\n"
24593 " const char *qemuparam,\n"
24594 " const char *qemuvalue);\n"
24599 #: ../src/guestfs-actions.pod:1283
24600 msgid "guestfs_copy_size"
24604 #: ../src/guestfs-actions.pod:1285
24608 " guestfs_copy_size (guestfs_h *g,\n"
24609 " const char *src,\n"
24610 " const char *dest,\n"
24611 " int64_t size);\n"
24616 #: ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1422
24617 #: ../src/guestfs-actions.pod:1453 ../src/guestfs-actions.pod:1498
24618 #: ../src/guestfs-actions.pod:1875 ../src/guestfs-actions.pod:1897
24619 #: ../src/guestfs-actions.pod:3791 ../src/guestfs-actions.pod:7397
24620 #: ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7938
24621 #: ../src/guestfs-actions.pod:7961
24623 "This long-running command can generate progress notification messages so "
24624 "that the caller can display a progress bar or indicator. To receive these "
24625 "messages, the caller must register a progress event callback. See L<guestfs"
24626 "(3)/GUESTFS_EVENT_PROGRESS>."
24630 #: ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:4515
24631 #: ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:7632
24632 #: ../src/guestfs-actions.pod:7652 ../src/guestfs-actions.pod:7738
24633 msgid "(Added in 1.0.87)"
24637 #: ../src/guestfs-actions.pod:1306
24642 #: ../src/guestfs-actions.pod:1308
24646 " guestfs_cp (guestfs_h *g,\n"
24647 " const char *src,\n"
24648 " const char *dest);\n"
24653 #: ../src/guestfs-actions.pod:1318 ../src/guestfs-actions.pod:1332
24654 #: ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1478
24655 #: ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:5259
24656 #: ../src/guestfs-actions.pod:5734
24657 msgid "(Added in 1.0.18)"
24661 #: ../src/guestfs-actions.pod:1320
24662 msgid "guestfs_cp_a"
24666 #: ../src/guestfs-actions.pod:1322
24670 " guestfs_cp_a (guestfs_h *g,\n"
24671 " const char *src,\n"
24672 " const char *dest);\n"
24677 #: ../src/guestfs-actions.pod:1334
24682 #: ../src/guestfs-actions.pod:1336
24686 " guestfs_dd (guestfs_h *g,\n"
24687 " const char *src,\n"
24688 " const char *dest);\n"
24693 #: ../src/guestfs-actions.pod:1346
24695 "If the destination is a device, it must be as large or larger than the "
24696 "source file or device, otherwise the copy will fail. This command cannot do "
24697 "partial copies (see C<guestfs_copy_size>)."
24701 #: ../src/guestfs-actions.pod:1354
24706 #: ../src/guestfs-actions.pod:1356
24710 " guestfs_df (guestfs_h *g);\n"
24715 #: ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378
24717 "This command is mostly useful for interactive sessions. It is I<not> "
24718 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
24723 #: ../src/guestfs-actions.pod:1368 ../src/guestfs-actions.pod:1385
24724 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:2510
24725 #: ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2602
24726 #: ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:5159
24727 #: ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7159
24728 #: ../src/guestfs-actions.pod:7778 ../src/guestfs-actions.pod:7791
24729 #: ../src/guestfs-actions.pod:7804
24730 msgid "(Added in 1.0.54)"
24734 #: ../src/guestfs-actions.pod:1370
24735 msgid "guestfs_df_h"
24739 #: ../src/guestfs-actions.pod:1372
24743 " guestfs_df_h (guestfs_h *g);\n"
24748 #: ../src/guestfs-actions.pod:1387
24749 msgid "guestfs_dmesg"
24753 #: ../src/guestfs-actions.pod:1389
24757 " guestfs_dmesg (guestfs_h *g);\n"
24762 #: ../src/guestfs-actions.pod:1396
24764 "Another way to get the same information is to enable verbose messages with "
24765 "C<guestfs_set_verbose> or by setting the environment variable "
24766 "C<LIBGUESTFS_DEBUG=1> before running the program."
24770 #: ../src/guestfs-actions.pod:1406
24771 msgid "guestfs_download"
24775 #: ../src/guestfs-actions.pod:1408
24779 " guestfs_download (guestfs_h *g,\n"
24780 " const char *remotefilename,\n"
24781 " const char *filename);\n"
24786 #: ../src/guestfs-actions.pod:1418
24787 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
24791 #: ../src/guestfs-actions.pod:1429
24792 msgid "guestfs_download_offset"
24796 #: ../src/guestfs-actions.pod:1431
24800 " guestfs_download_offset (guestfs_h *g,\n"
24801 " const char *remotefilename,\n"
24802 " const char *filename,\n"
24803 " int64_t offset,\n"
24804 " int64_t size);\n"
24809 #: ../src/guestfs-actions.pod:1444
24811 "Note that there is no limit on the amount of data that can be downloaded "
24812 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
24813 "full amount unless an error occurs."
24817 #: ../src/guestfs-actions.pod:1449
24818 msgid "See also C<guestfs_download>, C<guestfs_pread>."
24822 #: ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:7436
24823 msgid "(Added in 1.5.17)"
24827 #: ../src/guestfs-actions.pod:1460
24828 msgid "guestfs_drop_caches"
24832 #: ../src/guestfs-actions.pod:1462
24836 " guestfs_drop_caches (guestfs_h *g,\n"
24837 " int whattodrop);\n"
24842 #: ../src/guestfs-actions.pod:1480
24847 #: ../src/guestfs-actions.pod:1482
24851 " guestfs_du (guestfs_h *g,\n"
24852 " const char *path);\n"
24857 #: ../src/guestfs-actions.pod:1505
24858 msgid "guestfs_e2fsck_f"
24862 #: ../src/guestfs-actions.pod:1507
24866 " guestfs_e2fsck_f (guestfs_h *g,\n"
24867 " const char *device);\n"
24872 #: ../src/guestfs-actions.pod:1515
24874 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
24875 "Normally you should use C<guestfs_fsck>."
24879 #: ../src/guestfs-actions.pod:1520
24880 msgid "(Added in 1.0.29)"
24884 #: ../src/guestfs-actions.pod:1522
24885 msgid "guestfs_echo_daemon"
24889 #: ../src/guestfs-actions.pod:1524
24893 " guestfs_echo_daemon (guestfs_h *g,\n"
24894 " char *const *words);\n"
24899 #: ../src/guestfs-actions.pod:1533
24900 msgid "See also C<guestfs_ping_daemon>."
24904 #: ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:2296
24905 #: ../src/guestfs-actions.pod:6607
24906 msgid "(Added in 1.0.69)"
24910 #: ../src/guestfs-actions.pod:1540
24911 msgid "guestfs_egrep"
24915 #: ../src/guestfs-actions.pod:1542
24919 " guestfs_egrep (guestfs_h *g,\n"
24920 " const char *regex,\n"
24921 " const char *path);\n"
24926 #: ../src/guestfs-actions.pod:1557 ../src/guestfs-actions.pod:1576
24927 #: ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1679
24928 #: ../src/guestfs-actions.pod:1698 ../src/guestfs-actions.pod:2426
24929 #: ../src/guestfs-actions.pod:2445 ../src/guestfs-actions.pod:2623
24930 #: ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2651
24931 #: ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2719
24932 #: ../src/guestfs-actions.pod:2732 ../src/guestfs-actions.pod:4005
24933 #: ../src/guestfs-actions.pod:4019 ../src/guestfs-actions.pod:4032
24934 #: ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:5047
24935 #: ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6117
24936 #: ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7015
24937 #: ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041
24938 #: ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7076
24939 #: ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102
24940 #: ../src/guestfs-actions.pod:7896 ../src/guestfs-actions.pod:7915
24941 #: ../src/guestfs-actions.pod:8009 ../src/guestfs-actions.pod:8028
24942 #: ../src/guestfs-actions.pod:8074 ../src/guestfs-actions.pod:8093
24943 msgid "(Added in 1.0.66)"
24947 #: ../src/guestfs-actions.pod:1559
24948 msgid "guestfs_egrepi"
24952 #: ../src/guestfs-actions.pod:1561
24956 " guestfs_egrepi (guestfs_h *g,\n"
24957 " const char *regex,\n"
24958 " const char *path);\n"
24963 #: ../src/guestfs-actions.pod:1578
24964 msgid "guestfs_equal"
24968 #: ../src/guestfs-actions.pod:1580
24972 " guestfs_equal (guestfs_h *g,\n"
24973 " const char *file1,\n"
24974 " const char *file2);\n"
24979 #: ../src/guestfs-actions.pod:1594
24980 msgid "guestfs_exists"
24984 #: ../src/guestfs-actions.pod:1596
24988 " guestfs_exists (guestfs_h *g,\n"
24989 " const char *path);\n"
24994 #: ../src/guestfs-actions.pod:1603
24995 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
24999 #: ../src/guestfs-actions.pod:1609
25000 msgid "guestfs_fallocate"
25004 #: ../src/guestfs-actions.pod:1611
25008 " guestfs_fallocate (guestfs_h *g,\n"
25009 " const char *path,\n"
25015 #: ../src/guestfs-actions.pod:1616
25017 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25022 #: ../src/guestfs-actions.pod:1635
25023 msgid "guestfs_fallocate64"
25027 #: ../src/guestfs-actions.pod:1637
25031 " guestfs_fallocate64 (guestfs_h *g,\n"
25032 " const char *path,\n"
25038 #: ../src/guestfs-actions.pod:1646
25040 "Note that this call allocates disk blocks for the file. To create a sparse "
25041 "file use C<guestfs_truncate_size> instead."
25045 #: ../src/guestfs-actions.pod:1649
25047 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25048 "oversight it only allowed 30 bit lengths to be specified, effectively "
25049 "limiting the maximum size of files created through that call to 1GB."
25053 #: ../src/guestfs-actions.pod:1660
25054 msgid "(Added in 1.3.17)"
25058 #: ../src/guestfs-actions.pod:1662
25059 msgid "guestfs_fgrep"
25063 #: ../src/guestfs-actions.pod:1664
25067 " guestfs_fgrep (guestfs_h *g,\n"
25068 " const char *pattern,\n"
25069 " const char *path);\n"
25074 #: ../src/guestfs-actions.pod:1681
25075 msgid "guestfs_fgrepi"
25079 #: ../src/guestfs-actions.pod:1683
25083 " guestfs_fgrepi (guestfs_h *g,\n"
25084 " const char *pattern,\n"
25085 " const char *path);\n"
25090 #: ../src/guestfs-actions.pod:1700
25091 msgid "guestfs_file"
25095 #: ../src/guestfs-actions.pod:1702
25099 " guestfs_file (guestfs_h *g,\n"
25100 " const char *path);\n"
25105 #: ../src/guestfs-actions.pod:1720
25107 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25108 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
25112 #: ../src/guestfs-actions.pod:1728
25113 msgid "guestfs_file_architecture"
25117 #: ../src/guestfs-actions.pod:1730
25121 " guestfs_file_architecture (guestfs_h *g,\n"
25122 " const char *filename);\n"
25127 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2001
25128 #: ../src/guestfs-actions.pod:2018 ../src/guestfs-actions.pod:2752
25129 #: ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2912
25130 #: ../src/guestfs-actions.pod:3099 ../src/guestfs-actions.pod:3117
25131 #: ../src/guestfs-actions.pod:3157 ../src/guestfs-actions.pod:3232
25132 #: ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:3562
25133 #: ../src/guestfs-actions.pod:3694
25134 msgid "(Added in 1.5.3)"
25138 #: ../src/guestfs-actions.pod:1840
25139 msgid "guestfs_filesize"
25143 #: ../src/guestfs-actions.pod:1842
25147 " guestfs_filesize (guestfs_h *g,\n"
25148 " const char *file);\n"
25153 #: ../src/guestfs-actions.pod:1848
25155 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
25156 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
25157 "devices, use C<guestfs_blockdev_getsize64>."
25161 #: ../src/guestfs-actions.pod:1854
25162 msgid "(Added in 1.0.82)"
25166 #: ../src/guestfs-actions.pod:1856
25167 msgid "guestfs_fill"
25171 #: ../src/guestfs-actions.pod:1858
25175 " guestfs_fill (guestfs_h *g,\n"
25178 " const char *path);\n"
25183 #: ../src/guestfs-actions.pod:1868
25185 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25186 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
25187 "bytes use C<guestfs_fill_pattern>."
25191 #: ../src/guestfs-actions.pod:1880
25192 msgid "(Added in 1.0.79)"
25196 #: ../src/guestfs-actions.pod:1882
25197 msgid "guestfs_fill_pattern"
25201 #: ../src/guestfs-actions.pod:1884
25205 " guestfs_fill_pattern (guestfs_h *g,\n"
25206 " const char *pattern,\n"
25208 " const char *path);\n"
25213 #: ../src/guestfs-actions.pod:1890
25215 "This function is like C<guestfs_fill> except that it creates a new file of "
25216 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
25217 "pattern is truncated if necessary to ensure the length of the file is "
25218 "exactly C<len> bytes."
25222 #: ../src/guestfs-actions.pod:1902
25223 msgid "(Added in 1.3.12)"
25227 #: ../src/guestfs-actions.pod:1904
25228 msgid "guestfs_find"
25232 #: ../src/guestfs-actions.pod:1906
25236 " guestfs_find (guestfs_h *g,\n"
25237 " const char *directory);\n"
25242 #: ../src/guestfs-actions.pod:1922
25244 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
25248 #: ../src/guestfs-actions.pod:1935
25249 msgid "See also C<guestfs_find0>."
25253 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4452
25254 #: ../src/guestfs-actions.pod:6152
25255 msgid "(Added in 1.0.27)"
25259 #: ../src/guestfs-actions.pod:1946
25260 msgid "guestfs_find0"
25264 #: ../src/guestfs-actions.pod:1948
25268 " guestfs_find0 (guestfs_h *g,\n"
25269 " const char *directory,\n"
25270 " const char *files);\n"
25275 #: ../src/guestfs-actions.pod:1957
25277 "This command works the same way as C<guestfs_find> with the following "
25282 #: ../src/guestfs-actions.pod:1984
25283 msgid "(Added in 1.0.74)"
25287 #: ../src/guestfs-actions.pod:1986
25288 msgid "guestfs_findfs_label"
25292 #: ../src/guestfs-actions.pod:1988
25296 " guestfs_findfs_label (guestfs_h *g,\n"
25297 " const char *label);\n"
25302 #: ../src/guestfs-actions.pod:1996
25303 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25307 #: ../src/guestfs-actions.pod:2003
25308 msgid "guestfs_findfs_uuid"
25312 #: ../src/guestfs-actions.pod:2005
25316 " guestfs_findfs_uuid (guestfs_h *g,\n"
25317 " const char *uuid);\n"
25322 #: ../src/guestfs-actions.pod:2013
25323 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25327 #: ../src/guestfs-actions.pod:2020
25328 msgid "guestfs_fsck"
25332 #: ../src/guestfs-actions.pod:2022
25336 " guestfs_fsck (guestfs_h *g,\n"
25337 " const char *fstype,\n"
25338 " const char *device);\n"
25343 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:7943
25344 msgid "(Added in 1.0.16)"
25348 #: ../src/guestfs-actions.pod:2059
25349 msgid "guestfs_get_append"
25353 #: ../src/guestfs-actions.pod:2061
25357 " guestfs_get_append (guestfs_h *g);\n"
25362 #: ../src/guestfs-actions.pod:2069
25364 "This function returns a string which may be NULL. There is no way to return "
25365 "an error from this function. The string is owned by the guest handle and "
25366 "must I<not> be freed."
25370 #: ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5830
25371 #: ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6770
25372 #: ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6805
25373 #: ../src/guestfs-actions.pod:6829 ../src/guestfs-actions.pod:7583
25374 #: ../src/guestfs-actions.pod:7598 ../src/guestfs-actions.pod:7990
25375 msgid "(Added in 1.0.26)"
25379 #: ../src/guestfs-actions.pod:2075
25380 msgid "guestfs_get_attach_method"
25384 #: ../src/guestfs-actions.pod:2077
25388 " guestfs_get_attach_method (guestfs_h *g);\n"
25393 #: ../src/guestfs-actions.pod:2080
25394 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25398 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:6342
25399 msgid "(Added in 1.9.8)"
25403 #: ../src/guestfs-actions.pod:2087
25404 msgid "guestfs_get_autosync"
25408 #: ../src/guestfs-actions.pod:2089
25412 " guestfs_get_autosync (guestfs_h *g);\n"
25417 #: ../src/guestfs-actions.pod:2098
25418 msgid "guestfs_get_direct"
25422 #: ../src/guestfs-actions.pod:2100
25426 " guestfs_get_direct (guestfs_h *g);\n"
25431 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:6383
25432 msgid "(Added in 1.0.72)"
25436 #: ../src/guestfs-actions.pod:2109
25437 msgid "guestfs_get_e2label"
25441 #: ../src/guestfs-actions.pod:2111
25445 " guestfs_get_e2label (guestfs_h *g,\n"
25446 " const char *device);\n"
25451 #: ../src/guestfs-actions.pod:2115
25453 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25458 #: ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2149
25459 #: ../src/guestfs-actions.pod:6401 ../src/guestfs-actions.pod:6420
25460 msgid "(Added in 1.0.15)"
25464 #: ../src/guestfs-actions.pod:2130
25465 msgid "guestfs_get_e2uuid"
25469 #: ../src/guestfs-actions.pod:2132
25473 " guestfs_get_e2uuid (guestfs_h *g,\n"
25474 " const char *device);\n"
25479 #: ../src/guestfs-actions.pod:2136
25481 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25486 #: ../src/guestfs-actions.pod:2151
25487 msgid "guestfs_get_memsize"
25491 #: ../src/guestfs-actions.pod:2153
25495 " guestfs_get_memsize (guestfs_h *g);\n"
25500 #: ../src/guestfs-actions.pod:2159
25502 "If C<guestfs_set_memsize> was not called on this handle, and if "
25503 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25504 "value for memsize."
25508 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:4743
25509 #: ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:4971
25510 #: ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5002
25511 #: ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5032
25512 #: ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6441
25513 #: ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:7352
25514 msgid "(Added in 1.0.55)"
25518 #: ../src/guestfs-actions.pod:2170
25519 msgid "guestfs_get_network"
25523 #: ../src/guestfs-actions.pod:2172
25527 " guestfs_get_network (guestfs_h *g);\n"
25532 #: ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:6460
25533 msgid "(Added in 1.5.4)"
25537 #: ../src/guestfs-actions.pod:2181
25538 msgid "guestfs_get_path"
25542 #: ../src/guestfs-actions.pod:2183
25546 " guestfs_get_path (guestfs_h *g);\n"
25551 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2231
25553 "This function returns a string, or NULL on error. The string is owned by "
25554 "the guest handle and must I<not> be freed."
25558 #: ../src/guestfs-actions.pod:2196
25559 msgid "guestfs_get_pgroup"
25563 #: ../src/guestfs-actions.pod:2198
25567 " guestfs_get_pgroup (guestfs_h *g);\n"
25572 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6496
25573 #: ../src/guestfs-actions.pod:7844
25574 msgid "(Added in 1.11.18)"
25578 #: ../src/guestfs-actions.pod:2207
25579 msgid "guestfs_get_pid"
25583 #: ../src/guestfs-actions.pod:2209
25587 " guestfs_get_pid (guestfs_h *g);\n"
25592 #: ../src/guestfs-actions.pod:2219
25593 msgid "(Added in 1.0.56)"
25597 #: ../src/guestfs-actions.pod:2221
25598 msgid "guestfs_get_qemu"
25602 #: ../src/guestfs-actions.pod:2223
25606 " guestfs_get_qemu (guestfs_h *g);\n"
25611 #: ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:6524
25612 msgid "(Added in 1.0.6)"
25616 #: ../src/guestfs-actions.pod:2236
25617 msgid "guestfs_get_recovery_proc"
25621 #: ../src/guestfs-actions.pod:2238
25625 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25630 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:3816
25631 #: ../src/guestfs-actions.pod:4147 ../src/guestfs-actions.pod:4550
25632 #: ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:5760
25633 #: ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6548
25634 #: ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7275
25635 #: ../src/guestfs-actions.pod:7467
25636 msgid "(Added in 1.0.77)"
25640 #: ../src/guestfs-actions.pod:2247
25641 msgid "guestfs_get_selinux"
25645 #: ../src/guestfs-actions.pod:2249
25649 " guestfs_get_selinux (guestfs_h *g);\n"
25654 #: ../src/guestfs-actions.pod:2252
25656 "This returns the current setting of the selinux flag which is passed to the "
25657 "appliance at boot time. See C<guestfs_set_selinux>."
25661 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2334
25662 #: ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:6641
25663 msgid "(Added in 1.0.67)"
25667 #: ../src/guestfs-actions.pod:2262
25668 msgid "guestfs_get_smp"
25672 #: ../src/guestfs-actions.pod:2264
25676 " guestfs_get_smp (guestfs_h *g);\n"
25681 #: ../src/guestfs-actions.pod:2273
25682 msgid "guestfs_get_state"
25686 #: ../src/guestfs-actions.pod:2275
25690 " guestfs_get_state (guestfs_h *g);\n"
25695 #: ../src/guestfs-actions.pod:2287
25696 msgid "guestfs_get_trace"
25700 #: ../src/guestfs-actions.pod:2289
25704 " guestfs_get_trace (guestfs_h *g);\n"
25709 #: ../src/guestfs-actions.pod:2298
25710 msgid "guestfs_get_umask"
25714 #: ../src/guestfs-actions.pod:2300
25718 " guestfs_get_umask (guestfs_h *g);\n"
25723 #: ../src/guestfs-actions.pod:2303
25725 "Return the current umask. By default the umask is C<022> unless it has been "
25726 "set by calling C<guestfs_umask>."
25730 #: ../src/guestfs-actions.pod:2310
25731 msgid "guestfs_get_verbose"
25735 #: ../src/guestfs-actions.pod:2312
25739 " guestfs_get_verbose (guestfs_h *g);\n"
25744 #: ../src/guestfs-actions.pod:2321
25745 msgid "guestfs_getcon"
25749 #: ../src/guestfs-actions.pod:2323
25753 " guestfs_getcon (guestfs_h *g);\n"
25758 #: ../src/guestfs-actions.pod:2328
25760 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
25764 #: ../src/guestfs-actions.pod:2336
25765 msgid "guestfs_getxattr"
25769 #: ../src/guestfs-actions.pod:2338
25773 " guestfs_getxattr (guestfs_h *g,\n"
25774 " const char *path,\n"
25775 " const char *name,\n"
25776 " size_t *size_r);\n"
25781 #: ../src/guestfs-actions.pod:2344
25783 "Get a single extended attribute from file C<path> named C<name>. This call "
25784 "follows symlinks. If you want to lookup an extended attribute for the "
25785 "symlink itself, use C<guestfs_lgetxattr>."
25789 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:3830
25791 "Normally it is better to get all extended attributes from a file in one go "
25792 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
25793 "implementations are buggy and do not provide a way to list out attributes. "
25794 "For these filesystems (notably ntfs-3g) you have to know the names of the "
25795 "extended attributes you want in advance and call this function."
25799 #: ../src/guestfs-actions.pod:2358
25800 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
25804 #: ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2573
25805 #: ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3842
25806 #: ../src/guestfs-actions.pod:5753 ../src/guestfs-actions.pod:5779
25807 #: ../src/guestfs-actions.pod:5960
25809 "This function returns a buffer, or NULL on error. The size of the returned "
25810 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
25815 #: ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:3846
25816 msgid "(Added in 1.7.24)"
25820 #: ../src/guestfs-actions.pod:2366
25821 msgid "guestfs_getxattrs"
25825 #: ../src/guestfs-actions.pod:2368
25828 " struct guestfs_xattr_list *\n"
25829 " guestfs_getxattrs (guestfs_h *g,\n"
25830 " const char *path);\n"
25835 #: ../src/guestfs-actions.pod:2378
25836 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
25840 #: ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:3858
25841 #: ../src/guestfs-actions.pod:4546
25843 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
25844 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
25848 #: ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:3862
25849 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4097
25850 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6660
25851 #: ../src/guestfs-actions.pod:8055
25852 msgid "(Added in 1.0.59)"
25856 #: ../src/guestfs-actions.pod:2386
25857 msgid "guestfs_glob_expand"
25861 #: ../src/guestfs-actions.pod:2388
25865 " guestfs_glob_expand (guestfs_h *g,\n"
25866 " const char *pattern);\n"
25871 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6853
25872 #: ../src/guestfs-actions.pod:6870
25873 msgid "(Added in 1.0.50)"
25877 #: ../src/guestfs-actions.pod:2409
25878 msgid "guestfs_grep"
25882 #: ../src/guestfs-actions.pod:2411
25886 " guestfs_grep (guestfs_h *g,\n"
25887 " const char *regex,\n"
25888 " const char *path);\n"
25893 #: ../src/guestfs-actions.pod:2428
25894 msgid "guestfs_grepi"
25898 #: ../src/guestfs-actions.pod:2430
25902 " guestfs_grepi (guestfs_h *g,\n"
25903 " const char *regex,\n"
25904 " const char *path);\n"
25909 #: ../src/guestfs-actions.pod:2447
25910 msgid "guestfs_grub_install"
25914 #: ../src/guestfs-actions.pod:2449
25918 " guestfs_grub_install (guestfs_h *g,\n"
25919 " const char *root,\n"
25920 " const char *device);\n"
25925 #: ../src/guestfs-actions.pod:2492
25926 msgid "(Added in 1.0.17)"
25930 #: ../src/guestfs-actions.pod:2494
25931 msgid "guestfs_head"
25935 #: ../src/guestfs-actions.pod:2496
25939 " guestfs_head (guestfs_h *g,\n"
25940 " const char *path);\n"
25945 #: ../src/guestfs-actions.pod:2512
25946 msgid "guestfs_head_n"
25950 #: ../src/guestfs-actions.pod:2514
25954 " guestfs_head_n (guestfs_h *g,\n"
25956 " const char *path);\n"
25961 #: ../src/guestfs-actions.pod:2536
25962 msgid "guestfs_hexdump"
25966 #: ../src/guestfs-actions.pod:2538
25970 " guestfs_hexdump (guestfs_h *g,\n"
25971 " const char *path);\n"
25976 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:6934
25977 #: ../src/guestfs-actions.pod:6989
25978 msgid "(Added in 1.0.22)"
25982 #: ../src/guestfs-actions.pod:2553
25983 msgid "guestfs_initrd_cat"
25987 #: ../src/guestfs-actions.pod:2555
25991 " guestfs_initrd_cat (guestfs_h *g,\n"
25992 " const char *initrdpath,\n"
25993 " const char *filename,\n"
25994 " size_t *size_r);\n"
25999 #: ../src/guestfs-actions.pod:2571
26000 msgid "See also C<guestfs_initrd_list>."
26004 #: ../src/guestfs-actions.pod:2582
26005 msgid "guestfs_initrd_list"
26009 #: ../src/guestfs-actions.pod:2584
26013 " guestfs_initrd_list (guestfs_h *g,\n"
26014 " const char *path);\n"
26019 #: ../src/guestfs-actions.pod:2604
26020 msgid "guestfs_inotify_add_watch"
26024 #: ../src/guestfs-actions.pod:2606
26028 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26029 " const char *path,\n"
26035 #: ../src/guestfs-actions.pod:2625
26036 msgid "guestfs_inotify_close"
26040 #: ../src/guestfs-actions.pod:2627
26044 " guestfs_inotify_close (guestfs_h *g);\n"
26049 #: ../src/guestfs-actions.pod:2638
26050 msgid "guestfs_inotify_files"
26054 #: ../src/guestfs-actions.pod:2640
26058 " guestfs_inotify_files (guestfs_h *g);\n"
26063 #: ../src/guestfs-actions.pod:2643
26065 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26066 "returns a list of pathnames of objects that were touched. The returned "
26067 "pathnames are sorted and deduplicated."
26071 #: ../src/guestfs-actions.pod:2653
26072 msgid "guestfs_inotify_init"
26076 #: ../src/guestfs-actions.pod:2655
26080 " guestfs_inotify_init (guestfs_h *g,\n"
26081 " int maxevents);\n"
26086 #: ../src/guestfs-actions.pod:2663
26088 "C<maxevents> is the maximum number of events which will be queued up between "
26089 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26090 "passed as C<0>, then the kernel (or previously set) default is used. For "
26091 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26092 "throws away events, but records the fact that it threw them away by setting "
26093 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26094 "C<guestfs_inotify_read>)."
26098 #: ../src/guestfs-actions.pod:2673
26100 "Before any events are generated, you have to add some watches to the "
26101 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26102 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26106 #: ../src/guestfs-actions.pod:2679
26108 "Queued up events should be read periodically by calling "
26109 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26110 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26111 "often enough then you risk the internal queue overflowing."
26115 #: ../src/guestfs-actions.pod:2686
26117 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26118 "This also removes any watches automatically."
26122 #: ../src/guestfs-actions.pod:2699
26123 msgid "guestfs_inotify_read"
26127 #: ../src/guestfs-actions.pod:2701
26130 " struct guestfs_inotify_event_list *\n"
26131 " guestfs_inotify_read (guestfs_h *g);\n"
26136 #: ../src/guestfs-actions.pod:2715
26138 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26139 "there was an error. I<The caller must call "
26140 "C<guestfs_free_inotify_event_list> after use>."
26144 #: ../src/guestfs-actions.pod:2721
26145 msgid "guestfs_inotify_rm_watch"
26149 #: ../src/guestfs-actions.pod:2723
26153 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
26159 #: ../src/guestfs-actions.pod:2727
26161 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
26165 #: ../src/guestfs-actions.pod:2734
26166 msgid "guestfs_inspect_get_arch"
26170 #: ../src/guestfs-actions.pod:2736
26174 " guestfs_inspect_get_arch (guestfs_h *g,\n"
26175 " const char *root);\n"
26180 #: ../src/guestfs-actions.pod:2740
26182 "This returns the architecture of the inspected operating system. The "
26183 "possible return values are listed under C<guestfs_file_architecture>."
26187 #: ../src/guestfs-actions.pod:2754
26188 msgid "guestfs_inspect_get_distro"
26192 #: ../src/guestfs-actions.pod:2756
26196 " guestfs_inspect_get_distro (guestfs_h *g,\n"
26197 " const char *root);\n"
26202 #: ../src/guestfs-actions.pod:2848
26203 msgid "guestfs_inspect_get_drive_mappings"
26207 #: ../src/guestfs-actions.pod:2850
26211 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
26212 " const char *root);\n"
26217 #: ../src/guestfs-actions.pod:2879
26219 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26220 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
26224 #: ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:3151
26225 #: ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5221
26226 #: ../src/guestfs-actions.pod:7291
26228 "This function returns a NULL-terminated array of strings, or NULL if there "
26229 "was an error. The array of strings will always have length C<2n+1>, where "
26230 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26231 "caller must free the strings and the array after use>."
26235 #: ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:3345
26236 msgid "(Added in 1.9.17)"
26240 #: ../src/guestfs-actions.pod:2891
26241 msgid "guestfs_inspect_get_filesystems"
26245 #: ../src/guestfs-actions.pod:2893
26249 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
26250 " const char *root);\n"
26255 #: ../src/guestfs-actions.pod:2905
26257 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26258 "C<guestfs_inspect_get_mountpoints>."
26262 #: ../src/guestfs-actions.pod:2914
26263 msgid "guestfs_inspect_get_format"
26267 #: ../src/guestfs-actions.pod:2916
26271 " guestfs_inspect_get_format (guestfs_h *g,\n"
26272 " const char *root);\n"
26277 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3381
26278 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3415
26279 #: ../src/guestfs-actions.pod:6171
26280 msgid "(Added in 1.9.4)"
26284 #: ../src/guestfs-actions.pod:2952
26285 msgid "guestfs_inspect_get_hostname"
26289 #: ../src/guestfs-actions.pod:2954
26293 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
26294 " const char *root);\n"
26299 #: ../src/guestfs-actions.pod:2969
26300 msgid "(Added in 1.7.9)"
26304 #: ../src/guestfs-actions.pod:2971
26305 msgid "guestfs_inspect_get_icon"
26309 #: ../src/guestfs-actions.pod:2973
26313 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26314 " const char *root,\n"
26315 " size_t *size_r,\n"
26321 #: ../src/guestfs-actions.pod:2984
26324 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26325 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26330 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3876
26331 #: ../src/guestfs-actions.pod:5120
26332 msgid "(Added in 1.11.12)"
26336 #: ../src/guestfs-actions.pod:3053
26337 msgid "guestfs_inspect_get_icon_va"
26341 #: ../src/guestfs-actions.pod:3055
26345 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26346 " const char *root,\n"
26347 " size_t *size_r,\n"
26348 " va_list args);\n"
26353 #: ../src/guestfs-actions.pod:3061
26354 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26358 #: ../src/guestfs-actions.pod:3065
26359 msgid "guestfs_inspect_get_icon_argv"
26363 #: ../src/guestfs-actions.pod:3067
26367 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26368 " const char *root,\n"
26369 " size_t *size_r,\n"
26370 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
26375 #: ../src/guestfs-actions.pod:3073
26376 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26380 #: ../src/guestfs-actions.pod:3077
26381 msgid "guestfs_inspect_get_major_version"
26385 #: ../src/guestfs-actions.pod:3079
26389 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26390 " const char *root);\n"
26395 #: ../src/guestfs-actions.pod:3101
26396 msgid "guestfs_inspect_get_minor_version"
26400 #: ../src/guestfs-actions.pod:3103
26404 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26405 " const char *root);\n"
26410 #: ../src/guestfs-actions.pod:3112
26412 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26413 "C<guestfs_inspect_get_major_version>."
26417 #: ../src/guestfs-actions.pod:3119
26418 msgid "guestfs_inspect_get_mountpoints"
26422 #: ../src/guestfs-actions.pod:3121
26426 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26427 " const char *root);\n"
26432 #: ../src/guestfs-actions.pod:3142
26434 "For operating systems like Windows which still use drive letters, this call "
26435 "will only return an entry for the first drive \"mounted on\" C</>. For "
26436 "information about the mapping of drive letters to partitions, see "
26437 "C<guestfs_inspect_get_drive_mappings>."
26441 #: ../src/guestfs-actions.pod:3148
26443 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26444 "C<guestfs_inspect_get_filesystems>."
26448 #: ../src/guestfs-actions.pod:3159
26449 msgid "guestfs_inspect_get_package_format"
26453 #: ../src/guestfs-actions.pod:3161
26457 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26458 " const char *root);\n"
26463 #: ../src/guestfs-actions.pod:3165
26465 "This function and C<guestfs_inspect_get_package_management> return the "
26466 "package format and package management tool used by the inspected operating "
26467 "system. For example for Fedora these functions would return C<rpm> (package "
26468 "format) and C<yum> (package management)."
26472 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:3211
26473 msgid "(Added in 1.7.5)"
26477 #: ../src/guestfs-actions.pod:3185
26478 msgid "guestfs_inspect_get_package_management"
26482 #: ../src/guestfs-actions.pod:3187
26486 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26487 " const char *root);\n"
26492 #: ../src/guestfs-actions.pod:3191
26494 "C<guestfs_inspect_get_package_format> and this function return the package "
26495 "format and package management tool used by the inspected operating system. "
26496 "For example for Fedora these functions would return C<rpm> (package format) "
26497 "and C<yum> (package management)."
26501 #: ../src/guestfs-actions.pod:3213
26502 msgid "guestfs_inspect_get_product_name"
26506 #: ../src/guestfs-actions.pod:3215
26510 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26511 " const char *root);\n"
26516 #: ../src/guestfs-actions.pod:3234
26517 msgid "guestfs_inspect_get_product_variant"
26521 #: ../src/guestfs-actions.pod:3236
26525 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26526 " const char *root);\n"
26531 #: ../src/guestfs-actions.pod:3259
26533 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26534 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26538 #: ../src/guestfs-actions.pod:3266
26539 msgid "(Added in 1.9.13)"
26543 #: ../src/guestfs-actions.pod:3268
26544 msgid "guestfs_inspect_get_roots"
26548 #: ../src/guestfs-actions.pod:3270
26552 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26557 #: ../src/guestfs-actions.pod:3273
26559 "This function is a convenient way to get the list of root devices, as "
26560 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26561 "the whole inspection process."
26565 #: ../src/guestfs-actions.pod:3277
26567 "This returns an empty list if either no root devices were found or the "
26568 "caller has not called C<guestfs_inspect_os>."
26572 #: ../src/guestfs-actions.pod:3286
26573 msgid "(Added in 1.7.3)"
26577 #: ../src/guestfs-actions.pod:3288
26578 msgid "guestfs_inspect_get_type"
26582 #: ../src/guestfs-actions.pod:3290
26586 " guestfs_inspect_get_type (guestfs_h *g,\n"
26587 " const char *root);\n"
26592 #: ../src/guestfs-actions.pod:3327
26593 msgid "guestfs_inspect_get_windows_current_control_set"
26597 #: ../src/guestfs-actions.pod:3329
26601 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26602 " const char *root);\n"
26607 #: ../src/guestfs-actions.pod:3347
26608 msgid "guestfs_inspect_get_windows_systemroot"
26612 #: ../src/guestfs-actions.pod:3349
26616 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26617 " const char *root);\n"
26622 #: ../src/guestfs-actions.pod:3365
26623 msgid "(Added in 1.5.25)"
26627 #: ../src/guestfs-actions.pod:3367
26628 msgid "guestfs_inspect_is_live"
26632 #: ../src/guestfs-actions.pod:3369
26636 " guestfs_inspect_is_live (guestfs_h *g,\n"
26637 " const char *root);\n"
26642 #: ../src/guestfs-actions.pod:3373
26644 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26645 "disk), then this returns true if a live image was detected on the disk."
26649 #: ../src/guestfs-actions.pod:3383
26650 msgid "guestfs_inspect_is_multipart"
26654 #: ../src/guestfs-actions.pod:3385
26658 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26659 " const char *root);\n"
26664 #: ../src/guestfs-actions.pod:3389
26666 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26667 "disk), then this returns true if the disk is part of a set."
26671 #: ../src/guestfs-actions.pod:3399
26672 msgid "guestfs_inspect_is_netinst"
26676 #: ../src/guestfs-actions.pod:3401
26680 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
26681 " const char *root);\n"
26686 #: ../src/guestfs-actions.pod:3405
26688 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26689 "disk), then this returns true if the disk is a network installer, ie. not a "
26690 "self-contained install CD but one which is likely to require network access "
26691 "to complete the install."
26695 #: ../src/guestfs-actions.pod:3417
26696 msgid "guestfs_inspect_list_applications"
26700 #: ../src/guestfs-actions.pod:3419
26703 " struct guestfs_application_list *\n"
26704 " guestfs_inspect_list_applications (guestfs_h *g,\n"
26705 " const char *root);\n"
26710 #: ../src/guestfs-actions.pod:3425
26712 "I<Note:> This call works differently from other parts of the inspection "
26713 "API. You have to call C<guestfs_inspect_os>, then "
26714 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
26715 "this. Listing applications is a significantly more difficult operation "
26716 "which requires access to the full filesystem. Also note that unlike the "
26717 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
26718 "the libguestfs handle, this call actually reads parts of the mounted "
26719 "filesystems during the call."
26723 #: ../src/guestfs-actions.pod:3515
26725 "This function returns a C<struct guestfs_application_list *>, or NULL if "
26726 "there was an error. I<The caller must call C<guestfs_free_application_list> "
26731 #: ../src/guestfs-actions.pod:3519
26732 msgid "(Added in 1.7.8)"
26736 #: ../src/guestfs-actions.pod:3521
26737 msgid "guestfs_inspect_os"
26741 #: ../src/guestfs-actions.pod:3523
26745 " guestfs_inspect_os (guestfs_h *g);\n"
26750 #: ../src/guestfs-actions.pod:3539
26752 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
26753 "functions in order to query further information about each operating system, "
26754 "such as the name and version."
26758 #: ../src/guestfs-actions.pod:3544
26760 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
26761 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
26762 "the contents. This should be called with no disks currently mounted. The "
26763 "function may also use Augeas, so any existing Augeas handle will be closed."
26767 #: ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3887
26768 #: ../src/guestfs-actions.pod:3969
26769 msgid "See also C<guestfs_list_filesystems>."
26773 #: ../src/guestfs-actions.pod:3564
26774 msgid "guestfs_is_blockdev"
26778 #: ../src/guestfs-actions.pod:3566
26782 " guestfs_is_blockdev (guestfs_h *g,\n"
26783 " const char *path);\n"
26788 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3602
26789 #: ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3647
26790 #: ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3719
26791 #: ../src/guestfs-actions.pod:3734
26792 msgid "See also C<guestfs_stat>."
26796 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3606
26797 #: ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3723
26798 #: ../src/guestfs-actions.pod:3738
26799 msgid "(Added in 1.5.10)"
26803 #: ../src/guestfs-actions.pod:3579
26804 msgid "guestfs_is_busy"
26808 #: ../src/guestfs-actions.pod:3581
26812 " guestfs_is_busy (guestfs_h *g);\n"
26817 #: ../src/guestfs-actions.pod:3593
26818 msgid "guestfs_is_chardev"
26822 #: ../src/guestfs-actions.pod:3595
26826 " guestfs_is_chardev (guestfs_h *g,\n"
26827 " const char *path);\n"
26832 #: ../src/guestfs-actions.pod:3608
26833 msgid "guestfs_is_config"
26837 #: ../src/guestfs-actions.pod:3610
26841 " guestfs_is_config (guestfs_h *g);\n"
26846 #: ../src/guestfs-actions.pod:3622
26847 msgid "guestfs_is_dir"
26851 #: ../src/guestfs-actions.pod:3624
26855 " guestfs_is_dir (guestfs_h *g,\n"
26856 " const char *path);\n"
26861 #: ../src/guestfs-actions.pod:3638
26862 msgid "guestfs_is_fifo"
26866 #: ../src/guestfs-actions.pod:3640
26870 " guestfs_is_fifo (guestfs_h *g,\n"
26871 " const char *path);\n"
26876 #: ../src/guestfs-actions.pod:3653
26877 msgid "guestfs_is_file"
26881 #: ../src/guestfs-actions.pod:3655
26885 " guestfs_is_file (guestfs_h *g,\n"
26886 " const char *path);\n"
26891 #: ../src/guestfs-actions.pod:3669
26892 msgid "guestfs_is_launching"
26896 #: ../src/guestfs-actions.pod:3671
26900 " guestfs_is_launching (guestfs_h *g);\n"
26905 #: ../src/guestfs-actions.pod:3683
26906 msgid "guestfs_is_lv"
26910 #: ../src/guestfs-actions.pod:3685
26914 " guestfs_is_lv (guestfs_h *g,\n"
26915 " const char *device);\n"
26920 #: ../src/guestfs-actions.pod:3696
26921 msgid "guestfs_is_ready"
26925 #: ../src/guestfs-actions.pod:3698
26929 " guestfs_is_ready (guestfs_h *g);\n"
26934 #: ../src/guestfs-actions.pod:3710
26935 msgid "guestfs_is_socket"
26939 #: ../src/guestfs-actions.pod:3712
26943 " guestfs_is_socket (guestfs_h *g,\n"
26944 " const char *path);\n"
26949 #: ../src/guestfs-actions.pod:3725
26950 msgid "guestfs_is_symlink"
26954 #: ../src/guestfs-actions.pod:3727
26958 " guestfs_is_symlink (guestfs_h *g,\n"
26959 " const char *path);\n"
26964 #: ../src/guestfs-actions.pod:3740
26965 msgid "guestfs_is_zero"
26969 #: ../src/guestfs-actions.pod:3742
26973 " guestfs_is_zero (guestfs_h *g,\n"
26974 " const char *path);\n"
26979 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3765
26980 msgid "(Added in 1.11.8)"
26984 #: ../src/guestfs-actions.pod:3753
26985 msgid "guestfs_is_zero_device"
26989 #: ../src/guestfs-actions.pod:3755
26993 " guestfs_is_zero_device (guestfs_h *g,\n"
26994 " const char *device);\n"
26999 #: ../src/guestfs-actions.pod:3767
27000 msgid "guestfs_kill_subprocess"
27004 #: ../src/guestfs-actions.pod:3769
27008 " guestfs_kill_subprocess (guestfs_h *g);\n"
27013 #: ../src/guestfs-actions.pod:3778
27014 msgid "guestfs_launch"
27018 #: ../src/guestfs-actions.pod:3780
27022 " guestfs_launch (guestfs_h *g);\n"
27027 #: ../src/guestfs-actions.pod:3798
27028 msgid "guestfs_lchown"
27032 #: ../src/guestfs-actions.pod:3800
27036 " guestfs_lchown (guestfs_h *g,\n"
27039 " const char *path);\n"
27044 #: ../src/guestfs-actions.pod:3806
27046 "Change the file owner to C<owner> and group to C<group>. This is like "
27047 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27048 "changed, not the target."
27052 #: ../src/guestfs-actions.pod:3818
27053 msgid "guestfs_lgetxattr"
27057 #: ../src/guestfs-actions.pod:3820
27061 " guestfs_lgetxattr (guestfs_h *g,\n"
27062 " const char *path,\n"
27063 " const char *name,\n"
27064 " size_t *size_r);\n"
27069 #: ../src/guestfs-actions.pod:3840
27070 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27074 #: ../src/guestfs-actions.pod:3848
27075 msgid "guestfs_lgetxattrs"
27079 #: ../src/guestfs-actions.pod:3850
27082 " struct guestfs_xattr_list *\n"
27083 " guestfs_lgetxattrs (guestfs_h *g,\n"
27084 " const char *path);\n"
27089 #: ../src/guestfs-actions.pod:3854
27091 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27092 "then it returns the extended attributes of the link itself."
27096 #: ../src/guestfs-actions.pod:3864
27097 msgid "guestfs_list_9p"
27101 #: ../src/guestfs-actions.pod:3866
27105 " guestfs_list_9p (guestfs_h *g);\n"
27110 #: ../src/guestfs-actions.pod:3878
27111 msgid "guestfs_list_devices"
27115 #: ../src/guestfs-actions.pod:3880
27119 " guestfs_list_devices (guestfs_h *g);\n"
27124 #: ../src/guestfs-actions.pod:3895
27125 msgid "guestfs_list_dm_devices"
27129 #: ../src/guestfs-actions.pod:3897
27133 " guestfs_list_dm_devices (guestfs_h *g);\n"
27138 #: ../src/guestfs-actions.pod:3902
27140 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27141 "previous call to C<guestfs_luks_open>."
27145 #: ../src/guestfs-actions.pod:3905
27147 "Device mapper devices which correspond to logical volumes are I<not> "
27148 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
27153 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5359
27154 msgid "(Added in 1.11.15)"
27158 #: ../src/guestfs-actions.pod:3915
27159 msgid "guestfs_list_filesystems"
27163 #: ../src/guestfs-actions.pod:3917
27167 " guestfs_list_filesystems (guestfs_h *g);\n"
27172 #: ../src/guestfs-actions.pod:3937
27174 "This command runs other libguestfs commands, which might include "
27175 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
27176 "soon after launch and only when nothing is mounted."
27180 #: ../src/guestfs-actions.pod:3941
27182 "Not all of the filesystems returned will be mountable. In particular, swap "
27183 "partitions are returned in the list. Also this command does not check that "
27184 "each filesystem found is valid and mountable, and some filesystems might be "
27185 "mountable but require special options. Filesystems may not all belong to a "
27186 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
27190 #: ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:5720
27191 msgid "(Added in 1.5.15)"
27195 #: ../src/guestfs-actions.pod:3957
27196 msgid "guestfs_list_partitions"
27200 #: ../src/guestfs-actions.pod:3959
27204 " guestfs_list_partitions (guestfs_h *g);\n"
27209 #: ../src/guestfs-actions.pod:3966
27211 "This does not return logical volumes. For that you will need to call "
27216 #: ../src/guestfs-actions.pod:3977
27221 #: ../src/guestfs-actions.pod:3979
27225 " guestfs_ll (guestfs_h *g,\n"
27226 " const char *directory);\n"
27231 #: ../src/guestfs-actions.pod:3994
27236 #: ../src/guestfs-actions.pod:3996
27240 " guestfs_ln (guestfs_h *g,\n"
27241 " const char *target,\n"
27242 " const char *linkname);\n"
27247 #: ../src/guestfs-actions.pod:4007
27248 msgid "guestfs_ln_f"
27252 #: ../src/guestfs-actions.pod:4009
27256 " guestfs_ln_f (guestfs_h *g,\n"
27257 " const char *target,\n"
27258 " const char *linkname);\n"
27263 #: ../src/guestfs-actions.pod:4021
27264 msgid "guestfs_ln_s"
27268 #: ../src/guestfs-actions.pod:4023
27272 " guestfs_ln_s (guestfs_h *g,\n"
27273 " const char *target,\n"
27274 " const char *linkname);\n"
27279 #: ../src/guestfs-actions.pod:4034
27280 msgid "guestfs_ln_sf"
27284 #: ../src/guestfs-actions.pod:4036
27288 " guestfs_ln_sf (guestfs_h *g,\n"
27289 " const char *target,\n"
27290 " const char *linkname);\n"
27295 #: ../src/guestfs-actions.pod:4048
27296 msgid "guestfs_lremovexattr"
27300 #: ../src/guestfs-actions.pod:4050
27304 " guestfs_lremovexattr (guestfs_h *g,\n"
27305 " const char *xattr,\n"
27306 " const char *path);\n"
27311 #: ../src/guestfs-actions.pod:4055
27313 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27314 "link, then it removes an extended attribute of the link itself."
27318 #: ../src/guestfs-actions.pod:4063
27323 #: ../src/guestfs-actions.pod:4065
27327 " guestfs_ls (guestfs_h *g,\n"
27328 " const char *directory);\n"
27333 #: ../src/guestfs-actions.pod:4073
27335 "This command is mostly useful for interactive sessions. Programs should "
27336 "probably use C<guestfs_readdir> instead."
27340 #: ../src/guestfs-actions.pod:4082
27341 msgid "guestfs_lsetxattr"
27345 #: ../src/guestfs-actions.pod:4084
27349 " guestfs_lsetxattr (guestfs_h *g,\n"
27350 " const char *xattr,\n"
27351 " const char *val,\n"
27353 " const char *path);\n"
27358 #: ../src/guestfs-actions.pod:4091
27360 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27361 "then it sets an extended attribute of the link itself."
27365 #: ../src/guestfs-actions.pod:4099
27366 msgid "guestfs_lstat"
27370 #: ../src/guestfs-actions.pod:4101
27373 " struct guestfs_stat *\n"
27374 " guestfs_lstat (guestfs_h *g,\n"
27375 " const char *path);\n"
27380 #: ../src/guestfs-actions.pod:4107
27382 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27383 "link, then the link is stat-ed, not the file it refers to."
27387 #: ../src/guestfs-actions.pod:4113 ../src/guestfs-actions.pod:6894
27389 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27390 "error. I<The caller must call C<guestfs_free_stat> after use>."
27394 #: ../src/guestfs-actions.pod:4117 ../src/guestfs-actions.pod:6898
27395 #: ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:7297
27396 msgid "(Added in 0.9.2)"
27400 #: ../src/guestfs-actions.pod:4119
27401 msgid "guestfs_lstatlist"
27405 #: ../src/guestfs-actions.pod:4121
27408 " struct guestfs_stat_list *\n"
27409 " guestfs_lstatlist (guestfs_h *g,\n"
27410 " const char *path,\n"
27411 " char *const *names);\n"
27416 #: ../src/guestfs-actions.pod:4126
27418 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27419 "files, where all files are in the directory C<path>. C<names> is the list "
27420 "of files from this directory."
27424 #: ../src/guestfs-actions.pod:4135
27426 "This call is intended for programs that want to efficiently list a directory "
27427 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27428 "for a similarly efficient call for getting extended attributes. Very long "
27429 "directory listings might cause the protocol message size to be exceeded, "
27430 "causing this call to fail. The caller must split up such requests into "
27431 "smaller groups of names."
27435 #: ../src/guestfs-actions.pod:4143
27437 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27438 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27442 #: ../src/guestfs-actions.pod:4149
27443 msgid "guestfs_luks_add_key"
27447 #: ../src/guestfs-actions.pod:4151
27451 " guestfs_luks_add_key (guestfs_h *g,\n"
27452 " const char *device,\n"
27453 " const char *key,\n"
27454 " const char *newkey,\n"
27460 #: ../src/guestfs-actions.pod:4163
27462 "Note that if C<keyslot> already contains a key, then this command will "
27463 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27467 #: ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:4209
27468 #: ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4252
27469 #: ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4306
27471 "This function takes a key or passphrase parameter which could contain "
27472 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27477 #: ../src/guestfs-actions.pod:4173 ../src/guestfs-actions.pod:4213
27478 #: ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4256
27479 msgid "(Added in 1.5.2)"
27483 #: ../src/guestfs-actions.pod:4175
27484 msgid "guestfs_luks_close"
27488 #: ../src/guestfs-actions.pod:4177
27492 " guestfs_luks_close (guestfs_h *g,\n"
27493 " const char *device);\n"
27498 #: ../src/guestfs-actions.pod:4181
27500 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27501 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27502 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27503 "underlying block device."
27507 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4291
27508 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4360
27509 #: ../src/guestfs-actions.pod:4408
27510 msgid "(Added in 1.5.1)"
27514 #: ../src/guestfs-actions.pod:4191
27515 msgid "guestfs_luks_format"
27519 #: ../src/guestfs-actions.pod:4193
27523 " guestfs_luks_format (guestfs_h *g,\n"
27524 " const char *device,\n"
27525 " const char *key,\n"
27531 #: ../src/guestfs-actions.pod:4215
27532 msgid "guestfs_luks_format_cipher"
27536 #: ../src/guestfs-actions.pod:4217
27540 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27541 " const char *device,\n"
27542 " const char *key,\n"
27544 " const char *cipher);\n"
27549 #: ../src/guestfs-actions.pod:4224
27551 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27552 "set the C<cipher> used."
27556 #: ../src/guestfs-actions.pod:4238
27557 msgid "guestfs_luks_kill_slot"
27561 #: ../src/guestfs-actions.pod:4240
27565 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27566 " const char *device,\n"
27567 " const char *key,\n"
27573 #: ../src/guestfs-actions.pod:4258
27574 msgid "guestfs_luks_open"
27578 #: ../src/guestfs-actions.pod:4260
27582 " guestfs_luks_open (guestfs_h *g,\n"
27583 " const char *device,\n"
27584 " const char *key,\n"
27585 " const char *mapname);\n"
27590 #: ../src/guestfs-actions.pod:4278
27592 "If this block device contains LVM volume groups, then calling "
27593 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27598 #: ../src/guestfs-actions.pod:4282
27599 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27603 #: ../src/guestfs-actions.pod:4293
27604 msgid "guestfs_luks_open_ro"
27608 #: ../src/guestfs-actions.pod:4295
27612 " guestfs_luks_open_ro (guestfs_h *g,\n"
27613 " const char *device,\n"
27614 " const char *key,\n"
27615 " const char *mapname);\n"
27620 #: ../src/guestfs-actions.pod:4301
27622 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27627 #: ../src/guestfs-actions.pod:4312
27628 msgid "guestfs_lvcreate"
27632 #: ../src/guestfs-actions.pod:4314
27636 " guestfs_lvcreate (guestfs_h *g,\n"
27637 " const char *logvol,\n"
27638 " const char *volgroup,\n"
27644 #: ../src/guestfs-actions.pod:4327
27645 msgid "guestfs_lvm_canonical_lv_name"
27649 #: ../src/guestfs-actions.pod:4329
27653 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27654 " const char *lvname);\n"
27659 #: ../src/guestfs-actions.pod:4340
27660 msgid "See also C<guestfs_is_lv>."
27664 #: ../src/guestfs-actions.pod:4345
27665 msgid "(Added in 1.5.24)"
27669 #: ../src/guestfs-actions.pod:4347
27670 msgid "guestfs_lvm_clear_filter"
27674 #: ../src/guestfs-actions.pod:4349
27678 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
27683 #: ../src/guestfs-actions.pod:4352
27685 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
27686 "see every block device."
27690 #: ../src/guestfs-actions.pod:4362
27691 msgid "guestfs_lvm_remove_all"
27695 #: ../src/guestfs-actions.pod:4364
27699 " guestfs_lvm_remove_all (guestfs_h *g);\n"
27704 #: ../src/guestfs-actions.pod:4377
27705 msgid "guestfs_lvm_set_filter"
27709 #: ../src/guestfs-actions.pod:4379
27713 " guestfs_lvm_set_filter (guestfs_h *g,\n"
27714 " char *const *devices);\n"
27719 #: ../src/guestfs-actions.pod:4410
27720 msgid "guestfs_lvremove"
27724 #: ../src/guestfs-actions.pod:4412
27728 " guestfs_lvremove (guestfs_h *g,\n"
27729 " const char *device);\n"
27734 #: ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:5817
27735 #: ../src/guestfs-actions.pod:7667
27736 msgid "(Added in 1.0.13)"
27740 #: ../src/guestfs-actions.pod:4426
27741 msgid "guestfs_lvrename"
27745 #: ../src/guestfs-actions.pod:4428
27749 " guestfs_lvrename (guestfs_h *g,\n"
27750 " const char *logvol,\n"
27751 " const char *newlogvol);\n"
27756 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:7680
27757 msgid "(Added in 1.0.83)"
27761 #: ../src/guestfs-actions.pod:4439
27762 msgid "guestfs_lvresize"
27766 #: ../src/guestfs-actions.pod:4441
27770 " guestfs_lvresize (guestfs_h *g,\n"
27771 " const char *device,\n"
27777 #: ../src/guestfs-actions.pod:4454
27778 msgid "guestfs_lvresize_free"
27782 #: ../src/guestfs-actions.pod:4456
27786 " guestfs_lvresize_free (guestfs_h *g,\n"
27787 " const char *lv,\n"
27793 #: ../src/guestfs-actions.pod:4469
27794 msgid "(Added in 1.3.3)"
27798 #: ../src/guestfs-actions.pod:4471
27799 msgid "guestfs_lvs"
27803 #: ../src/guestfs-actions.pod:4473
27807 " guestfs_lvs (guestfs_h *g);\n"
27812 #: ../src/guestfs-actions.pod:4482
27813 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
27817 #: ../src/guestfs-actions.pod:4490
27818 msgid "guestfs_lvs_full"
27822 #: ../src/guestfs-actions.pod:4492
27825 " struct guestfs_lvm_lv_list *\n"
27826 " guestfs_lvs_full (guestfs_h *g);\n"
27831 #: ../src/guestfs-actions.pod:4498
27833 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
27834 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
27838 #: ../src/guestfs-actions.pod:4504
27839 msgid "guestfs_lvuuid"
27843 #: ../src/guestfs-actions.pod:4506
27847 " guestfs_lvuuid (guestfs_h *g,\n"
27848 " const char *device);\n"
27853 #: ../src/guestfs-actions.pod:4517
27854 msgid "guestfs_lxattrlist"
27858 #: ../src/guestfs-actions.pod:4519
27861 " struct guestfs_xattr_list *\n"
27862 " guestfs_lxattrlist (guestfs_h *g,\n"
27863 " const char *path,\n"
27864 " char *const *names);\n"
27869 #: ../src/guestfs-actions.pod:4538
27871 "This call is intended for programs that want to efficiently list a directory "
27872 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
27873 "a similarly efficient call for getting standard stats. Very long directory "
27874 "listings might cause the protocol message size to be exceeded, causing this "
27875 "call to fail. The caller must split up such requests into smaller groups of "
27880 #: ../src/guestfs-actions.pod:4552
27881 msgid "guestfs_mkdir"
27885 #: ../src/guestfs-actions.pod:4554
27889 " guestfs_mkdir (guestfs_h *g,\n"
27890 " const char *path);\n"
27895 #: ../src/guestfs-actions.pod:4564
27896 msgid "guestfs_mkdir_mode"
27900 #: ../src/guestfs-actions.pod:4566
27904 " guestfs_mkdir_mode (guestfs_h *g,\n"
27905 " const char *path,\n"
27911 #: ../src/guestfs-actions.pod:4578
27912 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
27916 #: ../src/guestfs-actions.pod:4584
27917 msgid "guestfs_mkdir_p"
27921 #: ../src/guestfs-actions.pod:4586
27925 " guestfs_mkdir_p (guestfs_h *g,\n"
27926 " const char *path);\n"
27931 #: ../src/guestfs-actions.pod:4597
27932 msgid "guestfs_mkdtemp"
27936 #: ../src/guestfs-actions.pod:4599
27940 " guestfs_mkdtemp (guestfs_h *g,\n"
27941 " const char *template);\n"
27946 #: ../src/guestfs-actions.pod:4627
27947 msgid "guestfs_mke2fs_J"
27951 #: ../src/guestfs-actions.pod:4629
27955 " guestfs_mke2fs_J (guestfs_h *g,\n"
27956 " const char *fstype,\n"
27957 " int blocksize,\n"
27958 " const char *device,\n"
27959 " const char *journal);\n"
27964 #: ../src/guestfs-actions.pod:4642
27965 msgid "See also C<guestfs_mke2journal>."
27969 #: ../src/guestfs-actions.pod:4646 ../src/guestfs-actions.pod:4664
27970 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4698
27971 #: ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4726
27972 #: ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:5062
27973 msgid "(Added in 1.0.68)"
27977 #: ../src/guestfs-actions.pod:4648
27978 msgid "guestfs_mke2fs_JL"
27982 #: ../src/guestfs-actions.pod:4650
27986 " guestfs_mke2fs_JL (guestfs_h *g,\n"
27987 " const char *fstype,\n"
27988 " int blocksize,\n"
27989 " const char *device,\n"
27990 " const char *label);\n"
27995 #: ../src/guestfs-actions.pod:4660
27996 msgid "See also C<guestfs_mke2journal_L>."
28000 #: ../src/guestfs-actions.pod:4666
28001 msgid "guestfs_mke2fs_JU"
28005 #: ../src/guestfs-actions.pod:4668
28009 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28010 " const char *fstype,\n"
28011 " int blocksize,\n"
28012 " const char *device,\n"
28013 " const char *uuid);\n"
28018 #: ../src/guestfs-actions.pod:4678
28019 msgid "See also C<guestfs_mke2journal_U>."
28023 #: ../src/guestfs-actions.pod:4684
28024 msgid "guestfs_mke2journal"
28028 #: ../src/guestfs-actions.pod:4686
28032 " guestfs_mke2journal (guestfs_h *g,\n"
28033 " int blocksize,\n"
28034 " const char *device);\n"
28039 #: ../src/guestfs-actions.pod:4700
28040 msgid "guestfs_mke2journal_L"
28044 #: ../src/guestfs-actions.pod:4702
28048 " guestfs_mke2journal_L (guestfs_h *g,\n"
28049 " int blocksize,\n"
28050 " const char *label,\n"
28051 " const char *device);\n"
28056 #: ../src/guestfs-actions.pod:4714
28057 msgid "guestfs_mke2journal_U"
28061 #: ../src/guestfs-actions.pod:4716
28065 " guestfs_mke2journal_U (guestfs_h *g,\n"
28066 " int blocksize,\n"
28067 " const char *uuid,\n"
28068 " const char *device);\n"
28073 #: ../src/guestfs-actions.pod:4728
28074 msgid "guestfs_mkfifo"
28078 #: ../src/guestfs-actions.pod:4730
28082 " guestfs_mkfifo (guestfs_h *g,\n"
28084 " const char *path);\n"
28089 #: ../src/guestfs-actions.pod:4735
28091 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28092 "is just a convenient wrapper around C<guestfs_mknod>."
28096 #: ../src/guestfs-actions.pod:4745
28097 msgid "guestfs_mkfs"
28101 #: ../src/guestfs-actions.pod:4747
28105 " guestfs_mkfs (guestfs_h *g,\n"
28106 " const char *fstype,\n"
28107 " const char *device);\n"
28112 #: ../src/guestfs-actions.pod:4760
28113 msgid "guestfs_mkfs_b"
28117 #: ../src/guestfs-actions.pod:4762
28121 " guestfs_mkfs_b (guestfs_h *g,\n"
28122 " const char *fstype,\n"
28123 " int blocksize,\n"
28124 " const char *device);\n"
28129 #: ../src/guestfs-actions.pod:4768
28131 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28136 #: ../src/guestfs-actions.pod:4775
28138 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28139 "block size of the resulting filesystem. Supported block sizes depend on the "
28140 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28144 #: ../src/guestfs-actions.pod:4787
28145 msgid "guestfs_mkfs_opts"
28149 #: ../src/guestfs-actions.pod:4789
28153 " guestfs_mkfs_opts (guestfs_h *g,\n"
28154 " const char *fstype,\n"
28155 " const char *device,\n"
28161 #: ../src/guestfs-actions.pod:4800
28164 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
28165 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
28166 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
28167 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
28172 #: ../src/guestfs-actions.pod:4848
28173 msgid "(Added in 1.7.19)"
28177 #: ../src/guestfs-actions.pod:4850
28178 msgid "guestfs_mkfs_opts_va"
28182 #: ../src/guestfs-actions.pod:4852
28186 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
28187 " const char *fstype,\n"
28188 " const char *device,\n"
28189 " va_list args);\n"
28194 #: ../src/guestfs-actions.pod:4858
28195 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
28199 #: ../src/guestfs-actions.pod:4862
28200 msgid "guestfs_mkfs_opts_argv"
28204 #: ../src/guestfs-actions.pod:4864
28208 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
28209 " const char *fstype,\n"
28210 " const char *device,\n"
28211 " const struct guestfs_mkfs_opts_argv *optargs);\n"
28216 #: ../src/guestfs-actions.pod:4870
28217 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
28221 #: ../src/guestfs-actions.pod:4874
28222 msgid "guestfs_mkmountpoint"
28226 #: ../src/guestfs-actions.pod:4876
28230 " guestfs_mkmountpoint (guestfs_h *g,\n"
28231 " const char *exemptpath);\n"
28236 #: ../src/guestfs-actions.pod:4880
28238 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
28239 "that can be used to create extra mountpoints before mounting the first "
28244 #: ../src/guestfs-actions.pod:4904
28246 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
28247 "may get unexpected errors if you try to mix these calls. It is safest to "
28248 "manually unmount filesystems and remove mountpoints after use."
28252 #: ../src/guestfs-actions.pod:4908
28254 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
28255 "first, so for this to work for manual mountpoints, you must ensure that the "
28256 "innermost mountpoints have the longest pathnames, as in the example code "
28261 #: ../src/guestfs-actions.pod:4915
28263 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
28264 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
28265 "can also trigger these issues."
28269 #: ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5227
28270 #: ../src/guestfs-actions.pod:6237
28271 msgid "(Added in 1.0.62)"
28275 #: ../src/guestfs-actions.pod:4923
28276 msgid "guestfs_mknod"
28280 #: ../src/guestfs-actions.pod:4925
28284 " guestfs_mknod (guestfs_h *g,\n"
28288 " const char *path);\n"
28293 #: ../src/guestfs-actions.pod:4940
28295 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28296 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28297 "regular file). These constants are available in the standard Linux header "
28298 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
28299 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
28300 "the appropriate constant for you."
28304 #: ../src/guestfs-actions.pod:4954
28305 msgid "guestfs_mknod_b"
28309 #: ../src/guestfs-actions.pod:4956
28313 " guestfs_mknod_b (guestfs_h *g,\n"
28317 " const char *path);\n"
28322 #: ../src/guestfs-actions.pod:4963
28324 "This call creates a block device node called C<path> with mode C<mode> and "
28325 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28326 "wrapper around C<guestfs_mknod>."
28330 #: ../src/guestfs-actions.pod:4973
28331 msgid "guestfs_mknod_c"
28335 #: ../src/guestfs-actions.pod:4975
28339 " guestfs_mknod_c (guestfs_h *g,\n"
28343 " const char *path);\n"
28348 #: ../src/guestfs-actions.pod:4982
28350 "This call creates a char device node called C<path> with mode C<mode> and "
28351 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28352 "wrapper around C<guestfs_mknod>."
28356 #: ../src/guestfs-actions.pod:4992
28357 msgid "guestfs_mkswap"
28361 #: ../src/guestfs-actions.pod:4994
28365 " guestfs_mkswap (guestfs_h *g,\n"
28366 " const char *device);\n"
28371 #: ../src/guestfs-actions.pod:5004
28372 msgid "guestfs_mkswap_L"
28376 #: ../src/guestfs-actions.pod:5006
28380 " guestfs_mkswap_L (guestfs_h *g,\n"
28381 " const char *label,\n"
28382 " const char *device);\n"
28387 #: ../src/guestfs-actions.pod:5021
28388 msgid "guestfs_mkswap_U"
28392 #: ../src/guestfs-actions.pod:5023
28396 " guestfs_mkswap_U (guestfs_h *g,\n"
28397 " const char *uuid,\n"
28398 " const char *device);\n"
28403 #: ../src/guestfs-actions.pod:5034
28404 msgid "guestfs_mkswap_file"
28408 #: ../src/guestfs-actions.pod:5036
28412 " guestfs_mkswap_file (guestfs_h *g,\n"
28413 " const char *path);\n"
28418 #: ../src/guestfs-actions.pod:5042
28420 "This command just writes a swap file signature to an existing file. To "
28421 "create the file itself, use something like C<guestfs_fallocate>."
28425 #: ../src/guestfs-actions.pod:5049
28426 msgid "guestfs_modprobe"
28430 #: ../src/guestfs-actions.pod:5051
28434 " guestfs_modprobe (guestfs_h *g,\n"
28435 " const char *modulename);\n"
28440 #: ../src/guestfs-actions.pod:5064
28441 msgid "guestfs_mount"
28445 #: ../src/guestfs-actions.pod:5066
28449 " guestfs_mount (guestfs_h *g,\n"
28450 " const char *device,\n"
28451 " const char *mountpoint);\n"
28456 #: ../src/guestfs-actions.pod:5085
28458 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28459 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28460 "problems for users. If your program might need to work with older versions "
28461 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28462 "for the first parameter if you don't want any options)."
28466 #: ../src/guestfs-actions.pod:5096
28467 msgid "guestfs_mount_9p"
28471 #: ../src/guestfs-actions.pod:5098
28475 " guestfs_mount_9p (guestfs_h *g,\n"
28476 " const char *mounttag,\n"
28477 " const char *mountpoint,\n"
28483 #: ../src/guestfs-actions.pod:5109
28486 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28491 #: ../src/guestfs-actions.pod:5122
28492 msgid "guestfs_mount_9p_va"
28496 #: ../src/guestfs-actions.pod:5124
28500 " guestfs_mount_9p_va (guestfs_h *g,\n"
28501 " const char *mounttag,\n"
28502 " const char *mountpoint,\n"
28503 " va_list args);\n"
28508 #: ../src/guestfs-actions.pod:5130
28509 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28513 #: ../src/guestfs-actions.pod:5134
28514 msgid "guestfs_mount_9p_argv"
28518 #: ../src/guestfs-actions.pod:5136
28522 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28523 " const char *mounttag,\n"
28524 " const char *mountpoint,\n"
28525 " const struct guestfs_mount_9p_argv *optargs);\n"
28530 #: ../src/guestfs-actions.pod:5142
28531 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28535 #: ../src/guestfs-actions.pod:5146
28536 msgid "guestfs_mount_loop"
28540 #: ../src/guestfs-actions.pod:5148
28544 " guestfs_mount_loop (guestfs_h *g,\n"
28545 " const char *file,\n"
28546 " const char *mountpoint);\n"
28551 #: ../src/guestfs-actions.pod:5161
28552 msgid "guestfs_mount_options"
28556 #: ../src/guestfs-actions.pod:5163
28560 " guestfs_mount_options (guestfs_h *g,\n"
28561 " const char *options,\n"
28562 " const char *device,\n"
28563 " const char *mountpoint);\n"
28568 #: ../src/guestfs-actions.pod:5169
28570 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28571 "the mount options as for the L<mount(8)> I<-o> flag."
28575 #: ../src/guestfs-actions.pod:5179 ../src/guestfs-actions.pod:5193
28576 #: ../src/guestfs-actions.pod:5210
28577 msgid "(Added in 1.0.10)"
28581 #: ../src/guestfs-actions.pod:5181
28582 msgid "guestfs_mount_ro"
28586 #: ../src/guestfs-actions.pod:5183
28590 " guestfs_mount_ro (guestfs_h *g,\n"
28591 " const char *device,\n"
28592 " const char *mountpoint);\n"
28597 #: ../src/guestfs-actions.pod:5188
28599 "This is the same as the C<guestfs_mount> command, but it mounts the "
28600 "filesystem with the read-only (I<-o ro>) flag."
28604 #: ../src/guestfs-actions.pod:5195
28605 msgid "guestfs_mount_vfs"
28609 #: ../src/guestfs-actions.pod:5197
28613 " guestfs_mount_vfs (guestfs_h *g,\n"
28614 " const char *options,\n"
28615 " const char *vfstype,\n"
28616 " const char *device,\n"
28617 " const char *mountpoint);\n"
28622 #: ../src/guestfs-actions.pod:5204
28624 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28625 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
28630 #: ../src/guestfs-actions.pod:5212
28631 msgid "guestfs_mountpoints"
28635 #: ../src/guestfs-actions.pod:5214
28639 " guestfs_mountpoints (guestfs_h *g);\n"
28644 #: ../src/guestfs-actions.pod:5217
28646 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28647 "devices. This one returns a hash table (map) of device name to directory "
28648 "where the device is mounted."
28652 #: ../src/guestfs-actions.pod:5229
28653 msgid "guestfs_mounts"
28657 #: ../src/guestfs-actions.pod:5231
28661 " guestfs_mounts (guestfs_h *g);\n"
28666 #: ../src/guestfs-actions.pod:5239
28667 msgid "See also: C<guestfs_mountpoints>"
28671 #: ../src/guestfs-actions.pod:5247
28676 #: ../src/guestfs-actions.pod:5249
28680 " guestfs_mv (guestfs_h *g,\n"
28681 " const char *src,\n"
28682 " const char *dest);\n"
28687 #: ../src/guestfs-actions.pod:5261
28688 msgid "guestfs_ntfs_3g_probe"
28692 #: ../src/guestfs-actions.pod:5263
28696 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
28698 " const char *device);\n"
28703 #: ../src/guestfs-actions.pod:5282
28704 msgid "(Added in 1.0.43)"
28708 #: ../src/guestfs-actions.pod:5284
28709 msgid "guestfs_ntfsresize"
28713 #: ../src/guestfs-actions.pod:5286
28717 " guestfs_ntfsresize (guestfs_h *g,\n"
28718 " const char *device);\n"
28723 #: ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5390
28725 "I<This function is deprecated.> In new code, use the L</"
28726 "guestfs_ntfsresize_opts> call instead."
28730 #: ../src/guestfs-actions.pod:5314
28731 msgid "guestfs_ntfsresize_opts"
28735 #: ../src/guestfs-actions.pod:5316
28739 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
28740 " const char *device,\n"
28746 #: ../src/guestfs-actions.pod:5326
28749 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
28750 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
28755 #: ../src/guestfs-actions.pod:5346
28757 "After the resize operation, the filesystem is always marked as requiring a "
28758 "consistency check (for safety). You have to boot into Windows to perform "
28759 "this check and clear this condition. If you I<don't> set the C<force> "
28760 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
28761 "times on a single filesystem without booting into Windows between each "
28766 #: ../src/guestfs-actions.pod:5361
28767 msgid "guestfs_ntfsresize_opts_va"
28771 #: ../src/guestfs-actions.pod:5363
28775 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
28776 " const char *device,\n"
28777 " va_list args);\n"
28782 #: ../src/guestfs-actions.pod:5368
28783 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
28787 #: ../src/guestfs-actions.pod:5372
28788 msgid "guestfs_ntfsresize_opts_argv"
28792 #: ../src/guestfs-actions.pod:5374
28796 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
28797 " const char *device,\n"
28798 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
28803 #: ../src/guestfs-actions.pod:5379
28804 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
28808 #: ../src/guestfs-actions.pod:5383
28809 msgid "guestfs_ntfsresize_size"
28813 #: ../src/guestfs-actions.pod:5385
28817 " guestfs_ntfsresize_size (guestfs_h *g,\n"
28818 " const char *device,\n"
28819 " int64_t size);\n"
28824 #: ../src/guestfs-actions.pod:5397
28826 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
28827 "to specify the new size (in bytes) explicitly."
28831 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5844
28832 #: ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6185
28833 #: ../src/guestfs-actions.pod:7824
28834 msgid "(Added in 1.3.14)"
28838 #: ../src/guestfs-actions.pod:5404
28839 msgid "guestfs_part_add"
28843 #: ../src/guestfs-actions.pod:5406
28847 " guestfs_part_add (guestfs_h *g,\n"
28848 " const char *device,\n"
28849 " const char *prlogex,\n"
28850 " int64_t startsect,\n"
28851 " int64_t endsect);\n"
28856 #: ../src/guestfs-actions.pod:5413
28858 "This command adds a partition to C<device>. If there is no partition table "
28859 "on the device, call C<guestfs_part_init> first."
28863 #: ../src/guestfs-actions.pod:5425
28865 "Creating a partition which covers the whole disk is not so easy. Use "
28866 "C<guestfs_part_disk> to do that."
28870 #: ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:5468
28871 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5605
28872 #: ../src/guestfs-actions.pod:5643 ../src/guestfs-actions.pod:5662
28873 #: ../src/guestfs-actions.pod:5702
28874 msgid "(Added in 1.0.78)"
28878 #: ../src/guestfs-actions.pod:5432
28879 msgid "guestfs_part_del"
28883 #: ../src/guestfs-actions.pod:5434
28887 " guestfs_part_del (guestfs_h *g,\n"
28888 " const char *device,\n"
28894 #: ../src/guestfs-actions.pod:5449
28895 msgid "guestfs_part_disk"
28899 #: ../src/guestfs-actions.pod:5451
28903 " guestfs_part_disk (guestfs_h *g,\n"
28904 " const char *device,\n"
28905 " const char *parttype);\n"
28910 #: ../src/guestfs-actions.pod:5456
28912 "This command is simply a combination of C<guestfs_part_init> followed by "
28913 "C<guestfs_part_add> to create a single primary partition covering the whole "
28918 #: ../src/guestfs-actions.pod:5460
28920 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
28921 "possible values are described in C<guestfs_part_init>."
28925 #: ../src/guestfs-actions.pod:5470
28926 msgid "guestfs_part_get_bootable"
28930 #: ../src/guestfs-actions.pod:5472
28934 " guestfs_part_get_bootable (guestfs_h *g,\n"
28935 " const char *device,\n"
28941 #: ../src/guestfs-actions.pod:5480
28942 msgid "See also C<guestfs_part_set_bootable>."
28946 #: ../src/guestfs-actions.pod:5486
28947 msgid "guestfs_part_get_mbr_id"
28951 #: ../src/guestfs-actions.pod:5488
28955 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
28956 " const char *device,\n"
28962 #: ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5678
28964 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
28965 "undefined results for other partition table types (see "
28966 "C<guestfs_part_get_parttype>)."
28970 #: ../src/guestfs-actions.pod:5504
28971 msgid "guestfs_part_get_parttype"
28975 #: ../src/guestfs-actions.pod:5506
28979 " guestfs_part_get_parttype (guestfs_h *g,\n"
28980 " const char *device);\n"
28985 #: ../src/guestfs-actions.pod:5513
28987 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
28988 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
28989 "possible, although unusual. See C<guestfs_part_init> for a full list."
28993 #: ../src/guestfs-actions.pod:5523
28994 msgid "guestfs_part_init"
28998 #: ../src/guestfs-actions.pod:5525
29002 " guestfs_part_init (guestfs_h *g,\n"
29003 " const char *device,\n"
29004 " const char *parttype);\n"
29009 #: ../src/guestfs-actions.pod:5534
29011 "Initially there are no partitions. Following this, you should call "
29012 "C<guestfs_part_add> for each partition required."
29016 #: ../src/guestfs-actions.pod:5607
29017 msgid "guestfs_part_list"
29021 #: ../src/guestfs-actions.pod:5609
29024 " struct guestfs_partition_list *\n"
29025 " guestfs_part_list (guestfs_h *g,\n"
29026 " const char *device);\n"
29031 #: ../src/guestfs-actions.pod:5626
29033 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29034 "the device's sector size, see C<guestfs_blockdev_getss>."
29038 #: ../src/guestfs-actions.pod:5639
29040 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29041 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29046 #: ../src/guestfs-actions.pod:5645
29047 msgid "guestfs_part_set_bootable"
29051 #: ../src/guestfs-actions.pod:5647
29055 " guestfs_part_set_bootable (guestfs_h *g,\n"
29056 " const char *device,\n"
29058 " int bootable);\n"
29063 #: ../src/guestfs-actions.pod:5664
29064 msgid "guestfs_part_set_mbr_id"
29068 #: ../src/guestfs-actions.pod:5666
29072 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29073 " const char *device,\n"
29080 #: ../src/guestfs-actions.pod:5686
29081 msgid "guestfs_part_set_name"
29085 #: ../src/guestfs-actions.pod:5688
29089 " guestfs_part_set_name (guestfs_h *g,\n"
29090 " const char *device,\n"
29092 " const char *name);\n"
29097 #: ../src/guestfs-actions.pod:5704
29098 msgid "guestfs_part_to_dev"
29102 #: ../src/guestfs-actions.pod:5706
29106 " guestfs_part_to_dev (guestfs_h *g,\n"
29107 " const char *partition);\n"
29112 #: ../src/guestfs-actions.pod:5714
29114 "The named partition must exist, for example as a string returned from "
29115 "C<guestfs_list_partitions>."
29119 #: ../src/guestfs-actions.pod:5722
29120 msgid "guestfs_ping_daemon"
29124 #: ../src/guestfs-actions.pod:5724
29128 " guestfs_ping_daemon (guestfs_h *g);\n"
29133 #: ../src/guestfs-actions.pod:5736
29134 msgid "guestfs_pread"
29138 #: ../src/guestfs-actions.pod:5738
29142 " guestfs_pread (guestfs_h *g,\n"
29143 " const char *path,\n"
29145 " int64_t offset,\n"
29146 " size_t *size_r);\n"
29151 #: ../src/guestfs-actions.pod:5751
29152 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
29156 #: ../src/guestfs-actions.pod:5762
29157 msgid "guestfs_pread_device"
29161 #: ../src/guestfs-actions.pod:5764
29165 " guestfs_pread_device (guestfs_h *g,\n"
29166 " const char *device,\n"
29168 " int64_t offset,\n"
29169 " size_t *size_r);\n"
29174 #: ../src/guestfs-actions.pod:5777
29175 msgid "See also C<guestfs_pread>."
29179 #: ../src/guestfs-actions.pod:5786
29180 msgid "(Added in 1.5.21)"
29184 #: ../src/guestfs-actions.pod:5788
29185 msgid "guestfs_pvcreate"
29189 #: ../src/guestfs-actions.pod:5790
29193 " guestfs_pvcreate (guestfs_h *g,\n"
29194 " const char *device);\n"
29199 #: ../src/guestfs-actions.pod:5802
29200 msgid "guestfs_pvremove"
29204 #: ../src/guestfs-actions.pod:5804
29208 " guestfs_pvremove (guestfs_h *g,\n"
29209 " const char *device);\n"
29214 #: ../src/guestfs-actions.pod:5819
29215 msgid "guestfs_pvresize"
29219 #: ../src/guestfs-actions.pod:5821
29223 " guestfs_pvresize (guestfs_h *g,\n"
29224 " const char *device);\n"
29229 #: ../src/guestfs-actions.pod:5832
29230 msgid "guestfs_pvresize_size"
29234 #: ../src/guestfs-actions.pod:5834
29238 " guestfs_pvresize_size (guestfs_h *g,\n"
29239 " const char *device,\n"
29240 " int64_t size);\n"
29245 #: ../src/guestfs-actions.pod:5839
29247 "This command is the same as C<guestfs_pvresize> except that it allows you to "
29248 "specify the new size (in bytes) explicitly."
29252 #: ../src/guestfs-actions.pod:5846
29253 msgid "guestfs_pvs"
29257 #: ../src/guestfs-actions.pod:5848
29261 " guestfs_pvs (guestfs_h *g);\n"
29266 #: ../src/guestfs-actions.pod:5857
29267 msgid "See also C<guestfs_pvs_full>."
29271 #: ../src/guestfs-actions.pod:5865
29272 msgid "guestfs_pvs_full"
29276 #: ../src/guestfs-actions.pod:5867
29279 " struct guestfs_lvm_pv_list *\n"
29280 " guestfs_pvs_full (guestfs_h *g);\n"
29285 #: ../src/guestfs-actions.pod:5873
29287 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
29288 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
29292 #: ../src/guestfs-actions.pod:5879
29293 msgid "guestfs_pvuuid"
29297 #: ../src/guestfs-actions.pod:5881
29301 " guestfs_pvuuid (guestfs_h *g,\n"
29302 " const char *device);\n"
29307 #: ../src/guestfs-actions.pod:5892
29308 msgid "guestfs_pwrite"
29312 #: ../src/guestfs-actions.pod:5894
29316 " guestfs_pwrite (guestfs_h *g,\n"
29317 " const char *path,\n"
29318 " const char *content,\n"
29319 " size_t content_size,\n"
29320 " int64_t offset);\n"
29325 #: ../src/guestfs-actions.pod:5910
29326 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29330 #: ../src/guestfs-actions.pod:5919
29331 msgid "guestfs_pwrite_device"
29335 #: ../src/guestfs-actions.pod:5921
29339 " guestfs_pwrite_device (guestfs_h *g,\n"
29340 " const char *device,\n"
29341 " const char *content,\n"
29342 " size_t content_size,\n"
29343 " int64_t offset);\n"
29348 #: ../src/guestfs-actions.pod:5936
29349 msgid "See also C<guestfs_pwrite>."
29353 #: ../src/guestfs-actions.pod:5943
29354 msgid "(Added in 1.5.20)"
29358 #: ../src/guestfs-actions.pod:5945
29359 msgid "guestfs_read_file"
29363 #: ../src/guestfs-actions.pod:5947
29367 " guestfs_read_file (guestfs_h *g,\n"
29368 " const char *path,\n"
29369 " size_t *size_r);\n"
29374 #: ../src/guestfs-actions.pod:5955
29376 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29377 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29378 "function is limited in the total size of file that can be handled."
29382 #: ../src/guestfs-actions.pod:5967
29383 msgid "(Added in 1.0.63)"
29387 #: ../src/guestfs-actions.pod:5969
29388 msgid "guestfs_read_lines"
29392 #: ../src/guestfs-actions.pod:5971
29396 " guestfs_read_lines (guestfs_h *g,\n"
29397 " const char *path);\n"
29402 #: ../src/guestfs-actions.pod:5980
29404 "Note that this function cannot correctly handle binary files (specifically, "
29405 "files containing C<\\0> character which is treated as end of line). For "
29406 "those you need to use the C<guestfs_read_file> function which has a more "
29407 "complex interface."
29411 #: ../src/guestfs-actions.pod:5991
29412 msgid "guestfs_readdir"
29416 #: ../src/guestfs-actions.pod:5993
29419 " struct guestfs_dirent_list *\n"
29420 " guestfs_readdir (guestfs_h *g,\n"
29421 " const char *dir);\n"
29426 #: ../src/guestfs-actions.pod:6047
29428 "This function is primarily intended for use by programs. To get a simple "
29429 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29430 "consumption, use C<guestfs_ll>."
29434 #: ../src/guestfs-actions.pod:6051
29436 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29437 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
29441 #: ../src/guestfs-actions.pod:6057
29442 msgid "guestfs_readlink"
29446 #: ../src/guestfs-actions.pod:6059
29450 " guestfs_readlink (guestfs_h *g,\n"
29451 " const char *path);\n"
29456 #: ../src/guestfs-actions.pod:6070
29457 msgid "guestfs_readlinklist"
29461 #: ../src/guestfs-actions.pod:6072
29465 " guestfs_readlinklist (guestfs_h *g,\n"
29466 " const char *path,\n"
29467 " char *const *names);\n"
29472 #: ../src/guestfs-actions.pod:6105
29473 msgid "guestfs_realpath"
29477 #: ../src/guestfs-actions.pod:6107
29481 " guestfs_realpath (guestfs_h *g,\n"
29482 " const char *path);\n"
29487 #: ../src/guestfs-actions.pod:6119
29488 msgid "guestfs_removexattr"
29492 #: ../src/guestfs-actions.pod:6121
29496 " guestfs_removexattr (guestfs_h *g,\n"
29497 " const char *xattr,\n"
29498 " const char *path);\n"
29503 #: ../src/guestfs-actions.pod:6129
29504 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29508 #: ../src/guestfs-actions.pod:6135
29509 msgid "guestfs_resize2fs"
29513 #: ../src/guestfs-actions.pod:6137
29517 " guestfs_resize2fs (guestfs_h *g,\n"
29518 " const char *device);\n"
29523 #: ../src/guestfs-actions.pod:6144
29525 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29526 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29527 "sometimes gives an error about this and sometimes not. In any case, it is "
29528 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29532 #: ../src/guestfs-actions.pod:6154
29533 msgid "guestfs_resize2fs_M"
29537 #: ../src/guestfs-actions.pod:6156
29541 " guestfs_resize2fs_M (guestfs_h *g,\n"
29542 " const char *device);\n"
29547 #: ../src/guestfs-actions.pod:6160
29549 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29550 "resized to its minimum size. This works like the I<-M> option to the "
29551 "C<resize2fs> command."
29555 #: ../src/guestfs-actions.pod:6164
29557 "To get the resulting size of the filesystem you should call "
29558 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29559 "These two numbers, multiplied together, give the resulting size of the "
29560 "minimal filesystem in bytes."
29564 #: ../src/guestfs-actions.pod:6173
29565 msgid "guestfs_resize2fs_size"
29569 #: ../src/guestfs-actions.pod:6175
29573 " guestfs_resize2fs_size (guestfs_h *g,\n"
29574 " const char *device,\n"
29575 " int64_t size);\n"
29580 #: ../src/guestfs-actions.pod:6180
29582 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29583 "to specify the new size (in bytes) explicitly."
29587 #: ../src/guestfs-actions.pod:6187
29592 #: ../src/guestfs-actions.pod:6189
29596 " guestfs_rm (guestfs_h *g,\n"
29597 " const char *path);\n"
29602 #: ../src/guestfs-actions.pod:6199
29603 msgid "guestfs_rm_rf"
29607 #: ../src/guestfs-actions.pod:6201
29611 " guestfs_rm_rf (guestfs_h *g,\n"
29612 " const char *path);\n"
29617 #: ../src/guestfs-actions.pod:6213
29618 msgid "guestfs_rmdir"
29622 #: ../src/guestfs-actions.pod:6215
29626 " guestfs_rmdir (guestfs_h *g,\n"
29627 " const char *path);\n"
29632 #: ../src/guestfs-actions.pod:6225
29633 msgid "guestfs_rmmountpoint"
29637 #: ../src/guestfs-actions.pod:6227
29641 " guestfs_rmmountpoint (guestfs_h *g,\n"
29642 " const char *exemptpath);\n"
29647 #: ../src/guestfs-actions.pod:6231
29649 "This calls removes a mountpoint that was previously created with "
29650 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29654 #: ../src/guestfs-actions.pod:6239
29655 msgid "guestfs_scrub_device"
29659 #: ../src/guestfs-actions.pod:6241
29663 " guestfs_scrub_device (guestfs_h *g,\n"
29664 " const char *device);\n"
29669 #: ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6274
29670 #: ../src/guestfs-actions.pod:6293
29671 msgid "(Added in 1.0.52)"
29675 #: ../src/guestfs-actions.pod:6258
29676 msgid "guestfs_scrub_file"
29680 #: ../src/guestfs-actions.pod:6260
29684 " guestfs_scrub_file (guestfs_h *g,\n"
29685 " const char *file);\n"
29690 #: ../src/guestfs-actions.pod:6276
29691 msgid "guestfs_scrub_freespace"
29695 #: ../src/guestfs-actions.pod:6278
29699 " guestfs_scrub_freespace (guestfs_h *g,\n"
29700 " const char *dir);\n"
29705 #: ../src/guestfs-actions.pod:6282
29707 "This command creates the directory C<dir> and then fills it with files until "
29708 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
29709 "and deletes them. The intention is to scrub any free space on the partition "
29710 "containing C<dir>."
29714 #: ../src/guestfs-actions.pod:6295
29715 msgid "guestfs_set_append"
29719 #: ../src/guestfs-actions.pod:6297
29723 " guestfs_set_append (guestfs_h *g,\n"
29724 " const char *append);\n"
29729 #: ../src/guestfs-actions.pod:6314
29730 msgid "guestfs_set_attach_method"
29734 #: ../src/guestfs-actions.pod:6316
29738 " guestfs_set_attach_method (guestfs_h *g,\n"
29739 " const char *attachmethod);\n"
29744 #: ../src/guestfs-actions.pod:6344
29745 msgid "guestfs_set_autosync"
29749 #: ../src/guestfs-actions.pod:6346
29753 " guestfs_set_autosync (guestfs_h *g,\n"
29754 " int autosync);\n"
29759 #: ../src/guestfs-actions.pod:6362
29760 msgid "guestfs_set_direct"
29764 #: ../src/guestfs-actions.pod:6364
29768 " guestfs_set_direct (guestfs_h *g,\n"
29774 #: ../src/guestfs-actions.pod:6372
29776 "One consequence of this is that log messages aren't caught by the library "
29777 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
29782 #: ../src/guestfs-actions.pod:6385
29783 msgid "guestfs_set_e2label"
29787 #: ../src/guestfs-actions.pod:6387
29791 " guestfs_set_e2label (guestfs_h *g,\n"
29792 " const char *device,\n"
29793 " const char *label);\n"
29798 #: ../src/guestfs-actions.pod:6396
29800 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
29801 "the existing label on a filesystem."
29805 #: ../src/guestfs-actions.pod:6403
29806 msgid "guestfs_set_e2uuid"
29810 #: ../src/guestfs-actions.pod:6405
29814 " guestfs_set_e2uuid (guestfs_h *g,\n"
29815 " const char *device,\n"
29816 " const char *uuid);\n"
29821 #: ../src/guestfs-actions.pod:6415
29823 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
29824 "the existing UUID of a filesystem."
29828 #: ../src/guestfs-actions.pod:6422
29829 msgid "guestfs_set_memsize"
29833 #: ../src/guestfs-actions.pod:6424
29837 " guestfs_set_memsize (guestfs_h *g,\n"
29843 #: ../src/guestfs-actions.pod:6428
29845 "This sets the memory size in megabytes allocated to the qemu subprocess. "
29846 "This only has any effect if called before C<guestfs_launch>."
29850 #: ../src/guestfs-actions.pod:6443
29851 msgid "guestfs_set_network"
29855 #: ../src/guestfs-actions.pod:6445
29859 " guestfs_set_network (guestfs_h *g,\n"
29865 #: ../src/guestfs-actions.pod:6455
29867 "You must call this before calling C<guestfs_launch>, otherwise it has no "
29872 #: ../src/guestfs-actions.pod:6462
29873 msgid "guestfs_set_path"
29877 #: ../src/guestfs-actions.pod:6464
29881 " guestfs_set_path (guestfs_h *g,\n"
29882 " const char *searchpath);\n"
29887 #: ../src/guestfs-actions.pod:6479
29888 msgid "guestfs_set_pgroup"
29892 #: ../src/guestfs-actions.pod:6481
29896 " guestfs_set_pgroup (guestfs_h *g,\n"
29902 #: ../src/guestfs-actions.pod:6498
29903 msgid "guestfs_set_qemu"
29907 #: ../src/guestfs-actions.pod:6500
29911 " guestfs_set_qemu (guestfs_h *g,\n"
29912 " const char *qemu);\n"
29917 #: ../src/guestfs-actions.pod:6526
29918 msgid "guestfs_set_recovery_proc"
29922 #: ../src/guestfs-actions.pod:6528
29926 " guestfs_set_recovery_proc (guestfs_h *g,\n"
29927 " int recoveryproc);\n"
29932 #: ../src/guestfs-actions.pod:6532
29934 "If this is called with the parameter C<false> then C<guestfs_launch> does "
29935 "not create a recovery process. The purpose of the recovery process is to "
29936 "stop runaway qemu processes in the case where the main program aborts "
29941 #: ../src/guestfs-actions.pod:6537
29943 "This only has any effect if called before C<guestfs_launch>, and the default "
29948 #: ../src/guestfs-actions.pod:6550
29949 msgid "guestfs_set_selinux"
29953 #: ../src/guestfs-actions.pod:6552
29957 " guestfs_set_selinux (guestfs_h *g,\n"
29963 #: ../src/guestfs-actions.pod:6569
29964 msgid "guestfs_set_smp"
29968 #: ../src/guestfs-actions.pod:6571
29972 " guestfs_set_smp (guestfs_h *g,\n"
29978 #: ../src/guestfs-actions.pod:6579
29979 msgid "This function must be called before C<guestfs_launch>."
29983 #: ../src/guestfs-actions.pod:6585
29984 msgid "guestfs_set_trace"
29988 #: ../src/guestfs-actions.pod:6587
29992 " guestfs_set_trace (guestfs_h *g,\n"
29998 #: ../src/guestfs-actions.pod:6601
30000 "Trace messages are normally sent to C<stderr>, unless you register a "
30001 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30005 #: ../src/guestfs-actions.pod:6609
30006 msgid "guestfs_set_verbose"
30010 #: ../src/guestfs-actions.pod:6611
30014 " guestfs_set_verbose (guestfs_h *g,\n"
30020 #: ../src/guestfs-actions.pod:6620
30022 "Verbose messages are normally sent to C<stderr>, unless you register a "
30023 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30027 #: ../src/guestfs-actions.pod:6628
30028 msgid "guestfs_setcon"
30032 #: ../src/guestfs-actions.pod:6630
30036 " guestfs_setcon (guestfs_h *g,\n"
30037 " const char *context);\n"
30042 #: ../src/guestfs-actions.pod:6643
30043 msgid "guestfs_setxattr"
30047 #: ../src/guestfs-actions.pod:6645
30051 " guestfs_setxattr (guestfs_h *g,\n"
30052 " const char *xattr,\n"
30053 " const char *val,\n"
30055 " const char *path);\n"
30060 #: ../src/guestfs-actions.pod:6656
30061 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30065 #: ../src/guestfs-actions.pod:6662
30066 msgid "guestfs_sfdisk"
30070 #: ../src/guestfs-actions.pod:6664
30074 " guestfs_sfdisk (guestfs_h *g,\n"
30075 " const char *device,\n"
30079 " char *const *lines);\n"
30084 #: ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6716
30085 #: ../src/guestfs-actions.pod:6750
30087 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30092 #: ../src/guestfs-actions.pod:6699
30094 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30098 #: ../src/guestfs-actions.pod:6709
30099 msgid "guestfs_sfdiskM"
30103 #: ../src/guestfs-actions.pod:6711
30107 " guestfs_sfdiskM (guestfs_h *g,\n"
30108 " const char *device,\n"
30109 " char *const *lines);\n"
30114 #: ../src/guestfs-actions.pod:6723
30116 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
30117 "partition sizes are specified in megabytes only (rounded to the nearest "
30118 "cylinder) and you don't need to specify the cyls, heads and sectors "
30119 "parameters which were rarely if ever used anyway."
30123 #: ../src/guestfs-actions.pod:6729
30125 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
30126 "C<guestfs_part_disk>"
30130 #: ../src/guestfs-actions.pod:6739
30131 msgid "guestfs_sfdisk_N"
30135 #: ../src/guestfs-actions.pod:6741
30139 " guestfs_sfdisk_N (guestfs_h *g,\n"
30140 " const char *device,\n"
30145 " const char *line);\n"
30150 #: ../src/guestfs-actions.pod:6760
30152 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
30153 "for the cyls/heads/sectors parameters."
30157 #: ../src/guestfs-actions.pod:6763
30158 msgid "See also: C<guestfs_part_add>"
30162 #: ../src/guestfs-actions.pod:6772
30163 msgid "guestfs_sfdisk_disk_geometry"
30167 #: ../src/guestfs-actions.pod:6774
30171 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
30172 " const char *device);\n"
30177 #: ../src/guestfs-actions.pod:6778
30179 "This displays the disk geometry of C<device> read from the partition table. "
30180 "Especially in the case where the underlying block device has been resized, "
30181 "this can be different from the kernel's idea of the geometry (see "
30182 "C<guestfs_sfdisk_kernel_geometry>)."
30186 #: ../src/guestfs-actions.pod:6791
30187 msgid "guestfs_sfdisk_kernel_geometry"
30191 #: ../src/guestfs-actions.pod:6793
30195 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
30196 " const char *device);\n"
30201 #: ../src/guestfs-actions.pod:6807
30202 msgid "guestfs_sfdisk_l"
30206 #: ../src/guestfs-actions.pod:6809
30210 " guestfs_sfdisk_l (guestfs_h *g,\n"
30211 " const char *device);\n"
30216 #: ../src/guestfs-actions.pod:6813
30218 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
30223 #: ../src/guestfs-actions.pod:6824
30224 msgid "See also: C<guestfs_part_list>"
30228 #: ../src/guestfs-actions.pod:6831
30233 #: ../src/guestfs-actions.pod:6833
30237 " guestfs_sh (guestfs_h *g,\n"
30238 " const char *command);\n"
30243 #: ../src/guestfs-actions.pod:6840
30244 msgid "This is like C<guestfs_command>, but passes the command to:"
30248 #: ../src/guestfs-actions.pod:6848
30249 msgid "All the provisos about C<guestfs_command> apply to this call."
30253 #: ../src/guestfs-actions.pod:6855
30254 msgid "guestfs_sh_lines"
30258 #: ../src/guestfs-actions.pod:6857
30262 " guestfs_sh_lines (guestfs_h *g,\n"
30263 " const char *command);\n"
30268 #: ../src/guestfs-actions.pod:6861
30270 "This is the same as C<guestfs_sh>, but splits the result into a list of "
30275 #: ../src/guestfs-actions.pod:6864
30276 msgid "See also: C<guestfs_command_lines>"
30280 #: ../src/guestfs-actions.pod:6872
30281 msgid "guestfs_sleep"
30285 #: ../src/guestfs-actions.pod:6874
30289 " guestfs_sleep (guestfs_h *g,\n"
30295 #: ../src/guestfs-actions.pod:6882
30296 msgid "(Added in 1.0.41)"
30300 #: ../src/guestfs-actions.pod:6884 ../src/guestfs-structs.pod:109
30301 msgid "guestfs_stat"
30305 #: ../src/guestfs-actions.pod:6886
30308 " struct guestfs_stat *\n"
30309 " guestfs_stat (guestfs_h *g,\n"
30310 " const char *path);\n"
30315 #: ../src/guestfs-actions.pod:6900 ../src/guestfs-structs.pod:135
30316 msgid "guestfs_statvfs"
30320 #: ../src/guestfs-actions.pod:6902
30323 " struct guestfs_statvfs *\n"
30324 " guestfs_statvfs (guestfs_h *g,\n"
30325 " const char *path);\n"
30330 #: ../src/guestfs-actions.pod:6912
30332 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30333 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30337 #: ../src/guestfs-actions.pod:6918
30338 msgid "guestfs_strings"
30342 #: ../src/guestfs-actions.pod:6920
30346 " guestfs_strings (guestfs_h *g,\n"
30347 " const char *path);\n"
30352 #: ../src/guestfs-actions.pod:6936
30353 msgid "guestfs_strings_e"
30357 #: ../src/guestfs-actions.pod:6938
30361 " guestfs_strings_e (guestfs_h *g,\n"
30362 " const char *encoding,\n"
30363 " const char *path);\n"
30368 #: ../src/guestfs-actions.pod:6943
30370 "This is like the C<guestfs_strings> command, but allows you to specify the "
30371 "encoding of strings that are looked for in the source file C<path>."
30375 #: ../src/guestfs-actions.pod:6953
30377 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30378 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30382 #: ../src/guestfs-actions.pod:6991
30383 msgid "guestfs_swapoff_device"
30387 #: ../src/guestfs-actions.pod:6993
30391 " guestfs_swapoff_device (guestfs_h *g,\n"
30392 " const char *device);\n"
30397 #: ../src/guestfs-actions.pod:6997
30399 "This command disables the libguestfs appliance swap device or partition "
30400 "named C<device>. See C<guestfs_swapon_device>."
30404 #: ../src/guestfs-actions.pod:7005
30405 msgid "guestfs_swapoff_file"
30409 #: ../src/guestfs-actions.pod:7007
30413 " guestfs_swapoff_file (guestfs_h *g,\n"
30414 " const char *file);\n"
30419 #: ../src/guestfs-actions.pod:7017
30420 msgid "guestfs_swapoff_label"
30424 #: ../src/guestfs-actions.pod:7019
30428 " guestfs_swapoff_label (guestfs_h *g,\n"
30429 " const char *label);\n"
30434 #: ../src/guestfs-actions.pod:7030
30435 msgid "guestfs_swapoff_uuid"
30439 #: ../src/guestfs-actions.pod:7032
30443 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30444 " const char *uuid);\n"
30449 #: ../src/guestfs-actions.pod:7043
30450 msgid "guestfs_swapon_device"
30454 #: ../src/guestfs-actions.pod:7045
30458 " guestfs_swapon_device (guestfs_h *g,\n"
30459 " const char *device);\n"
30464 #: ../src/guestfs-actions.pod:7049
30466 "This command enables the libguestfs appliance to use the swap device or "
30467 "partition named C<device>. The increased memory is made available for all "
30468 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30472 #: ../src/guestfs-actions.pod:7065
30473 msgid "guestfs_swapon_file"
30477 #: ../src/guestfs-actions.pod:7067
30481 " guestfs_swapon_file (guestfs_h *g,\n"
30482 " const char *file);\n"
30487 #: ../src/guestfs-actions.pod:7071
30489 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30494 #: ../src/guestfs-actions.pod:7078
30495 msgid "guestfs_swapon_label"
30499 #: ../src/guestfs-actions.pod:7080
30503 " guestfs_swapon_label (guestfs_h *g,\n"
30504 " const char *label);\n"
30509 #: ../src/guestfs-actions.pod:7084
30511 "This command enables swap to a labeled swap partition. See "
30512 "C<guestfs_swapon_device> for other notes."
30516 #: ../src/guestfs-actions.pod:7091
30517 msgid "guestfs_swapon_uuid"
30521 #: ../src/guestfs-actions.pod:7093
30525 " guestfs_swapon_uuid (guestfs_h *g,\n"
30526 " const char *uuid);\n"
30531 #: ../src/guestfs-actions.pod:7097
30533 "This command enables swap to a swap partition with the given UUID. See "
30534 "C<guestfs_swapon_device> for other notes."
30538 #: ../src/guestfs-actions.pod:7104
30539 msgid "guestfs_sync"
30543 #: ../src/guestfs-actions.pod:7106
30547 " guestfs_sync (guestfs_h *g);\n"
30552 #: ../src/guestfs-actions.pod:7119
30553 msgid "guestfs_tail"
30557 #: ../src/guestfs-actions.pod:7121
30561 " guestfs_tail (guestfs_h *g,\n"
30562 " const char *path);\n"
30567 #: ../src/guestfs-actions.pod:7137
30568 msgid "guestfs_tail_n"
30572 #: ../src/guestfs-actions.pod:7139
30576 " guestfs_tail_n (guestfs_h *g,\n"
30578 " const char *path);\n"
30583 #: ../src/guestfs-actions.pod:7161
30584 msgid "guestfs_tar_in"
30588 #: ../src/guestfs-actions.pod:7163
30592 " guestfs_tar_in (guestfs_h *g,\n"
30593 " const char *tarfile,\n"
30594 " const char *directory);\n"
30599 #: ../src/guestfs-actions.pod:7171
30601 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30605 #: ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7193
30606 #: ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7225
30607 msgid "(Added in 1.0.3)"
30611 #: ../src/guestfs-actions.pod:7178
30612 msgid "guestfs_tar_out"
30616 #: ../src/guestfs-actions.pod:7180
30620 " guestfs_tar_out (guestfs_h *g,\n"
30621 " const char *directory,\n"
30622 " const char *tarfile);\n"
30627 #: ../src/guestfs-actions.pod:7188
30629 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30630 "C<guestfs_txz_out>."
30634 #: ../src/guestfs-actions.pod:7195
30635 msgid "guestfs_tgz_in"
30639 #: ../src/guestfs-actions.pod:7197
30643 " guestfs_tgz_in (guestfs_h *g,\n"
30644 " const char *tarball,\n"
30645 " const char *directory);\n"
30650 #: ../src/guestfs-actions.pod:7205
30651 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30655 #: ../src/guestfs-actions.pod:7211
30656 msgid "guestfs_tgz_out"
30660 #: ../src/guestfs-actions.pod:7213
30664 " guestfs_tgz_out (guestfs_h *g,\n"
30665 " const char *directory,\n"
30666 " const char *tarball);\n"
30671 #: ../src/guestfs-actions.pod:7221
30672 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30676 #: ../src/guestfs-actions.pod:7227
30677 msgid "guestfs_touch"
30681 #: ../src/guestfs-actions.pod:7229
30685 " guestfs_touch (guestfs_h *g,\n"
30686 " const char *path);\n"
30691 #: ../src/guestfs-actions.pod:7244
30692 msgid "guestfs_truncate"
30696 #: ../src/guestfs-actions.pod:7246
30700 " guestfs_truncate (guestfs_h *g,\n"
30701 " const char *path);\n"
30706 #: ../src/guestfs-actions.pod:7257
30707 msgid "guestfs_truncate_size"
30711 #: ../src/guestfs-actions.pod:7259
30715 " guestfs_truncate_size (guestfs_h *g,\n"
30716 " const char *path,\n"
30717 " int64_t size);\n"
30722 #: ../src/guestfs-actions.pod:7267
30724 "If the current file size is less than C<size> then the file is extended to "
30725 "the required size with zero bytes. This creates a sparse file (ie. disk "
30726 "blocks are not allocated for the file until you write to it). To create a "
30727 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
30731 #: ../src/guestfs-actions.pod:7277
30732 msgid "guestfs_tune2fs_l"
30736 #: ../src/guestfs-actions.pod:7279
30740 " guestfs_tune2fs_l (guestfs_h *g,\n"
30741 " const char *device);\n"
30746 #: ../src/guestfs-actions.pod:7299
30747 msgid "guestfs_txz_in"
30751 #: ../src/guestfs-actions.pod:7301
30755 " guestfs_txz_in (guestfs_h *g,\n"
30756 " const char *tarball,\n"
30757 " const char *directory);\n"
30762 #: ../src/guestfs-actions.pod:7313
30763 msgid "guestfs_txz_out"
30767 #: ../src/guestfs-actions.pod:7315
30771 " guestfs_txz_out (guestfs_h *g,\n"
30772 " const char *directory,\n"
30773 " const char *tarball);\n"
30778 #: ../src/guestfs-actions.pod:7327
30779 msgid "guestfs_umask"
30783 #: ../src/guestfs-actions.pod:7329
30787 " guestfs_umask (guestfs_h *g,\n"
30793 #: ../src/guestfs-actions.pod:7345
30795 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
30796 "C<guestfs_mkdir>."
30800 #: ../src/guestfs-actions.pod:7354
30801 msgid "guestfs_umount"
30805 #: ../src/guestfs-actions.pod:7356
30809 " guestfs_umount (guestfs_h *g,\n"
30810 " const char *pathordevice);\n"
30815 #: ../src/guestfs-actions.pod:7368
30816 msgid "guestfs_umount_all"
30820 #: ../src/guestfs-actions.pod:7370
30824 " guestfs_umount_all (guestfs_h *g);\n"
30829 #: ../src/guestfs-actions.pod:7381
30830 msgid "guestfs_upload"
30834 #: ../src/guestfs-actions.pod:7383
30838 " guestfs_upload (guestfs_h *g,\n"
30839 " const char *filename,\n"
30840 " const char *remotefilename);\n"
30845 #: ../src/guestfs-actions.pod:7393
30846 msgid "See also C<guestfs_download>."
30850 #: ../src/guestfs-actions.pod:7404
30851 msgid "guestfs_upload_offset"
30855 #: ../src/guestfs-actions.pod:7406
30859 " guestfs_upload_offset (guestfs_h *g,\n"
30860 " const char *filename,\n"
30861 " const char *remotefilename,\n"
30862 " int64_t offset);\n"
30867 #: ../src/guestfs-actions.pod:7422
30869 "Note that there is no limit on the amount of data that can be uploaded with "
30870 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
30871 "full amount unless an error occurs."
30875 #: ../src/guestfs-actions.pod:7427
30876 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
30880 #: ../src/guestfs-actions.pod:7438
30881 msgid "guestfs_utimens"
30885 #: ../src/guestfs-actions.pod:7440
30889 " guestfs_utimens (guestfs_h *g,\n"
30890 " const char *path,\n"
30891 " int64_t atsecs,\n"
30892 " int64_t atnsecs,\n"
30893 " int64_t mtsecs,\n"
30894 " int64_t mtnsecs);\n"
30899 #: ../src/guestfs-actions.pod:7469 ../src/guestfs-structs.pod:175
30900 msgid "guestfs_version"
30904 #: ../src/guestfs-actions.pod:7471
30907 " struct guestfs_version *\n"
30908 " guestfs_version (guestfs_h *g);\n"
30913 #: ../src/guestfs-actions.pod:7499
30915 "I<Note:> Don't use this call to test for availability of features. In "
30916 "enterprise distributions we backport features from later versions into "
30917 "earlier versions, making this an unreliable way to test for features. Use "
30918 "C<guestfs_available> instead."
30922 #: ../src/guestfs-actions.pod:7505
30924 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
30925 "error. I<The caller must call C<guestfs_free_version> after use>."
30929 #: ../src/guestfs-actions.pod:7509
30930 msgid "(Added in 1.0.58)"
30934 #: ../src/guestfs-actions.pod:7511
30935 msgid "guestfs_vfs_label"
30939 #: ../src/guestfs-actions.pod:7513
30943 " guestfs_vfs_label (guestfs_h *g,\n"
30944 " const char *device);\n"
30949 #: ../src/guestfs-actions.pod:7522
30950 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
30954 #: ../src/guestfs-actions.pod:7527 ../src/guestfs-actions.pod:7564
30955 msgid "(Added in 1.3.18)"
30959 #: ../src/guestfs-actions.pod:7529
30960 msgid "guestfs_vfs_type"
30964 #: ../src/guestfs-actions.pod:7531
30968 " guestfs_vfs_type (guestfs_h *g,\n"
30969 " const char *device);\n"
30974 #: ../src/guestfs-actions.pod:7548
30975 msgid "guestfs_vfs_uuid"
30979 #: ../src/guestfs-actions.pod:7550
30983 " guestfs_vfs_uuid (guestfs_h *g,\n"
30984 " const char *device);\n"
30989 #: ../src/guestfs-actions.pod:7559
30990 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
30994 #: ../src/guestfs-actions.pod:7566
30995 msgid "guestfs_vg_activate"
30999 #: ../src/guestfs-actions.pod:7568
31003 " guestfs_vg_activate (guestfs_h *g,\n"
31005 " char *const *volgroups);\n"
31010 #: ../src/guestfs-actions.pod:7585
31011 msgid "guestfs_vg_activate_all"
31015 #: ../src/guestfs-actions.pod:7587
31019 " guestfs_vg_activate_all (guestfs_h *g,\n"
31020 " int activate);\n"
31025 #: ../src/guestfs-actions.pod:7600
31026 msgid "guestfs_vgcreate"
31030 #: ../src/guestfs-actions.pod:7602
31034 " guestfs_vgcreate (guestfs_h *g,\n"
31035 " const char *volgroup,\n"
31036 " char *const *physvols);\n"
31041 #: ../src/guestfs-actions.pod:7614
31042 msgid "guestfs_vglvuuids"
31046 #: ../src/guestfs-actions.pod:7616
31050 " guestfs_vglvuuids (guestfs_h *g,\n"
31051 " const char *vgname);\n"
31056 #: ../src/guestfs-actions.pod:7623
31058 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31059 "associate logical volumes and volume groups."
31063 #: ../src/guestfs-actions.pod:7626
31064 msgid "See also C<guestfs_vgpvuuids>."
31068 #: ../src/guestfs-actions.pod:7634
31069 msgid "guestfs_vgpvuuids"
31073 #: ../src/guestfs-actions.pod:7636
31077 " guestfs_vgpvuuids (guestfs_h *g,\n"
31078 " const char *vgname);\n"
31083 #: ../src/guestfs-actions.pod:7643
31085 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31086 "associate physical volumes and volume groups."
31090 #: ../src/guestfs-actions.pod:7646
31091 msgid "See also C<guestfs_vglvuuids>."
31095 #: ../src/guestfs-actions.pod:7654
31096 msgid "guestfs_vgremove"
31100 #: ../src/guestfs-actions.pod:7656
31104 " guestfs_vgremove (guestfs_h *g,\n"
31105 " const char *vgname);\n"
31110 #: ../src/guestfs-actions.pod:7669
31111 msgid "guestfs_vgrename"
31115 #: ../src/guestfs-actions.pod:7671
31119 " guestfs_vgrename (guestfs_h *g,\n"
31120 " const char *volgroup,\n"
31121 " const char *newvolgroup);\n"
31126 #: ../src/guestfs-actions.pod:7682
31127 msgid "guestfs_vgs"
31131 #: ../src/guestfs-actions.pod:7684
31135 " guestfs_vgs (guestfs_h *g);\n"
31140 #: ../src/guestfs-actions.pod:7693
31141 msgid "See also C<guestfs_vgs_full>."
31145 #: ../src/guestfs-actions.pod:7701
31146 msgid "guestfs_vgs_full"
31150 #: ../src/guestfs-actions.pod:7703
31153 " struct guestfs_lvm_vg_list *\n"
31154 " guestfs_vgs_full (guestfs_h *g);\n"
31159 #: ../src/guestfs-actions.pod:7709
31161 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
31162 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
31166 #: ../src/guestfs-actions.pod:7715
31167 msgid "guestfs_vgscan"
31171 #: ../src/guestfs-actions.pod:7717
31175 " guestfs_vgscan (guestfs_h *g);\n"
31180 #: ../src/guestfs-actions.pod:7727
31181 msgid "guestfs_vguuid"
31185 #: ../src/guestfs-actions.pod:7729
31189 " guestfs_vguuid (guestfs_h *g,\n"
31190 " const char *vgname);\n"
31195 #: ../src/guestfs-actions.pod:7740
31196 msgid "guestfs_wait_ready"
31200 #: ../src/guestfs-actions.pod:7742
31204 " guestfs_wait_ready (guestfs_h *g);\n"
31209 #: ../src/guestfs-actions.pod:7745
31211 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
31216 #: ../src/guestfs-actions.pod:7752
31217 msgid "This function is a no op."
31221 #: ../src/guestfs-actions.pod:7754
31223 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
31224 "calling C<guestfs_launch> to wait for the launch to complete. However this "
31225 "is no longer necessary because C<guestfs_launch> now does the waiting."
31229 #: ../src/guestfs-actions.pod:7759
31231 "If you see any calls to this function in code then you can just remove them, "
31232 "unless you want to retain compatibility with older versions of the API."
31236 #: ../src/guestfs-actions.pod:7767
31237 msgid "guestfs_wc_c"
31241 #: ../src/guestfs-actions.pod:7769
31245 " guestfs_wc_c (guestfs_h *g,\n"
31246 " const char *path);\n"
31251 #: ../src/guestfs-actions.pod:7780
31252 msgid "guestfs_wc_l"
31256 #: ../src/guestfs-actions.pod:7782
31260 " guestfs_wc_l (guestfs_h *g,\n"
31261 " const char *path);\n"
31266 #: ../src/guestfs-actions.pod:7793
31267 msgid "guestfs_wc_w"
31271 #: ../src/guestfs-actions.pod:7795
31275 " guestfs_wc_w (guestfs_h *g,\n"
31276 " const char *path);\n"
31281 #: ../src/guestfs-actions.pod:7806
31282 msgid "guestfs_write"
31286 #: ../src/guestfs-actions.pod:7808
31290 " guestfs_write (guestfs_h *g,\n"
31291 " const char *path,\n"
31292 " const char *content,\n"
31293 " size_t content_size);\n"
31298 #: ../src/guestfs-actions.pod:7817
31299 msgid "See also C<guestfs_write_append>."
31303 #: ../src/guestfs-actions.pod:7826
31304 msgid "guestfs_write_append"
31308 #: ../src/guestfs-actions.pod:7828
31312 " guestfs_write_append (guestfs_h *g,\n"
31313 " const char *path,\n"
31314 " const char *content,\n"
31315 " size_t content_size);\n"
31320 #: ../src/guestfs-actions.pod:7837
31321 msgid "See also C<guestfs_write>."
31325 #: ../src/guestfs-actions.pod:7846
31326 msgid "guestfs_write_file"
31330 #: ../src/guestfs-actions.pod:7848
31334 " guestfs_write_file (guestfs_h *g,\n"
31335 " const char *path,\n"
31336 " const char *content,\n"
31342 #: ../src/guestfs-actions.pod:7854
31344 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31349 #: ../src/guestfs-actions.pod:7879
31350 msgid "guestfs_zegrep"
31354 #: ../src/guestfs-actions.pod:7881
31358 " guestfs_zegrep (guestfs_h *g,\n"
31359 " const char *regex,\n"
31360 " const char *path);\n"
31365 #: ../src/guestfs-actions.pod:7898
31366 msgid "guestfs_zegrepi"
31370 #: ../src/guestfs-actions.pod:7900
31374 " guestfs_zegrepi (guestfs_h *g,\n"
31375 " const char *regex,\n"
31376 " const char *path);\n"
31381 #: ../src/guestfs-actions.pod:7917
31382 msgid "guestfs_zero"
31386 #: ../src/guestfs-actions.pod:7919
31390 " guestfs_zero (guestfs_h *g,\n"
31391 " const char *device);\n"
31396 #: ../src/guestfs-actions.pod:7933
31398 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31399 "C<guestfs_is_zero_device>"
31403 #: ../src/guestfs-actions.pod:7945
31404 msgid "guestfs_zero_device"
31408 #: ../src/guestfs-actions.pod:7947
31412 " guestfs_zero_device (guestfs_h *g,\n"
31413 " const char *device);\n"
31418 #: ../src/guestfs-actions.pod:7951
31420 "This command writes zeroes over the entire C<device>. Compare with "
31421 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31425 #: ../src/guestfs-actions.pod:7969
31426 msgid "(Added in 1.3.1)"
31430 #: ../src/guestfs-actions.pod:7971
31431 msgid "guestfs_zerofree"
31435 #: ../src/guestfs-actions.pod:7973
31439 " guestfs_zerofree (guestfs_h *g,\n"
31440 " const char *device);\n"
31445 #: ../src/guestfs-actions.pod:7992
31446 msgid "guestfs_zfgrep"
31450 #: ../src/guestfs-actions.pod:7994
31454 " guestfs_zfgrep (guestfs_h *g,\n"
31455 " const char *pattern,\n"
31456 " const char *path);\n"
31461 #: ../src/guestfs-actions.pod:8011
31462 msgid "guestfs_zfgrepi"
31466 #: ../src/guestfs-actions.pod:8013
31470 " guestfs_zfgrepi (guestfs_h *g,\n"
31471 " const char *pattern,\n"
31472 " const char *path);\n"
31477 #: ../src/guestfs-actions.pod:8030
31478 msgid "guestfs_zfile"
31482 #: ../src/guestfs-actions.pod:8032
31486 " guestfs_zfile (guestfs_h *g,\n"
31487 " const char *meth,\n"
31488 " const char *path);\n"
31493 #: ../src/guestfs-actions.pod:8037
31495 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31500 #: ../src/guestfs-actions.pod:8049
31502 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31507 #: ../src/guestfs-actions.pod:8057
31508 msgid "guestfs_zgrep"
31512 #: ../src/guestfs-actions.pod:8059
31516 " guestfs_zgrep (guestfs_h *g,\n"
31517 " const char *regex,\n"
31518 " const char *path);\n"
31523 #: ../src/guestfs-actions.pod:8076
31524 msgid "guestfs_zgrepi"
31528 #: ../src/guestfs-actions.pod:8078
31532 " guestfs_zgrepi (guestfs_h *g,\n"
31533 " const char *regex,\n"
31534 " const char *path);\n"
31539 #: ../src/guestfs-availability.pod:3
31544 #: ../src/guestfs-availability.pod:5
31546 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
31547 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
31548 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
31549 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
31550 "L</guestfs_aug_save> L</guestfs_aug_set>"
31554 #: ../src/guestfs-availability.pod:21
31559 #: ../src/guestfs-availability.pod:23
31560 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31564 #: ../src/guestfs-availability.pod:26
31569 #: ../src/guestfs-availability.pod:28
31570 msgid "The following functions: L</guestfs_grub_install>"
31574 #: ../src/guestfs-availability.pod:31
31579 #: ../src/guestfs-availability.pod:33
31581 "The following functions: L</guestfs_inotify_add_watch> L</"
31582 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
31583 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31587 #: ../src/guestfs-availability.pod:41
31588 msgid "B<linuxfsuuid>"
31592 #: ../src/guestfs-availability.pod:43
31594 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
31595 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31599 #: ../src/guestfs-availability.pod:50
31600 msgid "B<linuxmodules>"
31604 #: ../src/guestfs-availability.pod:52
31605 msgid "The following functions: L</guestfs_modprobe>"
31609 #: ../src/guestfs-availability.pod:55
31610 msgid "B<linuxxattrs>"
31614 #: ../src/guestfs-availability.pod:57
31616 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
31617 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
31618 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
31619 "guestfs_setxattr>"
31623 #: ../src/guestfs-availability.pod:68
31628 #: ../src/guestfs-availability.pod:70
31630 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
31631 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
31632 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31636 #: ../src/guestfs-availability.pod:79
31641 #: ../src/guestfs-availability.pod:81
31643 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
31644 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
31645 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
31646 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
31647 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
31648 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
31649 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
31653 #: ../src/guestfs-availability.pod:104
31658 #: ../src/guestfs-availability.pod:106
31660 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
31661 "guestfs_mknod_b> L</guestfs_mknod_c>"
31665 #: ../src/guestfs-availability.pod:112
31670 #: ../src/guestfs-availability.pod:114
31671 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31675 #: ../src/guestfs-availability.pod:117
31676 msgid "B<ntfsprogs>"
31680 #: ../src/guestfs-availability.pod:119
31682 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31683 "L</guestfs_ntfsresize_size>"
31687 #: ../src/guestfs-availability.pod:124
31688 msgid "B<realpath>"
31692 #: ../src/guestfs-availability.pod:126
31693 msgid "The following functions: L</guestfs_realpath>"
31697 #: ../src/guestfs-availability.pod:129
31702 #: ../src/guestfs-availability.pod:131
31704 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
31705 "guestfs_scrub_freespace>"
31709 #: ../src/guestfs-availability.pod:136
31714 #: ../src/guestfs-availability.pod:138
31715 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
31719 #: ../src/guestfs-availability.pod:142
31724 #: ../src/guestfs-availability.pod:144
31725 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
31729 #: ../src/guestfs-availability.pod:148
31730 msgid "B<zerofree>"
31734 #: ../src/guestfs-availability.pod:150
31735 msgid "The following functions: L</guestfs_zerofree>"
31739 #: ../src/guestfs-structs.pod:1
31740 msgid "guestfs_int_bool"
31744 #: ../src/guestfs-structs.pod:3
31747 " struct guestfs_int_bool {\n"
31755 #: ../src/guestfs-structs.pod:8
31758 " struct guestfs_int_bool_list {\n"
31759 " uint32_t len; /* Number of elements in list. */\n"
31760 " struct guestfs_int_bool *val; /* Elements. */\n"
31766 #: ../src/guestfs-structs.pod:13
31769 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
31770 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
31775 #: ../src/guestfs-structs.pod:16
31776 msgid "guestfs_lvm_pv"
31780 #: ../src/guestfs-structs.pod:18
31783 " struct guestfs_lvm_pv {\n"
31784 " char *pv_name;\n"
31785 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31786 " char pv_uuid[32];\n"
31788 " uint64_t pv_size;\n"
31789 " uint64_t dev_size;\n"
31790 " uint64_t pv_free;\n"
31791 " uint64_t pv_used;\n"
31792 " char *pv_attr;\n"
31793 " int64_t pv_pe_count;\n"
31794 " int64_t pv_pe_alloc_count;\n"
31795 " char *pv_tags;\n"
31796 " uint64_t pe_start;\n"
31797 " int64_t pv_mda_count;\n"
31798 " uint64_t pv_mda_free;\n"
31804 #: ../src/guestfs-structs.pod:36
31807 " struct guestfs_lvm_pv_list {\n"
31808 " uint32_t len; /* Number of elements in list. */\n"
31809 " struct guestfs_lvm_pv *val; /* Elements. */\n"
31815 #: ../src/guestfs-structs.pod:41
31818 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
31819 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
31824 #: ../src/guestfs-structs.pod:44
31825 msgid "guestfs_lvm_vg"
31829 #: ../src/guestfs-structs.pod:46
31832 " struct guestfs_lvm_vg {\n"
31833 " char *vg_name;\n"
31834 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31835 " char vg_uuid[32];\n"
31837 " char *vg_attr;\n"
31838 " uint64_t vg_size;\n"
31839 " uint64_t vg_free;\n"
31840 " char *vg_sysid;\n"
31841 " uint64_t vg_extent_size;\n"
31842 " int64_t vg_extent_count;\n"
31843 " int64_t vg_free_count;\n"
31844 " int64_t max_lv;\n"
31845 " int64_t max_pv;\n"
31846 " int64_t pv_count;\n"
31847 " int64_t lv_count;\n"
31848 " int64_t snap_count;\n"
31849 " int64_t vg_seqno;\n"
31850 " char *vg_tags;\n"
31851 " int64_t vg_mda_count;\n"
31852 " uint64_t vg_mda_free;\n"
31858 #: ../src/guestfs-structs.pod:69
31861 " struct guestfs_lvm_vg_list {\n"
31862 " uint32_t len; /* Number of elements in list. */\n"
31863 " struct guestfs_lvm_vg *val; /* Elements. */\n"
31869 #: ../src/guestfs-structs.pod:74
31872 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
31873 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
31878 #: ../src/guestfs-structs.pod:77
31879 msgid "guestfs_lvm_lv"
31883 #: ../src/guestfs-structs.pod:79
31886 " struct guestfs_lvm_lv {\n"
31887 " char *lv_name;\n"
31888 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31889 " char lv_uuid[32];\n"
31890 " char *lv_attr;\n"
31891 " int64_t lv_major;\n"
31892 " int64_t lv_minor;\n"
31893 " int64_t lv_kernel_major;\n"
31894 " int64_t lv_kernel_minor;\n"
31895 " uint64_t lv_size;\n"
31896 " int64_t seg_count;\n"
31898 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31899 " float snap_percent;\n"
31900 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31901 " float copy_percent;\n"
31902 " char *move_pv;\n"
31903 " char *lv_tags;\n"
31904 " char *mirror_log;\n"
31905 " char *modules;\n"
31911 #: ../src/guestfs-structs.pod:101
31914 " struct guestfs_lvm_lv_list {\n"
31915 " uint32_t len; /* Number of elements in list. */\n"
31916 " struct guestfs_lvm_lv *val; /* Elements. */\n"
31922 #: ../src/guestfs-structs.pod:106
31925 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
31926 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
31931 #: ../src/guestfs-structs.pod:111
31934 " struct guestfs_stat {\n"
31938 " int64_t nlink;\n"
31943 " int64_t blksize;\n"
31944 " int64_t blocks;\n"
31945 " int64_t atime;\n"
31946 " int64_t mtime;\n"
31947 " int64_t ctime;\n"
31953 #: ../src/guestfs-structs.pod:127
31956 " struct guestfs_stat_list {\n"
31957 " uint32_t len; /* Number of elements in list. */\n"
31958 " struct guestfs_stat *val; /* Elements. */\n"
31964 #: ../src/guestfs-structs.pod:132
31967 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
31968 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
31973 #: ../src/guestfs-structs.pod:137
31976 " struct guestfs_statvfs {\n"
31977 " int64_t bsize;\n"
31978 " int64_t frsize;\n"
31979 " int64_t blocks;\n"
31980 " int64_t bfree;\n"
31981 " int64_t bavail;\n"
31982 " int64_t files;\n"
31983 " int64_t ffree;\n"
31984 " int64_t favail;\n"
31987 " int64_t namemax;\n"
31993 #: ../src/guestfs-structs.pod:151
31996 " struct guestfs_statvfs_list {\n"
31997 " uint32_t len; /* Number of elements in list. */\n"
31998 " struct guestfs_statvfs *val; /* Elements. */\n"
32004 #: ../src/guestfs-structs.pod:156
32007 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32008 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32013 #: ../src/guestfs-structs.pod:159
32014 msgid "guestfs_dirent"
32018 #: ../src/guestfs-structs.pod:161
32021 " struct guestfs_dirent {\n"
32030 #: ../src/guestfs-structs.pod:167
32033 " struct guestfs_dirent_list {\n"
32034 " uint32_t len; /* Number of elements in list. */\n"
32035 " struct guestfs_dirent *val; /* Elements. */\n"
32041 #: ../src/guestfs-structs.pod:172
32044 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32045 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32050 #: ../src/guestfs-structs.pod:177
32053 " struct guestfs_version {\n"
32054 " int64_t major;\n"
32055 " int64_t minor;\n"
32056 " int64_t release;\n"
32063 #: ../src/guestfs-structs.pod:184
32066 " struct guestfs_version_list {\n"
32067 " uint32_t len; /* Number of elements in list. */\n"
32068 " struct guestfs_version *val; /* Elements. */\n"
32074 #: ../src/guestfs-structs.pod:189
32077 " void guestfs_free_version (struct guestfs_free_version *);\n"
32078 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32083 #: ../src/guestfs-structs.pod:192
32084 msgid "guestfs_xattr"
32088 #: ../src/guestfs-structs.pod:194
32091 " struct guestfs_xattr {\n"
32092 " char *attrname;\n"
32093 " /* The next two fields describe a byte array. */\n"
32094 " uint32_t attrval_len;\n"
32095 " char *attrval;\n"
32101 #: ../src/guestfs-structs.pod:201
32104 " struct guestfs_xattr_list {\n"
32105 " uint32_t len; /* Number of elements in list. */\n"
32106 " struct guestfs_xattr *val; /* Elements. */\n"
32112 #: ../src/guestfs-structs.pod:206
32115 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
32116 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
32121 #: ../src/guestfs-structs.pod:209
32122 msgid "guestfs_inotify_event"
32126 #: ../src/guestfs-structs.pod:211
32129 " struct guestfs_inotify_event {\n"
32130 " int64_t in_wd;\n"
32131 " uint32_t in_mask;\n"
32132 " uint32_t in_cookie;\n"
32133 " char *in_name;\n"
32139 #: ../src/guestfs-structs.pod:218
32142 " struct guestfs_inotify_event_list {\n"
32143 " uint32_t len; /* Number of elements in list. */\n"
32144 " struct guestfs_inotify_event *val; /* Elements. */\n"
32150 #: ../src/guestfs-structs.pod:223
32153 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
32154 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
32159 #: ../src/guestfs-structs.pod:226
32160 msgid "guestfs_partition"
32164 #: ../src/guestfs-structs.pod:228
32167 " struct guestfs_partition {\n"
32168 " int32_t part_num;\n"
32169 " uint64_t part_start;\n"
32170 " uint64_t part_end;\n"
32171 " uint64_t part_size;\n"
32177 #: ../src/guestfs-structs.pod:235
32180 " struct guestfs_partition_list {\n"
32181 " uint32_t len; /* Number of elements in list. */\n"
32182 " struct guestfs_partition *val; /* Elements. */\n"
32188 #: ../src/guestfs-structs.pod:240
32191 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
32192 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
32197 #: ../src/guestfs-structs.pod:243
32198 msgid "guestfs_application"
32202 #: ../src/guestfs-structs.pod:245
32205 " struct guestfs_application {\n"
32206 " char *app_name;\n"
32207 " char *app_display_name;\n"
32208 " int32_t app_epoch;\n"
32209 " char *app_version;\n"
32210 " char *app_release;\n"
32211 " char *app_install_path;\n"
32212 " char *app_trans_path;\n"
32213 " char *app_publisher;\n"
32214 " char *app_url;\n"
32215 " char *app_source_package;\n"
32216 " char *app_summary;\n"
32217 " char *app_description;\n"
32223 #: ../src/guestfs-structs.pod:260
32226 " struct guestfs_application_list {\n"
32227 " uint32_t len; /* Number of elements in list. */\n"
32228 " struct guestfs_application *val; /* Elements. */\n"
32234 #: ../src/guestfs-structs.pod:265
32237 " void guestfs_free_application (struct guestfs_free_application *);\n"
32238 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
32243 #: ../src/guestfs.pod:5
32244 msgid "guestfs - Library for accessing and modifying virtual machine images"
32248 #: ../src/guestfs.pod:11
32251 " guestfs_h *g = guestfs_create ();\n"
32252 " guestfs_add_drive (g, \"guest.img\");\n"
32253 " guestfs_launch (g);\n"
32254 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32255 " guestfs_touch (g, \"/hello\");\n"
32256 " guestfs_umount (g, \"/\");\n"
32257 " guestfs_close (g);\n"
32262 #: ../src/guestfs.pod:25
32264 "Libguestfs is a library for accessing and modifying guest disk images. "
32265 "Amongst the things this is good for: making batch configuration changes to "
32266 "guests, getting disk used/free statistics (see also: virt-df), migrating "
32267 "between virtualization systems (see also: virt-p2v), performing partial "
32268 "backups, performing partial guest clones, cloning guests and changing "
32269 "registry/UUID/hostname info, and much else besides."
32273 #: ../src/guestfs.pod:33
32275 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
32276 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
32277 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
32282 #: ../src/guestfs.pod:38
32284 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
32285 "what filesystem is in each LV, etc.). It can also run commands in the "
32286 "context of the guest. Also you can access filesystems over FUSE."
32290 #: ../src/guestfs.pod:43
32292 "Libguestfs is a library that can be linked with C and C++ management "
32293 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
32294 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
32299 #: ../src/guestfs.pod:48
32301 "You don't need to be root to use libguestfs, although obviously you do need "
32302 "enough permissions to access the disk images."
32306 #: ../src/guestfs.pod:51
32308 "Libguestfs is a large API because it can do many things. For a gentle "
32309 "introduction, please read the L</API OVERVIEW> section next."
32313 #: ../src/guestfs.pod:54
32315 "There are also some example programs in the L<guestfs-examples(3)> manual "
32320 #: ../src/guestfs.pod:57
32321 msgid "API OVERVIEW"
32325 #: ../src/guestfs.pod:59
32327 "This section provides a gentler overview of the libguestfs API. We also try "
32328 "to group API calls together, where that may not be obvious from reading "
32329 "about the individual calls in the main section of this manual."
32333 #: ../src/guestfs.pod:64
32338 #: ../src/guestfs.pod:66
32340 "Before you can use libguestfs calls, you have to create a handle. Then you "
32341 "must add at least one disk image to the handle, followed by launching the "
32342 "handle, then performing whatever operations you want, and finally closing "
32343 "the handle. By convention we use the single letter C<g> for the name of the "
32344 "handle variable, although of course you can use any name you want."
32348 #: ../src/guestfs.pod:73
32349 msgid "The general structure of all libguestfs-using programs looks like this:"
32353 #: ../src/guestfs.pod:76
32356 " guestfs_h *g = guestfs_create ();\n"
32361 #: ../src/guestfs.pod:78
32364 " /* Call guestfs_add_drive additional times if there are\n"
32365 " * multiple disk images.\n"
32367 " guestfs_add_drive (g, \"guest.img\");\n"
32372 #: ../src/guestfs.pod:83
32375 " /* Most manipulation calls won't work until you've launched\n"
32376 " * the handle 'g'. You have to do this _after_ adding drives\n"
32377 " * and _before_ other commands.\n"
32379 " guestfs_launch (g);\n"
32384 #: ../src/guestfs.pod:89
32387 " /* Now you can examine what partitions, LVs etc are available.\n"
32389 " char **partitions = guestfs_list_partitions (g);\n"
32390 " char **logvols = guestfs_lvs (g);\n"
32395 #: ../src/guestfs.pod:94
32398 " /* To access a filesystem in the image, you must mount it.\n"
32400 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32405 #: ../src/guestfs.pod:98
32408 " /* Now you can perform filesystem actions on the guest\n"
32411 " guestfs_touch (g, \"/hello\");\n"
32416 #: ../src/guestfs.pod:103
32419 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32420 " * it is done automatically when you close the handle. See\n"
32421 " * discussion of autosync in this page.\n"
32423 " guestfs_sync (g);\n"
32428 #: ../src/guestfs.pod:109
32431 " /* Close the handle 'g'. */\n"
32432 " guestfs_close (g);\n"
32437 #: ../src/guestfs.pod:112
32439 "The code above doesn't include any error checking. In real code you should "
32440 "check return values carefully for errors. In general all functions that "
32441 "return integers return C<-1> on error, and all functions that return "
32442 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32443 "how to handle errors, and consult the documentation for each function call "
32444 "below to see precisely how they return error indications. See L<guestfs-"
32445 "examples(3)> for fully worked examples."
32449 #: ../src/guestfs.pod:121
32450 msgid "DISK IMAGES"
32454 #: ../src/guestfs.pod:123
32456 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32457 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32458 "actual block device, or simply an empty file of zeroes that you have created "
32459 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32464 #: ../src/guestfs.pod:129
32466 "The call you should use in modern code for adding drives is L</"
32467 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32468 "specifying that the format is raw, do:"
32472 #: ../src/guestfs.pod:133
32475 " guestfs_add_drive_opts (g, filename,\n"
32476 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32482 #: ../src/guestfs.pod:137
32483 msgid "You can add a disk read-only using:"
32487 #: ../src/guestfs.pod:139
32490 " guestfs_add_drive_opts (g, filename,\n"
32491 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32492 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32498 #: ../src/guestfs.pod:144
32500 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32501 "libguestfs won't modify the file."
32505 #: ../src/guestfs.pod:147
32507 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32508 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32509 "corruption, but adding it read-only is safe."
32513 #: ../src/guestfs.pod:151
32515 "You must add at least one disk image, and you may add multiple disk images. "
32516 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32517 "first one you added), C</dev/sdb> (for the second one you added), etc."
32521 #: ../src/guestfs.pod:156
32523 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32524 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32525 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32529 #: ../src/guestfs.pod:161
32534 #: ../src/guestfs.pod:163
32536 "Before you can read or write files, create directories and so on in a disk "
32537 "image that contains filesystems, you have to mount those filesystems using "
32538 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32539 "a disk image contains (for example) one partition with a filesystem on that "
32540 "partition, then you can mount it directly:"
32544 #: ../src/guestfs.pod:170
32547 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32552 #: ../src/guestfs.pod:172
32554 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32555 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32556 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32557 "that these are libguestfs virtual devices, and are nothing to do with host "
32562 #: ../src/guestfs.pod:178
32564 "If you are given a disk image and you don't know what it contains then you "
32565 "have to find out. Libguestfs can do that too: use L</"
32566 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
32567 "LVs, and either try mounting each to see what is mountable, or else examine "
32568 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32569 "filesystems, use L</guestfs_list_filesystems>."
32573 #: ../src/guestfs.pod:186
32575 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32576 "L</INSPECTION> below). But you might find it easier to look at higher level "
32577 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32581 #: ../src/guestfs.pod:191
32583 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32584 "several other variations of the C<guestfs_mount_*> call."
32588 #: ../src/guestfs.pod:194
32589 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32593 #: ../src/guestfs.pod:196
32595 "The majority of the libguestfs API consists of fairly low-level calls for "
32596 "accessing and modifying the files, directories, symlinks etc on mounted "
32597 "filesystems. There are over a hundred such calls which you can find listed "
32598 "in detail below in this man page, and we don't even pretend to cover them "
32599 "all in this overview."
32603 #: ../src/guestfs.pod:202
32605 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32610 #: ../src/guestfs.pod:205
32612 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32613 "the file called C<\"etc/passwd\"> then you could do:"
32617 #: ../src/guestfs.pod:208
32620 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32625 #: ../src/guestfs.pod:210
32627 "This would return C<data> as a newly allocated buffer containing the full "
32628 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32629 "or C<NULL> if there was an error."
32633 #: ../src/guestfs.pod:214
32635 "As another example, to create a top-level directory on that filesystem "
32636 "called C<\"var\"> you would do:"
32640 #: ../src/guestfs.pod:217
32643 " guestfs_mkdir (g, \"/var\");\n"
32648 #: ../src/guestfs.pod:219
32649 msgid "To create a symlink you could do:"
32653 #: ../src/guestfs.pod:221
32656 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32657 " \"/etc/rc3.d/S30portmap\");\n"
32662 #: ../src/guestfs.pod:224
32664 "Libguestfs will reject attempts to use relative paths and there is no "
32665 "concept of a current working directory."
32669 #: ../src/guestfs.pod:227
32671 "Libguestfs can return errors in many situations: for example if the "
32672 "filesystem isn't writable, or if a file or directory that you requested "
32673 "doesn't exist. If you are using the C API (documented here) you have to "
32674 "check for those error conditions after each call. (Other language bindings "
32675 "turn these errors into exceptions)."
32679 #: ../src/guestfs.pod:233
32681 "File writes are affected by the per-handle umask, set by calling L</"
32682 "guestfs_umask> and defaulting to 022. See L</UMASK>."
32686 #: ../src/guestfs.pod:236
32687 msgid "PARTITIONING"
32691 #: ../src/guestfs.pod:238
32693 "Libguestfs contains API calls to read, create and modify partition tables on "
32698 #: ../src/guestfs.pod:241
32700 "In the common case where you want to create a single partition covering the "
32701 "whole disk, you should use the L</guestfs_part_disk> call:"
32705 #: ../src/guestfs.pod:245
32708 " const char *parttype = \"mbr\";\n"
32709 " if (disk_is_larger_than_2TB)\n"
32710 " parttype = \"gpt\";\n"
32711 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
32716 #: ../src/guestfs.pod:250
32718 "Obviously this effectively wipes anything that was on that disk image before."
32722 #: ../src/guestfs.pod:253
32727 #: ../src/guestfs.pod:255
32729 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
32730 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
32731 "you familiarize yourself with the concepts of physical volumes, volume "
32732 "groups and logical volumes."
32736 #: ../src/guestfs.pod:260
32738 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
32739 "tldp.org/HOWTO/LVM-HOWTO/>."
32743 #: ../src/guestfs.pod:263
32744 msgid "DOWNLOADING"
32748 #: ../src/guestfs.pod:265
32750 "Use L</guestfs_cat> to download small, text only files. This call is "
32751 "limited to files which are less than 2 MB and which cannot contain any ASCII "
32752 "NUL (C<\\0>) characters. However the API is very simple to use."
32756 #: ../src/guestfs.pod:269
32758 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
32759 "bit data, since it returns a (pointer, size) pair. However it is still "
32760 "limited to \"small\" files, less than 2 MB."
32764 #: ../src/guestfs.pod:273
32766 "L</guestfs_download> can be used to download any file, with no limits on "
32767 "content or size (even files larger than 4 GB)."
32771 #: ../src/guestfs.pod:276
32773 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
32777 #: ../src/guestfs.pod:279
32782 #: ../src/guestfs.pod:281
32784 "It's often the case that you want to write a file or files to the disk image."
32788 #: ../src/guestfs.pod:284
32790 "To write a small file with fixed content, use L</guestfs_write>. To create "
32791 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
32792 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
32793 "of other functions for creating test files, for example L</guestfs_fill> and "
32794 "L</guestfs_fill_pattern>."
32798 #: ../src/guestfs.pod:290
32800 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
32801 "file content or size (even files larger than 4 GB)."
32805 #: ../src/guestfs.pod:293
32807 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
32811 #: ../src/guestfs.pod:295
32813 "However the fastest way to upload I<large numbers of arbitrary files> is to "
32814 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
32815 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
32816 "in a predictable way (eg. adding it last after all other drives) then you "
32817 "can get the device name from L</guestfs_list_devices> and mount it directly "
32818 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
32819 "portable between kernel versions, and they don't support labels or UUIDs. "
32820 "If you want to pre-build an image or you need to mount it using a label or "
32821 "UUID, use an ISO image instead."
32825 #: ../src/guestfs.pod:306
32830 #: ../src/guestfs.pod:308
32832 "There are various different commands for copying between files and devices "
32833 "and in and out of the guest filesystem. These are summarised in the table "
32838 #: ../src/guestfs.pod:314
32839 msgid "B<file> to B<file>"
32843 #: ../src/guestfs.pod:316
32845 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
32846 "directories recursively."
32850 #: ../src/guestfs.pod:319
32851 msgid "B<file or device> to B<file or device>"
32855 #: ../src/guestfs.pod:321
32857 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
32858 "devices in the guest."
32862 #: ../src/guestfs.pod:324
32863 msgid "Example: duplicate the contents of an LV:"
32867 #: ../src/guestfs.pod:326
32870 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
32875 #: ../src/guestfs.pod:328
32877 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
32878 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
32879 "guestfs_copy_size>."
32883 #: ../src/guestfs.pod:332
32884 msgid "B<file on the host> to B<file or device>"
32888 #: ../src/guestfs.pod:334
32889 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
32893 #: ../src/guestfs.pod:336
32894 msgid "B<file or device> to B<file on the host>"
32898 #: ../src/guestfs.pod:338
32899 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
32903 #: ../src/guestfs.pod:342
32904 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
32908 #: ../src/guestfs.pod:344
32910 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
32911 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
32912 "appears you can only upload and download to files. However many Un*x-like "
32913 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
32914 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
32915 "and arbitrary file descriptor N."
32919 #: ../src/guestfs.pod:352
32920 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
32924 #: ../src/guestfs.pod:355
32927 " guestfs_download (g, filename, \"/dev/stdout\");\n"
32932 #: ../src/guestfs.pod:357
32933 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
32937 #: ../src/guestfs.pod:359
32940 " char devfd[64];\n"
32941 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
32942 " guestfs_tar_out (g, \"/\", devfd);\n"
32947 #: ../src/guestfs.pod:363
32948 msgid "LISTING FILES"
32952 #: ../src/guestfs.pod:365
32954 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
32955 "L<guestfish(1)>-equivalent command C<ll>)."
32959 #: ../src/guestfs.pod:368
32961 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
32962 "programs, as a flat list of strings."
32966 #: ../src/guestfs.pod:371
32968 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
32969 "directory, plus additional information about each one. It is more "
32970 "equivalent to using the L<readdir(3)> call on a local filesystem."
32974 #: ../src/guestfs.pod:375
32976 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
32980 #: ../src/guestfs.pod:378
32981 msgid "RUNNING COMMANDS"
32985 #: ../src/guestfs.pod:380
32987 "Although libguestfs is primarily an API for manipulating files inside guest "
32988 "images, we also provide some limited facilities for running commands inside "
32993 #: ../src/guestfs.pod:384
32994 msgid "There are many limitations to this:"
32998 #: ../src/guestfs.pod:390
33000 "The kernel version that the command runs under will be different from what "
33005 #: ../src/guestfs.pod:395
33007 "If the command needs to communicate with daemons, then most likely they "
33008 "won't be running."
33012 #: ../src/guestfs.pod:400
33013 msgid "The command will be running in limited memory."
33017 #: ../src/guestfs.pod:404
33019 "The network may not be available unless you enable it (see L</"
33020 "guestfs_set_network>)."
33024 #: ../src/guestfs.pod:409
33025 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33029 #: ../src/guestfs.pod:413
33031 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33035 #: ../src/guestfs.pod:418
33037 "For SELinux guests, you may need to enable SELinux and load policy first. "
33038 "See L</SELINUX> in this manpage."
33042 #: ../src/guestfs.pod:423
33044 "I<Security:> It is not safe to run commands from untrusted, possibly "
33045 "malicious guests. These commands may attempt to exploit your program by "
33046 "sending unexpected output. They could also try to exploit the Linux kernel "
33047 "or qemu provided by the libguestfs appliance. They could use the network "
33048 "provided by the libguestfs appliance to bypass ordinary network partitions "
33049 "and firewalls. They could use the elevated privileges or different SELinux "
33050 "context of your program to their advantage."
33054 #: ../src/guestfs.pod:432
33056 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33057 "(a script which runs when the guest next boots normally), and to have this "
33058 "script run the commands you want in the normal context of the running guest, "
33059 "network security and so on. For information about other security issues, "
33060 "see L</SECURITY>."
33064 #: ../src/guestfs.pod:440
33066 "The two main API calls to run commands are L</guestfs_command> and L</"
33067 "guestfs_sh> (there are also variations)."
33071 #: ../src/guestfs.pod:443
33073 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33074 "shell globs, redirections, etc will work."
33078 #: ../src/guestfs.pod:446
33079 msgid "CONFIGURATION FILES"
33083 #: ../src/guestfs.pod:448
33085 "To read and write configuration files in Linux guest filesystems, we "
33086 "strongly recommend using Augeas. For example, Augeas understands how to "
33087 "read and write, say, a Linux shadow password file or X.org configuration "
33088 "file, and so avoids you having to write that code."
33092 #: ../src/guestfs.pod:453
33094 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33095 "document Augeas itself here because there is excellent documentation on the "
33096 "L<http://augeas.net/> website."
33100 #: ../src/guestfs.pod:457
33102 "If you don't want to use Augeas (you fool!) then try calling L</"
33103 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
33108 #: ../src/guestfs.pod:461
33113 #: ../src/guestfs.pod:463
33115 "We support SELinux guests. To ensure that labeling happens correctly in "
33116 "SELinux guests, you need to enable SELinux and load the guest's policy:"
33120 #: ../src/guestfs.pod:471
33121 msgid "Before launching, do:"
33125 #: ../src/guestfs.pod:473
33128 " guestfs_set_selinux (g, 1);\n"
33133 #: ../src/guestfs.pod:477
33135 "After mounting the guest's filesystem(s), load the policy. This is best "
33136 "done by running the L<load_policy(8)> command in the guest itself:"
33140 #: ../src/guestfs.pod:481
33143 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
33148 #: ../src/guestfs.pod:483
33150 "(Older versions of C<load_policy> require you to specify the name of the "
33155 #: ../src/guestfs.pod:488
33157 "Optionally, set the security context for the API. The correct security "
33158 "context to use can only be known by inspecting the guest. As an example:"
33162 #: ../src/guestfs.pod:492
33165 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
33170 #: ../src/guestfs.pod:496
33171 msgid "This will work for running commands and editing existing files."
33175 #: ../src/guestfs.pod:498
33177 "When new files are created, you may need to label them explicitly, for "
33178 "example by running the external command C<restorecon pathname>."
33182 #: ../src/guestfs.pod:502
33187 #: ../src/guestfs.pod:504
33189 "Certain calls are affected by the current file mode creation mask (the "
33190 "\"umask\"). In particular ones which create files or directories, such as "
33191 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
33192 "either the default mode that the file is created with or modifies the mode "
33197 #: ../src/guestfs.pod:510
33199 "The default umask is C<022>, so files are created with modes such as C<0644> "
33200 "and directories with C<0755>."
33204 #: ../src/guestfs.pod:513
33206 "There are two ways to avoid being affected by umask. Either set umask to 0 "
33207 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
33208 "guestfs_chmod> after creating each file or directory."
33212 #: ../src/guestfs.pod:517
33213 msgid "For more information about umask, see L<umask(2)>."
33217 #: ../src/guestfs.pod:521
33219 "Libguestfs allows you to access Linux guests which have been encrypted using "
33220 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
33221 "standard. This includes nearly all whole disk encryption systems used by "
33222 "modern Linux guests."
33226 #: ../src/guestfs.pod:527
33228 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
33229 "returns the string C<crypto_LUKS>)."
33233 #: ../src/guestfs.pod:530
33235 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
33236 "will require the passphrase!"
33240 #: ../src/guestfs.pod:533
33242 "Opening a LUKS device creates a new device mapper device called C</dev/"
33243 "mapper/mapname> (where C<mapname> is the string you supply to L</"
33244 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
33245 "from and encrypted to the underlying block device respectively."
33249 #: ../src/guestfs.pod:539
33251 "LVM volume groups on the device can be made visible by calling L</"
33252 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
33253 "(s) can now be mounted in the usual way."
33257 #: ../src/guestfs.pod:543
33259 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
33260 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
33261 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
33262 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
33263 "underlying encrypted block device)."
33267 #: ../src/guestfs.pod:550
33272 #: ../src/guestfs.pod:552
33274 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
33275 "contains operating systems, an install CD or a live CD. (These APIs used to "
33276 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
33277 "version 1.5.3 the most frequently used part of this library has been "
33278 "rewritten in C and moved into the core code)."
33282 #: ../src/guestfs.pod:559
33284 "Add all disks belonging to the unknown virtual machine and call L</"
33285 "guestfs_launch> in the usual way."
33289 #: ../src/guestfs.pod:562
33291 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
33292 "and certain heuristics, and returns a list of operating systems that were "
33293 "found. An empty list means none were found. A single element is the root "
33294 "filesystem of the operating system. For dual- or multi-boot guests, "
33295 "multiple roots can be returned, each one corresponding to a separate "
33296 "operating system. (Multi-boot virtual machines are extremely rare in the "
33297 "world of virtualization, but since this scenario can happen, we have built "
33298 "libguestfs to deal with it.)"
33302 #: ../src/guestfs.pod:571
33304 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33305 "to get additional details about that operating system. For example, call L</"
33306 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33307 "Windows and Linux-based operating systems respectively."
33311 #: ../src/guestfs.pod:577
33313 "Un*x-like and Linux-based operating systems usually consist of several "
33314 "filesystems which are mounted at boot time (for example, a separate boot "
33315 "partition mounted on C</boot>). The inspection rules are able to detect how "
33316 "filesystems correspond to mount points. Call "
33317 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33318 "hash table like this example:"
33322 #: ../src/guestfs.pod:584
33325 " /boot => /dev/sda1\n"
33326 " / => /dev/vg_guest/lv_root\n"
33327 " /usr => /dev/vg_guest/lv_usr\n"
33332 #: ../src/guestfs.pod:588
33334 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33335 "filesystems as suggested."
33339 #: ../src/guestfs.pod:591
33341 "Be careful to mount filesystems in the right order (eg. C</> before C</"
33342 "usr>). Sorting the keys of the hash by length, shortest first, should work."
33346 #: ../src/guestfs.pod:595
33348 "Inspection currently only works for some common operating systems. "
33349 "Contributors are welcome to send patches for other operating systems that we "
33350 "currently cannot detect."
33354 #: ../src/guestfs.pod:599
33356 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33357 "for more details. The L</guestfs_inspect_os> function just ignores any "
33358 "encrypted devices."
33362 #: ../src/guestfs.pod:603
33364 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33365 "inspection and caches the results in the guest handle. Subsequent calls to "
33366 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
33367 "read the disks. If you change the content of the guest disks, you can redo "
33368 "inspection by calling L</guestfs_inspect_os> again. (L</"
33369 "guestfs_inspect_list_applications> works a little differently from the other "
33370 "calls and does read the disks. See documentation for that function for "
33375 #: ../src/guestfs.pod:612
33376 msgid "INSPECTING INSTALL DISKS"
33380 #: ../src/guestfs.pod:614
33382 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33387 #: ../src/guestfs.pod:617
33389 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33390 "system, which currently can be C<installed> (a regular operating system) or "
33391 "C<installer> (some sort of install disk)."
33395 #: ../src/guestfs.pod:621
33397 "Further information is available about the operating system that can be "
33398 "installed using the regular inspection APIs like L</"
33399 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
33403 #: ../src/guestfs.pod:626
33405 "Some additional information specific to installer disks is also available "
33406 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
33407 "guestfs_inspect_is_multipart> calls."
33411 #: ../src/guestfs.pod:631
33412 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33416 #: ../src/guestfs.pod:633
33418 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
33419 "ntfs-3g.org/> driver."
33423 #: ../src/guestfs.pod:636
33424 msgid "DRIVE LETTERS AND PATHS"
33428 #: ../src/guestfs.pod:638
33430 "DOS and Windows still use drive letters, and the filesystems are always "
33431 "treated as case insensitive by Windows itself, and therefore you might find "
33432 "a Windows configuration file referring to a path like C<c:\\windows"
33433 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
33434 "might be referred to as C</WINDOWS/System32>."
33438 #: ../src/guestfs.pod:644
33440 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33441 "L</guestfs_inspect_get_drive_mappings>)"
33445 #: ../src/guestfs.pod:647
33447 "Dealing with separator characters (backslash vs forward slash) is outside "
33448 "the scope of libguestfs, but usually a simple character replacement will "
33453 #: ../src/guestfs.pod:651
33455 "To resolve the case insensitivity of paths, call L</"
33456 "guestfs_case_sensitive_path>."
33460 #: ../src/guestfs.pod:654
33461 msgid "ACCESSING THE WINDOWS REGISTRY"
33465 #: ../src/guestfs.pod:656
33467 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33468 "files, through the library C<hivex> which is part of the libguestfs project "
33469 "although ships as a separate tarball. You have to locate and download the "
33470 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33471 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
33472 "reg(1)> for more help on this issue."
33476 #: ../src/guestfs.pod:664
33477 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33481 #: ../src/guestfs.pod:666
33483 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33484 "provide something which looks like a Linux symlink. The way it tries to do "
33485 "the rewriting is described here:"
33489 #: ../src/guestfs.pod:670
33491 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
33496 #: ../src/guestfs.pod:672
33498 "The essential problem is that ntfs-3g simply does not have enough "
33499 "information to do a correct job. NTFS links can contain drive letters and "
33500 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33501 "It is almost certainly the case that libguestfs callers should ignore what "
33502 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33506 #: ../src/guestfs.pod:679
33508 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
33509 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33510 "attribute, and read the raw reparse data from that (you can find the format "
33511 "documented in various places around the web)."
33515 #: ../src/guestfs.pod:684
33516 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33520 #: ../src/guestfs.pod:686
33522 "There are other useful extended attributes that can be read from ntfs-3g "
33523 "filesystems (using L</guestfs_getxattr>). See:"
33527 #: ../src/guestfs.pod:689
33529 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33533 #: ../src/guestfs.pod:691
33534 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33538 #: ../src/guestfs.pod:693
33540 "Although we don't want to discourage you from using the C API, we will "
33541 "mention here that the same API is also available in other languages."
33545 #: ../src/guestfs.pod:696
33547 "The API is broadly identical in all supported languages. This means that "
33548 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33549 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33550 "OCaml. In other words, a straightforward, predictable isomorphism between "
33555 #: ../src/guestfs.pod:702
33557 "Error messages are automatically transformed into exceptions if the language "
33562 #: ../src/guestfs.pod:705
33564 "We don't try to \"object orientify\" parts of the API in OO languages, "
33565 "although contributors are welcome to write higher level APIs above what we "
33566 "provide in their favourite languages if they wish."
33570 #: ../src/guestfs.pod:711
33575 #: ../src/guestfs.pod:713
33577 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33578 "identical to the C API. C++ classes and exceptions are not used."
33582 #: ../src/guestfs.pod:717
33587 #: ../src/guestfs.pod:719
33589 "The C# bindings are highly experimental. Please read the warnings at the "
33590 "top of C<csharp/Libguestfs.cs>."
33594 #: ../src/guestfs.pod:722
33599 #: ../src/guestfs.pod:724
33600 msgid "See L<guestfs-erlang(3)>."
33604 #: ../src/guestfs.pod:726
33609 #: ../src/guestfs.pod:728
33611 "This is the only language binding that is working but incomplete. Only "
33612 "calls which return simple integers have been bound in Haskell, and we are "
33613 "looking for help to complete this binding."
33617 #: ../src/guestfs.pod:732
33622 #: ../src/guestfs.pod:734
33624 "Full documentation is contained in the Javadoc which is distributed with "
33625 "libguestfs. For examples, see L<guestfs-java(3)>."
33629 #: ../src/guestfs.pod:737
33634 #: ../src/guestfs.pod:739
33635 msgid "See L<guestfs-ocaml(3)>."
33639 #: ../src/guestfs.pod:741
33644 #: ../src/guestfs.pod:743
33645 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33649 #: ../src/guestfs.pod:745
33654 #: ../src/guestfs.pod:747
33656 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33657 "the php-libguestfs package for your distribution."
33661 #: ../src/guestfs.pod:750
33662 msgid "The PHP binding only works correctly on 64 bit machines."
33666 #: ../src/guestfs.pod:752
33671 #: ../src/guestfs.pod:754
33672 msgid "See L<guestfs-python(3)>."
33676 #: ../src/guestfs.pod:756
33681 #: ../src/guestfs.pod:758
33682 msgid "See L<guestfs-ruby(3)>."
33686 #: ../src/guestfs.pod:760
33687 msgid "B<shell scripts>"
33691 #: ../src/guestfs.pod:762
33692 msgid "See L<guestfish(1)>."
33696 #: ../src/guestfs.pod:766
33697 msgid "LIBGUESTFS GOTCHAS"
33701 #: ../src/guestfs.pod:768
33703 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
33704 "system [...] that works in the way it is documented but is counterintuitive "
33705 "and almost invites mistakes.\""
33709 #: ../src/guestfs.pod:772
33711 "Since we developed libguestfs and the associated tools, there are several "
33712 "things we would have designed differently, but are now stuck with for "
33713 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
33714 "release, you can expect these to change. Beware of them."
33718 #: ../src/guestfs.pod:780
33719 msgid "Autosync / forgetting to sync."
33723 #: ../src/guestfs.pod:782
33725 "I<Update:> Autosync is enabled by default for all API users starting from "
33726 "libguestfs 1.5.24. This section only applies to older versions."
33730 #: ../src/guestfs.pod:785
33732 "When modifying a filesystem from C or another language, you B<must> unmount "
33733 "all filesystems and call L</guestfs_sync> explicitly before you close the "
33734 "libguestfs handle. You can also call:"
33738 #: ../src/guestfs.pod:789
33741 " guestfs_set_autosync (g, 1);\n"
33746 #: ../src/guestfs.pod:791
33748 "to have the unmount/sync done automatically for you when the handle 'g' is "
33749 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
33753 #: ../src/guestfs.pod:795
33755 "If you forget to do this, then it is entirely possible that your changes "
33756 "won't be written out, or will be partially written, or (very rarely) that "
33757 "you'll get disk corruption."
33761 #: ../src/guestfs.pod:799
33763 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
33764 "guestfish scripts that forget to sync will work just fine, which can make "
33765 "this very puzzling if you are trying to debug a problem."
33769 #: ../src/guestfs.pod:803
33770 msgid "Mount option C<-o sync> should not be the default."
33774 #: ../src/guestfs.pod:805
33776 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
33777 "libguestfs 1.13.16. This section only applies to older versions."
33781 #: ../src/guestfs.pod:808
33783 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
33784 "However C<-o sync> does not add any reliability benefit, but does have a "
33785 "very large performance impact."
33789 #: ../src/guestfs.pod:812
33791 "The work around is to use L</guestfs_mount_options> and set the mount "
33792 "options that you actually want to use."
33796 #: ../src/guestfs.pod:815
33797 msgid "Read-only should be the default."
33801 #: ../src/guestfs.pod:817
33803 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
33804 "specify I<--rw> if you want to make changes to the image."
33808 #: ../src/guestfs.pod:820
33809 msgid "This would reduce the potential to corrupt live VM images."
33813 #: ../src/guestfs.pod:822
33815 "Note that many filesystems change the disk when you just mount and unmount, "
33816 "even if you didn't perform any writes. You need to use L</"
33817 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
33821 #: ../src/guestfs.pod:826
33822 msgid "guestfish command line is hard to use."
33826 #: ../src/guestfs.pod:828
33828 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
33829 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
33830 "exist, so it fails. In earlier versions of guestfish the error message was "
33831 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
33832 "we should have used C<guestfish -c command> to run commands."
33836 #: ../src/guestfs.pod:835
33837 msgid "guestfish megabyte modifiers don't work right on all commands"
33841 #: ../src/guestfs.pod:837
33843 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
33844 "other modifiers). What guestfish actually does is to multiply the number "
33845 "part by the modifier part and pass the result to the C API. However this "
33846 "doesn't work for a few APIs which aren't expecting bytes, but are already "
33847 "expecting some other unit (eg. megabytes)."
33851 #: ../src/guestfs.pod:844
33852 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
33856 #: ../src/guestfs.pod:846
33859 " lvcreate LV VG 100M\n"
33864 #: ../src/guestfs.pod:848
33866 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
33867 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
33868 "megabytes * megabytes) logical volume. The error message you get from this "
33869 "is also a little obscure."
33873 #: ../src/guestfs.pod:853
33875 "This could be fixed in the generator by specially marking parameters and "
33876 "return values which take bytes or other units."
33880 #: ../src/guestfs.pod:856
33881 msgid "Ambiguity between devices and paths"
33885 #: ../src/guestfs.pod:858
33887 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
33888 "sdb2>) and a similar pathname. A file might just happen to be called "
33889 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
33893 #: ../src/guestfs.pod:863
33895 "In the current API we usually resolve this ambiguity by having two separate "
33896 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
33897 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
33898 "detecting if the path supplied begins with C</dev/>."
33902 #: ../src/guestfs.pod:869
33904 "To avoid both the ambiguity and the need to duplicate some calls, we could "
33905 "make paths/devices into structured names. One way to do this would be to "
33906 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
33907 "aspect of grub. Another way would be to use a structured type, equivalent "
33908 "to this OCaml type:"
33912 #: ../src/guestfs.pod:875
33915 " type path = Path of string | Device of int | Partition of int * int\n"
33920 #: ../src/guestfs.pod:877
33921 msgid "which would allow you to pass arguments like:"
33925 #: ../src/guestfs.pod:879
33928 " Path \"/foo/bar\"\n"
33929 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
33930 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
33931 " Path \"/dev/sdb2\" (* not a device *)\n"
33936 #: ../src/guestfs.pod:884
33938 "As you can see there are still problems to resolve even with this "
33939 "representation. Also consider how it might work in guestfish."
33943 #: ../src/guestfs.pod:889
33944 msgid "KEYS AND PASSPHRASES"
33948 #: ../src/guestfs.pod:891
33950 "Certain libguestfs calls take a parameter that contains sensitive key "
33951 "material, passed in as a C string."
33955 #: ../src/guestfs.pod:894
33957 "In the future we would hope to change the libguestfs implementation so that "
33958 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
33959 "swap. However this is I<not> done at the moment, because of the complexity "
33960 "of such an implementation."
33964 #: ../src/guestfs.pod:899
33966 "Therefore you should be aware that any key parameter you pass to libguestfs "
33967 "might end up being written out to the swap partition. If this is a concern, "
33968 "scrub the swap partition or don't use libguestfs on encrypted devices."
33972 #: ../src/guestfs.pod:904
33973 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
33977 #: ../src/guestfs.pod:906
33979 "All high-level libguestfs actions are synchronous. If you want to use "
33980 "libguestfs asynchronously then you must create a thread."
33984 #: ../src/guestfs.pod:909
33986 "Only use the handle from a single thread. Either use the handle exclusively "
33987 "from one thread, or provide your own mutex so that two threads cannot issue "
33988 "calls on the same handle at the same time."
33992 #: ../src/guestfs.pod:913
33994 "See the graphical program guestfs-browser for one possible architecture for "
33995 "multithreaded programs using libvirt and libguestfs."
33999 #: ../src/guestfs.pod:916
34004 #: ../src/guestfs.pod:918
34006 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34011 #: ../src/guestfs.pod:921
34013 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
34014 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34018 #: ../src/guestfs.pod:924
34020 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34021 "to change the directories that libguestfs will search in. The value is a "
34022 "colon-separated list of paths. The current directory is I<not> searched "
34023 "unless the path contains an empty element or C<.>. For example "
34024 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34025 "then C</usr/lib/guestfs>."
34029 #: ../src/guestfs.pod:931
34030 msgid "QEMU WRAPPERS"
34034 #: ../src/guestfs.pod:933
34036 "If you want to compile your own qemu, run qemu from a non-standard location, "
34037 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34042 #: ../src/guestfs.pod:937
34044 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34045 "last command in the shell script (so that qemu replaces the shell and "
34046 "becomes the direct child of the libguestfs-using program). If you don't do "
34047 "this, then the qemu process won't be cleaned up correctly."
34051 #: ../src/guestfs.pod:942
34053 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34058 #: ../src/guestfs.pod:945
34062 " qemudir=/home/rjones/d/qemu\n"
34063 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
34068 #: ../src/guestfs.pod:949
34070 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34071 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34076 #: ../src/guestfs.pod:953
34079 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34084 #: ../src/guestfs.pod:955
34086 "Note that libguestfs also calls qemu with the -help and -version options in "
34087 "order to determine features."
34091 #: ../src/guestfs.pod:958
34093 "Wrappers can also be used to edit the options passed to qemu. In the "
34094 "following example, the C<-machine ...> option (C<-machine> and the following "
34095 "argument) are removed from the command line and replaced with C<-machine pc,"
34096 "accel=tcg>. The while loop iterates over the options until it finds the "
34097 "right one to remove, putting the remaining options into the C<args> array."
34101 #: ../src/guestfs.pod:965
34109 #: ../src/guestfs.pod:967
34113 " while [ $# -gt 0 ]; do\n"
34114 " case \"$1\" in\n"
34118 " args[i]=\"$1\"\n"
34127 #: ../src/guestfs.pod:979
34130 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
34135 #: ../src/guestfs.pod:981
34136 msgid "ATTACHING TO RUNNING DAEMONS"
34140 #: ../src/guestfs.pod:983
34142 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
34143 "babies. Use with caution."
34147 #: ../src/guestfs.pod:986
34149 "I<Note (2):> This section explains how to attach to a running daemon from a "
34150 "low level perspective. For most users, simply using virt tools such as "
34151 "L<guestfish(1)> with the I<--live> option will \"just work\"."
34155 #: ../src/guestfs.pod:990
34156 msgid "Using guestfs_set_attach_method"
34160 #: ../src/guestfs.pod:992
34162 "By calling L</guestfs_set_attach_method> you can change how the library "
34163 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
34164 "ARCHITECTURE> for some background)."
34168 #: ../src/guestfs.pod:996
34170 "The normal attach method is C<appliance>, where a small appliance is created "
34171 "containing the daemon, and then the library connects to this."
34175 #: ../src/guestfs.pod:999
34177 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
34178 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
34179 "daemon over the Unix domain socket."
34183 #: ../src/guestfs.pod:1003
34185 "The normal use for this is to connect to a running virtual machine that "
34186 "contains a C<guestfsd> daemon, and send commands so you can read and write "
34187 "files inside the live virtual machine."
34191 #: ../src/guestfs.pod:1007
34192 msgid "Using guestfs_add_domain with live flag"
34196 #: ../src/guestfs.pod:1009
34198 "L</guestfs_add_domain> provides some help for getting the correct attach "
34199 "method. If you pass the C<live> option to this function, then (if the "
34200 "virtual machine is running) it will examine the libvirt XML looking for a "
34201 "virtio-serial channel to connect to:"
34205 #: ../src/guestfs.pod:1015
34212 " <channel type='unix'>\n"
34213 " <source mode='bind' path='/path/to/socket'/>\n"
34214 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
34223 #: ../src/guestfs.pod:1027
34225 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
34226 "method to C<unix:/path/to/socket>."
34230 #: ../src/guestfs.pod:1030
34232 "Some of the libguestfs tools (including guestfish) support a I<--live> "
34233 "option which is passed through to L</guestfs_add_domain> thus allowing you "
34234 "to attach to and modify live virtual machines."
34238 #: ../src/guestfs.pod:1034
34240 "The virtual machine needs to have been set up beforehand so that it has the "
34241 "virtio-serial channel and so that guestfsd is running inside it."
34245 #: ../src/guestfs.pod:1038
34246 msgid "ABI GUARANTEE"
34250 #: ../src/guestfs.pod:1040
34252 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
34253 "actions as outlined in this section. Although we will deprecate some "
34254 "actions, for example if they get replaced by newer calls, we will keep the "
34255 "old actions forever. This allows you the developer to program in confidence "
34256 "against the libguestfs API."
34260 #: ../src/guestfs.pod:1046
34261 msgid "BLOCK DEVICE NAMING"
34265 #: ../src/guestfs.pod:1048
34267 "In the kernel there is now quite a profusion of schemata for naming block "
34268 "devices (in this context, by I<block device> I mean a physical or virtual "
34269 "hard drive). The original Linux IDE driver used names starting with C</dev/"
34270 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
34271 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
34272 "for the old IDE driver (particularly for SATA devices) those devices also "
34273 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
34274 "paravirtualized drivers. This has created several different naming systems, "
34275 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
34279 #: ../src/guestfs.pod:1060
34281 "As discussed above, libguestfs uses a qemu appliance running an embedded "
34282 "Linux kernel to access block devices. We can run a variety of appliances "
34283 "based on a variety of Linux kernels."
34287 #: ../src/guestfs.pod:1064
34289 "This causes a problem for libguestfs because many API calls use device or "
34290 "partition names. Working scripts and the recipe (example) scripts that we "
34291 "make available over the internet could fail if the naming scheme changes."
34295 #: ../src/guestfs.pod:1069
34297 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
34298 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
34299 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
34300 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34304 #: ../src/guestfs.pod:1075
34306 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34307 "L</guestfs_list_partitions> and similar calls return the true names of the "
34308 "devices and partitions as known to the appliance."
34312 #: ../src/guestfs.pod:1080
34313 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34317 #: ../src/guestfs.pod:1082
34319 "Usually this translation is transparent. However in some (very rare) cases "
34320 "you may need to know the exact algorithm. Such cases include where you use "
34321 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
34322 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
34326 #: ../src/guestfs.pod:1088
34328 "The algorithm is applied only to I<parameters> which are known to be either "
34329 "device or partition names. Return values from functions such as L</"
34330 "guestfs_list_devices> are never changed."
34334 #: ../src/guestfs.pod:1096
34335 msgid "Is the string a parameter which is a device or partition name?"
34339 #: ../src/guestfs.pod:1100
34340 msgid "Does the string begin with C</dev/sd>?"
34344 #: ../src/guestfs.pod:1104
34346 "Does the named device exist? If so, we use that device. However if I<not> "
34347 "then we continue with this algorithm."
34351 #: ../src/guestfs.pod:1109
34352 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34356 #: ../src/guestfs.pod:1111
34357 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34361 #: ../src/guestfs.pod:1113
34362 msgid "If that named device exists, use it. If not, continue."
34366 #: ../src/guestfs.pod:1117
34367 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34371 #: ../src/guestfs.pod:1119
34372 msgid "If that named device exists, use it. If not, return an error."
34376 #: ../src/guestfs.pod:1123
34377 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34381 #: ../src/guestfs.pod:1125
34383 "Although the standard naming scheme and automatic translation is useful for "
34384 "simple programs and guestfish scripts, for larger programs it is best not to "
34385 "rely on this mechanism."
34389 #: ../src/guestfs.pod:1129
34391 "Where possible for maximum future portability programs using libguestfs "
34392 "should use these future-proof techniques:"
34396 #: ../src/guestfs.pod:1136
34398 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34399 "device names, and then use those names directly."
34403 #: ../src/guestfs.pod:1139
34405 "Since those device names exist by definition, they will never be translated."
34409 #: ../src/guestfs.pod:1144
34411 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34412 "filesystem labels."
34416 #: ../src/guestfs.pod:1149
34421 #: ../src/guestfs.pod:1151
34423 "This section discusses security implications of using libguestfs, "
34424 "particularly with untrusted or malicious guests or disk images."
34428 #: ../src/guestfs.pod:1154
34429 msgid "GENERAL SECURITY CONSIDERATIONS"
34433 #: ../src/guestfs.pod:1156
34435 "Be careful with any files or data that you download from a guest (by "
34436 "\"download\" we mean not just the L</guestfs_download> command but any "
34437 "command that reads files, filenames, directories or anything else from a "
34438 "disk image). An attacker could manipulate the data to fool your program "
34439 "into doing the wrong thing. Consider cases such as:"
34443 #: ../src/guestfs.pod:1166
34444 msgid "the data (file etc) not being present"
34448 #: ../src/guestfs.pod:1170
34449 msgid "being present but empty"
34453 #: ../src/guestfs.pod:1174
34454 msgid "being much larger than normal"
34458 #: ../src/guestfs.pod:1178
34459 msgid "containing arbitrary 8 bit data"
34463 #: ../src/guestfs.pod:1182
34464 msgid "being in an unexpected character encoding"
34468 #: ../src/guestfs.pod:1186
34469 msgid "containing homoglyphs."
34473 #: ../src/guestfs.pod:1190
34474 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34478 #: ../src/guestfs.pod:1192
34480 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34481 "(VFS) module can sometimes be escalated into exploits by deliberately "
34482 "creating a malicious, malformed filesystem. These exploits are very severe "
34483 "for two reasons. Firstly there are very many filesystem drivers in the "
34484 "kernel, and many of them are infrequently used and not much developer "
34485 "attention has been paid to the code. Linux userspace helps potential "
34486 "crackers by detecting the filesystem type and automatically choosing the "
34487 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34488 "the administrator. Secondly, a kernel-level exploit is like a local root "
34489 "exploit (worse in some ways), giving immediate and total access to the "
34490 "system right down to the hardware level."
34494 #: ../src/guestfs.pod:1205
34496 "That explains why you should never mount a filesystem from an untrusted "
34497 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34498 "inside a qemu virtual machine, usually running as a non-root user. The "
34499 "attacker would need to write a filesystem which first exploited the kernel, "
34500 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34501 "the libguestfs protocol, and finally to be as serious as the host kernel "
34502 "exploit it would need to escalate its privileges to root. This multi-step "
34503 "escalation, performed by a static piece of data, is thought to be extremely "
34504 "hard to do, although we never say 'never' about security issues."
34508 #: ../src/guestfs.pod:1216
34510 "In any case callers can reduce the attack surface by forcing the filesystem "
34511 "type when mounting (use L</guestfs_mount_vfs>)."
34515 #: ../src/guestfs.pod:1219
34516 msgid "PROTOCOL SECURITY"
34520 #: ../src/guestfs.pod:1221
34522 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34523 "defined upper message size. However a program that uses libguestfs must "
34524 "also take care - for example you can write a program that downloads a binary "
34525 "from a disk image and executes it locally, and no amount of protocol "
34526 "security will save you from the consequences."
34530 #: ../src/guestfs.pod:1227
34531 msgid "INSPECTION SECURITY"
34535 #: ../src/guestfs.pod:1229
34537 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34538 "directly from the guest, and these could contain any 8 bit data. Callers "
34539 "should be careful to escape these before printing them to a structured file "
34540 "(for example, use HTML escaping if creating a web page)."
34544 #: ../src/guestfs.pod:1235
34546 "Guest configuration may be altered in unusual ways by the administrator of "
34547 "the virtual machine, and may not reflect reality (particularly for untrusted "
34548 "or actively malicious guests). For example we parse the hostname from "
34549 "configuration files like C</etc/sysconfig/network> that we find in the "
34550 "guest, but the guest administrator can easily manipulate these files to "
34551 "provide the wrong hostname."
34555 #: ../src/guestfs.pod:1243
34557 "The inspection API parses guest configuration using two external libraries: "
34558 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34559 "designed to be robust in the face of malicious data, although denial of "
34560 "service attacks are still possible, for example with oversized configuration "
34565 #: ../src/guestfs.pod:1249
34566 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34570 #: ../src/guestfs.pod:1251
34572 "Be very cautious about running commands from the guest. By running a "
34573 "command in the guest, you are giving CPU time to a binary that you do not "
34574 "control, under the same user account as the library, albeit wrapped in qemu "
34575 "virtualization. More information and alternatives can be found in the "
34576 "section L</RUNNING COMMANDS>."
34580 #: ../src/guestfs.pod:1257
34581 msgid "CVE-2010-3851"
34585 #: ../src/guestfs.pod:1259
34586 msgid "https://bugzilla.redhat.com/642934"
34590 #: ../src/guestfs.pod:1261
34592 "This security bug concerns the automatic disk format detection that qemu "
34593 "does on disk images."
34597 #: ../src/guestfs.pod:1264
34599 "A raw disk image is just the raw bytes, there is no header. Other disk "
34600 "images like qcow2 contain a special header. Qemu deals with this by looking "
34601 "for one of the known headers, and if none is found then assuming the disk "
34602 "image must be raw."
34606 #: ../src/guestfs.pod:1269
34608 "This allows a guest which has been given a raw disk image to write some "
34609 "other header. At next boot (or when the disk image is accessed by "
34610 "libguestfs) qemu would do autodetection and think the disk image format was, "
34611 "say, qcow2 based on the header written by the guest."
34615 #: ../src/guestfs.pod:1274
34617 "This in itself would not be a problem, but qcow2 offers many features, one "
34618 "of which is to allow a disk image to refer to another image (called the "
34619 "\"backing disk\"). It does this by placing the path to the backing disk "
34620 "into the qcow2 header. This path is not validated and could point to any "
34621 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34622 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34623 "control of the attacker."
34627 #: ../src/guestfs.pod:1282
34629 "In libguestfs this is rather hard to exploit except under two circumstances:"
34633 #: ../src/guestfs.pod:1289
34634 msgid "You have enabled the network or have opened the disk in write mode."
34638 #: ../src/guestfs.pod:1293
34640 "You are also running untrusted code from the guest (see L</RUNNING "
34645 #: ../src/guestfs.pod:1298
34647 "The way to avoid this is to specify the expected disk format when adding "
34648 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34649 "should always do this if the disk is raw format, and it's a good idea for "
34654 #: ../src/guestfs.pod:1303
34656 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34657 "format is fetched from libvirt and passed through."
34661 #: ../src/guestfs.pod:1306
34663 "For libguestfs tools, use the I<--format> command line parameter as "
34668 #: ../src/guestfs.pod:1309
34669 msgid "CONNECTION MANAGEMENT"
34673 #: ../src/guestfs.pod:1311
34674 msgid "guestfs_h *"
34678 #: ../src/guestfs.pod:1313
34680 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34681 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34682 "handle and release all resources used."
34686 #: ../src/guestfs.pod:1317
34688 "For information on using multiple handles and threads, see the section L</"
34689 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34693 #: ../src/guestfs.pod:1320
34694 msgid "guestfs_create"
34698 #: ../src/guestfs.pod:1322
34701 " guestfs_h *guestfs_create (void);\n"
34706 #: ../src/guestfs.pod:1324
34707 msgid "Create a connection handle."
34711 #: ../src/guestfs.pod:1326
34713 "On success this returns a non-NULL pointer to a handle. On error it returns "
34718 #: ../src/guestfs.pod:1329
34720 "You have to \"configure\" the handle after creating it. This includes "
34721 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
34722 "handle at least once."
34726 #: ../src/guestfs.pod:1333
34727 msgid "After configuring the handle, you have to call L</guestfs_launch>."
34731 #: ../src/guestfs.pod:1335
34733 "You may also want to configure error handling for the handle. See the L</"
34734 "ERROR HANDLING> section below."
34738 #: ../src/guestfs.pod:1338
34739 msgid "guestfs_close"
34743 #: ../src/guestfs.pod:1340
34746 " void guestfs_close (guestfs_h *g);\n"
34751 #: ../src/guestfs.pod:1342
34752 msgid "This closes the connection handle and frees up all resources used."
34756 #: ../src/guestfs.pod:1344
34758 "If autosync was set on the handle and the handle was launched, then this "
34759 "implicitly calls various functions to unmount filesystems and sync the "
34760 "disk. See L</guestfs_set_autosync> for more details."
34764 #: ../src/guestfs.pod:1348
34765 msgid "If a close callback was set on the handle, then it is called."
34769 #: ../src/guestfs.pod:1350
34770 msgid "ERROR HANDLING"
34774 #: ../src/guestfs.pod:1352
34776 "API functions can return errors. For example, almost all functions that "
34777 "return C<int> will return C<-1> to indicate an error."
34781 #: ../src/guestfs.pod:1355
34783 "Additional information is available for errors: an error message string and "
34784 "optionally an error number (errno) if the thing that failed was a system "
34789 #: ../src/guestfs.pod:1359
34791 "You can get at the additional information about the last error on the handle "
34792 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
34793 "up an error handler with L</guestfs_set_error_handler>."
34797 #: ../src/guestfs.pod:1364
34799 "When the handle is created, a default error handler is installed which "
34800 "prints the error message string to C<stderr>. For small short-running "
34801 "command line programs it is sufficient to do:"
34805 #: ../src/guestfs.pod:1368
34808 " if (guestfs_launch (g) == -1)\n"
34809 " exit (EXIT_FAILURE);\n"
34814 #: ../src/guestfs.pod:1371
34816 "since the default error handler will ensure that an error message has been "
34817 "printed to C<stderr> before the program exits."
34821 #: ../src/guestfs.pod:1374
34823 "For other programs the caller will almost certainly want to install an "
34824 "alternate error handler or do error handling in-line like this:"
34828 #: ../src/guestfs.pod:1377
34831 " /* This disables the default behaviour of printing errors\n"
34833 " guestfs_set_error_handler (g, NULL, NULL);\n"
34838 #: ../src/guestfs.pod:1381
34841 " if (guestfs_launch (g) == -1) {\n"
34842 " /* Examine the error message and print it etc. */\n"
34843 " char *msg = guestfs_last_error (g);\n"
34844 " int errnum = guestfs_last_errno (g);\n"
34845 " fprintf (stderr, \"%s\", msg);\n"
34846 " if (errnum != 0)\n"
34847 " fprintf (stderr, \": %s\", strerror (errnum));\n"
34848 " fprintf (stderr, \"\\n\");\n"
34855 #: ../src/guestfs.pod:1392
34857 "Out of memory errors are handled differently. The default action is to call "
34858 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
34859 "guestfs_set_out_of_memory_handler>."
34863 #: ../src/guestfs.pod:1396
34865 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
34866 "because there is no handle if this happens there is no way to get additional "
34867 "error information. However L</guestfs_create> is supposed to be a "
34868 "lightweight operation which can only fail because of insufficient memory (it "
34869 "returns NULL in this case)."
34873 #: ../src/guestfs.pod:1402
34874 msgid "guestfs_last_error"
34878 #: ../src/guestfs.pod:1404
34881 " const char *guestfs_last_error (guestfs_h *g);\n"
34886 #: ../src/guestfs.pod:1406
34888 "This returns the last error message that happened on C<g>. If there has not "
34889 "been an error since the handle was created, then this returns C<NULL>."
34893 #: ../src/guestfs.pod:1410
34895 "The lifetime of the returned string is until the next error occurs, or L</"
34896 "guestfs_close> is called."
34900 #: ../src/guestfs.pod:1413
34901 msgid "guestfs_last_errno"
34905 #: ../src/guestfs.pod:1415
34908 " int guestfs_last_errno (guestfs_h *g);\n"
34913 #: ../src/guestfs.pod:1417
34914 msgid "This returns the last error number (errno) that happened on C<g>."
34918 #: ../src/guestfs.pod:1419
34919 msgid "If successful, an errno integer not equal to zero is returned."
34923 #: ../src/guestfs.pod:1421
34925 "If no error, this returns 0. This call can return 0 in three situations:"
34929 #: ../src/guestfs.pod:1428
34930 msgid "There has not been any error on the handle."
34934 #: ../src/guestfs.pod:1432
34936 "There has been an error but the errno was meaningless. This corresponds to "
34937 "the case where the error did not come from a failed system call, but for "
34938 "some other reason."
34942 #: ../src/guestfs.pod:1438
34944 "There was an error from a failed system call, but for some reason the errno "
34945 "was not captured and returned. This usually indicates a bug in libguestfs."
34949 #: ../src/guestfs.pod:1444
34951 "Libguestfs tries to convert the errno from inside the applicance into a "
34952 "corresponding errno for the caller (not entirely trivial: the appliance "
34953 "might be running a completely different operating system from the library "
34954 "and error numbers are not standardized across Un*xen). If this could not be "
34955 "done, then the error is translated to C<EINVAL>. In practice this should "
34956 "only happen in very rare circumstances."
34960 #: ../src/guestfs.pod:1452
34961 msgid "guestfs_set_error_handler"
34965 #: ../src/guestfs.pod:1454
34968 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
34970 " const char *msg);\n"
34971 " void guestfs_set_error_handler (guestfs_h *g,\n"
34972 " guestfs_error_handler_cb cb,\n"
34973 " void *opaque);\n"
34978 #: ../src/guestfs.pod:1461
34980 "The callback C<cb> will be called if there is an error. The parameters "
34981 "passed to the callback are an opaque data pointer and the error message "
34986 #: ../src/guestfs.pod:1465
34988 "C<errno> is not passed to the callback. To get that the callback must call "
34989 "L</guestfs_last_errno>."
34993 #: ../src/guestfs.pod:1468
34995 "Note that the message string C<msg> is freed as soon as the callback "
34996 "function returns, so if you want to stash it somewhere you must make your "
35001 #: ../src/guestfs.pod:1472
35002 msgid "The default handler prints messages on C<stderr>."
35006 #: ../src/guestfs.pod:1474
35007 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35011 #: ../src/guestfs.pod:1476
35012 msgid "guestfs_get_error_handler"
35016 #: ../src/guestfs.pod:1478
35019 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35020 " void **opaque_rtn);\n"
35025 #: ../src/guestfs.pod:1481
35026 msgid "Returns the current error handler callback."
35030 #: ../src/guestfs.pod:1483
35031 msgid "guestfs_set_out_of_memory_handler"
35035 #: ../src/guestfs.pod:1485
35038 " typedef void (*guestfs_abort_cb) (void);\n"
35039 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35040 " guestfs_abort_cb);\n"
35045 #: ../src/guestfs.pod:1489
35047 "The callback C<cb> will be called if there is an out of memory situation. "
35048 "I<Note this callback must not return>."
35052 #: ../src/guestfs.pod:1492
35053 msgid "The default is to call L<abort(3)>."
35057 #: ../src/guestfs.pod:1494
35059 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35063 #: ../src/guestfs.pod:1497
35064 msgid "guestfs_get_out_of_memory_handler"
35068 #: ../src/guestfs.pod:1499
35071 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35076 #: ../src/guestfs.pod:1501
35077 msgid "This returns the current out of memory handler."
35081 #: ../src/guestfs.pod:1503
35086 #: ../src/guestfs.pod:1507
35091 #: ../src/guestfs.pod:1509
35096 #: ../src/guestfs.pod:1511
35097 msgid "AVAILABILITY"
35101 #: ../src/guestfs.pod:1513
35102 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35106 #: ../src/guestfs.pod:1515
35108 "Using L</guestfs_available> you can test availability of the following "
35109 "groups of functions. This test queries the appliance to see if the "
35110 "appliance you are currently using supports the functionality."
35114 #: ../src/guestfs.pod:1520
35115 msgid "@AVAILABILITY@"
35119 #: ../src/guestfs.pod:1522
35120 msgid "GUESTFISH supported COMMAND"
35124 #: ../src/guestfs.pod:1524
35126 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
35127 "prints out the available groups and whether they are supported by this build "
35128 "of libguestfs. Note however that you have to do C<run> first."
35132 #: ../src/guestfs.pod:1529
35133 msgid "SINGLE CALLS AT COMPILE TIME"
35137 #: ../src/guestfs.pod:1531
35139 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
35140 "function, such as:"
35144 #: ../src/guestfs.pod:1534
35147 " #define LIBGUESTFS_HAVE_DD 1\n"
35152 #: ../src/guestfs.pod:1536
35153 msgid "if L</guestfs_dd> is available."
35157 #: ../src/guestfs.pod:1538
35159 "Before version 1.5.8, if you needed to test whether a single libguestfs "
35160 "function is available at compile time, we recommended using build tools such "
35161 "as autoconf or cmake. For example in autotools you could use:"
35165 #: ../src/guestfs.pod:1543
35168 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
35169 " AC_CHECK_FUNCS([guestfs_dd])\n"
35174 #: ../src/guestfs.pod:1546
35176 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
35181 #: ../src/guestfs.pod:1549
35182 msgid "SINGLE CALLS AT RUN TIME"
35186 #: ../src/guestfs.pod:1551
35188 "Testing at compile time doesn't guarantee that a function really exists in "
35189 "the library. The reason is that you might be dynamically linked against a "
35190 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
35191 "This situation unfortunately results in a segmentation fault, which is a "
35192 "shortcoming of the C dynamic linking system itself."
35196 #: ../src/guestfs.pod:1558
35198 "You can use L<dlopen(3)> to test if a function is available at run time, as "
35199 "in this example program (note that you still need the compile time check as "
35204 #: ../src/guestfs.pod:1562
35207 " #include <stdio.h>\n"
35208 " #include <stdlib.h>\n"
35209 " #include <unistd.h>\n"
35210 " #include <dlfcn.h>\n"
35211 " #include <guestfs.h>\n"
35216 #: ../src/guestfs.pod:1568
35221 " #ifdef LIBGUESTFS_HAVE_DD\n"
35223 " int has_function;\n"
35228 #: ../src/guestfs.pod:1574
35231 " /* Test if the function guestfs_dd is really available. */\n"
35232 " dl = dlopen (NULL, RTLD_LAZY);\n"
35234 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
35235 " exit (EXIT_FAILURE);\n"
35237 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
35243 #: ../src/guestfs.pod:1583
35246 " if (!has_function)\n"
35247 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
35249 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
35250 " /* Now it's safe to call\n"
35251 " guestfs_dd (g, \"foo\", \"bar\");\n"
35255 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
35262 #: ../src/guestfs.pod:1596
35264 "You may think the above is an awful lot of hassle, and it is. There are "
35265 "other ways outside of the C linking system to ensure that this kind of "
35266 "incompatibility never arises, such as using package versioning:"
35270 #: ../src/guestfs.pod:1601
35273 " Requires: libguestfs >= 1.0.80\n"
35278 #: ../src/guestfs.pod:1603
35279 msgid "CALLS WITH OPTIONAL ARGUMENTS"
35283 #: ../src/guestfs.pod:1605
35285 "A recent feature of the API is the introduction of calls which take optional "
35286 "arguments. In C these are declared 3 ways. The main way is as a call which "
35287 "takes variable arguments (ie. C<...>), as in this example:"
35291 #: ../src/guestfs.pod:1610
35294 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
35299 #: ../src/guestfs.pod:1612
35301 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35302 "call with no optional arguments specified:"
35306 #: ../src/guestfs.pod:1615
35309 " guestfs_add_drive_opts (g, filename, -1);\n"
35314 #: ../src/guestfs.pod:1617
35315 msgid "With a single optional argument:"
35319 #: ../src/guestfs.pod:1619
35322 " guestfs_add_drive_opts (g, filename,\n"
35323 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35329 #: ../src/guestfs.pod:1623
35334 #: ../src/guestfs.pod:1625
35337 " guestfs_add_drive_opts (g, filename,\n"
35338 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35339 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35345 #: ../src/guestfs.pod:1630
35347 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35352 #: ../src/guestfs.pod:1633
35353 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35357 #: ../src/guestfs.pod:1635
35359 "The second variant has the same name with the suffix C<_va>, which works the "
35360 "same way but takes a C<va_list>. See the C manual for details. For the "
35361 "example function, this is declared:"
35365 #: ../src/guestfs.pod:1639
35368 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35369 " va_list args);\n"
35374 #: ../src/guestfs.pod:1642
35375 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35379 #: ../src/guestfs.pod:1644
35381 "The third variant is useful where you need to construct these calls. You "
35382 "pass in a structure where you fill in the optional fields. The structure "
35383 "has a bitmask as the first element which you must set to indicate which "
35384 "fields you have filled in. For our example function the structure and call "
35389 #: ../src/guestfs.pod:1650
35392 " struct guestfs_add_drive_opts_argv {\n"
35393 " uint64_t bitmask;\n"
35395 " const char *format;\n"
35398 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35399 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35404 #: ../src/guestfs.pod:1659
35405 msgid "You could call it like this:"
35409 #: ../src/guestfs.pod:1661
35412 " struct guestfs_add_drive_opts_argv optargs = {\n"
35413 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35414 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35415 " .readonly = 1,\n"
35416 " .format = \"qcow2\"\n"
35422 #: ../src/guestfs.pod:1668
35425 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35430 #: ../src/guestfs.pod:1676
35431 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35435 #: ../src/guestfs.pod:1681
35436 msgid "You do not need to fill in all fields of the structure."
35440 #: ../src/guestfs.pod:1685
35442 "There must be a one-to-one correspondence between fields of the structure "
35443 "that are filled in, and bits set in the bitmask."
35447 #: ../src/guestfs.pod:1690
35448 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35452 #: ../src/guestfs.pod:1692
35454 "In other languages, optional arguments are expressed in the way that is "
35455 "natural for that language. We refer you to the language-specific "
35456 "documentation for more details on that."
35460 #: ../src/guestfs.pod:1696
35461 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35465 #: ../src/guestfs.pod:1698
35466 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35470 #: ../src/guestfs.pod:1700
35472 "B<Note:> This section documents the generic event mechanism introduced in "
35473 "libguestfs 1.10, which you should use in new code if possible. The old "
35474 "functions C<guestfs_set_log_message_callback>, "
35475 "C<guestfs_set_subprocess_quit_callback>, "
35476 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35477 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35478 "page. Because of the ABI guarantee, the old functions continue to work."
35482 #: ../src/guestfs.pod:1709
35484 "Handles generate events when certain things happen, such as log messages "
35485 "being generated, progress messages during long-running operations, or the "
35486 "handle being closed. The API calls described below let you register a "
35487 "callback to be called when events happen. You can register multiple "
35488 "callbacks (for the same, different or overlapping sets of events), and "
35489 "individually remove callbacks. If callbacks are not removed, then they "
35490 "remain in force until the handle is closed."
35494 #: ../src/guestfs.pod:1717
35496 "In the current implementation, events are only generated synchronously: that "
35497 "means that events (and hence callbacks) can only happen while you are in the "
35498 "middle of making another libguestfs call. The callback is called in the "
35503 #: ../src/guestfs.pod:1722
35505 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35506 "unsigned integers, or a message buffer. Payloads are discussed later on."
35510 #: ../src/guestfs.pod:1726
35511 msgid "CLASSES OF EVENTS"
35515 #: ../src/guestfs.pod:1730
35516 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35520 #: ../src/guestfs.pod:1733
35522 "The callback function will be called while the handle is being closed "
35523 "(synchronously from L</guestfs_close>)."
35527 #: ../src/guestfs.pod:1736
35529 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35530 "handles that are open when the program exits. This means that this callback "
35531 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35532 "problems in higher-level languages (eg. if your HLL interpreter has already "
35533 "been cleaned up by the time this is called, and if your callback then jumps "
35534 "into some HLL function)."
35538 #: ../src/guestfs.pod:1743
35540 "If no callback is registered: the handle is closed without any callback "
35545 #: ../src/guestfs.pod:1746
35546 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35550 #: ../src/guestfs.pod:1749
35552 "The callback function will be called when the child process quits, either "
35553 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35554 "corresponds to a transition from any state to the CONFIG state)."
35558 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35559 msgid "If no callback is registered: the event is ignored."
35563 #: ../src/guestfs.pod:1755
35564 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35568 #: ../src/guestfs.pod:1758
35570 "The callback function will be called when the child process becomes ready "
35571 "first time after it has been launched. (This corresponds to a transition "
35572 "from LAUNCHING to the READY state)."
35576 #: ../src/guestfs.pod:1764
35577 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35581 #: ../src/guestfs.pod:1767
35583 "Some long-running operations can generate progress messages. If this "
35584 "callback is registered, then it will be called each time a progress message "
35585 "is generated (usually two seconds after the operation started, and three "
35586 "times per second thereafter until it completes, although the frequency may "
35587 "change in future versions)."
35591 #: ../src/guestfs.pod:1773
35593 "The callback receives in the payload four unsigned 64 bit numbers which are "
35594 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35598 #: ../src/guestfs.pod:1776
35600 "The units of C<total> are not defined, although for some operations C<total> "
35601 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35602 "or megabytes), and C<position> may be the portion which has been transferred."
35606 #: ../src/guestfs.pod:1781
35607 msgid "The only defined and stable parts of the API are:"
35611 #: ../src/guestfs.pod:1787
35613 "The callback can display to the user some type of progress bar or indicator "
35614 "which shows the ratio of C<position>:C<total>."
35618 #: ../src/guestfs.pod:1792
35619 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35623 #: ../src/guestfs.pod:1796
35625 "If any progress notification is sent during a call, then a final progress "
35626 "notification is always sent when C<position> = C<total> (I<unless> the call "
35627 "fails with an error)."
35631 #: ../src/guestfs.pod:1800
35633 "This is to simplify caller code, so callers can easily set the progress "
35634 "indicator to \"100%\" at the end of the operation, without requiring special "
35635 "code to detect this case."
35639 #: ../src/guestfs.pod:1806
35641 "For some calls we are unable to estimate the progress of the call, but we "
35642 "can still generate progress messages to indicate activity. This is known as "
35643 "\"pulse mode\", and is directly supported by certain progress bar "
35644 "implementations (eg. GtkProgressBar)."
35648 #: ../src/guestfs.pod:1811
35650 "For these calls, zero or more progress messages are generated with "
35651 "C<position = 0> and C<total = 1>, followed by a final message with "
35652 "C<position = total = 1>."
35656 #: ../src/guestfs.pod:1815
35658 "As noted above, if the call fails with an error then the final message may "
35659 "not be generated."
35663 #: ../src/guestfs.pod:1820
35665 "The callback also receives the procedure number (C<proc_nr>) and serial "
35666 "number (C<serial>) of the call. These are only useful for debugging "
35667 "protocol issues, and the callback can normally ignore them. The callback "
35668 "may want to print these numbers in error messages or debugging messages."
35672 #: ../src/guestfs.pod:1826
35673 msgid "If no callback is registered: progress messages are discarded."
35677 #: ../src/guestfs.pod:1828
35678 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35682 #: ../src/guestfs.pod:1831
35684 "The callback function is called whenever a log message is generated by qemu, "
35685 "the appliance kernel, guestfsd (daemon), or utility programs."
35689 #: ../src/guestfs.pod:1834
35691 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
35692 "guestfs_launch>) then additional debug messages are generated."
35696 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35698 "If no callback is registered: the messages are discarded unless the verbose "
35699 "flag is set in which case they are sent to stderr. You can override the "
35700 "printing of verbose messages to stderr by setting up a callback."
35704 #: ../src/guestfs.pod:1842
35705 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
35709 #: ../src/guestfs.pod:1845
35711 "The callback function is called whenever a log message is generated by the "
35712 "library part of libguestfs."
35716 #: ../src/guestfs.pod:1848
35718 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
35719 "messages are generated."
35723 #: ../src/guestfs.pod:1856
35724 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
35728 #: ../src/guestfs.pod:1859
35730 "The callback function is called whenever a trace message is generated. This "
35731 "only applies if the trace flag (L</guestfs_set_trace>) is set."
35735 #: ../src/guestfs.pod:1862
35737 "If no callback is registered: the messages are sent to stderr. You can "
35738 "override the printing of trace messages to stderr by setting up a callback."
35742 #: ../src/guestfs.pod:1866
35743 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
35747 #: ../src/guestfs.pod:1869
35749 "The callback function is called whenever a libguestfs function is entered."
35753 #: ../src/guestfs.pod:1872
35755 "The payload is a string which contains the name of the function that we are "
35756 "entering (not including C<guestfs_> prefix)."
35760 #: ../src/guestfs.pod:1875
35762 "Note that libguestfs functions can call themselves, so you may see many "
35763 "events from a single call. A few libguestfs functions do not generate this "
35768 #: ../src/guestfs.pod:1883
35769 msgid "guestfs_set_event_callback"
35773 #: ../src/guestfs.pod:1885
35776 " int guestfs_set_event_callback (guestfs_h *g,\n"
35777 " guestfs_event_callback cb,\n"
35778 " uint64_t event_bitmask,\n"
35780 " void *opaque);\n"
35785 #: ../src/guestfs.pod:1891
35787 "This function registers a callback (C<cb>) for all event classes in the "
35788 "C<event_bitmask>."
35792 #: ../src/guestfs.pod:1894
35794 "For example, to register for all log message events, you could call this "
35795 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
35796 "To register a single callback for all possible classes of events, use "
35797 "C<GUESTFS_EVENT_ALL>."
35801 #: ../src/guestfs.pod:1900
35802 msgid "C<flags> should always be passed as 0."
35806 #: ../src/guestfs.pod:1902
35808 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
35809 "it for any purpose."
35813 #: ../src/guestfs.pod:1905
35815 "The return value is the event handle (an integer) which you can use to "
35816 "delete the callback (see below)."
35820 #: ../src/guestfs.pod:1908
35822 "If there is an error, this function returns C<-1>, and sets the error in the "
35823 "handle in the usual way (see L</guestfs_last_error> etc.)"
35827 #: ../src/guestfs.pod:1911
35829 "Callbacks remain in effect until they are deleted, or until the handle is "
35834 #: ../src/guestfs.pod:1914
35836 "In the case where multiple callbacks are registered for a particular event "
35837 "class, all of the callbacks are called. The order in which multiple "
35838 "callbacks are called is not defined."
35842 #: ../src/guestfs.pod:1918
35843 msgid "guestfs_delete_event_callback"
35847 #: ../src/guestfs.pod:1920
35850 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
35855 #: ../src/guestfs.pod:1922
35857 "Delete a callback that was previously registered. C<event_handle> should be "
35858 "the integer that was returned by a previous call to "
35859 "C<guestfs_set_event_callback> on the same handle."
35863 #: ../src/guestfs.pod:1926
35864 msgid "guestfs_event_callback"
35868 #: ../src/guestfs.pod:1928
35871 " typedef void (*guestfs_event_callback) (\n"
35874 " uint64_t event,\n"
35875 " int event_handle,\n"
35877 " const char *buf, size_t buf_len,\n"
35878 " const uint64_t *array, size_t array_len);\n"
35883 #: ../src/guestfs.pod:1937
35885 "This is the type of the event callback function that you have to provide."
35889 #: ../src/guestfs.pod:1940
35891 "The basic parameters are: the handle (C<g>), the opaque user pointer "
35892 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
35893 "handle, and C<flags> which in the current API you should ignore."
35897 #: ../src/guestfs.pod:1944
35899 "The remaining parameters contain the event payload (if any). Each event may "
35900 "contain a payload, which usually relates to the event class, but for future "
35901 "proofing your code should be written to handle any payload for any event "
35906 #: ../src/guestfs.pod:1949
35908 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
35909 "there is no message buffer). Note that this message buffer can contain "
35910 "arbitrary 8 bit data, including NUL bytes."
35914 #: ../src/guestfs.pod:1953
35916 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
35917 "moment this is only used for progress messages."
35921 #: ../src/guestfs.pod:1956
35922 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
35926 #: ../src/guestfs.pod:1958
35928 "One motivation for the generic event API was to allow GUI programs to "
35929 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
35930 "unconditionally to C<stderr>."
35934 #: ../src/guestfs.pod:1962
35936 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
35937 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
35938 "messages are not events; you must capture error messages separately)."
35942 #: ../src/guestfs.pod:1967
35944 "Programs have to set up a callback to capture the classes of events of "
35949 #: ../src/guestfs.pod:1970
35953 " guestfs_set_event_callback\n"
35954 " (g, message_callback,\n"
35955 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
35956 " GUESTFS_EVENT_TRACE,\n"
35957 " 0, NULL) == -1)\n"
35958 " if (eh == -1) {\n"
35959 " // handle error in the usual way\n"
35965 #: ../src/guestfs.pod:1980
35967 "The callback can then direct messages to the appropriate place. In this "
35968 "example, messages are directed to syslog:"
35972 #: ../src/guestfs.pod:1983
35976 " message_callback (\n"
35979 " uint64_t event,\n"
35980 " int event_handle,\n"
35982 " const char *buf, size_t buf_len,\n"
35983 " const uint64_t *array, size_t array_len)\n"
35985 " const int priority = LOG_USER|LOG_INFO;\n"
35986 " if (buf_len > 0)\n"
35987 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
35993 #: ../src/guestfs.pod:1998
35994 msgid "CANCELLING LONG TRANSFERS"
35998 #: ../src/guestfs.pod:2000
36000 "Some operations can be cancelled by the caller while they are in progress. "
36001 "Currently only operations that involve uploading or downloading data can be "
36002 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36003 "parameters in the generator)."
36007 #: ../src/guestfs.pod:2005
36008 msgid "guestfs_user_cancel"
36012 #: ../src/guestfs.pod:2007
36015 " void guestfs_user_cancel (guestfs_h *g);\n"
36020 #: ../src/guestfs.pod:2009
36022 "C<guestfs_user_cancel> cancels the current upload or download operation."
36026 #: ../src/guestfs.pod:2012
36028 "Unlike most other libguestfs calls, this function is signal safe and thread "
36029 "safe. You can call it from a signal handler or from another thread, without "
36030 "needing to do any locking."
36034 #: ../src/guestfs.pod:2016
36036 "The transfer that was in progress (if there is one) will stop shortly "
36037 "afterwards, and will return an error. The errno (see L</"
36038 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36039 "out if the operation was cancelled or failed because of another error."
36043 #: ../src/guestfs.pod:2022
36045 "No cleanup is performed: for example, if a file was being uploaded then "
36046 "after cancellation there may be a partially uploaded file. It is the "
36047 "caller's responsibility to clean up if necessary."
36051 #: ../src/guestfs.pod:2026
36052 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36056 #: ../src/guestfs.pod:2028
36058 "In an interactive text-based program, you might call it from a C<SIGINT> "
36059 "signal handler so that pressing C<^C> cancels the current operation. (You "
36060 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36061 "receive the C<^C> signal)."
36065 #: ../src/guestfs.pod:2033
36067 "In a graphical program, when the main thread is displaying a progress bar "
36068 "with a cancel button, wire up the cancel button to call this function."
36072 #: ../src/guestfs.pod:2037
36073 msgid "PRIVATE DATA AREA"
36077 #: ../src/guestfs.pod:2039
36079 "You can attach named pieces of private data to the libguestfs handle, fetch "
36080 "them by name, and walk over them, for the lifetime of the handle. This is "
36081 "called the private data area and is only available from the C API."
36085 #: ../src/guestfs.pod:2044
36086 msgid "To attach a named piece of data, use the following call:"
36090 #: ../src/guestfs.pod:2046
36093 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36098 #: ../src/guestfs.pod:2048
36100 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36101 "pointer (which can be C<NULL>). Any previous item with the same key is "
36106 #: ../src/guestfs.pod:2052
36108 "You can use any C<key> you want, but your key should I<not> start with an "
36109 "underscore character. Keys beginning with an underscore character are "
36110 "reserved for internal libguestfs purposes (eg. for implementing language "
36111 "bindings). It is recommended that you prefix the key with some unique "
36112 "string to avoid collisions with other users."
36116 #: ../src/guestfs.pod:2058
36117 msgid "To retrieve the pointer, use:"
36121 #: ../src/guestfs.pod:2060
36124 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
36129 #: ../src/guestfs.pod:2062
36131 "This function returns C<NULL> if either no data is found associated with "
36132 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
36137 #: ../src/guestfs.pod:2066
36139 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
36140 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
36141 "all. In particular, libguestfs does I<not> try to free the data when the "
36142 "handle is closed. If the data must be freed, then the caller must either "
36143 "free it before calling L</guestfs_close> or must set up a close callback to "
36144 "do it (see L</GUESTFS_EVENT_CLOSE>)."
36148 #: ../src/guestfs.pod:2073
36149 msgid "To walk over all entries, use these two functions:"
36153 #: ../src/guestfs.pod:2075
36156 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
36161 #: ../src/guestfs.pod:2077
36164 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
36169 #: ../src/guestfs.pod:2079
36171 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
36172 "not have any particular meaning -- keys are not returned in any defined "
36173 "order). A pointer to the key is returned in C<*key_rtn> and the "
36174 "corresponding data pointer is returned from the function. C<NULL> is "
36175 "returned if there are no keys stored in the handle."
36179 #: ../src/guestfs.pod:2085
36181 "C<guestfs_next_private> returns the next key, pointer pair. The return "
36182 "value of this function is also C<NULL> is there are no further entries to "
36187 #: ../src/guestfs.pod:2089
36188 msgid "Notes about walking over entries:"
36192 #: ../src/guestfs.pod:2095
36194 "You must not call C<guestfs_set_private> while walking over the entries."
36198 #: ../src/guestfs.pod:2100
36200 "The handle maintains an internal iterator which is reset when you call "
36201 "C<guestfs_first_private>. This internal iterator is invalidated when you "
36202 "call C<guestfs_set_private>."
36206 #: ../src/guestfs.pod:2106
36207 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
36211 #: ../src/guestfs.pod:2108
36214 " guestfs_set_private (g, key, NULL);\n"
36219 #: ../src/guestfs.pod:2110
36220 msgid "then that C<key> is not returned when walking."
36224 #: ../src/guestfs.pod:2114
36226 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
36227 "C<guestfs_next_private> or C<guestfs_set_private>."
36231 #: ../src/guestfs.pod:2120
36233 "The following example code shows how to print all keys and data pointers "
36234 "that are associated with the handle C<g>:"
36238 #: ../src/guestfs.pod:2123
36241 " const char *key;\n"
36242 " void *data = guestfs_first_private (g, &key);\n"
36243 " while (data != NULL)\n"
36245 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36246 " data = guestfs_next_private (g, &key);\n"
36252 #: ../src/guestfs.pod:2131
36254 "More commonly you are only interested in keys that begin with an application-"
36255 "specific prefix C<foo_>. Modify the loop like so:"
36259 #: ../src/guestfs.pod:2134
36262 " const char *key;\n"
36263 " void *data = guestfs_first_private (g, &key);\n"
36264 " while (data != NULL)\n"
36266 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36267 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36268 " data = guestfs_next_private (g, &key);\n"
36274 #: ../src/guestfs.pod:2143
36276 "If you need to modify keys while walking, then you have to jump back to the "
36277 "beginning of the loop. For example, to delete all keys prefixed with "
36282 #: ../src/guestfs.pod:2147
36285 " const char *key;\n"
36288 " data = guestfs_first_private (g, &key);\n"
36289 " while (data != NULL)\n"
36291 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36293 " guestfs_set_private (g, key, NULL);\n"
36294 " /* note that 'key' pointer is now invalid, and so is\n"
36295 " the internal iterator */\n"
36298 " data = guestfs_next_private (g, &key);\n"
36304 #: ../src/guestfs.pod:2163
36306 "Note that the above loop is guaranteed to terminate because the keys are "
36307 "being deleted, but other manipulations of keys within the loop might not "
36308 "terminate unless you also maintain an indication of which keys have been "
36313 #: ../src/guestfs.pod:2168 ../src/guestfs.pod:2173
36318 #: ../src/guestfs.pod:2170
36320 "<!-- old anchor for the next section --> <a name="
36321 "\"state_machine_and_low_level_event_api\"/>"
36325 #: ../src/guestfs.pod:2175
36326 msgid "ARCHITECTURE"
36330 #: ../src/guestfs.pod:2177
36332 "Internally, libguestfs is implemented by running an appliance (a special "
36333 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36334 "process of the main program."
36338 #: ../src/guestfs.pod:2181
36341 " ___________________\n"
36343 " | main program |\n"
36345 " | | child process / appliance\n"
36346 " | | __________________________\n"
36348 " +-------------------+ RPC | +-----------------+ |\n"
36349 " | libguestfs <--------------------> guestfsd | |\n"
36350 " | | | +-----------------+ |\n"
36351 " \\___________________/ | | Linux kernel | |\n"
36352 " | +--^--------------+ |\n"
36353 " \\_________|________________/\n"
36355 " _______v______\n"
36358 " | disk image |\n"
36359 " \\______________/\n"
36364 #: ../src/guestfs.pod:2201
36366 "The library, linked to the main program, creates the child process and hence "
36367 "the appliance in the L</guestfs_launch> function."
36371 #: ../src/guestfs.pod:2204
36373 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36374 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36375 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36376 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36377 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36378 "attached to the qemu process which translates device access by the "
36379 "appliance's Linux kernel into accesses to the image."
36383 #: ../src/guestfs.pod:2213
36385 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36386 "Although the disk image you are attached to might also be used by some "
36387 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36388 "care if both libguestfs's qemu process and your virtual machine are trying "
36389 "to update the disk image at the same time, since these usually results in "
36390 "massive disk corruption)."
36394 #: ../src/guestfs.pod:2220
36395 msgid "STATE MACHINE"
36399 #: ../src/guestfs.pod:2222
36400 msgid "libguestfs uses a state machine to model the child process:"
36404 #: ../src/guestfs.pod:2224
36408 " guestfs_create\n"
36416 " / | \\ \\ guestfs_launch\n"
36417 " / | _\\__V______\n"
36419 " / | | LAUNCHING |\n"
36420 " / | \\___________/\n"
36422 " / | guestfs_launch\n"
36424 " ______ / __|____V\n"
36425 " / \\ ------> / \\\n"
36426 " | BUSY | | READY |\n"
36427 " \\______/ <------ \\________/\n"
36432 #: ../src/guestfs.pod:2246
36434 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36435 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36436 "(3) alternating between READY and BUSY as commands are issued to, and "
36437 "carried out by, the child process."
36441 #: ../src/guestfs.pod:2251
36443 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36444 "asynchronously at any time (eg. due to some internal error), and that causes "
36445 "the state to transition back to CONFIG."
36449 #: ../src/guestfs.pod:2255
36451 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36452 "issued when in the CONFIG state."
36456 #: ../src/guestfs.pod:2258
36458 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36459 "L</guestfs_launch> blocks until the child process is READY to accept "
36460 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36461 "moves the state from CONFIG to LAUNCHING while it is running."
36465 #: ../src/guestfs.pod:2264
36467 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36468 "state. These API calls block waiting for the command to be carried out (ie. "
36469 "the state to transition to BUSY and then back to READY). There are no non-"
36470 "blocking versions, and no way to issue more than one command per handle at "
36475 #: ../src/guestfs.pod:2270
36477 "Finally, the child process sends asynchronous messages back to the main "
36478 "program, such as kernel log messages. You can register a callback to "
36479 "receive these messages."
36483 #: ../src/guestfs.pod:2274
36488 #: ../src/guestfs.pod:2276
36489 msgid "APPLIANCE BOOT PROCESS"
36493 #: ../src/guestfs.pod:2278
36495 "This process has evolved and continues to evolve. The description here "
36496 "corresponds only to the current version of libguestfs and is provided for "
36497 "information only."
36501 #: ../src/guestfs.pod:2282
36503 "In order to follow the stages involved below, enable libguestfs debugging "
36504 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36508 #: ../src/guestfs.pod:2287
36509 msgid "Create the appliance"
36513 #: ../src/guestfs.pod:2289
36515 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36516 "initrd and the appliance."
36520 #: ../src/guestfs.pod:2292
36522 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36523 "directory if C<TMPDIR> is set)."
36527 #: ../src/guestfs.pod:2295
36529 "For a complete description of how the appliance is created and cached, read "
36530 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36534 #: ../src/guestfs.pod:2299
36535 msgid "Start qemu and boot the kernel"
36539 #: ../src/guestfs.pod:2301
36540 msgid "qemu is invoked to boot the kernel."
36544 #: ../src/guestfs.pod:2303
36545 msgid "Run the initrd"
36549 #: ../src/guestfs.pod:2305
36551 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
36552 "appliance. The purpose of the initrd is to load enough kernel modules in "
36553 "order that the appliance itself can be mounted and started."
36557 #: ../src/guestfs.pod:2309
36559 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
36564 #: ../src/guestfs.pod:2312
36566 "When the initrd has started you will see messages showing that kernel "
36567 "modules are being loaded, similar to this:"
36571 #: ../src/guestfs.pod:2315
36574 " febootstrap: ext2 mini initrd starting up\n"
36575 " febootstrap: mounting /sys\n"
36576 " febootstrap: internal insmod libcrc32c.ko\n"
36577 " febootstrap: internal insmod crc32c-intel.ko\n"
36582 #: ../src/guestfs.pod:2320
36583 msgid "Find and mount the appliance device"
36587 #: ../src/guestfs.pod:2322
36589 "The appliance is a sparse file containing an ext2 filesystem which contains "
36590 "a familiar (although reduced in size) Linux operating system. It would "
36591 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
36595 #: ../src/guestfs.pod:2326
36597 "The regular disks being inspected by libguestfs are the first devices "
36598 "exposed by qemu (eg. as C</dev/vda>)."
36602 #: ../src/guestfs.pod:2329
36604 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
36605 "there was only one regular disk)."
36609 #: ../src/guestfs.pod:2332
36611 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
36612 "and switch root into the appliance, and run C</init> from the appliance."
36616 #: ../src/guestfs.pod:2336
36617 msgid "If this works successfully you will see messages such as:"
36621 #: ../src/guestfs.pod:2338
36624 " febootstrap: picked /sys/block/vdb/dev as root device\n"
36625 " febootstrap: creating /dev/root as block special 252:16\n"
36626 " febootstrap: mounting new root on /root\n"
36627 " febootstrap: chroot\n"
36628 " Starting /init script ...\n"
36633 #: ../src/guestfs.pod:2344
36635 "Note that C<Starting /init script ...> indicates that the appliance's init "
36636 "script is now running."
36640 #: ../src/guestfs.pod:2347
36641 msgid "Initialize the appliance"
36645 #: ../src/guestfs.pod:2349
36647 "The appliance itself now initializes itself. This involves starting certain "
36648 "processes like C<udev>, possibly printing some debug information, and "
36649 "finally running the daemon (C<guestfsd>)."
36653 #: ../src/guestfs.pod:2353
36658 #: ../src/guestfs.pod:2355
36660 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
36665 #: ../src/guestfs.pod:2358
36668 " verbose daemon enabled\n"
36673 #: ../src/guestfs.pod:2360
36675 "The daemon expects to see a named virtio-serial port exposed by qemu and "
36676 "connected on the other end to the library."
36680 #: ../src/guestfs.pod:2363
36682 "The daemon connects to this port (and hence to the library) and sends a four "
36683 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
36684 "protocol (see below)."
36688 #: ../src/guestfs.pod:2369
36689 msgid "COMMUNICATION PROTOCOL"
36693 #: ../src/guestfs.pod:2371
36695 "Don't rely on using this protocol directly. This section documents how it "
36696 "currently works, but it may change at any time."
36700 #: ../src/guestfs.pod:2374
36702 "The protocol used to talk between the library and the daemon running inside "
36703 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
36704 "1014, RFC 1832, RFC 4506)."
36708 #: ../src/guestfs.pod:2378
36710 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
36711 "this file is automatically generated)."
36715 #: ../src/guestfs.pod:2381
36717 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
36718 "and C<FileOut> parameters, which are handled with very simple request/reply "
36719 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
36720 "parameters, which use the same request and reply messages, but they may also "
36721 "be followed by files sent using a chunked encoding."
36725 #: ../src/guestfs.pod:2388
36726 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
36730 #: ../src/guestfs.pod:2390
36731 msgid "For ordinary functions, the request message is:"
36735 #: ../src/guestfs.pod:2392
36738 " total length (header + arguments,\n"
36739 " but not including the length word itself)\n"
36740 " struct guestfs_message_header (encoded as XDR)\n"
36741 " struct guestfs_<foo>_args (encoded as XDR)\n"
36746 #: ../src/guestfs.pod:2397
36748 "The total length field allows the daemon to allocate a fixed size buffer "
36749 "into which it slurps the rest of the message. As a result, the total length "
36750 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
36751 "effective size of any request is limited to somewhere under this size."
36755 #: ../src/guestfs.pod:2403
36757 "Note also that many functions don't take any arguments, in which case the "
36758 "C<guestfs_I<foo>_args> is completely omitted."
36762 #: ../src/guestfs.pod:2406
36764 "The header contains the procedure number (C<guestfs_proc>) which is how the "
36765 "receiver knows what type of args structure to expect, or none at all."
36769 #: ../src/guestfs.pod:2410
36771 "For functions that take optional arguments, the optional arguments are "
36772 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
36773 "arguments. A bitmask in the header indicates which optional arguments are "
36774 "meaningful. The bitmask is also checked to see if it contains bits set "
36775 "which the daemon does not know about (eg. if more optional arguments were "
36776 "added in a later version of the library), and this causes the call to be "
36781 #: ../src/guestfs.pod:2418
36782 msgid "The reply message for ordinary functions is:"
36786 #: ../src/guestfs.pod:2420
36789 " total length (header + ret,\n"
36790 " but not including the length word itself)\n"
36791 " struct guestfs_message_header (encoded as XDR)\n"
36792 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36797 #: ../src/guestfs.pod:2425
36799 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
36800 "functions that return no formal return values."
36804 #: ../src/guestfs.pod:2428
36806 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
36810 #: ../src/guestfs.pod:2431
36812 "In the case of an error, a flag is set in the header, and the reply message "
36813 "is slightly changed:"
36817 #: ../src/guestfs.pod:2434
36820 " total length (header + error,\n"
36821 " but not including the length word itself)\n"
36822 " struct guestfs_message_header (encoded as XDR)\n"
36823 " struct guestfs_message_error (encoded as XDR)\n"
36828 #: ../src/guestfs.pod:2439
36830 "The C<guestfs_message_error> structure contains the error message as a "
36835 #: ../src/guestfs.pod:2442
36836 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
36840 #: ../src/guestfs.pod:2444
36842 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
36843 "The normal request message is sent (see above). However this is followed by "
36844 "a sequence of file chunks."
36848 #: ../src/guestfs.pod:2448
36851 " total length (header + arguments,\n"
36852 " but not including the length word itself,\n"
36853 " and not including the chunks)\n"
36854 " struct guestfs_message_header (encoded as XDR)\n"
36855 " struct guestfs_<foo>_args (encoded as XDR)\n"
36856 " sequence of chunks for FileIn param #0\n"
36857 " sequence of chunks for FileIn param #1 etc.\n"
36862 #: ../src/guestfs.pod:2456
36863 msgid "The \"sequence of chunks\" is:"
36867 #: ../src/guestfs.pod:2458
36870 " length of chunk (not including length word itself)\n"
36871 " struct guestfs_chunk (encoded as XDR)\n"
36872 " length of chunk\n"
36873 " struct guestfs_chunk (encoded as XDR)\n"
36875 " length of chunk\n"
36876 " struct guestfs_chunk (with data.data_len == 0)\n"
36881 #: ../src/guestfs.pod:2466
36883 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
36884 "is set in the final chunk to indicate either successful completion or early "
36889 #: ../src/guestfs.pod:2470
36891 "At time of writing there are no functions that have more than one FileIn "
36892 "parameter. However this is (theoretically) supported, by sending the "
36893 "sequence of chunks for each FileIn parameter one after another (from left to "
36898 #: ../src/guestfs.pod:2475
36900 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
36901 "transfer. The library does this by sending a chunk with a special flag set "
36902 "to indicate cancellation. When the daemon sees this, it cancels the whole "
36903 "RPC, does I<not> send any reply, and goes back to reading the next request."
36907 #: ../src/guestfs.pod:2481
36909 "The daemon may also cancel. It does this by writing a special word "
36910 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
36911 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
36912 "cancel chunk). The special word is chosen so that even if cancellation "
36913 "happens right at the end of the transfer (after the library has finished "
36914 "writing and has started listening for the reply), the \"spurious\" cancel "
36915 "flag will not be confused with the reply message."
36919 #: ../src/guestfs.pod:2490
36921 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
36922 "limit), and also files where the size is not known in advance (eg. from "
36923 "pipes or sockets). However the chunks are rather small "
36924 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
36925 "to keep much in memory."
36929 #: ../src/guestfs.pod:2496
36930 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
36934 #: ../src/guestfs.pod:2498
36936 "The protocol for FileOut parameters is exactly the same as for FileIn "
36937 "parameters, but with the roles of daemon and library reversed."
36941 #: ../src/guestfs.pod:2501
36944 " total length (header + ret,\n"
36945 " but not including the length word itself,\n"
36946 " and not including the chunks)\n"
36947 " struct guestfs_message_header (encoded as XDR)\n"
36948 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36949 " sequence of chunks for FileOut param #0\n"
36950 " sequence of chunks for FileOut param #1 etc.\n"
36955 #: ../src/guestfs.pod:2509
36956 msgid "INITIAL MESSAGE"
36960 #: ../src/guestfs.pod:2511
36962 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
36963 "which indicates that the guest and daemon is alive. This is what L</"
36964 "guestfs_launch> waits for."
36968 #: ../src/guestfs.pod:2515
36969 msgid "PROGRESS NOTIFICATION MESSAGES"
36973 #: ../src/guestfs.pod:2517
36975 "The daemon may send progress notification messages at any time. These are "
36976 "distinguished by the normal length word being replaced by "
36977 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
36981 #: ../src/guestfs.pod:2521
36983 "The library turns them into progress callbacks (see L</"
36984 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
36989 #: ../src/guestfs.pod:2525
36991 "The daemon self-limits the frequency of progress messages it sends (see "
36992 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
36997 #: ../src/guestfs.pod:2529
36998 msgid "LIBGUESTFS VERSION NUMBERS"
37002 #: ../src/guestfs.pod:2531
37004 "Since April 2010, libguestfs has started to make separate development and "
37005 "stable releases, along with corresponding branches in our git repository. "
37006 "These separate releases can be identified by version number:"
37010 #: ../src/guestfs.pod:2536
37013 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
37014 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
37020 " | `-------- sub-version\n"
37022 " `------ always '1' because we don't change the ABI\n"
37027 #: ../src/guestfs.pod:2547
37028 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
37032 #: ../src/guestfs.pod:2549
37034 "As time passes we cherry pick fixes from the development branch and backport "
37035 "those into the stable branch, the effect being that the stable branch should "
37036 "get more stable and less buggy over time. So the stable releases are ideal "
37037 "for people who don't need new features but would just like the software to "
37042 #: ../src/guestfs.pod:2555
37043 msgid "Our criteria for backporting changes are:"
37047 #: ../src/guestfs.pod:2561
37049 "Documentation changes which don't affect any code are backported unless the "
37050 "documentation refers to a future feature which is not in stable."
37054 #: ../src/guestfs.pod:2567
37056 "Bug fixes which are not controversial, fix obvious problems, and have been "
37057 "well tested are backported."
37061 #: ../src/guestfs.pod:2572
37063 "Simple rearrangements of code which shouldn't affect how it works get "
37064 "backported. This is so that the code in the two branches doesn't get too "
37065 "far out of step, allowing us to backport future fixes more easily."
37069 #: ../src/guestfs.pod:2578
37071 "We I<don't> backport new features, new APIs, new tools etc, except in one "
37072 "exceptional case: the new feature is required in order to implement an "
37073 "important bug fix."
37077 #: ../src/guestfs.pod:2584
37079 "A new stable branch starts when we think the new features in development are "
37080 "substantial and compelling enough over the current stable branch to warrant "
37081 "it. When that happens we create new stable and development versions 1.N.0 "
37082 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
37083 "stable at this point, but by backporting fixes from development, that branch "
37084 "will stabilize over time."
37088 #: ../src/guestfs.pod:2592
37089 msgid "EXTENDING LIBGUESTFS"
37093 #: ../src/guestfs.pod:2594
37094 msgid "ADDING A NEW API ACTION"
37098 #: ../src/guestfs.pod:2596
37100 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
37101 "documentation) are generated, and this makes it easy to extend the "
37106 #: ../src/guestfs.pod:2600
37107 msgid "To add a new API action there are two changes:"
37111 #: ../src/guestfs.pod:2606
37113 "You need to add a description of the call (name, parameters, return type, "
37114 "tests, documentation) to C<generator/generator_actions.ml>."
37118 #: ../src/guestfs.pod:2609
37120 "There are two sorts of API action, depending on whether the call goes "
37121 "through to the daemon in the appliance, or is serviced entirely by the "
37122 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
37123 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
37124 "an example of the latter, since a trace flag is maintained in the handle and "
37125 "all tracing is done on the library side."
37129 #: ../src/guestfs.pod:2617
37131 "Most new actions are of the first type, and get added to the "
37132 "C<daemon_functions> list. Each function has a unique procedure number used "
37133 "in the RPC protocol which is assigned to that action when we publish "
37134 "libguestfs and cannot be reused. Take the latest procedure number and "
37139 #: ../src/guestfs.pod:2623
37141 "For library-only actions of the second type, add to the "
37142 "C<non_daemon_functions> list. Since these functions are serviced by the "
37143 "library and do not travel over the RPC mechanism to the daemon, these "
37144 "functions do not need a procedure number, and so the procedure number is set "
37149 #: ../src/guestfs.pod:2631
37150 msgid "Implement the action (in C):"
37154 #: ../src/guestfs.pod:2633
37156 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
37157 "C<daemon/> directory."
37161 #: ../src/guestfs.pod:2636
37163 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
37164 "(note: double underscore) in the C<src/> directory."
37168 #: ../src/guestfs.pod:2639
37169 msgid "In either case, use another function as an example of what to do."
37173 #: ../src/guestfs.pod:2643
37174 msgid "After making these changes, use C<make> to compile."
37178 #: ../src/guestfs.pod:2645
37180 "Note that you don't need to implement the RPC, language bindings, manual "
37181 "pages or anything else. It's all automatically generated from the OCaml "
37186 #: ../src/guestfs.pod:2649
37187 msgid "ADDING TESTS FOR AN API ACTION"
37191 #: ../src/guestfs.pod:2651
37193 "You can supply zero or as many tests as you want per API call. The tests "
37194 "can either be added as part of the API description (C<generator/"
37195 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
37196 "into C<regressions/>. Note that adding a script to C<regressions/> is "
37197 "slower, so if possible use the first method."
37201 #: ../src/guestfs.pod:2657
37203 "The following describes the test environment used when you add an API test "
37204 "in C<generator_actions.ml>."
37208 #: ../src/guestfs.pod:2660
37209 msgid "The test environment has 4 block devices:"
37213 #: ../src/guestfs.pod:2664
37214 msgid "C</dev/sda> 500MB"
37218 #: ../src/guestfs.pod:2666
37219 msgid "General block device for testing."
37223 #: ../src/guestfs.pod:2668
37224 msgid "C</dev/sdb> 50MB"
37228 #: ../src/guestfs.pod:2670
37230 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
37235 #: ../src/guestfs.pod:2673
37236 msgid "C</dev/sdc> 10MB"
37240 #: ../src/guestfs.pod:2675
37241 msgid "Used in a few tests where two block devices are needed."
37245 #: ../src/guestfs.pod:2677
37246 msgid "C</dev/sdd>"
37250 #: ../src/guestfs.pod:2679
37251 msgid "ISO with fixed content (see C<images/test.iso>)."
37255 #: ../src/guestfs.pod:2683
37257 "To be able to run the tests in a reasonable amount of time, the libguestfs "
37258 "appliance and block devices are reused between tests. So don't try testing "
37259 "L</guestfs_kill_subprocess> :-x"
37263 #: ../src/guestfs.pod:2687
37265 "Each test starts with an initial scenario, selected using one of the "
37266 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
37267 "initialize the disks mentioned above in a particular way as documented in "
37268 "C<generator_types.ml>. You should not assume anything about the previous "
37269 "contents of other disks that are not initialized."
37273 #: ../src/guestfs.pod:2693
37275 "You can add a prerequisite clause to any individual test. This is a run-"
37276 "time check, which, if it fails, causes the test to be skipped. Useful if "
37277 "testing a command which might not work on all variations of libguestfs "
37278 "builds. A test that has prerequisite of C<Always> means to run "
37283 #: ../src/guestfs.pod:2699
37285 "In addition, packagers can skip individual tests by setting environment "
37286 "variables before running C<make check>."
37290 #: ../src/guestfs.pod:2702
37293 " SKIP_TEST_<CMD>_<NUM>=1\n"
37298 #: ../src/guestfs.pod:2704
37299 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37303 #: ../src/guestfs.pod:2706
37308 #: ../src/guestfs.pod:2708
37311 " SKIP_TEST_<CMD>=1\n"
37316 #: ../src/guestfs.pod:2710
37317 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37321 #: ../src/guestfs.pod:2712
37322 msgid "Packagers can run only certain tests by setting for example:"
37326 #: ../src/guestfs.pod:2714
37329 " TEST_ONLY=\"vfs_type zerofree\"\n"
37334 #: ../src/guestfs.pod:2716
37336 "See C<capitests/tests.c> for more details of how these environment variables "
37341 #: ../src/guestfs.pod:2719
37342 msgid "DEBUGGING NEW API ACTIONS"
37346 #: ../src/guestfs.pod:2721
37347 msgid "Test new actions work before submitting them."
37351 #: ../src/guestfs.pod:2723
37352 msgid "You can use guestfish to try out new commands."
37356 #: ../src/guestfs.pod:2725
37358 "Debugging the daemon is a problem because it runs inside a minimal "
37359 "environment. However you can fprintf messages in the daemon to stderr, and "
37360 "they will show up if you use C<guestfish -v>."
37364 #: ../src/guestfs.pod:2729
37365 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37369 #: ../src/guestfs.pod:2731
37371 "Our C source code generally adheres to some basic code-formatting "
37372 "conventions. The existing code base is not totally consistent on this "
37373 "front, but we do prefer that contributed code be formatted similarly. In "
37374 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37375 "indentation level, and other than that, follow the K&R style."
37379 #: ../src/guestfs.pod:2737
37381 "If you use Emacs, add the following to one of one of your start-up files (e."
37382 "g., ~/.emacs), to help ensure that you get indentation right:"
37386 #: ../src/guestfs.pod:2740
37389 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37390 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37391 " (add-hook 'find-file-hook\n"
37392 " '(lambda () (if (and buffer-file-name\n"
37393 " (string-match \"/libguestfs\\\\>\"\n"
37394 " (buffer-file-name))\n"
37395 " (not (string-equal mode-name \"Change Log\"))\n"
37396 " (not (string-equal mode-name \"Makefile\")))\n"
37397 " (setq indent-tabs-mode nil))))\n"
37402 #: ../src/guestfs.pod:2750
37405 " ;;; When editing C sources in libguestfs, use this style.\n"
37406 " (defun libguestfs-c-mode ()\n"
37407 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37409 " (c-set-style \"K&R\")\n"
37410 " (setq c-indent-level 2)\n"
37411 " (setq c-basic-offset 2))\n"
37412 " (add-hook 'c-mode-hook\n"
37413 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37414 " (buffer-file-name))\n"
37415 " (libguestfs-c-mode))))\n"
37420 #: ../src/guestfs.pod:2762
37421 msgid "Enable warnings when compiling (and fix any problems this finds):"
37425 #: ../src/guestfs.pod:2765
37428 " ./configure --enable-gcc-warnings\n"
37433 #: ../src/guestfs.pod:2767
37434 msgid "Useful targets are:"
37438 #: ../src/guestfs.pod:2769
37441 " make syntax-check # checks the syntax of the C code\n"
37442 " make check # runs the test suite\n"
37447 #: ../src/guestfs.pod:2772
37448 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37452 #: ../src/guestfs.pod:2774
37454 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37455 "which are used to do shell quoting."
37459 #: ../src/guestfs.pod:2779
37464 #: ../src/guestfs.pod:2781
37466 "Simple shell quoted string. Any spaces or other shell characters are "
37471 #: ../src/guestfs.pod:2784
37476 #: ../src/guestfs.pod:2786
37478 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37483 #: ../src/guestfs.pod:2793
37486 " asprintf (&cmd, \"cat %R\", path);\n"
37491 #: ../src/guestfs.pod:2795
37492 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37496 #: ../src/guestfs.pod:2797
37498 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
37499 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
37500 "they are not passed via the shell (instead, straight to exec). You probably "
37501 "want to use the C<sysroot_path()> function however."
37505 #: ../src/guestfs.pod:2803
37506 msgid "SUBMITTING YOUR NEW API ACTIONS"
37510 #: ../src/guestfs.pod:2805
37512 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
37513 "libguestfs> and CC to L<rjones@redhat.com>."
37517 #: ../src/guestfs.pod:2809
37518 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37522 #: ../src/guestfs.pod:2811
37523 msgid "We support i18n (gettext anyhow) in the library."
37527 #: ../src/guestfs.pod:2813
37529 "However many messages come from the daemon, and we don't translate those at "
37530 "the moment. One reason is that the appliance generally has all locale files "
37531 "removed from it, because they take up a lot of space. So we'd have to readd "
37532 "some of those, as well as copying our PO files into the appliance."
37536 #: ../src/guestfs.pod:2819
37538 "Debugging messages are never translated, since they are intended for the "
37543 #: ../src/guestfs.pod:2822
37544 msgid "SOURCE CODE SUBDIRECTORIES"
37548 #: ../src/guestfs.pod:2826
37553 #: ../src/guestfs.pod:2828
37554 msgid "L<virt-alignment-scan(1)> command and documentation."
37558 #: ../src/guestfs.pod:2832
37559 msgid "The libguestfs appliance, build scripts and so on."
37563 #: ../src/guestfs.pod:2834
37564 msgid "C<capitests>"
37568 #: ../src/guestfs.pod:2836
37569 msgid "Automated tests of the C API."
37573 #: ../src/guestfs.pod:2838
37578 #: ../src/guestfs.pod:2840
37580 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
37585 #: ../src/guestfs.pod:2843
37590 #: ../src/guestfs.pod:2845
37592 "Safety and liveness tests of components that libguestfs depends upon (not of "
37593 "libguestfs itself). Mainly this is for qemu and the kernel."
37597 #: ../src/guestfs.pod:2848
37602 #: ../src/guestfs.pod:2850
37603 msgid "Outside contributions, experimental parts."
37607 #: ../src/guestfs.pod:2852
37612 #: ../src/guestfs.pod:2854
37614 "The daemon that runs inside the libguestfs appliance and carries out actions."
37618 #: ../src/guestfs.pod:2857
37623 #: ../src/guestfs.pod:2859
37624 msgid "L<virt-df(1)> command and documentation."
37628 #: ../src/guestfs.pod:2861
37633 #: ../src/guestfs.pod:2863
37634 msgid "L<virt-edit(1)> command and documentation."
37638 #: ../src/guestfs.pod:2865
37639 msgid "C<examples>"
37643 #: ../src/guestfs.pod:2867
37644 msgid "C API example code."
37648 #: ../src/guestfs.pod:2869
37653 #: ../src/guestfs.pod:2871
37655 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
37656 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
37657 "L<virt-tar-out(1)>."
37661 #: ../src/guestfs.pod:2875
37666 #: ../src/guestfs.pod:2877
37668 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
37672 #: ../src/guestfs.pod:2879
37673 msgid "C<generator>"
37677 #: ../src/guestfs.pod:2881
37679 "The crucially important generator, used to automatically generate large "
37680 "amounts of boilerplate C code for things like RPC and bindings."
37684 #: ../src/guestfs.pod:2884
37689 #: ../src/guestfs.pod:2886
37690 msgid "Files used by the test suite."
37694 #: ../src/guestfs.pod:2888
37695 msgid "Some \"phony\" guest images which we test against."
37699 #: ../src/guestfs.pod:2890
37700 msgid "C<inspector>"
37704 #: ../src/guestfs.pod:2892
37705 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
37709 #: ../src/guestfs.pod:2894
37714 #: ../src/guestfs.pod:2896
37715 msgid "Logo used on the website. The fish is called Arthur by the way."
37719 #: ../src/guestfs.pod:2898
37724 #: ../src/guestfs.pod:2900
37725 msgid "M4 macros used by autoconf."
37729 #: ../src/guestfs.pod:2902
37734 #: ../src/guestfs.pod:2904
37735 msgid "Translations of simple gettext strings."
37739 #: ../src/guestfs.pod:2906
37744 #: ../src/guestfs.pod:2908
37746 "The build infrastructure and PO files for translations of manpages and POD "
37747 "files. Eventually this will be combined with the C<po> directory, but that "
37748 "is rather complicated."
37752 #: ../src/guestfs.pod:2912
37753 msgid "C<regressions>"
37757 #: ../src/guestfs.pod:2914
37758 msgid "Regression tests."
37762 #: ../src/guestfs.pod:2916
37767 #: ../src/guestfs.pod:2918
37768 msgid "L<virt-rescue(1)> command and documentation."
37772 #: ../src/guestfs.pod:2920
37777 #: ../src/guestfs.pod:2922
37778 msgid "L<virt-resize(1)> command and documentation."
37782 #: ../src/guestfs.pod:2924
37783 msgid "C<sparsify>"
37787 #: ../src/guestfs.pod:2926
37788 msgid "L<virt-sparsify(1)> command and documentation."
37792 #: ../src/guestfs.pod:2928
37797 #: ../src/guestfs.pod:2930
37798 msgid "Source code to the C library."
37802 #: ../src/guestfs.pod:2932
37807 #: ../src/guestfs.pod:2934
37809 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
37813 #: ../src/guestfs.pod:2936
37814 msgid "C<test-tool>"
37818 #: ../src/guestfs.pod:2938
37820 "Test tool for end users to test if their qemu/kernel combination will work "
37825 #: ../src/guestfs.pod:2941
37830 #: ../src/guestfs.pod:2943
37835 #: ../src/guestfs.pod:2945
37840 #: ../src/guestfs.pod:2947
37845 #: ../src/guestfs.pod:2949
37850 #: ../src/guestfs.pod:2951
37855 #: ../src/guestfs.pod:2953
37860 #: ../src/guestfs.pod:2955
37865 #: ../src/guestfs.pod:2957
37870 #: ../src/guestfs.pod:2959
37871 msgid "Language bindings."
37875 #: ../src/guestfs.pod:2963
37876 msgid "MAKING A STABLE RELEASE"
37880 #: ../src/guestfs.pod:2965
37882 "When we make a stable release, there are several steps documented here. See "
37883 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
37888 #: ../src/guestfs.pod:2973
37890 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
37894 #: ../src/guestfs.pod:2978
37895 msgid "Finalize RELEASE-NOTES."
37899 #: ../src/guestfs.pod:2982
37900 msgid "Update ROADMAP."
37904 #: ../src/guestfs.pod:2986
37905 msgid "Run C<src/api-support/update-from-tarballs.sh>."
37909 #: ../src/guestfs.pod:2990
37910 msgid "Push and pull from Transifex."
37914 #: ../src/guestfs.pod:2992
37919 #: ../src/guestfs.pod:2994
37927 #: ../src/guestfs.pod:2996
37928 msgid "to push the latest POT files to Transifex. Then run:"
37932 #: ../src/guestfs.pod:2998
37940 #: ../src/guestfs.pod:3000
37941 msgid "which is a wrapper to pull the latest translated C<*.po> files."
37945 #: ../src/guestfs.pod:3004
37947 "Create new stable and development directories under L<http://libguestfs.org/"
37952 #: ../src/guestfs.pod:3009
37953 msgid "Create the branch in git:"
37957 #: ../src/guestfs.pod:3011
37960 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
37961 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
37962 " git branch stable-1.XX\n"
37963 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
37968 #: ../src/guestfs.pod:3018
37973 #: ../src/guestfs.pod:3020
37974 msgid "PROTOCOL LIMITS"
37978 #: ../src/guestfs.pod:3022
37980 "Internally libguestfs uses a message-based protocol to pass API calls and "
37981 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
37982 "plenty more detail about this). The maximum message size used by the "
37983 "protocol is slightly less than 4 MB. For some API calls you may need to be "
37984 "aware of this limit. The API calls which may be affected are individually "
37985 "documented, with a link back to this section of the documentation."
37989 #: ../src/guestfs.pod:3030
37991 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
37992 "a simple string. Because this string is at some point internally encoded as "
37993 "a message, the maximum size that it can return is slightly under 4 MB. If "
37994 "the requested file is larger than this then you will get an error."
37998 #: ../src/guestfs.pod:3036
38000 "In order to transfer large files into and out of the guest filesystem, you "
38001 "need to use particular calls that support this. The sections L</UPLOADING> "
38002 "and L</DOWNLOADING> document how to do this."
38006 #: ../src/guestfs.pod:3040
38008 "You might also consider mounting the disk image using our FUSE filesystem "
38009 "support (L<guestmount(1)>)."
38013 #: ../src/guestfs.pod:3043
38014 msgid "MAXIMUM NUMBER OF DISKS"
38018 #: ../src/guestfs.pod:3045
38019 msgid "When using virtio disks (the default) the current limit is B<25> disks."
38023 #: ../src/guestfs.pod:3048
38025 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
38026 "slots. However febootstrap only understands disks with names C</dev/vda> "
38027 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
38032 #: ../src/guestfs.pod:3053
38034 "We are working to substantially raise this limit in future versions but it "
38035 "requires complex changes to qemu."
38039 #: ../src/guestfs.pod:3056
38041 "In future versions of libguestfs it should also be possible to \"hot plug\" "
38042 "disks (add and remove disks after calling L</guestfs_launch>). This also "
38043 "requires changes to qemu."
38047 #: ../src/guestfs.pod:3060
38048 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
38052 #: ../src/guestfs.pod:3062
38053 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
38057 #: ../src/guestfs.pod:3064
38059 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
38060 "vda>, and C</dev/vda1> through C</dev/vda15>)."
38064 #: ../src/guestfs.pod:3067
38066 "If you attach a disk with more than 15 partitions, the extra partitions are "
38067 "ignored by libguestfs."
38071 #: ../src/guestfs.pod:3070
38072 msgid "MAXIMUM SIZE OF A DISK"
38076 #: ../src/guestfs.pod:3072
38077 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
38081 #: ../src/guestfs.pod:3074
38083 "We have tested block devices up to 1 exabyte (2**60 or "
38084 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
38089 #: ../src/guestfs.pod:3078
38091 "Although libguestfs probably does not impose any limit, the underlying host "
38092 "storage will. If you store disk images on a host ext4 filesystem, then the "
38093 "maximum size will be limited by the maximum ext4 file size (currently 16 "
38094 "TB). If you store disk images as host logical volumes then you are limited "
38095 "by the maximum size of an LV."
38099 #: ../src/guestfs.pod:3084
38101 "For the hugest disk image files, we recommend using XFS on the host for "
38106 #: ../src/guestfs.pod:3087
38107 msgid "MAXIMUM SIZE OF A PARTITION"
38111 #: ../src/guestfs.pod:3089
38113 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
38114 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
38115 "address a partition located beyond 2 TB on the disk."
38119 #: ../src/guestfs.pod:3093
38121 "It is recommended that you use GPT partitions on disks which are larger than "
38122 "this size. GPT uses 64 bit sector numbers and so can address partitions "
38123 "which are theoretically larger than the largest disk we could support."
38127 #: ../src/guestfs.pod:3098
38128 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
38132 #: ../src/guestfs.pod:3100
38134 "This depends on the filesystem type. libguestfs itself does not impose any "
38135 "known limit. Consult Wikipedia or the filesystem documentation to find out "
38136 "what these limits are."
38140 #: ../src/guestfs.pod:3104
38141 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
38145 #: ../src/guestfs.pod:3106
38147 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
38148 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
38149 "uploads and downloads."
38153 #: ../src/guestfs.pod:3110
38154 msgid "INSPECTION LIMITS"
38158 #: ../src/guestfs.pod:3112
38160 "The inspection code has several arbitrary limits on things like the size of "
38161 "Windows Registry hive it will read, and the length of product name. These "
38162 "are intended to stop a malicious guest from consuming arbitrary amounts of "
38163 "memory and disk space on the host, and should not be reached in practice. "
38164 "See the source code for more information."
38168 #: ../src/guestfs.pod:3138
38170 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
38171 "effect as calling C<guestfs_set_verbose (g, 1)>."
38175 #: ../src/guestfs.pod:3150
38177 "Set the path that libguestfs uses to search for a supermin appliance. See "
38178 "the discussion of paths in section L</PATH> above."
38182 #: ../src/guestfs.pod:3159
38183 msgid "See also L</QEMU WRAPPERS> above."
38187 #: ../src/guestfs.pod:3163
38189 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
38190 "effect as calling C<guestfs_set_trace (g, 1)>."
38194 #: ../src/guestfs.pod:3181
38196 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
38197 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
38198 "L<guestfish(1)>, L<guestmount(1)>, L<virt-alignment-scan(1)>, L<virt-cat(1)"
38199 ">, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
38200 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
38201 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue"
38202 "(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, L<virt-tar(1)>, L<virt-tar-in"
38203 "(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
38204 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
38208 #: ../src/guestfs.pod:3215
38210 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
38211 "(8)>, L<disktype(1)>."
38215 #: ../src/guestfs.pod:3222 ../tools/virt-make-fs.pl:553
38216 #: ../tools/virt-win-reg.pl:761
38221 #: ../src/guestfs.pod:3224
38222 msgid "To get a list of bugs against libguestfs use this link:"
38226 #: ../src/guestfs.pod:3226
38228 "L<https://bugzilla.redhat.com/buglist.cgi?"
38229 "component=libguestfs&product=Virtualization+Tools>"
38233 #: ../src/guestfs.pod:3228
38234 msgid "To report a new bug against libguestfs use this link:"
38238 #: ../src/guestfs.pod:3230
38240 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
38241 "component=libguestfs&product=Virtualization+Tools>"
38245 #: ../src/guestfs.pod:3232
38246 msgid "When reporting a bug, please check:"
38250 #: ../src/guestfs.pod:3238
38251 msgid "That the bug hasn't been reported already."
38255 #: ../src/guestfs.pod:3242
38256 msgid "That you are testing a recent version."
38260 #: ../src/guestfs.pod:3246
38261 msgid "Describe the bug accurately, and give a way to reproduce it."
38265 #: ../src/guestfs.pod:3250
38267 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
38272 #: ../test-tool/libguestfs-test-tool.pod:5
38273 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
38277 #: ../test-tool/libguestfs-test-tool.pod:9
38280 " libguestfs-test-tool [--options]\n"
38285 #: ../test-tool/libguestfs-test-tool.pod:13
38287 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
38288 "to check basic libguestfs functionality is working. This is needed because "
38289 "libguestfs occasionally breaks for reasons beyond our control: usually "
38290 "because of changes in the underlying qemu or kernel packages, or the host "
38295 #: ../test-tool/libguestfs-test-tool.pod:19
38296 msgid "If you suspect a problem in libguestfs, then just run:"
38300 #: ../test-tool/libguestfs-test-tool.pod:21
38303 " libguestfs-test-tool\n"
38308 #: ../test-tool/libguestfs-test-tool.pod:23
38309 msgid "It will print lots of diagnostic messages."
38313 #: ../test-tool/libguestfs-test-tool.pod:25
38314 msgid "If it runs to completion successfully, you will see this near the end:"
38318 #: ../test-tool/libguestfs-test-tool.pod:27
38321 " ===== TEST FINISHED OK =====\n"
38326 #: ../test-tool/libguestfs-test-tool.pod:29
38327 msgid "and the test tool will exit with code 0."
38331 #: ../test-tool/libguestfs-test-tool.pod:31
38333 "If it fails (and/or exits with non-zero error code), please paste the "
38334 "I<complete, unedited> output of the test tool into a bug report. More "
38335 "information about reporting bugs can be found on the L<http://libguestfs.org/"
38340 #: ../test-tool/libguestfs-test-tool.pod:42
38341 msgid "Display short usage information and exit."
38345 #: ../test-tool/libguestfs-test-tool.pod:44
38346 msgid "B<--qemu qemu_binary>"
38350 #: ../test-tool/libguestfs-test-tool.pod:46
38352 "If you have downloaded another qemu binary, point this option at the full "
38353 "path of the binary to try it."
38357 #: ../test-tool/libguestfs-test-tool.pod:49
38358 msgid "B<--qemudir qemu_source_dir>"
38362 #: ../test-tool/libguestfs-test-tool.pod:51
38364 "If you have compiled qemu from source, point this option at the source "
38365 "directory to try it."
38369 #: ../test-tool/libguestfs-test-tool.pod:54
38374 #: ../test-tool/libguestfs-test-tool.pod:56
38375 msgid "B<--timeout N>"
38379 #: ../test-tool/libguestfs-test-tool.pod:58
38381 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38382 "minutes) which does not usually need to be adjusted."
38386 #: ../test-tool/libguestfs-test-tool.pod:63
38387 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38391 #: ../test-tool/libguestfs-test-tool.pod:65
38393 "If you have compiled another version of qemu from source and would like to "
38394 "try that, then you can use the I<--qemudir> option to point to the qemu "
38395 "source directory."
38399 #: ../test-tool/libguestfs-test-tool.pod:69
38401 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38402 "option to point to the binary."
38406 #: ../test-tool/libguestfs-test-tool.pod:72
38408 "Note when using these options, you can ignore the business of qemu wrapper "
38409 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38410 "wrapper script for you if one is needed."
38414 #: ../test-tool/libguestfs-test-tool.pod:76
38415 msgid "TRYING OUT A DIFFERENT KERNEL"
38419 #: ../test-tool/libguestfs-test-tool.pod:78
38421 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38422 "libguestfs tries. You do this by setting the environment variables "
38423 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38427 #: ../test-tool/libguestfs-test-tool.pod:82
38429 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38434 #: ../test-tool/libguestfs-test-tool.pod:85
38435 msgid "SELF-DIAGNOSIS"
38439 #: ../test-tool/libguestfs-test-tool.pod:87
38441 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38442 "produced by libguestfs-test-tool and/or possible errors."
38446 #: ../test-tool/libguestfs-test-tool.pod:92
38448 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38449 "I<1> if there was an error."
38453 #: ../test-tool/libguestfs-test-tool.pod:97
38455 "For the full list of environment variables which may affect libguestfs, "
38456 "please see the L<guestfs(3)> manual page."
38460 #: ../test-tool/libguestfs-test-tool.pod:102
38461 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38465 #: ../tools/virt-list-filesystems.pl:32
38467 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38471 #: ../tools/virt-list-filesystems.pl:36
38474 " virt-list-filesystems [--options] domname\n"
38479 #: ../tools/virt-list-filesystems.pl:38
38482 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38487 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38489 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38494 #: ../tools/virt-list-filesystems.pl:45
38496 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38497 "are contained in a virtual machine or disk image."
38501 #: ../tools/virt-list-filesystems.pl:49
38503 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38504 "functionality. For more complex cases you should look at the L<guestfish(1)"
38509 #: ../tools/virt-list-filesystems.pl:112
38511 "With this option, C<virt-list-filesystems> displays the type of each "
38512 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38516 #: ../tools/virt-list-filesystems.pl:119
38521 #: ../tools/virt-list-filesystems.pl:123
38523 "Normally we only show mountable filesystems. If this option is given then "
38524 "swap devices are shown too."
38528 #: ../tools/virt-list-filesystems.pl:197
38530 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
38531 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
38532 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38536 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38537 msgid "Copyright (C) 2009 Red Hat Inc."
38541 #: ../tools/virt-list-partitions.pl:32
38543 "virt-list-partitions - List partitions in a virtual machine or disk image"
38547 #: ../tools/virt-list-partitions.pl:36
38550 " virt-list-partitions [--options] domname\n"
38555 #: ../tools/virt-list-partitions.pl:38
38558 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
38563 #: ../tools/virt-list-partitions.pl:45
38565 "C<virt-list-partitions> is a command line tool to list the partitions that "
38566 "are contained in a virtual machine or disk image. It is mainly useful as a "
38567 "first step to using L<virt-resize(1)>."
38571 #: ../tools/virt-list-partitions.pl:50
38573 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
38574 "functionality. For more complex cases you should look at the L<guestfish(1)"
38579 #: ../tools/virt-list-partitions.pl:113
38580 msgid "Show sizes in human-readable form (eg. \"1G\")."
38584 #: ../tools/virt-list-partitions.pl:123
38586 "With this option, C<virt-list-partitions> displays the type and size of each "
38587 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
38591 #: ../tools/virt-list-partitions.pl:130
38596 #: ../tools/virt-list-partitions.pl:132
38601 #: ../tools/virt-list-partitions.pl:134
38603 "Display the total size of each block device (as a separate row or rows)."
38607 #: ../tools/virt-list-partitions.pl:267
38609 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
38610 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
38611 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38615 #: ../tools/virt-list-partitions.pl:283
38616 msgid "Copyright (C) 2009-2010 Red Hat Inc."
38620 #: ../tools/virt-make-fs.pl:37
38621 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
38625 #: ../tools/virt-make-fs.pl:41
38628 " virt-make-fs [--options] input.tar output.img\n"
38633 #: ../tools/virt-make-fs.pl:43
38636 " virt-make-fs [--options] input.tar.gz output.img\n"
38641 #: ../tools/virt-make-fs.pl:45
38644 " virt-make-fs [--options] directory output.img\n"
38649 #: ../tools/virt-make-fs.pl:49
38651 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
38652 "archive or some files in a directory. It is similar to tools like L<mkisofs"
38653 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
38654 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
38655 "you want to attach these filesystems to existing virtual machines (eg. to "
38656 "import large amounts of read-only data to a VM)."
38660 #: ../tools/virt-make-fs.pl:57
38661 msgid "Basic usage is:"
38665 #: ../tools/virt-make-fs.pl:59
38668 " virt-make-fs input output\n"
38673 #: ../tools/virt-make-fs.pl:61
38675 "where C<input> is either a directory containing files that you want to add, "
38676 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
38677 "C<output> is a disk image. The input type is detected automatically. The "
38678 "output disk image defaults to a raw ext2 image unless you specify extra "
38679 "flags (see L</OPTIONS> below)."
38683 #: ../tools/virt-make-fs.pl:67
38684 msgid "EXTRA SPACE"
38688 #: ../tools/virt-make-fs.pl:69
38690 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
38691 "the files that it contains, but might have extra space. Depending on how "
38692 "you are going to use the output, you might think this extra space is wasted "
38693 "and want to minimize it, or you might want to leave space so that more files "
38694 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
38695 "but you can use the I<--size> flag to leave space in the filesystem if you "
38700 #: ../tools/virt-make-fs.pl:77
38702 "An alternative way to leave extra space but not make the output image any "
38703 "bigger is to use an alternative disk image format (instead of the default "
38704 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
38705 "image format (check your hypervisor supports this before using it). This "
38706 "allows you to choose a large I<--size> but the extra space won't actually be "
38707 "allocated in the image until you try to store something in it."
38711 #: ../tools/virt-make-fs.pl:85
38713 "Don't forget that you can also use local commands including L<resize2fs(8)> "
38714 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
38715 "to build another image from scratch."
38719 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
38720 #: ../tools/virt-make-fs.pl:142
38725 #: ../tools/virt-make-fs.pl:91
38728 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
38733 #: ../tools/virt-make-fs.pl:93
38734 msgid "FILESYSTEM TYPE"
38738 #: ../tools/virt-make-fs.pl:95
38740 "The default filesystem type is C<ext2>. Just about any filesystem type that "
38741 "libguestfs supports can be used (but I<not> read-only formats like "
38742 "ISO9660). Here are some of the more common choices:"
38746 #: ../tools/virt-make-fs.pl:101
38751 #: ../tools/virt-make-fs.pl:103
38753 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
38754 "you are not going to use the filesystem in a way that requires the journal, "
38755 "then this is just wasted overhead."
38759 #: ../tools/virt-make-fs.pl:107
38760 msgid "I<ntfs> or I<vfat>"
38764 #: ../tools/virt-make-fs.pl:109
38765 msgid "Useful if exporting data to a Windows guest."
38769 #: ../tools/virt-make-fs.pl:111
38771 "I<Note for vfat>: The tar archive or local directory must only contain files "
38772 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
38773 "program running within libguestfs is unable to change the ownership of non-"
38774 "root files, since vfat itself does not support this."
38778 #: ../tools/virt-make-fs.pl:116
38783 #: ../tools/virt-make-fs.pl:118
38785 "Lower overhead than C<ext2>, but certain limitations on filename length and "
38786 "total filesystem size."
38790 #: ../tools/virt-make-fs.pl:125
38793 " virt-make-fs --type=minix input minixfs.img\n"
38798 #: ../tools/virt-make-fs.pl:127
38799 msgid "TO PARTITION OR NOT TO PARTITION"
38803 #: ../tools/virt-make-fs.pl:129
38804 msgid "Optionally virt-make-fs can add a partition table to the output disk."
38808 #: ../tools/virt-make-fs.pl:131
38810 "Adding a partition can make the disk image more compatible with certain "
38811 "virtualized operating systems which don't expect to see a filesystem "
38812 "directly located on a block device (Linux doesn't care and will happily "
38813 "handle both types)."
38817 #: ../tools/virt-make-fs.pl:136
38819 "On the other hand, if you have a partition table then the output image is no "
38820 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
38821 "directly on a partitioned disk image. (However libguestfs tools such as "
38822 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
38826 #: ../tools/virt-make-fs.pl:144
38827 msgid "Add an MBR partition:"
38831 #: ../tools/virt-make-fs.pl:146
38834 " virt-make-fs --partition -- input disk.img\n"
38839 #: ../tools/virt-make-fs.pl:148
38841 "If the output disk image could be terabyte-sized or larger, it's better to "
38842 "use an EFI/GPT-compatible partition table:"
38846 #: ../tools/virt-make-fs.pl:151
38849 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
38854 #: ../tools/virt-make-fs.pl:179
38855 msgid "Enable debugging information."
38859 #: ../tools/virt-make-fs.pl:185
38860 msgid "B<--size=E<lt>NE<gt>>"
38864 #: ../tools/virt-make-fs.pl:187
38865 msgid "B<--size=+E<lt>NE<gt>>"
38869 #: ../tools/virt-make-fs.pl:189
38870 msgid "B<-s E<lt>NE<gt>>"
38874 #: ../tools/virt-make-fs.pl:191
38875 msgid "B<-s +E<lt>NE<gt>>"
38879 #: ../tools/virt-make-fs.pl:193
38881 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
38885 #: ../tools/virt-make-fs.pl:196
38887 "If this option is I<not> given, then the output image will be just large "
38888 "enough to contain all the files, with not much wasted space."
38892 #: ../tools/virt-make-fs.pl:199
38894 "To choose a fixed size output disk, specify an absolute number followed by b/"
38895 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38896 "Petabytes or Exabytes. This must be large enough to contain all the input "
38897 "files, else you will get an error."
38901 #: ../tools/virt-make-fs.pl:204
38903 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
38904 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38905 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
38906 "the input files, and (approximately) an extra 200 MB free space."
38910 #: ../tools/virt-make-fs.pl:210
38912 "Note that virt-make-fs estimates free space, and therefore will not produce "
38913 "filesystems containing precisely the free space requested. (It is much more "
38914 "expensive and time-consuming to produce a filesystem which has precisely the "
38915 "desired free space)."
38919 #: ../tools/virt-make-fs.pl:219
38920 msgid "B<--format=E<lt>fmtE<gt>>"
38924 #: ../tools/virt-make-fs.pl:221
38925 msgid "B<-F E<lt>fmtE<gt>>"
38929 #: ../tools/virt-make-fs.pl:223
38930 msgid "Choose the output disk image format."
38934 #: ../tools/virt-make-fs.pl:225
38935 msgid "The default is C<raw> (raw disk image)."
38939 #: ../tools/virt-make-fs.pl:227
38941 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
38942 "that would really make sense here is C<qcow2>."
38946 #: ../tools/virt-make-fs.pl:234
38947 msgid "B<--type=E<lt>fsE<gt>>"
38951 #: ../tools/virt-make-fs.pl:236
38952 msgid "B<-t E<lt>fsE<gt>>"
38956 #: ../tools/virt-make-fs.pl:238
38957 msgid "Choose the output filesystem type."
38961 #: ../tools/virt-make-fs.pl:240
38962 msgid "The default is C<ext2>."
38966 #: ../tools/virt-make-fs.pl:242
38968 "Any filesystem which is supported read-write by libguestfs can be used here."
38972 #: ../tools/virt-make-fs.pl:249
38973 msgid "B<--partition>"
38977 #: ../tools/virt-make-fs.pl:251
38978 msgid "B<--partition=E<lt>parttypeE<gt>>"
38982 #: ../tools/virt-make-fs.pl:253
38984 "If specified, this flag adds an MBR partition table to the output disk image."
38988 #: ../tools/virt-make-fs.pl:256
38990 "You can change the partition table type, eg. I<--partition=gpt> for large "
38995 #: ../tools/virt-make-fs.pl:259
38997 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
38998 "might consider the next parameter to be the partition type. For example:"
39002 #: ../tools/virt-make-fs.pl:263
39005 " virt-make-fs --partition input.tar ...\n"
39010 #: ../tools/virt-make-fs.pl:265
39012 "would cause virt-make-fs to think you wanted to use a partition type of "
39013 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
39014 "dash) between options and the input file argument:"
39018 #: ../tools/virt-make-fs.pl:269
39021 " virt-make-fs --partition -- input.tar ...\n"
39026 #: ../tools/virt-make-fs.pl:541
39028 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
39029 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
39030 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
39034 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
39036 "When reporting bugs, please enable debugging and capture the I<complete> "
39041 #: ../tools/virt-make-fs.pl:558
39044 " export LIBGUESTFS_DEBUG=1\n"
39045 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
39050 #: ../tools/virt-make-fs.pl:561
39052 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
39057 #: ../tools/virt-tar.pl:33
39058 msgid "virt-tar - Extract or upload files to a virtual machine"
39062 #: ../tools/virt-tar.pl:37
39065 " virt-tar [--options] -x domname directory tarball\n"
39070 #: ../tools/virt-tar.pl:39
39073 " virt-tar [--options] -u domname tarball directory\n"
39078 #: ../tools/virt-tar.pl:41
39081 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
39086 #: ../tools/virt-tar.pl:43
39089 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
39094 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
39099 #: ../tools/virt-tar.pl:47
39101 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
39102 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
39106 #: ../tools/virt-tar.pl:52
39107 msgid "Download C</home> from the VM into a local tarball:"
39111 #: ../tools/virt-tar.pl:54
39114 " virt-tar -x domname /home home.tar\n"
39119 #: ../tools/virt-tar.pl:56
39122 " virt-tar -zx domname /home home.tar.gz\n"
39127 #: ../tools/virt-tar.pl:58
39128 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
39132 #: ../tools/virt-tar.pl:60
39135 " virt-tar -u domname uploadstuff.tar /tmp\n"
39140 #: ../tools/virt-tar.pl:62
39143 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
39148 #: ../tools/virt-tar.pl:66
39150 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
39151 "virtual machines. If you do this, you risk disk corruption in the VM. "
39152 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
39156 #: ../tools/virt-tar.pl:71
39158 "You can use I<-x> (extract) on live virtual machines, but you might get "
39159 "inconsistent results or errors if there is filesystem activity inside the "
39160 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
39161 "work, but the only way to guarantee consistent results is if the virtual "
39162 "machine is shut down."
39166 #: ../tools/virt-tar.pl:79
39168 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
39169 "parts of a guest filesystem. There are many possibilities: making backups, "
39170 "uploading data files, snooping on guest activity, fixing or customizing "
39175 #: ../tools/virt-tar.pl:84
39177 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
39178 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
39179 "should look at the L<guestfish(1)> tool."
39183 #: ../tools/virt-tar.pl:88
39185 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
39186 "its contents (recursively) from the virtual machine into a local tarball. "
39187 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
39188 "virtual machine. You cannot use these two options together."
39192 #: ../tools/virt-tar.pl:94
39194 "In addition, you may need to use the I<-z> (gZip) option to enable "
39195 "compression. When uploading, you have to specify I<-z> if the upload file "
39196 "is compressed because virt-tar won't detect this on its own."
39200 #: ../tools/virt-tar.pl:98
39202 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
39203 "example it cannot do PKZip files or bzip2 compression. If you want that "
39204 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
39205 "the L<libguestfs(3)> API)."
39209 #: ../tools/virt-tar.pl:160
39210 msgid "B<--extract>"
39214 #: ../tools/virt-tar.pl:162
39215 msgid "B<--download>"
39219 #: ../tools/virt-tar.pl:164
39224 #: ../tools/virt-tar.pl:166
39225 msgid "B<--upload>"
39229 #: ../tools/virt-tar.pl:168
39231 "Use I<-x> to extract (download) a directory from a virtual machine to a "
39236 #: ../tools/virt-tar.pl:171
39238 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
39239 "Please read the L</WARNING> section above before using this option."
39243 #: ../tools/virt-tar.pl:175
39244 msgid "You must specify exactly one of these options."
39248 #: ../tools/virt-tar.pl:181
39253 #: ../tools/virt-tar.pl:183
39258 #: ../tools/virt-tar.pl:185
39259 msgid "Specify that the input or output tarball is gzip-compressed."
39263 #: ../tools/virt-tar.pl:298
39265 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
39266 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
39267 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
39272 #: ../tools/virt-win-reg.pl:37
39274 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
39278 #: ../tools/virt-win-reg.pl:41
39281 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
39286 #: ../tools/virt-win-reg.pl:43
39289 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
39294 #: ../tools/virt-win-reg.pl:45
39297 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
39302 #: ../tools/virt-win-reg.pl:47
39305 " virt-win-reg --merge domname [input.reg ...]\n"
39310 #: ../tools/virt-win-reg.pl:49
39313 " virt-win-reg [--options] disk.img ... # instead of domname\n"
39318 #: ../tools/virt-win-reg.pl:53
39320 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
39321 "virtual machines. If you do this, you I<will> get irreversible disk "
39322 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
39323 "but doesn't catch all cases."
39327 #: ../tools/virt-win-reg.pl:58
39329 "Modifying the Windows Registry is an inherently risky operation. The format "
39330 "is deliberately obscure and undocumented, and Registry changes can leave the "
39331 "system unbootable. Therefore when using the I<--merge> option, make sure "
39332 "you have a reliable backup first."
39336 #: ../tools/virt-win-reg.pl:65
39338 "This program can export and merge Windows Registry entries from a Windows "
39343 #: ../tools/virt-win-reg.pl:68
39345 "The first parameter is the libvirt guest name or the raw disk image of a "
39350 #: ../tools/virt-win-reg.pl:71
39352 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
39353 "exported (recursively). For example:"
39357 #: ../tools/virt-win-reg.pl:74
39360 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39365 #: ../tools/virt-win-reg.pl:76
39367 "You can also display single values from within registry keys, for example:"
39371 #: ../tools/virt-win-reg.pl:79
39374 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39375 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39376 " Windows 7 Enterprise\n"
39381 #: ../tools/virt-win-reg.pl:83
39383 "With I<--merge>, you can merge a textual regedit file into the Windows "
39388 #: ../tools/virt-win-reg.pl:86
39391 " $ virt-win-reg --merge Windows7 changes.reg\n"
39396 #: ../tools/virt-win-reg.pl:90
39398 "This program is only meant for simple access to the registry. If you want "
39399 "to do complicated things with the registry, we suggest you download the "
39400 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39401 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39402 "L<hivexregedit(1)>."
39406 #: ../tools/virt-win-reg.pl:159
39411 #: ../tools/virt-win-reg.pl:161
39413 "In merge mode, this merges a textual regedit file into the Windows Registry "
39414 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39415 "displays or exports Registry entries instead."
39419 #: ../tools/virt-win-reg.pl:165
39421 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39422 "result in disk corruption. However exporting (without this flag) is always "
39427 #: ../tools/virt-win-reg.pl:173
39428 msgid "B<--encoding> UTF-16LE|ASCII"
39432 #: ../tools/virt-win-reg.pl:175
39434 "When merging (only), you may need to specify the encoding for strings to be "
39435 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
39436 "(3)/ENCODING STRINGS>."
39440 #: ../tools/virt-win-reg.pl:179
39442 "The default is to use UTF-16LE, which should work with recent versions of "
39447 #: ../tools/virt-win-reg.pl:186
39448 msgid "B<--unsafe-printable-strings>"
39452 #: ../tools/virt-win-reg.pl:188
39454 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39455 "instead of hex sequences. Remove the final zero codepoint from strings if "
39460 #: ../tools/virt-win-reg.pl:192
39462 "This is unsafe and does not preserve the fidelity of strings in the original "
39463 "Registry for various reasons:"
39467 #: ../tools/virt-win-reg.pl:199
39469 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39470 "other encodings will be corrupted by this transformation."
39474 #: ../tools/virt-win-reg.pl:204
39476 "Assumes that everything which has type 1 or 2 is really a string and that "
39477 "everything else is not a string, but the type field in real Registries is "
39482 #: ../tools/virt-win-reg.pl:210
39484 "Loses information about whether a zero codepoint followed the string in the "
39489 #: ../tools/virt-win-reg.pl:215
39491 "This all happens because the Registry itself contains no information about "
39492 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39496 #: ../tools/virt-win-reg.pl:219
39498 "You should only use this option for quick hacking and debugging of the "
39499 "Registry contents, and I<never> use it if the output is going to be passed "
39500 "into another program or stored in another Registry."
39504 #: ../tools/virt-win-reg.pl:556
39505 msgid "SUPPORTED SYSTEMS"
39509 #: ../tools/virt-win-reg.pl:558
39511 "The program currently supports Windows NT-derived guests starting with "
39512 "Windows XP through to at least Windows 7."
39516 #: ../tools/virt-win-reg.pl:561
39517 msgid "The following Registry keys are supported:"
39521 #: ../tools/virt-win-reg.pl:565
39522 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39526 #: ../tools/virt-win-reg.pl:567
39527 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39531 #: ../tools/virt-win-reg.pl:569
39532 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39536 #: ../tools/virt-win-reg.pl:571
39537 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39541 #: ../tools/virt-win-reg.pl:573
39542 msgid "C<HKEY_USERS\\.DEFAULT>"
39546 #: ../tools/virt-win-reg.pl:575
39547 msgid "C<HKEY_USERS\\I<SID>>"
39551 #: ../tools/virt-win-reg.pl:577
39552 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
39556 #: ../tools/virt-win-reg.pl:579
39557 msgid "C<HKEY_USERS\\I<username>>"
39561 #: ../tools/virt-win-reg.pl:581
39563 "where I<username> is a local user name (this is a libguestfs extension)."
39567 #: ../tools/virt-win-reg.pl:585
39569 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
39574 #: ../tools/virt-win-reg.pl:588
39576 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
39577 "supported (there is no \"current user\")."
39581 #: ../tools/virt-win-reg.pl:591
39586 #: ../tools/virt-win-reg.pl:593
39588 "C<virt-win-reg> expects that regedit files have already been reencoded in "
39589 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
39590 "style line endings. Since Windows regedit files are often in UTF-16LE with "
39591 "Windows-style line endings, you may need to reencode the whole file before "
39592 "or after processing."
39596 #: ../tools/virt-win-reg.pl:599
39598 "To reencode a file from Windows format to Linux (before processing it with "
39599 "the I<--merge> option), you would do something like this:"
39603 #: ../tools/virt-win-reg.pl:602
39606 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
39611 #: ../tools/virt-win-reg.pl:604
39613 "To go in the opposite direction, after exporting and before sending the file "
39614 "to a Windows user, do something like this:"
39618 #: ../tools/virt-win-reg.pl:607
39621 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
39626 #: ../tools/virt-win-reg.pl:609
39627 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
39631 #: ../tools/virt-win-reg.pl:611
39633 "If you are unsure about the current encoding, use the L<file(1)> command. "
39634 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
39635 "style (CRLF) line endings, like this:"
39639 #: ../tools/virt-win-reg.pl:615
39642 " $ file software.reg\n"
39643 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
39644 " with CRLF line terminators\n"
39649 #: ../tools/virt-win-reg.pl:619
39650 msgid "This file would need conversion before you could I<--merge> it."
39654 #: ../tools/virt-win-reg.pl:621
39655 msgid "CurrentControlSet etc."
39659 #: ../tools/virt-win-reg.pl:623
39661 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
39662 "Registry at the level of the hive file, and therefore you cannot modify "
39667 #: ../tools/virt-win-reg.pl:627
39669 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
39670 "circumstances it might refer to another control set. The way to find out is "
39671 "to look at the C<HKLM\\SYSTEM\\Select> key:"
39675 #: ../tools/virt-win-reg.pl:631
39678 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
39679 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
39680 " \"Current\"=dword:00000001\n"
39681 " \"Default\"=dword:00000001\n"
39682 " \"Failed\"=dword:00000000\n"
39683 " \"LastKnownGood\"=dword:00000002\n"
39688 #: ../tools/virt-win-reg.pl:638
39689 msgid "\"Current\" is the one which Windows will choose when it boots."
39693 #: ../tools/virt-win-reg.pl:640
39695 "Similarly, other C<Current...> keys in the path may need to be replaced."
39699 #: ../tools/virt-win-reg.pl:643
39700 msgid "WINDOWS TIPS"
39704 #: ../tools/virt-win-reg.pl:645
39706 "Note that some of these tips modify the guest disk image. The guest I<must> "
39707 "be shut off, else you will get disk corruption."
39711 #: ../tools/virt-win-reg.pl:648
39712 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
39716 #: ../tools/virt-win-reg.pl:650
39718 "Prepare a DOS batch script, VBScript or executable. Upload this using "
39719 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
39720 "is uploaded into C<C:\\>:"
39724 #: ../tools/virt-win-reg.pl:654
39727 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
39732 #: ../tools/virt-win-reg.pl:656
39733 msgid "Prepare a regedit file containing the registry change:"
39737 #: ../tools/virt-win-reg.pl:658
39740 " cat > test.reg <<'EOF'\n"
39741 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
39742 " \"Test\"=\"c:\\\\test.bat\"\n"
39748 #: ../tools/virt-win-reg.pl:663
39750 "In this example we use the key C<RunOnce> which means that the script will "
39751 "run precisely once when the first user logs in. If you want it to run every "
39752 "time a user logs in, replace C<RunOnce> with C<Run>."
39756 #: ../tools/virt-win-reg.pl:667
39757 msgid "Now update the registry:"
39761 #: ../tools/virt-win-reg.pl:669
39764 " virt-win-reg --merge WindowsGuest test.reg\n"
39769 #: ../tools/virt-win-reg.pl:671
39770 msgid "INSTALLING A SERVICE"
39774 #: ../tools/virt-win-reg.pl:673
39776 "This section assumes you are familiar with Windows services, and you either "
39777 "have a program which handles the Windows Service Control Protocol directly "
39778 "or you want to run any program using a service wrapper like SrvAny or the "
39783 #: ../tools/virt-win-reg.pl:678
39785 "First upload the program and optionally the service wrapper. In this case "
39786 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
39790 #: ../tools/virt-win-reg.pl:682
39793 " guestfish -i -d WindowsGuest <<EOF\n"
39794 " upload rhsrvany.exe /rhsrvany.exe\n"
39795 " upload test.exe /test.exe\n"
39801 #: ../tools/virt-win-reg.pl:687
39803 "Prepare a regedit file containing the registry changes. In this example, "
39804 "the first registry change is needed for the service itself or the service "
39805 "wrapper (if used). The second registry change is only needed because I am "
39806 "using the RHSrvAny service wrapper."
39810 #: ../tools/virt-win-reg.pl:692
39813 " cat > service.reg <<'EOF'\n"
39814 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
39815 " \"Type\"=dword:00000010\n"
39816 " \"Start\"=dword:00000002\n"
39817 " \"ErrorControl\"=dword:00000001\n"
39818 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
39819 " \"DisplayName\"=\"RHSrvAny\"\n"
39820 " \"ObjectName\"=\"NetworkService\"\n"
39825 #: ../tools/virt-win-reg.pl:701
39828 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
39829 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
39830 " \"PWD\"=\"c:\\\\Temp\"\n"
39836 #: ../tools/virt-win-reg.pl:712
39838 "For use of C<ControlSet001> see the section above in this manual page. You "
39839 "may need to adjust this according to the control set that is in use by the "
39844 #: ../tools/virt-win-reg.pl:718
39846 "C<\"ObjectName\"> controls the privileges that the service will have. An "
39847 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
39848 "privileged account."
39852 #: ../tools/virt-win-reg.pl:724
39854 "For the meaning of the magic numbers, see this Microsoft KB article: "
39855 "L<http://support.microsoft.com/kb/103000>."
39859 #: ../tools/virt-win-reg.pl:729
39860 msgid "Update the registry:"
39864 #: ../tools/virt-win-reg.pl:731
39867 " virt-win-reg --merge WindowsGuest service.reg\n"
39872 #: ../tools/virt-win-reg.pl:735
39874 "Be careful when passing parameters containing C<\\> (backslash) in the "
39875 "shell. Usually you will have to use 'single quotes' or double backslashes "
39876 "(but not both) to protect them from the shell."
39880 #: ../tools/virt-win-reg.pl:739
39881 msgid "Paths and value names are case-insensitive."
39885 #: ../tools/virt-win-reg.pl:748
39887 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
39888 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
39889 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39893 #: ../tools/virt-win-reg.pl:766
39896 " export LIBGUESTFS_DEBUG=1\n"
39897 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
39902 #: ../tools/virt-win-reg.pl:769
39904 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."