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-04 19:22+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 #: ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3
23 #: ../df/virt-df.pod:3 ../edit/virt-edit.pod:3
24 #: ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3
25 #: ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3
26 #: ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3
27 #: ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3
28 #: ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3
29 #: ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3
30 #: ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3
31 #: ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3
32 #: ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3
33 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
34 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
35 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
36 #: ../tools/virt-win-reg.pl:35
41 #: ../cat/virt-cat.pod:5
42 msgid "virt-cat - Display files in a virtual machine"
46 #: ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
47 #: ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
48 #: ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7
49 #: ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7
50 #: ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7
51 #: ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7
52 #: ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7
53 #: ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7
54 #: ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7
55 #: ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7
56 #: ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7
57 #: ../test-tool/libguestfs-test-tool.pod:7
58 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
59 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
60 #: ../tools/virt-win-reg.pl:39
65 #: ../cat/virt-cat.pod:9
68 " virt-cat [--options] -d domname file [file ...]\n"
73 #: ../cat/virt-cat.pod:11
76 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
81 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
82 #: ../inspector/virt-inspector.pod:13
87 #: ../cat/virt-cat.pod:15
90 " virt-cat domname file\n"
95 #: ../cat/virt-cat.pod:17
98 " virt-cat disk.img file\n"
103 #: ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
104 #: ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
105 #: ../erlang/examples/guestfs-erlang.pod:16
106 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
107 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
108 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
109 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
110 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
111 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
112 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
113 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
114 #: ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23
115 #: ../test-tool/libguestfs-test-tool.pod:11
116 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
117 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
118 #: ../tools/virt-win-reg.pl:63
123 #: ../cat/virt-cat.pod:21
125 "C<virt-cat> is a command line tool to display the contents of C<file> where "
126 "C<file> exists in the named virtual machine (or disk image)."
130 #: ../cat/virt-cat.pod:24
132 "Multiple filenames can be given, in which case they are concatenated "
133 "together. Each filename must be a full path, starting at the root directory "
134 "(starting with '/')."
138 #: ../cat/virt-cat.pod:28
140 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
141 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
142 "(see L</USING GUESTFISH> below)."
146 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
147 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
148 #: ../fish/guestfish.pod:1018 ../fish/virt-copy-in.pod:29
149 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
150 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
151 #: ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75
152 #: ../tools/virt-tar.pl:50
157 #: ../cat/virt-cat.pod:34
159 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
163 #: ../cat/virt-cat.pod:37
166 " virt-cat -d mydomain /etc/fstab\n"
171 #: ../cat/virt-cat.pod:39
172 msgid "List syslog messages from a VM disk image file:"
176 #: ../cat/virt-cat.pod:41
179 " virt-cat -a disk.img /var/log/messages | tail\n"
184 #: ../cat/virt-cat.pod:43
185 msgid "Find out what DHCP IP address a VM acquired:"
189 #: ../cat/virt-cat.pod:45
192 " virt-cat -d mydomain /var/log/messages | \\\n"
193 " grep 'dhclient: bound to' | tail\n"
198 #: ../cat/virt-cat.pod:48
199 msgid "Find out what packages were recently installed:"
203 #: ../cat/virt-cat.pod:50
206 " virt-cat -d mydomain /var/log/yum.log | tail\n"
211 #: ../cat/virt-cat.pod:52
212 msgid "Find out who is logged on inside a virtual machine:"
216 #: ../cat/virt-cat.pod:54
219 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
225 #: ../cat/virt-cat.pod:57
226 msgid "or who was logged on:"
230 #: ../cat/virt-cat.pod:59
233 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
234 " last -f /tmp/wtmp\n"
239 #: ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91
240 #: ../cat/virt-ls.pod:261 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
241 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
242 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
243 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83
244 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
245 #: ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99
246 #: ../test-tool/libguestfs-test-tool.pod:36
247 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
248 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
249 #: ../tools/virt-win-reg.pl:96
254 #: ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95
255 #: ../cat/virt-ls.pod:265 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
256 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151
257 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
258 #: ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103
259 #: ../test-tool/libguestfs-test-tool.pod:40
260 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62
261 #: ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111
262 #: ../tools/virt-win-reg.pl:104
267 #: ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97
268 #: ../cat/virt-ls.pod:267 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
269 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
270 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
271 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
272 #: ../tools/virt-win-reg.pl:106
273 msgid "Display brief help."
277 #: ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99
278 #: ../cat/virt-ls.pod:269 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
279 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
284 #: ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101
285 #: ../cat/virt-ls.pod:271 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
286 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
287 msgid "B<--add> file"
291 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
292 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
293 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
295 "Add I<file> which should be a disk image from a virtual machine. If the "
296 "virtual machine has multiple block devices, you must supply all of them with "
297 "separate I<-a> options."
301 #: ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107
302 #: ../cat/virt-ls.pod:277 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
303 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93
304 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
306 "The format of the disk image is auto-detected. To override this and force a "
307 "particular format use the I<--format=..> option."
311 #: ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125
312 #: ../cat/virt-ls.pod:291 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
317 #: ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127
318 #: ../cat/virt-ls.pod:293 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
319 msgid "B<--connect> URI"
323 #: ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129
324 #: ../cat/virt-ls.pod:295 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
325 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
326 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
327 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
329 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
330 "to the default libvirt hypervisor."
334 #: ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132
335 #: ../cat/virt-ls.pod:298 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
337 "If you specify guest block devices directly (I<-a>), then libvirt is not "
342 #: ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141
343 #: ../cat/virt-ls.pod:307 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
344 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
349 #: ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143
350 #: ../cat/virt-ls.pod:309 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
351 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
352 msgid "B<--domain> guest"
356 #: ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145
357 #: ../cat/virt-ls.pod:311 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
358 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
360 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
365 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
366 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
367 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
368 msgid "B<--echo-keys>"
372 #: ../cat/virt-cat.pod:100
374 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
375 "so you cannot see what you are typing. If you are not worried about Tempest "
376 "attacks and there is no one else in the room you can specify this flag to "
377 "see what you are typing."
381 #: ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170
382 #: ../cat/virt-ls.pod:328 ../df/virt-df.pod:101 ../fish/guestfish.pod:233
383 #: ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99
384 #: ../rescue/virt-rescue.pod:124
385 msgid "B<--format=raw|qcow2|..>"
389 #: ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172
390 #: ../cat/virt-ls.pod:330 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134
391 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135
392 #: ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
397 #: ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174
398 #: ../cat/virt-ls.pod:332 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136
399 #: ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137
400 #: ../rescue/virt-rescue.pod:128
402 "The default for the I<-a> option is to auto-detect the format of the disk "
403 "image. Using this forces the disk format for I<-a> options which follow on "
404 "the command line. Using I<--format> with no argument switches back to auto-"
405 "detection for subsequent I<-a> options."
409 #: ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179
410 #: ../cat/virt-ls.pod:337 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141
411 #: ../fish/guestfish.pod:242 ../fish/guestfish.pod:673
412 #: ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133
413 #: ../src/guestfs.pod:2791
418 #: ../cat/virt-cat.pod:116
421 " virt-cat --format=raw -a disk.img file\n"
426 #: ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183
427 #: ../cat/virt-ls.pod:341 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145
428 #: ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
429 msgid "forces raw format (no auto-detection) for C<disk.img>."
433 #: ../cat/virt-cat.pod:120
436 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
441 #: ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187
442 #: ../cat/virt-ls.pod:345 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149
443 #: ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
445 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
446 "detection for C<another.img>."
450 #: ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190
451 #: ../cat/virt-ls.pod:348 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152
452 #: ../rescue/virt-rescue.pod:144
454 "If you have untrusted raw-format guest disk images, you should use this "
455 "option to specify the disk format. This avoids a possible security problem "
456 "with malicious guests (CVE-2010-3851)."
460 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
461 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
462 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
463 msgid "B<--keys-from-stdin>"
467 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
468 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
469 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
471 "Read key or passphrase parameters from stdin. The default is to try to read "
472 "passphrases from the user by opening C</dev/tty>."
476 #: ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261
477 #: ../cat/virt-ls.pod:425 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161
478 #: ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257
479 #: ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:182
480 #: ../sparsify/virt-sparsify.pod:159
485 #: ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263
486 #: ../cat/virt-ls.pod:427 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163
487 #: ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259
488 #: ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:184
489 #: ../sparsify/virt-sparsify.pod:161
494 #: ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265
495 #: ../cat/virt-ls.pod:429 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165
496 #: ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186
497 #: ../sparsify/virt-sparsify.pod:163
498 msgid "Enable verbose messages for debugging."
502 #: ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267
503 #: ../cat/virt-ls.pod:431 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167
504 #: ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263
505 #: ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:188
506 #: ../resize/virt-resize.pod:484 ../sparsify/virt-sparsify.pod:165
511 #: ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269
512 #: ../cat/virt-ls.pod:433 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169
513 #: ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265
514 #: ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:190
515 #: ../resize/virt-resize.pod:486 ../sparsify/virt-sparsify.pod:167
516 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-list-partitions.pl:70
517 #: ../tools/virt-make-fs.pl:169 ../tools/virt-tar.pl:119
518 #: ../tools/virt-win-reg.pl:112
523 #: ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271
524 #: ../cat/virt-ls.pod:435 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171
525 #: ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192
526 #: ../resize/virt-resize.pod:488 ../sparsify/virt-sparsify.pod:169
527 #: ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72
528 #: ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121
529 #: ../tools/virt-win-reg.pl:114
530 msgid "Display version number and exit."
534 #: ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281
535 #: ../cat/virt-ls.pod:437 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173
536 #: ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278
537 #: ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:203
538 #: ../sparsify/virt-sparsify.pod:171 ../tools/virt-tar.pl:158
543 #: ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283
544 #: ../cat/virt-ls.pod:439 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175
545 #: ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205
546 #: ../sparsify/virt-sparsify.pod:173
547 msgid "Enable tracing of libguestfs API calls."
551 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
552 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
553 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
557 #: ../cat/virt-cat.pod:154
558 msgid "Previous versions of virt-cat allowed you to write either:"
562 #: ../cat/virt-cat.pod:156
565 " virt-cat disk.img [disk.img ...] file\n"
570 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
571 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
576 #: ../cat/virt-cat.pod:160
579 " virt-cat guestname file\n"
584 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
585 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
587 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
588 "the confusing case where a disk image might have the same name as a guest."
592 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
593 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
594 msgid "For compatibility the old style is still supported."
598 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
599 msgid "USING GUESTFISH"
603 #: ../cat/virt-cat.pod:170
605 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
606 "C<virt-cat> doesn't work."
610 #: ../cat/virt-cat.pod:173
611 msgid "Using C<virt-cat> is approximately equivalent to doing:"
615 #: ../cat/virt-cat.pod:175
618 " guestfish --ro -i -d domname download file -\n"
623 #: ../cat/virt-cat.pod:177
625 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
626 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
630 #: ../cat/virt-cat.pod:181
632 "The command above uses libguestfs's guest inspection feature and so does not "
633 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
634 "disk images that don't contain guests. To display a file from a disk image "
639 #: ../cat/virt-cat.pod:186
642 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
647 #: ../cat/virt-cat.pod:188
649 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
650 "the disk image, and C<file> is the full path to the file."
654 #: ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365
655 #: ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342
656 #: ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266
657 #: ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188
658 #: ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532
659 #: ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
660 msgid "SHELL QUOTING"
664 #: ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367
665 #: ../cat/virt-ls.pod:485 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344
666 #: ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268
667 #: ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190
668 #: ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534
669 #: ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
671 "Libvirt guest names can contain arbitrary characters, some of which have "
672 "meaning to the shell such as C<#> and space. You may need to quote or "
673 "escape these characters on the command line. See the shell manual page L<sh"
678 #: ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372
679 #: ../cat/virt-ls.pod:490 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349
680 #: ../fish/guestfish.pod:1081 ../fuse/guestmount.pod:303
681 #: ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:608
682 #: ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
687 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374
688 #: ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351
689 #: ../fuse/guestmount.pod:305 ../inspector/virt-inspector.pod:377
690 #: ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
692 "This program returns 0 if successful, or non-zero if there was an error."
696 #: ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377
697 #: ../cat/virt-ls.pod:495 ../df/virt-df.pod:227 ../edit/virt-edit.pod:354
698 #: ../erlang/examples/guestfs-erlang.pod:97
699 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
700 #: ../fish/guestfish.pod:1235 ../fish/virt-copy-in.pod:50
701 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
702 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308
703 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45
704 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
705 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288
706 #: ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36
707 #: ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3167
708 #: ../test-tool/libguestfs-test-tool.pod:100
709 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
710 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
711 #: ../tools/virt-win-reg.pl:746
716 #: ../cat/virt-cat.pod:205
718 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
719 "tar-out(1)>, L<http://libguestfs.org/>."
723 #: ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388
724 #: ../cat/virt-ls.pod:507 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368
725 #: ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:635
726 #: ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208
727 #: ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:564
728 #: ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:772
733 #: ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390
734 #: ../cat/virt-ls.pod:509 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370
735 #: ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298
736 #: ../resize/virt-resize.pod:637 ../sparsify/virt-sparsify.pod:266
737 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279
738 #: ../tools/virt-make-fs.pl:566 ../tools/virt-tar.pl:313
739 #: ../tools/virt-win-reg.pl:774
740 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
744 #: ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392
745 #: ../cat/virt-ls.pod:511 ../df/virt-df.pod:239 ../edit/virt-edit.pod:372
746 #: ../erlang/examples/guestfs-erlang.pod:114
747 #: ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401
748 #: ../fish/guestfish.pod:1265 ../fish/virt-copy-in.pod:64
749 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
750 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323
751 #: ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62
752 #: ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56
753 #: ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300
754 #: ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52
755 #: ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3246
756 #: ../test-tool/libguestfs-test-tool.pod:110
757 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
758 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
759 #: ../tools/virt-win-reg.pl:776
764 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405
765 #: ../resize/virt-resize.pod:641
766 msgid "Copyright (C) 2010-2011 Red Hat Inc."
770 #: ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396
771 #: ../cat/virt-ls.pod:515 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376
772 #: ../fish/guestfish.pod:1270 ../fish/virt-copy-in.pod:69
773 #: ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67
774 #: ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:328
775 #: ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:304
776 #: ../resize/virt-resize.pod:643 ../sparsify/virt-sparsify.pod:272
777 #: ../test-tool/libguestfs-test-tool.pod:115
778 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
779 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
780 #: ../tools/virt-win-reg.pl:780
782 "This program is free software; you can redistribute it and/or modify it "
783 "under the terms of the GNU General Public License as published by the Free "
784 "Software Foundation; either version 2 of the License, or (at your option) "
789 #: ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401
790 #: ../cat/virt-ls.pod:520 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381
791 #: ../fish/guestfish.pod:1275 ../fish/virt-copy-in.pod:74
792 #: ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72
793 #: ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:333
794 #: ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:309
795 #: ../resize/virt-resize.pod:648 ../sparsify/virt-sparsify.pod:277
796 #: ../test-tool/libguestfs-test-tool.pod:120
797 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
798 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
799 #: ../tools/virt-win-reg.pl:785
801 "This program is distributed in the hope that it will be useful, but WITHOUT "
802 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
803 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
808 #: ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406
809 #: ../cat/virt-ls.pod:525 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386
810 #: ../fish/guestfish.pod:1280 ../fish/virt-copy-in.pod:79
811 #: ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77
812 #: ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:338
813 #: ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:314
814 #: ../resize/virt-resize.pod:653 ../sparsify/virt-sparsify.pod:282
815 #: ../test-tool/libguestfs-test-tool.pod:125
816 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
817 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
818 #: ../tools/virt-win-reg.pl:790
820 "You should have received a copy of the GNU General Public License along with "
821 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
822 "Ave, Cambridge, MA 02139, USA."
826 #: ../cat/virt-filesystems.pod:5
828 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
829 "virtual machine or disk image"
833 #: ../cat/virt-filesystems.pod:9
836 " virt-filesystems [--options] -d domname\n"
841 #: ../cat/virt-filesystems.pod:11
844 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
849 #: ../cat/virt-filesystems.pod:15
851 "This tool allows you to discover filesystems, partitions, logical volumes, "
852 "and their sizes in a disk image or virtual machine. It is a replacement for "
853 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
857 #: ../cat/virt-filesystems.pod:20
859 "One use for this tool is from shell scripts to iterate over all filesystems "
864 #: ../cat/virt-filesystems.pod:23
867 " for fs in $(virt-filesystems -a disk.img); do\n"
874 #: ../cat/virt-filesystems.pod:27
876 "Another use is to list partitions before using another tool to modify those "
877 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
878 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
882 #: ../cat/virt-filesystems.pod:32
884 "Various command line options control what this program displays. You need "
885 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
886 "guest respectively. If you just specify that then the program shows "
887 "filesystems found, one per line, like this:"
891 #: ../cat/virt-filesystems.pod:37
894 " $ virt-filesystems -a disk.img\n"
896 " /dev/vg_guest/lv_root\n"
901 #: ../cat/virt-filesystems.pod:41
903 "If you add I<-l> or I<--long> then the output includes extra information:"
907 #: ../cat/virt-filesystems.pod:44
910 " $ virt-filesystems -a disk.img -l\n"
911 " Name Type VFS Label Size\n"
912 " /dev/sda1 filesystem ext4 boot 524288000\n"
913 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
918 #: ../cat/virt-filesystems.pod:49
920 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
925 #: ../cat/virt-filesystems.pod:52
928 " $ virt-filesystems -a disk.img --extra\n"
930 " /dev/vg_guest/lv_root\n"
931 " /dev/vg_guest/lv_swap\n"
932 " /dev/vg_guest/lv_data\n"
937 #: ../cat/virt-filesystems.pod:58
939 "If you add I<--partitions> then partitions are shown instead of filesystems:"
943 #: ../cat/virt-filesystems.pod:60
946 " $ virt-filesystems -a disk.img --partitions\n"
953 #: ../cat/virt-filesystems.pod:64
955 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
956 "volumes>, I<--block-devices> to list those items."
960 #: ../cat/virt-filesystems.pod:67
962 "You can use these options in combination as well (if you want a combination "
963 "including filesystems, you have to add I<--filesystems>). Notice that some "
964 "items fall into several categories (eg. C</dev/sda1> might be both a "
965 "partition and a filesystem). These items are listed several times. To get "
966 "a list which includes absolutely everything that virt-filesystems knows "
967 "about, use the I<--all> option."
971 #: ../cat/virt-filesystems.pod:74
973 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
974 "uuid> option to display device and filesystem UUIDs in the long output."
978 #: ../cat/virt-filesystems.pod:78
980 "I<--all --long --uuid> is a useful combination to display all possible "
981 "information about everything."
985 #: ../cat/virt-filesystems.pod:81
988 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
989 " Name Type VFS Label Size Parent UUID\n"
990 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
991 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
992 " /dev/sda1 partition - - 100M /dev/sda -\n"
993 " /dev/sda2 partition - - 20G /dev/sda -\n"
994 " /dev/sda device - - 20G - -\n"
999 #: ../cat/virt-filesystems.pod:89
1001 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1005 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1010 #: ../cat/virt-filesystems.pod:112
1012 "Display everything. This is currently the same as specifying these options: "
1013 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
1014 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
1015 "added to this list in future)."
1019 #: ../cat/virt-filesystems.pod:117
1020 msgid "See also I<--long>."
1024 #: ../cat/virt-filesystems.pod:119
1025 msgid "B<--blkdevs>"
1029 #: ../cat/virt-filesystems.pod:121
1030 msgid "B<--block-devices>"
1034 #: ../cat/virt-filesystems.pod:123
1035 msgid "Display block devices."
1039 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1044 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1046 "Write out the results in CSV format (comma-separated values). This format "
1047 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1048 "ABOUT CSV FORMAT> below."
1052 #: ../cat/virt-filesystems.pod:150
1054 "When prompting for keys and passphrases, virt-filesystems normally turns "
1055 "echoing off so you cannot see what you are typing. If you are not worried "
1056 "about Tempest attacks and there is no one else in the room you can specify "
1057 "this flag to see what you are typing."
1061 #: ../cat/virt-filesystems.pod:155
1066 #: ../cat/virt-filesystems.pod:157
1068 "This causes filesystems that are not ordinary, mountable filesystems to be "
1069 "displayed. This category includes swapspace, and filesystems that are empty "
1070 "or contain unknown data."
1074 #: ../cat/virt-filesystems.pod:161
1075 msgid "This option implies I<--filesystems>."
1079 #: ../cat/virt-filesystems.pod:163
1080 msgid "B<--filesystems>"
1084 #: ../cat/virt-filesystems.pod:165
1086 "Display mountable filesystems. If no display option was selected then this "
1087 "option is implied."
1091 #: ../cat/virt-filesystems.pod:168
1092 msgid "With I<--extra>, non-mountable filesystems are shown too."
1096 #: ../cat/virt-filesystems.pod:181
1099 " virt-filesystems --format=raw -a disk.img\n"
1104 #: ../cat/virt-filesystems.pod:185
1107 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1112 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1113 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1114 #: ../tools/virt-list-partitions.pl:109
1119 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1120 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1121 msgid "B<--human-readable>"
1125 #: ../cat/virt-filesystems.pod:198
1126 msgid "In I<--long> mode, display sizes in human-readable format."
1130 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1131 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1136 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1137 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1142 #: ../cat/virt-filesystems.pod:209
1143 msgid "Display extra columns of data (\"long format\")."
1147 #: ../cat/virt-filesystems.pod:211
1148 msgid "A title row is added unless you also specify I<--no-title>."
1152 #: ../cat/virt-filesystems.pod:213
1154 "The extra columns displayed depend on what output you select, and the "
1155 "ordering of columns may change in future versions. Use the title row, I<--"
1156 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1161 #: ../cat/virt-filesystems.pod:218
1163 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1164 "default is to show raw numbers of I<bytes>."
1168 #: ../cat/virt-filesystems.pod:221
1169 msgid "Use I<--uuid> to display UUIDs too."
1173 #: ../cat/virt-filesystems.pod:223
1178 #: ../cat/virt-filesystems.pod:225
1179 msgid "B<--logvols>"
1183 #: ../cat/virt-filesystems.pod:227
1184 msgid "B<--logical-volumes>"
1188 #: ../cat/virt-filesystems.pod:229
1190 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1191 "of whether the LVs contain filesystems."
1195 #: ../cat/virt-filesystems.pod:232
1196 msgid "B<--no-title>"
1200 #: ../cat/virt-filesystems.pod:234
1201 msgid "In I<--long> mode, don't add a title row."
1205 #: ../cat/virt-filesystems.pod:236
1207 "Note that the order of the columns is not fixed, and may change in future "
1208 "versions of virt-filesystems, so using this option may give you unexpected "
1213 #: ../cat/virt-filesystems.pod:240
1218 #: ../cat/virt-filesystems.pod:242
1219 msgid "B<--partitions>"
1223 #: ../cat/virt-filesystems.pod:244
1225 "Display partitions. In this mode, these are displayed irrespective of "
1226 "whether the partitions contain filesystems."
1230 #: ../cat/virt-filesystems.pod:247
1235 #: ../cat/virt-filesystems.pod:249
1236 msgid "B<--physvols>"
1240 #: ../cat/virt-filesystems.pod:251
1241 msgid "B<--physical-volumes>"
1245 #: ../cat/virt-filesystems.pod:253
1246 msgid "Display LVM physical volumes."
1250 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1255 #: ../cat/virt-filesystems.pod:257
1260 #: ../cat/virt-filesystems.pod:259
1261 msgid "In I<--long> mode, display UUIDs as well."
1265 #: ../cat/virt-filesystems.pod:273
1270 #: ../cat/virt-filesystems.pod:275
1271 msgid "B<--volgroups>"
1275 #: ../cat/virt-filesystems.pod:277
1276 msgid "B<--volume-groups>"
1280 #: ../cat/virt-filesystems.pod:279
1281 msgid "Display LVM volume groups."
1285 #: ../cat/virt-filesystems.pod:287
1290 #: ../cat/virt-filesystems.pod:289
1292 "Note that columns in the output are subject to reordering and change in "
1293 "future versions of this tool."
1297 #: ../cat/virt-filesystems.pod:294
1302 #: ../cat/virt-filesystems.pod:296
1303 msgid "The filesystem, partition, block device or LVM name."
1307 #: ../cat/virt-filesystems.pod:298
1309 "For device and partition names these are displayed as canonical libguestfs "
1310 "names, so that for example C</dev/sda2> is the second partition on the first "
1315 #: ../cat/virt-filesystems.pod:302
1317 "If the I<--long> option is B<not> specified, then only the name column is "
1318 "shown in the output."
1322 #: ../cat/virt-filesystems.pod:305
1327 #: ../cat/virt-filesystems.pod:307
1328 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1332 #: ../cat/virt-filesystems.pod:309
1337 #: ../cat/virt-filesystems.pod:311
1339 "If there is a filesystem, then this column displays the filesystem type if "
1340 "one could be detected, eg. C<ext4>."
1344 #: ../cat/virt-filesystems.pod:314
1349 #: ../cat/virt-filesystems.pod:316
1351 "If the object has a label (used for identifying and mounting filesystems) "
1352 "then this column contains the label."
1356 #: ../cat/virt-filesystems.pod:319
1361 #: ../cat/virt-filesystems.pod:321
1363 "The size of the object in bytes. If the I<--human> option is used then the "
1364 "size is displayed in a human-readable form."
1368 #: ../cat/virt-filesystems.pod:324
1373 #: ../cat/virt-filesystems.pod:326
1375 "The parent column records the parent relationship between objects. For "
1376 "example, if the object is a partition, then this column contains the name of "
1377 "the containing device. If the object is a logical volume, then this column "
1378 "is the name of the volume group."
1382 #: ../cat/virt-filesystems.pod:331
1387 #: ../cat/virt-filesystems.pod:333
1389 "If the object has a UUID (used for identifying and mounting filesystems and "
1390 "block devices) then this column contains the UUID as a string."
1394 #: ../cat/virt-filesystems.pod:337
1395 msgid "The UUID is only displayed if the I<--uuid> option is given."
1399 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
1400 #: ../df/virt-df.pod:191
1401 msgid "NOTE ABOUT CSV FORMAT"
1405 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
1406 #: ../df/virt-df.pod:193
1408 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1409 "should be easy to parse, but it is definitely not easy to parse."
1413 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
1414 #: ../df/virt-df.pod:196
1416 "Myth: Just split fields at commas. Reality: This does I<not> work "
1417 "reliably. This example has two columns:"
1421 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
1422 #: ../df/virt-df.pod:199
1425 " \"foo,bar\",baz\n"
1430 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
1431 #: ../df/virt-df.pod:201
1433 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1434 "reliably. This example has one row:"
1438 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
1439 #: ../df/virt-df.pod:204
1448 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
1449 #: ../df/virt-df.pod:207
1451 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1452 "packaged in major Linux distributions)."
1456 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
1457 #: ../df/virt-df.pod:210
1459 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1460 "or Python's built-in csv library)."
1464 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
1465 #: ../df/virt-df.pod:213
1466 msgid "Most spreadsheets and databases can import CSV directly."
1470 #: ../cat/virt-filesystems.pod:379
1472 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
1473 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
1478 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570
1479 #: ../tools/virt-win-reg.pl:778
1480 msgid "Copyright (C) 2010 Red Hat Inc."
1484 #: ../cat/virt-ls.pod:5
1485 msgid "virt-ls - List files in a virtual machine"
1489 #: ../cat/virt-ls.pod:9
1492 " virt-ls [--options] -d domname directory [directory ...]\n"
1497 #: ../cat/virt-ls.pod:11
1500 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
1505 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1510 #: ../cat/virt-ls.pod:15
1513 " virt-ls [--options] domname directory\n"
1518 #: ../cat/virt-ls.pod:17
1521 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1526 #: ../cat/virt-ls.pod:21
1528 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1529 "more from a virtual machine or disk image."
1533 #: ../cat/virt-ls.pod:24
1535 "Multiple directory names can be given, in which case the output from each is "
1540 #: ../cat/virt-ls.pod:27
1542 "To list directories from a libvirt guest use the I<-d> option to specify the "
1543 "name of the guest. For a disk image, use the I<-a> option."
1547 #: ../cat/virt-ls.pod:31
1549 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1550 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
1555 #: ../cat/virt-ls.pod:37
1556 msgid "Get a list of all files and directories in a virtual machine:"
1560 #: ../cat/virt-ls.pod:39
1563 " virt-ls -R -d guest /\n"
1568 #: ../cat/virt-ls.pod:41
1569 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1573 #: ../cat/virt-ls.pod:43
1576 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1581 #: ../cat/virt-ls.pod:45
1582 msgid "List all public-writable directories in a Linux virtual machine:"
1586 #: ../cat/virt-ls.pod:47
1589 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1594 #: ../cat/virt-ls.pod:49
1595 msgid "List all Unix domain sockets in a Linux virtual machine:"
1599 #: ../cat/virt-ls.pod:51
1602 " virt-ls -lR -d guest / | grep '^s'\n"
1607 #: ../cat/virt-ls.pod:53
1608 msgid "List all regular files with filenames ending in '.png':"
1612 #: ../cat/virt-ls.pod:55
1615 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1620 #: ../cat/virt-ls.pod:57
1621 msgid "To display files larger than 10MB in home directories:"
1625 #: ../cat/virt-ls.pod:59
1628 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1633 #: ../cat/virt-ls.pod:61
1634 msgid "Find everything modified in the last 7 days:"
1638 #: ../cat/virt-ls.pod:63
1641 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1646 #: ../cat/virt-ls.pod:65
1647 msgid "Find regular files modified in the last 24 hours:"
1651 #: ../cat/virt-ls.pod:67
1654 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1659 #: ../cat/virt-ls.pod:69
1660 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1664 #: ../cat/virt-ls.pod:71
1666 "Find the differences between files in a guest and an earlier snapshot of the "
1671 #: ../cat/virt-ls.pod:74
1674 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1675 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1676 " diff -u old new | less\n"
1681 #: ../cat/virt-ls.pod:78
1683 "The commands above won't find files where the content has changed but the "
1684 "metadata (eg. file size and modification date) is the same. To do that, you "
1685 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
1686 "checksum> can be quite slow since it has to read and compute a checksum of "
1687 "every regular file in the virtual machine."
1691 #: ../cat/virt-ls.pod:84
1692 msgid "OUTPUT MODES"
1696 #: ../cat/virt-ls.pod:86
1698 "C<virt-ls> has four output modes, controlled by different combinations of "
1699 "the I<-l> and I<-R> options."
1703 #: ../cat/virt-ls.pod:89
1704 msgid "SIMPLE LISTING"
1708 #: ../cat/virt-ls.pod:91
1709 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1713 #: ../cat/virt-ls.pod:93
1716 " $ virt-ls -d guest /\n"
1724 #: ../cat/virt-ls.pod:98
1725 msgid "LONG LISTING"
1729 #: ../cat/virt-ls.pod:100
1731 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1732 "(more specifically, like the C<guestfs_ll> function)."
1736 #: ../cat/virt-ls.pod:103
1739 " $ virt-ls -l -d guest /\n"
1741 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1742 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
1748 #: ../cat/virt-ls.pod:109
1750 "Note that while this is useful for displaying a directory, do not try "
1751 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
1756 #: ../cat/virt-ls.pod:113
1757 msgid "RECURSIVE LISTING"
1761 #: ../cat/virt-ls.pod:115
1763 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
1764 "and directories recursively:"
1768 #: ../cat/virt-ls.pod:118
1771 " $ virt-ls -R -d guest /tmp\n"
1779 #: ../cat/virt-ls.pod:123
1781 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
1782 "converts C<\\0> characters to C<\\n>."
1786 #: ../cat/virt-ls.pod:126
1787 msgid "RECURSIVE LONG LISTING"
1791 #: ../cat/virt-ls.pod:128
1793 "Using I<-lR> options together changes the output to display directories "
1794 "recursively, with file stats, and optionally other features such as "
1795 "checksums and extended attributes."
1799 #: ../cat/virt-ls.pod:132
1801 "Most of the interesting features of C<virt-ls> are only available when using "
1806 #: ../cat/virt-ls.pod:135
1808 "The fields are normally space-separated. Filenames are B<not> quoted, so "
1809 "you cannot use the output in another program (because filenames can contain "
1810 "spaces and other unsafe characters). If the guest was untrusted and someone "
1811 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
1812 "on you by creating filenames with embedded newline characters. To B<safely> "
1813 "parse the output in another program, use the I<--csv> (Comma-Separated "
1818 #: ../cat/virt-ls.pod:143
1820 "Note that this output format is completely unrelated to the C<ls -lR> "
1825 #: ../cat/virt-ls.pod:146
1828 " $ virt-ls -lR -d guest /bin\n"
1829 " d 0555 4096 /bin\n"
1830 " - 0755 123 /bin/alsaunmute\n"
1831 " - 0755 28328 /bin/arch\n"
1832 " l 0777 4 /bin/awk -> gawk\n"
1833 " - 0755 27216 /bin/basename\n"
1834 " - 0755 943360 /bin/bash\n"
1840 #: ../cat/virt-ls.pod:155
1841 msgid "These basic fields are always shown:"
1845 #: ../cat/virt-ls.pod:159
1850 #: ../cat/virt-ls.pod:161
1852 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
1853 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
1854 "link), C<s> (socket) or C<u> (unknown)."
1858 #: ../cat/virt-ls.pod:171
1863 #: ../cat/virt-ls.pod:173
1864 msgid "The Unix permissions, displayed as a 4 digit octal number."
1868 #: ../cat/virt-ls.pod:175
1873 #: ../cat/virt-ls.pod:177
1875 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
1876 "readable> option is given, in which case this is shown as a human-readable "
1881 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4245
1886 #: ../cat/virt-ls.pod:183
1887 msgid "The full path of the file or directory."
1891 #: ../cat/virt-ls.pod:185
1896 #: ../cat/virt-ls.pod:187
1897 msgid "For symbolic links only, the link target."
1901 #: ../cat/virt-ls.pod:191
1903 "In I<-lR> mode, additional command line options enable the display of more "
1908 #: ../cat/virt-ls.pod:194
1910 "With the I<--uids> flag, these additional fields are displayed before the "
1915 #: ../cat/virt-ls.pod:199
1920 #: ../cat/virt-ls.pod:201
1925 #: ../cat/virt-ls.pod:203
1927 "The UID and GID of the owner of the file (displayed numerically). Note "
1928 "these only make sense in the context of a Unix-like guest."
1932 #: ../cat/virt-ls.pod:208
1933 msgid "With the I<--times> flag, these additional fields are displayed:"
1937 #: ../cat/virt-ls.pod:212
1942 #: ../cat/virt-ls.pod:214
1943 msgid "The time of last access."
1947 #: ../cat/virt-ls.pod:216
1952 #: ../cat/virt-ls.pod:218
1953 msgid "The time of last modification."
1957 #: ../cat/virt-ls.pod:220
1962 #: ../cat/virt-ls.pod:222
1963 msgid "The time of last status change."
1967 #: ../cat/virt-ls.pod:226
1969 "The time fields are displayed as string dates and times, unless one of the "
1970 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
1974 #: ../cat/virt-ls.pod:229
1975 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
1979 #: ../cat/virt-ls.pod:233
1984 #: ../cat/virt-ls.pod:235
1986 "The device containing the file (displayed as major:minor). This may not "
1987 "match devices as known to the guest."
1991 #: ../cat/virt-ls.pod:238
1996 #: ../cat/virt-ls.pod:240
1997 msgid "The inode number."
2001 #: ../cat/virt-ls.pod:242
2006 #: ../cat/virt-ls.pod:244
2007 msgid "The number of hard links."
2011 #: ../cat/virt-ls.pod:246
2016 #: ../cat/virt-ls.pod:248
2018 "For block and char special files, the device (displayed as major:minor)."
2022 #: ../cat/virt-ls.pod:251
2027 #: ../cat/virt-ls.pod:253
2028 msgid "The number of 512 byte blocks allocated to the file."
2032 #: ../cat/virt-ls.pod:257
2034 "With the I<--checksum> flag, the checksum of the file contents is shown "
2035 "(only for regular files). Computing file checksums can take a considerable "
2040 #: ../cat/virt-ls.pod:280
2041 msgid "B<--checksum>"
2045 #: ../cat/virt-ls.pod:282
2046 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2050 #: ../cat/virt-ls.pod:284
2052 "Display checksum over file contents for regular files. With no argument, "
2053 "this defaults to using I<md5>. Using an argument, you can select the "
2054 "checksum type to use."
2058 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2059 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2060 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2062 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2067 #: ../cat/virt-ls.pod:316
2069 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2070 "so you cannot see what you are typing. If you are not worried about Tempest "
2071 "attacks and there is no one else in the room you can specify this flag to "
2072 "see what you are typing."
2076 #: ../cat/virt-ls.pod:321
2077 msgid "B<--extra-stats>"
2081 #: ../cat/virt-ls.pod:323
2082 msgid "Display extra stats."
2086 #: ../cat/virt-ls.pod:339
2089 " virt-ls --format=raw -a disk.img /dir\n"
2094 #: ../cat/virt-ls.pod:343
2097 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2102 #: ../cat/virt-ls.pod:356
2103 msgid "Display file sizes in human-readable format."
2107 #: ../cat/virt-ls.pod:370
2112 #: ../cat/virt-ls.pod:372
2113 msgid "B<--recursive>"
2117 #: ../cat/virt-ls.pod:374
2119 "Select the mode. With neither of these options, C<virt-ls> produces a "
2120 "simple, flat list of the files in the named directory. See L</SIMPLE "
2125 #: ../cat/virt-ls.pod:378
2127 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2132 #: ../cat/virt-ls.pod:381
2134 "C<virt-ls -R> produces a recursive list of files starting at the named "
2135 "directory. See L</RECURSIVE LISTING>."
2139 #: ../cat/virt-ls.pod:384
2141 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2142 "parsed. See L</RECURSIVE LONG LISTING>."
2146 #: ../cat/virt-ls.pod:387
2151 #: ../cat/virt-ls.pod:389
2152 msgid "Display time fields."
2156 #: ../cat/virt-ls.pod:394
2157 msgid "B<--time-days>"
2161 #: ../cat/virt-ls.pod:396
2162 msgid "Display time fields as days before now (negative if in the future)."
2166 #: ../cat/virt-ls.pod:398
2168 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2169 "of the file is between 0 and 86399 seconds."
2173 #: ../cat/virt-ls.pod:404
2174 msgid "B<--time-relative>"
2178 #: ../cat/virt-ls.pod:406
2179 msgid "Display time fields as seconds before now (negative if in the future)."
2183 #: ../cat/virt-ls.pod:411
2188 #: ../cat/virt-ls.pod:413
2189 msgid "Display time fields as seconds since the Unix epoch."
2193 #: ../cat/virt-ls.pod:418
2198 #: ../cat/virt-ls.pod:420
2199 msgid "Display UID and GID fields."
2203 #: ../cat/virt-ls.pod:445
2204 msgid "Previous versions of virt-ls allowed you to write either:"
2208 #: ../cat/virt-ls.pod:447
2211 " virt-ls disk.img [disk.img ...] /dir\n"
2216 #: ../cat/virt-ls.pod:451
2219 " virt-ls guestname /dir\n"
2224 #: ../cat/virt-ls.pod:497
2226 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2227 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2228 "L<http://libguestfs.org/>."
2232 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374
2233 #: ../rescue/virt-rescue.pod:302
2234 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2238 #: ../df/virt-df.pod:5
2239 msgid "virt-df - Display free space on virtual filesystems"
2243 #: ../df/virt-df.pod:9
2246 " virt-df [--options]\n"
2251 #: ../df/virt-df.pod:11
2254 " virt-df [--options] -d domname\n"
2259 #: ../df/virt-df.pod:13
2262 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
2267 #: ../df/virt-df.pod:17
2270 " virt-df [--options] domname\n"
2275 #: ../df/virt-df.pod:19
2278 " virt-df [--options] disk.img [disk.img ...]\n"
2283 #: ../df/virt-df.pod:23
2285 "C<virt-df> is a command line tool to display free space on virtual machine "
2286 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2287 "allocated to a virtual machine, but can look inside disk images to see how "
2288 "much space is really being used."
2292 #: ../df/virt-df.pod:28
2294 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2295 "to get a list of all active and inactive guests, and performs a C<df>-type "
2296 "operation on each one in turn, printing out the results."
2300 #: ../df/virt-df.pod:32
2302 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
2303 "type operation on either the single named libvirt domain, or on the disk "
2304 "image(s) listed on the command line (which must all belong to a single VM). "
2305 "In this mode (with arguments), C<virt-df> will I<only work for a single "
2306 "guest>. If you want to run on multiple guests, then you have to invoke "
2307 "C<virt-df> multiple times."
2311 #: ../df/virt-df.pod:39
2313 "Use the I<--csv> option to get a format which can be easily parsed by other "
2314 "programs. Other options are similar to the standard L<df(1)> command."
2318 #: ../df/virt-df.pod:45
2320 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2321 "output human-readable:"
2325 #: ../df/virt-df.pod:48
2328 " # virt-df -d F14x64 -h\n"
2329 " Filesystem Size Used Available Use%\n"
2330 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2331 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2336 #: ../df/virt-df.pod:53
2337 msgid "Show disk usage for a disk image file called C<test.img>:"
2341 #: ../df/virt-df.pod:55
2344 " $ virt-df -a test1.img\n"
2345 " Filesystem 1K-blocks Used Available Use%\n"
2346 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2351 #: ../df/virt-df.pod:112
2354 " virt-df --format=raw -a disk.img\n"
2359 #: ../df/virt-df.pod:116
2362 " virt-df --format=raw -a disk.img --format -a another.img\n"
2367 #: ../df/virt-df.pod:129
2368 msgid "Print sizes in human-readable format."
2372 #: ../df/virt-df.pod:131
2373 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2377 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2382 #: ../df/virt-df.pod:135
2387 #: ../df/virt-df.pod:137
2388 msgid "Print inodes instead of blocks."
2392 #: ../df/virt-df.pod:139
2393 msgid "B<--one-per-guest>"
2397 #: ../df/virt-df.pod:141
2399 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2400 "disks from several guests to a single libguestfs appliance."
2404 #: ../df/virt-df.pod:144
2405 msgid "You might use this option in the following circumstances:"
2409 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
2410 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
2411 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
2412 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
2413 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
2414 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
2415 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
2416 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
2417 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
2418 #: ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398
2419 #: ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412
2420 #: ../fish/guestfish-actions.pod:1139 ../fish/guestfish-actions.pod:1143
2421 #: ../fish/guestfish-actions.pod:1147 ../fish/guestfish-actions.pod:1151
2422 #: ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163
2423 #: ../fish/guestfish-actions.pod:1167 ../fish/guestfish-actions.pod:1177
2424 #: ../fish/guestfish-actions.pod:1181 ../fish/guestfish-actions.pod:1185
2425 #: ../fish/guestfish-actions.pod:1275 ../fish/guestfish-actions.pod:1279
2426 #: ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289
2427 #: ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335
2428 #: ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1596
2429 #: ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:1610
2430 #: ../fish/guestfish-actions.pod:2005 ../fish/guestfish-actions.pod:2011
2431 #: ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2026
2432 #: ../fish/guestfish-actions.pod:2033 ../fish/guestfish.pod:445
2433 #: ../fish/guestfish.pod:449 ../fish/guestfish.pod:453
2434 #: ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393
2435 #: ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282
2436 #: ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295
2437 #: ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32
2438 #: ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43
2439 #: ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54
2440 #: ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64
2441 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
2442 #: ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596
2443 #: ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610
2444 #: ../src/guestfs-actions.pod:1778 ../src/guestfs-actions.pod:1782
2445 #: ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:1790
2446 #: ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1802
2447 #: ../src/guestfs-actions.pod:1806 ../src/guestfs-actions.pod:1816
2448 #: ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1824
2449 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:1966
2450 #: ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:1976
2451 #: ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2041
2452 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2461
2453 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2475
2454 #: ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3018
2455 #: ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3033
2456 #: ../src/guestfs-actions.pod:3040 ../src/guestfs.pod:388
2457 #: ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402
2458 #: ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416
2459 #: ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098
2460 #: ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115
2461 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164
2462 #: ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176
2463 #: ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674
2464 #: ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785
2465 #: ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804
2466 #: ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104
2467 #: ../src/guestfs.pod:2112 ../src/guestfs.pod:2559 ../src/guestfs.pod:2565
2468 #: ../src/guestfs.pod:2570 ../src/guestfs.pod:2576 ../src/guestfs.pod:2959
2469 #: ../src/guestfs.pod:2964 ../src/guestfs.pod:2968 ../src/guestfs.pod:2972
2470 #: ../src/guestfs.pod:2976 ../src/guestfs.pod:2990 ../src/guestfs.pod:2995
2471 #: ../src/guestfs.pod:3223 ../src/guestfs.pod:3227 ../src/guestfs.pod:3231
2472 #: ../src/guestfs.pod:3235 ../tools/virt-win-reg.pl:197
2473 #: ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208
2474 #: ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716
2475 #: ../tools/virt-win-reg.pl:722
2480 #: ../df/virt-df.pod:150
2482 "If you think an untrusted guest might actively try to exploit the libguestfs "
2483 "appliance kernel, then this prevents one guest from interfering with the "
2484 "stats printed for another guest."
2488 #: ../df/virt-df.pod:156
2490 "If the kernel has a bug which stops it from accessing a filesystem in one "
2491 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2492 "and report stats for further guests."
2496 #: ../df/virt-df.pod:165
2498 "Print UUIDs instead of names. This is useful for following a guest even "
2499 "when the guest is migrated or renamed, or when two guests happen to have the "
2504 #: ../df/virt-df.pod:169
2506 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2507 "images, we still print the disk image name even when this option is "
2512 #: ../df/virt-df.pod:229
2514 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
2519 #: ../edit/virt-edit.pod:5
2520 msgid "virt-edit - Edit a file in a virtual machine"
2524 #: ../edit/virt-edit.pod:9
2527 " virt-edit [--options] -d domname file [file ...]\n"
2532 #: ../edit/virt-edit.pod:11
2535 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2540 #: ../edit/virt-edit.pod:13
2543 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2548 #: ../edit/virt-edit.pod:17
2551 " virt-edit domname file\n"
2556 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2559 " virt-edit disk.img [disk.img ...] file\n"
2564 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
2565 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
2566 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
2567 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
2572 #: ../edit/virt-edit.pod:23
2574 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2575 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2576 "doing this, but doesn't catch all cases."
2580 #: ../edit/virt-edit.pod:29
2582 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2583 "exists in the named virtual machine (or disk image)."
2587 #: ../edit/virt-edit.pod:32
2589 "Multiple filenames can be given, in which case they are each edited in "
2590 "turn. Each filename must be a full path, starting at the root directory "
2591 "(starting with '/')."
2595 #: ../edit/virt-edit.pod:36
2596 msgid "If you want to just view a file, use L<virt-cat(1)>."
2600 #: ../edit/virt-edit.pod:38
2602 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
2603 "USING GUESTFISH> below)."
2607 #: ../edit/virt-edit.pod:41
2609 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2610 "that and much more."
2614 #: ../edit/virt-edit.pod:46
2615 msgid "Edit the named files interactively:"
2619 #: ../edit/virt-edit.pod:48
2622 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2627 #: ../edit/virt-edit.pod:50
2630 " virt-edit -d mydomain /etc/passwd\n"
2635 #: ../edit/virt-edit.pod:52
2636 msgid "For Windows guests, some Windows paths are understood:"
2640 #: ../edit/virt-edit.pod:54
2643 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2648 #: ../edit/virt-edit.pod:56
2650 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
2651 "INTERACTIVE EDITING> below). To change the init default level to 5:"
2655 #: ../edit/virt-edit.pod:60
2658 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2663 #: ../edit/virt-edit.pod:81
2664 msgid "B<-b> extension"
2668 #: ../edit/virt-edit.pod:83
2669 msgid "B<--backup> extension"
2673 #: ../edit/virt-edit.pod:85
2675 "Create a backup of the original file I<in the guest disk image>. The backup "
2676 "has the original filename with C<extension> added."
2680 #: ../edit/virt-edit.pod:88
2682 "Usually the first character of C<extension> would be a dot C<.> so you would "
2687 #: ../edit/virt-edit.pod:91
2690 " virt-edit -b .orig [etc]\n"
2695 #: ../edit/virt-edit.pod:93
2696 msgid "By default, no backup file is made."
2700 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
2701 #: ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74
2702 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
2703 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
2708 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
2709 #: ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76
2710 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
2711 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
2712 msgid "B<--connect URI>"
2716 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
2717 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
2718 #: ../tools/virt-win-reg.pl:135
2720 "If you specify guest block devices directly, then libvirt is not used at all."
2724 #: ../edit/virt-edit.pod:114
2726 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2727 "off so you cannot see what you are typing. If you are not worried about "
2728 "Tempest attacks and there is no one else in the room you can specify this "
2729 "flag to see what you are typing."
2733 #: ../edit/virt-edit.pod:119
2738 #: ../edit/virt-edit.pod:121
2739 msgid "B<--expr> EXPR"
2743 #: ../edit/virt-edit.pod:123
2745 "Instead of launching the external editor, non-interactively apply the Perl "
2746 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2751 #: ../edit/virt-edit.pod:127
2753 "Be careful to properly quote the expression to prevent it from being altered "
2758 #: ../edit/virt-edit.pod:130
2759 msgid "Note that this option is only available when Perl 5 is installed."
2763 #: ../edit/virt-edit.pod:132
2764 msgid "B<--format> raw|qcow2|..."
2768 #: ../edit/virt-edit.pod:143
2771 " virt-edit --format=raw -a disk.img file\n"
2776 #: ../edit/virt-edit.pod:147
2779 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2784 #: ../edit/virt-edit.pod:181
2785 msgid "Previous versions of virt-edit allowed you to write either:"
2789 #: ../edit/virt-edit.pod:187
2792 " virt-edit guestname file\n"
2797 #: ../edit/virt-edit.pod:195
2798 msgid "NON-INTERACTIVE EDITING"
2802 #: ../edit/virt-edit.pod:197
2804 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2805 "administrator can interactively edit the file."
2809 #: ../edit/virt-edit.pod:200
2811 "There are two ways also to use C<virt-edit> from scripts in order to make "
2812 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2813 "like this, it's less error-prone to write scripts directly using the "
2814 "libguestfs API and Augeas for configuration file editing.)"
2818 #: ../edit/virt-edit.pod:206
2820 "The first method is to temporarily set C<$EDITOR> to any script or program "
2821 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2822 "update C<tmpfile> in place however it likes."
2826 #: ../edit/virt-edit.pod:210
2828 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2829 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2830 "instances of C<foo> with C<bar> in a file:"
2834 #: ../edit/virt-edit.pod:214
2837 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2842 #: ../edit/virt-edit.pod:216
2844 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2845 "For example to delete root's password you could do:"
2849 #: ../edit/virt-edit.pod:219
2852 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2857 #: ../edit/virt-edit.pod:221
2859 "What really happens is that the snippet is evaluated as a Perl expression "
2860 "for each line of the file. The line, including the final C<\\n>, is passed "
2861 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2865 #: ../edit/virt-edit.pod:226
2867 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2868 "C<apache> user account from the password file you can do:"
2872 #: ../edit/virt-edit.pod:229
2875 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2880 #: ../edit/virt-edit.pod:231
2882 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2883 "the end of the file is rather difficult this way since there is no concept "
2884 "of \"last line of the file\" - your expression just doesn't get called "
2885 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2890 #: ../edit/virt-edit.pod:237
2892 "The variable C<$lineno> contains the current line number. As is "
2893 "traditional, the first line in the file is number C<1>."
2897 #: ../edit/virt-edit.pod:240
2899 "The return value from the expression is ignored, but the expression may call "
2900 "C<die> in order to abort the whole program, leaving the original file "
2905 #: ../edit/virt-edit.pod:244
2907 "Remember when matching the end of a line that C<$_> may contain the final C<"
2908 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2909 "newline then neither of these. Thus to match or substitute some text at the "
2910 "end of a line, use this regular expression:"
2914 #: ../edit/virt-edit.pod:249
2917 " /some text(\\r?\\n)?$/\n"
2922 #: ../edit/virt-edit.pod:251
2924 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
2925 "$_> itself (since that would remove all newlines from the file):"
2929 #: ../edit/virt-edit.pod:255
2932 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2937 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2938 msgid "WINDOWS PATHS"
2942 #: ../edit/virt-edit.pod:259
2944 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2945 "paths (eg. C<E:\\foo\\bar.txt>)."
2949 #: ../edit/virt-edit.pod:262
2950 msgid "If and only if the guest is running Windows then:"
2954 #: ../edit/virt-edit.pod:268
2956 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2957 "to the correct filesystem."
2961 #: ../edit/virt-edit.pod:273
2963 "Any backslash (C<\\>) characters in the path are replaced with forward "
2964 "slashes so that libguestfs can process it."
2968 #: ../edit/virt-edit.pod:278
2970 "The path is resolved case insensitively to locate the file that should be "
2975 #: ../edit/virt-edit.pod:283
2976 msgid "There are some known shortcomings:"
2980 #: ../edit/virt-edit.pod:289
2981 msgid "Some NTFS symbolic links may not be followed correctly."
2985 #: ../edit/virt-edit.pod:293
2986 msgid "NTFS junction points that cross filesystems are not followed."
2990 #: ../edit/virt-edit.pod:299
2992 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2993 "C<virt-edit> doesn't work."
2997 #: ../edit/virt-edit.pod:302
2998 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3002 #: ../edit/virt-edit.pod:304
3005 " guestfish --rw -i -d domname edit /file\n"
3010 #: ../edit/virt-edit.pod:306
3012 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
3017 #: ../edit/virt-edit.pod:309
3019 "The command above uses libguestfs's guest inspection feature and so does not "
3020 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
3021 "disk images that don't contain guests. To edit a file on a disk image "
3026 #: ../edit/virt-edit.pod:314
3029 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
3034 #: ../edit/virt-edit.pod:316
3036 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
3037 "the disk image to edit, and C</file> is the full path to the file."
3041 #: ../edit/virt-edit.pod:320
3043 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
3044 "C<write> or C<upload> instead:"
3048 #: ../edit/virt-edit.pod:323
3051 " guestfish --rw -i -d domname touch /newfile\n"
3056 #: ../edit/virt-edit.pod:325
3059 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3064 #: ../edit/virt-edit.pod:327
3067 " guestfish --rw -i -d domname upload localfile /newfile\n"
3072 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1086
3073 #: ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232
3074 #: ../src/guestfs.pod:3106 ../test-tool/libguestfs-test-tool.pod:95
3075 msgid "ENVIRONMENT VARIABLES"
3079 #: ../edit/virt-edit.pod:333
3084 #: ../edit/virt-edit.pod:335
3086 "If set, this string is used as the editor. It may contain arguments, eg. C<"
3091 #: ../edit/virt-edit.pod:338
3092 msgid "If not set, C<vi> is used."
3096 #: ../edit/virt-edit.pod:356
3098 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
3099 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
3100 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3104 #: ../erlang/examples/guestfs-erlang.pod:5
3105 msgid "guestfs-erlang - How to use libguestfs from Erlang"
3109 #: ../erlang/examples/guestfs-erlang.pod:9
3112 " {ok, G} = guestfs:create(),\n"
3113 " ok = guestfs:add_drive_opts(G, Disk,\n"
3114 " [{format, \"raw\"}, {readonly, true}]),\n"
3115 " ok = guestfs:launch(G),\n"
3116 " [Device] = guestfs:list_devices(G),\n"
3117 " ok = guestfs:close(G).\n"
3122 #: ../erlang/examples/guestfs-erlang.pod:18
3124 "This manual page documents how to call libguestfs from the Erlang "
3125 "programming language. This page just documents the differences from the C "
3126 "API and gives some examples. If you are not familiar with using libguestfs, "
3127 "you also need to read L<guestfs(3)>."
3131 #: ../erlang/examples/guestfs-erlang.pod:23
3132 msgid "OPENING AND CLOSING THE HANDLE"
3136 #: ../erlang/examples/guestfs-erlang.pod:25
3138 "The Erlang bindings are implemented using an external program called C<erl-"
3139 "guestfs>. This program must be on the current PATH, or else you should "
3140 "specify the full path to the program:"
3144 #: ../erlang/examples/guestfs-erlang.pod:29
3147 " {ok, G} = guestfs:create().\n"
3152 #: ../erlang/examples/guestfs-erlang.pod:31
3155 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
3160 #: ../erlang/examples/guestfs-erlang.pod:33
3161 msgid "C<G> is the libguestfs handle which you should pass to other functions."
3165 #: ../erlang/examples/guestfs-erlang.pod:36
3166 msgid "To close the handle:"
3170 #: ../erlang/examples/guestfs-erlang.pod:38
3173 " ok = guestfs:close(G).\n"
3178 #: ../erlang/examples/guestfs-erlang.pod:40
3179 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
3183 #: ../erlang/examples/guestfs-erlang.pod:42
3185 "For functions that take optional arguments, the first arguments are the non-"
3186 "optional ones. The last argument is a list of tuples supplying the "
3187 "remaining optional arguments."
3191 #: ../erlang/examples/guestfs-erlang.pod:46
3194 " ok = guestfs:add_drive_opts(G, Disk,\n"
3195 " [{format, \"raw\"}, {readonly, true}]).\n"
3200 #: ../erlang/examples/guestfs-erlang.pod:49
3201 msgid "If the last argument would be an empty list, you can also omit it:"
3205 #: ../erlang/examples/guestfs-erlang.pod:51
3208 " ok = guestfs:add_drive_opts(G, Disk).\n"
3213 #: ../erlang/examples/guestfs-erlang.pod:53
3214 msgid "RETURN VALUES AND ERRORS"
3218 #: ../erlang/examples/guestfs-erlang.pod:55
3220 "On success, most functions return a C<Result> term (which could be a list, "
3221 "string, tuple etc.). If there is nothing for the function to return, then "
3222 "the atom C<ok> is returned."
3226 #: ../erlang/examples/guestfs-erlang.pod:59
3227 msgid "On error, you would see one of the following tuples:"
3231 #: ../erlang/examples/guestfs-erlang.pod:63
3232 msgid "C<{error, Msg, Errno}>"
3236 #: ../erlang/examples/guestfs-erlang.pod:65
3237 msgid "This indicates an ordinary error from the function."
3241 #: ../erlang/examples/guestfs-erlang.pod:67
3243 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
3248 #: ../erlang/examples/guestfs-erlang.pod:70
3249 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
3253 #: ../erlang/examples/guestfs-erlang.pod:72
3254 msgid "C<{unknown, Function}>"
3258 #: ../erlang/examples/guestfs-erlang.pod:74
3260 "This indicates that the function you called is not known. Generally this "
3261 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
3262 "which you should not do."
3266 #: ../erlang/examples/guestfs-erlang.pod:78
3267 msgid "C<Function> is the name of the unknown function."
3271 #: ../erlang/examples/guestfs-erlang.pod:80
3272 msgid "C<{unknownarg, Arg}>"
3276 #: ../erlang/examples/guestfs-erlang.pod:82
3278 "This indicates that you called a function with optional arguments, with an "
3279 "unknown argument name."
3283 #: ../erlang/examples/guestfs-erlang.pod:85
3284 msgid "C<Arg> is the name of the unknown argument."
3288 #: ../erlang/examples/guestfs-erlang.pod:89
3289 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
3290 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
3291 #: ../python/examples/guestfs-python.pod:34
3292 #: ../ruby/examples/guestfs-ruby.pod:28
3293 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
3297 #: ../erlang/examples/guestfs-erlang.pod:91
3298 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
3299 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
3300 #: ../python/examples/guestfs-python.pod:36
3301 #: ../ruby/examples/guestfs-ruby.pod:30
3306 #: ../erlang/examples/guestfs-erlang.pod:93
3307 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
3308 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
3309 #: ../python/examples/guestfs-python.pod:38
3310 #: ../ruby/examples/guestfs-ruby.pod:32
3311 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
3315 #: ../erlang/examples/guestfs-erlang.pod:95
3316 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
3317 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
3318 #: ../python/examples/guestfs-python.pod:40
3319 #: ../ruby/examples/guestfs-ruby.pod:34
3324 #: ../erlang/examples/guestfs-erlang.pod:99
3326 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
3327 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
3328 "L<guestfs-ruby(3)>, L<http://www.erlang.org/>. L<http://libguestfs.org/>."
3332 #: ../erlang/examples/guestfs-erlang.pod:110
3333 #: ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397
3334 #: ../fish/guestfish.pod:1261 ../fish/virt-copy-in.pod:60
3335 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
3336 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:319
3337 #: ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58
3338 #: ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52
3339 #: ../python/examples/guestfs-python.pod:54
3340 #: ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3242
3341 #: ../test-tool/libguestfs-test-tool.pod:106
3346 #: ../erlang/examples/guestfs-erlang.pod:112
3347 #: ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399
3348 #: ../fish/guestfish.pod:1263 ../fish/virt-copy-in.pod:62
3349 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
3350 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:321
3351 #: ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93
3352 #: ../perl/examples/guestfs-perl.pod:54
3353 #: ../python/examples/guestfs-python.pod:56
3354 #: ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3244
3355 #: ../test-tool/libguestfs-test-tool.pod:108
3356 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3360 #: ../erlang/examples/guestfs-erlang.pod:116
3361 #: ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
3362 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
3366 #: ../erlang/examples/guestfs-erlang.pod:118
3367 #: ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405
3368 #: ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99
3369 #: ../perl/examples/guestfs-perl.pod:60
3370 #: ../python/examples/guestfs-python.pod:62
3371 #: ../ruby/examples/guestfs-ruby.pod:56
3373 "The examples in this manual page may be freely copied, modified and "
3374 "distributed without any restrictions."
3378 #: ../erlang/examples/guestfs-erlang.pod:121
3379 #: ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408
3380 #: ../java/examples/guestfs-java.pod:69
3381 #: ../ocaml/examples/guestfs-ocaml.pod:102
3382 #: ../perl/examples/guestfs-perl.pod:63
3383 #: ../python/examples/guestfs-python.pod:65
3384 #: ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3251
3386 "This library is free software; you can redistribute it and/or modify it "
3387 "under the terms of the GNU Lesser General Public License as published by the "
3388 "Free Software Foundation; either version 2 of the License, or (at your "
3389 "option) any later version."
3393 #: ../erlang/examples/guestfs-erlang.pod:126
3394 #: ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413
3395 #: ../java/examples/guestfs-java.pod:74
3396 #: ../ocaml/examples/guestfs-ocaml.pod:107
3397 #: ../perl/examples/guestfs-perl.pod:68
3398 #: ../python/examples/guestfs-python.pod:70
3399 #: ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3256
3401 "This library is distributed in the hope that it will be useful, but WITHOUT "
3402 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3403 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3408 #: ../erlang/examples/guestfs-erlang.pod:131
3409 #: ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418
3410 #: ../java/examples/guestfs-java.pod:79
3411 #: ../ocaml/examples/guestfs-ocaml.pod:112
3412 #: ../perl/examples/guestfs-perl.pod:73
3413 #: ../python/examples/guestfs-python.pod:75
3414 #: ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3261
3416 "You should have received a copy of the GNU Lesser General Public License "
3417 "along with this library; if not, write to the Free Software Foundation, "
3418 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3422 #: ../examples/guestfs-examples.pod:5
3423 msgid "guestfs-examples - Examples of using libguestfs from C"
3427 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3430 " #include <guestfs.h>\n"
3435 #: ../examples/guestfs-examples.pod:11
3438 " guestfs_h *g = guestfs_create ();\n"
3439 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3440 " guestfs_launch (g);\n"
3445 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3448 " cc prog.c -o prog -lguestfs\n"
3450 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3455 #: ../examples/guestfs-examples.pod:21
3457 "This manual page contains examples of calling libguestfs from the C "
3458 "programming language. If you are not familiar with using libguestfs, you "
3459 "also need to read L<guestfs(3)>."
3463 #: ../examples/guestfs-examples.pod:35
3465 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
3466 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
3467 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
3471 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97
3472 #: ../python/examples/guestfs-python.pod:60
3473 #: ../ruby/examples/guestfs-ruby.pod:54
3474 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3478 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3483 #: ../examples/guestfs-recipes.pod:5
3485 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3486 "here. The only way which works for both sorts of output is to just write "
3487 "the URL directly. Do NOT use L<...> for URLs."
3491 #: ../examples/guestfs-recipes.pod:9
3493 "We break with tradition here and don't use ALL CAPS for the section "
3494 "headings, as this makes them much easier to read."
3498 #: ../examples/guestfs-recipes.pod:16
3499 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3503 #: ../examples/guestfs-recipes.pod:20
3505 "This page contains recipes for and links to things you can do using "
3506 "libguestfs, L<guestfish(1)> and the virt tools."
3510 #: ../examples/guestfs-recipes.pod:23
3511 msgid "Audit a virtual machine for setuid files"
3515 #: ../examples/guestfs-recipes.pod:25
3517 "The link below contains a small program which can be used to audit a Linux "
3518 "virtual machine to see what setuid and setgid files it contains."
3522 #: ../examples/guestfs-recipes.pod:28
3524 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
3529 #: ../examples/guestfs-recipes.pod:30
3530 msgid "Change the background image in a Windows XP VM"
3534 #: ../examples/guestfs-recipes.pod:32
3536 "The links below explain how to use L<guestfish(1)> to change the background "
3537 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3538 "be substantially different for each version of Windows."
3542 #: ../examples/guestfs-recipes.pod:37
3544 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
3545 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3549 #: ../examples/guestfs-recipes.pod:40
3550 msgid "Cloning a virtual machine (Linux)"
3554 #: ../examples/guestfs-recipes.pod:42
3556 "The guestfish technique described in the link below works well for most "
3557 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3562 #: ../examples/guestfs-recipes.pod:46
3564 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
3569 #: ../examples/guestfs-recipes.pod:48
3571 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3576 #: ../examples/guestfs-recipes.pod:51
3577 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3581 #: ../examples/guestfs-recipes.pod:53
3582 msgid "Cloning a virtual machine (Windows)"
3586 #: ../examples/guestfs-recipes.pod:55
3588 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3589 "straightforward. Currently there is code in the Aeolus Oz project which "
3590 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3591 "we may add sysprepping ability."
3595 #: ../examples/guestfs-recipes.pod:60
3597 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
3598 "list/2011-May/msg00019.html"
3602 #: ../examples/guestfs-recipes.pod:63
3603 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3607 #: ../examples/guestfs-recipes.pod:65
3608 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3612 #: ../examples/guestfs-recipes.pod:67
3615 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3620 #: ../examples/guestfs-recipes.pod:69
3621 msgid "To export just a subdirectory, eg. C</files>, do:"
3625 #: ../examples/guestfs-recipes.pod:71
3628 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3633 #: ../examples/guestfs-recipes.pod:73
3634 msgid "Create empty disk images"
3638 #: ../examples/guestfs-recipes.pod:75
3640 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3641 "The useful guide below explains the options available."
3645 #: ../examples/guestfs-recipes.pod:78
3647 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
3652 #: ../examples/guestfs-recipes.pod:80
3653 msgid "Dump raw filesystem content from inside a disk image or VM"
3657 #: ../examples/guestfs-recipes.pod:82
3659 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3660 "filesystem content from any filesystem in a disk image or a VM (even one "
3661 "which is encrypted or buried inside an LV):"
3665 #: ../examples/guestfs-recipes.pod:86
3668 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3673 #: ../examples/guestfs-recipes.pod:88
3676 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3681 #: ../examples/guestfs-recipes.pod:90
3682 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3686 #: ../examples/guestfs-recipes.pod:92
3687 msgid "Edit grub configuration in a VM"
3691 #: ../examples/guestfs-recipes.pod:94
3692 msgid "You can use this to:"
3696 #: ../examples/guestfs-recipes.pod:100
3697 msgid "Fix a virtual machine that does not boot."
3701 #: ../examples/guestfs-recipes.pod:104
3702 msgid "Change which kernel is used to boot the VM."
3706 #: ../examples/guestfs-recipes.pod:108
3707 msgid "Change kernel command line options."
3711 #: ../examples/guestfs-recipes.pod:112
3712 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3716 #: ../examples/guestfs-recipes.pod:114
3719 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3724 #: ../examples/guestfs-recipes.pod:116
3726 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3731 #: ../examples/guestfs-recipes.pod:119
3734 " virt-rescue -d BrokenGuest\n"
3739 #: ../examples/guestfs-recipes.pod:121
3740 msgid "Export any directory from a VM"
3744 #: ../examples/guestfs-recipes.pod:123
3746 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3750 #: ../examples/guestfs-recipes.pod:126
3753 " virt-copy-out -d Guest /home .\n"
3758 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
3759 #: ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592
3760 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:18
3761 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2457
3762 #: ../src/guestfs-actions.pod:3008 ../src/guestfs.pod:1670
3763 #: ../tools/virt-win-reg.pl:706
3768 #: ../examples/guestfs-recipes.pod:134
3770 "The final dot of the command is not a printing error. It means we want to "
3771 "copy out to the current directory."
3775 #: ../examples/guestfs-recipes.pod:139
3776 msgid "This creates a directory called C<home> under the current directory."
3780 #: ../examples/guestfs-recipes.pod:143
3782 "If the guest is a Windows guest then you can use drive letters and "
3783 "backslashes, but you must prefix the path with C<win:> and quote it to "
3784 "protect it from the shell, like this:"
3788 #: ../examples/guestfs-recipes.pod:147
3791 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3796 #: ../examples/guestfs-recipes.pod:149
3797 msgid "To get the output as a compressed tarball, do:"
3801 #: ../examples/guestfs-recipes.pod:151
3804 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3809 #: ../examples/guestfs-recipes.pod:153
3811 "Although it sounds tempting, this is usually not a reliable way to get a "
3812 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
3813 "org/FAQ.html#backup"
3817 #: ../examples/guestfs-recipes.pod:157
3818 msgid "Find out which user is using the most space"
3822 #: ../examples/guestfs-recipes.pod:159
3824 "This simple script examines a Linux guest to find out which user is using "
3825 "the most space in their home directory:"
3829 #: ../examples/guestfs-recipes.pod:162
3837 #: ../examples/guestfs-recipes.pod:164
3845 #: ../examples/guestfs-recipes.pod:166
3854 #: ../examples/guestfs-recipes.pod:169
3857 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3862 #: ../examples/guestfs-recipes.pod:171
3865 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3866 " echo -n \"$dir/$d\"\n"
3868 " guestfish --remote du \"$dir/$d\";\n"
3869 " done | sort -nr -k 2\n"
3874 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3877 " guestfish --remote exit\n"
3882 #: ../examples/guestfs-recipes.pod:179
3883 msgid "Get DHCP address from a VM"
3887 #: ../examples/guestfs-recipes.pod:181
3889 "The link below explains the many different possible techniques for getting "
3890 "the last assigned DHCP address of a virtual machine."
3894 #: ../examples/guestfs-recipes.pod:184
3896 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
3897 "a-virtual-machine-disk-image/#content"
3901 #: ../examples/guestfs-recipes.pod:186
3903 "In the libguestfs source examples directory you will find the latest version "
3904 "of the C<virt-dhcp-address.c> program."
3908 #: ../examples/guestfs-recipes.pod:189
3909 msgid "Get the operating system product name string"
3913 #: ../examples/guestfs-recipes.pod:191
3914 msgid "Save the following script into a file called C<product-name.sh>:"
3918 #: ../examples/guestfs-recipes.pod:193
3923 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3924 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3925 " guestfish --remote inspect-get-product-name \"$root\"\n"
3926 " guestfish --remote exit\n"
3931 #: ../examples/guestfs-recipes.pod:200
3932 msgid "Make the script executable and run it on a named guest:"
3936 #: ../examples/guestfs-recipes.pod:202
3939 " # product-name.sh RHEL60x64\n"
3940 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3945 #: ../examples/guestfs-recipes.pod:205
3947 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3948 "C<xpath> command line tool or from your favourite programming language:"
3952 #: ../examples/guestfs-recipes.pod:209
3955 " # virt-inspector RHEL60x64 > xml\n"
3956 " # xpath '//product_name' < xml\n"
3959 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
3964 #: ../examples/guestfs-recipes.pod:215
3965 msgid "Get the default boot kernel for a Linux VM"
3969 #: ../examples/guestfs-recipes.pod:217
3971 "The link below contains a program to print the default boot kernel for a "
3976 #: ../examples/guestfs-recipes.pod:220
3978 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
3979 "kernel-for-a-vm/#content"
3983 #: ../examples/guestfs-recipes.pod:222
3985 "It uses Augeas, and the technique is generally applicable for many different "
3990 #: ../examples/guestfs-recipes.pod:229
3991 msgid "listing the user accounts in the guest"
3995 #: ../examples/guestfs-recipes.pod:233
3996 msgid "what repositories is it configured to use"
4000 #: ../examples/guestfs-recipes.pod:237
4001 msgid "what NTP servers does it connect to"
4005 #: ../examples/guestfs-recipes.pod:241
4006 msgid "what were the boot messages last time it booted"
4010 #: ../examples/guestfs-recipes.pod:245
4011 msgid "listing who was logged in recently"
4015 #: ../examples/guestfs-recipes.pod:249
4016 msgid "http://augeas.net/"
4020 #: ../examples/guestfs-recipes.pod:251
4021 msgid "Install RPMs in a guest"
4025 #: ../examples/guestfs-recipes.pod:253
4027 "The link below contains a method to install RPMs in a guest. In fact the "
4028 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4029 "installs them next time the guest is booted. You could use this technique "
4030 "to install vital security updates in an offline guest."
4034 #: ../examples/guestfs-recipes.pod:259
4036 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4040 #: ../examples/guestfs-recipes.pod:261
4041 msgid "List applications installed in a VM"
4045 #: ../examples/guestfs-recipes.pod:263
4046 msgid "Save the following to a file C<list-apps.sh>:"
4050 #: ../examples/guestfs-recipes.pod:265
4055 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4056 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4057 " guestfish --remote inspect-list-applications \"$root\"\n"
4058 " guestfish --remote exit\n"
4063 #: ../examples/guestfs-recipes.pod:272
4065 "Make the file executable and then you can run it on any named virtual "
4070 #: ../examples/guestfs-recipes.pod:275
4073 " # list-apps.sh WinGuest\n"
4075 " app_name: Mozilla Firefox (3.6.12)\n"
4076 " app_display_name: Mozilla Firefox (3.6.12)\n"
4078 " app_version: 3.6.12 (en-GB)\n"
4080 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4081 " app_trans_path:\n"
4082 " app_publisher: Mozilla\n"
4083 " app_url: http://www.mozilla.com/en-GB/\n"
4084 " app_source_package:\n"
4086 " app_description: Mozilla Firefox\n"
4089 " app_name: VLC media player\n"
4090 " app_display_name: VLC media player 1.1.5\n"
4092 " app_version: 1.1.5\n"
4094 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
4095 " app_trans_path:\n"
4096 " app_publisher: VideoLAN\n"
4097 " app_url: http://www.videolan.org/\n"
4098 " app_source_package:\n"
4100 " app_description:\n"
4106 #: ../examples/guestfs-recipes.pod:305
4108 "If you want to run the script on disk images (instead of libvirt virtual "
4109 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
4114 #: ../examples/guestfs-recipes.pod:309
4115 msgid "List files and directories in a VM"
4119 #: ../examples/guestfs-recipes.pod:311
4120 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
4124 #: ../examples/guestfs-recipes.pod:313
4127 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
4132 #: ../examples/guestfs-recipes.pod:315
4133 msgid "List services in a Windows VM"
4137 #: ../examples/guestfs-recipes.pod:317
4139 "The link below contains a script that can be used to list out the services "
4140 "from a Windows VM, and whether those services run at boot time or are loaded "
4145 #: ../examples/guestfs-recipes.pod:321
4147 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
4152 #: ../examples/guestfs-recipes.pod:323
4153 msgid "Make a disk image sparse"
4157 #: ../examples/guestfs-recipes.pod:325
4159 "The link below contains some guides for making a disk image sparse (or "
4160 "reintroducing sparseness)."
4164 #: ../examples/guestfs-recipes.pod:328
4166 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
4170 #: ../examples/guestfs-recipes.pod:330
4171 msgid "Monitor disk usage over time"
4175 #: ../examples/guestfs-recipes.pod:332
4177 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
4178 "The link below contains a guide."
4182 #: ../examples/guestfs-recipes.pod:335
4183 msgid "http://virt-tools.org/learning/advanced-virt-df/"
4187 #: ../examples/guestfs-recipes.pod:337
4188 msgid "Reading the Windows Event Log from Windows Vista (or later)"
4192 #: ../examples/guestfs-recipes.pod:339
4194 "L<guestfish(1)> plus the tools described in the link below can be used to "
4195 "read out the Windows Event Log from any virtual machine running Windows "
4196 "Vista or a later version."
4200 #: ../examples/guestfs-recipes.pod:343
4202 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
4203 "guestfish/#content"
4207 #: ../examples/guestfs-recipes.pod:345
4208 msgid "Remove root password (Linux)"
4212 #: ../examples/guestfs-recipes.pod:347
4214 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
4215 "files. One use is to remove the root password from a Linux guest:"
4219 #: ../examples/guestfs-recipes.pod:350
4222 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4227 #: ../examples/guestfs-recipes.pod:352
4228 msgid "Remove Administrator password (Windows)"
4232 #: ../examples/guestfs-recipes.pod:354
4234 "The link below contains one technique for removing the Administrator "
4235 "password from a Windows VM, or to be more precise, it gives you a command "
4236 "prompt the next time you log in which you can use to bypass any security:"
4240 #: ../examples/guestfs-recipes.pod:359
4242 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
4243 "administrator-password-with-guestfish/"
4247 #: ../examples/guestfs-recipes.pod:361
4248 msgid "Unpack a live CD"
4252 #: ../examples/guestfs-recipes.pod:363
4254 "Linux live CDs often contain multiple layers of disk images wrapped like a "
4255 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4256 "layers, as outlined in the guide below."
4260 #: ../examples/guestfs-recipes.pod:367
4262 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
4267 #: ../examples/guestfs-recipes.pod:369
4268 msgid "Uploading and downloading files"
4272 #: ../examples/guestfs-recipes.pod:371
4274 "The link below contains general tips on uploading (copying in) and "
4275 "downloading (copying out) files from VMs."
4279 #: ../examples/guestfs-recipes.pod:374
4281 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4285 #: ../examples/guestfs-recipes.pod:376
4286 msgid "Use libguestfs tools on VMware ESX guests"
4290 #: ../examples/guestfs-recipes.pod:378
4292 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4293 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4297 #: ../examples/guestfs-recipes.pod:382
4299 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
4304 #: ../examples/guestfs-recipes.pod:386
4306 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)"
4307 ">, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
4308 "python(3)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4312 #: ../examples/guestfs-recipes.pod:403
4313 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4317 #: ../fish/guestfish-actions.pod:1
4322 #: ../fish/guestfish-actions.pod:3
4325 " add-cdrom filename\n"
4330 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
4331 msgid "This function adds a virtual CD-ROM disk image to the guest."
4335 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
4336 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4340 #: ../fish/guestfish-actions.pod:15
4342 "This call checks for the existence of C<filename>. This stops you from "
4343 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4344 "and C<http:> URLs. To specify those, use the general L</config> call "
4349 #: ../fish/guestfish-actions.pod:22
4351 "If you just want to add an ISO file (often you use this as an efficient way "
4352 "to transfer large files into the guest), then you should probably use L</add-"
4353 "drive-ro> instead."
4357 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
4358 #: ../fish/guestfish-actions.pod:177
4360 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
4365 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
4366 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:1026
4367 #: ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:1400
4368 #: ../fish/guestfish-actions.pod:3157 ../fish/guestfish-actions.pod:3468
4369 #: ../fish/guestfish-actions.pod:3516 ../fish/guestfish-actions.pod:4429
4370 #: ../fish/guestfish-actions.pod:4452 ../fish/guestfish-actions.pod:4474
4371 #: ../fish/guestfish-actions.pod:4512 ../fish/guestfish-actions.pod:5161
4372 #: ../fish/guestfish-actions.pod:5267 ../src/guestfs-actions.pod:10
4373 #: ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273
4374 #: ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:2118
4375 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:4771
4376 #: ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5393
4377 #: ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6719
4378 #: ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6816
4379 #: ../src/guestfs-actions.pod:7748 ../src/guestfs-actions.pod:7857
4380 #: ../src/guestfs-actions.pod:8040
4382 "Deprecated functions will not be removed from the API, but the fact that "
4383 "they are deprecated indicates that there are problems with correct use of "
4388 #: ../fish/guestfish-actions.pod:35
4393 #: ../fish/guestfish-actions.pod:37
4398 #: ../fish/guestfish-actions.pod:39
4401 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
4406 #: ../fish/guestfish-actions.pod:41
4408 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4409 "It works by connecting to libvirt, requesting the domain and domain XML from "
4410 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
4414 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
4416 "The number of disks added is returned. This operation is atomic: if an "
4417 "error is returned, then no disks are added."
4421 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
4423 "This function does some minimal checks to make sure the libvirt domain is "
4424 "not running (unless C<readonly> is true). In a future version we will try "
4425 "to acquire the libvirt lock on each disk."
4429 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
4431 "Disks must be accessible locally. This often means that adding disks from a "
4432 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4433 "unless those disks are accessible via the same device path locally too."
4437 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
4439 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4440 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4441 "libvirt URI (or one set through an environment variable, see the libvirt "
4442 "documentation for full details)."
4446 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
4448 "The optional C<live> flag controls whether this call will try to connect to "
4449 "a running virtual machine C<guestfsd> process if it sees a suitable "
4450 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4451 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4452 "DAEMONS> for more information."
4456 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4458 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4459 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4460 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4465 #: ../fish/guestfish-actions.pod:76
4467 "The other optional parameters are passed directly through to L</add-drive-"
4472 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
4473 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:784
4474 #: ../fish/guestfish-actions.pod:805 ../fish/guestfish-actions.pod:2040
4475 #: ../fish/guestfish-actions.pod:3206 ../fish/guestfish-actions.pod:3369
4476 #: ../fish/guestfish-actions.pod:3504
4478 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
4482 #: ../fish/guestfish-actions.pod:81
4487 #: ../fish/guestfish-actions.pod:83
4490 " add-drive filename\n"
4495 #: ../fish/guestfish-actions.pod:85
4497 "This function is the equivalent of calling L</add-drive-opts> with no "
4498 "optional parameters, so the disk is added writable, with the format being "
4499 "detected automatically."
4503 #: ../fish/guestfish-actions.pod:89
4505 "Automatic detection of the format opens you up to a potential security hole "
4506 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4507 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4508 "you should think about replacing calls to this function with calls to L</add-"
4509 "drive-opts>, and specifying the format."
4513 #: ../fish/guestfish-actions.pod:96
4514 msgid "add-drive-opts"
4518 #: ../fish/guestfish-actions.pod:98
4523 #: ../fish/guestfish-actions.pod:100
4526 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4531 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4533 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4534 "The first time you call this function, the disk appears as C</dev/sda>, the "
4535 "second time as C</dev/sdb>, and so on."
4539 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4541 "You don't necessarily need to be root when using libguestfs. However you "
4542 "obviously do need sufficient permissions to access the filename for whatever "
4543 "operations you want to perform (ie. read access if you just want to read the "
4544 "image or write access if you want to modify the image)."
4548 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4549 msgid "This call checks that C<filename> exists."
4553 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3168
4554 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4808
4555 msgid "The optional arguments are:"
4559 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4564 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4566 "If true then the image is treated as read-only. Writes are still allowed, "
4567 "but they are stored in a temporary snapshot overlay which is discarded at "
4568 "the end. The disk that you add is not modified."
4572 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4577 #: ../fish/guestfish-actions.pod:127
4579 "This forces the image format. If you omit this (or use L</add-drive> or L</"
4580 "add-drive-ro>) then the format is automatically detected. Possible formats "
4581 "include C<raw> and C<qcow2>."
4585 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4587 "Automatic detection of the format opens you up to a potential security hole "
4588 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4589 "RHBZ#642934. Specifying the format closes this security hole."
4593 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4598 #: ../fish/guestfish-actions.pod:138
4600 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
4601 "add-drive-with-if> call (q.v.)"
4605 #: ../fish/guestfish-actions.pod:145
4606 msgid "add-drive-ro"
4610 #: ../fish/guestfish-actions.pod:147
4615 #: ../fish/guestfish-actions.pod:149
4618 " add-drive-ro filename\n"
4623 #: ../fish/guestfish-actions.pod:151
4625 "This function is the equivalent of calling L</add-drive-opts> with the "
4626 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4627 "is added read-only, with the format being detected automatically."
4631 #: ../fish/guestfish-actions.pod:156
4632 msgid "add-drive-ro-with-if"
4636 #: ../fish/guestfish-actions.pod:158
4639 " add-drive-ro-with-if filename iface\n"
4644 #: ../fish/guestfish-actions.pod:160
4646 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4647 "interface emulation to use at run time."
4651 #: ../fish/guestfish-actions.pod:170
4652 msgid "add-drive-with-if"
4656 #: ../fish/guestfish-actions.pod:172
4659 " add-drive-with-if filename iface\n"
4664 #: ../fish/guestfish-actions.pod:174
4666 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4667 "interface emulation to use at run time."
4671 #: ../fish/guestfish-actions.pod:184
4676 #: ../fish/guestfish-actions.pod:186
4679 " aug-clear augpath\n"
4684 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4686 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4687 "L<augtool(1)> C<clear> command."
4691 #: ../fish/guestfish-actions.pod:191
4696 #: ../fish/guestfish-actions.pod:193
4704 #: ../fish/guestfish-actions.pod:195
4706 "Close the current Augeas handle and free up any resources used by it. After "
4707 "calling this, you have to call L</aug-init> again before you can use any "
4708 "other Augeas functions."
4712 #: ../fish/guestfish-actions.pod:200
4717 #: ../fish/guestfish-actions.pod:202
4720 " aug-defnode name expr val\n"
4725 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4727 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4731 #: ../fish/guestfish-actions.pod:207
4733 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4734 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4735 "containing that single node."
4739 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4741 "On success this returns a pair containing the number of nodes in the "
4742 "nodeset, and a boolean flag if a node was created."
4746 #: ../fish/guestfish-actions.pod:215
4751 #: ../fish/guestfish-actions.pod:217
4754 " aug-defvar name expr\n"
4759 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4761 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4762 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4766 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4768 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4769 "evaluates to something which is not a nodeset."
4773 #: ../fish/guestfish-actions.pod:226
4778 #: ../fish/guestfish-actions.pod:228
4781 " aug-get augpath\n"
4786 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4788 "Look up the value associated with C<path>. If C<path> matches exactly one "
4789 "node, the C<value> is returned."
4793 #: ../fish/guestfish-actions.pod:233
4798 #: ../fish/guestfish-actions.pod:235
4801 " aug-init root flags\n"
4806 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4808 "Create a new Augeas handle for editing configuration files. If there was "
4809 "any previous Augeas handle associated with this guestfs session, then it is "
4814 #: ../fish/guestfish-actions.pod:241
4815 msgid "You must call this before using any other L</aug-*> commands."
4819 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4821 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4825 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4827 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4828 "logical I<or> of the following integers:"
4832 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4833 msgid "C<AUG_SAVE_BACKUP> = 1"
4837 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4838 msgid "Keep the original file with a C<.augsave> extension."
4842 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4843 msgid "C<AUG_SAVE_NEWFILE> = 2"
4847 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4849 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4850 "original. Overrides C<AUG_SAVE_BACKUP>."
4854 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4855 msgid "C<AUG_TYPE_CHECK> = 4"
4859 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4860 msgid "Typecheck lenses."
4864 #: ../fish/guestfish-actions.pod:266
4866 "This option is only useful when debugging Augeas lenses. Use of this option "
4867 "may require additional memory for the libguestfs appliance. You may need to "
4868 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
4872 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
4873 msgid "C<AUG_NO_STDINC> = 8"
4877 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
4878 msgid "Do not use standard load path for modules."
4882 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
4883 msgid "C<AUG_SAVE_NOOP> = 16"
4887 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
4888 msgid "Make save a no-op, just record what would have been changed."
4892 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
4893 msgid "C<AUG_NO_LOAD> = 32"
4897 #: ../fish/guestfish-actions.pod:281
4898 msgid "Do not load the tree in L</aug-init>."
4902 #: ../fish/guestfish-actions.pod:285
4903 msgid "To close the handle, you can call L</aug-close>."
4907 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
4908 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4912 #: ../fish/guestfish-actions.pod:289
4917 #: ../fish/guestfish-actions.pod:291
4920 " aug-insert augpath label true|false\n"
4925 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
4927 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4928 "or after C<path> (depending on the boolean flag C<before>)."
4932 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
4934 "C<path> must match exactly one existing node in the tree, and C<label> must "
4935 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4939 #: ../fish/guestfish-actions.pod:301
4944 #: ../fish/guestfish-actions.pod:303
4952 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
4953 msgid "Load files into the tree."
4957 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
4958 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4962 #: ../fish/guestfish-actions.pod:310
4967 #: ../fish/guestfish-actions.pod:312
4975 #: ../fish/guestfish-actions.pod:314
4977 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4978 "resulting nodes into alphabetical order."
4982 #: ../fish/guestfish-actions.pod:317
4987 #: ../fish/guestfish-actions.pod:319
4990 " aug-match augpath\n"
4995 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
4997 "Returns a list of paths which match the path expression C<path>. The "
4998 "returned paths are sufficiently qualified so that they match exactly one "
4999 "node in the current tree."
5003 #: ../fish/guestfish-actions.pod:325
5008 #: ../fish/guestfish-actions.pod:327
5011 " aug-mv src dest\n"
5016 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
5018 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5019 "C<dest> is overwritten if it exists."
5023 #: ../fish/guestfish-actions.pod:332
5028 #: ../fish/guestfish-actions.pod:334
5036 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
5037 msgid "Remove C<path> and all of its children."
5041 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
5042 msgid "On success this returns the number of entries which were removed."
5046 #: ../fish/guestfish-actions.pod:340
5051 #: ../fish/guestfish-actions.pod:342
5059 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
5060 msgid "This writes all pending changes to disk."
5064 #: ../fish/guestfish-actions.pod:346
5066 "The flags which were passed to L</aug-init> affect exactly how files are "
5071 #: ../fish/guestfish-actions.pod:349
5076 #: ../fish/guestfish-actions.pod:351
5079 " aug-set augpath val\n"
5084 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
5085 msgid "Set the value associated with C<path> to C<val>."
5089 #: ../fish/guestfish-actions.pod:355
5091 "In the Augeas API, it is possible to clear a node by setting the value to "
5092 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5093 "this call. Instead you must use the L</aug-clear> call."
5097 #: ../fish/guestfish-actions.pod:360
5102 #: ../fish/guestfish-actions.pod:362
5105 " available 'groups ...'\n"
5110 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
5112 "This command is used to check the availability of some groups of "
5113 "functionality in the appliance, which not all builds of the libguestfs "
5114 "appliance will be able to provide."
5118 #: ../fish/guestfish-actions.pod:368
5120 "The libguestfs groups, and the functions that those groups correspond to, "
5121 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5122 "runtime by calling L</available-all-groups>."
5126 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
5128 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5129 "\"]> would check for the availability of the Linux inotify functions and "
5130 "Augeas (configuration file editing) functions."
5134 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
5135 msgid "The command returns no error if I<all> requested groups are available."
5139 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
5141 "It fails with an error if one or more of the requested groups is unavailable "
5146 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
5148 "If an unknown group name is included in the list of groups then an error is "
5153 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
5158 #: ../fish/guestfish-actions.pod:392
5159 msgid "You must call L</launch> before calling this function."
5163 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
5165 "The reason is because we don't know what groups are supported by the "
5166 "appliance/daemon until it is running and can be queried."
5170 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
5172 "If a group of functions is available, this does not necessarily mean that "
5173 "they will work. You still have to check for errors when calling individual "
5174 "API functions even if they are available."
5178 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
5180 "It is usually the job of distro packagers to build complete functionality "
5181 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5182 "with all requirements satisfied, will support everything."
5186 #: ../fish/guestfish-actions.pod:414
5188 "This call was added in version C<1.0.80>. In previous versions of "
5189 "libguestfs all you could do would be to speculatively execute a command to "
5190 "find out if the daemon implemented it. See also L</version>."
5194 #: ../fish/guestfish-actions.pod:421
5195 msgid "available-all-groups"
5199 #: ../fish/guestfish-actions.pod:423
5202 " available-all-groups\n"
5207 #: ../fish/guestfish-actions.pod:425
5209 "This command returns a list of all optional groups that this daemon knows "
5210 "about. Note this returns both supported and unsupported groups. To find "
5211 "out which ones the daemon can actually support you have to call L</"
5212 "available> on each member of the returned list."
5216 #: ../fish/guestfish-actions.pod:431
5217 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
5221 #: ../fish/guestfish-actions.pod:433
5226 #: ../fish/guestfish-actions.pod:435
5229 " base64-in (base64file|-) filename\n"
5234 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
5236 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5240 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449
5241 #: ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:782
5242 #: ../fish/guestfish-actions.pod:803 ../fish/guestfish-actions.pod:902
5243 #: ../fish/guestfish-actions.pod:921 ../fish/guestfish-actions.pod:1295
5244 #: ../fish/guestfish-actions.pod:4732 ../fish/guestfish-actions.pod:4744
5245 #: ../fish/guestfish-actions.pod:4755 ../fish/guestfish-actions.pod:4766
5246 #: ../fish/guestfish-actions.pod:4818 ../fish/guestfish-actions.pod:4827
5247 #: ../fish/guestfish-actions.pod:4881 ../fish/guestfish-actions.pod:4904
5248 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
5252 #: ../fish/guestfish-actions.pod:442
5257 #: ../fish/guestfish-actions.pod:444
5260 " base64-out filename (base64file|-)\n"
5265 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
5267 "This command downloads the contents of C<filename>, writing it out to local "
5268 "file C<base64file> encoded as base64."
5272 #: ../fish/guestfish-actions.pod:451
5273 msgid "blockdev-flushbufs"
5277 #: ../fish/guestfish-actions.pod:453
5280 " blockdev-flushbufs device\n"
5285 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
5287 "This tells the kernel to flush internal buffers associated with C<device>."
5291 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469
5292 #: ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488
5293 #: ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513
5294 #: ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532
5295 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548
5296 #: ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696
5297 #: ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727
5298 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764
5299 #: ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796
5300 #: ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
5301 msgid "This uses the L<blockdev(8)> command."
5305 #: ../fish/guestfish-actions.pod:460
5306 msgid "blockdev-getbsz"
5310 #: ../fish/guestfish-actions.pod:462
5313 " blockdev-getbsz device\n"
5318 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
5319 msgid "This returns the block size of a device."
5323 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529
5324 #: ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
5326 "(Note this is different from both I<size in blocks> and I<filesystem block "
5331 #: ../fish/guestfish-actions.pod:471
5332 msgid "blockdev-getro"
5336 #: ../fish/guestfish-actions.pod:473
5339 " blockdev-getro device\n"
5344 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
5346 "Returns a boolean indicating if the block device is read-only (true if read-"
5347 "only, false if not)."
5351 #: ../fish/guestfish-actions.pod:480
5352 msgid "blockdev-getsize64"
5356 #: ../fish/guestfish-actions.pod:482
5359 " blockdev-getsize64 device\n"
5364 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
5365 msgid "This returns the size of the device in bytes."
5369 #: ../fish/guestfish-actions.pod:486
5370 msgid "See also L</blockdev-getsz>."
5374 #: ../fish/guestfish-actions.pod:490
5375 msgid "blockdev-getss"
5379 #: ../fish/guestfish-actions.pod:492
5382 " blockdev-getss device\n"
5387 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
5389 "This returns the size of sectors on a block device. Usually 512, but can be "
5390 "larger for modern devices."
5394 #: ../fish/guestfish-actions.pod:497
5396 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5400 #: ../fish/guestfish-actions.pod:502
5401 msgid "blockdev-getsz"
5405 #: ../fish/guestfish-actions.pod:504
5408 " blockdev-getsz device\n"
5413 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
5415 "This returns the size of the device in units of 512-byte sectors (even if "
5416 "the sectorsize isn't 512 bytes ... weird)."
5420 #: ../fish/guestfish-actions.pod:509
5422 "See also L</blockdev-getss> for the real sector size of the device, and L</"
5423 "blockdev-getsize64> for the more useful I<size in bytes>."
5427 #: ../fish/guestfish-actions.pod:515
5428 msgid "blockdev-rereadpt"
5432 #: ../fish/guestfish-actions.pod:517
5435 " blockdev-rereadpt device\n"
5440 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
5441 msgid "Reread the partition table on C<device>."
5445 #: ../fish/guestfish-actions.pod:523
5446 msgid "blockdev-setbsz"
5450 #: ../fish/guestfish-actions.pod:525
5453 " blockdev-setbsz device blocksize\n"
5458 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
5459 msgid "This sets the block size of a device."
5463 #: ../fish/guestfish-actions.pod:534
5464 msgid "blockdev-setro"
5468 #: ../fish/guestfish-actions.pod:536
5471 " blockdev-setro device\n"
5476 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
5477 msgid "Sets the block device named C<device> to read-only."
5481 #: ../fish/guestfish-actions.pod:542
5482 msgid "blockdev-setrw"
5486 #: ../fish/guestfish-actions.pod:544
5489 " blockdev-setrw device\n"
5494 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
5495 msgid "Sets the block device named C<device> to read-write."
5499 #: ../fish/guestfish-actions.pod:550
5500 msgid "btrfs-filesystem-resize"
5504 #: ../fish/guestfish-actions.pod:552
5507 " btrfs-filesystem-resize mountpoint [size:..]\n"
5512 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
5513 msgid "This command resizes a btrfs filesystem."
5517 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
5519 "Note that unlike other resize calls, the filesystem has to be mounted and "
5520 "the parameter is the mountpoint not the device (this is a requirement of "
5525 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3479
5526 #: ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5332
5527 msgid "The optional parameters are:"
5531 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3483
5532 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5336
5537 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5539 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5540 "resized to the maximum size."
5544 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
5545 msgid "See also L<btrfs(8)>."
5549 #: ../fish/guestfish-actions.pod:575
5550 msgid "case-sensitive-path"
5554 #: ../fish/guestfish-actions.pod:577
5557 " case-sensitive-path path\n"
5562 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5564 "This can be used to resolve case insensitive paths on a filesystem which is "
5565 "case sensitive. The use case is to resolve paths which you have read from "
5566 "Windows configuration files or the Windows Registry, to the true path."
5570 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5572 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5573 "(and probably others), which is that although the underlying filesystem is "
5574 "case-insensitive, the driver exports the filesystem to Linux as case-"
5579 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
5581 "One consequence of this is that special directories such as C<c:\\windows> "
5582 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5583 "precise details of how they were created. In Windows itself this would not "
5588 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
5590 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5595 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
5597 "This function resolves the true case of each element in the path and returns "
5598 "the case-sensitive path."
5602 #: ../fish/guestfish-actions.pod:601
5604 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
5605 "WINDOWS/system32\"> (the exact return value would depend on details of how "
5606 "the directories were originally created under Windows)."
5610 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
5611 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5615 #: ../fish/guestfish-actions.pod:609
5616 msgid "See also L</realpath>."
5620 #: ../fish/guestfish-actions.pod:611
5625 #: ../fish/guestfish-actions.pod:613
5633 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3899
5634 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5975
5635 msgid "Return the contents of the file named C<path>."
5639 #: ../fish/guestfish-actions.pod:617
5641 "Note that this function cannot correctly handle binary files (specifically, "
5642 "files containing C<\\0> character which is treated as end of string). For "
5643 "those you need to use the L</read-file> or L</download> functions which have "
5644 "a more complex interface."
5648 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757
5649 #: ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:980
5650 #: ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1057
5651 #: ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1259
5652 #: ../fish/guestfish-actions.pod:1572 ../fish/guestfish-actions.pod:1582
5653 #: ../fish/guestfish-actions.pod:1632 ../fish/guestfish-actions.pod:1647
5654 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1676
5655 #: ../fish/guestfish-actions.pod:3769 ../fish/guestfish-actions.pod:3784
5656 #: ../fish/guestfish-actions.pod:3860 ../fish/guestfish-actions.pod:3877
5657 #: ../fish/guestfish-actions.pod:3892 ../fish/guestfish-actions.pod:4573
5658 #: ../fish/guestfish-actions.pod:4619 ../fish/guestfish-actions.pod:4704
5659 #: ../fish/guestfish-actions.pod:4719 ../fish/guestfish-actions.pod:5125
5660 #: ../fish/guestfish-actions.pod:5137 ../fish/guestfish-actions.pod:5155
5661 #: ../fish/guestfish-actions.pod:5172 ../fish/guestfish-actions.pod:5182
5662 #: ../fish/guestfish-actions.pod:5239 ../fish/guestfish-actions.pod:5249
5663 #: ../fish/guestfish-actions.pod:5278 ../fish/guestfish-actions.pod:5288
5664 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127
5665 #: ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1554
5666 #: ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:1676
5667 #: ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1941
5668 #: ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2442
5669 #: ../src/guestfs-actions.pod:2507 ../src/guestfs-actions.pod:2531
5670 #: ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2577
5671 #: ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5783
5672 #: ../src/guestfs-actions.pod:5914 ../src/guestfs-actions.pod:5940
5673 #: ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6931
5674 #: ../src/guestfs-actions.pod:6986 ../src/guestfs-actions.pod:7132
5675 #: ../src/guestfs-actions.pod:7156 ../src/guestfs-actions.pod:7821
5676 #: ../src/guestfs-actions.pod:7841 ../src/guestfs-actions.pod:7874
5677 #: ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912
5678 #: ../src/guestfs-actions.pod:8006 ../src/guestfs-actions.pod:8025
5679 #: ../src/guestfs-actions.pod:8071 ../src/guestfs-actions.pod:8090
5681 "Because of the message protocol, there is a transfer limit of somewhere "
5682 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5686 #: ../fish/guestfish-actions.pod:625
5691 #: ../fish/guestfish-actions.pod:627
5694 " checksum csumtype path\n"
5699 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
5701 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5705 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
5707 "The type of checksum to compute is given by the C<csumtype> parameter which "
5708 "must have one of the following values:"
5712 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5717 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5719 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5724 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
5729 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
5730 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5734 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
5739 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
5740 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5744 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
5749 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
5750 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5754 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
5759 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
5760 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5764 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
5769 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
5770 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5774 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
5779 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
5780 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5784 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
5785 msgid "The checksum is returned as a printable string."
5789 #: ../fish/guestfish-actions.pod:670
5790 msgid "To get the checksum for a device, use L</checksum-device>."
5794 #: ../fish/guestfish-actions.pod:672
5795 msgid "To get the checksums for many files, use L</checksums-out>."
5799 #: ../fish/guestfish-actions.pod:674
5800 msgid "checksum-device"
5804 #: ../fish/guestfish-actions.pod:676
5807 " checksum-device csumtype device\n"
5812 #: ../fish/guestfish-actions.pod:678
5814 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5815 "device named C<device>. For the types of checksums supported see the L</"
5816 "checksum> command."
5820 #: ../fish/guestfish-actions.pod:682
5821 msgid "checksums-out"
5825 #: ../fish/guestfish-actions.pod:684
5828 " checksums-out csumtype directory (sumsfile|-)\n"
5833 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
5835 "This command computes the checksums of all regular files in C<directory> and "
5836 "then emits a list of those checksums to the local output file C<sumsfile>."
5840 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
5842 "This can be used for verifying the integrity of a virtual machine. However "
5843 "to be properly secure you should pay attention to the output of the checksum "
5844 "command (it uses the ones from GNU coreutils). In particular when the "
5845 "filename is not printable, coreutils uses a special backslash syntax. For "
5846 "more information, see the GNU coreutils info file."
5850 #: ../fish/guestfish-actions.pod:700
5855 #: ../fish/guestfish-actions.pod:702
5858 " chmod mode path\n"
5863 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
5865 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5870 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
5872 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5873 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5878 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3132
5879 #: ../fish/guestfish-actions.pod:3271 ../fish/guestfish-actions.pod:3281
5880 #: ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:1064
5881 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4948
5882 #: ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986
5883 msgid "The mode actually set is affected by the umask."
5887 #: ../fish/guestfish-actions.pod:713
5892 #: ../fish/guestfish-actions.pod:715
5895 " chown owner group path\n"
5900 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
5901 msgid "Change the file owner to C<owner> and group to C<group>."
5905 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2567
5906 #: ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3810
5908 "Only numeric uid and gid are supported. If you want to use names, you will "
5909 "need to locate and parse the password file yourself (Augeas support makes "
5910 "this relatively easy)."
5914 #: ../fish/guestfish-actions.pod:723
5919 #: ../fish/guestfish-actions.pod:725
5922 " command 'arguments ...'\n"
5927 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
5929 "This call runs a command from the guest filesystem. The filesystem must be "
5930 "mounted, and must contain a compatible operating system (ie. something "
5931 "Linux, with the same or compatible processor architecture)."
5935 #: ../fish/guestfish-actions.pod:732
5937 "The single parameter is an argv-style list of arguments. The first element "
5938 "is the name of the program to run. Subsequent elements are parameters. The "
5939 "list must be non-empty (ie. must contain a program name). Note that the "
5940 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5944 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
5945 msgid "The return value is anything printed to I<stdout> by the command."
5949 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
5951 "If the command returns a non-zero exit status, then this function returns an "
5952 "error message. The error message string is the content of I<stderr> from "
5957 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5959 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5960 "bin>. If you require a program from another location, you should provide "
5961 "the full path in the first parameter."
5965 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
5967 "Shared libraries and data files required by the program must be available on "
5968 "filesystems which are mounted in the correct places. It is the caller's "
5969 "responsibility to ensure all filesystems that are needed are mounted at the "
5974 #: ../fish/guestfish-actions.pod:760
5975 msgid "command-lines"
5979 #: ../fish/guestfish-actions.pod:762
5982 " command-lines 'arguments ...'\n"
5987 #: ../fish/guestfish-actions.pod:764
5989 "This is the same as L</command>, but splits the result into a list of lines."
5993 #: ../fish/guestfish-actions.pod:767
5994 msgid "See also: L</sh-lines>"
5998 #: ../fish/guestfish-actions.pod:772
5999 msgid "compress-device-out"
6003 #: ../fish/guestfish-actions.pod:774
6006 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6011 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
6013 "This command compresses C<device> and writes it out to the local file "
6018 #: ../fish/guestfish-actions.pod:779
6020 "The C<ctype> and optional C<level> parameters have the same meaning as in L</"
6025 #: ../fish/guestfish-actions.pod:786
6026 msgid "compress-out"
6030 #: ../fish/guestfish-actions.pod:788
6033 " compress-out ctype file (zfile|-) [level:..]\n"
6038 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1220
6040 "This command compresses C<file> and writes it out to the local file C<zfile>."
6044 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1223
6046 "The compression program used is controlled by the C<ctype> parameter. "
6047 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6048 "Some compression types may not be supported by particular builds of "
6049 "libguestfs, in which case you will get an error containing the substring "
6050 "\"not supported\"."
6054 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1229
6056 "The optional C<level> parameter controls compression level. The meaning and "
6057 "default for this parameter depends on the compression program being used."
6061 #: ../fish/guestfish-actions.pod:807
6066 #: ../fish/guestfish-actions.pod:809
6069 " config qemuparam qemuvalue\n"
6074 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1270
6076 "This can be used to add arbitrary qemu command line parameters of the form "
6077 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6078 "setting some parameters which would interfere with parameters that we use."
6082 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1275
6083 msgid "The first character of C<param> string must be a C<-> (dash)."
6087 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1277
6088 msgid "C<value> can be NULL."
6092 #: ../fish/guestfish-actions.pod:820
6097 #: ../fish/guestfish-actions.pod:822
6100 " copy-size src dest size\n"
6105 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1291
6107 "This command copies exactly C<size> bytes from one source device or file "
6108 "C<src> to another destination device or file C<dest>."
6112 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1294
6114 "Note this will fail if the source is too short or if the destination is not "
6119 #: ../fish/guestfish-actions.pod:830
6124 #: ../fish/guestfish-actions.pod:832
6132 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1313
6134 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6135 "destination filename or destination directory."
6139 #: ../fish/guestfish-actions.pod:837
6144 #: ../fish/guestfish-actions.pod:839
6152 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1327
6154 "This copies a file or directory from C<src> to C<dest> recursively using the "
6159 #: ../fish/guestfish-actions.pod:844
6164 #: ../fish/guestfish-actions.pod:846
6172 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1341
6174 "This command copies from one source device or file C<src> to another "
6175 "destination device or file C<dest>. Normally you would use this to copy to "
6176 "or from a device or partition, for example to duplicate a filesystem."
6180 #: ../fish/guestfish-actions.pod:853
6182 "If the destination is a device, it must be as large or larger than the "
6183 "source file or device, otherwise the copy will fail. This command cannot do "
6184 "partial copies (see L</copy-size>)."
6188 #: ../fish/guestfish-actions.pod:857
6193 #: ../fish/guestfish-actions.pod:859
6201 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1359
6202 msgid "This command runs the C<df> command to report disk space used."
6206 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
6208 "This command is mostly useful for interactive sessions. It is I<not> "
6209 "intended that you try to parse the output string. Use L</statvfs> from "
6214 #: ../fish/guestfish-actions.pod:867
6219 #: ../fish/guestfish-actions.pod:869
6227 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1375
6229 "This command runs the C<df -h> command to report disk space used in human-"
6234 #: ../fish/guestfish-actions.pod:878
6239 #: ../fish/guestfish-actions.pod:880
6247 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1392
6249 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6250 "This is sometimes useful for extended debugging of problems."
6254 #: ../fish/guestfish-actions.pod:886
6256 "Another way to get the same information is to enable verbose messages with "
6257 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
6258 "before running the program."
6262 #: ../fish/guestfish-actions.pod:891
6267 #: ../fish/guestfish-actions.pod:893
6270 " download remotefilename (filename|-)\n"
6275 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908
6276 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1438
6278 "Download file C<remotefilename> and save it as C<filename> on the local "
6283 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4877
6284 #: ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:7391
6285 msgid "C<filename> can also be a named pipe."
6289 #: ../fish/guestfish-actions.pod:900
6290 msgid "See also L</upload>, L</cat>."
6294 #: ../fish/guestfish-actions.pod:904
6295 msgid "download-offset"
6299 #: ../fish/guestfish-actions.pod:906
6302 " download-offset remotefilename (filename|-) offset size\n"
6307 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1441
6309 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6310 "region must be within the file or device)."
6314 #: ../fish/guestfish-actions.pod:914
6316 "Note that there is no limit on the amount of data that can be downloaded "
6317 "with this call, unlike with L</pread>, and this call always reads the full "
6318 "amount unless an error occurs."
6322 #: ../fish/guestfish-actions.pod:919
6323 msgid "See also L</download>, L</pread>."
6327 #: ../fish/guestfish-actions.pod:923
6332 #: ../fish/guestfish-actions.pod:925
6335 " drop-caches whattodrop\n"
6340 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1466
6342 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6343 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6344 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6348 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1471
6349 msgid "Setting C<whattodrop> to 3 should drop everything."
6353 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1473
6355 "This automatically calls L<sync(2)> before the operation, so that the "
6356 "maximum guest memory is freed."
6360 #: ../fish/guestfish-actions.pod:937
6365 #: ../fish/guestfish-actions.pod:939
6373 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1486
6375 "This command runs the C<du -s> command to estimate file space usage for "
6380 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1489
6382 "C<path> can be a file or a directory. If C<path> is a directory then the "
6383 "estimate includes the contents of the directory and all subdirectories "
6388 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1493
6390 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6394 #: ../fish/guestfish-actions.pod:951
6399 #: ../fish/guestfish-actions.pod:953
6402 " e2fsck-f device\n"
6407 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1511
6409 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6410 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6415 #: ../fish/guestfish-actions.pod:959
6417 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6418 "should use L</fsck>."
6422 #: ../fish/guestfish-actions.pod:962
6427 #: ../fish/guestfish-actions.pod:964
6430 " echo-daemon 'words ...'\n"
6435 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1528
6437 "This command concatenates the list of C<words> passed with single spaces "
6438 "between them and returns the resulting string."
6442 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1531
6443 msgid "You can use this command to test the connection through to the daemon."
6447 #: ../fish/guestfish-actions.pod:971
6448 msgid "See also L</ping-daemon>."
6452 #: ../fish/guestfish-actions.pod:973
6457 #: ../fish/guestfish-actions.pod:975
6460 " egrep regex path\n"
6465 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1547
6467 "This calls the external C<egrep> program and returns the matching lines."
6471 #: ../fish/guestfish-actions.pod:983
6476 #: ../fish/guestfish-actions.pod:985
6479 " egrepi regex path\n"
6484 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1566
6486 "This calls the external C<egrep -i> program and returns the matching lines."
6490 #: ../fish/guestfish-actions.pod:993
6495 #: ../fish/guestfish-actions.pod:995
6498 " equal file1 file2\n"
6503 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1585
6505 "This compares the two files C<file1> and C<file2> and returns true if their "
6506 "content is exactly equal, or false otherwise."
6510 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1588
6511 msgid "The external L<cmp(1)> program is used for the comparison."
6515 #: ../fish/guestfish-actions.pod:1002
6520 #: ../fish/guestfish-actions.pod:1004
6528 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1600
6530 "This returns C<true> if and only if there is a file, directory (or anything) "
6531 "with the given C<path> name."
6535 #: ../fish/guestfish-actions.pod:1009
6536 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6540 #: ../fish/guestfish-actions.pod:1011
6545 #: ../fish/guestfish-actions.pod:1013
6548 " fallocate path len\n"
6553 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034
6554 #: ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1642
6556 "This command preallocates a file (containing zero bytes) named C<path> of "
6557 "size C<len> bytes. If the file exists already, it is overwritten."
6561 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1627
6563 "Do not confuse this with the guestfish-specific C<alloc> command which "
6564 "allocates a file in the host and attaches it as a device."
6568 #: ../fish/guestfish-actions.pod:1023
6570 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
6575 #: ../fish/guestfish-actions.pod:1030
6580 #: ../fish/guestfish-actions.pod:1032
6583 " fallocate64 path len\n"
6588 #: ../fish/guestfish-actions.pod:1038
6590 "Note that this call allocates disk blocks for the file. To create a sparse "
6591 "file use L</truncate-size> instead."
6595 #: ../fish/guestfish-actions.pod:1041
6597 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6598 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6599 "maximum size of files created through that call to 1GB."
6603 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1654
6605 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6606 "commands which create a file in the host and attach it as a device."
6610 #: ../fish/guestfish-actions.pod:1050
6615 #: ../fish/guestfish-actions.pod:1052
6618 " fgrep pattern path\n"
6623 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1669
6625 "This calls the external C<fgrep> program and returns the matching lines."
6629 #: ../fish/guestfish-actions.pod:1060
6634 #: ../fish/guestfish-actions.pod:1062
6637 " fgrepi pattern path\n"
6642 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1688
6644 "This calls the external C<fgrep -i> program and returns the matching lines."
6648 #: ../fish/guestfish-actions.pod:1070
6653 #: ../fish/guestfish-actions.pod:1072
6661 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1706
6663 "This call uses the standard L<file(1)> command to determine the type or "
6664 "contents of the file."
6668 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1709
6670 "This call will also transparently look inside various types of compressed "
6675 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1712
6677 "The exact command which runs is C<file -zb path>. Note in particular that "
6678 "the filename is not prepended to the output (the I<-b> option)."
6682 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1716
6684 "The output depends on the output of the underlying L<file(1)> command and it "
6685 "can change in future in ways beyond our control. In other words, the output "
6686 "is not guaranteed by the ABI."
6690 #: ../fish/guestfish-actions.pod:1088
6692 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
6693 "(etc), L</is-zero>."
6697 #: ../fish/guestfish-actions.pod:1091
6698 msgid "file-architecture"
6702 #: ../fish/guestfish-actions.pod:1093
6705 " file-architecture filename\n"
6710 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1734
6712 "This detects the architecture of the binary C<filename>, and returns it if "
6717 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1737
6718 msgid "Currently defined architectures are:"
6722 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1741
6727 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1743
6729 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6730 "irrespective of the precise processor requirements of the binary."
6734 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1746
6739 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1748
6740 msgid "64 bit x86-64."
6744 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1750
6749 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1752
6750 msgid "32 bit SPARC."
6754 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1754
6759 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1756
6760 msgid "64 bit SPARC V9 and above."
6764 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1758
6769 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1760
6770 msgid "Intel Itanium."
6774 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1762
6779 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1764
6780 msgid "32 bit Power PC."
6784 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1766
6789 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1768
6790 msgid "64 bit Power PC."
6794 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1772
6795 msgid "Libguestfs may return other architecture strings in future."
6799 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1774
6800 msgid "The function works on at least the following types of files:"
6804 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1780
6805 msgid "many types of Un*x and Linux binary"
6809 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1784
6810 msgid "many types of Un*x and Linux shared library"
6814 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1788
6815 msgid "Windows Win32 and Win64 binaries"
6819 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1792
6820 msgid "Windows Win32 and Win64 DLLs"
6824 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1794
6825 msgid "Win32 binaries and DLLs return C<i386>."
6829 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1796
6830 msgid "Win64 binaries and DLLs return C<x86_64>."
6834 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1800
6835 msgid "Linux kernel modules"
6839 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1804
6840 msgid "Linux new-style initrd images"
6844 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1808
6845 msgid "some non-x86 Linux vmlinuz kernels"
6849 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1812
6850 msgid "What it can't do currently:"
6854 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1818
6855 msgid "static libraries (libfoo.a)"
6859 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1822
6860 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6864 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1826
6865 msgid "x86 Linux vmlinuz kernels"
6869 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1828
6871 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6872 "compressed code, and are horribly hard to unpack. If you want to find the "
6873 "architecture of a kernel, use the architecture of the associated initrd or "
6874 "kernel module(s) instead."
6878 #: ../fish/guestfish-actions.pod:1196
6883 #: ../fish/guestfish-actions.pod:1198
6891 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1846
6892 msgid "This command returns the size of C<file> in bytes."
6896 #: ../fish/guestfish-actions.pod:1202
6898 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
6899 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
6903 #: ../fish/guestfish-actions.pod:1206
6908 #: ../fish/guestfish-actions.pod:1208
6911 " fill c len path\n"
6916 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1864
6918 "This command creates a new file called C<path>. The initial content of the "
6919 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6924 #: ../fish/guestfish-actions.pod:1214
6926 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6927 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6932 #: ../fish/guestfish-actions.pod:1219
6933 msgid "fill-pattern"
6937 #: ../fish/guestfish-actions.pod:1221
6940 " fill-pattern pattern len path\n"
6945 #: ../fish/guestfish-actions.pod:1223
6947 "This function is like L</fill> except that it creates a new file of length "
6948 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6949 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6954 #: ../fish/guestfish-actions.pod:1228
6959 #: ../fish/guestfish-actions.pod:1230
6967 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1910
6969 "This command lists out all files and directories, recursively, starting at "
6970 "C<directory>. It is essentially equivalent to running the shell command "
6971 "C<find directory -print> but some post-processing happens on the output, "
6976 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1915
6978 "This returns a list of strings I<without any prefix>. Thus if the directory "
6983 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1918
6993 #: ../fish/guestfish-actions.pod:1244
6994 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6998 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1925
7009 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1930
7010 msgid "If C<directory> is not a directory, then this command returns an error."
7014 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1933
7015 msgid "The returned list is sorted."
7019 #: ../fish/guestfish-actions.pod:1257
7020 msgid "See also L</find0>."
7024 #: ../fish/guestfish-actions.pod:1262
7029 #: ../fish/guestfish-actions.pod:1264
7032 " find0 directory (files|-)\n"
7037 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1953
7039 "This command lists out all files and directories, recursively, starting at "
7040 "C<directory>, placing the resulting list in the external file called "
7045 #: ../fish/guestfish-actions.pod:1270
7047 "This command works the same way as L</find> with the following exceptions:"
7051 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1964
7052 msgid "The resulting list is written to an external file."
7056 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1968
7058 "Items (filenames) in the result are separated by C<\\0> characters. See "
7059 "L<find(1)> option I<-print0>."
7063 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1973
7064 msgid "This command is not limited in the number of names that it can return."
7068 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1978
7069 msgid "The result list is not sorted."
7073 #: ../fish/guestfish-actions.pod:1297
7074 msgid "findfs-label"
7078 #: ../fish/guestfish-actions.pod:1299
7081 " findfs-label label\n"
7086 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1992
7088 "This command searches the filesystems and returns the one which has the "
7089 "given label. An error is returned if no such filesystem can be found."
7093 #: ../fish/guestfish-actions.pod:1305
7094 msgid "To find the label of a filesystem, use L</vfs-label>."
7098 #: ../fish/guestfish-actions.pod:1307
7103 #: ../fish/guestfish-actions.pod:1309
7106 " findfs-uuid uuid\n"
7111 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2009
7113 "This command searches the filesystems and returns the one which has the "
7114 "given UUID. An error is returned if no such filesystem can be found."
7118 #: ../fish/guestfish-actions.pod:1315
7119 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7123 #: ../fish/guestfish-actions.pod:1317
7128 #: ../fish/guestfish-actions.pod:1319
7131 " fsck fstype device\n"
7136 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2027
7138 "This runs the filesystem checker (fsck) on C<device> which should have "
7139 "filesystem type C<fstype>."
7143 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2030
7145 "The returned integer is the status. See L<fsck(8)> for the list of status "
7146 "codes from C<fsck>."
7150 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2039
7151 msgid "Multiple status codes can be summed together."
7155 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2043
7157 "A non-zero return code can mean \"success\", for example if errors have been "
7158 "corrected on the filesystem."
7162 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2048
7163 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7167 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2053
7169 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7173 #: ../fish/guestfish-actions.pod:1349
7178 #: ../fish/guestfish-actions.pod:1351
7186 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2064
7188 "Return the additional kernel options which are added to the guest kernel "
7193 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2067
7194 msgid "If C<NULL> then no options are added."
7198 #: ../fish/guestfish-actions.pod:1358
7199 msgid "get-attach-method"
7203 #: ../fish/guestfish-actions.pod:1360
7206 " get-attach-method\n"
7211 #: ../fish/guestfish-actions.pod:1362
7212 msgid "Return the current attach method. See L</set-attach-method>."
7216 #: ../fish/guestfish-actions.pod:1364
7217 msgid "get-autosync"
7221 #: ../fish/guestfish-actions.pod:1366
7229 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2092
7230 msgid "Get the autosync flag."
7234 #: ../fish/guestfish-actions.pod:1370
7239 #: ../fish/guestfish-actions.pod:1372
7247 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2103
7248 msgid "Return the direct appliance mode flag."
7252 #: ../fish/guestfish-actions.pod:1376
7257 #: ../fish/guestfish-actions.pod:1378
7260 " get-e2label device\n"
7265 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2122
7267 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7271 #: ../fish/guestfish-actions.pod:1383
7273 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
7278 #: ../fish/guestfish-actions.pod:1390
7283 #: ../fish/guestfish-actions.pod:1392
7286 " get-e2uuid device\n"
7291 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2143
7293 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7297 #: ../fish/guestfish-actions.pod:1397
7299 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
7304 #: ../fish/guestfish-actions.pod:1404
7309 #: ../fish/guestfish-actions.pod:1406
7317 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2156
7319 "This gets the memory size in megabytes allocated to the qemu subprocess."
7323 #: ../fish/guestfish-actions.pod:1411
7325 "If L</set-memsize> was not called on this handle, and if "
7326 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7327 "value for memsize."
7331 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472
7332 #: ../fish/guestfish-actions.pod:4225 ../fish/guestfish-actions.pod:4327
7333 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2255
7334 #: ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6562
7336 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7340 #: ../fish/guestfish-actions.pod:1418
7345 #: ../fish/guestfish-actions.pod:1420
7353 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2175
7354 msgid "This returns the enable network flag."
7358 #: ../fish/guestfish-actions.pod:1424
7363 #: ../fish/guestfish-actions.pod:1426
7371 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2186
7372 msgid "Return the current search path."
7376 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2188
7378 "This is always non-NULL. If it wasn't set already, then this will return "
7383 #: ../fish/guestfish-actions.pod:1433
7388 #: ../fish/guestfish-actions.pod:1435
7396 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2201
7397 msgid "This returns the process group flag."
7401 #: ../fish/guestfish-actions.pod:1439
7406 #: ../fish/guestfish-actions.pod:1441
7411 #: ../fish/guestfish-actions.pod:1443
7419 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2212
7421 "Return the process ID of the qemu subprocess. If there is no qemu "
7422 "subprocess, then this will return an error."
7426 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2215
7427 msgid "This is an internal call used for debugging and testing."
7431 #: ../fish/guestfish-actions.pod:1450
7436 #: ../fish/guestfish-actions.pod:1452
7444 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2226
7445 msgid "Return the current qemu binary."
7449 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2228
7451 "This is always non-NULL. If it wasn't set already, then this will return "
7452 "the default qemu binary name."
7456 #: ../fish/guestfish-actions.pod:1459
7457 msgid "get-recovery-proc"
7461 #: ../fish/guestfish-actions.pod:1461
7464 " get-recovery-proc\n"
7469 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2241
7470 msgid "Return the recovery process enabled flag."
7474 #: ../fish/guestfish-actions.pod:1465
7479 #: ../fish/guestfish-actions.pod:1467
7487 #: ../fish/guestfish-actions.pod:1469
7489 "This returns the current setting of the selinux flag which is passed to the "
7490 "appliance at boot time. See L</set-selinux>."
7494 #: ../fish/guestfish-actions.pod:1475
7499 #: ../fish/guestfish-actions.pod:1477
7507 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2267
7508 msgid "This returns the number of virtual CPUs assigned to the appliance."
7512 #: ../fish/guestfish-actions.pod:1481
7517 #: ../fish/guestfish-actions.pod:1483
7525 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2278
7527 "This returns the current state as an opaque integer. This is only useful "
7528 "for printing debug and internal error messages."
7532 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2434
7533 #: ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2490
7534 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:2281
7535 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3616
7536 #: ../src/guestfs-actions.pod:3677 ../src/guestfs-actions.pod:3704
7537 msgid "For more information on states, see L<guestfs(3)>."
7541 #: ../fish/guestfish-actions.pod:1490
7546 #: ../fish/guestfish-actions.pod:1492
7554 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2292
7555 msgid "Return the command trace flag."
7559 #: ../fish/guestfish-actions.pod:1496
7564 #: ../fish/guestfish-actions.pod:1498
7572 #: ../fish/guestfish-actions.pod:1500
7574 "Return the current umask. By default the umask is C<022> unless it has been "
7575 "set by calling L</umask>."
7579 #: ../fish/guestfish-actions.pod:1503
7584 #: ../fish/guestfish-actions.pod:1505
7592 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2315
7593 msgid "This returns the verbose messages flag."
7597 #: ../fish/guestfish-actions.pod:1509
7602 #: ../fish/guestfish-actions.pod:1511
7610 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2326
7611 msgid "This gets the SELinux security context of the daemon."
7615 #: ../fish/guestfish-actions.pod:1515
7616 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7620 #: ../fish/guestfish-actions.pod:1518
7625 #: ../fish/guestfish-actions.pod:1520
7628 " getxattr path name\n"
7633 #: ../fish/guestfish-actions.pod:1522
7635 "Get a single extended attribute from file C<path> named C<name>. This call "
7636 "follows symlinks. If you want to lookup an extended attribute for the "
7637 "symlink itself, use L</lgetxattr>."
7641 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2579
7643 "Normally it is better to get all extended attributes from a file in one go "
7644 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7645 "buggy and do not provide a way to list out attributes. For these "
7646 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7647 "attributes you want in advance and call this function."
7651 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2586
7652 #: ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3837
7654 "Extended attribute values are blobs of binary data. If there is no extended "
7655 "attribute named C<name>, this returns an error."
7659 #: ../fish/guestfish-actions.pod:1536
7660 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7664 #: ../fish/guestfish-actions.pod:1538
7669 #: ../fish/guestfish-actions.pod:1540
7677 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2372
7679 "This call lists the extended attributes of the file or directory C<path>."
7683 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2375
7685 "At the system call level, this is a combination of the L<listxattr(2)> and "
7686 "L<getxattr(2)> calls."
7690 #: ../fish/guestfish-actions.pod:1548
7691 msgid "See also: L</lgetxattrs>, L<attr(5)>."
7695 #: ../fish/guestfish-actions.pod:1550
7700 #: ../fish/guestfish-actions.pod:1552
7703 " glob-expand pattern\n"
7708 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2392
7710 "This command searches for all the pathnames matching C<pattern> according to "
7711 "the wildcard expansion rules used by the shell."
7715 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2396
7717 "If no paths match, then this returns an empty list (note: not an error)."
7721 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2399
7723 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
7724 "GLOB_BRACE>. See that manual page for more details."
7728 #: ../fish/guestfish-actions.pod:1565
7733 #: ../fish/guestfish-actions.pod:1567
7736 " grep regex path\n"
7741 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2416
7742 msgid "This calls the external C<grep> program and returns the matching lines."
7746 #: ../fish/guestfish-actions.pod:1575
7751 #: ../fish/guestfish-actions.pod:1577
7754 " grepi regex path\n"
7759 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2435
7761 "This calls the external C<grep -i> program and returns the matching lines."
7765 #: ../fish/guestfish-actions.pod:1585
7766 msgid "grub-install"
7770 #: ../fish/guestfish-actions.pod:1587
7773 " grub-install root device\n"
7778 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2454
7780 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
7781 "with the root directory being C<root>."
7785 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2463
7787 "There is currently no way in the API to install grub2, which is used by most "
7788 "modern Linux guests. It is possible to run the grub2 command from the "
7789 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
7793 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2470
7795 "This uses C<grub-install> from the host. Unfortunately grub is not always "
7796 "compatible with itself, so this only works in rather narrow circumstances. "
7797 "Careful testing with each guest version is advisable."
7801 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2477
7803 "If grub-install reports the error \"No suitable drive was found in the "
7804 "generated device map.\" it may be that you need to create a C</boot/grub/"
7805 "device.map> file first that contains the mapping between grub device names "
7806 "and Linux device names. It is usually sufficient to create a file "
7811 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2484
7819 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2486
7820 msgid "replacing C</dev/vda> with the name of the installation device."
7824 #: ../fish/guestfish-actions.pod:1625
7829 #: ../fish/guestfish-actions.pod:1627
7837 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2500
7839 "This command returns up to the first 10 lines of a file as a list of strings."
7843 #: ../fish/guestfish-actions.pod:1635
7848 #: ../fish/guestfish-actions.pod:1637
7851 " head-n nrlines path\n"
7856 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2519
7858 "If the parameter C<nrlines> is a positive number, this returns the first "
7859 "C<nrlines> lines of the file C<path>."
7863 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2522
7865 "If the parameter C<nrlines> is a negative number, this returns lines from "
7866 "the file C<path>, excluding the last C<nrlines> lines."
7870 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4717
7871 #: ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:7150
7872 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7876 #: ../fish/guestfish-actions.pod:1650
7881 #: ../fish/guestfish-actions.pod:1652
7889 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2542
7891 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7892 "readable, canonical hex dump of the file."
7896 #: ../fish/guestfish-actions.pod:1660
7901 #: ../fish/guestfish-actions.pod:1662
7904 " initrd-cat initrdpath filename\n"
7909 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2561
7911 "This command unpacks the file C<filename> from the initrd file called "
7912 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7917 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2565
7919 "For example, in guestfish you could use the following command to examine the "
7920 "boot script (usually called C</init>) contained in a Linux initrd or "
7925 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2569
7928 " initrd-cat /boot/initrd-<version>.img init\n"
7933 #: ../fish/guestfish-actions.pod:1674
7934 msgid "See also L</initrd-list>."
7938 #: ../fish/guestfish-actions.pod:1679
7943 #: ../fish/guestfish-actions.pod:1681
7946 " initrd-list path\n"
7951 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2588
7952 msgid "This command lists out files contained in an initrd."
7956 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2590
7958 "The files are listed without any initial C</> character. The files are "
7959 "listed in the order they appear (not necessarily alphabetical). Directory "
7960 "names are listed as separate items."
7964 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2594
7966 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7967 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7972 #: ../fish/guestfish-actions.pod:1693
7973 msgid "inotify-add-watch"
7977 #: ../fish/guestfish-actions.pod:1695
7980 " inotify-add-watch path mask\n"
7985 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2611
7986 msgid "Watch C<path> for the events listed in C<mask>."
7990 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2613
7992 "Note that if C<path> is a directory then events within that directory are "
7993 "watched, but this does I<not> happen recursively (in subdirectories)."
7997 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2617
7999 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8000 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8004 #: ../fish/guestfish-actions.pod:1707
8005 msgid "inotify-close"
8009 #: ../fish/guestfish-actions.pod:1709
8017 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2630
8019 "This closes the inotify handle which was previously opened by inotify_init. "
8020 "It removes all watches, throws away any pending events, and deallocates all "
8025 #: ../fish/guestfish-actions.pod:1715
8026 msgid "inotify-files"
8030 #: ../fish/guestfish-actions.pod:1717
8038 #: ../fish/guestfish-actions.pod:1719
8040 "This function is a helpful wrapper around L</inotify-read> which just "
8041 "returns a list of pathnames of objects that were touched. The returned "
8042 "pathnames are sorted and deduplicated."
8046 #: ../fish/guestfish-actions.pod:1723
8047 msgid "inotify-init"
8051 #: ../fish/guestfish-actions.pod:1725
8054 " inotify-init maxevents\n"
8059 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2659
8061 "This command creates a new inotify handle. The inotify subsystem can be "
8062 "used to notify events which happen to objects in the guest filesystem."
8066 #: ../fish/guestfish-actions.pod:1731
8068 "C<maxevents> is the maximum number of events which will be queued up between "
8069 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8070 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8071 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8072 "but records the fact that it threw them away by setting a flag "
8073 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8077 #: ../fish/guestfish-actions.pod:1741
8079 "Before any events are generated, you have to add some watches to the "
8080 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8081 "L</inotify-watch-all>."
8085 #: ../fish/guestfish-actions.pod:1747
8087 "Queued up events should be read periodically by calling L</inotify-read> (or "
8088 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8089 "If you don't read the events out often enough then you risk the internal "
8090 "queue overflowing."
8094 #: ../fish/guestfish-actions.pod:1754
8096 "The handle should be closed after use by calling L</inotify-close>. This "
8097 "also removes any watches automatically."
8101 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2690
8103 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8104 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8105 "that there is one global inotify handle per libguestfs instance."
8109 #: ../fish/guestfish-actions.pod:1763
8110 msgid "inotify-read"
8114 #: ../fish/guestfish-actions.pod:1765
8122 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2704
8124 "Return the complete queue of events that have happened since the previous "
8129 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2707
8130 msgid "If no events have happened, this returns an empty list."
8134 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2709
8136 "I<Note>: In order to make sure that all events have been read, you must call "
8137 "this function repeatedly until it returns an empty list. The reason is that "
8138 "the call will read events up to the maximum appliance-to-host message size "
8139 "and leave remaining events in the queue."
8143 #: ../fish/guestfish-actions.pod:1778
8144 msgid "inotify-rm-watch"
8148 #: ../fish/guestfish-actions.pod:1780
8151 " inotify-rm-watch wd\n"
8156 #: ../fish/guestfish-actions.pod:1782
8157 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8161 #: ../fish/guestfish-actions.pod:1785
8162 msgid "inspect-get-arch"
8166 #: ../fish/guestfish-actions.pod:1787
8169 " inspect-get-arch root\n"
8174 #: ../fish/guestfish-actions.pod:1789
8176 "This returns the architecture of the inspected operating system. The "
8177 "possible return values are listed under L</file-architecture>."
8181 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2744
8183 "If the architecture could not be determined, then the string C<unknown> is "
8188 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1883
8189 #: ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1974
8190 #: ../fish/guestfish-actions.pod:2058 ../fish/guestfish-actions.pod:2119
8191 #: ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2154
8192 #: ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2226
8193 #: ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252
8194 #: ../fish/guestfish-actions.pod:2262 ../fish/guestfish-actions.pod:2272
8195 #: ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2380
8196 #: ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:2747
8197 #: ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2945
8198 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3095
8199 #: ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3206
8200 #: ../src/guestfs-actions.pod:3227 ../src/guestfs-actions.pod:3280
8201 #: ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3340
8202 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3377
8203 #: ../src/guestfs-actions.pod:3393 ../src/guestfs-actions.pod:3411
8204 #: ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3554
8205 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8209 #: ../fish/guestfish-actions.pod:1798
8210 msgid "inspect-get-distro"
8214 #: ../fish/guestfish-actions.pod:1800
8217 " inspect-get-distro root\n"
8222 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2760
8224 "This returns the distro (distribution) of the inspected operating system."
8228 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2763
8229 msgid "Currently defined distros are:"
8233 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2767
8234 msgid "\"archlinux\""
8238 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2769
8243 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2771
8248 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2773
8253 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2775
8258 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2777
8263 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2779
8268 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2781
8273 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2783
8278 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2785
8283 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2787
8284 msgid "\"linuxmint\""
8288 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2789
8293 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2791
8294 msgid "\"mandriva\""
8298 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2793
8303 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2795
8308 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2797
8313 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2799
8318 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2801
8323 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2803
8324 msgid "\"redhat-based\""
8328 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2805
8329 msgid "Some Red Hat-derived distro."
8333 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2807
8338 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2809
8339 msgid "Red Hat Enterprise Linux."
8343 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2811
8344 msgid "\"scientificlinux\""
8348 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2813
8349 msgid "Scientific Linux."
8353 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2815
8354 msgid "\"slackware\""
8358 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2817
8363 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2819
8364 msgid "\"ttylinux\""
8368 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2821
8373 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2823
8378 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2825
8383 #: ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:1953
8384 #: ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:2827
8385 #: ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3311
8390 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2829
8391 msgid "The distro could not be determined."
8395 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:2209
8396 #: ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:3303
8401 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2833
8403 "Windows does not have distributions. This string is returned if the OS type "
8408 #: ../fish/guestfish-actions.pod:1880 ../fish/guestfish-actions.pod:1959
8409 #: ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2838
8410 #: ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:3317
8412 "Future versions of libguestfs may return other strings here. The caller "
8413 "should be prepared to handle any string."
8417 #: ../fish/guestfish-actions.pod:1885
8418 msgid "inspect-get-drive-mappings"
8422 #: ../fish/guestfish-actions.pod:1887
8425 " inspect-get-drive-mappings root\n"
8430 #: ../fish/guestfish-actions.pod:1889 ../src/guestfs-actions.pod:2854
8432 "This call is useful for Windows which uses a primitive system of assigning "
8433 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8434 "Windows Registry to find out how disks/partitions are mapped to drive "
8435 "letters, and returns a hash table as in the example below:"
8439 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2860
8449 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2864
8451 "Note that keys are drive letters. For Windows, the key is case insensitive "
8452 "and just contains the drive letter, without the customary colon separator "
8457 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2868
8459 "In future we may support other operating systems that also used drive "
8460 "letters, but the keys for those might not be case insensitive and might be "
8461 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8466 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2873
8468 "For Windows guests, currently only hard drive mappings are returned. "
8469 "Removable disks (eg. DVD-ROMs) are ignored."
8473 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2876
8475 "For guests that do not use drive mappings, or if the drive mappings could "
8476 "not be determined, this returns an empty hash table."
8480 #: ../fish/guestfish-actions.pod:1914
8482 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8483 "get-mountpoints>, L</inspect-get-filesystems>."
8487 #: ../fish/guestfish-actions.pod:1918
8488 msgid "inspect-get-filesystems"
8492 #: ../fish/guestfish-actions.pod:1920
8495 " inspect-get-filesystems root\n"
8500 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:2897
8502 "This returns a list of all the filesystems that we think are associated with "
8503 "this operating system. This includes the root filesystem, other ordinary "
8504 "filesystems, and non-mounted devices like swap partitions."
8508 #: ../fish/guestfish-actions.pod:1927 ../src/guestfs-actions.pod:2902
8510 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8511 "to be shared between operating systems."
8515 #: ../fish/guestfish-actions.pod:1930
8517 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8522 #: ../fish/guestfish-actions.pod:1933
8523 msgid "inspect-get-format"
8527 #: ../fish/guestfish-actions.pod:1935
8530 " inspect-get-format root\n"
8535 #: ../fish/guestfish-actions.pod:1937 ../src/guestfs-actions.pod:2920
8537 "This returns the format of the inspected operating system. You can use it "
8538 "to detect install images, live CDs and similar."
8542 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2923
8543 msgid "Currently defined formats are:"
8547 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:2927
8548 msgid "\"installed\""
8552 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2929
8553 msgid "This is an installed operating system."
8557 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2931
8558 msgid "\"installer\""
8562 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2933
8564 "The disk image being inspected is not an installed operating system, but a "
8565 "I<bootable> install disk, live CD, or similar."
8569 #: ../fish/guestfish-actions.pod:1955 ../src/guestfs-actions.pod:2938
8570 msgid "The format of this disk image is not known."
8574 #: ../fish/guestfish-actions.pod:1964
8575 msgid "inspect-get-hostname"
8579 #: ../fish/guestfish-actions.pod:1966
8582 " inspect-get-hostname root\n"
8587 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2958
8589 "This function returns the hostname of the operating system as found by "
8590 "inspection of the guest's configuration files."
8594 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:2961
8596 "If the hostname could not be determined, then the string C<unknown> is "
8601 #: ../fish/guestfish-actions.pod:1976
8602 msgid "inspect-get-icon"
8606 #: ../fish/guestfish-actions.pod:1978
8609 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8614 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:2987
8616 "This function returns an icon corresponding to the inspected operating "
8617 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8618 "to PNG if necessary)."
8622 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2991
8624 "If it was not possible to get an icon this function returns a zero-length "
8625 "(non-NULL) buffer. I<Callers must check for this case>."
8629 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:2994
8631 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8632 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8633 "this file will be returned. You can disable favicons by passing the "
8634 "optional C<favicon> boolean as false (default is true)."
8638 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3000
8640 "If finding the favicon fails, then we look in other places in the guest for "
8645 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3003
8647 "If the optional C<highquality> boolean is true then only high quality icons "
8648 "are returned, which means only icons of high resolution with an alpha "
8649 "channel. The default (false) is to return any icon we can, even if it is of "
8650 "substandard quality."
8654 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3014
8656 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8657 "before you call this, since it needs to read information from the guest "
8658 "filesystem during the call."
8662 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3020
8664 "B<Security:> The icon data comes from the untrusted guest, and should be "
8665 "treated with caution. PNG files have been known to contain exploits. "
8666 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8667 "trying to process or display the icon."
8671 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3028
8673 "The PNG image returned can be any size. It might not be square. Libguestfs "
8674 "tries to return the largest, highest quality icon available. The "
8675 "application must scale the icon to the required size."
8679 #: ../fish/guestfish-actions.pod:2028 ../src/guestfs-actions.pod:3035
8681 "Extracting icons from Windows guests requires the external C<wrestool> "
8682 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8683 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
8684 "installed separately."
8688 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3042
8690 "Operating system icons are usually trademarks. Seek legal advice before "
8691 "using trademarks in applications."
8695 #: ../fish/guestfish-actions.pod:2042
8696 msgid "inspect-get-major-version"
8700 #: ../fish/guestfish-actions.pod:2044
8703 " inspect-get-major-version root\n"
8708 #: ../fish/guestfish-actions.pod:2046 ../src/guestfs-actions.pod:3083
8710 "This returns the major version number of the inspected operating system."
8714 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3086
8716 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8717 "popular public names used by the operating system. Notably the operating "
8718 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8719 "1). You can find out the real versions corresponding to releases of Windows "
8720 "by consulting Wikipedia or MSDN."
8724 #: ../fish/guestfish-actions.pod:2056 ../fish/guestfish-actions.pod:2067
8725 #: ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3110
8726 msgid "If the version could not be determined, then C<0> is returned."
8730 #: ../fish/guestfish-actions.pod:2060
8731 msgid "inspect-get-minor-version"
8735 #: ../fish/guestfish-actions.pod:2062
8738 " inspect-get-minor-version root\n"
8743 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3107
8745 "This returns the minor version number of the inspected operating system."
8749 #: ../fish/guestfish-actions.pod:2069
8751 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8752 "get-major-version>."
8756 #: ../fish/guestfish-actions.pod:2072
8757 msgid "inspect-get-mountpoints"
8761 #: ../fish/guestfish-actions.pod:2074
8764 " inspect-get-mountpoints root\n"
8769 #: ../fish/guestfish-actions.pod:2076 ../src/guestfs-actions.pod:3125
8771 "This returns a hash of where we think the filesystems associated with this "
8772 "operating system should be mounted. Callers should note that this is at "
8773 "best an educated guess made by reading configuration files such as C</etc/"
8774 "fstab>. I<In particular note> that this may return filesystems which are "
8775 "non-existent or not mountable and callers should be prepared to handle or "
8776 "ignore failures if they try to mount them."
8780 #: ../fish/guestfish-actions.pod:2085 ../src/guestfs-actions.pod:3134
8782 "Each element in the returned hashtable has a key which is the path of the "
8783 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8784 "mounted there (eg. C</dev/sda1>)."
8788 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3139
8790 "Non-mounted devices such as swap devices are I<not> returned in this list."
8794 #: ../fish/guestfish-actions.pod:2093
8796 "For operating systems like Windows which still use drive letters, this call "
8797 "will only return an entry for the first drive \"mounted on\" C</>. For "
8798 "information about the mapping of drive letters to partitions, see L</inspect-"
8799 "get-drive-mappings>."
8803 #: ../fish/guestfish-actions.pod:2099
8805 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8810 #: ../fish/guestfish-actions.pod:2102
8811 msgid "inspect-get-package-format"
8815 #: ../fish/guestfish-actions.pod:2104
8818 " inspect-get-package-format root\n"
8823 #: ../fish/guestfish-actions.pod:2106
8825 "This function and L</inspect-get-package-management> return the package "
8826 "format and package management tool used by the inspected operating system. "
8827 "For example for Fedora these functions would return C<rpm> (package format) "
8828 "and C<yum> (package management)."
8832 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3171
8834 "This returns the string C<unknown> if we could not determine the package "
8835 "format I<or> if the operating system does not have a real packaging system "
8840 #: ../fish/guestfish-actions.pod:2116 ../src/guestfs-actions.pod:3175
8842 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8843 "Future versions of libguestfs may return other strings."
8847 #: ../fish/guestfish-actions.pod:2121
8848 msgid "inspect-get-package-management"
8852 #: ../fish/guestfish-actions.pod:2123
8855 " inspect-get-package-management root\n"
8860 #: ../fish/guestfish-actions.pod:2125
8862 "L</inspect-get-package-format> and this function return the package format "
8863 "and package management tool used by the inspected operating system. For "
8864 "example for Fedora these functions would return C<rpm> (package format) and "
8865 "C<yum> (package management)."
8869 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3197
8871 "This returns the string C<unknown> if we could not determine the package "
8872 "management tool I<or> if the operating system does not have a real packaging "
8873 "system (eg. Windows)."
8877 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3201
8879 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8880 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8881 "libguestfs may return other strings."
8885 #: ../fish/guestfish-actions.pod:2142
8886 msgid "inspect-get-product-name"
8890 #: ../fish/guestfish-actions.pod:2144
8893 " inspect-get-product-name root\n"
8898 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3219
8900 "This returns the product name of the inspected operating system. The "
8901 "product name is generally some freeform string which can be displayed to the "
8902 "user, but should not be parsed by programs."
8906 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:3224
8908 "If the product name could not be determined, then the string C<unknown> is "
8913 #: ../fish/guestfish-actions.pod:2156
8914 msgid "inspect-get-product-variant"
8918 #: ../fish/guestfish-actions.pod:2158
8921 " inspect-get-product-variant root\n"
8926 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3240
8927 msgid "This returns the product variant of the inspected operating system."
8931 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3243
8933 "For Windows guests, this returns the contents of the Registry key C<HKLM"
8934 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
8935 "is usually a string such as C<Client> or C<Server> (other values are "
8936 "possible). This can be used to distinguish consumer and enterprise versions "
8937 "of Windows that have the same version number (for example, Windows 7 and "
8938 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8939 "the latter is C<Server>)."
8943 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3252
8945 "For enterprise Linux guests, in future we intend this to return the product "
8946 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8947 "implemented at present."
8951 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3256
8953 "If the product variant could not be determined, then the string C<unknown> "
8958 #: ../fish/guestfish-actions.pod:2179
8960 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8961 "get-product-name>, L</inspect-get-major-version>."
8965 #: ../fish/guestfish-actions.pod:2183
8966 msgid "inspect-get-roots"
8970 #: ../fish/guestfish-actions.pod:2185
8973 " inspect-get-roots\n"
8978 #: ../fish/guestfish-actions.pod:2187
8980 "This function is a convenient way to get the list of root devices, as "
8981 "returned from a previous call to L</inspect-os>, but without redoing the "
8982 "whole inspection process."
8986 #: ../fish/guestfish-actions.pod:2191
8988 "This returns an empty list if either no root devices were found or the "
8989 "caller has not called L</inspect-os>."
8993 #: ../fish/guestfish-actions.pod:2196
8994 msgid "inspect-get-type"
8998 #: ../fish/guestfish-actions.pod:2198
9001 " inspect-get-type root\n"
9006 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3294
9008 "This returns the type of the inspected operating system. Currently defined "
9013 #: ../fish/guestfish-actions.pod:2205 ../src/guestfs-actions.pod:3299
9018 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3301
9019 msgid "Any Linux-based operating system."
9023 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3305
9024 msgid "Any Microsoft Windows operating system."
9028 #: ../fish/guestfish-actions.pod:2213 ../src/guestfs-actions.pod:3307
9033 #: ../fish/guestfish-actions.pod:2215 ../src/guestfs-actions.pod:3309
9038 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3313
9039 msgid "The operating system type could not be determined."
9043 #: ../fish/guestfish-actions.pod:2228
9044 msgid "inspect-get-windows-current-control-set"
9048 #: ../fish/guestfish-actions.pod:2230
9051 " inspect-get-windows-current-control-set root\n"
9056 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3333
9058 "This returns the Windows CurrentControlSet of the inspected guest. The "
9059 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9063 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3336
9065 "This call assumes that the guest is Windows and that the Registry could be "
9066 "examined by inspection. If this is not the case then an error is returned."
9070 #: ../fish/guestfish-actions.pod:2241
9071 msgid "inspect-get-windows-systemroot"
9075 #: ../fish/guestfish-actions.pod:2243
9078 " inspect-get-windows-systemroot root\n"
9083 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3353
9085 "This returns the Windows systemroot of the inspected guest. The systemroot "
9086 "is a directory path such as C</WINDOWS>."
9090 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3356
9092 "This call assumes that the guest is Windows and that the systemroot could be "
9093 "determined by inspection. If this is not the case then an error is returned."
9097 #: ../fish/guestfish-actions.pod:2254
9098 msgid "inspect-is-live"
9102 #: ../fish/guestfish-actions.pod:2256
9105 " inspect-is-live root\n"
9110 #: ../fish/guestfish-actions.pod:2258
9112 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9113 "then this returns true if a live image was detected on the disk."
9117 #: ../fish/guestfish-actions.pod:2264
9118 msgid "inspect-is-multipart"
9122 #: ../fish/guestfish-actions.pod:2266
9125 " inspect-is-multipart root\n"
9130 #: ../fish/guestfish-actions.pod:2268
9132 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9133 "then this returns true if the disk is part of a set."
9137 #: ../fish/guestfish-actions.pod:2274
9138 msgid "inspect-is-netinst"
9142 #: ../fish/guestfish-actions.pod:2276
9145 " inspect-is-netinst root\n"
9150 #: ../fish/guestfish-actions.pod:2278
9152 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9153 "then this returns true if the disk is a network installer, ie. not a self-"
9154 "contained install CD but one which is likely to require network access to "
9155 "complete the install."
9159 #: ../fish/guestfish-actions.pod:2286
9160 msgid "inspect-list-applications"
9164 #: ../fish/guestfish-actions.pod:2288
9167 " inspect-list-applications root\n"
9172 #: ../fish/guestfish-actions.pod:2290 ../src/guestfs-actions.pod:3423
9173 msgid "Return the list of applications installed in the operating system."
9177 #: ../fish/guestfish-actions.pod:2292
9179 "I<Note:> This call works differently from other parts of the inspection "
9180 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9181 "then mount up the disks, before calling this. Listing applications is a "
9182 "significantly more difficult operation which requires access to the full "
9183 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9184 "are just returning data cached in the libguestfs handle, this call actually "
9185 "reads parts of the mounted filesystems during the call."
9189 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3435
9191 "This returns an empty list if the inspection code was not able to determine "
9192 "the list of applications."
9196 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3438
9197 msgid "The application structure contains the following fields:"
9201 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3442
9206 #: ../fish/guestfish-actions.pod:2311 ../src/guestfs-actions.pod:3444
9208 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9209 "guests, this is the package name."
9213 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3447
9214 msgid "C<app_display_name>"
9218 #: ../fish/guestfish-actions.pod:2316 ../src/guestfs-actions.pod:3449
9220 "The display name of the application, sometimes localized to the install "
9221 "language of the guest operating system."
9225 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3452
9227 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9228 "to display something can use C<app_name> instead."
9232 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3455
9233 msgid "C<app_epoch>"
9237 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3457
9239 "For package managers which use epochs, this contains the epoch of the "
9240 "package (an integer). If unavailable, this is returned as C<0>."
9244 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3460
9245 msgid "C<app_version>"
9249 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3462
9251 "The version string of the application or package. If unavailable this is "
9252 "returned as an empty string C<\"\">."
9256 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3465
9257 msgid "C<app_release>"
9261 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3467
9263 "The release string of the application or package, for package managers that "
9264 "use this. If unavailable this is returned as an empty string C<\"\">."
9268 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3471
9269 msgid "C<app_install_path>"
9273 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3473
9275 "The installation path of the application (on operating systems such as "
9276 "Windows which use installation paths). This path is in the format used by "
9277 "the guest operating system, it is not a libguestfs path."
9281 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3478
9282 msgid "If unavailable this is returned as an empty string C<\"\">."
9286 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3480
9287 msgid "C<app_trans_path>"
9291 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3482
9293 "The install path translated into a libguestfs path. If unavailable this is "
9294 "returned as an empty string C<\"\">."
9298 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3485
9299 msgid "C<app_publisher>"
9303 #: ../fish/guestfish-actions.pod:2354 ../src/guestfs-actions.pod:3487
9305 "The name of the publisher of the application, for package managers that use "
9306 "this. If unavailable this is returned as an empty string C<\"\">."
9310 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3491
9315 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3493
9317 "The URL (eg. upstream URL) of the application. If unavailable this is "
9318 "returned as an empty string C<\"\">."
9322 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3496
9323 msgid "C<app_source_package>"
9327 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3498
9329 "For packaging systems which support this, the name of the source package. "
9330 "If unavailable this is returned as an empty string C<\"\">."
9334 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3501
9335 msgid "C<app_summary>"
9339 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3503
9341 "A short (usually one line) description of the application or package. If "
9342 "unavailable this is returned as an empty string C<\"\">."
9346 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3506
9347 msgid "C<app_description>"
9351 #: ../fish/guestfish-actions.pod:2375 ../src/guestfs-actions.pod:3508
9353 "A longer description of the application or package. If unavailable this is "
9354 "returned as an empty string C<\"\">."
9358 #: ../fish/guestfish-actions.pod:2382
9363 #: ../fish/guestfish-actions.pod:2384
9371 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3526
9373 "This function uses other libguestfs functions and certain heuristics to "
9374 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9375 "for operating systems."
9379 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3530
9380 msgid "The list returned is empty if no operating systems were found."
9384 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3532
9386 "If one operating system was found, then this returns a list with a single "
9387 "element, which is the name of the root filesystem of this operating system. "
9388 "It is also possible for this function to return a list containing more than "
9389 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9390 "element being the root filesystem of one of the operating systems."
9394 #: ../fish/guestfish-actions.pod:2399
9396 "You can pass the root string(s) returned to other L</inspect-get-*> "
9397 "functions in order to query further information about each operating system, "
9398 "such as the name and version."
9402 #: ../fish/guestfish-actions.pod:2404
9404 "This function uses other libguestfs features such as L</mount-ro> and L</"
9405 "umount-all> in order to mount and unmount filesystems and look at the "
9406 "contents. This should be called with no disks currently mounted. The "
9407 "function may also use Augeas, so any existing Augeas handle will be closed."
9411 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3550
9413 "This function cannot decrypt encrypted disks. The caller must do that first "
9414 "(supplying the necessary keys) if the disk is encrypted."
9418 #: ../fish/guestfish-actions.pod:2416 ../fish/guestfish-actions.pod:2614
9419 #: ../fish/guestfish-actions.pod:2673
9420 msgid "See also L</list-filesystems>."
9424 #: ../fish/guestfish-actions.pod:2418
9429 #: ../fish/guestfish-actions.pod:2420
9432 " is-blockdev path\n"
9437 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3570
9439 "This returns C<true> if and only if there is a block device with the given "
9444 #: ../fish/guestfish-actions.pod:2425 ../fish/guestfish-actions.pod:2443
9445 #: ../fish/guestfish-actions.pod:2462 ../fish/guestfish-actions.pod:2471
9446 #: ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2515
9447 #: ../fish/guestfish-actions.pod:2524
9448 msgid "See also L</stat>."
9452 #: ../fish/guestfish-actions.pod:2427
9457 #: ../fish/guestfish-actions.pod:2429
9465 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3584
9467 "This returns true iff this handle is busy processing a command (in the "
9472 #: ../fish/guestfish-actions.pod:2436
9477 #: ../fish/guestfish-actions.pod:2438
9480 " is-chardev path\n"
9485 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3599
9487 "This returns C<true> if and only if there is a character device with the "
9488 "given C<path> name."
9492 #: ../fish/guestfish-actions.pod:2445
9497 #: ../fish/guestfish-actions.pod:2447
9505 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3613
9507 "This returns true iff this handle is being configured (in the C<CONFIG> "
9512 #: ../fish/guestfish-actions.pod:2454
9517 #: ../fish/guestfish-actions.pod:2456
9525 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3628
9527 "This returns C<true> if and only if there is a directory with the given "
9528 "C<path> name. Note that it returns false for other objects like files."
9532 #: ../fish/guestfish-actions.pod:2464
9537 #: ../fish/guestfish-actions.pod:2466
9545 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3644
9547 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9548 "given C<path> name."
9552 #: ../fish/guestfish-actions.pod:2473
9557 #: ../fish/guestfish-actions.pod:2475
9565 #: ../fish/guestfish-actions.pod:2477 ../src/guestfs-actions.pod:3659
9567 "This returns C<true> if and only if there is a regular file with the given "
9568 "C<path> name. Note that it returns false for other objects like directories."
9572 #: ../fish/guestfish-actions.pod:2483
9573 msgid "is-launching"
9577 #: ../fish/guestfish-actions.pod:2485
9585 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3674
9587 "This returns true iff this handle is launching the subprocess (in the "
9588 "C<LAUNCHING> state)."
9592 #: ../fish/guestfish-actions.pod:2492
9597 #: ../fish/guestfish-actions.pod:2494
9605 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3689
9607 "This command tests whether C<device> is a logical volume, and returns true "
9608 "iff this is the case."
9612 #: ../fish/guestfish-actions.pod:2499
9617 #: ../fish/guestfish-actions.pod:2501
9625 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3701
9627 "This returns true iff this handle is ready to accept commands (in the "
9632 #: ../fish/guestfish-actions.pod:2508
9637 #: ../fish/guestfish-actions.pod:2510
9645 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3716
9647 "This returns C<true> if and only if there is a Unix domain socket with the "
9648 "given C<path> name."
9652 #: ../fish/guestfish-actions.pod:2517
9657 #: ../fish/guestfish-actions.pod:2519
9660 " is-symlink path\n"
9665 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3731
9667 "This returns C<true> if and only if there is a symbolic link with the given "
9672 #: ../fish/guestfish-actions.pod:2526
9677 #: ../fish/guestfish-actions.pod:2528
9685 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3746
9687 "This returns true iff the file exists and the file is empty or it contains "
9692 #: ../fish/guestfish-actions.pod:2533
9693 msgid "is-zero-device"
9697 #: ../fish/guestfish-actions.pod:2535
9700 " is-zero-device device\n"
9705 #: ../fish/guestfish-actions.pod:2537 ../src/guestfs-actions.pod:3759
9706 msgid "This returns true iff the device exists and contains all zero bytes."
9710 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3761
9711 msgid "Note that for large devices this can take a long time to run."
9715 #: ../fish/guestfish-actions.pod:2541
9716 msgid "kill-subprocess"
9720 #: ../fish/guestfish-actions.pod:2543
9723 " kill-subprocess\n"
9728 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3772
9729 msgid "This kills the qemu subprocess. You should never need to call this."
9733 #: ../fish/guestfish-actions.pod:2547
9738 #: ../fish/guestfish-actions.pod:2549
9743 #: ../fish/guestfish-actions.pod:2551
9751 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3783
9753 "Internally libguestfs is implemented by running a virtual machine using "
9758 #: ../fish/guestfish-actions.pod:2556 ../src/guestfs-actions.pod:3786
9760 "You should call this after configuring the handle (eg. adding drives) but "
9761 "before performing any actions."
9765 #: ../fish/guestfish-actions.pod:2559
9770 #: ../fish/guestfish-actions.pod:2561
9773 " lchown owner group path\n"
9778 #: ../fish/guestfish-actions.pod:2563
9780 "Change the file owner to C<owner> and group to C<group>. This is like L</"
9781 "chown> but if C<path> is a symlink then the link itself is changed, not the "
9786 #: ../fish/guestfish-actions.pod:2571
9791 #: ../fish/guestfish-actions.pod:2573
9794 " lgetxattr path name\n"
9799 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3826
9801 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
9802 "is a symlink, then this call returns an extended attribute from the symlink."
9806 #: ../fish/guestfish-actions.pod:2589
9807 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
9811 #: ../fish/guestfish-actions.pod:2591
9816 #: ../fish/guestfish-actions.pod:2593
9819 " lgetxattrs path\n"
9824 #: ../fish/guestfish-actions.pod:2595
9826 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
9827 "it returns the extended attributes of the link itself."
9831 #: ../fish/guestfish-actions.pod:2599
9836 #: ../fish/guestfish-actions.pod:2601
9844 #: ../fish/guestfish-actions.pod:2603 ../src/guestfs-actions.pod:3869
9846 "List all 9p filesystems attached to the guest. A list of mount tags is "
9851 #: ../fish/guestfish-actions.pod:2606
9852 msgid "list-devices"
9856 #: ../fish/guestfish-actions.pod:2608
9864 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3883
9865 msgid "List all the block devices."
9869 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3885
9870 msgid "The full block device names are returned, eg. C</dev/sda>."
9874 #: ../fish/guestfish-actions.pod:2616
9875 msgid "list-dm-devices"
9879 #: ../fish/guestfish-actions.pod:2618
9882 " list-dm-devices\n"
9887 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3900
9888 msgid "List all device mapper devices."
9892 #: ../fish/guestfish-actions.pod:2622
9894 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9895 "previous call to L</luks-open>."
9899 #: ../fish/guestfish-actions.pod:2625
9901 "Device mapper devices which correspond to logical volumes are I<not> "
9902 "returned in this list. Call L</lvs> if you want to list logical volumes."
9906 #: ../fish/guestfish-actions.pod:2629
9907 msgid "list-filesystems"
9911 #: ../fish/guestfish-actions.pod:2631
9914 " list-filesystems\n"
9919 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3920
9921 "This inspection command looks for filesystems on partitions, block devices "
9922 "and logical volumes, returning a list of devices containing filesystems and "
9927 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3924
9929 "The return value is a hash, where the keys are the devices containing "
9930 "filesystems, and the values are the filesystem types. For example:"
9934 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3928
9937 " \"/dev/sda1\" => \"ntfs\"\n"
9938 " \"/dev/sda2\" => \"ext2\"\n"
9939 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9940 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9945 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3933
9947 "The value can have the special value \"unknown\", meaning the content of the "
9948 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9952 #: ../fish/guestfish-actions.pod:2650
9954 "This command runs other libguestfs commands, which might include L</mount> "
9955 "and L</umount>, and therefore you should use this soon after launch and only "
9956 "when nothing is mounted."
9960 #: ../fish/guestfish-actions.pod:2654
9962 "Not all of the filesystems returned will be mountable. In particular, swap "
9963 "partitions are returned in the list. Also this command does not check that "
9964 "each filesystem found is valid and mountable, and some filesystems might be "
9965 "mountable but require special options. Filesystems may not all belong to a "
9966 "single logical operating system (use L</inspect-os> to look for OSes)."
9970 #: ../fish/guestfish-actions.pod:2662
9971 msgid "list-partitions"
9975 #: ../fish/guestfish-actions.pod:2664
9978 " list-partitions\n"
9983 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:3962
9984 msgid "List all the partitions detected on all block devices."
9988 #: ../fish/guestfish-actions.pod:2668 ../src/guestfs-actions.pod:3964
9989 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9993 #: ../fish/guestfish-actions.pod:2670
9995 "This does not return logical volumes. For that you will need to call L</"
10000 #: ../fish/guestfish-actions.pod:2675
10005 #: ../fish/guestfish-actions.pod:2677
10013 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3983
10015 "List the files in C<directory> (relative to the root directory, there is no "
10016 "cwd) in the format of 'ls -la'."
10020 #: ../fish/guestfish-actions.pod:2682 ../src/guestfs-actions.pod:3986
10022 "This command is mostly useful for interactive sessions. It is I<not> "
10023 "intended that you try to parse the output string."
10027 #: ../fish/guestfish-actions.pod:2685
10032 #: ../fish/guestfish-actions.pod:2687
10035 " ln target linkname\n"
10040 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4001
10041 msgid "This command creates a hard link using the C<ln> command."
10045 #: ../fish/guestfish-actions.pod:2691
10050 #: ../fish/guestfish-actions.pod:2693
10053 " ln-f target linkname\n"
10058 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:4014
10060 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10061 "option removes the link (C<linkname>) if it exists already."
10065 #: ../fish/guestfish-actions.pod:2698
10070 #: ../fish/guestfish-actions.pod:2700
10073 " ln-s target linkname\n"
10078 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4028
10079 msgid "This command creates a symbolic link using the C<ln -s> command."
10083 #: ../fish/guestfish-actions.pod:2704
10088 #: ../fish/guestfish-actions.pod:2706
10091 " ln-sf target linkname\n"
10096 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4041
10098 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10099 "option removes the link (C<linkname>) if it exists already."
10103 #: ../fish/guestfish-actions.pod:2711
10104 msgid "lremovexattr"
10108 #: ../fish/guestfish-actions.pod:2713
10111 " lremovexattr xattr path\n"
10116 #: ../fish/guestfish-actions.pod:2715
10118 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10119 "it removes an extended attribute of the link itself."
10123 #: ../fish/guestfish-actions.pod:2719
10128 #: ../fish/guestfish-actions.pod:2721
10136 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4069
10138 "List the files in C<directory> (relative to the root directory, there is no "
10139 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10143 #: ../fish/guestfish-actions.pod:2727
10145 "This command is mostly useful for interactive sessions. Programs should "
10146 "probably use L</readdir> instead."
10150 #: ../fish/guestfish-actions.pod:2730
10155 #: ../fish/guestfish-actions.pod:2732
10158 " lsetxattr xattr val vallen path\n"
10163 #: ../fish/guestfish-actions.pod:2734
10165 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10166 "sets an extended attribute of the link itself."
10170 #: ../fish/guestfish-actions.pod:2738
10175 #: ../fish/guestfish-actions.pod:2740
10183 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:4552
10184 #: ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:6890
10185 msgid "Returns file information for the given C<path>."
10189 #: ../fish/guestfish-actions.pod:2744
10191 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10192 "the link is stat-ed, not the file it refers to."
10196 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4111
10197 msgid "This is the same as the C<lstat(2)> system call."
10201 #: ../fish/guestfish-actions.pod:2750
10206 #: ../fish/guestfish-actions.pod:2752
10209 " lstatlist path 'names ...'\n"
10214 #: ../fish/guestfish-actions.pod:2754
10216 "This call allows you to perform the L</lstat> operation on multiple files, "
10217 "where all files are in the directory C<path>. C<names> is the list of files "
10218 "from this directory."
10222 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4130
10224 "On return you get a list of stat structs, with a one-to-one correspondence "
10225 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10226 "then the C<ino> field of that structure is set to C<-1>."
10230 #: ../fish/guestfish-actions.pod:2763
10232 "This call is intended for programs that want to efficiently list a directory "
10233 "contents without making many round-trips. See also L</lxattrlist> for a "
10234 "similarly efficient call for getting extended attributes. Very long "
10235 "directory listings might cause the protocol message size to be exceeded, "
10236 "causing this call to fail. The caller must split up such requests into "
10237 "smaller groups of names."
10241 #: ../fish/guestfish-actions.pod:2771
10242 msgid "luks-add-key"
10246 #: ../fish/guestfish-actions.pod:2773
10249 " luks-add-key device keyslot\n"
10254 #: ../fish/guestfish-actions.pod:2775 ../src/guestfs-actions.pod:4158
10256 "This command adds a new key on LUKS device C<device>. C<key> is any "
10257 "existing key, and is used to access the device. C<newkey> is the new key to "
10258 "add. C<keyslot> is the key slot that will be replaced."
10262 #: ../fish/guestfish-actions.pod:2780
10264 "Note that if C<keyslot> already contains a key, then this command will "
10265 "fail. You have to use L</luks-kill-slot> first to remove that key."
10269 #: ../fish/guestfish-actions.pod:2784 ../fish/guestfish-actions.pod:2806
10270 #: ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2833
10271 #: ../fish/guestfish-actions.pod:2859 ../fish/guestfish-actions.pod:2869
10273 "This command has one or more key or passphrase parameters. Guestfish will "
10274 "prompt for these separately."
10278 #: ../fish/guestfish-actions.pod:2787
10283 #: ../fish/guestfish-actions.pod:2789
10286 " luks-close device\n"
10291 #: ../fish/guestfish-actions.pod:2791
10293 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
10294 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
10295 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
10300 #: ../fish/guestfish-actions.pod:2797
10301 msgid "luks-format"
10305 #: ../fish/guestfish-actions.pod:2799
10308 " luks-format device keyslot\n"
10313 #: ../fish/guestfish-actions.pod:2801 ../src/guestfs-actions.pod:4199
10315 "This command erases existing data on C<device> and formats the device as a "
10316 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10317 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10321 #: ../fish/guestfish-actions.pod:2809 ../fish/guestfish-actions.pod:2822
10322 #: ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:3560
10323 #: ../fish/guestfish-actions.pod:4086 ../fish/guestfish-actions.pod:4423
10324 #: ../fish/guestfish-actions.pod:4446 ../fish/guestfish-actions.pod:4468
10325 #: ../fish/guestfish-actions.pod:5214 ../src/guestfs-actions.pod:4206
10326 #: ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4372
10327 #: ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:6253
10328 #: ../src/guestfs-actions.pod:6704 ../src/guestfs-actions.pod:6734
10329 #: ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:7966
10331 "B<This command is dangerous. Without careful use you can easily destroy all "
10336 #: ../fish/guestfish-actions.pod:2812
10337 msgid "luks-format-cipher"
10341 #: ../fish/guestfish-actions.pod:2814
10344 " luks-format-cipher device keyslot cipher\n"
10349 #: ../fish/guestfish-actions.pod:2816
10351 "This command is the same as L</luks-format> but it also allows you to set "
10352 "the C<cipher> used."
10356 #: ../fish/guestfish-actions.pod:2825
10357 msgid "luks-kill-slot"
10361 #: ../fish/guestfish-actions.pod:2827
10364 " luks-kill-slot device keyslot\n"
10369 #: ../fish/guestfish-actions.pod:2829 ../src/guestfs-actions.pod:4246
10371 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10372 "device C<device>. C<key> must be one of the I<other> keys."
10376 #: ../fish/guestfish-actions.pod:2836
10381 #: ../fish/guestfish-actions.pod:2838
10384 " luks-open device mapname\n"
10389 #: ../fish/guestfish-actions.pod:2840 ../src/guestfs-actions.pod:4266
10391 "This command opens a block device which has been encrypted according to the "
10392 "Linux Unified Key Setup (LUKS) standard."
10396 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4269
10397 msgid "C<device> is the encrypted block device or partition."
10401 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4271
10403 "The caller must supply one of the keys associated with the LUKS block "
10404 "device, in the C<key> parameter."
10408 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4274
10410 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10411 "writes to this block device are decrypted from and encrypted to the "
10412 "underlying C<device> respectively."
10416 #: ../fish/guestfish-actions.pod:2852
10418 "If this block device contains LVM volume groups, then calling L</vgscan> "
10419 "followed by L</vg-activate-all> will make them visible."
10423 #: ../fish/guestfish-actions.pod:2856
10424 msgid "Use L</list-dm-devices> to list all device mapper devices."
10428 #: ../fish/guestfish-actions.pod:2862
10429 msgid "luks-open-ro"
10433 #: ../fish/guestfish-actions.pod:2864
10436 " luks-open-ro device mapname\n"
10441 #: ../fish/guestfish-actions.pod:2866
10443 "This is the same as L</luks-open> except that a read-only mapping is created."
10447 #: ../fish/guestfish-actions.pod:2872
10452 #: ../fish/guestfish-actions.pod:2874
10455 " lvcreate logvol volgroup mbytes\n"
10460 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4320
10462 "This creates an LVM logical volume called C<logvol> on the volume group "
10463 "C<volgroup>, with C<size> megabytes."
10467 #: ../fish/guestfish-actions.pod:2879
10468 msgid "lvm-canonical-lv-name"
10472 #: ../fish/guestfish-actions.pod:2881
10475 " lvm-canonical-lv-name lvname\n"
10480 #: ../fish/guestfish-actions.pod:2883 ../src/guestfs-actions.pod:4333
10482 "This converts alternative naming schemes for LVs that you might find to the "
10483 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10488 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4337
10490 "This command returns an error if the C<lvname> parameter does not refer to a "
10495 #: ../fish/guestfish-actions.pod:2890
10496 msgid "See also L</is-lv>."
10500 #: ../fish/guestfish-actions.pod:2892
10501 msgid "lvm-clear-filter"
10505 #: ../fish/guestfish-actions.pod:2894
10508 " lvm-clear-filter\n"
10513 #: ../fish/guestfish-actions.pod:2896
10515 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
10520 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2930
10521 #: ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4397
10523 "This command also clears the LVM cache and performs a volume group scan."
10527 #: ../fish/guestfish-actions.pod:2902
10528 msgid "lvm-remove-all"
10532 #: ../fish/guestfish-actions.pod:2904
10535 " lvm-remove-all\n"
10540 #: ../fish/guestfish-actions.pod:2906 ../src/guestfs-actions.pod:4367
10542 "This command removes all LVM logical volumes, volume groups and physical "
10547 #: ../fish/guestfish-actions.pod:2912
10548 msgid "lvm-set-filter"
10552 #: ../fish/guestfish-actions.pod:2914
10555 " lvm-set-filter 'devices ...'\n"
10560 #: ../fish/guestfish-actions.pod:2916 ../src/guestfs-actions.pod:4383
10562 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10563 "block devices in the list C<devices>, and will ignore all other attached "
10568 #: ../fish/guestfish-actions.pod:2920 ../src/guestfs-actions.pod:4387
10570 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10571 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10572 "there are two types of duplication possible: either cloned PVs/VGs which "
10573 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10574 "same name. In normal operation you cannot create this situation, but you "
10575 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10576 "inside the LVM metadata."
10580 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4400
10581 msgid "You can filter whole block devices or individual partitions."
10585 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4402
10587 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10588 "filesystem), even if you are not filtering out that VG."
10592 #: ../fish/guestfish-actions.pod:2939
10597 #: ../fish/guestfish-actions.pod:2941
10600 " lvremove device\n"
10605 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4416
10607 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10608 "LV, such as C</dev/VG/LV>."
10612 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4419
10614 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10619 #: ../fish/guestfish-actions.pod:2949
10624 #: ../fish/guestfish-actions.pod:2951
10627 " lvrename logvol newlogvol\n"
10632 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4433
10633 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10637 #: ../fish/guestfish-actions.pod:2955
10642 #: ../fish/guestfish-actions.pod:2957
10645 " lvresize device mbytes\n"
10650 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4446
10652 "This resizes (expands or shrinks) an existing LVM logical volume to "
10653 "C<mbytes>. When reducing, data in the reduced part is lost."
10657 #: ../fish/guestfish-actions.pod:2963
10658 msgid "lvresize-free"
10662 #: ../fish/guestfish-actions.pod:2965
10665 " lvresize-free lv percent\n"
10670 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4461
10672 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10673 "remaining free space in the volume group. Commonly you would call this with "
10674 "pc = 100 which expands the logical volume as much as possible, using all "
10675 "remaining free space in the volume group."
10679 #: ../fish/guestfish-actions.pod:2973
10684 #: ../fish/guestfish-actions.pod:2975
10692 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4476
10694 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10699 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4479
10701 "This returns a list of the logical volume device names (eg. C</dev/"
10702 "VolGroup00/LogVol00>)."
10706 #: ../fish/guestfish-actions.pod:2983
10707 msgid "See also L</lvs-full>, L</list-filesystems>."
10711 #: ../fish/guestfish-actions.pod:2985
10716 #: ../fish/guestfish-actions.pod:2987
10724 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4495
10726 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10727 "(8)> command. The \"full\" version includes all fields."
10731 #: ../fish/guestfish-actions.pod:2992
10736 #: ../fish/guestfish-actions.pod:2994
10744 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4510
10745 msgid "This command returns the UUID of the LVM LV C<device>."
10749 #: ../fish/guestfish-actions.pod:2998
10754 #: ../fish/guestfish-actions.pod:3000
10757 " lxattrlist path 'names ...'\n"
10762 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4524
10764 "This call allows you to get the extended attributes of multiple files, where "
10765 "all files are in the directory C<path>. C<names> is the list of files from "
10770 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4528
10772 "On return you get a flat list of xattr structs which must be interpreted "
10773 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10774 "C<attrval> in this struct is zero-length to indicate there was an error "
10775 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10776 "number (the number of following attributes for this file, which could be C<"
10777 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10778 "for the first named file. This repeats for the second and subsequent files."
10782 #: ../fish/guestfish-actions.pod:3016
10784 "This call is intended for programs that want to efficiently list a directory "
10785 "contents without making many round-trips. See also L</lstatlist> for a "
10786 "similarly efficient call for getting standard stats. Very long directory "
10787 "listings might cause the protocol message size to be exceeded, causing this "
10788 "call to fail. The caller must split up such requests into smaller groups of "
10793 #: ../fish/guestfish-actions.pod:3024
10798 #: ../fish/guestfish-actions.pod:3026
10806 #: ../fish/guestfish-actions.pod:3028 ../src/guestfs-actions.pod:4558
10807 msgid "Create a directory named C<path>."
10811 #: ../fish/guestfish-actions.pod:3030
10816 #: ../fish/guestfish-actions.pod:3032
10819 " mkdir-mode path mode\n"
10824 #: ../fish/guestfish-actions.pod:3034 ../src/guestfs-actions.pod:4571
10826 "This command creates a directory, setting the initial permissions of the "
10827 "directory to C<mode>."
10831 #: ../fish/guestfish-actions.pod:3037 ../src/guestfs-actions.pod:4574
10833 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10834 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10839 #: ../fish/guestfish-actions.pod:3041
10840 msgid "See also L</mkdir>, L</umask>"
10844 #: ../fish/guestfish-actions.pod:3043
10849 #: ../fish/guestfish-actions.pod:3045
10857 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4590
10859 "Create a directory named C<path>, creating any parent directories as "
10860 "necessary. This is like the C<mkdir -p> shell command."
10864 #: ../fish/guestfish-actions.pod:3050
10869 #: ../fish/guestfish-actions.pod:3052
10872 " mkdtemp template\n"
10877 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4603
10879 "This command creates a temporary directory. The C<template> parameter "
10880 "should be a full pathname for the temporary directory name with the final "
10881 "six characters being \"XXXXXX\"."
10885 #: ../fish/guestfish-actions.pod:3059 ../src/guestfs-actions.pod:4608
10887 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10888 "being suitable for Windows filesystems."
10892 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4611
10893 msgid "The name of the temporary directory that was created is returned."
10897 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4614
10898 msgid "The temporary directory is created with mode 0700 and is owned by root."
10902 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4617
10904 "The caller is responsible for deleting the temporary directory and its "
10905 "contents after use."
10909 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4620
10910 msgid "See also: L<mkdtemp(3)>"
10914 #: ../fish/guestfish-actions.pod:3073
10919 #: ../fish/guestfish-actions.pod:3075
10922 " mke2fs-J fstype blocksize device journal\n"
10927 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4636
10929 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10930 "C<journal>. It is equivalent to the command:"
10934 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4640
10937 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10942 #: ../fish/guestfish-actions.pod:3083
10943 msgid "See also L</mke2journal>."
10947 #: ../fish/guestfish-actions.pod:3085
10952 #: ../fish/guestfish-actions.pod:3087
10955 " mke2fs-JL fstype blocksize device label\n"
10960 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4657
10962 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10963 "the journal labeled C<label>."
10967 #: ../fish/guestfish-actions.pod:3092
10968 msgid "See also L</mke2journal-L>."
10972 #: ../fish/guestfish-actions.pod:3094
10977 #: ../fish/guestfish-actions.pod:3096
10980 " mke2fs-JU fstype blocksize device uuid\n"
10985 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4675
10987 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10988 "the journal with UUID C<uuid>."
10992 #: ../fish/guestfish-actions.pod:3101
10993 msgid "See also L</mke2journal-U>."
10997 #: ../fish/guestfish-actions.pod:3103
10998 msgid "mke2journal"
11002 #: ../fish/guestfish-actions.pod:3105
11005 " mke2journal blocksize device\n"
11010 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4691
11012 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11017 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4694
11020 " mke2fs -O journal_dev -b blocksize device\n"
11025 #: ../fish/guestfish-actions.pod:3112
11026 msgid "mke2journal-L"
11030 #: ../fish/guestfish-actions.pod:3114
11033 " mke2journal-L blocksize label device\n"
11038 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4708
11039 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11043 #: ../fish/guestfish-actions.pod:3118
11044 msgid "mke2journal-U"
11048 #: ../fish/guestfish-actions.pod:3120
11051 " mke2journal-U blocksize uuid device\n"
11056 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4722
11057 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11061 #: ../fish/guestfish-actions.pod:3124
11066 #: ../fish/guestfish-actions.pod:3126
11069 " mkfifo mode path\n"
11074 #: ../fish/guestfish-actions.pod:3128
11076 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11077 "is just a convenient wrapper around L</mknod>."
11081 #: ../fish/guestfish-actions.pod:3134
11086 #: ../fish/guestfish-actions.pod:3136
11089 " mkfs fstype device\n"
11094 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4752
11096 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11097 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11101 #: ../fish/guestfish-actions.pod:3142
11106 #: ../fish/guestfish-actions.pod:3144
11109 " mkfs-b fstype blocksize device\n"
11114 #: ../fish/guestfish-actions.pod:3146
11116 "This call is similar to L</mkfs>, but it allows you to control the block "
11117 "size of the resulting filesystem. Supported block sizes depend on the "
11118 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11122 #: ../fish/guestfish-actions.pod:3151 ../fish/guestfish-actions.pod:3178
11123 #: ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4818
11125 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11130 #: ../fish/guestfish-actions.pod:3154
11132 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11137 #: ../fish/guestfish-actions.pod:3161
11142 #: ../fish/guestfish-actions.pod:3163
11145 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
11150 #: ../fish/guestfish-actions.pod:3165 ../src/guestfs-actions.pod:4805
11152 "This function creates a filesystem on C<device>. The filesystem type is "
11153 "C<fstype>, for example C<ext3>."
11157 #: ../fish/guestfish-actions.pod:3172 ../src/guestfs-actions.pod:4812
11158 msgid "C<blocksize>"
11162 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4814
11164 "The filesystem block size. Supported block sizes depend on the filesystem "
11165 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11170 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4821
11171 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11175 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4823
11176 msgid "C<features>"
11180 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4825
11181 msgid "This passes the I<-O> parameter to the external mkfs program."
11185 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4827
11187 "For certain filesystem types, this allows extra filesystem features to be "
11188 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11192 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4831
11194 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11199 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4834
11204 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4836
11206 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
11207 "sets the inode size (only for ext2/3/4 filesystems at present)."
11211 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4839
11212 msgid "C<sectorsize>"
11216 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4841
11218 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
11219 "sets sector size for ufs filesystem."
11223 #: ../fish/guestfish-actions.pod:3208
11224 msgid "mkmountpoint"
11228 #: ../fish/guestfish-actions.pod:3210
11231 " mkmountpoint exemptpath\n"
11236 #: ../fish/guestfish-actions.pod:3212
11238 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
11239 "to create extra mountpoints before mounting the first filesystem."
11243 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4884
11245 "These calls are I<only> necessary in some very limited circumstances, mainly "
11246 "the case where you want to mount a mix of unrelated and/or read-only "
11247 "filesystems together."
11251 #: ../fish/guestfish-actions.pod:3220 ../src/guestfs-actions.pod:4888
11253 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11254 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11255 "inside that. You can unpack this as follows in guestfish:"
11259 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4893
11262 " add-ro Fedora-11-i686-Live.iso\n"
11264 " mkmountpoint /cd\n"
11265 " mkmountpoint /sqsh\n"
11266 " mkmountpoint /ext3fs\n"
11267 " mount /dev/sda /cd\n"
11268 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11269 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11274 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4902
11275 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11279 #: ../fish/guestfish-actions.pod:3236
11281 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
11282 "unexpected errors if you try to mix these calls. It is safest to manually "
11283 "unmount filesystems and remove mountpoints after use."
11287 #: ../fish/guestfish-actions.pod:3240
11289 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
11290 "for this to work for manual mountpoints, you must ensure that the innermost "
11291 "mountpoints have the longest pathnames, as in the example code above."
11295 #: ../fish/guestfish-actions.pod:3245 ../src/guestfs-actions.pod:4913
11297 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11301 #: ../fish/guestfish-actions.pod:3247
11303 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
11304 "L</umount-all> to be called when the handle is closed which can also trigger "
11309 #: ../fish/guestfish-actions.pod:3251
11314 #: ../fish/guestfish-actions.pod:3253
11317 " mknod mode devmajor devminor path\n"
11322 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:4932
11324 "This call creates block or character special devices, or named pipes (FIFOs)."
11328 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4935
11330 "The C<mode> parameter should be the mode, using the standard constants. "
11331 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11332 "used when creating block and character special devices."
11336 #: ../fish/guestfish-actions.pod:3263
11338 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11339 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11340 "regular file). These constants are available in the standard Linux header "
11341 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
11342 "wrappers around this command which bitwise OR in the appropriate constant "
11347 #: ../fish/guestfish-actions.pod:3273
11352 #: ../fish/guestfish-actions.pod:3275
11355 " mknod-b mode devmajor devminor path\n"
11360 #: ../fish/guestfish-actions.pod:3277
11362 "This call creates a block device node called C<path> with mode C<mode> and "
11363 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11364 "wrapper around L</mknod>."
11368 #: ../fish/guestfish-actions.pod:3283
11373 #: ../fish/guestfish-actions.pod:3285
11376 " mknod-c mode devmajor devminor path\n"
11381 #: ../fish/guestfish-actions.pod:3287
11383 "This call creates a char device node called C<path> with mode C<mode> and "
11384 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11385 "wrapper around L</mknod>."
11389 #: ../fish/guestfish-actions.pod:3293
11394 #: ../fish/guestfish-actions.pod:3295
11402 #: ../fish/guestfish-actions.pod:3297 ../src/guestfs-actions.pod:4998
11403 msgid "Create a swap partition on C<device>."
11407 #: ../fish/guestfish-actions.pod:3299
11412 #: ../fish/guestfish-actions.pod:3301
11415 " mkswap-L label device\n"
11420 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5011
11421 msgid "Create a swap partition on C<device> with label C<label>."
11425 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5013
11427 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11428 "sda>), just to a partition. This appears to be a limitation of the kernel "
11433 #: ../fish/guestfish-actions.pod:3309
11438 #: ../fish/guestfish-actions.pod:3311
11441 " mkswap-U uuid device\n"
11446 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5028
11447 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11451 #: ../fish/guestfish-actions.pod:3315
11452 msgid "mkswap-file"
11456 #: ../fish/guestfish-actions.pod:3317
11459 " mkswap-file path\n"
11464 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5040
11465 msgid "Create a swap file."
11469 #: ../fish/guestfish-actions.pod:3321
11471 "This command just writes a swap file signature to an existing file. To "
11472 "create the file itself, use something like L</fallocate>."
11476 #: ../fish/guestfish-actions.pod:3324
11481 #: ../fish/guestfish-actions.pod:3326
11484 " modprobe modulename\n"
11489 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5055
11490 msgid "This loads a kernel module in the appliance."
11494 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5057
11496 "The kernel module must have been whitelisted when libguestfs was built (see "
11497 "C<appliance/kmod.whitelist.in> in the source)."
11501 #: ../fish/guestfish-actions.pod:3333
11506 #: ../fish/guestfish-actions.pod:3335
11509 " mount device mountpoint\n"
11514 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5071
11516 "Mount a guest disk at a position in the filesystem. Block devices are named "
11517 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11518 "those block devices contain partitions, they will have the usual names (eg. "
11519 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11523 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5077
11525 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11526 "mounted on C</> before others can be mounted. Other filesystems can only be "
11527 "mounted on directories which already exist."
11531 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5082
11533 "The mounted filesystem is writable, if we have sufficient permissions on the "
11534 "underlying device."
11538 #: ../fish/guestfish-actions.pod:3351
11540 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
11541 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
11542 "problems for users. If your program might need to work with older versions "
11543 "of libguestfs, use L</mount-options> instead (using an empty string for the "
11544 "first parameter if you don't want any options)."
11548 #: ../fish/guestfish-actions.pod:3358
11553 #: ../fish/guestfish-actions.pod:3360
11556 " mount-9p mounttag mountpoint [options:..]\n"
11561 #: ../fish/guestfish-actions.pod:3362 ../src/guestfs-actions.pod:5111
11563 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
11568 #: ../fish/guestfish-actions.pod:3365 ../src/guestfs-actions.pod:5114
11570 "If required, C<trans=virtio> will be automatically added to the options. "
11571 "Any other options required can be passed in the optional C<options> "
11576 #: ../fish/guestfish-actions.pod:3371
11581 #: ../fish/guestfish-actions.pod:3373
11584 " mount-loop file mountpoint\n"
11589 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5153
11591 "This command lets you mount C<file> (a filesystem image in a file) on a "
11592 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11597 #: ../fish/guestfish-actions.pod:3379
11598 msgid "mount-options"
11602 #: ../fish/guestfish-actions.pod:3381
11605 " mount-options options device mountpoint\n"
11610 #: ../fish/guestfish-actions.pod:3383
11612 "This is the same as the L</mount> command, but it allows you to set the "
11613 "mount options as for the L<mount(8)> I<-o> flag."
11617 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5173
11619 "If the C<options> parameter is an empty string, then no options are passed "
11620 "(all options default to whatever the filesystem uses)."
11624 #: ../fish/guestfish-actions.pod:3391
11629 #: ../fish/guestfish-actions.pod:3393
11632 " mount-ro device mountpoint\n"
11637 #: ../fish/guestfish-actions.pod:3395
11639 "This is the same as the L</mount> command, but it mounts the filesystem with "
11640 "the read-only (I<-o ro>) flag."
11644 #: ../fish/guestfish-actions.pod:3398
11649 #: ../fish/guestfish-actions.pod:3400
11652 " mount-vfs options vfstype device mountpoint\n"
11657 #: ../fish/guestfish-actions.pod:3402
11659 "This is the same as the L</mount> command, but it allows you to set both the "
11660 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11664 #: ../fish/guestfish-actions.pod:3406
11665 msgid "mountpoints"
11669 #: ../fish/guestfish-actions.pod:3408
11677 #: ../fish/guestfish-actions.pod:3410
11679 "This call is similar to L</mounts>. That call returns a list of devices. "
11680 "This one returns a hash table (map) of device name to directory where the "
11681 "device is mounted."
11685 #: ../fish/guestfish-actions.pod:3414
11690 #: ../fish/guestfish-actions.pod:3416
11698 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5234
11700 "This returns the list of currently mounted filesystems. It returns the list "
11701 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11705 #: ../fish/guestfish-actions.pod:3421 ../src/guestfs-actions.pod:5237
11706 msgid "Some internal mounts are not shown."
11710 #: ../fish/guestfish-actions.pod:3423
11711 msgid "See also: L</mountpoints>"
11715 #: ../fish/guestfish-actions.pod:3425
11720 #: ../fish/guestfish-actions.pod:3427
11728 #: ../fish/guestfish-actions.pod:3429 ../src/guestfs-actions.pod:5254
11730 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11731 "destination filename or destination directory."
11735 #: ../fish/guestfish-actions.pod:3432
11736 msgid "ntfs-3g-probe"
11740 #: ../fish/guestfish-actions.pod:3434
11743 " ntfs-3g-probe true|false device\n"
11748 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5268
11750 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11751 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11752 "write, and some cannot be mounted at all)."
11756 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5272
11758 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11759 "can be mounted read-write. Set it to false if you want to test if the "
11760 "volume can be mounted read-only."
11764 #: ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5276
11766 "The return value is an integer which C<0> if the operation would succeed, or "
11767 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11771 #: ../fish/guestfish-actions.pod:3448
11776 #: ../fish/guestfish-actions.pod:3450
11779 " ntfsresize device\n"
11784 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:3476
11785 #: ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5329
11787 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11788 "size of the underlying device."
11792 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5300
11794 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
11795 "consistency check (for safety). You have to boot into Windows to perform "
11796 "this check and clear this condition. Furthermore, ntfsresize refuses to "
11797 "resize filesystems which have been marked in this way. So in effect it is "
11798 "not possible to call ntfsresize multiple times on a single filesystem "
11799 "without booting into Windows between each resize."
11803 #: ../fish/guestfish-actions.pod:3463 ../fish/guestfish-actions.pod:3502
11804 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5355
11805 msgid "See also L<ntfsresize(8)>."
11809 #: ../fish/guestfish-actions.pod:3465 ../fish/guestfish-actions.pod:3513
11811 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
11816 #: ../fish/guestfish-actions.pod:3472
11817 msgid "ntfsresize-opts"
11821 #: ../fish/guestfish-actions.pod:3474
11824 " ntfsresize-opts device [size:..] [force:..]\n"
11829 #: ../fish/guestfish-actions.pod:3485 ../src/guestfs-actions.pod:5338
11831 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
11832 "resized to fit the container (eg. partition)."
11836 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5341
11841 #: ../fish/guestfish-actions.pod:3490 ../src/guestfs-actions.pod:5343
11843 "If this option is true, then force the resize of the filesystem even if the "
11844 "filesystem is marked as requiring a consistency check."
11848 #: ../fish/guestfish-actions.pod:3493
11850 "After the resize operation, the filesystem is always marked as requiring a "
11851 "consistency check (for safety). You have to boot into Windows to perform "
11852 "this check and clear this condition. If you I<don't> set the C<force> "
11853 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
11854 "a single filesystem without booting into Windows between each resize."
11858 #: ../fish/guestfish-actions.pod:3506
11859 msgid "ntfsresize-size"
11863 #: ../fish/guestfish-actions.pod:3508
11866 " ntfsresize-size device size\n"
11871 #: ../fish/guestfish-actions.pod:3510
11873 "This command is the same as L</ntfsresize> except that it allows you to "
11874 "specify the new size (in bytes) explicitly."
11878 #: ../fish/guestfish-actions.pod:3520
11883 #: ../fish/guestfish-actions.pod:3522
11886 " part-add device prlogex startsect endsect\n"
11891 #: ../fish/guestfish-actions.pod:3524
11893 "This command adds a partition to C<device>. If there is no partition table "
11894 "on the device, call L</part-init> first."
11898 #: ../fish/guestfish-actions.pod:3527 ../src/guestfs-actions.pod:5416
11900 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11901 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11902 "C<logical>) and C<e> (or C<extended>) partition types."
11906 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5421
11908 "C<startsect> and C<endsect> are the start and end of the partition in "
11909 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11910 "from the end of the disk (C<-1> is the last sector)."
11914 #: ../fish/guestfish-actions.pod:3536
11916 "Creating a partition which covers the whole disk is not so easy. Use L</"
11917 "part-disk> to do that."
11921 #: ../fish/guestfish-actions.pod:3539
11926 #: ../fish/guestfish-actions.pod:3541
11929 " part-del device partnum\n"
11934 #: ../fish/guestfish-actions.pod:3543 ../src/guestfs-actions.pod:5439
11935 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11939 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5441
11941 "Note that in the case of MBR partitioning, deleting an extended partition "
11942 "also deletes any logical partitions it contains."
11946 #: ../fish/guestfish-actions.pod:3549
11951 #: ../fish/guestfish-actions.pod:3551
11954 " part-disk device parttype\n"
11959 #: ../fish/guestfish-actions.pod:3553
11961 "This command is simply a combination of L</part-init> followed by L</part-"
11962 "add> to create a single primary partition covering the whole disk."
11966 #: ../fish/guestfish-actions.pod:3557
11968 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11969 "possible values are described in L</part-init>."
11973 #: ../fish/guestfish-actions.pod:3563
11974 msgid "part-get-bootable"
11978 #: ../fish/guestfish-actions.pod:3565
11981 " part-get-bootable device partnum\n"
11986 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5477
11988 "This command returns true if the partition C<partnum> on C<device> has the "
11989 "bootable flag set."
11993 #: ../fish/guestfish-actions.pod:3570
11994 msgid "See also L</part-set-bootable>."
11998 #: ../fish/guestfish-actions.pod:3572
11999 msgid "part-get-mbr-id"
12003 #: ../fish/guestfish-actions.pod:3574
12006 " part-get-mbr-id device partnum\n"
12011 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5493
12013 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12014 "partition C<partnum>."
12018 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3723
12020 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12021 "undefined results for other partition table types (see L</part-get-"
12026 #: ../fish/guestfish-actions.pod:3583
12027 msgid "part-get-parttype"
12031 #: ../fish/guestfish-actions.pod:3585
12034 " part-get-parttype device\n"
12039 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5510
12041 "This command examines the partition table on C<device> and returns the "
12042 "partition table type (format) being used."
12046 #: ../fish/guestfish-actions.pod:3590
12048 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12049 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12050 "possible, although unusual. See L</part-init> for a full list."
12054 #: ../fish/guestfish-actions.pod:3595
12059 #: ../fish/guestfish-actions.pod:3597
12062 " part-init device parttype\n"
12067 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5530
12069 "This creates an empty partition table on C<device> of one of the partition "
12070 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12071 "(for large disks)."
12075 #: ../fish/guestfish-actions.pod:3603
12077 "Initially there are no partitions. Following this, you should call L</part-"
12078 "add> for each partition required."
12082 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5537
12083 msgid "Possible values for C<parttype> are:"
12087 #: ../fish/guestfish-actions.pod:3610 ../src/guestfs-actions.pod:5541
12092 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5543
12097 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5545
12098 msgid "Intel EFI / GPT partition table."
12102 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5547
12104 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12105 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12106 "the C<mbr> format."
12110 #: ../fish/guestfish-actions.pod:3620 ../src/guestfs-actions.pod:5551
12115 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5553
12120 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5555
12122 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12123 "Windows. This partition type will B<only> work for device sizes up to 2 "
12124 "TB. For large disks we recommend using C<gpt>."
12128 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5562
12130 "Other partition table types that may work but are not supported include:"
12134 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5567
12139 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5569
12140 msgid "AIX disk labels."
12144 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5571
12149 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5573
12154 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5575
12155 msgid "Amiga \"Rigid Disk Block\" format."
12159 #: ../fish/guestfish-actions.pod:3646 ../src/guestfs-actions.pod:5577
12164 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5579
12165 msgid "BSD disk labels."
12169 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5581
12174 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5583
12175 msgid "DASD, used on IBM mainframes."
12179 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5585
12184 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5587
12185 msgid "MIPS/SGI volumes."
12189 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5589
12194 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5591
12195 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12199 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5593
12204 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5595
12205 msgid "NEC PC-98 format, common in Japan apparently."
12209 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5597
12214 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5599
12215 msgid "Sun disk labels."
12219 #: ../fish/guestfish-actions.pod:3672
12224 #: ../fish/guestfish-actions.pod:3674
12227 " part-list device\n"
12232 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5613
12234 "This command parses the partition table on C<device> and returns the list of "
12235 "partitions found."
12239 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5616
12240 msgid "The fields in the returned structure are:"
12244 #: ../fish/guestfish-actions.pod:3683 ../src/guestfs-actions.pod:5620
12245 msgid "B<part_num>"
12249 #: ../fish/guestfish-actions.pod:3685 ../src/guestfs-actions.pod:5622
12250 msgid "Partition number, counting from 1."
12254 #: ../fish/guestfish-actions.pod:3687 ../src/guestfs-actions.pod:5624
12255 msgid "B<part_start>"
12259 #: ../fish/guestfish-actions.pod:3689
12261 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12262 "the device's sector size, see L</blockdev-getss>."
12266 #: ../fish/guestfish-actions.pod:3692 ../src/guestfs-actions.pod:5629
12267 msgid "B<part_end>"
12271 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5631
12272 msgid "End of the partition in bytes."
12276 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5633
12277 msgid "B<part_size>"
12281 #: ../fish/guestfish-actions.pod:3698 ../src/guestfs-actions.pod:5635
12282 msgid "Size of the partition in bytes."
12286 #: ../fish/guestfish-actions.pod:3702
12287 msgid "part-set-bootable"
12291 #: ../fish/guestfish-actions.pod:3704
12294 " part-set-bootable device partnum true|false\n"
12299 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5653
12301 "This sets the bootable flag on partition numbered C<partnum> on device "
12302 "C<device>. Note that partitions are numbered from 1."
12306 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5656
12308 "The bootable flag is used by some operating systems (notably Windows) to "
12309 "determine which partition to boot from. It is by no means universally "
12314 #: ../fish/guestfish-actions.pod:3713
12315 msgid "part-set-mbr-id"
12319 #: ../fish/guestfish-actions.pod:3715
12322 " part-set-mbr-id device partnum idbyte\n"
12327 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5672
12329 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12330 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12331 "documentation are in fact hexadecimal numbers, but usually documented "
12332 "without any leading \"0x\" which might be confusing."
12336 #: ../fish/guestfish-actions.pod:3727
12337 msgid "part-set-name"
12341 #: ../fish/guestfish-actions.pod:3729
12344 " part-set-name device partnum name\n"
12349 #: ../fish/guestfish-actions.pod:3731 ../src/guestfs-actions.pod:5694
12351 "This sets the partition name on partition numbered C<partnum> on device "
12352 "C<device>. Note that partitions are numbered from 1."
12356 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5697
12358 "The partition name can only be set on certain types of partition table. "
12359 "This works on C<gpt> but not on C<mbr> partitions."
12363 #: ../fish/guestfish-actions.pod:3737
12364 msgid "part-to-dev"
12368 #: ../fish/guestfish-actions.pod:3739
12371 " part-to-dev partition\n"
12376 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5710
12378 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12379 "partition number, returning the device name (eg. \"/dev/sdb\")."
12383 #: ../fish/guestfish-actions.pod:3745
12385 "The named partition must exist, for example as a string returned from L</"
12386 "list-partitions>."
12390 #: ../fish/guestfish-actions.pod:3748
12391 msgid "ping-daemon"
12395 #: ../fish/guestfish-actions.pod:3750
12403 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5727
12405 "This is a test probe into the guestfs daemon running inside the qemu "
12406 "subprocess. Calling this function checks that the daemon responds to the "
12407 "ping message, without affecting the daemon or attached block device(s) in "
12412 #: ../fish/guestfish-actions.pod:3757
12417 #: ../fish/guestfish-actions.pod:3759
12420 " pread path count offset\n"
12425 #: ../fish/guestfish-actions.pod:3761 ../src/guestfs-actions.pod:5745
12427 "This command lets you read part of a file. It reads C<count> bytes of the "
12428 "file, starting at C<offset>, from file C<path>."
12432 #: ../fish/guestfish-actions.pod:3764 ../fish/guestfish-actions.pod:3779
12433 #: ../src/guestfs-actions.pod:5748 ../src/guestfs-actions.pod:5774
12435 "This may read fewer bytes than requested. For further details see the "
12436 "L<pread(2)> system call."
12440 #: ../fish/guestfish-actions.pod:3767
12441 msgid "See also L</pwrite>, L</pread-device>."
12445 #: ../fish/guestfish-actions.pod:3772
12446 msgid "pread-device"
12450 #: ../fish/guestfish-actions.pod:3774
12453 " pread-device device count offset\n"
12458 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5771
12460 "This command lets you read part of a file. It reads C<count> bytes of "
12461 "C<device>, starting at C<offset>."
12465 #: ../fish/guestfish-actions.pod:3782
12466 msgid "See also L</pread>."
12470 #: ../fish/guestfish-actions.pod:3787
12475 #: ../fish/guestfish-actions.pod:3789
12478 " pvcreate device\n"
12483 #: ../fish/guestfish-actions.pod:3791 ../src/guestfs-actions.pod:5794
12485 "This creates an LVM physical volume on the named C<device>, where C<device> "
12486 "should usually be a partition name such as C</dev/sda1>."
12490 #: ../fish/guestfish-actions.pod:3795
12495 #: ../fish/guestfish-actions.pod:3797
12498 " pvremove device\n"
12503 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5808
12505 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12510 #: ../fish/guestfish-actions.pod:3802 ../src/guestfs-actions.pod:5811
12512 "The implementation uses the C<pvremove> command which refuses to wipe "
12513 "physical volumes that contain any volume groups, so you have to remove those "
12518 #: ../fish/guestfish-actions.pod:3806
12523 #: ../fish/guestfish-actions.pod:3808
12526 " pvresize device\n"
12531 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5825
12533 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12534 "the new size of the underlying device."
12538 #: ../fish/guestfish-actions.pod:3813
12539 msgid "pvresize-size"
12543 #: ../fish/guestfish-actions.pod:3815
12546 " pvresize-size device size\n"
12551 #: ../fish/guestfish-actions.pod:3817
12553 "This command is the same as L</pvresize> except that it allows you to "
12554 "specify the new size (in bytes) explicitly."
12558 #: ../fish/guestfish-actions.pod:3820
12563 #: ../fish/guestfish-actions.pod:3822
12571 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5851
12573 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12578 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5854
12580 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12585 #: ../fish/guestfish-actions.pod:3830
12586 msgid "See also L</pvs-full>."
12590 #: ../fish/guestfish-actions.pod:3832
12595 #: ../fish/guestfish-actions.pod:3834
12603 #: ../fish/guestfish-actions.pod:3836 ../src/guestfs-actions.pod:5870
12605 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12606 "(8)> command. The \"full\" version includes all fields."
12610 #: ../fish/guestfish-actions.pod:3839
12615 #: ../fish/guestfish-actions.pod:3841
12623 #: ../fish/guestfish-actions.pod:3843 ../src/guestfs-actions.pod:5885
12624 msgid "This command returns the UUID of the LVM PV C<device>."
12628 #: ../fish/guestfish-actions.pod:3845
12633 #: ../fish/guestfish-actions.pod:3847
12636 " pwrite path content offset\n"
12641 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5901
12643 "This command writes to part of a file. It writes the data buffer C<content> "
12644 "to the file C<path> starting at offset C<offset>."
12648 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:5904
12650 "This command implements the L<pwrite(2)> system call, and like that system "
12651 "call it may not write the full data requested. The return value is the "
12652 "number of bytes that were actually written to the file. This could even be "
12653 "0, although short writes are unlikely for regular files in ordinary "
12658 #: ../fish/guestfish-actions.pod:3858
12659 msgid "See also L</pread>, L</pwrite-device>."
12663 #: ../fish/guestfish-actions.pod:3863
12664 msgid "pwrite-device"
12668 #: ../fish/guestfish-actions.pod:3865
12671 " pwrite-device device content offset\n"
12676 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5928
12678 "This command writes to part of a device. It writes the data buffer "
12679 "C<content> to C<device> starting at offset C<offset>."
12683 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5931
12685 "This command implements the L<pwrite(2)> system call, and like that system "
12686 "call it may not write the full data requested (although short writes to disk "
12687 "devices and partitions are probably impossible with standard Linux kernels)."
12691 #: ../fish/guestfish-actions.pod:3875
12692 msgid "See also L</pwrite>."
12696 #: ../fish/guestfish-actions.pod:3880
12701 #: ../fish/guestfish-actions.pod:3882
12704 " read-file path\n"
12709 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5952
12710 msgid "This calls returns the contents of the file C<path> as a buffer."
12714 #: ../fish/guestfish-actions.pod:3887
12716 "Unlike L</cat>, this function can correctly handle files that contain "
12717 "embedded ASCII NUL characters. However unlike L</download>, this function "
12718 "is limited in the total size of file that can be handled."
12722 #: ../fish/guestfish-actions.pod:3895
12727 #: ../fish/guestfish-actions.pod:3897
12730 " read-lines path\n"
12735 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5977
12737 "The file contents are returned as a list of lines. Trailing C<LF> and "
12738 "C<CRLF> character sequences are I<not> returned."
12742 #: ../fish/guestfish-actions.pod:3904
12744 "Note that this function cannot correctly handle binary files (specifically, "
12745 "files containing C<\\0> character which is treated as end of line). For "
12746 "those you need to use the L</read-file> function which has a more complex "
12751 #: ../fish/guestfish-actions.pod:3909
12756 #: ../fish/guestfish-actions.pod:3911
12764 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5997
12765 msgid "This returns the list of directory entries in directory C<dir>."
12769 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5999
12771 "All entries in the directory are returned, including C<.> and C<..>. The "
12772 "entries are I<not> sorted, but returned in the same order as the underlying "
12777 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6003
12779 "Also this call returns basic file type information about each file. The "
12780 "C<ftyp> field will contain one of the following characters:"
12784 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:6008
12789 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6010
12790 msgid "Block special"
12794 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6012
12799 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6014
12800 msgid "Char special"
12804 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6016
12809 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6018
12814 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6020
12819 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6022
12820 msgid "FIFO (named pipe)"
12824 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6024
12829 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6026
12830 msgid "Symbolic link"
12834 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6028
12839 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6030
12840 msgid "Regular file"
12844 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6032
12849 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6034
12854 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6036
12859 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6038
12860 msgid "Unknown file type"
12864 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6040
12869 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6042
12871 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12875 #: ../fish/guestfish-actions.pod:3963
12877 "This function is primarily intended for use by programs. To get a simple "
12878 "list of names, use L</ls>. To get a printable directory for human "
12879 "consumption, use L</ll>."
12883 #: ../fish/guestfish-actions.pod:3967
12888 #: ../fish/guestfish-actions.pod:3969
12896 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6063
12897 msgid "This command reads the target of a symbolic link."
12901 #: ../fish/guestfish-actions.pod:3973
12902 msgid "readlinklist"
12906 #: ../fish/guestfish-actions.pod:3975
12909 " readlinklist path 'names ...'\n"
12914 #: ../fish/guestfish-actions.pod:3977 ../src/guestfs-actions.pod:6077
12916 "This call allows you to do a C<readlink> operation on multiple files, where "
12917 "all files are in the directory C<path>. C<names> is the list of files from "
12922 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6081
12924 "On return you get a list of strings, with a one-to-one correspondence to the "
12925 "C<names> list. Each string is the value of the symbolic link."
12929 #: ../fish/guestfish-actions.pod:3985 ../src/guestfs-actions.pod:6085
12931 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12932 "result string is the empty string C<\"\">. However the whole operation is "
12933 "completed even if there were C<readlink(2)> errors, and so you can call this "
12934 "function with names where you don't know if they are symbolic links already "
12935 "(albeit slightly less efficient)."
12939 #: ../fish/guestfish-actions.pod:3992 ../src/guestfs-actions.pod:6092
12941 "This call is intended for programs that want to efficiently list a directory "
12942 "contents without making many round-trips. Very long directory listings "
12943 "might cause the protocol message size to be exceeded, causing this call to "
12944 "fail. The caller must split up such requests into smaller groups of names."
12948 #: ../fish/guestfish-actions.pod:3999
12953 #: ../fish/guestfish-actions.pod:4001
12961 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6111
12963 "Return the canonicalized absolute pathname of C<path>. The returned path "
12964 "has no C<.>, C<..> or symbolic link path elements."
12968 #: ../fish/guestfish-actions.pod:4006
12969 msgid "removexattr"
12973 #: ../fish/guestfish-actions.pod:4008
12976 " removexattr xattr path\n"
12981 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6126
12983 "This call removes the extended attribute named C<xattr> of the file C<path>."
12987 #: ../fish/guestfish-actions.pod:4013
12988 msgid "See also: L</lremovexattr>, L<attr(5)>."
12992 #: ../fish/guestfish-actions.pod:4015
12997 #: ../fish/guestfish-actions.pod:4017
13000 " resize2fs device\n"
13005 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6141
13007 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13008 "underlying device."
13012 #: ../fish/guestfish-actions.pod:4022
13014 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13015 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13016 "gives an error about this and sometimes not. In any case, it is always safe "
13017 "to call L</e2fsck-f> before calling this function."
13021 #: ../fish/guestfish-actions.pod:4028
13022 msgid "resize2fs-M"
13026 #: ../fish/guestfish-actions.pod:4030
13029 " resize2fs-M device\n"
13034 #: ../fish/guestfish-actions.pod:4032
13036 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13037 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13042 #: ../fish/guestfish-actions.pod:4036
13044 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13045 "and read the C<Block size> and C<Block count> values. These two numbers, "
13046 "multiplied together, give the resulting size of the minimal filesystem in "
13051 #: ../fish/guestfish-actions.pod:4041
13052 msgid "resize2fs-size"
13056 #: ../fish/guestfish-actions.pod:4043
13059 " resize2fs-size device size\n"
13064 #: ../fish/guestfish-actions.pod:4045
13066 "This command is the same as L</resize2fs> except that it allows you to "
13067 "specify the new size (in bytes) explicitly."
13071 #: ../fish/guestfish-actions.pod:4048
13076 #: ../fish/guestfish-actions.pod:4050
13084 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6193
13085 msgid "Remove the single file C<path>."
13089 #: ../fish/guestfish-actions.pod:4054
13094 #: ../fish/guestfish-actions.pod:4056
13102 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6205
13104 "Remove the file or directory C<path>, recursively removing the contents if "
13105 "its a directory. This is like the C<rm -rf> shell command."
13109 #: ../fish/guestfish-actions.pod:4062
13114 #: ../fish/guestfish-actions.pod:4064
13122 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6219
13123 msgid "Remove the single directory C<path>."
13127 #: ../fish/guestfish-actions.pod:4068
13128 msgid "rmmountpoint"
13132 #: ../fish/guestfish-actions.pod:4070
13135 " rmmountpoint exemptpath\n"
13140 #: ../fish/guestfish-actions.pod:4072
13142 "This calls removes a mountpoint that was previously created with L</"
13143 "mkmountpoint>. See L</mkmountpoint> for full details."
13147 #: ../fish/guestfish-actions.pod:4076
13148 msgid "scrub-device"
13152 #: ../fish/guestfish-actions.pod:4078
13155 " scrub-device device\n"
13160 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6245
13162 "This command writes patterns over C<device> to make data retrieval more "
13167 #: ../fish/guestfish-actions.pod:4083 ../fish/guestfish-actions.pod:4098
13168 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6248
13169 #: ../src/guestfs-actions.pod:6269 ../src/guestfs-actions.pod:6288
13171 "It is an interface to the L<scrub(1)> program. See that manual page for "
13176 #: ../fish/guestfish-actions.pod:4089
13181 #: ../fish/guestfish-actions.pod:4091
13184 " scrub-file file\n"
13189 #: ../fish/guestfish-actions.pod:4093 ../src/guestfs-actions.pod:6264
13191 "This command writes patterns over a file to make data retrieval more "
13196 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6267
13197 msgid "The file is I<removed> after scrubbing."
13201 #: ../fish/guestfish-actions.pod:4101
13202 msgid "scrub-freespace"
13206 #: ../fish/guestfish-actions.pod:4103
13209 " scrub-freespace dir\n"
13214 #: ../fish/guestfish-actions.pod:4105
13216 "This command creates the directory C<dir> and then fills it with files until "
13217 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
13218 "deletes them. The intention is to scrub any free space on the partition "
13219 "containing C<dir>."
13223 #: ../fish/guestfish-actions.pod:4114
13228 #: ../fish/guestfish-actions.pod:4116
13233 #: ../fish/guestfish-actions.pod:4118
13236 " set-append append\n"
13241 #: ../fish/guestfish-actions.pod:4120 ../src/guestfs-actions.pod:6301
13243 "This function is used to add additional options to the guest kernel command "
13248 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6304
13250 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13251 "environment variable."
13255 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6307
13257 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13258 "(libguestfs always adds a few of its own)."
13262 #: ../fish/guestfish-actions.pod:4129
13263 msgid "set-attach-method"
13267 #: ../fish/guestfish-actions.pod:4131
13268 msgid "attach-method"
13272 #: ../fish/guestfish-actions.pod:4133
13275 " set-attach-method attachmethod\n"
13280 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6320
13282 "Set the method that libguestfs uses to connect to the back end guestfsd "
13283 "daemon. Possible methods are:"
13287 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6325
13288 #: ../src/guestfs.pod:2826
13289 msgid "C<appliance>"
13293 #: ../fish/guestfish-actions.pod:4142 ../src/guestfs-actions.pod:6327
13295 "Launch an appliance and connect to it. This is the ordinary method and the "
13300 #: ../fish/guestfish-actions.pod:4145 ../src/guestfs-actions.pod:6330
13301 msgid "C<unix:I<path>>"
13305 #: ../fish/guestfish-actions.pod:4147 ../src/guestfs-actions.pod:6332
13306 msgid "Connect to the Unix domain socket I<path>."
13310 #: ../fish/guestfish-actions.pod:4149 ../src/guestfs-actions.pod:6334
13312 "This method lets you connect to an existing daemon or (using virtio-serial) "
13313 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
13314 "RUNNING DAEMONS>."
13318 #: ../fish/guestfish-actions.pod:4155
13319 msgid "set-autosync"
13323 #: ../fish/guestfish-actions.pod:4157
13328 #: ../fish/guestfish-actions.pod:4159
13331 " set-autosync true|false\n"
13336 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6350
13338 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13339 "effort attempt to make filesystems consistent and synchronized when the "
13340 "handle is closed (also if the program exits without closing handles)."
13344 #: ../fish/guestfish-actions.pod:4166 ../src/guestfs-actions.pod:6355
13346 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13347 "disabled by default)."
13351 #: ../fish/guestfish-actions.pod:4169
13356 #: ../fish/guestfish-actions.pod:4171
13361 #: ../fish/guestfish-actions.pod:4173
13364 " set-direct true|false\n"
13369 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6368
13371 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13372 "passed directly through to the appliance once it is launched."
13376 #: ../fish/guestfish-actions.pod:4179
13378 "One consequence of this is that log messages aren't caught by the library "
13379 "and handled by L</set-log-message-callback>, but go straight to stdout."
13383 #: ../fish/guestfish-actions.pod:4183 ../src/guestfs-actions.pod:6376
13384 msgid "You probably don't want to use this unless you know what you are doing."
13388 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6379
13389 msgid "The default is disabled."
13393 #: ../fish/guestfish-actions.pod:4188
13394 msgid "set-e2label"
13398 #: ../fish/guestfish-actions.pod:4190
13401 " set-e2label device label\n"
13406 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6392
13408 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13409 "C<label>. Filesystem labels are limited to 16 characters."
13413 #: ../fish/guestfish-actions.pod:4196
13415 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13416 "label on a filesystem."
13420 #: ../fish/guestfish-actions.pod:4199
13425 #: ../fish/guestfish-actions.pod:4201
13428 " set-e2uuid device uuid\n"
13433 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6410
13435 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13436 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13437 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13441 #: ../fish/guestfish-actions.pod:4208
13443 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13444 "UUID of a filesystem."
13448 #: ../fish/guestfish-actions.pod:4211
13449 msgid "set-memsize"
13453 #: ../fish/guestfish-actions.pod:4213
13458 #: ../fish/guestfish-actions.pod:4215
13461 " set-memsize memsize\n"
13466 #: ../fish/guestfish-actions.pod:4217
13468 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13469 "This only has any effect if called before L</launch>."
13473 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6432
13475 "You can also change this by setting the environment variable "
13476 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13480 #: ../fish/guestfish-actions.pod:4228
13481 msgid "set-network"
13485 #: ../fish/guestfish-actions.pod:4230
13490 #: ../fish/guestfish-actions.pod:4232
13493 " set-network true|false\n"
13498 #: ../fish/guestfish-actions.pod:4234 ../src/guestfs-actions.pod:6449
13500 "If C<network> is true, then the network is enabled in the libguestfs "
13501 "appliance. The default is false."
13505 #: ../fish/guestfish-actions.pod:4237 ../src/guestfs-actions.pod:6452
13507 "This affects whether commands are able to access the network (see L<guestfs"
13508 "(3)/RUNNING COMMANDS>)."
13512 #: ../fish/guestfish-actions.pod:4240
13514 "You must call this before calling L</launch>, otherwise it has no effect."
13518 #: ../fish/guestfish-actions.pod:4243
13523 #: ../fish/guestfish-actions.pod:4247
13526 " set-path searchpath\n"
13531 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6468
13532 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13536 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6470
13538 "The default is C<$libdir/guestfs> unless overridden by setting "
13539 "C<LIBGUESTFS_PATH> environment variable."
13543 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6473
13544 msgid "Setting C<path> to C<NULL> restores the default path."
13548 #: ../fish/guestfish-actions.pod:4256
13553 #: ../fish/guestfish-actions.pod:4258
13558 #: ../fish/guestfish-actions.pod:4260
13561 " set-pgroup true|false\n"
13566 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6485
13568 "If C<pgroup> is true, child processes are placed into their own process "
13573 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6488
13575 "The practical upshot of this is that signals like C<SIGINT> (from users "
13576 "pressing C<^C>) won't be received by the child process."
13580 #: ../fish/guestfish-actions.pod:4268 ../src/guestfs-actions.pod:6491
13582 "The default for this flag is false, because usually you want C<^C> to kill "
13587 #: ../fish/guestfish-actions.pod:4271
13592 #: ../fish/guestfish-actions.pod:4273
13597 #: ../fish/guestfish-actions.pod:4275
13605 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6504
13606 msgid "Set the qemu binary that we will use."
13610 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6506
13612 "The default is chosen when the library was compiled by the configure script."
13616 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6509
13618 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13623 #: ../fish/guestfish-actions.pod:4285 ../src/guestfs-actions.pod:6512
13624 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13628 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6514
13630 "Note that you should call this function as early as possible after creating "
13631 "the handle. This is because some pre-launch operations depend on testing "
13632 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13633 "don't retest features, and so you might see inconsistent results. Using the "
13634 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13635 "the qemu binary at the same time as the handle is created."
13639 #: ../fish/guestfish-actions.pod:4295
13640 msgid "set-recovery-proc"
13644 #: ../fish/guestfish-actions.pod:4297
13645 msgid "recovery-proc"
13649 #: ../fish/guestfish-actions.pod:4299
13652 " set-recovery-proc true|false\n"
13657 #: ../fish/guestfish-actions.pod:4301
13659 "If this is called with the parameter C<false> then L</launch> does not "
13660 "create a recovery process. The purpose of the recovery process is to stop "
13661 "runaway qemu processes in the case where the main program aborts abruptly."
13665 #: ../fish/guestfish-actions.pod:4306
13667 "This only has any effect if called before L</launch>, and the default is "
13672 #: ../fish/guestfish-actions.pod:4309 ../src/guestfs-actions.pod:6540
13674 "About the only time when you would want to disable this is if the main "
13675 "process will fork itself into the background (\"daemonize\" itself). In "
13676 "this case the recovery process thinks that the main program has disappeared "
13677 "and so kills qemu, which is not very helpful."
13681 #: ../fish/guestfish-actions.pod:4315
13682 msgid "set-selinux"
13686 #: ../fish/guestfish-actions.pod:4317
13691 #: ../fish/guestfish-actions.pod:4319
13694 " set-selinux true|false\n"
13699 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6556
13701 "This sets the selinux flag that is passed to the appliance at boot time. "
13702 "The default is C<selinux=0> (disabled)."
13706 #: ../fish/guestfish-actions.pod:4324 ../src/guestfs-actions.pod:6559
13708 "Note that if SELinux is enabled, it is always in Permissive mode "
13709 "(C<enforcing=0>)."
13713 #: ../fish/guestfish-actions.pod:4330
13718 #: ../fish/guestfish-actions.pod:4332
13723 #: ../fish/guestfish-actions.pod:4334
13731 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6575
13733 "Change the number of virtual CPUs assigned to the appliance. The default is "
13734 "C<1>. Increasing this may improve performance, though often it has no "
13739 #: ../fish/guestfish-actions.pod:4340
13740 msgid "This function must be called before L</launch>."
13744 #: ../fish/guestfish-actions.pod:4342
13749 #: ../fish/guestfish-actions.pod:4344
13754 #: ../fish/guestfish-actions.pod:4346
13757 " set-trace true|false\n"
13762 #: ../fish/guestfish-actions.pod:4348 ../src/guestfs-actions.pod:6591
13764 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
13765 "return values are traced."
13769 #: ../fish/guestfish-actions.pod:4351 ../src/guestfs-actions.pod:6594
13771 "If you want to trace C API calls into libguestfs (and other libraries) then "
13772 "possibly a better way is to use the external ltrace(1) command."
13776 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6598
13778 "Command traces are disabled unless the environment variable "
13779 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13783 #: ../fish/guestfish-actions.pod:4358
13785 "Trace messages are normally sent to C<stderr>, unless you register a "
13786 "callback to send them somewhere else (see L</set-event-callback>)."
13790 #: ../fish/guestfish-actions.pod:4362
13791 msgid "set-verbose"
13795 #: ../fish/guestfish-actions.pod:4364
13800 #: ../fish/guestfish-actions.pod:4366
13803 " set-verbose true|false\n"
13808 #: ../fish/guestfish-actions.pod:4368 ../src/guestfs-actions.pod:6615
13809 msgid "If C<verbose> is true, this turns on verbose messages."
13813 #: ../fish/guestfish-actions.pod:4370 ../src/guestfs-actions.pod:6617
13815 "Verbose messages are disabled unless the environment variable "
13816 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13820 #: ../fish/guestfish-actions.pod:4373
13822 "Verbose messages are normally sent to C<stderr>, unless you register a "
13823 "callback to send them somewhere else (see L</set-event-callback>)."
13827 #: ../fish/guestfish-actions.pod:4377
13832 #: ../fish/guestfish-actions.pod:4379
13835 " setcon context\n"
13840 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6634
13842 "This sets the SELinux security context of the daemon to the string "
13847 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6637
13848 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13852 #: ../fish/guestfish-actions.pod:4386
13857 #: ../fish/guestfish-actions.pod:4388
13860 " setxattr xattr val vallen path\n"
13865 #: ../fish/guestfish-actions.pod:4390 ../src/guestfs-actions.pod:6652
13867 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13868 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13872 #: ../fish/guestfish-actions.pod:4394
13873 msgid "See also: L</lsetxattr>, L<attr(5)>."
13877 #: ../fish/guestfish-actions.pod:4396
13882 #: ../fish/guestfish-actions.pod:4398
13885 " sfdisk device cyls heads sectors 'lines ...'\n"
13890 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6679
13892 "This is a direct interface to the L<sfdisk(8)> program for creating "
13893 "partitions on block devices."
13897 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6682
13898 msgid "C<device> should be a block device, for example C</dev/sda>."
13902 #: ../fish/guestfish-actions.pod:4405 ../src/guestfs-actions.pod:6684
13904 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13905 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
13906 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13907 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13908 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13909 "the kernel) cannot work out the right geometry and you will need to tell it."
13913 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6692
13915 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13916 "refer to the L<sfdisk(8)> manpage."
13920 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6695
13922 "To create a single partition occupying the whole disk, you would pass "
13923 "C<lines> as a single element list, when the single element being the string "
13928 #: ../fish/guestfish-actions.pod:4420
13929 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13933 #: ../fish/guestfish-actions.pod:4426 ../fish/guestfish-actions.pod:4449
13934 #: ../fish/guestfish-actions.pod:4471
13936 "I<This function is deprecated.> In new code, use the L</part_add> call "
13941 #: ../fish/guestfish-actions.pod:4433
13946 #: ../fish/guestfish-actions.pod:4435
13949 " sfdiskM device 'lines ...'\n"
13954 #: ../fish/guestfish-actions.pod:4437
13956 "This is a simplified interface to the L</sfdisk> command, where partition "
13957 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13958 "you don't need to specify the cyls, heads and sectors parameters which were "
13959 "rarely if ever used anyway."
13963 #: ../fish/guestfish-actions.pod:4443
13964 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13968 #: ../fish/guestfish-actions.pod:4456
13973 #: ../fish/guestfish-actions.pod:4458
13976 " sfdisk-N device partnum cyls heads sectors line\n"
13981 #: ../fish/guestfish-actions.pod:4460 ../src/guestfs-actions.pod:6757
13983 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13984 "(note: C<n> counts from 1)."
13988 #: ../fish/guestfish-actions.pod:4463
13990 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13991 "cyls/heads/sectors parameters."
13995 #: ../fish/guestfish-actions.pod:4466
13996 msgid "See also: L</part-add>"
14000 #: ../fish/guestfish-actions.pod:4478
14001 msgid "sfdisk-disk-geometry"
14005 #: ../fish/guestfish-actions.pod:4480
14008 " sfdisk-disk-geometry device\n"
14013 #: ../fish/guestfish-actions.pod:4482
14015 "This displays the disk geometry of C<device> read from the partition table. "
14016 "Especially in the case where the underlying block device has been resized, "
14017 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
14018 "kernel-geometry>)."
14022 #: ../fish/guestfish-actions.pod:4487 ../fish/guestfish-actions.pod:4496
14023 #: ../src/guestfs-actions.pod:6783 ../src/guestfs-actions.pod:6799
14024 msgid "The result is in human-readable format, and not designed to be parsed."
14028 #: ../fish/guestfish-actions.pod:4490
14029 msgid "sfdisk-kernel-geometry"
14033 #: ../fish/guestfish-actions.pod:4492
14036 " sfdisk-kernel-geometry device\n"
14041 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6797
14042 msgid "This displays the kernel's idea of the geometry of C<device>."
14046 #: ../fish/guestfish-actions.pod:4499
14051 #: ../fish/guestfish-actions.pod:4501
14054 " sfdisk-l device\n"
14059 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6820
14061 "This displays the partition table on C<device>, in the human-readable output "
14062 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14066 #: ../fish/guestfish-actions.pod:4507
14067 msgid "See also: L</part-list>"
14071 #: ../fish/guestfish-actions.pod:4509
14073 "I<This function is deprecated.> In new code, use the L</part_list> call "
14078 #: ../fish/guestfish-actions.pod:4516
14083 #: ../fish/guestfish-actions.pod:4518
14091 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6837
14093 "This call runs a command from the guest filesystem via the guest's C</bin/"
14098 #: ../fish/guestfish-actions.pod:4523
14099 msgid "This is like L</command>, but passes the command to:"
14103 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6842
14106 " /bin/sh -c \"command\"\n"
14111 #: ../fish/guestfish-actions.pod:4527 ../src/guestfs-actions.pod:6844
14113 "Depending on the guest's shell, this usually results in wildcards being "
14114 "expanded, shell expressions being interpolated and so on."
14118 #: ../fish/guestfish-actions.pod:4531
14119 msgid "All the provisos about L</command> apply to this call."
14123 #: ../fish/guestfish-actions.pod:4533
14128 #: ../fish/guestfish-actions.pod:4535
14131 " sh-lines command\n"
14136 #: ../fish/guestfish-actions.pod:4537
14137 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14141 #: ../fish/guestfish-actions.pod:4540
14142 msgid "See also: L</command-lines>"
14146 #: ../fish/guestfish-actions.pod:4542
14151 #: ../fish/guestfish-actions.pod:4544
14159 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6878
14160 msgid "Sleep for C<secs> seconds."
14164 #: ../fish/guestfish-actions.pod:4548
14169 #: ../fish/guestfish-actions.pod:4550
14177 #: ../fish/guestfish-actions.pod:4554 ../src/guestfs-actions.pod:6892
14178 msgid "This is the same as the C<stat(2)> system call."
14182 #: ../fish/guestfish-actions.pod:4556
14187 #: ../fish/guestfish-actions.pod:4558
14195 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6906
14197 "Returns file system statistics for any mounted file system. C<path> should "
14198 "be a file or directory in the mounted file system (typically it is the mount "
14199 "point itself, but it doesn't need to be)."
14203 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6910
14204 msgid "This is the same as the C<statvfs(2)> system call."
14208 #: ../fish/guestfish-actions.pod:4566
14213 #: ../fish/guestfish-actions.pod:4568
14221 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6924
14223 "This runs the L<strings(1)> command on a file and returns the list of "
14224 "printable strings found."
14228 #: ../fish/guestfish-actions.pod:4576
14233 #: ../fish/guestfish-actions.pod:4578
14236 " strings-e encoding path\n"
14241 #: ../fish/guestfish-actions.pod:4580
14243 "This is like the L</strings> command, but allows you to specify the encoding "
14244 "of strings that are looked for in the source file C<path>."
14248 #: ../fish/guestfish-actions.pod:4584 ../src/guestfs-actions.pod:6947
14249 msgid "Allowed encodings are:"
14253 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6951
14258 #: ../fish/guestfish-actions.pod:4590
14260 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14261 "ISO-8859-X (this is what L</strings> uses)."
14265 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6956
14270 #: ../fish/guestfish-actions.pod:4595 ../src/guestfs-actions.pod:6958
14271 msgid "Single 8-bit-byte characters."
14275 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:6960
14280 #: ../fish/guestfish-actions.pod:4599 ../src/guestfs-actions.pod:6962
14281 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14285 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6965
14286 msgid "l (lower case letter L)"
14290 #: ../fish/guestfish-actions.pod:4604 ../src/guestfs-actions.pod:6967
14292 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14293 "examining binaries in Windows guests."
14297 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:6970
14302 #: ../fish/guestfish-actions.pod:4609 ../src/guestfs-actions.pod:6972
14303 msgid "32-bit big endian such as UCS-4BE."
14307 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6974
14312 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6976
14313 msgid "32-bit little endian such as UCS-4LE."
14317 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6980
14318 msgid "The returned strings are transcoded to UTF-8."
14322 #: ../fish/guestfish-actions.pod:4622
14323 msgid "swapoff-device"
14327 #: ../fish/guestfish-actions.pod:4624
14330 " swapoff-device device\n"
14335 #: ../fish/guestfish-actions.pod:4626
14337 "This command disables the libguestfs appliance swap device or partition "
14338 "named C<device>. See L</swapon-device>."
14342 #: ../fish/guestfish-actions.pod:4630
14343 msgid "swapoff-file"
14347 #: ../fish/guestfish-actions.pod:4632
14350 " swapoff-file file\n"
14355 #: ../fish/guestfish-actions.pod:4634 ../src/guestfs-actions.pod:7011
14356 msgid "This command disables the libguestfs appliance swap on file."
14360 #: ../fish/guestfish-actions.pod:4636
14361 msgid "swapoff-label"
14365 #: ../fish/guestfish-actions.pod:4638
14368 " swapoff-label label\n"
14373 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:7023
14375 "This command disables the libguestfs appliance swap on labeled swap "
14380 #: ../fish/guestfish-actions.pod:4643
14381 msgid "swapoff-uuid"
14385 #: ../fish/guestfish-actions.pod:4645
14388 " swapoff-uuid uuid\n"
14393 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:7036
14395 "This command disables the libguestfs appliance swap partition with the given "
14400 #: ../fish/guestfish-actions.pod:4650
14401 msgid "swapon-device"
14405 #: ../fish/guestfish-actions.pod:4652
14408 " swapon-device device\n"
14413 #: ../fish/guestfish-actions.pod:4654
14415 "This command enables the libguestfs appliance to use the swap device or "
14416 "partition named C<device>. The increased memory is made available for all "
14417 "commands, for example those run using L</command> or L</sh>."
14421 #: ../fish/guestfish-actions.pod:4659 ../src/guestfs-actions.pod:7054
14423 "Note that you should not swap to existing guest swap partitions unless you "
14424 "know what you are doing. They may contain hibernation information, or other "
14425 "information that the guest doesn't want you to trash. You also risk leaking "
14426 "information about the host to the guest this way. Instead, attach a new "
14427 "host device to the guest and swap on that."
14431 #: ../fish/guestfish-actions.pod:4666
14432 msgid "swapon-file"
14436 #: ../fish/guestfish-actions.pod:4668
14439 " swapon-file file\n"
14444 #: ../fish/guestfish-actions.pod:4670
14446 "This command enables swap to a file. See L</swapon-device> for other notes."
14450 #: ../fish/guestfish-actions.pod:4673
14451 msgid "swapon-label"
14455 #: ../fish/guestfish-actions.pod:4675
14458 " swapon-label label\n"
14463 #: ../fish/guestfish-actions.pod:4677
14465 "This command enables swap to a labeled swap partition. See L</swapon-"
14466 "device> for other notes."
14470 #: ../fish/guestfish-actions.pod:4680
14471 msgid "swapon-uuid"
14475 #: ../fish/guestfish-actions.pod:4682
14478 " swapon-uuid uuid\n"
14483 #: ../fish/guestfish-actions.pod:4684
14485 "This command enables swap to a swap partition with the given UUID. See L</"
14486 "swapon-device> for other notes."
14490 #: ../fish/guestfish-actions.pod:4687
14495 #: ../fish/guestfish-actions.pod:4689
14503 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7109
14505 "This syncs the disk, so that any writes are flushed through to the "
14506 "underlying disk image."
14510 #: ../fish/guestfish-actions.pod:4694 ../src/guestfs-actions.pod:7112
14512 "You should always call this if you have modified a disk image, before "
14513 "closing the handle."
14517 #: ../fish/guestfish-actions.pod:4697
14522 #: ../fish/guestfish-actions.pod:4699
14530 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7125
14532 "This command returns up to the last 10 lines of a file as a list of strings."
14536 #: ../fish/guestfish-actions.pod:4707
14541 #: ../fish/guestfish-actions.pod:4709
14544 " tail-n nrlines path\n"
14549 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7144
14551 "If the parameter C<nrlines> is a positive number, this returns the last "
14552 "C<nrlines> lines of the file C<path>."
14556 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7147
14558 "If the parameter C<nrlines> is a negative number, this returns lines from "
14559 "the file C<path>, starting with the C<-nrlines>th line."
14563 #: ../fish/guestfish-actions.pod:4722
14568 #: ../fish/guestfish-actions.pod:4724
14571 " tar-in (tarfile|-) directory\n"
14576 #: ../fish/guestfish-actions.pod:4726 ../src/guestfs-actions.pod:7168
14578 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14579 "tar file) into C<directory>."
14583 #: ../fish/guestfish-actions.pod:4729
14584 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14588 #: ../fish/guestfish-actions.pod:4734
14593 #: ../fish/guestfish-actions.pod:4736
14596 " tar-out directory (tarfile|-)\n"
14601 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7185
14603 "This command packs the contents of C<directory> and downloads it to local "
14608 #: ../fish/guestfish-actions.pod:4741
14609 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14613 #: ../fish/guestfish-actions.pod:4746
14618 #: ../fish/guestfish-actions.pod:4748
14621 " tgz-in (tarball|-) directory\n"
14626 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7202
14628 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14629 "tar file) into C<directory>."
14633 #: ../fish/guestfish-actions.pod:4753
14634 msgid "To upload an uncompressed tarball, use L</tar-in>."
14638 #: ../fish/guestfish-actions.pod:4757
14643 #: ../fish/guestfish-actions.pod:4759
14646 " tgz-out directory (tarball|-)\n"
14651 #: ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7218
14653 "This command packs the contents of C<directory> and downloads it to local "
14658 #: ../fish/guestfish-actions.pod:4764
14659 msgid "To download an uncompressed tarball, use L</tar-out>."
14663 #: ../fish/guestfish-actions.pod:4768
14668 #: ../fish/guestfish-actions.pod:4770
14676 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7233
14678 "Touch acts like the L<touch(1)> command. It can be used to update the "
14679 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14684 #: ../fish/guestfish-actions.pod:4776 ../src/guestfs-actions.pod:7237
14686 "This command only works on regular files, and will fail on other file types "
14687 "such as directories, symbolic links, block special etc."
14691 #: ../fish/guestfish-actions.pod:4779
14696 #: ../fish/guestfish-actions.pod:4781
14704 #: ../fish/guestfish-actions.pod:4783 ../src/guestfs-actions.pod:7250
14706 "This command truncates C<path> to a zero-length file. The file must exist "
14711 #: ../fish/guestfish-actions.pod:4786
14712 msgid "truncate-size"
14716 #: ../fish/guestfish-actions.pod:4788
14719 " truncate-size path size\n"
14724 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7264
14726 "This command truncates C<path> to size C<size> bytes. The file must exist "
14731 #: ../fish/guestfish-actions.pod:4793
14733 "If the current file size is less than C<size> then the file is extended to "
14734 "the required size with zero bytes. This creates a sparse file (ie. disk "
14735 "blocks are not allocated for the file until you write to it). To create a "
14736 "non-sparse file of zeroes, use L</fallocate64> instead."
14740 #: ../fish/guestfish-actions.pod:4799
14745 #: ../fish/guestfish-actions.pod:4801
14748 " tune2fs-l device\n"
14753 #: ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:7283
14755 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14760 #: ../fish/guestfish-actions.pod:4806 ../src/guestfs-actions.pod:7286
14762 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14763 "for more details. The list of fields returned isn't clearly defined, and "
14764 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14765 "and the filesystem itself."
14769 #: ../fish/guestfish-actions.pod:4811
14774 #: ../fish/guestfish-actions.pod:4813
14777 " txz-in (tarball|-) directory\n"
14782 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7306
14784 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14785 "tar file) into C<directory>."
14789 #: ../fish/guestfish-actions.pod:4820
14794 #: ../fish/guestfish-actions.pod:4822
14797 " txz-out directory (tarball|-)\n"
14802 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7320
14804 "This command packs the contents of C<directory> and downloads it to local "
14805 "file C<tarball> (as an xz compressed tar archive)."
14809 #: ../fish/guestfish-actions.pod:4829
14814 #: ../fish/guestfish-actions.pod:4831
14822 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7333
14824 "This function sets the mask used for creating new files and device nodes to "
14829 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7336
14831 "Typical umask values would be C<022> which creates new files with "
14832 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14833 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14837 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7341
14839 "The default umask is C<022>. This is important because it means that "
14840 "directories and device nodes will be created with C<0644> or C<0755> mode "
14841 "even if you specify C<0777>."
14845 #: ../fish/guestfish-actions.pod:4845
14846 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
14850 #: ../fish/guestfish-actions.pod:4848 ../src/guestfs-actions.pod:7348
14851 msgid "This call returns the previous umask."
14855 #: ../fish/guestfish-actions.pod:4850
14860 #: ../fish/guestfish-actions.pod:4852
14865 #: ../fish/guestfish-actions.pod:4854
14868 " umount pathordevice\n"
14873 #: ../fish/guestfish-actions.pod:4856 ../src/guestfs-actions.pod:7360
14875 "This unmounts the given filesystem. The filesystem may be specified either "
14876 "by its mountpoint (path) or the device which contains the filesystem."
14880 #: ../fish/guestfish-actions.pod:4860
14885 #: ../fish/guestfish-actions.pod:4862
14886 msgid "unmount-all"
14890 #: ../fish/guestfish-actions.pod:4864
14898 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7373
14899 msgid "This unmounts all mounted filesystems."
14903 #: ../fish/guestfish-actions.pod:4868 ../src/guestfs-actions.pod:7375
14904 msgid "Some internal mounts are not unmounted by this call."
14908 #: ../fish/guestfish-actions.pod:4870
14913 #: ../fish/guestfish-actions.pod:4872
14916 " upload (filename|-) remotefilename\n"
14921 #: ../fish/guestfish-actions.pod:4874 ../fish/guestfish-actions.pod:4887
14922 #: ../src/guestfs-actions.pod:7388 ../src/guestfs-actions.pod:7412
14923 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14927 #: ../fish/guestfish-actions.pod:4879
14928 msgid "See also L</download>."
14932 #: ../fish/guestfish-actions.pod:4883
14933 msgid "upload-offset"
14937 #: ../fish/guestfish-actions.pod:4885
14940 " upload-offset (filename|-) remotefilename offset\n"
14945 #: ../fish/guestfish-actions.pod:4890 ../src/guestfs-actions.pod:7415
14947 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14948 "The intention is to overwrite parts of existing files or devices, although "
14949 "if a non-existant file is specified then it is created with a \"hole\" "
14950 "before C<offset>. The size of the data written is implicit in the size of "
14951 "the source C<filename>."
14955 #: ../fish/guestfish-actions.pod:4897
14957 "Note that there is no limit on the amount of data that can be uploaded with "
14958 "this call, unlike with L</pwrite>, and this call always writes the full "
14959 "amount unless an error occurs."
14963 #: ../fish/guestfish-actions.pod:4902
14964 msgid "See also L</upload>, L</pwrite>."
14968 #: ../fish/guestfish-actions.pod:4906
14973 #: ../fish/guestfish-actions.pod:4908
14976 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14981 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7448
14982 msgid "This command sets the timestamps of a file with nanosecond precision."
14986 #: ../fish/guestfish-actions.pod:4913 ../src/guestfs-actions.pod:7451
14988 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14993 #: ../fish/guestfish-actions.pod:4916 ../src/guestfs-actions.pod:7454
14995 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14996 "nanoseconds from the epoch."
15000 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7457
15002 "If the C<*nsecs> field contains the special value C<-1> then the "
15003 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15004 "ignored in this case)."
15008 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7461
15010 "If the C<*nsecs> field contains the special value C<-2> then the "
15011 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15016 #: ../fish/guestfish-actions.pod:4927
15021 #: ../fish/guestfish-actions.pod:4929
15029 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7474
15031 "Return the libguestfs version number that the program is linked against."
15035 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7477
15037 "Note that because of dynamic linking this is not necessarily the version of "
15038 "libguestfs that you compiled against. You can compile the program, and then "
15039 "at runtime dynamically link against a completely different C<libguestfs.so> "
15044 #: ../fish/guestfish-actions.pod:4939 ../src/guestfs-actions.pod:7482
15046 "This call was added in version C<1.0.58>. In previous versions of "
15047 "libguestfs there was no way to get the version number. From C code you can "
15048 "use dynamic linker functions to find out if this symbol exists (if it "
15049 "doesn't, then it's an earlier version)."
15053 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7488
15055 "The call returns a structure with four elements. The first three (C<major>, "
15056 "C<minor> and C<release>) are numbers and correspond to the usual version "
15057 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15058 "but may be used for distro-specific information."
15062 #: ../fish/guestfish-actions.pod:4951 ../src/guestfs-actions.pod:7494
15064 "To construct the original version string: C<$major.$minor.$release$extra>"
15068 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7497
15069 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15073 #: ../fish/guestfish-actions.pod:4956
15075 "I<Note:> Don't use this call to test for availability of features. In "
15076 "enterprise distributions we backport features from later versions into "
15077 "earlier versions, making this an unreliable way to test for features. Use "
15078 "L</available> instead."
15082 #: ../fish/guestfish-actions.pod:4962
15087 #: ../fish/guestfish-actions.pod:4964
15090 " vfs-label device\n"
15095 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7517
15096 msgid "This returns the filesystem label of the filesystem on C<device>."
15100 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7520
15101 msgid "If the filesystem is unlabeled, this returns the empty string."
15105 #: ../fish/guestfish-actions.pod:4971
15106 msgid "To find a filesystem from the label, use L</findfs-label>."
15110 #: ../fish/guestfish-actions.pod:4973
15115 #: ../fish/guestfish-actions.pod:4975
15118 " vfs-type device\n"
15123 #: ../fish/guestfish-actions.pod:4977 ../src/guestfs-actions.pod:7535
15125 "This command gets the filesystem type corresponding to the filesystem on "
15130 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7538
15132 "For most filesystems, the result is the name of the Linux VFS module which "
15133 "would be used to mount this filesystem if you mounted it without specifying "
15134 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15138 #: ../fish/guestfish-actions.pod:4985
15143 #: ../fish/guestfish-actions.pod:4987
15146 " vfs-uuid device\n"
15151 #: ../fish/guestfish-actions.pod:4989 ../src/guestfs-actions.pod:7554
15152 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15156 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7557
15157 msgid "If the filesystem does not have a UUID, this returns the empty string."
15161 #: ../fish/guestfish-actions.pod:4994
15162 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15166 #: ../fish/guestfish-actions.pod:4996
15167 msgid "vg-activate"
15171 #: ../fish/guestfish-actions.pod:4998
15174 " vg-activate true|false 'volgroups ...'\n"
15179 #: ../fish/guestfish-actions.pod:5000 ../src/guestfs-actions.pod:7573
15181 "This command activates or (if C<activate> is false) deactivates all logical "
15182 "volumes in the listed volume groups C<volgroups>."
15186 #: ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:7576
15187 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15191 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7578
15193 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15194 "activated or deactivated."
15198 #: ../fish/guestfish-actions.pod:5008
15199 msgid "vg-activate-all"
15203 #: ../fish/guestfish-actions.pod:5010
15206 " vg-activate-all true|false\n"
15211 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7591
15213 "This command activates or (if C<activate> is false) deactivates all logical "
15214 "volumes in all volume groups."
15218 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7594
15219 msgid "This command is the same as running C<vgchange -a y|n>"
15223 #: ../fish/guestfish-actions.pod:5017
15228 #: ../fish/guestfish-actions.pod:5019
15231 " vgcreate volgroup 'physvols ...'\n"
15236 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7607
15238 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15239 "of physical volumes C<physvols>."
15243 #: ../fish/guestfish-actions.pod:5024
15248 #: ../fish/guestfish-actions.pod:5026
15251 " vglvuuids vgname\n"
15256 #: ../fish/guestfish-actions.pod:5028 ../src/guestfs-actions.pod:7620
15258 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15259 "volumes created in this volume group."
15263 #: ../fish/guestfish-actions.pod:5031
15265 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
15266 "logical volumes and volume groups."
15270 #: ../fish/guestfish-actions.pod:5034
15271 msgid "See also L</vgpvuuids>."
15275 #: ../fish/guestfish-actions.pod:5036
15280 #: ../fish/guestfish-actions.pod:5038
15283 " vgpvuuids vgname\n"
15288 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7640
15290 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15291 "volumes that this volume group resides on."
15295 #: ../fish/guestfish-actions.pod:5043
15297 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
15298 "physical volumes and volume groups."
15302 #: ../fish/guestfish-actions.pod:5046
15303 msgid "See also L</vglvuuids>."
15307 #: ../fish/guestfish-actions.pod:5048
15312 #: ../fish/guestfish-actions.pod:5050
15315 " vgremove vgname\n"
15320 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7660
15321 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15325 #: ../fish/guestfish-actions.pod:5054 ../src/guestfs-actions.pod:7662
15327 "This also forcibly removes all logical volumes in the volume group (if any)."
15331 #: ../fish/guestfish-actions.pod:5057
15336 #: ../fish/guestfish-actions.pod:5059
15339 " vgrename volgroup newvolgroup\n"
15344 #: ../fish/guestfish-actions.pod:5061 ../src/guestfs-actions.pod:7676
15345 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15349 #: ../fish/guestfish-actions.pod:5063
15354 #: ../fish/guestfish-actions.pod:5065
15362 #: ../fish/guestfish-actions.pod:5067 ../src/guestfs-actions.pod:7687
15364 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15369 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7690
15371 "This returns a list of just the volume group names that were detected (eg. "
15376 #: ../fish/guestfish-actions.pod:5073
15377 msgid "See also L</vgs-full>."
15381 #: ../fish/guestfish-actions.pod:5075
15386 #: ../fish/guestfish-actions.pod:5077
15394 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7706
15396 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15397 "> command. The \"full\" version includes all fields."
15401 #: ../fish/guestfish-actions.pod:5082
15406 #: ../fish/guestfish-actions.pod:5084
15414 #: ../fish/guestfish-actions.pod:5086 ../src/guestfs-actions.pod:7720
15416 "This rescans all block devices and rebuilds the list of LVM physical "
15417 "volumes, volume groups and logical volumes."
15421 #: ../fish/guestfish-actions.pod:5089
15426 #: ../fish/guestfish-actions.pod:5091
15434 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7733
15435 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15439 #: ../fish/guestfish-actions.pod:5095
15444 #: ../fish/guestfish-actions.pod:5097
15452 #: ../fish/guestfish-actions.pod:5099 ../src/guestfs-actions.pod:7773
15454 "This command counts the characters in a file, using the C<wc -c> external "
15459 #: ../fish/guestfish-actions.pod:5102
15464 #: ../fish/guestfish-actions.pod:5104
15472 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7786
15474 "This command counts the lines in a file, using the C<wc -l> external command."
15478 #: ../fish/guestfish-actions.pod:5109
15483 #: ../fish/guestfish-actions.pod:5111
15491 #: ../fish/guestfish-actions.pod:5113 ../src/guestfs-actions.pod:7799
15493 "This command counts the words in a file, using the C<wc -w> external command."
15497 #: ../fish/guestfish-actions.pod:5116
15502 #: ../fish/guestfish-actions.pod:5118
15505 " write path content\n"
15510 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7814
15512 "This call creates a file called C<path>. The content of the file is the "
15513 "string C<content> (which can contain any 8 bit data)."
15517 #: ../fish/guestfish-actions.pod:5123
15518 msgid "See also L</write-append>."
15522 #: ../fish/guestfish-actions.pod:5128
15523 msgid "write-append"
15527 #: ../fish/guestfish-actions.pod:5130
15530 " write-append path content\n"
15535 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7834
15537 "This call appends C<content> to the end of file C<path>. If C<path> does "
15538 "not exist, then a new file is created."
15542 #: ../fish/guestfish-actions.pod:5135
15543 msgid "See also L</write>."
15547 #: ../fish/guestfish-actions.pod:5140
15552 #: ../fish/guestfish-actions.pod:5142
15555 " write-file path content size\n"
15560 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7861
15562 "This call creates a file called C<path>. The contents of the file is the "
15563 "string C<content> (which can contain any 8 bit data), with length C<size>."
15567 #: ../fish/guestfish-actions.pod:5148 ../src/guestfs-actions.pod:7865
15569 "As a special case, if C<size> is C<0> then the length is calculated using "
15570 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15574 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7869
15576 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15577 "I<not> work, even if the length is specified."
15581 #: ../fish/guestfish-actions.pod:5158
15583 "I<This function is deprecated.> In new code, use the L</write> call instead."
15587 #: ../fish/guestfish-actions.pod:5165
15592 #: ../fish/guestfish-actions.pod:5167
15595 " zegrep regex path\n"
15600 #: ../fish/guestfish-actions.pod:5169 ../src/guestfs-actions.pod:7886
15602 "This calls the external C<zegrep> program and returns the matching lines."
15606 #: ../fish/guestfish-actions.pod:5175
15611 #: ../fish/guestfish-actions.pod:5177
15614 " zegrepi regex path\n"
15619 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7905
15621 "This calls the external C<zegrep -i> program and returns the matching lines."
15625 #: ../fish/guestfish-actions.pod:5185
15630 #: ../fish/guestfish-actions.pod:5187
15638 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7923
15639 msgid "This command writes zeroes over the first few blocks of C<device>."
15643 #: ../fish/guestfish-actions.pod:5191 ../src/guestfs-actions.pod:7925
15645 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15646 "securely wipe the device). It should be sufficient to remove any partition "
15647 "tables, filesystem superblocks and so on."
15651 #: ../fish/guestfish-actions.pod:5195 ../fish/guestfish-actions.pod:5210
15652 #: ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:7955
15654 "If blocks are already zero, then this command avoids writing zeroes. This "
15655 "prevents the underlying device from becoming non-sparse or growing "
15660 #: ../fish/guestfish-actions.pod:5199
15661 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15665 #: ../fish/guestfish-actions.pod:5202
15666 msgid "zero-device"
15670 #: ../fish/guestfish-actions.pod:5204
15673 " zero-device device\n"
15678 #: ../fish/guestfish-actions.pod:5206
15680 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15681 "which just zeroes the first few blocks of a device."
15685 #: ../fish/guestfish-actions.pod:5217
15690 #: ../fish/guestfish-actions.pod:5219
15693 " zerofree device\n"
15698 #: ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:7977
15700 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15701 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15702 "possible to compress the filesystem more effectively."
15706 #: ../fish/guestfish-actions.pod:5226 ../src/guestfs-actions.pod:7982
15707 msgid "You should B<not> run this program if the filesystem is mounted."
15711 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:7985
15713 "It is possible that using this program can damage the filesystem or data on "
15718 #: ../fish/guestfish-actions.pod:5232
15723 #: ../fish/guestfish-actions.pod:5234
15726 " zfgrep pattern path\n"
15731 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:7999
15733 "This calls the external C<zfgrep> program and returns the matching lines."
15737 #: ../fish/guestfish-actions.pod:5242
15742 #: ../fish/guestfish-actions.pod:5244
15745 " zfgrepi pattern path\n"
15750 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8018
15752 "This calls the external C<zfgrep -i> program and returns the matching lines."
15756 #: ../fish/guestfish-actions.pod:5252
15761 #: ../fish/guestfish-actions.pod:5254
15764 " zfile meth path\n"
15769 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8044
15771 "This command runs C<file> after first decompressing C<path> using C<method>."
15775 #: ../fish/guestfish-actions.pod:5259 ../src/guestfs-actions.pod:8047
15776 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15780 #: ../fish/guestfish-actions.pod:5261
15782 "Since 1.0.63, use L</file> instead which can now process compressed files."
15786 #: ../fish/guestfish-actions.pod:5264
15788 "I<This function is deprecated.> In new code, use the L</file> call instead."
15792 #: ../fish/guestfish-actions.pod:5271
15797 #: ../fish/guestfish-actions.pod:5273
15800 " zgrep regex path\n"
15805 #: ../fish/guestfish-actions.pod:5275 ../src/guestfs-actions.pod:8064
15807 "This calls the external C<zgrep> program and returns the matching lines."
15811 #: ../fish/guestfish-actions.pod:5281
15816 #: ../fish/guestfish-actions.pod:5283
15819 " zgrepi regex path\n"
15824 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8083
15826 "This calls the external C<zgrep -i> program and returns the matching lines."
15830 #: ../fish/guestfish-commands.pod:1
15835 #: ../fish/guestfish-commands.pod:3
15840 #: ../fish/guestfish-commands.pod:5
15843 " alloc filename size\n"
15848 #: ../fish/guestfish-commands.pod:7
15850 "This creates an empty (zeroed) file of the given size, and then adds so it "
15851 "can be further examined."
15855 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
15856 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
15860 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
15861 msgid "Size can be specified using standard suffixes, eg. C<1M>."
15865 #: ../fish/guestfish-commands.pod:14
15867 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
15868 "image, see L</PREPARED DISK IMAGES>."
15872 #: ../fish/guestfish-commands.pod:17
15877 #: ../fish/guestfish-commands.pod:19
15880 " copy-in local [local ...] /remotedir\n"
15885 #: ../fish/guestfish-commands.pod:21
15887 "C<copy-in> copies local files or directories recursively into the disk "
15888 "image, placing them in the directory called C</remotedir> (which must "
15889 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
15890 "other commands as necessary."
15894 #: ../fish/guestfish-commands.pod:26
15896 "Multiple local files and directories can be specified, but the last "
15897 "parameter must always be a remote directory. Wildcards cannot be used."
15901 #: ../fish/guestfish-commands.pod:30
15906 #: ../fish/guestfish-commands.pod:32
15909 " copy-out remote [remote ...] localdir\n"
15914 #: ../fish/guestfish-commands.pod:34
15916 "C<copy-out> copies remote files or directories recursively out of the disk "
15917 "image, placing them on the host disk in a local directory called C<localdir> "
15918 "(which must exist). This guestfish meta-command turns into a sequence of L</"
15919 "download>, L</tar-out> and other commands as necessary."
15923 #: ../fish/guestfish-commands.pod:40
15925 "Multiple remote files and directories can be specified, but the last "
15926 "parameter must always be a local directory. To download to the current "
15927 "directory, use C<.> as in:"
15931 #: ../fish/guestfish-commands.pod:44
15934 " copy-out /home .\n"
15939 #: ../fish/guestfish-commands.pod:46
15941 "Wildcards cannot be used in the ordinary command, but you can use them with "
15942 "the help of L</glob> like this:"
15946 #: ../fish/guestfish-commands.pod:49
15949 " glob copy-out /home/* .\n"
15954 #: ../fish/guestfish-commands.pod:51
15959 #: ../fish/guestfish-commands.pod:53
15962 " display filename\n"
15967 #: ../fish/guestfish-commands.pod:55
15969 "Use C<display> (a graphical display program) to display an image file. It "
15970 "downloads the file, and runs C<display> on it."
15974 #: ../fish/guestfish-commands.pod:58
15976 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15977 "environment variable. For example to use the GNOME display program:"
15981 #: ../fish/guestfish-commands.pod:61
15984 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15989 #: ../fish/guestfish-commands.pod:63
15990 msgid "See also L<display(1)>."
15994 #: ../fish/guestfish-commands.pod:65
15999 #: ../fish/guestfish-commands.pod:67
16002 " echo [params ...]\n"
16007 #: ../fish/guestfish-commands.pod:69
16008 msgid "This echos the parameters to the terminal."
16012 #: ../fish/guestfish-commands.pod:71
16017 #: ../fish/guestfish-commands.pod:73
16022 #: ../fish/guestfish-commands.pod:75
16027 #: ../fish/guestfish-commands.pod:77
16035 #: ../fish/guestfish-commands.pod:79
16037 "This is used to edit a file. It downloads the file, edits it locally using "
16038 "your editor, then uploads the result."
16042 #: ../fish/guestfish-commands.pod:82
16044 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16045 "or C<emacs> you will get those corresponding editors."
16049 #: ../fish/guestfish-commands.pod:86
16054 #: ../fish/guestfish-commands.pod:88
16057 " glob command args...\n"
16062 #: ../fish/guestfish-commands.pod:90
16064 "Expand wildcards in any paths in the args list, and run C<command> "
16065 "repeatedly on each matching path."
16069 #: ../fish/guestfish-commands.pod:93
16070 msgid "See L</WILDCARDS AND GLOBBING>."
16074 #: ../fish/guestfish-commands.pod:95
16079 #: ../fish/guestfish-commands.pod:97
16082 " hexedit <filename|device>\n"
16083 " hexedit <filename|device> <max>\n"
16084 " hexedit <filename|device> <start> <max>\n"
16089 #: ../fish/guestfish-commands.pod:101
16091 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16096 #: ../fish/guestfish-commands.pod:104
16098 "This command works by downloading potentially the whole file or device, "
16099 "editing it locally, then uploading it. If the file or device is large, you "
16100 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16101 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16102 "usual modifiers allowed such as C<1M> (1 megabyte)."
16106 #: ../fish/guestfish-commands.pod:111
16107 msgid "For example to edit the first few sectors of a disk you might do:"
16111 #: ../fish/guestfish-commands.pod:114
16114 " hexedit /dev/sda 1M\n"
16119 #: ../fish/guestfish-commands.pod:116
16121 "which would allow you to edit anywhere within the first megabyte of the disk."
16125 #: ../fish/guestfish-commands.pod:119
16126 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16130 #: ../fish/guestfish-commands.pod:121
16133 " hexedit /dev/sda1 0x400 0x400\n"
16138 #: ../fish/guestfish-commands.pod:123
16139 msgid "(assuming the superblock is in the standard location)."
16143 #: ../fish/guestfish-commands.pod:125
16145 "This command requires the external L<hexedit(1)> program. You can specify "
16146 "another program to use by setting the C<HEXEDITOR> environment variable."
16150 #: ../fish/guestfish-commands.pod:129
16151 msgid "See also L</hexdump>."
16155 #: ../fish/guestfish-commands.pod:131
16160 #: ../fish/guestfish-commands.pod:133
16168 #: ../fish/guestfish-commands.pod:135
16170 "Change the local directory, ie. the current directory of guestfish itself."
16174 #: ../fish/guestfish-commands.pod:138
16175 msgid "Note that C<!cd> won't do what you might expect."
16179 #: ../fish/guestfish-commands.pod:140
16184 #: ../fish/guestfish-commands.pod:142
16189 #: ../fish/guestfish-commands.pod:144
16197 #: ../fish/guestfish-commands.pod:146
16198 msgid "Opens the manual page for guestfish."
16202 #: ../fish/guestfish-commands.pod:148
16207 #: ../fish/guestfish-commands.pod:150
16212 #: ../fish/guestfish-commands.pod:152
16220 #: ../fish/guestfish-commands.pod:154
16228 #: ../fish/guestfish-commands.pod:156
16229 msgid "This is used to view a file."
16233 #: ../fish/guestfish-commands.pod:158
16235 "The default viewer is C<$PAGER>. However if you use the alternate command "
16236 "C<less> you will get the C<less> command specifically."
16240 #: ../fish/guestfish-commands.pod:161
16245 #: ../fish/guestfish-commands.pod:163
16253 #: ../fish/guestfish-commands.pod:165
16255 "Close and reopen the libguestfs handle. It is not necessary to use this "
16256 "normally, because the handle is closed properly when guestfish exits. "
16257 "However this is occasionally useful for testing."
16261 #: ../fish/guestfish-commands.pod:169
16266 #: ../fish/guestfish-commands.pod:171
16269 " setenv VAR value\n"
16274 #: ../fish/guestfish-commands.pod:173
16275 msgid "Set the environment variable C<VAR> to the string C<value>."
16279 #: ../fish/guestfish-commands.pod:175
16281 "To print the value of an environment variable use a shell command such as:"
16285 #: ../fish/guestfish-commands.pod:178
16293 #: ../fish/guestfish-commands.pod:180
16298 #: ../fish/guestfish-commands.pod:182
16301 " sparse filename size\n"
16306 #: ../fish/guestfish-commands.pod:184
16308 "This creates an empty sparse file of the given size, and then adds so it can "
16309 "be further examined."
16313 #: ../fish/guestfish-commands.pod:187
16315 "In all respects it works the same as the L</alloc> command, except that the "
16316 "image file is allocated sparsely, which means that disk blocks are not "
16317 "assigned to the file until they are needed. Sparse disk files only use "
16318 "space when written to, but they are slower and there is a danger you could "
16319 "run out of real disk space during a write operation."
16323 #: ../fish/guestfish-commands.pod:197
16328 #: ../fish/guestfish-commands.pod:199
16336 #: ../fish/guestfish-commands.pod:201
16338 "This command returns a list of the optional groups known to the daemon, and "
16339 "indicates which ones are supported by this build of the libguestfs appliance."
16343 #: ../fish/guestfish-commands.pod:205
16344 msgid "See also L<guestfs(3)/AVAILABILITY>."
16348 #: ../fish/guestfish-commands.pod:207
16353 #: ../fish/guestfish-commands.pod:209
16356 " time command args...\n"
16361 #: ../fish/guestfish-commands.pod:211
16363 "Run the command as usual, but print the elapsed time afterwards. This can "
16364 "be useful for benchmarking operations."
16368 #: ../fish/guestfish-commands.pod:214
16373 #: ../fish/guestfish-commands.pod:216
16381 #: ../fish/guestfish-commands.pod:218
16382 msgid "Remove C<VAR> from the environment."
16386 #: ../fish/guestfish.pod:5
16387 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16391 #: ../fish/guestfish.pod:9
16394 " guestfish [--options] [commands]\n"
16399 #: ../fish/guestfish.pod:11
16407 #: ../fish/guestfish.pod:13
16410 " guestfish [--ro|--rw] -a disk.img\n"
16415 #: ../fish/guestfish.pod:15
16418 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16423 #: ../fish/guestfish.pod:17
16426 " guestfish -d libvirt-domain\n"
16431 #: ../fish/guestfish.pod:19
16434 " guestfish [--ro|--rw] -a disk.img -i\n"
16439 #: ../fish/guestfish.pod:21
16442 " guestfish -d libvirt-domain -i\n"
16447 #: ../fish/guestfish.pod:25
16449 "Using guestfish in read/write mode on live virtual machines can be "
16450 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16451 "option to use guestfish safely if the disk image or virtual machine might be "
16456 #: ../fish/guestfish.pod:32
16458 "Guestfish is a shell and command-line tool for examining and modifying "
16459 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16460 "functionality of the guestfs API, see L<guestfs(3)>."
16464 #: ../fish/guestfish.pod:36
16466 "Guestfish gives you structured access to the libguestfs API, from shell "
16467 "scripts or the command line or interactively. If you want to rescue a "
16468 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16473 #: ../fish/guestfish.pod:43
16474 msgid "As an interactive shell"
16478 #: ../fish/guestfish.pod:45
16486 #: ../fish/guestfish.pod:47
16489 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16490 " editing virtual machine filesystems.\n"
16495 #: ../fish/guestfish.pod:50
16498 " Type: 'help' for a list of commands\n"
16499 " 'man' to read the manual\n"
16500 " 'quit' to quit the shell\n"
16505 #: ../fish/guestfish.pod:54
16508 " ><fs> add-ro disk.img\n"
16510 " ><fs> list-filesystems\n"
16511 " /dev/sda1: ext4\n"
16512 " /dev/vg_guest/lv_root: ext4\n"
16513 " /dev/vg_guest/lv_swap: swap\n"
16514 " ><fs> mount /dev/vg_guest/lv_root /\n"
16515 " ><fs> cat /etc/fstab\n"
16517 " # Created by anaconda\n"
16524 #: ../fish/guestfish.pod:67
16525 msgid "From shell scripts"
16529 #: ../fish/guestfish.pod:69
16530 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16534 #: ../fish/guestfish.pod:71
16537 " guestfish <<_EOF_\n"
16540 " mount /dev/vg_guest/lv_root /\n"
16541 " write /etc/motd \"Welcome, new users\"\n"
16547 #: ../fish/guestfish.pod:78
16548 msgid "List the LVM logical volumes in a disk image:"
16552 #: ../fish/guestfish.pod:80
16555 " guestfish -a disk.img --ro <<_EOF_\n"
16563 #: ../fish/guestfish.pod:85
16564 msgid "List all the filesystems in a disk image:"
16568 #: ../fish/guestfish.pod:87
16571 " guestfish -a disk.img --ro <<_EOF_\n"
16573 " list-filesystems\n"
16579 #: ../fish/guestfish.pod:92
16580 msgid "On one command line"
16584 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
16585 msgid "Update C</etc/resolv.conf> in a guest:"
16589 #: ../fish/guestfish.pod:96
16593 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16594 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16599 #: ../fish/guestfish.pod:100
16600 msgid "Edit C</boot/grub/grub.conf> interactively:"
16604 #: ../fish/guestfish.pod:102
16607 " guestfish --rw --add disk.img \\\n"
16608 " --mount /dev/vg_guest/lv_root \\\n"
16609 " --mount /dev/sda1:/boot \\\n"
16610 " edit /boot/grub/grub.conf\n"
16615 #: ../fish/guestfish.pod:107
16616 msgid "Mount disks automatically"
16620 #: ../fish/guestfish.pod:109
16622 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16626 #: ../fish/guestfish.pod:112
16629 " guestfish --ro -a disk.img -i cat /etc/group\n"
16634 #: ../fish/guestfish.pod:114
16637 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16642 #: ../fish/guestfish.pod:116
16643 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16647 #: ../fish/guestfish.pod:118
16650 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16655 #: ../fish/guestfish.pod:120
16656 msgid "As a script interpreter"
16660 #: ../fish/guestfish.pod:122
16661 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16665 #: ../fish/guestfish.pod:124
16668 " #!/usr/bin/guestfish -f\n"
16669 " sparse test1.img 100M\n"
16671 " part-disk /dev/sda mbr\n"
16672 " mkfs ext2 /dev/sda1\n"
16677 #: ../fish/guestfish.pod:130
16678 msgid "Start with a prepared disk"
16682 #: ../fish/guestfish.pod:132
16684 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16685 "single ext2-formatted partition:"
16689 #: ../fish/guestfish.pod:135
16692 " guestfish -N fs\n"
16697 #: ../fish/guestfish.pod:137
16698 msgid "To list what is available do:"
16702 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1009
16705 " guestfish -N help | less\n"
16710 #: ../fish/guestfish.pod:141
16711 msgid "Remote control"
16715 #: ../fish/guestfish.pod:143
16718 " eval \"`guestfish --listen`\"\n"
16719 " guestfish --remote add-ro disk.img\n"
16720 " guestfish --remote run\n"
16721 " guestfish --remote lvs\n"
16726 #: ../fish/guestfish.pod:154
16727 msgid "Displays general help on options."
16731 #: ../fish/guestfish.pod:158
16732 msgid "B<--cmd-help>"
16736 #: ../fish/guestfish.pod:160
16737 msgid "Lists all available guestfish commands."
16741 #: ../fish/guestfish.pod:162
16746 #: ../fish/guestfish.pod:164
16747 msgid "B<--cmd-help cmd>"
16751 #: ../fish/guestfish.pod:166
16752 msgid "Displays detailed help on a single command C<cmd>."
16756 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
16757 msgid "B<-a image>"
16761 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
16762 msgid "B<--add image>"
16766 #: ../fish/guestfish.pod:172
16767 msgid "Add a block device or virtual machine image to the shell."
16771 #: ../fish/guestfish.pod:177
16773 "Using this flag is mostly equivalent to using the C<add> command, with "
16774 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
16775 "the I<--format=...> flag was given."
16779 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
16781 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16782 "URI to use. The default is to use the default libvirt connection."
16786 #: ../fish/guestfish.pod:189
16791 #: ../fish/guestfish.pod:191
16793 "If using the I<--listen> option and a csh-like shell, use this option. See "
16794 "section L</REMOTE CONTROL AND CSH> below."
16798 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
16799 msgid "B<-d libvirt-domain>"
16803 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
16804 msgid "B<--domain libvirt-domain>"
16808 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
16810 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16811 "used, then any libvirt domain can be used. However in write mode, only "
16812 "libvirt domains which are shut down can be named here."
16816 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
16817 msgid "Domain UUIDs can be used instead of names."
16821 #: ../fish/guestfish.pod:204
16823 "Using this flag is mostly equivalent to using the C<add-domain> command, "
16824 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
16825 "if the I<--format:...> flag was given."
16829 #: ../fish/guestfish.pod:208
16834 #: ../fish/guestfish.pod:210
16835 msgid "B<--no-dest-paths>"
16839 #: ../fish/guestfish.pod:212
16841 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16842 "to hit the tab key to complete paths on the guest filesystem, but this "
16843 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16844 "allow this feature to be disabled."
16848 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
16850 "When prompting for keys and passphrases, guestfish normally turns echoing "
16851 "off so you cannot see what you are typing. If you are not worried about "
16852 "Tempest attacks and there is no one else in the room you can specify this "
16853 "flag to see what you are typing."
16857 #: ../fish/guestfish.pod:224
16862 #: ../fish/guestfish.pod:226
16863 msgid "B<--file file>"
16867 #: ../fish/guestfish.pod:228
16868 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16872 #: ../fish/guestfish.pod:231
16875 " #!/usr/bin/guestfish -f\n"
16880 #: ../fish/guestfish.pod:244
16883 " guestfish --format=raw -a disk.img\n"
16888 #: ../fish/guestfish.pod:248
16891 " guestfish --format=raw -a disk.img --format -a another.img\n"
16896 #: ../fish/guestfish.pod:253
16898 "If you have untrusted raw-format guest disk images, you should use this "
16899 "option to specify the disk format. This avoids a possible security problem "
16900 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16904 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
16905 msgid "B<--inspector>"
16909 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
16911 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16912 "system and mount filesystems as they would be mounted on the real virtual "
16917 #: ../fish/guestfish.pod:266
16918 msgid "Typical usage is either:"
16922 #: ../fish/guestfish.pod:268
16925 " guestfish -d myguest -i\n"
16930 #: ../fish/guestfish.pod:270
16931 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16935 #: ../fish/guestfish.pod:272
16938 " guestfish --ro -d myguest -i\n"
16943 #: ../fish/guestfish.pod:274
16944 msgid "(for active domains, readonly), or specify the block device directly:"
16948 #: ../fish/guestfish.pod:276
16951 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16956 #: ../fish/guestfish.pod:278
16958 "Note that the command line syntax changed slightly over older versions of "
16959 "guestfish. You can still use the old syntax:"
16963 #: ../fish/guestfish.pod:281
16966 " guestfish [--ro] -i disk.img\n"
16971 #: ../fish/guestfish.pod:283
16974 " guestfish [--ro] -i libvirt-domain\n"
16979 #: ../fish/guestfish.pod:285
16981 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16982 "then using other commands to mount the filesystems that were found."
16986 #: ../fish/guestfish.pod:294
16987 msgid "B<--listen>"
16991 #: ../fish/guestfish.pod:296
16993 "Fork into the background and listen for remote commands. See section L</"
16994 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16998 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
17003 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
17005 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
17006 "ATTACHING TO RUNNING DAEMONS>)."
17010 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
17011 msgid "B<-m dev[:mountpoint[:options]]>"
17015 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
17016 msgid "B<--mount dev[:mountpoint[:options]]>"
17020 #: ../fish/guestfish.pod:308
17021 msgid "Mount the named partition or logical volume on the given mountpoint."
17025 #: ../fish/guestfish.pod:310
17026 msgid "If the mountpoint is omitted, it defaults to C</>."
17030 #: ../fish/guestfish.pod:312
17031 msgid "You have to mount something on C</> before most commands will work."
17035 #: ../fish/guestfish.pod:314
17037 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17042 #: ../fish/guestfish.pod:317
17044 "If you don't know what filesystems a disk image contains, you can either run "
17045 "guestfish without this option, then list the partitions, filesystems and LVs "
17046 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17047 "commands), or you can use the L<virt-filesystems(1)> program."
17051 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
17053 "The third (and rarely used) part of the mount parameter is the list of mount "
17054 "options used to mount the underlying filesystem. If this is not given, then "
17055 "the mount options are either the empty string or C<ro> (the latter if the "
17056 "I<--ro> flag is used). By specifying the mount options, you override this "
17057 "default choice. Probably the only time you would use this is to enable ACLs "
17058 "and/or extended attributes if the filesystem can support them:"
17062 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
17065 " -m /dev/sda1:/:acl,user_xattr\n"
17070 #: ../fish/guestfish.pod:333
17071 msgid "Using this flag is equivalent to using the C<mount-options> command."
17075 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193
17076 #: ../resize/virt-resize.pod:358
17081 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
17082 msgid "B<--no-sync>"
17086 #: ../fish/guestfish.pod:339
17088 "Disable autosync. This is enabled by default. See the discussion of "
17089 "autosync in the L<guestfs(3)> manpage."
17093 #: ../fish/guestfish.pod:342
17098 #: ../fish/guestfish.pod:344
17099 msgid "B<--new type>"
17103 #: ../fish/guestfish.pod:346
17108 #: ../fish/guestfish.pod:348
17110 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17111 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17112 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17117 #: ../fish/guestfish.pod:353
17118 msgid "B<--progress-bars>"
17122 #: ../fish/guestfish.pod:355
17123 msgid "Enable progress bars, even when guestfish is used non-interactively."
17127 #: ../fish/guestfish.pod:357
17129 "Progress bars are enabled by default when guestfish is used as an "
17130 "interactive shell."
17134 #: ../fish/guestfish.pod:360
17135 msgid "B<--no-progress-bars>"
17139 #: ../fish/guestfish.pod:362
17140 msgid "Disable progress bars."
17144 #: ../fish/guestfish.pod:364
17145 msgid "B<--remote[=pid]>"
17149 #: ../fish/guestfish.pod:366
17151 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17152 "CONTROL GUESTFISH OVER A SOCKET> below."
17156 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239
17157 #: ../rescue/virt-rescue.pod:161
17162 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
17163 #: ../rescue/virt-rescue.pod:163
17168 #: ../fish/guestfish.pod:373
17170 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17171 "mounts are done read-only."
17175 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17177 "The option must always be used if the disk image or virtual machine might be "
17178 "running, and is generally recommended in cases where you don't need write "
17179 "access to the disk."
17183 #: ../fish/guestfish.pod:380
17185 "Note that prepared disk images created with I<-N> are not affected by this "
17186 "option. Also commands like C<add> are not affected - you have to specify "
17187 "the C<readonly:true> option explicitly if you need it."
17191 #: ../fish/guestfish.pod:384
17192 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17196 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253
17197 #: ../rescue/virt-rescue.pod:173
17198 msgid "B<--selinux>"
17202 #: ../fish/guestfish.pod:388
17203 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17207 #: ../fish/guestfish.pod:394
17209 "Enable very verbose messages. This is particularly useful if you find a bug."
17213 #: ../fish/guestfish.pod:401
17214 msgid "Display the guestfish / libguestfs version number and exit."
17218 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269
17219 #: ../rescue/virt-rescue.pod:194
17224 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
17225 #: ../rescue/virt-rescue.pod:196
17230 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
17232 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17233 "mounts are done read-write."
17237 #: ../fish/guestfish.pod:410
17238 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
17242 #: ../fish/guestfish.pod:414
17243 msgid "Echo each command before executing it."
17247 #: ../fish/guestfish.pod:418
17248 msgid "COMMANDS ON COMMAND LINE"
17252 #: ../fish/guestfish.pod:420
17254 "Any additional (non-option) arguments are treated as commands to execute."
17258 #: ../fish/guestfish.pod:423
17260 "Commands to execute should be separated by a colon (C<:>), where the colon "
17261 "is a separate parameter. Thus:"
17265 #: ../fish/guestfish.pod:426
17268 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17273 #: ../fish/guestfish.pod:428
17275 "If there are no additional arguments, then we enter a shell, either an "
17276 "interactive shell with a prompt (if the input is a terminal) or a non-"
17277 "interactive shell."
17281 #: ../fish/guestfish.pod:432
17283 "In either command line mode or non-interactive shell, the first command that "
17284 "gives an error causes the whole shell to exit. In interactive mode (with a "
17285 "prompt) if a command fails, you can continue to enter commands."
17289 #: ../fish/guestfish.pod:437
17290 msgid "USING launch (OR run)"
17294 #: ../fish/guestfish.pod:439
17296 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17297 "then launch it, then mount any disks you need, and finally issue actions/"
17298 "commands. So the general order of the day is:"
17302 #: ../fish/guestfish.pod:447
17303 msgid "add or -a/--add"
17307 #: ../fish/guestfish.pod:451
17308 msgid "launch (aka run)"
17312 #: ../fish/guestfish.pod:455
17313 msgid "mount or -m/--mount"
17317 #: ../fish/guestfish.pod:459
17318 msgid "any other commands"
17322 #: ../fish/guestfish.pod:463
17324 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17325 "guest before mounting or performing any other commands."
17329 #: ../fish/guestfish.pod:466
17331 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17332 "I<--new> options were given then C<run> is done automatically, simply "
17333 "because guestfish can't perform the action you asked for without doing this."
17337 #: ../fish/guestfish.pod:471
17338 msgid "OPENING DISKS FOR READ AND WRITE"
17342 #: ../fish/guestfish.pod:473
17344 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
17345 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
17346 "I<-i> and I<-m> open disk images read-only or for writing."
17350 #: ../fish/guestfish.pod:478
17352 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
17353 "opening disk images supplied on the command line for write. To open a disk "
17354 "image read-only you have to do I<-a image --ro>."
17358 #: ../fish/guestfish.pod:482
17360 "This matters: If you accidentally open a live VM disk image writable then "
17361 "you will cause irreversible disk corruption."
17365 #: ../fish/guestfish.pod:485
17367 "In a future libguestfs we intend to change the default the other way. Disk "
17368 "images will be opened read-only. You will have to either specify "
17369 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
17370 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
17371 "access for disk images specified by those other command line options."
17375 #: ../fish/guestfish.pod:492
17377 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
17378 "which does nothing (it is already the default). However it is highly "
17379 "recommended that you use this option to indicate that you need write access, "
17380 "and prepare your scripts for the day when this option will be required for "
17385 #: ../fish/guestfish.pod:498
17387 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17388 "other libguestfs program apart from guestfish and guestmount."
17392 #: ../fish/guestfish.pod:501
17397 #: ../fish/guestfish.pod:503
17399 "You can quote ordinary parameters using either single or double quotes. For "
17404 #: ../fish/guestfish.pod:506
17407 " add \"file with a space.img\"\n"
17412 #: ../fish/guestfish.pod:508
17415 " rm '/file name'\n"
17420 #: ../fish/guestfish.pod:510
17428 #: ../fish/guestfish.pod:512
17430 "A few commands require a list of strings to be passed. For these, use a "
17431 "whitespace-separated list, enclosed in quotes. Strings containing "
17432 "whitespace to be passed through must be enclosed in single quotes. A "
17433 "literal single quote must be escaped with a backslash."
17437 #: ../fish/guestfish.pod:517
17440 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17441 " command \"/bin/echo 'foo bar'\"\n"
17442 " command \"/bin/echo \\'foo\\'\"\n"
17447 #: ../fish/guestfish.pod:521
17448 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17452 #: ../fish/guestfish.pod:523
17454 "In double-quoted arguments (only) use backslash to insert special characters:"
17458 #: ../fish/guestfish.pod:528
17463 #: ../fish/guestfish.pod:530
17464 msgid "Alert (bell) character."
17468 #: ../fish/guestfish.pod:532
17473 #: ../fish/guestfish.pod:534
17474 msgid "Backspace character."
17478 #: ../fish/guestfish.pod:536
17483 #: ../fish/guestfish.pod:538
17484 msgid "Form feed character."
17488 #: ../fish/guestfish.pod:540
17493 #: ../fish/guestfish.pod:542
17494 msgid "Newline character."
17498 #: ../fish/guestfish.pod:544
17503 #: ../fish/guestfish.pod:546
17504 msgid "Carriage return character."
17508 #: ../fish/guestfish.pod:548
17513 #: ../fish/guestfish.pod:550
17514 msgid "Horizontal tab character."
17518 #: ../fish/guestfish.pod:552
17523 #: ../fish/guestfish.pod:554
17524 msgid "Vertical tab character."
17528 #: ../fish/guestfish.pod:556
17533 #: ../fish/guestfish.pod:558
17534 msgid "A literal double quote character."
17538 #: ../fish/guestfish.pod:560
17543 #: ../fish/guestfish.pod:562
17545 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
17550 #: ../fish/guestfish.pod:565
17555 #: ../fish/guestfish.pod:567
17557 "A character with hex value I<hh>. There must be precisely 2 hex digits."
17561 #: ../fish/guestfish.pod:570
17563 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
17568 #: ../fish/guestfish.pod:573
17573 #: ../fish/guestfish.pod:575
17574 msgid "A literal backslash character."
17578 #: ../fish/guestfish.pod:579
17579 msgid "OPTIONAL ARGUMENTS"
17583 #: ../fish/guestfish.pod:581
17585 "Some commands take optional arguments. These arguments appear in this "
17586 "documentation as C<[argname:..]>. You can use them as in these examples:"
17590 #: ../fish/guestfish.pod:585
17593 " add-drive-opts filename\n"
17598 #: ../fish/guestfish.pod:587
17601 " add-drive-opts filename readonly:true\n"
17606 #: ../fish/guestfish.pod:589
17609 " add-drive-opts filename format:qcow2 readonly:false\n"
17614 #: ../fish/guestfish.pod:591
17616 "Each optional argument can appear at most once. All optional arguments must "
17617 "appear after the required ones."
17621 #: ../fish/guestfish.pod:594
17626 #: ../fish/guestfish.pod:596
17628 "This section applies to all commands which can take integers as parameters."
17632 #: ../fish/guestfish.pod:599
17633 msgid "SIZE SUFFIX"
17637 #: ../fish/guestfish.pod:601
17639 "When the command takes a parameter measured in bytes, you can use one of the "
17640 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17644 #: ../fish/guestfish.pod:607
17645 msgid "B<k> or B<K> or B<KiB>"
17649 #: ../fish/guestfish.pod:609
17650 msgid "The size in kilobytes (multiplied by 1024)."
17654 #: ../fish/guestfish.pod:611
17659 #: ../fish/guestfish.pod:613
17660 msgid "The size in SI 1000 byte units."
17664 #: ../fish/guestfish.pod:615
17665 msgid "B<M> or B<MiB>"
17669 #: ../fish/guestfish.pod:617
17670 msgid "The size in megabytes (multiplied by 1048576)."
17674 #: ../fish/guestfish.pod:619
17679 #: ../fish/guestfish.pod:621
17680 msgid "The size in SI 1000000 byte units."
17684 #: ../fish/guestfish.pod:623
17685 msgid "B<G> or B<GiB>"
17689 #: ../fish/guestfish.pod:625
17690 msgid "The size in gigabytes (multiplied by 2**30)."
17694 #: ../fish/guestfish.pod:627
17699 #: ../fish/guestfish.pod:629
17700 msgid "The size in SI 10**9 byte units."
17704 #: ../fish/guestfish.pod:631
17705 msgid "B<T> or B<TiB>"
17709 #: ../fish/guestfish.pod:633
17710 msgid "The size in terabytes (multiplied by 2**40)."
17714 #: ../fish/guestfish.pod:635
17719 #: ../fish/guestfish.pod:637
17720 msgid "The size in SI 10**12 byte units."
17724 #: ../fish/guestfish.pod:639
17725 msgid "B<P> or B<PiB>"
17729 #: ../fish/guestfish.pod:641
17730 msgid "The size in petabytes (multiplied by 2**50)."
17734 #: ../fish/guestfish.pod:643
17739 #: ../fish/guestfish.pod:645
17740 msgid "The size in SI 10**15 byte units."
17744 #: ../fish/guestfish.pod:647
17745 msgid "B<E> or B<EiB>"
17749 #: ../fish/guestfish.pod:649
17750 msgid "The size in exabytes (multiplied by 2**60)."
17754 #: ../fish/guestfish.pod:651
17759 #: ../fish/guestfish.pod:653
17760 msgid "The size in SI 10**18 byte units."
17764 #: ../fish/guestfish.pod:655
17765 msgid "B<Z> or B<ZiB>"
17769 #: ../fish/guestfish.pod:657
17770 msgid "The size in zettabytes (multiplied by 2**70)."
17774 #: ../fish/guestfish.pod:659
17779 #: ../fish/guestfish.pod:661
17780 msgid "The size in SI 10**21 byte units."
17784 #: ../fish/guestfish.pod:663
17785 msgid "B<Y> or B<YiB>"
17789 #: ../fish/guestfish.pod:665
17790 msgid "The size in yottabytes (multiplied by 2**80)."
17794 #: ../fish/guestfish.pod:667
17799 #: ../fish/guestfish.pod:669
17800 msgid "The size in SI 10**24 byte units."
17804 #: ../fish/guestfish.pod:675
17807 " truncate-size /file 1G\n"
17812 #: ../fish/guestfish.pod:677
17813 msgid "would truncate the file to 1 gigabyte."
17817 #: ../fish/guestfish.pod:679
17819 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
17820 "the parameter to L</memsize> is specified in megabytes already). Adding a "
17821 "suffix will probably not do what you expect."
17825 #: ../fish/guestfish.pod:683
17826 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17830 #: ../fish/guestfish.pod:685
17832 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17833 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17837 #: ../fish/guestfish.pod:688
17840 " 1234 decimal number 1234\n"
17841 " 02322 octal number, equivalent to decimal 1234\n"
17842 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17847 #: ../fish/guestfish.pod:692
17849 "When using the C<chmod> command, you almost always want to specify an octal "
17850 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17851 "L<chmod(1)> program):"
17855 #: ../fish/guestfish.pod:696
17858 " chmod 0777 /public # OK\n"
17859 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17864 #: ../fish/guestfish.pod:699
17866 "Commands that return numbers usually print them in decimal, but some "
17867 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17868 "octal, preceeded by C<0>)."
17872 #: ../fish/guestfish.pod:703
17873 msgid "WILDCARDS AND GLOBBING"
17877 #: ../fish/guestfish.pod:705
17879 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17880 "(globbing) by default. So for example the following will not do what you "
17885 #: ../fish/guestfish.pod:709
17893 #: ../fish/guestfish.pod:711
17895 "Assuming you don't have a directory called literally C</home/*> then the "
17896 "above command will return an error."
17900 #: ../fish/guestfish.pod:714
17901 msgid "To perform wildcard expansion, use the C<glob> command."
17905 #: ../fish/guestfish.pod:716
17908 " glob rm-rf /home/*\n"
17913 #: ../fish/guestfish.pod:718
17915 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17916 "many times), equivalent to:"
17920 #: ../fish/guestfish.pod:721
17923 " rm-rf /home/jim\n"
17924 " rm-rf /home/joe\n"
17925 " rm-rf /home/mary\n"
17930 #: ../fish/guestfish.pod:725
17931 msgid "C<glob> only works on simple guest paths and not on device names."
17935 #: ../fish/guestfish.pod:727
17937 "If you have several parameters, each containing a wildcard, then glob will "
17938 "perform a Cartesian product."
17942 #: ../fish/guestfish.pod:730
17947 #: ../fish/guestfish.pod:732
17949 "Any line which starts with a I<#> character is treated as a comment and "
17950 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17951 "a command. For example:"
17955 #: ../fish/guestfish.pod:736
17958 " # this is a comment\n"
17959 " # this is a comment\n"
17960 " foo # NOT a comment\n"
17965 #: ../fish/guestfish.pod:740
17966 msgid "Blank lines are also ignored."
17970 #: ../fish/guestfish.pod:742
17971 msgid "RUNNING COMMANDS LOCALLY"
17975 #: ../fish/guestfish.pod:744
17977 "Any line which starts with a I<!> character is treated as a command sent to "
17978 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17982 #: ../fish/guestfish.pod:748
17986 " tgz-out /remote local/remote-data.tar.gz\n"
17991 #: ../fish/guestfish.pod:751
17993 "will create a directory C<local> on the host, and then export the contents "
17994 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17995 "(See C<tgz-out>)."
17999 #: ../fish/guestfish.pod:755
18001 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18002 "effect, due to the way that subprocesses work in Unix."
18006 #: ../fish/guestfish.pod:758
18007 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18011 #: ../fish/guestfish.pod:760
18013 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18014 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18015 "and executed as guestfish commands."
18019 #: ../fish/guestfish.pod:764
18021 "Thus you can use shell script to construct arbitrary guestfish commands "
18022 "which are then parsed by guestfish."
18026 #: ../fish/guestfish.pod:767
18028 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18029 "through C</foo.100>) using guestfish commands alone. However this is simple "
18030 "if we use a shell script to create the guestfish commands for us:"
18034 #: ../fish/guestfish.pod:772
18037 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18042 #: ../fish/guestfish.pod:774
18043 msgid "or with names like C</foo.001>:"
18047 #: ../fish/guestfish.pod:776
18050 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18055 #: ../fish/guestfish.pod:778
18057 "When using guestfish interactively it can be helpful to just run the shell "
18058 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18059 "ordinary I<!> local command), see what guestfish commands it would run, and "
18060 "when you are happy with those prepend the C<E<lt>> character to run the "
18061 "guestfish commands for real."
18065 #: ../fish/guestfish.pod:784
18070 #: ../fish/guestfish.pod:786
18072 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18073 "command (a guestfish command) to the second command (any host command). For "
18078 #: ../fish/guestfish.pod:790
18081 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18086 #: ../fish/guestfish.pod:792
18088 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18089 "program). The above command would list all accounts in the guest filesystem "
18090 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18094 #: ../fish/guestfish.pod:797
18097 " hexdump /bin/ls | head\n"
18098 " list-devices | tail -1\n"
18099 " tgz-out / - | tar ztf -\n"
18104 #: ../fish/guestfish.pod:801
18106 "The space before the pipe symbol is required, any space after the pipe "
18107 "symbol is optional. Everything after the pipe symbol is just passed "
18108 "straight to the host shell, so it can contain redirections, globs and "
18109 "anything else that makes sense on the host side."
18113 #: ../fish/guestfish.pod:806
18115 "To use a literal argument which begins with a pipe symbol, you have to quote "
18120 #: ../fish/guestfish.pod:809
18128 #: ../fish/guestfish.pod:811
18129 msgid "HOME DIRECTORIES"
18133 #: ../fish/guestfish.pod:813
18135 "If a parameter starts with the character C<~> then the tilde may be expanded "
18136 "as a home directory path (either C<~> for the current user's home directory, "
18137 "or C<~user> for another user)."
18141 #: ../fish/guestfish.pod:817
18143 "Note that home directory expansion happens for users known I<on the host>, "
18144 "not in the guest filesystem."
18148 #: ../fish/guestfish.pod:820
18150 "To use a literal argument which begins with a tilde, you have to quote it, "
18155 #: ../fish/guestfish.pod:823
18163 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18164 msgid "ENCRYPTED DISKS"
18168 #: ../fish/guestfish.pod:827
18170 "Libguestfs has some support for Linux guests encrypted according to the "
18171 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18172 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18173 "LUKS is supported."
18177 #: ../fish/guestfish.pod:832
18178 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18182 #: ../fish/guestfish.pod:834
18185 " ><fs> vfs-type /dev/sda2\n"
18191 #: ../fish/guestfish.pod:837
18193 "Then open those devices using L</luks-open>. This creates a device-mapper "
18194 "device called C</dev/mapper/luksdev>."
18198 #: ../fish/guestfish.pod:840
18201 " ><fs> luks-open /dev/sda2 luksdev\n"
18202 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18207 #: ../fish/guestfish.pod:843
18209 "Finally you have to tell LVM to scan for volume groups on the newly created "
18214 #: ../fish/guestfish.pod:846
18218 " vg-activate-all true\n"
18223 #: ../fish/guestfish.pod:849
18224 msgid "The logical volume(s) can now be mounted in the usual way."
18228 #: ../fish/guestfish.pod:851
18230 "Before closing a LUKS device you must unmount any logical volumes on it and "
18231 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18232 "one. Then you can close the mapper device:"
18236 #: ../fish/guestfish.pod:855
18239 " vg-activate false /dev/VG\n"
18240 " luks-close /dev/mapper/luksdev\n"
18245 #: ../fish/guestfish.pod:860
18247 "If a path is prefixed with C<win:> then you can use Windows-style drive "
18248 "letters and paths (with some limitations). The following commands are "
18253 #: ../fish/guestfish.pod:864
18256 " file /WINDOWS/system32/config/system.LOG\n"
18261 #: ../fish/guestfish.pod:866
18264 " file win:\\windows\\system32\\config\\system.log\n"
18269 #: ../fish/guestfish.pod:868
18272 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
18277 #: ../fish/guestfish.pod:870
18279 "The parameter is rewritten \"behind the scenes\" by looking up the position "
18280 "where the drive is mounted, prepending that to the path, changing all "
18281 "backslash characters to forward slash, then resolving the result using L</"
18282 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
18283 "the parameter might be rewritten like this:"
18287 #: ../fish/guestfish.pod:876
18290 " win:e:\\foo\\bar => /e/FOO/bar\n"
18295 #: ../fish/guestfish.pod:878
18296 msgid "This only works in argument positions that expect a path."
18300 #: ../fish/guestfish.pod:880
18301 msgid "UPLOADING AND DOWNLOADING FILES"
18305 #: ../fish/guestfish.pod:882
18307 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18308 "others which upload from or download to a local file, you can use the "
18309 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18313 #: ../fish/guestfish.pod:886
18321 #: ../fish/guestfish.pod:888
18323 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18327 #: ../fish/guestfish.pod:891
18330 " tar-out /etc - | tar tf -\n"
18335 #: ../fish/guestfish.pod:893
18337 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18338 "command (see L</PIPES>)."
18342 #: ../fish/guestfish.pod:896
18344 "When using C<-> to read from stdin, the input is read up to the end of "
18345 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18346 "some arbitrary end marker:"
18350 #: ../fish/guestfish.pod:900
18353 " upload -<<END /foo\n"
18362 #: ../fish/guestfish.pod:906
18364 "Any string of characters can be used instead of C<END>. The end marker must "
18365 "appear on a line of its own, without any preceeding or following characters "
18366 "(not even spaces)."
18370 #: ../fish/guestfish.pod:910
18372 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18373 "upload local files (so-called \"FileIn\" parameters in the generator)."
18377 #: ../fish/guestfish.pod:913
18378 msgid "EXIT ON ERROR BEHAVIOUR"
18382 #: ../fish/guestfish.pod:915
18384 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18385 "taking commands from a human over a tty), and will exit on the first error "
18386 "in non-interactive mode (scripts, commands given on the command line)."
18390 #: ../fish/guestfish.pod:920
18392 "If you prefix a command with a I<-> character, then that command will not "
18393 "cause guestfish to exit, even if that (one) command returns an error."
18397 #: ../fish/guestfish.pod:924
18398 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18402 #: ../fish/guestfish.pod:926
18404 "Guestfish can be remote-controlled over a socket. This is useful "
18405 "particularly in shell scripts where you want to make several different "
18406 "changes to a filesystem, but you don't want the overhead of starting up a "
18407 "guestfish process each time."
18411 #: ../fish/guestfish.pod:931
18412 msgid "Start a guestfish server process using:"
18416 #: ../fish/guestfish.pod:933
18419 " eval \"`guestfish --listen`\"\n"
18424 #: ../fish/guestfish.pod:935
18425 msgid "and then send it commands by doing:"
18429 #: ../fish/guestfish.pod:937
18432 " guestfish --remote cmd [...]\n"
18437 #: ../fish/guestfish.pod:939
18438 msgid "To cause the server to exit, send it the exit command:"
18442 #: ../fish/guestfish.pod:943
18444 "Note that the server will normally exit if there is an error in a command. "
18445 "You can change this in the usual way. See section L</EXIT ON ERROR "
18450 #: ../fish/guestfish.pod:947
18451 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18455 #: ../fish/guestfish.pod:949
18457 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18458 "is how the I<--remote> option knows where to send the commands. You can "
18459 "have several guestfish listener processes running using:"
18463 #: ../fish/guestfish.pod:953
18466 " eval \"`guestfish --listen`\"\n"
18467 " pid1=$GUESTFISH_PID\n"
18468 " eval \"`guestfish --listen`\"\n"
18469 " pid2=$GUESTFISH_PID\n"
18471 " guestfish --remote=$pid1 cmd\n"
18472 " guestfish --remote=$pid2 cmd\n"
18477 #: ../fish/guestfish.pod:961
18478 msgid "REMOTE CONTROL AND CSH"
18482 #: ../fish/guestfish.pod:963
18484 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18489 #: ../fish/guestfish.pod:966
18492 " eval \"`guestfish --listen --csh`\"\n"
18497 #: ../fish/guestfish.pod:968
18498 msgid "REMOTE CONTROL DETAILS"
18502 #: ../fish/guestfish.pod:970
18504 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18505 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18506 "and C<$PID> is the process ID of the server."
18510 #: ../fish/guestfish.pod:974
18511 msgid "Guestfish client and server versions must match exactly."
18515 #: ../fish/guestfish.pod:976
18516 msgid "REMOTE CONTROL RUN COMMAND HANGING"
18520 #: ../fish/guestfish.pod:978
18522 "Using the C<run> (or C<launch>) command remotely in a command substitution "
18523 "context hangs, ie. don't do (note the backquotes):"
18527 #: ../fish/guestfish.pod:981
18530 " a=`guestfish --remote run`\n"
18535 #: ../fish/guestfish.pod:983
18537 "Since the C<run> command produces no output on stdout, this is not useful "
18538 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
18543 #: ../fish/guestfish.pod:987
18544 msgid "PREPARED DISK IMAGES"
18548 #: ../fish/guestfish.pod:989
18550 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18551 "preformatted disk images that guestfish can make for you to save typing. "
18552 "This is particularly useful for testing purposes. This option is used "
18553 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18554 "can be mixed with I<-a>)."
18558 #: ../fish/guestfish.pod:995
18560 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18561 "the second and so on. Existing files in the current directory are "
18566 #: ../fish/guestfish.pod:999
18568 "The type briefly describes how the disk should be sized, partitioned, how "
18569 "filesystem(s) should be created, and how content should be added. "
18570 "Optionally the type can be followed by extra parameters, separated by C<:> "
18571 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18572 "allocated disk, containing a single partition, with the partition formatted "
18573 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18578 #: ../fish/guestfish.pod:1007
18579 msgid "To list the available types and any extra parameters they take, run:"
18583 #: ../fish/guestfish.pod:1011
18585 "Note that the prepared filesystem is not mounted. You would usually have to "
18586 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18590 #: ../fish/guestfish.pod:1015
18592 "If any I<-N> or I<--new> options are given, the guest is automatically "
18597 #: ../fish/guestfish.pod:1020
18598 msgid "Create a 100MB disk with an ext4-formatted partition:"
18602 #: ../fish/guestfish.pod:1022
18605 " guestfish -N fs:ext4\n"
18610 #: ../fish/guestfish.pod:1024
18611 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18615 #: ../fish/guestfish.pod:1026
18618 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18623 #: ../fish/guestfish.pod:1028
18624 msgid "Create a blank 200MB disk:"
18628 #: ../fish/guestfish.pod:1030
18631 " guestfish -N disk:200M\n"
18636 #: ../fish/guestfish.pod:1032
18637 msgid "PROGRESS BARS"
18641 #: ../fish/guestfish.pod:1034
18643 "Some (not all) long-running commands send progress notification messages as "
18644 "they are running. Guestfish turns these messages into progress bars."
18648 #: ../fish/guestfish.pod:1038
18650 "When a command that supports progress bars takes longer than two seconds to "
18651 "run, and if progress bars are enabled, then you will see one appearing below "
18656 #: ../fish/guestfish.pod:1042
18659 " ><fs> copy-size /large-file /another-file 2048M\n"
18660 " / 10% [#####-----------------------------------------] 00:30\n"
18665 #: ../fish/guestfish.pod:1045
18667 "The spinner on the left hand side moves round once for every progress "
18668 "notification received from the backend. This is a (reasonably) golden "
18669 "assurance that the command is \"doing something\" even if the progress bar "
18670 "is not moving, because the command is able to send the progress "
18671 "notifications. When the bar reaches 100% and the command finishes, the "
18672 "spinner disappears."
18676 #: ../fish/guestfish.pod:1052
18678 "Progress bars are enabled by default when guestfish is used interactively. "
18679 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18680 "and you can disable them completely using I<--no-progress-bars>."
18684 #: ../fish/guestfish.pod:1057
18685 msgid "GUESTFISH COMMANDS"
18689 #: ../fish/guestfish.pod:1059
18691 "The commands in this section are guestfish convenience commands, in other "
18692 "words, they are not part of the L<guestfs(3)> API."
18696 #: ../fish/guestfish.pod:1062
18701 #: ../fish/guestfish.pod:1064
18710 #: ../fish/guestfish.pod:1067
18711 msgid "Without any parameter, this provides general help."
18715 #: ../fish/guestfish.pod:1069
18716 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18720 #: ../fish/guestfish.pod:1071
18721 msgid "quit | exit"
18725 #: ../fish/guestfish.pod:1073
18726 msgid "This exits guestfish. You can also use C<^D> key."
18730 #: ../fish/guestfish.pod:1075
18731 msgid "@FISH_COMMANDS@"
18735 #: ../fish/guestfish.pod:1077
18740 #: ../fish/guestfish.pod:1079 ../src/guestfs.pod:1505
18745 #: ../fish/guestfish.pod:1083
18747 "guestfish returns 0 if the commands completed without error, or 1 if there "
18752 #: ../fish/guestfish.pod:1090
18757 #: ../fish/guestfish.pod:1092
18759 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18764 #: ../fish/guestfish.pod:1095 ../src/guestfs.pod:3110
18765 msgid "FEBOOTSTRAP_KERNEL"
18769 #: ../fish/guestfish.pod:1097 ../src/guestfs.pod:3112
18770 msgid "FEBOOTSTRAP_MODULES"
18774 #: ../fish/guestfish.pod:1099 ../src/guestfs.pod:3114
18776 "These two environment variables allow the kernel that libguestfs uses in the "
18777 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18778 "most recent host kernel is chosen. For more information about kernel "
18779 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18780 "available in febootstrap E<ge> 3.8."
18784 #: ../fish/guestfish.pod:1105
18785 msgid "GUESTFISH_DISPLAY_IMAGE"
18789 #: ../fish/guestfish.pod:1107
18791 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18792 "If not set, it uses L<display(1)>."
18796 #: ../fish/guestfish.pod:1110
18797 msgid "GUESTFISH_PID"
18801 #: ../fish/guestfish.pod:1112
18803 "Used with the I<--remote> option to specify the remote guestfish process to "
18804 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18808 #: ../fish/guestfish.pod:1116
18813 #: ../fish/guestfish.pod:1118
18815 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18816 "not specified, the external L<hexedit(1)> program is used."
18820 #: ../fish/guestfish.pod:1122
18825 #: ../fish/guestfish.pod:1124
18827 "If compiled with GNU readline support, various files in the home directory "
18828 "can be used. See L</FILES>."
18832 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3120
18833 msgid "LIBGUESTFS_APPEND"
18837 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3122
18838 msgid "Pass additional options to the guest kernel."
18842 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3124
18843 msgid "LIBGUESTFS_DEBUG"
18847 #: ../fish/guestfish.pod:1133
18849 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18850 "effect as using the B<-v> option."
18854 #: ../fish/guestfish.pod:1136 ../src/guestfs.pod:3129
18855 msgid "LIBGUESTFS_MEMSIZE"
18859 #: ../fish/guestfish.pod:1138 ../src/guestfs.pod:3131
18861 "Set the memory allocated to the qemu process, in megabytes. For example:"
18865 #: ../fish/guestfish.pod:1141 ../src/guestfs.pod:3134
18868 " LIBGUESTFS_MEMSIZE=700\n"
18873 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3136
18874 msgid "LIBGUESTFS_PATH"
18878 #: ../fish/guestfish.pod:1145
18880 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18881 "the discussion of paths in L<guestfs(3)>."
18885 #: ../fish/guestfish.pod:1148 ../src/guestfs.pod:3141
18886 msgid "LIBGUESTFS_QEMU"
18890 #: ../fish/guestfish.pod:1150 ../src/guestfs.pod:3143
18892 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18893 "which was found at compile time by the configure script is used."
18897 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3149
18898 msgid "LIBGUESTFS_TRACE"
18902 #: ../fish/guestfish.pod:1156
18903 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18907 #: ../fish/guestfish.pod:1158
18912 #: ../fish/guestfish.pod:1160
18914 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18919 #: ../fish/guestfish.pod:1163 ../sparsify/virt-sparsify.pod:236
18920 #: ../src/guestfs.pod:3154
18925 #: ../fish/guestfish.pod:1165 ../src/guestfs.pod:3156
18927 "Location of temporary directory, defaults to C</tmp> except for the cached "
18928 "supermin appliance which defaults to C</var/tmp>."
18932 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3159
18934 "If libguestfs was compiled to use the supermin appliance then the real "
18935 "appliance is cached in this directory, shared between all handles belonging "
18936 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18937 "use in case C</var/tmp> is not large enough."
18941 #: ../fish/guestfish.pod:1176 ../fuse/guestmount.pod:288
18942 #: ../rescue/virt-rescue.pod:273
18947 #: ../fish/guestfish.pod:1180 ../fuse/guestmount.pod:292
18948 #: ../rescue/virt-rescue.pod:277
18949 msgid "$HOME/.libguestfs-tools.rc"
18953 #: ../fish/guestfish.pod:1182 ../fuse/guestmount.pod:294
18954 #: ../rescue/virt-rescue.pod:279
18955 msgid "/etc/libguestfs-tools.conf"
18959 #: ../fish/guestfish.pod:1184 ../fuse/guestmount.pod:296
18960 #: ../rescue/virt-rescue.pod:281
18962 "This configuration file controls the default read-only or read-write mode "
18963 "(I<--ro> or I<--rw>)."
18967 #: ../fish/guestfish.pod:1187
18968 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18972 #: ../fish/guestfish.pod:1189
18973 msgid "$HOME/.guestfish"
18977 #: ../fish/guestfish.pod:1191
18979 "If compiled with GNU readline support, then the command history is saved in "
18984 #: ../fish/guestfish.pod:1194
18985 msgid "$HOME/.inputrc"
18989 #: ../fish/guestfish.pod:1196
18990 msgid "/etc/inputrc"
18994 #: ../fish/guestfish.pod:1198
18996 "If compiled with GNU readline support, then these files can be used to "
18997 "configure readline. For further information, please see L<readline(3)/"
18998 "INITIALIZATION FILE>."
19002 #: ../fish/guestfish.pod:1202
19003 msgid "To write rules which only apply to guestfish, use:"
19007 #: ../fish/guestfish.pod:1204
19017 #: ../fish/guestfish.pod:1208
19019 "Variables that you can set in inputrc that change the behaviour of guestfish "
19020 "in useful ways include:"
19024 #: ../fish/guestfish.pod:1213
19025 msgid "completion-ignore-case (default: on)"
19029 #: ../fish/guestfish.pod:1215
19031 "By default, guestfish will ignore case when tab-completing paths on the "
19036 #: ../fish/guestfish.pod:1218
19039 " set completion-ignore-case off\n"
19044 #: ../fish/guestfish.pod:1220
19045 msgid "to make guestfish case sensitive."
19049 #: ../fish/guestfish.pod:1224
19054 #: ../fish/guestfish.pod:1226
19055 msgid "test2.img (etc)"
19059 #: ../fish/guestfish.pod:1228
19061 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19062 "will be created in the file C<test1.img> in the current directory. The "
19063 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19064 "the same name will be overwritten."
19068 #: ../fish/guestfish.pod:1237
19070 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
19071 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
19072 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
19073 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
19074 ">, L<virt-sparsify(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)"
19075 ">, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-"
19080 #: ../fish/guestfish.pod:1267 ../src/guestfs.pod:3248
19081 #: ../test-tool/libguestfs-test-tool.pod:112
19082 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19086 #: ../fish/virt-copy-in.pod:5
19088 "virt-copy-in - Copy files and directories into a virtual machine disk image."
19092 #: ../fish/virt-copy-in.pod:9
19095 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19100 #: ../fish/virt-copy-in.pod:11
19103 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19108 #: ../fish/virt-copy-in.pod:15
19110 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19111 "causing disk corruption. The virtual machine must be shut down before you "
19112 "use this command."
19116 #: ../fish/virt-copy-in.pod:21
19118 "C<virt-copy-in> copies files and directories from the local disk into a "
19119 "virtual machine disk image or named libvirt domain."
19123 #: ../fish/virt-copy-in.pod:24
19125 "You can give one of more filenames and directories on the command line. "
19126 "Directories are copied in recursively. The final parameter must be the "
19127 "destination directory in the disk image which must be an absolute path "
19128 "starting with a C</> character."
19132 #: ../fish/virt-copy-in.pod:33
19135 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19140 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19141 msgid "Upload a home directory to a guest:"
19145 #: ../fish/virt-copy-in.pod:37
19148 " virt-copy-in -d MyGuest skel /home\n"
19153 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
19154 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19155 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19159 #: ../fish/virt-copy-in.pod:41
19161 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19162 "> C<copy-in> command. For anything more complex than a trivial copy, you "
19163 "are probably better off using guestfish directly."
19167 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
19168 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19170 "Since the shell script just passes options straight to guestfish, read "
19171 "L<guestfish(1)> to see the full list of options."
19175 #: ../fish/virt-copy-in.pod:52
19177 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
19178 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19182 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
19183 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
19184 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19188 #: ../fish/virt-copy-out.pod:5
19190 "virt-copy-out - Copy files and directories out of a virtual machine disk "
19195 #: ../fish/virt-copy-out.pod:9
19198 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
19203 #: ../fish/virt-copy-out.pod:11
19206 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
19211 #: ../fish/virt-copy-out.pod:15
19213 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
19214 "image or named libvirt domain."
19218 #: ../fish/virt-copy-out.pod:18
19220 "You can give one of more filenames and directories on the command line. "
19221 "Directories are copied out recursively."
19225 #: ../fish/virt-copy-out.pod:23
19226 msgid "Download the home directories from a virtual machine:"
19230 #: ../fish/virt-copy-out.pod:25
19234 " virt-copy-out -d MyGuest /home homes\n"
19239 #: ../fish/virt-copy-out.pod:30
19241 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19242 "> C<copy-out> command. For anything more complex than a trivial copy, you "
19243 "are probably better off using guestfish directly."
19247 #: ../fish/virt-copy-out.pod:41
19249 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
19250 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19254 #: ../fish/virt-tar-in.pod:5
19255 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
19259 #: ../fish/virt-tar-in.pod:9
19262 " virt-tar-in -a disk.img data.tar /destination\n"
19267 #: ../fish/virt-tar-in.pod:11
19270 " virt-tar-in -d domain data.tar /destination\n"
19275 #: ../fish/virt-tar-in.pod:13
19278 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
19283 #: ../fish/virt-tar-in.pod:17
19285 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
19286 "causing disk corruption. The virtual machine must be shut down before you "
19287 "use this command."
19291 #: ../fish/virt-tar-in.pod:23
19293 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
19294 "image or named libvirt domain."
19298 #: ../fish/virt-tar-in.pod:26
19300 "The first parameter is the tar file. Use C<-> to read the tar file from "
19301 "standard input. The second parameter is the absolute target directory to "
19306 #: ../fish/virt-tar-in.pod:34
19309 " virt-tar-in -d MyGuest homes.tar /home\n"
19314 #: ../fish/virt-tar-in.pod:38
19316 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19317 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
19318 "probably better off using guestfish directly."
19322 #: ../fish/virt-tar-in.pod:49
19324 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19325 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
19330 #: ../fish/virt-tar-out.pod:5
19332 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
19336 #: ../fish/virt-tar-out.pod:9
19339 " virt-tar-out -a disk.img /dir files.tar\n"
19344 #: ../fish/virt-tar-out.pod:11
19347 " virt-tar-out -d domain /dir files.tar\n"
19352 #: ../fish/virt-tar-out.pod:13
19355 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
19360 #: ../fish/virt-tar-out.pod:17
19362 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
19366 #: ../fish/virt-tar-out.pod:20
19368 "The first parameter is the absolute path of the virtual machine directory. "
19369 "The second parameter is the tar file to write. Use C<-> to write to "
19374 #: ../fish/virt-tar-out.pod:26
19375 msgid "Download the home directories from a guest:"
19379 #: ../fish/virt-tar-out.pod:28
19382 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
19387 #: ../fish/virt-tar-out.pod:32
19389 "This command is just a simple shell script wrapper around the L<guestfish(1)"
19390 "> C<tar-out> command. For anything more complex than a trivial copy, you "
19391 "are probably better off using guestfish directly."
19395 #: ../fish/virt-tar-out.pod:43
19397 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19398 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19402 #: ../fuse/guestmount.pod:5
19404 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19408 #: ../fuse/guestmount.pod:9
19411 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19416 #: ../fuse/guestmount.pod:11
19419 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19424 #: ../fuse/guestmount.pod:13
19427 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19432 #: ../fuse/guestmount.pod:17
19434 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19435 "machines. If you do this, you risk disk corruption in the VM."
19439 #: ../fuse/guestmount.pod:22
19441 "The guestmount program can be used to mount virtual machine filesystems and "
19442 "other disk images on the host. It uses libguestfs for access to the guest "
19443 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19444 "a mountable device."
19448 #: ../fuse/guestmount.pod:27
19450 "Along with other options, you have to give at least one device (I<-a> "
19451 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19452 "option) or use the I<-i> inspection option. How this works is better "
19453 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19458 #: ../fuse/guestmount.pod:33
19460 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19461 "by you, and the filesystem will not be visible to any other users unless you "
19462 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19463 "the filesystem, use the C<fusermount -u> command."
19467 #: ../fuse/guestmount.pod:41
19469 "For a typical Windows guest which has its main filesystem on the first "
19474 #: ../fuse/guestmount.pod:44
19477 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19482 #: ../fuse/guestmount.pod:46
19484 "For a typical Linux guest which has a /boot filesystem on the first "
19485 "partition, and the root filesystem on a logical volume:"
19489 #: ../fuse/guestmount.pod:49
19492 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19497 #: ../fuse/guestmount.pod:51
19498 msgid "To get libguestfs to detect guest mountpoints for you:"
19502 #: ../fuse/guestmount.pod:53
19505 " guestmount -a guest.img -i --ro /mnt\n"
19510 #: ../fuse/guestmount.pod:55
19511 msgid "For a libvirt guest called \"Guest\" you could do:"
19515 #: ../fuse/guestmount.pod:57
19518 " guestmount -d Guest -i --ro /mnt\n"
19523 #: ../fuse/guestmount.pod:59
19525 "If you don't know what filesystems are contained in a guest or disk image, "
19526 "use L<virt-filesystems(1)> first:"
19530 #: ../fuse/guestmount.pod:62
19533 " virt-filesystems MyGuest\n"
19538 #: ../fuse/guestmount.pod:64
19540 "If you want to trace the libguestfs calls but without excessive debugging "
19541 "information, we recommend:"
19545 #: ../fuse/guestmount.pod:67
19548 " guestmount [...] --trace /mnt\n"
19553 #: ../fuse/guestmount.pod:69
19554 msgid "If you want to debug the program, we recommend:"
19558 #: ../fuse/guestmount.pod:71
19561 " guestmount [...] --trace --verbose /mnt\n"
19566 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19567 #: ../resize/virt-resize.pod:544
19572 #: ../fuse/guestmount.pod:75
19573 msgid "Other users cannot see the filesystem by default"
19577 #: ../fuse/guestmount.pod:77
19579 "If you mount a filesystem as one user (eg. root), then other users will not "
19580 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19581 "option when mounting:"
19585 #: ../fuse/guestmount.pod:81
19588 " sudo guestmount [...] -o allow_other /mnt\n"
19593 #: ../fuse/guestmount.pod:91
19594 msgid "Add a block device or virtual machine image."
19598 #: ../fuse/guestmount.pod:114
19599 msgid "B<--dir-cache-timeout N>"
19603 #: ../fuse/guestmount.pod:116
19605 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19606 "seconds. The readdir cache [actually, there are several semi-independent "
19607 "caches] is populated after a readdir(2) call with the stat and extended "
19608 "attributes of the files in the directory, in anticipation that they will be "
19609 "requested soon after."
19613 #: ../fuse/guestmount.pod:122
19615 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19616 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19617 "requests, only cache existing ones."
19621 #: ../fuse/guestmount.pod:142
19623 "If you have untrusted raw-format guest disk images, you should use this "
19624 "option to specify the disk format. This avoids a possible security problem "
19625 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19626 "guestfs_add_drive_opts>."
19630 #: ../fuse/guestmount.pod:147
19631 msgid "B<--fuse-help>"
19635 #: ../fuse/guestmount.pod:149
19636 msgid "Display help on special FUSE options (see I<-o> below)."
19640 #: ../fuse/guestmount.pod:153
19641 msgid "Display brief help and exit."
19645 #: ../fuse/guestmount.pod:177
19647 "Mount the named partition or logical volume on the given mountpoint B<in the "
19648 "guest> (this has nothing to do with mountpoints in the host)."
19652 #: ../fuse/guestmount.pod:180
19654 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19655 "something on C</>."
19659 #: ../fuse/guestmount.pod:197
19661 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19662 "unmounted. If you specify this option, then we don't attempt to sync the "
19663 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19667 #: ../fuse/guestmount.pod:202
19668 msgid "B<-o option>"
19672 #: ../fuse/guestmount.pod:204
19673 msgid "B<--option option>"
19677 #: ../fuse/guestmount.pod:206
19678 msgid "Pass extra options to FUSE."
19682 #: ../fuse/guestmount.pod:208
19684 "To get a list of all the extra options supported by FUSE, use the command "
19685 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19686 "of them are a good idea."
19690 #: ../fuse/guestmount.pod:212
19693 " guestmount --fuse-help\n"
19698 #: ../fuse/guestmount.pod:214
19699 msgid "Some potentially useful FUSE options:"
19703 #: ../fuse/guestmount.pod:218
19704 msgid "B<-o allow_other>"
19708 #: ../fuse/guestmount.pod:220
19709 msgid "Allow other users to see the filesystem."
19713 #: ../fuse/guestmount.pod:222
19714 msgid "B<-o attr_timeout=N>"
19718 #: ../fuse/guestmount.pod:224
19719 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19723 #: ../fuse/guestmount.pod:226
19724 msgid "B<-o kernel_cache>"
19728 #: ../fuse/guestmount.pod:228
19730 "Allow the kernel to cache files (reduces the number of reads that have to go "
19731 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19732 "afford the extra memory usage."
19736 #: ../fuse/guestmount.pod:232
19737 msgid "B<-o uid=N> B<-o gid=N>"
19741 #: ../fuse/guestmount.pod:234
19743 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19744 "the chosen values."
19748 #: ../fuse/guestmount.pod:243
19750 "Add devices and mount everything read-only. Also disallow writes and make "
19751 "the disk appear read-only to FUSE."
19755 #: ../fuse/guestmount.pod:246
19757 "This is highly recommended if you are not going to edit the guest disk. If "
19758 "the guest is running and this option is I<not> supplied, then there is a "
19759 "strong risk of disk corruption in the guest. We try to prevent this from "
19760 "happening, but it is not always possible."
19764 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
19765 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19769 #: ../fuse/guestmount.pod:255
19770 msgid "Enable SELinux support for the guest."
19774 #: ../fuse/guestmount.pod:261
19775 msgid "Enable verbose messages from underlying libguestfs."
19779 #: ../fuse/guestmount.pod:267
19780 msgid "Display the program version and exit."
19784 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
19785 #: ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
19786 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19790 #: ../fuse/guestmount.pod:280
19795 #: ../fuse/guestmount.pod:282
19796 msgid "Trace libguestfs calls and entry into each FUSE function."
19800 #: ../fuse/guestmount.pod:284
19801 msgid "This also stops the daemon from forking into the background."
19805 #: ../fuse/guestmount.pod:310
19807 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19808 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
19813 #: ../fuse/guestmount.pod:325
19814 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19818 #: ../inspector/virt-inspector.pod:5
19820 "virt-inspector - Display operating system version and other information "
19821 "about a virtual machine"
19825 #: ../inspector/virt-inspector.pod:9
19828 " virt-inspector [--options] -d domname\n"
19833 #: ../inspector/virt-inspector.pod:11
19836 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19841 #: ../inspector/virt-inspector.pod:15
19844 " virt-inspector domname\n"
19849 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19852 " virt-inspector disk.img [disk.img ...]\n"
19857 #: ../inspector/virt-inspector.pod:21
19859 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19860 "determine the version of the operating system and other information about "
19861 "the virtual machine."
19865 #: ../inspector/virt-inspector.pod:25
19866 msgid "Virt-inspector produces XML output for feeding into other programs."
19870 #: ../inspector/virt-inspector.pod:27
19872 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19873 "the libvirt domain (see: C<virsh list --all>)."
19877 #: ../inspector/virt-inspector.pod:30
19879 "You can also run virt-inspector directly on disk images from a single "
19880 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19881 "has several block devices, in which case you should list several I<-a> "
19882 "options one after another, with the first corresponding to the guest's C</"
19883 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
19887 #: ../inspector/virt-inspector.pod:37
19889 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19890 "keys and similar."
19894 #: ../inspector/virt-inspector.pod:40
19896 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19897 "inspect several virtual machines, you have to run virt-inspector several "
19898 "times (for example, from a shell script for-loop)."
19902 #: ../inspector/virt-inspector.pod:45
19904 "Because virt-inspector needs direct access to guest images, it won't "
19905 "normally work over remote libvirt connections."
19909 #: ../inspector/virt-inspector.pod:48
19911 "All of the information available from virt-inspector is also available "
19912 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19913 "The same information can also be fetched using guestfish or via libguestfs "
19914 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19915 "WITH OTHER PROGRAMMING LANGUAGES>)."
19919 #: ../inspector/virt-inspector.pod:81
19921 "Libvirt is only used if you specify a C<domname> on the command line. If "
19922 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19927 #: ../inspector/virt-inspector.pod:94
19929 "When prompting for keys and passphrases, virt-inspector normally turns "
19930 "echoing off so you cannot see what you are typing. If you are not worried "
19931 "about Tempest attacks and there is no one else in the room you can specify "
19932 "this flag to see what you are typing."
19936 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
19937 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
19938 #: ../tools/virt-win-reg.pl:144
19940 "Specify the format of disk images given on the command line. If this is "
19941 "omitted then the format is autodetected from the content of the disk image."
19945 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
19946 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
19947 #: ../tools/virt-win-reg.pl:148
19949 "If disk images are requested from libvirt, then this program asks libvirt "
19950 "for this information. In this case, the value of the format parameter is "
19955 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
19956 #: ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132
19957 #: ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102
19958 #: ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
19960 "If working with untrusted raw-format guest disk images, you should ensure "
19961 "the format is always specified."
19965 #: ../inspector/virt-inspector.pod:139
19966 msgid "Previous versions of virt-inspector allowed you to write either:"
19970 #: ../inspector/virt-inspector.pod:145
19973 " virt-inspector guestname\n"
19978 #: ../inspector/virt-inspector.pod:153
19983 #: ../inspector/virt-inspector.pod:155
19985 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19986 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19987 "just an overview."
19991 #: ../inspector/virt-inspector.pod:159
19993 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19994 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19995 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19996 "which is vanishingly rare in real world VMs."
20000 #: ../inspector/virt-inspector.pod:164
20001 msgid "E<lt>operatingsystemE<gt>"
20005 #: ../inspector/virt-inspector.pod:166
20007 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20008 "describe the operating system, its architecture, the descriptive \"product "
20009 "name\" string, the type of OS and so on, as in this example:"
20013 #: ../inspector/virt-inspector.pod:170
20016 " <operatingsystems>\n"
20017 " <operatingsystem>\n"
20018 " <root>/dev/sda2</root>\n"
20019 " <name>windows</name>\n"
20020 " <arch>i386</arch>\n"
20021 " <distro>windows</distro>\n"
20022 " <product_name>Windows 7 Enterprise</product_name>\n"
20023 " <product_variant>Client</product_variant>\n"
20024 " <major_version>6</major_version>\n"
20025 " <minor_version>1</minor_version>\n"
20026 " <windows_systemroot>/Windows</windows_systemroot>\n"
20027 " <format>installed</format>\n"
20032 #: ../inspector/virt-inspector.pod:183
20034 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20035 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20036 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20037 "architecture. The other fields are fairly self-explanatory, but because "
20038 "these fields are taken directly from the libguestfs inspection API you can "
20039 "find precise information from L<guestfs(3)/INSPECTION>."
20043 #: ../inspector/virt-inspector.pod:191
20045 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20046 "of view of libguestfs (block devices may have completely different names "
20047 "inside the VM itself)."
20051 #: ../inspector/virt-inspector.pod:195
20052 msgid "E<lt>mountpointsE<gt>"
20056 #: ../inspector/virt-inspector.pod:197
20058 "Un*x-like guests typically have multiple filesystems which are mounted at "
20059 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20060 "element which looks like this:"
20064 #: ../inspector/virt-inspector.pod:201
20067 " <operatingsystems>\n"
20068 " <operatingsystem>\n"
20071 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20072 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20073 " </mountpoints>\n"
20078 #: ../inspector/virt-inspector.pod:209
20080 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20081 "and may have completely different names inside the guest. Only mountable "
20082 "filesystems appear in this list, not things like swap devices."
20086 #: ../inspector/virt-inspector.pod:214
20087 msgid "E<lt>filesystemsE<gt>"
20091 #: ../inspector/virt-inspector.pod:216
20093 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20094 "filesystems belonging to the guest, including swap and empty partitions. "
20095 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20096 "this OS or shared with this OS and other OSes)."
20100 #: ../inspector/virt-inspector.pod:222
20101 msgid "You might see something like this:"
20105 #: ../inspector/virt-inspector.pod:224
20108 " <operatingsystems>\n"
20109 " <operatingsystem>\n"
20112 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20113 " <type>ext4</type>\n"
20114 " <label>Fedora-13-x86_64</label>\n"
20115 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20121 #: ../inspector/virt-inspector.pod:234
20123 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20124 "the label, and the UUID."
20128 #: ../inspector/virt-inspector.pod:237
20129 msgid "E<lt>applicationsE<gt>"
20133 #: ../inspector/virt-inspector.pod:239
20135 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20136 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20141 #: ../inspector/virt-inspector.pod:243
20143 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20144 "Typical values would be C<rpm> and C<deb>."
20148 #: ../inspector/virt-inspector.pod:246
20150 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20151 "Typical values include C<yum>, C<up2date> and C<apt>"
20155 #: ../inspector/virt-inspector.pod:249
20156 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20160 #: ../inspector/virt-inspector.pod:252
20163 " <operatingsystems>\n"
20164 " <operatingsystem>\n"
20166 " <applications>\n"
20168 " <name>coreutils</name>\n"
20169 " <version>8.5</version>\n"
20170 " <release>1</release>\n"
20171 " </application>\n"
20176 #: ../inspector/virt-inspector.pod:262
20178 "The version and release fields may not be available for some types guests. "
20179 "Other fields are possible, see L<guestfs(3)/"
20180 "guestfs_inspect_list_applications>."
20184 #: ../inspector/virt-inspector.pod:266
20185 msgid "E<lt>drive_mappingsE<gt>"
20189 #: ../inspector/virt-inspector.pod:268
20191 "For operating systems like Windows which use drive letters, virt-inspector "
20192 "is able to find out how drive letters map to filesystems."
20196 #: ../inspector/virt-inspector.pod:272
20199 " <operatingsystems>\n"
20200 " <operatingsystem>\n"
20202 " <drive_mappings>\n"
20203 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
20204 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
20205 " </drive_mappings>\n"
20210 #: ../inspector/virt-inspector.pod:280
20212 "In the example above, drive C maps to the filesystem on the second partition "
20213 "on the first disk, and drive E maps to the filesystem on the first partition "
20214 "on the second disk."
20218 #: ../inspector/virt-inspector.pod:284
20220 "Note that this only covers permanent local filesystem mappings, not things "
20221 "like network shares. Furthermore NTFS volume mount points may not be listed "
20226 #: ../inspector/virt-inspector.pod:288
20227 msgid "E<lt>iconE<gt>"
20231 #: ../inspector/virt-inspector.pod:290
20233 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
20234 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
20235 "very large and high quality."
20239 #: ../inspector/virt-inspector.pod:294
20242 " <operatingsystems>\n"
20243 " <operatingsystem>\n"
20246 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
20247 " [... many lines of base64 data ...]\n"
20253 #: ../inspector/virt-inspector.pod:302
20255 "To display the icon, you have to extract it and convert the base64 data back "
20256 "to a binary file. Use an XPath query or simply an editor to extract the "
20257 "data, then use the coreutils L<base64(1)> program to do the conversion back "
20262 #: ../inspector/virt-inspector.pod:307
20265 " base64 -i -d < icon.data > icon.png\n"
20270 #: ../inspector/virt-inspector.pod:309
20271 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
20275 #: ../inspector/virt-inspector.pod:311
20277 "Virt-inspector can detect some operating system installers on install disks, "
20278 "live CDs, bootable USB keys and more."
20282 #: ../inspector/virt-inspector.pod:314
20284 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
20285 "fields may be present to indicate a live CD, network installer, or one part "
20286 "of a multipart CD. For example:"
20290 #: ../inspector/virt-inspector.pod:318
20293 " <operatingsystems>\n"
20294 " <operatingsystem>\n"
20295 " <root>/dev/sda</root>\n"
20296 " <name>linux</name>\n"
20297 " <arch>i386</arch>\n"
20298 " <distro>ubuntu</distro>\n"
20299 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
20300 " <major_version>10</major_version>\n"
20301 " <minor_version>10</minor_version>\n"
20302 " <format>installer</format>\n"
20308 #: ../inspector/virt-inspector.pod:330
20309 msgid "USING XPATH"
20313 #: ../inspector/virt-inspector.pod:332
20315 "You can use the XPath query language to select parts of the XML. We "
20316 "recommend using C<xmlstarlet> to perform XPath queries from the command line."
20320 #: ../inspector/virt-inspector.pod:338
20323 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
20325 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20326 " <type>ext4</type>\n"
20332 #: ../inspector/virt-inspector.pod:344
20335 " $ virt-inspector -d Guest | \\\n"
20336 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
20342 #: ../inspector/virt-inspector.pod:348
20345 " $ virt-inspector -d Guest | \\\n"
20346 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
20347 " [displays the guest icon, if there is one]\n"
20352 #: ../inspector/virt-inspector.pod:359
20353 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
20357 #: ../inspector/virt-inspector.pod:361
20359 "Early versions of libguestfs shipped with a different virt-inspector program "
20360 "written in Perl (the current version is written in C). The XML output of "
20361 "the Perl virt-inspector was different and it could also output in other "
20362 "formats like text."
20366 #: ../inspector/virt-inspector.pod:366
20368 "The old virt-inspector is no longer supported or shipped with libguestfs."
20372 #: ../inspector/virt-inspector.pod:369
20374 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
20375 "versions of virt-inspector with different names:"
20379 #: ../inspector/virt-inspector.pod:372
20382 " virt-inspector Old Perl version.\n"
20383 " virt-inspector2 New C version.\n"
20388 #: ../inspector/virt-inspector.pod:382
20390 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
20391 ">, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
20395 #: ../inspector/virt-inspector.pod:399
20396 msgid "Matthew Booth L<mbooth@redhat.com>"
20400 #: ../java/examples/guestfs-java.pod:5
20401 msgid "guestfs-java - How to use libguestfs from Java"
20405 #: ../java/examples/guestfs-java.pod:9
20408 " import com.redhat.et.libguestfs.*;\n"
20413 #: ../java/examples/guestfs-java.pod:11
20416 " GuestFS g = new GuestFS ();\n"
20417 " g.add_drive_opts (\"disk.img\", null);\n"
20423 #: ../java/examples/guestfs-java.pod:17
20425 "This manual page documents how to call libguestfs from the Java programming "
20426 "language. This page just documents the differences from the C API and gives "
20427 "some examples. If you are not familiar with using libguestfs, you also need "
20428 "to read L<guestfs(3)>."
20432 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20433 msgid "CLOSING THE HANDLE"
20437 #: ../java/examples/guestfs-java.pod:24
20439 "The handle is closed when it is reaped by the garbage collector. Because "
20440 "libguestfs handles include a lot of state, it is also possible to close (and "
20441 "hence free) them explicitly by calling the C<close> method."
20445 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20446 #: ../python/examples/guestfs-python.pod:21
20447 #: ../ruby/examples/guestfs-ruby.pod:22
20452 #: ../java/examples/guestfs-java.pod:31
20454 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20455 "exception. This has a single parameter which is the error message (a "
20460 #: ../java/examples/guestfs-java.pod:35
20461 msgid "Calling any method on a closed handle raises the same exception."
20465 #: ../java/examples/guestfs-java.pod:47
20467 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-ocaml"
20468 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20469 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
20473 #: ../ocaml/examples/guestfs-ocaml.pod:5
20474 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20478 #: ../ocaml/examples/guestfs-ocaml.pod:9
20479 msgid "Module style:"
20483 #: ../ocaml/examples/guestfs-ocaml.pod:11
20486 " let g = Guestfs.create () in\n"
20487 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20488 " Guestfs.launch g;\n"
20493 #: ../ocaml/examples/guestfs-ocaml.pod:15
20494 msgid "Object-oriented style:"
20498 #: ../ocaml/examples/guestfs-ocaml.pod:17
20501 " let g = new Guestfs.guestfs () in\n"
20502 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20508 #: ../ocaml/examples/guestfs-ocaml.pod:21
20511 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20513 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20518 #: ../ocaml/examples/guestfs-ocaml.pod:27
20520 "This manual page documents how to call libguestfs from the OCaml programming "
20521 "language. This page just documents the differences from the C API and gives "
20522 "some examples. If you are not familiar with using libguestfs, you also need "
20523 "to read L<guestfs(3)>."
20527 #: ../ocaml/examples/guestfs-ocaml.pod:32
20528 msgid "PROGRAMMING STYLES"
20532 #: ../ocaml/examples/guestfs-ocaml.pod:34
20534 "There are two different programming styles supported by the OCaml bindings. "
20535 "You can use a module style, with each C function mapped to an OCaml function:"
20539 #: ../ocaml/examples/guestfs-ocaml.pod:38
20542 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20547 #: ../ocaml/examples/guestfs-ocaml.pod:40
20552 #: ../ocaml/examples/guestfs-ocaml.pod:42
20555 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20560 #: ../ocaml/examples/guestfs-ocaml.pod:44
20562 "Alternately you can use an object-oriented style, calling methods on the "
20563 "class C<Guestfs.guestfs>:"
20567 #: ../ocaml/examples/guestfs-ocaml.pod:47
20570 " method set_verbose : bool -> unit\n"
20575 #: ../ocaml/examples/guestfs-ocaml.pod:49
20577 "The object-oriented style is usually briefer, and the minor performance "
20578 "penalty isn't noticable in the general overhead of performing libguestfs "
20583 #: ../ocaml/examples/guestfs-ocaml.pod:55
20585 "The handle is closed when it is reaped by the garbage collector. Because "
20586 "libguestfs handles include a lot of state, it is also possible to close (and "
20587 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20592 #: ../ocaml/examples/guestfs-ocaml.pod:62
20594 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20595 "exception. This has a single parameter which is the error message (a "
20600 #: ../ocaml/examples/guestfs-ocaml.pod:66
20602 "Calling any function/method on a closed handle raises C<Guestfs."
20603 "Handle_closed>. The single parameter is the name of the function that you "
20608 #: ../ocaml/examples/guestfs-ocaml.pod:80
20610 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
20611 "(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20612 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>, L<http://caml.inria.fr/>."
20616 #: ../perl/examples/guestfs-perl.pod:5
20617 msgid "guestfs-perl - How to use libguestfs from Perl"
20621 #: ../perl/examples/guestfs-perl.pod:9
20624 " use Sys::Guestfs;\n"
20629 #: ../perl/examples/guestfs-perl.pod:11
20632 " my $h = Sys::Guestfs->new ();\n"
20633 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20634 " $h->launch ();\n"
20635 " $h->mount_options ('', '/dev/sda1', '/');\n"
20636 " $h->touch ('/hello');\n"
20642 #: ../perl/examples/guestfs-perl.pod:20
20644 "This manual page documents how to call libguestfs from the Perl programming "
20645 "language. This page just documents the differences from the C API and gives "
20646 "some examples. If you are not familiar with using libguestfs, you also need "
20647 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20651 #: ../perl/examples/guestfs-perl.pod:26
20656 #: ../perl/examples/guestfs-perl.pod:28
20658 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20663 #: ../perl/examples/guestfs-perl.pod:41
20665 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang"
20666 "(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
20667 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20671 #: ../python/examples/guestfs-python.pod:5
20672 msgid "guestfs-python - How to use libguestfs from Python"
20676 #: ../python/examples/guestfs-python.pod:9
20679 " import guestfs\n"
20680 " g = guestfs.GuestFS ()\n"
20681 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20687 #: ../python/examples/guestfs-python.pod:16
20689 "This manual page documents how to call libguestfs from the Python "
20690 "programming language. This page just documents the differences from the C "
20691 "API and gives some examples. If you are not familiar with using libguestfs, "
20692 "you also need to read L<guestfs(3)>."
20696 #: ../python/examples/guestfs-python.pod:23
20698 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20699 "single string argument which is the error message."
20703 #: ../python/examples/guestfs-python.pod:26
20704 msgid "MORE DOCUMENTATION"
20708 #: ../python/examples/guestfs-python.pod:28
20713 #: ../python/examples/guestfs-python.pod:30
20717 " >>> import guestfs\n"
20718 " >>> help (guestfs)\n"
20723 #: ../python/examples/guestfs-python.pod:44
20725 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
20726 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, "
20727 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20731 #: ../rescue/virt-rescue.pod:5
20732 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20736 #: ../rescue/virt-rescue.pod:9
20739 " virt-rescue [--options] -d domname\n"
20744 #: ../rescue/virt-rescue.pod:11
20747 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20752 #: ../rescue/virt-rescue.pod:15
20755 " virt-rescue [--options] domname\n"
20760 #: ../rescue/virt-rescue.pod:17
20763 " virt-rescue [--options] disk.img [disk.img ...]\n"
20768 #: ../rescue/virt-rescue.pod:21
20770 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20771 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20772 "you from doing this, but doesn't catch all cases."
20776 #: ../rescue/virt-rescue.pod:25
20778 "However if you use the I<--ro> (read only) option, then you can attach a "
20779 "shell to a live virtual machine. The results might be strange or "
20780 "inconsistent at times but you won't get disk corruption."
20784 #: ../rescue/virt-rescue.pod:31
20786 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20787 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20788 "recovery tools which you can use to examine or rescue a virtual machine or "
20793 #: ../rescue/virt-rescue.pod:36
20795 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20796 "on disk image(s):"
20800 #: ../rescue/virt-rescue.pod:39
20803 " virt-rescue -d GuestName\n"
20808 #: ../rescue/virt-rescue.pod:41
20811 " virt-rescue --ro -a /path/to/disk.img\n"
20816 #: ../rescue/virt-rescue.pod:43
20819 " virt-rescue -a /dev/sdc\n"
20824 #: ../rescue/virt-rescue.pod:45
20825 msgid "For live VMs you I<must> use the --ro option."
20829 #: ../rescue/virt-rescue.pod:47
20831 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20832 "in an interactive bash shell where you can use many ordinary Linux "
20833 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20834 "appliance. You must mount the virtual machine's filesystems by hand. There "
20835 "is an empty directory called C</sysroot> where you can mount filesystems."
20839 #: ../rescue/virt-rescue.pod:54
20841 "In the example below, we list logical volumes, then choose one to mount "
20842 "under C</sysroot>:"
20846 #: ../rescue/virt-rescue.pod:57
20850 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20851 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20852 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20853 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20854 " ><rescue> ls /sysroot\n"
20859 #: ../rescue/virt-rescue.pod:64
20861 "If you don't know what filesystems are available on the virtual machine then "
20862 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20866 #: ../rescue/virt-rescue.pod:70
20868 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20869 "virtual machine. For example you can use it on a blank file if you want to "
20870 "partition that file (although we would recommend using L<guestfish(1)> "
20871 "instead as it is more suitable for this purpose). You can even use virt-"
20872 "rescue on things like SD cards."
20876 #: ../rescue/virt-rescue.pod:76
20878 "Virt-rescue does not require root. You only need to run it as root if you "
20879 "need root to open the disk image."
20883 #: ../rescue/virt-rescue.pod:79
20885 "This tool is just designed for quick interactive hacking on a virtual "
20886 "machine. For more structured access to a virtual machine disk image, you "
20887 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20888 "make scripted changes to guests, use L<guestfish(1)>."
20892 #: ../rescue/virt-rescue.pod:103
20893 msgid "B<--append kernelopts>"
20897 #: ../rescue/virt-rescue.pod:105
20898 msgid "Pass additional options to the rescue kernel."
20902 #: ../rescue/virt-rescue.pod:135
20905 " virt-rescue --format=raw -a disk.img\n"
20910 #: ../rescue/virt-rescue.pod:139
20913 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20918 #: ../rescue/virt-rescue.pod:148
20923 #: ../rescue/virt-rescue.pod:150
20924 msgid "B<--memsize MB>"
20928 #: ../rescue/virt-rescue.pod:152
20930 "Change the amount of memory allocated to the rescue system. The default is "
20931 "set by libguestfs and is small but adequate for running system tools. The "
20932 "occasional program might need more memory. The parameter is specified in "
20937 #: ../rescue/virt-rescue.pod:157
20938 msgid "B<--network>"
20942 #: ../rescue/virt-rescue.pod:159
20943 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20947 #: ../rescue/virt-rescue.pod:165
20948 msgid "Open the image read-only."
20952 #: ../rescue/virt-rescue.pod:175
20954 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
20955 "SELINUX> before using this option."
20959 #: ../rescue/virt-rescue.pod:178
20964 #: ../rescue/virt-rescue.pod:180
20965 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
20969 #: ../rescue/virt-rescue.pod:198
20971 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20972 "are done read-write."
20976 #: ../rescue/virt-rescue.pod:211
20977 msgid "Previous versions of virt-rescue allowed you to write either:"
20981 #: ../rescue/virt-rescue.pod:213
20984 " virt-rescue disk.img [disk.img ...]\n"
20989 #: ../rescue/virt-rescue.pod:217
20992 " virt-rescue guestname\n"
20997 #: ../rescue/virt-rescue.pod:225
21002 #: ../rescue/virt-rescue.pod:227
21004 "Adding the I<--network> option enables QEMU user networking in the rescue "
21005 "appliance. There are some differences between user networking and ordinary "
21010 #: ../rescue/virt-rescue.pod:233
21011 msgid "ping does not work"
21015 #: ../rescue/virt-rescue.pod:235
21017 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21018 "send the ping packets, and because virt-rescue must be able to run as non-"
21019 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
21020 "The ping command will appear to resolve addresses but will not be able to "
21021 "send or receive any packets. This does not mean that the network is not "
21026 #: ../rescue/virt-rescue.pod:242
21027 msgid "cannot receive connections"
21031 #: ../rescue/virt-rescue.pod:244
21032 msgid "QEMU user networking cannot receive incoming connections."
21036 #: ../rescue/virt-rescue.pod:246
21037 msgid "making TCP connections"
21041 #: ../rescue/virt-rescue.pod:248
21043 "The virt-rescue appliance needs to be small and so does not include many "
21044 "network tools. In particular there is no L<telnet(1)> command. You can "
21045 "make TCP connections from the shell using the magical C</dev/tcp/"
21046 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21050 #: ../rescue/virt-rescue.pod:253
21053 " exec 3<>/dev/tcp/redhat.com/80\n"
21054 " echo \"GET /\" >&3\n"
21060 #: ../rescue/virt-rescue.pod:257
21061 msgid "See L<bash(1)> for more details."
21065 #: ../rescue/virt-rescue.pod:263
21067 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
21068 "ENVIRONMENT VARIABLES> for the complete list."
21072 #: ../rescue/virt-rescue.pod:290
21074 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
21075 "libguestfs.org/>."
21079 #: ../resize/virt-resize.pod:5
21080 msgid "virt-resize - Resize a virtual machine disk"
21084 #: ../resize/virt-resize.pod:9
21087 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21088 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21089 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21094 #: ../resize/virt-resize.pod:15
21096 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21097 "larger or smaller overall, and resizing or deleting any partitions contained "
21102 #: ../resize/virt-resize.pod:19
21104 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21105 "not> be used on live virtual machines - for consistent results, shut the "
21106 "virtual machine down before resizing it."
21110 #: ../resize/virt-resize.pod:23
21112 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21113 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21117 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520
21118 #: ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469
21119 #: ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2604
21124 #: ../resize/virt-resize.pod:33
21126 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21127 "fill the extra 5GB of space."
21131 #: ../resize/virt-resize.pod:36
21134 " virt-filesystems --long -h --all -a olddisk\n"
21139 #: ../resize/virt-resize.pod:38
21142 " truncate -r olddisk newdisk\n"
21143 " truncate -s +5G newdisk\n"
21148 #: ../resize/virt-resize.pod:41
21151 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21152 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21157 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527
21158 #: ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475
21159 #: ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2629
21164 #: ../resize/virt-resize.pod:46
21166 "As above, but make the /boot partition 200MB bigger, while giving the "
21167 "remaining space to /dev/sda2:"
21171 #: ../resize/virt-resize.pod:49
21174 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21175 " olddisk newdisk\n"
21180 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533
21181 #: ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486
21182 #: ../src/guestfs.pod:1436
21187 #: ../resize/virt-resize.pod:54
21189 "As in the first example, but expand a logical volume as the final step. "
21190 "This is what you would typically use for Linux guests that use LVM:"
21194 #: ../resize/virt-resize.pod:58
21197 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
21198 " olddisk newdisk\n"
21203 #: ../resize/virt-resize.pod:61
21208 #: ../resize/virt-resize.pod:63
21210 "As in the first example, but the output format will be qcow2 instead of a "
21215 #: ../resize/virt-resize.pod:66
21218 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
21219 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
21224 #: ../resize/virt-resize.pod:71
21225 msgid "DETAILED USAGE"
21229 #: ../resize/virt-resize.pod:73
21230 msgid "EXPANDING A VIRTUAL MACHINE DISK"
21234 #: ../resize/virt-resize.pod:77
21235 msgid "1. Shut down the virtual machine"
21239 #: ../resize/virt-resize.pod:79
21240 msgid "2. Locate input disk image"
21244 #: ../resize/virt-resize.pod:81
21246 "Locate the input disk image (ie. the file or device on the host containing "
21247 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
21248 "dumpxml> like this to find the disk image name:"
21252 #: ../resize/virt-resize.pod:85
21255 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
21256 " Found 1 nodes:\n"
21258 " <source dev=\"/dev/vg/lv_guest\" />\n"
21263 #: ../resize/virt-resize.pod:90
21264 msgid "3. Look at current sizing"
21268 #: ../resize/virt-resize.pod:92
21269 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
21273 #: ../resize/virt-resize.pod:95
21276 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
21277 " Name Type Size Parent\n"
21278 " /dev/sda1 partition 101M /dev/sda\n"
21279 " /dev/sda2 partition 7.9G /dev/sda\n"
21280 " /dev/sda device 8.0G -\n"
21285 #: ../resize/virt-resize.pod:101
21287 "(This example is a virtual machine with an 8 GB disk which we would like to "
21288 "expand up to 10 GB)."
21292 #: ../resize/virt-resize.pod:104
21293 msgid "4. Create output disk"
21297 #: ../resize/virt-resize.pod:106
21299 "Virt-resize cannot do in-place disk modifications. You have to have space "
21300 "to store the resized output disk."
21304 #: ../resize/virt-resize.pod:109
21306 "To store the resized disk image in a file, create a file of a suitable size:"
21310 #: ../resize/virt-resize.pod:112
21313 " # rm -f outdisk\n"
21314 " # truncate -s 10G outdisk\n"
21319 #: ../resize/virt-resize.pod:115
21320 msgid "Or use L<lvcreate(1)> to create a logical volume:"
21324 #: ../resize/virt-resize.pod:117
21327 " # lvcreate -L 10G -n lv_name vg_name\n"
21332 #: ../resize/virt-resize.pod:119
21333 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
21337 #: ../resize/virt-resize.pod:121
21340 " # virsh pool-list\n"
21341 " # virsh vol-create-as poolname newvol 10G\n"
21346 #: ../resize/virt-resize.pod:124
21351 #: ../resize/virt-resize.pod:126
21353 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
21354 "file) and the output disk. The output disk is the one created in the "
21359 #: ../resize/virt-resize.pod:130
21362 " # virt-resize indisk outdisk\n"
21367 #: ../resize/virt-resize.pod:132
21369 "This command just copies disk image C<indisk> to disk image C<outdisk> "
21370 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
21371 "larger, then an extra, empty partition is created at the end of the disk "
21372 "covering the extra space. If C<outdisk> is smaller, then it will give an "
21377 #: ../resize/virt-resize.pod:138
21379 "More realistically you'd want to expand existing partitions in the disk "
21380 "image by passing extra options (for the full list see the L</OPTIONS> "
21385 #: ../resize/virt-resize.pod:142
21387 "L</--expand> is the most useful option. It expands the named partition "
21388 "within the disk to fill any extra space:"
21392 #: ../resize/virt-resize.pod:145
21395 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
21400 #: ../resize/virt-resize.pod:147
21402 "(In this case, an extra partition is I<not> created at the end of the disk, "
21403 "because there will be no unused space)."
21407 #: ../resize/virt-resize.pod:150
21409 "L</--resize> is the other commonly used option. The following would "
21410 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21411 "rest of the available space:"
21415 #: ../resize/virt-resize.pod:154
21418 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21419 " indisk outdisk\n"
21424 #: ../resize/virt-resize.pod:157
21426 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21427 "if virt-resize knows how, it will resize the contents, the equivalent of "
21428 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21429 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21430 "filesystems, so you would have to online resize them after booting the guest."
21434 #: ../resize/virt-resize.pod:164
21435 msgid "Other options are covered below."
21439 #: ../resize/virt-resize.pod:166
21444 #: ../resize/virt-resize.pod:168
21445 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21449 #: ../resize/virt-resize.pod:170
21450 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21454 #: ../resize/virt-resize.pod:172
21457 " # virsh edit guestname\n"
21462 #: ../resize/virt-resize.pod:174
21464 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21465 "html#elementsDisks>"
21469 #: ../resize/virt-resize.pod:177
21470 msgid "Then start up the domain with the new, resized disk:"
21474 #: ../resize/virt-resize.pod:179
21477 " # virsh start guestname\n"
21482 #: ../resize/virt-resize.pod:181
21484 "and check that it still works. See also the L</NOTES> section below for "
21485 "additional information."
21489 #: ../resize/virt-resize.pod:184
21490 msgid "7. Resize LVs etc inside the guest"
21494 #: ../resize/virt-resize.pod:186
21495 msgid "(This can also be done offline using L<guestfish(1)>)"
21499 #: ../resize/virt-resize.pod:188
21501 "Once the guest has booted you should see the new space available, at least "
21502 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21503 "may need to resize LVs inside PVs, and also resize filesystem types that "
21504 "virt-resize does not know how to expand."
21508 #: ../resize/virt-resize.pod:195
21509 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21513 #: ../resize/virt-resize.pod:197
21515 "Shrinking is somewhat more complex than expanding, and only an overview is "
21520 #: ../resize/virt-resize.pod:200
21522 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21523 "filesystems). The user has to shrink content before passing the disk image "
21524 "to virt-resize, and virt-resize will check that the content has been shrunk "
21529 #: ../resize/virt-resize.pod:205
21530 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21534 #: ../resize/virt-resize.pod:207
21536 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21537 "steps 3 and 4 above to allocate a new disk image."
21541 #: ../resize/virt-resize.pod:210
21543 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21547 #: ../resize/virt-resize.pod:213
21548 msgid "IGNORING OR DELETING PARTITIONS"
21552 #: ../resize/virt-resize.pod:215
21554 "virt-resize also gives a convenient way to ignore or delete partitions when "
21555 "copying from the input disk to the output disk. Ignoring a partition speeds "
21556 "up the copy where you don't care about the existing contents of a "
21557 "partition. Deleting a partition removes it completely, but note that it "
21558 "also renumbers any partitions after the one which is deleted, which can "
21559 "leave some guests unbootable."
21563 #: ../resize/virt-resize.pod:222
21564 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21568 #: ../resize/virt-resize.pod:224
21570 "If the input disk is in qcow2 format, then you may prefer that the output is "
21571 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21572 "the fly. The output format is simply determined by the format of the empty "
21573 "output container that you provide. Thus to create qcow2 output, use:"
21577 #: ../resize/virt-resize.pod:230
21580 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21585 #: ../resize/virt-resize.pod:232
21586 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21590 #: ../resize/virt-resize.pod:234
21591 msgid "Similarly, to get non-sparse raw output use:"
21595 #: ../resize/virt-resize.pod:236
21598 " fallocate -l size outdisk\n"
21603 #: ../resize/virt-resize.pod:238
21605 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21606 "dev/zero of=outdisk bs=1M count=..>)"
21610 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
21611 msgid "Display help."
21615 #: ../resize/virt-resize.pod:249
21620 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21621 #: ../tools/virt-win-reg.pl:120
21626 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21627 msgid "Enable debugging messages."
21631 #: ../resize/virt-resize.pod:255
21632 msgid "B<--delete part>"
21636 #: ../resize/virt-resize.pod:257
21638 "Delete the named partition. It would be more accurate to describe this as "
21639 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21640 "the original disk image is left intact."
21644 #: ../resize/virt-resize.pod:261
21646 "Note that when you delete a partition, then anything contained in the "
21647 "partition is also deleted. Furthermore, this causes any partitions that "
21648 "come after to be I<renumbered>, which can easily make your guest unbootable."
21652 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21653 #: ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
21654 msgid "You can give this option multiple times."
21658 #: ../resize/virt-resize.pod:268
21659 msgid "B<--expand part>"
21663 #: ../resize/virt-resize.pod:270
21665 "Expand the named partition so it uses up all extra space (space left over "
21666 "after any other resize changes that you request have been done)."
21670 #: ../resize/virt-resize.pod:273
21672 "If virt-resize knows how, it will expand the direct content of the "
21673 "partition. For example, if the partition is an LVM PV, it will expand the "
21674 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21675 "content it doesn't know about alone."
21679 #: ../resize/virt-resize.pod:278
21680 msgid "Currently virt-resize can resize:"
21684 #: ../resize/virt-resize.pod:284
21685 msgid "ext2, ext3 and ext4 filesystems."
21689 #: ../resize/virt-resize.pod:288
21690 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21694 #: ../resize/virt-resize.pod:290
21696 "The filesystem must have been shut down consistently last time it was used. "
21697 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21698 "consistency check, so at the first boot after resizing Windows will check "
21703 #: ../resize/virt-resize.pod:297
21705 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21706 "inside the PV, but see the I<--LV-expand> option. The user could also "
21707 "resize LVs as desired after boot."
21711 #: ../resize/virt-resize.pod:303
21712 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21716 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
21717 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21721 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125
21722 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92
21723 #: ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
21724 msgid "B<--format> raw"
21728 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
21730 "Specify the format of the input disk image. If this flag is not given then "
21731 "it is auto-detected from the image itself."
21735 #: ../resize/virt-resize.pod:317
21737 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21738 "AND NON-SPARSE RAW FORMATS>."
21742 #: ../resize/virt-resize.pod:320
21743 msgid "B<--ignore part>"
21747 #: ../resize/virt-resize.pod:322
21749 "Ignore the named partition. Effectively this means the partition is "
21750 "allocated on the destination disk, but the content is not copied across from "
21751 "the source disk. The content of the partition will be blank (all zero "
21756 #: ../resize/virt-resize.pod:329
21757 msgid "B<--LV-expand logvol>"
21761 #: ../resize/virt-resize.pod:331
21763 "This takes the logical volume and, as a final step, expands it to fill all "
21764 "the space available in its volume group. A typical usage, assuming a Linux "
21765 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
21766 "lv_root> would be:"
21770 #: ../resize/virt-resize.pod:336
21773 " virt-resize indisk outdisk \\\n"
21774 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21779 #: ../resize/virt-resize.pod:339
21781 "This would first expand the partition (and PV), and then expand the root "
21782 "device to fill the extra space in the PV."
21786 #: ../resize/virt-resize.pod:342
21788 "The contents of the LV are also resized if virt-resize knows how to do "
21789 "that. You can stop virt-resize from trying to expand the content by using "
21790 "the option I<--no-expand-content>."
21794 #: ../resize/virt-resize.pod:346
21795 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21799 #: ../resize/virt-resize.pod:348
21801 "You can give this option multiple times, I<but> it doesn't make sense to do "
21802 "this unless the logical volumes you specify are all in different volume "
21807 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
21808 msgid "B<--machine-readable>"
21812 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
21814 "This option is used to make the output more machine friendly when being "
21815 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
21819 #: ../resize/virt-resize.pod:360
21820 msgid "B<--dryrun>"
21824 #: ../resize/virt-resize.pod:362
21825 msgid "Print a summary of what would be done, but don't do anything."
21829 #: ../resize/virt-resize.pod:364
21830 msgid "B<--no-copy-boot-loader>"
21834 #: ../resize/virt-resize.pod:366
21836 "By default, virt-resize copies over some sectors at the start of the disk "
21837 "(up to the beginning of the first partition). Commonly these sectors "
21838 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21839 "in order for the guest to boot correctly."
21843 #: ../resize/virt-resize.pod:371
21845 "If you specify this flag, then this initial copy is not done. You may need "
21846 "to reinstall the boot loader in this case."
21850 #: ../resize/virt-resize.pod:374
21851 msgid "B<--no-extra-partition>"
21855 #: ../resize/virt-resize.pod:376
21857 "By default, virt-resize creates an extra partition if there is any extra, "
21858 "unused space after all resizing has happened. Use this option to prevent "
21859 "the extra partition from being created. If you do this then the extra space "
21860 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21861 "tool in the guest."
21865 #: ../resize/virt-resize.pod:382
21867 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21872 #: ../resize/virt-resize.pod:385
21873 msgid "B<--no-expand-content>"
21877 #: ../resize/virt-resize.pod:387
21879 "By default, virt-resize will try to expand the direct contents of "
21880 "partitions, if it knows how (see I<--expand> option above)."
21884 #: ../resize/virt-resize.pod:390
21886 "If you give the I<--no-expand-content> option then virt-resize will not "
21891 #: ../resize/virt-resize.pod:393
21892 msgid "B<--ntfsresize-force>"
21896 #: ../resize/virt-resize.pod:395
21898 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21899 "the NTFS disk is marked as needing a consistency check. You have to use "
21900 "this option if you want to resize a Windows guest multiple times without "
21901 "booting into Windows between each resize."
21905 #: ../resize/virt-resize.pod:401
21906 msgid "B<--output-format> raw"
21910 #: ../resize/virt-resize.pod:403
21912 "Specify the format of the output disk image. If this flag is not given then "
21913 "it is auto-detected from the image itself."
21917 #: ../resize/virt-resize.pod:409
21919 "Note that this option I<does not create> the output format. This option "
21920 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21921 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
21922 "SPARSE RAW FORMATS>."
21926 #: ../resize/virt-resize.pod:414 ../sparsify/virt-sparsify.pod:153
21931 #: ../resize/virt-resize.pod:416 ../sparsify/virt-sparsify.pod:155
21936 #: ../resize/virt-resize.pod:418
21937 msgid "Don't print the summary."
21941 #: ../resize/virt-resize.pod:420
21942 msgid "B<--resize part=size>"
21946 #: ../resize/virt-resize.pod:422
21948 "Resize the named partition (expanding or shrinking it) so that it has the "
21953 #: ../resize/virt-resize.pod:425
21955 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21956 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21957 "size; or as a relative number or percentage. For example:"
21961 #: ../resize/virt-resize.pod:431
21964 " --resize /dev/sda2=10G\n"
21969 #: ../resize/virt-resize.pod:433
21972 " --resize /dev/sda4=90%\n"
21977 #: ../resize/virt-resize.pod:435
21980 " --resize /dev/sda2=+1G\n"
21985 #: ../resize/virt-resize.pod:437
21988 " --resize /dev/sda2=-200M\n"
21993 #: ../resize/virt-resize.pod:439
21996 " --resize /dev/sda1=+128K\n"
22001 #: ../resize/virt-resize.pod:441
22004 " --resize /dev/sda1=+10%\n"
22009 #: ../resize/virt-resize.pod:443
22012 " --resize /dev/sda1=-10%\n"
22017 #: ../resize/virt-resize.pod:445
22019 "You can increase the size of any partition. Virt-resize will expand the "
22020 "direct content of the partition if it knows how (see I<--expand> below)."
22024 #: ../resize/virt-resize.pod:449
22026 "You can only I<decrease> the size of partitions that contain filesystems or "
22027 "PVs which have already been shrunk. Virt-resize will check this has been "
22028 "done before proceeding, or else will print an error (see also I<--resize-"
22033 #: ../resize/virt-resize.pod:456
22034 msgid "B<--resize-force part=size>"
22038 #: ../resize/virt-resize.pod:458
22040 "This is the same as I<--resize> except that it will let you decrease the "
22041 "size of any partition. Generally this means you will lose any data which "
22042 "was at the end of the partition you shrink, but you may not care about that "
22043 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22044 "as a swap partition)."
22048 #: ../resize/virt-resize.pod:464
22049 msgid "See also the I<--ignore> option."
22053 #: ../resize/virt-resize.pod:466
22054 msgid "B<--shrink part>"
22058 #: ../resize/virt-resize.pod:468
22060 "Shrink the named partition until the overall disk image fits in the "
22061 "destination. The named partition B<must> contain a filesystem or PV which "
22062 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22063 "online tools). Virt-resize will check this and give an error if it has not "
22068 #: ../resize/virt-resize.pod:474
22070 "The amount by which the overall disk must be shrunk (after carrying out all "
22071 "other operations requested by the user) is called the \"deficit\". For "
22072 "example, a straight copy (assume no other operations) from a 5GB disk image "
22073 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22074 "would give an error unless the user specified a partition to shrink and that "
22075 "partition had more than a gigabyte of free space."
22079 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
22080 msgid "MACHINE READABLE OUTPUT"
22084 #: ../resize/virt-resize.pod:494
22086 "The I<--machine-readable> option can be used to make the output more machine "
22087 "friendly, which is useful when calling virt-resize from other programs, GUIs "
22092 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
22093 msgid "There are two ways to use this option."
22097 #: ../resize/virt-resize.pod:500
22099 "Firstly use the option on its own to query the capabilities of the virt-"
22100 "resize binary. Typical output looks like this:"
22104 #: ../resize/virt-resize.pod:503
22107 " $ virt-resize --machine-readable\n"
22109 " ntfsresize-force\n"
22117 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
22119 "A list of features is printed, one per line, and the program exits with "
22124 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
22126 "Secondly use the option in conjunction with other options to make the "
22127 "regular program output more machine friendly."
22131 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
22132 msgid "At the moment this means:"
22136 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
22138 "Progress bar messages can be parsed from stdout by looking for this regular "
22143 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
22146 " ^[0-9]+/[0-9]+$\n"
22151 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
22153 "The calling program should treat messages sent to stdout (except for "
22154 "progress bar messages) as status messages. They can be logged and/or "
22155 "displayed to the user."
22159 #: ../resize/virt-resize.pod:535
22161 "The calling program should treat messages sent to stderr as error messages. "
22162 "In addition, virt-resize exits with a non-zero status code if there was a "
22167 #: ../resize/virt-resize.pod:541
22169 "Versions of the program prior to 1.13.9 did not support the I<--machine-"
22170 "readable> option and will return an error."
22174 #: ../resize/virt-resize.pod:546
22175 msgid "\"Partition 1 does not end on cylinder boundary.\""
22179 #: ../resize/virt-resize.pod:548
22181 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
22182 "means the partitions will not be aligned to the ancient CHS geometry. "
22183 "However CHS geometry is meaningless for disks manufactured since the early "
22184 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
22185 "cylinders is not required by any modern operating system."
22189 #: ../resize/virt-resize.pod:555
22190 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
22194 #: ../resize/virt-resize.pod:557
22196 "In Windows Vista and later versions, Microsoft switched to using a separate "
22197 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
22198 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
22199 "the boot partition. Doing so seems to break the guest completely. However "
22200 "expanding the second partition (ie. C: drive) should work."
22204 #: ../resize/virt-resize.pod:564
22206 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
22207 "NTFS partitions have been expanded. This is just a safety check and (unless "
22208 "it find errors) is nothing to worry about."
22212 #: ../resize/virt-resize.pod:568
22213 msgid "GUEST BOOT STUCK AT \"GRUB\""
22217 #: ../resize/virt-resize.pod:570
22219 "If a Linux guest does not boot after resizing, and the boot is stuck after "
22220 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
22221 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
22222 "although we think is to do with partition alignment."
22226 #: ../resize/virt-resize.pod:575
22229 " guestfish -i -a newdisk\n"
22230 " ><fs> cat /boot/grub/device.map\n"
22231 " # check the contents of this file are sensible or\n"
22232 " # edit the file if necessary\n"
22233 " ><fs> grub-install / /dev/vda\n"
22239 #: ../resize/virt-resize.pod:582
22241 "For more flexible guest reconfiguration, including if you need to specify "
22242 "other parameters to grub-install, use L<virt-rescue(1)>."
22246 #: ../resize/virt-resize.pod:585
22247 msgid "ALTERNATIVE TOOLS"
22251 #: ../resize/virt-resize.pod:587
22253 "There are several proprietary tools for resizing partitions. We won't "
22254 "mention any here."
22258 #: ../resize/virt-resize.pod:590
22260 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
22261 "operations on disk images. They can resize and move partitions, but I don't "
22262 "think they can do anything with the contents, and they certainly don't "
22267 #: ../resize/virt-resize.pod:595
22269 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
22270 "but at a much lower level. You will probably end up hand-calculating sector "
22271 "offsets, which is something that virt-resize was designed to avoid. If you "
22272 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
22277 #: ../resize/virt-resize.pod:615
22279 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
22280 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
22281 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
22282 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<virt-sparsify(1)>, "
22283 "L<http://libguestfs.org/>."
22287 #: ../ruby/examples/guestfs-ruby.pod:5
22288 msgid "guestfs-ruby - How to use libguestfs from Ruby"
22292 #: ../ruby/examples/guestfs-ruby.pod:9
22295 " require 'guestfs'\n"
22296 " g = Guestfs::Guestfs.new()\n"
22297 " g.add_drive_opts(\"disk.img\",\n"
22298 " :readonly => 1, :format => \"raw\")\n"
22304 #: ../ruby/examples/guestfs-ruby.pod:17
22306 "This manual page documents how to call libguestfs from the Ruby programming "
22307 "language. This page just documents the differences from the C API and gives "
22308 "some examples. If you are not familiar with using libguestfs, you also need "
22309 "to read L<guestfs(3)>."
22313 #: ../ruby/examples/guestfs-ruby.pod:24
22315 "Errors from libguestfs functions are mapped into the C<Error> exception. "
22316 "This has a single parameter which is the error message (a string)."
22320 #: ../ruby/examples/guestfs-ruby.pod:38
22322 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java"
22323 "(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
22324 "L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
22328 #: ../sparsify/virt-sparsify.pod:5
22329 msgid "virt-sparsify - Make a virtual machine disk sparse"
22333 #: ../sparsify/virt-sparsify.pod:9
22336 " virt-sparsify [--options] indisk outdisk\n"
22341 #: ../sparsify/virt-sparsify.pod:13
22343 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
22344 "image) sparse a.k.a. thin-provisioned. This means that free space within "
22345 "the disk image can be converted back to free space on the host."
22349 #: ../sparsify/virt-sparsify.pod:18
22351 "Virt-sparsify can locate and sparsify free space in most filesystems (eg. "
22352 "ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
22356 #: ../sparsify/virt-sparsify.pod:21
22358 "Virt-sparsify can also convert between some disk formats, for example "
22359 "converting a raw disk image to a thin-provisioned qcow2 image."
22363 #: ../sparsify/virt-sparsify.pod:24
22365 "Virt-sparsify can operate on any disk image, not just ones from virtual "
22366 "machines. If a virtual machine has multiple disk images, then you must "
22367 "sparsify each one separately."
22371 #: ../sparsify/virt-sparsify.pod:28
22372 msgid "IMPORTANT LIMITATIONS"
22376 #: ../sparsify/virt-sparsify.pod:34
22378 "Virt-sparsify does not do in-place modifications. It copies from a source "
22379 "image to a destination image, leaving the source unchanged. I<Check that "
22380 "the sparsification was successful before deleting the source image>."
22384 #: ../sparsify/virt-sparsify.pod:41
22385 msgid "The virtual machine I<must be shut down> before using this tool."
22389 #: ../sparsify/virt-sparsify.pod:45
22391 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
22392 "(1 temporary copy + 1 destination image). This is in the worst case and "
22393 "usually much less space is required."
22397 #: ../sparsify/virt-sparsify.pod:51
22399 "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
22403 #: ../sparsify/virt-sparsify.pod:56
22404 msgid "Virt-sparsify cannot handle encrypted disks."
22408 #: ../sparsify/virt-sparsify.pod:60
22410 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
22411 "this space is often used for critical items like bootloaders so it's not "
22416 #: ../sparsify/virt-sparsify.pod:66
22418 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
22419 "to do this unless we can be sure there is no hibernation data, so at the "
22420 "moment swap partitions are ignored."
22424 #: ../sparsify/virt-sparsify.pod:72
22426 "You may also want to read the manual pages for the associated tools L<virt-"
22427 "filesystems(1)> and L<virt-df(1)> before starting."
22431 #: ../sparsify/virt-sparsify.pod:77
22432 msgid "Typical usage is:"
22436 #: ../sparsify/virt-sparsify.pod:79
22439 " virt-sparsify indisk outdisk\n"
22444 #: ../sparsify/virt-sparsify.pod:81
22446 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
22447 "is created, or overwritten if it already exists. The format of the input "
22448 "disk is detected (eg. qcow2) and the same format is used for the output disk."
22452 #: ../sparsify/virt-sparsify.pod:86
22453 msgid "To convert between formats, use the I<--convert> option:"
22457 #: ../sparsify/virt-sparsify.pod:88
22460 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
22465 #: ../sparsify/virt-sparsify.pod:90
22467 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
22468 "can find within the source disk image. You can get it to ignore (don't zero "
22469 "free space on) certain filesystems by doing:"
22473 #: ../sparsify/virt-sparsify.pod:94
22476 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
22481 #: ../sparsify/virt-sparsify.pod:96
22483 "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
22487 #: ../sparsify/virt-sparsify.pod:107
22488 msgid "B<--convert> raw"
22492 #: ../sparsify/virt-sparsify.pod:109
22493 msgid "B<--convert> qcow2"
22497 #: ../sparsify/virt-sparsify.pod:111
22498 msgid "B<--convert> [other formats]"
22502 #: ../sparsify/virt-sparsify.pod:113
22504 "Use C<output-format> as the format for the destination image. If this is "
22505 "not specified, then the input format is used."
22509 #: ../sparsify/virt-sparsify.pod:116
22510 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
22514 #: ../sparsify/virt-sparsify.pod:118
22516 "You can also use any format supported by the L<qemu-img(1)> program, eg. "
22517 "C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
22521 #: ../sparsify/virt-sparsify.pod:122
22523 "Specifying the I<--convert> option is usually a good idea, because then virt-"
22524 "sparsify doesn't need to try to guess the input format."
22528 #: ../sparsify/virt-sparsify.pod:127
22529 msgid "B<--format> qcow2"
22533 #: ../sparsify/virt-sparsify.pod:135
22534 msgid "B<--ignore> filesystem"
22538 #: ../sparsify/virt-sparsify.pod:137
22539 msgid "B<--ignore> volgroup"
22543 #: ../sparsify/virt-sparsify.pod:139
22545 "Ignore the named filesystem. Free space on the filesystem will not be "
22546 "zeroed, but existing blocks of zeroes will still be sparsified."
22550 #: ../sparsify/virt-sparsify.pod:142
22552 "In the second form, this ignores the named volume group. Use the volume "
22553 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
22557 #: ../sparsify/virt-sparsify.pod:157
22558 msgid "This disables progress bars and other unnecessary output."
22562 #: ../sparsify/virt-sparsify.pod:179
22564 "The I<--machine-readable> option can be used to make the output more machine "
22565 "friendly, which is useful when calling virt-sparsify from other programs, "
22570 #: ../sparsify/virt-sparsify.pod:185
22572 "Firstly use the option on its own to query the capabilities of the virt-"
22573 "sparsify binary. Typical output looks like this:"
22577 #: ../sparsify/virt-sparsify.pod:188
22580 " $ virt-sparsify --machine-readable\n"
22588 #: ../sparsify/virt-sparsify.pod:218
22590 "The calling program should treat messages sent to stderr as error messages. "
22591 "In addition, virt-sparsify exits with a non-zero status code if there was a "
22596 #: ../sparsify/virt-sparsify.pod:224
22598 "All versions of virt-sparsify have supported the I<--machine-readable> "
22603 #: ../sparsify/virt-sparsify.pod:238
22605 "Location of the temporary directory used for the potentially large temporary "
22610 #: ../sparsify/virt-sparsify.pod:241
22612 "You should ensure there is enough free space in the worst case for a full "
22613 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
22614 "to another directory that has enough space."
22618 #: ../sparsify/virt-sparsify.pod:245
22619 msgid "This defaults to C</tmp>."
22623 #: ../sparsify/virt-sparsify.pod:249
22625 "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
22629 #: ../sparsify/virt-sparsify.pod:253
22631 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
22632 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, L<qemu-img"
22633 "(1)>, L<http://libguestfs.org/>."
22637 #: ../sparsify/virt-sparsify.pod:270
22638 msgid "Copyright (C) 2011 Red Hat Inc."
22642 #: ../src/guestfs-actions.pod:1
22643 msgid "guestfs_add_cdrom"
22647 #: ../src/guestfs-actions.pod:3
22651 " guestfs_add_cdrom (guestfs_h *g,\n"
22652 " const char *filename);\n"
22657 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249
22658 #: ../src/guestfs-actions.pod:270
22660 "I<This function is deprecated.> In new code, use the L</"
22661 "guestfs_add_drive_opts> call instead."
22665 #: ../src/guestfs-actions.pod:24
22667 "This call checks for the existence of C<filename>. This stops you from "
22668 "specifying other types of drive which are supported by qemu such as C<nbd:> "
22669 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
22674 #: ../src/guestfs-actions.pod:31
22676 "If you just want to add an ISO file (often you use this as an efficient way "
22677 "to transfer large files into the guest), then you should probably use "
22678 "C<guestfs_add_drive_ro> instead."
22682 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
22683 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
22684 #: ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280
22685 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
22686 #: ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447
22687 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506
22688 #: ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552
22689 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652
22690 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681
22691 #: ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798
22692 #: ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826
22693 #: ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046
22694 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084
22695 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1233
22696 #: ../src/guestfs-actions.pod:1279 ../src/guestfs-actions.pod:1297
22697 #: ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:1330
22698 #: ../src/guestfs-actions.pod:1350 ../src/guestfs-actions.pod:1420
22699 #: ../src/guestfs-actions.pod:1451 ../src/guestfs-actions.pod:1476
22700 #: ../src/guestfs-actions.pod:1518 ../src/guestfs-actions.pod:1631
22701 #: ../src/guestfs-actions.pod:1658 ../src/guestfs-actions.pod:1873
22702 #: ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:1982
22703 #: ../src/guestfs-actions.pod:2490 ../src/guestfs-actions.pod:2634
22704 #: ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2730
22705 #: ../src/guestfs-actions.pod:3774 ../src/guestfs-actions.pod:3789
22706 #: ../src/guestfs-actions.pod:3814 ../src/guestfs-actions.pod:4003
22707 #: ../src/guestfs-actions.pod:4017 ../src/guestfs-actions.pod:4030
22708 #: ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:4059
22709 #: ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4167
22710 #: ../src/guestfs-actions.pod:4187 ../src/guestfs-actions.pod:4204
22711 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:4250
22712 #: ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4304
22713 #: ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4358
22714 #: ../src/guestfs-actions.pod:4370 ../src/guestfs-actions.pod:4406
22715 #: ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4435
22716 #: ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4467
22717 #: ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:4580
22718 #: ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4644
22719 #: ../src/guestfs-actions.pod:4662 ../src/guestfs-actions.pod:4680
22720 #: ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:4710
22721 #: ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4741
22722 #: ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4783
22723 #: ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4919
22724 #: ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4969
22725 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5000
22726 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5030
22727 #: ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5060
22728 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5118
22729 #: ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5177
22730 #: ../src/guestfs-actions.pod:5191 ../src/guestfs-actions.pod:5208
22731 #: ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5310
22732 #: ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5400
22733 #: ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5445
22734 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5603
22735 #: ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5682
22736 #: ../src/guestfs-actions.pod:5700 ../src/guestfs-actions.pod:5732
22737 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5815
22738 #: ../src/guestfs-actions.pod:5828 ../src/guestfs-actions.pod:5842
22739 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
22740 #: ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6183
22741 #: ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6209
22742 #: ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6235
22743 #: ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6272
22744 #: ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310
22745 #: ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6358
22746 #: ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6399
22747 #: ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6439
22748 #: ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6475
22749 #: ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6522
22750 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565
22751 #: ../src/guestfs-actions.pod:6581 ../src/guestfs-actions.pod:6605
22752 #: ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6639
22753 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6702
22754 #: ../src/guestfs-actions.pod:6732 ../src/guestfs-actions.pod:6765
22755 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:7001
22756 #: ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7026
22757 #: ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7061
22758 #: ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7087
22759 #: ../src/guestfs-actions.pod:7100 ../src/guestfs-actions.pod:7115
22760 #: ../src/guestfs-actions.pod:7174 ../src/guestfs-actions.pod:7191
22761 #: ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7223
22762 #: ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7253
22763 #: ../src/guestfs-actions.pod:7273 ../src/guestfs-actions.pod:7309
22764 #: ../src/guestfs-actions.pod:7323 ../src/guestfs-actions.pod:7364
22765 #: ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7395
22766 #: ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7465
22767 #: ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7596
22768 #: ../src/guestfs-actions.pod:7610 ../src/guestfs-actions.pod:7665
22769 #: ../src/guestfs-actions.pod:7678 ../src/guestfs-actions.pod:7723
22770 #: ../src/guestfs-actions.pod:7763 ../src/guestfs-actions.pod:7819
22771 #: ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7872
22772 #: ../src/guestfs-actions.pod:7936 ../src/guestfs-actions.pod:7959
22773 #: ../src/guestfs-actions.pod:7988
22774 msgid "This function returns 0 on success or -1 on error."
22778 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
22779 #: ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:2096
22780 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2319
22781 #: ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:3796
22782 #: ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:6360
22783 #: ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6626
22784 #: ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7242
22785 #: ../src/guestfs-actions.pod:7765
22786 msgid "(Added in 0.3)"
22790 #: ../src/guestfs-actions.pod:41
22791 msgid "guestfs_add_domain"
22795 #: ../src/guestfs-actions.pod:43
22799 " guestfs_add_domain (guestfs_h *g,\n"
22800 " const char *dom,\n"
22806 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
22807 #: ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:1161
22808 #: ../src/guestfs-actions.pod:1213 ../src/guestfs-actions.pod:2979
22809 #: ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5104
22810 #: ../src/guestfs-actions.pod:5321
22812 "You may supply a list of optional arguments to this call. Use zero or more "
22813 "of the following pairs of parameters, and terminate the list with C<-1> on "
22814 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
22818 #: ../src/guestfs-actions.pod:53
22821 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
22822 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
22823 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
22824 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
22825 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
22830 #: ../src/guestfs-actions.pod:59
22832 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
22833 "It works by connecting to libvirt, requesting the domain and domain XML from "
22834 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
22839 #: ../src/guestfs-actions.pod:94
22841 "The other optional parameters are passed directly through to "
22842 "C<guestfs_add_drive_opts>."
22846 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
22847 #: ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698
22848 #: ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747
22849 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1496
22850 #: ../src/guestfs-actions.pod:1852 ../src/guestfs-actions.pod:2055
22851 #: ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2217
22852 #: ../src/guestfs-actions.pod:2269 ../src/guestfs-actions.pod:2283
22853 #: ../src/guestfs-actions.pod:2306 ../src/guestfs-actions.pod:2621
22854 #: ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3115
22855 #: ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5500
22856 #: ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5938
22857 #: ../src/guestfs-actions.pod:7350 ../src/guestfs-actions.pod:7776
22858 #: ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7802
22859 msgid "On error this function returns -1."
22863 #: ../src/guestfs-actions.pod:99
22864 msgid "(Added in 1.7.4)"
22868 #: ../src/guestfs-actions.pod:101
22869 msgid "guestfs_add_domain_va"
22873 #: ../src/guestfs-actions.pod:103
22877 " guestfs_add_domain_va (guestfs_h *g,\n"
22878 " const char *dom,\n"
22879 " va_list args);\n"
22884 #: ../src/guestfs-actions.pod:108
22885 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
22889 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
22890 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
22891 #: ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887
22892 #: ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1202
22893 #: ../src/guestfs-actions.pod:1248 ../src/guestfs-actions.pod:1261
22894 #: ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3075
22895 #: ../src/guestfs-actions.pod:4860 ../src/guestfs-actions.pod:4872
22896 #: ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:5144
22897 #: ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5381
22898 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
22902 #: ../src/guestfs-actions.pod:112
22903 msgid "guestfs_add_domain_argv"
22907 #: ../src/guestfs-actions.pod:114
22911 " guestfs_add_domain_argv (guestfs_h *g,\n"
22912 " const char *dom,\n"
22913 " const struct guestfs_add_domain_argv *optargs);\n"
22918 #: ../src/guestfs-actions.pod:119
22919 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
22923 #: ../src/guestfs-actions.pod:123
22924 msgid "guestfs_add_drive"
22928 #: ../src/guestfs-actions.pod:125
22932 " guestfs_add_drive (guestfs_h *g,\n"
22933 " const char *filename);\n"
22938 #: ../src/guestfs-actions.pod:129
22940 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
22941 "optional parameters, so the disk is added writable, with the format being "
22942 "detected automatically."
22946 #: ../src/guestfs-actions.pod:133
22948 "Automatic detection of the format opens you up to a potential security hole "
22949 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
22950 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
22951 "you should think about replacing calls to this function with calls to "
22952 "C<guestfs_add_drive_opts>, and specifying the format."
22956 #: ../src/guestfs-actions.pod:144
22957 msgid "guestfs_add_drive_opts"
22961 #: ../src/guestfs-actions.pod:146
22965 " guestfs_add_drive_opts (guestfs_h *g,\n"
22966 " const char *filename,\n"
22972 #: ../src/guestfs-actions.pod:156
22975 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
22976 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
22977 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
22982 #: ../src/guestfs-actions.pod:185
22984 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
22985 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
22986 "Possible formats include C<raw> and C<qcow2>."
22990 #: ../src/guestfs-actions.pod:196
22992 "This rarely-used option lets you emulate the behaviour of the deprecated "
22993 "C<guestfs_add_drive_with_if> call (q.v.)"
22997 #: ../src/guestfs-actions.pod:203
22998 msgid "(Added in 1.5.23)"
23002 #: ../src/guestfs-actions.pod:205
23003 msgid "guestfs_add_drive_opts_va"
23007 #: ../src/guestfs-actions.pod:207
23011 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23012 " const char *filename,\n"
23013 " va_list args);\n"
23018 #: ../src/guestfs-actions.pod:212
23019 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23023 #: ../src/guestfs-actions.pod:216
23024 msgid "guestfs_add_drive_opts_argv"
23028 #: ../src/guestfs-actions.pod:218
23032 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23033 " const char *filename,\n"
23034 " const struct guestfs_add_drive_opts_argv *optargs);\n"
23039 #: ../src/guestfs-actions.pod:223
23040 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23044 #: ../src/guestfs-actions.pod:227
23045 msgid "guestfs_add_drive_ro"
23049 #: ../src/guestfs-actions.pod:229
23053 " guestfs_add_drive_ro (guestfs_h *g,\n"
23054 " const char *filename);\n"
23059 #: ../src/guestfs-actions.pod:233
23061 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23062 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23063 "disk is added read-only, with the format being detected automatically."
23067 #: ../src/guestfs-actions.pod:240
23068 msgid "(Added in 1.0.38)"
23072 #: ../src/guestfs-actions.pod:242
23073 msgid "guestfs_add_drive_ro_with_if"
23077 #: ../src/guestfs-actions.pod:244
23081 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23082 " const char *filename,\n"
23083 " const char *iface);\n"
23088 #: ../src/guestfs-actions.pod:256
23090 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23091 "QEMU interface emulation to use at run time."
23095 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
23096 #: ../src/guestfs-actions.pod:2580
23097 msgid "(Added in 1.0.84)"
23101 #: ../src/guestfs-actions.pod:263
23102 msgid "guestfs_add_drive_with_if"
23106 #: ../src/guestfs-actions.pod:265
23110 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23111 " const char *filename,\n"
23112 " const char *iface);\n"
23117 #: ../src/guestfs-actions.pod:277
23119 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23120 "QEMU interface emulation to use at run time."
23124 #: ../src/guestfs-actions.pod:284
23125 msgid "guestfs_aug_clear"
23129 #: ../src/guestfs-actions.pod:286
23133 " guestfs_aug_clear (guestfs_h *g,\n"
23134 " const char *augpath);\n"
23139 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2308
23140 msgid "(Added in 1.3.4)"
23144 #: ../src/guestfs-actions.pod:297
23145 msgid "guestfs_aug_close"
23149 #: ../src/guestfs-actions.pod:299
23153 " guestfs_aug_close (guestfs_h *g);\n"
23158 #: ../src/guestfs-actions.pod:302
23160 "Close the current Augeas handle and free up any resources used by it. After "
23161 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23162 "any other Augeas functions."
23166 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
23167 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
23168 #: ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449
23169 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494
23170 #: ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522
23171 #: ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554
23172 #: ../src/guestfs-actions.pod:5989
23173 msgid "(Added in 0.7)"
23177 #: ../src/guestfs-actions.pod:311
23178 msgid "guestfs_aug_defnode"
23182 #: ../src/guestfs-actions.pod:313
23185 " struct guestfs_int_bool *\n"
23186 " guestfs_aug_defnode (guestfs_h *g,\n"
23187 " const char *name,\n"
23188 " const char *expr,\n"
23189 " const char *val);\n"
23194 #: ../src/guestfs-actions.pod:322
23196 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23197 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23198 "containing that single node."
23202 #: ../src/guestfs-actions.pod:330
23204 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23205 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23209 #: ../src/guestfs-actions.pod:336
23210 msgid "guestfs_aug_defvar"
23214 #: ../src/guestfs-actions.pod:338
23218 " guestfs_aug_defvar (guestfs_h *g,\n"
23219 " const char *name,\n"
23220 " const char *expr);\n"
23225 #: ../src/guestfs-actions.pod:354
23226 msgid "guestfs_aug_get"
23230 #: ../src/guestfs-actions.pod:356
23234 " guestfs_aug_get (guestfs_h *g,\n"
23235 " const char *augpath);\n"
23240 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927
23241 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005
23242 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124
23243 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1382
23244 #: ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1535
23245 #: ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1835
23246 #: ../src/guestfs-actions.pod:1998 ../src/guestfs-actions.pod:2015
23247 #: ../src/guestfs-actions.pod:2082 ../src/guestfs-actions.pod:2125
23248 #: ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:2331
23249 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2749
23250 #: ../src/guestfs-actions.pod:2843 ../src/guestfs-actions.pod:2947
23251 #: ../src/guestfs-actions.pod:2966 ../src/guestfs-actions.pod:3180
23252 #: ../src/guestfs-actions.pod:3208 ../src/guestfs-actions.pod:3229
23253 #: ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3322
23254 #: ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3362
23255 #: ../src/guestfs-actions.pod:3989 ../src/guestfs-actions.pod:4342
23256 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4622
23257 #: ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:5717
23258 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:6065
23259 #: ../src/guestfs-actions.pod:6114 ../src/guestfs-actions.pod:6786
23260 #: ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6826
23261 #: ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:7524
23262 #: ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7561
23263 #: ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:8052
23265 "This function returns a string, or NULL on error. I<The caller must free "
23266 "the returned string after use>."
23270 #: ../src/guestfs-actions.pod:368
23271 msgid "guestfs_aug_init"
23275 #: ../src/guestfs-actions.pod:370
23279 " guestfs_aug_init (guestfs_h *g,\n"
23280 " const char *root,\n"
23286 #: ../src/guestfs-actions.pod:379
23287 msgid "You must call this before using any other C<guestfs_aug_*> commands."
23291 #: ../src/guestfs-actions.pod:404
23293 "This option is only useful when debugging Augeas lenses. Use of this option "
23294 "may require additional memory for the libguestfs appliance. You may need to "
23295 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
23296 "C<guestfs_set_memsize>."
23300 #: ../src/guestfs-actions.pod:419
23301 msgid "Do not load the tree in C<guestfs_aug_init>."
23305 #: ../src/guestfs-actions.pod:423
23306 msgid "To close the handle, you can call C<guestfs_aug_close>."
23310 #: ../src/guestfs-actions.pod:431
23311 msgid "guestfs_aug_insert"
23315 #: ../src/guestfs-actions.pod:433
23319 " guestfs_aug_insert (guestfs_h *g,\n"
23320 " const char *augpath,\n"
23321 " const char *label,\n"
23327 #: ../src/guestfs-actions.pod:451
23328 msgid "guestfs_aug_load"
23332 #: ../src/guestfs-actions.pod:453
23336 " guestfs_aug_load (guestfs_h *g);\n"
23341 #: ../src/guestfs-actions.pod:465
23342 msgid "guestfs_aug_ls"
23346 #: ../src/guestfs-actions.pod:467
23350 " guestfs_aug_ls (guestfs_h *g,\n"
23351 " const char *augpath);\n"
23356 #: ../src/guestfs-actions.pod:471
23358 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
23359 "sorting the resulting nodes into alphabetical order."
23363 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490
23364 #: ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143
23365 #: ../src/guestfs-actions.pod:1550 ../src/guestfs-actions.pod:1569
23366 #: ../src/guestfs-actions.pod:1672 ../src/guestfs-actions.pod:1691
23367 #: ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2403
23368 #: ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2438
23369 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2527
23370 #: ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2647
23371 #: ../src/guestfs-actions.pod:2908 ../src/guestfs-actions.pod:3282
23372 #: ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3872
23373 #: ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3909
23374 #: ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4076
23375 #: ../src/guestfs-actions.pod:4484 ../src/guestfs-actions.pod:5241
23376 #: ../src/guestfs-actions.pod:5859 ../src/guestfs-actions.pod:5985
23377 #: ../src/guestfs-actions.pod:6099 ../src/guestfs-actions.pod:6866
23378 #: ../src/guestfs-actions.pod:6927 ../src/guestfs-actions.pod:6982
23379 #: ../src/guestfs-actions.pod:7128 ../src/guestfs-actions.pod:7152
23380 #: ../src/guestfs-actions.pod:7628 ../src/guestfs-actions.pod:7648
23381 #: ../src/guestfs-actions.pod:7695 ../src/guestfs-actions.pod:7889
23382 #: ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:8002
23383 #: ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8067
23384 #: ../src/guestfs-actions.pod:8086
23386 "This function returns a NULL-terminated array of strings (like L<environ(3)"
23387 ">), or NULL if there was an error. I<The caller must free the strings and "
23388 "the array after use>."
23392 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068
23393 #: ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1607
23394 #: ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3667
23395 #: ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4375
23396 #: ../src/guestfs-actions.pod:4562 ../src/guestfs-actions.pod:4595
23397 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:5245
23398 #: ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:6197
23399 #: ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6223
23400 #: ../src/guestfs-actions.pod:6707 ../src/guestfs-actions.pod:7366
23401 #: ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7612
23402 #: ../src/guestfs-actions.pod:7877
23403 msgid "(Added in 0.8)"
23407 #: ../src/guestfs-actions.pod:480
23408 msgid "guestfs_aug_match"
23412 #: ../src/guestfs-actions.pod:482
23416 " guestfs_aug_match (guestfs_h *g,\n"
23417 " const char *augpath);\n"
23422 #: ../src/guestfs-actions.pod:496
23423 msgid "guestfs_aug_mv"
23427 #: ../src/guestfs-actions.pod:498
23431 " guestfs_aug_mv (guestfs_h *g,\n"
23432 " const char *src,\n"
23433 " const char *dest);\n"
23438 #: ../src/guestfs-actions.pod:510
23439 msgid "guestfs_aug_rm"
23443 #: ../src/guestfs-actions.pod:512
23447 " guestfs_aug_rm (guestfs_h *g,\n"
23448 " const char *augpath);\n"
23453 #: ../src/guestfs-actions.pod:524
23454 msgid "guestfs_aug_save"
23458 #: ../src/guestfs-actions.pod:526
23462 " guestfs_aug_save (guestfs_h *g);\n"
23467 #: ../src/guestfs-actions.pod:531
23469 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
23474 #: ../src/guestfs-actions.pod:538
23475 msgid "guestfs_aug_set"
23479 #: ../src/guestfs-actions.pod:540
23483 " guestfs_aug_set (guestfs_h *g,\n"
23484 " const char *augpath,\n"
23485 " const char *val);\n"
23490 #: ../src/guestfs-actions.pod:547
23492 "In the Augeas API, it is possible to clear a node by setting the value to "
23493 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
23494 "this call. Instead you must use the C<guestfs_aug_clear> call."
23498 #: ../src/guestfs-actions.pod:556
23499 msgid "guestfs_available"
23503 #: ../src/guestfs-actions.pod:558
23507 " guestfs_available (guestfs_h *g,\n"
23508 " char *const *groups);\n"
23513 #: ../src/guestfs-actions.pod:566
23515 "The libguestfs groups, and the functions that those groups correspond to, "
23516 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
23517 "runtime by calling C<guestfs_available_all_groups>."
23521 #: ../src/guestfs-actions.pod:590
23522 msgid "You must call C<guestfs_launch> before calling this function."
23526 #: ../src/guestfs-actions.pod:612
23528 "This call was added in version C<1.0.80>. In previous versions of "
23529 "libguestfs all you could do would be to speculatively execute a command to "
23530 "find out if the daemon implemented it. See also C<guestfs_version>."
23534 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1352
23535 msgid "(Added in 1.0.80)"
23539 #: ../src/guestfs-actions.pod:623
23540 msgid "guestfs_available_all_groups"
23544 #: ../src/guestfs-actions.pod:625
23548 " guestfs_available_all_groups (guestfs_h *g);\n"
23553 #: ../src/guestfs-actions.pod:628
23555 "This command returns a list of all optional groups that this daemon knows "
23556 "about. Note this returns both supported and unsupported groups. To find "
23557 "out which ones the daemon can actually support you have to call "
23558 "C<guestfs_available> on each member of the returned list."
23562 #: ../src/guestfs-actions.pod:634
23563 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
23567 #: ../src/guestfs-actions.pod:640
23568 msgid "(Added in 1.3.15)"
23572 #: ../src/guestfs-actions.pod:642
23573 msgid "guestfs_base64_in"
23577 #: ../src/guestfs-actions.pod:644
23581 " guestfs_base64_in (guestfs_h *g,\n"
23582 " const char *base64file,\n"
23583 " const char *filename);\n"
23588 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
23589 msgid "(Added in 1.3.5)"
23593 #: ../src/guestfs-actions.pod:656
23594 msgid "guestfs_base64_out"
23598 #: ../src/guestfs-actions.pod:658
23602 " guestfs_base64_out (guestfs_h *g,\n"
23603 " const char *filename,\n"
23604 " const char *base64file);\n"
23609 #: ../src/guestfs-actions.pod:670
23610 msgid "guestfs_blockdev_flushbufs"
23614 #: ../src/guestfs-actions.pod:672
23618 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
23619 " const char *device);\n"
23624 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700
23625 #: ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731
23626 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768
23627 #: ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800
23628 #: ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
23629 msgid "(Added in 0.9.3)"
23633 #: ../src/guestfs-actions.pod:685
23634 msgid "guestfs_blockdev_getbsz"
23638 #: ../src/guestfs-actions.pod:687
23642 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
23643 " const char *device);\n"
23648 #: ../src/guestfs-actions.pod:702
23649 msgid "guestfs_blockdev_getro"
23653 #: ../src/guestfs-actions.pod:704
23657 " guestfs_blockdev_getro (guestfs_h *g,\n"
23658 " const char *device);\n"
23663 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1590
23664 #: ../src/guestfs-actions.pod:1605 ../src/guestfs-actions.pod:2094
23665 #: ../src/guestfs-actions.pod:2105 ../src/guestfs-actions.pod:2177
23666 #: ../src/guestfs-actions.pod:2203 ../src/guestfs-actions.pod:2243
23667 #: ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:2294
23668 #: ../src/guestfs-actions.pod:2317 ../src/guestfs-actions.pod:3379
23669 #: ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3413
23670 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3589
23671 #: ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:3618
23672 #: ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3649
23673 #: ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:3679
23674 #: ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3706
23675 #: ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:3736
23676 #: ../src/guestfs-actions.pod:3749 ../src/guestfs-actions.pod:3763
23677 #: ../src/guestfs-actions.pod:5482
23678 msgid "This function returns a C truth value on success or -1 on error."
23682 #: ../src/guestfs-actions.pod:717
23683 msgid "guestfs_blockdev_getsize64"
23687 #: ../src/guestfs-actions.pod:719
23691 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
23692 " const char *device);\n"
23697 #: ../src/guestfs-actions.pod:725
23698 msgid "See also C<guestfs_blockdev_getsz>."
23702 #: ../src/guestfs-actions.pod:733
23703 msgid "guestfs_blockdev_getss"
23707 #: ../src/guestfs-actions.pod:735
23711 " guestfs_blockdev_getss (guestfs_h *g,\n"
23712 " const char *device);\n"
23717 #: ../src/guestfs-actions.pod:742
23719 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
23724 #: ../src/guestfs-actions.pod:751
23725 msgid "guestfs_blockdev_getsz"
23729 #: ../src/guestfs-actions.pod:753
23733 " guestfs_blockdev_getsz (guestfs_h *g,\n"
23734 " const char *device);\n"
23739 #: ../src/guestfs-actions.pod:760
23741 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
23742 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
23746 #: ../src/guestfs-actions.pod:770
23747 msgid "guestfs_blockdev_rereadpt"
23751 #: ../src/guestfs-actions.pod:772
23755 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
23756 " const char *device);\n"
23761 #: ../src/guestfs-actions.pod:784
23762 msgid "guestfs_blockdev_setbsz"
23766 #: ../src/guestfs-actions.pod:786
23770 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
23771 " const char *device,\n"
23772 " int blocksize);\n"
23777 #: ../src/guestfs-actions.pod:802
23778 msgid "guestfs_blockdev_setro"
23782 #: ../src/guestfs-actions.pod:804
23786 " guestfs_blockdev_setro (guestfs_h *g,\n"
23787 " const char *device);\n"
23792 #: ../src/guestfs-actions.pod:816
23793 msgid "guestfs_blockdev_setrw"
23797 #: ../src/guestfs-actions.pod:818
23801 " guestfs_blockdev_setrw (guestfs_h *g,\n"
23802 " const char *device);\n"
23807 #: ../src/guestfs-actions.pod:830
23808 msgid "guestfs_btrfs_filesystem_resize"
23812 #: ../src/guestfs-actions.pod:832
23816 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
23817 " const char *mountpoint,\n"
23823 #: ../src/guestfs-actions.pod:842
23826 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
23831 #: ../src/guestfs-actions.pod:865
23832 msgid "(Added in 1.11.17)"
23836 #: ../src/guestfs-actions.pod:867
23837 msgid "guestfs_btrfs_filesystem_resize_va"
23841 #: ../src/guestfs-actions.pod:869
23845 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
23846 " const char *mountpoint,\n"
23847 " va_list args);\n"
23852 #: ../src/guestfs-actions.pod:874
23853 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
23857 #: ../src/guestfs-actions.pod:878
23858 msgid "guestfs_btrfs_filesystem_resize_argv"
23862 #: ../src/guestfs-actions.pod:880
23866 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
23867 " const char *mountpoint,\n"
23868 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
23873 #: ../src/guestfs-actions.pod:885
23874 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
23878 #: ../src/guestfs-actions.pod:889
23879 msgid "guestfs_case_sensitive_path"
23883 #: ../src/guestfs-actions.pod:891
23887 " guestfs_case_sensitive_path (guestfs_h *g,\n"
23888 " const char *path);\n"
23893 #: ../src/guestfs-actions.pod:917
23895 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
23896 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
23897 "how the directories were originally created under Windows)."
23901 #: ../src/guestfs-actions.pod:925
23902 msgid "See also C<guestfs_realpath>."
23906 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7546
23907 msgid "(Added in 1.0.75)"
23911 #: ../src/guestfs-actions.pod:932
23912 msgid "guestfs_cat"
23916 #: ../src/guestfs-actions.pod:934
23920 " guestfs_cat (guestfs_h *g,\n"
23921 " const char *path);\n"
23926 #: ../src/guestfs-actions.pod:940
23928 "Note that this function cannot correctly handle binary files (specifically, "
23929 "files containing C<\\0> character which is treated as end of string). For "
23930 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
23931 "functions which have a more complex interface."
23935 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3893
23936 #: ../src/guestfs-actions.pod:3975 ../src/guestfs-actions.pod:3992
23937 #: ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4488
23938 #: ../src/guestfs-actions.pod:4502 ../src/guestfs-actions.pod:5863
23939 #: ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:7699
23940 #: ../src/guestfs-actions.pod:7713
23941 msgid "(Added in 0.4)"
23945 #: ../src/guestfs-actions.pod:953
23946 msgid "guestfs_checksum"
23950 #: ../src/guestfs-actions.pod:955
23954 " guestfs_checksum (guestfs_h *g,\n"
23955 " const char *csumtype,\n"
23956 " const char *path);\n"
23961 #: ../src/guestfs-actions.pod:1001
23962 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
23966 #: ../src/guestfs-actions.pod:1003
23967 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
23971 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1427
23972 #: ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:3591
23973 #: ../src/guestfs-actions.pod:3620 ../src/guestfs-actions.pod:3681
23974 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:7402
23975 msgid "(Added in 1.0.2)"
23979 #: ../src/guestfs-actions.pod:1010
23980 msgid "guestfs_checksum_device"
23984 #: ../src/guestfs-actions.pod:1012
23988 " guestfs_checksum_device (guestfs_h *g,\n"
23989 " const char *csumtype,\n"
23990 " const char *device);\n"
23995 #: ../src/guestfs-actions.pod:1017
23997 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
23998 "device named C<device>. For the types of checksums supported see the "
23999 "C<guestfs_checksum> command."
24003 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5312
24004 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5484
24005 #: ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5684
24006 #: ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7325
24007 #: ../src/guestfs-actions.pod:7725
24008 msgid "(Added in 1.3.2)"
24012 #: ../src/guestfs-actions.pod:1026
24013 msgid "guestfs_checksums_out"
24017 #: ../src/guestfs-actions.pod:1028
24021 " guestfs_checksums_out (guestfs_h *g,\n"
24022 " const char *csumtype,\n"
24023 " const char *directory,\n"
24024 " const char *sumsfile);\n"
24029 #: ../src/guestfs-actions.pod:1048
24030 msgid "(Added in 1.3.7)"
24034 #: ../src/guestfs-actions.pod:1050
24035 msgid "guestfs_chmod"
24039 #: ../src/guestfs-actions.pod:1052
24043 " guestfs_chmod (guestfs_h *g,\n"
24045 " const char *path);\n"
24050 #: ../src/guestfs-actions.pod:1070
24051 msgid "guestfs_chown"
24055 #: ../src/guestfs-actions.pod:1072
24059 " guestfs_chown (guestfs_h *g,\n"
24062 " const char *path);\n"
24067 #: ../src/guestfs-actions.pod:1088
24068 msgid "guestfs_command"
24072 #: ../src/guestfs-actions.pod:1090
24076 " guestfs_command (guestfs_h *g,\n"
24077 " char *const *arguments);\n"
24082 #: ../src/guestfs-actions.pod:1099
24084 "The single parameter is an argv-style list of arguments. The first element "
24085 "is the name of the program to run. Subsequent elements are parameters. The "
24086 "list must be non-empty (ie. must contain a program name). Note that the "
24087 "command runs directly, and is I<not> invoked via the shell (see "
24092 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150
24093 #: ../src/guestfs-actions.pod:1726
24094 msgid "(Added in 0.9.1)"
24098 #: ../src/guestfs-actions.pod:1132
24099 msgid "guestfs_command_lines"
24103 #: ../src/guestfs-actions.pod:1134
24107 " guestfs_command_lines (guestfs_h *g,\n"
24108 " char *const *arguments);\n"
24113 #: ../src/guestfs-actions.pod:1138
24115 "This is the same as C<guestfs_command>, but splits the result into a list of "
24120 #: ../src/guestfs-actions.pod:1141
24121 msgid "See also: C<guestfs_sh_lines>"
24125 #: ../src/guestfs-actions.pod:1152
24126 msgid "guestfs_compress_device_out"
24130 #: ../src/guestfs-actions.pod:1154
24134 " guestfs_compress_device_out (guestfs_h *g,\n"
24135 " const char *ctype,\n"
24136 " const char *device,\n"
24137 " const char *zdevice,\n"
24143 #: ../src/guestfs-actions.pod:1166
24146 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24151 #: ../src/guestfs-actions.pod:1171
24153 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24154 "C<guestfs_compress_out>."
24158 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1235
24159 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:6583
24160 msgid "(Added in 1.13.15)"
24164 #: ../src/guestfs-actions.pod:1178
24165 msgid "guestfs_compress_device_out_va"
24169 #: ../src/guestfs-actions.pod:1180
24173 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24174 " const char *ctype,\n"
24175 " const char *device,\n"
24176 " const char *zdevice,\n"
24177 " va_list args);\n"
24182 #: ../src/guestfs-actions.pod:1187
24183 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24187 #: ../src/guestfs-actions.pod:1191
24188 msgid "guestfs_compress_device_out_argv"
24192 #: ../src/guestfs-actions.pod:1193
24196 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24197 " const char *ctype,\n"
24198 " const char *device,\n"
24199 " const char *zdevice,\n"
24200 " const struct guestfs_compress_device_out_argv *optargs);\n"
24205 #: ../src/guestfs-actions.pod:1200
24206 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24210 #: ../src/guestfs-actions.pod:1204
24211 msgid "guestfs_compress_out"
24215 #: ../src/guestfs-actions.pod:1206
24219 " guestfs_compress_out (guestfs_h *g,\n"
24220 " const char *ctype,\n"
24221 " const char *file,\n"
24222 " const char *zfile,\n"
24228 #: ../src/guestfs-actions.pod:1218
24231 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24236 #: ../src/guestfs-actions.pod:1237
24237 msgid "guestfs_compress_out_va"
24241 #: ../src/guestfs-actions.pod:1239
24245 " guestfs_compress_out_va (guestfs_h *g,\n"
24246 " const char *ctype,\n"
24247 " const char *file,\n"
24248 " const char *zfile,\n"
24249 " va_list args);\n"
24254 #: ../src/guestfs-actions.pod:1246
24255 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24259 #: ../src/guestfs-actions.pod:1250
24260 msgid "guestfs_compress_out_argv"
24264 #: ../src/guestfs-actions.pod:1252
24268 " guestfs_compress_out_argv (guestfs_h *g,\n"
24269 " const char *ctype,\n"
24270 " const char *file,\n"
24271 " const char *zfile,\n"
24272 " const struct guestfs_compress_out_argv *optargs);\n"
24277 #: ../src/guestfs-actions.pod:1259
24278 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24282 #: ../src/guestfs-actions.pod:1263
24283 msgid "guestfs_config"
24287 #: ../src/guestfs-actions.pod:1265
24291 " guestfs_config (guestfs_h *g,\n"
24292 " const char *qemuparam,\n"
24293 " const char *qemuvalue);\n"
24298 #: ../src/guestfs-actions.pod:1283
24299 msgid "guestfs_copy_size"
24303 #: ../src/guestfs-actions.pod:1285
24307 " guestfs_copy_size (guestfs_h *g,\n"
24308 " const char *src,\n"
24309 " const char *dest,\n"
24310 " int64_t size);\n"
24315 #: ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1422
24316 #: ../src/guestfs-actions.pod:1453 ../src/guestfs-actions.pod:1498
24317 #: ../src/guestfs-actions.pod:1875 ../src/guestfs-actions.pod:1897
24318 #: ../src/guestfs-actions.pod:3791 ../src/guestfs-actions.pod:7397
24319 #: ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7938
24320 #: ../src/guestfs-actions.pod:7961
24322 "This long-running command can generate progress notification messages so "
24323 "that the caller can display a progress bar or indicator. To receive these "
24324 "messages, the caller must register a progress event callback. See L<guestfs"
24325 "(3)/GUESTFS_EVENT_PROGRESS>."
24329 #: ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:4515
24330 #: ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:7632
24331 #: ../src/guestfs-actions.pod:7652 ../src/guestfs-actions.pod:7738
24332 msgid "(Added in 1.0.87)"
24336 #: ../src/guestfs-actions.pod:1306
24341 #: ../src/guestfs-actions.pod:1308
24345 " guestfs_cp (guestfs_h *g,\n"
24346 " const char *src,\n"
24347 " const char *dest);\n"
24352 #: ../src/guestfs-actions.pod:1318 ../src/guestfs-actions.pod:1332
24353 #: ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1478
24354 #: ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:5259
24355 #: ../src/guestfs-actions.pod:5734
24356 msgid "(Added in 1.0.18)"
24360 #: ../src/guestfs-actions.pod:1320
24361 msgid "guestfs_cp_a"
24365 #: ../src/guestfs-actions.pod:1322
24369 " guestfs_cp_a (guestfs_h *g,\n"
24370 " const char *src,\n"
24371 " const char *dest);\n"
24376 #: ../src/guestfs-actions.pod:1334
24381 #: ../src/guestfs-actions.pod:1336
24385 " guestfs_dd (guestfs_h *g,\n"
24386 " const char *src,\n"
24387 " const char *dest);\n"
24392 #: ../src/guestfs-actions.pod:1346
24394 "If the destination is a device, it must be as large or larger than the "
24395 "source file or device, otherwise the copy will fail. This command cannot do "
24396 "partial copies (see C<guestfs_copy_size>)."
24400 #: ../src/guestfs-actions.pod:1354
24405 #: ../src/guestfs-actions.pod:1356
24409 " guestfs_df (guestfs_h *g);\n"
24414 #: ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378
24416 "This command is mostly useful for interactive sessions. It is I<not> "
24417 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
24422 #: ../src/guestfs-actions.pod:1368 ../src/guestfs-actions.pod:1385
24423 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:2510
24424 #: ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2602
24425 #: ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:5159
24426 #: ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7159
24427 #: ../src/guestfs-actions.pod:7778 ../src/guestfs-actions.pod:7791
24428 #: ../src/guestfs-actions.pod:7804
24429 msgid "(Added in 1.0.54)"
24433 #: ../src/guestfs-actions.pod:1370
24434 msgid "guestfs_df_h"
24438 #: ../src/guestfs-actions.pod:1372
24442 " guestfs_df_h (guestfs_h *g);\n"
24447 #: ../src/guestfs-actions.pod:1387
24448 msgid "guestfs_dmesg"
24452 #: ../src/guestfs-actions.pod:1389
24456 " guestfs_dmesg (guestfs_h *g);\n"
24461 #: ../src/guestfs-actions.pod:1396
24463 "Another way to get the same information is to enable verbose messages with "
24464 "C<guestfs_set_verbose> or by setting the environment variable "
24465 "C<LIBGUESTFS_DEBUG=1> before running the program."
24469 #: ../src/guestfs-actions.pod:1406
24470 msgid "guestfs_download"
24474 #: ../src/guestfs-actions.pod:1408
24478 " guestfs_download (guestfs_h *g,\n"
24479 " const char *remotefilename,\n"
24480 " const char *filename);\n"
24485 #: ../src/guestfs-actions.pod:1418
24486 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
24490 #: ../src/guestfs-actions.pod:1429
24491 msgid "guestfs_download_offset"
24495 #: ../src/guestfs-actions.pod:1431
24499 " guestfs_download_offset (guestfs_h *g,\n"
24500 " const char *remotefilename,\n"
24501 " const char *filename,\n"
24502 " int64_t offset,\n"
24503 " int64_t size);\n"
24508 #: ../src/guestfs-actions.pod:1444
24510 "Note that there is no limit on the amount of data that can be downloaded "
24511 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
24512 "full amount unless an error occurs."
24516 #: ../src/guestfs-actions.pod:1449
24517 msgid "See also C<guestfs_download>, C<guestfs_pread>."
24521 #: ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:7436
24522 msgid "(Added in 1.5.17)"
24526 #: ../src/guestfs-actions.pod:1460
24527 msgid "guestfs_drop_caches"
24531 #: ../src/guestfs-actions.pod:1462
24535 " guestfs_drop_caches (guestfs_h *g,\n"
24536 " int whattodrop);\n"
24541 #: ../src/guestfs-actions.pod:1480
24546 #: ../src/guestfs-actions.pod:1482
24550 " guestfs_du (guestfs_h *g,\n"
24551 " const char *path);\n"
24556 #: ../src/guestfs-actions.pod:1505
24557 msgid "guestfs_e2fsck_f"
24561 #: ../src/guestfs-actions.pod:1507
24565 " guestfs_e2fsck_f (guestfs_h *g,\n"
24566 " const char *device);\n"
24571 #: ../src/guestfs-actions.pod:1515
24573 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
24574 "Normally you should use C<guestfs_fsck>."
24578 #: ../src/guestfs-actions.pod:1520
24579 msgid "(Added in 1.0.29)"
24583 #: ../src/guestfs-actions.pod:1522
24584 msgid "guestfs_echo_daemon"
24588 #: ../src/guestfs-actions.pod:1524
24592 " guestfs_echo_daemon (guestfs_h *g,\n"
24593 " char *const *words);\n"
24598 #: ../src/guestfs-actions.pod:1533
24599 msgid "See also C<guestfs_ping_daemon>."
24603 #: ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:2296
24604 #: ../src/guestfs-actions.pod:6607
24605 msgid "(Added in 1.0.69)"
24609 #: ../src/guestfs-actions.pod:1540
24610 msgid "guestfs_egrep"
24614 #: ../src/guestfs-actions.pod:1542
24618 " guestfs_egrep (guestfs_h *g,\n"
24619 " const char *regex,\n"
24620 " const char *path);\n"
24625 #: ../src/guestfs-actions.pod:1557 ../src/guestfs-actions.pod:1576
24626 #: ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1679
24627 #: ../src/guestfs-actions.pod:1698 ../src/guestfs-actions.pod:2426
24628 #: ../src/guestfs-actions.pod:2445 ../src/guestfs-actions.pod:2623
24629 #: ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2651
24630 #: ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2719
24631 #: ../src/guestfs-actions.pod:2732 ../src/guestfs-actions.pod:4005
24632 #: ../src/guestfs-actions.pod:4019 ../src/guestfs-actions.pod:4032
24633 #: ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:5047
24634 #: ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6117
24635 #: ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7015
24636 #: ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041
24637 #: ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7076
24638 #: ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102
24639 #: ../src/guestfs-actions.pod:7896 ../src/guestfs-actions.pod:7915
24640 #: ../src/guestfs-actions.pod:8009 ../src/guestfs-actions.pod:8028
24641 #: ../src/guestfs-actions.pod:8074 ../src/guestfs-actions.pod:8093
24642 msgid "(Added in 1.0.66)"
24646 #: ../src/guestfs-actions.pod:1559
24647 msgid "guestfs_egrepi"
24651 #: ../src/guestfs-actions.pod:1561
24655 " guestfs_egrepi (guestfs_h *g,\n"
24656 " const char *regex,\n"
24657 " const char *path);\n"
24662 #: ../src/guestfs-actions.pod:1578
24663 msgid "guestfs_equal"
24667 #: ../src/guestfs-actions.pod:1580
24671 " guestfs_equal (guestfs_h *g,\n"
24672 " const char *file1,\n"
24673 " const char *file2);\n"
24678 #: ../src/guestfs-actions.pod:1594
24679 msgid "guestfs_exists"
24683 #: ../src/guestfs-actions.pod:1596
24687 " guestfs_exists (guestfs_h *g,\n"
24688 " const char *path);\n"
24693 #: ../src/guestfs-actions.pod:1603
24694 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
24698 #: ../src/guestfs-actions.pod:1609
24699 msgid "guestfs_fallocate"
24703 #: ../src/guestfs-actions.pod:1611
24707 " guestfs_fallocate (guestfs_h *g,\n"
24708 " const char *path,\n"
24714 #: ../src/guestfs-actions.pod:1616
24716 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
24721 #: ../src/guestfs-actions.pod:1635
24722 msgid "guestfs_fallocate64"
24726 #: ../src/guestfs-actions.pod:1637
24730 " guestfs_fallocate64 (guestfs_h *g,\n"
24731 " const char *path,\n"
24737 #: ../src/guestfs-actions.pod:1646
24739 "Note that this call allocates disk blocks for the file. To create a sparse "
24740 "file use C<guestfs_truncate_size> instead."
24744 #: ../src/guestfs-actions.pod:1649
24746 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
24747 "oversight it only allowed 30 bit lengths to be specified, effectively "
24748 "limiting the maximum size of files created through that call to 1GB."
24752 #: ../src/guestfs-actions.pod:1660
24753 msgid "(Added in 1.3.17)"
24757 #: ../src/guestfs-actions.pod:1662
24758 msgid "guestfs_fgrep"
24762 #: ../src/guestfs-actions.pod:1664
24766 " guestfs_fgrep (guestfs_h *g,\n"
24767 " const char *pattern,\n"
24768 " const char *path);\n"
24773 #: ../src/guestfs-actions.pod:1681
24774 msgid "guestfs_fgrepi"
24778 #: ../src/guestfs-actions.pod:1683
24782 " guestfs_fgrepi (guestfs_h *g,\n"
24783 " const char *pattern,\n"
24784 " const char *path);\n"
24789 #: ../src/guestfs-actions.pod:1700
24790 msgid "guestfs_file"
24794 #: ../src/guestfs-actions.pod:1702
24798 " guestfs_file (guestfs_h *g,\n"
24799 " const char *path);\n"
24804 #: ../src/guestfs-actions.pod:1720
24806 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
24807 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
24811 #: ../src/guestfs-actions.pod:1728
24812 msgid "guestfs_file_architecture"
24816 #: ../src/guestfs-actions.pod:1730
24820 " guestfs_file_architecture (guestfs_h *g,\n"
24821 " const char *filename);\n"
24826 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2001
24827 #: ../src/guestfs-actions.pod:2018 ../src/guestfs-actions.pod:2752
24828 #: ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2912
24829 #: ../src/guestfs-actions.pod:3099 ../src/guestfs-actions.pod:3117
24830 #: ../src/guestfs-actions.pod:3157 ../src/guestfs-actions.pod:3232
24831 #: ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:3562
24832 #: ../src/guestfs-actions.pod:3694
24833 msgid "(Added in 1.5.3)"
24837 #: ../src/guestfs-actions.pod:1840
24838 msgid "guestfs_filesize"
24842 #: ../src/guestfs-actions.pod:1842
24846 " guestfs_filesize (guestfs_h *g,\n"
24847 " const char *file);\n"
24852 #: ../src/guestfs-actions.pod:1848
24854 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
24855 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
24856 "devices, use C<guestfs_blockdev_getsize64>."
24860 #: ../src/guestfs-actions.pod:1854
24861 msgid "(Added in 1.0.82)"
24865 #: ../src/guestfs-actions.pod:1856
24866 msgid "guestfs_fill"
24870 #: ../src/guestfs-actions.pod:1858
24874 " guestfs_fill (guestfs_h *g,\n"
24877 " const char *path);\n"
24882 #: ../src/guestfs-actions.pod:1868
24884 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
24885 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
24886 "bytes use C<guestfs_fill_pattern>."
24890 #: ../src/guestfs-actions.pod:1880
24891 msgid "(Added in 1.0.79)"
24895 #: ../src/guestfs-actions.pod:1882
24896 msgid "guestfs_fill_pattern"
24900 #: ../src/guestfs-actions.pod:1884
24904 " guestfs_fill_pattern (guestfs_h *g,\n"
24905 " const char *pattern,\n"
24907 " const char *path);\n"
24912 #: ../src/guestfs-actions.pod:1890
24914 "This function is like C<guestfs_fill> except that it creates a new file of "
24915 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
24916 "pattern is truncated if necessary to ensure the length of the file is "
24917 "exactly C<len> bytes."
24921 #: ../src/guestfs-actions.pod:1902
24922 msgid "(Added in 1.3.12)"
24926 #: ../src/guestfs-actions.pod:1904
24927 msgid "guestfs_find"
24931 #: ../src/guestfs-actions.pod:1906
24935 " guestfs_find (guestfs_h *g,\n"
24936 " const char *directory);\n"
24941 #: ../src/guestfs-actions.pod:1922
24943 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
24947 #: ../src/guestfs-actions.pod:1935
24948 msgid "See also C<guestfs_find0>."
24952 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4452
24953 #: ../src/guestfs-actions.pod:6152
24954 msgid "(Added in 1.0.27)"
24958 #: ../src/guestfs-actions.pod:1946
24959 msgid "guestfs_find0"
24963 #: ../src/guestfs-actions.pod:1948
24967 " guestfs_find0 (guestfs_h *g,\n"
24968 " const char *directory,\n"
24969 " const char *files);\n"
24974 #: ../src/guestfs-actions.pod:1957
24976 "This command works the same way as C<guestfs_find> with the following "
24981 #: ../src/guestfs-actions.pod:1984
24982 msgid "(Added in 1.0.74)"
24986 #: ../src/guestfs-actions.pod:1986
24987 msgid "guestfs_findfs_label"
24991 #: ../src/guestfs-actions.pod:1988
24995 " guestfs_findfs_label (guestfs_h *g,\n"
24996 " const char *label);\n"
25001 #: ../src/guestfs-actions.pod:1996
25002 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25006 #: ../src/guestfs-actions.pod:2003
25007 msgid "guestfs_findfs_uuid"
25011 #: ../src/guestfs-actions.pod:2005
25015 " guestfs_findfs_uuid (guestfs_h *g,\n"
25016 " const char *uuid);\n"
25021 #: ../src/guestfs-actions.pod:2013
25022 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25026 #: ../src/guestfs-actions.pod:2020
25027 msgid "guestfs_fsck"
25031 #: ../src/guestfs-actions.pod:2022
25035 " guestfs_fsck (guestfs_h *g,\n"
25036 " const char *fstype,\n"
25037 " const char *device);\n"
25042 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:7943
25043 msgid "(Added in 1.0.16)"
25047 #: ../src/guestfs-actions.pod:2059
25048 msgid "guestfs_get_append"
25052 #: ../src/guestfs-actions.pod:2061
25056 " guestfs_get_append (guestfs_h *g);\n"
25061 #: ../src/guestfs-actions.pod:2069
25063 "This function returns a string which may be NULL. There is no way to return "
25064 "an error from this function. The string is owned by the guest handle and "
25065 "must I<not> be freed."
25069 #: ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5830
25070 #: ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6770
25071 #: ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6805
25072 #: ../src/guestfs-actions.pod:6829 ../src/guestfs-actions.pod:7583
25073 #: ../src/guestfs-actions.pod:7598 ../src/guestfs-actions.pod:7990
25074 msgid "(Added in 1.0.26)"
25078 #: ../src/guestfs-actions.pod:2075
25079 msgid "guestfs_get_attach_method"
25083 #: ../src/guestfs-actions.pod:2077
25087 " guestfs_get_attach_method (guestfs_h *g);\n"
25092 #: ../src/guestfs-actions.pod:2080
25093 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25097 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:6342
25098 msgid "(Added in 1.9.8)"
25102 #: ../src/guestfs-actions.pod:2087
25103 msgid "guestfs_get_autosync"
25107 #: ../src/guestfs-actions.pod:2089
25111 " guestfs_get_autosync (guestfs_h *g);\n"
25116 #: ../src/guestfs-actions.pod:2098
25117 msgid "guestfs_get_direct"
25121 #: ../src/guestfs-actions.pod:2100
25125 " guestfs_get_direct (guestfs_h *g);\n"
25130 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:6383
25131 msgid "(Added in 1.0.72)"
25135 #: ../src/guestfs-actions.pod:2109
25136 msgid "guestfs_get_e2label"
25140 #: ../src/guestfs-actions.pod:2111
25144 " guestfs_get_e2label (guestfs_h *g,\n"
25145 " const char *device);\n"
25150 #: ../src/guestfs-actions.pod:2115
25152 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25157 #: ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2149
25158 #: ../src/guestfs-actions.pod:6401 ../src/guestfs-actions.pod:6420
25159 msgid "(Added in 1.0.15)"
25163 #: ../src/guestfs-actions.pod:2130
25164 msgid "guestfs_get_e2uuid"
25168 #: ../src/guestfs-actions.pod:2132
25172 " guestfs_get_e2uuid (guestfs_h *g,\n"
25173 " const char *device);\n"
25178 #: ../src/guestfs-actions.pod:2136
25180 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25185 #: ../src/guestfs-actions.pod:2151
25186 msgid "guestfs_get_memsize"
25190 #: ../src/guestfs-actions.pod:2153
25194 " guestfs_get_memsize (guestfs_h *g);\n"
25199 #: ../src/guestfs-actions.pod:2159
25201 "If C<guestfs_set_memsize> was not called on this handle, and if "
25202 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25203 "value for memsize."
25207 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:4743
25208 #: ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:4971
25209 #: ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5002
25210 #: ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5032
25211 #: ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6441
25212 #: ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:7352
25213 msgid "(Added in 1.0.55)"
25217 #: ../src/guestfs-actions.pod:2170
25218 msgid "guestfs_get_network"
25222 #: ../src/guestfs-actions.pod:2172
25226 " guestfs_get_network (guestfs_h *g);\n"
25231 #: ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:6460
25232 msgid "(Added in 1.5.4)"
25236 #: ../src/guestfs-actions.pod:2181
25237 msgid "guestfs_get_path"
25241 #: ../src/guestfs-actions.pod:2183
25245 " guestfs_get_path (guestfs_h *g);\n"
25250 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2231
25252 "This function returns a string, or NULL on error. The string is owned by "
25253 "the guest handle and must I<not> be freed."
25257 #: ../src/guestfs-actions.pod:2196
25258 msgid "guestfs_get_pgroup"
25262 #: ../src/guestfs-actions.pod:2198
25266 " guestfs_get_pgroup (guestfs_h *g);\n"
25271 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6496
25272 #: ../src/guestfs-actions.pod:7844
25273 msgid "(Added in 1.11.18)"
25277 #: ../src/guestfs-actions.pod:2207
25278 msgid "guestfs_get_pid"
25282 #: ../src/guestfs-actions.pod:2209
25286 " guestfs_get_pid (guestfs_h *g);\n"
25291 #: ../src/guestfs-actions.pod:2219
25292 msgid "(Added in 1.0.56)"
25296 #: ../src/guestfs-actions.pod:2221
25297 msgid "guestfs_get_qemu"
25301 #: ../src/guestfs-actions.pod:2223
25305 " guestfs_get_qemu (guestfs_h *g);\n"
25310 #: ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:6524
25311 msgid "(Added in 1.0.6)"
25315 #: ../src/guestfs-actions.pod:2236
25316 msgid "guestfs_get_recovery_proc"
25320 #: ../src/guestfs-actions.pod:2238
25324 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25329 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:3816
25330 #: ../src/guestfs-actions.pod:4147 ../src/guestfs-actions.pod:4550
25331 #: ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:5760
25332 #: ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6548
25333 #: ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7275
25334 #: ../src/guestfs-actions.pod:7467
25335 msgid "(Added in 1.0.77)"
25339 #: ../src/guestfs-actions.pod:2247
25340 msgid "guestfs_get_selinux"
25344 #: ../src/guestfs-actions.pod:2249
25348 " guestfs_get_selinux (guestfs_h *g);\n"
25353 #: ../src/guestfs-actions.pod:2252
25355 "This returns the current setting of the selinux flag which is passed to the "
25356 "appliance at boot time. See C<guestfs_set_selinux>."
25360 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2334
25361 #: ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:6641
25362 msgid "(Added in 1.0.67)"
25366 #: ../src/guestfs-actions.pod:2262
25367 msgid "guestfs_get_smp"
25371 #: ../src/guestfs-actions.pod:2264
25375 " guestfs_get_smp (guestfs_h *g);\n"
25380 #: ../src/guestfs-actions.pod:2273
25381 msgid "guestfs_get_state"
25385 #: ../src/guestfs-actions.pod:2275
25389 " guestfs_get_state (guestfs_h *g);\n"
25394 #: ../src/guestfs-actions.pod:2287
25395 msgid "guestfs_get_trace"
25399 #: ../src/guestfs-actions.pod:2289
25403 " guestfs_get_trace (guestfs_h *g);\n"
25408 #: ../src/guestfs-actions.pod:2298
25409 msgid "guestfs_get_umask"
25413 #: ../src/guestfs-actions.pod:2300
25417 " guestfs_get_umask (guestfs_h *g);\n"
25422 #: ../src/guestfs-actions.pod:2303
25424 "Return the current umask. By default the umask is C<022> unless it has been "
25425 "set by calling C<guestfs_umask>."
25429 #: ../src/guestfs-actions.pod:2310
25430 msgid "guestfs_get_verbose"
25434 #: ../src/guestfs-actions.pod:2312
25438 " guestfs_get_verbose (guestfs_h *g);\n"
25443 #: ../src/guestfs-actions.pod:2321
25444 msgid "guestfs_getcon"
25448 #: ../src/guestfs-actions.pod:2323
25452 " guestfs_getcon (guestfs_h *g);\n"
25457 #: ../src/guestfs-actions.pod:2328
25459 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
25463 #: ../src/guestfs-actions.pod:2336
25464 msgid "guestfs_getxattr"
25468 #: ../src/guestfs-actions.pod:2338
25472 " guestfs_getxattr (guestfs_h *g,\n"
25473 " const char *path,\n"
25474 " const char *name,\n"
25475 " size_t *size_r);\n"
25480 #: ../src/guestfs-actions.pod:2344
25482 "Get a single extended attribute from file C<path> named C<name>. This call "
25483 "follows symlinks. If you want to lookup an extended attribute for the "
25484 "symlink itself, use C<guestfs_lgetxattr>."
25488 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:3830
25490 "Normally it is better to get all extended attributes from a file in one go "
25491 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
25492 "implementations are buggy and do not provide a way to list out attributes. "
25493 "For these filesystems (notably ntfs-3g) you have to know the names of the "
25494 "extended attributes you want in advance and call this function."
25498 #: ../src/guestfs-actions.pod:2358
25499 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
25503 #: ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2573
25504 #: ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3842
25505 #: ../src/guestfs-actions.pod:5753 ../src/guestfs-actions.pod:5779
25506 #: ../src/guestfs-actions.pod:5960
25508 "This function returns a buffer, or NULL on error. The size of the returned "
25509 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
25514 #: ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:3846
25515 msgid "(Added in 1.7.24)"
25519 #: ../src/guestfs-actions.pod:2366
25520 msgid "guestfs_getxattrs"
25524 #: ../src/guestfs-actions.pod:2368
25527 " struct guestfs_xattr_list *\n"
25528 " guestfs_getxattrs (guestfs_h *g,\n"
25529 " const char *path);\n"
25534 #: ../src/guestfs-actions.pod:2378
25535 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
25539 #: ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:3858
25540 #: ../src/guestfs-actions.pod:4546
25542 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
25543 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
25547 #: ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:3862
25548 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4097
25549 #: ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6660
25550 #: ../src/guestfs-actions.pod:8055
25551 msgid "(Added in 1.0.59)"
25555 #: ../src/guestfs-actions.pod:2386
25556 msgid "guestfs_glob_expand"
25560 #: ../src/guestfs-actions.pod:2388
25564 " guestfs_glob_expand (guestfs_h *g,\n"
25565 " const char *pattern);\n"
25570 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6853
25571 #: ../src/guestfs-actions.pod:6870
25572 msgid "(Added in 1.0.50)"
25576 #: ../src/guestfs-actions.pod:2409
25577 msgid "guestfs_grep"
25581 #: ../src/guestfs-actions.pod:2411
25585 " guestfs_grep (guestfs_h *g,\n"
25586 " const char *regex,\n"
25587 " const char *path);\n"
25592 #: ../src/guestfs-actions.pod:2428
25593 msgid "guestfs_grepi"
25597 #: ../src/guestfs-actions.pod:2430
25601 " guestfs_grepi (guestfs_h *g,\n"
25602 " const char *regex,\n"
25603 " const char *path);\n"
25608 #: ../src/guestfs-actions.pod:2447
25609 msgid "guestfs_grub_install"
25613 #: ../src/guestfs-actions.pod:2449
25617 " guestfs_grub_install (guestfs_h *g,\n"
25618 " const char *root,\n"
25619 " const char *device);\n"
25624 #: ../src/guestfs-actions.pod:2492
25625 msgid "(Added in 1.0.17)"
25629 #: ../src/guestfs-actions.pod:2494
25630 msgid "guestfs_head"
25634 #: ../src/guestfs-actions.pod:2496
25638 " guestfs_head (guestfs_h *g,\n"
25639 " const char *path);\n"
25644 #: ../src/guestfs-actions.pod:2512
25645 msgid "guestfs_head_n"
25649 #: ../src/guestfs-actions.pod:2514
25653 " guestfs_head_n (guestfs_h *g,\n"
25655 " const char *path);\n"
25660 #: ../src/guestfs-actions.pod:2536
25661 msgid "guestfs_hexdump"
25665 #: ../src/guestfs-actions.pod:2538
25669 " guestfs_hexdump (guestfs_h *g,\n"
25670 " const char *path);\n"
25675 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:6934
25676 #: ../src/guestfs-actions.pod:6989
25677 msgid "(Added in 1.0.22)"
25681 #: ../src/guestfs-actions.pod:2553
25682 msgid "guestfs_initrd_cat"
25686 #: ../src/guestfs-actions.pod:2555
25690 " guestfs_initrd_cat (guestfs_h *g,\n"
25691 " const char *initrdpath,\n"
25692 " const char *filename,\n"
25693 " size_t *size_r);\n"
25698 #: ../src/guestfs-actions.pod:2571
25699 msgid "See also C<guestfs_initrd_list>."
25703 #: ../src/guestfs-actions.pod:2582
25704 msgid "guestfs_initrd_list"
25708 #: ../src/guestfs-actions.pod:2584
25712 " guestfs_initrd_list (guestfs_h *g,\n"
25713 " const char *path);\n"
25718 #: ../src/guestfs-actions.pod:2604
25719 msgid "guestfs_inotify_add_watch"
25723 #: ../src/guestfs-actions.pod:2606
25727 " guestfs_inotify_add_watch (guestfs_h *g,\n"
25728 " const char *path,\n"
25734 #: ../src/guestfs-actions.pod:2625
25735 msgid "guestfs_inotify_close"
25739 #: ../src/guestfs-actions.pod:2627
25743 " guestfs_inotify_close (guestfs_h *g);\n"
25748 #: ../src/guestfs-actions.pod:2638
25749 msgid "guestfs_inotify_files"
25753 #: ../src/guestfs-actions.pod:2640
25757 " guestfs_inotify_files (guestfs_h *g);\n"
25762 #: ../src/guestfs-actions.pod:2643
25764 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
25765 "returns a list of pathnames of objects that were touched. The returned "
25766 "pathnames are sorted and deduplicated."
25770 #: ../src/guestfs-actions.pod:2653
25771 msgid "guestfs_inotify_init"
25775 #: ../src/guestfs-actions.pod:2655
25779 " guestfs_inotify_init (guestfs_h *g,\n"
25780 " int maxevents);\n"
25785 #: ../src/guestfs-actions.pod:2663
25787 "C<maxevents> is the maximum number of events which will be queued up between "
25788 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
25789 "passed as C<0>, then the kernel (or previously set) default is used. For "
25790 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
25791 "throws away events, but records the fact that it threw them away by setting "
25792 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
25793 "C<guestfs_inotify_read>)."
25797 #: ../src/guestfs-actions.pod:2673
25799 "Before any events are generated, you have to add some watches to the "
25800 "internal watch list. See: C<guestfs_inotify_add_watch>, "
25801 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
25805 #: ../src/guestfs-actions.pod:2679
25807 "Queued up events should be read periodically by calling "
25808 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
25809 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
25810 "often enough then you risk the internal queue overflowing."
25814 #: ../src/guestfs-actions.pod:2686
25816 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
25817 "This also removes any watches automatically."
25821 #: ../src/guestfs-actions.pod:2699
25822 msgid "guestfs_inotify_read"
25826 #: ../src/guestfs-actions.pod:2701
25829 " struct guestfs_inotify_event_list *\n"
25830 " guestfs_inotify_read (guestfs_h *g);\n"
25835 #: ../src/guestfs-actions.pod:2715
25837 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
25838 "there was an error. I<The caller must call "
25839 "C<guestfs_free_inotify_event_list> after use>."
25843 #: ../src/guestfs-actions.pod:2721
25844 msgid "guestfs_inotify_rm_watch"
25848 #: ../src/guestfs-actions.pod:2723
25852 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
25858 #: ../src/guestfs-actions.pod:2727
25860 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
25864 #: ../src/guestfs-actions.pod:2734
25865 msgid "guestfs_inspect_get_arch"
25869 #: ../src/guestfs-actions.pod:2736
25873 " guestfs_inspect_get_arch (guestfs_h *g,\n"
25874 " const char *root);\n"
25879 #: ../src/guestfs-actions.pod:2740
25881 "This returns the architecture of the inspected operating system. The "
25882 "possible return values are listed under C<guestfs_file_architecture>."
25886 #: ../src/guestfs-actions.pod:2754
25887 msgid "guestfs_inspect_get_distro"
25891 #: ../src/guestfs-actions.pod:2756
25895 " guestfs_inspect_get_distro (guestfs_h *g,\n"
25896 " const char *root);\n"
25901 #: ../src/guestfs-actions.pod:2848
25902 msgid "guestfs_inspect_get_drive_mappings"
25906 #: ../src/guestfs-actions.pod:2850
25910 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
25911 " const char *root);\n"
25916 #: ../src/guestfs-actions.pod:2879
25918 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25919 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
25923 #: ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:3151
25924 #: ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5221
25925 #: ../src/guestfs-actions.pod:7291
25927 "This function returns a NULL-terminated array of strings, or NULL if there "
25928 "was an error. The array of strings will always have length C<2n+1>, where "
25929 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
25930 "caller must free the strings and the array after use>."
25934 #: ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:3345
25935 msgid "(Added in 1.9.17)"
25939 #: ../src/guestfs-actions.pod:2891
25940 msgid "guestfs_inspect_get_filesystems"
25944 #: ../src/guestfs-actions.pod:2893
25948 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
25949 " const char *root);\n"
25954 #: ../src/guestfs-actions.pod:2905
25956 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25957 "C<guestfs_inspect_get_mountpoints>."
25961 #: ../src/guestfs-actions.pod:2914
25962 msgid "guestfs_inspect_get_format"
25966 #: ../src/guestfs-actions.pod:2916
25970 " guestfs_inspect_get_format (guestfs_h *g,\n"
25971 " const char *root);\n"
25976 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3381
25977 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3415
25978 #: ../src/guestfs-actions.pod:6171
25979 msgid "(Added in 1.9.4)"
25983 #: ../src/guestfs-actions.pod:2952
25984 msgid "guestfs_inspect_get_hostname"
25988 #: ../src/guestfs-actions.pod:2954
25992 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
25993 " const char *root);\n"
25998 #: ../src/guestfs-actions.pod:2969
25999 msgid "(Added in 1.7.9)"
26003 #: ../src/guestfs-actions.pod:2971
26004 msgid "guestfs_inspect_get_icon"
26008 #: ../src/guestfs-actions.pod:2973
26012 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26013 " const char *root,\n"
26014 " size_t *size_r,\n"
26020 #: ../src/guestfs-actions.pod:2984
26023 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26024 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26029 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3876
26030 #: ../src/guestfs-actions.pod:5120
26031 msgid "(Added in 1.11.12)"
26035 #: ../src/guestfs-actions.pod:3053
26036 msgid "guestfs_inspect_get_icon_va"
26040 #: ../src/guestfs-actions.pod:3055
26044 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26045 " const char *root,\n"
26046 " size_t *size_r,\n"
26047 " va_list args);\n"
26052 #: ../src/guestfs-actions.pod:3061
26053 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26057 #: ../src/guestfs-actions.pod:3065
26058 msgid "guestfs_inspect_get_icon_argv"
26062 #: ../src/guestfs-actions.pod:3067
26066 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26067 " const char *root,\n"
26068 " size_t *size_r,\n"
26069 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
26074 #: ../src/guestfs-actions.pod:3073
26075 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26079 #: ../src/guestfs-actions.pod:3077
26080 msgid "guestfs_inspect_get_major_version"
26084 #: ../src/guestfs-actions.pod:3079
26088 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26089 " const char *root);\n"
26094 #: ../src/guestfs-actions.pod:3101
26095 msgid "guestfs_inspect_get_minor_version"
26099 #: ../src/guestfs-actions.pod:3103
26103 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26104 " const char *root);\n"
26109 #: ../src/guestfs-actions.pod:3112
26111 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26112 "C<guestfs_inspect_get_major_version>."
26116 #: ../src/guestfs-actions.pod:3119
26117 msgid "guestfs_inspect_get_mountpoints"
26121 #: ../src/guestfs-actions.pod:3121
26125 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26126 " const char *root);\n"
26131 #: ../src/guestfs-actions.pod:3142
26133 "For operating systems like Windows which still use drive letters, this call "
26134 "will only return an entry for the first drive \"mounted on\" C</>. For "
26135 "information about the mapping of drive letters to partitions, see "
26136 "C<guestfs_inspect_get_drive_mappings>."
26140 #: ../src/guestfs-actions.pod:3148
26142 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26143 "C<guestfs_inspect_get_filesystems>."
26147 #: ../src/guestfs-actions.pod:3159
26148 msgid "guestfs_inspect_get_package_format"
26152 #: ../src/guestfs-actions.pod:3161
26156 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26157 " const char *root);\n"
26162 #: ../src/guestfs-actions.pod:3165
26164 "This function and C<guestfs_inspect_get_package_management> return the "
26165 "package format and package management tool used by the inspected operating "
26166 "system. For example for Fedora these functions would return C<rpm> (package "
26167 "format) and C<yum> (package management)."
26171 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:3211
26172 msgid "(Added in 1.7.5)"
26176 #: ../src/guestfs-actions.pod:3185
26177 msgid "guestfs_inspect_get_package_management"
26181 #: ../src/guestfs-actions.pod:3187
26185 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26186 " const char *root);\n"
26191 #: ../src/guestfs-actions.pod:3191
26193 "C<guestfs_inspect_get_package_format> and this function return the package "
26194 "format and package management tool used by the inspected operating system. "
26195 "For example for Fedora these functions would return C<rpm> (package format) "
26196 "and C<yum> (package management)."
26200 #: ../src/guestfs-actions.pod:3213
26201 msgid "guestfs_inspect_get_product_name"
26205 #: ../src/guestfs-actions.pod:3215
26209 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26210 " const char *root);\n"
26215 #: ../src/guestfs-actions.pod:3234
26216 msgid "guestfs_inspect_get_product_variant"
26220 #: ../src/guestfs-actions.pod:3236
26224 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26225 " const char *root);\n"
26230 #: ../src/guestfs-actions.pod:3259
26232 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26233 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26237 #: ../src/guestfs-actions.pod:3266
26238 msgid "(Added in 1.9.13)"
26242 #: ../src/guestfs-actions.pod:3268
26243 msgid "guestfs_inspect_get_roots"
26247 #: ../src/guestfs-actions.pod:3270
26251 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26256 #: ../src/guestfs-actions.pod:3273
26258 "This function is a convenient way to get the list of root devices, as "
26259 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26260 "the whole inspection process."
26264 #: ../src/guestfs-actions.pod:3277
26266 "This returns an empty list if either no root devices were found or the "
26267 "caller has not called C<guestfs_inspect_os>."
26271 #: ../src/guestfs-actions.pod:3286
26272 msgid "(Added in 1.7.3)"
26276 #: ../src/guestfs-actions.pod:3288
26277 msgid "guestfs_inspect_get_type"
26281 #: ../src/guestfs-actions.pod:3290
26285 " guestfs_inspect_get_type (guestfs_h *g,\n"
26286 " const char *root);\n"
26291 #: ../src/guestfs-actions.pod:3327
26292 msgid "guestfs_inspect_get_windows_current_control_set"
26296 #: ../src/guestfs-actions.pod:3329
26300 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26301 " const char *root);\n"
26306 #: ../src/guestfs-actions.pod:3347
26307 msgid "guestfs_inspect_get_windows_systemroot"
26311 #: ../src/guestfs-actions.pod:3349
26315 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26316 " const char *root);\n"
26321 #: ../src/guestfs-actions.pod:3365
26322 msgid "(Added in 1.5.25)"
26326 #: ../src/guestfs-actions.pod:3367
26327 msgid "guestfs_inspect_is_live"
26331 #: ../src/guestfs-actions.pod:3369
26335 " guestfs_inspect_is_live (guestfs_h *g,\n"
26336 " const char *root);\n"
26341 #: ../src/guestfs-actions.pod:3373
26343 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26344 "disk), then this returns true if a live image was detected on the disk."
26348 #: ../src/guestfs-actions.pod:3383
26349 msgid "guestfs_inspect_is_multipart"
26353 #: ../src/guestfs-actions.pod:3385
26357 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26358 " const char *root);\n"
26363 #: ../src/guestfs-actions.pod:3389
26365 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26366 "disk), then this returns true if the disk is part of a set."
26370 #: ../src/guestfs-actions.pod:3399
26371 msgid "guestfs_inspect_is_netinst"
26375 #: ../src/guestfs-actions.pod:3401
26379 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
26380 " const char *root);\n"
26385 #: ../src/guestfs-actions.pod:3405
26387 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26388 "disk), then this returns true if the disk is a network installer, ie. not a "
26389 "self-contained install CD but one which is likely to require network access "
26390 "to complete the install."
26394 #: ../src/guestfs-actions.pod:3417
26395 msgid "guestfs_inspect_list_applications"
26399 #: ../src/guestfs-actions.pod:3419
26402 " struct guestfs_application_list *\n"
26403 " guestfs_inspect_list_applications (guestfs_h *g,\n"
26404 " const char *root);\n"
26409 #: ../src/guestfs-actions.pod:3425
26411 "I<Note:> This call works differently from other parts of the inspection "
26412 "API. You have to call C<guestfs_inspect_os>, then "
26413 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
26414 "this. Listing applications is a significantly more difficult operation "
26415 "which requires access to the full filesystem. Also note that unlike the "
26416 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
26417 "the libguestfs handle, this call actually reads parts of the mounted "
26418 "filesystems during the call."
26422 #: ../src/guestfs-actions.pod:3515
26424 "This function returns a C<struct guestfs_application_list *>, or NULL if "
26425 "there was an error. I<The caller must call C<guestfs_free_application_list> "
26430 #: ../src/guestfs-actions.pod:3519
26431 msgid "(Added in 1.7.8)"
26435 #: ../src/guestfs-actions.pod:3521
26436 msgid "guestfs_inspect_os"
26440 #: ../src/guestfs-actions.pod:3523
26444 " guestfs_inspect_os (guestfs_h *g);\n"
26449 #: ../src/guestfs-actions.pod:3539
26451 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
26452 "functions in order to query further information about each operating system, "
26453 "such as the name and version."
26457 #: ../src/guestfs-actions.pod:3544
26459 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
26460 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
26461 "the contents. This should be called with no disks currently mounted. The "
26462 "function may also use Augeas, so any existing Augeas handle will be closed."
26466 #: ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3887
26467 #: ../src/guestfs-actions.pod:3969
26468 msgid "See also C<guestfs_list_filesystems>."
26472 #: ../src/guestfs-actions.pod:3564
26473 msgid "guestfs_is_blockdev"
26477 #: ../src/guestfs-actions.pod:3566
26481 " guestfs_is_blockdev (guestfs_h *g,\n"
26482 " const char *path);\n"
26487 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3602
26488 #: ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3647
26489 #: ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3719
26490 #: ../src/guestfs-actions.pod:3734
26491 msgid "See also C<guestfs_stat>."
26495 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3606
26496 #: ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3723
26497 #: ../src/guestfs-actions.pod:3738
26498 msgid "(Added in 1.5.10)"
26502 #: ../src/guestfs-actions.pod:3579
26503 msgid "guestfs_is_busy"
26507 #: ../src/guestfs-actions.pod:3581
26511 " guestfs_is_busy (guestfs_h *g);\n"
26516 #: ../src/guestfs-actions.pod:3593
26517 msgid "guestfs_is_chardev"
26521 #: ../src/guestfs-actions.pod:3595
26525 " guestfs_is_chardev (guestfs_h *g,\n"
26526 " const char *path);\n"
26531 #: ../src/guestfs-actions.pod:3608
26532 msgid "guestfs_is_config"
26536 #: ../src/guestfs-actions.pod:3610
26540 " guestfs_is_config (guestfs_h *g);\n"
26545 #: ../src/guestfs-actions.pod:3622
26546 msgid "guestfs_is_dir"
26550 #: ../src/guestfs-actions.pod:3624
26554 " guestfs_is_dir (guestfs_h *g,\n"
26555 " const char *path);\n"
26560 #: ../src/guestfs-actions.pod:3638
26561 msgid "guestfs_is_fifo"
26565 #: ../src/guestfs-actions.pod:3640
26569 " guestfs_is_fifo (guestfs_h *g,\n"
26570 " const char *path);\n"
26575 #: ../src/guestfs-actions.pod:3653
26576 msgid "guestfs_is_file"
26580 #: ../src/guestfs-actions.pod:3655
26584 " guestfs_is_file (guestfs_h *g,\n"
26585 " const char *path);\n"
26590 #: ../src/guestfs-actions.pod:3669
26591 msgid "guestfs_is_launching"
26595 #: ../src/guestfs-actions.pod:3671
26599 " guestfs_is_launching (guestfs_h *g);\n"
26604 #: ../src/guestfs-actions.pod:3683
26605 msgid "guestfs_is_lv"
26609 #: ../src/guestfs-actions.pod:3685
26613 " guestfs_is_lv (guestfs_h *g,\n"
26614 " const char *device);\n"
26619 #: ../src/guestfs-actions.pod:3696
26620 msgid "guestfs_is_ready"
26624 #: ../src/guestfs-actions.pod:3698
26628 " guestfs_is_ready (guestfs_h *g);\n"
26633 #: ../src/guestfs-actions.pod:3710
26634 msgid "guestfs_is_socket"
26638 #: ../src/guestfs-actions.pod:3712
26642 " guestfs_is_socket (guestfs_h *g,\n"
26643 " const char *path);\n"
26648 #: ../src/guestfs-actions.pod:3725
26649 msgid "guestfs_is_symlink"
26653 #: ../src/guestfs-actions.pod:3727
26657 " guestfs_is_symlink (guestfs_h *g,\n"
26658 " const char *path);\n"
26663 #: ../src/guestfs-actions.pod:3740
26664 msgid "guestfs_is_zero"
26668 #: ../src/guestfs-actions.pod:3742
26672 " guestfs_is_zero (guestfs_h *g,\n"
26673 " const char *path);\n"
26678 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3765
26679 msgid "(Added in 1.11.8)"
26683 #: ../src/guestfs-actions.pod:3753
26684 msgid "guestfs_is_zero_device"
26688 #: ../src/guestfs-actions.pod:3755
26692 " guestfs_is_zero_device (guestfs_h *g,\n"
26693 " const char *device);\n"
26698 #: ../src/guestfs-actions.pod:3767
26699 msgid "guestfs_kill_subprocess"
26703 #: ../src/guestfs-actions.pod:3769
26707 " guestfs_kill_subprocess (guestfs_h *g);\n"
26712 #: ../src/guestfs-actions.pod:3778
26713 msgid "guestfs_launch"
26717 #: ../src/guestfs-actions.pod:3780
26721 " guestfs_launch (guestfs_h *g);\n"
26726 #: ../src/guestfs-actions.pod:3798
26727 msgid "guestfs_lchown"
26731 #: ../src/guestfs-actions.pod:3800
26735 " guestfs_lchown (guestfs_h *g,\n"
26738 " const char *path);\n"
26743 #: ../src/guestfs-actions.pod:3806
26745 "Change the file owner to C<owner> and group to C<group>. This is like "
26746 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
26747 "changed, not the target."
26751 #: ../src/guestfs-actions.pod:3818
26752 msgid "guestfs_lgetxattr"
26756 #: ../src/guestfs-actions.pod:3820
26760 " guestfs_lgetxattr (guestfs_h *g,\n"
26761 " const char *path,\n"
26762 " const char *name,\n"
26763 " size_t *size_r);\n"
26768 #: ../src/guestfs-actions.pod:3840
26769 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
26773 #: ../src/guestfs-actions.pod:3848
26774 msgid "guestfs_lgetxattrs"
26778 #: ../src/guestfs-actions.pod:3850
26781 " struct guestfs_xattr_list *\n"
26782 " guestfs_lgetxattrs (guestfs_h *g,\n"
26783 " const char *path);\n"
26788 #: ../src/guestfs-actions.pod:3854
26790 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
26791 "then it returns the extended attributes of the link itself."
26795 #: ../src/guestfs-actions.pod:3864
26796 msgid "guestfs_list_9p"
26800 #: ../src/guestfs-actions.pod:3866
26804 " guestfs_list_9p (guestfs_h *g);\n"
26809 #: ../src/guestfs-actions.pod:3878
26810 msgid "guestfs_list_devices"
26814 #: ../src/guestfs-actions.pod:3880
26818 " guestfs_list_devices (guestfs_h *g);\n"
26823 #: ../src/guestfs-actions.pod:3895
26824 msgid "guestfs_list_dm_devices"
26828 #: ../src/guestfs-actions.pod:3897
26832 " guestfs_list_dm_devices (guestfs_h *g);\n"
26837 #: ../src/guestfs-actions.pod:3902
26839 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
26840 "previous call to C<guestfs_luks_open>."
26844 #: ../src/guestfs-actions.pod:3905
26846 "Device mapper devices which correspond to logical volumes are I<not> "
26847 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
26852 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5359
26853 msgid "(Added in 1.11.15)"
26857 #: ../src/guestfs-actions.pod:3915
26858 msgid "guestfs_list_filesystems"
26862 #: ../src/guestfs-actions.pod:3917
26866 " guestfs_list_filesystems (guestfs_h *g);\n"
26871 #: ../src/guestfs-actions.pod:3937
26873 "This command runs other libguestfs commands, which might include "
26874 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
26875 "soon after launch and only when nothing is mounted."
26879 #: ../src/guestfs-actions.pod:3941
26881 "Not all of the filesystems returned will be mountable. In particular, swap "
26882 "partitions are returned in the list. Also this command does not check that "
26883 "each filesystem found is valid and mountable, and some filesystems might be "
26884 "mountable but require special options. Filesystems may not all belong to a "
26885 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
26889 #: ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:5720
26890 msgid "(Added in 1.5.15)"
26894 #: ../src/guestfs-actions.pod:3957
26895 msgid "guestfs_list_partitions"
26899 #: ../src/guestfs-actions.pod:3959
26903 " guestfs_list_partitions (guestfs_h *g);\n"
26908 #: ../src/guestfs-actions.pod:3966
26910 "This does not return logical volumes. For that you will need to call "
26915 #: ../src/guestfs-actions.pod:3977
26920 #: ../src/guestfs-actions.pod:3979
26924 " guestfs_ll (guestfs_h *g,\n"
26925 " const char *directory);\n"
26930 #: ../src/guestfs-actions.pod:3994
26935 #: ../src/guestfs-actions.pod:3996
26939 " guestfs_ln (guestfs_h *g,\n"
26940 " const char *target,\n"
26941 " const char *linkname);\n"
26946 #: ../src/guestfs-actions.pod:4007
26947 msgid "guestfs_ln_f"
26951 #: ../src/guestfs-actions.pod:4009
26955 " guestfs_ln_f (guestfs_h *g,\n"
26956 " const char *target,\n"
26957 " const char *linkname);\n"
26962 #: ../src/guestfs-actions.pod:4021
26963 msgid "guestfs_ln_s"
26967 #: ../src/guestfs-actions.pod:4023
26971 " guestfs_ln_s (guestfs_h *g,\n"
26972 " const char *target,\n"
26973 " const char *linkname);\n"
26978 #: ../src/guestfs-actions.pod:4034
26979 msgid "guestfs_ln_sf"
26983 #: ../src/guestfs-actions.pod:4036
26987 " guestfs_ln_sf (guestfs_h *g,\n"
26988 " const char *target,\n"
26989 " const char *linkname);\n"
26994 #: ../src/guestfs-actions.pod:4048
26995 msgid "guestfs_lremovexattr"
26999 #: ../src/guestfs-actions.pod:4050
27003 " guestfs_lremovexattr (guestfs_h *g,\n"
27004 " const char *xattr,\n"
27005 " const char *path);\n"
27010 #: ../src/guestfs-actions.pod:4055
27012 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27013 "link, then it removes an extended attribute of the link itself."
27017 #: ../src/guestfs-actions.pod:4063
27022 #: ../src/guestfs-actions.pod:4065
27026 " guestfs_ls (guestfs_h *g,\n"
27027 " const char *directory);\n"
27032 #: ../src/guestfs-actions.pod:4073
27034 "This command is mostly useful for interactive sessions. Programs should "
27035 "probably use C<guestfs_readdir> instead."
27039 #: ../src/guestfs-actions.pod:4082
27040 msgid "guestfs_lsetxattr"
27044 #: ../src/guestfs-actions.pod:4084
27048 " guestfs_lsetxattr (guestfs_h *g,\n"
27049 " const char *xattr,\n"
27050 " const char *val,\n"
27052 " const char *path);\n"
27057 #: ../src/guestfs-actions.pod:4091
27059 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27060 "then it sets an extended attribute of the link itself."
27064 #: ../src/guestfs-actions.pod:4099
27065 msgid "guestfs_lstat"
27069 #: ../src/guestfs-actions.pod:4101
27072 " struct guestfs_stat *\n"
27073 " guestfs_lstat (guestfs_h *g,\n"
27074 " const char *path);\n"
27079 #: ../src/guestfs-actions.pod:4107
27081 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27082 "link, then the link is stat-ed, not the file it refers to."
27086 #: ../src/guestfs-actions.pod:4113 ../src/guestfs-actions.pod:6894
27088 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27089 "error. I<The caller must call C<guestfs_free_stat> after use>."
27093 #: ../src/guestfs-actions.pod:4117 ../src/guestfs-actions.pod:6898
27094 #: ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:7297
27095 msgid "(Added in 0.9.2)"
27099 #: ../src/guestfs-actions.pod:4119
27100 msgid "guestfs_lstatlist"
27104 #: ../src/guestfs-actions.pod:4121
27107 " struct guestfs_stat_list *\n"
27108 " guestfs_lstatlist (guestfs_h *g,\n"
27109 " const char *path,\n"
27110 " char *const *names);\n"
27115 #: ../src/guestfs-actions.pod:4126
27117 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27118 "files, where all files are in the directory C<path>. C<names> is the list "
27119 "of files from this directory."
27123 #: ../src/guestfs-actions.pod:4135
27125 "This call is intended for programs that want to efficiently list a directory "
27126 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27127 "for a similarly efficient call for getting extended attributes. Very long "
27128 "directory listings might cause the protocol message size to be exceeded, "
27129 "causing this call to fail. The caller must split up such requests into "
27130 "smaller groups of names."
27134 #: ../src/guestfs-actions.pod:4143
27136 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27137 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27141 #: ../src/guestfs-actions.pod:4149
27142 msgid "guestfs_luks_add_key"
27146 #: ../src/guestfs-actions.pod:4151
27150 " guestfs_luks_add_key (guestfs_h *g,\n"
27151 " const char *device,\n"
27152 " const char *key,\n"
27153 " const char *newkey,\n"
27159 #: ../src/guestfs-actions.pod:4163
27161 "Note that if C<keyslot> already contains a key, then this command will "
27162 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27166 #: ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:4209
27167 #: ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4252
27168 #: ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4306
27170 "This function takes a key or passphrase parameter which could contain "
27171 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27176 #: ../src/guestfs-actions.pod:4173 ../src/guestfs-actions.pod:4213
27177 #: ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4256
27178 msgid "(Added in 1.5.2)"
27182 #: ../src/guestfs-actions.pod:4175
27183 msgid "guestfs_luks_close"
27187 #: ../src/guestfs-actions.pod:4177
27191 " guestfs_luks_close (guestfs_h *g,\n"
27192 " const char *device);\n"
27197 #: ../src/guestfs-actions.pod:4181
27199 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27200 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27201 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27202 "underlying block device."
27206 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4291
27207 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4360
27208 #: ../src/guestfs-actions.pod:4408
27209 msgid "(Added in 1.5.1)"
27213 #: ../src/guestfs-actions.pod:4191
27214 msgid "guestfs_luks_format"
27218 #: ../src/guestfs-actions.pod:4193
27222 " guestfs_luks_format (guestfs_h *g,\n"
27223 " const char *device,\n"
27224 " const char *key,\n"
27230 #: ../src/guestfs-actions.pod:4215
27231 msgid "guestfs_luks_format_cipher"
27235 #: ../src/guestfs-actions.pod:4217
27239 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27240 " const char *device,\n"
27241 " const char *key,\n"
27243 " const char *cipher);\n"
27248 #: ../src/guestfs-actions.pod:4224
27250 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27251 "set the C<cipher> used."
27255 #: ../src/guestfs-actions.pod:4238
27256 msgid "guestfs_luks_kill_slot"
27260 #: ../src/guestfs-actions.pod:4240
27264 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27265 " const char *device,\n"
27266 " const char *key,\n"
27272 #: ../src/guestfs-actions.pod:4258
27273 msgid "guestfs_luks_open"
27277 #: ../src/guestfs-actions.pod:4260
27281 " guestfs_luks_open (guestfs_h *g,\n"
27282 " const char *device,\n"
27283 " const char *key,\n"
27284 " const char *mapname);\n"
27289 #: ../src/guestfs-actions.pod:4278
27291 "If this block device contains LVM volume groups, then calling "
27292 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27297 #: ../src/guestfs-actions.pod:4282
27298 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27302 #: ../src/guestfs-actions.pod:4293
27303 msgid "guestfs_luks_open_ro"
27307 #: ../src/guestfs-actions.pod:4295
27311 " guestfs_luks_open_ro (guestfs_h *g,\n"
27312 " const char *device,\n"
27313 " const char *key,\n"
27314 " const char *mapname);\n"
27319 #: ../src/guestfs-actions.pod:4301
27321 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27326 #: ../src/guestfs-actions.pod:4312
27327 msgid "guestfs_lvcreate"
27331 #: ../src/guestfs-actions.pod:4314
27335 " guestfs_lvcreate (guestfs_h *g,\n"
27336 " const char *logvol,\n"
27337 " const char *volgroup,\n"
27343 #: ../src/guestfs-actions.pod:4327
27344 msgid "guestfs_lvm_canonical_lv_name"
27348 #: ../src/guestfs-actions.pod:4329
27352 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27353 " const char *lvname);\n"
27358 #: ../src/guestfs-actions.pod:4340
27359 msgid "See also C<guestfs_is_lv>."
27363 #: ../src/guestfs-actions.pod:4345
27364 msgid "(Added in 1.5.24)"
27368 #: ../src/guestfs-actions.pod:4347
27369 msgid "guestfs_lvm_clear_filter"
27373 #: ../src/guestfs-actions.pod:4349
27377 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
27382 #: ../src/guestfs-actions.pod:4352
27384 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
27385 "see every block device."
27389 #: ../src/guestfs-actions.pod:4362
27390 msgid "guestfs_lvm_remove_all"
27394 #: ../src/guestfs-actions.pod:4364
27398 " guestfs_lvm_remove_all (guestfs_h *g);\n"
27403 #: ../src/guestfs-actions.pod:4377
27404 msgid "guestfs_lvm_set_filter"
27408 #: ../src/guestfs-actions.pod:4379
27412 " guestfs_lvm_set_filter (guestfs_h *g,\n"
27413 " char *const *devices);\n"
27418 #: ../src/guestfs-actions.pod:4410
27419 msgid "guestfs_lvremove"
27423 #: ../src/guestfs-actions.pod:4412
27427 " guestfs_lvremove (guestfs_h *g,\n"
27428 " const char *device);\n"
27433 #: ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:5817
27434 #: ../src/guestfs-actions.pod:7667
27435 msgid "(Added in 1.0.13)"
27439 #: ../src/guestfs-actions.pod:4426
27440 msgid "guestfs_lvrename"
27444 #: ../src/guestfs-actions.pod:4428
27448 " guestfs_lvrename (guestfs_h *g,\n"
27449 " const char *logvol,\n"
27450 " const char *newlogvol);\n"
27455 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:7680
27456 msgid "(Added in 1.0.83)"
27460 #: ../src/guestfs-actions.pod:4439
27461 msgid "guestfs_lvresize"
27465 #: ../src/guestfs-actions.pod:4441
27469 " guestfs_lvresize (guestfs_h *g,\n"
27470 " const char *device,\n"
27476 #: ../src/guestfs-actions.pod:4454
27477 msgid "guestfs_lvresize_free"
27481 #: ../src/guestfs-actions.pod:4456
27485 " guestfs_lvresize_free (guestfs_h *g,\n"
27486 " const char *lv,\n"
27492 #: ../src/guestfs-actions.pod:4469
27493 msgid "(Added in 1.3.3)"
27497 #: ../src/guestfs-actions.pod:4471
27498 msgid "guestfs_lvs"
27502 #: ../src/guestfs-actions.pod:4473
27506 " guestfs_lvs (guestfs_h *g);\n"
27511 #: ../src/guestfs-actions.pod:4482
27512 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
27516 #: ../src/guestfs-actions.pod:4490
27517 msgid "guestfs_lvs_full"
27521 #: ../src/guestfs-actions.pod:4492
27524 " struct guestfs_lvm_lv_list *\n"
27525 " guestfs_lvs_full (guestfs_h *g);\n"
27530 #: ../src/guestfs-actions.pod:4498
27532 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
27533 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
27537 #: ../src/guestfs-actions.pod:4504
27538 msgid "guestfs_lvuuid"
27542 #: ../src/guestfs-actions.pod:4506
27546 " guestfs_lvuuid (guestfs_h *g,\n"
27547 " const char *device);\n"
27552 #: ../src/guestfs-actions.pod:4517
27553 msgid "guestfs_lxattrlist"
27557 #: ../src/guestfs-actions.pod:4519
27560 " struct guestfs_xattr_list *\n"
27561 " guestfs_lxattrlist (guestfs_h *g,\n"
27562 " const char *path,\n"
27563 " char *const *names);\n"
27568 #: ../src/guestfs-actions.pod:4538
27570 "This call is intended for programs that want to efficiently list a directory "
27571 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
27572 "a similarly efficient call for getting standard stats. Very long directory "
27573 "listings might cause the protocol message size to be exceeded, causing this "
27574 "call to fail. The caller must split up such requests into smaller groups of "
27579 #: ../src/guestfs-actions.pod:4552
27580 msgid "guestfs_mkdir"
27584 #: ../src/guestfs-actions.pod:4554
27588 " guestfs_mkdir (guestfs_h *g,\n"
27589 " const char *path);\n"
27594 #: ../src/guestfs-actions.pod:4564
27595 msgid "guestfs_mkdir_mode"
27599 #: ../src/guestfs-actions.pod:4566
27603 " guestfs_mkdir_mode (guestfs_h *g,\n"
27604 " const char *path,\n"
27610 #: ../src/guestfs-actions.pod:4578
27611 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
27615 #: ../src/guestfs-actions.pod:4584
27616 msgid "guestfs_mkdir_p"
27620 #: ../src/guestfs-actions.pod:4586
27624 " guestfs_mkdir_p (guestfs_h *g,\n"
27625 " const char *path);\n"
27630 #: ../src/guestfs-actions.pod:4597
27631 msgid "guestfs_mkdtemp"
27635 #: ../src/guestfs-actions.pod:4599
27639 " guestfs_mkdtemp (guestfs_h *g,\n"
27640 " const char *template);\n"
27645 #: ../src/guestfs-actions.pod:4627
27646 msgid "guestfs_mke2fs_J"
27650 #: ../src/guestfs-actions.pod:4629
27654 " guestfs_mke2fs_J (guestfs_h *g,\n"
27655 " const char *fstype,\n"
27656 " int blocksize,\n"
27657 " const char *device,\n"
27658 " const char *journal);\n"
27663 #: ../src/guestfs-actions.pod:4642
27664 msgid "See also C<guestfs_mke2journal>."
27668 #: ../src/guestfs-actions.pod:4646 ../src/guestfs-actions.pod:4664
27669 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4698
27670 #: ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4726
27671 #: ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:5062
27672 msgid "(Added in 1.0.68)"
27676 #: ../src/guestfs-actions.pod:4648
27677 msgid "guestfs_mke2fs_JL"
27681 #: ../src/guestfs-actions.pod:4650
27685 " guestfs_mke2fs_JL (guestfs_h *g,\n"
27686 " const char *fstype,\n"
27687 " int blocksize,\n"
27688 " const char *device,\n"
27689 " const char *label);\n"
27694 #: ../src/guestfs-actions.pod:4660
27695 msgid "See also C<guestfs_mke2journal_L>."
27699 #: ../src/guestfs-actions.pod:4666
27700 msgid "guestfs_mke2fs_JU"
27704 #: ../src/guestfs-actions.pod:4668
27708 " guestfs_mke2fs_JU (guestfs_h *g,\n"
27709 " const char *fstype,\n"
27710 " int blocksize,\n"
27711 " const char *device,\n"
27712 " const char *uuid);\n"
27717 #: ../src/guestfs-actions.pod:4678
27718 msgid "See also C<guestfs_mke2journal_U>."
27722 #: ../src/guestfs-actions.pod:4684
27723 msgid "guestfs_mke2journal"
27727 #: ../src/guestfs-actions.pod:4686
27731 " guestfs_mke2journal (guestfs_h *g,\n"
27732 " int blocksize,\n"
27733 " const char *device);\n"
27738 #: ../src/guestfs-actions.pod:4700
27739 msgid "guestfs_mke2journal_L"
27743 #: ../src/guestfs-actions.pod:4702
27747 " guestfs_mke2journal_L (guestfs_h *g,\n"
27748 " int blocksize,\n"
27749 " const char *label,\n"
27750 " const char *device);\n"
27755 #: ../src/guestfs-actions.pod:4714
27756 msgid "guestfs_mke2journal_U"
27760 #: ../src/guestfs-actions.pod:4716
27764 " guestfs_mke2journal_U (guestfs_h *g,\n"
27765 " int blocksize,\n"
27766 " const char *uuid,\n"
27767 " const char *device);\n"
27772 #: ../src/guestfs-actions.pod:4728
27773 msgid "guestfs_mkfifo"
27777 #: ../src/guestfs-actions.pod:4730
27781 " guestfs_mkfifo (guestfs_h *g,\n"
27783 " const char *path);\n"
27788 #: ../src/guestfs-actions.pod:4735
27790 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27791 "is just a convenient wrapper around C<guestfs_mknod>."
27795 #: ../src/guestfs-actions.pod:4745
27796 msgid "guestfs_mkfs"
27800 #: ../src/guestfs-actions.pod:4747
27804 " guestfs_mkfs (guestfs_h *g,\n"
27805 " const char *fstype,\n"
27806 " const char *device);\n"
27811 #: ../src/guestfs-actions.pod:4760
27812 msgid "guestfs_mkfs_b"
27816 #: ../src/guestfs-actions.pod:4762
27820 " guestfs_mkfs_b (guestfs_h *g,\n"
27821 " const char *fstype,\n"
27822 " int blocksize,\n"
27823 " const char *device);\n"
27828 #: ../src/guestfs-actions.pod:4768
27830 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
27835 #: ../src/guestfs-actions.pod:4775
27837 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
27838 "block size of the resulting filesystem. Supported block sizes depend on the "
27839 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
27843 #: ../src/guestfs-actions.pod:4787
27844 msgid "guestfs_mkfs_opts"
27848 #: ../src/guestfs-actions.pod:4789
27852 " guestfs_mkfs_opts (guestfs_h *g,\n"
27853 " const char *fstype,\n"
27854 " const char *device,\n"
27860 #: ../src/guestfs-actions.pod:4800
27863 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
27864 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
27865 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
27866 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
27871 #: ../src/guestfs-actions.pod:4848
27872 msgid "(Added in 1.7.19)"
27876 #: ../src/guestfs-actions.pod:4850
27877 msgid "guestfs_mkfs_opts_va"
27881 #: ../src/guestfs-actions.pod:4852
27885 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
27886 " const char *fstype,\n"
27887 " const char *device,\n"
27888 " va_list args);\n"
27893 #: ../src/guestfs-actions.pod:4858
27894 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
27898 #: ../src/guestfs-actions.pod:4862
27899 msgid "guestfs_mkfs_opts_argv"
27903 #: ../src/guestfs-actions.pod:4864
27907 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
27908 " const char *fstype,\n"
27909 " const char *device,\n"
27910 " const struct guestfs_mkfs_opts_argv *optargs);\n"
27915 #: ../src/guestfs-actions.pod:4870
27916 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
27920 #: ../src/guestfs-actions.pod:4874
27921 msgid "guestfs_mkmountpoint"
27925 #: ../src/guestfs-actions.pod:4876
27929 " guestfs_mkmountpoint (guestfs_h *g,\n"
27930 " const char *exemptpath);\n"
27935 #: ../src/guestfs-actions.pod:4880
27937 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
27938 "that can be used to create extra mountpoints before mounting the first "
27943 #: ../src/guestfs-actions.pod:4904
27945 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
27946 "may get unexpected errors if you try to mix these calls. It is safest to "
27947 "manually unmount filesystems and remove mountpoints after use."
27951 #: ../src/guestfs-actions.pod:4908
27953 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
27954 "first, so for this to work for manual mountpoints, you must ensure that the "
27955 "innermost mountpoints have the longest pathnames, as in the example code "
27960 #: ../src/guestfs-actions.pod:4915
27962 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
27963 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
27964 "can also trigger these issues."
27968 #: ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5227
27969 #: ../src/guestfs-actions.pod:6237
27970 msgid "(Added in 1.0.62)"
27974 #: ../src/guestfs-actions.pod:4923
27975 msgid "guestfs_mknod"
27979 #: ../src/guestfs-actions.pod:4925
27983 " guestfs_mknod (guestfs_h *g,\n"
27987 " const char *path);\n"
27992 #: ../src/guestfs-actions.pod:4940
27994 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27995 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27996 "regular file). These constants are available in the standard Linux header "
27997 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
27998 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
27999 "the appropriate constant for you."
28003 #: ../src/guestfs-actions.pod:4954
28004 msgid "guestfs_mknod_b"
28008 #: ../src/guestfs-actions.pod:4956
28012 " guestfs_mknod_b (guestfs_h *g,\n"
28016 " const char *path);\n"
28021 #: ../src/guestfs-actions.pod:4963
28023 "This call creates a block device node called C<path> with mode C<mode> and "
28024 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28025 "wrapper around C<guestfs_mknod>."
28029 #: ../src/guestfs-actions.pod:4973
28030 msgid "guestfs_mknod_c"
28034 #: ../src/guestfs-actions.pod:4975
28038 " guestfs_mknod_c (guestfs_h *g,\n"
28042 " const char *path);\n"
28047 #: ../src/guestfs-actions.pod:4982
28049 "This call creates a char device node called C<path> with mode C<mode> and "
28050 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28051 "wrapper around C<guestfs_mknod>."
28055 #: ../src/guestfs-actions.pod:4992
28056 msgid "guestfs_mkswap"
28060 #: ../src/guestfs-actions.pod:4994
28064 " guestfs_mkswap (guestfs_h *g,\n"
28065 " const char *device);\n"
28070 #: ../src/guestfs-actions.pod:5004
28071 msgid "guestfs_mkswap_L"
28075 #: ../src/guestfs-actions.pod:5006
28079 " guestfs_mkswap_L (guestfs_h *g,\n"
28080 " const char *label,\n"
28081 " const char *device);\n"
28086 #: ../src/guestfs-actions.pod:5021
28087 msgid "guestfs_mkswap_U"
28091 #: ../src/guestfs-actions.pod:5023
28095 " guestfs_mkswap_U (guestfs_h *g,\n"
28096 " const char *uuid,\n"
28097 " const char *device);\n"
28102 #: ../src/guestfs-actions.pod:5034
28103 msgid "guestfs_mkswap_file"
28107 #: ../src/guestfs-actions.pod:5036
28111 " guestfs_mkswap_file (guestfs_h *g,\n"
28112 " const char *path);\n"
28117 #: ../src/guestfs-actions.pod:5042
28119 "This command just writes a swap file signature to an existing file. To "
28120 "create the file itself, use something like C<guestfs_fallocate>."
28124 #: ../src/guestfs-actions.pod:5049
28125 msgid "guestfs_modprobe"
28129 #: ../src/guestfs-actions.pod:5051
28133 " guestfs_modprobe (guestfs_h *g,\n"
28134 " const char *modulename);\n"
28139 #: ../src/guestfs-actions.pod:5064
28140 msgid "guestfs_mount"
28144 #: ../src/guestfs-actions.pod:5066
28148 " guestfs_mount (guestfs_h *g,\n"
28149 " const char *device,\n"
28150 " const char *mountpoint);\n"
28155 #: ../src/guestfs-actions.pod:5085
28157 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28158 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28159 "problems for users. If your program might need to work with older versions "
28160 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28161 "for the first parameter if you don't want any options)."
28165 #: ../src/guestfs-actions.pod:5096
28166 msgid "guestfs_mount_9p"
28170 #: ../src/guestfs-actions.pod:5098
28174 " guestfs_mount_9p (guestfs_h *g,\n"
28175 " const char *mounttag,\n"
28176 " const char *mountpoint,\n"
28182 #: ../src/guestfs-actions.pod:5109
28185 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28190 #: ../src/guestfs-actions.pod:5122
28191 msgid "guestfs_mount_9p_va"
28195 #: ../src/guestfs-actions.pod:5124
28199 " guestfs_mount_9p_va (guestfs_h *g,\n"
28200 " const char *mounttag,\n"
28201 " const char *mountpoint,\n"
28202 " va_list args);\n"
28207 #: ../src/guestfs-actions.pod:5130
28208 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28212 #: ../src/guestfs-actions.pod:5134
28213 msgid "guestfs_mount_9p_argv"
28217 #: ../src/guestfs-actions.pod:5136
28221 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28222 " const char *mounttag,\n"
28223 " const char *mountpoint,\n"
28224 " const struct guestfs_mount_9p_argv *optargs);\n"
28229 #: ../src/guestfs-actions.pod:5142
28230 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28234 #: ../src/guestfs-actions.pod:5146
28235 msgid "guestfs_mount_loop"
28239 #: ../src/guestfs-actions.pod:5148
28243 " guestfs_mount_loop (guestfs_h *g,\n"
28244 " const char *file,\n"
28245 " const char *mountpoint);\n"
28250 #: ../src/guestfs-actions.pod:5161
28251 msgid "guestfs_mount_options"
28255 #: ../src/guestfs-actions.pod:5163
28259 " guestfs_mount_options (guestfs_h *g,\n"
28260 " const char *options,\n"
28261 " const char *device,\n"
28262 " const char *mountpoint);\n"
28267 #: ../src/guestfs-actions.pod:5169
28269 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28270 "the mount options as for the L<mount(8)> I<-o> flag."
28274 #: ../src/guestfs-actions.pod:5179 ../src/guestfs-actions.pod:5193
28275 #: ../src/guestfs-actions.pod:5210
28276 msgid "(Added in 1.0.10)"
28280 #: ../src/guestfs-actions.pod:5181
28281 msgid "guestfs_mount_ro"
28285 #: ../src/guestfs-actions.pod:5183
28289 " guestfs_mount_ro (guestfs_h *g,\n"
28290 " const char *device,\n"
28291 " const char *mountpoint);\n"
28296 #: ../src/guestfs-actions.pod:5188
28298 "This is the same as the C<guestfs_mount> command, but it mounts the "
28299 "filesystem with the read-only (I<-o ro>) flag."
28303 #: ../src/guestfs-actions.pod:5195
28304 msgid "guestfs_mount_vfs"
28308 #: ../src/guestfs-actions.pod:5197
28312 " guestfs_mount_vfs (guestfs_h *g,\n"
28313 " const char *options,\n"
28314 " const char *vfstype,\n"
28315 " const char *device,\n"
28316 " const char *mountpoint);\n"
28321 #: ../src/guestfs-actions.pod:5204
28323 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28324 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
28329 #: ../src/guestfs-actions.pod:5212
28330 msgid "guestfs_mountpoints"
28334 #: ../src/guestfs-actions.pod:5214
28338 " guestfs_mountpoints (guestfs_h *g);\n"
28343 #: ../src/guestfs-actions.pod:5217
28345 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28346 "devices. This one returns a hash table (map) of device name to directory "
28347 "where the device is mounted."
28351 #: ../src/guestfs-actions.pod:5229
28352 msgid "guestfs_mounts"
28356 #: ../src/guestfs-actions.pod:5231
28360 " guestfs_mounts (guestfs_h *g);\n"
28365 #: ../src/guestfs-actions.pod:5239
28366 msgid "See also: C<guestfs_mountpoints>"
28370 #: ../src/guestfs-actions.pod:5247
28375 #: ../src/guestfs-actions.pod:5249
28379 " guestfs_mv (guestfs_h *g,\n"
28380 " const char *src,\n"
28381 " const char *dest);\n"
28386 #: ../src/guestfs-actions.pod:5261
28387 msgid "guestfs_ntfs_3g_probe"
28391 #: ../src/guestfs-actions.pod:5263
28395 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
28397 " const char *device);\n"
28402 #: ../src/guestfs-actions.pod:5282
28403 msgid "(Added in 1.0.43)"
28407 #: ../src/guestfs-actions.pod:5284
28408 msgid "guestfs_ntfsresize"
28412 #: ../src/guestfs-actions.pod:5286
28416 " guestfs_ntfsresize (guestfs_h *g,\n"
28417 " const char *device);\n"
28422 #: ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5390
28424 "I<This function is deprecated.> In new code, use the L</"
28425 "guestfs_ntfsresize_opts> call instead."
28429 #: ../src/guestfs-actions.pod:5314
28430 msgid "guestfs_ntfsresize_opts"
28434 #: ../src/guestfs-actions.pod:5316
28438 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
28439 " const char *device,\n"
28445 #: ../src/guestfs-actions.pod:5326
28448 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
28449 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
28454 #: ../src/guestfs-actions.pod:5346
28456 "After the resize operation, the filesystem is always marked as requiring a "
28457 "consistency check (for safety). You have to boot into Windows to perform "
28458 "this check and clear this condition. If you I<don't> set the C<force> "
28459 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
28460 "times on a single filesystem without booting into Windows between each "
28465 #: ../src/guestfs-actions.pod:5361
28466 msgid "guestfs_ntfsresize_opts_va"
28470 #: ../src/guestfs-actions.pod:5363
28474 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
28475 " const char *device,\n"
28476 " va_list args);\n"
28481 #: ../src/guestfs-actions.pod:5368
28482 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
28486 #: ../src/guestfs-actions.pod:5372
28487 msgid "guestfs_ntfsresize_opts_argv"
28491 #: ../src/guestfs-actions.pod:5374
28495 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
28496 " const char *device,\n"
28497 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
28502 #: ../src/guestfs-actions.pod:5379
28503 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
28507 #: ../src/guestfs-actions.pod:5383
28508 msgid "guestfs_ntfsresize_size"
28512 #: ../src/guestfs-actions.pod:5385
28516 " guestfs_ntfsresize_size (guestfs_h *g,\n"
28517 " const char *device,\n"
28518 " int64_t size);\n"
28523 #: ../src/guestfs-actions.pod:5397
28525 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
28526 "to specify the new size (in bytes) explicitly."
28530 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5844
28531 #: ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6185
28532 #: ../src/guestfs-actions.pod:7824
28533 msgid "(Added in 1.3.14)"
28537 #: ../src/guestfs-actions.pod:5404
28538 msgid "guestfs_part_add"
28542 #: ../src/guestfs-actions.pod:5406
28546 " guestfs_part_add (guestfs_h *g,\n"
28547 " const char *device,\n"
28548 " const char *prlogex,\n"
28549 " int64_t startsect,\n"
28550 " int64_t endsect);\n"
28555 #: ../src/guestfs-actions.pod:5413
28557 "This command adds a partition to C<device>. If there is no partition table "
28558 "on the device, call C<guestfs_part_init> first."
28562 #: ../src/guestfs-actions.pod:5425
28564 "Creating a partition which covers the whole disk is not so easy. Use "
28565 "C<guestfs_part_disk> to do that."
28569 #: ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:5468
28570 #: ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5605
28571 #: ../src/guestfs-actions.pod:5643 ../src/guestfs-actions.pod:5662
28572 #: ../src/guestfs-actions.pod:5702
28573 msgid "(Added in 1.0.78)"
28577 #: ../src/guestfs-actions.pod:5432
28578 msgid "guestfs_part_del"
28582 #: ../src/guestfs-actions.pod:5434
28586 " guestfs_part_del (guestfs_h *g,\n"
28587 " const char *device,\n"
28593 #: ../src/guestfs-actions.pod:5449
28594 msgid "guestfs_part_disk"
28598 #: ../src/guestfs-actions.pod:5451
28602 " guestfs_part_disk (guestfs_h *g,\n"
28603 " const char *device,\n"
28604 " const char *parttype);\n"
28609 #: ../src/guestfs-actions.pod:5456
28611 "This command is simply a combination of C<guestfs_part_init> followed by "
28612 "C<guestfs_part_add> to create a single primary partition covering the whole "
28617 #: ../src/guestfs-actions.pod:5460
28619 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
28620 "possible values are described in C<guestfs_part_init>."
28624 #: ../src/guestfs-actions.pod:5470
28625 msgid "guestfs_part_get_bootable"
28629 #: ../src/guestfs-actions.pod:5472
28633 " guestfs_part_get_bootable (guestfs_h *g,\n"
28634 " const char *device,\n"
28640 #: ../src/guestfs-actions.pod:5480
28641 msgid "See also C<guestfs_part_set_bootable>."
28645 #: ../src/guestfs-actions.pod:5486
28646 msgid "guestfs_part_get_mbr_id"
28650 #: ../src/guestfs-actions.pod:5488
28654 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
28655 " const char *device,\n"
28661 #: ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5678
28663 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
28664 "undefined results for other partition table types (see "
28665 "C<guestfs_part_get_parttype>)."
28669 #: ../src/guestfs-actions.pod:5504
28670 msgid "guestfs_part_get_parttype"
28674 #: ../src/guestfs-actions.pod:5506
28678 " guestfs_part_get_parttype (guestfs_h *g,\n"
28679 " const char *device);\n"
28684 #: ../src/guestfs-actions.pod:5513
28686 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
28687 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
28688 "possible, although unusual. See C<guestfs_part_init> for a full list."
28692 #: ../src/guestfs-actions.pod:5523
28693 msgid "guestfs_part_init"
28697 #: ../src/guestfs-actions.pod:5525
28701 " guestfs_part_init (guestfs_h *g,\n"
28702 " const char *device,\n"
28703 " const char *parttype);\n"
28708 #: ../src/guestfs-actions.pod:5534
28710 "Initially there are no partitions. Following this, you should call "
28711 "C<guestfs_part_add> for each partition required."
28715 #: ../src/guestfs-actions.pod:5607
28716 msgid "guestfs_part_list"
28720 #: ../src/guestfs-actions.pod:5609
28723 " struct guestfs_partition_list *\n"
28724 " guestfs_part_list (guestfs_h *g,\n"
28725 " const char *device);\n"
28730 #: ../src/guestfs-actions.pod:5626
28732 "Start of the partition I<in bytes>. To get sectors you have to divide by "
28733 "the device's sector size, see C<guestfs_blockdev_getss>."
28737 #: ../src/guestfs-actions.pod:5639
28739 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
28740 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
28745 #: ../src/guestfs-actions.pod:5645
28746 msgid "guestfs_part_set_bootable"
28750 #: ../src/guestfs-actions.pod:5647
28754 " guestfs_part_set_bootable (guestfs_h *g,\n"
28755 " const char *device,\n"
28757 " int bootable);\n"
28762 #: ../src/guestfs-actions.pod:5664
28763 msgid "guestfs_part_set_mbr_id"
28767 #: ../src/guestfs-actions.pod:5666
28771 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
28772 " const char *device,\n"
28779 #: ../src/guestfs-actions.pod:5686
28780 msgid "guestfs_part_set_name"
28784 #: ../src/guestfs-actions.pod:5688
28788 " guestfs_part_set_name (guestfs_h *g,\n"
28789 " const char *device,\n"
28791 " const char *name);\n"
28796 #: ../src/guestfs-actions.pod:5704
28797 msgid "guestfs_part_to_dev"
28801 #: ../src/guestfs-actions.pod:5706
28805 " guestfs_part_to_dev (guestfs_h *g,\n"
28806 " const char *partition);\n"
28811 #: ../src/guestfs-actions.pod:5714
28813 "The named partition must exist, for example as a string returned from "
28814 "C<guestfs_list_partitions>."
28818 #: ../src/guestfs-actions.pod:5722
28819 msgid "guestfs_ping_daemon"
28823 #: ../src/guestfs-actions.pod:5724
28827 " guestfs_ping_daemon (guestfs_h *g);\n"
28832 #: ../src/guestfs-actions.pod:5736
28833 msgid "guestfs_pread"
28837 #: ../src/guestfs-actions.pod:5738
28841 " guestfs_pread (guestfs_h *g,\n"
28842 " const char *path,\n"
28844 " int64_t offset,\n"
28845 " size_t *size_r);\n"
28850 #: ../src/guestfs-actions.pod:5751
28851 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
28855 #: ../src/guestfs-actions.pod:5762
28856 msgid "guestfs_pread_device"
28860 #: ../src/guestfs-actions.pod:5764
28864 " guestfs_pread_device (guestfs_h *g,\n"
28865 " const char *device,\n"
28867 " int64_t offset,\n"
28868 " size_t *size_r);\n"
28873 #: ../src/guestfs-actions.pod:5777
28874 msgid "See also C<guestfs_pread>."
28878 #: ../src/guestfs-actions.pod:5786
28879 msgid "(Added in 1.5.21)"
28883 #: ../src/guestfs-actions.pod:5788
28884 msgid "guestfs_pvcreate"
28888 #: ../src/guestfs-actions.pod:5790
28892 " guestfs_pvcreate (guestfs_h *g,\n"
28893 " const char *device);\n"
28898 #: ../src/guestfs-actions.pod:5802
28899 msgid "guestfs_pvremove"
28903 #: ../src/guestfs-actions.pod:5804
28907 " guestfs_pvremove (guestfs_h *g,\n"
28908 " const char *device);\n"
28913 #: ../src/guestfs-actions.pod:5819
28914 msgid "guestfs_pvresize"
28918 #: ../src/guestfs-actions.pod:5821
28922 " guestfs_pvresize (guestfs_h *g,\n"
28923 " const char *device);\n"
28928 #: ../src/guestfs-actions.pod:5832
28929 msgid "guestfs_pvresize_size"
28933 #: ../src/guestfs-actions.pod:5834
28937 " guestfs_pvresize_size (guestfs_h *g,\n"
28938 " const char *device,\n"
28939 " int64_t size);\n"
28944 #: ../src/guestfs-actions.pod:5839
28946 "This command is the same as C<guestfs_pvresize> except that it allows you to "
28947 "specify the new size (in bytes) explicitly."
28951 #: ../src/guestfs-actions.pod:5846
28952 msgid "guestfs_pvs"
28956 #: ../src/guestfs-actions.pod:5848
28960 " guestfs_pvs (guestfs_h *g);\n"
28965 #: ../src/guestfs-actions.pod:5857
28966 msgid "See also C<guestfs_pvs_full>."
28970 #: ../src/guestfs-actions.pod:5865
28971 msgid "guestfs_pvs_full"
28975 #: ../src/guestfs-actions.pod:5867
28978 " struct guestfs_lvm_pv_list *\n"
28979 " guestfs_pvs_full (guestfs_h *g);\n"
28984 #: ../src/guestfs-actions.pod:5873
28986 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
28987 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
28991 #: ../src/guestfs-actions.pod:5879
28992 msgid "guestfs_pvuuid"
28996 #: ../src/guestfs-actions.pod:5881
29000 " guestfs_pvuuid (guestfs_h *g,\n"
29001 " const char *device);\n"
29006 #: ../src/guestfs-actions.pod:5892
29007 msgid "guestfs_pwrite"
29011 #: ../src/guestfs-actions.pod:5894
29015 " guestfs_pwrite (guestfs_h *g,\n"
29016 " const char *path,\n"
29017 " const char *content,\n"
29018 " size_t content_size,\n"
29019 " int64_t offset);\n"
29024 #: ../src/guestfs-actions.pod:5910
29025 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29029 #: ../src/guestfs-actions.pod:5919
29030 msgid "guestfs_pwrite_device"
29034 #: ../src/guestfs-actions.pod:5921
29038 " guestfs_pwrite_device (guestfs_h *g,\n"
29039 " const char *device,\n"
29040 " const char *content,\n"
29041 " size_t content_size,\n"
29042 " int64_t offset);\n"
29047 #: ../src/guestfs-actions.pod:5936
29048 msgid "See also C<guestfs_pwrite>."
29052 #: ../src/guestfs-actions.pod:5943
29053 msgid "(Added in 1.5.20)"
29057 #: ../src/guestfs-actions.pod:5945
29058 msgid "guestfs_read_file"
29062 #: ../src/guestfs-actions.pod:5947
29066 " guestfs_read_file (guestfs_h *g,\n"
29067 " const char *path,\n"
29068 " size_t *size_r);\n"
29073 #: ../src/guestfs-actions.pod:5955
29075 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29076 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29077 "function is limited in the total size of file that can be handled."
29081 #: ../src/guestfs-actions.pod:5967
29082 msgid "(Added in 1.0.63)"
29086 #: ../src/guestfs-actions.pod:5969
29087 msgid "guestfs_read_lines"
29091 #: ../src/guestfs-actions.pod:5971
29095 " guestfs_read_lines (guestfs_h *g,\n"
29096 " const char *path);\n"
29101 #: ../src/guestfs-actions.pod:5980
29103 "Note that this function cannot correctly handle binary files (specifically, "
29104 "files containing C<\\0> character which is treated as end of line). For "
29105 "those you need to use the C<guestfs_read_file> function which has a more "
29106 "complex interface."
29110 #: ../src/guestfs-actions.pod:5991
29111 msgid "guestfs_readdir"
29115 #: ../src/guestfs-actions.pod:5993
29118 " struct guestfs_dirent_list *\n"
29119 " guestfs_readdir (guestfs_h *g,\n"
29120 " const char *dir);\n"
29125 #: ../src/guestfs-actions.pod:6047
29127 "This function is primarily intended for use by programs. To get a simple "
29128 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29129 "consumption, use C<guestfs_ll>."
29133 #: ../src/guestfs-actions.pod:6051
29135 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29136 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
29140 #: ../src/guestfs-actions.pod:6057
29141 msgid "guestfs_readlink"
29145 #: ../src/guestfs-actions.pod:6059
29149 " guestfs_readlink (guestfs_h *g,\n"
29150 " const char *path);\n"
29155 #: ../src/guestfs-actions.pod:6070
29156 msgid "guestfs_readlinklist"
29160 #: ../src/guestfs-actions.pod:6072
29164 " guestfs_readlinklist (guestfs_h *g,\n"
29165 " const char *path,\n"
29166 " char *const *names);\n"
29171 #: ../src/guestfs-actions.pod:6105
29172 msgid "guestfs_realpath"
29176 #: ../src/guestfs-actions.pod:6107
29180 " guestfs_realpath (guestfs_h *g,\n"
29181 " const char *path);\n"
29186 #: ../src/guestfs-actions.pod:6119
29187 msgid "guestfs_removexattr"
29191 #: ../src/guestfs-actions.pod:6121
29195 " guestfs_removexattr (guestfs_h *g,\n"
29196 " const char *xattr,\n"
29197 " const char *path);\n"
29202 #: ../src/guestfs-actions.pod:6129
29203 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29207 #: ../src/guestfs-actions.pod:6135
29208 msgid "guestfs_resize2fs"
29212 #: ../src/guestfs-actions.pod:6137
29216 " guestfs_resize2fs (guestfs_h *g,\n"
29217 " const char *device);\n"
29222 #: ../src/guestfs-actions.pod:6144
29224 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29225 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29226 "sometimes gives an error about this and sometimes not. In any case, it is "
29227 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29231 #: ../src/guestfs-actions.pod:6154
29232 msgid "guestfs_resize2fs_M"
29236 #: ../src/guestfs-actions.pod:6156
29240 " guestfs_resize2fs_M (guestfs_h *g,\n"
29241 " const char *device);\n"
29246 #: ../src/guestfs-actions.pod:6160
29248 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29249 "resized to its minimum size. This works like the I<-M> option to the "
29250 "C<resize2fs> command."
29254 #: ../src/guestfs-actions.pod:6164
29256 "To get the resulting size of the filesystem you should call "
29257 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29258 "These two numbers, multiplied together, give the resulting size of the "
29259 "minimal filesystem in bytes."
29263 #: ../src/guestfs-actions.pod:6173
29264 msgid "guestfs_resize2fs_size"
29268 #: ../src/guestfs-actions.pod:6175
29272 " guestfs_resize2fs_size (guestfs_h *g,\n"
29273 " const char *device,\n"
29274 " int64_t size);\n"
29279 #: ../src/guestfs-actions.pod:6180
29281 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29282 "to specify the new size (in bytes) explicitly."
29286 #: ../src/guestfs-actions.pod:6187
29291 #: ../src/guestfs-actions.pod:6189
29295 " guestfs_rm (guestfs_h *g,\n"
29296 " const char *path);\n"
29301 #: ../src/guestfs-actions.pod:6199
29302 msgid "guestfs_rm_rf"
29306 #: ../src/guestfs-actions.pod:6201
29310 " guestfs_rm_rf (guestfs_h *g,\n"
29311 " const char *path);\n"
29316 #: ../src/guestfs-actions.pod:6213
29317 msgid "guestfs_rmdir"
29321 #: ../src/guestfs-actions.pod:6215
29325 " guestfs_rmdir (guestfs_h *g,\n"
29326 " const char *path);\n"
29331 #: ../src/guestfs-actions.pod:6225
29332 msgid "guestfs_rmmountpoint"
29336 #: ../src/guestfs-actions.pod:6227
29340 " guestfs_rmmountpoint (guestfs_h *g,\n"
29341 " const char *exemptpath);\n"
29346 #: ../src/guestfs-actions.pod:6231
29348 "This calls removes a mountpoint that was previously created with "
29349 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29353 #: ../src/guestfs-actions.pod:6239
29354 msgid "guestfs_scrub_device"
29358 #: ../src/guestfs-actions.pod:6241
29362 " guestfs_scrub_device (guestfs_h *g,\n"
29363 " const char *device);\n"
29368 #: ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6274
29369 #: ../src/guestfs-actions.pod:6293
29370 msgid "(Added in 1.0.52)"
29374 #: ../src/guestfs-actions.pod:6258
29375 msgid "guestfs_scrub_file"
29379 #: ../src/guestfs-actions.pod:6260
29383 " guestfs_scrub_file (guestfs_h *g,\n"
29384 " const char *file);\n"
29389 #: ../src/guestfs-actions.pod:6276
29390 msgid "guestfs_scrub_freespace"
29394 #: ../src/guestfs-actions.pod:6278
29398 " guestfs_scrub_freespace (guestfs_h *g,\n"
29399 " const char *dir);\n"
29404 #: ../src/guestfs-actions.pod:6282
29406 "This command creates the directory C<dir> and then fills it with files until "
29407 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
29408 "and deletes them. The intention is to scrub any free space on the partition "
29409 "containing C<dir>."
29413 #: ../src/guestfs-actions.pod:6295
29414 msgid "guestfs_set_append"
29418 #: ../src/guestfs-actions.pod:6297
29422 " guestfs_set_append (guestfs_h *g,\n"
29423 " const char *append);\n"
29428 #: ../src/guestfs-actions.pod:6314
29429 msgid "guestfs_set_attach_method"
29433 #: ../src/guestfs-actions.pod:6316
29437 " guestfs_set_attach_method (guestfs_h *g,\n"
29438 " const char *attachmethod);\n"
29443 #: ../src/guestfs-actions.pod:6344
29444 msgid "guestfs_set_autosync"
29448 #: ../src/guestfs-actions.pod:6346
29452 " guestfs_set_autosync (guestfs_h *g,\n"
29453 " int autosync);\n"
29458 #: ../src/guestfs-actions.pod:6362
29459 msgid "guestfs_set_direct"
29463 #: ../src/guestfs-actions.pod:6364
29467 " guestfs_set_direct (guestfs_h *g,\n"
29473 #: ../src/guestfs-actions.pod:6372
29475 "One consequence of this is that log messages aren't caught by the library "
29476 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
29481 #: ../src/guestfs-actions.pod:6385
29482 msgid "guestfs_set_e2label"
29486 #: ../src/guestfs-actions.pod:6387
29490 " guestfs_set_e2label (guestfs_h *g,\n"
29491 " const char *device,\n"
29492 " const char *label);\n"
29497 #: ../src/guestfs-actions.pod:6396
29499 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
29500 "the existing label on a filesystem."
29504 #: ../src/guestfs-actions.pod:6403
29505 msgid "guestfs_set_e2uuid"
29509 #: ../src/guestfs-actions.pod:6405
29513 " guestfs_set_e2uuid (guestfs_h *g,\n"
29514 " const char *device,\n"
29515 " const char *uuid);\n"
29520 #: ../src/guestfs-actions.pod:6415
29522 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
29523 "the existing UUID of a filesystem."
29527 #: ../src/guestfs-actions.pod:6422
29528 msgid "guestfs_set_memsize"
29532 #: ../src/guestfs-actions.pod:6424
29536 " guestfs_set_memsize (guestfs_h *g,\n"
29542 #: ../src/guestfs-actions.pod:6428
29544 "This sets the memory size in megabytes allocated to the qemu subprocess. "
29545 "This only has any effect if called before C<guestfs_launch>."
29549 #: ../src/guestfs-actions.pod:6443
29550 msgid "guestfs_set_network"
29554 #: ../src/guestfs-actions.pod:6445
29558 " guestfs_set_network (guestfs_h *g,\n"
29564 #: ../src/guestfs-actions.pod:6455
29566 "You must call this before calling C<guestfs_launch>, otherwise it has no "
29571 #: ../src/guestfs-actions.pod:6462
29572 msgid "guestfs_set_path"
29576 #: ../src/guestfs-actions.pod:6464
29580 " guestfs_set_path (guestfs_h *g,\n"
29581 " const char *searchpath);\n"
29586 #: ../src/guestfs-actions.pod:6479
29587 msgid "guestfs_set_pgroup"
29591 #: ../src/guestfs-actions.pod:6481
29595 " guestfs_set_pgroup (guestfs_h *g,\n"
29601 #: ../src/guestfs-actions.pod:6498
29602 msgid "guestfs_set_qemu"
29606 #: ../src/guestfs-actions.pod:6500
29610 " guestfs_set_qemu (guestfs_h *g,\n"
29611 " const char *qemu);\n"
29616 #: ../src/guestfs-actions.pod:6526
29617 msgid "guestfs_set_recovery_proc"
29621 #: ../src/guestfs-actions.pod:6528
29625 " guestfs_set_recovery_proc (guestfs_h *g,\n"
29626 " int recoveryproc);\n"
29631 #: ../src/guestfs-actions.pod:6532
29633 "If this is called with the parameter C<false> then C<guestfs_launch> does "
29634 "not create a recovery process. The purpose of the recovery process is to "
29635 "stop runaway qemu processes in the case where the main program aborts "
29640 #: ../src/guestfs-actions.pod:6537
29642 "This only has any effect if called before C<guestfs_launch>, and the default "
29647 #: ../src/guestfs-actions.pod:6550
29648 msgid "guestfs_set_selinux"
29652 #: ../src/guestfs-actions.pod:6552
29656 " guestfs_set_selinux (guestfs_h *g,\n"
29662 #: ../src/guestfs-actions.pod:6569
29663 msgid "guestfs_set_smp"
29667 #: ../src/guestfs-actions.pod:6571
29671 " guestfs_set_smp (guestfs_h *g,\n"
29677 #: ../src/guestfs-actions.pod:6579
29678 msgid "This function must be called before C<guestfs_launch>."
29682 #: ../src/guestfs-actions.pod:6585
29683 msgid "guestfs_set_trace"
29687 #: ../src/guestfs-actions.pod:6587
29691 " guestfs_set_trace (guestfs_h *g,\n"
29697 #: ../src/guestfs-actions.pod:6601
29699 "Trace messages are normally sent to C<stderr>, unless you register a "
29700 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
29704 #: ../src/guestfs-actions.pod:6609
29705 msgid "guestfs_set_verbose"
29709 #: ../src/guestfs-actions.pod:6611
29713 " guestfs_set_verbose (guestfs_h *g,\n"
29719 #: ../src/guestfs-actions.pod:6620
29721 "Verbose messages are normally sent to C<stderr>, unless you register a "
29722 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
29726 #: ../src/guestfs-actions.pod:6628
29727 msgid "guestfs_setcon"
29731 #: ../src/guestfs-actions.pod:6630
29735 " guestfs_setcon (guestfs_h *g,\n"
29736 " const char *context);\n"
29741 #: ../src/guestfs-actions.pod:6643
29742 msgid "guestfs_setxattr"
29746 #: ../src/guestfs-actions.pod:6645
29750 " guestfs_setxattr (guestfs_h *g,\n"
29751 " const char *xattr,\n"
29752 " const char *val,\n"
29754 " const char *path);\n"
29759 #: ../src/guestfs-actions.pod:6656
29760 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
29764 #: ../src/guestfs-actions.pod:6662
29765 msgid "guestfs_sfdisk"
29769 #: ../src/guestfs-actions.pod:6664
29773 " guestfs_sfdisk (guestfs_h *g,\n"
29774 " const char *device,\n"
29778 " char *const *lines);\n"
29783 #: ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6716
29784 #: ../src/guestfs-actions.pod:6750
29786 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
29791 #: ../src/guestfs-actions.pod:6699
29793 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
29797 #: ../src/guestfs-actions.pod:6709
29798 msgid "guestfs_sfdiskM"
29802 #: ../src/guestfs-actions.pod:6711
29806 " guestfs_sfdiskM (guestfs_h *g,\n"
29807 " const char *device,\n"
29808 " char *const *lines);\n"
29813 #: ../src/guestfs-actions.pod:6723
29815 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
29816 "partition sizes are specified in megabytes only (rounded to the nearest "
29817 "cylinder) and you don't need to specify the cyls, heads and sectors "
29818 "parameters which were rarely if ever used anyway."
29822 #: ../src/guestfs-actions.pod:6729
29824 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
29825 "C<guestfs_part_disk>"
29829 #: ../src/guestfs-actions.pod:6739
29830 msgid "guestfs_sfdisk_N"
29834 #: ../src/guestfs-actions.pod:6741
29838 " guestfs_sfdisk_N (guestfs_h *g,\n"
29839 " const char *device,\n"
29844 " const char *line);\n"
29849 #: ../src/guestfs-actions.pod:6760
29851 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
29852 "for the cyls/heads/sectors parameters."
29856 #: ../src/guestfs-actions.pod:6763
29857 msgid "See also: C<guestfs_part_add>"
29861 #: ../src/guestfs-actions.pod:6772
29862 msgid "guestfs_sfdisk_disk_geometry"
29866 #: ../src/guestfs-actions.pod:6774
29870 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
29871 " const char *device);\n"
29876 #: ../src/guestfs-actions.pod:6778
29878 "This displays the disk geometry of C<device> read from the partition table. "
29879 "Especially in the case where the underlying block device has been resized, "
29880 "this can be different from the kernel's idea of the geometry (see "
29881 "C<guestfs_sfdisk_kernel_geometry>)."
29885 #: ../src/guestfs-actions.pod:6791
29886 msgid "guestfs_sfdisk_kernel_geometry"
29890 #: ../src/guestfs-actions.pod:6793
29894 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
29895 " const char *device);\n"
29900 #: ../src/guestfs-actions.pod:6807
29901 msgid "guestfs_sfdisk_l"
29905 #: ../src/guestfs-actions.pod:6809
29909 " guestfs_sfdisk_l (guestfs_h *g,\n"
29910 " const char *device);\n"
29915 #: ../src/guestfs-actions.pod:6813
29917 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
29922 #: ../src/guestfs-actions.pod:6824
29923 msgid "See also: C<guestfs_part_list>"
29927 #: ../src/guestfs-actions.pod:6831
29932 #: ../src/guestfs-actions.pod:6833
29936 " guestfs_sh (guestfs_h *g,\n"
29937 " const char *command);\n"
29942 #: ../src/guestfs-actions.pod:6840
29943 msgid "This is like C<guestfs_command>, but passes the command to:"
29947 #: ../src/guestfs-actions.pod:6848
29948 msgid "All the provisos about C<guestfs_command> apply to this call."
29952 #: ../src/guestfs-actions.pod:6855
29953 msgid "guestfs_sh_lines"
29957 #: ../src/guestfs-actions.pod:6857
29961 " guestfs_sh_lines (guestfs_h *g,\n"
29962 " const char *command);\n"
29967 #: ../src/guestfs-actions.pod:6861
29969 "This is the same as C<guestfs_sh>, but splits the result into a list of "
29974 #: ../src/guestfs-actions.pod:6864
29975 msgid "See also: C<guestfs_command_lines>"
29979 #: ../src/guestfs-actions.pod:6872
29980 msgid "guestfs_sleep"
29984 #: ../src/guestfs-actions.pod:6874
29988 " guestfs_sleep (guestfs_h *g,\n"
29994 #: ../src/guestfs-actions.pod:6882
29995 msgid "(Added in 1.0.41)"
29999 #: ../src/guestfs-actions.pod:6884 ../src/guestfs-structs.pod:109
30000 msgid "guestfs_stat"
30004 #: ../src/guestfs-actions.pod:6886
30007 " struct guestfs_stat *\n"
30008 " guestfs_stat (guestfs_h *g,\n"
30009 " const char *path);\n"
30014 #: ../src/guestfs-actions.pod:6900 ../src/guestfs-structs.pod:135
30015 msgid "guestfs_statvfs"
30019 #: ../src/guestfs-actions.pod:6902
30022 " struct guestfs_statvfs *\n"
30023 " guestfs_statvfs (guestfs_h *g,\n"
30024 " const char *path);\n"
30029 #: ../src/guestfs-actions.pod:6912
30031 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30032 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30036 #: ../src/guestfs-actions.pod:6918
30037 msgid "guestfs_strings"
30041 #: ../src/guestfs-actions.pod:6920
30045 " guestfs_strings (guestfs_h *g,\n"
30046 " const char *path);\n"
30051 #: ../src/guestfs-actions.pod:6936
30052 msgid "guestfs_strings_e"
30056 #: ../src/guestfs-actions.pod:6938
30060 " guestfs_strings_e (guestfs_h *g,\n"
30061 " const char *encoding,\n"
30062 " const char *path);\n"
30067 #: ../src/guestfs-actions.pod:6943
30069 "This is like the C<guestfs_strings> command, but allows you to specify the "
30070 "encoding of strings that are looked for in the source file C<path>."
30074 #: ../src/guestfs-actions.pod:6953
30076 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30077 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30081 #: ../src/guestfs-actions.pod:6991
30082 msgid "guestfs_swapoff_device"
30086 #: ../src/guestfs-actions.pod:6993
30090 " guestfs_swapoff_device (guestfs_h *g,\n"
30091 " const char *device);\n"
30096 #: ../src/guestfs-actions.pod:6997
30098 "This command disables the libguestfs appliance swap device or partition "
30099 "named C<device>. See C<guestfs_swapon_device>."
30103 #: ../src/guestfs-actions.pod:7005
30104 msgid "guestfs_swapoff_file"
30108 #: ../src/guestfs-actions.pod:7007
30112 " guestfs_swapoff_file (guestfs_h *g,\n"
30113 " const char *file);\n"
30118 #: ../src/guestfs-actions.pod:7017
30119 msgid "guestfs_swapoff_label"
30123 #: ../src/guestfs-actions.pod:7019
30127 " guestfs_swapoff_label (guestfs_h *g,\n"
30128 " const char *label);\n"
30133 #: ../src/guestfs-actions.pod:7030
30134 msgid "guestfs_swapoff_uuid"
30138 #: ../src/guestfs-actions.pod:7032
30142 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30143 " const char *uuid);\n"
30148 #: ../src/guestfs-actions.pod:7043
30149 msgid "guestfs_swapon_device"
30153 #: ../src/guestfs-actions.pod:7045
30157 " guestfs_swapon_device (guestfs_h *g,\n"
30158 " const char *device);\n"
30163 #: ../src/guestfs-actions.pod:7049
30165 "This command enables the libguestfs appliance to use the swap device or "
30166 "partition named C<device>. The increased memory is made available for all "
30167 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30171 #: ../src/guestfs-actions.pod:7065
30172 msgid "guestfs_swapon_file"
30176 #: ../src/guestfs-actions.pod:7067
30180 " guestfs_swapon_file (guestfs_h *g,\n"
30181 " const char *file);\n"
30186 #: ../src/guestfs-actions.pod:7071
30188 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30193 #: ../src/guestfs-actions.pod:7078
30194 msgid "guestfs_swapon_label"
30198 #: ../src/guestfs-actions.pod:7080
30202 " guestfs_swapon_label (guestfs_h *g,\n"
30203 " const char *label);\n"
30208 #: ../src/guestfs-actions.pod:7084
30210 "This command enables swap to a labeled swap partition. See "
30211 "C<guestfs_swapon_device> for other notes."
30215 #: ../src/guestfs-actions.pod:7091
30216 msgid "guestfs_swapon_uuid"
30220 #: ../src/guestfs-actions.pod:7093
30224 " guestfs_swapon_uuid (guestfs_h *g,\n"
30225 " const char *uuid);\n"
30230 #: ../src/guestfs-actions.pod:7097
30232 "This command enables swap to a swap partition with the given UUID. See "
30233 "C<guestfs_swapon_device> for other notes."
30237 #: ../src/guestfs-actions.pod:7104
30238 msgid "guestfs_sync"
30242 #: ../src/guestfs-actions.pod:7106
30246 " guestfs_sync (guestfs_h *g);\n"
30251 #: ../src/guestfs-actions.pod:7119
30252 msgid "guestfs_tail"
30256 #: ../src/guestfs-actions.pod:7121
30260 " guestfs_tail (guestfs_h *g,\n"
30261 " const char *path);\n"
30266 #: ../src/guestfs-actions.pod:7137
30267 msgid "guestfs_tail_n"
30271 #: ../src/guestfs-actions.pod:7139
30275 " guestfs_tail_n (guestfs_h *g,\n"
30277 " const char *path);\n"
30282 #: ../src/guestfs-actions.pod:7161
30283 msgid "guestfs_tar_in"
30287 #: ../src/guestfs-actions.pod:7163
30291 " guestfs_tar_in (guestfs_h *g,\n"
30292 " const char *tarfile,\n"
30293 " const char *directory);\n"
30298 #: ../src/guestfs-actions.pod:7171
30300 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30304 #: ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7193
30305 #: ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7225
30306 msgid "(Added in 1.0.3)"
30310 #: ../src/guestfs-actions.pod:7178
30311 msgid "guestfs_tar_out"
30315 #: ../src/guestfs-actions.pod:7180
30319 " guestfs_tar_out (guestfs_h *g,\n"
30320 " const char *directory,\n"
30321 " const char *tarfile);\n"
30326 #: ../src/guestfs-actions.pod:7188
30328 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30329 "C<guestfs_txz_out>."
30333 #: ../src/guestfs-actions.pod:7195
30334 msgid "guestfs_tgz_in"
30338 #: ../src/guestfs-actions.pod:7197
30342 " guestfs_tgz_in (guestfs_h *g,\n"
30343 " const char *tarball,\n"
30344 " const char *directory);\n"
30349 #: ../src/guestfs-actions.pod:7205
30350 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30354 #: ../src/guestfs-actions.pod:7211
30355 msgid "guestfs_tgz_out"
30359 #: ../src/guestfs-actions.pod:7213
30363 " guestfs_tgz_out (guestfs_h *g,\n"
30364 " const char *directory,\n"
30365 " const char *tarball);\n"
30370 #: ../src/guestfs-actions.pod:7221
30371 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30375 #: ../src/guestfs-actions.pod:7227
30376 msgid "guestfs_touch"
30380 #: ../src/guestfs-actions.pod:7229
30384 " guestfs_touch (guestfs_h *g,\n"
30385 " const char *path);\n"
30390 #: ../src/guestfs-actions.pod:7244
30391 msgid "guestfs_truncate"
30395 #: ../src/guestfs-actions.pod:7246
30399 " guestfs_truncate (guestfs_h *g,\n"
30400 " const char *path);\n"
30405 #: ../src/guestfs-actions.pod:7257
30406 msgid "guestfs_truncate_size"
30410 #: ../src/guestfs-actions.pod:7259
30414 " guestfs_truncate_size (guestfs_h *g,\n"
30415 " const char *path,\n"
30416 " int64_t size);\n"
30421 #: ../src/guestfs-actions.pod:7267
30423 "If the current file size is less than C<size> then the file is extended to "
30424 "the required size with zero bytes. This creates a sparse file (ie. disk "
30425 "blocks are not allocated for the file until you write to it). To create a "
30426 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
30430 #: ../src/guestfs-actions.pod:7277
30431 msgid "guestfs_tune2fs_l"
30435 #: ../src/guestfs-actions.pod:7279
30439 " guestfs_tune2fs_l (guestfs_h *g,\n"
30440 " const char *device);\n"
30445 #: ../src/guestfs-actions.pod:7299
30446 msgid "guestfs_txz_in"
30450 #: ../src/guestfs-actions.pod:7301
30454 " guestfs_txz_in (guestfs_h *g,\n"
30455 " const char *tarball,\n"
30456 " const char *directory);\n"
30461 #: ../src/guestfs-actions.pod:7313
30462 msgid "guestfs_txz_out"
30466 #: ../src/guestfs-actions.pod:7315
30470 " guestfs_txz_out (guestfs_h *g,\n"
30471 " const char *directory,\n"
30472 " const char *tarball);\n"
30477 #: ../src/guestfs-actions.pod:7327
30478 msgid "guestfs_umask"
30482 #: ../src/guestfs-actions.pod:7329
30486 " guestfs_umask (guestfs_h *g,\n"
30492 #: ../src/guestfs-actions.pod:7345
30494 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
30495 "C<guestfs_mkdir>."
30499 #: ../src/guestfs-actions.pod:7354
30500 msgid "guestfs_umount"
30504 #: ../src/guestfs-actions.pod:7356
30508 " guestfs_umount (guestfs_h *g,\n"
30509 " const char *pathordevice);\n"
30514 #: ../src/guestfs-actions.pod:7368
30515 msgid "guestfs_umount_all"
30519 #: ../src/guestfs-actions.pod:7370
30523 " guestfs_umount_all (guestfs_h *g);\n"
30528 #: ../src/guestfs-actions.pod:7381
30529 msgid "guestfs_upload"
30533 #: ../src/guestfs-actions.pod:7383
30537 " guestfs_upload (guestfs_h *g,\n"
30538 " const char *filename,\n"
30539 " const char *remotefilename);\n"
30544 #: ../src/guestfs-actions.pod:7393
30545 msgid "See also C<guestfs_download>."
30549 #: ../src/guestfs-actions.pod:7404
30550 msgid "guestfs_upload_offset"
30554 #: ../src/guestfs-actions.pod:7406
30558 " guestfs_upload_offset (guestfs_h *g,\n"
30559 " const char *filename,\n"
30560 " const char *remotefilename,\n"
30561 " int64_t offset);\n"
30566 #: ../src/guestfs-actions.pod:7422
30568 "Note that there is no limit on the amount of data that can be uploaded with "
30569 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
30570 "full amount unless an error occurs."
30574 #: ../src/guestfs-actions.pod:7427
30575 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
30579 #: ../src/guestfs-actions.pod:7438
30580 msgid "guestfs_utimens"
30584 #: ../src/guestfs-actions.pod:7440
30588 " guestfs_utimens (guestfs_h *g,\n"
30589 " const char *path,\n"
30590 " int64_t atsecs,\n"
30591 " int64_t atnsecs,\n"
30592 " int64_t mtsecs,\n"
30593 " int64_t mtnsecs);\n"
30598 #: ../src/guestfs-actions.pod:7469 ../src/guestfs-structs.pod:175
30599 msgid "guestfs_version"
30603 #: ../src/guestfs-actions.pod:7471
30606 " struct guestfs_version *\n"
30607 " guestfs_version (guestfs_h *g);\n"
30612 #: ../src/guestfs-actions.pod:7499
30614 "I<Note:> Don't use this call to test for availability of features. In "
30615 "enterprise distributions we backport features from later versions into "
30616 "earlier versions, making this an unreliable way to test for features. Use "
30617 "C<guestfs_available> instead."
30621 #: ../src/guestfs-actions.pod:7505
30623 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
30624 "error. I<The caller must call C<guestfs_free_version> after use>."
30628 #: ../src/guestfs-actions.pod:7509
30629 msgid "(Added in 1.0.58)"
30633 #: ../src/guestfs-actions.pod:7511
30634 msgid "guestfs_vfs_label"
30638 #: ../src/guestfs-actions.pod:7513
30642 " guestfs_vfs_label (guestfs_h *g,\n"
30643 " const char *device);\n"
30648 #: ../src/guestfs-actions.pod:7522
30649 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
30653 #: ../src/guestfs-actions.pod:7527 ../src/guestfs-actions.pod:7564
30654 msgid "(Added in 1.3.18)"
30658 #: ../src/guestfs-actions.pod:7529
30659 msgid "guestfs_vfs_type"
30663 #: ../src/guestfs-actions.pod:7531
30667 " guestfs_vfs_type (guestfs_h *g,\n"
30668 " const char *device);\n"
30673 #: ../src/guestfs-actions.pod:7548
30674 msgid "guestfs_vfs_uuid"
30678 #: ../src/guestfs-actions.pod:7550
30682 " guestfs_vfs_uuid (guestfs_h *g,\n"
30683 " const char *device);\n"
30688 #: ../src/guestfs-actions.pod:7559
30689 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
30693 #: ../src/guestfs-actions.pod:7566
30694 msgid "guestfs_vg_activate"
30698 #: ../src/guestfs-actions.pod:7568
30702 " guestfs_vg_activate (guestfs_h *g,\n"
30704 " char *const *volgroups);\n"
30709 #: ../src/guestfs-actions.pod:7585
30710 msgid "guestfs_vg_activate_all"
30714 #: ../src/guestfs-actions.pod:7587
30718 " guestfs_vg_activate_all (guestfs_h *g,\n"
30719 " int activate);\n"
30724 #: ../src/guestfs-actions.pod:7600
30725 msgid "guestfs_vgcreate"
30729 #: ../src/guestfs-actions.pod:7602
30733 " guestfs_vgcreate (guestfs_h *g,\n"
30734 " const char *volgroup,\n"
30735 " char *const *physvols);\n"
30740 #: ../src/guestfs-actions.pod:7614
30741 msgid "guestfs_vglvuuids"
30745 #: ../src/guestfs-actions.pod:7616
30749 " guestfs_vglvuuids (guestfs_h *g,\n"
30750 " const char *vgname);\n"
30755 #: ../src/guestfs-actions.pod:7623
30757 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
30758 "associate logical volumes and volume groups."
30762 #: ../src/guestfs-actions.pod:7626
30763 msgid "See also C<guestfs_vgpvuuids>."
30767 #: ../src/guestfs-actions.pod:7634
30768 msgid "guestfs_vgpvuuids"
30772 #: ../src/guestfs-actions.pod:7636
30776 " guestfs_vgpvuuids (guestfs_h *g,\n"
30777 " const char *vgname);\n"
30782 #: ../src/guestfs-actions.pod:7643
30784 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
30785 "associate physical volumes and volume groups."
30789 #: ../src/guestfs-actions.pod:7646
30790 msgid "See also C<guestfs_vglvuuids>."
30794 #: ../src/guestfs-actions.pod:7654
30795 msgid "guestfs_vgremove"
30799 #: ../src/guestfs-actions.pod:7656
30803 " guestfs_vgremove (guestfs_h *g,\n"
30804 " const char *vgname);\n"
30809 #: ../src/guestfs-actions.pod:7669
30810 msgid "guestfs_vgrename"
30814 #: ../src/guestfs-actions.pod:7671
30818 " guestfs_vgrename (guestfs_h *g,\n"
30819 " const char *volgroup,\n"
30820 " const char *newvolgroup);\n"
30825 #: ../src/guestfs-actions.pod:7682
30826 msgid "guestfs_vgs"
30830 #: ../src/guestfs-actions.pod:7684
30834 " guestfs_vgs (guestfs_h *g);\n"
30839 #: ../src/guestfs-actions.pod:7693
30840 msgid "See also C<guestfs_vgs_full>."
30844 #: ../src/guestfs-actions.pod:7701
30845 msgid "guestfs_vgs_full"
30849 #: ../src/guestfs-actions.pod:7703
30852 " struct guestfs_lvm_vg_list *\n"
30853 " guestfs_vgs_full (guestfs_h *g);\n"
30858 #: ../src/guestfs-actions.pod:7709
30860 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
30861 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
30865 #: ../src/guestfs-actions.pod:7715
30866 msgid "guestfs_vgscan"
30870 #: ../src/guestfs-actions.pod:7717
30874 " guestfs_vgscan (guestfs_h *g);\n"
30879 #: ../src/guestfs-actions.pod:7727
30880 msgid "guestfs_vguuid"
30884 #: ../src/guestfs-actions.pod:7729
30888 " guestfs_vguuid (guestfs_h *g,\n"
30889 " const char *vgname);\n"
30894 #: ../src/guestfs-actions.pod:7740
30895 msgid "guestfs_wait_ready"
30899 #: ../src/guestfs-actions.pod:7742
30903 " guestfs_wait_ready (guestfs_h *g);\n"
30908 #: ../src/guestfs-actions.pod:7745
30910 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
30915 #: ../src/guestfs-actions.pod:7752
30916 msgid "This function is a no op."
30920 #: ../src/guestfs-actions.pod:7754
30922 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
30923 "calling C<guestfs_launch> to wait for the launch to complete. However this "
30924 "is no longer necessary because C<guestfs_launch> now does the waiting."
30928 #: ../src/guestfs-actions.pod:7759
30930 "If you see any calls to this function in code then you can just remove them, "
30931 "unless you want to retain compatibility with older versions of the API."
30935 #: ../src/guestfs-actions.pod:7767
30936 msgid "guestfs_wc_c"
30940 #: ../src/guestfs-actions.pod:7769
30944 " guestfs_wc_c (guestfs_h *g,\n"
30945 " const char *path);\n"
30950 #: ../src/guestfs-actions.pod:7780
30951 msgid "guestfs_wc_l"
30955 #: ../src/guestfs-actions.pod:7782
30959 " guestfs_wc_l (guestfs_h *g,\n"
30960 " const char *path);\n"
30965 #: ../src/guestfs-actions.pod:7793
30966 msgid "guestfs_wc_w"
30970 #: ../src/guestfs-actions.pod:7795
30974 " guestfs_wc_w (guestfs_h *g,\n"
30975 " const char *path);\n"
30980 #: ../src/guestfs-actions.pod:7806
30981 msgid "guestfs_write"
30985 #: ../src/guestfs-actions.pod:7808
30989 " guestfs_write (guestfs_h *g,\n"
30990 " const char *path,\n"
30991 " const char *content,\n"
30992 " size_t content_size);\n"
30997 #: ../src/guestfs-actions.pod:7817
30998 msgid "See also C<guestfs_write_append>."
31002 #: ../src/guestfs-actions.pod:7826
31003 msgid "guestfs_write_append"
31007 #: ../src/guestfs-actions.pod:7828
31011 " guestfs_write_append (guestfs_h *g,\n"
31012 " const char *path,\n"
31013 " const char *content,\n"
31014 " size_t content_size);\n"
31019 #: ../src/guestfs-actions.pod:7837
31020 msgid "See also C<guestfs_write>."
31024 #: ../src/guestfs-actions.pod:7846
31025 msgid "guestfs_write_file"
31029 #: ../src/guestfs-actions.pod:7848
31033 " guestfs_write_file (guestfs_h *g,\n"
31034 " const char *path,\n"
31035 " const char *content,\n"
31041 #: ../src/guestfs-actions.pod:7854
31043 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31048 #: ../src/guestfs-actions.pod:7879
31049 msgid "guestfs_zegrep"
31053 #: ../src/guestfs-actions.pod:7881
31057 " guestfs_zegrep (guestfs_h *g,\n"
31058 " const char *regex,\n"
31059 " const char *path);\n"
31064 #: ../src/guestfs-actions.pod:7898
31065 msgid "guestfs_zegrepi"
31069 #: ../src/guestfs-actions.pod:7900
31073 " guestfs_zegrepi (guestfs_h *g,\n"
31074 " const char *regex,\n"
31075 " const char *path);\n"
31080 #: ../src/guestfs-actions.pod:7917
31081 msgid "guestfs_zero"
31085 #: ../src/guestfs-actions.pod:7919
31089 " guestfs_zero (guestfs_h *g,\n"
31090 " const char *device);\n"
31095 #: ../src/guestfs-actions.pod:7933
31097 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31098 "C<guestfs_is_zero_device>"
31102 #: ../src/guestfs-actions.pod:7945
31103 msgid "guestfs_zero_device"
31107 #: ../src/guestfs-actions.pod:7947
31111 " guestfs_zero_device (guestfs_h *g,\n"
31112 " const char *device);\n"
31117 #: ../src/guestfs-actions.pod:7951
31119 "This command writes zeroes over the entire C<device>. Compare with "
31120 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31124 #: ../src/guestfs-actions.pod:7969
31125 msgid "(Added in 1.3.1)"
31129 #: ../src/guestfs-actions.pod:7971
31130 msgid "guestfs_zerofree"
31134 #: ../src/guestfs-actions.pod:7973
31138 " guestfs_zerofree (guestfs_h *g,\n"
31139 " const char *device);\n"
31144 #: ../src/guestfs-actions.pod:7992
31145 msgid "guestfs_zfgrep"
31149 #: ../src/guestfs-actions.pod:7994
31153 " guestfs_zfgrep (guestfs_h *g,\n"
31154 " const char *pattern,\n"
31155 " const char *path);\n"
31160 #: ../src/guestfs-actions.pod:8011
31161 msgid "guestfs_zfgrepi"
31165 #: ../src/guestfs-actions.pod:8013
31169 " guestfs_zfgrepi (guestfs_h *g,\n"
31170 " const char *pattern,\n"
31171 " const char *path);\n"
31176 #: ../src/guestfs-actions.pod:8030
31177 msgid "guestfs_zfile"
31181 #: ../src/guestfs-actions.pod:8032
31185 " guestfs_zfile (guestfs_h *g,\n"
31186 " const char *meth,\n"
31187 " const char *path);\n"
31192 #: ../src/guestfs-actions.pod:8037
31194 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31199 #: ../src/guestfs-actions.pod:8049
31201 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31206 #: ../src/guestfs-actions.pod:8057
31207 msgid "guestfs_zgrep"
31211 #: ../src/guestfs-actions.pod:8059
31215 " guestfs_zgrep (guestfs_h *g,\n"
31216 " const char *regex,\n"
31217 " const char *path);\n"
31222 #: ../src/guestfs-actions.pod:8076
31223 msgid "guestfs_zgrepi"
31227 #: ../src/guestfs-actions.pod:8078
31231 " guestfs_zgrepi (guestfs_h *g,\n"
31232 " const char *regex,\n"
31233 " const char *path);\n"
31238 #: ../src/guestfs-availability.pod:3
31243 #: ../src/guestfs-availability.pod:5
31245 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
31246 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
31247 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
31248 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
31249 "L</guestfs_aug_save> L</guestfs_aug_set>"
31253 #: ../src/guestfs-availability.pod:21
31258 #: ../src/guestfs-availability.pod:23
31259 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31263 #: ../src/guestfs-availability.pod:26
31268 #: ../src/guestfs-availability.pod:28
31269 msgid "The following functions: L</guestfs_grub_install>"
31273 #: ../src/guestfs-availability.pod:31
31278 #: ../src/guestfs-availability.pod:33
31280 "The following functions: L</guestfs_inotify_add_watch> L</"
31281 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
31282 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31286 #: ../src/guestfs-availability.pod:41
31287 msgid "B<linuxfsuuid>"
31291 #: ../src/guestfs-availability.pod:43
31293 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
31294 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31298 #: ../src/guestfs-availability.pod:50
31299 msgid "B<linuxmodules>"
31303 #: ../src/guestfs-availability.pod:52
31304 msgid "The following functions: L</guestfs_modprobe>"
31308 #: ../src/guestfs-availability.pod:55
31309 msgid "B<linuxxattrs>"
31313 #: ../src/guestfs-availability.pod:57
31315 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
31316 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
31317 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
31318 "guestfs_setxattr>"
31322 #: ../src/guestfs-availability.pod:68
31327 #: ../src/guestfs-availability.pod:70
31329 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
31330 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
31331 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31335 #: ../src/guestfs-availability.pod:79
31340 #: ../src/guestfs-availability.pod:81
31342 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
31343 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
31344 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
31345 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
31346 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
31347 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
31348 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
31352 #: ../src/guestfs-availability.pod:104
31357 #: ../src/guestfs-availability.pod:106
31359 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
31360 "guestfs_mknod_b> L</guestfs_mknod_c>"
31364 #: ../src/guestfs-availability.pod:112
31369 #: ../src/guestfs-availability.pod:114
31370 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31374 #: ../src/guestfs-availability.pod:117
31375 msgid "B<ntfsprogs>"
31379 #: ../src/guestfs-availability.pod:119
31381 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31382 "L</guestfs_ntfsresize_size>"
31386 #: ../src/guestfs-availability.pod:124
31387 msgid "B<realpath>"
31391 #: ../src/guestfs-availability.pod:126
31392 msgid "The following functions: L</guestfs_realpath>"
31396 #: ../src/guestfs-availability.pod:129
31401 #: ../src/guestfs-availability.pod:131
31403 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
31404 "guestfs_scrub_freespace>"
31408 #: ../src/guestfs-availability.pod:136
31413 #: ../src/guestfs-availability.pod:138
31414 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
31418 #: ../src/guestfs-availability.pod:142
31423 #: ../src/guestfs-availability.pod:144
31424 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
31428 #: ../src/guestfs-availability.pod:148
31429 msgid "B<zerofree>"
31433 #: ../src/guestfs-availability.pod:150
31434 msgid "The following functions: L</guestfs_zerofree>"
31438 #: ../src/guestfs-structs.pod:1
31439 msgid "guestfs_int_bool"
31443 #: ../src/guestfs-structs.pod:3
31446 " struct guestfs_int_bool {\n"
31454 #: ../src/guestfs-structs.pod:8
31457 " struct guestfs_int_bool_list {\n"
31458 " uint32_t len; /* Number of elements in list. */\n"
31459 " struct guestfs_int_bool *val; /* Elements. */\n"
31465 #: ../src/guestfs-structs.pod:13
31468 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
31469 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
31474 #: ../src/guestfs-structs.pod:16
31475 msgid "guestfs_lvm_pv"
31479 #: ../src/guestfs-structs.pod:18
31482 " struct guestfs_lvm_pv {\n"
31483 " char *pv_name;\n"
31484 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31485 " char pv_uuid[32];\n"
31487 " uint64_t pv_size;\n"
31488 " uint64_t dev_size;\n"
31489 " uint64_t pv_free;\n"
31490 " uint64_t pv_used;\n"
31491 " char *pv_attr;\n"
31492 " int64_t pv_pe_count;\n"
31493 " int64_t pv_pe_alloc_count;\n"
31494 " char *pv_tags;\n"
31495 " uint64_t pe_start;\n"
31496 " int64_t pv_mda_count;\n"
31497 " uint64_t pv_mda_free;\n"
31503 #: ../src/guestfs-structs.pod:36
31506 " struct guestfs_lvm_pv_list {\n"
31507 " uint32_t len; /* Number of elements in list. */\n"
31508 " struct guestfs_lvm_pv *val; /* Elements. */\n"
31514 #: ../src/guestfs-structs.pod:41
31517 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
31518 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
31523 #: ../src/guestfs-structs.pod:44
31524 msgid "guestfs_lvm_vg"
31528 #: ../src/guestfs-structs.pod:46
31531 " struct guestfs_lvm_vg {\n"
31532 " char *vg_name;\n"
31533 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31534 " char vg_uuid[32];\n"
31536 " char *vg_attr;\n"
31537 " uint64_t vg_size;\n"
31538 " uint64_t vg_free;\n"
31539 " char *vg_sysid;\n"
31540 " uint64_t vg_extent_size;\n"
31541 " int64_t vg_extent_count;\n"
31542 " int64_t vg_free_count;\n"
31543 " int64_t max_lv;\n"
31544 " int64_t max_pv;\n"
31545 " int64_t pv_count;\n"
31546 " int64_t lv_count;\n"
31547 " int64_t snap_count;\n"
31548 " int64_t vg_seqno;\n"
31549 " char *vg_tags;\n"
31550 " int64_t vg_mda_count;\n"
31551 " uint64_t vg_mda_free;\n"
31557 #: ../src/guestfs-structs.pod:69
31560 " struct guestfs_lvm_vg_list {\n"
31561 " uint32_t len; /* Number of elements in list. */\n"
31562 " struct guestfs_lvm_vg *val; /* Elements. */\n"
31568 #: ../src/guestfs-structs.pod:74
31571 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
31572 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
31577 #: ../src/guestfs-structs.pod:77
31578 msgid "guestfs_lvm_lv"
31582 #: ../src/guestfs-structs.pod:79
31585 " struct guestfs_lvm_lv {\n"
31586 " char *lv_name;\n"
31587 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
31588 " char lv_uuid[32];\n"
31589 " char *lv_attr;\n"
31590 " int64_t lv_major;\n"
31591 " int64_t lv_minor;\n"
31592 " int64_t lv_kernel_major;\n"
31593 " int64_t lv_kernel_minor;\n"
31594 " uint64_t lv_size;\n"
31595 " int64_t seg_count;\n"
31597 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31598 " float snap_percent;\n"
31599 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31600 " float copy_percent;\n"
31601 " char *move_pv;\n"
31602 " char *lv_tags;\n"
31603 " char *mirror_log;\n"
31604 " char *modules;\n"
31610 #: ../src/guestfs-structs.pod:101
31613 " struct guestfs_lvm_lv_list {\n"
31614 " uint32_t len; /* Number of elements in list. */\n"
31615 " struct guestfs_lvm_lv *val; /* Elements. */\n"
31621 #: ../src/guestfs-structs.pod:106
31624 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
31625 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
31630 #: ../src/guestfs-structs.pod:111
31633 " struct guestfs_stat {\n"
31637 " int64_t nlink;\n"
31642 " int64_t blksize;\n"
31643 " int64_t blocks;\n"
31644 " int64_t atime;\n"
31645 " int64_t mtime;\n"
31646 " int64_t ctime;\n"
31652 #: ../src/guestfs-structs.pod:127
31655 " struct guestfs_stat_list {\n"
31656 " uint32_t len; /* Number of elements in list. */\n"
31657 " struct guestfs_stat *val; /* Elements. */\n"
31663 #: ../src/guestfs-structs.pod:132
31666 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
31667 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
31672 #: ../src/guestfs-structs.pod:137
31675 " struct guestfs_statvfs {\n"
31676 " int64_t bsize;\n"
31677 " int64_t frsize;\n"
31678 " int64_t blocks;\n"
31679 " int64_t bfree;\n"
31680 " int64_t bavail;\n"
31681 " int64_t files;\n"
31682 " int64_t ffree;\n"
31683 " int64_t favail;\n"
31686 " int64_t namemax;\n"
31692 #: ../src/guestfs-structs.pod:151
31695 " struct guestfs_statvfs_list {\n"
31696 " uint32_t len; /* Number of elements in list. */\n"
31697 " struct guestfs_statvfs *val; /* Elements. */\n"
31703 #: ../src/guestfs-structs.pod:156
31706 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
31707 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
31712 #: ../src/guestfs-structs.pod:159
31713 msgid "guestfs_dirent"
31717 #: ../src/guestfs-structs.pod:161
31720 " struct guestfs_dirent {\n"
31729 #: ../src/guestfs-structs.pod:167
31732 " struct guestfs_dirent_list {\n"
31733 " uint32_t len; /* Number of elements in list. */\n"
31734 " struct guestfs_dirent *val; /* Elements. */\n"
31740 #: ../src/guestfs-structs.pod:172
31743 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
31744 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
31749 #: ../src/guestfs-structs.pod:177
31752 " struct guestfs_version {\n"
31753 " int64_t major;\n"
31754 " int64_t minor;\n"
31755 " int64_t release;\n"
31762 #: ../src/guestfs-structs.pod:184
31765 " struct guestfs_version_list {\n"
31766 " uint32_t len; /* Number of elements in list. */\n"
31767 " struct guestfs_version *val; /* Elements. */\n"
31773 #: ../src/guestfs-structs.pod:189
31776 " void guestfs_free_version (struct guestfs_free_version *);\n"
31777 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
31782 #: ../src/guestfs-structs.pod:192
31783 msgid "guestfs_xattr"
31787 #: ../src/guestfs-structs.pod:194
31790 " struct guestfs_xattr {\n"
31791 " char *attrname;\n"
31792 " /* The next two fields describe a byte array. */\n"
31793 " uint32_t attrval_len;\n"
31794 " char *attrval;\n"
31800 #: ../src/guestfs-structs.pod:201
31803 " struct guestfs_xattr_list {\n"
31804 " uint32_t len; /* Number of elements in list. */\n"
31805 " struct guestfs_xattr *val; /* Elements. */\n"
31811 #: ../src/guestfs-structs.pod:206
31814 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
31815 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
31820 #: ../src/guestfs-structs.pod:209
31821 msgid "guestfs_inotify_event"
31825 #: ../src/guestfs-structs.pod:211
31828 " struct guestfs_inotify_event {\n"
31829 " int64_t in_wd;\n"
31830 " uint32_t in_mask;\n"
31831 " uint32_t in_cookie;\n"
31832 " char *in_name;\n"
31838 #: ../src/guestfs-structs.pod:218
31841 " struct guestfs_inotify_event_list {\n"
31842 " uint32_t len; /* Number of elements in list. */\n"
31843 " struct guestfs_inotify_event *val; /* Elements. */\n"
31849 #: ../src/guestfs-structs.pod:223
31852 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
31853 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
31858 #: ../src/guestfs-structs.pod:226
31859 msgid "guestfs_partition"
31863 #: ../src/guestfs-structs.pod:228
31866 " struct guestfs_partition {\n"
31867 " int32_t part_num;\n"
31868 " uint64_t part_start;\n"
31869 " uint64_t part_end;\n"
31870 " uint64_t part_size;\n"
31876 #: ../src/guestfs-structs.pod:235
31879 " struct guestfs_partition_list {\n"
31880 " uint32_t len; /* Number of elements in list. */\n"
31881 " struct guestfs_partition *val; /* Elements. */\n"
31887 #: ../src/guestfs-structs.pod:240
31890 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
31891 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
31896 #: ../src/guestfs-structs.pod:243
31897 msgid "guestfs_application"
31901 #: ../src/guestfs-structs.pod:245
31904 " struct guestfs_application {\n"
31905 " char *app_name;\n"
31906 " char *app_display_name;\n"
31907 " int32_t app_epoch;\n"
31908 " char *app_version;\n"
31909 " char *app_release;\n"
31910 " char *app_install_path;\n"
31911 " char *app_trans_path;\n"
31912 " char *app_publisher;\n"
31913 " char *app_url;\n"
31914 " char *app_source_package;\n"
31915 " char *app_summary;\n"
31916 " char *app_description;\n"
31922 #: ../src/guestfs-structs.pod:260
31925 " struct guestfs_application_list {\n"
31926 " uint32_t len; /* Number of elements in list. */\n"
31927 " struct guestfs_application *val; /* Elements. */\n"
31933 #: ../src/guestfs-structs.pod:265
31936 " void guestfs_free_application (struct guestfs_free_application *);\n"
31937 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
31942 #: ../src/guestfs.pod:5
31943 msgid "guestfs - Library for accessing and modifying virtual machine images"
31947 #: ../src/guestfs.pod:11
31950 " guestfs_h *g = guestfs_create ();\n"
31951 " guestfs_add_drive (g, \"guest.img\");\n"
31952 " guestfs_launch (g);\n"
31953 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31954 " guestfs_touch (g, \"/hello\");\n"
31955 " guestfs_umount (g, \"/\");\n"
31956 " guestfs_close (g);\n"
31961 #: ../src/guestfs.pod:25
31963 "Libguestfs is a library for accessing and modifying guest disk images. "
31964 "Amongst the things this is good for: making batch configuration changes to "
31965 "guests, getting disk used/free statistics (see also: virt-df), migrating "
31966 "between virtualization systems (see also: virt-p2v), performing partial "
31967 "backups, performing partial guest clones, cloning guests and changing "
31968 "registry/UUID/hostname info, and much else besides."
31972 #: ../src/guestfs.pod:33
31974 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
31975 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
31976 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
31981 #: ../src/guestfs.pod:38
31983 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
31984 "what filesystem is in each LV, etc.). It can also run commands in the "
31985 "context of the guest. Also you can access filesystems over FUSE."
31989 #: ../src/guestfs.pod:43
31991 "Libguestfs is a library that can be linked with C and C++ management "
31992 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
31993 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
31998 #: ../src/guestfs.pod:48
32000 "You don't need to be root to use libguestfs, although obviously you do need "
32001 "enough permissions to access the disk images."
32005 #: ../src/guestfs.pod:51
32007 "Libguestfs is a large API because it can do many things. For a gentle "
32008 "introduction, please read the L</API OVERVIEW> section next."
32012 #: ../src/guestfs.pod:54
32014 "There are also some example programs in the L<guestfs-examples(3)> manual "
32019 #: ../src/guestfs.pod:57
32020 msgid "API OVERVIEW"
32024 #: ../src/guestfs.pod:59
32026 "This section provides a gentler overview of the libguestfs API. We also try "
32027 "to group API calls together, where that may not be obvious from reading "
32028 "about the individual calls in the main section of this manual."
32032 #: ../src/guestfs.pod:64
32037 #: ../src/guestfs.pod:66
32039 "Before you can use libguestfs calls, you have to create a handle. Then you "
32040 "must add at least one disk image to the handle, followed by launching the "
32041 "handle, then performing whatever operations you want, and finally closing "
32042 "the handle. By convention we use the single letter C<g> for the name of the "
32043 "handle variable, although of course you can use any name you want."
32047 #: ../src/guestfs.pod:73
32048 msgid "The general structure of all libguestfs-using programs looks like this:"
32052 #: ../src/guestfs.pod:76
32055 " guestfs_h *g = guestfs_create ();\n"
32060 #: ../src/guestfs.pod:78
32063 " /* Call guestfs_add_drive additional times if there are\n"
32064 " * multiple disk images.\n"
32066 " guestfs_add_drive (g, \"guest.img\");\n"
32071 #: ../src/guestfs.pod:83
32074 " /* Most manipulation calls won't work until you've launched\n"
32075 " * the handle 'g'. You have to do this _after_ adding drives\n"
32076 " * and _before_ other commands.\n"
32078 " guestfs_launch (g);\n"
32083 #: ../src/guestfs.pod:89
32086 " /* Now you can examine what partitions, LVs etc are available.\n"
32088 " char **partitions = guestfs_list_partitions (g);\n"
32089 " char **logvols = guestfs_lvs (g);\n"
32094 #: ../src/guestfs.pod:94
32097 " /* To access a filesystem in the image, you must mount it.\n"
32099 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32104 #: ../src/guestfs.pod:98
32107 " /* Now you can perform filesystem actions on the guest\n"
32110 " guestfs_touch (g, \"/hello\");\n"
32115 #: ../src/guestfs.pod:103
32118 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32119 " * it is done automatically when you close the handle. See\n"
32120 " * discussion of autosync in this page.\n"
32122 " guestfs_sync (g);\n"
32127 #: ../src/guestfs.pod:109
32130 " /* Close the handle 'g'. */\n"
32131 " guestfs_close (g);\n"
32136 #: ../src/guestfs.pod:112
32138 "The code above doesn't include any error checking. In real code you should "
32139 "check return values carefully for errors. In general all functions that "
32140 "return integers return C<-1> on error, and all functions that return "
32141 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32142 "how to handle errors, and consult the documentation for each function call "
32143 "below to see precisely how they return error indications. See L<guestfs-"
32144 "examples(3)> for fully worked examples."
32148 #: ../src/guestfs.pod:121
32149 msgid "DISK IMAGES"
32153 #: ../src/guestfs.pod:123
32155 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32156 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32157 "actual block device, or simply an empty file of zeroes that you have created "
32158 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32163 #: ../src/guestfs.pod:129
32165 "The call you should use in modern code for adding drives is L</"
32166 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32167 "specifying that the format is raw, do:"
32171 #: ../src/guestfs.pod:133
32174 " guestfs_add_drive_opts (g, filename,\n"
32175 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32181 #: ../src/guestfs.pod:137
32182 msgid "You can add a disk read-only using:"
32186 #: ../src/guestfs.pod:139
32189 " guestfs_add_drive_opts (g, filename,\n"
32190 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32191 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32197 #: ../src/guestfs.pod:144
32199 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32200 "libguestfs won't modify the file."
32204 #: ../src/guestfs.pod:147
32206 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32207 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32208 "corruption, but adding it read-only is safe."
32212 #: ../src/guestfs.pod:151
32214 "You must add at least one disk image, and you may add multiple disk images. "
32215 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32216 "first one you added), C</dev/sdb> (for the second one you added), etc."
32220 #: ../src/guestfs.pod:156
32222 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32223 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32224 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32228 #: ../src/guestfs.pod:161
32233 #: ../src/guestfs.pod:163
32235 "Before you can read or write files, create directories and so on in a disk "
32236 "image that contains filesystems, you have to mount those filesystems using "
32237 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32238 "a disk image contains (for example) one partition with a filesystem on that "
32239 "partition, then you can mount it directly:"
32243 #: ../src/guestfs.pod:170
32246 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32251 #: ../src/guestfs.pod:172
32253 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32254 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32255 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32256 "that these are libguestfs virtual devices, and are nothing to do with host "
32261 #: ../src/guestfs.pod:178
32263 "If you are given a disk image and you don't know what it contains then you "
32264 "have to find out. Libguestfs can do that too: use L</"
32265 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
32266 "LVs, and either try mounting each to see what is mountable, or else examine "
32267 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32268 "filesystems, use L</guestfs_list_filesystems>."
32272 #: ../src/guestfs.pod:186
32274 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32275 "L</INSPECTION> below). But you might find it easier to look at higher level "
32276 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32280 #: ../src/guestfs.pod:191
32282 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32283 "several other variations of the C<guestfs_mount_*> call."
32287 #: ../src/guestfs.pod:194
32288 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32292 #: ../src/guestfs.pod:196
32294 "The majority of the libguestfs API consists of fairly low-level calls for "
32295 "accessing and modifying the files, directories, symlinks etc on mounted "
32296 "filesystems. There are over a hundred such calls which you can find listed "
32297 "in detail below in this man page, and we don't even pretend to cover them "
32298 "all in this overview."
32302 #: ../src/guestfs.pod:202
32304 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32309 #: ../src/guestfs.pod:205
32311 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32312 "the file called C<\"etc/passwd\"> then you could do:"
32316 #: ../src/guestfs.pod:208
32319 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32324 #: ../src/guestfs.pod:210
32326 "This would return C<data> as a newly allocated buffer containing the full "
32327 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32328 "or C<NULL> if there was an error."
32332 #: ../src/guestfs.pod:214
32334 "As another example, to create a top-level directory on that filesystem "
32335 "called C<\"var\"> you would do:"
32339 #: ../src/guestfs.pod:217
32342 " guestfs_mkdir (g, \"/var\");\n"
32347 #: ../src/guestfs.pod:219
32348 msgid "To create a symlink you could do:"
32352 #: ../src/guestfs.pod:221
32355 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32356 " \"/etc/rc3.d/S30portmap\");\n"
32361 #: ../src/guestfs.pod:224
32363 "Libguestfs will reject attempts to use relative paths and there is no "
32364 "concept of a current working directory."
32368 #: ../src/guestfs.pod:227
32370 "Libguestfs can return errors in many situations: for example if the "
32371 "filesystem isn't writable, or if a file or directory that you requested "
32372 "doesn't exist. If you are using the C API (documented here) you have to "
32373 "check for those error conditions after each call. (Other language bindings "
32374 "turn these errors into exceptions)."
32378 #: ../src/guestfs.pod:233
32380 "File writes are affected by the per-handle umask, set by calling L</"
32381 "guestfs_umask> and defaulting to 022. See L</UMASK>."
32385 #: ../src/guestfs.pod:236
32386 msgid "PARTITIONING"
32390 #: ../src/guestfs.pod:238
32392 "Libguestfs contains API calls to read, create and modify partition tables on "
32397 #: ../src/guestfs.pod:241
32399 "In the common case where you want to create a single partition covering the "
32400 "whole disk, you should use the L</guestfs_part_disk> call:"
32404 #: ../src/guestfs.pod:245
32407 " const char *parttype = \"mbr\";\n"
32408 " if (disk_is_larger_than_2TB)\n"
32409 " parttype = \"gpt\";\n"
32410 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
32415 #: ../src/guestfs.pod:250
32417 "Obviously this effectively wipes anything that was on that disk image before."
32421 #: ../src/guestfs.pod:253
32426 #: ../src/guestfs.pod:255
32428 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
32429 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
32430 "you familiarize yourself with the concepts of physical volumes, volume "
32431 "groups and logical volumes."
32435 #: ../src/guestfs.pod:260
32437 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
32438 "tldp.org/HOWTO/LVM-HOWTO/>."
32442 #: ../src/guestfs.pod:263
32443 msgid "DOWNLOADING"
32447 #: ../src/guestfs.pod:265
32449 "Use L</guestfs_cat> to download small, text only files. This call is "
32450 "limited to files which are less than 2 MB and which cannot contain any ASCII "
32451 "NUL (C<\\0>) characters. However the API is very simple to use."
32455 #: ../src/guestfs.pod:269
32457 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
32458 "bit data, since it returns a (pointer, size) pair. However it is still "
32459 "limited to \"small\" files, less than 2 MB."
32463 #: ../src/guestfs.pod:273
32465 "L</guestfs_download> can be used to download any file, with no limits on "
32466 "content or size (even files larger than 4 GB)."
32470 #: ../src/guestfs.pod:276
32472 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
32476 #: ../src/guestfs.pod:279
32481 #: ../src/guestfs.pod:281
32483 "It's often the case that you want to write a file or files to the disk image."
32487 #: ../src/guestfs.pod:284
32489 "To write a small file with fixed content, use L</guestfs_write>. To create "
32490 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
32491 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
32492 "of other functions for creating test files, for example L</guestfs_fill> and "
32493 "L</guestfs_fill_pattern>."
32497 #: ../src/guestfs.pod:290
32499 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
32500 "file content or size (even files larger than 4 GB)."
32504 #: ../src/guestfs.pod:293
32506 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
32510 #: ../src/guestfs.pod:295
32512 "However the fastest way to upload I<large numbers of arbitrary files> is to "
32513 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
32514 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
32515 "in a predictable way (eg. adding it last after all other drives) then you "
32516 "can get the device name from L</guestfs_list_devices> and mount it directly "
32517 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
32518 "portable between kernel versions, and they don't support labels or UUIDs. "
32519 "If you want to pre-build an image or you need to mount it using a label or "
32520 "UUID, use an ISO image instead."
32524 #: ../src/guestfs.pod:306
32529 #: ../src/guestfs.pod:308
32531 "There are various different commands for copying between files and devices "
32532 "and in and out of the guest filesystem. These are summarised in the table "
32537 #: ../src/guestfs.pod:314
32538 msgid "B<file> to B<file>"
32542 #: ../src/guestfs.pod:316
32544 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
32545 "directories recursively."
32549 #: ../src/guestfs.pod:319
32550 msgid "B<file or device> to B<file or device>"
32554 #: ../src/guestfs.pod:321
32556 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
32557 "devices in the guest."
32561 #: ../src/guestfs.pod:324
32562 msgid "Example: duplicate the contents of an LV:"
32566 #: ../src/guestfs.pod:326
32569 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
32574 #: ../src/guestfs.pod:328
32576 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
32577 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
32578 "guestfs_copy_size>."
32582 #: ../src/guestfs.pod:332
32583 msgid "B<file on the host> to B<file or device>"
32587 #: ../src/guestfs.pod:334
32588 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
32592 #: ../src/guestfs.pod:336
32593 msgid "B<file or device> to B<file on the host>"
32597 #: ../src/guestfs.pod:338
32598 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
32602 #: ../src/guestfs.pod:342
32603 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
32607 #: ../src/guestfs.pod:344
32609 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
32610 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
32611 "appears you can only upload and download to files. However many Un*x-like "
32612 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
32613 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
32614 "and arbitrary file descriptor N."
32618 #: ../src/guestfs.pod:352
32619 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
32623 #: ../src/guestfs.pod:355
32626 " guestfs_download (g, filename, \"/dev/stdout\");\n"
32631 #: ../src/guestfs.pod:357
32632 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
32636 #: ../src/guestfs.pod:359
32639 " char devfd[64];\n"
32640 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
32641 " guestfs_tar_out (g, \"/\", devfd);\n"
32646 #: ../src/guestfs.pod:363
32647 msgid "LISTING FILES"
32651 #: ../src/guestfs.pod:365
32653 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
32654 "L<guestfish(1)>-equivalent command C<ll>)."
32658 #: ../src/guestfs.pod:368
32660 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
32661 "programs, as a flat list of strings."
32665 #: ../src/guestfs.pod:371
32667 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
32668 "directory, plus additional information about each one. It is more "
32669 "equivalent to using the L<readdir(3)> call on a local filesystem."
32673 #: ../src/guestfs.pod:375
32675 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
32679 #: ../src/guestfs.pod:378
32680 msgid "RUNNING COMMANDS"
32684 #: ../src/guestfs.pod:380
32686 "Although libguestfs is primarily an API for manipulating files inside guest "
32687 "images, we also provide some limited facilities for running commands inside "
32692 #: ../src/guestfs.pod:384
32693 msgid "There are many limitations to this:"
32697 #: ../src/guestfs.pod:390
32699 "The kernel version that the command runs under will be different from what "
32704 #: ../src/guestfs.pod:395
32706 "If the command needs to communicate with daemons, then most likely they "
32707 "won't be running."
32711 #: ../src/guestfs.pod:400
32712 msgid "The command will be running in limited memory."
32716 #: ../src/guestfs.pod:404
32718 "The network may not be available unless you enable it (see L</"
32719 "guestfs_set_network>)."
32723 #: ../src/guestfs.pod:409
32724 msgid "Only supports Linux guests (not Windows, BSD, etc)."
32728 #: ../src/guestfs.pod:413
32730 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
32734 #: ../src/guestfs.pod:418
32736 "For SELinux guests, you may need to enable SELinux and load policy first. "
32737 "See L</SELINUX> in this manpage."
32741 #: ../src/guestfs.pod:423
32743 "I<Security:> It is not safe to run commands from untrusted, possibly "
32744 "malicious guests. These commands may attempt to exploit your program by "
32745 "sending unexpected output. They could also try to exploit the Linux kernel "
32746 "or qemu provided by the libguestfs appliance. They could use the network "
32747 "provided by the libguestfs appliance to bypass ordinary network partitions "
32748 "and firewalls. They could use the elevated privileges or different SELinux "
32749 "context of your program to their advantage."
32753 #: ../src/guestfs.pod:432
32755 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
32756 "(a script which runs when the guest next boots normally), and to have this "
32757 "script run the commands you want in the normal context of the running guest, "
32758 "network security and so on. For information about other security issues, "
32759 "see L</SECURITY>."
32763 #: ../src/guestfs.pod:440
32765 "The two main API calls to run commands are L</guestfs_command> and L</"
32766 "guestfs_sh> (there are also variations)."
32770 #: ../src/guestfs.pod:443
32772 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
32773 "shell globs, redirections, etc will work."
32777 #: ../src/guestfs.pod:446
32778 msgid "CONFIGURATION FILES"
32782 #: ../src/guestfs.pod:448
32784 "To read and write configuration files in Linux guest filesystems, we "
32785 "strongly recommend using Augeas. For example, Augeas understands how to "
32786 "read and write, say, a Linux shadow password file or X.org configuration "
32787 "file, and so avoids you having to write that code."
32791 #: ../src/guestfs.pod:453
32793 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
32794 "document Augeas itself here because there is excellent documentation on the "
32795 "L<http://augeas.net/> website."
32799 #: ../src/guestfs.pod:457
32801 "If you don't want to use Augeas (you fool!) then try calling L</"
32802 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
32807 #: ../src/guestfs.pod:461
32812 #: ../src/guestfs.pod:463
32814 "We support SELinux guests. To ensure that labeling happens correctly in "
32815 "SELinux guests, you need to enable SELinux and load the guest's policy:"
32819 #: ../src/guestfs.pod:471
32820 msgid "Before launching, do:"
32824 #: ../src/guestfs.pod:473
32827 " guestfs_set_selinux (g, 1);\n"
32832 #: ../src/guestfs.pod:477
32834 "After mounting the guest's filesystem(s), load the policy. This is best "
32835 "done by running the L<load_policy(8)> command in the guest itself:"
32839 #: ../src/guestfs.pod:481
32842 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
32847 #: ../src/guestfs.pod:483
32849 "(Older versions of C<load_policy> require you to specify the name of the "
32854 #: ../src/guestfs.pod:488
32856 "Optionally, set the security context for the API. The correct security "
32857 "context to use can only be known by inspecting the guest. As an example:"
32861 #: ../src/guestfs.pod:492
32864 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
32869 #: ../src/guestfs.pod:496
32870 msgid "This will work for running commands and editing existing files."
32874 #: ../src/guestfs.pod:498
32876 "When new files are created, you may need to label them explicitly, for "
32877 "example by running the external command C<restorecon pathname>."
32881 #: ../src/guestfs.pod:502
32886 #: ../src/guestfs.pod:504
32888 "Certain calls are affected by the current file mode creation mask (the "
32889 "\"umask\"). In particular ones which create files or directories, such as "
32890 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
32891 "either the default mode that the file is created with or modifies the mode "
32896 #: ../src/guestfs.pod:510
32898 "The default umask is C<022>, so files are created with modes such as C<0644> "
32899 "and directories with C<0755>."
32903 #: ../src/guestfs.pod:513
32905 "There are two ways to avoid being affected by umask. Either set umask to 0 "
32906 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
32907 "guestfs_chmod> after creating each file or directory."
32911 #: ../src/guestfs.pod:517
32912 msgid "For more information about umask, see L<umask(2)>."
32916 #: ../src/guestfs.pod:521
32918 "Libguestfs allows you to access Linux guests which have been encrypted using "
32919 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
32920 "standard. This includes nearly all whole disk encryption systems used by "
32921 "modern Linux guests."
32925 #: ../src/guestfs.pod:527
32927 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
32928 "returns the string C<crypto_LUKS>)."
32932 #: ../src/guestfs.pod:530
32934 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
32935 "will require the passphrase!"
32939 #: ../src/guestfs.pod:533
32941 "Opening a LUKS device creates a new device mapper device called C</dev/"
32942 "mapper/mapname> (where C<mapname> is the string you supply to L</"
32943 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
32944 "from and encrypted to the underlying block device respectively."
32948 #: ../src/guestfs.pod:539
32950 "LVM volume groups on the device can be made visible by calling L</"
32951 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
32952 "(s) can now be mounted in the usual way."
32956 #: ../src/guestfs.pod:543
32958 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
32959 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
32960 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
32961 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
32962 "underlying encrypted block device)."
32966 #: ../src/guestfs.pod:550
32971 #: ../src/guestfs.pod:552
32973 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
32974 "contains operating systems, an install CD or a live CD. (These APIs used to "
32975 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
32976 "version 1.5.3 the most frequently used part of this library has been "
32977 "rewritten in C and moved into the core code)."
32981 #: ../src/guestfs.pod:559
32983 "Add all disks belonging to the unknown virtual machine and call L</"
32984 "guestfs_launch> in the usual way."
32988 #: ../src/guestfs.pod:562
32990 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
32991 "and certain heuristics, and returns a list of operating systems that were "
32992 "found. An empty list means none were found. A single element is the root "
32993 "filesystem of the operating system. For dual- or multi-boot guests, "
32994 "multiple roots can be returned, each one corresponding to a separate "
32995 "operating system. (Multi-boot virtual machines are extremely rare in the "
32996 "world of virtualization, but since this scenario can happen, we have built "
32997 "libguestfs to deal with it.)"
33001 #: ../src/guestfs.pod:571
33003 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33004 "to get additional details about that operating system. For example, call L</"
33005 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33006 "Windows and Linux-based operating systems respectively."
33010 #: ../src/guestfs.pod:577
33012 "Un*x-like and Linux-based operating systems usually consist of several "
33013 "filesystems which are mounted at boot time (for example, a separate boot "
33014 "partition mounted on C</boot>). The inspection rules are able to detect how "
33015 "filesystems correspond to mount points. Call "
33016 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33017 "hash table like this example:"
33021 #: ../src/guestfs.pod:584
33024 " /boot => /dev/sda1\n"
33025 " / => /dev/vg_guest/lv_root\n"
33026 " /usr => /dev/vg_guest/lv_usr\n"
33031 #: ../src/guestfs.pod:588
33033 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33034 "filesystems as suggested."
33038 #: ../src/guestfs.pod:591
33040 "Be careful to mount filesystems in the right order (eg. C</> before C</"
33041 "usr>). Sorting the keys of the hash by length, shortest first, should work."
33045 #: ../src/guestfs.pod:595
33047 "Inspection currently only works for some common operating systems. "
33048 "Contributors are welcome to send patches for other operating systems that we "
33049 "currently cannot detect."
33053 #: ../src/guestfs.pod:599
33055 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33056 "for more details. The L</guestfs_inspect_os> function just ignores any "
33057 "encrypted devices."
33061 #: ../src/guestfs.pod:603
33063 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33064 "inspection and caches the results in the guest handle. Subsequent calls to "
33065 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
33066 "read the disks. If you change the content of the guest disks, you can redo "
33067 "inspection by calling L</guestfs_inspect_os> again. (L</"
33068 "guestfs_inspect_list_applications> works a little differently from the other "
33069 "calls and does read the disks. See documentation for that function for "
33074 #: ../src/guestfs.pod:612
33075 msgid "INSPECTING INSTALL DISKS"
33079 #: ../src/guestfs.pod:614
33081 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33086 #: ../src/guestfs.pod:617
33088 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33089 "system, which currently can be C<installed> (a regular operating system) or "
33090 "C<installer> (some sort of install disk)."
33094 #: ../src/guestfs.pod:621
33096 "Further information is available about the operating system that can be "
33097 "installed using the regular inspection APIs like L</"
33098 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
33102 #: ../src/guestfs.pod:626
33104 "Some additional information specific to installer disks is also available "
33105 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
33106 "guestfs_inspect_is_multipart> calls."
33110 #: ../src/guestfs.pod:631
33111 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33115 #: ../src/guestfs.pod:633
33117 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
33118 "ntfs-3g.org/> driver."
33122 #: ../src/guestfs.pod:636
33123 msgid "DRIVE LETTERS AND PATHS"
33127 #: ../src/guestfs.pod:638
33129 "DOS and Windows still use drive letters, and the filesystems are always "
33130 "treated as case insensitive by Windows itself, and therefore you might find "
33131 "a Windows configuration file referring to a path like C<c:\\windows"
33132 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
33133 "might be referred to as C</WINDOWS/System32>."
33137 #: ../src/guestfs.pod:644
33139 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33140 "L</guestfs_inspect_get_drive_mappings>)"
33144 #: ../src/guestfs.pod:647
33146 "Dealing with separator characters (backslash vs forward slash) is outside "
33147 "the scope of libguestfs, but usually a simple character replacement will "
33152 #: ../src/guestfs.pod:651
33154 "To resolve the case insensitivity of paths, call L</"
33155 "guestfs_case_sensitive_path>."
33159 #: ../src/guestfs.pod:654
33160 msgid "ACCESSING THE WINDOWS REGISTRY"
33164 #: ../src/guestfs.pod:656
33166 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33167 "files, through the library C<hivex> which is part of the libguestfs project "
33168 "although ships as a separate tarball. You have to locate and download the "
33169 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33170 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
33171 "reg(1)> for more help on this issue."
33175 #: ../src/guestfs.pod:664
33176 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33180 #: ../src/guestfs.pod:666
33182 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33183 "provide something which looks like a Linux symlink. The way it tries to do "
33184 "the rewriting is described here:"
33188 #: ../src/guestfs.pod:670
33190 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
33195 #: ../src/guestfs.pod:672
33197 "The essential problem is that ntfs-3g simply does not have enough "
33198 "information to do a correct job. NTFS links can contain drive letters and "
33199 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33200 "It is almost certainly the case that libguestfs callers should ignore what "
33201 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33205 #: ../src/guestfs.pod:679
33207 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
33208 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33209 "attribute, and read the raw reparse data from that (you can find the format "
33210 "documented in various places around the web)."
33214 #: ../src/guestfs.pod:684
33215 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33219 #: ../src/guestfs.pod:686
33221 "There are other useful extended attributes that can be read from ntfs-3g "
33222 "filesystems (using L</guestfs_getxattr>). See:"
33226 #: ../src/guestfs.pod:689
33228 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33232 #: ../src/guestfs.pod:691
33233 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33237 #: ../src/guestfs.pod:693
33239 "Although we don't want to discourage you from using the C API, we will "
33240 "mention here that the same API is also available in other languages."
33244 #: ../src/guestfs.pod:696
33246 "The API is broadly identical in all supported languages. This means that "
33247 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33248 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33249 "OCaml. In other words, a straightforward, predictable isomorphism between "
33254 #: ../src/guestfs.pod:702
33256 "Error messages are automatically transformed into exceptions if the language "
33261 #: ../src/guestfs.pod:705
33263 "We don't try to \"object orientify\" parts of the API in OO languages, "
33264 "although contributors are welcome to write higher level APIs above what we "
33265 "provide in their favourite languages if they wish."
33269 #: ../src/guestfs.pod:711
33274 #: ../src/guestfs.pod:713
33276 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33277 "identical to the C API. C++ classes and exceptions are not used."
33281 #: ../src/guestfs.pod:717
33286 #: ../src/guestfs.pod:719
33288 "The C# bindings are highly experimental. Please read the warnings at the "
33289 "top of C<csharp/Libguestfs.cs>."
33293 #: ../src/guestfs.pod:722
33298 #: ../src/guestfs.pod:724
33299 msgid "See L<guestfs-erlang(3)>."
33303 #: ../src/guestfs.pod:726
33308 #: ../src/guestfs.pod:728
33310 "This is the only language binding that is working but incomplete. Only "
33311 "calls which return simple integers have been bound in Haskell, and we are "
33312 "looking for help to complete this binding."
33316 #: ../src/guestfs.pod:732
33321 #: ../src/guestfs.pod:734
33323 "Full documentation is contained in the Javadoc which is distributed with "
33324 "libguestfs. For examples, see L<guestfs-java(3)>."
33328 #: ../src/guestfs.pod:737
33333 #: ../src/guestfs.pod:739
33334 msgid "See L<guestfs-ocaml(3)>."
33338 #: ../src/guestfs.pod:741
33343 #: ../src/guestfs.pod:743
33344 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33348 #: ../src/guestfs.pod:745
33353 #: ../src/guestfs.pod:747
33355 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33356 "the php-libguestfs package for your distribution."
33360 #: ../src/guestfs.pod:750
33361 msgid "The PHP binding only works correctly on 64 bit machines."
33365 #: ../src/guestfs.pod:752
33370 #: ../src/guestfs.pod:754
33371 msgid "See L<guestfs-python(3)>."
33375 #: ../src/guestfs.pod:756
33380 #: ../src/guestfs.pod:758
33381 msgid "See L<guestfs-ruby(3)>."
33385 #: ../src/guestfs.pod:760
33386 msgid "B<shell scripts>"
33390 #: ../src/guestfs.pod:762
33391 msgid "See L<guestfish(1)>."
33395 #: ../src/guestfs.pod:766
33396 msgid "LIBGUESTFS GOTCHAS"
33400 #: ../src/guestfs.pod:768
33402 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
33403 "system [...] that works in the way it is documented but is counterintuitive "
33404 "and almost invites mistakes.\""
33408 #: ../src/guestfs.pod:772
33410 "Since we developed libguestfs and the associated tools, there are several "
33411 "things we would have designed differently, but are now stuck with for "
33412 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
33413 "release, you can expect these to change. Beware of them."
33417 #: ../src/guestfs.pod:780
33418 msgid "Autosync / forgetting to sync."
33422 #: ../src/guestfs.pod:782
33424 "I<Update:> Autosync is enabled by default for all API users starting from "
33425 "libguestfs 1.5.24. This section only applies to older versions."
33429 #: ../src/guestfs.pod:785
33431 "When modifying a filesystem from C or another language, you B<must> unmount "
33432 "all filesystems and call L</guestfs_sync> explicitly before you close the "
33433 "libguestfs handle. You can also call:"
33437 #: ../src/guestfs.pod:789
33440 " guestfs_set_autosync (g, 1);\n"
33445 #: ../src/guestfs.pod:791
33447 "to have the unmount/sync done automatically for you when the handle 'g' is "
33448 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
33452 #: ../src/guestfs.pod:795
33454 "If you forget to do this, then it is entirely possible that your changes "
33455 "won't be written out, or will be partially written, or (very rarely) that "
33456 "you'll get disk corruption."
33460 #: ../src/guestfs.pod:799
33462 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
33463 "guestfish scripts that forget to sync will work just fine, which can make "
33464 "this very puzzling if you are trying to debug a problem."
33468 #: ../src/guestfs.pod:803
33469 msgid "Mount option C<-o sync> should not be the default."
33473 #: ../src/guestfs.pod:805
33475 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
33476 "libguestfs 1.13.16. This section only applies to older versions."
33480 #: ../src/guestfs.pod:808
33482 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
33483 "However C<-o sync> does not add any reliability benefit, but does have a "
33484 "very large performance impact."
33488 #: ../src/guestfs.pod:812
33490 "The work around is to use L</guestfs_mount_options> and set the mount "
33491 "options that you actually want to use."
33495 #: ../src/guestfs.pod:815
33496 msgid "Read-only should be the default."
33500 #: ../src/guestfs.pod:817
33502 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
33503 "specify I<--rw> if you want to make changes to the image."
33507 #: ../src/guestfs.pod:820
33508 msgid "This would reduce the potential to corrupt live VM images."
33512 #: ../src/guestfs.pod:822
33514 "Note that many filesystems change the disk when you just mount and unmount, "
33515 "even if you didn't perform any writes. You need to use L</"
33516 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
33520 #: ../src/guestfs.pod:826
33521 msgid "guestfish command line is hard to use."
33525 #: ../src/guestfs.pod:828
33527 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
33528 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
33529 "exist, so it fails. In earlier versions of guestfish the error message was "
33530 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
33531 "we should have used C<guestfish -c command> to run commands."
33535 #: ../src/guestfs.pod:835
33536 msgid "guestfish megabyte modifiers don't work right on all commands"
33540 #: ../src/guestfs.pod:837
33542 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
33543 "other modifiers). What guestfish actually does is to multiply the number "
33544 "part by the modifier part and pass the result to the C API. However this "
33545 "doesn't work for a few APIs which aren't expecting bytes, but are already "
33546 "expecting some other unit (eg. megabytes)."
33550 #: ../src/guestfs.pod:844
33551 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
33555 #: ../src/guestfs.pod:846
33558 " lvcreate LV VG 100M\n"
33563 #: ../src/guestfs.pod:848
33565 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
33566 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
33567 "megabytes * megabytes) logical volume. The error message you get from this "
33568 "is also a little obscure."
33572 #: ../src/guestfs.pod:853
33574 "This could be fixed in the generator by specially marking parameters and "
33575 "return values which take bytes or other units."
33579 #: ../src/guestfs.pod:856
33580 msgid "Ambiguity between devices and paths"
33584 #: ../src/guestfs.pod:858
33586 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
33587 "sdb2>) and a similar pathname. A file might just happen to be called "
33588 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
33592 #: ../src/guestfs.pod:863
33594 "In the current API we usually resolve this ambiguity by having two separate "
33595 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
33596 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
33597 "detecting if the path supplied begins with C</dev/>."
33601 #: ../src/guestfs.pod:869
33603 "To avoid both the ambiguity and the need to duplicate some calls, we could "
33604 "make paths/devices into structured names. One way to do this would be to "
33605 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
33606 "aspect of grub. Another way would be to use a structured type, equivalent "
33607 "to this OCaml type:"
33611 #: ../src/guestfs.pod:875
33614 " type path = Path of string | Device of int | Partition of int * int\n"
33619 #: ../src/guestfs.pod:877
33620 msgid "which would allow you to pass arguments like:"
33624 #: ../src/guestfs.pod:879
33627 " Path \"/foo/bar\"\n"
33628 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
33629 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
33630 " Path \"/dev/sdb2\" (* not a device *)\n"
33635 #: ../src/guestfs.pod:884
33637 "As you can see there are still problems to resolve even with this "
33638 "representation. Also consider how it might work in guestfish."
33642 #: ../src/guestfs.pod:889
33643 msgid "KEYS AND PASSPHRASES"
33647 #: ../src/guestfs.pod:891
33649 "Certain libguestfs calls take a parameter that contains sensitive key "
33650 "material, passed in as a C string."
33654 #: ../src/guestfs.pod:894
33656 "In the future we would hope to change the libguestfs implementation so that "
33657 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
33658 "swap. However this is I<not> done at the moment, because of the complexity "
33659 "of such an implementation."
33663 #: ../src/guestfs.pod:899
33665 "Therefore you should be aware that any key parameter you pass to libguestfs "
33666 "might end up being written out to the swap partition. If this is a concern, "
33667 "scrub the swap partition or don't use libguestfs on encrypted devices."
33671 #: ../src/guestfs.pod:904
33672 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
33676 #: ../src/guestfs.pod:906
33678 "All high-level libguestfs actions are synchronous. If you want to use "
33679 "libguestfs asynchronously then you must create a thread."
33683 #: ../src/guestfs.pod:909
33685 "Only use the handle from a single thread. Either use the handle exclusively "
33686 "from one thread, or provide your own mutex so that two threads cannot issue "
33687 "calls on the same handle at the same time."
33691 #: ../src/guestfs.pod:913
33693 "See the graphical program guestfs-browser for one possible architecture for "
33694 "multithreaded programs using libvirt and libguestfs."
33698 #: ../src/guestfs.pod:916
33703 #: ../src/guestfs.pod:918
33705 "Libguestfs needs a supermin appliance, which it finds by looking along an "
33710 #: ../src/guestfs.pod:921
33712 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
33713 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
33717 #: ../src/guestfs.pod:924
33719 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
33720 "to change the directories that libguestfs will search in. The value is a "
33721 "colon-separated list of paths. The current directory is I<not> searched "
33722 "unless the path contains an empty element or C<.>. For example "
33723 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
33724 "then C</usr/lib/guestfs>."
33728 #: ../src/guestfs.pod:931
33729 msgid "QEMU WRAPPERS"
33733 #: ../src/guestfs.pod:933
33735 "If you want to compile your own qemu, run qemu from a non-standard location, "
33736 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
33741 #: ../src/guestfs.pod:937
33743 "There is one important rule to remember: you I<must C<exec qemu>> as the "
33744 "last command in the shell script (so that qemu replaces the shell and "
33745 "becomes the direct child of the libguestfs-using program). If you don't do "
33746 "this, then the qemu process won't be cleaned up correctly."
33750 #: ../src/guestfs.pod:942
33752 "Here is an example of a wrapper, where I have built my own copy of qemu from "
33757 #: ../src/guestfs.pod:945
33761 " qemudir=/home/rjones/d/qemu\n"
33762 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
33767 #: ../src/guestfs.pod:949
33769 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
33770 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
33775 #: ../src/guestfs.pod:953
33778 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
33783 #: ../src/guestfs.pod:955
33785 "Note that libguestfs also calls qemu with the -help and -version options in "
33786 "order to determine features."
33790 #: ../src/guestfs.pod:958
33792 "Wrappers can also be used to edit the options passed to qemu. In the "
33793 "following example, the C<-machine ...> option (C<-machine> and the following "
33794 "argument) are removed from the command line and replaced with C<-machine pc,"
33795 "accel=tcg>. The while loop iterates over the options until it finds the "
33796 "right one to remove, putting the remaining options into the C<args> array."
33800 #: ../src/guestfs.pod:965
33808 #: ../src/guestfs.pod:967
33812 " while [ $# -gt 0 ]; do\n"
33813 " case \"$1\" in\n"
33817 " args[i]=\"$1\"\n"
33826 #: ../src/guestfs.pod:979
33829 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
33834 #: ../src/guestfs.pod:981
33835 msgid "ATTACHING TO RUNNING DAEMONS"
33839 #: ../src/guestfs.pod:983
33841 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
33842 "babies. Use with caution."
33846 #: ../src/guestfs.pod:986
33848 "I<Note (2):> This section explains how to attach to a running daemon from a "
33849 "low level perspective. For most users, simply using virt tools such as "
33850 "L<guestfish(1)> with the I<--live> option will \"just work\"."
33854 #: ../src/guestfs.pod:990
33855 msgid "Using guestfs_set_attach_method"
33859 #: ../src/guestfs.pod:992
33861 "By calling L</guestfs_set_attach_method> you can change how the library "
33862 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
33863 "ARCHITECTURE> for some background)."
33867 #: ../src/guestfs.pod:996
33869 "The normal attach method is C<appliance>, where a small appliance is created "
33870 "containing the daemon, and then the library connects to this."
33874 #: ../src/guestfs.pod:999
33876 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
33877 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
33878 "daemon over the Unix domain socket."
33882 #: ../src/guestfs.pod:1003
33884 "The normal use for this is to connect to a running virtual machine that "
33885 "contains a C<guestfsd> daemon, and send commands so you can read and write "
33886 "files inside the live virtual machine."
33890 #: ../src/guestfs.pod:1007
33891 msgid "Using guestfs_add_domain with live flag"
33895 #: ../src/guestfs.pod:1009
33897 "L</guestfs_add_domain> provides some help for getting the correct attach "
33898 "method. If you pass the C<live> option to this function, then (if the "
33899 "virtual machine is running) it will examine the libvirt XML looking for a "
33900 "virtio-serial channel to connect to:"
33904 #: ../src/guestfs.pod:1015
33911 " <channel type='unix'>\n"
33912 " <source mode='bind' path='/path/to/socket'/>\n"
33913 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
33922 #: ../src/guestfs.pod:1027
33924 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
33925 "method to C<unix:/path/to/socket>."
33929 #: ../src/guestfs.pod:1030
33931 "Some of the libguestfs tools (including guestfish) support a I<--live> "
33932 "option which is passed through to L</guestfs_add_domain> thus allowing you "
33933 "to attach to and modify live virtual machines."
33937 #: ../src/guestfs.pod:1034
33939 "The virtual machine needs to have been set up beforehand so that it has the "
33940 "virtio-serial channel and so that guestfsd is running inside it."
33944 #: ../src/guestfs.pod:1038
33945 msgid "ABI GUARANTEE"
33949 #: ../src/guestfs.pod:1040
33951 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
33952 "actions as outlined in this section. Although we will deprecate some "
33953 "actions, for example if they get replaced by newer calls, we will keep the "
33954 "old actions forever. This allows you the developer to program in confidence "
33955 "against the libguestfs API."
33959 #: ../src/guestfs.pod:1046
33960 msgid "BLOCK DEVICE NAMING"
33964 #: ../src/guestfs.pod:1048
33966 "In the kernel there is now quite a profusion of schemata for naming block "
33967 "devices (in this context, by I<block device> I mean a physical or virtual "
33968 "hard drive). The original Linux IDE driver used names starting with C</dev/"
33969 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
33970 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
33971 "for the old IDE driver (particularly for SATA devices) those devices also "
33972 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
33973 "paravirtualized drivers. This has created several different naming systems, "
33974 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
33978 #: ../src/guestfs.pod:1060
33980 "As discussed above, libguestfs uses a qemu appliance running an embedded "
33981 "Linux kernel to access block devices. We can run a variety of appliances "
33982 "based on a variety of Linux kernels."
33986 #: ../src/guestfs.pod:1064
33988 "This causes a problem for libguestfs because many API calls use device or "
33989 "partition names. Working scripts and the recipe (example) scripts that we "
33990 "make available over the internet could fail if the naming scheme changes."
33994 #: ../src/guestfs.pod:1069
33996 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
33997 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
33998 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
33999 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34003 #: ../src/guestfs.pod:1075
34005 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34006 "L</guestfs_list_partitions> and similar calls return the true names of the "
34007 "devices and partitions as known to the appliance."
34011 #: ../src/guestfs.pod:1080
34012 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34016 #: ../src/guestfs.pod:1082
34018 "Usually this translation is transparent. However in some (very rare) cases "
34019 "you may need to know the exact algorithm. Such cases include where you use "
34020 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
34021 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
34025 #: ../src/guestfs.pod:1088
34027 "The algorithm is applied only to I<parameters> which are known to be either "
34028 "device or partition names. Return values from functions such as L</"
34029 "guestfs_list_devices> are never changed."
34033 #: ../src/guestfs.pod:1096
34034 msgid "Is the string a parameter which is a device or partition name?"
34038 #: ../src/guestfs.pod:1100
34039 msgid "Does the string begin with C</dev/sd>?"
34043 #: ../src/guestfs.pod:1104
34045 "Does the named device exist? If so, we use that device. However if I<not> "
34046 "then we continue with this algorithm."
34050 #: ../src/guestfs.pod:1109
34051 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34055 #: ../src/guestfs.pod:1111
34056 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34060 #: ../src/guestfs.pod:1113
34061 msgid "If that named device exists, use it. If not, continue."
34065 #: ../src/guestfs.pod:1117
34066 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34070 #: ../src/guestfs.pod:1119
34071 msgid "If that named device exists, use it. If not, return an error."
34075 #: ../src/guestfs.pod:1123
34076 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34080 #: ../src/guestfs.pod:1125
34082 "Although the standard naming scheme and automatic translation is useful for "
34083 "simple programs and guestfish scripts, for larger programs it is best not to "
34084 "rely on this mechanism."
34088 #: ../src/guestfs.pod:1129
34090 "Where possible for maximum future portability programs using libguestfs "
34091 "should use these future-proof techniques:"
34095 #: ../src/guestfs.pod:1136
34097 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34098 "device names, and then use those names directly."
34102 #: ../src/guestfs.pod:1139
34104 "Since those device names exist by definition, they will never be translated."
34108 #: ../src/guestfs.pod:1144
34110 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34111 "filesystem labels."
34115 #: ../src/guestfs.pod:1149
34120 #: ../src/guestfs.pod:1151
34122 "This section discusses security implications of using libguestfs, "
34123 "particularly with untrusted or malicious guests or disk images."
34127 #: ../src/guestfs.pod:1154
34128 msgid "GENERAL SECURITY CONSIDERATIONS"
34132 #: ../src/guestfs.pod:1156
34134 "Be careful with any files or data that you download from a guest (by "
34135 "\"download\" we mean not just the L</guestfs_download> command but any "
34136 "command that reads files, filenames, directories or anything else from a "
34137 "disk image). An attacker could manipulate the data to fool your program "
34138 "into doing the wrong thing. Consider cases such as:"
34142 #: ../src/guestfs.pod:1166
34143 msgid "the data (file etc) not being present"
34147 #: ../src/guestfs.pod:1170
34148 msgid "being present but empty"
34152 #: ../src/guestfs.pod:1174
34153 msgid "being much larger than normal"
34157 #: ../src/guestfs.pod:1178
34158 msgid "containing arbitrary 8 bit data"
34162 #: ../src/guestfs.pod:1182
34163 msgid "being in an unexpected character encoding"
34167 #: ../src/guestfs.pod:1186
34168 msgid "containing homoglyphs."
34172 #: ../src/guestfs.pod:1190
34173 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34177 #: ../src/guestfs.pod:1192
34179 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34180 "(VFS) module can sometimes be escalated into exploits by deliberately "
34181 "creating a malicious, malformed filesystem. These exploits are very severe "
34182 "for two reasons. Firstly there are very many filesystem drivers in the "
34183 "kernel, and many of them are infrequently used and not much developer "
34184 "attention has been paid to the code. Linux userspace helps potential "
34185 "crackers by detecting the filesystem type and automatically choosing the "
34186 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34187 "the administrator. Secondly, a kernel-level exploit is like a local root "
34188 "exploit (worse in some ways), giving immediate and total access to the "
34189 "system right down to the hardware level."
34193 #: ../src/guestfs.pod:1205
34195 "That explains why you should never mount a filesystem from an untrusted "
34196 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34197 "inside a qemu virtual machine, usually running as a non-root user. The "
34198 "attacker would need to write a filesystem which first exploited the kernel, "
34199 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34200 "the libguestfs protocol, and finally to be as serious as the host kernel "
34201 "exploit it would need to escalate its privileges to root. This multi-step "
34202 "escalation, performed by a static piece of data, is thought to be extremely "
34203 "hard to do, although we never say 'never' about security issues."
34207 #: ../src/guestfs.pod:1216
34209 "In any case callers can reduce the attack surface by forcing the filesystem "
34210 "type when mounting (use L</guestfs_mount_vfs>)."
34214 #: ../src/guestfs.pod:1219
34215 msgid "PROTOCOL SECURITY"
34219 #: ../src/guestfs.pod:1221
34221 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34222 "defined upper message size. However a program that uses libguestfs must "
34223 "also take care - for example you can write a program that downloads a binary "
34224 "from a disk image and executes it locally, and no amount of protocol "
34225 "security will save you from the consequences."
34229 #: ../src/guestfs.pod:1227
34230 msgid "INSPECTION SECURITY"
34234 #: ../src/guestfs.pod:1229
34236 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34237 "directly from the guest, and these could contain any 8 bit data. Callers "
34238 "should be careful to escape these before printing them to a structured file "
34239 "(for example, use HTML escaping if creating a web page)."
34243 #: ../src/guestfs.pod:1235
34245 "Guest configuration may be altered in unusual ways by the administrator of "
34246 "the virtual machine, and may not reflect reality (particularly for untrusted "
34247 "or actively malicious guests). For example we parse the hostname from "
34248 "configuration files like C</etc/sysconfig/network> that we find in the "
34249 "guest, but the guest administrator can easily manipulate these files to "
34250 "provide the wrong hostname."
34254 #: ../src/guestfs.pod:1243
34256 "The inspection API parses guest configuration using two external libraries: "
34257 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34258 "designed to be robust in the face of malicious data, although denial of "
34259 "service attacks are still possible, for example with oversized configuration "
34264 #: ../src/guestfs.pod:1249
34265 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34269 #: ../src/guestfs.pod:1251
34271 "Be very cautious about running commands from the guest. By running a "
34272 "command in the guest, you are giving CPU time to a binary that you do not "
34273 "control, under the same user account as the library, albeit wrapped in qemu "
34274 "virtualization. More information and alternatives can be found in the "
34275 "section L</RUNNING COMMANDS>."
34279 #: ../src/guestfs.pod:1257
34280 msgid "CVE-2010-3851"
34284 #: ../src/guestfs.pod:1259
34285 msgid "https://bugzilla.redhat.com/642934"
34289 #: ../src/guestfs.pod:1261
34291 "This security bug concerns the automatic disk format detection that qemu "
34292 "does on disk images."
34296 #: ../src/guestfs.pod:1264
34298 "A raw disk image is just the raw bytes, there is no header. Other disk "
34299 "images like qcow2 contain a special header. Qemu deals with this by looking "
34300 "for one of the known headers, and if none is found then assuming the disk "
34301 "image must be raw."
34305 #: ../src/guestfs.pod:1269
34307 "This allows a guest which has been given a raw disk image to write some "
34308 "other header. At next boot (or when the disk image is accessed by "
34309 "libguestfs) qemu would do autodetection and think the disk image format was, "
34310 "say, qcow2 based on the header written by the guest."
34314 #: ../src/guestfs.pod:1274
34316 "This in itself would not be a problem, but qcow2 offers many features, one "
34317 "of which is to allow a disk image to refer to another image (called the "
34318 "\"backing disk\"). It does this by placing the path to the backing disk "
34319 "into the qcow2 header. This path is not validated and could point to any "
34320 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34321 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34322 "control of the attacker."
34326 #: ../src/guestfs.pod:1282
34328 "In libguestfs this is rather hard to exploit except under two circumstances:"
34332 #: ../src/guestfs.pod:1289
34333 msgid "You have enabled the network or have opened the disk in write mode."
34337 #: ../src/guestfs.pod:1293
34339 "You are also running untrusted code from the guest (see L</RUNNING "
34344 #: ../src/guestfs.pod:1298
34346 "The way to avoid this is to specify the expected disk format when adding "
34347 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34348 "should always do this if the disk is raw format, and it's a good idea for "
34353 #: ../src/guestfs.pod:1303
34355 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34356 "format is fetched from libvirt and passed through."
34360 #: ../src/guestfs.pod:1306
34362 "For libguestfs tools, use the I<--format> command line parameter as "
34367 #: ../src/guestfs.pod:1309
34368 msgid "CONNECTION MANAGEMENT"
34372 #: ../src/guestfs.pod:1311
34373 msgid "guestfs_h *"
34377 #: ../src/guestfs.pod:1313
34379 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34380 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34381 "handle and release all resources used."
34385 #: ../src/guestfs.pod:1317
34387 "For information on using multiple handles and threads, see the section L</"
34388 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34392 #: ../src/guestfs.pod:1320
34393 msgid "guestfs_create"
34397 #: ../src/guestfs.pod:1322
34400 " guestfs_h *guestfs_create (void);\n"
34405 #: ../src/guestfs.pod:1324
34406 msgid "Create a connection handle."
34410 #: ../src/guestfs.pod:1326
34412 "On success this returns a non-NULL pointer to a handle. On error it returns "
34417 #: ../src/guestfs.pod:1329
34419 "You have to \"configure\" the handle after creating it. This includes "
34420 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
34421 "handle at least once."
34425 #: ../src/guestfs.pod:1333
34426 msgid "After configuring the handle, you have to call L</guestfs_launch>."
34430 #: ../src/guestfs.pod:1335
34432 "You may also want to configure error handling for the handle. See the L</"
34433 "ERROR HANDLING> section below."
34437 #: ../src/guestfs.pod:1338
34438 msgid "guestfs_close"
34442 #: ../src/guestfs.pod:1340
34445 " void guestfs_close (guestfs_h *g);\n"
34450 #: ../src/guestfs.pod:1342
34451 msgid "This closes the connection handle and frees up all resources used."
34455 #: ../src/guestfs.pod:1344
34457 "If autosync was set on the handle and the handle was launched, then this "
34458 "implicitly calls various functions to unmount filesystems and sync the "
34459 "disk. See L</guestfs_set_autosync> for more details."
34463 #: ../src/guestfs.pod:1348
34464 msgid "If a close callback was set on the handle, then it is called."
34468 #: ../src/guestfs.pod:1350
34469 msgid "ERROR HANDLING"
34473 #: ../src/guestfs.pod:1352
34475 "API functions can return errors. For example, almost all functions that "
34476 "return C<int> will return C<-1> to indicate an error."
34480 #: ../src/guestfs.pod:1355
34482 "Additional information is available for errors: an error message string and "
34483 "optionally an error number (errno) if the thing that failed was a system "
34488 #: ../src/guestfs.pod:1359
34490 "You can get at the additional information about the last error on the handle "
34491 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
34492 "up an error handler with L</guestfs_set_error_handler>."
34496 #: ../src/guestfs.pod:1364
34498 "When the handle is created, a default error handler is installed which "
34499 "prints the error message string to C<stderr>. For small short-running "
34500 "command line programs it is sufficient to do:"
34504 #: ../src/guestfs.pod:1368
34507 " if (guestfs_launch (g) == -1)\n"
34508 " exit (EXIT_FAILURE);\n"
34513 #: ../src/guestfs.pod:1371
34515 "since the default error handler will ensure that an error message has been "
34516 "printed to C<stderr> before the program exits."
34520 #: ../src/guestfs.pod:1374
34522 "For other programs the caller will almost certainly want to install an "
34523 "alternate error handler or do error handling in-line like this:"
34527 #: ../src/guestfs.pod:1377
34530 " /* This disables the default behaviour of printing errors\n"
34532 " guestfs_set_error_handler (g, NULL, NULL);\n"
34537 #: ../src/guestfs.pod:1381
34540 " if (guestfs_launch (g) == -1) {\n"
34541 " /* Examine the error message and print it etc. */\n"
34542 " char *msg = guestfs_last_error (g);\n"
34543 " int errnum = guestfs_last_errno (g);\n"
34544 " fprintf (stderr, \"%s\", msg);\n"
34545 " if (errnum != 0)\n"
34546 " fprintf (stderr, \": %s\", strerror (errnum));\n"
34547 " fprintf (stderr, \"\\n\");\n"
34554 #: ../src/guestfs.pod:1392
34556 "Out of memory errors are handled differently. The default action is to call "
34557 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
34558 "guestfs_set_out_of_memory_handler>."
34562 #: ../src/guestfs.pod:1396
34564 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
34565 "because there is no handle if this happens there is no way to get additional "
34566 "error information. However L</guestfs_create> is supposed to be a "
34567 "lightweight operation which can only fail because of insufficient memory (it "
34568 "returns NULL in this case)."
34572 #: ../src/guestfs.pod:1402
34573 msgid "guestfs_last_error"
34577 #: ../src/guestfs.pod:1404
34580 " const char *guestfs_last_error (guestfs_h *g);\n"
34585 #: ../src/guestfs.pod:1406
34587 "This returns the last error message that happened on C<g>. If there has not "
34588 "been an error since the handle was created, then this returns C<NULL>."
34592 #: ../src/guestfs.pod:1410
34594 "The lifetime of the returned string is until the next error occurs, or L</"
34595 "guestfs_close> is called."
34599 #: ../src/guestfs.pod:1413
34600 msgid "guestfs_last_errno"
34604 #: ../src/guestfs.pod:1415
34607 " int guestfs_last_errno (guestfs_h *g);\n"
34612 #: ../src/guestfs.pod:1417
34613 msgid "This returns the last error number (errno) that happened on C<g>."
34617 #: ../src/guestfs.pod:1419
34618 msgid "If successful, an errno integer not equal to zero is returned."
34622 #: ../src/guestfs.pod:1421
34624 "If no error, this returns 0. This call can return 0 in three situations:"
34628 #: ../src/guestfs.pod:1428
34629 msgid "There has not been any error on the handle."
34633 #: ../src/guestfs.pod:1432
34635 "There has been an error but the errno was meaningless. This corresponds to "
34636 "the case where the error did not come from a failed system call, but for "
34637 "some other reason."
34641 #: ../src/guestfs.pod:1438
34643 "There was an error from a failed system call, but for some reason the errno "
34644 "was not captured and returned. This usually indicates a bug in libguestfs."
34648 #: ../src/guestfs.pod:1444
34650 "Libguestfs tries to convert the errno from inside the applicance into a "
34651 "corresponding errno for the caller (not entirely trivial: the appliance "
34652 "might be running a completely different operating system from the library "
34653 "and error numbers are not standardized across Un*xen). If this could not be "
34654 "done, then the error is translated to C<EINVAL>. In practice this should "
34655 "only happen in very rare circumstances."
34659 #: ../src/guestfs.pod:1452
34660 msgid "guestfs_set_error_handler"
34664 #: ../src/guestfs.pod:1454
34667 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
34669 " const char *msg);\n"
34670 " void guestfs_set_error_handler (guestfs_h *g,\n"
34671 " guestfs_error_handler_cb cb,\n"
34672 " void *opaque);\n"
34677 #: ../src/guestfs.pod:1461
34679 "The callback C<cb> will be called if there is an error. The parameters "
34680 "passed to the callback are an opaque data pointer and the error message "
34685 #: ../src/guestfs.pod:1465
34687 "C<errno> is not passed to the callback. To get that the callback must call "
34688 "L</guestfs_last_errno>."
34692 #: ../src/guestfs.pod:1468
34694 "Note that the message string C<msg> is freed as soon as the callback "
34695 "function returns, so if you want to stash it somewhere you must make your "
34700 #: ../src/guestfs.pod:1472
34701 msgid "The default handler prints messages on C<stderr>."
34705 #: ../src/guestfs.pod:1474
34706 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
34710 #: ../src/guestfs.pod:1476
34711 msgid "guestfs_get_error_handler"
34715 #: ../src/guestfs.pod:1478
34718 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
34719 " void **opaque_rtn);\n"
34724 #: ../src/guestfs.pod:1481
34725 msgid "Returns the current error handler callback."
34729 #: ../src/guestfs.pod:1483
34730 msgid "guestfs_set_out_of_memory_handler"
34734 #: ../src/guestfs.pod:1485
34737 " typedef void (*guestfs_abort_cb) (void);\n"
34738 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
34739 " guestfs_abort_cb);\n"
34744 #: ../src/guestfs.pod:1489
34746 "The callback C<cb> will be called if there is an out of memory situation. "
34747 "I<Note this callback must not return>."
34751 #: ../src/guestfs.pod:1492
34752 msgid "The default is to call L<abort(3)>."
34756 #: ../src/guestfs.pod:1494
34758 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
34762 #: ../src/guestfs.pod:1497
34763 msgid "guestfs_get_out_of_memory_handler"
34767 #: ../src/guestfs.pod:1499
34770 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
34775 #: ../src/guestfs.pod:1501
34776 msgid "This returns the current out of memory handler."
34780 #: ../src/guestfs.pod:1503
34785 #: ../src/guestfs.pod:1507
34790 #: ../src/guestfs.pod:1509
34795 #: ../src/guestfs.pod:1511
34796 msgid "AVAILABILITY"
34800 #: ../src/guestfs.pod:1513
34801 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
34805 #: ../src/guestfs.pod:1515
34807 "Using L</guestfs_available> you can test availability of the following "
34808 "groups of functions. This test queries the appliance to see if the "
34809 "appliance you are currently using supports the functionality."
34813 #: ../src/guestfs.pod:1520
34814 msgid "@AVAILABILITY@"
34818 #: ../src/guestfs.pod:1522
34819 msgid "GUESTFISH supported COMMAND"
34823 #: ../src/guestfs.pod:1524
34825 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
34826 "prints out the available groups and whether they are supported by this build "
34827 "of libguestfs. Note however that you have to do C<run> first."
34831 #: ../src/guestfs.pod:1529
34832 msgid "SINGLE CALLS AT COMPILE TIME"
34836 #: ../src/guestfs.pod:1531
34838 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
34839 "function, such as:"
34843 #: ../src/guestfs.pod:1534
34846 " #define LIBGUESTFS_HAVE_DD 1\n"
34851 #: ../src/guestfs.pod:1536
34852 msgid "if L</guestfs_dd> is available."
34856 #: ../src/guestfs.pod:1538
34858 "Before version 1.5.8, if you needed to test whether a single libguestfs "
34859 "function is available at compile time, we recommended using build tools such "
34860 "as autoconf or cmake. For example in autotools you could use:"
34864 #: ../src/guestfs.pod:1543
34867 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
34868 " AC_CHECK_FUNCS([guestfs_dd])\n"
34873 #: ../src/guestfs.pod:1546
34875 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
34880 #: ../src/guestfs.pod:1549
34881 msgid "SINGLE CALLS AT RUN TIME"
34885 #: ../src/guestfs.pod:1551
34887 "Testing at compile time doesn't guarantee that a function really exists in "
34888 "the library. The reason is that you might be dynamically linked against a "
34889 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
34890 "This situation unfortunately results in a segmentation fault, which is a "
34891 "shortcoming of the C dynamic linking system itself."
34895 #: ../src/guestfs.pod:1558
34897 "You can use L<dlopen(3)> to test if a function is available at run time, as "
34898 "in this example program (note that you still need the compile time check as "
34903 #: ../src/guestfs.pod:1562
34906 " #include <stdio.h>\n"
34907 " #include <stdlib.h>\n"
34908 " #include <unistd.h>\n"
34909 " #include <dlfcn.h>\n"
34910 " #include <guestfs.h>\n"
34915 #: ../src/guestfs.pod:1568
34920 " #ifdef LIBGUESTFS_HAVE_DD\n"
34922 " int has_function;\n"
34927 #: ../src/guestfs.pod:1574
34930 " /* Test if the function guestfs_dd is really available. */\n"
34931 " dl = dlopen (NULL, RTLD_LAZY);\n"
34933 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
34934 " exit (EXIT_FAILURE);\n"
34936 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
34942 #: ../src/guestfs.pod:1583
34945 " if (!has_function)\n"
34946 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
34948 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
34949 " /* Now it's safe to call\n"
34950 " guestfs_dd (g, \"foo\", \"bar\");\n"
34954 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
34961 #: ../src/guestfs.pod:1596
34963 "You may think the above is an awful lot of hassle, and it is. There are "
34964 "other ways outside of the C linking system to ensure that this kind of "
34965 "incompatibility never arises, such as using package versioning:"
34969 #: ../src/guestfs.pod:1601
34972 " Requires: libguestfs >= 1.0.80\n"
34977 #: ../src/guestfs.pod:1603
34978 msgid "CALLS WITH OPTIONAL ARGUMENTS"
34982 #: ../src/guestfs.pod:1605
34984 "A recent feature of the API is the introduction of calls which take optional "
34985 "arguments. In C these are declared 3 ways. The main way is as a call which "
34986 "takes variable arguments (ie. C<...>), as in this example:"
34990 #: ../src/guestfs.pod:1610
34993 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
34998 #: ../src/guestfs.pod:1612
35000 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35001 "call with no optional arguments specified:"
35005 #: ../src/guestfs.pod:1615
35008 " guestfs_add_drive_opts (g, filename, -1);\n"
35013 #: ../src/guestfs.pod:1617
35014 msgid "With a single optional argument:"
35018 #: ../src/guestfs.pod:1619
35021 " guestfs_add_drive_opts (g, filename,\n"
35022 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35028 #: ../src/guestfs.pod:1623
35033 #: ../src/guestfs.pod:1625
35036 " guestfs_add_drive_opts (g, filename,\n"
35037 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35038 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35044 #: ../src/guestfs.pod:1630
35046 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35051 #: ../src/guestfs.pod:1633
35052 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35056 #: ../src/guestfs.pod:1635
35058 "The second variant has the same name with the suffix C<_va>, which works the "
35059 "same way but takes a C<va_list>. See the C manual for details. For the "
35060 "example function, this is declared:"
35064 #: ../src/guestfs.pod:1639
35067 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35068 " va_list args);\n"
35073 #: ../src/guestfs.pod:1642
35074 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35078 #: ../src/guestfs.pod:1644
35080 "The third variant is useful where you need to construct these calls. You "
35081 "pass in a structure where you fill in the optional fields. The structure "
35082 "has a bitmask as the first element which you must set to indicate which "
35083 "fields you have filled in. For our example function the structure and call "
35088 #: ../src/guestfs.pod:1650
35091 " struct guestfs_add_drive_opts_argv {\n"
35092 " uint64_t bitmask;\n"
35094 " const char *format;\n"
35097 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35098 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35103 #: ../src/guestfs.pod:1659
35104 msgid "You could call it like this:"
35108 #: ../src/guestfs.pod:1661
35111 " struct guestfs_add_drive_opts_argv optargs = {\n"
35112 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35113 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35114 " .readonly = 1,\n"
35115 " .format = \"qcow2\"\n"
35121 #: ../src/guestfs.pod:1668
35124 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35129 #: ../src/guestfs.pod:1676
35130 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35134 #: ../src/guestfs.pod:1681
35135 msgid "You do not need to fill in all fields of the structure."
35139 #: ../src/guestfs.pod:1685
35141 "There must be a one-to-one correspondence between fields of the structure "
35142 "that are filled in, and bits set in the bitmask."
35146 #: ../src/guestfs.pod:1690
35147 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35151 #: ../src/guestfs.pod:1692
35153 "In other languages, optional arguments are expressed in the way that is "
35154 "natural for that language. We refer you to the language-specific "
35155 "documentation for more details on that."
35159 #: ../src/guestfs.pod:1696
35160 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35164 #: ../src/guestfs.pod:1698
35165 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35169 #: ../src/guestfs.pod:1700
35171 "B<Note:> This section documents the generic event mechanism introduced in "
35172 "libguestfs 1.10, which you should use in new code if possible. The old "
35173 "functions C<guestfs_set_log_message_callback>, "
35174 "C<guestfs_set_subprocess_quit_callback>, "
35175 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35176 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35177 "page. Because of the ABI guarantee, the old functions continue to work."
35181 #: ../src/guestfs.pod:1709
35183 "Handles generate events when certain things happen, such as log messages "
35184 "being generated, progress messages during long-running operations, or the "
35185 "handle being closed. The API calls described below let you register a "
35186 "callback to be called when events happen. You can register multiple "
35187 "callbacks (for the same, different or overlapping sets of events), and "
35188 "individually remove callbacks. If callbacks are not removed, then they "
35189 "remain in force until the handle is closed."
35193 #: ../src/guestfs.pod:1717
35195 "In the current implementation, events are only generated synchronously: that "
35196 "means that events (and hence callbacks) can only happen while you are in the "
35197 "middle of making another libguestfs call. The callback is called in the "
35202 #: ../src/guestfs.pod:1722
35204 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35205 "unsigned integers, or a message buffer. Payloads are discussed later on."
35209 #: ../src/guestfs.pod:1726
35210 msgid "CLASSES OF EVENTS"
35214 #: ../src/guestfs.pod:1730
35215 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35219 #: ../src/guestfs.pod:1733
35221 "The callback function will be called while the handle is being closed "
35222 "(synchronously from L</guestfs_close>)."
35226 #: ../src/guestfs.pod:1736
35228 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35229 "handles that are open when the program exits. This means that this callback "
35230 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35231 "problems in higher-level languages (eg. if your HLL interpreter has already "
35232 "been cleaned up by the time this is called, and if your callback then jumps "
35233 "into some HLL function)."
35237 #: ../src/guestfs.pod:1743
35239 "If no callback is registered: the handle is closed without any callback "
35244 #: ../src/guestfs.pod:1746
35245 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35249 #: ../src/guestfs.pod:1749
35251 "The callback function will be called when the child process quits, either "
35252 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35253 "corresponds to a transition from any state to the CONFIG state)."
35257 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35258 msgid "If no callback is registered: the event is ignored."
35262 #: ../src/guestfs.pod:1755
35263 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35267 #: ../src/guestfs.pod:1758
35269 "The callback function will be called when the child process becomes ready "
35270 "first time after it has been launched. (This corresponds to a transition "
35271 "from LAUNCHING to the READY state)."
35275 #: ../src/guestfs.pod:1764
35276 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35280 #: ../src/guestfs.pod:1767
35282 "Some long-running operations can generate progress messages. If this "
35283 "callback is registered, then it will be called each time a progress message "
35284 "is generated (usually two seconds after the operation started, and three "
35285 "times per second thereafter until it completes, although the frequency may "
35286 "change in future versions)."
35290 #: ../src/guestfs.pod:1773
35292 "The callback receives in the payload four unsigned 64 bit numbers which are "
35293 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35297 #: ../src/guestfs.pod:1776
35299 "The units of C<total> are not defined, although for some operations C<total> "
35300 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35301 "or megabytes), and C<position> may be the portion which has been transferred."
35305 #: ../src/guestfs.pod:1781
35306 msgid "The only defined and stable parts of the API are:"
35310 #: ../src/guestfs.pod:1787
35312 "The callback can display to the user some type of progress bar or indicator "
35313 "which shows the ratio of C<position>:C<total>."
35317 #: ../src/guestfs.pod:1792
35318 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35322 #: ../src/guestfs.pod:1796
35324 "If any progress notification is sent during a call, then a final progress "
35325 "notification is always sent when C<position> = C<total> (I<unless> the call "
35326 "fails with an error)."
35330 #: ../src/guestfs.pod:1800
35332 "This is to simplify caller code, so callers can easily set the progress "
35333 "indicator to \"100%\" at the end of the operation, without requiring special "
35334 "code to detect this case."
35338 #: ../src/guestfs.pod:1806
35340 "For some calls we are unable to estimate the progress of the call, but we "
35341 "can still generate progress messages to indicate activity. This is known as "
35342 "\"pulse mode\", and is directly supported by certain progress bar "
35343 "implementations (eg. GtkProgressBar)."
35347 #: ../src/guestfs.pod:1811
35349 "For these calls, zero or more progress messages are generated with "
35350 "C<position = 0> and C<total = 1>, followed by a final message with "
35351 "C<position = total = 1>."
35355 #: ../src/guestfs.pod:1815
35357 "As noted above, if the call fails with an error then the final message may "
35358 "not be generated."
35362 #: ../src/guestfs.pod:1820
35364 "The callback also receives the procedure number (C<proc_nr>) and serial "
35365 "number (C<serial>) of the call. These are only useful for debugging "
35366 "protocol issues, and the callback can normally ignore them. The callback "
35367 "may want to print these numbers in error messages or debugging messages."
35371 #: ../src/guestfs.pod:1826
35372 msgid "If no callback is registered: progress messages are discarded."
35376 #: ../src/guestfs.pod:1828
35377 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35381 #: ../src/guestfs.pod:1831
35383 "The callback function is called whenever a log message is generated by qemu, "
35384 "the appliance kernel, guestfsd (daemon), or utility programs."
35388 #: ../src/guestfs.pod:1834
35390 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
35391 "guestfs_launch>) then additional debug messages are generated."
35395 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35397 "If no callback is registered: the messages are discarded unless the verbose "
35398 "flag is set in which case they are sent to stderr. You can override the "
35399 "printing of verbose messages to stderr by setting up a callback."
35403 #: ../src/guestfs.pod:1842
35404 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
35408 #: ../src/guestfs.pod:1845
35410 "The callback function is called whenever a log message is generated by the "
35411 "library part of libguestfs."
35415 #: ../src/guestfs.pod:1848
35417 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
35418 "messages are generated."
35422 #: ../src/guestfs.pod:1856
35423 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
35427 #: ../src/guestfs.pod:1859
35429 "The callback function is called whenever a trace message is generated. This "
35430 "only applies if the trace flag (L</guestfs_set_trace>) is set."
35434 #: ../src/guestfs.pod:1862
35436 "If no callback is registered: the messages are sent to stderr. You can "
35437 "override the printing of trace messages to stderr by setting up a callback."
35441 #: ../src/guestfs.pod:1866
35442 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
35446 #: ../src/guestfs.pod:1869
35448 "The callback function is called whenever a libguestfs function is entered."
35452 #: ../src/guestfs.pod:1872
35454 "The payload is a string which contains the name of the function that we are "
35455 "entering (not including C<guestfs_> prefix)."
35459 #: ../src/guestfs.pod:1875
35461 "Note that libguestfs functions can call themselves, so you may see many "
35462 "events from a single call. A few libguestfs functions do not generate this "
35467 #: ../src/guestfs.pod:1883
35468 msgid "guestfs_set_event_callback"
35472 #: ../src/guestfs.pod:1885
35475 " int guestfs_set_event_callback (guestfs_h *g,\n"
35476 " guestfs_event_callback cb,\n"
35477 " uint64_t event_bitmask,\n"
35479 " void *opaque);\n"
35484 #: ../src/guestfs.pod:1891
35486 "This function registers a callback (C<cb>) for all event classes in the "
35487 "C<event_bitmask>."
35491 #: ../src/guestfs.pod:1894
35493 "For example, to register for all log message events, you could call this "
35494 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
35495 "To register a single callback for all possible classes of events, use "
35496 "C<GUESTFS_EVENT_ALL>."
35500 #: ../src/guestfs.pod:1900
35501 msgid "C<flags> should always be passed as 0."
35505 #: ../src/guestfs.pod:1902
35507 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
35508 "it for any purpose."
35512 #: ../src/guestfs.pod:1905
35514 "The return value is the event handle (an integer) which you can use to "
35515 "delete the callback (see below)."
35519 #: ../src/guestfs.pod:1908
35521 "If there is an error, this function returns C<-1>, and sets the error in the "
35522 "handle in the usual way (see L</guestfs_last_error> etc.)"
35526 #: ../src/guestfs.pod:1911
35528 "Callbacks remain in effect until they are deleted, or until the handle is "
35533 #: ../src/guestfs.pod:1914
35535 "In the case where multiple callbacks are registered for a particular event "
35536 "class, all of the callbacks are called. The order in which multiple "
35537 "callbacks are called is not defined."
35541 #: ../src/guestfs.pod:1918
35542 msgid "guestfs_delete_event_callback"
35546 #: ../src/guestfs.pod:1920
35549 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
35554 #: ../src/guestfs.pod:1922
35556 "Delete a callback that was previously registered. C<event_handle> should be "
35557 "the integer that was returned by a previous call to "
35558 "C<guestfs_set_event_callback> on the same handle."
35562 #: ../src/guestfs.pod:1926
35563 msgid "guestfs_event_callback"
35567 #: ../src/guestfs.pod:1928
35570 " typedef void (*guestfs_event_callback) (\n"
35573 " uint64_t event,\n"
35574 " int event_handle,\n"
35576 " const char *buf, size_t buf_len,\n"
35577 " const uint64_t *array, size_t array_len);\n"
35582 #: ../src/guestfs.pod:1937
35584 "This is the type of the event callback function that you have to provide."
35588 #: ../src/guestfs.pod:1940
35590 "The basic parameters are: the handle (C<g>), the opaque user pointer "
35591 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
35592 "handle, and C<flags> which in the current API you should ignore."
35596 #: ../src/guestfs.pod:1944
35598 "The remaining parameters contain the event payload (if any). Each event may "
35599 "contain a payload, which usually relates to the event class, but for future "
35600 "proofing your code should be written to handle any payload for any event "
35605 #: ../src/guestfs.pod:1949
35607 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
35608 "there is no message buffer). Note that this message buffer can contain "
35609 "arbitrary 8 bit data, including NUL bytes."
35613 #: ../src/guestfs.pod:1953
35615 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
35616 "moment this is only used for progress messages."
35620 #: ../src/guestfs.pod:1956
35621 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
35625 #: ../src/guestfs.pod:1958
35627 "One motivation for the generic event API was to allow GUI programs to "
35628 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
35629 "unconditionally to C<stderr>."
35633 #: ../src/guestfs.pod:1962
35635 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
35636 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
35637 "messages are not events; you must capture error messages separately)."
35641 #: ../src/guestfs.pod:1967
35643 "Programs have to set up a callback to capture the classes of events of "
35648 #: ../src/guestfs.pod:1970
35652 " guestfs_set_event_callback\n"
35653 " (g, message_callback,\n"
35654 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
35655 " GUESTFS_EVENT_TRACE,\n"
35656 " 0, NULL) == -1)\n"
35657 " if (eh == -1) {\n"
35658 " // handle error in the usual way\n"
35664 #: ../src/guestfs.pod:1980
35666 "The callback can then direct messages to the appropriate place. In this "
35667 "example, messages are directed to syslog:"
35671 #: ../src/guestfs.pod:1983
35675 " message_callback (\n"
35678 " uint64_t event,\n"
35679 " int event_handle,\n"
35681 " const char *buf, size_t buf_len,\n"
35682 " const uint64_t *array, size_t array_len)\n"
35684 " const int priority = LOG_USER|LOG_INFO;\n"
35685 " if (buf_len > 0)\n"
35686 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
35692 #: ../src/guestfs.pod:1998
35693 msgid "CANCELLING LONG TRANSFERS"
35697 #: ../src/guestfs.pod:2000
35699 "Some operations can be cancelled by the caller while they are in progress. "
35700 "Currently only operations that involve uploading or downloading data can be "
35701 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
35702 "parameters in the generator)."
35706 #: ../src/guestfs.pod:2005
35707 msgid "guestfs_user_cancel"
35711 #: ../src/guestfs.pod:2007
35714 " void guestfs_user_cancel (guestfs_h *g);\n"
35719 #: ../src/guestfs.pod:2009
35721 "C<guestfs_user_cancel> cancels the current upload or download operation."
35725 #: ../src/guestfs.pod:2012
35727 "Unlike most other libguestfs calls, this function is signal safe and thread "
35728 "safe. You can call it from a signal handler or from another thread, without "
35729 "needing to do any locking."
35733 #: ../src/guestfs.pod:2016
35735 "The transfer that was in progress (if there is one) will stop shortly "
35736 "afterwards, and will return an error. The errno (see L</"
35737 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
35738 "out if the operation was cancelled or failed because of another error."
35742 #: ../src/guestfs.pod:2022
35744 "No cleanup is performed: for example, if a file was being uploaded then "
35745 "after cancellation there may be a partially uploaded file. It is the "
35746 "caller's responsibility to clean up if necessary."
35750 #: ../src/guestfs.pod:2026
35751 msgid "There are two common places that you might call C<guestfs_user_cancel>."
35755 #: ../src/guestfs.pod:2028
35757 "In an interactive text-based program, you might call it from a C<SIGINT> "
35758 "signal handler so that pressing C<^C> cancels the current operation. (You "
35759 "also need to call L</guestfs_set_pgroup> so that child processes don't "
35760 "receive the C<^C> signal)."
35764 #: ../src/guestfs.pod:2033
35766 "In a graphical program, when the main thread is displaying a progress bar "
35767 "with a cancel button, wire up the cancel button to call this function."
35771 #: ../src/guestfs.pod:2037
35772 msgid "PRIVATE DATA AREA"
35776 #: ../src/guestfs.pod:2039
35778 "You can attach named pieces of private data to the libguestfs handle, fetch "
35779 "them by name, and walk over them, for the lifetime of the handle. This is "
35780 "called the private data area and is only available from the C API."
35784 #: ../src/guestfs.pod:2044
35785 msgid "To attach a named piece of data, use the following call:"
35789 #: ../src/guestfs.pod:2046
35792 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
35797 #: ../src/guestfs.pod:2048
35799 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
35800 "pointer (which can be C<NULL>). Any previous item with the same key is "
35805 #: ../src/guestfs.pod:2052
35807 "You can use any C<key> you want, but your key should I<not> start with an "
35808 "underscore character. Keys beginning with an underscore character are "
35809 "reserved for internal libguestfs purposes (eg. for implementing language "
35810 "bindings). It is recommended that you prefix the key with some unique "
35811 "string to avoid collisions with other users."
35815 #: ../src/guestfs.pod:2058
35816 msgid "To retrieve the pointer, use:"
35820 #: ../src/guestfs.pod:2060
35823 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
35828 #: ../src/guestfs.pod:2062
35830 "This function returns C<NULL> if either no data is found associated with "
35831 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
35836 #: ../src/guestfs.pod:2066
35838 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
35839 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
35840 "all. In particular, libguestfs does I<not> try to free the data when the "
35841 "handle is closed. If the data must be freed, then the caller must either "
35842 "free it before calling L</guestfs_close> or must set up a close callback to "
35843 "do it (see L</GUESTFS_EVENT_CLOSE>)."
35847 #: ../src/guestfs.pod:2073
35848 msgid "To walk over all entries, use these two functions:"
35852 #: ../src/guestfs.pod:2075
35855 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
35860 #: ../src/guestfs.pod:2077
35863 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
35868 #: ../src/guestfs.pod:2079
35870 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
35871 "not have any particular meaning -- keys are not returned in any defined "
35872 "order). A pointer to the key is returned in C<*key_rtn> and the "
35873 "corresponding data pointer is returned from the function. C<NULL> is "
35874 "returned if there are no keys stored in the handle."
35878 #: ../src/guestfs.pod:2085
35880 "C<guestfs_next_private> returns the next key, pointer pair. The return "
35881 "value of this function is also C<NULL> is there are no further entries to "
35886 #: ../src/guestfs.pod:2089
35887 msgid "Notes about walking over entries:"
35891 #: ../src/guestfs.pod:2095
35893 "You must not call C<guestfs_set_private> while walking over the entries."
35897 #: ../src/guestfs.pod:2100
35899 "The handle maintains an internal iterator which is reset when you call "
35900 "C<guestfs_first_private>. This internal iterator is invalidated when you "
35901 "call C<guestfs_set_private>."
35905 #: ../src/guestfs.pod:2106
35906 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
35910 #: ../src/guestfs.pod:2108
35913 " guestfs_set_private (g, key, NULL);\n"
35918 #: ../src/guestfs.pod:2110
35919 msgid "then that C<key> is not returned when walking."
35923 #: ../src/guestfs.pod:2114
35925 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
35926 "C<guestfs_next_private> or C<guestfs_set_private>."
35930 #: ../src/guestfs.pod:2120
35932 "The following example code shows how to print all keys and data pointers "
35933 "that are associated with the handle C<g>:"
35937 #: ../src/guestfs.pod:2123
35940 " const char *key;\n"
35941 " void *data = guestfs_first_private (g, &key);\n"
35942 " while (data != NULL)\n"
35944 " printf (\"key = %s, data = %p\\n\", key, data);\n"
35945 " data = guestfs_next_private (g, &key);\n"
35951 #: ../src/guestfs.pod:2131
35953 "More commonly you are only interested in keys that begin with an application-"
35954 "specific prefix C<foo_>. Modify the loop like so:"
35958 #: ../src/guestfs.pod:2134
35961 " const char *key;\n"
35962 " void *data = guestfs_first_private (g, &key);\n"
35963 " while (data != NULL)\n"
35965 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35966 " printf (\"key = %s, data = %p\\n\", key, data);\n"
35967 " data = guestfs_next_private (g, &key);\n"
35973 #: ../src/guestfs.pod:2143
35975 "If you need to modify keys while walking, then you have to jump back to the "
35976 "beginning of the loop. For example, to delete all keys prefixed with "
35981 #: ../src/guestfs.pod:2147
35984 " const char *key;\n"
35987 " data = guestfs_first_private (g, &key);\n"
35988 " while (data != NULL)\n"
35990 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
35992 " guestfs_set_private (g, key, NULL);\n"
35993 " /* note that 'key' pointer is now invalid, and so is\n"
35994 " the internal iterator */\n"
35997 " data = guestfs_next_private (g, &key);\n"
36003 #: ../src/guestfs.pod:2163
36005 "Note that the above loop is guaranteed to terminate because the keys are "
36006 "being deleted, but other manipulations of keys within the loop might not "
36007 "terminate unless you also maintain an indication of which keys have been "
36012 #: ../src/guestfs.pod:2168 ../src/guestfs.pod:2173
36017 #: ../src/guestfs.pod:2170
36019 "<!-- old anchor for the next section --> <a name="
36020 "\"state_machine_and_low_level_event_api\"/>"
36024 #: ../src/guestfs.pod:2175
36025 msgid "ARCHITECTURE"
36029 #: ../src/guestfs.pod:2177
36031 "Internally, libguestfs is implemented by running an appliance (a special "
36032 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36033 "process of the main program."
36037 #: ../src/guestfs.pod:2181
36040 " ___________________\n"
36042 " | main program |\n"
36044 " | | child process / appliance\n"
36045 " | | __________________________\n"
36047 " +-------------------+ RPC | +-----------------+ |\n"
36048 " | libguestfs <--------------------> guestfsd | |\n"
36049 " | | | +-----------------+ |\n"
36050 " \\___________________/ | | Linux kernel | |\n"
36051 " | +--^--------------+ |\n"
36052 " \\_________|________________/\n"
36054 " _______v______\n"
36057 " | disk image |\n"
36058 " \\______________/\n"
36063 #: ../src/guestfs.pod:2201
36065 "The library, linked to the main program, creates the child process and hence "
36066 "the appliance in the L</guestfs_launch> function."
36070 #: ../src/guestfs.pod:2204
36072 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36073 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36074 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36075 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36076 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36077 "attached to the qemu process which translates device access by the "
36078 "appliance's Linux kernel into accesses to the image."
36082 #: ../src/guestfs.pod:2213
36084 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36085 "Although the disk image you are attached to might also be used by some "
36086 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36087 "care if both libguestfs's qemu process and your virtual machine are trying "
36088 "to update the disk image at the same time, since these usually results in "
36089 "massive disk corruption)."
36093 #: ../src/guestfs.pod:2220
36094 msgid "STATE MACHINE"
36098 #: ../src/guestfs.pod:2222
36099 msgid "libguestfs uses a state machine to model the child process:"
36103 #: ../src/guestfs.pod:2224
36107 " guestfs_create\n"
36115 " / | \\ \\ guestfs_launch\n"
36116 " / | _\\__V______\n"
36118 " / | | LAUNCHING |\n"
36119 " / | \\___________/\n"
36121 " / | guestfs_launch\n"
36123 " ______ / __|____V\n"
36124 " / \\ ------> / \\\n"
36125 " | BUSY | | READY |\n"
36126 " \\______/ <------ \\________/\n"
36131 #: ../src/guestfs.pod:2246
36133 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36134 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36135 "(3) alternating between READY and BUSY as commands are issued to, and "
36136 "carried out by, the child process."
36140 #: ../src/guestfs.pod:2251
36142 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36143 "asynchronously at any time (eg. due to some internal error), and that causes "
36144 "the state to transition back to CONFIG."
36148 #: ../src/guestfs.pod:2255
36150 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36151 "issued when in the CONFIG state."
36155 #: ../src/guestfs.pod:2258
36157 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36158 "L</guestfs_launch> blocks until the child process is READY to accept "
36159 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36160 "moves the state from CONFIG to LAUNCHING while it is running."
36164 #: ../src/guestfs.pod:2264
36166 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36167 "state. These API calls block waiting for the command to be carried out (ie. "
36168 "the state to transition to BUSY and then back to READY). There are no non-"
36169 "blocking versions, and no way to issue more than one command per handle at "
36174 #: ../src/guestfs.pod:2270
36176 "Finally, the child process sends asynchronous messages back to the main "
36177 "program, such as kernel log messages. You can register a callback to "
36178 "receive these messages."
36182 #: ../src/guestfs.pod:2274
36187 #: ../src/guestfs.pod:2276
36188 msgid "APPLIANCE BOOT PROCESS"
36192 #: ../src/guestfs.pod:2278
36194 "This process has evolved and continues to evolve. The description here "
36195 "corresponds only to the current version of libguestfs and is provided for "
36196 "information only."
36200 #: ../src/guestfs.pod:2282
36202 "In order to follow the stages involved below, enable libguestfs debugging "
36203 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36207 #: ../src/guestfs.pod:2287
36208 msgid "Create the appliance"
36212 #: ../src/guestfs.pod:2289
36214 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36215 "initrd and the appliance."
36219 #: ../src/guestfs.pod:2292
36221 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36222 "directory if C<TMPDIR> is set)."
36226 #: ../src/guestfs.pod:2295
36228 "For a complete description of how the appliance is created and cached, read "
36229 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36233 #: ../src/guestfs.pod:2299
36234 msgid "Start qemu and boot the kernel"
36238 #: ../src/guestfs.pod:2301
36239 msgid "qemu is invoked to boot the kernel."
36243 #: ../src/guestfs.pod:2303
36244 msgid "Run the initrd"
36248 #: ../src/guestfs.pod:2305
36250 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
36251 "appliance. The purpose of the initrd is to load enough kernel modules in "
36252 "order that the appliance itself can be mounted and started."
36256 #: ../src/guestfs.pod:2309
36258 "The initrd is a cpio archive called C</var/tmp/.guestfs-E<lt>UIDE<gt>/"
36263 #: ../src/guestfs.pod:2312
36265 "When the initrd has started you will see messages showing that kernel "
36266 "modules are being loaded, similar to this:"
36270 #: ../src/guestfs.pod:2315
36273 " febootstrap: ext2 mini initrd starting up\n"
36274 " febootstrap: mounting /sys\n"
36275 " febootstrap: internal insmod libcrc32c.ko\n"
36276 " febootstrap: internal insmod crc32c-intel.ko\n"
36281 #: ../src/guestfs.pod:2320
36282 msgid "Find and mount the appliance device"
36286 #: ../src/guestfs.pod:2322
36288 "The appliance is a sparse file containing an ext2 filesystem which contains "
36289 "a familiar (although reduced in size) Linux operating system. It would "
36290 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
36294 #: ../src/guestfs.pod:2326
36296 "The regular disks being inspected by libguestfs are the first devices "
36297 "exposed by qemu (eg. as C</dev/vda>)."
36301 #: ../src/guestfs.pod:2329
36303 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
36304 "there was only one regular disk)."
36308 #: ../src/guestfs.pod:2332
36310 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
36311 "and switch root into the appliance, and run C</init> from the appliance."
36315 #: ../src/guestfs.pod:2336
36316 msgid "If this works successfully you will see messages such as:"
36320 #: ../src/guestfs.pod:2338
36323 " febootstrap: picked /sys/block/vdb/dev as root device\n"
36324 " febootstrap: creating /dev/root as block special 252:16\n"
36325 " febootstrap: mounting new root on /root\n"
36326 " febootstrap: chroot\n"
36327 " Starting /init script ...\n"
36332 #: ../src/guestfs.pod:2344
36334 "Note that C<Starting /init script ...> indicates that the appliance's init "
36335 "script is now running."
36339 #: ../src/guestfs.pod:2347
36340 msgid "Initialize the appliance"
36344 #: ../src/guestfs.pod:2349
36346 "The appliance itself now initializes itself. This involves starting certain "
36347 "processes like C<udev>, possibly printing some debug information, and "
36348 "finally running the daemon (C<guestfsd>)."
36352 #: ../src/guestfs.pod:2353
36357 #: ../src/guestfs.pod:2355
36359 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
36364 #: ../src/guestfs.pod:2358
36367 " verbose daemon enabled\n"
36372 #: ../src/guestfs.pod:2360
36374 "The daemon expects to see a named virtio-serial port exposed by qemu and "
36375 "connected on the other end to the library."
36379 #: ../src/guestfs.pod:2363
36381 "The daemon connects to this port (and hence to the library) and sends a four "
36382 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
36383 "protocol (see below)."
36387 #: ../src/guestfs.pod:2369
36388 msgid "COMMUNICATION PROTOCOL"
36392 #: ../src/guestfs.pod:2371
36394 "Don't rely on using this protocol directly. This section documents how it "
36395 "currently works, but it may change at any time."
36399 #: ../src/guestfs.pod:2374
36401 "The protocol used to talk between the library and the daemon running inside "
36402 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
36403 "1014, RFC 1832, RFC 4506)."
36407 #: ../src/guestfs.pod:2378
36409 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
36410 "this file is automatically generated)."
36414 #: ../src/guestfs.pod:2381
36416 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
36417 "and C<FileOut> parameters, which are handled with very simple request/reply "
36418 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
36419 "parameters, which use the same request and reply messages, but they may also "
36420 "be followed by files sent using a chunked encoding."
36424 #: ../src/guestfs.pod:2388
36425 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
36429 #: ../src/guestfs.pod:2390
36430 msgid "For ordinary functions, the request message is:"
36434 #: ../src/guestfs.pod:2392
36437 " total length (header + arguments,\n"
36438 " but not including the length word itself)\n"
36439 " struct guestfs_message_header (encoded as XDR)\n"
36440 " struct guestfs_<foo>_args (encoded as XDR)\n"
36445 #: ../src/guestfs.pod:2397
36447 "The total length field allows the daemon to allocate a fixed size buffer "
36448 "into which it slurps the rest of the message. As a result, the total length "
36449 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
36450 "effective size of any request is limited to somewhere under this size."
36454 #: ../src/guestfs.pod:2403
36456 "Note also that many functions don't take any arguments, in which case the "
36457 "C<guestfs_I<foo>_args> is completely omitted."
36461 #: ../src/guestfs.pod:2406
36463 "The header contains the procedure number (C<guestfs_proc>) which is how the "
36464 "receiver knows what type of args structure to expect, or none at all."
36468 #: ../src/guestfs.pod:2410
36470 "For functions that take optional arguments, the optional arguments are "
36471 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
36472 "arguments. A bitmask in the header indicates which optional arguments are "
36473 "meaningful. The bitmask is also checked to see if it contains bits set "
36474 "which the daemon does not know about (eg. if more optional arguments were "
36475 "added in a later version of the library), and this causes the call to be "
36480 #: ../src/guestfs.pod:2418
36481 msgid "The reply message for ordinary functions is:"
36485 #: ../src/guestfs.pod:2420
36488 " total length (header + ret,\n"
36489 " but not including the length word itself)\n"
36490 " struct guestfs_message_header (encoded as XDR)\n"
36491 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36496 #: ../src/guestfs.pod:2425
36498 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
36499 "functions that return no formal return values."
36503 #: ../src/guestfs.pod:2428
36505 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
36509 #: ../src/guestfs.pod:2431
36511 "In the case of an error, a flag is set in the header, and the reply message "
36512 "is slightly changed:"
36516 #: ../src/guestfs.pod:2434
36519 " total length (header + error,\n"
36520 " but not including the length word itself)\n"
36521 " struct guestfs_message_header (encoded as XDR)\n"
36522 " struct guestfs_message_error (encoded as XDR)\n"
36527 #: ../src/guestfs.pod:2439
36529 "The C<guestfs_message_error> structure contains the error message as a "
36534 #: ../src/guestfs.pod:2442
36535 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
36539 #: ../src/guestfs.pod:2444
36541 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
36542 "The normal request message is sent (see above). However this is followed by "
36543 "a sequence of file chunks."
36547 #: ../src/guestfs.pod:2448
36550 " total length (header + arguments,\n"
36551 " but not including the length word itself,\n"
36552 " and not including the chunks)\n"
36553 " struct guestfs_message_header (encoded as XDR)\n"
36554 " struct guestfs_<foo>_args (encoded as XDR)\n"
36555 " sequence of chunks for FileIn param #0\n"
36556 " sequence of chunks for FileIn param #1 etc.\n"
36561 #: ../src/guestfs.pod:2456
36562 msgid "The \"sequence of chunks\" is:"
36566 #: ../src/guestfs.pod:2458
36569 " length of chunk (not including length word itself)\n"
36570 " struct guestfs_chunk (encoded as XDR)\n"
36571 " length of chunk\n"
36572 " struct guestfs_chunk (encoded as XDR)\n"
36574 " length of chunk\n"
36575 " struct guestfs_chunk (with data.data_len == 0)\n"
36580 #: ../src/guestfs.pod:2466
36582 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
36583 "is set in the final chunk to indicate either successful completion or early "
36588 #: ../src/guestfs.pod:2470
36590 "At time of writing there are no functions that have more than one FileIn "
36591 "parameter. However this is (theoretically) supported, by sending the "
36592 "sequence of chunks for each FileIn parameter one after another (from left to "
36597 #: ../src/guestfs.pod:2475
36599 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
36600 "transfer. The library does this by sending a chunk with a special flag set "
36601 "to indicate cancellation. When the daemon sees this, it cancels the whole "
36602 "RPC, does I<not> send any reply, and goes back to reading the next request."
36606 #: ../src/guestfs.pod:2481
36608 "The daemon may also cancel. It does this by writing a special word "
36609 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
36610 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
36611 "cancel chunk). The special word is chosen so that even if cancellation "
36612 "happens right at the end of the transfer (after the library has finished "
36613 "writing and has started listening for the reply), the \"spurious\" cancel "
36614 "flag will not be confused with the reply message."
36618 #: ../src/guestfs.pod:2490
36620 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
36621 "limit), and also files where the size is not known in advance (eg. from "
36622 "pipes or sockets). However the chunks are rather small "
36623 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
36624 "to keep much in memory."
36628 #: ../src/guestfs.pod:2496
36629 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
36633 #: ../src/guestfs.pod:2498
36635 "The protocol for FileOut parameters is exactly the same as for FileIn "
36636 "parameters, but with the roles of daemon and library reversed."
36640 #: ../src/guestfs.pod:2501
36643 " total length (header + ret,\n"
36644 " but not including the length word itself,\n"
36645 " and not including the chunks)\n"
36646 " struct guestfs_message_header (encoded as XDR)\n"
36647 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36648 " sequence of chunks for FileOut param #0\n"
36649 " sequence of chunks for FileOut param #1 etc.\n"
36654 #: ../src/guestfs.pod:2509
36655 msgid "INITIAL MESSAGE"
36659 #: ../src/guestfs.pod:2511
36661 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
36662 "which indicates that the guest and daemon is alive. This is what L</"
36663 "guestfs_launch> waits for."
36667 #: ../src/guestfs.pod:2515
36668 msgid "PROGRESS NOTIFICATION MESSAGES"
36672 #: ../src/guestfs.pod:2517
36674 "The daemon may send progress notification messages at any time. These are "
36675 "distinguished by the normal length word being replaced by "
36676 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
36680 #: ../src/guestfs.pod:2521
36682 "The library turns them into progress callbacks (see L</"
36683 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
36688 #: ../src/guestfs.pod:2525
36690 "The daemon self-limits the frequency of progress messages it sends (see "
36691 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
36696 #: ../src/guestfs.pod:2529
36697 msgid "LIBGUESTFS VERSION NUMBERS"
36701 #: ../src/guestfs.pod:2531
36703 "Since April 2010, libguestfs has started to make separate development and "
36704 "stable releases, along with corresponding branches in our git repository. "
36705 "These separate releases can be identified by version number:"
36709 #: ../src/guestfs.pod:2536
36712 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
36713 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
36719 " | `-------- sub-version\n"
36721 " `------ always '1' because we don't change the ABI\n"
36726 #: ../src/guestfs.pod:2547
36727 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
36731 #: ../src/guestfs.pod:2549
36733 "As time passes we cherry pick fixes from the development branch and backport "
36734 "those into the stable branch, the effect being that the stable branch should "
36735 "get more stable and less buggy over time. So the stable releases are ideal "
36736 "for people who don't need new features but would just like the software to "
36741 #: ../src/guestfs.pod:2555
36742 msgid "Our criteria for backporting changes are:"
36746 #: ../src/guestfs.pod:2561
36748 "Documentation changes which don't affect any code are backported unless the "
36749 "documentation refers to a future feature which is not in stable."
36753 #: ../src/guestfs.pod:2567
36755 "Bug fixes which are not controversial, fix obvious problems, and have been "
36756 "well tested are backported."
36760 #: ../src/guestfs.pod:2572
36762 "Simple rearrangements of code which shouldn't affect how it works get "
36763 "backported. This is so that the code in the two branches doesn't get too "
36764 "far out of step, allowing us to backport future fixes more easily."
36768 #: ../src/guestfs.pod:2578
36770 "We I<don't> backport new features, new APIs, new tools etc, except in one "
36771 "exceptional case: the new feature is required in order to implement an "
36772 "important bug fix."
36776 #: ../src/guestfs.pod:2584
36778 "A new stable branch starts when we think the new features in development are "
36779 "substantial and compelling enough over the current stable branch to warrant "
36780 "it. When that happens we create new stable and development versions 1.N.0 "
36781 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
36782 "stable at this point, but by backporting fixes from development, that branch "
36783 "will stabilize over time."
36787 #: ../src/guestfs.pod:2592
36788 msgid "EXTENDING LIBGUESTFS"
36792 #: ../src/guestfs.pod:2594
36793 msgid "ADDING A NEW API ACTION"
36797 #: ../src/guestfs.pod:2596
36799 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
36800 "documentation) are generated, and this makes it easy to extend the "
36805 #: ../src/guestfs.pod:2600
36806 msgid "To add a new API action there are two changes:"
36810 #: ../src/guestfs.pod:2606
36812 "You need to add a description of the call (name, parameters, return type, "
36813 "tests, documentation) to C<generator/generator_actions.ml>."
36817 #: ../src/guestfs.pod:2609
36819 "There are two sorts of API action, depending on whether the call goes "
36820 "through to the daemon in the appliance, or is serviced entirely by the "
36821 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
36822 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
36823 "an example of the latter, since a trace flag is maintained in the handle and "
36824 "all tracing is done on the library side."
36828 #: ../src/guestfs.pod:2617
36830 "Most new actions are of the first type, and get added to the "
36831 "C<daemon_functions> list. Each function has a unique procedure number used "
36832 "in the RPC protocol which is assigned to that action when we publish "
36833 "libguestfs and cannot be reused. Take the latest procedure number and "
36838 #: ../src/guestfs.pod:2623
36840 "For library-only actions of the second type, add to the "
36841 "C<non_daemon_functions> list. Since these functions are serviced by the "
36842 "library and do not travel over the RPC mechanism to the daemon, these "
36843 "functions do not need a procedure number, and so the procedure number is set "
36848 #: ../src/guestfs.pod:2631
36849 msgid "Implement the action (in C):"
36853 #: ../src/guestfs.pod:2633
36855 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
36856 "C<daemon/> directory."
36860 #: ../src/guestfs.pod:2636
36862 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
36863 "(note: double underscore) in the C<src/> directory."
36867 #: ../src/guestfs.pod:2639
36868 msgid "In either case, use another function as an example of what to do."
36872 #: ../src/guestfs.pod:2643
36873 msgid "After making these changes, use C<make> to compile."
36877 #: ../src/guestfs.pod:2645
36879 "Note that you don't need to implement the RPC, language bindings, manual "
36880 "pages or anything else. It's all automatically generated from the OCaml "
36885 #: ../src/guestfs.pod:2649
36886 msgid "ADDING TESTS FOR AN API ACTION"
36890 #: ../src/guestfs.pod:2651
36892 "You can supply zero or as many tests as you want per API call. The tests "
36893 "can either be added as part of the API description (C<generator/"
36894 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
36895 "into C<regressions/>. Note that adding a script to C<regressions/> is "
36896 "slower, so if possible use the first method."
36900 #: ../src/guestfs.pod:2657
36902 "The following describes the test environment used when you add an API test "
36903 "in C<generator_actions.ml>."
36907 #: ../src/guestfs.pod:2660
36908 msgid "The test environment has 4 block devices:"
36912 #: ../src/guestfs.pod:2664
36913 msgid "C</dev/sda> 500MB"
36917 #: ../src/guestfs.pod:2666
36918 msgid "General block device for testing."
36922 #: ../src/guestfs.pod:2668
36923 msgid "C</dev/sdb> 50MB"
36927 #: ../src/guestfs.pod:2670
36929 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
36934 #: ../src/guestfs.pod:2673
36935 msgid "C</dev/sdc> 10MB"
36939 #: ../src/guestfs.pod:2675
36940 msgid "Used in a few tests where two block devices are needed."
36944 #: ../src/guestfs.pod:2677
36945 msgid "C</dev/sdd>"
36949 #: ../src/guestfs.pod:2679
36950 msgid "ISO with fixed content (see C<images/test.iso>)."
36954 #: ../src/guestfs.pod:2683
36956 "To be able to run the tests in a reasonable amount of time, the libguestfs "
36957 "appliance and block devices are reused between tests. So don't try testing "
36958 "L</guestfs_kill_subprocess> :-x"
36962 #: ../src/guestfs.pod:2687
36964 "Each test starts with an initial scenario, selected using one of the "
36965 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
36966 "initialize the disks mentioned above in a particular way as documented in "
36967 "C<generator_types.ml>. You should not assume anything about the previous "
36968 "contents of other disks that are not initialized."
36972 #: ../src/guestfs.pod:2693
36974 "You can add a prerequisite clause to any individual test. This is a run-"
36975 "time check, which, if it fails, causes the test to be skipped. Useful if "
36976 "testing a command which might not work on all variations of libguestfs "
36977 "builds. A test that has prerequisite of C<Always> means to run "
36982 #: ../src/guestfs.pod:2699
36984 "In addition, packagers can skip individual tests by setting environment "
36985 "variables before running C<make check>."
36989 #: ../src/guestfs.pod:2702
36992 " SKIP_TEST_<CMD>_<NUM>=1\n"
36997 #: ../src/guestfs.pod:2704
36998 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37002 #: ../src/guestfs.pod:2706
37007 #: ../src/guestfs.pod:2708
37010 " SKIP_TEST_<CMD>=1\n"
37015 #: ../src/guestfs.pod:2710
37016 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37020 #: ../src/guestfs.pod:2712
37021 msgid "Packagers can run only certain tests by setting for example:"
37025 #: ../src/guestfs.pod:2714
37028 " TEST_ONLY=\"vfs_type zerofree\"\n"
37033 #: ../src/guestfs.pod:2716
37035 "See C<capitests/tests.c> for more details of how these environment variables "
37040 #: ../src/guestfs.pod:2719
37041 msgid "DEBUGGING NEW API ACTIONS"
37045 #: ../src/guestfs.pod:2721
37046 msgid "Test new actions work before submitting them."
37050 #: ../src/guestfs.pod:2723
37051 msgid "You can use guestfish to try out new commands."
37055 #: ../src/guestfs.pod:2725
37057 "Debugging the daemon is a problem because it runs inside a minimal "
37058 "environment. However you can fprintf messages in the daemon to stderr, and "
37059 "they will show up if you use C<guestfish -v>."
37063 #: ../src/guestfs.pod:2729
37064 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37068 #: ../src/guestfs.pod:2731
37070 "Our C source code generally adheres to some basic code-formatting "
37071 "conventions. The existing code base is not totally consistent on this "
37072 "front, but we do prefer that contributed code be formatted similarly. In "
37073 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37074 "indentation level, and other than that, follow the K&R style."
37078 #: ../src/guestfs.pod:2737
37080 "If you use Emacs, add the following to one of one of your start-up files (e."
37081 "g., ~/.emacs), to help ensure that you get indentation right:"
37085 #: ../src/guestfs.pod:2740
37088 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37089 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37090 " (add-hook 'find-file-hook\n"
37091 " '(lambda () (if (and buffer-file-name\n"
37092 " (string-match \"/libguestfs\\\\>\"\n"
37093 " (buffer-file-name))\n"
37094 " (not (string-equal mode-name \"Change Log\"))\n"
37095 " (not (string-equal mode-name \"Makefile\")))\n"
37096 " (setq indent-tabs-mode nil))))\n"
37101 #: ../src/guestfs.pod:2750
37104 " ;;; When editing C sources in libguestfs, use this style.\n"
37105 " (defun libguestfs-c-mode ()\n"
37106 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37108 " (c-set-style \"K&R\")\n"
37109 " (setq c-indent-level 2)\n"
37110 " (setq c-basic-offset 2))\n"
37111 " (add-hook 'c-mode-hook\n"
37112 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37113 " (buffer-file-name))\n"
37114 " (libguestfs-c-mode))))\n"
37119 #: ../src/guestfs.pod:2762
37120 msgid "Enable warnings when compiling (and fix any problems this finds):"
37124 #: ../src/guestfs.pod:2765
37127 " ./configure --enable-gcc-warnings\n"
37132 #: ../src/guestfs.pod:2767
37133 msgid "Useful targets are:"
37137 #: ../src/guestfs.pod:2769
37140 " make syntax-check # checks the syntax of the C code\n"
37141 " make check # runs the test suite\n"
37146 #: ../src/guestfs.pod:2772
37147 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37151 #: ../src/guestfs.pod:2774
37153 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37154 "which are used to do shell quoting."
37158 #: ../src/guestfs.pod:2779
37163 #: ../src/guestfs.pod:2781
37165 "Simple shell quoted string. Any spaces or other shell characters are "
37170 #: ../src/guestfs.pod:2784
37175 #: ../src/guestfs.pod:2786
37177 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37182 #: ../src/guestfs.pod:2793
37185 " asprintf (&cmd, \"cat %R\", path);\n"
37190 #: ../src/guestfs.pod:2795
37191 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37195 #: ../src/guestfs.pod:2797
37197 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
37198 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
37199 "they are not passed via the shell (instead, straight to exec). You probably "
37200 "want to use the C<sysroot_path()> function however."
37204 #: ../src/guestfs.pod:2803
37205 msgid "SUBMITTING YOUR NEW API ACTIONS"
37209 #: ../src/guestfs.pod:2805
37211 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
37212 "libguestfs> and CC to L<rjones@redhat.com>."
37216 #: ../src/guestfs.pod:2809
37217 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37221 #: ../src/guestfs.pod:2811
37222 msgid "We support i18n (gettext anyhow) in the library."
37226 #: ../src/guestfs.pod:2813
37228 "However many messages come from the daemon, and we don't translate those at "
37229 "the moment. One reason is that the appliance generally has all locale files "
37230 "removed from it, because they take up a lot of space. So we'd have to readd "
37231 "some of those, as well as copying our PO files into the appliance."
37235 #: ../src/guestfs.pod:2819
37237 "Debugging messages are never translated, since they are intended for the "
37242 #: ../src/guestfs.pod:2822
37243 msgid "SOURCE CODE SUBDIRECTORIES"
37247 #: ../src/guestfs.pod:2828
37248 msgid "The libguestfs appliance, build scripts and so on."
37252 #: ../src/guestfs.pod:2830
37253 msgid "C<capitests>"
37257 #: ../src/guestfs.pod:2832
37258 msgid "Automated tests of the C API."
37262 #: ../src/guestfs.pod:2834
37267 #: ../src/guestfs.pod:2836
37269 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
37274 #: ../src/guestfs.pod:2839
37279 #: ../src/guestfs.pod:2841
37281 "Safety and liveness tests of components that libguestfs depends upon (not of "
37282 "libguestfs itself). Mainly this is for qemu and the kernel."
37286 #: ../src/guestfs.pod:2844
37291 #: ../src/guestfs.pod:2846
37292 msgid "Outside contributions, experimental parts."
37296 #: ../src/guestfs.pod:2848
37301 #: ../src/guestfs.pod:2850
37303 "The daemon that runs inside the libguestfs appliance and carries out actions."
37307 #: ../src/guestfs.pod:2853
37312 #: ../src/guestfs.pod:2855
37313 msgid "L<virt-df(1)> command and documentation."
37317 #: ../src/guestfs.pod:2857
37322 #: ../src/guestfs.pod:2859
37323 msgid "L<virt-edit(1)> command and documentation."
37327 #: ../src/guestfs.pod:2861
37328 msgid "C<examples>"
37332 #: ../src/guestfs.pod:2863
37333 msgid "C API example code."
37337 #: ../src/guestfs.pod:2865
37342 #: ../src/guestfs.pod:2867
37344 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
37345 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
37346 "L<virt-tar-out(1)>."
37350 #: ../src/guestfs.pod:2871
37355 #: ../src/guestfs.pod:2873
37357 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
37361 #: ../src/guestfs.pod:2875
37362 msgid "C<generator>"
37366 #: ../src/guestfs.pod:2877
37368 "The crucially important generator, used to automatically generate large "
37369 "amounts of boilerplate C code for things like RPC and bindings."
37373 #: ../src/guestfs.pod:2880
37378 #: ../src/guestfs.pod:2882
37379 msgid "Files used by the test suite."
37383 #: ../src/guestfs.pod:2884
37384 msgid "Some \"phony\" guest images which we test against."
37388 #: ../src/guestfs.pod:2886
37389 msgid "C<inspector>"
37393 #: ../src/guestfs.pod:2888
37394 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
37398 #: ../src/guestfs.pod:2890
37403 #: ../src/guestfs.pod:2892
37404 msgid "Logo used on the website. The fish is called Arthur by the way."
37408 #: ../src/guestfs.pod:2894
37413 #: ../src/guestfs.pod:2896
37414 msgid "M4 macros used by autoconf."
37418 #: ../src/guestfs.pod:2898
37423 #: ../src/guestfs.pod:2900
37424 msgid "Translations of simple gettext strings."
37428 #: ../src/guestfs.pod:2902
37433 #: ../src/guestfs.pod:2904
37435 "The build infrastructure and PO files for translations of manpages and POD "
37436 "files. Eventually this will be combined with the C<po> directory, but that "
37437 "is rather complicated."
37441 #: ../src/guestfs.pod:2908
37442 msgid "C<regressions>"
37446 #: ../src/guestfs.pod:2910
37447 msgid "Regression tests."
37451 #: ../src/guestfs.pod:2912
37456 #: ../src/guestfs.pod:2914
37457 msgid "L<virt-rescue(1)> command and documentation."
37461 #: ../src/guestfs.pod:2916
37466 #: ../src/guestfs.pod:2918
37467 msgid "Source code to the C library."
37471 #: ../src/guestfs.pod:2920
37476 #: ../src/guestfs.pod:2922
37478 "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
37482 #: ../src/guestfs.pod:2924
37483 msgid "C<test-tool>"
37487 #: ../src/guestfs.pod:2926
37489 "Test tool for end users to test if their qemu/kernel combination will work "
37494 #: ../src/guestfs.pod:2929
37499 #: ../src/guestfs.pod:2931
37504 #: ../src/guestfs.pod:2933
37509 #: ../src/guestfs.pod:2935
37514 #: ../src/guestfs.pod:2937
37519 #: ../src/guestfs.pod:2939
37524 #: ../src/guestfs.pod:2941
37529 #: ../src/guestfs.pod:2943
37534 #: ../src/guestfs.pod:2945
37539 #: ../src/guestfs.pod:2947
37540 msgid "Language bindings."
37544 #: ../src/guestfs.pod:2951
37545 msgid "MAKING A STABLE RELEASE"
37549 #: ../src/guestfs.pod:2953
37551 "When we make a stable release, there are several steps documented here. See "
37552 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
37557 #: ../src/guestfs.pod:2961
37559 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
37563 #: ../src/guestfs.pod:2966
37564 msgid "Finalize RELEASE-NOTES."
37568 #: ../src/guestfs.pod:2970
37569 msgid "Update ROADMAP."
37573 #: ../src/guestfs.pod:2974
37574 msgid "Run C<src/api-support/update-from-tarballs.sh>."
37578 #: ../src/guestfs.pod:2978
37579 msgid "Push and pull from Transifex."
37583 #: ../src/guestfs.pod:2980
37588 #: ../src/guestfs.pod:2982
37596 #: ../src/guestfs.pod:2984
37597 msgid "to push the latest POT files to Transifex. Then run:"
37601 #: ../src/guestfs.pod:2986
37609 #: ../src/guestfs.pod:2988
37610 msgid "which is a wrapper to pull the latest translated C<*.po> files."
37614 #: ../src/guestfs.pod:2992
37616 "Create new stable and development directories under L<http://libguestfs.org/"
37621 #: ../src/guestfs.pod:2997
37622 msgid "Create the branch in git:"
37626 #: ../src/guestfs.pod:2999
37629 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
37630 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
37631 " git branch stable-1.XX\n"
37632 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
37637 #: ../src/guestfs.pod:3006
37642 #: ../src/guestfs.pod:3008
37643 msgid "PROTOCOL LIMITS"
37647 #: ../src/guestfs.pod:3010
37649 "Internally libguestfs uses a message-based protocol to pass API calls and "
37650 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
37651 "plenty more detail about this). The maximum message size used by the "
37652 "protocol is slightly less than 4 MB. For some API calls you may need to be "
37653 "aware of this limit. The API calls which may be affected are individually "
37654 "documented, with a link back to this section of the documentation."
37658 #: ../src/guestfs.pod:3018
37660 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
37661 "a simple string. Because this string is at some point internally encoded as "
37662 "a message, the maximum size that it can return is slightly under 4 MB. If "
37663 "the requested file is larger than this then you will get an error."
37667 #: ../src/guestfs.pod:3024
37669 "In order to transfer large files into and out of the guest filesystem, you "
37670 "need to use particular calls that support this. The sections L</UPLOADING> "
37671 "and L</DOWNLOADING> document how to do this."
37675 #: ../src/guestfs.pod:3028
37677 "You might also consider mounting the disk image using our FUSE filesystem "
37678 "support (L<guestmount(1)>)."
37682 #: ../src/guestfs.pod:3031
37683 msgid "MAXIMUM NUMBER OF DISKS"
37687 #: ../src/guestfs.pod:3033
37688 msgid "When using virtio disks (the default) the current limit is B<25> disks."
37692 #: ../src/guestfs.pod:3036
37694 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
37695 "slots. However febootstrap only understands disks with names C</dev/vda> "
37696 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
37701 #: ../src/guestfs.pod:3041
37703 "We are working to substantially raise this limit in future versions but it "
37704 "requires complex changes to qemu."
37708 #: ../src/guestfs.pod:3044
37710 "In future versions of libguestfs it should also be possible to \"hot plug\" "
37711 "disks (add and remove disks after calling L</guestfs_launch>). This also "
37712 "requires changes to qemu."
37716 #: ../src/guestfs.pod:3048
37717 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
37721 #: ../src/guestfs.pod:3050
37722 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
37726 #: ../src/guestfs.pod:3052
37728 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
37729 "vda>, and C</dev/vda1> through C</dev/vda15>)."
37733 #: ../src/guestfs.pod:3055
37735 "If you attach a disk with more than 15 partitions, the extra partitions are "
37736 "ignored by libguestfs."
37740 #: ../src/guestfs.pod:3058
37741 msgid "MAXIMUM SIZE OF A DISK"
37745 #: ../src/guestfs.pod:3060
37746 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
37750 #: ../src/guestfs.pod:3062
37752 "We have tested block devices up to 1 exabyte (2**60 or "
37753 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
37758 #: ../src/guestfs.pod:3066
37760 "Although libguestfs probably does not impose any limit, the underlying host "
37761 "storage will. If you store disk images on a host ext4 filesystem, then the "
37762 "maximum size will be limited by the maximum ext4 file size (currently 16 "
37763 "TB). If you store disk images as host logical volumes then you are limited "
37764 "by the maximum size of an LV."
37768 #: ../src/guestfs.pod:3072
37770 "For the hugest disk image files, we recommend using XFS on the host for "
37775 #: ../src/guestfs.pod:3075
37776 msgid "MAXIMUM SIZE OF A PARTITION"
37780 #: ../src/guestfs.pod:3077
37782 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
37783 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
37784 "address a partition located beyond 2 TB on the disk."
37788 #: ../src/guestfs.pod:3081
37790 "It is recommended that you use GPT partitions on disks which are larger than "
37791 "this size. GPT uses 64 bit sector numbers and so can address partitions "
37792 "which are theoretically larger than the largest disk we could support."
37796 #: ../src/guestfs.pod:3086
37797 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
37801 #: ../src/guestfs.pod:3088
37803 "This depends on the filesystem type. libguestfs itself does not impose any "
37804 "known limit. Consult Wikipedia or the filesystem documentation to find out "
37805 "what these limits are."
37809 #: ../src/guestfs.pod:3092
37810 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
37814 #: ../src/guestfs.pod:3094
37816 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
37817 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
37818 "uploads and downloads."
37822 #: ../src/guestfs.pod:3098
37823 msgid "INSPECTION LIMITS"
37827 #: ../src/guestfs.pod:3100
37829 "The inspection code has several arbitrary limits on things like the size of "
37830 "Windows Registry hive it will read, and the length of product name. These "
37831 "are intended to stop a malicious guest from consuming arbitrary amounts of "
37832 "memory and disk space on the host, and should not be reached in practice. "
37833 "See the source code for more information."
37837 #: ../src/guestfs.pod:3126
37839 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
37840 "effect as calling C<guestfs_set_verbose (g, 1)>."
37844 #: ../src/guestfs.pod:3138
37846 "Set the path that libguestfs uses to search for a supermin appliance. See "
37847 "the discussion of paths in section L</PATH> above."
37851 #: ../src/guestfs.pod:3147
37852 msgid "See also L</QEMU WRAPPERS> above."
37856 #: ../src/guestfs.pod:3151
37858 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
37859 "effect as calling C<guestfs_set_trace (g, 1)>."
37863 #: ../src/guestfs.pod:3169
37865 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-"
37866 "ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
37867 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
37868 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
37869 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)"
37870 ">, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
37871 "L<virt-sparsify(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
37872 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<febootstrap-supermin-"
37873 "helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
37877 #: ../src/guestfs.pod:3202
37879 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
37880 "(8)>, L<disktype(1)>."
37884 #: ../src/guestfs.pod:3209 ../tools/virt-make-fs.pl:553
37885 #: ../tools/virt-win-reg.pl:761
37890 #: ../src/guestfs.pod:3211
37891 msgid "To get a list of bugs against libguestfs use this link:"
37895 #: ../src/guestfs.pod:3213
37897 "L<https://bugzilla.redhat.com/buglist.cgi?"
37898 "component=libguestfs&product=Virtualization+Tools>"
37902 #: ../src/guestfs.pod:3215
37903 msgid "To report a new bug against libguestfs use this link:"
37907 #: ../src/guestfs.pod:3217
37909 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
37910 "component=libguestfs&product=Virtualization+Tools>"
37914 #: ../src/guestfs.pod:3219
37915 msgid "When reporting a bug, please check:"
37919 #: ../src/guestfs.pod:3225
37920 msgid "That the bug hasn't been reported already."
37924 #: ../src/guestfs.pod:3229
37925 msgid "That you are testing a recent version."
37929 #: ../src/guestfs.pod:3233
37930 msgid "Describe the bug accurately, and give a way to reproduce it."
37934 #: ../src/guestfs.pod:3237
37936 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
37941 #: ../test-tool/libguestfs-test-tool.pod:5
37942 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
37946 #: ../test-tool/libguestfs-test-tool.pod:9
37949 " libguestfs-test-tool [--options]\n"
37954 #: ../test-tool/libguestfs-test-tool.pod:13
37956 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
37957 "to check basic libguestfs functionality is working. This is needed because "
37958 "libguestfs occasionally breaks for reasons beyond our control: usually "
37959 "because of changes in the underlying qemu or kernel packages, or the host "
37964 #: ../test-tool/libguestfs-test-tool.pod:19
37965 msgid "If you suspect a problem in libguestfs, then just run:"
37969 #: ../test-tool/libguestfs-test-tool.pod:21
37972 " libguestfs-test-tool\n"
37977 #: ../test-tool/libguestfs-test-tool.pod:23
37978 msgid "It will print lots of diagnostic messages."
37982 #: ../test-tool/libguestfs-test-tool.pod:25
37983 msgid "If it runs to completion successfully, you will see this near the end:"
37987 #: ../test-tool/libguestfs-test-tool.pod:27
37990 " ===== TEST FINISHED OK =====\n"
37995 #: ../test-tool/libguestfs-test-tool.pod:29
37996 msgid "and the test tool will exit with code 0."
38000 #: ../test-tool/libguestfs-test-tool.pod:31
38002 "If it fails (and/or exits with non-zero error code), please paste the "
38003 "I<complete, unedited> output of the test tool into a bug report. More "
38004 "information about reporting bugs can be found on the L<http://libguestfs.org/"
38009 #: ../test-tool/libguestfs-test-tool.pod:42
38010 msgid "Display short usage information and exit."
38014 #: ../test-tool/libguestfs-test-tool.pod:44
38015 msgid "B<--qemu qemu_binary>"
38019 #: ../test-tool/libguestfs-test-tool.pod:46
38021 "If you have downloaded another qemu binary, point this option at the full "
38022 "path of the binary to try it."
38026 #: ../test-tool/libguestfs-test-tool.pod:49
38027 msgid "B<--qemudir qemu_source_dir>"
38031 #: ../test-tool/libguestfs-test-tool.pod:51
38033 "If you have compiled qemu from source, point this option at the source "
38034 "directory to try it."
38038 #: ../test-tool/libguestfs-test-tool.pod:54
38043 #: ../test-tool/libguestfs-test-tool.pod:56
38044 msgid "B<--timeout N>"
38048 #: ../test-tool/libguestfs-test-tool.pod:58
38050 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38051 "minutes) which does not usually need to be adjusted."
38055 #: ../test-tool/libguestfs-test-tool.pod:63
38056 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38060 #: ../test-tool/libguestfs-test-tool.pod:65
38062 "If you have compiled another version of qemu from source and would like to "
38063 "try that, then you can use the I<--qemudir> option to point to the qemu "
38064 "source directory."
38068 #: ../test-tool/libguestfs-test-tool.pod:69
38070 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38071 "option to point to the binary."
38075 #: ../test-tool/libguestfs-test-tool.pod:72
38077 "Note when using these options, you can ignore the business of qemu wrapper "
38078 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38079 "wrapper script for you if one is needed."
38083 #: ../test-tool/libguestfs-test-tool.pod:76
38084 msgid "TRYING OUT A DIFFERENT KERNEL"
38088 #: ../test-tool/libguestfs-test-tool.pod:78
38090 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38091 "libguestfs tries. You do this by setting the environment variables "
38092 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38096 #: ../test-tool/libguestfs-test-tool.pod:82
38098 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38103 #: ../test-tool/libguestfs-test-tool.pod:85
38104 msgid "SELF-DIAGNOSIS"
38108 #: ../test-tool/libguestfs-test-tool.pod:87
38110 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38111 "produced by libguestfs-test-tool and/or possible errors."
38115 #: ../test-tool/libguestfs-test-tool.pod:92
38117 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38118 "I<1> if there was an error."
38122 #: ../test-tool/libguestfs-test-tool.pod:97
38124 "For the full list of environment variables which may affect libguestfs, "
38125 "please see the L<guestfs(3)> manual page."
38129 #: ../test-tool/libguestfs-test-tool.pod:102
38130 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38134 #: ../tools/virt-list-filesystems.pl:32
38136 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38140 #: ../tools/virt-list-filesystems.pl:36
38143 " virt-list-filesystems [--options] domname\n"
38148 #: ../tools/virt-list-filesystems.pl:38
38151 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38156 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38158 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38163 #: ../tools/virt-list-filesystems.pl:45
38165 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38166 "are contained in a virtual machine or disk image."
38170 #: ../tools/virt-list-filesystems.pl:49
38172 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38173 "functionality. For more complex cases you should look at the L<guestfish(1)"
38178 #: ../tools/virt-list-filesystems.pl:112
38180 "With this option, C<virt-list-filesystems> displays the type of each "
38181 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38185 #: ../tools/virt-list-filesystems.pl:119
38190 #: ../tools/virt-list-filesystems.pl:123
38192 "Normally we only show mountable filesystems. If this option is given then "
38193 "swap devices are shown too."
38197 #: ../tools/virt-list-filesystems.pl:197
38199 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
38200 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
38201 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38205 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38206 msgid "Copyright (C) 2009 Red Hat Inc."
38210 #: ../tools/virt-list-partitions.pl:32
38212 "virt-list-partitions - List partitions in a virtual machine or disk image"
38216 #: ../tools/virt-list-partitions.pl:36
38219 " virt-list-partitions [--options] domname\n"
38224 #: ../tools/virt-list-partitions.pl:38
38227 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
38232 #: ../tools/virt-list-partitions.pl:45
38234 "C<virt-list-partitions> is a command line tool to list the partitions that "
38235 "are contained in a virtual machine or disk image. It is mainly useful as a "
38236 "first step to using L<virt-resize(1)>."
38240 #: ../tools/virt-list-partitions.pl:50
38242 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
38243 "functionality. For more complex cases you should look at the L<guestfish(1)"
38248 #: ../tools/virt-list-partitions.pl:113
38249 msgid "Show sizes in human-readable form (eg. \"1G\")."
38253 #: ../tools/virt-list-partitions.pl:123
38255 "With this option, C<virt-list-partitions> displays the type and size of each "
38256 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
38260 #: ../tools/virt-list-partitions.pl:130
38265 #: ../tools/virt-list-partitions.pl:132
38270 #: ../tools/virt-list-partitions.pl:134
38272 "Display the total size of each block device (as a separate row or rows)."
38276 #: ../tools/virt-list-partitions.pl:267
38278 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
38279 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
38280 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38284 #: ../tools/virt-list-partitions.pl:283
38285 msgid "Copyright (C) 2009-2010 Red Hat Inc."
38289 #: ../tools/virt-make-fs.pl:37
38290 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
38294 #: ../tools/virt-make-fs.pl:41
38297 " virt-make-fs [--options] input.tar output.img\n"
38302 #: ../tools/virt-make-fs.pl:43
38305 " virt-make-fs [--options] input.tar.gz output.img\n"
38310 #: ../tools/virt-make-fs.pl:45
38313 " virt-make-fs [--options] directory output.img\n"
38318 #: ../tools/virt-make-fs.pl:49
38320 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
38321 "archive or some files in a directory. It is similar to tools like L<mkisofs"
38322 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
38323 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
38324 "you want to attach these filesystems to existing virtual machines (eg. to "
38325 "import large amounts of read-only data to a VM)."
38329 #: ../tools/virt-make-fs.pl:57
38330 msgid "Basic usage is:"
38334 #: ../tools/virt-make-fs.pl:59
38337 " virt-make-fs input output\n"
38342 #: ../tools/virt-make-fs.pl:61
38344 "where C<input> is either a directory containing files that you want to add, "
38345 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
38346 "C<output> is a disk image. The input type is detected automatically. The "
38347 "output disk image defaults to a raw ext2 image unless you specify extra "
38348 "flags (see L</OPTIONS> below)."
38352 #: ../tools/virt-make-fs.pl:67
38353 msgid "EXTRA SPACE"
38357 #: ../tools/virt-make-fs.pl:69
38359 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
38360 "the files that it contains, but might have extra space. Depending on how "
38361 "you are going to use the output, you might think this extra space is wasted "
38362 "and want to minimize it, or you might want to leave space so that more files "
38363 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
38364 "but you can use the I<--size> flag to leave space in the filesystem if you "
38369 #: ../tools/virt-make-fs.pl:77
38371 "An alternative way to leave extra space but not make the output image any "
38372 "bigger is to use an alternative disk image format (instead of the default "
38373 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
38374 "image format (check your hypervisor supports this before using it). This "
38375 "allows you to choose a large I<--size> but the extra space won't actually be "
38376 "allocated in the image until you try to store something in it."
38380 #: ../tools/virt-make-fs.pl:85
38382 "Don't forget that you can also use local commands including L<resize2fs(8)> "
38383 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
38384 "to build another image from scratch."
38388 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
38389 #: ../tools/virt-make-fs.pl:142
38394 #: ../tools/virt-make-fs.pl:91
38397 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
38402 #: ../tools/virt-make-fs.pl:93
38403 msgid "FILESYSTEM TYPE"
38407 #: ../tools/virt-make-fs.pl:95
38409 "The default filesystem type is C<ext2>. Just about any filesystem type that "
38410 "libguestfs supports can be used (but I<not> read-only formats like "
38411 "ISO9660). Here are some of the more common choices:"
38415 #: ../tools/virt-make-fs.pl:101
38420 #: ../tools/virt-make-fs.pl:103
38422 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
38423 "you are not going to use the filesystem in a way that requires the journal, "
38424 "then this is just wasted overhead."
38428 #: ../tools/virt-make-fs.pl:107
38429 msgid "I<ntfs> or I<vfat>"
38433 #: ../tools/virt-make-fs.pl:109
38434 msgid "Useful if exporting data to a Windows guest."
38438 #: ../tools/virt-make-fs.pl:111
38440 "I<Note for vfat>: The tar archive or local directory must only contain files "
38441 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
38442 "program running within libguestfs is unable to change the ownership of non-"
38443 "root files, since vfat itself does not support this."
38447 #: ../tools/virt-make-fs.pl:116
38452 #: ../tools/virt-make-fs.pl:118
38454 "Lower overhead than C<ext2>, but certain limitations on filename length and "
38455 "total filesystem size."
38459 #: ../tools/virt-make-fs.pl:125
38462 " virt-make-fs --type=minix input minixfs.img\n"
38467 #: ../tools/virt-make-fs.pl:127
38468 msgid "TO PARTITION OR NOT TO PARTITION"
38472 #: ../tools/virt-make-fs.pl:129
38473 msgid "Optionally virt-make-fs can add a partition table to the output disk."
38477 #: ../tools/virt-make-fs.pl:131
38479 "Adding a partition can make the disk image more compatible with certain "
38480 "virtualized operating systems which don't expect to see a filesystem "
38481 "directly located on a block device (Linux doesn't care and will happily "
38482 "handle both types)."
38486 #: ../tools/virt-make-fs.pl:136
38488 "On the other hand, if you have a partition table then the output image is no "
38489 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
38490 "directly on a partitioned disk image. (However libguestfs tools such as "
38491 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
38495 #: ../tools/virt-make-fs.pl:144
38496 msgid "Add an MBR partition:"
38500 #: ../tools/virt-make-fs.pl:146
38503 " virt-make-fs --partition -- input disk.img\n"
38508 #: ../tools/virt-make-fs.pl:148
38510 "If the output disk image could be terabyte-sized or larger, it's better to "
38511 "use an EFI/GPT-compatible partition table:"
38515 #: ../tools/virt-make-fs.pl:151
38518 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
38523 #: ../tools/virt-make-fs.pl:179
38524 msgid "Enable debugging information."
38528 #: ../tools/virt-make-fs.pl:185
38529 msgid "B<--size=E<lt>NE<gt>>"
38533 #: ../tools/virt-make-fs.pl:187
38534 msgid "B<--size=+E<lt>NE<gt>>"
38538 #: ../tools/virt-make-fs.pl:189
38539 msgid "B<-s E<lt>NE<gt>>"
38543 #: ../tools/virt-make-fs.pl:191
38544 msgid "B<-s +E<lt>NE<gt>>"
38548 #: ../tools/virt-make-fs.pl:193
38550 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
38554 #: ../tools/virt-make-fs.pl:196
38556 "If this option is I<not> given, then the output image will be just large "
38557 "enough to contain all the files, with not much wasted space."
38561 #: ../tools/virt-make-fs.pl:199
38563 "To choose a fixed size output disk, specify an absolute number followed by b/"
38564 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38565 "Petabytes or Exabytes. This must be large enough to contain all the input "
38566 "files, else you will get an error."
38570 #: ../tools/virt-make-fs.pl:204
38572 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
38573 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38574 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
38575 "the input files, and (approximately) an extra 200 MB free space."
38579 #: ../tools/virt-make-fs.pl:210
38581 "Note that virt-make-fs estimates free space, and therefore will not produce "
38582 "filesystems containing precisely the free space requested. (It is much more "
38583 "expensive and time-consuming to produce a filesystem which has precisely the "
38584 "desired free space)."
38588 #: ../tools/virt-make-fs.pl:219
38589 msgid "B<--format=E<lt>fmtE<gt>>"
38593 #: ../tools/virt-make-fs.pl:221
38594 msgid "B<-F E<lt>fmtE<gt>>"
38598 #: ../tools/virt-make-fs.pl:223
38599 msgid "Choose the output disk image format."
38603 #: ../tools/virt-make-fs.pl:225
38604 msgid "The default is C<raw> (raw disk image)."
38608 #: ../tools/virt-make-fs.pl:227
38610 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
38611 "that would really make sense here is C<qcow2>."
38615 #: ../tools/virt-make-fs.pl:234
38616 msgid "B<--type=E<lt>fsE<gt>>"
38620 #: ../tools/virt-make-fs.pl:236
38621 msgid "B<-t E<lt>fsE<gt>>"
38625 #: ../tools/virt-make-fs.pl:238
38626 msgid "Choose the output filesystem type."
38630 #: ../tools/virt-make-fs.pl:240
38631 msgid "The default is C<ext2>."
38635 #: ../tools/virt-make-fs.pl:242
38637 "Any filesystem which is supported read-write by libguestfs can be used here."
38641 #: ../tools/virt-make-fs.pl:249
38642 msgid "B<--partition>"
38646 #: ../tools/virt-make-fs.pl:251
38647 msgid "B<--partition=E<lt>parttypeE<gt>>"
38651 #: ../tools/virt-make-fs.pl:253
38653 "If specified, this flag adds an MBR partition table to the output disk image."
38657 #: ../tools/virt-make-fs.pl:256
38659 "You can change the partition table type, eg. I<--partition=gpt> for large "
38664 #: ../tools/virt-make-fs.pl:259
38666 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
38667 "might consider the next parameter to be the partition type. For example:"
38671 #: ../tools/virt-make-fs.pl:263
38674 " virt-make-fs --partition input.tar ...\n"
38679 #: ../tools/virt-make-fs.pl:265
38681 "would cause virt-make-fs to think you wanted to use a partition type of "
38682 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
38683 "dash) between options and the input file argument:"
38687 #: ../tools/virt-make-fs.pl:269
38690 " virt-make-fs --partition -- input.tar ...\n"
38695 #: ../tools/virt-make-fs.pl:541
38697 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
38698 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
38699 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
38703 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
38705 "When reporting bugs, please enable debugging and capture the I<complete> "
38710 #: ../tools/virt-make-fs.pl:558
38713 " export LIBGUESTFS_DEBUG=1\n"
38714 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
38719 #: ../tools/virt-make-fs.pl:561
38721 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
38726 #: ../tools/virt-tar.pl:33
38727 msgid "virt-tar - Extract or upload files to a virtual machine"
38731 #: ../tools/virt-tar.pl:37
38734 " virt-tar [--options] -x domname directory tarball\n"
38739 #: ../tools/virt-tar.pl:39
38742 " virt-tar [--options] -u domname tarball directory\n"
38747 #: ../tools/virt-tar.pl:41
38750 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
38755 #: ../tools/virt-tar.pl:43
38758 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
38763 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
38768 #: ../tools/virt-tar.pl:47
38770 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
38771 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
38775 #: ../tools/virt-tar.pl:52
38776 msgid "Download C</home> from the VM into a local tarball:"
38780 #: ../tools/virt-tar.pl:54
38783 " virt-tar -x domname /home home.tar\n"
38788 #: ../tools/virt-tar.pl:56
38791 " virt-tar -zx domname /home home.tar.gz\n"
38796 #: ../tools/virt-tar.pl:58
38797 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
38801 #: ../tools/virt-tar.pl:60
38804 " virt-tar -u domname uploadstuff.tar /tmp\n"
38809 #: ../tools/virt-tar.pl:62
38812 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
38817 #: ../tools/virt-tar.pl:66
38819 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
38820 "virtual machines. If you do this, you risk disk corruption in the VM. "
38821 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
38825 #: ../tools/virt-tar.pl:71
38827 "You can use I<-x> (extract) on live virtual machines, but you might get "
38828 "inconsistent results or errors if there is filesystem activity inside the "
38829 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
38830 "work, but the only way to guarantee consistent results is if the virtual "
38831 "machine is shut down."
38835 #: ../tools/virt-tar.pl:79
38837 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
38838 "parts of a guest filesystem. There are many possibilities: making backups, "
38839 "uploading data files, snooping on guest activity, fixing or customizing "
38844 #: ../tools/virt-tar.pl:84
38846 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
38847 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
38848 "should look at the L<guestfish(1)> tool."
38852 #: ../tools/virt-tar.pl:88
38854 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
38855 "its contents (recursively) from the virtual machine into a local tarball. "
38856 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
38857 "virtual machine. You cannot use these two options together."
38861 #: ../tools/virt-tar.pl:94
38863 "In addition, you may need to use the I<-z> (gZip) option to enable "
38864 "compression. When uploading, you have to specify I<-z> if the upload file "
38865 "is compressed because virt-tar won't detect this on its own."
38869 #: ../tools/virt-tar.pl:98
38871 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
38872 "example it cannot do PKZip files or bzip2 compression. If you want that "
38873 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
38874 "the L<libguestfs(3)> API)."
38878 #: ../tools/virt-tar.pl:160
38879 msgid "B<--extract>"
38883 #: ../tools/virt-tar.pl:162
38884 msgid "B<--download>"
38888 #: ../tools/virt-tar.pl:164
38893 #: ../tools/virt-tar.pl:166
38894 msgid "B<--upload>"
38898 #: ../tools/virt-tar.pl:168
38900 "Use I<-x> to extract (download) a directory from a virtual machine to a "
38905 #: ../tools/virt-tar.pl:171
38907 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
38908 "Please read the L</WARNING> section above before using this option."
38912 #: ../tools/virt-tar.pl:175
38913 msgid "You must specify exactly one of these options."
38917 #: ../tools/virt-tar.pl:181
38922 #: ../tools/virt-tar.pl:183
38927 #: ../tools/virt-tar.pl:185
38928 msgid "Specify that the input or output tarball is gzip-compressed."
38932 #: ../tools/virt-tar.pl:298
38934 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
38935 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
38936 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
38941 #: ../tools/virt-win-reg.pl:37
38943 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
38947 #: ../tools/virt-win-reg.pl:41
38950 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
38955 #: ../tools/virt-win-reg.pl:43
38958 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
38963 #: ../tools/virt-win-reg.pl:45
38966 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
38971 #: ../tools/virt-win-reg.pl:47
38974 " virt-win-reg --merge domname [input.reg ...]\n"
38979 #: ../tools/virt-win-reg.pl:49
38982 " virt-win-reg [--options] disk.img ... # instead of domname\n"
38987 #: ../tools/virt-win-reg.pl:53
38989 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
38990 "virtual machines. If you do this, you I<will> get irreversible disk "
38991 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
38992 "but doesn't catch all cases."
38996 #: ../tools/virt-win-reg.pl:58
38998 "Modifying the Windows Registry is an inherently risky operation. The format "
38999 "is deliberately obscure and undocumented, and Registry changes can leave the "
39000 "system unbootable. Therefore when using the I<--merge> option, make sure "
39001 "you have a reliable backup first."
39005 #: ../tools/virt-win-reg.pl:65
39007 "This program can export and merge Windows Registry entries from a Windows "
39012 #: ../tools/virt-win-reg.pl:68
39014 "The first parameter is the libvirt guest name or the raw disk image of a "
39019 #: ../tools/virt-win-reg.pl:71
39021 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
39022 "exported (recursively). For example:"
39026 #: ../tools/virt-win-reg.pl:74
39029 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39034 #: ../tools/virt-win-reg.pl:76
39036 "You can also display single values from within registry keys, for example:"
39040 #: ../tools/virt-win-reg.pl:79
39043 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39044 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39045 " Windows 7 Enterprise\n"
39050 #: ../tools/virt-win-reg.pl:83
39052 "With I<--merge>, you can merge a textual regedit file into the Windows "
39057 #: ../tools/virt-win-reg.pl:86
39060 " $ virt-win-reg --merge Windows7 changes.reg\n"
39065 #: ../tools/virt-win-reg.pl:90
39067 "This program is only meant for simple access to the registry. If you want "
39068 "to do complicated things with the registry, we suggest you download the "
39069 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39070 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39071 "L<hivexregedit(1)>."
39075 #: ../tools/virt-win-reg.pl:159
39080 #: ../tools/virt-win-reg.pl:161
39082 "In merge mode, this merges a textual regedit file into the Windows Registry "
39083 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39084 "displays or exports Registry entries instead."
39088 #: ../tools/virt-win-reg.pl:165
39090 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39091 "result in disk corruption. However exporting (without this flag) is always "
39096 #: ../tools/virt-win-reg.pl:173
39097 msgid "B<--encoding> UTF-16LE|ASCII"
39101 #: ../tools/virt-win-reg.pl:175
39103 "When merging (only), you may need to specify the encoding for strings to be "
39104 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
39105 "(3)/ENCODING STRINGS>."
39109 #: ../tools/virt-win-reg.pl:179
39111 "The default is to use UTF-16LE, which should work with recent versions of "
39116 #: ../tools/virt-win-reg.pl:186
39117 msgid "B<--unsafe-printable-strings>"
39121 #: ../tools/virt-win-reg.pl:188
39123 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39124 "instead of hex sequences. Remove the final zero codepoint from strings if "
39129 #: ../tools/virt-win-reg.pl:192
39131 "This is unsafe and does not preserve the fidelity of strings in the original "
39132 "Registry for various reasons:"
39136 #: ../tools/virt-win-reg.pl:199
39138 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39139 "other encodings will be corrupted by this transformation."
39143 #: ../tools/virt-win-reg.pl:204
39145 "Assumes that everything which has type 1 or 2 is really a string and that "
39146 "everything else is not a string, but the type field in real Registries is "
39151 #: ../tools/virt-win-reg.pl:210
39153 "Loses information about whether a zero codepoint followed the string in the "
39158 #: ../tools/virt-win-reg.pl:215
39160 "This all happens because the Registry itself contains no information about "
39161 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39165 #: ../tools/virt-win-reg.pl:219
39167 "You should only use this option for quick hacking and debugging of the "
39168 "Registry contents, and I<never> use it if the output is going to be passed "
39169 "into another program or stored in another Registry."
39173 #: ../tools/virt-win-reg.pl:556
39174 msgid "SUPPORTED SYSTEMS"
39178 #: ../tools/virt-win-reg.pl:558
39180 "The program currently supports Windows NT-derived guests starting with "
39181 "Windows XP through to at least Windows 7."
39185 #: ../tools/virt-win-reg.pl:561
39186 msgid "The following Registry keys are supported:"
39190 #: ../tools/virt-win-reg.pl:565
39191 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39195 #: ../tools/virt-win-reg.pl:567
39196 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39200 #: ../tools/virt-win-reg.pl:569
39201 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39205 #: ../tools/virt-win-reg.pl:571
39206 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39210 #: ../tools/virt-win-reg.pl:573
39211 msgid "C<HKEY_USERS\\.DEFAULT>"
39215 #: ../tools/virt-win-reg.pl:575
39216 msgid "C<HKEY_USERS\\I<SID>>"
39220 #: ../tools/virt-win-reg.pl:577
39221 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
39225 #: ../tools/virt-win-reg.pl:579
39226 msgid "C<HKEY_USERS\\I<username>>"
39230 #: ../tools/virt-win-reg.pl:581
39232 "where I<username> is a local user name (this is a libguestfs extension)."
39236 #: ../tools/virt-win-reg.pl:585
39238 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
39243 #: ../tools/virt-win-reg.pl:588
39245 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
39246 "supported (there is no \"current user\")."
39250 #: ../tools/virt-win-reg.pl:591
39255 #: ../tools/virt-win-reg.pl:593
39257 "C<virt-win-reg> expects that regedit files have already been reencoded in "
39258 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
39259 "style line endings. Since Windows regedit files are often in UTF-16LE with "
39260 "Windows-style line endings, you may need to reencode the whole file before "
39261 "or after processing."
39265 #: ../tools/virt-win-reg.pl:599
39267 "To reencode a file from Windows format to Linux (before processing it with "
39268 "the I<--merge> option), you would do something like this:"
39272 #: ../tools/virt-win-reg.pl:602
39275 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
39280 #: ../tools/virt-win-reg.pl:604
39282 "To go in the opposite direction, after exporting and before sending the file "
39283 "to a Windows user, do something like this:"
39287 #: ../tools/virt-win-reg.pl:607
39290 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
39295 #: ../tools/virt-win-reg.pl:609
39296 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
39300 #: ../tools/virt-win-reg.pl:611
39302 "If you are unsure about the current encoding, use the L<file(1)> command. "
39303 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
39304 "style (CRLF) line endings, like this:"
39308 #: ../tools/virt-win-reg.pl:615
39311 " $ file software.reg\n"
39312 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
39313 " with CRLF line terminators\n"
39318 #: ../tools/virt-win-reg.pl:619
39319 msgid "This file would need conversion before you could I<--merge> it."
39323 #: ../tools/virt-win-reg.pl:621
39324 msgid "CurrentControlSet etc."
39328 #: ../tools/virt-win-reg.pl:623
39330 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
39331 "Registry at the level of the hive file, and therefore you cannot modify "
39336 #: ../tools/virt-win-reg.pl:627
39338 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
39339 "circumstances it might refer to another control set. The way to find out is "
39340 "to look at the C<HKLM\\SYSTEM\\Select> key:"
39344 #: ../tools/virt-win-reg.pl:631
39347 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
39348 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
39349 " \"Current\"=dword:00000001\n"
39350 " \"Default\"=dword:00000001\n"
39351 " \"Failed\"=dword:00000000\n"
39352 " \"LastKnownGood\"=dword:00000002\n"
39357 #: ../tools/virt-win-reg.pl:638
39358 msgid "\"Current\" is the one which Windows will choose when it boots."
39362 #: ../tools/virt-win-reg.pl:640
39364 "Similarly, other C<Current...> keys in the path may need to be replaced."
39368 #: ../tools/virt-win-reg.pl:643
39369 msgid "WINDOWS TIPS"
39373 #: ../tools/virt-win-reg.pl:645
39375 "Note that some of these tips modify the guest disk image. The guest I<must> "
39376 "be shut off, else you will get disk corruption."
39380 #: ../tools/virt-win-reg.pl:648
39381 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
39385 #: ../tools/virt-win-reg.pl:650
39387 "Prepare a DOS batch script, VBScript or executable. Upload this using "
39388 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
39389 "is uploaded into C<C:\\>:"
39393 #: ../tools/virt-win-reg.pl:654
39396 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
39401 #: ../tools/virt-win-reg.pl:656
39402 msgid "Prepare a regedit file containing the registry change:"
39406 #: ../tools/virt-win-reg.pl:658
39409 " cat > test.reg <<'EOF'\n"
39410 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
39411 " \"Test\"=\"c:\\\\test.bat\"\n"
39417 #: ../tools/virt-win-reg.pl:663
39419 "In this example we use the key C<RunOnce> which means that the script will "
39420 "run precisely once when the first user logs in. If you want it to run every "
39421 "time a user logs in, replace C<RunOnce> with C<Run>."
39425 #: ../tools/virt-win-reg.pl:667
39426 msgid "Now update the registry:"
39430 #: ../tools/virt-win-reg.pl:669
39433 " virt-win-reg --merge WindowsGuest test.reg\n"
39438 #: ../tools/virt-win-reg.pl:671
39439 msgid "INSTALLING A SERVICE"
39443 #: ../tools/virt-win-reg.pl:673
39445 "This section assumes you are familiar with Windows services, and you either "
39446 "have a program which handles the Windows Service Control Protocol directly "
39447 "or you want to run any program using a service wrapper like SrvAny or the "
39452 #: ../tools/virt-win-reg.pl:678
39454 "First upload the program and optionally the service wrapper. In this case "
39455 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
39459 #: ../tools/virt-win-reg.pl:682
39462 " guestfish -i -d WindowsGuest <<EOF\n"
39463 " upload rhsrvany.exe /rhsrvany.exe\n"
39464 " upload test.exe /test.exe\n"
39470 #: ../tools/virt-win-reg.pl:687
39472 "Prepare a regedit file containing the registry changes. In this example, "
39473 "the first registry change is needed for the service itself or the service "
39474 "wrapper (if used). The second registry change is only needed because I am "
39475 "using the RHSrvAny service wrapper."
39479 #: ../tools/virt-win-reg.pl:692
39482 " cat > service.reg <<'EOF'\n"
39483 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
39484 " \"Type\"=dword:00000010\n"
39485 " \"Start\"=dword:00000002\n"
39486 " \"ErrorControl\"=dword:00000001\n"
39487 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
39488 " \"DisplayName\"=\"RHSrvAny\"\n"
39489 " \"ObjectName\"=\"NetworkService\"\n"
39494 #: ../tools/virt-win-reg.pl:701
39497 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
39498 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
39499 " \"PWD\"=\"c:\\\\Temp\"\n"
39505 #: ../tools/virt-win-reg.pl:712
39507 "For use of C<ControlSet001> see the section above in this manual page. You "
39508 "may need to adjust this according to the control set that is in use by the "
39513 #: ../tools/virt-win-reg.pl:718
39515 "C<\"ObjectName\"> controls the privileges that the service will have. An "
39516 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
39517 "privileged account."
39521 #: ../tools/virt-win-reg.pl:724
39523 "For the meaning of the magic numbers, see this Microsoft KB article: "
39524 "L<http://support.microsoft.com/kb/103000>."
39528 #: ../tools/virt-win-reg.pl:729
39529 msgid "Update the registry:"
39533 #: ../tools/virt-win-reg.pl:731
39536 " virt-win-reg --merge WindowsGuest service.reg\n"
39541 #: ../tools/virt-win-reg.pl:735
39543 "Be careful when passing parameters containing C<\\> (backslash) in the "
39544 "shell. Usually you will have to use 'single quotes' or double backslashes "
39545 "(but not both) to protect them from the shell."
39549 #: ../tools/virt-win-reg.pl:739
39550 msgid "Paths and value names are case-insensitive."
39554 #: ../tools/virt-win-reg.pl:748
39556 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
39557 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
39558 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39562 #: ../tools/virt-win-reg.pl:766
39565 " export LIBGUESTFS_DEBUG=1\n"
39566 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
39571 #: ../tools/virt-win-reg.pl:769
39573 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."