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-08-07 23:15+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 #: ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14
25 #: ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3
26 #: ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3
27 #: ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3
28 #: ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3
29 #: ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3
30 #: ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3
31 #: ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3
32 #: ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3
33 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30
34 #: ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31
35 #: ../tools/virt-win-reg.pl:35
40 #: ../cat/virt-cat.pod:5
41 msgid "virt-cat - Display files in a virtual machine"
45 #: ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7
46 #: ../df/virt-df.pod:7 ../edit/virt-edit.pod:7
47 #: ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7
48 #: ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7
49 #: ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7
50 #: ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7
51 #: ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7
52 #: ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7
53 #: ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7
54 #: ../ruby/examples/guestfs-ruby.pod:7 ../src/guestfs.pod:7
55 #: ../test-tool/libguestfs-test-tool.pod:7
56 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34
57 #: ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35
58 #: ../tools/virt-win-reg.pl:39
63 #: ../cat/virt-cat.pod:9
66 " virt-cat [--options] -d domname file [file ...]\n"
71 #: ../cat/virt-cat.pod:11
74 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
79 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15
80 #: ../inspector/virt-inspector.pod:13
85 #: ../cat/virt-cat.pod:15
88 " virt-cat domname file\n"
93 #: ../cat/virt-cat.pod:17
96 " virt-cat disk.img file\n"
101 #: ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19
102 #: ../df/virt-df.pod:21 ../edit/virt-edit.pod:27
103 #: ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18
104 #: ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19
105 #: ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21
106 #: ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20
107 #: ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15
108 #: ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18
109 #: ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29
110 #: ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15
111 #: ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11
112 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40
113 #: ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77
114 #: ../tools/virt-win-reg.pl:63
119 #: ../cat/virt-cat.pod:21
121 "C<virt-cat> is a command line tool to display the contents of C<file> where "
122 "C<file> exists in the named virtual machine (or disk image)."
126 #: ../cat/virt-cat.pod:24
128 "Multiple filenames can be given, in which case they are concatenated "
129 "together. Each filename must be a full path, starting at the root directory "
130 "(starting with '/')."
134 #: ../cat/virt-cat.pod:28
136 "C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-"
137 "edit>. For more complex cases you should look at the L<guestfish(1)> tool "
138 "(see L</USING GUESTFISH> below)."
142 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43
143 #: ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41
144 #: ../fish/guestfish.pod:1007 ../fish/virt-copy-in.pod:29
145 #: ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30
146 #: ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39
147 #: ../resize/virt-resize.pod:27 ../tools/virt-tar.pl:50
152 #: ../cat/virt-cat.pod:34
154 "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
158 #: ../cat/virt-cat.pod:37
161 " virt-cat -d mydomain /etc/fstab\n"
166 #: ../cat/virt-cat.pod:39
167 msgid "List syslog messages from a VM disk image file:"
171 #: ../cat/virt-cat.pod:41
174 " virt-cat -a disk.img /var/log/messages | tail\n"
179 #: ../cat/virt-cat.pod:43
180 msgid "Find out what DHCP IP address a VM acquired:"
184 #: ../cat/virt-cat.pod:45
187 " virt-cat -d mydomain /var/log/messages | \\\n"
188 " grep 'dhclient: bound to' | tail\n"
193 #: ../cat/virt-cat.pod:48
194 msgid "Find out what packages were recently installed:"
198 #: ../cat/virt-cat.pod:50
201 " virt-cat -d mydomain /var/log/yum.log | tail\n"
206 #: ../cat/virt-cat.pod:52
207 msgid "Find out who is logged on inside a virtual machine:"
211 #: ../cat/virt-cat.pod:54
214 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
220 #: ../cat/virt-cat.pod:57
221 msgid "or who was logged on:"
225 #: ../cat/virt-cat.pod:59
228 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
229 " last -f /tmp/wtmp\n"
234 #: ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91
235 #: ../cat/virt-ls.pod:261 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62
236 #: ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45
237 #: ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42
238 #: ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83
239 #: ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84
240 #: ../resize/virt-resize.pod:241 ../test-tool/libguestfs-test-tool.pod:37
241 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54
242 #: ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103
243 #: ../tools/virt-win-reg.pl:96
248 #: ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95
249 #: ../cat/virt-ls.pod:265 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66
250 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151
251 #: ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88
252 #: ../resize/virt-resize.pod:245 ../tools/virt-list-filesystems.pl:61
253 #: ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161
254 #: ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
259 #: ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97
260 #: ../cat/virt-ls.pod:267 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68
261 #: ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90
262 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64
263 #: ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113
264 #: ../tools/virt-win-reg.pl:106
265 msgid "Display brief help."
269 #: ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99
270 #: ../cat/virt-ls.pod:269 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70
271 #: ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
276 #: ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101
277 #: ../cat/virt-ls.pod:271 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72
278 #: ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
279 msgid "B<--add> file"
283 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103
284 #: ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74
285 #: ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
287 "Add I<file> which should be a disk image from a virtual machine. If the "
288 "virtual machine has multiple block devices, you must supply all of them with "
289 "separate I<-a> options."
293 #: ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107
294 #: ../cat/virt-ls.pod:277 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78
295 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93
296 #: ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
298 "The format of the disk image is auto-detected. To override this and force a "
299 "particular format use the I<--format=..> option."
303 #: ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125
304 #: ../cat/virt-ls.pod:291 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
309 #: ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127
310 #: ../cat/virt-ls.pod:293 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
311 msgid "B<--connect> URI"
315 #: ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129
316 #: ../cat/virt-ls.pod:295 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99
317 #: ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111
318 #: ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82
319 #: ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
321 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
322 "to the default libvirt hypervisor."
326 #: ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132
327 #: ../cat/virt-ls.pod:298 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
329 "If you specify guest block devices directly (I<-a>), then libvirt is not "
334 #: ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141
335 #: ../cat/virt-ls.pod:307 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105
336 #: ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
341 #: ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143
342 #: ../cat/virt-ls.pod:309 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107
343 #: ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
344 msgid "B<--domain> guest"
348 #: ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145
349 #: ../cat/virt-ls.pod:311 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109
350 #: ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
352 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
357 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148
358 #: ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217
359 #: ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
360 msgid "B<--echo-keys>"
364 #: ../cat/virt-cat.pod:100
366 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
367 "so you cannot see what you are typing. If you are not worried about Tempest "
368 "attacks and there is no one else in the room you can specify this flag to "
369 "see what you are typing."
373 #: ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170
374 #: ../cat/virt-ls.pod:328 ../df/virt-df.pod:101 ../fish/guestfish.pod:233
375 #: ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99
376 #: ../rescue/virt-rescue.pod:124
377 msgid "B<--format=raw|qcow2|..>"
381 #: ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172
382 #: ../cat/virt-ls.pod:330 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134
383 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135
384 #: ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
389 #: ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174
390 #: ../cat/virt-ls.pod:332 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136
391 #: ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137
392 #: ../rescue/virt-rescue.pod:128
394 "The default for the I<-a> option is to auto-detect the format of the disk "
395 "image. Using this forces the disk format for I<-a> options which follow on "
396 "the command line. Using I<--format> with no argument switches back to auto-"
397 "detection for subsequent I<-a> options."
401 #: ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179
402 #: ../cat/virt-ls.pod:337 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141
403 #: ../fish/guestfish.pod:242 ../fish/guestfish.pod:673
404 #: ../inspector/virt-inspector.pod:335 ../rescue/virt-rescue.pod:133
405 #: ../src/guestfs.pod:2653
410 #: ../cat/virt-cat.pod:116
413 " virt-cat --format=raw -a disk.img file\n"
418 #: ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183
419 #: ../cat/virt-ls.pod:341 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145
420 #: ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
421 msgid "forces raw format (no auto-detection) for C<disk.img>."
425 #: ../cat/virt-cat.pod:120
428 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
433 #: ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187
434 #: ../cat/virt-ls.pod:345 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149
435 #: ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
437 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
438 "detection for C<another.img>."
442 #: ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190
443 #: ../cat/virt-ls.pod:348 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152
444 #: ../rescue/virt-rescue.pod:144
446 "If you have untrusted raw-format guest disk images, you should use this "
447 "option to specify the disk format. This avoids a possible security problem "
448 "with malicious guests (CVE-2010-3851)."
452 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200
453 #: ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289
454 #: ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
455 msgid "B<--keys-from-stdin>"
459 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202
460 #: ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291
461 #: ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
463 "Read key or passphrase parameters from stdin. The default is to try to read "
464 "passphrases from the user by opening C</dev/tty>."
468 #: ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261
469 #: ../cat/virt-ls.pod:425 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161
470 #: ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257
471 #: ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:178
476 #: ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263
477 #: ../cat/virt-ls.pod:427 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163
478 #: ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259
479 #: ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:180
484 #: ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265
485 #: ../cat/virt-ls.pod:429 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165
486 #: ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:182
487 msgid "Enable verbose messages for debugging."
491 #: ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267
492 #: ../cat/virt-ls.pod:431 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167
493 #: ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263
494 #: ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:184
495 #: ../resize/virt-resize.pod:478
500 #: ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269
501 #: ../cat/virt-ls.pod:433 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169
502 #: ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265
503 #: ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:186
504 #: ../resize/virt-resize.pod:480 ../tools/virt-list-filesystems.pl:69
505 #: ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169
506 #: ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
511 #: ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271
512 #: ../cat/virt-ls.pod:435 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171
513 #: ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:188
514 #: ../resize/virt-resize.pod:482 ../tools/virt-list-filesystems.pl:71
515 #: ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171
516 #: ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
517 msgid "Display version number and exit."
521 #: ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281
522 #: ../cat/virt-ls.pod:437 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173
523 #: ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278
524 #: ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:199
525 #: ../tools/virt-tar.pl:158
530 #: ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283
531 #: ../cat/virt-ls.pod:439 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175
532 #: ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:201
533 msgid "Enable tracing of libguestfs API calls."
537 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179
538 #: ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:205
539 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
543 #: ../cat/virt-cat.pod:154
544 msgid "Previous versions of virt-cat allowed you to write either:"
548 #: ../cat/virt-cat.pod:156
551 " virt-cat disk.img [disk.img ...] file\n"
556 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185
557 #: ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:211
562 #: ../cat/virt-cat.pod:160
565 " virt-cat guestname file\n"
570 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189
571 #: ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:215
573 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
574 "the confusing case where a disk image might have the same name as a guest."
578 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193
579 #: ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:219
580 msgid "For compatibility the old style is still supported."
584 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
585 msgid "USING GUESTFISH"
589 #: ../cat/virt-cat.pod:170
591 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
592 "C<virt-cat> doesn't work."
596 #: ../cat/virt-cat.pod:173
597 msgid "Using C<virt-cat> is approximately equivalent to doing:"
601 #: ../cat/virt-cat.pod:175
604 " guestfish --ro -i -d domname download file -\n"
609 #: ../cat/virt-cat.pod:177
611 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
612 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
616 #: ../cat/virt-cat.pod:181
618 "The command above uses libguestfs's guest inspection feature and so does not "
619 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
620 "disk images that don't contain guests. To display a file from a disk image "
625 #: ../cat/virt-cat.pod:186
628 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
633 #: ../cat/virt-cat.pod:188
635 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
636 "the disk image to edit, and C<file> is the full path to the file."
640 #: ../cat/virt-cat.pod:192 ../cat/virt-filesystems.pod:365
641 #: ../cat/virt-ls.pod:483 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342
642 #: ../inspector/virt-inspector.pod:349 ../rescue/virt-rescue.pod:262
643 #: ../resize/virt-resize.pod:543 ../tools/virt-list-filesystems.pl:188
644 #: ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532
645 #: ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
646 msgid "SHELL QUOTING"
650 #: ../cat/virt-cat.pod:194 ../cat/virt-filesystems.pod:367
651 #: ../cat/virt-ls.pod:485 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344
652 #: ../inspector/virt-inspector.pod:351 ../rescue/virt-rescue.pod:264
653 #: ../resize/virt-resize.pod:545 ../tools/virt-list-filesystems.pl:190
654 #: ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534
655 #: ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
657 "Libvirt guest names can contain arbitrary characters, some of which have "
658 "meaning to the shell such as C<#> and space. You may need to quote or "
659 "escape these characters on the command line. See the shell manual page L<sh"
664 #: ../cat/virt-cat.pod:199 ../cat/virt-filesystems.pod:372
665 #: ../cat/virt-ls.pod:490 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349
666 #: ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384
667 #: ../fish/guestfish.pod:1224 ../fish/virt-copy-in.pod:50
668 #: ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47
669 #: ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:303
670 #: ../inspector/virt-inspector.pod:372 ../java/examples/guestfs-java.pod:45
671 #: ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39
672 #: ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:284
673 #: ../resize/virt-resize.pod:550 ../ruby/examples/guestfs-ruby.pod:36
674 #: ../src/guestfs.pod:3027 ../test-tool/libguestfs-test-tool.pod:87
675 #: ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265
676 #: ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296
677 #: ../tools/virt-win-reg.pl:746
682 #: ../cat/virt-cat.pod:201
684 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-"
685 "tar-out(1)>, L<http://libguestfs.org/>."
689 #: ../cat/virt-cat.pod:208 ../cat/virt-filesystems.pod:383
690 #: ../cat/virt-ls.pod:502 ../df/virt-df.pod:230 ../edit/virt-edit.pod:363
691 #: ../rescue/virt-rescue.pod:292 ../resize/virt-resize.pod:571
692 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277
693 #: ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311
694 #: ../tools/virt-win-reg.pl:772
699 #: ../cat/virt-cat.pod:210 ../cat/virt-filesystems.pod:385
700 #: ../cat/virt-ls.pod:504 ../df/virt-df.pod:232 ../edit/virt-edit.pod:365
701 #: ../inspector/virt-inspector.pod:386 ../rescue/virt-rescue.pod:294
702 #: ../resize/virt-resize.pod:573 ../tools/virt-list-filesystems.pl:210
703 #: ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566
704 #: ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
705 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
709 #: ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:387
710 #: ../cat/virt-ls.pod:506 ../df/virt-df.pod:234 ../edit/virt-edit.pod:367
711 #: ../examples/guestfs-examples.pod:48 ../examples/guestfs-recipes.pod:400
712 #: ../fish/guestfish.pod:1253 ../fish/virt-copy-in.pod:64
713 #: ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62
714 #: ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:318
715 #: ../inspector/virt-inspector.pod:394 ../java/examples/guestfs-java.pod:61
716 #: ../ocaml/examples/guestfs-ocaml.pod:94 ../perl/examples/guestfs-perl.pod:55
717 #: ../python/examples/guestfs-python.pod:57 ../rescue/virt-rescue.pod:296
718 #: ../resize/virt-resize.pod:575 ../ruby/examples/guestfs-ruby.pod:51
719 #: ../src/guestfs.pod:3103 ../test-tool/libguestfs-test-tool.pod:97
720 #: ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281
721 #: ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315
722 #: ../tools/virt-win-reg.pl:776
727 #: ../cat/virt-cat.pod:214 ../inspector/virt-inspector.pod:396
728 #: ../resize/virt-resize.pod:577
729 msgid "Copyright (C) 2010-2011 Red Hat Inc."
733 #: ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:391
734 #: ../cat/virt-ls.pod:510 ../df/virt-df.pod:238 ../edit/virt-edit.pod:371
735 #: ../fish/guestfish.pod:1258 ../fish/virt-copy-in.pod:69
736 #: ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67
737 #: ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:323
738 #: ../inspector/virt-inspector.pod:398 ../rescue/virt-rescue.pod:300
739 #: ../resize/virt-resize.pod:579 ../test-tool/libguestfs-test-tool.pod:102
740 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285
741 #: ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319
742 #: ../tools/virt-win-reg.pl:780
744 "This program is free software; you can redistribute it and/or modify it "
745 "under the terms of the GNU General Public License as published by the Free "
746 "Software Foundation; either version 2 of the License, or (at your option) "
751 #: ../cat/virt-cat.pod:221 ../cat/virt-filesystems.pod:396
752 #: ../cat/virt-ls.pod:515 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376
753 #: ../fish/guestfish.pod:1263 ../fish/virt-copy-in.pod:74
754 #: ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72
755 #: ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:328
756 #: ../inspector/virt-inspector.pod:403 ../rescue/virt-rescue.pod:305
757 #: ../resize/virt-resize.pod:584 ../test-tool/libguestfs-test-tool.pod:107
758 #: ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290
759 #: ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324
760 #: ../tools/virt-win-reg.pl:785
762 "This program is distributed in the hope that it will be useful, but WITHOUT "
763 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
764 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
769 #: ../cat/virt-cat.pod:226 ../cat/virt-filesystems.pod:401
770 #: ../cat/virt-ls.pod:520 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381
771 #: ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:79
772 #: ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77
773 #: ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:333
774 #: ../inspector/virt-inspector.pod:408 ../rescue/virt-rescue.pod:310
775 #: ../resize/virt-resize.pod:589 ../test-tool/libguestfs-test-tool.pod:112
776 #: ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295
777 #: ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329
778 #: ../tools/virt-win-reg.pl:790
780 "You should have received a copy of the GNU General Public License along with "
781 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
782 "Ave, Cambridge, MA 02139, USA."
786 #: ../cat/virt-filesystems.pod:5
788 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
789 "virtual machine or disk image"
793 #: ../cat/virt-filesystems.pod:9
796 " virt-filesystems [--options] -d domname\n"
801 #: ../cat/virt-filesystems.pod:11
804 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
809 #: ../cat/virt-filesystems.pod:15
811 "This tool allows you to discover filesystems, partitions, logical volumes, "
812 "and their sizes in a disk image or virtual machine. It is a replacement for "
813 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
817 #: ../cat/virt-filesystems.pod:20
819 "One use for this tool is from shell scripts to iterate over all filesystems "
824 #: ../cat/virt-filesystems.pod:23
827 " for fs in $(virt-filesystems -a disk.img); do\n"
834 #: ../cat/virt-filesystems.pod:27
836 "Another use is to list partitions before using another tool to modify those "
837 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
838 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
842 #: ../cat/virt-filesystems.pod:32
844 "Various command line options control what this program displays. You need "
845 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
846 "guest respectively. If you just specify that then the program shows "
847 "filesystems found, one per line, like this:"
851 #: ../cat/virt-filesystems.pod:37
854 " $ virt-filesystems -a disk.img\n"
856 " /dev/vg_guest/lv_root\n"
861 #: ../cat/virt-filesystems.pod:41
863 "If you add I<-l> or I<--long> then the output includes extra information:"
867 #: ../cat/virt-filesystems.pod:44
870 " $ virt-filesystems -a disk.img -l\n"
871 " Name Type VFS Label Size\n"
872 " /dev/sda1 filesystem ext4 boot 524288000\n"
873 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
878 #: ../cat/virt-filesystems.pod:49
880 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
885 #: ../cat/virt-filesystems.pod:52
888 " $ virt-filesystems -a disk.img --extra\n"
890 " /dev/vg_guest/lv_root\n"
891 " /dev/vg_guest/lv_swap\n"
892 " /dev/vg_guest/lv_data\n"
897 #: ../cat/virt-filesystems.pod:58
899 "If you add I<--partitions> then partitions are shown instead of filesystems:"
903 #: ../cat/virt-filesystems.pod:60
906 " $ virt-filesystems -a disk.img --partitions\n"
913 #: ../cat/virt-filesystems.pod:64
915 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, I<--physical-"
916 "volumes>, I<--block-devices> to list those items."
920 #: ../cat/virt-filesystems.pod:67
922 "You can use these options in combination as well (if you want a combination "
923 "including filesystems, you have to add I<--filesystems>). Notice that some "
924 "items fall into several categories (eg. C</dev/sda1> might be both a "
925 "partition and a filesystem). These items are listed several times. To get "
926 "a list which includes absolutely everything that virt-filesystems knows "
927 "about, use the I<--all> option."
931 #: ../cat/virt-filesystems.pod:74
933 "UUIDs (because they are quite long) are not shown by default. Add the I<--"
934 "uuid> option to display device and filesystem UUIDs in the long output."
938 #: ../cat/virt-filesystems.pod:78
940 "I<--all --long --uuid> is a useful combination to display all possible "
941 "information about everything."
945 #: ../cat/virt-filesystems.pod:81
948 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
949 " Name Type VFS Label Size Parent UUID\n"
950 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
951 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
952 " /dev/sda1 partition - - 100M /dev/sda -\n"
953 " /dev/sda2 partition - - 20G /dev/sda -\n"
954 " /dev/sda device - - 20G - -\n"
959 #: ../cat/virt-filesystems.pod:89
961 "For machine-readable output, use I<--csv> to get Comma-Separated Values."
965 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
970 #: ../cat/virt-filesystems.pod:112
972 "Display everything. This is currently the same as specifying these options: "
973 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, I<--"
974 "logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may be "
975 "added to this list in future)."
979 #: ../cat/virt-filesystems.pod:117
980 msgid "See also I<--long>."
984 #: ../cat/virt-filesystems.pod:119
989 #: ../cat/virt-filesystems.pod:121
990 msgid "B<--block-devices>"
994 #: ../cat/virt-filesystems.pod:123
995 msgid "Display block devices."
999 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1004 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1006 "Write out the results in CSV format (comma-separated values). This format "
1007 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1008 "ABOUT CSV FORMAT> below."
1012 #: ../cat/virt-filesystems.pod:150
1014 "When prompting for keys and passphrases, virt-filesystems normally turns "
1015 "echoing off so you cannot see what you are typing. If you are not worried "
1016 "about Tempest attacks and there is no one else in the room you can specify "
1017 "this flag to see what you are typing."
1021 #: ../cat/virt-filesystems.pod:155
1026 #: ../cat/virt-filesystems.pod:157
1028 "This causes filesystems that are not ordinary, mountable filesystems to be "
1029 "displayed. This category includes swapspace, and filesystems that are empty "
1030 "or contain unknown data."
1034 #: ../cat/virt-filesystems.pod:161
1035 msgid "This option implies I<--filesystems>."
1039 #: ../cat/virt-filesystems.pod:163
1040 msgid "B<--filesystems>"
1044 #: ../cat/virt-filesystems.pod:165
1046 "Display mountable filesystems. If no display option was selected then this "
1047 "option is implied."
1051 #: ../cat/virt-filesystems.pod:168
1052 msgid "With I<--extra>, non-mountable filesystems are shown too."
1056 #: ../cat/virt-filesystems.pod:181
1059 " virt-filesystems --format=raw -a disk.img\n"
1064 #: ../cat/virt-filesystems.pod:185
1067 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1072 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352
1073 #: ../df/virt-df.pod:125 ../fish/guestfish.pod:156
1074 #: ../tools/virt-list-partitions.pl:109
1079 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354
1080 #: ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1081 msgid "B<--human-readable>"
1085 #: ../cat/virt-filesystems.pod:198
1086 msgid "In I<--long> mode, display sizes in human-readable format."
1090 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366
1091 #: ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1096 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368
1097 #: ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1102 #: ../cat/virt-filesystems.pod:209
1103 msgid "Display extra columns of data (\"long format\")."
1107 #: ../cat/virt-filesystems.pod:211
1108 msgid "A title row is added unless you also specify I<--no-title>."
1112 #: ../cat/virt-filesystems.pod:213
1114 "The extra columns displayed depend on what output you select, and the "
1115 "ordering of columns may change in future versions. Use the title row, I<--"
1116 "csv> output and/or L<csvtool(1)> to match columns to data in external "
1121 #: ../cat/virt-filesystems.pod:218
1123 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1124 "default is to show raw numbers of I<bytes>."
1128 #: ../cat/virt-filesystems.pod:221
1129 msgid "Use I<--uuid> to display UUIDs too."
1133 #: ../cat/virt-filesystems.pod:223
1138 #: ../cat/virt-filesystems.pod:225
1139 msgid "B<--logvols>"
1143 #: ../cat/virt-filesystems.pod:227
1144 msgid "B<--logical-volumes>"
1148 #: ../cat/virt-filesystems.pod:229
1150 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1151 "of whether the LVs contain filesystems."
1155 #: ../cat/virt-filesystems.pod:232
1156 msgid "B<--no-title>"
1160 #: ../cat/virt-filesystems.pod:234
1161 msgid "In I<--long> mode, don't add a title row."
1165 #: ../cat/virt-filesystems.pod:236
1167 "Note that the order of the columns is not fixed, and may change in future "
1168 "versions of virt-filesystems, so using this option may give you unexpected "
1173 #: ../cat/virt-filesystems.pod:240
1178 #: ../cat/virt-filesystems.pod:242
1179 msgid "B<--partitions>"
1183 #: ../cat/virt-filesystems.pod:244
1185 "Display partitions. In this mode, these are displayed irrespective of "
1186 "whether the partitions contain filesystems."
1190 #: ../cat/virt-filesystems.pod:247
1195 #: ../cat/virt-filesystems.pod:249
1196 msgid "B<--physvols>"
1200 #: ../cat/virt-filesystems.pod:251
1201 msgid "B<--physical-volumes>"
1205 #: ../cat/virt-filesystems.pod:253
1206 msgid "Display LVM physical volumes."
1210 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1215 #: ../cat/virt-filesystems.pod:257
1220 #: ../cat/virt-filesystems.pod:259
1221 msgid "In I<--long> mode, display UUIDs as well."
1225 #: ../cat/virt-filesystems.pod:273
1230 #: ../cat/virt-filesystems.pod:275
1231 msgid "B<--volgroups>"
1235 #: ../cat/virt-filesystems.pod:277
1236 msgid "B<--volume-groups>"
1240 #: ../cat/virt-filesystems.pod:279
1241 msgid "Display LVM volume groups."
1245 #: ../cat/virt-filesystems.pod:287
1250 #: ../cat/virt-filesystems.pod:289
1252 "Note that columns in the output are subject to reordering and change in "
1253 "future versions of this tool."
1257 #: ../cat/virt-filesystems.pod:294
1262 #: ../cat/virt-filesystems.pod:296
1263 msgid "The filesystem, partition, block device or LVM name."
1267 #: ../cat/virt-filesystems.pod:298
1269 "For device and partition names these are displayed as canonical libguestfs "
1270 "names, so that for example C</dev/sda2> is the second partition on the first "
1275 #: ../cat/virt-filesystems.pod:302
1277 "If the I<--long> option is B<not> specified, then only the name column is "
1278 "shown in the output."
1282 #: ../cat/virt-filesystems.pod:305
1287 #: ../cat/virt-filesystems.pod:307
1288 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1292 #: ../cat/virt-filesystems.pod:309
1297 #: ../cat/virt-filesystems.pod:311
1299 "If there is a filesystem, then this column displays the filesystem type if "
1300 "one could be detected, eg. C<ext4>."
1304 #: ../cat/virt-filesystems.pod:314
1309 #: ../cat/virt-filesystems.pod:316
1311 "If the object has a label (used for identifying and mounting filesystems) "
1312 "then this column contains the label."
1316 #: ../cat/virt-filesystems.pod:319
1321 #: ../cat/virt-filesystems.pod:321
1323 "The size of the object in bytes. If the I<--human> option is used then the "
1324 "size is displayed in a human-readable form."
1328 #: ../cat/virt-filesystems.pod:324
1333 #: ../cat/virt-filesystems.pod:326
1335 "The parent column records the parent relationship between objects. For "
1336 "example, if the object is a partition, then this column contains the name of "
1337 "the containing device. If the object is a logical volume, then this column "
1338 "is the name of the volume group."
1342 #: ../cat/virt-filesystems.pod:331
1347 #: ../cat/virt-filesystems.pod:333
1349 "If the object has a UUID (used for identifying and mounting filesystems and "
1350 "block devices) then this column contains the UUID as a string."
1354 #: ../cat/virt-filesystems.pod:337
1355 msgid "The UUID is only displayed if the I<--uuid> option is given."
1359 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459
1360 #: ../df/virt-df.pod:191
1361 msgid "NOTE ABOUT CSV FORMAT"
1365 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461
1366 #: ../df/virt-df.pod:193
1368 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1369 "should be easy to parse, but it is definitely not easy to parse."
1373 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464
1374 #: ../df/virt-df.pod:196
1376 "Myth: Just split fields at commas. Reality: This does I<not> work "
1377 "reliably. This example has two columns:"
1381 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467
1382 #: ../df/virt-df.pod:199
1385 " \"foo,bar\",baz\n"
1390 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469
1391 #: ../df/virt-df.pod:201
1393 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1394 "reliably. This example has one row:"
1398 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472
1399 #: ../df/virt-df.pod:204
1408 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475
1409 #: ../df/virt-df.pod:207
1411 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1412 "packaged in major Linux distributions)."
1416 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478
1417 #: ../df/virt-df.pod:210
1419 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1420 "or Python's built-in csv library)."
1424 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481
1425 #: ../df/virt-df.pod:213
1426 msgid "Most spreadsheets and databases can import CSV directly."
1430 #: ../cat/virt-filesystems.pod:374
1432 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-list-"
1433 "filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, L<http://"
1438 #: ../cat/virt-filesystems.pod:389 ../tools/virt-make-fs.pl:570
1439 #: ../tools/virt-win-reg.pl:778
1440 msgid "Copyright (C) 2010 Red Hat Inc."
1444 #: ../cat/virt-ls.pod:5
1445 msgid "virt-ls - List files in a virtual machine"
1449 #: ../cat/virt-ls.pod:9
1452 " virt-ls [--options] -d domname directory [directory ...]\n"
1457 #: ../cat/virt-ls.pod:11
1460 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory ...]\n"
1465 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1470 #: ../cat/virt-ls.pod:15
1473 " virt-ls [--options] domname directory\n"
1478 #: ../cat/virt-ls.pod:17
1481 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1486 #: ../cat/virt-ls.pod:21
1488 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1489 "more from a virtual machine or disk image."
1493 #: ../cat/virt-ls.pod:24
1495 "Multiple directory names can be given, in which case the output from each is "
1500 #: ../cat/virt-ls.pod:27
1502 "To list directories from a libvirt guest use the I<-d> option to specify the "
1503 "name of the guest. For a disk image, use the I<-a> option."
1507 #: ../cat/virt-ls.pod:31
1509 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1510 "may need to use L<guestfish(1)>, or write a program directly to the L<guestfs"
1515 #: ../cat/virt-ls.pod:37
1516 msgid "Get a list of all files and directories in a virtual machine:"
1520 #: ../cat/virt-ls.pod:39
1523 " virt-ls -R -d guest /\n"
1528 #: ../cat/virt-ls.pod:41
1529 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1533 #: ../cat/virt-ls.pod:43
1536 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1541 #: ../cat/virt-ls.pod:45
1542 msgid "List all public-writable directories in a Linux virtual machine:"
1546 #: ../cat/virt-ls.pod:47
1549 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1554 #: ../cat/virt-ls.pod:49
1555 msgid "List all Unix domain sockets in a Linux virtual machine:"
1559 #: ../cat/virt-ls.pod:51
1562 " virt-ls -lR -d guest / | grep '^s'\n"
1567 #: ../cat/virt-ls.pod:53
1568 msgid "List all regular files with filenames ending in '.png':"
1572 #: ../cat/virt-ls.pod:55
1575 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1580 #: ../cat/virt-ls.pod:57
1581 msgid "To display files larger than 10MB in home directories:"
1585 #: ../cat/virt-ls.pod:59
1588 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1593 #: ../cat/virt-ls.pod:61
1594 msgid "Find everything modified in the last 7 days:"
1598 #: ../cat/virt-ls.pod:63
1601 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1606 #: ../cat/virt-ls.pod:65
1607 msgid "Find regular files modified in the last 24 hours:"
1611 #: ../cat/virt-ls.pod:67
1614 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1619 #: ../cat/virt-ls.pod:69
1620 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1624 #: ../cat/virt-ls.pod:71
1626 "Find the differences between files in a guest and an earlier snapshot of the "
1631 #: ../cat/virt-ls.pod:74
1634 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1635 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1636 " diff -u old new | less\n"
1641 #: ../cat/virt-ls.pod:78
1643 "The commands above won't find files where the content has changed but the "
1644 "metadata (eg. file size and modification date) is the same. To do that, you "
1645 "need to add the I<--checksum> parameter to both C<virt-ls> commands. I<--"
1646 "checksum> can be quite slow since it has to read and compute a checksum of "
1647 "every regular file in the virtual machine."
1651 #: ../cat/virt-ls.pod:84
1652 msgid "OUTPUT MODES"
1656 #: ../cat/virt-ls.pod:86
1658 "C<virt-ls> has four output modes, controlled by different combinations of "
1659 "the I<-l> and I<-R> options."
1663 #: ../cat/virt-ls.pod:89
1664 msgid "SIMPLE LISTING"
1668 #: ../cat/virt-ls.pod:91
1669 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1673 #: ../cat/virt-ls.pod:93
1676 " $ virt-ls -d guest /\n"
1684 #: ../cat/virt-ls.pod:98
1685 msgid "LONG LISTING"
1689 #: ../cat/virt-ls.pod:100
1691 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1692 "(more specifically, like the C<guestfs_ll> function)."
1696 #: ../cat/virt-ls.pod:103
1699 " $ virt-ls -l -d guest /\n"
1701 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1702 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
1708 #: ../cat/virt-ls.pod:109
1710 "Note that while this is useful for displaying a directory, do not try "
1711 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
1716 #: ../cat/virt-ls.pod:113
1717 msgid "RECURSIVE LISTING"
1721 #: ../cat/virt-ls.pod:115
1723 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
1724 "and directories recursively:"
1728 #: ../cat/virt-ls.pod:118
1731 " $ virt-ls -R -d guest /tmp\n"
1739 #: ../cat/virt-ls.pod:123
1741 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
1742 "converts C<\\0> characters to C<\\n>."
1746 #: ../cat/virt-ls.pod:126
1747 msgid "RECURSIVE LONG LISTING"
1751 #: ../cat/virt-ls.pod:128
1753 "Using I<-lR> options together changes the output to display directories "
1754 "recursively, with file stats, and optionally other features such as "
1755 "checksums and extended attributes."
1759 #: ../cat/virt-ls.pod:132
1761 "Most of the interesting features of C<virt-ls> are only available when using "
1766 #: ../cat/virt-ls.pod:135
1768 "The fields are normally space-separated. Filenames are B<not> quoted, so "
1769 "you cannot use the output in another program (because filenames can contain "
1770 "spaces and other unsafe characters). If the guest was untrusted and someone "
1771 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
1772 "on you by creating filenames with embedded newline characters. To B<safely> "
1773 "parse the output in another program, use the I<--csv> (Comma-Separated "
1778 #: ../cat/virt-ls.pod:143
1780 "Note that this output format is completely unrelated to the C<ls -lR> "
1785 #: ../cat/virt-ls.pod:146
1788 " $ virt-ls -lR -d guest /bin\n"
1789 " d 0555 4096 /bin\n"
1790 " - 0755 123 /bin/alsaunmute\n"
1791 " - 0755 28328 /bin/arch\n"
1792 " l 0777 4 /bin/awk -> gawk\n"
1793 " - 0755 27216 /bin/basename\n"
1794 " - 0755 943360 /bin/bash\n"
1800 #: ../cat/virt-ls.pod:155
1801 msgid "These basic fields are always shown:"
1805 #: ../cat/virt-ls.pod:159
1810 #: ../cat/virt-ls.pod:161
1812 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
1813 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
1814 "link), C<s> (socket) or C<u> (unknown)."
1818 #: ../cat/virt-ls.pod:171
1823 #: ../cat/virt-ls.pod:173
1824 msgid "The Unix permissions, displayed as a 4 digit octal number."
1828 #: ../cat/virt-ls.pod:175
1833 #: ../cat/virt-ls.pod:177
1835 "The size of the file. This is shown in bytes unless I<-h> or I<--human-"
1836 "readable> option is given, in which case this is shown as a human-readable "
1841 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4183
1846 #: ../cat/virt-ls.pod:183
1847 msgid "The full path of the file or directory."
1851 #: ../cat/virt-ls.pod:185
1856 #: ../cat/virt-ls.pod:187
1857 msgid "For symbolic links only, the link target."
1861 #: ../cat/virt-ls.pod:191
1863 "In I<-lR> mode, additional command line options enable the display of more "
1868 #: ../cat/virt-ls.pod:194
1870 "With the I<--uids> flag, these additional fields are displayed before the "
1875 #: ../cat/virt-ls.pod:199
1880 #: ../cat/virt-ls.pod:201
1885 #: ../cat/virt-ls.pod:203
1887 "The UID and GID of the owner of the file (displayed numerically). Note "
1888 "these only make sense in the context of a Unix-like guest."
1892 #: ../cat/virt-ls.pod:208
1893 msgid "With the I<--times> flag, these additional fields are displayed:"
1897 #: ../cat/virt-ls.pod:212
1902 #: ../cat/virt-ls.pod:214
1903 msgid "The time of last access."
1907 #: ../cat/virt-ls.pod:216
1912 #: ../cat/virt-ls.pod:218
1913 msgid "The time of last modification."
1917 #: ../cat/virt-ls.pod:220
1922 #: ../cat/virt-ls.pod:222
1923 msgid "The time of last status change."
1927 #: ../cat/virt-ls.pod:226
1929 "The time fields are displayed as string dates and times, unless one of the "
1930 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
1934 #: ../cat/virt-ls.pod:229
1935 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
1939 #: ../cat/virt-ls.pod:233
1944 #: ../cat/virt-ls.pod:235
1946 "The device containing the file (displayed as major:minor). This may not "
1947 "match devices as known to the guest."
1951 #: ../cat/virt-ls.pod:238
1956 #: ../cat/virt-ls.pod:240
1957 msgid "The inode number."
1961 #: ../cat/virt-ls.pod:242
1966 #: ../cat/virt-ls.pod:244
1967 msgid "The number of hard links."
1971 #: ../cat/virt-ls.pod:246
1976 #: ../cat/virt-ls.pod:248
1978 "For block and char special files, the device (displayed as major:minor)."
1982 #: ../cat/virt-ls.pod:251
1987 #: ../cat/virt-ls.pod:253
1988 msgid "The number of 512 byte blocks allocated to the file."
1992 #: ../cat/virt-ls.pod:257
1994 "With the I<--checksum> flag, the checksum of the file contents is shown "
1995 "(only for regular files). Computing file checksums can take a considerable "
2000 #: ../cat/virt-ls.pod:280
2001 msgid "B<--checksum>"
2005 #: ../cat/virt-ls.pod:282
2006 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2010 #: ../cat/virt-ls.pod:284
2012 "Display checksum over file contents for regular files. With no argument, "
2013 "this defaults to using I<md5>. Using an argument, you can select the "
2014 "checksum type to use."
2018 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358
2019 #: ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408
2020 #: ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2022 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2027 #: ../cat/virt-ls.pod:316
2029 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2030 "so you cannot see what you are typing. If you are not worried about Tempest "
2031 "attacks and there is no one else in the room you can specify this flag to "
2032 "see what you are typing."
2036 #: ../cat/virt-ls.pod:321
2037 msgid "B<--extra-stats>"
2041 #: ../cat/virt-ls.pod:323
2042 msgid "Display extra stats."
2046 #: ../cat/virt-ls.pod:339
2049 " virt-ls --format=raw -a disk.img /dir\n"
2054 #: ../cat/virt-ls.pod:343
2057 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2062 #: ../cat/virt-ls.pod:356
2063 msgid "Display file sizes in human-readable format."
2067 #: ../cat/virt-ls.pod:370
2072 #: ../cat/virt-ls.pod:372
2073 msgid "B<--recursive>"
2077 #: ../cat/virt-ls.pod:374
2079 "Select the mode. With neither of these options, C<virt-ls> produces a "
2080 "simple, flat list of the files in the named directory. See L</SIMPLE "
2085 #: ../cat/virt-ls.pod:378
2087 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See L</"
2092 #: ../cat/virt-ls.pod:381
2094 "C<virt-ls -R> produces a recursive list of files starting at the named "
2095 "directory. See L</RECURSIVE LISTING>."
2099 #: ../cat/virt-ls.pod:384
2101 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2102 "parsed. See L</RECURSIVE LONG LISTING>."
2106 #: ../cat/virt-ls.pod:387
2111 #: ../cat/virt-ls.pod:389
2112 msgid "Display time fields."
2116 #: ../cat/virt-ls.pod:394
2117 msgid "B<--time-days>"
2121 #: ../cat/virt-ls.pod:396
2122 msgid "Display time fields as days before now (negative if in the future)."
2126 #: ../cat/virt-ls.pod:398
2128 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2129 "of the file is between 0 and 86399 seconds."
2133 #: ../cat/virt-ls.pod:404
2134 msgid "B<--time-relative>"
2138 #: ../cat/virt-ls.pod:406
2139 msgid "Display time fields as seconds before now (negative if in the future)."
2143 #: ../cat/virt-ls.pod:411
2148 #: ../cat/virt-ls.pod:413
2149 msgid "Display time fields as seconds since the Unix epoch."
2153 #: ../cat/virt-ls.pod:418
2158 #: ../cat/virt-ls.pod:420
2159 msgid "Display UID and GID fields."
2163 #: ../cat/virt-ls.pod:445
2164 msgid "Previous versions of virt-ls allowed you to write either:"
2168 #: ../cat/virt-ls.pod:447
2171 " virt-ls disk.img [disk.img ...] /dir\n"
2176 #: ../cat/virt-ls.pod:451
2179 " virt-ls guestname /dir\n"
2184 #: ../cat/virt-ls.pod:492
2186 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-"
2187 "tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
2188 "L<http://libguestfs.org/>."
2192 #: ../cat/virt-ls.pod:508 ../df/virt-df.pod:236 ../edit/virt-edit.pod:369
2193 #: ../rescue/virt-rescue.pod:298
2194 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2198 #: ../df/virt-df.pod:5
2199 msgid "virt-df - Display free space on virtual filesystems"
2203 #: ../df/virt-df.pod:9
2206 " virt-df [--options]\n"
2211 #: ../df/virt-df.pod:11
2214 " virt-df [--options] -d domname\n"
2219 #: ../df/virt-df.pod:13
2222 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
2227 #: ../df/virt-df.pod:17
2230 " virt-df [--options] domname\n"
2235 #: ../df/virt-df.pod:19
2238 " virt-df [--options] disk.img [disk.img ...]\n"
2243 #: ../df/virt-df.pod:23
2245 "C<virt-df> is a command line tool to display free space on virtual machine "
2246 "filesystems. Unlike other tools, it doesn't just display the size of disk "
2247 "allocated to a virtual machine, but can look inside disk images to see how "
2248 "much space is really being used."
2252 #: ../df/virt-df.pod:28
2254 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
2255 "to get a list of all active and inactive guests, and performs a C<df>-type "
2256 "operation on each one in turn, printing out the results."
2260 #: ../df/virt-df.pod:32
2262 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a C<df>-"
2263 "type operation on either the single named libvirt domain, or on the disk "
2264 "image(s) listed on the command line (which must all belong to a single VM). "
2265 "In this mode (with arguments), C<virt-df> will I<only work for a single "
2266 "guest>. If you want to run on multiple guests, then you have to invoke "
2267 "C<virt-df> multiple times."
2271 #: ../df/virt-df.pod:39
2273 "Use the I<--csv> option to get a format which can be easily parsed by other "
2274 "programs. Other options are similar to the standard L<df(1)> command."
2278 #: ../df/virt-df.pod:45
2280 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
2281 "output human-readable:"
2285 #: ../df/virt-df.pod:48
2288 " # virt-df -d F14x64 -h\n"
2289 " Filesystem Size Used Available Use%\n"
2290 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
2291 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
2296 #: ../df/virt-df.pod:53
2297 msgid "Show disk usage for a disk image file called C<test.img>:"
2301 #: ../df/virt-df.pod:55
2304 " $ virt-df -a test1.img\n"
2305 " Filesystem 1K-blocks Used Available Use%\n"
2306 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
2311 #: ../df/virt-df.pod:112
2314 " virt-df --format=raw -a disk.img\n"
2319 #: ../df/virt-df.pod:116
2322 " virt-df --format=raw -a disk.img --format -a another.img\n"
2327 #: ../df/virt-df.pod:129
2328 msgid "Print sizes in human-readable format."
2332 #: ../df/virt-df.pod:131
2333 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
2337 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
2342 #: ../df/virt-df.pod:135
2347 #: ../df/virt-df.pod:137
2348 msgid "Print inodes instead of blocks."
2352 #: ../df/virt-df.pod:139
2353 msgid "B<--one-per-guest>"
2357 #: ../df/virt-df.pod:141
2359 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
2360 "disks from several guests to a single libguestfs appliance."
2364 #: ../df/virt-df.pod:144
2365 msgid "You might use this option in the following circumstances:"
2369 #: ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266
2370 #: ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276
2371 #: ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291
2372 #: ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102
2373 #: ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132
2374 #: ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227
2375 #: ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235
2376 #: ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243
2377 #: ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20
2378 #: ../fish/guestfish-actions.pod:385 ../fish/guestfish-actions.pod:393
2379 #: ../fish/guestfish-actions.pod:400 ../fish/guestfish-actions.pod:407
2380 #: ../fish/guestfish-actions.pod:1099 ../fish/guestfish-actions.pod:1103
2381 #: ../fish/guestfish-actions.pod:1107 ../fish/guestfish-actions.pod:1111
2382 #: ../fish/guestfish-actions.pod:1119 ../fish/guestfish-actions.pod:1123
2383 #: ../fish/guestfish-actions.pod:1127 ../fish/guestfish-actions.pod:1137
2384 #: ../fish/guestfish-actions.pod:1141 ../fish/guestfish-actions.pod:1145
2385 #: ../fish/guestfish-actions.pod:1235 ../fish/guestfish-actions.pod:1239
2386 #: ../fish/guestfish-actions.pod:1244 ../fish/guestfish-actions.pod:1249
2387 #: ../fish/guestfish-actions.pod:1291 ../fish/guestfish-actions.pod:1295
2388 #: ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:1933
2389 #: ../fish/guestfish-actions.pod:1939 ../fish/guestfish-actions.pod:1947
2390 #: ../fish/guestfish-actions.pod:1954 ../fish/guestfish-actions.pod:1961
2391 #: ../fish/guestfish.pod:445 ../fish/guestfish.pod:449
2392 #: ../fish/guestfish.pod:453 ../fish/guestfish.pod:457
2393 #: ../inspector/virt-inspector.pod:384 ../inspector/virt-inspector.pod:388
2394 #: ../resize/virt-resize.pod:282 ../resize/virt-resize.pod:286
2395 #: ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301
2396 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29
2397 #: ../src/guestfs-actions.pod:583 ../src/guestfs-actions.pod:591
2398 #: ../src/guestfs-actions.pod:598 ../src/guestfs-actions.pod:605
2399 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1666
2400 #: ../src/guestfs-actions.pod:1670 ../src/guestfs-actions.pod:1674
2401 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1686
2402 #: ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:1700
2403 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1708
2404 #: ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850
2405 #: ../src/guestfs-actions.pod:1855 ../src/guestfs-actions.pod:1860
2406 #: ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1925
2407 #: ../src/guestfs-actions.pod:1930 ../src/guestfs-actions.pod:2859
2408 #: ../src/guestfs-actions.pod:2865 ../src/guestfs-actions.pod:2873
2409 #: ../src/guestfs-actions.pod:2880 ../src/guestfs-actions.pod:2887
2410 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
2411 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
2412 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1064
2413 #: ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077
2414 #: ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112
2415 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142
2416 #: ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154
2417 #: ../src/guestfs.pod:1644 ../src/guestfs.pod:1649 ../src/guestfs.pod:1653
2418 #: ../src/guestfs.pod:1755 ../src/guestfs.pod:1760 ../src/guestfs.pod:1764
2419 #: ../src/guestfs.pod:1774 ../src/guestfs.pod:2048 ../src/guestfs.pod:2053
2420 #: ../src/guestfs.pod:2059 ../src/guestfs.pod:2067 ../src/guestfs.pod:2421
2421 #: ../src/guestfs.pod:2427 ../src/guestfs.pod:2432 ../src/guestfs.pod:2438
2422 #: ../src/guestfs.pod:2819 ../src/guestfs.pod:2824 ../src/guestfs.pod:2828
2423 #: ../src/guestfs.pod:2832 ../src/guestfs.pod:2836 ../src/guestfs.pod:2850
2424 #: ../src/guestfs.pod:2855 ../src/guestfs.pod:3080 ../src/guestfs.pod:3084
2425 #: ../src/guestfs.pod:3088 ../src/guestfs.pod:3092
2426 #: ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202
2427 #: ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710
2428 #: ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
2433 #: ../df/virt-df.pod:150
2435 "If you think an untrusted guest might actively try to exploit the libguestfs "
2436 "appliance kernel, then this prevents one guest from interfering with the "
2437 "stats printed for another guest."
2441 #: ../df/virt-df.pod:156
2443 "If the kernel has a bug which stops it from accessing a filesystem in one "
2444 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
2445 "and report stats for further guests."
2449 #: ../df/virt-df.pod:165
2451 "Print UUIDs instead of names. This is useful for following a guest even "
2452 "when the guest is migrated or renamed, or when two guests happen to have the "
2457 #: ../df/virt-df.pod:169
2459 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
2460 "images, we still print the disk image name even when this option is "
2465 #: ../df/virt-df.pod:224
2467 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<http://"
2472 #: ../edit/virt-edit.pod:5
2473 msgid "virt-edit - Edit a file in a virtual machine"
2477 #: ../edit/virt-edit.pod:9
2480 " virt-edit [--options] -d domname file [file ...]\n"
2485 #: ../edit/virt-edit.pod:11
2488 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
2493 #: ../edit/virt-edit.pod:13
2496 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
2501 #: ../edit/virt-edit.pod:17
2504 " virt-edit domname file\n"
2509 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
2512 " virt-edit disk.img [disk.img ...] file\n"
2517 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23
2518 #: ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15
2519 #: ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19
2520 #: ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
2525 #: ../edit/virt-edit.pod:23
2527 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
2528 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
2529 "doing this, but doesn't catch all cases."
2533 #: ../edit/virt-edit.pod:29
2535 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
2536 "exists in the named virtual machine (or disk image)."
2540 #: ../edit/virt-edit.pod:32
2542 "Multiple filenames can be given, in which case they are each edited in "
2543 "turn. Each filename must be a full path, starting at the root directory "
2544 "(starting with '/')."
2548 #: ../edit/virt-edit.pod:36
2549 msgid "If you want to just view a file, use L<virt-cat(1)>."
2553 #: ../edit/virt-edit.pod:38
2555 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
2556 "USING GUESTFISH> below)."
2560 #: ../edit/virt-edit.pod:41
2562 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
2563 "that and much more."
2567 #: ../edit/virt-edit.pod:46
2568 msgid "Edit the named files interactively:"
2572 #: ../edit/virt-edit.pod:48
2575 " virt-edit -d mydomain /boot/grub/grub.conf\n"
2580 #: ../edit/virt-edit.pod:50
2583 " virt-edit -d mydomain /etc/passwd\n"
2588 #: ../edit/virt-edit.pod:52
2589 msgid "For Windows guests, some Windows paths are understood:"
2593 #: ../edit/virt-edit.pod:54
2596 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
2601 #: ../edit/virt-edit.pod:56
2603 "If Perl is installed, you can also edit files non-interactively (see L</NON-"
2604 "INTERACTIVE EDITING> below). To change the init default level to 5:"
2608 #: ../edit/virt-edit.pod:60
2611 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
2616 #: ../edit/virt-edit.pod:81
2617 msgid "B<-b> extension"
2621 #: ../edit/virt-edit.pod:83
2622 msgid "B<--backup> extension"
2626 #: ../edit/virt-edit.pod:85
2628 "Create a backup of the original file I<in the guest disk image>. The backup "
2629 "has the original filename with C<extension> added."
2633 #: ../edit/virt-edit.pod:88
2635 "Usually the first character of C<extension> would be a dot C<.> so you would "
2640 #: ../edit/virt-edit.pod:91
2643 " virt-edit -b .orig [etc]\n"
2648 #: ../edit/virt-edit.pod:93
2649 msgid "By default, no backup file is made."
2653 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181
2654 #: ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74
2655 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78
2656 #: ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
2661 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183
2662 #: ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76
2663 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80
2664 #: ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
2665 msgid "B<--connect URI>"
2669 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84
2670 #: ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134
2671 #: ../tools/virt-win-reg.pl:135
2673 "If you specify guest block devices directly, then libvirt is not used at all."
2677 #: ../edit/virt-edit.pod:114
2679 "When prompting for keys and passphrases, virt-edit normally turns echoing "
2680 "off so you cannot see what you are typing. If you are not worried about "
2681 "Tempest attacks and there is no one else in the room you can specify this "
2682 "flag to see what you are typing."
2686 #: ../edit/virt-edit.pod:119
2691 #: ../edit/virt-edit.pod:121
2692 msgid "B<--expr> EXPR"
2696 #: ../edit/virt-edit.pod:123
2698 "Instead of launching the external editor, non-interactively apply the Perl "
2699 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
2704 #: ../edit/virt-edit.pod:127
2706 "Be careful to properly quote the expression to prevent it from being altered "
2711 #: ../edit/virt-edit.pod:130
2712 msgid "Note that this option is only available when Perl 5 is installed."
2716 #: ../edit/virt-edit.pod:132
2717 msgid "B<--format> raw|qcow2|..."
2721 #: ../edit/virt-edit.pod:143
2724 " virt-edit --format=raw -a disk.img file\n"
2729 #: ../edit/virt-edit.pod:147
2732 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
2737 #: ../edit/virt-edit.pod:181
2738 msgid "Previous versions of virt-edit allowed you to write either:"
2742 #: ../edit/virt-edit.pod:187
2745 " virt-edit guestname file\n"
2750 #: ../edit/virt-edit.pod:195
2751 msgid "NON-INTERACTIVE EDITING"
2755 #: ../edit/virt-edit.pod:197
2757 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
2758 "administrator can interactively edit the file."
2762 #: ../edit/virt-edit.pod:200
2764 "There are two ways also to use C<virt-edit> from scripts in order to make "
2765 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
2766 "like this, it's less error-prone to write scripts directly using the "
2767 "libguestfs API and Augeas for configuration file editing.)"
2771 #: ../edit/virt-edit.pod:206
2773 "The first method is to temporarily set C<$EDITOR> to any script or program "
2774 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
2775 "update C<tmpfile> in place however it likes."
2779 #: ../edit/virt-edit.pod:210
2781 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
2782 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
2783 "instances of C<foo> with C<bar> in a file:"
2787 #: ../edit/virt-edit.pod:214
2790 " virt-edit -d domname filename -e 's/foo/bar/'\n"
2795 #: ../edit/virt-edit.pod:216
2797 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
2798 "For example to delete root's password you could do:"
2802 #: ../edit/virt-edit.pod:219
2805 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
2810 #: ../edit/virt-edit.pod:221
2812 "What really happens is that the snippet is evaluated as a Perl expression "
2813 "for each line of the file. The line, including the final C<\\n>, is passed "
2814 "in C<$_> and the expression should update C<$_> or leave it unchanged."
2818 #: ../edit/virt-edit.pod:226
2820 "To delete a line, set C<$_> to the empty string. For example, to delete the "
2821 "C<apache> user account from the password file you can do:"
2825 #: ../edit/virt-edit.pod:229
2828 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
2833 #: ../edit/virt-edit.pod:231
2835 "To insert a line, prepend or append it to C<$_>. However appending lines to "
2836 "the end of the file is rather difficult this way since there is no concept "
2837 "of \"last line of the file\" - your expression just doesn't get called "
2838 "again. You might want to use the first method (setting C<$EDITOR>) if you "
2843 #: ../edit/virt-edit.pod:237
2845 "The variable C<$lineno> contains the current line number. As is "
2846 "traditional, the first line in the file is number C<1>."
2850 #: ../edit/virt-edit.pod:240
2852 "The return value from the expression is ignored, but the expression may call "
2853 "C<die> in order to abort the whole program, leaving the original file "
2858 #: ../edit/virt-edit.pod:244
2860 "Remember when matching the end of a line that C<$_> may contain the final C<"
2861 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
2862 "newline then neither of these. Thus to match or substitute some text at the "
2863 "end of a line, use this regular expression:"
2867 #: ../edit/virt-edit.pod:249
2870 " /some text(\\r?\\n)?$/\n"
2875 #: ../edit/virt-edit.pod:251
2877 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
2878 "$_> itself (since that would remove all newlines from the file):"
2882 #: ../edit/virt-edit.pod:255
2885 " my $m = $_; chomp $m; $m =~ /some text$/\n"
2890 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
2891 msgid "WINDOWS PATHS"
2895 #: ../edit/virt-edit.pod:259
2897 "C<virt-edit> has a limited ability to understand Windows drive letters and "
2898 "paths (eg. C<E:\\foo\\bar.txt>)."
2902 #: ../edit/virt-edit.pod:262
2903 msgid "If and only if the guest is running Windows then:"
2907 #: ../edit/virt-edit.pod:268
2909 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
2910 "to the correct filesystem."
2914 #: ../edit/virt-edit.pod:273
2916 "Any backslash (C<\\>) characters in the path are replaced with forward "
2917 "slashes so that libguestfs can process it."
2921 #: ../edit/virt-edit.pod:278
2923 "The path is resolved case insensitively to locate the file that should be "
2928 #: ../edit/virt-edit.pod:283
2929 msgid "There are some known shortcomings:"
2933 #: ../edit/virt-edit.pod:289
2934 msgid "Some NTFS symbolic links may not be followed correctly."
2938 #: ../edit/virt-edit.pod:293
2939 msgid "NTFS junction points that cross filesystems are not followed."
2943 #: ../edit/virt-edit.pod:299
2945 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
2946 "C<virt-edit> doesn't work."
2950 #: ../edit/virt-edit.pod:302
2951 msgid "Using C<virt-edit> is approximately equivalent to doing:"
2955 #: ../edit/virt-edit.pod:304
2958 " guestfish --rw -i -d domname edit /file\n"
2963 #: ../edit/virt-edit.pod:306
2965 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
2970 #: ../edit/virt-edit.pod:309
2972 "The command above uses libguestfs's guest inspection feature and so does not "
2973 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
2974 "disk images that don't contain guests. To edit a file on a disk image "
2979 #: ../edit/virt-edit.pod:314
2982 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
2987 #: ../edit/virt-edit.pod:316
2989 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
2990 "the disk image to edit, and C</file> is the full path to the file."
2994 #: ../edit/virt-edit.pod:320
2996 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
2997 "C<write> or C<upload> instead:"
3001 #: ../edit/virt-edit.pod:323
3004 " guestfish --rw -i -d domname touch /newfile\n"
3009 #: ../edit/virt-edit.pod:325
3012 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3017 #: ../edit/virt-edit.pod:327
3020 " guestfish --rw -i -d domname upload localfile /newfile\n"
3025 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1075
3026 #: ../rescue/virt-rescue.pod:257 ../src/guestfs.pod:2966
3027 #: ../test-tool/libguestfs-test-tool.pod:82
3028 msgid "ENVIRONMENT VARIABLES"
3032 #: ../edit/virt-edit.pod:333
3037 #: ../edit/virt-edit.pod:335
3039 "If set, this string is used as the editor. It may contain arguments, eg. C<"
3044 #: ../edit/virt-edit.pod:338
3045 msgid "If not set, C<vi> is used."
3049 #: ../edit/virt-edit.pod:351
3051 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
3052 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
3053 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3057 #: ../examples/guestfs-examples.pod:5
3058 msgid "guestfs-examples - Examples of using libguestfs from C"
3062 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
3065 " #include <guestfs.h>\n"
3070 #: ../examples/guestfs-examples.pod:11
3073 " guestfs_h *g = guestfs_create ();\n"
3074 " guestfs_add_drive_ro (g, \"disk.img\");\n"
3075 " guestfs_launch (g);\n"
3080 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
3083 " cc prog.c -o prog -lguestfs\n"
3085 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
3090 #: ../examples/guestfs-examples.pod:21
3092 "This manual page contains examples of calling libguestfs from the C "
3093 "programming language. If you are not familiar with using libguestfs, you "
3094 "also need to read L<guestfs(3)>."
3098 #: ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37
3099 #: ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31
3100 #: ../python/examples/guestfs-python.pod:34
3101 #: ../ruby/examples/guestfs-ruby.pod:28
3102 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
3106 #: ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39
3107 #: ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33
3108 #: ../python/examples/guestfs-python.pod:36
3109 #: ../ruby/examples/guestfs-ruby.pod:30
3114 #: ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41
3115 #: ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35
3116 #: ../python/examples/guestfs-python.pod:38
3117 #: ../ruby/examples/guestfs-ruby.pod:32
3118 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
3122 #: ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43
3123 #: ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37
3124 #: ../python/examples/guestfs-python.pod:40
3125 #: ../ruby/examples/guestfs-ruby.pod:34
3130 #: ../examples/guestfs-examples.pod:35
3132 "L<guestfs(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
3133 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
3138 #: ../examples/guestfs-examples.pod:44 ../examples/guestfs-recipes.pod:396
3139 #: ../fish/guestfish.pod:1249 ../fish/virt-copy-in.pod:60
3140 #: ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58
3141 #: ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:314
3142 #: ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:57
3143 #: ../ocaml/examples/guestfs-ocaml.pod:90 ../perl/examples/guestfs-perl.pod:51
3144 #: ../python/examples/guestfs-python.pod:53
3145 #: ../ruby/examples/guestfs-ruby.pod:47 ../src/guestfs.pod:3099
3146 #: ../test-tool/libguestfs-test-tool.pod:93
3151 #: ../examples/guestfs-examples.pod:46 ../examples/guestfs-recipes.pod:398
3152 #: ../fish/guestfish.pod:1251 ../fish/virt-copy-in.pod:62
3153 #: ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60
3154 #: ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:316
3155 #: ../java/examples/guestfs-java.pod:59 ../ocaml/examples/guestfs-ocaml.pod:92
3156 #: ../perl/examples/guestfs-perl.pod:53
3157 #: ../python/examples/guestfs-python.pod:55
3158 #: ../ruby/examples/guestfs-ruby.pod:49 ../src/guestfs.pod:3101
3159 #: ../test-tool/libguestfs-test-tool.pod:95
3160 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3164 #: ../examples/guestfs-examples.pod:50 ../ocaml/examples/guestfs-ocaml.pod:96
3165 #: ../python/examples/guestfs-python.pod:59
3166 #: ../ruby/examples/guestfs-ruby.pod:53
3167 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
3171 #: ../examples/guestfs-examples.pod:52 ../examples/guestfs-recipes.pod:404
3172 #: ../java/examples/guestfs-java.pod:65 ../ocaml/examples/guestfs-ocaml.pod:98
3173 #: ../perl/examples/guestfs-perl.pod:59
3174 #: ../python/examples/guestfs-python.pod:61
3175 #: ../ruby/examples/guestfs-ruby.pod:55
3177 "The examples in this manual page may be freely copied, modified and "
3178 "distributed without any restrictions."
3182 #: ../examples/guestfs-examples.pod:55 ../examples/guestfs-recipes.pod:407
3183 #: ../java/examples/guestfs-java.pod:68
3184 #: ../ocaml/examples/guestfs-ocaml.pod:101
3185 #: ../perl/examples/guestfs-perl.pod:62
3186 #: ../python/examples/guestfs-python.pod:64
3187 #: ../ruby/examples/guestfs-ruby.pod:58 ../src/guestfs.pod:3108
3189 "This library is free software; you can redistribute it and/or modify it "
3190 "under the terms of the GNU Lesser General Public License as published by the "
3191 "Free Software Foundation; either version 2 of the License, or (at your "
3192 "option) any later version."
3196 #: ../examples/guestfs-examples.pod:60 ../examples/guestfs-recipes.pod:412
3197 #: ../java/examples/guestfs-java.pod:73
3198 #: ../ocaml/examples/guestfs-ocaml.pod:106
3199 #: ../perl/examples/guestfs-perl.pod:67
3200 #: ../python/examples/guestfs-python.pod:69
3201 #: ../ruby/examples/guestfs-ruby.pod:63 ../src/guestfs.pod:3113
3203 "This library is distributed in the hope that it will be useful, but WITHOUT "
3204 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3205 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3210 #: ../examples/guestfs-examples.pod:65 ../examples/guestfs-recipes.pod:417
3211 #: ../java/examples/guestfs-java.pod:78
3212 #: ../ocaml/examples/guestfs-ocaml.pod:111
3213 #: ../perl/examples/guestfs-perl.pod:72
3214 #: ../python/examples/guestfs-python.pod:74
3215 #: ../ruby/examples/guestfs-ruby.pod:68 ../src/guestfs.pod:3118
3217 "You should have received a copy of the GNU Lesser General Public License "
3218 "along with this library; if not, write to the Free Software Foundation, "
3219 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3223 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
3228 #: ../examples/guestfs-recipes.pod:5
3230 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
3231 "here. The only way which works for both sorts of output is to just write "
3232 "the URL directly. Do NOT use L<...> for URLs."
3236 #: ../examples/guestfs-recipes.pod:9
3238 "We break with tradition here and don't use ALL CAPS for the section "
3239 "headings, as this makes them much easier to read."
3243 #: ../examples/guestfs-recipes.pod:16
3244 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
3248 #: ../examples/guestfs-recipes.pod:20
3250 "This page contains recipes for and links to things you can do using "
3251 "libguestfs, L<guestfish(1)> and the virt tools."
3255 #: ../examples/guestfs-recipes.pod:23
3256 msgid "Audit a virtual machine for setuid files"
3260 #: ../examples/guestfs-recipes.pod:25
3262 "The link below contains a small program which can be used to audit a Linux "
3263 "virtual machine to see what setuid and setgid files it contains."
3267 #: ../examples/guestfs-recipes.pod:28
3269 "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-"
3274 #: ../examples/guestfs-recipes.pod:30
3275 msgid "Change the background image in a Windows XP VM"
3279 #: ../examples/guestfs-recipes.pod:32
3281 "The links below explain how to use L<guestfish(1)> to change the background "
3282 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
3283 "be substantially different for each version of Windows."
3287 #: ../examples/guestfs-recipes.pod:37
3289 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html https://"
3290 "lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
3294 #: ../examples/guestfs-recipes.pod:40
3295 msgid "Cloning a virtual machine (Linux)"
3299 #: ../examples/guestfs-recipes.pod:42
3301 "The guestfish technique described in the link below works well for most "
3302 "Linux VMs. Depending on the Linux distro you may need to change the paths "
3307 #: ../examples/guestfs-recipes.pod:46
3309 "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-"
3314 #: ../examples/guestfs-recipes.pod:48
3316 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
3321 #: ../examples/guestfs-recipes.pod:51
3322 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
3326 #: ../examples/guestfs-recipes.pod:53
3327 msgid "Cloning a virtual machine (Windows)"
3331 #: ../examples/guestfs-recipes.pod:55
3333 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
3334 "straightforward. Currently there is code in the Aeolus Oz project which "
3335 "does this (using libguestfs). As part of our review of the virt-clone tool, "
3336 "we may add sysprepping ability."
3340 #: ../examples/guestfs-recipes.pod:60
3342 "https://github.com/clalancette/oz https://www.redhat.com/archives/virt-tools-"
3343 "list/2011-May/msg00019.html"
3347 #: ../examples/guestfs-recipes.pod:63
3348 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
3352 #: ../examples/guestfs-recipes.pod:65
3353 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
3357 #: ../examples/guestfs-recipes.pod:67
3360 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
3365 #: ../examples/guestfs-recipes.pod:69
3366 msgid "To export just a subdirectory, eg. C</files>, do:"
3370 #: ../examples/guestfs-recipes.pod:71
3373 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
3378 #: ../examples/guestfs-recipes.pod:73
3379 msgid "Create empty disk images"
3383 #: ../examples/guestfs-recipes.pod:75
3385 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
3386 "The useful guide below explains the options available."
3390 #: ../examples/guestfs-recipes.pod:78
3392 "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/"
3397 #: ../examples/guestfs-recipes.pod:80
3398 msgid "Dump raw filesystem content from inside a disk image or VM"
3402 #: ../examples/guestfs-recipes.pod:82
3404 "You can use the L<guestfish(1)> C<download> command to extract the raw "
3405 "filesystem content from any filesystem in a disk image or a VM (even one "
3406 "which is encrypted or buried inside an LV):"
3410 #: ../examples/guestfs-recipes.pod:86
3413 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
3418 #: ../examples/guestfs-recipes.pod:88
3421 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
3426 #: ../examples/guestfs-recipes.pod:90
3427 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
3431 #: ../examples/guestfs-recipes.pod:92
3432 msgid "Edit grub configuration in a VM"
3436 #: ../examples/guestfs-recipes.pod:94
3437 msgid "You can use this to:"
3441 #: ../examples/guestfs-recipes.pod:100
3442 msgid "Fix a virtual machine that does not boot."
3446 #: ../examples/guestfs-recipes.pod:104
3447 msgid "Change which kernel is used to boot the VM."
3451 #: ../examples/guestfs-recipes.pod:108
3452 msgid "Change kernel command line options."
3456 #: ../examples/guestfs-recipes.pod:112
3457 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
3461 #: ../examples/guestfs-recipes.pod:114
3464 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
3469 #: ../examples/guestfs-recipes.pod:116
3471 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
3476 #: ../examples/guestfs-recipes.pod:119
3479 " virt-rescue -d BrokenGuest\n"
3484 #: ../examples/guestfs-recipes.pod:121
3485 msgid "Export any directory from a VM"
3489 #: ../examples/guestfs-recipes.pod:123
3491 "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
3495 #: ../examples/guestfs-recipes.pod:126
3498 " virt-copy-out -d Guest /home .\n"
3503 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9
3504 #: ../fish/guestfish-actions.pod:1287 ../fish/guestfish-actions.pod:1929
3505 #: ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:1917
3506 #: ../src/guestfs-actions.pod:2855 ../src/guestfs.pod:1640
3507 #: ../tools/virt-win-reg.pl:706
3512 #: ../examples/guestfs-recipes.pod:134
3514 "The final dot of the command is not a printing error. It means we want to "
3515 "copy out to the current directory."
3519 #: ../examples/guestfs-recipes.pod:139
3520 msgid "This creates a directory called C<home> under the current directory."
3524 #: ../examples/guestfs-recipes.pod:143
3526 "If the guest is a Windows guest then you can use drive letters and "
3527 "backslashes, but you must prefix the path with C<win:> and quote it to "
3528 "protect it from the shell, like this:"
3532 #: ../examples/guestfs-recipes.pod:147
3535 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
3540 #: ../examples/guestfs-recipes.pod:149
3541 msgid "To get the output as a compressed tarball, do:"
3545 #: ../examples/guestfs-recipes.pod:151
3548 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
3553 #: ../examples/guestfs-recipes.pod:153
3555 "Although it sounds tempting, this is usually not a reliable way to get a "
3556 "backup from a running guest. See the entry in the FAQ: http://libguestfs."
3557 "org/FAQ.html#backup"
3561 #: ../examples/guestfs-recipes.pod:157
3562 msgid "Find out which user is using the most space"
3566 #: ../examples/guestfs-recipes.pod:159
3568 "This simple script examines a Linux guest to find out which user is using "
3569 "the most space in their home directory:"
3573 #: ../examples/guestfs-recipes.pod:162
3581 #: ../examples/guestfs-recipes.pod:164
3589 #: ../examples/guestfs-recipes.pod:166
3598 #: ../examples/guestfs-recipes.pod:169
3601 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
3606 #: ../examples/guestfs-recipes.pod:171
3609 " for d in $(guestfish --remote ls \"$dir\"); do\n"
3610 " echo -n \"$dir/$d\"\n"
3612 " guestfish --remote du \"$dir/$d\";\n"
3613 " done | sort -nr -k 2\n"
3618 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
3621 " guestfish --remote exit\n"
3626 #: ../examples/guestfs-recipes.pod:179
3627 msgid "Get DHCP address from a VM"
3631 #: ../examples/guestfs-recipes.pod:181
3633 "The link below explains the many different possible techniques for getting "
3634 "the last assigned DHCP address of a virtual machine."
3638 #: ../examples/guestfs-recipes.pod:184
3640 "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-"
3641 "a-virtual-machine-disk-image/#content"
3645 #: ../examples/guestfs-recipes.pod:186
3647 "In the libguestfs source examples directory you will find the latest version "
3648 "of the C<virt-dhcp-address.c> program."
3652 #: ../examples/guestfs-recipes.pod:189
3653 msgid "Get the operating system product name string"
3657 #: ../examples/guestfs-recipes.pod:191
3658 msgid "Save the following script into a file called C<product-name.sh>:"
3662 #: ../examples/guestfs-recipes.pod:193
3667 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3668 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3669 " guestfish --remote inspect-get-product-name \"$root\"\n"
3670 " guestfish --remote exit\n"
3675 #: ../examples/guestfs-recipes.pod:200
3676 msgid "Make the script executable and run it on a named guest:"
3680 #: ../examples/guestfs-recipes.pod:202
3683 " # product-name.sh RHEL60x64\n"
3684 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
3689 #: ../examples/guestfs-recipes.pod:205
3691 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
3692 "C<xpath> command line tool or from your favourite programming language:"
3696 #: ../examples/guestfs-recipes.pod:209
3699 " # virt-inspector RHEL60x64 > xml\n"
3700 " # xpath '//product_name' < xml\n"
3703 " <product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>\n"
3708 #: ../examples/guestfs-recipes.pod:215
3709 msgid "Get the default boot kernel for a Linux VM"
3713 #: ../examples/guestfs-recipes.pod:217
3715 "The link below contains a program to print the default boot kernel for a "
3720 #: ../examples/guestfs-recipes.pod:220
3722 "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-"
3723 "kernel-for-a-vm/#content"
3727 #: ../examples/guestfs-recipes.pod:222
3729 "It uses Augeas, and the technique is generally applicable for many different "
3734 #: ../examples/guestfs-recipes.pod:229
3735 msgid "listing the user accounts in the guest"
3739 #: ../examples/guestfs-recipes.pod:233
3740 msgid "what repositories is it configured to use"
3744 #: ../examples/guestfs-recipes.pod:237
3745 msgid "what NTP servers does it connect to"
3749 #: ../examples/guestfs-recipes.pod:241
3750 msgid "what were the boot messages last time it booted"
3754 #: ../examples/guestfs-recipes.pod:245
3755 msgid "listing who was logged in recently"
3759 #: ../examples/guestfs-recipes.pod:249
3760 msgid "http://augeas.net/"
3764 #: ../examples/guestfs-recipes.pod:251
3765 msgid "Install RPMs in a guest"
3769 #: ../examples/guestfs-recipes.pod:253
3771 "The link below contains a method to install RPMs in a guest. In fact the "
3772 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
3773 "installs them next time the guest is booted. You could use this technique "
3774 "to install vital security updates in an offline guest."
3778 #: ../examples/guestfs-recipes.pod:259
3780 "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
3784 #: ../examples/guestfs-recipes.pod:261
3785 msgid "List applications installed in a VM"
3789 #: ../examples/guestfs-recipes.pod:263
3790 msgid "Save the following to a file C<list-apps.sh>:"
3794 #: ../examples/guestfs-recipes.pod:265
3799 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
3800 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
3801 " guestfish --remote inspect-list-applications \"$root\"\n"
3802 " guestfish --remote exit\n"
3807 #: ../examples/guestfs-recipes.pod:272
3809 "Make the file executable and then you can run it on any named virtual "
3814 #: ../examples/guestfs-recipes.pod:275
3817 " # list-apps.sh WinGuest\n"
3819 " app_name: Mozilla Firefox (3.6.12)\n"
3820 " app_display_name: Mozilla Firefox (3.6.12)\n"
3822 " app_version: 3.6.12 (en-GB)\n"
3824 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
3825 " app_trans_path:\n"
3826 " app_publisher: Mozilla\n"
3827 " app_url: http://www.mozilla.com/en-GB/\n"
3828 " app_source_package:\n"
3830 " app_description: Mozilla Firefox\n"
3833 " app_name: VLC media player\n"
3834 " app_display_name: VLC media player 1.1.5\n"
3836 " app_version: 1.1.5\n"
3838 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
3839 " app_trans_path:\n"
3840 " app_publisher: VideoLAN\n"
3841 " app_url: http://www.videolan.org/\n"
3842 " app_source_package:\n"
3844 " app_description:\n"
3850 #: ../examples/guestfs-recipes.pod:305
3852 "If you want to run the script on disk images (instead of libvirt virtual "
3853 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also L<virt-inspector(1)"
3858 #: ../examples/guestfs-recipes.pod:309
3859 msgid "List files and directories in a VM"
3863 #: ../examples/guestfs-recipes.pod:311
3864 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
3868 #: ../examples/guestfs-recipes.pod:313
3871 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
3876 #: ../examples/guestfs-recipes.pod:315
3877 msgid "List services in a Windows VM"
3881 #: ../examples/guestfs-recipes.pod:317
3883 "The link below contains a script that can be used to list out the services "
3884 "from a Windows VM, and whether those services run at boot time or are loaded "
3889 #: ../examples/guestfs-recipes.pod:321
3891 "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/"
3896 #: ../examples/guestfs-recipes.pod:323
3897 msgid "Make a disk image sparse"
3901 #: ../examples/guestfs-recipes.pod:325
3903 "The link below contains some guides for making a disk image sparse (or "
3904 "reintroducing sparseness)."
3908 #: ../examples/guestfs-recipes.pod:328
3910 "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
3914 #: ../examples/guestfs-recipes.pod:330
3915 msgid "Monitor disk usage over time"
3919 #: ../examples/guestfs-recipes.pod:332
3921 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
3922 "The link below contains a guide."
3926 #: ../examples/guestfs-recipes.pod:335
3927 msgid "http://virt-tools.org/learning/advanced-virt-df/"
3931 #: ../examples/guestfs-recipes.pod:337
3932 msgid "Reading the Windows Event Log from Windows Vista (or later)"
3936 #: ../examples/guestfs-recipes.pod:339
3938 "L<guestfish(1)> plus the tools described in the link below can be used to "
3939 "read out the Windows Event Log from any virtual machine running Windows "
3940 "Vista or a later version."
3944 #: ../examples/guestfs-recipes.pod:343
3946 "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-"
3947 "guestfish/#content"
3951 #: ../examples/guestfs-recipes.pod:345
3952 msgid "Remove root password (Linux)"
3956 #: ../examples/guestfs-recipes.pod:347
3958 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
3959 "files. One use is to remove the root password from a Linux guest:"
3963 #: ../examples/guestfs-recipes.pod:350
3966 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3971 #: ../examples/guestfs-recipes.pod:352
3972 msgid "Remove Administrator password (Windows)"
3976 #: ../examples/guestfs-recipes.pod:354
3978 "The link below contains one technique for removing the Administrator "
3979 "password from a Windows VM, or to be more precise, it gives you a command "
3980 "prompt the next time you log in which you can use to bypass any security:"
3984 #: ../examples/guestfs-recipes.pod:359
3986 "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-"
3987 "administrator-password-with-guestfish/"
3991 #: ../examples/guestfs-recipes.pod:361
3992 msgid "Unpack a live CD"
3996 #: ../examples/guestfs-recipes.pod:363
3998 "Linux live CDs often contain multiple layers of disk images wrapped like a "
3999 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4000 "layers, as outlined in the guide below."
4004 #: ../examples/guestfs-recipes.pod:367
4006 "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-"
4011 #: ../examples/guestfs-recipes.pod:369
4012 msgid "Uploading and downloading files"
4016 #: ../examples/guestfs-recipes.pod:371
4018 "The link below contains general tips on uploading (copying in) and "
4019 "downloading (copying out) files from VMs."
4023 #: ../examples/guestfs-recipes.pod:374
4025 "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4029 #: ../examples/guestfs-recipes.pod:376
4030 msgid "Use libguestfs tools on VMware ESX guests"
4034 #: ../examples/guestfs-recipes.pod:378
4036 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4037 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4041 #: ../examples/guestfs-recipes.pod:382
4043 "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-"
4048 #: ../examples/guestfs-recipes.pod:386
4050 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4051 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby"
4052 "(3)>, L<http://libguestfs.org/>."
4056 #: ../examples/guestfs-recipes.pod:402
4057 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4061 #: ../fish/guestfish-actions.pod:1
4066 #: ../fish/guestfish-actions.pod:3
4069 " add-cdrom filename\n"
4074 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
4075 msgid "This function adds a virtual CD-ROM disk image to the guest."
4079 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
4080 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4084 #: ../fish/guestfish-actions.pod:15
4086 "This call checks for the existence of C<filename>. This stops you from "
4087 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4088 "and C<http:> URLs. To specify those, use the general L</config> call "
4093 #: ../fish/guestfish-actions.pod:22
4095 "If you just want to add an ISO file (often you use this as an efficient way "
4096 "to transfer large files into the guest), then you should probably use L</add-"
4097 "drive-ro> instead."
4101 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163
4102 #: ../fish/guestfish-actions.pod:177
4104 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
4109 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166
4110 #: ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:986
4111 #: ../fish/guestfish-actions.pod:1346 ../fish/guestfish-actions.pod:1360
4112 #: ../fish/guestfish-actions.pod:3085 ../fish/guestfish-actions.pod:3292
4113 #: ../fish/guestfish-actions.pod:3406 ../fish/guestfish-actions.pod:3454
4114 #: ../fish/guestfish-actions.pod:4355 ../fish/guestfish-actions.pod:4378
4115 #: ../fish/guestfish-actions.pod:4400 ../fish/guestfish-actions.pod:4438
4116 #: ../fish/guestfish-actions.pod:5087 ../fish/guestfish-actions.pod:5185
4117 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:252
4118 #: ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:1503
4119 #: ../src/guestfs-actions.pod:2002 ../src/guestfs-actions.pod:2023
4120 #: ../src/guestfs-actions.pod:4618 ../src/guestfs-actions.pod:4921
4121 #: ../src/guestfs-actions.pod:5150 ../src/guestfs-actions.pod:5250
4122 #: ../src/guestfs-actions.pod:6516 ../src/guestfs-actions.pod:6560
4123 #: ../src/guestfs-actions.pod:6594 ../src/guestfs-actions.pod:6657
4124 #: ../src/guestfs-actions.pod:7589 ../src/guestfs-actions.pod:7698
4125 #: ../src/guestfs-actions.pod:7873
4127 "Deprecated functions will not be removed from the API, but the fact that "
4128 "they are deprecated indicates that there are problems with correct use of "
4133 #: ../fish/guestfish-actions.pod:35
4138 #: ../fish/guestfish-actions.pod:37
4143 #: ../fish/guestfish-actions.pod:39
4146 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] [allowuuid:..]\n"
4151 #: ../fish/guestfish-actions.pod:41
4153 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4154 "It works by connecting to libvirt, requesting the domain and domain XML from "
4155 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
4159 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
4161 "The number of disks added is returned. This operation is atomic: if an "
4162 "error is returned, then no disks are added."
4166 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
4168 "This function does some minimal checks to make sure the libvirt domain is "
4169 "not running (unless C<readonly> is true). In a future version we will try "
4170 "to acquire the libvirt lock on each disk."
4174 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
4176 "Disks must be accessible locally. This often means that adding disks from a "
4177 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4178 "unless those disks are accessible via the same device path locally too."
4182 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
4184 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4185 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4186 "libvirt URI (or one set through an environment variable, see the libvirt "
4187 "documentation for full details)."
4191 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
4193 "The optional C<live> flag controls whether this call will try to connect to "
4194 "a running virtual machine C<guestfsd> process if it sees a suitable "
4195 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
4196 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
4197 "DAEMONS> for more information."
4201 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
4203 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
4204 "passed instead of the domain name. The C<dom> string is treated as a UUID "
4205 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
4210 #: ../fish/guestfish-actions.pod:76
4212 "The other optional parameters are passed directly through to L</add-drive-"
4217 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143
4218 #: ../fish/guestfish-actions.pod:568 ../fish/guestfish-actions.pod:1968
4219 #: ../fish/guestfish-actions.pod:3134 ../fish/guestfish-actions.pod:3307
4220 #: ../fish/guestfish-actions.pod:3442
4222 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
4226 #: ../fish/guestfish-actions.pod:81
4231 #: ../fish/guestfish-actions.pod:83
4234 " add-drive filename\n"
4239 #: ../fish/guestfish-actions.pod:85
4241 "This function is the equivalent of calling L</add-drive-opts> with no "
4242 "optional parameters, so the disk is added writable, with the format being "
4243 "detected automatically."
4247 #: ../fish/guestfish-actions.pod:89
4249 "Automatic detection of the format opens you up to a potential security hole "
4250 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4251 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4252 "you should think about replacing calls to this function with calls to L</add-"
4253 "drive-opts>, and specifying the format."
4257 #: ../fish/guestfish-actions.pod:96
4258 msgid "add-drive-opts"
4262 #: ../fish/guestfish-actions.pod:98
4267 #: ../fish/guestfish-actions.pod:100
4270 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
4275 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
4277 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4278 "The first time you call this function, the disk appears as C</dev/sda>, the "
4279 "second time as C</dev/sdb>, and so on."
4283 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
4285 "You don't necessarily need to be root when using libguestfs. However you "
4286 "obviously do need sufficient permissions to access the filename for whatever "
4287 "operations you want to perform (ie. read access if you just want to read the "
4288 "image or write access if you want to modify the image)."
4292 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
4293 msgid "This call checks that C<filename> exists."
4297 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3096
4298 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4655
4299 msgid "The optional arguments are:"
4303 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
4308 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
4310 "If true then the image is treated as read-only. Writes are still allowed, "
4311 "but they are stored in a temporary snapshot overlay which is discarded at "
4312 "the end. The disk that you add is not modified."
4316 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
4321 #: ../fish/guestfish-actions.pod:127
4323 "This forces the image format. If you omit this (or use L</add-drive> or L</"
4324 "add-drive-ro>) then the format is automatically detected. Possible formats "
4325 "include C<raw> and C<qcow2>."
4329 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
4331 "Automatic detection of the format opens you up to a potential security hole "
4332 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4333 "RHBZ#642934. Specifying the format closes this security hole."
4337 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
4342 #: ../fish/guestfish-actions.pod:138
4344 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
4345 "add-drive-with-if> call (q.v.)"
4349 #: ../fish/guestfish-actions.pod:145
4350 msgid "add-drive-ro"
4354 #: ../fish/guestfish-actions.pod:147
4359 #: ../fish/guestfish-actions.pod:149
4362 " add-drive-ro filename\n"
4367 #: ../fish/guestfish-actions.pod:151
4369 "This function is the equivalent of calling L</add-drive-opts> with the "
4370 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
4371 "is added read-only, with the format being detected automatically."
4375 #: ../fish/guestfish-actions.pod:156
4376 msgid "add-drive-ro-with-if"
4380 #: ../fish/guestfish-actions.pod:158
4383 " add-drive-ro-with-if filename iface\n"
4388 #: ../fish/guestfish-actions.pod:160
4390 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
4391 "interface emulation to use at run time."
4395 #: ../fish/guestfish-actions.pod:170
4396 msgid "add-drive-with-if"
4400 #: ../fish/guestfish-actions.pod:172
4403 " add-drive-with-if filename iface\n"
4408 #: ../fish/guestfish-actions.pod:174
4410 "This is the same as L</add-drive> but it allows you to specify the QEMU "
4411 "interface emulation to use at run time."
4415 #: ../fish/guestfish-actions.pod:184
4420 #: ../fish/guestfish-actions.pod:186
4423 " aug-clear augpath\n"
4428 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
4430 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4431 "L<augtool(1)> C<clear> command."
4435 #: ../fish/guestfish-actions.pod:191
4440 #: ../fish/guestfish-actions.pod:193
4448 #: ../fish/guestfish-actions.pod:195
4450 "Close the current Augeas handle and free up any resources used by it. After "
4451 "calling this, you have to call L</aug-init> again before you can use any "
4452 "other Augeas functions."
4456 #: ../fish/guestfish-actions.pod:200
4461 #: ../fish/guestfish-actions.pod:202
4464 " aug-defnode name expr val\n"
4469 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
4471 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4475 #: ../fish/guestfish-actions.pod:207
4477 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4478 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
4479 "containing that single node."
4483 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
4485 "On success this returns a pair containing the number of nodes in the "
4486 "nodeset, and a boolean flag if a node was created."
4490 #: ../fish/guestfish-actions.pod:215
4495 #: ../fish/guestfish-actions.pod:217
4498 " aug-defvar name expr\n"
4503 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
4505 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4506 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4510 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
4512 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4513 "evaluates to something which is not a nodeset."
4517 #: ../fish/guestfish-actions.pod:226
4522 #: ../fish/guestfish-actions.pod:228
4525 " aug-get augpath\n"
4530 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
4532 "Look up the value associated with C<path>. If C<path> matches exactly one "
4533 "node, the C<value> is returned."
4537 #: ../fish/guestfish-actions.pod:233
4542 #: ../fish/guestfish-actions.pod:235
4545 " aug-init root flags\n"
4550 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
4552 "Create a new Augeas handle for editing configuration files. If there was "
4553 "any previous Augeas handle associated with this guestfs session, then it is "
4558 #: ../fish/guestfish-actions.pod:241
4559 msgid "You must call this before using any other L</aug-*> commands."
4563 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
4565 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
4569 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
4571 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
4572 "logical I<or> of the following integers:"
4576 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
4577 msgid "C<AUG_SAVE_BACKUP> = 1"
4581 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
4582 msgid "Keep the original file with a C<.augsave> extension."
4586 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
4587 msgid "C<AUG_SAVE_NEWFILE> = 2"
4591 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
4593 "Save changes into a file with extension C<.augnew>, and do not overwrite "
4594 "original. Overrides C<AUG_SAVE_BACKUP>."
4598 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
4599 msgid "C<AUG_TYPE_CHECK> = 4"
4603 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
4604 msgid "Typecheck lenses (can be expensive)."
4608 #: ../fish/guestfish-actions.pod:266 ../src/guestfs-actions.pod:404
4609 msgid "C<AUG_NO_STDINC> = 8"
4613 #: ../fish/guestfish-actions.pod:268 ../src/guestfs-actions.pod:406
4614 msgid "Do not use standard load path for modules."
4618 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:408
4619 msgid "C<AUG_SAVE_NOOP> = 16"
4623 #: ../fish/guestfish-actions.pod:272 ../src/guestfs-actions.pod:410
4624 msgid "Make save a no-op, just record what would have been changed."
4628 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:412
4629 msgid "C<AUG_NO_LOAD> = 32"
4633 #: ../fish/guestfish-actions.pod:276
4634 msgid "Do not load the tree in L</aug-init>."
4638 #: ../fish/guestfish-actions.pod:280
4639 msgid "To close the handle, you can call L</aug-close>."
4643 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:420
4644 msgid "To find out more about Augeas, see L<http://augeas.net/>."
4648 #: ../fish/guestfish-actions.pod:284
4653 #: ../fish/guestfish-actions.pod:286
4656 " aug-insert augpath label true|false\n"
4661 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:434
4663 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
4664 "or after C<path> (depending on the boolean flag C<before>)."
4668 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:438
4670 "C<path> must match exactly one existing node in the tree, and C<label> must "
4671 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
4675 #: ../fish/guestfish-actions.pod:296
4680 #: ../fish/guestfish-actions.pod:298
4688 #: ../fish/guestfish-actions.pod:300 ../src/guestfs-actions.pod:451
4689 msgid "Load files into the tree."
4693 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:453
4694 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
4698 #: ../fish/guestfish-actions.pod:305
4703 #: ../fish/guestfish-actions.pod:307
4711 #: ../fish/guestfish-actions.pod:309
4713 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
4714 "resulting nodes into alphabetical order."
4718 #: ../fish/guestfish-actions.pod:312
4723 #: ../fish/guestfish-actions.pod:314
4726 " aug-match augpath\n"
4731 #: ../fish/guestfish-actions.pod:316 ../src/guestfs-actions.pod:481
4733 "Returns a list of paths which match the path expression C<path>. The "
4734 "returned paths are sufficiently qualified so that they match exactly one "
4735 "node in the current tree."
4739 #: ../fish/guestfish-actions.pod:320
4744 #: ../fish/guestfish-actions.pod:322
4747 " aug-mv src dest\n"
4752 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:498
4754 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4755 "C<dest> is overwritten if it exists."
4759 #: ../fish/guestfish-actions.pod:327
4764 #: ../fish/guestfish-actions.pod:329
4772 #: ../fish/guestfish-actions.pod:331 ../src/guestfs-actions.pod:511
4773 msgid "Remove C<path> and all of its children."
4777 #: ../fish/guestfish-actions.pod:333 ../src/guestfs-actions.pod:513
4778 msgid "On success this returns the number of entries which were removed."
4782 #: ../fish/guestfish-actions.pod:335
4787 #: ../fish/guestfish-actions.pod:337
4795 #: ../fish/guestfish-actions.pod:339 ../src/guestfs-actions.pod:524
4796 msgid "This writes all pending changes to disk."
4800 #: ../fish/guestfish-actions.pod:341
4802 "The flags which were passed to L</aug-init> affect exactly how files are "
4807 #: ../fish/guestfish-actions.pod:344
4812 #: ../fish/guestfish-actions.pod:346
4815 " aug-set augpath val\n"
4820 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:540
4821 msgid "Set the value associated with C<path> to C<val>."
4825 #: ../fish/guestfish-actions.pod:350
4827 "In the Augeas API, it is possible to clear a node by setting the value to "
4828 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4829 "this call. Instead you must use the L</aug-clear> call."
4833 #: ../fish/guestfish-actions.pod:355
4838 #: ../fish/guestfish-actions.pod:357
4841 " available 'groups ...'\n"
4846 #: ../fish/guestfish-actions.pod:359 ../src/guestfs-actions.pod:557
4848 "This command is used to check the availability of some groups of "
4849 "functionality in the appliance, which not all builds of the libguestfs "
4850 "appliance will be able to provide."
4854 #: ../fish/guestfish-actions.pod:363
4856 "The libguestfs groups, and the functions that those groups correspond to, "
4857 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4858 "runtime by calling L</available-all-groups>."
4862 #: ../fish/guestfish-actions.pod:368 ../src/guestfs-actions.pod:566
4864 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
4865 "\"]> would check for the availability of the Linux inotify functions and "
4866 "Augeas (configuration file editing) functions."
4870 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
4871 msgid "The command returns no error if I<all> requested groups are available."
4875 #: ../fish/guestfish-actions.pod:375 ../src/guestfs-actions.pod:573
4877 "It fails with an error if one or more of the requested groups is unavailable "
4882 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
4884 "If an unknown group name is included in the list of groups then an error is "
4889 #: ../fish/guestfish-actions.pod:381 ../src/guestfs-actions.pod:579
4894 #: ../fish/guestfish-actions.pod:387
4895 msgid "You must call L</launch> before calling this function."
4899 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:587
4901 "The reason is because we don't know what groups are supported by the "
4902 "appliance/daemon until it is running and can be queried."
4906 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:593
4908 "If a group of functions is available, this does not necessarily mean that "
4909 "they will work. You still have to check for errors when calling individual "
4910 "API functions even if they are available."
4914 #: ../fish/guestfish-actions.pod:402 ../src/guestfs-actions.pod:600
4916 "It is usually the job of distro packagers to build complete functionality "
4917 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4918 "with all requirements satisfied, will support everything."
4922 #: ../fish/guestfish-actions.pod:409
4924 "This call was added in version C<1.0.80>. In previous versions of "
4925 "libguestfs all you could do would be to speculatively execute a command to "
4926 "find out if the daemon implemented it. See also L</version>."
4930 #: ../fish/guestfish-actions.pod:416
4931 msgid "available-all-groups"
4935 #: ../fish/guestfish-actions.pod:418
4938 " available-all-groups\n"
4943 #: ../fish/guestfish-actions.pod:420
4945 "This command returns a list of all optional groups that this daemon knows "
4946 "about. Note this returns both supported and unsupported groups. To find "
4947 "out which ones the daemon can actually support you have to call L</"
4948 "available> on each member of the returned list."
4952 #: ../fish/guestfish-actions.pod:426
4953 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
4957 #: ../fish/guestfish-actions.pod:428
4962 #: ../fish/guestfish-actions.pod:430
4965 " base64-in (base64file|-) filename\n"
4970 #: ../fish/guestfish-actions.pod:432 ../src/guestfs-actions.pod:644
4972 "This command uploads base64-encoded data from C<base64file> to C<filename>."
4976 #: ../fish/guestfish-actions.pod:435 ../fish/guestfish-actions.pod:444
4977 #: ../fish/guestfish-actions.pod:693 ../fish/guestfish-actions.pod:862
4978 #: ../fish/guestfish-actions.pod:881 ../fish/guestfish-actions.pod:1255
4979 #: ../fish/guestfish-actions.pod:4658 ../fish/guestfish-actions.pod:4670
4980 #: ../fish/guestfish-actions.pod:4681 ../fish/guestfish-actions.pod:4692
4981 #: ../fish/guestfish-actions.pod:4744 ../fish/guestfish-actions.pod:4753
4982 #: ../fish/guestfish-actions.pod:4807 ../fish/guestfish-actions.pod:4830
4983 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
4987 #: ../fish/guestfish-actions.pod:437
4992 #: ../fish/guestfish-actions.pod:439
4995 " base64-out filename (base64file|-)\n"
5000 #: ../fish/guestfish-actions.pod:441 ../src/guestfs-actions.pod:658
5002 "This command downloads the contents of C<filename>, writing it out to local "
5003 "file C<base64file> encoded as base64."
5007 #: ../fish/guestfish-actions.pod:446
5008 msgid "blockdev-flushbufs"
5012 #: ../fish/guestfish-actions.pod:448
5015 " blockdev-flushbufs device\n"
5020 #: ../fish/guestfish-actions.pod:450 ../src/guestfs-actions.pod:671
5022 "This tells the kernel to flush internal buffers associated with C<device>."
5026 #: ../fish/guestfish-actions.pod:453 ../fish/guestfish-actions.pod:464
5027 #: ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:483
5028 #: ../fish/guestfish-actions.pod:495 ../fish/guestfish-actions.pod:508
5029 #: ../fish/guestfish-actions.pod:516 ../fish/guestfish-actions.pod:527
5030 #: ../fish/guestfish-actions.pod:535 ../fish/guestfish-actions.pod:543
5031 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:691
5032 #: ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:722
5033 #: ../src/guestfs-actions.pod:740 ../src/guestfs-actions.pod:759
5034 #: ../src/guestfs-actions.pod:773 ../src/guestfs-actions.pod:791
5035 #: ../src/guestfs-actions.pod:805 ../src/guestfs-actions.pod:819
5036 msgid "This uses the L<blockdev(8)> command."
5040 #: ../fish/guestfish-actions.pod:455
5041 msgid "blockdev-getbsz"
5045 #: ../fish/guestfish-actions.pod:457
5048 " blockdev-getbsz device\n"
5053 #: ../fish/guestfish-actions.pod:459 ../src/guestfs-actions.pod:686
5054 msgid "This returns the block size of a device."
5058 #: ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:524
5059 #: ../src/guestfs-actions.pod:688 ../src/guestfs-actions.pod:788
5061 "(Note this is different from both I<size in blocks> and I<filesystem block "
5066 #: ../fish/guestfish-actions.pod:466
5067 msgid "blockdev-getro"
5071 #: ../fish/guestfish-actions.pod:468
5074 " blockdev-getro device\n"
5079 #: ../fish/guestfish-actions.pod:470 ../src/guestfs-actions.pod:703
5081 "Returns a boolean indicating if the block device is read-only (true if read-"
5082 "only, false if not)."
5086 #: ../fish/guestfish-actions.pod:475
5087 msgid "blockdev-getsize64"
5091 #: ../fish/guestfish-actions.pod:477
5094 " blockdev-getsize64 device\n"
5099 #: ../fish/guestfish-actions.pod:479 ../src/guestfs-actions.pod:718
5100 msgid "This returns the size of the device in bytes."
5104 #: ../fish/guestfish-actions.pod:481
5105 msgid "See also L</blockdev-getsz>."
5109 #: ../fish/guestfish-actions.pod:485
5110 msgid "blockdev-getss"
5114 #: ../fish/guestfish-actions.pod:487
5117 " blockdev-getss device\n"
5122 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:734
5124 "This returns the size of sectors on a block device. Usually 512, but can be "
5125 "larger for modern devices."
5129 #: ../fish/guestfish-actions.pod:492
5131 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5135 #: ../fish/guestfish-actions.pod:497
5136 msgid "blockdev-getsz"
5140 #: ../fish/guestfish-actions.pod:499
5143 " blockdev-getsz device\n"
5148 #: ../fish/guestfish-actions.pod:501 ../src/guestfs-actions.pod:752
5150 "This returns the size of the device in units of 512-byte sectors (even if "
5151 "the sectorsize isn't 512 bytes ... weird)."
5155 #: ../fish/guestfish-actions.pod:504
5157 "See also L</blockdev-getss> for the real sector size of the device, and L</"
5158 "blockdev-getsize64> for the more useful I<size in bytes>."
5162 #: ../fish/guestfish-actions.pod:510
5163 msgid "blockdev-rereadpt"
5167 #: ../fish/guestfish-actions.pod:512
5170 " blockdev-rereadpt device\n"
5175 #: ../fish/guestfish-actions.pod:514 ../src/guestfs-actions.pod:771
5176 msgid "Reread the partition table on C<device>."
5180 #: ../fish/guestfish-actions.pod:518
5181 msgid "blockdev-setbsz"
5185 #: ../fish/guestfish-actions.pod:520
5188 " blockdev-setbsz device blocksize\n"
5193 #: ../fish/guestfish-actions.pod:522 ../src/guestfs-actions.pod:786
5194 msgid "This sets the block size of a device."
5198 #: ../fish/guestfish-actions.pod:529
5199 msgid "blockdev-setro"
5203 #: ../fish/guestfish-actions.pod:531
5206 " blockdev-setro device\n"
5211 #: ../fish/guestfish-actions.pod:533 ../src/guestfs-actions.pod:803
5212 msgid "Sets the block device named C<device> to read-only."
5216 #: ../fish/guestfish-actions.pod:537
5217 msgid "blockdev-setrw"
5221 #: ../fish/guestfish-actions.pod:539
5224 " blockdev-setrw device\n"
5229 #: ../fish/guestfish-actions.pod:541 ../src/guestfs-actions.pod:817
5230 msgid "Sets the block device named C<device> to read-write."
5234 #: ../fish/guestfish-actions.pod:545
5235 msgid "btrfs-filesystem-resize"
5239 #: ../fish/guestfish-actions.pod:547
5242 " btrfs-filesystem-resize mountpoint [size:..]\n"
5247 #: ../fish/guestfish-actions.pod:549 ../src/guestfs-actions.pod:839
5248 msgid "This command resizes a btrfs filesystem."
5252 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:841
5254 "Note that unlike other resize calls, the filesystem has to be mounted and "
5255 "the parameter is the mountpoint not the device (this is a requirement of "
5260 #: ../fish/guestfish-actions.pod:555 ../fish/guestfish-actions.pod:3417
5261 #: ../src/guestfs-actions.pod:845 ../src/guestfs-actions.pod:5189
5262 msgid "The optional parameters are:"
5266 #: ../fish/guestfish-actions.pod:559 ../fish/guestfish-actions.pod:3421
5267 #: ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:5193
5272 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:851
5274 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
5275 "resized to the maximum size."
5279 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
5280 msgid "See also L<btrfs(8)>."
5284 #: ../fish/guestfish-actions.pod:570
5285 msgid "case-sensitive-path"
5289 #: ../fish/guestfish-actions.pod:572
5292 " case-sensitive-path path\n"
5297 #: ../fish/guestfish-actions.pod:574 ../src/guestfs-actions.pod:890
5299 "This can be used to resolve case insensitive paths on a filesystem which is "
5300 "case sensitive. The use case is to resolve paths which you have read from "
5301 "Windows configuration files or the Windows Registry, to the true path."
5305 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
5307 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5308 "(and probably others), which is that although the underlying filesystem is "
5309 "case-insensitive, the driver exports the filesystem to Linux as case-"
5314 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
5316 "One consequence of this is that special directories such as C<c:\\windows> "
5317 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5318 "precise details of how they were created. In Windows itself this would not "
5323 #: ../fish/guestfish-actions.pod:590 ../src/guestfs-actions.pod:906
5325 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5330 #: ../fish/guestfish-actions.pod:593 ../src/guestfs-actions.pod:909
5332 "This function resolves the true case of each element in the path and returns "
5333 "the case-sensitive path."
5337 #: ../fish/guestfish-actions.pod:596
5339 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
5340 "WINDOWS/system32\"> (the exact return value would depend on details of how "
5341 "the directories were originally created under Windows)."
5345 #: ../fish/guestfish-actions.pod:601 ../src/guestfs-actions.pod:917
5346 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5350 #: ../fish/guestfish-actions.pod:604
5351 msgid "See also L</realpath>."
5355 #: ../fish/guestfish-actions.pod:606
5360 #: ../fish/guestfish-actions.pod:608
5368 #: ../fish/guestfish-actions.pod:610 ../fish/guestfish-actions.pod:3837
5369 #: ../src/guestfs-actions.pod:933 ../src/guestfs-actions.pod:5832
5370 msgid "Return the contents of the file named C<path>."
5374 #: ../fish/guestfish-actions.pod:612
5376 "Note that this function cannot correctly handle binary files (specifically, "
5377 "files containing C<\\0> character which is treated as end of string). For "
5378 "those you need to use the L</read-file> or L</download> functions which have "
5379 "a more complex interface."
5383 #: ../fish/guestfish-actions.pod:617 ../fish/guestfish-actions.pod:752
5384 #: ../fish/guestfish-actions.pod:764 ../fish/guestfish-actions.pod:940
5385 #: ../fish/guestfish-actions.pod:950 ../fish/guestfish-actions.pod:1017
5386 #: ../fish/guestfish-actions.pod:1027 ../fish/guestfish-actions.pod:1219
5387 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:1536
5388 #: ../fish/guestfish-actions.pod:1564 ../fish/guestfish-actions.pod:1579
5389 #: ../fish/guestfish-actions.pod:1589 ../fish/guestfish-actions.pod:1608
5390 #: ../fish/guestfish-actions.pod:3707 ../fish/guestfish-actions.pod:3722
5391 #: ../fish/guestfish-actions.pod:3798 ../fish/guestfish-actions.pod:3815
5392 #: ../fish/guestfish-actions.pod:3830 ../fish/guestfish-actions.pod:4499
5393 #: ../fish/guestfish-actions.pod:4545 ../fish/guestfish-actions.pod:4630
5394 #: ../fish/guestfish-actions.pod:4645 ../fish/guestfish-actions.pod:5051
5395 #: ../fish/guestfish-actions.pod:5063 ../fish/guestfish-actions.pod:5081
5396 #: ../fish/guestfish-actions.pod:5098 ../fish/guestfish-actions.pod:5108
5397 #: ../fish/guestfish-actions.pod:5157 ../fish/guestfish-actions.pod:5167
5398 #: ../fish/guestfish-actions.pod:5196 ../fish/guestfish-actions.pod:5206
5399 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1122
5400 #: ../src/guestfs-actions.pod:1142 ../src/guestfs-actions.pod:1438
5401 #: ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1560
5402 #: ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1825
5403 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:2315
5404 #: ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:2382
5405 #: ../src/guestfs-actions.pod:2399 ../src/guestfs-actions.pod:2428
5406 #: ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5640
5407 #: ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5797
5408 #: ../src/guestfs-actions.pod:5821 ../src/guestfs-actions.pod:6772
5409 #: ../src/guestfs-actions.pod:6827 ../src/guestfs-actions.pod:6973
5410 #: ../src/guestfs-actions.pod:6997 ../src/guestfs-actions.pod:7662
5411 #: ../src/guestfs-actions.pod:7682 ../src/guestfs-actions.pod:7715
5412 #: ../src/guestfs-actions.pod:7734 ../src/guestfs-actions.pod:7753
5413 #: ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7858
5414 #: ../src/guestfs-actions.pod:7904 ../src/guestfs-actions.pod:7923
5416 "Because of the message protocol, there is a transfer limit of somewhere "
5417 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5421 #: ../fish/guestfish-actions.pod:620
5426 #: ../fish/guestfish-actions.pod:622
5429 " checksum csumtype path\n"
5434 #: ../fish/guestfish-actions.pod:624 ../src/guestfs-actions.pod:955
5436 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5440 #: ../fish/guestfish-actions.pod:627 ../src/guestfs-actions.pod:958
5442 "The type of checksum to compute is given by the C<csumtype> parameter which "
5443 "must have one of the following values:"
5447 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
5452 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:965
5454 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5459 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
5464 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
5465 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5469 #: ../fish/guestfish-actions.pod:641 ../src/guestfs-actions.pod:972
5474 #: ../fish/guestfish-actions.pod:643 ../src/guestfs-actions.pod:974
5475 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
5479 #: ../fish/guestfish-actions.pod:645 ../src/guestfs-actions.pod:976
5484 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:978
5485 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
5489 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:980
5494 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:982
5495 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
5499 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:984
5504 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:986
5505 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
5509 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:988
5514 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:990
5515 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
5519 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:994
5520 msgid "The checksum is returned as a printable string."
5524 #: ../fish/guestfish-actions.pod:665
5525 msgid "To get the checksum for a device, use L</checksum-device>."
5529 #: ../fish/guestfish-actions.pod:667
5530 msgid "To get the checksums for many files, use L</checksums-out>."
5534 #: ../fish/guestfish-actions.pod:669
5535 msgid "checksum-device"
5539 #: ../fish/guestfish-actions.pod:671
5542 " checksum-device csumtype device\n"
5547 #: ../fish/guestfish-actions.pod:673
5549 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
5550 "device named C<device>. For the types of checksums supported see the L</"
5551 "checksum> command."
5555 #: ../fish/guestfish-actions.pod:677
5556 msgid "checksums-out"
5560 #: ../fish/guestfish-actions.pod:679
5563 " checksums-out csumtype directory (sumsfile|-)\n"
5568 #: ../fish/guestfish-actions.pod:681 ../src/guestfs-actions.pod:1029
5570 "This command computes the checksums of all regular files in C<directory> and "
5571 "then emits a list of those checksums to the local output file C<sumsfile>."
5575 #: ../fish/guestfish-actions.pod:685 ../src/guestfs-actions.pod:1033
5577 "This can be used for verifying the integrity of a virtual machine. However "
5578 "to be properly secure you should pay attention to the output of the checksum "
5579 "command (it uses the ones from GNU coreutils). In particular when the "
5580 "filename is not printable, coreutils uses a special backslash syntax. For "
5581 "more information, see the GNU coreutils info file."
5585 #: ../fish/guestfish-actions.pod:695
5590 #: ../fish/guestfish-actions.pod:697
5593 " chmod mode path\n"
5598 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1052
5600 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
5605 #: ../fish/guestfish-actions.pod:702 ../src/guestfs-actions.pod:1055
5607 "I<Note>: When using this command from guestfish, C<mode> by default would be "
5608 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
5613 #: ../fish/guestfish-actions.pod:706 ../fish/guestfish-actions.pod:3060
5614 #: ../fish/guestfish-actions.pod:3199 ../fish/guestfish-actions.pod:3209
5615 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:1059
5616 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4795
5617 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:4833
5618 msgid "The mode actually set is affected by the umask."
5622 #: ../fish/guestfish-actions.pod:708
5627 #: ../fish/guestfish-actions.pod:710
5630 " chown owner group path\n"
5635 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1073
5636 msgid "Change the file owner to C<owner> and group to C<group>."
5640 #: ../fish/guestfish-actions.pod:714 ../fish/guestfish-actions.pod:2495
5641 #: ../src/guestfs-actions.pod:1075 ../src/guestfs-actions.pod:3657
5643 "Only numeric uid and gid are supported. If you want to use names, you will "
5644 "need to locate and parse the password file yourself (Augeas support makes "
5645 "this relatively easy)."
5649 #: ../fish/guestfish-actions.pod:718
5654 #: ../fish/guestfish-actions.pod:720
5657 " command 'arguments ...'\n"
5662 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1089
5664 "This call runs a command from the guest filesystem. The filesystem must be "
5665 "mounted, and must contain a compatible operating system (ie. something "
5666 "Linux, with the same or compatible processor architecture)."
5670 #: ../fish/guestfish-actions.pod:727
5672 "The single parameter is an argv-style list of arguments. The first element "
5673 "is the name of the program to run. Subsequent elements are parameters. The "
5674 "list must be non-empty (ie. must contain a program name). Note that the "
5675 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
5679 #: ../fish/guestfish-actions.pod:734 ../src/guestfs-actions.pod:1101
5680 msgid "The return value is anything printed to I<stdout> by the command."
5684 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1104
5686 "If the command returns a non-zero exit status, then this function returns an "
5687 "error message. The error message string is the content of I<stderr> from "
5692 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1108
5694 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
5695 "bin>. If you require a program from another location, you should provide "
5696 "the full path in the first parameter."
5700 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
5702 "Shared libraries and data files required by the program must be available on "
5703 "filesystems which are mounted in the correct places. It is the caller's "
5704 "responsibility to ensure all filesystems that are needed are mounted at the "
5709 #: ../fish/guestfish-actions.pod:755
5710 msgid "command-lines"
5714 #: ../fish/guestfish-actions.pod:757
5717 " command-lines 'arguments ...'\n"
5722 #: ../fish/guestfish-actions.pod:759
5724 "This is the same as L</command>, but splits the result into a list of lines."
5728 #: ../fish/guestfish-actions.pod:762
5729 msgid "See also: L</sh-lines>"
5733 #: ../fish/guestfish-actions.pod:767
5738 #: ../fish/guestfish-actions.pod:769
5741 " config qemuparam qemuvalue\n"
5746 #: ../fish/guestfish-actions.pod:771 ../src/guestfs-actions.pod:1154
5748 "This can be used to add arbitrary qemu command line parameters of the form "
5749 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
5750 "setting some parameters which would interfere with parameters that we use."
5754 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1159
5755 msgid "The first character of C<param> string must be a C<-> (dash)."
5759 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1161
5760 msgid "C<value> can be NULL."
5764 #: ../fish/guestfish-actions.pod:780
5769 #: ../fish/guestfish-actions.pod:782
5772 " copy-size src dest size\n"
5777 #: ../fish/guestfish-actions.pod:784 ../src/guestfs-actions.pod:1175
5779 "This command copies exactly C<size> bytes from one source device or file "
5780 "C<src> to another destination device or file C<dest>."
5784 #: ../fish/guestfish-actions.pod:787 ../src/guestfs-actions.pod:1178
5786 "Note this will fail if the source is too short or if the destination is not "
5791 #: ../fish/guestfish-actions.pod:790
5796 #: ../fish/guestfish-actions.pod:792
5804 #: ../fish/guestfish-actions.pod:794 ../src/guestfs-actions.pod:1197
5806 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5807 "destination filename or destination directory."
5811 #: ../fish/guestfish-actions.pod:797
5816 #: ../fish/guestfish-actions.pod:799
5824 #: ../fish/guestfish-actions.pod:801 ../src/guestfs-actions.pod:1211
5826 "This copies a file or directory from C<src> to C<dest> recursively using the "
5831 #: ../fish/guestfish-actions.pod:804
5836 #: ../fish/guestfish-actions.pod:806
5844 #: ../fish/guestfish-actions.pod:808 ../src/guestfs-actions.pod:1225
5846 "This command copies from one source device or file C<src> to another "
5847 "destination device or file C<dest>. Normally you would use this to copy to "
5848 "or from a device or partition, for example to duplicate a filesystem."
5852 #: ../fish/guestfish-actions.pod:813
5854 "If the destination is a device, it must be as large or larger than the "
5855 "source file or device, otherwise the copy will fail. This command cannot do "
5856 "partial copies (see L</copy-size>)."
5860 #: ../fish/guestfish-actions.pod:817
5865 #: ../fish/guestfish-actions.pod:819
5873 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1243
5874 msgid "This command runs the C<df> command to report disk space used."
5878 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:834
5880 "This command is mostly useful for interactive sessions. It is I<not> "
5881 "intended that you try to parse the output string. Use L</statvfs> from "
5886 #: ../fish/guestfish-actions.pod:827
5891 #: ../fish/guestfish-actions.pod:829
5899 #: ../fish/guestfish-actions.pod:831 ../src/guestfs-actions.pod:1259
5901 "This command runs the C<df -h> command to report disk space used in human-"
5906 #: ../fish/guestfish-actions.pod:838
5911 #: ../fish/guestfish-actions.pod:840
5919 #: ../fish/guestfish-actions.pod:842 ../src/guestfs-actions.pod:1276
5921 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5922 "This is sometimes useful for extended debugging of problems."
5926 #: ../fish/guestfish-actions.pod:846
5928 "Another way to get the same information is to enable verbose messages with "
5929 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
5930 "before running the program."
5934 #: ../fish/guestfish-actions.pod:851
5939 #: ../fish/guestfish-actions.pod:853
5942 " download remotefilename (filename|-)\n"
5947 #: ../fish/guestfish-actions.pod:855 ../fish/guestfish-actions.pod:868
5948 #: ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1322
5950 "Download file C<remotefilename> and save it as C<filename> on the local "
5955 #: ../fish/guestfish-actions.pod:858 ../fish/guestfish-actions.pod:4803
5956 #: ../src/guestfs-actions.pod:1300 ../src/guestfs-actions.pod:7232
5957 msgid "C<filename> can also be a named pipe."
5961 #: ../fish/guestfish-actions.pod:860
5962 msgid "See also L</upload>, L</cat>."
5966 #: ../fish/guestfish-actions.pod:864
5967 msgid "download-offset"
5971 #: ../fish/guestfish-actions.pod:866
5974 " download-offset remotefilename (filename|-) offset size\n"
5979 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1325
5981 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
5982 "region must be within the file or device)."
5986 #: ../fish/guestfish-actions.pod:874
5988 "Note that there is no limit on the amount of data that can be downloaded "
5989 "with this call, unlike with L</pread>, and this call always reads the full "
5990 "amount unless an error occurs."
5994 #: ../fish/guestfish-actions.pod:879
5995 msgid "See also L</download>, L</pread>."
5999 #: ../fish/guestfish-actions.pod:883
6004 #: ../fish/guestfish-actions.pod:885
6007 " drop-caches whattodrop\n"
6012 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1350
6014 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6015 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6016 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6020 #: ../fish/guestfish-actions.pod:892 ../src/guestfs-actions.pod:1355
6021 msgid "Setting C<whattodrop> to 3 should drop everything."
6025 #: ../fish/guestfish-actions.pod:894 ../src/guestfs-actions.pod:1357
6027 "This automatically calls L<sync(2)> before the operation, so that the "
6028 "maximum guest memory is freed."
6032 #: ../fish/guestfish-actions.pod:897
6037 #: ../fish/guestfish-actions.pod:899
6045 #: ../fish/guestfish-actions.pod:901 ../src/guestfs-actions.pod:1370
6047 "This command runs the C<du -s> command to estimate file space usage for "
6052 #: ../fish/guestfish-actions.pod:904 ../src/guestfs-actions.pod:1373
6054 "C<path> can be a file or a directory. If C<path> is a directory then the "
6055 "estimate includes the contents of the directory and all subdirectories "
6060 #: ../fish/guestfish-actions.pod:908 ../src/guestfs-actions.pod:1377
6062 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6066 #: ../fish/guestfish-actions.pod:911
6071 #: ../fish/guestfish-actions.pod:913
6074 " e2fsck-f device\n"
6079 #: ../fish/guestfish-actions.pod:915 ../src/guestfs-actions.pod:1395
6081 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6082 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6087 #: ../fish/guestfish-actions.pod:919
6089 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6090 "should use L</fsck>."
6094 #: ../fish/guestfish-actions.pod:922
6099 #: ../fish/guestfish-actions.pod:924
6102 " echo-daemon 'words ...'\n"
6107 #: ../fish/guestfish-actions.pod:926 ../src/guestfs-actions.pod:1412
6109 "This command concatenates the list of C<words> passed with single spaces "
6110 "between them and returns the resulting string."
6114 #: ../fish/guestfish-actions.pod:929 ../src/guestfs-actions.pod:1415
6115 msgid "You can use this command to test the connection through to the daemon."
6119 #: ../fish/guestfish-actions.pod:931
6120 msgid "See also L</ping-daemon>."
6124 #: ../fish/guestfish-actions.pod:933
6129 #: ../fish/guestfish-actions.pod:935
6132 " egrep regex path\n"
6137 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1431
6139 "This calls the external C<egrep> program and returns the matching lines."
6143 #: ../fish/guestfish-actions.pod:943
6148 #: ../fish/guestfish-actions.pod:945
6151 " egrepi regex path\n"
6156 #: ../fish/guestfish-actions.pod:947 ../src/guestfs-actions.pod:1450
6158 "This calls the external C<egrep -i> program and returns the matching lines."
6162 #: ../fish/guestfish-actions.pod:953
6167 #: ../fish/guestfish-actions.pod:955
6170 " equal file1 file2\n"
6175 #: ../fish/guestfish-actions.pod:957 ../src/guestfs-actions.pod:1469
6177 "This compares the two files C<file1> and C<file2> and returns true if their "
6178 "content is exactly equal, or false otherwise."
6182 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1472
6183 msgid "The external L<cmp(1)> program is used for the comparison."
6187 #: ../fish/guestfish-actions.pod:962
6192 #: ../fish/guestfish-actions.pod:964
6200 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1484
6202 "This returns C<true> if and only if there is a file, directory (or anything) "
6203 "with the given C<path> name."
6207 #: ../fish/guestfish-actions.pod:969
6208 msgid "See also L</is-file>, L</is-dir>, L</stat>."
6212 #: ../fish/guestfish-actions.pod:971
6217 #: ../fish/guestfish-actions.pod:973
6220 " fallocate path len\n"
6225 #: ../fish/guestfish-actions.pod:975 ../fish/guestfish-actions.pod:994
6226 #: ../src/guestfs-actions.pod:1507 ../src/guestfs-actions.pod:1526
6228 "This command preallocates a file (containing zero bytes) named C<path> of "
6229 "size C<len> bytes. If the file exists already, it is overwritten."
6233 #: ../fish/guestfish-actions.pod:979 ../src/guestfs-actions.pod:1511
6235 "Do not confuse this with the guestfish-specific C<alloc> command which "
6236 "allocates a file in the host and attaches it as a device."
6240 #: ../fish/guestfish-actions.pod:983
6242 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
6247 #: ../fish/guestfish-actions.pod:990
6252 #: ../fish/guestfish-actions.pod:992
6255 " fallocate64 path len\n"
6260 #: ../fish/guestfish-actions.pod:998
6262 "Note that this call allocates disk blocks for the file. To create a sparse "
6263 "file use L</truncate-size> instead."
6267 #: ../fish/guestfish-actions.pod:1001
6269 "The deprecated call L</fallocate> does the same, but owing to an oversight "
6270 "it only allowed 30 bit lengths to be specified, effectively limiting the "
6271 "maximum size of files created through that call to 1GB."
6275 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1538
6277 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6278 "commands which create a file in the host and attach it as a device."
6282 #: ../fish/guestfish-actions.pod:1010
6287 #: ../fish/guestfish-actions.pod:1012
6290 " fgrep pattern path\n"
6295 #: ../fish/guestfish-actions.pod:1014 ../src/guestfs-actions.pod:1553
6297 "This calls the external C<fgrep> program and returns the matching lines."
6301 #: ../fish/guestfish-actions.pod:1020
6306 #: ../fish/guestfish-actions.pod:1022
6309 " fgrepi pattern path\n"
6314 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1572
6316 "This calls the external C<fgrep -i> program and returns the matching lines."
6320 #: ../fish/guestfish-actions.pod:1030
6325 #: ../fish/guestfish-actions.pod:1032
6333 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1590
6335 "This call uses the standard L<file(1)> command to determine the type or "
6336 "contents of the file."
6340 #: ../fish/guestfish-actions.pod:1037 ../src/guestfs-actions.pod:1593
6342 "This call will also transparently look inside various types of compressed "
6347 #: ../fish/guestfish-actions.pod:1040 ../src/guestfs-actions.pod:1596
6349 "The exact command which runs is C<file -zb path>. Note in particular that "
6350 "the filename is not prepended to the output (the I<-b> option)."
6354 #: ../fish/guestfish-actions.pod:1044 ../src/guestfs-actions.pod:1600
6356 "The output depends on the output of the underlying L<file(1)> command and it "
6357 "can change in future in ways beyond our control. In other words, the output "
6358 "is not guaranteed by the ABI."
6362 #: ../fish/guestfish-actions.pod:1048
6364 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
6365 "(etc), L</is-zero>."
6369 #: ../fish/guestfish-actions.pod:1051
6370 msgid "file-architecture"
6374 #: ../fish/guestfish-actions.pod:1053
6377 " file-architecture filename\n"
6382 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1618
6384 "This detects the architecture of the binary C<filename>, and returns it if "
6389 #: ../fish/guestfish-actions.pod:1058 ../src/guestfs-actions.pod:1621
6390 msgid "Currently defined architectures are:"
6394 #: ../fish/guestfish-actions.pod:1062 ../src/guestfs-actions.pod:1625
6399 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1627
6401 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
6402 "irrespective of the precise processor requirements of the binary."
6406 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1630
6411 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1632
6412 msgid "64 bit x86-64."
6416 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1634
6421 #: ../fish/guestfish-actions.pod:1073 ../src/guestfs-actions.pod:1636
6422 msgid "32 bit SPARC."
6426 #: ../fish/guestfish-actions.pod:1075 ../src/guestfs-actions.pod:1638
6431 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1640
6432 msgid "64 bit SPARC V9 and above."
6436 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1642
6441 #: ../fish/guestfish-actions.pod:1081 ../src/guestfs-actions.pod:1644
6442 msgid "Intel Itanium."
6446 #: ../fish/guestfish-actions.pod:1083 ../src/guestfs-actions.pod:1646
6451 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1648
6452 msgid "32 bit Power PC."
6456 #: ../fish/guestfish-actions.pod:1087 ../src/guestfs-actions.pod:1650
6461 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1652
6462 msgid "64 bit Power PC."
6466 #: ../fish/guestfish-actions.pod:1093 ../src/guestfs-actions.pod:1656
6467 msgid "Libguestfs may return other architecture strings in future."
6471 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1658
6472 msgid "The function works on at least the following types of files:"
6476 #: ../fish/guestfish-actions.pod:1101 ../src/guestfs-actions.pod:1664
6477 msgid "many types of Un*x and Linux binary"
6481 #: ../fish/guestfish-actions.pod:1105 ../src/guestfs-actions.pod:1668
6482 msgid "many types of Un*x and Linux shared library"
6486 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1672
6487 msgid "Windows Win32 and Win64 binaries"
6491 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1676
6492 msgid "Windows Win32 and Win64 DLLs"
6496 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1678
6497 msgid "Win32 binaries and DLLs return C<i386>."
6501 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1680
6502 msgid "Win64 binaries and DLLs return C<x86_64>."
6506 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1684
6507 msgid "Linux kernel modules"
6511 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1688
6512 msgid "Linux new-style initrd images"
6516 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1692
6517 msgid "some non-x86 Linux vmlinuz kernels"
6521 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1696
6522 msgid "What it can't do currently:"
6526 #: ../fish/guestfish-actions.pod:1139 ../src/guestfs-actions.pod:1702
6527 msgid "static libraries (libfoo.a)"
6531 #: ../fish/guestfish-actions.pod:1143 ../src/guestfs-actions.pod:1706
6532 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
6536 #: ../fish/guestfish-actions.pod:1147 ../src/guestfs-actions.pod:1710
6537 msgid "x86 Linux vmlinuz kernels"
6541 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1712
6543 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
6544 "compressed code, and are horribly hard to unpack. If you want to find the "
6545 "architecture of a kernel, use the architecture of the associated initrd or "
6546 "kernel module(s) instead."
6550 #: ../fish/guestfish-actions.pod:1156
6555 #: ../fish/guestfish-actions.pod:1158
6563 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1730
6564 msgid "This command returns the size of C<file> in bytes."
6568 #: ../fish/guestfish-actions.pod:1162
6570 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
6571 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
6575 #: ../fish/guestfish-actions.pod:1166
6580 #: ../fish/guestfish-actions.pod:1168
6583 " fill c len path\n"
6588 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1748
6590 "This command creates a new file called C<path>. The initial content of the "
6591 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
6596 #: ../fish/guestfish-actions.pod:1174
6598 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
6599 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
6604 #: ../fish/guestfish-actions.pod:1179
6605 msgid "fill-pattern"
6609 #: ../fish/guestfish-actions.pod:1181
6612 " fill-pattern pattern len path\n"
6617 #: ../fish/guestfish-actions.pod:1183
6619 "This function is like L</fill> except that it creates a new file of length "
6620 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
6621 "is truncated if necessary to ensure the length of the file is exactly C<len> "
6626 #: ../fish/guestfish-actions.pod:1188
6631 #: ../fish/guestfish-actions.pod:1190
6639 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1794
6641 "This command lists out all files and directories, recursively, starting at "
6642 "C<directory>. It is essentially equivalent to running the shell command "
6643 "C<find directory -print> but some post-processing happens on the output, "
6648 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1799
6650 "This returns a list of strings I<without any prefix>. Thus if the directory "
6655 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1802
6665 #: ../fish/guestfish-actions.pod:1204
6666 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
6670 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:1809
6681 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:1814
6682 msgid "If C<directory> is not a directory, then this command returns an error."
6686 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1817
6687 msgid "The returned list is sorted."
6691 #: ../fish/guestfish-actions.pod:1217
6692 msgid "See also L</find0>."
6696 #: ../fish/guestfish-actions.pod:1222
6701 #: ../fish/guestfish-actions.pod:1224
6704 " find0 directory (files|-)\n"
6709 #: ../fish/guestfish-actions.pod:1226 ../src/guestfs-actions.pod:1837
6711 "This command lists out all files and directories, recursively, starting at "
6712 "C<directory>, placing the resulting list in the external file called "
6717 #: ../fish/guestfish-actions.pod:1230
6719 "This command works the same way as L</find> with the following exceptions:"
6723 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1848
6724 msgid "The resulting list is written to an external file."
6728 #: ../fish/guestfish-actions.pod:1241 ../src/guestfs-actions.pod:1852
6730 "Items (filenames) in the result are separated by C<\\0> characters. See "
6731 "L<find(1)> option I<-print0>."
6735 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:1857
6736 msgid "This command is not limited in the number of names that it can return."
6740 #: ../fish/guestfish-actions.pod:1251 ../src/guestfs-actions.pod:1862
6741 msgid "The result list is not sorted."
6745 #: ../fish/guestfish-actions.pod:1257
6746 msgid "findfs-label"
6750 #: ../fish/guestfish-actions.pod:1259
6753 " findfs-label label\n"
6758 #: ../fish/guestfish-actions.pod:1261 ../src/guestfs-actions.pod:1876
6760 "This command searches the filesystems and returns the one which has the "
6761 "given label. An error is returned if no such filesystem can be found."
6765 #: ../fish/guestfish-actions.pod:1265
6766 msgid "To find the label of a filesystem, use L</vfs-label>."
6770 #: ../fish/guestfish-actions.pod:1267
6775 #: ../fish/guestfish-actions.pod:1269
6778 " findfs-uuid uuid\n"
6783 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1893
6785 "This command searches the filesystems and returns the one which has the "
6786 "given UUID. An error is returned if no such filesystem can be found."
6790 #: ../fish/guestfish-actions.pod:1275
6791 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
6795 #: ../fish/guestfish-actions.pod:1277
6800 #: ../fish/guestfish-actions.pod:1279
6803 " fsck fstype device\n"
6808 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1911
6810 "This runs the filesystem checker (fsck) on C<device> which should have "
6811 "filesystem type C<fstype>."
6815 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:1914
6817 "The returned integer is the status. See L<fsck(8)> for the list of status "
6818 "codes from C<fsck>."
6822 #: ../fish/guestfish-actions.pod:1293 ../src/guestfs-actions.pod:1923
6823 msgid "Multiple status codes can be summed together."
6827 #: ../fish/guestfish-actions.pod:1297 ../src/guestfs-actions.pod:1927
6829 "A non-zero return code can mean \"success\", for example if errors have been "
6830 "corrected on the filesystem."
6834 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:1932
6835 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6839 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:1937
6841 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6845 #: ../fish/guestfish-actions.pod:1309
6850 #: ../fish/guestfish-actions.pod:1311
6858 #: ../fish/guestfish-actions.pod:1313 ../src/guestfs-actions.pod:1948
6860 "Return the additional kernel options which are added to the guest kernel "
6865 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:1951
6866 msgid "If C<NULL> then no options are added."
6870 #: ../fish/guestfish-actions.pod:1318
6871 msgid "get-attach-method"
6875 #: ../fish/guestfish-actions.pod:1320
6878 " get-attach-method\n"
6883 #: ../fish/guestfish-actions.pod:1322
6884 msgid "Return the current attach method. See L</set-attach-method>."
6888 #: ../fish/guestfish-actions.pod:1324
6889 msgid "get-autosync"
6893 #: ../fish/guestfish-actions.pod:1326
6901 #: ../fish/guestfish-actions.pod:1328 ../src/guestfs-actions.pod:1976
6902 msgid "Get the autosync flag."
6906 #: ../fish/guestfish-actions.pod:1330
6911 #: ../fish/guestfish-actions.pod:1332
6919 #: ../fish/guestfish-actions.pod:1334 ../src/guestfs-actions.pod:1987
6920 msgid "Return the direct appliance mode flag."
6924 #: ../fish/guestfish-actions.pod:1336
6929 #: ../fish/guestfish-actions.pod:1338
6932 " get-e2label device\n"
6937 #: ../fish/guestfish-actions.pod:1340 ../src/guestfs-actions.pod:2006
6939 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6943 #: ../fish/guestfish-actions.pod:1343
6945 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
6950 #: ../fish/guestfish-actions.pod:1350
6955 #: ../fish/guestfish-actions.pod:1352
6958 " get-e2uuid device\n"
6963 #: ../fish/guestfish-actions.pod:1354 ../src/guestfs-actions.pod:2027
6965 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6969 #: ../fish/guestfish-actions.pod:1357
6971 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
6976 #: ../fish/guestfish-actions.pod:1364
6981 #: ../fish/guestfish-actions.pod:1366
6989 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2040
6991 "This gets the memory size in megabytes allocated to the qemu subprocess."
6995 #: ../fish/guestfish-actions.pod:1371
6997 "If L</set-memsize> was not called on this handle, and if "
6998 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6999 "value for memsize."
7003 #: ../fish/guestfish-actions.pod:1375 ../fish/guestfish-actions.pod:1432
7004 #: ../fish/guestfish-actions.pod:4163 ../fish/guestfish-actions.pod:4265
7005 #: ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2139
7006 #: ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6419
7008 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7012 #: ../fish/guestfish-actions.pod:1378
7017 #: ../fish/guestfish-actions.pod:1380
7025 #: ../fish/guestfish-actions.pod:1382 ../src/guestfs-actions.pod:2059
7026 msgid "This returns the enable network flag."
7030 #: ../fish/guestfish-actions.pod:1384
7035 #: ../fish/guestfish-actions.pod:1386
7043 #: ../fish/guestfish-actions.pod:1388 ../src/guestfs-actions.pod:2070
7044 msgid "Return the current search path."
7048 #: ../fish/guestfish-actions.pod:1390 ../src/guestfs-actions.pod:2072
7050 "This is always non-NULL. If it wasn't set already, then this will return "
7055 #: ../fish/guestfish-actions.pod:1393
7060 #: ../fish/guestfish-actions.pod:1395
7068 #: ../fish/guestfish-actions.pod:1397 ../src/guestfs-actions.pod:2085
7069 msgid "This returns the process group flag."
7073 #: ../fish/guestfish-actions.pod:1399
7078 #: ../fish/guestfish-actions.pod:1401
7083 #: ../fish/guestfish-actions.pod:1403
7091 #: ../fish/guestfish-actions.pod:1405 ../src/guestfs-actions.pod:2096
7093 "Return the process ID of the qemu subprocess. If there is no qemu "
7094 "subprocess, then this will return an error."
7098 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2099
7099 msgid "This is an internal call used for debugging and testing."
7103 #: ../fish/guestfish-actions.pod:1410
7108 #: ../fish/guestfish-actions.pod:1412
7116 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2110
7117 msgid "Return the current qemu binary."
7121 #: ../fish/guestfish-actions.pod:1416 ../src/guestfs-actions.pod:2112
7123 "This is always non-NULL. If it wasn't set already, then this will return "
7124 "the default qemu binary name."
7128 #: ../fish/guestfish-actions.pod:1419
7129 msgid "get-recovery-proc"
7133 #: ../fish/guestfish-actions.pod:1421
7136 " get-recovery-proc\n"
7141 #: ../fish/guestfish-actions.pod:1423 ../src/guestfs-actions.pod:2125
7142 msgid "Return the recovery process enabled flag."
7146 #: ../fish/guestfish-actions.pod:1425
7151 #: ../fish/guestfish-actions.pod:1427
7159 #: ../fish/guestfish-actions.pod:1429
7161 "This returns the current setting of the selinux flag which is passed to the "
7162 "appliance at boot time. See L</set-selinux>."
7166 #: ../fish/guestfish-actions.pod:1435
7171 #: ../fish/guestfish-actions.pod:1437
7179 #: ../fish/guestfish-actions.pod:1439 ../src/guestfs-actions.pod:2151
7181 "This returns the current state as an opaque integer. This is only useful "
7182 "for printing debug and internal error messages."
7186 #: ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:2362
7187 #: ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2418
7188 #: ../fish/guestfish-actions.pod:2434 ../src/guestfs-actions.pod:2154
7189 #: ../src/guestfs-actions.pod:3434 ../src/guestfs-actions.pod:3463
7190 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3551
7191 msgid "For more information on states, see L<guestfs(3)>."
7195 #: ../fish/guestfish-actions.pod:1444
7200 #: ../fish/guestfish-actions.pod:1446
7208 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2165
7209 msgid "Return the command trace flag."
7213 #: ../fish/guestfish-actions.pod:1450
7218 #: ../fish/guestfish-actions.pod:1452
7226 #: ../fish/guestfish-actions.pod:1454
7228 "Return the current umask. By default the umask is C<022> unless it has been "
7229 "set by calling L</umask>."
7233 #: ../fish/guestfish-actions.pod:1457
7238 #: ../fish/guestfish-actions.pod:1459
7246 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2188
7247 msgid "This returns the verbose messages flag."
7251 #: ../fish/guestfish-actions.pod:1463
7256 #: ../fish/guestfish-actions.pod:1465
7264 #: ../fish/guestfish-actions.pod:1467 ../src/guestfs-actions.pod:2199
7265 msgid "This gets the SELinux security context of the daemon."
7269 #: ../fish/guestfish-actions.pod:1469
7270 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
7274 #: ../fish/guestfish-actions.pod:1472
7279 #: ../fish/guestfish-actions.pod:1474
7282 " getxattr path name\n"
7287 #: ../fish/guestfish-actions.pod:1476
7289 "Get a single extended attribute from file C<path> named C<name>. This call "
7290 "follows symlinks. If you want to lookup an extended attribute for the "
7291 "symlink itself, use L</lgetxattr>."
7295 #: ../fish/guestfish-actions.pod:1480 ../fish/guestfish-actions.pod:2507
7297 "Normally it is better to get all extended attributes from a file in one go "
7298 "by calling L</getxattrs>. However some Linux filesystem implementations are "
7299 "buggy and do not provide a way to list out attributes. For these "
7300 "filesystems (notably ntfs-3g) you have to know the names of the extended "
7301 "attributes you want in advance and call this function."
7305 #: ../fish/guestfish-actions.pod:1487 ../fish/guestfish-actions.pod:2514
7306 #: ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:3684
7308 "Extended attribute values are blobs of binary data. If there is no extended "
7309 "attribute named C<name>, this returns an error."
7313 #: ../fish/guestfish-actions.pod:1490
7314 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
7318 #: ../fish/guestfish-actions.pod:1492
7323 #: ../fish/guestfish-actions.pod:1494
7331 #: ../fish/guestfish-actions.pod:1496 ../src/guestfs-actions.pod:2245
7333 "This call lists the extended attributes of the file or directory C<path>."
7337 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2248
7339 "At the system call level, this is a combination of the L<listxattr(2)> and "
7340 "L<getxattr(2)> calls."
7344 #: ../fish/guestfish-actions.pod:1502
7345 msgid "See also: L</lgetxattrs>, L<attr(5)>."
7349 #: ../fish/guestfish-actions.pod:1504
7354 #: ../fish/guestfish-actions.pod:1506
7357 " glob-expand pattern\n"
7362 #: ../fish/guestfish-actions.pod:1508 ../src/guestfs-actions.pod:2265
7364 "This command searches for all the pathnames matching C<pattern> according to "
7365 "the wildcard expansion rules used by the shell."
7369 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2269
7371 "If no paths match, then this returns an empty list (note: not an error)."
7375 #: ../fish/guestfish-actions.pod:1515 ../src/guestfs-actions.pod:2272
7377 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
7378 "GLOB_BRACE>. See that manual page for more details."
7382 #: ../fish/guestfish-actions.pod:1519
7387 #: ../fish/guestfish-actions.pod:1521
7390 " grep regex path\n"
7395 #: ../fish/guestfish-actions.pod:1523 ../src/guestfs-actions.pod:2289
7396 msgid "This calls the external C<grep> program and returns the matching lines."
7400 #: ../fish/guestfish-actions.pod:1529
7405 #: ../fish/guestfish-actions.pod:1531
7408 " grepi regex path\n"
7413 #: ../fish/guestfish-actions.pod:1533 ../src/guestfs-actions.pod:2308
7415 "This calls the external C<grep -i> program and returns the matching lines."
7419 #: ../fish/guestfish-actions.pod:1539
7420 msgid "grub-install"
7424 #: ../fish/guestfish-actions.pod:1541
7427 " grub-install root device\n"
7432 #: ../fish/guestfish-actions.pod:1543 ../src/guestfs-actions.pod:2327
7434 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
7435 "the root directory being C<root>."
7439 #: ../fish/guestfish-actions.pod:1546 ../src/guestfs-actions.pod:2330
7441 "Note: If grub-install reports the error \"No suitable drive was found in the "
7442 "generated device map.\" it may be that you need to create a C</boot/grub/"
7443 "device.map> file first that contains the mapping between grub device names "
7444 "and Linux device names. It is usually sufficient to create a file "
7449 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2337
7457 #: ../fish/guestfish-actions.pod:1555 ../src/guestfs-actions.pod:2339
7458 msgid "replacing C</dev/vda> with the name of the installation device."
7462 #: ../fish/guestfish-actions.pod:1557
7467 #: ../fish/guestfish-actions.pod:1559
7475 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2351
7477 "This command returns up to the first 10 lines of a file as a list of strings."
7481 #: ../fish/guestfish-actions.pod:1567
7486 #: ../fish/guestfish-actions.pod:1569
7489 " head-n nrlines path\n"
7494 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2370
7496 "If the parameter C<nrlines> is a positive number, this returns the first "
7497 "C<nrlines> lines of the file C<path>."
7501 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2373
7503 "If the parameter C<nrlines> is a negative number, this returns lines from "
7504 "the file C<path>, excluding the last C<nrlines> lines."
7508 #: ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:4643
7509 #: ../src/guestfs-actions.pod:2376 ../src/guestfs-actions.pod:6991
7510 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
7514 #: ../fish/guestfish-actions.pod:1582
7519 #: ../fish/guestfish-actions.pod:1584
7527 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2393
7529 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
7530 "readable, canonical hex dump of the file."
7534 #: ../fish/guestfish-actions.pod:1592
7539 #: ../fish/guestfish-actions.pod:1594
7542 " initrd-cat initrdpath filename\n"
7547 #: ../fish/guestfish-actions.pod:1596 ../src/guestfs-actions.pod:2412
7549 "This command unpacks the file C<filename> from the initrd file called "
7550 "C<initrdpath>. The filename must be given I<without> the initial C</> "
7555 #: ../fish/guestfish-actions.pod:1600 ../src/guestfs-actions.pod:2416
7557 "For example, in guestfish you could use the following command to examine the "
7558 "boot script (usually called C</init>) contained in a Linux initrd or "
7563 #: ../fish/guestfish-actions.pod:1604 ../src/guestfs-actions.pod:2420
7566 " initrd-cat /boot/initrd-<version>.img init\n"
7571 #: ../fish/guestfish-actions.pod:1606
7572 msgid "See also L</initrd-list>."
7576 #: ../fish/guestfish-actions.pod:1611
7581 #: ../fish/guestfish-actions.pod:1613
7584 " initrd-list path\n"
7589 #: ../fish/guestfish-actions.pod:1615 ../src/guestfs-actions.pod:2439
7590 msgid "This command lists out files contained in an initrd."
7594 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2441
7596 "The files are listed without any initial C</> character. The files are "
7597 "listed in the order they appear (not necessarily alphabetical). Directory "
7598 "names are listed as separate items."
7602 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2445
7604 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
7605 "initrd. We I<only> support the newer initramfs format (compressed cpio "
7610 #: ../fish/guestfish-actions.pod:1625
7611 msgid "inotify-add-watch"
7615 #: ../fish/guestfish-actions.pod:1627
7618 " inotify-add-watch path mask\n"
7623 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2462
7624 msgid "Watch C<path> for the events listed in C<mask>."
7628 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2464
7630 "Note that if C<path> is a directory then events within that directory are "
7631 "watched, but this does I<not> happen recursively (in subdirectories)."
7635 #: ../fish/guestfish-actions.pod:1635 ../src/guestfs-actions.pod:2468
7637 "Note for non-C or non-Linux callers: the inotify events are defined by the "
7638 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
7642 #: ../fish/guestfish-actions.pod:1639
7643 msgid "inotify-close"
7647 #: ../fish/guestfish-actions.pod:1641
7655 #: ../fish/guestfish-actions.pod:1643 ../src/guestfs-actions.pod:2481
7657 "This closes the inotify handle which was previously opened by inotify_init. "
7658 "It removes all watches, throws away any pending events, and deallocates all "
7663 #: ../fish/guestfish-actions.pod:1647
7664 msgid "inotify-files"
7668 #: ../fish/guestfish-actions.pod:1649
7676 #: ../fish/guestfish-actions.pod:1651
7678 "This function is a helpful wrapper around L</inotify-read> which just "
7679 "returns a list of pathnames of objects that were touched. The returned "
7680 "pathnames are sorted and deduplicated."
7684 #: ../fish/guestfish-actions.pod:1655
7685 msgid "inotify-init"
7689 #: ../fish/guestfish-actions.pod:1657
7692 " inotify-init maxevents\n"
7697 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2510
7699 "This command creates a new inotify handle. The inotify subsystem can be "
7700 "used to notify events which happen to objects in the guest filesystem."
7704 #: ../fish/guestfish-actions.pod:1663
7706 "C<maxevents> is the maximum number of events which will be queued up between "
7707 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
7708 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
7709 "default was 16384 events. Beyond this limit, the kernel throws away events, "
7710 "but records the fact that it threw them away by setting a flag "
7711 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
7715 #: ../fish/guestfish-actions.pod:1673
7717 "Before any events are generated, you have to add some watches to the "
7718 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
7719 "L</inotify-watch-all>."
7723 #: ../fish/guestfish-actions.pod:1679
7725 "Queued up events should be read periodically by calling L</inotify-read> (or "
7726 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
7727 "If you don't read the events out often enough then you risk the internal "
7728 "queue overflowing."
7732 #: ../fish/guestfish-actions.pod:1686
7734 "The handle should be closed after use by calling L</inotify-close>. This "
7735 "also removes any watches automatically."
7739 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2541
7741 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
7742 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
7743 "that there is one global inotify handle per libguestfs instance."
7747 #: ../fish/guestfish-actions.pod:1695
7748 msgid "inotify-read"
7752 #: ../fish/guestfish-actions.pod:1697
7760 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2555
7762 "Return the complete queue of events that have happened since the previous "
7767 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2558
7768 msgid "If no events have happened, this returns an empty list."
7772 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2560
7774 "I<Note>: In order to make sure that all events have been read, you must call "
7775 "this function repeatedly until it returns an empty list. The reason is that "
7776 "the call will read events up to the maximum appliance-to-host message size "
7777 "and leave remaining events in the queue."
7781 #: ../fish/guestfish-actions.pod:1710
7782 msgid "inotify-rm-watch"
7786 #: ../fish/guestfish-actions.pod:1712
7789 " inotify-rm-watch wd\n"
7794 #: ../fish/guestfish-actions.pod:1714
7795 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
7799 #: ../fish/guestfish-actions.pod:1717
7800 msgid "inspect-get-arch"
7804 #: ../fish/guestfish-actions.pod:1719
7807 " inspect-get-arch root\n"
7812 #: ../fish/guestfish-actions.pod:1721
7814 "This returns the architecture of the inspected operating system. The "
7815 "possible return values are listed under L</file-architecture>."
7819 #: ../fish/guestfish-actions.pod:1725 ../src/guestfs-actions.pod:2595
7821 "If the architecture could not be determined, then the string C<unknown> is "
7826 #: ../fish/guestfish-actions.pod:1728 ../fish/guestfish-actions.pod:1811
7827 #: ../fish/guestfish-actions.pod:1890 ../fish/guestfish-actions.pod:1902
7828 #: ../fish/guestfish-actions.pod:1986 ../fish/guestfish-actions.pod:2047
7829 #: ../fish/guestfish-actions.pod:2068 ../fish/guestfish-actions.pod:2082
7830 #: ../fish/guestfish-actions.pod:2122 ../fish/guestfish-actions.pod:2154
7831 #: ../fish/guestfish-actions.pod:2167 ../fish/guestfish-actions.pod:2180
7832 #: ../fish/guestfish-actions.pod:2190 ../fish/guestfish-actions.pod:2200
7833 #: ../fish/guestfish-actions.pod:2212 ../fish/guestfish-actions.pod:2308
7834 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:2598
7835 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2792
7836 #: ../src/guestfs-actions.pod:2811 ../src/guestfs-actions.pod:2942
7837 #: ../src/guestfs-actions.pod:3025 ../src/guestfs-actions.pod:3053
7838 #: ../src/guestfs-actions.pod:3074 ../src/guestfs-actions.pod:3127
7839 #: ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3187
7840 #: ../src/guestfs-actions.pod:3207 ../src/guestfs-actions.pod:3224
7841 #: ../src/guestfs-actions.pod:3240 ../src/guestfs-actions.pod:3258
7842 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3401
7843 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7847 #: ../fish/guestfish-actions.pod:1730
7848 msgid "inspect-get-distro"
7852 #: ../fish/guestfish-actions.pod:1732
7855 " inspect-get-distro root\n"
7860 #: ../fish/guestfish-actions.pod:1734 ../src/guestfs-actions.pod:2611
7862 "This returns the distro (distribution) of the inspected operating system."
7866 #: ../fish/guestfish-actions.pod:1737 ../src/guestfs-actions.pod:2614
7867 msgid "Currently defined distros are:"
7871 #: ../fish/guestfish-actions.pod:1741 ../src/guestfs-actions.pod:2618
7872 msgid "\"archlinux\""
7876 #: ../fish/guestfish-actions.pod:1743 ../src/guestfs-actions.pod:2620
7881 #: ../fish/guestfish-actions.pod:1745 ../src/guestfs-actions.pod:2622
7886 #: ../fish/guestfish-actions.pod:1747 ../src/guestfs-actions.pod:2624
7891 #: ../fish/guestfish-actions.pod:1749 ../src/guestfs-actions.pod:2626
7896 #: ../fish/guestfish-actions.pod:1751 ../src/guestfs-actions.pod:2628
7901 #: ../fish/guestfish-actions.pod:1753 ../src/guestfs-actions.pod:2630
7906 #: ../fish/guestfish-actions.pod:1755 ../src/guestfs-actions.pod:2632
7911 #: ../fish/guestfish-actions.pod:1757 ../src/guestfs-actions.pod:2634
7916 #: ../fish/guestfish-actions.pod:1759 ../src/guestfs-actions.pod:2636
7921 #: ../fish/guestfish-actions.pod:1761 ../src/guestfs-actions.pod:2638
7922 msgid "\"linuxmint\""
7926 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2640
7931 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2642
7932 msgid "\"mandriva\""
7936 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2644
7941 #: ../fish/guestfish-actions.pod:1769 ../src/guestfs-actions.pod:2646
7946 #: ../fish/guestfish-actions.pod:1771 ../src/guestfs-actions.pod:2648
7951 #: ../fish/guestfish-actions.pod:1773 ../src/guestfs-actions.pod:2650
7956 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2652
7961 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2654
7962 msgid "\"redhat-based\""
7966 #: ../fish/guestfish-actions.pod:1779 ../src/guestfs-actions.pod:2656
7967 msgid "Some Red Hat-derived distro."
7971 #: ../fish/guestfish-actions.pod:1781 ../src/guestfs-actions.pod:2658
7976 #: ../fish/guestfish-actions.pod:1783 ../src/guestfs-actions.pod:2660
7977 msgid "Red Hat Enterprise Linux."
7981 #: ../fish/guestfish-actions.pod:1785 ../src/guestfs-actions.pod:2662
7982 msgid "\"scientificlinux\""
7986 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2664
7987 msgid "Scientific Linux."
7991 #: ../fish/guestfish-actions.pod:1789 ../src/guestfs-actions.pod:2666
7992 msgid "\"slackware\""
7996 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2668
8001 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2670
8006 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2672
8011 #: ../fish/guestfish-actions.pod:1797 ../fish/guestfish-actions.pod:1881
8012 #: ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:2674
8013 #: ../src/guestfs-actions.pod:2783 ../src/guestfs-actions.pod:3158
8018 #: ../fish/guestfish-actions.pod:1799 ../src/guestfs-actions.pod:2676
8019 msgid "The distro could not be determined."
8023 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:2137
8024 #: ../src/guestfs-actions.pod:2678 ../src/guestfs-actions.pod:3150
8029 #: ../fish/guestfish-actions.pod:1803 ../src/guestfs-actions.pod:2680
8031 "Windows does not have distributions. This string is returned if the OS type "
8036 #: ../fish/guestfish-actions.pod:1808 ../fish/guestfish-actions.pod:1887
8037 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:2685
8038 #: ../src/guestfs-actions.pod:2789 ../src/guestfs-actions.pod:3164
8040 "Future versions of libguestfs may return other strings here. The caller "
8041 "should be prepared to handle any string."
8045 #: ../fish/guestfish-actions.pod:1813
8046 msgid "inspect-get-drive-mappings"
8050 #: ../fish/guestfish-actions.pod:1815
8053 " inspect-get-drive-mappings root\n"
8058 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2701
8060 "This call is useful for Windows which uses a primitive system of assigning "
8061 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8062 "Windows Registry to find out how disks/partitions are mapped to drive "
8063 "letters, and returns a hash table as in the example below:"
8067 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2707
8077 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2711
8079 "Note that keys are drive letters. For Windows, the key is case insensitive "
8080 "and just contains the drive letter, without the customary colon separator "
8085 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2715
8087 "In future we may support other operating systems that also used drive "
8088 "letters, but the keys for those might not be case insensitive and might be "
8089 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8094 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2720
8096 "For Windows guests, currently only hard drive mappings are returned. "
8097 "Removable disks (eg. DVD-ROMs) are ignored."
8101 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2723
8103 "For guests that do not use drive mappings, or if the drive mappings could "
8104 "not be determined, this returns an empty hash table."
8108 #: ../fish/guestfish-actions.pod:1842
8110 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8111 "get-mountpoints>, L</inspect-get-filesystems>."
8115 #: ../fish/guestfish-actions.pod:1846
8116 msgid "inspect-get-filesystems"
8120 #: ../fish/guestfish-actions.pod:1848
8123 " inspect-get-filesystems root\n"
8128 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2744
8130 "This returns a list of all the filesystems that we think are associated with "
8131 "this operating system. This includes the root filesystem, other ordinary "
8132 "filesystems, and non-mounted devices like swap partitions."
8136 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2749
8138 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8139 "to be shared between operating systems."
8143 #: ../fish/guestfish-actions.pod:1858
8145 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8150 #: ../fish/guestfish-actions.pod:1861
8151 msgid "inspect-get-format"
8155 #: ../fish/guestfish-actions.pod:1863
8158 " inspect-get-format root\n"
8163 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2767
8165 "This returns the format of the inspected operating system. You can use it "
8166 "to detect install images, live CDs and similar."
8170 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2770
8171 msgid "Currently defined formats are:"
8175 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2774
8176 msgid "\"installed\""
8180 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2776
8181 msgid "This is an installed operating system."
8185 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2778
8186 msgid "\"installer\""
8190 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2780
8192 "The disk image being inspected is not an installed operating system, but a "
8193 "I<bootable> install disk, live CD, or similar."
8197 #: ../fish/guestfish-actions.pod:1883 ../src/guestfs-actions.pod:2785
8198 msgid "The format of this disk image is not known."
8202 #: ../fish/guestfish-actions.pod:1892
8203 msgid "inspect-get-hostname"
8207 #: ../fish/guestfish-actions.pod:1894
8210 " inspect-get-hostname root\n"
8215 #: ../fish/guestfish-actions.pod:1896 ../src/guestfs-actions.pod:2805
8217 "This function returns the hostname of the operating system as found by "
8218 "inspection of the guest's configuration files."
8222 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2808
8224 "If the hostname could not be determined, then the string C<unknown> is "
8229 #: ../fish/guestfish-actions.pod:1904
8230 msgid "inspect-get-icon"
8234 #: ../fish/guestfish-actions.pod:1906
8237 " inspect-get-icon root [favicon:..] [highquality:..]\n"
8242 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2834
8244 "This function returns an icon corresponding to the inspected operating "
8245 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
8246 "to PNG if necessary)."
8250 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2838
8252 "If it was not possible to get an icon this function returns a zero-length "
8253 "(non-NULL) buffer. I<Callers must check for this case>."
8257 #: ../fish/guestfish-actions.pod:1915 ../src/guestfs-actions.pod:2841
8259 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
8260 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
8261 "this file will be returned. You can disable favicons by passing the "
8262 "optional C<favicon> boolean as false (default is true)."
8266 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2847
8268 "If finding the favicon fails, then we look in other places in the guest for "
8273 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2850
8275 "If the optional C<highquality> boolean is true then only high quality icons "
8276 "are returned, which means only icons of high resolution with an alpha "
8277 "channel. The default (false) is to return any icon we can, even if it is of "
8278 "substandard quality."
8282 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2861
8284 "Unlike most other inspection API calls, the guest's disks must be mounted up "
8285 "before you call this, since it needs to read information from the guest "
8286 "filesystem during the call."
8290 #: ../fish/guestfish-actions.pod:1941 ../src/guestfs-actions.pod:2867
8292 "B<Security:> The icon data comes from the untrusted guest, and should be "
8293 "treated with caution. PNG files have been known to contain exploits. "
8294 "Ensure that libpng (or other relevant libraries) are fully up to date before "
8295 "trying to process or display the icon."
8299 #: ../fish/guestfish-actions.pod:1949 ../src/guestfs-actions.pod:2875
8301 "The PNG image returned can be any size. It might not be square. Libguestfs "
8302 "tries to return the largest, highest quality icon available. The "
8303 "application must scale the icon to the required size."
8307 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:2882
8309 "Extracting icons from Windows guests requires the external C<wrestool> "
8310 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
8311 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
8312 "installed separately."
8316 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2889
8318 "Operating system icons are usually trademarks. Seek legal advice before "
8319 "using trademarks in applications."
8323 #: ../fish/guestfish-actions.pod:1970
8324 msgid "inspect-get-major-version"
8328 #: ../fish/guestfish-actions.pod:1972
8331 " inspect-get-major-version root\n"
8336 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:2930
8338 "This returns the major version number of the inspected operating system."
8342 #: ../fish/guestfish-actions.pod:1977 ../src/guestfs-actions.pod:2933
8344 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8345 "popular public names used by the operating system. Notably the operating "
8346 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
8347 "1). You can find out the real versions corresponding to releases of Windows "
8348 "by consulting Wikipedia or MSDN."
8352 #: ../fish/guestfish-actions.pod:1984 ../fish/guestfish-actions.pod:1995
8353 #: ../src/guestfs-actions.pod:2940 ../src/guestfs-actions.pod:2957
8354 msgid "If the version could not be determined, then C<0> is returned."
8358 #: ../fish/guestfish-actions.pod:1988
8359 msgid "inspect-get-minor-version"
8363 #: ../fish/guestfish-actions.pod:1990
8366 " inspect-get-minor-version root\n"
8371 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:2954
8373 "This returns the minor version number of the inspected operating system."
8377 #: ../fish/guestfish-actions.pod:1997
8379 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8380 "get-major-version>."
8384 #: ../fish/guestfish-actions.pod:2000
8385 msgid "inspect-get-mountpoints"
8389 #: ../fish/guestfish-actions.pod:2002
8392 " inspect-get-mountpoints root\n"
8397 #: ../fish/guestfish-actions.pod:2004 ../src/guestfs-actions.pod:2972
8399 "This returns a hash of where we think the filesystems associated with this "
8400 "operating system should be mounted. Callers should note that this is at "
8401 "best an educated guess made by reading configuration files such as C</etc/"
8402 "fstab>. I<In particular note> that this may return filesystems which are "
8403 "non-existent or not mountable and callers should be prepared to handle or "
8404 "ignore failures if they try to mount them."
8408 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:2981
8410 "Each element in the returned hashtable has a key which is the path of the "
8411 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
8412 "mounted there (eg. C</dev/sda1>)."
8416 #: ../fish/guestfish-actions.pod:2018 ../src/guestfs-actions.pod:2986
8418 "Non-mounted devices such as swap devices are I<not> returned in this list."
8422 #: ../fish/guestfish-actions.pod:2021
8424 "For operating systems like Windows which still use drive letters, this call "
8425 "will only return an entry for the first drive \"mounted on\" C</>. For "
8426 "information about the mapping of drive letters to partitions, see L</inspect-"
8427 "get-drive-mappings>."
8431 #: ../fish/guestfish-actions.pod:2027
8433 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8438 #: ../fish/guestfish-actions.pod:2030
8439 msgid "inspect-get-package-format"
8443 #: ../fish/guestfish-actions.pod:2032
8446 " inspect-get-package-format root\n"
8451 #: ../fish/guestfish-actions.pod:2034
8453 "This function and L</inspect-get-package-management> return the package "
8454 "format and package management tool used by the inspected operating system. "
8455 "For example for Fedora these functions would return C<rpm> (package format) "
8456 "and C<yum> (package management)."
8460 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3018
8462 "This returns the string C<unknown> if we could not determine the package "
8463 "format I<or> if the operating system does not have a real packaging system "
8468 #: ../fish/guestfish-actions.pod:2044 ../src/guestfs-actions.pod:3022
8470 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
8471 "Future versions of libguestfs may return other strings."
8475 #: ../fish/guestfish-actions.pod:2049
8476 msgid "inspect-get-package-management"
8480 #: ../fish/guestfish-actions.pod:2051
8483 " inspect-get-package-management root\n"
8488 #: ../fish/guestfish-actions.pod:2053
8490 "L</inspect-get-package-format> and this function return the package format "
8491 "and package management tool used by the inspected operating system. For "
8492 "example for Fedora these functions would return C<rpm> (package format) and "
8493 "C<yum> (package management)."
8497 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3044
8499 "This returns the string C<unknown> if we could not determine the package "
8500 "management tool I<or> if the operating system does not have a real packaging "
8501 "system (eg. Windows)."
8505 #: ../fish/guestfish-actions.pod:2063 ../src/guestfs-actions.pod:3048
8507 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
8508 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
8509 "libguestfs may return other strings."
8513 #: ../fish/guestfish-actions.pod:2070
8514 msgid "inspect-get-product-name"
8518 #: ../fish/guestfish-actions.pod:2072
8521 " inspect-get-product-name root\n"
8526 #: ../fish/guestfish-actions.pod:2074 ../src/guestfs-actions.pod:3066
8528 "This returns the product name of the inspected operating system. The "
8529 "product name is generally some freeform string which can be displayed to the "
8530 "user, but should not be parsed by programs."
8534 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3071
8536 "If the product name could not be determined, then the string C<unknown> is "
8541 #: ../fish/guestfish-actions.pod:2084
8542 msgid "inspect-get-product-variant"
8546 #: ../fish/guestfish-actions.pod:2086
8549 " inspect-get-product-variant root\n"
8554 #: ../fish/guestfish-actions.pod:2088 ../src/guestfs-actions.pod:3087
8555 msgid "This returns the product variant of the inspected operating system."
8559 #: ../fish/guestfish-actions.pod:2091 ../src/guestfs-actions.pod:3090
8561 "For Windows guests, this returns the contents of the Registry key C<HKLM"
8562 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
8563 "is usually a string such as C<Client> or C<Server> (other values are "
8564 "possible). This can be used to distinguish consumer and enterprise versions "
8565 "of Windows that have the same version number (for example, Windows 7 and "
8566 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
8567 "the latter is C<Server>)."
8571 #: ../fish/guestfish-actions.pod:2100 ../src/guestfs-actions.pod:3099
8573 "For enterprise Linux guests, in future we intend this to return the product "
8574 "variant such as C<Desktop>, C<Server> and so on. But this is not "
8575 "implemented at present."
8579 #: ../fish/guestfish-actions.pod:2104 ../src/guestfs-actions.pod:3103
8581 "If the product variant could not be determined, then the string C<unknown> "
8586 #: ../fish/guestfish-actions.pod:2107
8588 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
8589 "get-product-name>, L</inspect-get-major-version>."
8593 #: ../fish/guestfish-actions.pod:2111
8594 msgid "inspect-get-roots"
8598 #: ../fish/guestfish-actions.pod:2113
8601 " inspect-get-roots\n"
8606 #: ../fish/guestfish-actions.pod:2115
8608 "This function is a convenient way to get the list of root devices, as "
8609 "returned from a previous call to L</inspect-os>, but without redoing the "
8610 "whole inspection process."
8614 #: ../fish/guestfish-actions.pod:2119
8616 "This returns an empty list if either no root devices were found or the "
8617 "caller has not called L</inspect-os>."
8621 #: ../fish/guestfish-actions.pod:2124
8622 msgid "inspect-get-type"
8626 #: ../fish/guestfish-actions.pod:2126
8629 " inspect-get-type root\n"
8634 #: ../fish/guestfish-actions.pod:2128 ../src/guestfs-actions.pod:3141
8636 "This returns the type of the inspected operating system. Currently defined "
8641 #: ../fish/guestfish-actions.pod:2133 ../src/guestfs-actions.pod:3146
8646 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3148
8647 msgid "Any Linux-based operating system."
8651 #: ../fish/guestfish-actions.pod:2139 ../src/guestfs-actions.pod:3152
8652 msgid "Any Microsoft Windows operating system."
8656 #: ../fish/guestfish-actions.pod:2141 ../src/guestfs-actions.pod:3154
8661 #: ../fish/guestfish-actions.pod:2143 ../src/guestfs-actions.pod:3156
8666 #: ../fish/guestfish-actions.pod:2147 ../src/guestfs-actions.pod:3160
8667 msgid "The operating system type could not be determined."
8671 #: ../fish/guestfish-actions.pod:2156
8672 msgid "inspect-get-windows-current-control-set"
8676 #: ../fish/guestfish-actions.pod:2158
8679 " inspect-get-windows-current-control-set root\n"
8684 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3180
8686 "This returns the Windows CurrentControlSet of the inspected guest. The "
8687 "CurrentControlSet is a registry key name such as C<ControlSet001>."
8691 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3183
8693 "This call assumes that the guest is Windows and that the Registry could be "
8694 "examined by inspection. If this is not the case then an error is returned."
8698 #: ../fish/guestfish-actions.pod:2169
8699 msgid "inspect-get-windows-systemroot"
8703 #: ../fish/guestfish-actions.pod:2171
8706 " inspect-get-windows-systemroot root\n"
8711 #: ../fish/guestfish-actions.pod:2173 ../src/guestfs-actions.pod:3200
8713 "This returns the Windows systemroot of the inspected guest. The systemroot "
8714 "is a directory path such as C</WINDOWS>."
8718 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3203
8720 "This call assumes that the guest is Windows and that the systemroot could be "
8721 "determined by inspection. If this is not the case then an error is returned."
8725 #: ../fish/guestfish-actions.pod:2182
8726 msgid "inspect-is-live"
8730 #: ../fish/guestfish-actions.pod:2184
8733 " inspect-is-live root\n"
8738 #: ../fish/guestfish-actions.pod:2186
8740 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8741 "then this returns true if a live image was detected on the disk."
8745 #: ../fish/guestfish-actions.pod:2192
8746 msgid "inspect-is-multipart"
8750 #: ../fish/guestfish-actions.pod:2194
8753 " inspect-is-multipart root\n"
8758 #: ../fish/guestfish-actions.pod:2196
8760 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8761 "then this returns true if the disk is part of a set."
8765 #: ../fish/guestfish-actions.pod:2202
8766 msgid "inspect-is-netinst"
8770 #: ../fish/guestfish-actions.pod:2204
8773 " inspect-is-netinst root\n"
8778 #: ../fish/guestfish-actions.pod:2206
8780 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
8781 "then this returns true if the disk is a network installer, ie. not a self-"
8782 "contained install CD but one which is likely to require network access to "
8783 "complete the install."
8787 #: ../fish/guestfish-actions.pod:2214
8788 msgid "inspect-list-applications"
8792 #: ../fish/guestfish-actions.pod:2216
8795 " inspect-list-applications root\n"
8800 #: ../fish/guestfish-actions.pod:2218 ../src/guestfs-actions.pod:3270
8801 msgid "Return the list of applications installed in the operating system."
8805 #: ../fish/guestfish-actions.pod:2220
8807 "I<Note:> This call works differently from other parts of the inspection "
8808 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
8809 "then mount up the disks, before calling this. Listing applications is a "
8810 "significantly more difficult operation which requires access to the full "
8811 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
8812 "are just returning data cached in the libguestfs handle, this call actually "
8813 "reads parts of the mounted filesystems during the call."
8817 #: ../fish/guestfish-actions.pod:2230 ../src/guestfs-actions.pod:3282
8819 "This returns an empty list if the inspection code was not able to determine "
8820 "the list of applications."
8824 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3285
8825 msgid "The application structure contains the following fields:"
8829 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3289
8834 #: ../fish/guestfish-actions.pod:2239 ../src/guestfs-actions.pod:3291
8836 "The name of the application. For Red Hat-derived and Debian-derived Linux "
8837 "guests, this is the package name."
8841 #: ../fish/guestfish-actions.pod:2242 ../src/guestfs-actions.pod:3294
8842 msgid "C<app_display_name>"
8846 #: ../fish/guestfish-actions.pod:2244 ../src/guestfs-actions.pod:3296
8848 "The display name of the application, sometimes localized to the install "
8849 "language of the guest operating system."
8853 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3299
8855 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
8856 "to display something can use C<app_name> instead."
8860 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3302
8861 msgid "C<app_epoch>"
8865 #: ../fish/guestfish-actions.pod:2252 ../src/guestfs-actions.pod:3304
8867 "For package managers which use epochs, this contains the epoch of the "
8868 "package (an integer). If unavailable, this is returned as C<0>."
8872 #: ../fish/guestfish-actions.pod:2255 ../src/guestfs-actions.pod:3307
8873 msgid "C<app_version>"
8877 #: ../fish/guestfish-actions.pod:2257 ../src/guestfs-actions.pod:3309
8879 "The version string of the application or package. If unavailable this is "
8880 "returned as an empty string C<\"\">."
8884 #: ../fish/guestfish-actions.pod:2260 ../src/guestfs-actions.pod:3312
8885 msgid "C<app_release>"
8889 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3314
8891 "The release string of the application or package, for package managers that "
8892 "use this. If unavailable this is returned as an empty string C<\"\">."
8896 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3318
8897 msgid "C<app_install_path>"
8901 #: ../fish/guestfish-actions.pod:2268 ../src/guestfs-actions.pod:3320
8903 "The installation path of the application (on operating systems such as "
8904 "Windows which use installation paths). This path is in the format used by "
8905 "the guest operating system, it is not a libguestfs path."
8909 #: ../fish/guestfish-actions.pod:2273 ../src/guestfs-actions.pod:3325
8910 msgid "If unavailable this is returned as an empty string C<\"\">."
8914 #: ../fish/guestfish-actions.pod:2275 ../src/guestfs-actions.pod:3327
8915 msgid "C<app_trans_path>"
8919 #: ../fish/guestfish-actions.pod:2277 ../src/guestfs-actions.pod:3329
8921 "The install path translated into a libguestfs path. If unavailable this is "
8922 "returned as an empty string C<\"\">."
8926 #: ../fish/guestfish-actions.pod:2280 ../src/guestfs-actions.pod:3332
8927 msgid "C<app_publisher>"
8931 #: ../fish/guestfish-actions.pod:2282 ../src/guestfs-actions.pod:3334
8933 "The name of the publisher of the application, for package managers that use "
8934 "this. If unavailable this is returned as an empty string C<\"\">."
8938 #: ../fish/guestfish-actions.pod:2286 ../src/guestfs-actions.pod:3338
8943 #: ../fish/guestfish-actions.pod:2288 ../src/guestfs-actions.pod:3340
8945 "The URL (eg. upstream URL) of the application. If unavailable this is "
8946 "returned as an empty string C<\"\">."
8950 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3343
8951 msgid "C<app_source_package>"
8955 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3345
8957 "For packaging systems which support this, the name of the source package. "
8958 "If unavailable this is returned as an empty string C<\"\">."
8962 #: ../fish/guestfish-actions.pod:2296 ../src/guestfs-actions.pod:3348
8963 msgid "C<app_summary>"
8967 #: ../fish/guestfish-actions.pod:2298 ../src/guestfs-actions.pod:3350
8969 "A short (usually one line) description of the application or package. If "
8970 "unavailable this is returned as an empty string C<\"\">."
8974 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3353
8975 msgid "C<app_description>"
8979 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3355
8981 "A longer description of the application or package. If unavailable this is "
8982 "returned as an empty string C<\"\">."
8986 #: ../fish/guestfish-actions.pod:2310
8991 #: ../fish/guestfish-actions.pod:2312
8999 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3373
9001 "This function uses other libguestfs functions and certain heuristics to "
9002 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9003 "for operating systems."
9007 #: ../fish/guestfish-actions.pod:2318 ../src/guestfs-actions.pod:3377
9008 msgid "The list returned is empty if no operating systems were found."
9012 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3379
9014 "If one operating system was found, then this returns a list with a single "
9015 "element, which is the name of the root filesystem of this operating system. "
9016 "It is also possible for this function to return a list containing more than "
9017 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9018 "element being the root filesystem of one of the operating systems."
9022 #: ../fish/guestfish-actions.pod:2327
9024 "You can pass the root string(s) returned to other L</inspect-get-*> "
9025 "functions in order to query further information about each operating system, "
9026 "such as the name and version."
9030 #: ../fish/guestfish-actions.pod:2332
9032 "This function uses other libguestfs features such as L</mount-ro> and L</"
9033 "umount-all> in order to mount and unmount filesystems and look at the "
9034 "contents. This should be called with no disks currently mounted. The "
9035 "function may also use Augeas, so any existing Augeas handle will be closed."
9039 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3397
9041 "This function cannot decrypt encrypted disks. The caller must do that first "
9042 "(supplying the necessary keys) if the disk is encrypted."
9046 #: ../fish/guestfish-actions.pod:2344 ../fish/guestfish-actions.pod:2542
9047 #: ../fish/guestfish-actions.pod:2601
9048 msgid "See also L</list-filesystems>."
9052 #: ../fish/guestfish-actions.pod:2346
9057 #: ../fish/guestfish-actions.pod:2348
9060 " is-blockdev path\n"
9065 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3417
9067 "This returns C<true> if and only if there is a block device with the given "
9072 #: ../fish/guestfish-actions.pod:2353 ../fish/guestfish-actions.pod:2371
9073 #: ../fish/guestfish-actions.pod:2390 ../fish/guestfish-actions.pod:2399
9074 #: ../fish/guestfish-actions.pod:2409 ../fish/guestfish-actions.pod:2443
9075 #: ../fish/guestfish-actions.pod:2452
9076 msgid "See also L</stat>."
9080 #: ../fish/guestfish-actions.pod:2355
9085 #: ../fish/guestfish-actions.pod:2357
9093 #: ../fish/guestfish-actions.pod:2359 ../src/guestfs-actions.pod:3431
9095 "This returns true iff this handle is busy processing a command (in the "
9100 #: ../fish/guestfish-actions.pod:2364
9105 #: ../fish/guestfish-actions.pod:2366
9108 " is-chardev path\n"
9113 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3446
9115 "This returns C<true> if and only if there is a character device with the "
9116 "given C<path> name."
9120 #: ../fish/guestfish-actions.pod:2373
9125 #: ../fish/guestfish-actions.pod:2375
9133 #: ../fish/guestfish-actions.pod:2377 ../src/guestfs-actions.pod:3460
9135 "This returns true iff this handle is being configured (in the C<CONFIG> "
9140 #: ../fish/guestfish-actions.pod:2382
9145 #: ../fish/guestfish-actions.pod:2384
9153 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3475
9155 "This returns C<true> if and only if there is a directory with the given "
9156 "C<path> name. Note that it returns false for other objects like files."
9160 #: ../fish/guestfish-actions.pod:2392
9165 #: ../fish/guestfish-actions.pod:2394
9173 #: ../fish/guestfish-actions.pod:2396 ../src/guestfs-actions.pod:3491
9175 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9176 "given C<path> name."
9180 #: ../fish/guestfish-actions.pod:2401
9185 #: ../fish/guestfish-actions.pod:2403
9193 #: ../fish/guestfish-actions.pod:2405 ../src/guestfs-actions.pod:3506
9195 "This returns C<true> if and only if there is a regular file with the given "
9196 "C<path> name. Note that it returns false for other objects like directories."
9200 #: ../fish/guestfish-actions.pod:2411
9201 msgid "is-launching"
9205 #: ../fish/guestfish-actions.pod:2413
9213 #: ../fish/guestfish-actions.pod:2415 ../src/guestfs-actions.pod:3521
9215 "This returns true iff this handle is launching the subprocess (in the "
9216 "C<LAUNCHING> state)."
9220 #: ../fish/guestfish-actions.pod:2420
9225 #: ../fish/guestfish-actions.pod:2422
9233 #: ../fish/guestfish-actions.pod:2424 ../src/guestfs-actions.pod:3536
9235 "This command tests whether C<device> is a logical volume, and returns true "
9236 "iff this is the case."
9240 #: ../fish/guestfish-actions.pod:2427
9245 #: ../fish/guestfish-actions.pod:2429
9253 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3548
9255 "This returns true iff this handle is ready to accept commands (in the "
9260 #: ../fish/guestfish-actions.pod:2436
9265 #: ../fish/guestfish-actions.pod:2438
9273 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3563
9275 "This returns C<true> if and only if there is a Unix domain socket with the "
9276 "given C<path> name."
9280 #: ../fish/guestfish-actions.pod:2445
9285 #: ../fish/guestfish-actions.pod:2447
9288 " is-symlink path\n"
9293 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3578
9295 "This returns C<true> if and only if there is a symbolic link with the given "
9300 #: ../fish/guestfish-actions.pod:2454
9305 #: ../fish/guestfish-actions.pod:2456
9313 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3593
9315 "This returns true iff the file exists and the file is empty or it contains "
9320 #: ../fish/guestfish-actions.pod:2461
9321 msgid "is-zero-device"
9325 #: ../fish/guestfish-actions.pod:2463
9328 " is-zero-device device\n"
9333 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3606
9334 msgid "This returns true iff the device exists and contains all zero bytes."
9338 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3608
9339 msgid "Note that for large devices this can take a long time to run."
9343 #: ../fish/guestfish-actions.pod:2469
9344 msgid "kill-subprocess"
9348 #: ../fish/guestfish-actions.pod:2471
9351 " kill-subprocess\n"
9356 #: ../fish/guestfish-actions.pod:2473 ../src/guestfs-actions.pod:3619
9357 msgid "This kills the qemu subprocess. You should never need to call this."
9361 #: ../fish/guestfish-actions.pod:2475
9366 #: ../fish/guestfish-actions.pod:2477
9371 #: ../fish/guestfish-actions.pod:2479
9379 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3630
9381 "Internally libguestfs is implemented by running a virtual machine using "
9386 #: ../fish/guestfish-actions.pod:2484 ../src/guestfs-actions.pod:3633
9388 "You should call this after configuring the handle (eg. adding drives) but "
9389 "before performing any actions."
9393 #: ../fish/guestfish-actions.pod:2487
9398 #: ../fish/guestfish-actions.pod:2489
9401 " lchown owner group path\n"
9406 #: ../fish/guestfish-actions.pod:2491
9408 "Change the file owner to C<owner> and group to C<group>. This is like L</"
9409 "chown> but if C<path> is a symlink then the link itself is changed, not the "
9414 #: ../fish/guestfish-actions.pod:2499
9419 #: ../fish/guestfish-actions.pod:2501
9422 " lgetxattr path name\n"
9427 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3673
9429 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
9430 "is a symlink, then this call returns an extended attribute from the symlink."
9434 #: ../fish/guestfish-actions.pod:2517
9435 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
9439 #: ../fish/guestfish-actions.pod:2519
9444 #: ../fish/guestfish-actions.pod:2521
9447 " lgetxattrs path\n"
9452 #: ../fish/guestfish-actions.pod:2523
9454 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
9455 "it returns the extended attributes of the link itself."
9459 #: ../fish/guestfish-actions.pod:2527
9464 #: ../fish/guestfish-actions.pod:2529
9472 #: ../fish/guestfish-actions.pod:2531 ../src/guestfs-actions.pod:3716
9474 "List all 9p filesystems attached to the guest. A list of mount tags is "
9479 #: ../fish/guestfish-actions.pod:2534
9480 msgid "list-devices"
9484 #: ../fish/guestfish-actions.pod:2536
9492 #: ../fish/guestfish-actions.pod:2538 ../src/guestfs-actions.pod:3730
9493 msgid "List all the block devices."
9497 #: ../fish/guestfish-actions.pod:2540 ../src/guestfs-actions.pod:3732
9498 msgid "The full block device names are returned, eg. C</dev/sda>."
9502 #: ../fish/guestfish-actions.pod:2544
9503 msgid "list-dm-devices"
9507 #: ../fish/guestfish-actions.pod:2546
9510 " list-dm-devices\n"
9515 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3747
9516 msgid "List all device mapper devices."
9520 #: ../fish/guestfish-actions.pod:2550
9522 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
9523 "previous call to L</luks-open>."
9527 #: ../fish/guestfish-actions.pod:2553
9529 "Device mapper devices which correspond to logical volumes are I<not> "
9530 "returned in this list. Call L</lvs> if you want to list logical volumes."
9534 #: ../fish/guestfish-actions.pod:2557
9535 msgid "list-filesystems"
9539 #: ../fish/guestfish-actions.pod:2559
9542 " list-filesystems\n"
9547 #: ../fish/guestfish-actions.pod:2561 ../src/guestfs-actions.pod:3767
9549 "This inspection command looks for filesystems on partitions, block devices "
9550 "and logical volumes, returning a list of devices containing filesystems and "
9555 #: ../fish/guestfish-actions.pod:2565 ../src/guestfs-actions.pod:3771
9557 "The return value is a hash, where the keys are the devices containing "
9558 "filesystems, and the values are the filesystem types. For example:"
9562 #: ../fish/guestfish-actions.pod:2569 ../src/guestfs-actions.pod:3775
9565 " \"/dev/sda1\" => \"ntfs\"\n"
9566 " \"/dev/sda2\" => \"ext2\"\n"
9567 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
9568 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
9573 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3780
9575 "The value can have the special value \"unknown\", meaning the content of the "
9576 "device is undetermined or empty. \"swap\" means a Linux swap partition."
9580 #: ../fish/guestfish-actions.pod:2578
9582 "This command runs other libguestfs commands, which might include L</mount> "
9583 "and L</umount>, and therefore you should use this soon after launch and only "
9584 "when nothing is mounted."
9588 #: ../fish/guestfish-actions.pod:2582
9590 "Not all of the filesystems returned will be mountable. In particular, swap "
9591 "partitions are returned in the list. Also this command does not check that "
9592 "each filesystem found is valid and mountable, and some filesystems might be "
9593 "mountable but require special options. Filesystems may not all belong to a "
9594 "single logical operating system (use L</inspect-os> to look for OSes)."
9598 #: ../fish/guestfish-actions.pod:2590
9599 msgid "list-partitions"
9603 #: ../fish/guestfish-actions.pod:2592
9606 " list-partitions\n"
9611 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3809
9612 msgid "List all the partitions detected on all block devices."
9616 #: ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:3811
9617 msgid "The full partition device names are returned, eg. C</dev/sda1>"
9621 #: ../fish/guestfish-actions.pod:2598
9623 "This does not return logical volumes. For that you will need to call L</"
9628 #: ../fish/guestfish-actions.pod:2603
9633 #: ../fish/guestfish-actions.pod:2605
9641 #: ../fish/guestfish-actions.pod:2607 ../src/guestfs-actions.pod:3830
9643 "List the files in C<directory> (relative to the root directory, there is no "
9644 "cwd) in the format of 'ls -la'."
9648 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3833
9650 "This command is mostly useful for interactive sessions. It is I<not> "
9651 "intended that you try to parse the output string."
9655 #: ../fish/guestfish-actions.pod:2613
9660 #: ../fish/guestfish-actions.pod:2615
9663 " ln target linkname\n"
9668 #: ../fish/guestfish-actions.pod:2617 ../src/guestfs-actions.pod:3848
9669 msgid "This command creates a hard link using the C<ln> command."
9673 #: ../fish/guestfish-actions.pod:2619
9678 #: ../fish/guestfish-actions.pod:2621
9681 " ln-f target linkname\n"
9686 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3861
9688 "This command creates a hard link using the C<ln -f> command. The I<-f> "
9689 "option removes the link (C<linkname>) if it exists already."
9693 #: ../fish/guestfish-actions.pod:2626
9698 #: ../fish/guestfish-actions.pod:2628
9701 " ln-s target linkname\n"
9706 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3875
9707 msgid "This command creates a symbolic link using the C<ln -s> command."
9711 #: ../fish/guestfish-actions.pod:2632
9716 #: ../fish/guestfish-actions.pod:2634
9719 " ln-sf target linkname\n"
9724 #: ../fish/guestfish-actions.pod:2636 ../src/guestfs-actions.pod:3888
9726 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
9727 "option removes the link (C<linkname>) if it exists already."
9731 #: ../fish/guestfish-actions.pod:2639
9732 msgid "lremovexattr"
9736 #: ../fish/guestfish-actions.pod:2641
9739 " lremovexattr xattr path\n"
9744 #: ../fish/guestfish-actions.pod:2643
9746 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
9747 "it removes an extended attribute of the link itself."
9751 #: ../fish/guestfish-actions.pod:2647
9756 #: ../fish/guestfish-actions.pod:2649
9764 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3916
9766 "List the files in C<directory> (relative to the root directory, there is no "
9767 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
9771 #: ../fish/guestfish-actions.pod:2655
9773 "This command is mostly useful for interactive sessions. Programs should "
9774 "probably use L</readdir> instead."
9778 #: ../fish/guestfish-actions.pod:2658
9783 #: ../fish/guestfish-actions.pod:2660
9786 " lsetxattr xattr val vallen path\n"
9791 #: ../fish/guestfish-actions.pod:2662
9793 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
9794 "sets an extended attribute of the link itself."
9798 #: ../fish/guestfish-actions.pod:2666
9803 #: ../fish/guestfish-actions.pod:2668
9811 #: ../fish/guestfish-actions.pod:2670 ../fish/guestfish-actions.pod:4478
9812 #: ../src/guestfs-actions.pod:3952 ../src/guestfs-actions.pod:6731
9813 msgid "Returns file information for the given C<path>."
9817 #: ../fish/guestfish-actions.pod:2672
9819 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
9820 "the link is stat-ed, not the file it refers to."
9824 #: ../fish/guestfish-actions.pod:2676 ../src/guestfs-actions.pod:3958
9825 msgid "This is the same as the C<lstat(2)> system call."
9829 #: ../fish/guestfish-actions.pod:2678
9834 #: ../fish/guestfish-actions.pod:2680
9837 " lstatlist path 'names ...'\n"
9842 #: ../fish/guestfish-actions.pod:2682
9844 "This call allows you to perform the L</lstat> operation on multiple files, "
9845 "where all files are in the directory C<path>. C<names> is the list of files "
9846 "from this directory."
9850 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3977
9852 "On return you get a list of stat structs, with a one-to-one correspondence "
9853 "to the C<names> list. If any name did not exist or could not be lstat'd, "
9854 "then the C<ino> field of that structure is set to C<-1>."
9858 #: ../fish/guestfish-actions.pod:2691
9860 "This call is intended for programs that want to efficiently list a directory "
9861 "contents without making many round-trips. See also L</lxattrlist> for a "
9862 "similarly efficient call for getting extended attributes. Very long "
9863 "directory listings might cause the protocol message size to be exceeded, "
9864 "causing this call to fail. The caller must split up such requests into "
9865 "smaller groups of names."
9869 #: ../fish/guestfish-actions.pod:2699
9870 msgid "luks-add-key"
9874 #: ../fish/guestfish-actions.pod:2701
9877 " luks-add-key device keyslot\n"
9882 #: ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:4005
9884 "This command adds a new key on LUKS device C<device>. C<key> is any "
9885 "existing key, and is used to access the device. C<newkey> is the new key to "
9886 "add. C<keyslot> is the key slot that will be replaced."
9890 #: ../fish/guestfish-actions.pod:2708
9892 "Note that if C<keyslot> already contains a key, then this command will "
9893 "fail. You have to use L</luks-kill-slot> first to remove that key."
9897 #: ../fish/guestfish-actions.pod:2712 ../fish/guestfish-actions.pod:2734
9898 #: ../fish/guestfish-actions.pod:2747 ../fish/guestfish-actions.pod:2761
9899 #: ../fish/guestfish-actions.pod:2787 ../fish/guestfish-actions.pod:2797
9901 "This command has one or more key or passphrase parameters. Guestfish will "
9902 "prompt for these separately."
9906 #: ../fish/guestfish-actions.pod:2715
9911 #: ../fish/guestfish-actions.pod:2717
9914 " luks-close device\n"
9919 #: ../fish/guestfish-actions.pod:2719
9921 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
9922 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
9923 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
9928 #: ../fish/guestfish-actions.pod:2725
9933 #: ../fish/guestfish-actions.pod:2727
9936 " luks-format device keyslot\n"
9941 #: ../fish/guestfish-actions.pod:2729 ../src/guestfs-actions.pod:4046
9943 "This command erases existing data on C<device> and formats the device as a "
9944 "LUKS encrypted device. C<key> is the initial key, which is added to key "
9945 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
9949 #: ../fish/guestfish-actions.pod:2737 ../fish/guestfish-actions.pod:2750
9950 #: ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:3498
9951 #: ../fish/guestfish-actions.pod:4024 ../fish/guestfish-actions.pod:4349
9952 #: ../fish/guestfish-actions.pod:4372 ../fish/guestfish-actions.pod:4394
9953 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:4053
9954 #: ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4219
9955 #: ../src/guestfs-actions.pod:5322 ../src/guestfs-actions.pod:6110
9956 #: ../src/guestfs-actions.pod:6545 ../src/guestfs-actions.pod:6575
9957 #: ../src/guestfs-actions.pod:6608 ../src/guestfs-actions.pod:7799
9959 "B<This command is dangerous. Without careful use you can easily destroy all "
9964 #: ../fish/guestfish-actions.pod:2740
9965 msgid "luks-format-cipher"
9969 #: ../fish/guestfish-actions.pod:2742
9972 " luks-format-cipher device keyslot cipher\n"
9977 #: ../fish/guestfish-actions.pod:2744
9979 "This command is the same as L</luks-format> but it also allows you to set "
9980 "the C<cipher> used."
9984 #: ../fish/guestfish-actions.pod:2753
9985 msgid "luks-kill-slot"
9989 #: ../fish/guestfish-actions.pod:2755
9992 " luks-kill-slot device keyslot\n"
9997 #: ../fish/guestfish-actions.pod:2757 ../src/guestfs-actions.pod:4093
9999 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10000 "device C<device>. C<key> must be one of the I<other> keys."
10004 #: ../fish/guestfish-actions.pod:2764
10009 #: ../fish/guestfish-actions.pod:2766
10012 " luks-open device mapname\n"
10017 #: ../fish/guestfish-actions.pod:2768 ../src/guestfs-actions.pod:4113
10019 "This command opens a block device which has been encrypted according to the "
10020 "Linux Unified Key Setup (LUKS) standard."
10024 #: ../fish/guestfish-actions.pod:2771 ../src/guestfs-actions.pod:4116
10025 msgid "C<device> is the encrypted block device or partition."
10029 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4118
10031 "The caller must supply one of the keys associated with the LUKS block "
10032 "device, in the C<key> parameter."
10036 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4121
10038 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10039 "writes to this block device are decrypted from and encrypted to the "
10040 "underlying C<device> respectively."
10044 #: ../fish/guestfish-actions.pod:2780
10046 "If this block device contains LVM volume groups, then calling L</vgscan> "
10047 "followed by L</vg-activate-all> will make them visible."
10051 #: ../fish/guestfish-actions.pod:2784
10052 msgid "Use L</list-dm-devices> to list all device mapper devices."
10056 #: ../fish/guestfish-actions.pod:2790
10057 msgid "luks-open-ro"
10061 #: ../fish/guestfish-actions.pod:2792
10064 " luks-open-ro device mapname\n"
10069 #: ../fish/guestfish-actions.pod:2794
10071 "This is the same as L</luks-open> except that a read-only mapping is created."
10075 #: ../fish/guestfish-actions.pod:2800
10080 #: ../fish/guestfish-actions.pod:2802
10083 " lvcreate logvol volgroup mbytes\n"
10088 #: ../fish/guestfish-actions.pod:2804 ../src/guestfs-actions.pod:4167
10090 "This creates an LVM logical volume called C<logvol> on the volume group "
10091 "C<volgroup>, with C<size> megabytes."
10095 #: ../fish/guestfish-actions.pod:2807
10096 msgid "lvm-canonical-lv-name"
10100 #: ../fish/guestfish-actions.pod:2809
10103 " lvm-canonical-lv-name lvname\n"
10108 #: ../fish/guestfish-actions.pod:2811 ../src/guestfs-actions.pod:4180
10110 "This converts alternative naming schemes for LVs that you might find to the "
10111 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10116 #: ../fish/guestfish-actions.pod:2815 ../src/guestfs-actions.pod:4184
10118 "This command returns an error if the C<lvname> parameter does not refer to a "
10123 #: ../fish/guestfish-actions.pod:2818
10124 msgid "See also L</is-lv>."
10128 #: ../fish/guestfish-actions.pod:2820
10129 msgid "lvm-clear-filter"
10133 #: ../fish/guestfish-actions.pod:2822
10136 " lvm-clear-filter\n"
10141 #: ../fish/guestfish-actions.pod:2824
10143 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
10148 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2858
10149 #: ../src/guestfs-actions.pod:4202 ../src/guestfs-actions.pod:4244
10151 "This command also clears the LVM cache and performs a volume group scan."
10155 #: ../fish/guestfish-actions.pod:2830
10156 msgid "lvm-remove-all"
10160 #: ../fish/guestfish-actions.pod:2832
10163 " lvm-remove-all\n"
10168 #: ../fish/guestfish-actions.pod:2834 ../src/guestfs-actions.pod:4214
10170 "This command removes all LVM logical volumes, volume groups and physical "
10175 #: ../fish/guestfish-actions.pod:2840
10176 msgid "lvm-set-filter"
10180 #: ../fish/guestfish-actions.pod:2842
10183 " lvm-set-filter 'devices ...'\n"
10188 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4230
10190 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10191 "block devices in the list C<devices>, and will ignore all other attached "
10196 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4234
10198 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10199 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10200 "there are two types of duplication possible: either cloned PVs/VGs which "
10201 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10202 "same name. In normal operation you cannot create this situation, but you "
10203 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10204 "inside the LVM metadata."
10208 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4247
10209 msgid "You can filter whole block devices or individual partitions."
10213 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4249
10215 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10216 "filesystem), even if you are not filtering out that VG."
10220 #: ../fish/guestfish-actions.pod:2867
10225 #: ../fish/guestfish-actions.pod:2869
10228 " lvremove device\n"
10233 #: ../fish/guestfish-actions.pod:2871 ../src/guestfs-actions.pod:4263
10235 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10236 "LV, such as C</dev/VG/LV>."
10240 #: ../fish/guestfish-actions.pod:2874 ../src/guestfs-actions.pod:4266
10242 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10247 #: ../fish/guestfish-actions.pod:2877
10252 #: ../fish/guestfish-actions.pod:2879
10255 " lvrename logvol newlogvol\n"
10260 #: ../fish/guestfish-actions.pod:2881 ../src/guestfs-actions.pod:4280
10261 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10265 #: ../fish/guestfish-actions.pod:2883
10270 #: ../fish/guestfish-actions.pod:2885
10273 " lvresize device mbytes\n"
10278 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4293
10280 "This resizes (expands or shrinks) an existing LVM logical volume to "
10281 "C<mbytes>. When reducing, data in the reduced part is lost."
10285 #: ../fish/guestfish-actions.pod:2891
10286 msgid "lvresize-free"
10290 #: ../fish/guestfish-actions.pod:2893
10293 " lvresize-free lv percent\n"
10298 #: ../fish/guestfish-actions.pod:2895 ../src/guestfs-actions.pod:4308
10300 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10301 "remaining free space in the volume group. Commonly you would call this with "
10302 "pc = 100 which expands the logical volume as much as possible, using all "
10303 "remaining free space in the volume group."
10307 #: ../fish/guestfish-actions.pod:2901
10312 #: ../fish/guestfish-actions.pod:2903
10320 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4323
10322 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10327 #: ../fish/guestfish-actions.pod:2908 ../src/guestfs-actions.pod:4326
10329 "This returns a list of the logical volume device names (eg. C</dev/"
10330 "VolGroup00/LogVol00>)."
10334 #: ../fish/guestfish-actions.pod:2911
10335 msgid "See also L</lvs-full>, L</list-filesystems>."
10339 #: ../fish/guestfish-actions.pod:2913
10344 #: ../fish/guestfish-actions.pod:2915
10352 #: ../fish/guestfish-actions.pod:2917 ../src/guestfs-actions.pod:4342
10354 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10355 "(8)> command. The \"full\" version includes all fields."
10359 #: ../fish/guestfish-actions.pod:2920
10364 #: ../fish/guestfish-actions.pod:2922
10372 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4357
10373 msgid "This command returns the UUID of the LVM LV C<device>."
10377 #: ../fish/guestfish-actions.pod:2926
10382 #: ../fish/guestfish-actions.pod:2928
10385 " lxattrlist path 'names ...'\n"
10390 #: ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4371
10392 "This call allows you to get the extended attributes of multiple files, where "
10393 "all files are in the directory C<path>. C<names> is the list of files from "
10398 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4375
10400 "On return you get a flat list of xattr structs which must be interpreted "
10401 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
10402 "C<attrval> in this struct is zero-length to indicate there was an error "
10403 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
10404 "number (the number of following attributes for this file, which could be C<"
10405 "\"0\">). Then after the first xattr struct are the zero or more attributes "
10406 "for the first named file. This repeats for the second and subsequent files."
10410 #: ../fish/guestfish-actions.pod:2944
10412 "This call is intended for programs that want to efficiently list a directory "
10413 "contents without making many round-trips. See also L</lstatlist> for a "
10414 "similarly efficient call for getting standard stats. Very long directory "
10415 "listings might cause the protocol message size to be exceeded, causing this "
10416 "call to fail. The caller must split up such requests into smaller groups of "
10421 #: ../fish/guestfish-actions.pod:2952
10426 #: ../fish/guestfish-actions.pod:2954
10434 #: ../fish/guestfish-actions.pod:2956 ../src/guestfs-actions.pod:4405
10435 msgid "Create a directory named C<path>."
10439 #: ../fish/guestfish-actions.pod:2958
10444 #: ../fish/guestfish-actions.pod:2960
10447 " mkdir-mode path mode\n"
10452 #: ../fish/guestfish-actions.pod:2962 ../src/guestfs-actions.pod:4418
10454 "This command creates a directory, setting the initial permissions of the "
10455 "directory to C<mode>."
10459 #: ../fish/guestfish-actions.pod:2965 ../src/guestfs-actions.pod:4421
10461 "For common Linux filesystems, the actual mode which is set will be C<mode & "
10462 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
10467 #: ../fish/guestfish-actions.pod:2969
10468 msgid "See also L</mkdir>, L</umask>"
10472 #: ../fish/guestfish-actions.pod:2971
10477 #: ../fish/guestfish-actions.pod:2973
10485 #: ../fish/guestfish-actions.pod:2975 ../src/guestfs-actions.pod:4437
10487 "Create a directory named C<path>, creating any parent directories as "
10488 "necessary. This is like the C<mkdir -p> shell command."
10492 #: ../fish/guestfish-actions.pod:2978
10497 #: ../fish/guestfish-actions.pod:2980
10500 " mkdtemp template\n"
10505 #: ../fish/guestfish-actions.pod:2982 ../src/guestfs-actions.pod:4450
10507 "This command creates a temporary directory. The C<template> parameter "
10508 "should be a full pathname for the temporary directory name with the final "
10509 "six characters being \"XXXXXX\"."
10513 #: ../fish/guestfish-actions.pod:2987 ../src/guestfs-actions.pod:4455
10515 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
10516 "being suitable for Windows filesystems."
10520 #: ../fish/guestfish-actions.pod:2990 ../src/guestfs-actions.pod:4458
10521 msgid "The name of the temporary directory that was created is returned."
10525 #: ../fish/guestfish-actions.pod:2993 ../src/guestfs-actions.pod:4461
10526 msgid "The temporary directory is created with mode 0700 and is owned by root."
10530 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4464
10532 "The caller is responsible for deleting the temporary directory and its "
10533 "contents after use."
10537 #: ../fish/guestfish-actions.pod:2999 ../src/guestfs-actions.pod:4467
10538 msgid "See also: L<mkdtemp(3)>"
10542 #: ../fish/guestfish-actions.pod:3001
10547 #: ../fish/guestfish-actions.pod:3003
10550 " mke2fs-J fstype blocksize device journal\n"
10555 #: ../fish/guestfish-actions.pod:3005 ../src/guestfs-actions.pod:4483
10557 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10558 "C<journal>. It is equivalent to the command:"
10562 #: ../fish/guestfish-actions.pod:3009 ../src/guestfs-actions.pod:4487
10565 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
10570 #: ../fish/guestfish-actions.pod:3011
10571 msgid "See also L</mke2journal>."
10575 #: ../fish/guestfish-actions.pod:3013
10580 #: ../fish/guestfish-actions.pod:3015
10583 " mke2fs-JL fstype blocksize device label\n"
10588 #: ../fish/guestfish-actions.pod:3017 ../src/guestfs-actions.pod:4504
10590 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10591 "the journal labeled C<label>."
10595 #: ../fish/guestfish-actions.pod:3020
10596 msgid "See also L</mke2journal-L>."
10600 #: ../fish/guestfish-actions.pod:3022
10605 #: ../fish/guestfish-actions.pod:3024
10608 " mke2fs-JU fstype blocksize device uuid\n"
10613 #: ../fish/guestfish-actions.pod:3026 ../src/guestfs-actions.pod:4522
10615 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
10616 "the journal with UUID C<uuid>."
10620 #: ../fish/guestfish-actions.pod:3029
10621 msgid "See also L</mke2journal-U>."
10625 #: ../fish/guestfish-actions.pod:3031
10626 msgid "mke2journal"
10630 #: ../fish/guestfish-actions.pod:3033
10633 " mke2journal blocksize device\n"
10638 #: ../fish/guestfish-actions.pod:3035 ../src/guestfs-actions.pod:4538
10640 "This creates an ext2 external journal on C<device>. It is equivalent to the "
10645 #: ../fish/guestfish-actions.pod:3038 ../src/guestfs-actions.pod:4541
10648 " mke2fs -O journal_dev -b blocksize device\n"
10653 #: ../fish/guestfish-actions.pod:3040
10654 msgid "mke2journal-L"
10658 #: ../fish/guestfish-actions.pod:3042
10661 " mke2journal-L blocksize label device\n"
10666 #: ../fish/guestfish-actions.pod:3044 ../src/guestfs-actions.pod:4555
10667 msgid "This creates an ext2 external journal on C<device> with label C<label>."
10671 #: ../fish/guestfish-actions.pod:3046
10672 msgid "mke2journal-U"
10676 #: ../fish/guestfish-actions.pod:3048
10679 " mke2journal-U blocksize uuid device\n"
10684 #: ../fish/guestfish-actions.pod:3050 ../src/guestfs-actions.pod:4569
10685 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
10689 #: ../fish/guestfish-actions.pod:3052
10694 #: ../fish/guestfish-actions.pod:3054
10697 " mkfifo mode path\n"
10702 #: ../fish/guestfish-actions.pod:3056
10704 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
10705 "is just a convenient wrapper around L</mknod>."
10709 #: ../fish/guestfish-actions.pod:3062
10714 #: ../fish/guestfish-actions.pod:3064
10717 " mkfs fstype device\n"
10722 #: ../fish/guestfish-actions.pod:3066 ../src/guestfs-actions.pod:4599
10724 "This creates a filesystem on C<device> (usually a partition or LVM logical "
10725 "volume). The filesystem type is C<fstype>, for example C<ext3>."
10729 #: ../fish/guestfish-actions.pod:3070
10734 #: ../fish/guestfish-actions.pod:3072
10737 " mkfs-b fstype blocksize device\n"
10742 #: ../fish/guestfish-actions.pod:3074
10744 "This call is similar to L</mkfs>, but it allows you to control the block "
10745 "size of the resulting filesystem. Supported block sizes depend on the "
10746 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
10750 #: ../fish/guestfish-actions.pod:3079 ../fish/guestfish-actions.pod:3106
10751 #: ../src/guestfs-actions.pod:4627 ../src/guestfs-actions.pod:4665
10753 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
10758 #: ../fish/guestfish-actions.pod:3082
10760 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
10765 #: ../fish/guestfish-actions.pod:3089
10770 #: ../fish/guestfish-actions.pod:3091
10773 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] [sectorsize:..]\n"
10778 #: ../fish/guestfish-actions.pod:3093 ../src/guestfs-actions.pod:4652
10780 "This function creates a filesystem on C<device>. The filesystem type is "
10781 "C<fstype>, for example C<ext3>."
10785 #: ../fish/guestfish-actions.pod:3100 ../src/guestfs-actions.pod:4659
10786 msgid "C<blocksize>"
10790 #: ../fish/guestfish-actions.pod:3102 ../src/guestfs-actions.pod:4661
10792 "The filesystem block size. Supported block sizes depend on the filesystem "
10793 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
10798 #: ../fish/guestfish-actions.pod:3109 ../src/guestfs-actions.pod:4668
10799 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
10803 #: ../fish/guestfish-actions.pod:3111 ../src/guestfs-actions.pod:4670
10804 msgid "C<features>"
10808 #: ../fish/guestfish-actions.pod:3113 ../src/guestfs-actions.pod:4672
10809 msgid "This passes the I<-O> parameter to the external mkfs program."
10813 #: ../fish/guestfish-actions.pod:3115 ../src/guestfs-actions.pod:4674
10815 "For certain filesystem types, this allows extra filesystem features to be "
10816 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
10820 #: ../fish/guestfish-actions.pod:3119 ../src/guestfs-actions.pod:4678
10822 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
10827 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4681
10832 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4683
10834 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
10835 "sets the inode size (only for ext2/3/4 filesystems at present)."
10839 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4686
10840 msgid "C<sectorsize>"
10844 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4688
10846 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
10847 "sets sector size for ufs filesystem."
10851 #: ../fish/guestfish-actions.pod:3136
10852 msgid "mkmountpoint"
10856 #: ../fish/guestfish-actions.pod:3138
10859 " mkmountpoint exemptpath\n"
10864 #: ../fish/guestfish-actions.pod:3140
10866 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
10867 "to create extra mountpoints before mounting the first filesystem."
10871 #: ../fish/guestfish-actions.pod:3144 ../src/guestfs-actions.pod:4731
10873 "These calls are I<only> necessary in some very limited circumstances, mainly "
10874 "the case where you want to mount a mix of unrelated and/or read-only "
10875 "filesystems together."
10879 #: ../fish/guestfish-actions.pod:3148 ../src/guestfs-actions.pod:4735
10881 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
10882 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
10883 "inside that. You can unpack this as follows in guestfish:"
10887 #: ../fish/guestfish-actions.pod:3153 ../src/guestfs-actions.pod:4740
10890 " add-ro Fedora-11-i686-Live.iso\n"
10892 " mkmountpoint /cd\n"
10893 " mkmountpoint /sqsh\n"
10894 " mkmountpoint /ext3fs\n"
10895 " mount /dev/sda /cd\n"
10896 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
10897 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
10902 #: ../fish/guestfish-actions.pod:3162 ../src/guestfs-actions.pod:4749
10903 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
10907 #: ../fish/guestfish-actions.pod:3164
10909 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
10910 "unexpected errors if you try to mix these calls. It is safest to manually "
10911 "unmount filesystems and remove mountpoints after use."
10915 #: ../fish/guestfish-actions.pod:3168
10917 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
10918 "for this to work for manual mountpoints, you must ensure that the innermost "
10919 "mountpoints have the longest pathnames, as in the example code above."
10923 #: ../fish/guestfish-actions.pod:3173 ../src/guestfs-actions.pod:4760
10925 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
10929 #: ../fish/guestfish-actions.pod:3175
10931 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
10932 "L</umount-all> to be called when the handle is closed which can also trigger "
10937 #: ../fish/guestfish-actions.pod:3179
10942 #: ../fish/guestfish-actions.pod:3181
10945 " mknod mode devmajor devminor path\n"
10950 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4779
10952 "This call creates block or character special devices, or named pipes (FIFOs)."
10956 #: ../fish/guestfish-actions.pod:3186 ../src/guestfs-actions.pod:4782
10958 "The C<mode> parameter should be the mode, using the standard constants. "
10959 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
10960 "used when creating block and character special devices."
10964 #: ../fish/guestfish-actions.pod:3191
10966 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
10967 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
10968 "regular file). These constants are available in the standard Linux header "
10969 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
10970 "wrappers around this command which bitwise OR in the appropriate constant "
10975 #: ../fish/guestfish-actions.pod:3201
10980 #: ../fish/guestfish-actions.pod:3203
10983 " mknod-b mode devmajor devminor path\n"
10988 #: ../fish/guestfish-actions.pod:3205
10990 "This call creates a block device node called C<path> with mode C<mode> and "
10991 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
10992 "wrapper around L</mknod>."
10996 #: ../fish/guestfish-actions.pod:3211
11001 #: ../fish/guestfish-actions.pod:3213
11004 " mknod-c mode devmajor devminor path\n"
11009 #: ../fish/guestfish-actions.pod:3215
11011 "This call creates a char device node called C<path> with mode C<mode> and "
11012 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11013 "wrapper around L</mknod>."
11017 #: ../fish/guestfish-actions.pod:3221
11022 #: ../fish/guestfish-actions.pod:3223
11030 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4845
11031 msgid "Create a swap partition on C<device>."
11035 #: ../fish/guestfish-actions.pod:3227
11040 #: ../fish/guestfish-actions.pod:3229
11043 " mkswap-L label device\n"
11048 #: ../fish/guestfish-actions.pod:3231 ../src/guestfs-actions.pod:4858
11049 msgid "Create a swap partition on C<device> with label C<label>."
11053 #: ../fish/guestfish-actions.pod:3233 ../src/guestfs-actions.pod:4860
11055 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11056 "sda>), just to a partition. This appears to be a limitation of the kernel "
11061 #: ../fish/guestfish-actions.pod:3237
11066 #: ../fish/guestfish-actions.pod:3239
11069 " mkswap-U uuid device\n"
11074 #: ../fish/guestfish-actions.pod:3241 ../src/guestfs-actions.pod:4875
11075 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11079 #: ../fish/guestfish-actions.pod:3243
11080 msgid "mkswap-file"
11084 #: ../fish/guestfish-actions.pod:3245
11087 " mkswap-file path\n"
11092 #: ../fish/guestfish-actions.pod:3247 ../src/guestfs-actions.pod:4887
11093 msgid "Create a swap file."
11097 #: ../fish/guestfish-actions.pod:3249
11099 "This command just writes a swap file signature to an existing file. To "
11100 "create the file itself, use something like L</fallocate>."
11104 #: ../fish/guestfish-actions.pod:3252
11109 #: ../fish/guestfish-actions.pod:3254
11112 " modprobe modulename\n"
11117 #: ../fish/guestfish-actions.pod:3256 ../src/guestfs-actions.pod:4902
11118 msgid "This loads a kernel module in the appliance."
11122 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4904
11124 "The kernel module must have been whitelisted when libguestfs was built (see "
11125 "C<appliance/kmod.whitelist.in> in the source)."
11129 #: ../fish/guestfish-actions.pod:3261
11134 #: ../fish/guestfish-actions.pod:3263
11137 " mount device mountpoint\n"
11142 #: ../fish/guestfish-actions.pod:3265 ../src/guestfs-actions.pod:4925
11144 "Mount a guest disk at a position in the filesystem. Block devices are named "
11145 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11146 "those block devices contain partitions, they will have the usual names (eg. "
11147 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11151 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:4931
11153 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11154 "mounted on C</> before others can be mounted. Other filesystems can only be "
11155 "mounted on directories which already exist."
11159 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4936
11161 "The mounted filesystem is writable, if we have sufficient permissions on the "
11162 "underlying device."
11166 #: ../fish/guestfish-actions.pod:3279
11168 "B<Important note:> When you use this call, the filesystem options C<sync> "
11169 "and C<noatime> are set implicitly. This was originally done because we "
11170 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11171 "very large negative performance impact and negligible effect on "
11172 "reliability. Therefore we recommend that you avoid using L</mount> in any "
11173 "code that needs performance, and instead use L</mount-options> (use an empty "
11174 "string for the first parameter if you don't want any options)."
11178 #: ../fish/guestfish-actions.pod:3289
11180 "I<This function is deprecated.> In new code, use the L</mount_options> call "
11185 #: ../fish/guestfish-actions.pod:3296
11190 #: ../fish/guestfish-actions.pod:3298
11193 " mount-9p mounttag mountpoint [options:..]\n"
11198 #: ../fish/guestfish-actions.pod:3300 ../src/guestfs-actions.pod:4968
11200 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
11205 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:4971
11207 "If required, C<trans=virtio> will be automatically added to the options. "
11208 "Any other options required can be passed in the optional C<options> "
11213 #: ../fish/guestfish-actions.pod:3309
11218 #: ../fish/guestfish-actions.pod:3311
11221 " mount-loop file mountpoint\n"
11226 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5010
11228 "This command lets you mount C<file> (a filesystem image in a file) on a "
11229 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11234 #: ../fish/guestfish-actions.pod:3317
11235 msgid "mount-options"
11239 #: ../fish/guestfish-actions.pod:3319
11242 " mount-options options device mountpoint\n"
11247 #: ../fish/guestfish-actions.pod:3321
11249 "This is the same as the L</mount> command, but it allows you to set the "
11250 "mount options as for the L<mount(8)> I<-o> flag."
11254 #: ../fish/guestfish-actions.pod:3325 ../src/guestfs-actions.pod:5030
11256 "If the C<options> parameter is an empty string, then no options are passed "
11257 "(all options default to whatever the filesystem uses)."
11261 #: ../fish/guestfish-actions.pod:3329
11266 #: ../fish/guestfish-actions.pod:3331
11269 " mount-ro device mountpoint\n"
11274 #: ../fish/guestfish-actions.pod:3333
11276 "This is the same as the L</mount> command, but it mounts the filesystem with "
11277 "the read-only (I<-o ro>) flag."
11281 #: ../fish/guestfish-actions.pod:3336
11286 #: ../fish/guestfish-actions.pod:3338
11289 " mount-vfs options vfstype device mountpoint\n"
11294 #: ../fish/guestfish-actions.pod:3340
11296 "This is the same as the L</mount> command, but it allows you to set both the "
11297 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
11301 #: ../fish/guestfish-actions.pod:3344
11302 msgid "mountpoints"
11306 #: ../fish/guestfish-actions.pod:3346
11314 #: ../fish/guestfish-actions.pod:3348
11316 "This call is similar to L</mounts>. That call returns a list of devices. "
11317 "This one returns a hash table (map) of device name to directory where the "
11318 "device is mounted."
11322 #: ../fish/guestfish-actions.pod:3352
11327 #: ../fish/guestfish-actions.pod:3354
11335 #: ../fish/guestfish-actions.pod:3356 ../src/guestfs-actions.pod:5091
11337 "This returns the list of currently mounted filesystems. It returns the list "
11338 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11342 #: ../fish/guestfish-actions.pod:3359 ../src/guestfs-actions.pod:5094
11343 msgid "Some internal mounts are not shown."
11347 #: ../fish/guestfish-actions.pod:3361
11348 msgid "See also: L</mountpoints>"
11352 #: ../fish/guestfish-actions.pod:3363
11357 #: ../fish/guestfish-actions.pod:3365
11365 #: ../fish/guestfish-actions.pod:3367 ../src/guestfs-actions.pod:5111
11367 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11368 "destination filename or destination directory."
11372 #: ../fish/guestfish-actions.pod:3370
11373 msgid "ntfs-3g-probe"
11377 #: ../fish/guestfish-actions.pod:3372
11380 " ntfs-3g-probe true|false device\n"
11385 #: ../fish/guestfish-actions.pod:3374 ../src/guestfs-actions.pod:5125
11387 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11388 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11389 "write, and some cannot be mounted at all)."
11393 #: ../fish/guestfish-actions.pod:3378 ../src/guestfs-actions.pod:5129
11395 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11396 "can be mounted read-write. Set it to false if you want to test if the "
11397 "volume can be mounted read-only."
11401 #: ../fish/guestfish-actions.pod:3382 ../src/guestfs-actions.pod:5133
11403 "The return value is an integer which C<0> if the operation would succeed, or "
11404 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
11408 #: ../fish/guestfish-actions.pod:3386
11413 #: ../fish/guestfish-actions.pod:3388
11416 " ntfsresize device\n"
11421 #: ../fish/guestfish-actions.pod:3390 ../fish/guestfish-actions.pod:3414
11422 #: ../src/guestfs-actions.pod:5154 ../src/guestfs-actions.pod:5186
11424 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
11425 "size of the underlying device."
11429 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5157
11431 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
11432 "consistency check (for safety). You have to boot into Windows to perform "
11433 "this check and clear this condition. Furthermore, ntfsresize refuses to "
11434 "resize filesystems which have been marked in this way. So in effect it is "
11435 "not possible to call ntfsresize multiple times on a single filesystem "
11436 "without booting into Windows between each resize."
11440 #: ../fish/guestfish-actions.pod:3401 ../fish/guestfish-actions.pod:3440
11441 #: ../src/guestfs-actions.pod:5165 ../src/guestfs-actions.pod:5212
11442 msgid "See also L<ntfsresize(8)>."
11446 #: ../fish/guestfish-actions.pod:3403 ../fish/guestfish-actions.pod:3451
11448 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
11453 #: ../fish/guestfish-actions.pod:3410
11454 msgid "ntfsresize-opts"
11458 #: ../fish/guestfish-actions.pod:3412
11461 " ntfsresize-opts device [size:..] [force:..]\n"
11466 #: ../fish/guestfish-actions.pod:3423 ../src/guestfs-actions.pod:5195
11468 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
11469 "resized to fit the container (eg. partition)."
11473 #: ../fish/guestfish-actions.pod:3426 ../src/guestfs-actions.pod:5198
11478 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5200
11480 "If this option is true, then force the resize of the filesystem even if the "
11481 "filesystem is marked as requiring a consistency check."
11485 #: ../fish/guestfish-actions.pod:3431
11487 "After the resize operation, the filesystem is always marked as requiring a "
11488 "consistency check (for safety). You have to boot into Windows to perform "
11489 "this check and clear this condition. If you I<don't> set the C<force> "
11490 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
11491 "a single filesystem without booting into Windows between each resize."
11495 #: ../fish/guestfish-actions.pod:3444
11496 msgid "ntfsresize-size"
11500 #: ../fish/guestfish-actions.pod:3446
11503 " ntfsresize-size device size\n"
11508 #: ../fish/guestfish-actions.pod:3448
11510 "This command is the same as L</ntfsresize> except that it allows you to "
11511 "specify the new size (in bytes) explicitly."
11515 #: ../fish/guestfish-actions.pod:3458
11520 #: ../fish/guestfish-actions.pod:3460
11523 " part-add device prlogex startsect endsect\n"
11528 #: ../fish/guestfish-actions.pod:3462
11530 "This command adds a partition to C<device>. If there is no partition table "
11531 "on the device, call L</part-init> first."
11535 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5273
11537 "The C<prlogex> parameter is the type of partition. Normally you should pass "
11538 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
11539 "C<logical>) and C<e> (or C<extended>) partition types."
11543 #: ../fish/guestfish-actions.pod:3470 ../src/guestfs-actions.pod:5278
11545 "C<startsect> and C<endsect> are the start and end of the partition in "
11546 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
11547 "from the end of the disk (C<-1> is the last sector)."
11551 #: ../fish/guestfish-actions.pod:3474
11553 "Creating a partition which covers the whole disk is not so easy. Use L</"
11554 "part-disk> to do that."
11558 #: ../fish/guestfish-actions.pod:3477
11563 #: ../fish/guestfish-actions.pod:3479
11566 " part-del device partnum\n"
11571 #: ../fish/guestfish-actions.pod:3481 ../src/guestfs-actions.pod:5296
11572 msgid "This command deletes the partition numbered C<partnum> on C<device>."
11576 #: ../fish/guestfish-actions.pod:3483 ../src/guestfs-actions.pod:5298
11578 "Note that in the case of MBR partitioning, deleting an extended partition "
11579 "also deletes any logical partitions it contains."
11583 #: ../fish/guestfish-actions.pod:3487
11588 #: ../fish/guestfish-actions.pod:3489
11591 " part-disk device parttype\n"
11596 #: ../fish/guestfish-actions.pod:3491
11598 "This command is simply a combination of L</part-init> followed by L</part-"
11599 "add> to create a single primary partition covering the whole disk."
11603 #: ../fish/guestfish-actions.pod:3495
11605 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
11606 "possible values are described in L</part-init>."
11610 #: ../fish/guestfish-actions.pod:3501
11611 msgid "part-get-bootable"
11615 #: ../fish/guestfish-actions.pod:3503
11618 " part-get-bootable device partnum\n"
11623 #: ../fish/guestfish-actions.pod:3505 ../src/guestfs-actions.pod:5334
11625 "This command returns true if the partition C<partnum> on C<device> has the "
11626 "bootable flag set."
11630 #: ../fish/guestfish-actions.pod:3508
11631 msgid "See also L</part-set-bootable>."
11635 #: ../fish/guestfish-actions.pod:3510
11636 msgid "part-get-mbr-id"
11640 #: ../fish/guestfish-actions.pod:3512
11643 " part-get-mbr-id device partnum\n"
11648 #: ../fish/guestfish-actions.pod:3514 ../src/guestfs-actions.pod:5350
11650 "Returns the MBR type byte (also known as the ID byte) from the numbered "
11651 "partition C<partnum>."
11655 #: ../fish/guestfish-actions.pod:3517 ../fish/guestfish-actions.pod:3661
11657 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
11658 "undefined results for other partition table types (see L</part-get-"
11663 #: ../fish/guestfish-actions.pod:3521
11664 msgid "part-get-parttype"
11668 #: ../fish/guestfish-actions.pod:3523
11671 " part-get-parttype device\n"
11676 #: ../fish/guestfish-actions.pod:3525 ../src/guestfs-actions.pod:5367
11678 "This command examines the partition table on C<device> and returns the "
11679 "partition table type (format) being used."
11683 #: ../fish/guestfish-actions.pod:3528
11685 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
11686 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
11687 "possible, although unusual. See L</part-init> for a full list."
11691 #: ../fish/guestfish-actions.pod:3533
11696 #: ../fish/guestfish-actions.pod:3535
11699 " part-init device parttype\n"
11704 #: ../fish/guestfish-actions.pod:3537 ../src/guestfs-actions.pod:5387
11706 "This creates an empty partition table on C<device> of one of the partition "
11707 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
11708 "(for large disks)."
11712 #: ../fish/guestfish-actions.pod:3541
11714 "Initially there are no partitions. Following this, you should call L</part-"
11715 "add> for each partition required."
11719 #: ../fish/guestfish-actions.pod:3544 ../src/guestfs-actions.pod:5394
11720 msgid "Possible values for C<parttype> are:"
11724 #: ../fish/guestfish-actions.pod:3548 ../src/guestfs-actions.pod:5398
11729 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5400
11734 #: ../fish/guestfish-actions.pod:3552 ../src/guestfs-actions.pod:5402
11735 msgid "Intel EFI / GPT partition table."
11739 #: ../fish/guestfish-actions.pod:3554 ../src/guestfs-actions.pod:5404
11741 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
11742 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
11743 "the C<mbr> format."
11747 #: ../fish/guestfish-actions.pod:3558 ../src/guestfs-actions.pod:5408
11752 #: ../fish/guestfish-actions.pod:3560 ../src/guestfs-actions.pod:5410
11757 #: ../fish/guestfish-actions.pod:3562 ../src/guestfs-actions.pod:5412
11759 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
11760 "Windows. This partition type will B<only> work for device sizes up to 2 "
11761 "TB. For large disks we recommend using C<gpt>."
11765 #: ../fish/guestfish-actions.pod:3569 ../src/guestfs-actions.pod:5419
11767 "Other partition table types that may work but are not supported include:"
11771 #: ../fish/guestfish-actions.pod:3574 ../src/guestfs-actions.pod:5424
11776 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5426
11777 msgid "AIX disk labels."
11781 #: ../fish/guestfish-actions.pod:3578 ../src/guestfs-actions.pod:5428
11786 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5430
11791 #: ../fish/guestfish-actions.pod:3582 ../src/guestfs-actions.pod:5432
11792 msgid "Amiga \"Rigid Disk Block\" format."
11796 #: ../fish/guestfish-actions.pod:3584 ../src/guestfs-actions.pod:5434
11801 #: ../fish/guestfish-actions.pod:3586 ../src/guestfs-actions.pod:5436
11802 msgid "BSD disk labels."
11806 #: ../fish/guestfish-actions.pod:3588 ../src/guestfs-actions.pod:5438
11811 #: ../fish/guestfish-actions.pod:3590 ../src/guestfs-actions.pod:5440
11812 msgid "DASD, used on IBM mainframes."
11816 #: ../fish/guestfish-actions.pod:3592 ../src/guestfs-actions.pod:5442
11821 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5444
11822 msgid "MIPS/SGI volumes."
11826 #: ../fish/guestfish-actions.pod:3596 ../src/guestfs-actions.pod:5446
11831 #: ../fish/guestfish-actions.pod:3598 ../src/guestfs-actions.pod:5448
11832 msgid "Old Mac partition format. Modern Macs use C<gpt>."
11836 #: ../fish/guestfish-actions.pod:3600 ../src/guestfs-actions.pod:5450
11841 #: ../fish/guestfish-actions.pod:3602 ../src/guestfs-actions.pod:5452
11842 msgid "NEC PC-98 format, common in Japan apparently."
11846 #: ../fish/guestfish-actions.pod:3604 ../src/guestfs-actions.pod:5454
11851 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5456
11852 msgid "Sun disk labels."
11856 #: ../fish/guestfish-actions.pod:3610
11861 #: ../fish/guestfish-actions.pod:3612
11864 " part-list device\n"
11869 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5470
11871 "This command parses the partition table on C<device> and returns the list of "
11872 "partitions found."
11876 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5473
11877 msgid "The fields in the returned structure are:"
11881 #: ../fish/guestfish-actions.pod:3621 ../src/guestfs-actions.pod:5477
11882 msgid "B<part_num>"
11886 #: ../fish/guestfish-actions.pod:3623 ../src/guestfs-actions.pod:5479
11887 msgid "Partition number, counting from 1."
11891 #: ../fish/guestfish-actions.pod:3625 ../src/guestfs-actions.pod:5481
11892 msgid "B<part_start>"
11896 #: ../fish/guestfish-actions.pod:3627
11898 "Start of the partition I<in bytes>. To get sectors you have to divide by "
11899 "the device's sector size, see L</blockdev-getss>."
11903 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5486
11904 msgid "B<part_end>"
11908 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5488
11909 msgid "End of the partition in bytes."
11913 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5490
11914 msgid "B<part_size>"
11918 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5492
11919 msgid "Size of the partition in bytes."
11923 #: ../fish/guestfish-actions.pod:3640
11924 msgid "part-set-bootable"
11928 #: ../fish/guestfish-actions.pod:3642
11931 " part-set-bootable device partnum true|false\n"
11936 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5510
11938 "This sets the bootable flag on partition numbered C<partnum> on device "
11939 "C<device>. Note that partitions are numbered from 1."
11943 #: ../fish/guestfish-actions.pod:3647 ../src/guestfs-actions.pod:5513
11945 "The bootable flag is used by some operating systems (notably Windows) to "
11946 "determine which partition to boot from. It is by no means universally "
11951 #: ../fish/guestfish-actions.pod:3651
11952 msgid "part-set-mbr-id"
11956 #: ../fish/guestfish-actions.pod:3653
11959 " part-set-mbr-id device partnum idbyte\n"
11964 #: ../fish/guestfish-actions.pod:3655 ../src/guestfs-actions.pod:5529
11966 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
11967 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
11968 "documentation are in fact hexadecimal numbers, but usually documented "
11969 "without any leading \"0x\" which might be confusing."
11973 #: ../fish/guestfish-actions.pod:3665
11974 msgid "part-set-name"
11978 #: ../fish/guestfish-actions.pod:3667
11981 " part-set-name device partnum name\n"
11986 #: ../fish/guestfish-actions.pod:3669 ../src/guestfs-actions.pod:5551
11988 "This sets the partition name on partition numbered C<partnum> on device "
11989 "C<device>. Note that partitions are numbered from 1."
11993 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5554
11995 "The partition name can only be set on certain types of partition table. "
11996 "This works on C<gpt> but not on C<mbr> partitions."
12000 #: ../fish/guestfish-actions.pod:3675
12001 msgid "part-to-dev"
12005 #: ../fish/guestfish-actions.pod:3677
12008 " part-to-dev partition\n"
12013 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5567
12015 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12016 "partition number, returning the device name (eg. \"/dev/sdb\")."
12020 #: ../fish/guestfish-actions.pod:3683
12022 "The named partition must exist, for example as a string returned from L</"
12023 "list-partitions>."
12027 #: ../fish/guestfish-actions.pod:3686
12028 msgid "ping-daemon"
12032 #: ../fish/guestfish-actions.pod:3688
12040 #: ../fish/guestfish-actions.pod:3690 ../src/guestfs-actions.pod:5584
12042 "This is a test probe into the guestfs daemon running inside the qemu "
12043 "subprocess. Calling this function checks that the daemon responds to the "
12044 "ping message, without affecting the daemon or attached block device(s) in "
12049 #: ../fish/guestfish-actions.pod:3695
12054 #: ../fish/guestfish-actions.pod:3697
12057 " pread path count offset\n"
12062 #: ../fish/guestfish-actions.pod:3699 ../src/guestfs-actions.pod:5602
12064 "This command lets you read part of a file. It reads C<count> bytes of the "
12065 "file, starting at C<offset>, from file C<path>."
12069 #: ../fish/guestfish-actions.pod:3702 ../fish/guestfish-actions.pod:3717
12070 #: ../src/guestfs-actions.pod:5605 ../src/guestfs-actions.pod:5631
12072 "This may read fewer bytes than requested. For further details see the "
12073 "L<pread(2)> system call."
12077 #: ../fish/guestfish-actions.pod:3705
12078 msgid "See also L</pwrite>, L</pread-device>."
12082 #: ../fish/guestfish-actions.pod:3710
12083 msgid "pread-device"
12087 #: ../fish/guestfish-actions.pod:3712
12090 " pread-device device count offset\n"
12095 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5628
12097 "This command lets you read part of a file. It reads C<count> bytes of "
12098 "C<device>, starting at C<offset>."
12102 #: ../fish/guestfish-actions.pod:3720
12103 msgid "See also L</pread>."
12107 #: ../fish/guestfish-actions.pod:3725
12112 #: ../fish/guestfish-actions.pod:3727
12115 " pvcreate device\n"
12120 #: ../fish/guestfish-actions.pod:3729 ../src/guestfs-actions.pod:5651
12122 "This creates an LVM physical volume on the named C<device>, where C<device> "
12123 "should usually be a partition name such as C</dev/sda1>."
12127 #: ../fish/guestfish-actions.pod:3733
12132 #: ../fish/guestfish-actions.pod:3735
12135 " pvremove device\n"
12140 #: ../fish/guestfish-actions.pod:3737 ../src/guestfs-actions.pod:5665
12142 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12147 #: ../fish/guestfish-actions.pod:3740 ../src/guestfs-actions.pod:5668
12149 "The implementation uses the C<pvremove> command which refuses to wipe "
12150 "physical volumes that contain any volume groups, so you have to remove those "
12155 #: ../fish/guestfish-actions.pod:3744
12160 #: ../fish/guestfish-actions.pod:3746
12163 " pvresize device\n"
12168 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5682
12170 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12171 "the new size of the underlying device."
12175 #: ../fish/guestfish-actions.pod:3751
12176 msgid "pvresize-size"
12180 #: ../fish/guestfish-actions.pod:3753
12183 " pvresize-size device size\n"
12188 #: ../fish/guestfish-actions.pod:3755
12190 "This command is the same as L</pvresize> except that it allows you to "
12191 "specify the new size (in bytes) explicitly."
12195 #: ../fish/guestfish-actions.pod:3758
12200 #: ../fish/guestfish-actions.pod:3760
12208 #: ../fish/guestfish-actions.pod:3762 ../src/guestfs-actions.pod:5708
12210 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12215 #: ../fish/guestfish-actions.pod:3765 ../src/guestfs-actions.pod:5711
12217 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12222 #: ../fish/guestfish-actions.pod:3768
12223 msgid "See also L</pvs-full>."
12227 #: ../fish/guestfish-actions.pod:3770
12232 #: ../fish/guestfish-actions.pod:3772
12240 #: ../fish/guestfish-actions.pod:3774 ../src/guestfs-actions.pod:5727
12242 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12243 "(8)> command. The \"full\" version includes all fields."
12247 #: ../fish/guestfish-actions.pod:3777
12252 #: ../fish/guestfish-actions.pod:3779
12260 #: ../fish/guestfish-actions.pod:3781 ../src/guestfs-actions.pod:5742
12261 msgid "This command returns the UUID of the LVM PV C<device>."
12265 #: ../fish/guestfish-actions.pod:3783
12270 #: ../fish/guestfish-actions.pod:3785
12273 " pwrite path content offset\n"
12278 #: ../fish/guestfish-actions.pod:3787 ../src/guestfs-actions.pod:5758
12280 "This command writes to part of a file. It writes the data buffer C<content> "
12281 "to the file C<path> starting at offset C<offset>."
12285 #: ../fish/guestfish-actions.pod:3790 ../src/guestfs-actions.pod:5761
12287 "This command implements the L<pwrite(2)> system call, and like that system "
12288 "call it may not write the full data requested. The return value is the "
12289 "number of bytes that were actually written to the file. This could even be "
12290 "0, although short writes are unlikely for regular files in ordinary "
12295 #: ../fish/guestfish-actions.pod:3796
12296 msgid "See also L</pread>, L</pwrite-device>."
12300 #: ../fish/guestfish-actions.pod:3801
12301 msgid "pwrite-device"
12305 #: ../fish/guestfish-actions.pod:3803
12308 " pwrite-device device content offset\n"
12313 #: ../fish/guestfish-actions.pod:3805 ../src/guestfs-actions.pod:5785
12315 "This command writes to part of a device. It writes the data buffer "
12316 "C<content> to C<device> starting at offset C<offset>."
12320 #: ../fish/guestfish-actions.pod:3808 ../src/guestfs-actions.pod:5788
12322 "This command implements the L<pwrite(2)> system call, and like that system "
12323 "call it may not write the full data requested (although short writes to disk "
12324 "devices and partitions are probably impossible with standard Linux kernels)."
12328 #: ../fish/guestfish-actions.pod:3813
12329 msgid "See also L</pwrite>."
12333 #: ../fish/guestfish-actions.pod:3818
12338 #: ../fish/guestfish-actions.pod:3820
12341 " read-file path\n"
12346 #: ../fish/guestfish-actions.pod:3822 ../src/guestfs-actions.pod:5809
12347 msgid "This calls returns the contents of the file C<path> as a buffer."
12351 #: ../fish/guestfish-actions.pod:3825
12353 "Unlike L</cat>, this function can correctly handle files that contain "
12354 "embedded ASCII NUL characters. However unlike L</download>, this function "
12355 "is limited in the total size of file that can be handled."
12359 #: ../fish/guestfish-actions.pod:3833
12364 #: ../fish/guestfish-actions.pod:3835
12367 " read-lines path\n"
12372 #: ../fish/guestfish-actions.pod:3839 ../src/guestfs-actions.pod:5834
12374 "The file contents are returned as a list of lines. Trailing C<LF> and "
12375 "C<CRLF> character sequences are I<not> returned."
12379 #: ../fish/guestfish-actions.pod:3842
12381 "Note that this function cannot correctly handle binary files (specifically, "
12382 "files containing C<\\0> character which is treated as end of line). For "
12383 "those you need to use the L</read-file> function which has a more complex "
12388 #: ../fish/guestfish-actions.pod:3847
12393 #: ../fish/guestfish-actions.pod:3849
12401 #: ../fish/guestfish-actions.pod:3851 ../src/guestfs-actions.pod:5854
12402 msgid "This returns the list of directory entries in directory C<dir>."
12406 #: ../fish/guestfish-actions.pod:3853 ../src/guestfs-actions.pod:5856
12408 "All entries in the directory are returned, including C<.> and C<..>. The "
12409 "entries are I<not> sorted, but returned in the same order as the underlying "
12414 #: ../fish/guestfish-actions.pod:3857 ../src/guestfs-actions.pod:5860
12416 "Also this call returns basic file type information about each file. The "
12417 "C<ftyp> field will contain one of the following characters:"
12421 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5865
12426 #: ../fish/guestfish-actions.pod:3864 ../src/guestfs-actions.pod:5867
12427 msgid "Block special"
12431 #: ../fish/guestfish-actions.pod:3866 ../src/guestfs-actions.pod:5869
12436 #: ../fish/guestfish-actions.pod:3868 ../src/guestfs-actions.pod:5871
12437 msgid "Char special"
12441 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5873
12446 #: ../fish/guestfish-actions.pod:3872 ../src/guestfs-actions.pod:5875
12451 #: ../fish/guestfish-actions.pod:3874 ../src/guestfs-actions.pod:5877
12456 #: ../fish/guestfish-actions.pod:3876 ../src/guestfs-actions.pod:5879
12457 msgid "FIFO (named pipe)"
12461 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:5881
12466 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5883
12467 msgid "Symbolic link"
12471 #: ../fish/guestfish-actions.pod:3882 ../src/guestfs-actions.pod:5885
12476 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5887
12477 msgid "Regular file"
12481 #: ../fish/guestfish-actions.pod:3886 ../src/guestfs-actions.pod:5889
12486 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5891
12491 #: ../fish/guestfish-actions.pod:3890 ../src/guestfs-actions.pod:5893
12496 #: ../fish/guestfish-actions.pod:3892 ../src/guestfs-actions.pod:5895
12497 msgid "Unknown file type"
12501 #: ../fish/guestfish-actions.pod:3894 ../src/guestfs-actions.pod:5897
12506 #: ../fish/guestfish-actions.pod:3896 ../src/guestfs-actions.pod:5899
12508 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
12512 #: ../fish/guestfish-actions.pod:3901
12514 "This function is primarily intended for use by programs. To get a simple "
12515 "list of names, use L</ls>. To get a printable directory for human "
12516 "consumption, use L</ll>."
12520 #: ../fish/guestfish-actions.pod:3905
12525 #: ../fish/guestfish-actions.pod:3907
12533 #: ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:5920
12534 msgid "This command reads the target of a symbolic link."
12538 #: ../fish/guestfish-actions.pod:3911
12539 msgid "readlinklist"
12543 #: ../fish/guestfish-actions.pod:3913
12546 " readlinklist path 'names ...'\n"
12551 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5934
12553 "This call allows you to do a C<readlink> operation on multiple files, where "
12554 "all files are in the directory C<path>. C<names> is the list of files from "
12559 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5938
12561 "On return you get a list of strings, with a one-to-one correspondence to the "
12562 "C<names> list. Each string is the value of the symbolic link."
12566 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:5942
12568 "If the C<readlink(2)> operation fails on any name, then the corresponding "
12569 "result string is the empty string C<\"\">. However the whole operation is "
12570 "completed even if there were C<readlink(2)> errors, and so you can call this "
12571 "function with names where you don't know if they are symbolic links already "
12572 "(albeit slightly less efficient)."
12576 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:5949
12578 "This call is intended for programs that want to efficiently list a directory "
12579 "contents without making many round-trips. Very long directory listings "
12580 "might cause the protocol message size to be exceeded, causing this call to "
12581 "fail. The caller must split up such requests into smaller groups of names."
12585 #: ../fish/guestfish-actions.pod:3937
12590 #: ../fish/guestfish-actions.pod:3939
12598 #: ../fish/guestfish-actions.pod:3941 ../src/guestfs-actions.pod:5968
12600 "Return the canonicalized absolute pathname of C<path>. The returned path "
12601 "has no C<.>, C<..> or symbolic link path elements."
12605 #: ../fish/guestfish-actions.pod:3944
12606 msgid "removexattr"
12610 #: ../fish/guestfish-actions.pod:3946
12613 " removexattr xattr path\n"
12618 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:5983
12620 "This call removes the extended attribute named C<xattr> of the file C<path>."
12624 #: ../fish/guestfish-actions.pod:3951
12625 msgid "See also: L</lremovexattr>, L<attr(5)>."
12629 #: ../fish/guestfish-actions.pod:3953
12634 #: ../fish/guestfish-actions.pod:3955
12637 " resize2fs device\n"
12642 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:5998
12644 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
12645 "underlying device."
12649 #: ../fish/guestfish-actions.pod:3960
12651 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
12652 "before calling this command. For unknown reasons C<resize2fs> sometimes "
12653 "gives an error about this and sometimes not. In any case, it is always safe "
12654 "to call L</e2fsck-f> before calling this function."
12658 #: ../fish/guestfish-actions.pod:3966
12659 msgid "resize2fs-M"
12663 #: ../fish/guestfish-actions.pod:3968
12666 " resize2fs-M device\n"
12671 #: ../fish/guestfish-actions.pod:3970
12673 "This command is the same as L</resize2fs>, but the filesystem is resized to "
12674 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
12679 #: ../fish/guestfish-actions.pod:3974
12681 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
12682 "and read the C<Block size> and C<Block count> values. These two numbers, "
12683 "multiplied together, give the resulting size of the minimal filesystem in "
12688 #: ../fish/guestfish-actions.pod:3979
12689 msgid "resize2fs-size"
12693 #: ../fish/guestfish-actions.pod:3981
12696 " resize2fs-size device size\n"
12701 #: ../fish/guestfish-actions.pod:3983
12703 "This command is the same as L</resize2fs> except that it allows you to "
12704 "specify the new size (in bytes) explicitly."
12708 #: ../fish/guestfish-actions.pod:3986
12713 #: ../fish/guestfish-actions.pod:3988
12721 #: ../fish/guestfish-actions.pod:3990 ../src/guestfs-actions.pod:6050
12722 msgid "Remove the single file C<path>."
12726 #: ../fish/guestfish-actions.pod:3992
12731 #: ../fish/guestfish-actions.pod:3994
12739 #: ../fish/guestfish-actions.pod:3996 ../src/guestfs-actions.pod:6062
12741 "Remove the file or directory C<path>, recursively removing the contents if "
12742 "its a directory. This is like the C<rm -rf> shell command."
12746 #: ../fish/guestfish-actions.pod:4000
12751 #: ../fish/guestfish-actions.pod:4002
12759 #: ../fish/guestfish-actions.pod:4004 ../src/guestfs-actions.pod:6076
12760 msgid "Remove the single directory C<path>."
12764 #: ../fish/guestfish-actions.pod:4006
12765 msgid "rmmountpoint"
12769 #: ../fish/guestfish-actions.pod:4008
12772 " rmmountpoint exemptpath\n"
12777 #: ../fish/guestfish-actions.pod:4010
12779 "This calls removes a mountpoint that was previously created with L</"
12780 "mkmountpoint>. See L</mkmountpoint> for full details."
12784 #: ../fish/guestfish-actions.pod:4014
12785 msgid "scrub-device"
12789 #: ../fish/guestfish-actions.pod:4016
12792 " scrub-device device\n"
12797 #: ../fish/guestfish-actions.pod:4018 ../src/guestfs-actions.pod:6102
12799 "This command writes patterns over C<device> to make data retrieval more "
12804 #: ../fish/guestfish-actions.pod:4021 ../fish/guestfish-actions.pod:4036
12805 #: ../fish/guestfish-actions.pod:4049 ../src/guestfs-actions.pod:6105
12806 #: ../src/guestfs-actions.pod:6126 ../src/guestfs-actions.pod:6145
12808 "It is an interface to the L<scrub(1)> program. See that manual page for "
12813 #: ../fish/guestfish-actions.pod:4027
12818 #: ../fish/guestfish-actions.pod:4029
12821 " scrub-file file\n"
12826 #: ../fish/guestfish-actions.pod:4031 ../src/guestfs-actions.pod:6121
12828 "This command writes patterns over a file to make data retrieval more "
12833 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6124
12834 msgid "The file is I<removed> after scrubbing."
12838 #: ../fish/guestfish-actions.pod:4039
12839 msgid "scrub-freespace"
12843 #: ../fish/guestfish-actions.pod:4041
12846 " scrub-freespace dir\n"
12851 #: ../fish/guestfish-actions.pod:4043
12853 "This command creates the directory C<dir> and then fills it with files until "
12854 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
12855 "deletes them. The intention is to scrub any free space on the partition "
12856 "containing C<dir>."
12860 #: ../fish/guestfish-actions.pod:4052
12865 #: ../fish/guestfish-actions.pod:4054
12870 #: ../fish/guestfish-actions.pod:4056
12873 " set-append append\n"
12878 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6158
12880 "This function is used to add additional options to the guest kernel command "
12885 #: ../fish/guestfish-actions.pod:4061 ../src/guestfs-actions.pod:6161
12887 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
12888 "environment variable."
12892 #: ../fish/guestfish-actions.pod:4064 ../src/guestfs-actions.pod:6164
12894 "Setting C<append> to C<NULL> means I<no> additional options are passed "
12895 "(libguestfs always adds a few of its own)."
12899 #: ../fish/guestfish-actions.pod:4067
12900 msgid "set-attach-method"
12904 #: ../fish/guestfish-actions.pod:4069
12905 msgid "attach-method"
12909 #: ../fish/guestfish-actions.pod:4071
12912 " set-attach-method attachmethod\n"
12917 #: ../fish/guestfish-actions.pod:4073 ../src/guestfs-actions.pod:6177
12919 "Set the method that libguestfs uses to connect to the back end guestfsd "
12920 "daemon. Possible methods are:"
12924 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6182
12925 #: ../src/guestfs.pod:2688
12926 msgid "C<appliance>"
12930 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6184
12932 "Launch an appliance and connect to it. This is the ordinary method and the "
12937 #: ../fish/guestfish-actions.pod:4083 ../src/guestfs-actions.pod:6187
12938 msgid "C<unix:I<path>>"
12942 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6189
12943 msgid "Connect to the Unix domain socket I<path>."
12947 #: ../fish/guestfish-actions.pod:4087 ../src/guestfs-actions.pod:6191
12949 "This method lets you connect to an existing daemon or (using virtio-serial) "
12950 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
12951 "RUNNING DAEMONS>."
12955 #: ../fish/guestfish-actions.pod:4093
12956 msgid "set-autosync"
12960 #: ../fish/guestfish-actions.pod:4095
12965 #: ../fish/guestfish-actions.pod:4097
12968 " set-autosync true|false\n"
12973 #: ../fish/guestfish-actions.pod:4099 ../src/guestfs-actions.pod:6207
12975 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
12976 "effort attempt to make filesystems consistent and synchronized when the "
12977 "handle is closed (also if the program exits without closing handles)."
12981 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6212
12983 "This is enabled by default (since libguestfs 1.5.24, previously it was "
12984 "disabled by default)."
12988 #: ../fish/guestfish-actions.pod:4107
12993 #: ../fish/guestfish-actions.pod:4109
12998 #: ../fish/guestfish-actions.pod:4111
13001 " set-direct true|false\n"
13006 #: ../fish/guestfish-actions.pod:4113 ../src/guestfs-actions.pod:6225
13008 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13009 "passed directly through to the appliance once it is launched."
13013 #: ../fish/guestfish-actions.pod:4117
13015 "One consequence of this is that log messages aren't caught by the library "
13016 "and handled by L</set-log-message-callback>, but go straight to stdout."
13020 #: ../fish/guestfish-actions.pod:4121 ../src/guestfs-actions.pod:6233
13021 msgid "You probably don't want to use this unless you know what you are doing."
13025 #: ../fish/guestfish-actions.pod:4124 ../src/guestfs-actions.pod:6236
13026 msgid "The default is disabled."
13030 #: ../fish/guestfish-actions.pod:4126
13031 msgid "set-e2label"
13035 #: ../fish/guestfish-actions.pod:4128
13038 " set-e2label device label\n"
13043 #: ../fish/guestfish-actions.pod:4130 ../src/guestfs-actions.pod:6249
13045 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13046 "C<label>. Filesystem labels are limited to 16 characters."
13050 #: ../fish/guestfish-actions.pod:4134
13052 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13053 "label on a filesystem."
13057 #: ../fish/guestfish-actions.pod:4137
13062 #: ../fish/guestfish-actions.pod:4139
13065 " set-e2uuid device uuid\n"
13070 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6267
13072 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13073 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13074 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13078 #: ../fish/guestfish-actions.pod:4146
13080 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13081 "UUID of a filesystem."
13085 #: ../fish/guestfish-actions.pod:4149
13086 msgid "set-memsize"
13090 #: ../fish/guestfish-actions.pod:4151
13095 #: ../fish/guestfish-actions.pod:4153
13098 " set-memsize memsize\n"
13103 #: ../fish/guestfish-actions.pod:4155
13105 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13106 "This only has any effect if called before L</launch>."
13110 #: ../fish/guestfish-actions.pod:4159 ../src/guestfs-actions.pod:6289
13112 "You can also change this by setting the environment variable "
13113 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13117 #: ../fish/guestfish-actions.pod:4166
13118 msgid "set-network"
13122 #: ../fish/guestfish-actions.pod:4168
13127 #: ../fish/guestfish-actions.pod:4170
13130 " set-network true|false\n"
13135 #: ../fish/guestfish-actions.pod:4172 ../src/guestfs-actions.pod:6306
13137 "If C<network> is true, then the network is enabled in the libguestfs "
13138 "appliance. The default is false."
13142 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6309
13144 "This affects whether commands are able to access the network (see L<guestfs"
13145 "(3)/RUNNING COMMANDS>)."
13149 #: ../fish/guestfish-actions.pod:4178
13151 "You must call this before calling L</launch>, otherwise it has no effect."
13155 #: ../fish/guestfish-actions.pod:4181
13160 #: ../fish/guestfish-actions.pod:4185
13163 " set-path searchpath\n"
13168 #: ../fish/guestfish-actions.pod:4187 ../src/guestfs-actions.pod:6325
13169 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13173 #: ../fish/guestfish-actions.pod:4189 ../src/guestfs-actions.pod:6327
13175 "The default is C<$libdir/guestfs> unless overridden by setting "
13176 "C<LIBGUESTFS_PATH> environment variable."
13180 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6330
13181 msgid "Setting C<path> to C<NULL> restores the default path."
13185 #: ../fish/guestfish-actions.pod:4194
13190 #: ../fish/guestfish-actions.pod:4196
13195 #: ../fish/guestfish-actions.pod:4198
13198 " set-pgroup true|false\n"
13203 #: ../fish/guestfish-actions.pod:4200 ../src/guestfs-actions.pod:6342
13205 "If C<pgroup> is true, child processes are placed into their own process "
13210 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6345
13212 "The practical upshot of this is that signals like C<SIGINT> (from users "
13213 "pressing C<^C>) won't be received by the child process."
13217 #: ../fish/guestfish-actions.pod:4206 ../src/guestfs-actions.pod:6348
13219 "The default for this flag is false, because usually you want C<^C> to kill "
13224 #: ../fish/guestfish-actions.pod:4209
13229 #: ../fish/guestfish-actions.pod:4211
13234 #: ../fish/guestfish-actions.pod:4213
13242 #: ../fish/guestfish-actions.pod:4215 ../src/guestfs-actions.pod:6361
13243 msgid "Set the qemu binary that we will use."
13247 #: ../fish/guestfish-actions.pod:4217 ../src/guestfs-actions.pod:6363
13249 "The default is chosen when the library was compiled by the configure script."
13253 #: ../fish/guestfish-actions.pod:4220 ../src/guestfs-actions.pod:6366
13255 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13260 #: ../fish/guestfish-actions.pod:4223 ../src/guestfs-actions.pod:6369
13261 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13265 #: ../fish/guestfish-actions.pod:4225 ../src/guestfs-actions.pod:6371
13267 "Note that you should call this function as early as possible after creating "
13268 "the handle. This is because some pre-launch operations depend on testing "
13269 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13270 "don't retest features, and so you might see inconsistent results. Using the "
13271 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13272 "the qemu binary at the same time as the handle is created."
13276 #: ../fish/guestfish-actions.pod:4233
13277 msgid "set-recovery-proc"
13281 #: ../fish/guestfish-actions.pod:4235
13282 msgid "recovery-proc"
13286 #: ../fish/guestfish-actions.pod:4237
13289 " set-recovery-proc true|false\n"
13294 #: ../fish/guestfish-actions.pod:4239
13296 "If this is called with the parameter C<false> then L</launch> does not "
13297 "create a recovery process. The purpose of the recovery process is to stop "
13298 "runaway qemu processes in the case where the main program aborts abruptly."
13302 #: ../fish/guestfish-actions.pod:4244
13304 "This only has any effect if called before L</launch>, and the default is "
13309 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6397
13311 "About the only time when you would want to disable this is if the main "
13312 "process will fork itself into the background (\"daemonize\" itself). In "
13313 "this case the recovery process thinks that the main program has disappeared "
13314 "and so kills qemu, which is not very helpful."
13318 #: ../fish/guestfish-actions.pod:4253
13319 msgid "set-selinux"
13323 #: ../fish/guestfish-actions.pod:4255
13328 #: ../fish/guestfish-actions.pod:4257
13331 " set-selinux true|false\n"
13336 #: ../fish/guestfish-actions.pod:4259 ../src/guestfs-actions.pod:6413
13338 "This sets the selinux flag that is passed to the appliance at boot time. "
13339 "The default is C<selinux=0> (disabled)."
13343 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6416
13345 "Note that if SELinux is enabled, it is always in Permissive mode "
13346 "(C<enforcing=0>)."
13350 #: ../fish/guestfish-actions.pod:4268
13355 #: ../fish/guestfish-actions.pod:4270
13360 #: ../fish/guestfish-actions.pod:4272
13363 " set-trace true|false\n"
13368 #: ../fish/guestfish-actions.pod:4274 ../src/guestfs-actions.pod:6432
13370 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
13371 "return values are traced."
13375 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6435
13377 "If you want to trace C API calls into libguestfs (and other libraries) then "
13378 "possibly a better way is to use the external ltrace(1) command."
13382 #: ../fish/guestfish-actions.pod:4281 ../src/guestfs-actions.pod:6439
13384 "Command traces are disabled unless the environment variable "
13385 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13389 #: ../fish/guestfish-actions.pod:4284
13391 "Trace messages are normally sent to C<stderr>, unless you register a "
13392 "callback to send them somewhere else (see L</set-event-callback>)."
13396 #: ../fish/guestfish-actions.pod:4288
13397 msgid "set-verbose"
13401 #: ../fish/guestfish-actions.pod:4290
13406 #: ../fish/guestfish-actions.pod:4292
13409 " set-verbose true|false\n"
13414 #: ../fish/guestfish-actions.pod:4294 ../src/guestfs-actions.pod:6456
13415 msgid "If C<verbose> is true, this turns on verbose messages."
13419 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6458
13421 "Verbose messages are disabled unless the environment variable "
13422 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13426 #: ../fish/guestfish-actions.pod:4299
13428 "Verbose messages are normally sent to C<stderr>, unless you register a "
13429 "callback to send them somewhere else (see L</set-event-callback>)."
13433 #: ../fish/guestfish-actions.pod:4303
13438 #: ../fish/guestfish-actions.pod:4305
13441 " setcon context\n"
13446 #: ../fish/guestfish-actions.pod:4307 ../src/guestfs-actions.pod:6475
13448 "This sets the SELinux security context of the daemon to the string "
13453 #: ../fish/guestfish-actions.pod:4310 ../src/guestfs-actions.pod:6478
13454 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13458 #: ../fish/guestfish-actions.pod:4312
13463 #: ../fish/guestfish-actions.pod:4314
13466 " setxattr xattr val vallen path\n"
13471 #: ../fish/guestfish-actions.pod:4316 ../src/guestfs-actions.pod:6493
13473 "This call sets the extended attribute named C<xattr> of the file C<path> to "
13474 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
13478 #: ../fish/guestfish-actions.pod:4320
13479 msgid "See also: L</lsetxattr>, L<attr(5)>."
13483 #: ../fish/guestfish-actions.pod:4322
13488 #: ../fish/guestfish-actions.pod:4324
13491 " sfdisk device cyls heads sectors 'lines ...'\n"
13496 #: ../fish/guestfish-actions.pod:4326 ../src/guestfs-actions.pod:6520
13498 "This is a direct interface to the L<sfdisk(8)> program for creating "
13499 "partitions on block devices."
13503 #: ../fish/guestfish-actions.pod:4329 ../src/guestfs-actions.pod:6523
13504 msgid "C<device> should be a block device, for example C</dev/sda>."
13508 #: ../fish/guestfish-actions.pod:4331 ../src/guestfs-actions.pod:6525
13510 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
13511 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
13512 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
13513 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
13514 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
13515 "the kernel) cannot work out the right geometry and you will need to tell it."
13519 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6533
13521 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
13522 "refer to the L<sfdisk(8)> manpage."
13526 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6536
13528 "To create a single partition occupying the whole disk, you would pass "
13529 "C<lines> as a single element list, when the single element being the string "
13534 #: ../fish/guestfish-actions.pod:4346
13535 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
13539 #: ../fish/guestfish-actions.pod:4352 ../fish/guestfish-actions.pod:4375
13540 #: ../fish/guestfish-actions.pod:4397
13542 "I<This function is deprecated.> In new code, use the L</part_add> call "
13547 #: ../fish/guestfish-actions.pod:4359
13552 #: ../fish/guestfish-actions.pod:4361
13555 " sfdiskM device 'lines ...'\n"
13560 #: ../fish/guestfish-actions.pod:4363
13562 "This is a simplified interface to the L</sfdisk> command, where partition "
13563 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
13564 "you don't need to specify the cyls, heads and sectors parameters which were "
13565 "rarely if ever used anyway."
13569 #: ../fish/guestfish-actions.pod:4369
13570 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
13574 #: ../fish/guestfish-actions.pod:4382
13579 #: ../fish/guestfish-actions.pod:4384
13582 " sfdisk-N device partnum cyls heads sectors line\n"
13587 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6598
13589 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
13590 "(note: C<n> counts from 1)."
13594 #: ../fish/guestfish-actions.pod:4389
13596 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
13597 "cyls/heads/sectors parameters."
13601 #: ../fish/guestfish-actions.pod:4392
13602 msgid "See also: L</part-add>"
13606 #: ../fish/guestfish-actions.pod:4404
13607 msgid "sfdisk-disk-geometry"
13611 #: ../fish/guestfish-actions.pod:4406
13614 " sfdisk-disk-geometry device\n"
13619 #: ../fish/guestfish-actions.pod:4408
13621 "This displays the disk geometry of C<device> read from the partition table. "
13622 "Especially in the case where the underlying block device has been resized, "
13623 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
13624 "kernel-geometry>)."
13628 #: ../fish/guestfish-actions.pod:4413 ../fish/guestfish-actions.pod:4422
13629 #: ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6640
13630 msgid "The result is in human-readable format, and not designed to be parsed."
13634 #: ../fish/guestfish-actions.pod:4416
13635 msgid "sfdisk-kernel-geometry"
13639 #: ../fish/guestfish-actions.pod:4418
13642 " sfdisk-kernel-geometry device\n"
13647 #: ../fish/guestfish-actions.pod:4420 ../src/guestfs-actions.pod:6638
13648 msgid "This displays the kernel's idea of the geometry of C<device>."
13652 #: ../fish/guestfish-actions.pod:4425
13657 #: ../fish/guestfish-actions.pod:4427
13660 " sfdisk-l device\n"
13665 #: ../fish/guestfish-actions.pod:4429 ../src/guestfs-actions.pod:6661
13667 "This displays the partition table on C<device>, in the human-readable output "
13668 "of the L<sfdisk(8)> command. It is not intended to be parsed."
13672 #: ../fish/guestfish-actions.pod:4433
13673 msgid "See also: L</part-list>"
13677 #: ../fish/guestfish-actions.pod:4435
13679 "I<This function is deprecated.> In new code, use the L</part_list> call "
13684 #: ../fish/guestfish-actions.pod:4442
13689 #: ../fish/guestfish-actions.pod:4444
13697 #: ../fish/guestfish-actions.pod:4446 ../src/guestfs-actions.pod:6678
13699 "This call runs a command from the guest filesystem via the guest's C</bin/"
13704 #: ../fish/guestfish-actions.pod:4449
13705 msgid "This is like L</command>, but passes the command to:"
13709 #: ../fish/guestfish-actions.pod:4451 ../src/guestfs-actions.pod:6683
13712 " /bin/sh -c \"command\"\n"
13717 #: ../fish/guestfish-actions.pod:4453 ../src/guestfs-actions.pod:6685
13719 "Depending on the guest's shell, this usually results in wildcards being "
13720 "expanded, shell expressions being interpolated and so on."
13724 #: ../fish/guestfish-actions.pod:4457
13725 msgid "All the provisos about L</command> apply to this call."
13729 #: ../fish/guestfish-actions.pod:4459
13734 #: ../fish/guestfish-actions.pod:4461
13737 " sh-lines command\n"
13742 #: ../fish/guestfish-actions.pod:4463
13743 msgid "This is the same as L</sh>, but splits the result into a list of lines."
13747 #: ../fish/guestfish-actions.pod:4466
13748 msgid "See also: L</command-lines>"
13752 #: ../fish/guestfish-actions.pod:4468
13757 #: ../fish/guestfish-actions.pod:4470
13765 #: ../fish/guestfish-actions.pod:4472 ../src/guestfs-actions.pod:6719
13766 msgid "Sleep for C<secs> seconds."
13770 #: ../fish/guestfish-actions.pod:4474
13775 #: ../fish/guestfish-actions.pod:4476
13783 #: ../fish/guestfish-actions.pod:4480 ../src/guestfs-actions.pod:6733
13784 msgid "This is the same as the C<stat(2)> system call."
13788 #: ../fish/guestfish-actions.pod:4482
13793 #: ../fish/guestfish-actions.pod:4484
13801 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6747
13803 "Returns file system statistics for any mounted file system. C<path> should "
13804 "be a file or directory in the mounted file system (typically it is the mount "
13805 "point itself, but it doesn't need to be)."
13809 #: ../fish/guestfish-actions.pod:4490 ../src/guestfs-actions.pod:6751
13810 msgid "This is the same as the C<statvfs(2)> system call."
13814 #: ../fish/guestfish-actions.pod:4492
13819 #: ../fish/guestfish-actions.pod:4494
13827 #: ../fish/guestfish-actions.pod:4496 ../src/guestfs-actions.pod:6765
13829 "This runs the L<strings(1)> command on a file and returns the list of "
13830 "printable strings found."
13834 #: ../fish/guestfish-actions.pod:4502
13839 #: ../fish/guestfish-actions.pod:4504
13842 " strings-e encoding path\n"
13847 #: ../fish/guestfish-actions.pod:4506
13849 "This is like the L</strings> command, but allows you to specify the encoding "
13850 "of strings that are looked for in the source file C<path>."
13854 #: ../fish/guestfish-actions.pod:4510 ../src/guestfs-actions.pod:6788
13855 msgid "Allowed encodings are:"
13859 #: ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6792
13864 #: ../fish/guestfish-actions.pod:4516
13866 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
13867 "ISO-8859-X (this is what L</strings> uses)."
13871 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6797
13876 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6799
13877 msgid "Single 8-bit-byte characters."
13881 #: ../fish/guestfish-actions.pod:4523 ../src/guestfs-actions.pod:6801
13886 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6803
13887 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
13891 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6806
13892 msgid "l (lower case letter L)"
13896 #: ../fish/guestfish-actions.pod:4530 ../src/guestfs-actions.pod:6808
13898 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
13899 "examining binaries in Windows guests."
13903 #: ../fish/guestfish-actions.pod:4533 ../src/guestfs-actions.pod:6811
13908 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6813
13909 msgid "32-bit big endian such as UCS-4BE."
13913 #: ../fish/guestfish-actions.pod:4537 ../src/guestfs-actions.pod:6815
13918 #: ../fish/guestfish-actions.pod:4539 ../src/guestfs-actions.pod:6817
13919 msgid "32-bit little endian such as UCS-4LE."
13923 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6821
13924 msgid "The returned strings are transcoded to UTF-8."
13928 #: ../fish/guestfish-actions.pod:4548
13929 msgid "swapoff-device"
13933 #: ../fish/guestfish-actions.pod:4550
13936 " swapoff-device device\n"
13941 #: ../fish/guestfish-actions.pod:4552
13943 "This command disables the libguestfs appliance swap device or partition "
13944 "named C<device>. See L</swapon-device>."
13948 #: ../fish/guestfish-actions.pod:4556
13949 msgid "swapoff-file"
13953 #: ../fish/guestfish-actions.pod:4558
13956 " swapoff-file file\n"
13961 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6852
13962 msgid "This command disables the libguestfs appliance swap on file."
13966 #: ../fish/guestfish-actions.pod:4562
13967 msgid "swapoff-label"
13971 #: ../fish/guestfish-actions.pod:4564
13974 " swapoff-label label\n"
13979 #: ../fish/guestfish-actions.pod:4566 ../src/guestfs-actions.pod:6864
13981 "This command disables the libguestfs appliance swap on labeled swap "
13986 #: ../fish/guestfish-actions.pod:4569
13987 msgid "swapoff-uuid"
13991 #: ../fish/guestfish-actions.pod:4571
13994 " swapoff-uuid uuid\n"
13999 #: ../fish/guestfish-actions.pod:4573 ../src/guestfs-actions.pod:6877
14001 "This command disables the libguestfs appliance swap partition with the given "
14006 #: ../fish/guestfish-actions.pod:4576
14007 msgid "swapon-device"
14011 #: ../fish/guestfish-actions.pod:4578
14014 " swapon-device device\n"
14019 #: ../fish/guestfish-actions.pod:4580
14021 "This command enables the libguestfs appliance to use the swap device or "
14022 "partition named C<device>. The increased memory is made available for all "
14023 "commands, for example those run using L</command> or L</sh>."
14027 #: ../fish/guestfish-actions.pod:4585 ../src/guestfs-actions.pod:6895
14029 "Note that you should not swap to existing guest swap partitions unless you "
14030 "know what you are doing. They may contain hibernation information, or other "
14031 "information that the guest doesn't want you to trash. You also risk leaking "
14032 "information about the host to the guest this way. Instead, attach a new "
14033 "host device to the guest and swap on that."
14037 #: ../fish/guestfish-actions.pod:4592
14038 msgid "swapon-file"
14042 #: ../fish/guestfish-actions.pod:4594
14045 " swapon-file file\n"
14050 #: ../fish/guestfish-actions.pod:4596
14052 "This command enables swap to a file. See L</swapon-device> for other notes."
14056 #: ../fish/guestfish-actions.pod:4599
14057 msgid "swapon-label"
14061 #: ../fish/guestfish-actions.pod:4601
14064 " swapon-label label\n"
14069 #: ../fish/guestfish-actions.pod:4603
14071 "This command enables swap to a labeled swap partition. See L</swapon-"
14072 "device> for other notes."
14076 #: ../fish/guestfish-actions.pod:4606
14077 msgid "swapon-uuid"
14081 #: ../fish/guestfish-actions.pod:4608
14084 " swapon-uuid uuid\n"
14089 #: ../fish/guestfish-actions.pod:4610
14091 "This command enables swap to a swap partition with the given UUID. See L</"
14092 "swapon-device> for other notes."
14096 #: ../fish/guestfish-actions.pod:4613
14101 #: ../fish/guestfish-actions.pod:4615
14109 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6950
14111 "This syncs the disk, so that any writes are flushed through to the "
14112 "underlying disk image."
14116 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6953
14118 "You should always call this if you have modified a disk image, before "
14119 "closing the handle."
14123 #: ../fish/guestfish-actions.pod:4623
14128 #: ../fish/guestfish-actions.pod:4625
14136 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6966
14138 "This command returns up to the last 10 lines of a file as a list of strings."
14142 #: ../fish/guestfish-actions.pod:4633
14147 #: ../fish/guestfish-actions.pod:4635
14150 " tail-n nrlines path\n"
14155 #: ../fish/guestfish-actions.pod:4637 ../src/guestfs-actions.pod:6985
14157 "If the parameter C<nrlines> is a positive number, this returns the last "
14158 "C<nrlines> lines of the file C<path>."
14162 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:6988
14164 "If the parameter C<nrlines> is a negative number, this returns lines from "
14165 "the file C<path>, starting with the C<-nrlines>th line."
14169 #: ../fish/guestfish-actions.pod:4648
14174 #: ../fish/guestfish-actions.pod:4650
14177 " tar-in (tarfile|-) directory\n"
14182 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7009
14184 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14185 "tar file) into C<directory>."
14189 #: ../fish/guestfish-actions.pod:4655
14190 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
14194 #: ../fish/guestfish-actions.pod:4660
14199 #: ../fish/guestfish-actions.pod:4662
14202 " tar-out directory (tarfile|-)\n"
14207 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7026
14209 "This command packs the contents of C<directory> and downloads it to local "
14214 #: ../fish/guestfish-actions.pod:4667
14215 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
14219 #: ../fish/guestfish-actions.pod:4672
14224 #: ../fish/guestfish-actions.pod:4674
14227 " tgz-in (tarball|-) directory\n"
14232 #: ../fish/guestfish-actions.pod:4676 ../src/guestfs-actions.pod:7043
14234 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14235 "tar file) into C<directory>."
14239 #: ../fish/guestfish-actions.pod:4679
14240 msgid "To upload an uncompressed tarball, use L</tar-in>."
14244 #: ../fish/guestfish-actions.pod:4683
14249 #: ../fish/guestfish-actions.pod:4685
14252 " tgz-out directory (tarball|-)\n"
14257 #: ../fish/guestfish-actions.pod:4687 ../src/guestfs-actions.pod:7059
14259 "This command packs the contents of C<directory> and downloads it to local "
14264 #: ../fish/guestfish-actions.pod:4690
14265 msgid "To download an uncompressed tarball, use L</tar-out>."
14269 #: ../fish/guestfish-actions.pod:4694
14274 #: ../fish/guestfish-actions.pod:4696
14282 #: ../fish/guestfish-actions.pod:4698 ../src/guestfs-actions.pod:7074
14284 "Touch acts like the L<touch(1)> command. It can be used to update the "
14285 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14290 #: ../fish/guestfish-actions.pod:4702 ../src/guestfs-actions.pod:7078
14292 "This command only works on regular files, and will fail on other file types "
14293 "such as directories, symbolic links, block special etc."
14297 #: ../fish/guestfish-actions.pod:4705
14302 #: ../fish/guestfish-actions.pod:4707
14310 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7091
14312 "This command truncates C<path> to a zero-length file. The file must exist "
14317 #: ../fish/guestfish-actions.pod:4712
14318 msgid "truncate-size"
14322 #: ../fish/guestfish-actions.pod:4714
14325 " truncate-size path size\n"
14330 #: ../fish/guestfish-actions.pod:4716 ../src/guestfs-actions.pod:7105
14332 "This command truncates C<path> to size C<size> bytes. The file must exist "
14337 #: ../fish/guestfish-actions.pod:4719
14339 "If the current file size is less than C<size> then the file is extended to "
14340 "the required size with zero bytes. This creates a sparse file (ie. disk "
14341 "blocks are not allocated for the file until you write to it). To create a "
14342 "non-sparse file of zeroes, use L</fallocate64> instead."
14346 #: ../fish/guestfish-actions.pod:4725
14351 #: ../fish/guestfish-actions.pod:4727
14354 " tune2fs-l device\n"
14359 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7124
14361 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
14366 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7127
14368 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
14369 "for more details. The list of fields returned isn't clearly defined, and "
14370 "depends on both the version of C<tune2fs> that libguestfs was built against, "
14371 "and the filesystem itself."
14375 #: ../fish/guestfish-actions.pod:4737
14380 #: ../fish/guestfish-actions.pod:4739
14383 " txz-in (tarball|-) directory\n"
14388 #: ../fish/guestfish-actions.pod:4741 ../src/guestfs-actions.pod:7147
14390 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
14391 "tar file) into C<directory>."
14395 #: ../fish/guestfish-actions.pod:4746
14400 #: ../fish/guestfish-actions.pod:4748
14403 " txz-out directory (tarball|-)\n"
14408 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7161
14410 "This command packs the contents of C<directory> and downloads it to local "
14411 "file C<tarball> (as an xz compressed tar archive)."
14415 #: ../fish/guestfish-actions.pod:4755
14420 #: ../fish/guestfish-actions.pod:4757
14428 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7174
14430 "This function sets the mask used for creating new files and device nodes to "
14435 #: ../fish/guestfish-actions.pod:4762 ../src/guestfs-actions.pod:7177
14437 "Typical umask values would be C<022> which creates new files with "
14438 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
14439 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
14443 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7182
14445 "The default umask is C<022>. This is important because it means that "
14446 "directories and device nodes will be created with C<0644> or C<0755> mode "
14447 "even if you specify C<0777>."
14451 #: ../fish/guestfish-actions.pod:4771
14452 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
14456 #: ../fish/guestfish-actions.pod:4774 ../src/guestfs-actions.pod:7189
14457 msgid "This call returns the previous umask."
14461 #: ../fish/guestfish-actions.pod:4776
14466 #: ../fish/guestfish-actions.pod:4778
14471 #: ../fish/guestfish-actions.pod:4780
14474 " umount pathordevice\n"
14479 #: ../fish/guestfish-actions.pod:4782 ../src/guestfs-actions.pod:7201
14481 "This unmounts the given filesystem. The filesystem may be specified either "
14482 "by its mountpoint (path) or the device which contains the filesystem."
14486 #: ../fish/guestfish-actions.pod:4786
14491 #: ../fish/guestfish-actions.pod:4788
14492 msgid "unmount-all"
14496 #: ../fish/guestfish-actions.pod:4790
14504 #: ../fish/guestfish-actions.pod:4792 ../src/guestfs-actions.pod:7214
14505 msgid "This unmounts all mounted filesystems."
14509 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7216
14510 msgid "Some internal mounts are not unmounted by this call."
14514 #: ../fish/guestfish-actions.pod:4796
14519 #: ../fish/guestfish-actions.pod:4798
14522 " upload (filename|-) remotefilename\n"
14527 #: ../fish/guestfish-actions.pod:4800 ../fish/guestfish-actions.pod:4813
14528 #: ../src/guestfs-actions.pod:7229 ../src/guestfs-actions.pod:7253
14529 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
14533 #: ../fish/guestfish-actions.pod:4805
14534 msgid "See also L</download>."
14538 #: ../fish/guestfish-actions.pod:4809
14539 msgid "upload-offset"
14543 #: ../fish/guestfish-actions.pod:4811
14546 " upload-offset (filename|-) remotefilename offset\n"
14551 #: ../fish/guestfish-actions.pod:4816 ../src/guestfs-actions.pod:7256
14553 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
14554 "The intention is to overwrite parts of existing files or devices, although "
14555 "if a non-existant file is specified then it is created with a \"hole\" "
14556 "before C<offset>. The size of the data written is implicit in the size of "
14557 "the source C<filename>."
14561 #: ../fish/guestfish-actions.pod:4823
14563 "Note that there is no limit on the amount of data that can be uploaded with "
14564 "this call, unlike with L</pwrite>, and this call always writes the full "
14565 "amount unless an error occurs."
14569 #: ../fish/guestfish-actions.pod:4828
14570 msgid "See also L</upload>, L</pwrite>."
14574 #: ../fish/guestfish-actions.pod:4832
14579 #: ../fish/guestfish-actions.pod:4834
14582 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
14587 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7289
14588 msgid "This command sets the timestamps of a file with nanosecond precision."
14592 #: ../fish/guestfish-actions.pod:4839 ../src/guestfs-actions.pod:7292
14594 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
14599 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7295
14601 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
14602 "nanoseconds from the epoch."
14606 #: ../fish/guestfish-actions.pod:4845 ../src/guestfs-actions.pod:7298
14608 "If the C<*nsecs> field contains the special value C<-1> then the "
14609 "corresponding timestamp is set to the current time. (The C<*secs> field is "
14610 "ignored in this case)."
14614 #: ../fish/guestfish-actions.pod:4849 ../src/guestfs-actions.pod:7302
14616 "If the C<*nsecs> field contains the special value C<-2> then the "
14617 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
14622 #: ../fish/guestfish-actions.pod:4853
14627 #: ../fish/guestfish-actions.pod:4855
14635 #: ../fish/guestfish-actions.pod:4857 ../src/guestfs-actions.pod:7315
14637 "Return the libguestfs version number that the program is linked against."
14641 #: ../fish/guestfish-actions.pod:4860 ../src/guestfs-actions.pod:7318
14643 "Note that because of dynamic linking this is not necessarily the version of "
14644 "libguestfs that you compiled against. You can compile the program, and then "
14645 "at runtime dynamically link against a completely different C<libguestfs.so> "
14650 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7323
14652 "This call was added in version C<1.0.58>. In previous versions of "
14653 "libguestfs there was no way to get the version number. From C code you can "
14654 "use dynamic linker functions to find out if this symbol exists (if it "
14655 "doesn't, then it's an earlier version)."
14659 #: ../fish/guestfish-actions.pod:4871 ../src/guestfs-actions.pod:7329
14661 "The call returns a structure with four elements. The first three (C<major>, "
14662 "C<minor> and C<release>) are numbers and correspond to the usual version "
14663 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
14664 "but may be used for distro-specific information."
14668 #: ../fish/guestfish-actions.pod:4877 ../src/guestfs-actions.pod:7335
14670 "To construct the original version string: C<$major.$minor.$release$extra>"
14674 #: ../fish/guestfish-actions.pod:4880 ../src/guestfs-actions.pod:7338
14675 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
14679 #: ../fish/guestfish-actions.pod:4882
14681 "I<Note:> Don't use this call to test for availability of features. In "
14682 "enterprise distributions we backport features from later versions into "
14683 "earlier versions, making this an unreliable way to test for features. Use "
14684 "L</available> instead."
14688 #: ../fish/guestfish-actions.pod:4888
14693 #: ../fish/guestfish-actions.pod:4890
14696 " vfs-label device\n"
14701 #: ../fish/guestfish-actions.pod:4892 ../src/guestfs-actions.pod:7358
14702 msgid "This returns the filesystem label of the filesystem on C<device>."
14706 #: ../fish/guestfish-actions.pod:4895 ../src/guestfs-actions.pod:7361
14707 msgid "If the filesystem is unlabeled, this returns the empty string."
14711 #: ../fish/guestfish-actions.pod:4897
14712 msgid "To find a filesystem from the label, use L</findfs-label>."
14716 #: ../fish/guestfish-actions.pod:4899
14721 #: ../fish/guestfish-actions.pod:4901
14724 " vfs-type device\n"
14729 #: ../fish/guestfish-actions.pod:4903 ../src/guestfs-actions.pod:7376
14731 "This command gets the filesystem type corresponding to the filesystem on "
14736 #: ../fish/guestfish-actions.pod:4906 ../src/guestfs-actions.pod:7379
14738 "For most filesystems, the result is the name of the Linux VFS module which "
14739 "would be used to mount this filesystem if you mounted it without specifying "
14740 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
14744 #: ../fish/guestfish-actions.pod:4911
14749 #: ../fish/guestfish-actions.pod:4913
14752 " vfs-uuid device\n"
14757 #: ../fish/guestfish-actions.pod:4915 ../src/guestfs-actions.pod:7395
14758 msgid "This returns the filesystem UUID of the filesystem on C<device>."
14762 #: ../fish/guestfish-actions.pod:4918 ../src/guestfs-actions.pod:7398
14763 msgid "If the filesystem does not have a UUID, this returns the empty string."
14767 #: ../fish/guestfish-actions.pod:4920
14768 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
14772 #: ../fish/guestfish-actions.pod:4922
14773 msgid "vg-activate"
14777 #: ../fish/guestfish-actions.pod:4924
14780 " vg-activate true|false 'volgroups ...'\n"
14785 #: ../fish/guestfish-actions.pod:4926 ../src/guestfs-actions.pod:7414
14787 "This command activates or (if C<activate> is false) deactivates all logical "
14788 "volumes in the listed volume groups C<volgroups>."
14792 #: ../fish/guestfish-actions.pod:4929 ../src/guestfs-actions.pod:7417
14793 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
14797 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7419
14799 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
14800 "activated or deactivated."
14804 #: ../fish/guestfish-actions.pod:4934
14805 msgid "vg-activate-all"
14809 #: ../fish/guestfish-actions.pod:4936
14812 " vg-activate-all true|false\n"
14817 #: ../fish/guestfish-actions.pod:4938 ../src/guestfs-actions.pod:7432
14819 "This command activates or (if C<activate> is false) deactivates all logical "
14820 "volumes in all volume groups."
14824 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7435
14825 msgid "This command is the same as running C<vgchange -a y|n>"
14829 #: ../fish/guestfish-actions.pod:4943
14834 #: ../fish/guestfish-actions.pod:4945
14837 " vgcreate volgroup 'physvols ...'\n"
14842 #: ../fish/guestfish-actions.pod:4947 ../src/guestfs-actions.pod:7448
14844 "This creates an LVM volume group called C<volgroup> from the non-empty list "
14845 "of physical volumes C<physvols>."
14849 #: ../fish/guestfish-actions.pod:4950
14854 #: ../fish/guestfish-actions.pod:4952
14857 " vglvuuids vgname\n"
14862 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7461
14864 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
14865 "volumes created in this volume group."
14869 #: ../fish/guestfish-actions.pod:4957
14871 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
14872 "logical volumes and volume groups."
14876 #: ../fish/guestfish-actions.pod:4960
14877 msgid "See also L</vgpvuuids>."
14881 #: ../fish/guestfish-actions.pod:4962
14886 #: ../fish/guestfish-actions.pod:4964
14889 " vgpvuuids vgname\n"
14894 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7481
14896 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
14897 "volumes that this volume group resides on."
14901 #: ../fish/guestfish-actions.pod:4969
14903 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
14904 "physical volumes and volume groups."
14908 #: ../fish/guestfish-actions.pod:4972
14909 msgid "See also L</vglvuuids>."
14913 #: ../fish/guestfish-actions.pod:4974
14918 #: ../fish/guestfish-actions.pod:4976
14921 " vgremove vgname\n"
14926 #: ../fish/guestfish-actions.pod:4978 ../src/guestfs-actions.pod:7501
14927 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
14931 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7503
14933 "This also forcibly removes all logical volumes in the volume group (if any)."
14937 #: ../fish/guestfish-actions.pod:4983
14942 #: ../fish/guestfish-actions.pod:4985
14945 " vgrename volgroup newvolgroup\n"
14950 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7517
14951 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
14955 #: ../fish/guestfish-actions.pod:4989
14960 #: ../fish/guestfish-actions.pod:4991
14968 #: ../fish/guestfish-actions.pod:4993 ../src/guestfs-actions.pod:7528
14970 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
14975 #: ../fish/guestfish-actions.pod:4996 ../src/guestfs-actions.pod:7531
14977 "This returns a list of just the volume group names that were detected (eg. "
14982 #: ../fish/guestfish-actions.pod:4999
14983 msgid "See also L</vgs-full>."
14987 #: ../fish/guestfish-actions.pod:5001
14992 #: ../fish/guestfish-actions.pod:5003
15000 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7547
15002 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15003 "> command. The \"full\" version includes all fields."
15007 #: ../fish/guestfish-actions.pod:5008
15012 #: ../fish/guestfish-actions.pod:5010
15020 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7561
15022 "This rescans all block devices and rebuilds the list of LVM physical "
15023 "volumes, volume groups and logical volumes."
15027 #: ../fish/guestfish-actions.pod:5015
15032 #: ../fish/guestfish-actions.pod:5017
15040 #: ../fish/guestfish-actions.pod:5019 ../src/guestfs-actions.pod:7574
15041 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15045 #: ../fish/guestfish-actions.pod:5021
15050 #: ../fish/guestfish-actions.pod:5023
15058 #: ../fish/guestfish-actions.pod:5025 ../src/guestfs-actions.pod:7614
15060 "This command counts the characters in a file, using the C<wc -c> external "
15065 #: ../fish/guestfish-actions.pod:5028
15070 #: ../fish/guestfish-actions.pod:5030
15078 #: ../fish/guestfish-actions.pod:5032 ../src/guestfs-actions.pod:7627
15080 "This command counts the lines in a file, using the C<wc -l> external command."
15084 #: ../fish/guestfish-actions.pod:5035
15089 #: ../fish/guestfish-actions.pod:5037
15097 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7640
15099 "This command counts the words in a file, using the C<wc -w> external command."
15103 #: ../fish/guestfish-actions.pod:5042
15108 #: ../fish/guestfish-actions.pod:5044
15111 " write path content\n"
15116 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7655
15118 "This call creates a file called C<path>. The content of the file is the "
15119 "string C<content> (which can contain any 8 bit data)."
15123 #: ../fish/guestfish-actions.pod:5049
15124 msgid "See also L</write-append>."
15128 #: ../fish/guestfish-actions.pod:5054
15129 msgid "write-append"
15133 #: ../fish/guestfish-actions.pod:5056
15136 " write-append path content\n"
15141 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7675
15143 "This call appends C<content> to the end of file C<path>. If C<path> does "
15144 "not exist, then a new file is created."
15148 #: ../fish/guestfish-actions.pod:5061
15149 msgid "See also L</write>."
15153 #: ../fish/guestfish-actions.pod:5066
15158 #: ../fish/guestfish-actions.pod:5068
15161 " write-file path content size\n"
15166 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7702
15168 "This call creates a file called C<path>. The contents of the file is the "
15169 "string C<content> (which can contain any 8 bit data), with length C<size>."
15173 #: ../fish/guestfish-actions.pod:5074 ../src/guestfs-actions.pod:7706
15175 "As a special case, if C<size> is C<0> then the length is calculated using "
15176 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15180 #: ../fish/guestfish-actions.pod:5078 ../src/guestfs-actions.pod:7710
15182 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15183 "I<not> work, even if the length is specified."
15187 #: ../fish/guestfish-actions.pod:5084
15189 "I<This function is deprecated.> In new code, use the L</write> call instead."
15193 #: ../fish/guestfish-actions.pod:5091
15198 #: ../fish/guestfish-actions.pod:5093
15201 " zegrep regex path\n"
15206 #: ../fish/guestfish-actions.pod:5095 ../src/guestfs-actions.pod:7727
15208 "This calls the external C<zegrep> program and returns the matching lines."
15212 #: ../fish/guestfish-actions.pod:5101
15217 #: ../fish/guestfish-actions.pod:5103
15220 " zegrepi regex path\n"
15225 #: ../fish/guestfish-actions.pod:5105 ../src/guestfs-actions.pod:7746
15227 "This calls the external C<zegrep -i> program and returns the matching lines."
15231 #: ../fish/guestfish-actions.pod:5111
15236 #: ../fish/guestfish-actions.pod:5113
15244 #: ../fish/guestfish-actions.pod:5115 ../src/guestfs-actions.pod:7764
15245 msgid "This command writes zeroes over the first few blocks of C<device>."
15249 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7766
15251 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15252 "securely wipe the device). It should be sufficient to remove any partition "
15253 "tables, filesystem superblocks and so on."
15257 #: ../fish/guestfish-actions.pod:5121
15258 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
15262 #: ../fish/guestfish-actions.pod:5124
15263 msgid "zero-device"
15267 #: ../fish/guestfish-actions.pod:5126
15270 " zero-device device\n"
15275 #: ../fish/guestfish-actions.pod:5128
15277 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
15278 "which just zeroes the first few blocks of a device."
15282 #: ../fish/guestfish-actions.pod:5135
15287 #: ../fish/guestfish-actions.pod:5137
15290 " zerofree device\n"
15295 #: ../fish/guestfish-actions.pod:5139 ../src/guestfs-actions.pod:7810
15297 "This runs the I<zerofree> program on C<device>. This program claims to zero "
15298 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
15299 "possible to compress the filesystem more effectively."
15303 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7815
15304 msgid "You should B<not> run this program if the filesystem is mounted."
15308 #: ../fish/guestfish-actions.pod:5147 ../src/guestfs-actions.pod:7818
15310 "It is possible that using this program can damage the filesystem or data on "
15315 #: ../fish/guestfish-actions.pod:5150
15320 #: ../fish/guestfish-actions.pod:5152
15323 " zfgrep pattern path\n"
15328 #: ../fish/guestfish-actions.pod:5154 ../src/guestfs-actions.pod:7832
15330 "This calls the external C<zfgrep> program and returns the matching lines."
15334 #: ../fish/guestfish-actions.pod:5160
15339 #: ../fish/guestfish-actions.pod:5162
15342 " zfgrepi pattern path\n"
15347 #: ../fish/guestfish-actions.pod:5164 ../src/guestfs-actions.pod:7851
15349 "This calls the external C<zfgrep -i> program and returns the matching lines."
15353 #: ../fish/guestfish-actions.pod:5170
15358 #: ../fish/guestfish-actions.pod:5172
15361 " zfile meth path\n"
15366 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7877
15368 "This command runs C<file> after first decompressing C<path> using C<method>."
15372 #: ../fish/guestfish-actions.pod:5177 ../src/guestfs-actions.pod:7880
15373 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
15377 #: ../fish/guestfish-actions.pod:5179
15379 "Since 1.0.63, use L</file> instead which can now process compressed files."
15383 #: ../fish/guestfish-actions.pod:5182
15385 "I<This function is deprecated.> In new code, use the L</file> call instead."
15389 #: ../fish/guestfish-actions.pod:5189
15394 #: ../fish/guestfish-actions.pod:5191
15397 " zgrep regex path\n"
15402 #: ../fish/guestfish-actions.pod:5193 ../src/guestfs-actions.pod:7897
15404 "This calls the external C<zgrep> program and returns the matching lines."
15408 #: ../fish/guestfish-actions.pod:5199
15413 #: ../fish/guestfish-actions.pod:5201
15416 " zgrepi regex path\n"
15421 #: ../fish/guestfish-actions.pod:5203 ../src/guestfs-actions.pod:7916
15423 "This calls the external C<zgrep -i> program and returns the matching lines."
15427 #: ../fish/guestfish-commands.pod:1
15432 #: ../fish/guestfish-commands.pod:3
15437 #: ../fish/guestfish-commands.pod:5
15440 " alloc filename size\n"
15445 #: ../fish/guestfish-commands.pod:7
15447 "This creates an empty (zeroed) file of the given size, and then adds so it "
15448 "can be further examined."
15452 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
15453 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
15457 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
15458 msgid "Size can be specified using standard suffixes, eg. C<1M>."
15462 #: ../fish/guestfish-commands.pod:14
15464 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
15465 "image, see L</PREPARED DISK IMAGES>."
15469 #: ../fish/guestfish-commands.pod:17
15474 #: ../fish/guestfish-commands.pod:19
15477 " copy-in local [local ...] /remotedir\n"
15482 #: ../fish/guestfish-commands.pod:21
15484 "C<copy-in> copies local files or directories recursively into the disk "
15485 "image, placing them in the directory called C</remotedir> (which must "
15486 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
15487 "other commands as necessary."
15491 #: ../fish/guestfish-commands.pod:26
15493 "Multiple local files and directories can be specified, but the last "
15494 "parameter must always be a remote directory. Wildcards cannot be used."
15498 #: ../fish/guestfish-commands.pod:30
15503 #: ../fish/guestfish-commands.pod:32
15506 " copy-out remote [remote ...] localdir\n"
15511 #: ../fish/guestfish-commands.pod:34
15513 "C<copy-out> copies remote files or directories recursively out of the disk "
15514 "image, placing them on the host disk in a local directory called C<localdir> "
15515 "(which must exist). This guestfish meta-command turns into a sequence of L</"
15516 "download>, L</tar-out> and other commands as necessary."
15520 #: ../fish/guestfish-commands.pod:40
15522 "Multiple remote files and directories can be specified, but the last "
15523 "parameter must always be a local directory. To download to the current "
15524 "directory, use C<.> as in:"
15528 #: ../fish/guestfish-commands.pod:44
15531 " copy-out /home .\n"
15536 #: ../fish/guestfish-commands.pod:46
15538 "Wildcards cannot be used in the ordinary command, but you can use them with "
15539 "the help of L</glob> like this:"
15543 #: ../fish/guestfish-commands.pod:49
15546 " glob copy-out /home/* .\n"
15551 #: ../fish/guestfish-commands.pod:51
15556 #: ../fish/guestfish-commands.pod:53
15559 " display filename\n"
15564 #: ../fish/guestfish-commands.pod:55
15566 "Use C<display> (a graphical display program) to display an image file. It "
15567 "downloads the file, and runs C<display> on it."
15571 #: ../fish/guestfish-commands.pod:58
15573 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
15574 "environment variable. For example to use the GNOME display program:"
15578 #: ../fish/guestfish-commands.pod:61
15581 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
15586 #: ../fish/guestfish-commands.pod:63
15587 msgid "See also L<display(1)>."
15591 #: ../fish/guestfish-commands.pod:65
15596 #: ../fish/guestfish-commands.pod:67
15599 " echo [params ...]\n"
15604 #: ../fish/guestfish-commands.pod:69
15605 msgid "This echos the parameters to the terminal."
15609 #: ../fish/guestfish-commands.pod:71
15614 #: ../fish/guestfish-commands.pod:73
15619 #: ../fish/guestfish-commands.pod:75
15624 #: ../fish/guestfish-commands.pod:77
15632 #: ../fish/guestfish-commands.pod:79
15634 "This is used to edit a file. It downloads the file, edits it locally using "
15635 "your editor, then uploads the result."
15639 #: ../fish/guestfish-commands.pod:82
15641 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
15642 "or C<emacs> you will get those corresponding editors."
15646 #: ../fish/guestfish-commands.pod:86
15651 #: ../fish/guestfish-commands.pod:88
15654 " glob command args...\n"
15659 #: ../fish/guestfish-commands.pod:90
15661 "Expand wildcards in any paths in the args list, and run C<command> "
15662 "repeatedly on each matching path."
15666 #: ../fish/guestfish-commands.pod:93
15667 msgid "See L</WILDCARDS AND GLOBBING>."
15671 #: ../fish/guestfish-commands.pod:95
15676 #: ../fish/guestfish-commands.pod:97
15679 " hexedit <filename|device>\n"
15680 " hexedit <filename|device> <max>\n"
15681 " hexedit <filename|device> <start> <max>\n"
15686 #: ../fish/guestfish-commands.pod:101
15688 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
15693 #: ../fish/guestfish-commands.pod:104
15695 "This command works by downloading potentially the whole file or device, "
15696 "editing it locally, then uploading it. If the file or device is large, you "
15697 "have to specify which part you wish to edit by using C<max> and/or C<start> "
15698 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
15699 "usual modifiers allowed such as C<1M> (1 megabyte)."
15703 #: ../fish/guestfish-commands.pod:111
15704 msgid "For example to edit the first few sectors of a disk you might do:"
15708 #: ../fish/guestfish-commands.pod:114
15711 " hexedit /dev/sda 1M\n"
15716 #: ../fish/guestfish-commands.pod:116
15718 "which would allow you to edit anywhere within the first megabyte of the disk."
15722 #: ../fish/guestfish-commands.pod:119
15723 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
15727 #: ../fish/guestfish-commands.pod:121
15730 " hexedit /dev/sda1 0x400 0x400\n"
15735 #: ../fish/guestfish-commands.pod:123
15736 msgid "(assuming the superblock is in the standard location)."
15740 #: ../fish/guestfish-commands.pod:125
15742 "This command requires the external L<hexedit(1)> program. You can specify "
15743 "another program to use by setting the C<HEXEDITOR> environment variable."
15747 #: ../fish/guestfish-commands.pod:129
15748 msgid "See also L</hexdump>."
15752 #: ../fish/guestfish-commands.pod:131
15757 #: ../fish/guestfish-commands.pod:133
15765 #: ../fish/guestfish-commands.pod:135
15767 "Change the local directory, ie. the current directory of guestfish itself."
15771 #: ../fish/guestfish-commands.pod:138
15772 msgid "Note that C<!cd> won't do what you might expect."
15776 #: ../fish/guestfish-commands.pod:140
15781 #: ../fish/guestfish-commands.pod:142
15786 #: ../fish/guestfish-commands.pod:144
15794 #: ../fish/guestfish-commands.pod:146
15795 msgid "Opens the manual page for guestfish."
15799 #: ../fish/guestfish-commands.pod:148
15804 #: ../fish/guestfish-commands.pod:150
15809 #: ../fish/guestfish-commands.pod:152
15817 #: ../fish/guestfish-commands.pod:154
15825 #: ../fish/guestfish-commands.pod:156
15826 msgid "This is used to view a file."
15830 #: ../fish/guestfish-commands.pod:158
15832 "The default viewer is C<$PAGER>. However if you use the alternate command "
15833 "C<less> you will get the C<less> command specifically."
15837 #: ../fish/guestfish-commands.pod:161
15842 #: ../fish/guestfish-commands.pod:163
15850 #: ../fish/guestfish-commands.pod:165
15852 "Close and reopen the libguestfs handle. It is not necessary to use this "
15853 "normally, because the handle is closed properly when guestfish exits. "
15854 "However this is occasionally useful for testing."
15858 #: ../fish/guestfish-commands.pod:169
15863 #: ../fish/guestfish-commands.pod:171
15866 " setenv VAR value\n"
15871 #: ../fish/guestfish-commands.pod:173
15872 msgid "Set the environment variable C<VAR> to the string C<value>."
15876 #: ../fish/guestfish-commands.pod:175
15878 "To print the value of an environment variable use a shell command such as:"
15882 #: ../fish/guestfish-commands.pod:178
15890 #: ../fish/guestfish-commands.pod:180
15895 #: ../fish/guestfish-commands.pod:182
15898 " sparse filename size\n"
15903 #: ../fish/guestfish-commands.pod:184
15905 "This creates an empty sparse file of the given size, and then adds so it can "
15906 "be further examined."
15910 #: ../fish/guestfish-commands.pod:187
15912 "In all respects it works the same as the L</alloc> command, except that the "
15913 "image file is allocated sparsely, which means that disk blocks are not "
15914 "assigned to the file until they are needed. Sparse disk files only use "
15915 "space when written to, but they are slower and there is a danger you could "
15916 "run out of real disk space during a write operation."
15920 #: ../fish/guestfish-commands.pod:197
15925 #: ../fish/guestfish-commands.pod:199
15933 #: ../fish/guestfish-commands.pod:201
15935 "This command returns a list of the optional groups known to the daemon, and "
15936 "indicates which ones are supported by this build of the libguestfs appliance."
15940 #: ../fish/guestfish-commands.pod:205
15941 msgid "See also L<guestfs(3)/AVAILABILITY>."
15945 #: ../fish/guestfish-commands.pod:207
15950 #: ../fish/guestfish-commands.pod:209
15953 " time command args...\n"
15958 #: ../fish/guestfish-commands.pod:211
15960 "Run the command as usual, but print the elapsed time afterwards. This can "
15961 "be useful for benchmarking operations."
15965 #: ../fish/guestfish-commands.pod:214
15970 #: ../fish/guestfish-commands.pod:216
15978 #: ../fish/guestfish-commands.pod:218
15979 msgid "Remove C<VAR> from the environment."
15983 #: ../fish/guestfish.pod:5
15984 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
15988 #: ../fish/guestfish.pod:9
15991 " guestfish [--options] [commands]\n"
15996 #: ../fish/guestfish.pod:11
16004 #: ../fish/guestfish.pod:13
16007 " guestfish [--ro|--rw] -a disk.img\n"
16012 #: ../fish/guestfish.pod:15
16015 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16020 #: ../fish/guestfish.pod:17
16023 " guestfish -d libvirt-domain\n"
16028 #: ../fish/guestfish.pod:19
16031 " guestfish [--ro|--rw] -a disk.img -i\n"
16036 #: ../fish/guestfish.pod:21
16039 " guestfish -d libvirt-domain -i\n"
16044 #: ../fish/guestfish.pod:25
16046 "Using guestfish in read/write mode on live virtual machines can be "
16047 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16048 "option to use guestfish safely if the disk image or virtual machine might be "
16053 #: ../fish/guestfish.pod:32
16055 "Guestfish is a shell and command-line tool for examining and modifying "
16056 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16057 "functionality of the guestfs API, see L<guestfs(3)>."
16061 #: ../fish/guestfish.pod:36
16063 "Guestfish gives you structured access to the libguestfs API, from shell "
16064 "scripts or the command line or interactively. If you want to rescue a "
16065 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16070 #: ../fish/guestfish.pod:43
16071 msgid "As an interactive shell"
16075 #: ../fish/guestfish.pod:45
16083 #: ../fish/guestfish.pod:47
16086 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16087 " editing virtual machine filesystems.\n"
16092 #: ../fish/guestfish.pod:50
16095 " Type: 'help' for a list of commands\n"
16096 " 'man' to read the manual\n"
16097 " 'quit' to quit the shell\n"
16102 #: ../fish/guestfish.pod:54
16105 " ><fs> add-ro disk.img\n"
16107 " ><fs> list-filesystems\n"
16108 " /dev/sda1: ext4\n"
16109 " /dev/vg_guest/lv_root: ext4\n"
16110 " /dev/vg_guest/lv_swap: swap\n"
16111 " ><fs> mount /dev/vg_guest/lv_root /\n"
16112 " ><fs> cat /etc/fstab\n"
16114 " # Created by anaconda\n"
16121 #: ../fish/guestfish.pod:67
16122 msgid "From shell scripts"
16126 #: ../fish/guestfish.pod:69
16127 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16131 #: ../fish/guestfish.pod:71
16134 " guestfish <<_EOF_\n"
16137 " mount /dev/vg_guest/lv_root /\n"
16138 " write /etc/motd \"Welcome, new users\"\n"
16144 #: ../fish/guestfish.pod:78
16145 msgid "List the LVM logical volumes in a disk image:"
16149 #: ../fish/guestfish.pod:80
16152 " guestfish -a disk.img --ro <<_EOF_\n"
16160 #: ../fish/guestfish.pod:85
16161 msgid "List all the filesystems in a disk image:"
16165 #: ../fish/guestfish.pod:87
16168 " guestfish -a disk.img --ro <<_EOF_\n"
16170 " list-filesystems\n"
16176 #: ../fish/guestfish.pod:92
16177 msgid "On one command line"
16181 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
16182 msgid "Update C</etc/resolv.conf> in a guest:"
16186 #: ../fish/guestfish.pod:96
16190 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
16191 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
16196 #: ../fish/guestfish.pod:100
16197 msgid "Edit C</boot/grub/grub.conf> interactively:"
16201 #: ../fish/guestfish.pod:102
16204 " guestfish --rw --add disk.img \\\n"
16205 " --mount /dev/vg_guest/lv_root \\\n"
16206 " --mount /dev/sda1:/boot \\\n"
16207 " edit /boot/grub/grub.conf\n"
16212 #: ../fish/guestfish.pod:107
16213 msgid "Mount disks automatically"
16217 #: ../fish/guestfish.pod:109
16219 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
16223 #: ../fish/guestfish.pod:112
16226 " guestfish --ro -a disk.img -i cat /etc/group\n"
16231 #: ../fish/guestfish.pod:114
16234 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
16239 #: ../fish/guestfish.pod:116
16240 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
16244 #: ../fish/guestfish.pod:118
16247 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
16252 #: ../fish/guestfish.pod:120
16253 msgid "As a script interpreter"
16257 #: ../fish/guestfish.pod:122
16258 msgid "Create a 100MB disk containing an ext2-formatted partition:"
16262 #: ../fish/guestfish.pod:124
16265 " #!/usr/bin/guestfish -f\n"
16266 " sparse test1.img 100M\n"
16268 " part-disk /dev/sda mbr\n"
16269 " mkfs ext2 /dev/sda1\n"
16274 #: ../fish/guestfish.pod:130
16275 msgid "Start with a prepared disk"
16279 #: ../fish/guestfish.pod:132
16281 "An alternate way to create a 100MB disk called C<test1.img> containing a "
16282 "single ext2-formatted partition:"
16286 #: ../fish/guestfish.pod:135
16289 " guestfish -N fs\n"
16294 #: ../fish/guestfish.pod:137
16295 msgid "To list what is available do:"
16299 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:998
16302 " guestfish -N help | less\n"
16307 #: ../fish/guestfish.pod:141
16308 msgid "Remote control"
16312 #: ../fish/guestfish.pod:143
16315 " eval \"`guestfish --listen`\"\n"
16316 " guestfish --remote add-ro disk.img\n"
16317 " guestfish --remote run\n"
16318 " guestfish --remote lvs\n"
16323 #: ../fish/guestfish.pod:154
16324 msgid "Displays general help on options."
16328 #: ../fish/guestfish.pod:158
16329 msgid "B<--cmd-help>"
16333 #: ../fish/guestfish.pod:160
16334 msgid "Lists all available guestfish commands."
16338 #: ../fish/guestfish.pod:162
16343 #: ../fish/guestfish.pod:164
16344 msgid "B<--cmd-help cmd>"
16348 #: ../fish/guestfish.pod:166
16349 msgid "Displays detailed help on a single command C<cmd>."
16353 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
16354 msgid "B<-a image>"
16358 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
16359 msgid "B<--add image>"
16363 #: ../fish/guestfish.pod:172
16364 msgid "Add a block device or virtual machine image to the shell."
16368 #: ../fish/guestfish.pod:177
16370 "Using this flag is mostly equivalent to using the C<add> command, with "
16371 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
16372 "the I<--format=...> flag was given."
16376 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
16378 "When used in conjunction with the I<-d> option, this specifies the libvirt "
16379 "URI to use. The default is to use the default libvirt connection."
16383 #: ../fish/guestfish.pod:189
16388 #: ../fish/guestfish.pod:191
16390 "If using the I<--listen> option and a csh-like shell, use this option. See "
16391 "section L</REMOTE CONTROL AND CSH> below."
16395 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
16396 msgid "B<-d libvirt-domain>"
16400 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
16401 msgid "B<--domain libvirt-domain>"
16405 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
16407 "Add disks from the named libvirt domain. If the I<--ro> option is also "
16408 "used, then any libvirt domain can be used. However in write mode, only "
16409 "libvirt domains which are shut down can be named here."
16413 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
16414 msgid "Domain UUIDs can be used instead of names."
16418 #: ../fish/guestfish.pod:204
16420 "Using this flag is mostly equivalent to using the C<add-domain> command, "
16421 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
16422 "if the I<--format:...> flag was given."
16426 #: ../fish/guestfish.pod:208
16431 #: ../fish/guestfish.pod:210
16432 msgid "B<--no-dest-paths>"
16436 #: ../fish/guestfish.pod:212
16438 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
16439 "to hit the tab key to complete paths on the guest filesystem, but this "
16440 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
16441 "allow this feature to be disabled."
16445 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
16447 "When prompting for keys and passphrases, guestfish normally turns echoing "
16448 "off so you cannot see what you are typing. If you are not worried about "
16449 "Tempest attacks and there is no one else in the room you can specify this "
16450 "flag to see what you are typing."
16454 #: ../fish/guestfish.pod:224
16459 #: ../fish/guestfish.pod:226
16460 msgid "B<--file file>"
16464 #: ../fish/guestfish.pod:228
16465 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
16469 #: ../fish/guestfish.pod:231
16472 " #!/usr/bin/guestfish -f\n"
16477 #: ../fish/guestfish.pod:244
16480 " guestfish --format=raw -a disk.img\n"
16485 #: ../fish/guestfish.pod:248
16488 " guestfish --format=raw -a disk.img --format -a another.img\n"
16493 #: ../fish/guestfish.pod:253
16495 "If you have untrusted raw-format guest disk images, you should use this "
16496 "option to specify the disk format. This avoids a possible security problem "
16497 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
16501 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
16502 msgid "B<--inspector>"
16506 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
16508 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
16509 "system and mount filesystems as they would be mounted on the real virtual "
16514 #: ../fish/guestfish.pod:266
16515 msgid "Typical usage is either:"
16519 #: ../fish/guestfish.pod:268
16522 " guestfish -d myguest -i\n"
16527 #: ../fish/guestfish.pod:270
16528 msgid "(for an inactive libvirt domain called I<myguest>), or:"
16532 #: ../fish/guestfish.pod:272
16535 " guestfish --ro -d myguest -i\n"
16540 #: ../fish/guestfish.pod:274
16541 msgid "(for active domains, readonly), or specify the block device directly:"
16545 #: ../fish/guestfish.pod:276
16548 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
16553 #: ../fish/guestfish.pod:278
16555 "Note that the command line syntax changed slightly over older versions of "
16556 "guestfish. You can still use the old syntax:"
16560 #: ../fish/guestfish.pod:281
16563 " guestfish [--ro] -i disk.img\n"
16568 #: ../fish/guestfish.pod:283
16571 " guestfish [--ro] -i libvirt-domain\n"
16576 #: ../fish/guestfish.pod:285
16578 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
16579 "then using other commands to mount the filesystems that were found."
16583 #: ../fish/guestfish.pod:294
16584 msgid "B<--listen>"
16588 #: ../fish/guestfish.pod:296
16590 "Fork into the background and listen for remote commands. See section L</"
16591 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
16595 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
16600 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
16602 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
16603 "ATTACHING TO RUNNING DAEMONS>)."
16607 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
16608 msgid "B<-m dev[:mountpoint[:options]]>"
16612 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
16613 msgid "B<--mount dev[:mountpoint[:options]]>"
16617 #: ../fish/guestfish.pod:308
16618 msgid "Mount the named partition or logical volume on the given mountpoint."
16622 #: ../fish/guestfish.pod:310
16623 msgid "If the mountpoint is omitted, it defaults to C</>."
16627 #: ../fish/guestfish.pod:312
16628 msgid "You have to mount something on C</> before most commands will work."
16632 #: ../fish/guestfish.pod:314
16634 "If any I<-m> or I<--mount> options are given, the guest is automatically "
16639 #: ../fish/guestfish.pod:317
16641 "If you don't know what filesystems a disk image contains, you can either run "
16642 "guestfish without this option, then list the partitions, filesystems and LVs "
16643 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
16644 "commands), or you can use the L<virt-filesystems(1)> program."
16648 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
16650 "The third (and rarely used) part of the mount parameter is the list of mount "
16651 "options used to mount the underlying filesystem. If this is not given, then "
16652 "the mount options are either the empty string or C<ro> (the latter if the "
16653 "I<--ro> flag is used). By specifying the mount options, you override this "
16654 "default choice. Probably the only time you would use this is to enable ACLs "
16655 "and/or extended attributes if the filesystem can support them:"
16659 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
16662 " -m /dev/sda1:/:acl,user_xattr\n"
16667 #: ../fish/guestfish.pod:333
16668 msgid "Using this flag is equivalent to using the C<mount-options> command."
16672 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193
16673 #: ../resize/virt-resize.pod:352
16678 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
16679 msgid "B<--no-sync>"
16683 #: ../fish/guestfish.pod:339
16685 "Disable autosync. This is enabled by default. See the discussion of "
16686 "autosync in the L<guestfs(3)> manpage."
16690 #: ../fish/guestfish.pod:342
16695 #: ../fish/guestfish.pod:344
16696 msgid "B<--new type>"
16700 #: ../fish/guestfish.pod:346
16705 #: ../fish/guestfish.pod:348
16707 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
16708 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
16709 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
16714 #: ../fish/guestfish.pod:353
16715 msgid "B<--progress-bars>"
16719 #: ../fish/guestfish.pod:355
16720 msgid "Enable progress bars, even when guestfish is used non-interactively."
16724 #: ../fish/guestfish.pod:357
16726 "Progress bars are enabled by default when guestfish is used as an "
16727 "interactive shell."
16731 #: ../fish/guestfish.pod:360
16732 msgid "B<--no-progress-bars>"
16736 #: ../fish/guestfish.pod:362
16737 msgid "Disable progress bars."
16741 #: ../fish/guestfish.pod:364
16742 msgid "B<--remote[=pid]>"
16746 #: ../fish/guestfish.pod:366
16748 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
16749 "CONTROL GUESTFISH OVER A SOCKET> below."
16753 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239
16754 #: ../rescue/virt-rescue.pod:161
16759 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241
16760 #: ../rescue/virt-rescue.pod:163
16765 #: ../fish/guestfish.pod:373
16767 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16768 "mounts are done read-only."
16772 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
16774 "The option must always be used if the disk image or virtual machine might be "
16775 "running, and is generally recommended in cases where you don't need write "
16776 "access to the disk."
16780 #: ../fish/guestfish.pod:380
16782 "Note that prepared disk images created with I<-N> are not affected by this "
16783 "option. Also commands like C<add> are not affected - you have to specify "
16784 "the C<readonly:true> option explicitly if you need it."
16788 #: ../fish/guestfish.pod:384
16789 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
16793 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253
16794 #: ../rescue/virt-rescue.pod:173
16795 msgid "B<--selinux>"
16799 #: ../fish/guestfish.pod:388
16800 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
16804 #: ../fish/guestfish.pod:394
16806 "Enable very verbose messages. This is particularly useful if you find a bug."
16810 #: ../fish/guestfish.pod:401
16811 msgid "Display the guestfish / libguestfs version number and exit."
16815 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269
16816 #: ../rescue/virt-rescue.pod:190
16821 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271
16822 #: ../rescue/virt-rescue.pod:192
16827 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
16829 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
16830 "mounts are done read-write."
16834 #: ../fish/guestfish.pod:410
16835 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
16839 #: ../fish/guestfish.pod:414
16840 msgid "Echo each command before executing it."
16844 #: ../fish/guestfish.pod:418
16845 msgid "COMMANDS ON COMMAND LINE"
16849 #: ../fish/guestfish.pod:420
16851 "Any additional (non-option) arguments are treated as commands to execute."
16855 #: ../fish/guestfish.pod:423
16857 "Commands to execute should be separated by a colon (C<:>), where the colon "
16858 "is a separate parameter. Thus:"
16862 #: ../fish/guestfish.pod:426
16865 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
16870 #: ../fish/guestfish.pod:428
16872 "If there are no additional arguments, then we enter a shell, either an "
16873 "interactive shell with a prompt (if the input is a terminal) or a non-"
16874 "interactive shell."
16878 #: ../fish/guestfish.pod:432
16880 "In either command line mode or non-interactive shell, the first command that "
16881 "gives an error causes the whole shell to exit. In interactive mode (with a "
16882 "prompt) if a command fails, you can continue to enter commands."
16886 #: ../fish/guestfish.pod:437
16887 msgid "USING launch (OR run)"
16891 #: ../fish/guestfish.pod:439
16893 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
16894 "then launch it, then mount any disks you need, and finally issue actions/"
16895 "commands. So the general order of the day is:"
16899 #: ../fish/guestfish.pod:447
16900 msgid "add or -a/--add"
16904 #: ../fish/guestfish.pod:451
16905 msgid "launch (aka run)"
16909 #: ../fish/guestfish.pod:455
16910 msgid "mount or -m/--mount"
16914 #: ../fish/guestfish.pod:459
16915 msgid "any other commands"
16919 #: ../fish/guestfish.pod:463
16921 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
16922 "guest before mounting or performing any other commands."
16926 #: ../fish/guestfish.pod:466
16928 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
16929 "I<--new> options were given then C<run> is done automatically, simply "
16930 "because guestfish can't perform the action you asked for without doing this."
16934 #: ../fish/guestfish.pod:471
16935 msgid "OPENING DISKS FOR READ AND WRITE"
16939 #: ../fish/guestfish.pod:473
16941 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
16942 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
16943 "I<-i> and I<-m> open disk images read-only or for writing."
16947 #: ../fish/guestfish.pod:478
16949 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
16950 "opening disk images supplied on the command line for write. To open a disk "
16951 "image read-only you have to do I<-a image --ro>."
16955 #: ../fish/guestfish.pod:482
16957 "This matters: If you accidentally open a live VM disk image writable then "
16958 "you will cause irreversible disk corruption."
16962 #: ../fish/guestfish.pod:485
16964 "In a future libguestfs we intend to change the default the other way. Disk "
16965 "images will be opened read-only. You will have to either specify "
16966 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
16967 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
16968 "access for disk images specified by those other command line options."
16972 #: ../fish/guestfish.pod:492
16974 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
16975 "which does nothing (it is already the default). However it is highly "
16976 "recommended that you use this option to indicate that you need write access, "
16977 "and prepare your scripts for the day when this option will be required for "
16982 #: ../fish/guestfish.pod:498
16984 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
16985 "other libguestfs program apart from guestfish and guestmount."
16989 #: ../fish/guestfish.pod:501
16994 #: ../fish/guestfish.pod:503
16996 "You can quote ordinary parameters using either single or double quotes. For "
17001 #: ../fish/guestfish.pod:506
17004 " add \"file with a space.img\"\n"
17009 #: ../fish/guestfish.pod:508
17012 " rm '/file name'\n"
17017 #: ../fish/guestfish.pod:510
17025 #: ../fish/guestfish.pod:512
17027 "A few commands require a list of strings to be passed. For these, use a "
17028 "whitespace-separated list, enclosed in quotes. Strings containing "
17029 "whitespace to be passed through must be enclosed in single quotes. A "
17030 "literal single quote must be escaped with a backslash."
17034 #: ../fish/guestfish.pod:517
17037 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17038 " command \"/bin/echo 'foo bar'\"\n"
17039 " command \"/bin/echo \\'foo\\'\"\n"
17044 #: ../fish/guestfish.pod:521
17045 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17049 #: ../fish/guestfish.pod:523
17051 "In double-quoted arguments (only) use backslash to insert special characters:"
17055 #: ../fish/guestfish.pod:528
17060 #: ../fish/guestfish.pod:530
17061 msgid "Alert (bell) character."
17065 #: ../fish/guestfish.pod:532
17070 #: ../fish/guestfish.pod:534
17071 msgid "Backspace character."
17075 #: ../fish/guestfish.pod:536
17080 #: ../fish/guestfish.pod:538
17081 msgid "Form feed character."
17085 #: ../fish/guestfish.pod:540
17090 #: ../fish/guestfish.pod:542
17091 msgid "Newline character."
17095 #: ../fish/guestfish.pod:544
17100 #: ../fish/guestfish.pod:546
17101 msgid "Carriage return character."
17105 #: ../fish/guestfish.pod:548
17110 #: ../fish/guestfish.pod:550
17111 msgid "Horizontal tab character."
17115 #: ../fish/guestfish.pod:552
17120 #: ../fish/guestfish.pod:554
17121 msgid "Vertical tab character."
17125 #: ../fish/guestfish.pod:556
17130 #: ../fish/guestfish.pod:558
17131 msgid "A literal double quote character."
17135 #: ../fish/guestfish.pod:560
17140 #: ../fish/guestfish.pod:562
17142 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
17147 #: ../fish/guestfish.pod:565
17152 #: ../fish/guestfish.pod:567
17154 "A character with hex value I<hh>. There must be precisely 2 hex digits."
17158 #: ../fish/guestfish.pod:570
17160 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
17165 #: ../fish/guestfish.pod:573
17170 #: ../fish/guestfish.pod:575
17171 msgid "A literal backslash character."
17175 #: ../fish/guestfish.pod:579
17176 msgid "OPTIONAL ARGUMENTS"
17180 #: ../fish/guestfish.pod:581
17182 "Some commands take optional arguments. These arguments appear in this "
17183 "documentation as C<[argname:..]>. You can use them as in these examples:"
17187 #: ../fish/guestfish.pod:585
17190 " add-drive-opts filename\n"
17195 #: ../fish/guestfish.pod:587
17198 " add-drive-opts filename readonly:true\n"
17203 #: ../fish/guestfish.pod:589
17206 " add-drive-opts filename format:qcow2 readonly:false\n"
17211 #: ../fish/guestfish.pod:591
17213 "Each optional argument can appear at most once. All optional arguments must "
17214 "appear after the required ones."
17218 #: ../fish/guestfish.pod:594
17223 #: ../fish/guestfish.pod:596
17225 "This section applies to all commands which can take integers as parameters."
17229 #: ../fish/guestfish.pod:599
17230 msgid "SIZE SUFFIX"
17234 #: ../fish/guestfish.pod:601
17236 "When the command takes a parameter measured in bytes, you can use one of the "
17237 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17241 #: ../fish/guestfish.pod:607
17242 msgid "B<k> or B<K> or B<KiB>"
17246 #: ../fish/guestfish.pod:609
17247 msgid "The size in kilobytes (multiplied by 1024)."
17251 #: ../fish/guestfish.pod:611
17256 #: ../fish/guestfish.pod:613
17257 msgid "The size in SI 1000 byte units."
17261 #: ../fish/guestfish.pod:615
17262 msgid "B<M> or B<MiB>"
17266 #: ../fish/guestfish.pod:617
17267 msgid "The size in megabytes (multiplied by 1048576)."
17271 #: ../fish/guestfish.pod:619
17276 #: ../fish/guestfish.pod:621
17277 msgid "The size in SI 1000000 byte units."
17281 #: ../fish/guestfish.pod:623
17282 msgid "B<G> or B<GiB>"
17286 #: ../fish/guestfish.pod:625
17287 msgid "The size in gigabytes (multiplied by 2**30)."
17291 #: ../fish/guestfish.pod:627
17296 #: ../fish/guestfish.pod:629
17297 msgid "The size in SI 10**9 byte units."
17301 #: ../fish/guestfish.pod:631
17302 msgid "B<T> or B<TiB>"
17306 #: ../fish/guestfish.pod:633
17307 msgid "The size in terabytes (multiplied by 2**40)."
17311 #: ../fish/guestfish.pod:635
17316 #: ../fish/guestfish.pod:637
17317 msgid "The size in SI 10**12 byte units."
17321 #: ../fish/guestfish.pod:639
17322 msgid "B<P> or B<PiB>"
17326 #: ../fish/guestfish.pod:641
17327 msgid "The size in petabytes (multiplied by 2**50)."
17331 #: ../fish/guestfish.pod:643
17336 #: ../fish/guestfish.pod:645
17337 msgid "The size in SI 10**15 byte units."
17341 #: ../fish/guestfish.pod:647
17342 msgid "B<E> or B<EiB>"
17346 #: ../fish/guestfish.pod:649
17347 msgid "The size in exabytes (multiplied by 2**60)."
17351 #: ../fish/guestfish.pod:651
17356 #: ../fish/guestfish.pod:653
17357 msgid "The size in SI 10**18 byte units."
17361 #: ../fish/guestfish.pod:655
17362 msgid "B<Z> or B<ZiB>"
17366 #: ../fish/guestfish.pod:657
17367 msgid "The size in zettabytes (multiplied by 2**70)."
17371 #: ../fish/guestfish.pod:659
17376 #: ../fish/guestfish.pod:661
17377 msgid "The size in SI 10**21 byte units."
17381 #: ../fish/guestfish.pod:663
17382 msgid "B<Y> or B<YiB>"
17386 #: ../fish/guestfish.pod:665
17387 msgid "The size in yottabytes (multiplied by 2**80)."
17391 #: ../fish/guestfish.pod:667
17396 #: ../fish/guestfish.pod:669
17397 msgid "The size in SI 10**24 byte units."
17401 #: ../fish/guestfish.pod:675
17404 " truncate-size /file 1G\n"
17409 #: ../fish/guestfish.pod:677
17410 msgid "would truncate the file to 1 gigabyte."
17414 #: ../fish/guestfish.pod:679
17416 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
17417 "the parameter to L</memsize> is specified in megabytes already). Adding a "
17418 "suffix will probably not do what you expect."
17422 #: ../fish/guestfish.pod:683
17423 msgid "OCTAL AND HEXADECIMAL NUMBERS"
17427 #: ../fish/guestfish.pod:685
17429 "For specifying the radix (base) use the C convention: C<0> to prefix an "
17430 "octal number or C<0x> to prefix a hexadecimal number. For example:"
17434 #: ../fish/guestfish.pod:688
17437 " 1234 decimal number 1234\n"
17438 " 02322 octal number, equivalent to decimal 1234\n"
17439 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
17444 #: ../fish/guestfish.pod:692
17446 "When using the C<chmod> command, you almost always want to specify an octal "
17447 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
17448 "L<chmod(1)> program):"
17452 #: ../fish/guestfish.pod:696
17455 " chmod 0777 /public # OK\n"
17456 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
17461 #: ../fish/guestfish.pod:699
17463 "Commands that return numbers usually print them in decimal, but some "
17464 "commands print numbers in other radices (eg. C<umask> prints the mode in "
17465 "octal, preceeded by C<0>)."
17469 #: ../fish/guestfish.pod:703
17470 msgid "WILDCARDS AND GLOBBING"
17474 #: ../fish/guestfish.pod:705
17476 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
17477 "(globbing) by default. So for example the following will not do what you "
17482 #: ../fish/guestfish.pod:709
17490 #: ../fish/guestfish.pod:711
17492 "Assuming you don't have a directory called literally C</home/*> then the "
17493 "above command will return an error."
17497 #: ../fish/guestfish.pod:714
17498 msgid "To perform wildcard expansion, use the C<glob> command."
17502 #: ../fish/guestfish.pod:716
17505 " glob rm-rf /home/*\n"
17510 #: ../fish/guestfish.pod:718
17512 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
17513 "many times), equivalent to:"
17517 #: ../fish/guestfish.pod:721
17520 " rm-rf /home/jim\n"
17521 " rm-rf /home/joe\n"
17522 " rm-rf /home/mary\n"
17527 #: ../fish/guestfish.pod:725
17528 msgid "C<glob> only works on simple guest paths and not on device names."
17532 #: ../fish/guestfish.pod:727
17534 "If you have several parameters, each containing a wildcard, then glob will "
17535 "perform a Cartesian product."
17539 #: ../fish/guestfish.pod:730
17544 #: ../fish/guestfish.pod:732
17546 "Any line which starts with a I<#> character is treated as a comment and "
17547 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
17548 "a command. For example:"
17552 #: ../fish/guestfish.pod:736
17555 " # this is a comment\n"
17556 " # this is a comment\n"
17557 " foo # NOT a comment\n"
17562 #: ../fish/guestfish.pod:740
17563 msgid "Blank lines are also ignored."
17567 #: ../fish/guestfish.pod:742
17568 msgid "RUNNING COMMANDS LOCALLY"
17572 #: ../fish/guestfish.pod:744
17574 "Any line which starts with a I<!> character is treated as a command sent to "
17575 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
17579 #: ../fish/guestfish.pod:748
17583 " tgz-out /remote local/remote-data.tar.gz\n"
17588 #: ../fish/guestfish.pod:751
17590 "will create a directory C<local> on the host, and then export the contents "
17591 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
17592 "(See C<tgz-out>)."
17596 #: ../fish/guestfish.pod:755
17598 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
17599 "effect, due to the way that subprocesses work in Unix."
17603 #: ../fish/guestfish.pod:758
17604 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
17608 #: ../fish/guestfish.pod:760
17610 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
17611 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
17612 "and executed as guestfish commands."
17616 #: ../fish/guestfish.pod:764
17618 "Thus you can use shell script to construct arbitrary guestfish commands "
17619 "which are then parsed by guestfish."
17623 #: ../fish/guestfish.pod:767
17625 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
17626 "through C</foo.100>) using guestfish commands alone. However this is simple "
17627 "if we use a shell script to create the guestfish commands for us:"
17631 #: ../fish/guestfish.pod:772
17634 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
17639 #: ../fish/guestfish.pod:774
17640 msgid "or with names like C</foo.001>:"
17644 #: ../fish/guestfish.pod:776
17647 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
17652 #: ../fish/guestfish.pod:778
17654 "When using guestfish interactively it can be helpful to just run the shell "
17655 "script first (ie. remove the initial C<E<lt>> character so it is just an "
17656 "ordinary I<!> local command), see what guestfish commands it would run, and "
17657 "when you are happy with those prepend the C<E<lt>> character to run the "
17658 "guestfish commands for real."
17662 #: ../fish/guestfish.pod:784
17667 #: ../fish/guestfish.pod:786
17669 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
17670 "command (a guestfish command) to the second command (any host command). For "
17675 #: ../fish/guestfish.pod:790
17678 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
17683 #: ../fish/guestfish.pod:792
17685 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
17686 "program). The above command would list all accounts in the guest filesystem "
17687 "which have UID 0, ie. root accounts including backdoors. Other examples:"
17691 #: ../fish/guestfish.pod:797
17694 " hexdump /bin/ls | head\n"
17695 " list-devices | tail -1\n"
17696 " tgz-out / - | tar ztf -\n"
17701 #: ../fish/guestfish.pod:801
17703 "The space before the pipe symbol is required, any space after the pipe "
17704 "symbol is optional. Everything after the pipe symbol is just passed "
17705 "straight to the host shell, so it can contain redirections, globs and "
17706 "anything else that makes sense on the host side."
17710 #: ../fish/guestfish.pod:806
17712 "To use a literal argument which begins with a pipe symbol, you have to quote "
17717 #: ../fish/guestfish.pod:809
17725 #: ../fish/guestfish.pod:811
17726 msgid "HOME DIRECTORIES"
17730 #: ../fish/guestfish.pod:813
17732 "If a parameter starts with the character C<~> then the tilde may be expanded "
17733 "as a home directory path (either C<~> for the current user's home directory, "
17734 "or C<~user> for another user)."
17738 #: ../fish/guestfish.pod:817
17740 "Note that home directory expansion happens for users known I<on the host>, "
17741 "not in the guest filesystem."
17745 #: ../fish/guestfish.pod:820
17747 "To use a literal argument which begins with a tilde, you have to quote it, "
17752 #: ../fish/guestfish.pod:823
17760 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
17761 msgid "ENCRYPTED DISKS"
17765 #: ../fish/guestfish.pod:827
17767 "Libguestfs has some support for Linux guests encrypted according to the "
17768 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
17769 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
17770 "LUKS is supported."
17774 #: ../fish/guestfish.pod:832
17775 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
17779 #: ../fish/guestfish.pod:834
17782 " ><fs> vfs-type /dev/sda2\n"
17788 #: ../fish/guestfish.pod:837
17790 "Then open those devices using L</luks-open>. This creates a device-mapper "
17791 "device called C</dev/mapper/luksdev>."
17795 #: ../fish/guestfish.pod:840
17798 " ><fs> luks-open /dev/sda2 luksdev\n"
17799 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
17804 #: ../fish/guestfish.pod:843
17806 "Finally you have to tell LVM to scan for volume groups on the newly created "
17811 #: ../fish/guestfish.pod:846
17815 " vg-activate-all true\n"
17820 #: ../fish/guestfish.pod:849
17821 msgid "The logical volume(s) can now be mounted in the usual way."
17825 #: ../fish/guestfish.pod:851
17827 "Before closing a LUKS device you must unmount any logical volumes on it and "
17828 "deactivate the volume groups by calling C<vg-activate false VG> on each "
17829 "one. Then you can close the mapper device:"
17833 #: ../fish/guestfish.pod:855
17836 " vg-activate false /dev/VG\n"
17837 " luks-close /dev/mapper/luksdev\n"
17842 #: ../fish/guestfish.pod:860
17844 "If a path is prefixed with C<win:> then you can use Windows-style drive "
17845 "letters and paths (with some limitations). The following commands are "
17850 #: ../fish/guestfish.pod:864
17853 " file /WINDOWS/system32/config/system.LOG\n"
17858 #: ../fish/guestfish.pod:866
17861 " file win:\\windows\\system32\\config\\system.log\n"
17866 #: ../fish/guestfish.pod:868
17869 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
17874 #: ../fish/guestfish.pod:870
17876 "The parameter is rewritten \"behind the scenes\" by looking up the position "
17877 "where the drive is mounted, prepending that to the path, changing all "
17878 "backslash characters to forward slash, then resolving the result using L</"
17879 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
17880 "the parameter might be rewritten like this:"
17884 #: ../fish/guestfish.pod:876
17887 " win:e:\\foo\\bar => /e/FOO/bar\n"
17892 #: ../fish/guestfish.pod:878
17893 msgid "This only works in argument positions that expect a path."
17897 #: ../fish/guestfish.pod:880
17898 msgid "UPLOADING AND DOWNLOADING FILES"
17902 #: ../fish/guestfish.pod:882
17904 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
17905 "others which upload from or download to a local file, you can use the "
17906 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
17910 #: ../fish/guestfish.pod:886
17918 #: ../fish/guestfish.pod:888
17920 "reads stdin and creates from that a file C</foo> in the disk image, and:"
17924 #: ../fish/guestfish.pod:891
17927 " tar-out /etc - | tar tf -\n"
17932 #: ../fish/guestfish.pod:893
17934 "writes the tarball to stdout and then pipes that into the external \"tar\" "
17935 "command (see L</PIPES>)."
17939 #: ../fish/guestfish.pod:896
17941 "When using C<-> to read from stdin, the input is read up to the end of "
17942 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
17943 "some arbitrary end marker:"
17947 #: ../fish/guestfish.pod:900
17950 " upload -<<END /foo\n"
17959 #: ../fish/guestfish.pod:906
17961 "Any string of characters can be used instead of C<END>. The end marker must "
17962 "appear on a line of its own, without any preceeding or following characters "
17963 "(not even spaces)."
17967 #: ../fish/guestfish.pod:910
17969 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
17970 "upload local files (so-called \"FileIn\" parameters in the generator)."
17974 #: ../fish/guestfish.pod:913
17975 msgid "EXIT ON ERROR BEHAVIOUR"
17979 #: ../fish/guestfish.pod:915
17981 "By default, guestfish will ignore any errors when in interactive mode (ie. "
17982 "taking commands from a human over a tty), and will exit on the first error "
17983 "in non-interactive mode (scripts, commands given on the command line)."
17987 #: ../fish/guestfish.pod:920
17989 "If you prefix a command with a I<-> character, then that command will not "
17990 "cause guestfish to exit, even if that (one) command returns an error."
17994 #: ../fish/guestfish.pod:924
17995 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
17999 #: ../fish/guestfish.pod:926
18001 "Guestfish can be remote-controlled over a socket. This is useful "
18002 "particularly in shell scripts where you want to make several different "
18003 "changes to a filesystem, but you don't want the overhead of starting up a "
18004 "guestfish process each time."
18008 #: ../fish/guestfish.pod:931
18009 msgid "Start a guestfish server process using:"
18013 #: ../fish/guestfish.pod:933
18016 " eval \"`guestfish --listen`\"\n"
18021 #: ../fish/guestfish.pod:935
18022 msgid "and then send it commands by doing:"
18026 #: ../fish/guestfish.pod:937
18029 " guestfish --remote cmd [...]\n"
18034 #: ../fish/guestfish.pod:939
18035 msgid "To cause the server to exit, send it the exit command:"
18039 #: ../fish/guestfish.pod:943
18041 "Note that the server will normally exit if there is an error in a command. "
18042 "You can change this in the usual way. See section L</EXIT ON ERROR "
18047 #: ../fish/guestfish.pod:947
18048 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18052 #: ../fish/guestfish.pod:949
18054 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18055 "is how the I<--remote> option knows where to send the commands. You can "
18056 "have several guestfish listener processes running using:"
18060 #: ../fish/guestfish.pod:953
18063 " eval \"`guestfish --listen`\"\n"
18064 " pid1=$GUESTFISH_PID\n"
18065 " eval \"`guestfish --listen`\"\n"
18066 " pid2=$GUESTFISH_PID\n"
18068 " guestfish --remote=$pid1 cmd\n"
18069 " guestfish --remote=$pid2 cmd\n"
18074 #: ../fish/guestfish.pod:961
18075 msgid "REMOTE CONTROL AND CSH"
18079 #: ../fish/guestfish.pod:963
18081 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18086 #: ../fish/guestfish.pod:966
18089 " eval \"`guestfish --listen --csh`\"\n"
18094 #: ../fish/guestfish.pod:968
18095 msgid "REMOTE CONTROL DETAILS"
18099 #: ../fish/guestfish.pod:970
18101 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18102 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18103 "and C<$PID> is the process ID of the server."
18107 #: ../fish/guestfish.pod:974
18108 msgid "Guestfish client and server versions must match exactly."
18112 #: ../fish/guestfish.pod:976
18113 msgid "PREPARED DISK IMAGES"
18117 #: ../fish/guestfish.pod:978
18119 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18120 "preformatted disk images that guestfish can make for you to save typing. "
18121 "This is particularly useful for testing purposes. This option is used "
18122 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18123 "can be mixed with I<-a>)."
18127 #: ../fish/guestfish.pod:984
18129 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18130 "the second and so on. Existing files in the current directory are "
18135 #: ../fish/guestfish.pod:988
18137 "The type briefly describes how the disk should be sized, partitioned, how "
18138 "filesystem(s) should be created, and how content should be added. "
18139 "Optionally the type can be followed by extra parameters, separated by C<:> "
18140 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18141 "allocated disk, containing a single partition, with the partition formatted "
18142 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18147 #: ../fish/guestfish.pod:996
18148 msgid "To list the available types and any extra parameters they take, run:"
18152 #: ../fish/guestfish.pod:1000
18154 "Note that the prepared filesystem is not mounted. You would usually have to "
18155 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18159 #: ../fish/guestfish.pod:1004
18161 "If any I<-N> or I<--new> options are given, the guest is automatically "
18166 #: ../fish/guestfish.pod:1009
18167 msgid "Create a 100MB disk with an ext4-formatted partition:"
18171 #: ../fish/guestfish.pod:1011
18174 " guestfish -N fs:ext4\n"
18179 #: ../fish/guestfish.pod:1013
18180 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18184 #: ../fish/guestfish.pod:1015
18187 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18192 #: ../fish/guestfish.pod:1017
18193 msgid "Create a blank 200MB disk:"
18197 #: ../fish/guestfish.pod:1019
18200 " guestfish -N disk:200M\n"
18205 #: ../fish/guestfish.pod:1021
18206 msgid "PROGRESS BARS"
18210 #: ../fish/guestfish.pod:1023
18212 "Some (not all) long-running commands send progress notification messages as "
18213 "they are running. Guestfish turns these messages into progress bars."
18217 #: ../fish/guestfish.pod:1027
18219 "When a command that supports progress bars takes longer than two seconds to "
18220 "run, and if progress bars are enabled, then you will see one appearing below "
18225 #: ../fish/guestfish.pod:1031
18228 " ><fs> copy-size /large-file /another-file 2048M\n"
18229 " / 10% [#####-----------------------------------------] 00:30\n"
18234 #: ../fish/guestfish.pod:1034
18236 "The spinner on the left hand side moves round once for every progress "
18237 "notification received from the backend. This is a (reasonably) golden "
18238 "assurance that the command is \"doing something\" even if the progress bar "
18239 "is not moving, because the command is able to send the progress "
18240 "notifications. When the bar reaches 100% and the command finishes, the "
18241 "spinner disappears."
18245 #: ../fish/guestfish.pod:1041
18247 "Progress bars are enabled by default when guestfish is used interactively. "
18248 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18249 "and you can disable them completely using I<--no-progress-bars>."
18253 #: ../fish/guestfish.pod:1046
18254 msgid "GUESTFISH COMMANDS"
18258 #: ../fish/guestfish.pod:1048
18260 "The commands in this section are guestfish convenience commands, in other "
18261 "words, they are not part of the L<guestfs(3)> API."
18265 #: ../fish/guestfish.pod:1051
18270 #: ../fish/guestfish.pod:1053
18279 #: ../fish/guestfish.pod:1056
18280 msgid "Without any parameter, this provides general help."
18284 #: ../fish/guestfish.pod:1058
18285 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18289 #: ../fish/guestfish.pod:1060
18290 msgid "quit | exit"
18294 #: ../fish/guestfish.pod:1062
18295 msgid "This exits guestfish. You can also use C<^D> key."
18299 #: ../fish/guestfish.pod:1064
18300 msgid "@FISH_COMMANDS@"
18304 #: ../fish/guestfish.pod:1066
18309 #: ../fish/guestfish.pod:1068 ../src/guestfs.pod:1475
18314 #: ../fish/guestfish.pod:1070 ../test-tool/libguestfs-test-tool.pod:77
18319 #: ../fish/guestfish.pod:1072
18321 "guestfish returns 0 if the commands completed without error, or 1 if there "
18326 #: ../fish/guestfish.pod:1079
18331 #: ../fish/guestfish.pod:1081
18333 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
18338 #: ../fish/guestfish.pod:1084 ../src/guestfs.pod:2970
18339 msgid "FEBOOTSTRAP_KERNEL"
18343 #: ../fish/guestfish.pod:1086 ../src/guestfs.pod:2972
18344 msgid "FEBOOTSTRAP_MODULES"
18348 #: ../fish/guestfish.pod:1088 ../src/guestfs.pod:2974
18350 "These two environment variables allow the kernel that libguestfs uses in the "
18351 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
18352 "most recent host kernel is chosen. For more information about kernel "
18353 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
18354 "available in febootstrap E<ge> 3.8."
18358 #: ../fish/guestfish.pod:1094
18359 msgid "GUESTFISH_DISPLAY_IMAGE"
18363 #: ../fish/guestfish.pod:1096
18365 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
18366 "If not set, it uses L<display(1)>."
18370 #: ../fish/guestfish.pod:1099
18371 msgid "GUESTFISH_PID"
18375 #: ../fish/guestfish.pod:1101
18377 "Used with the I<--remote> option to specify the remote guestfish process to "
18378 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
18382 #: ../fish/guestfish.pod:1105
18387 #: ../fish/guestfish.pod:1107
18389 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
18390 "not specified, the external L<hexedit(1)> program is used."
18394 #: ../fish/guestfish.pod:1111
18399 #: ../fish/guestfish.pod:1113
18401 "If compiled with GNU readline support, various files in the home directory "
18402 "can be used. See L</FILES>."
18406 #: ../fish/guestfish.pod:1116 ../src/guestfs.pod:2980
18407 msgid "LIBGUESTFS_APPEND"
18411 #: ../fish/guestfish.pod:1118 ../src/guestfs.pod:2982
18412 msgid "Pass additional options to the guest kernel."
18416 #: ../fish/guestfish.pod:1120 ../src/guestfs.pod:2984
18417 msgid "LIBGUESTFS_DEBUG"
18421 #: ../fish/guestfish.pod:1122
18423 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
18424 "effect as using the B<-v> option."
18428 #: ../fish/guestfish.pod:1125 ../src/guestfs.pod:2989
18429 msgid "LIBGUESTFS_MEMSIZE"
18433 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:2991
18435 "Set the memory allocated to the qemu process, in megabytes. For example:"
18439 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:2994
18442 " LIBGUESTFS_MEMSIZE=700\n"
18447 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:2996
18448 msgid "LIBGUESTFS_PATH"
18452 #: ../fish/guestfish.pod:1134
18454 "Set the path that guestfish uses to search for kernel and initrd.img. See "
18455 "the discussion of paths in L<guestfs(3)>."
18459 #: ../fish/guestfish.pod:1137 ../src/guestfs.pod:3001
18460 msgid "LIBGUESTFS_QEMU"
18464 #: ../fish/guestfish.pod:1139 ../src/guestfs.pod:3003
18466 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
18467 "which was found at compile time by the configure script is used."
18471 #: ../fish/guestfish.pod:1143 ../src/guestfs.pod:3009
18472 msgid "LIBGUESTFS_TRACE"
18476 #: ../fish/guestfish.pod:1145
18477 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
18481 #: ../fish/guestfish.pod:1147
18486 #: ../fish/guestfish.pod:1149
18488 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
18493 #: ../fish/guestfish.pod:1152 ../src/guestfs.pod:3014
18498 #: ../fish/guestfish.pod:1154 ../src/guestfs.pod:3016
18500 "Location of temporary directory, defaults to C</tmp> except for the cached "
18501 "supermin appliance which defaults to C</var/tmp>."
18505 #: ../fish/guestfish.pod:1157 ../src/guestfs.pod:3019
18507 "If libguestfs was compiled to use the supermin appliance then the real "
18508 "appliance is cached in this directory, shared between all handles belonging "
18509 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
18510 "use in case C</var/tmp> is not large enough."
18514 #: ../fish/guestfish.pod:1165 ../fuse/guestmount.pod:288
18515 #: ../rescue/virt-rescue.pod:269
18520 #: ../fish/guestfish.pod:1169 ../fuse/guestmount.pod:292
18521 #: ../rescue/virt-rescue.pod:273
18522 msgid "$HOME/.libguestfs-tools.rc"
18526 #: ../fish/guestfish.pod:1171 ../fuse/guestmount.pod:294
18527 #: ../rescue/virt-rescue.pod:275
18528 msgid "/etc/libguestfs-tools.conf"
18532 #: ../fish/guestfish.pod:1173 ../fuse/guestmount.pod:296
18533 #: ../rescue/virt-rescue.pod:277
18535 "This configuration file controls the default read-only or read-write mode "
18536 "(I<--ro> or I<--rw>)."
18540 #: ../fish/guestfish.pod:1176
18541 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
18545 #: ../fish/guestfish.pod:1178
18546 msgid "$HOME/.guestfish"
18550 #: ../fish/guestfish.pod:1180
18552 "If compiled with GNU readline support, then the command history is saved in "
18557 #: ../fish/guestfish.pod:1183
18558 msgid "$HOME/.inputrc"
18562 #: ../fish/guestfish.pod:1185
18563 msgid "/etc/inputrc"
18567 #: ../fish/guestfish.pod:1187
18569 "If compiled with GNU readline support, then these files can be used to "
18570 "configure readline. For further information, please see L<readline(3)/"
18571 "INITIALIZATION FILE>."
18575 #: ../fish/guestfish.pod:1191
18576 msgid "To write rules which only apply to guestfish, use:"
18580 #: ../fish/guestfish.pod:1193
18590 #: ../fish/guestfish.pod:1197
18592 "Variables that you can set in inputrc that change the behaviour of guestfish "
18593 "in useful ways include:"
18597 #: ../fish/guestfish.pod:1202
18598 msgid "completion-ignore-case (default: on)"
18602 #: ../fish/guestfish.pod:1204
18604 "By default, guestfish will ignore case when tab-completing paths on the "
18609 #: ../fish/guestfish.pod:1207
18612 " set completion-ignore-case off\n"
18617 #: ../fish/guestfish.pod:1209
18618 msgid "to make guestfish case sensitive."
18622 #: ../fish/guestfish.pod:1213
18627 #: ../fish/guestfish.pod:1215
18628 msgid "test2.img (etc)"
18632 #: ../fish/guestfish.pod:1217
18634 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
18635 "will be created in the file C<test1.img> in the current directory. The "
18636 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
18637 "the same name will be overwritten."
18641 #: ../fish/guestfish.pod:1226
18643 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
18644 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
18645 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
18646 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
18647 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
18648 ">, L<display(1)>, L<hexedit(1)>, L<febootstrap-supermin-helper(8)>."
18652 #: ../fish/guestfish.pod:1255 ../src/guestfs.pod:3105
18653 #: ../test-tool/libguestfs-test-tool.pod:99
18654 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
18658 #: ../fish/virt-copy-in.pod:5
18660 "virt-copy-in - Copy files and directories into a virtual machine disk image."
18664 #: ../fish/virt-copy-in.pod:9
18667 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
18672 #: ../fish/virt-copy-in.pod:11
18675 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
18680 #: ../fish/virt-copy-in.pod:15
18682 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
18683 "causing disk corruption. The virtual machine must be shut down before you "
18684 "use this command."
18688 #: ../fish/virt-copy-in.pod:21
18690 "C<virt-copy-in> copies files and directories from the local disk into a "
18691 "virtual machine disk image or named libvirt domain."
18695 #: ../fish/virt-copy-in.pod:24
18697 "You can give one of more filenames and directories on the command line. "
18698 "Directories are copied in recursively. The final parameter must be the "
18699 "destination directory in the disk image which must be an absolute path "
18700 "starting with a C</> character."
18704 #: ../fish/virt-copy-in.pod:33
18707 " virt-copy-in -d MyGuest resolv.conf /etc\n"
18712 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
18713 msgid "Upload a home directory to a guest:"
18717 #: ../fish/virt-copy-in.pod:37
18720 " virt-copy-in -d MyGuest skel /home\n"
18725 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28
18726 #: ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
18727 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
18731 #: ../fish/virt-copy-in.pod:41
18733 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18734 "> C<copy-in> command. For anything more complex than a trivial copy, you "
18735 "are probably better off using guestfish directly."
18739 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36
18740 #: ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
18742 "Since the shell script just passes options straight to guestfish, read "
18743 "L<guestfish(1)> to see the full list of options."
18747 #: ../fish/virt-copy-in.pod:52
18749 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
18750 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18754 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55
18755 #: ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
18756 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
18760 #: ../fish/virt-copy-out.pod:5
18762 "virt-copy-out - Copy files and directories out of a virtual machine disk "
18767 #: ../fish/virt-copy-out.pod:9
18770 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
18775 #: ../fish/virt-copy-out.pod:11
18778 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
18783 #: ../fish/virt-copy-out.pod:15
18785 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
18786 "image or named libvirt domain."
18790 #: ../fish/virt-copy-out.pod:18
18792 "You can give one of more filenames and directories on the command line. "
18793 "Directories are copied out recursively."
18797 #: ../fish/virt-copy-out.pod:23
18798 msgid "Download the home directories from a virtual machine:"
18802 #: ../fish/virt-copy-out.pod:25
18806 " virt-copy-out -d MyGuest /home homes\n"
18811 #: ../fish/virt-copy-out.pod:30
18813 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18814 "> C<copy-out> command. For anything more complex than a trivial copy, you "
18815 "are probably better off using guestfish directly."
18819 #: ../fish/virt-copy-out.pod:41
18821 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, L<virt-"
18822 "tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
18826 #: ../fish/virt-tar-in.pod:5
18827 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
18831 #: ../fish/virt-tar-in.pod:9
18834 " virt-tar-in -a disk.img data.tar /destination\n"
18839 #: ../fish/virt-tar-in.pod:11
18842 " virt-tar-in -d domain data.tar /destination\n"
18847 #: ../fish/virt-tar-in.pod:13
18850 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
18855 #: ../fish/virt-tar-in.pod:17
18857 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
18858 "causing disk corruption. The virtual machine must be shut down before you "
18859 "use this command."
18863 #: ../fish/virt-tar-in.pod:23
18865 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
18866 "image or named libvirt domain."
18870 #: ../fish/virt-tar-in.pod:26
18872 "The first parameter is the tar file. Use C<-> to read the tar file from "
18873 "standard input. The second parameter is the absolute target directory to "
18878 #: ../fish/virt-tar-in.pod:34
18881 " virt-tar-in -d MyGuest homes.tar /home\n"
18886 #: ../fish/virt-tar-in.pod:38
18888 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18889 "> C<tar-in> command. For anything more complex than a trivial copy, you are "
18890 "probably better off using guestfish directly."
18894 #: ../fish/virt-tar-in.pod:49
18896 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18897 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, L<http://libguestfs."
18902 #: ../fish/virt-tar-out.pod:5
18904 "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
18908 #: ../fish/virt-tar-out.pod:9
18911 " virt-tar-out -a disk.img /dir files.tar\n"
18916 #: ../fish/virt-tar-out.pod:11
18919 " virt-tar-out -d domain /dir files.tar\n"
18924 #: ../fish/virt-tar-out.pod:13
18927 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
18932 #: ../fish/virt-tar-out.pod:17
18934 "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
18938 #: ../fish/virt-tar-out.pod:20
18940 "The first parameter is the absolute path of the virtual machine directory. "
18941 "The second parameter is the tar file to write. Use C<-> to write to "
18946 #: ../fish/virt-tar-out.pod:26
18947 msgid "Download the home directories from a guest:"
18951 #: ../fish/virt-tar-out.pod:28
18954 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
18959 #: ../fish/virt-tar-out.pod:32
18961 "This command is just a simple shell script wrapper around the L<guestfish(1)"
18962 "> C<tar-out> command. For anything more complex than a trivial copy, you "
18963 "are probably better off using guestfish directly."
18967 #: ../fish/virt-tar-out.pod:43
18969 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
18970 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
18974 #: ../fuse/guestmount.pod:5
18976 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
18980 #: ../fuse/guestmount.pod:9
18983 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
18988 #: ../fuse/guestmount.pod:11
18991 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
18996 #: ../fuse/guestmount.pod:13
18999 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19004 #: ../fuse/guestmount.pod:17
19006 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19007 "machines. If you do this, you risk disk corruption in the VM."
19011 #: ../fuse/guestmount.pod:22
19013 "The guestmount program can be used to mount virtual machine filesystems and "
19014 "other disk images on the host. It uses libguestfs for access to the guest "
19015 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19016 "a mountable device."
19020 #: ../fuse/guestmount.pod:27
19022 "Along with other options, you have to give at least one device (I<-a> "
19023 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19024 "option) or use the I<-i> inspection option. How this works is better "
19025 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19030 #: ../fuse/guestmount.pod:33
19032 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19033 "by you, and the filesystem will not be visible to any other users unless you "
19034 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19035 "the filesystem, use the C<fusermount -u> command."
19039 #: ../fuse/guestmount.pod:41
19041 "For a typical Windows guest which has its main filesystem on the first "
19046 #: ../fuse/guestmount.pod:44
19049 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19054 #: ../fuse/guestmount.pod:46
19056 "For a typical Linux guest which has a /boot filesystem on the first "
19057 "partition, and the root filesystem on a logical volume:"
19061 #: ../fuse/guestmount.pod:49
19064 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
19069 #: ../fuse/guestmount.pod:51
19070 msgid "To get libguestfs to detect guest mountpoints for you:"
19074 #: ../fuse/guestmount.pod:53
19077 " guestmount -a guest.img -i --ro /mnt\n"
19082 #: ../fuse/guestmount.pod:55
19083 msgid "For a libvirt guest called \"Guest\" you could do:"
19087 #: ../fuse/guestmount.pod:57
19090 " guestmount -d Guest -i --ro /mnt\n"
19095 #: ../fuse/guestmount.pod:59
19097 "If you don't know what filesystems are contained in a guest or disk image, "
19098 "use L<virt-filesystems(1)> first:"
19102 #: ../fuse/guestmount.pod:62
19105 " virt-filesystems MyGuest\n"
19110 #: ../fuse/guestmount.pod:64
19112 "If you want to trace the libguestfs calls but without excessive debugging "
19113 "information, we recommend:"
19117 #: ../fuse/guestmount.pod:67
19120 " guestmount [...] --trace /mnt\n"
19125 #: ../fuse/guestmount.pod:69
19126 msgid "If you want to debug the program, we recommend:"
19130 #: ../fuse/guestmount.pod:71
19133 " guestmount [...] --trace --verbose /mnt\n"
19138 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68
19139 #: ../resize/virt-resize.pod:486
19144 #: ../fuse/guestmount.pod:75
19145 msgid "Other users cannot see the filesystem by default"
19149 #: ../fuse/guestmount.pod:77
19151 "If you mount a filesystem as one user (eg. root), then other users will not "
19152 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
19153 "option when mounting:"
19157 #: ../fuse/guestmount.pod:81
19160 " sudo guestmount [...] -o allow_other /mnt\n"
19165 #: ../fuse/guestmount.pod:91
19166 msgid "Add a block device or virtual machine image."
19170 #: ../fuse/guestmount.pod:114
19171 msgid "B<--dir-cache-timeout N>"
19175 #: ../fuse/guestmount.pod:116
19177 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
19178 "seconds. The readdir cache [actually, there are several semi-independent "
19179 "caches] is populated after a readdir(2) call with the stat and extended "
19180 "attributes of the files in the directory, in anticipation that they will be "
19181 "requested soon after."
19185 #: ../fuse/guestmount.pod:122
19187 "There is also a different attribute cache implemented by FUSE (see the FUSE "
19188 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
19189 "requests, only cache existing ones."
19193 #: ../fuse/guestmount.pod:142
19195 "If you have untrusted raw-format guest disk images, you should use this "
19196 "option to specify the disk format. This avoids a possible security problem "
19197 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
19198 "guestfs_add_drive_opts>."
19202 #: ../fuse/guestmount.pod:147
19203 msgid "B<--fuse-help>"
19207 #: ../fuse/guestmount.pod:149
19208 msgid "Display help on special FUSE options (see I<-o> below)."
19212 #: ../fuse/guestmount.pod:153
19213 msgid "Display brief help and exit."
19217 #: ../fuse/guestmount.pod:177
19219 "Mount the named partition or logical volume on the given mountpoint B<in the "
19220 "guest> (this has nothing to do with mountpoints in the host)."
19224 #: ../fuse/guestmount.pod:180
19226 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
19227 "something on C</>."
19231 #: ../fuse/guestmount.pod:197
19233 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
19234 "unmounted. If you specify this option, then we don't attempt to sync the "
19235 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
19239 #: ../fuse/guestmount.pod:202
19240 msgid "B<-o option>"
19244 #: ../fuse/guestmount.pod:204
19245 msgid "B<--option option>"
19249 #: ../fuse/guestmount.pod:206
19250 msgid "Pass extra options to FUSE."
19254 #: ../fuse/guestmount.pod:208
19256 "To get a list of all the extra options supported by FUSE, use the command "
19257 "below. Note that only the FUSE I<-o> options can be passed, and only some "
19258 "of them are a good idea."
19262 #: ../fuse/guestmount.pod:212
19265 " guestmount --fuse-help\n"
19270 #: ../fuse/guestmount.pod:214
19271 msgid "Some potentially useful FUSE options:"
19275 #: ../fuse/guestmount.pod:218
19276 msgid "B<-o allow_other>"
19280 #: ../fuse/guestmount.pod:220
19281 msgid "Allow other users to see the filesystem."
19285 #: ../fuse/guestmount.pod:222
19286 msgid "B<-o attr_timeout=N>"
19290 #: ../fuse/guestmount.pod:224
19291 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
19295 #: ../fuse/guestmount.pod:226
19296 msgid "B<-o kernel_cache>"
19300 #: ../fuse/guestmount.pod:228
19302 "Allow the kernel to cache files (reduces the number of reads that have to go "
19303 "through the L<guestfs(3)> API). This is generally a good idea if you can "
19304 "afford the extra memory usage."
19308 #: ../fuse/guestmount.pod:232
19309 msgid "B<-o uid=N> B<-o gid=N>"
19313 #: ../fuse/guestmount.pod:234
19315 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
19316 "the chosen values."
19320 #: ../fuse/guestmount.pod:243
19322 "Add devices and mount everything read-only. Also disallow writes and make "
19323 "the disk appear read-only to FUSE."
19327 #: ../fuse/guestmount.pod:246
19329 "This is highly recommended if you are not going to edit the guest disk. If "
19330 "the guest is running and this option is I<not> supplied, then there is a "
19331 "strong risk of disk corruption in the guest. We try to prevent this from "
19332 "happening, but it is not always possible."
19336 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
19337 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19341 #: ../fuse/guestmount.pod:255
19342 msgid "Enable SELinux support for the guest."
19346 #: ../fuse/guestmount.pod:261
19347 msgid "Enable verbose messages from underlying libguestfs."
19351 #: ../fuse/guestmount.pod:267
19352 msgid "Display the program version and exit."
19356 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299
19357 #: ../rescue/virt-rescue.pod:197 ../rescue/virt-rescue.pod:280
19358 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
19362 #: ../fuse/guestmount.pod:280
19367 #: ../fuse/guestmount.pod:282
19368 msgid "Trace libguestfs calls and entry into each FUSE function."
19372 #: ../fuse/guestmount.pod:284
19373 msgid "This also stops the daemon from forking into the background."
19377 #: ../fuse/guestmount.pod:305
19379 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
19380 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
19385 #: ../fuse/guestmount.pod:320
19386 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
19390 #: ../inspector/virt-inspector.pod:5
19392 "virt-inspector - Display operating system version and other information "
19393 "about a virtual machine"
19397 #: ../inspector/virt-inspector.pod:9
19400 " virt-inspector [--options] -d domname\n"
19405 #: ../inspector/virt-inspector.pod:11
19408 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
19413 #: ../inspector/virt-inspector.pod:15
19416 " virt-inspector domname\n"
19421 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
19424 " virt-inspector disk.img [disk.img ...]\n"
19429 #: ../inspector/virt-inspector.pod:21
19431 "B<virt-inspector> examines a virtual machine or disk image and tries to "
19432 "determine the version of the operating system and other information about "
19433 "the virtual machine."
19437 #: ../inspector/virt-inspector.pod:25
19438 msgid "Virt-inspector produces XML output for feeding into other programs."
19442 #: ../inspector/virt-inspector.pod:27
19444 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
19445 "the libvirt domain (see: C<virsh list --all>)."
19449 #: ../inspector/virt-inspector.pod:30
19451 "You can also run virt-inspector directly on disk images from a single "
19452 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
19453 "has several block devices, in which case you should list several I<-a> "
19454 "options one after another, with the first corresponding to the guest's C</"
19455 "dev/sda>, the second to the guest's C</dev/sdb> and so on."
19459 #: ../inspector/virt-inspector.pod:37
19461 "You can also run virt-inspector on install disks, live CDs, bootable USB "
19462 "keys and similar."
19466 #: ../inspector/virt-inspector.pod:40
19468 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
19469 "inspect several virtual machines, you have to run virt-inspector several "
19470 "times (for example, from a shell script for-loop)."
19474 #: ../inspector/virt-inspector.pod:45
19476 "Because virt-inspector needs direct access to guest images, it won't "
19477 "normally work over remote libvirt connections."
19481 #: ../inspector/virt-inspector.pod:48
19483 "All of the information available from virt-inspector is also available "
19484 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
19485 "The same information can also be fetched using guestfish or via libguestfs "
19486 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
19487 "WITH OTHER PROGRAMMING LANGUAGES>)."
19491 #: ../inspector/virt-inspector.pod:81
19493 "Libvirt is only used if you specify a C<domname> on the command line. If "
19494 "you specify guest block devices directly (I<-a>), then libvirt is not used "
19499 #: ../inspector/virt-inspector.pod:94
19501 "When prompting for keys and passphrases, virt-inspector normally turns "
19502 "echoing off so you cannot see what you are typing. If you are not worried "
19503 "about Tempest attacks and there is no one else in the room you can specify "
19504 "this flag to see what you are typing."
19508 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93
19509 #: ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143
19510 #: ../tools/virt-win-reg.pl:144
19512 "Specify the format of disk images given on the command line. If this is "
19513 "omitted then the format is autodetected from the content of the disk image."
19517 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97
19518 #: ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147
19519 #: ../tools/virt-win-reg.pl:148
19521 "If disk images are requested from libvirt, then this program asks libvirt "
19522 "for this information. In this case, the value of the format parameter is "
19527 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314
19528 #: ../resize/virt-resize.pod:400 ../tools/virt-list-filesystems.pl:101
19529 #: ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151
19530 #: ../tools/virt-win-reg.pl:152
19532 "If working with untrusted raw-format guest disk images, you should ensure "
19533 "the format is always specified."
19537 #: ../inspector/virt-inspector.pod:139
19538 msgid "Previous versions of virt-inspector allowed you to write either:"
19542 #: ../inspector/virt-inspector.pod:145
19545 " virt-inspector guestname\n"
19550 #: ../inspector/virt-inspector.pod:153
19555 #: ../inspector/virt-inspector.pod:155
19557 "The virt-inspector XML is described precisely in a RELAX NG schema file "
19558 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
19559 "just an overview."
19563 #: ../inspector/virt-inspector.pod:159
19565 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
19566 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
19567 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
19568 "which is vanishingly rare in real world VMs."
19572 #: ../inspector/virt-inspector.pod:164
19573 msgid "E<lt>operatingsystemE<gt>"
19577 #: ../inspector/virt-inspector.pod:166
19579 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
19580 "describe the operating system, its architecture, the descriptive \"product "
19581 "name\" string, the type of OS and so on, as in this example:"
19585 #: ../inspector/virt-inspector.pod:170
19588 " <operatingsystems>\n"
19589 " <operatingsystem>\n"
19590 " <root>/dev/sda2</root>\n"
19591 " <name>windows</name>\n"
19592 " <arch>i386</arch>\n"
19593 " <distro>windows</distro>\n"
19594 " <product_name>Windows 7 Enterprise</product_name>\n"
19595 " <product_variant>Client</product_variant>\n"
19596 " <major_version>6</major_version>\n"
19597 " <minor_version>1</minor_version>\n"
19598 " <windows_systemroot>/Windows</windows_systemroot>\n"
19599 " <format>installed</format>\n"
19604 #: ../inspector/virt-inspector.pod:183
19606 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
19607 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
19608 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
19609 "architecture. The other fields are fairly self-explanatory, but because "
19610 "these fields are taken directly from the libguestfs inspection API you can "
19611 "find precise information from L<guestfs(3)/INSPECTION>."
19615 #: ../inspector/virt-inspector.pod:191
19617 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
19618 "of view of libguestfs (block devices may have completely different names "
19619 "inside the VM itself)."
19623 #: ../inspector/virt-inspector.pod:195
19624 msgid "E<lt>mountpointsE<gt>"
19628 #: ../inspector/virt-inspector.pod:197
19630 "Un*x-like guests typically have multiple filesystems which are mounted at "
19631 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
19632 "element which looks like this:"
19636 #: ../inspector/virt-inspector.pod:201
19639 " <operatingsystems>\n"
19640 " <operatingsystem>\n"
19643 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
19644 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
19645 " </mountpoints>\n"
19650 #: ../inspector/virt-inspector.pod:209
19652 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
19653 "and may have completely different names inside the guest. Only mountable "
19654 "filesystems appear in this list, not things like swap devices."
19658 #: ../inspector/virt-inspector.pod:214
19659 msgid "E<lt>filesystemsE<gt>"
19663 #: ../inspector/virt-inspector.pod:216
19665 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
19666 "filesystems belonging to the guest, including swap and empty partitions. "
19667 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
19668 "this OS or shared with this OS and other OSes)."
19672 #: ../inspector/virt-inspector.pod:222
19673 msgid "You might see something like this:"
19677 #: ../inspector/virt-inspector.pod:224
19680 " <operatingsystems>\n"
19681 " <operatingsystem>\n"
19684 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19685 " <type>ext4</type>\n"
19686 " <label>Fedora-13-x86_64</label>\n"
19687 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
19693 #: ../inspector/virt-inspector.pod:234
19695 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
19696 "the label, and the UUID."
19700 #: ../inspector/virt-inspector.pod:237
19701 msgid "E<lt>applicationsE<gt>"
19705 #: ../inspector/virt-inspector.pod:239
19707 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
19708 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
19713 #: ../inspector/virt-inspector.pod:243
19715 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
19716 "Typical values would be C<rpm> and C<deb>."
19720 #: ../inspector/virt-inspector.pod:246
19722 "E<lt>package_managementE<gt>, if present, describes the package manager. "
19723 "Typical values include C<yum>, C<up2date> and C<apt>"
19727 #: ../inspector/virt-inspector.pod:249
19728 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
19732 #: ../inspector/virt-inspector.pod:252
19735 " <operatingsystems>\n"
19736 " <operatingsystem>\n"
19738 " <applications>\n"
19740 " <name>coreutils</name>\n"
19741 " <version>8.5</version>\n"
19742 " <release>1</release>\n"
19743 " </application>\n"
19748 #: ../inspector/virt-inspector.pod:262
19750 "The version and release fields may not be available for some types guests. "
19751 "Other fields are possible, see L<guestfs(3)/"
19752 "guestfs_inspect_list_applications>."
19756 #: ../inspector/virt-inspector.pod:266
19757 msgid "E<lt>drive_mappingsE<gt>"
19761 #: ../inspector/virt-inspector.pod:268
19763 "For operating systems like Windows which use drive letters, virt-inspector "
19764 "is able to find out how drive letters map to filesystems."
19768 #: ../inspector/virt-inspector.pod:272
19771 " <operatingsystems>\n"
19772 " <operatingsystem>\n"
19774 " <drive_mappings>\n"
19775 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
19776 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
19777 " </drive_mappings>\n"
19782 #: ../inspector/virt-inspector.pod:280
19784 "In the example above, drive C maps to the filesystem on the second partition "
19785 "on the first disk, and drive E maps to the filesystem on the first partition "
19786 "on the second disk."
19790 #: ../inspector/virt-inspector.pod:284
19792 "Note that this only covers permanent local filesystem mappings, not things "
19793 "like network shares. Furthermore NTFS volume mount points may not be listed "
19798 #: ../inspector/virt-inspector.pod:288
19799 msgid "E<lt>iconE<gt>"
19803 #: ../inspector/virt-inspector.pod:290
19805 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
19806 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
19807 "very large and high quality."
19811 #: ../inspector/virt-inspector.pod:294
19814 " <operatingsystems>\n"
19815 " <operatingsystem>\n"
19818 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
19819 " [... many lines of base64 data ...]\n"
19825 #: ../inspector/virt-inspector.pod:302
19827 "To display the icon, you have to extract it and convert the base64 data back "
19828 "to a binary file. Use an XPath query or simply an editor to extract the "
19829 "data, then use the coreutils L<base64(1)> program to do the conversion back "
19834 #: ../inspector/virt-inspector.pod:307
19837 " base64 -i -d < icon.data > icon.png\n"
19842 #: ../inspector/virt-inspector.pod:309
19843 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
19847 #: ../inspector/virt-inspector.pod:311
19849 "Virt-inspector can detect some operating system installers on install disks, "
19850 "live CDs, bootable USB keys and more."
19854 #: ../inspector/virt-inspector.pod:314
19856 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
19857 "fields may be present to indicate a live CD, network installer, or one part "
19858 "of a multipart CD. For example:"
19862 #: ../inspector/virt-inspector.pod:318
19865 " <operatingsystems>\n"
19866 " <operatingsystem>\n"
19867 " <root>/dev/sda</root>\n"
19868 " <name>linux</name>\n"
19869 " <arch>i386</arch>\n"
19870 " <distro>ubuntu</distro>\n"
19871 " <product_name>Ubuntu 10.10 "Maverick Meerkat"</product_name>\n"
19872 " <major_version>10</major_version>\n"
19873 " <minor_version>10</minor_version>\n"
19874 " <format>installer</format>\n"
19880 #: ../inspector/virt-inspector.pod:330
19881 msgid "USING XPATH"
19885 #: ../inspector/virt-inspector.pod:332
19887 "You can use the XPath query language, and/or the xpath tool, in order to "
19888 "select parts of the XML."
19892 #: ../inspector/virt-inspector.pod:337
19895 " $ virt-inspector -d Guest | xpath //filesystems\n"
19896 " Found 1 nodes:\n"
19899 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
19900 " <type>ext4</type>\n"
19906 #: ../inspector/virt-inspector.pod:345
19909 " $ virt-inspector -d Guest | \\\n"
19910 " xpath \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
19911 " Query didn't return a nodeset. Value: ext4\n"
19916 #: ../inspector/virt-inspector.pod:356
19917 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
19921 #: ../inspector/virt-inspector.pod:358
19923 "Early versions of libguestfs shipped with a different virt-inspector program "
19924 "written in Perl (the current version is written in C). The XML output of "
19925 "the Perl virt-inspector was different and it could also output in other "
19926 "formats like text."
19930 #: ../inspector/virt-inspector.pod:363
19932 "The old virt-inspector is no longer supported or shipped with libguestfs."
19936 #: ../inspector/virt-inspector.pod:366
19938 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
19939 "versions of virt-inspector with different names:"
19943 #: ../inspector/virt-inspector.pod:369
19946 " virt-inspector Old Perl version.\n"
19947 " virt-inspector2 New C version.\n"
19952 #: ../inspector/virt-inspector.pod:374
19954 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, L<base64(1)"
19955 ">, L<http://libguestfs.org/>."
19959 #: ../inspector/virt-inspector.pod:390
19960 msgid "Matthew Booth L<mbooth@redhat.com>"
19964 #: ../java/examples/guestfs-java.pod:5
19965 msgid "guestfs-java - How to use libguestfs from Java"
19969 #: ../java/examples/guestfs-java.pod:9
19972 " import com.redhat.et.libguestfs.*;\n"
19977 #: ../java/examples/guestfs-java.pod:11
19980 " GuestFS g = new GuestFS ();\n"
19981 " g.add_drive_opts (\"disk.img\", null);\n"
19987 #: ../java/examples/guestfs-java.pod:17
19989 "This manual page documents how to call libguestfs from the Java programming "
19990 "language. This page just documents the differences from the C API and gives "
19991 "some examples. If you are not familiar with using libguestfs, you also need "
19992 "to read L<guestfs(3)>."
19996 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
19997 msgid "CLOSING THE HANDLE"
20001 #: ../java/examples/guestfs-java.pod:24
20003 "The handle is closed when it is reaped by the garbage collector. Because "
20004 "libguestfs handles include a lot of state, it is also possible to close (and "
20005 "hence free) them explicitly by calling the C<close> method."
20009 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60
20010 #: ../python/examples/guestfs-python.pod:21
20011 #: ../ruby/examples/guestfs-ruby.pod:22
20016 #: ../java/examples/guestfs-java.pod:31
20018 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20019 "exception. This has a single parameter which is the error message (a "
20024 #: ../java/examples/guestfs-java.pod:35
20025 msgid "Calling any method on a closed handle raises the same exception."
20029 #: ../java/examples/guestfs-java.pod:47
20031 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)"
20032 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20033 "libguestfs.org/>, L<http://caml.inria.fr/>."
20037 #: ../java/examples/guestfs-java.pod:63 ../perl/examples/guestfs-perl.pod:57
20038 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20042 #: ../ocaml/examples/guestfs-ocaml.pod:5
20043 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20047 #: ../ocaml/examples/guestfs-ocaml.pod:9
20048 msgid "Module style:"
20052 #: ../ocaml/examples/guestfs-ocaml.pod:11
20055 " let g = Guestfs.create () in\n"
20056 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20057 " Guestfs.launch g;\n"
20062 #: ../ocaml/examples/guestfs-ocaml.pod:15
20063 msgid "Object-oriented style:"
20067 #: ../ocaml/examples/guestfs-ocaml.pod:17
20070 " let g = new Guestfs.guestfs () in\n"
20071 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20077 #: ../ocaml/examples/guestfs-ocaml.pod:21
20080 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
20082 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
20087 #: ../ocaml/examples/guestfs-ocaml.pod:27
20089 "This manual page documents how to call libguestfs from the OCaml programming "
20090 "language. This page just documents the differences from the C API and gives "
20091 "some examples. If you are not familiar with using libguestfs, you also need "
20092 "to read L<guestfs(3)>."
20096 #: ../ocaml/examples/guestfs-ocaml.pod:32
20097 msgid "PROGRAMMING STYLES"
20101 #: ../ocaml/examples/guestfs-ocaml.pod:34
20103 "There are two different programming styles supported by the OCaml bindings. "
20104 "You can use a module style, with each C function mapped to an OCaml function:"
20108 #: ../ocaml/examples/guestfs-ocaml.pod:38
20111 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
20116 #: ../ocaml/examples/guestfs-ocaml.pod:40
20121 #: ../ocaml/examples/guestfs-ocaml.pod:42
20124 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
20129 #: ../ocaml/examples/guestfs-ocaml.pod:44
20131 "Alternately you can use an object-oriented style, calling methods on the "
20132 "class C<Guestfs.guestfs>:"
20136 #: ../ocaml/examples/guestfs-ocaml.pod:47
20139 " method set_verbose : bool -> unit\n"
20144 #: ../ocaml/examples/guestfs-ocaml.pod:49
20146 "The object-oriented style is usually briefer, and the minor performance "
20147 "penalty isn't noticable in the general overhead of performing libguestfs "
20152 #: ../ocaml/examples/guestfs-ocaml.pod:55
20154 "The handle is closed when it is reaped by the garbage collector. Because "
20155 "libguestfs handles include a lot of state, it is also possible to close (and "
20156 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
20161 #: ../ocaml/examples/guestfs-ocaml.pod:62
20163 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
20164 "exception. This has a single parameter which is the error message (a "
20169 #: ../ocaml/examples/guestfs-ocaml.pod:66
20171 "Calling any function/method on a closed handle raises C<Guestfs."
20172 "Handle_closed>. The single parameter is the name of the function that you "
20177 #: ../ocaml/examples/guestfs-ocaml.pod:80
20179 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-perl(3)"
20180 ">, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20181 "libguestfs.org/>, L<http://caml.inria.fr/>."
20185 #: ../perl/examples/guestfs-perl.pod:5
20186 msgid "guestfs-perl - How to use libguestfs from Perl"
20190 #: ../perl/examples/guestfs-perl.pod:9
20193 " use Sys::Guestfs;\n"
20198 #: ../perl/examples/guestfs-perl.pod:11
20201 " my $h = Sys::Guestfs->new ();\n"
20202 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
20203 " $h->launch ();\n"
20204 " $h->mount_options ('', '/dev/sda1', '/');\n"
20205 " $h->touch ('/hello');\n"
20211 #: ../perl/examples/guestfs-perl.pod:20
20213 "This manual page documents how to call libguestfs from the Perl programming "
20214 "language. This page just documents the differences from the C API and gives "
20215 "some examples. If you are not familiar with using libguestfs, you also need "
20216 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
20220 #: ../perl/examples/guestfs-perl.pod:26
20225 #: ../perl/examples/guestfs-perl.pod:28
20227 "Errors from libguestfs functions turn into calls to C<croak> (see L<Carp(3)"
20232 #: ../perl/examples/guestfs-perl.pod:41
20234 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)"
20235 ">, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, "
20236 "L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
20240 #: ../python/examples/guestfs-python.pod:5
20241 msgid "guestfs-python - How to use libguestfs from Python"
20245 #: ../python/examples/guestfs-python.pod:9
20248 " import guestfs\n"
20249 " g = guestfs.GuestFS ()\n"
20250 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
20256 #: ../python/examples/guestfs-python.pod:16
20258 "This manual page documents how to call libguestfs from the Python "
20259 "programming language. This page just documents the differences from the C "
20260 "API and gives some examples. If you are not familiar with using libguestfs, "
20261 "you also need to read L<guestfs(3)>."
20265 #: ../python/examples/guestfs-python.pod:23
20267 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
20268 "single string argument which is the error message."
20272 #: ../python/examples/guestfs-python.pod:26
20273 msgid "MORE DOCUMENTATION"
20277 #: ../python/examples/guestfs-python.pod:28
20282 #: ../python/examples/guestfs-python.pod:30
20286 " >>> import guestfs\n"
20287 " >>> help (guestfs)\n"
20292 #: ../python/examples/guestfs-python.pod:44
20294 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
20295 ">, L<guestfs-perl(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://"
20296 "libguestfs.org/>."
20300 #: ../rescue/virt-rescue.pod:5
20301 msgid "virt-rescue - Run a rescue shell on a virtual machine"
20305 #: ../rescue/virt-rescue.pod:9
20308 " virt-rescue [--options] -d domname\n"
20313 #: ../rescue/virt-rescue.pod:11
20316 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
20321 #: ../rescue/virt-rescue.pod:15
20324 " virt-rescue [--options] domname\n"
20329 #: ../rescue/virt-rescue.pod:17
20332 " virt-rescue [--options] disk.img [disk.img ...]\n"
20337 #: ../rescue/virt-rescue.pod:21
20339 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
20340 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
20341 "you from doing this, but doesn't catch all cases."
20345 #: ../rescue/virt-rescue.pod:25
20347 "However if you use the I<--ro> (read only) option, then you can attach a "
20348 "shell to a live virtual machine. The results might be strange or "
20349 "inconsistent at times but you won't get disk corruption."
20353 #: ../rescue/virt-rescue.pod:31
20355 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
20356 "need for a CD. virt-rescue gives you a rescue shell and some simple "
20357 "recovery tools which you can use to examine or rescue a virtual machine or "
20362 #: ../rescue/virt-rescue.pod:36
20364 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
20365 "on disk image(s):"
20369 #: ../rescue/virt-rescue.pod:39
20372 " virt-rescue -d GuestName\n"
20377 #: ../rescue/virt-rescue.pod:41
20380 " virt-rescue --ro -a /path/to/disk.img\n"
20385 #: ../rescue/virt-rescue.pod:43
20388 " virt-rescue -a /dev/sdc\n"
20393 #: ../rescue/virt-rescue.pod:45
20394 msgid "For live VMs you I<must> use the --ro option."
20398 #: ../rescue/virt-rescue.pod:47
20400 "When you run virt-rescue on a virtual machine or disk image, you are placed "
20401 "in an interactive bash shell where you can use many ordinary Linux "
20402 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
20403 "appliance. You must mount the virtual machine's filesystems by hand. There "
20404 "is an empty directory called C</sysroot> where you can mount filesystems."
20408 #: ../rescue/virt-rescue.pod:54
20410 "In the example below, we list logical volumes, then choose one to mount "
20411 "under C</sysroot>:"
20415 #: ../rescue/virt-rescue.pod:57
20419 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
20420 " lv_root vg_f11x64 -wi-a- 8.83G\n"
20421 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
20422 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
20423 " ><rescue> ls /sysroot\n"
20428 #: ../rescue/virt-rescue.pod:64
20430 "If you don't know what filesystems are available on the virtual machine then "
20431 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
20435 #: ../rescue/virt-rescue.pod:70
20437 "Virt-rescue can be used on I<any> disk image file or device, not just a "
20438 "virtual machine. For example you can use it on a blank file if you want to "
20439 "partition that file (although we would recommend using L<guestfish(1)> "
20440 "instead as it is more suitable for this purpose). You can even use virt-"
20441 "rescue on things like SD cards."
20445 #: ../rescue/virt-rescue.pod:76
20447 "Virt-rescue does not require root. You only need to run it as root if you "
20448 "need root to open the disk image."
20452 #: ../rescue/virt-rescue.pod:79
20454 "This tool is just designed for quick interactive hacking on a virtual "
20455 "machine. For more structured access to a virtual machine disk image, you "
20456 "should use L<guestfs(3)>. To get a structured shell that you can use to "
20457 "make scripted changes to guests, use L<guestfish(1)>."
20461 #: ../rescue/virt-rescue.pod:103
20462 msgid "B<--append kernelopts>"
20466 #: ../rescue/virt-rescue.pod:105
20467 msgid "Pass additional options to the rescue kernel."
20471 #: ../rescue/virt-rescue.pod:135
20474 " virt-rescue --format=raw -a disk.img\n"
20479 #: ../rescue/virt-rescue.pod:139
20482 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
20487 #: ../rescue/virt-rescue.pod:148
20492 #: ../rescue/virt-rescue.pod:150
20493 msgid "B<--memsize MB>"
20497 #: ../rescue/virt-rescue.pod:152
20499 "Change the amount of memory allocated to the rescue system. The default is "
20500 "set by libguestfs and is small but adequate for running system tools. The "
20501 "occasional program might need more memory. The parameter is specified in "
20506 #: ../rescue/virt-rescue.pod:157
20507 msgid "B<--network>"
20511 #: ../rescue/virt-rescue.pod:159
20512 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
20516 #: ../rescue/virt-rescue.pod:165
20517 msgid "Open the image read-only."
20521 #: ../rescue/virt-rescue.pod:175
20523 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
20524 "SELINUX> before using this option."
20528 #: ../rescue/virt-rescue.pod:194
20530 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
20531 "are done read-write."
20535 #: ../rescue/virt-rescue.pod:207
20536 msgid "Previous versions of virt-rescue allowed you to write either:"
20540 #: ../rescue/virt-rescue.pod:209
20543 " virt-rescue disk.img [disk.img ...]\n"
20548 #: ../rescue/virt-rescue.pod:213
20551 " virt-rescue guestname\n"
20556 #: ../rescue/virt-rescue.pod:221
20561 #: ../rescue/virt-rescue.pod:223
20563 "Adding the I<--network> option enables QEMU user networking in the rescue "
20564 "appliance. There are some differences between user networking and ordinary "
20569 #: ../rescue/virt-rescue.pod:229
20570 msgid "ping does not work"
20574 #: ../rescue/virt-rescue.pod:231
20576 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
20577 "send the ping packets, and because virt-rescue must be able to run as non-"
20578 "root, QEMU user networking is not able to emulate the L<ping(8)> command. "
20579 "The ping command will appear to resolve addresses but will not be able to "
20580 "send or receive any packets. This does not mean that the network is not "
20585 #: ../rescue/virt-rescue.pod:238
20586 msgid "cannot receive connections"
20590 #: ../rescue/virt-rescue.pod:240
20591 msgid "QEMU user networking cannot receive incoming connections."
20595 #: ../rescue/virt-rescue.pod:242
20596 msgid "making TCP connections"
20600 #: ../rescue/virt-rescue.pod:244
20602 "The virt-rescue appliance needs to be small and so does not include many "
20603 "network tools. In particular there is no L<telnet(1)> command. You can "
20604 "make TCP connections from the shell using the magical C</dev/tcp/"
20605 "E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
20609 #: ../rescue/virt-rescue.pod:249
20612 " exec 3<>/dev/tcp/redhat.com/80\n"
20613 " echo \"GET /\" >&3\n"
20619 #: ../rescue/virt-rescue.pod:253
20620 msgid "See L<bash(1)> for more details."
20624 #: ../rescue/virt-rescue.pod:259
20626 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
20627 "ENVIRONMENT VARIABLES> for the complete list."
20631 #: ../rescue/virt-rescue.pod:286
20633 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<http://"
20634 "libguestfs.org/>."
20638 #: ../resize/virt-resize.pod:5
20639 msgid "virt-resize - Resize a virtual machine disk"
20643 #: ../resize/virt-resize.pod:9
20646 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
20647 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
20648 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
20653 #: ../resize/virt-resize.pod:15
20655 "Virt-resize is a tool which can resize a virtual machine disk, making it "
20656 "larger or smaller overall, and resizing or deleting any partitions contained "
20661 #: ../resize/virt-resize.pod:19
20663 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
20664 "not> be used on live virtual machines - for consistent results, shut the "
20665 "virtual machine down before resizing it."
20669 #: ../resize/virt-resize.pod:23
20671 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
20672 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
20676 #: ../resize/virt-resize.pod:31 ../src/guestfs.pod:469 ../src/guestfs.pod:1257
20677 #: ../src/guestfs.pod:1396 ../src/guestfs.pod:2466
20682 #: ../resize/virt-resize.pod:33
20684 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
20685 "fill the extra 5GB of space."
20689 #: ../resize/virt-resize.pod:36
20692 " virt-filesystems --long -h --all -a olddisk\n"
20697 #: ../resize/virt-resize.pod:38
20700 " truncate -r olddisk newdisk\n"
20701 " truncate -s +5G newdisk\n"
20706 #: ../resize/virt-resize.pod:41
20709 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
20710 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
20715 #: ../resize/virt-resize.pod:44 ../src/guestfs.pod:475 ../src/guestfs.pod:1261
20716 #: ../src/guestfs.pod:1400 ../src/guestfs.pod:2491
20721 #: ../resize/virt-resize.pod:46
20723 "As above, but make the /boot partition 200MB bigger, while giving the "
20724 "remaining space to /dev/sda2:"
20728 #: ../resize/virt-resize.pod:49
20731 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20732 " olddisk newdisk\n"
20737 #: ../resize/virt-resize.pod:52 ../src/guestfs.pod:486 ../src/guestfs.pod:1406
20742 #: ../resize/virt-resize.pod:54
20744 "As in the first example, but expand a logical volume as the final step. "
20745 "This is what you would typically use for Linux guests that use LVM:"
20749 #: ../resize/virt-resize.pod:58
20752 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
20753 " olddisk newdisk\n"
20758 #: ../resize/virt-resize.pod:61
20763 #: ../resize/virt-resize.pod:63
20765 "As in the first example, but the output format will be qcow2 instead of a "
20770 #: ../resize/virt-resize.pod:66
20773 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
20774 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
20779 #: ../resize/virt-resize.pod:71
20780 msgid "DETAILED USAGE"
20784 #: ../resize/virt-resize.pod:73
20785 msgid "EXPANDING A VIRTUAL MACHINE DISK"
20789 #: ../resize/virt-resize.pod:77
20790 msgid "1. Shut down the virtual machine"
20794 #: ../resize/virt-resize.pod:79
20795 msgid "2. Locate input disk image"
20799 #: ../resize/virt-resize.pod:81
20801 "Locate the input disk image (ie. the file or device on the host containing "
20802 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
20803 "dumpxml> like this to find the disk image name:"
20807 #: ../resize/virt-resize.pod:85
20810 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
20811 " Found 1 nodes:\n"
20813 " <source dev=\"/dev/vg/lv_guest\" />\n"
20818 #: ../resize/virt-resize.pod:90
20819 msgid "3. Look at current sizing"
20823 #: ../resize/virt-resize.pod:92
20824 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
20828 #: ../resize/virt-resize.pod:95
20831 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
20832 " Name Type Size Parent\n"
20833 " /dev/sda1 partition 101M /dev/sda\n"
20834 " /dev/sda2 partition 7.9G /dev/sda\n"
20835 " /dev/sda device 8.0G -\n"
20840 #: ../resize/virt-resize.pod:101
20842 "(This example is a virtual machine with an 8 GB disk which we would like to "
20843 "expand up to 10 GB)."
20847 #: ../resize/virt-resize.pod:104
20848 msgid "4. Create output disk"
20852 #: ../resize/virt-resize.pod:106
20854 "Virt-resize cannot do in-place disk modifications. You have to have space "
20855 "to store the resized output disk."
20859 #: ../resize/virt-resize.pod:109
20861 "To store the resized disk image in a file, create a file of a suitable size:"
20865 #: ../resize/virt-resize.pod:112
20868 " # rm -f outdisk\n"
20869 " # truncate -s 10G outdisk\n"
20874 #: ../resize/virt-resize.pod:115
20875 msgid "Or use L<lvcreate(1)> to create a logical volume:"
20879 #: ../resize/virt-resize.pod:117
20882 " # lvcreate -L 10G -n lv_name vg_name\n"
20887 #: ../resize/virt-resize.pod:119
20888 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
20892 #: ../resize/virt-resize.pod:121
20895 " # virsh pool-list\n"
20896 " # virsh vol-create-as poolname newvol 10G\n"
20901 #: ../resize/virt-resize.pod:124
20906 #: ../resize/virt-resize.pod:126
20908 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
20909 "file) and the output disk. The output disk is the one created in the "
20914 #: ../resize/virt-resize.pod:130
20917 " # virt-resize indisk outdisk\n"
20922 #: ../resize/virt-resize.pod:132
20924 "This command just copies disk image C<indisk> to disk image C<outdisk> "
20925 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
20926 "larger, then an extra, empty partition is created at the end of the disk "
20927 "covering the extra space. If C<outdisk> is smaller, then it will give an "
20932 #: ../resize/virt-resize.pod:138
20934 "More realistically you'd want to expand existing partitions in the disk "
20935 "image by passing extra options (for the full list see the L</OPTIONS> "
20940 #: ../resize/virt-resize.pod:142
20942 "L</--expand> is the most useful option. It expands the named partition "
20943 "within the disk to fill any extra space:"
20947 #: ../resize/virt-resize.pod:145
20950 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
20955 #: ../resize/virt-resize.pod:147
20957 "(In this case, an extra partition is I<not> created at the end of the disk, "
20958 "because there will be no unused space)."
20962 #: ../resize/virt-resize.pod:150
20964 "L</--resize> is the other commonly used option. The following would "
20965 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
20966 "rest of the available space:"
20970 #: ../resize/virt-resize.pod:154
20973 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
20974 " indisk outdisk\n"
20979 #: ../resize/virt-resize.pod:157
20981 "If the expanded partition in the image contains a filesystem or LVM PV, then "
20982 "if virt-resize knows how, it will resize the contents, the equivalent of "
20983 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
20984 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
20985 "filesystems, so you would have to online resize them after booting the guest."
20989 #: ../resize/virt-resize.pod:164
20990 msgid "Other options are covered below."
20994 #: ../resize/virt-resize.pod:166
20999 #: ../resize/virt-resize.pod:168
21000 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21004 #: ../resize/virt-resize.pod:170
21005 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21009 #: ../resize/virt-resize.pod:172
21012 " # virsh edit guestname\n"
21017 #: ../resize/virt-resize.pod:174
21019 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
21020 "html#elementsDisks>"
21024 #: ../resize/virt-resize.pod:177
21025 msgid "Then start up the domain with the new, resized disk:"
21029 #: ../resize/virt-resize.pod:179
21032 " # virsh start guestname\n"
21037 #: ../resize/virt-resize.pod:181
21039 "and check that it still works. See also the L</NOTES> section below for "
21040 "additional information."
21044 #: ../resize/virt-resize.pod:184
21045 msgid "7. Resize LVs etc inside the guest"
21049 #: ../resize/virt-resize.pod:186
21050 msgid "(This can also be done offline using L<guestfish(1)>)"
21054 #: ../resize/virt-resize.pod:188
21056 "Once the guest has booted you should see the new space available, at least "
21057 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
21058 "may need to resize LVs inside PVs, and also resize filesystem types that "
21059 "virt-resize does not know how to expand."
21063 #: ../resize/virt-resize.pod:195
21064 msgid "SHRINKING A VIRTUAL MACHINE DISK"
21068 #: ../resize/virt-resize.pod:197
21070 "Shrinking is somewhat more complex than expanding, and only an overview is "
21075 #: ../resize/virt-resize.pod:200
21077 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
21078 "filesystems). The user has to shrink content before passing the disk image "
21079 "to virt-resize, and virt-resize will check that the content has been shrunk "
21084 #: ../resize/virt-resize.pod:205
21085 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
21089 #: ../resize/virt-resize.pod:207
21091 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
21092 "steps 3 and 4 above to allocate a new disk image."
21096 #: ../resize/virt-resize.pod:210
21098 "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
21102 #: ../resize/virt-resize.pod:213
21103 msgid "IGNORING OR DELETING PARTITIONS"
21107 #: ../resize/virt-resize.pod:215
21109 "virt-resize also gives a convenient way to ignore or delete partitions when "
21110 "copying from the input disk to the output disk. Ignoring a partition speeds "
21111 "up the copy where you don't care about the existing contents of a "
21112 "partition. Deleting a partition removes it completely, but note that it "
21113 "also renumbers any partitions after the one which is deleted, which can "
21114 "leave some guests unbootable."
21118 #: ../resize/virt-resize.pod:222
21119 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
21123 #: ../resize/virt-resize.pod:224
21125 "If the input disk is in qcow2 format, then you may prefer that the output is "
21126 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
21127 "the fly. The output format is simply determined by the format of the empty "
21128 "output container that you provide. Thus to create qcow2 output, use:"
21132 #: ../resize/virt-resize.pod:230
21135 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
21140 #: ../resize/virt-resize.pod:232
21141 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
21145 #: ../resize/virt-resize.pod:234
21146 msgid "Similarly, to get non-sparse raw output use:"
21150 #: ../resize/virt-resize.pod:236
21153 " fallocate -l size outdisk\n"
21158 #: ../resize/virt-resize.pod:238
21160 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
21161 "dev/zero of=outdisk bs=1M count=..>)"
21165 #: ../resize/virt-resize.pod:247
21166 msgid "Display help."
21170 #: ../resize/virt-resize.pod:249
21175 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177
21176 #: ../tools/virt-win-reg.pl:120
21181 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
21182 msgid "Enable debugging messages."
21186 #: ../resize/virt-resize.pod:255
21187 msgid "B<--delete part>"
21191 #: ../resize/virt-resize.pod:257
21193 "Delete the named partition. It would be more accurate to describe this as "
21194 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
21195 "the original disk image is left intact."
21199 #: ../resize/virt-resize.pod:261
21201 "Note that when you delete a partition, then anything contained in the "
21202 "partition is also deleted. Furthermore, this causes any partitions that "
21203 "come after to be I<renumbered>, which can easily make your guest unbootable."
21207 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327
21208 #: ../resize/virt-resize.pod:448
21209 msgid "You can give this option multiple times."
21213 #: ../resize/virt-resize.pod:268
21214 msgid "B<--expand part>"
21218 #: ../resize/virt-resize.pod:270
21220 "Expand the named partition so it uses up all extra space (space left over "
21221 "after any other resize changes that you request have been done)."
21225 #: ../resize/virt-resize.pod:273
21227 "If virt-resize knows how, it will expand the direct content of the "
21228 "partition. For example, if the partition is an LVM PV, it will expand the "
21229 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
21230 "content it doesn't know about alone."
21234 #: ../resize/virt-resize.pod:278
21235 msgid "Currently virt-resize can resize:"
21239 #: ../resize/virt-resize.pod:284
21240 msgid "ext2, ext3 and ext4 filesystems."
21244 #: ../resize/virt-resize.pod:288
21245 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
21249 #: ../resize/virt-resize.pod:290
21251 "The filesystem must have been shut down consistently last time it was used. "
21252 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
21253 "consistency check, so at the first boot after resizing Windows will check "
21258 #: ../resize/virt-resize.pod:297
21260 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
21261 "inside the PV, but see the I<--LV-expand> option. The user could also "
21262 "resize LVs as desired after boot."
21266 #: ../resize/virt-resize.pod:303
21267 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
21271 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:476
21272 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
21276 #: ../resize/virt-resize.pod:309 ../tools/virt-list-filesystems.pl:91
21277 #: ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141
21278 #: ../tools/virt-win-reg.pl:142
21279 msgid "B<--format> raw"
21283 #: ../resize/virt-resize.pod:311
21285 "Specify the format of the input disk image. If this flag is not given then "
21286 "it is auto-detected from the image itself."
21290 #: ../resize/virt-resize.pod:317
21292 "Note that this option I<does not> affect the output format. See L</QCOW2 "
21293 "AND NON-SPARSE RAW FORMATS>."
21297 #: ../resize/virt-resize.pod:320
21298 msgid "B<--ignore part>"
21302 #: ../resize/virt-resize.pod:322
21304 "Ignore the named partition. Effectively this means the partition is "
21305 "allocated on the destination disk, but the content is not copied across from "
21306 "the source disk. The content of the partition will be blank (all zero "
21311 #: ../resize/virt-resize.pod:329
21312 msgid "B<--LV-expand logvol>"
21316 #: ../resize/virt-resize.pod:331
21318 "This takes the logical volume and, as a final step, expands it to fill all "
21319 "the space available in its volume group. A typical usage, assuming a Linux "
21320 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
21321 "lv_root> would be:"
21325 #: ../resize/virt-resize.pod:336
21328 " virt-resize indisk outdisk \\\n"
21329 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
21334 #: ../resize/virt-resize.pod:339
21336 "This would first expand the partition (and PV), and then expand the root "
21337 "device to fill the extra space in the PV."
21341 #: ../resize/virt-resize.pod:342
21343 "The contents of the LV are also resized if virt-resize knows how to do "
21344 "that. You can stop virt-resize from trying to expand the content by using "
21345 "the option I<--no-expand-content>."
21349 #: ../resize/virt-resize.pod:346
21350 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
21354 #: ../resize/virt-resize.pod:348
21356 "You can give this option multiple times, I<but> it doesn't make sense to do "
21357 "this unless the logical volumes you specify are all in different volume "
21362 #: ../resize/virt-resize.pod:354
21363 msgid "B<--dryrun>"
21367 #: ../resize/virt-resize.pod:356
21368 msgid "Print a summary of what would be done, but don't do anything."
21372 #: ../resize/virt-resize.pod:358
21373 msgid "B<--no-copy-boot-loader>"
21377 #: ../resize/virt-resize.pod:360
21379 "By default, virt-resize copies over some sectors at the start of the disk "
21380 "(up to the beginning of the first partition). Commonly these sectors "
21381 "contain the Master Boot Record (MBR) and the boot loader, and are required "
21382 "in order for the guest to boot correctly."
21386 #: ../resize/virt-resize.pod:365
21388 "If you specify this flag, then this initial copy is not done. You may need "
21389 "to reinstall the boot loader in this case."
21393 #: ../resize/virt-resize.pod:368
21394 msgid "B<--no-extra-partition>"
21398 #: ../resize/virt-resize.pod:370
21400 "By default, virt-resize creates an extra partition if there is any extra, "
21401 "unused space after all resizing has happened. Use this option to prevent "
21402 "the extra partition from being created. If you do this then the extra space "
21403 "will be inaccessible until you run fdisk, parted, or some other partitioning "
21404 "tool in the guest."
21408 #: ../resize/virt-resize.pod:376
21410 "Note that if the surplus space is smaller than 10 MB, no extra partition "
21415 #: ../resize/virt-resize.pod:379
21416 msgid "B<--no-expand-content>"
21420 #: ../resize/virt-resize.pod:381
21422 "By default, virt-resize will try to expand the direct contents of "
21423 "partitions, if it knows how (see I<--expand> option above)."
21427 #: ../resize/virt-resize.pod:384
21429 "If you give the I<--no-expand-content> option then virt-resize will not "
21434 #: ../resize/virt-resize.pod:387
21435 msgid "B<--ntfsresize-force>"
21439 #: ../resize/virt-resize.pod:389
21441 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
21442 "the NTFS disk is marked as needing a consistency check. You have to use "
21443 "this option if you want to resize a Windows guest multiple times without "
21444 "booting into Windows between each resize."
21448 #: ../resize/virt-resize.pod:395
21449 msgid "B<--output-format> raw"
21453 #: ../resize/virt-resize.pod:397
21455 "Specify the format of the output disk image. If this flag is not given then "
21456 "it is auto-detected from the image itself."
21460 #: ../resize/virt-resize.pod:403
21462 "Note that this option I<does not create> the output format. This option "
21463 "just tells libguestfs what it is so it doesn't try to guess it. You still "
21464 "need to create the output disk with the right format. See L</QCOW2 AND NON-"
21465 "SPARSE RAW FORMATS>."
21469 #: ../resize/virt-resize.pod:408
21474 #: ../resize/virt-resize.pod:410
21479 #: ../resize/virt-resize.pod:412
21480 msgid "Don't print the summary."
21484 #: ../resize/virt-resize.pod:414
21485 msgid "B<--resize part=size>"
21489 #: ../resize/virt-resize.pod:416
21491 "Resize the named partition (expanding or shrinking it) so that it has the "
21496 #: ../resize/virt-resize.pod:419
21498 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
21499 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
21500 "size; or as a relative number or percentage. For example:"
21504 #: ../resize/virt-resize.pod:425
21507 " --resize /dev/sda2=10G\n"
21512 #: ../resize/virt-resize.pod:427
21515 " --resize /dev/sda4=90%\n"
21520 #: ../resize/virt-resize.pod:429
21523 " --resize /dev/sda2=+1G\n"
21528 #: ../resize/virt-resize.pod:431
21531 " --resize /dev/sda2=-200M\n"
21536 #: ../resize/virt-resize.pod:433
21539 " --resize /dev/sda1=+128K\n"
21544 #: ../resize/virt-resize.pod:435
21547 " --resize /dev/sda1=+10%\n"
21552 #: ../resize/virt-resize.pod:437
21555 " --resize /dev/sda1=-10%\n"
21560 #: ../resize/virt-resize.pod:439
21562 "You can increase the size of any partition. Virt-resize will expand the "
21563 "direct content of the partition if it knows how (see I<--expand> below)."
21567 #: ../resize/virt-resize.pod:443
21569 "You can only I<decrease> the size of partitions that contain filesystems or "
21570 "PVs which have already been shrunk. Virt-resize will check this has been "
21571 "done before proceeding, or else will print an error (see also I<--resize-"
21576 #: ../resize/virt-resize.pod:450
21577 msgid "B<--resize-force part=size>"
21581 #: ../resize/virt-resize.pod:452
21583 "This is the same as I<--resize> except that it will let you decrease the "
21584 "size of any partition. Generally this means you will lose any data which "
21585 "was at the end of the partition you shrink, but you may not care about that "
21586 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
21587 "as a swap partition)."
21591 #: ../resize/virt-resize.pod:458
21592 msgid "See also the I<--ignore> option."
21596 #: ../resize/virt-resize.pod:460
21597 msgid "B<--shrink part>"
21601 #: ../resize/virt-resize.pod:462
21603 "Shrink the named partition until the overall disk image fits in the "
21604 "destination. The named partition B<must> contain a filesystem or PV which "
21605 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
21606 "online tools). Virt-resize will check this and give an error if it has not "
21611 #: ../resize/virt-resize.pod:468
21613 "The amount by which the overall disk must be shrunk (after carrying out all "
21614 "other operations requested by the user) is called the \"deficit\". For "
21615 "example, a straight copy (assume no other operations) from a 5GB disk image "
21616 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
21617 "would give an error unless the user specified a partition to shrink and that "
21618 "partition had more than a gigabyte of free space."
21622 #: ../resize/virt-resize.pod:488
21623 msgid "\"Partition 1 does not end on cylinder boundary.\""
21627 #: ../resize/virt-resize.pod:490
21629 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
21630 "means the partitions will not be aligned to the ancient CHS geometry. "
21631 "However CHS geometry is meaningless for disks manufactured since the early "
21632 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
21633 "cylinders is not required by any modern operating system."
21637 #: ../resize/virt-resize.pod:497
21638 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
21642 #: ../resize/virt-resize.pod:499
21644 "In Windows Vista and later versions, Microsoft switched to using a separate "
21645 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
21646 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
21647 "the boot partition. Doing so seems to break the guest completely. However "
21648 "expanding the second partition (ie. C: drive) should work."
21652 #: ../resize/virt-resize.pod:506
21654 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
21655 "NTFS partitions have been expanded. This is just a safety check and (unless "
21656 "it find errors) is nothing to worry about."
21660 #: ../resize/virt-resize.pod:510
21661 msgid "GUEST BOOT STUCK AT \"GRUB\""
21665 #: ../resize/virt-resize.pod:512
21667 "If a Linux guest does not boot after resizing, and the boot is stuck after "
21668 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
21669 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
21670 "although we think is to do with partition alignment."
21674 #: ../resize/virt-resize.pod:517
21677 " guestfish -i -a newdisk\n"
21678 " ><fs> cat /boot/grub/device.map\n"
21679 " # check the contents of this file are sensible or\n"
21680 " # edit the file if necessary\n"
21681 " ><fs> grub-install / /dev/vda\n"
21687 #: ../resize/virt-resize.pod:524
21689 "For more flexible guest reconfiguration, including if you need to specify "
21690 "other parameters to grub-install, use L<virt-rescue(1)>."
21694 #: ../resize/virt-resize.pod:527
21695 msgid "ALTERNATIVE TOOLS"
21699 #: ../resize/virt-resize.pod:529
21701 "There are several proprietary tools for resizing partitions. We won't "
21702 "mention any here."
21706 #: ../resize/virt-resize.pod:532
21708 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
21709 "operations on disk images. They can resize and move partitions, but I don't "
21710 "think they can do anything with the contents, and they certainly don't "
21715 #: ../resize/virt-resize.pod:537
21717 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
21718 "but at a much lower level. You will probably end up hand-calculating sector "
21719 "offsets, which is something that virt-resize was designed to avoid. If you "
21720 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
21725 #: ../resize/virt-resize.pod:552
21727 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
21728 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
21729 "L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, "
21730 "L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, L<http://libguestfs.org/>."
21734 #: ../ruby/examples/guestfs-ruby.pod:5
21735 msgid "guestfs-ruby - How to use libguestfs from Ruby"
21739 #: ../ruby/examples/guestfs-ruby.pod:9
21742 " require 'guestfs'\n"
21743 " g = Guestfs::Guestfs.new()\n"
21744 " g.add_drive_opts(\"disk.img\",\n"
21745 " :readonly => 1, :format => \"raw\")\n"
21751 #: ../ruby/examples/guestfs-ruby.pod:17
21753 "This manual page documents how to call libguestfs from the Ruby programming "
21754 "language. This page just documents the differences from the C API and gives "
21755 "some examples. If you are not familiar with using libguestfs, you also need "
21756 "to read L<guestfs(3)>."
21760 #: ../ruby/examples/guestfs-ruby.pod:24
21762 "Errors from libguestfs functions are mapped into the C<Error> exception. "
21763 "This has a single parameter which is the error message (a string)."
21767 #: ../ruby/examples/guestfs-ruby.pod:38
21769 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)"
21770 ">, L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://"
21771 "libguestfs.org/>."
21775 #: ../src/guestfs-actions.pod:1
21776 msgid "guestfs_add_cdrom"
21780 #: ../src/guestfs-actions.pod:3
21784 " guestfs_add_cdrom (guestfs_h *g,\n"
21785 " const char *filename);\n"
21790 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249
21791 #: ../src/guestfs-actions.pod:270
21793 "I<This function is deprecated.> In new code, use the L</"
21794 "guestfs_add_drive_opts> call instead."
21798 #: ../src/guestfs-actions.pod:24
21800 "This call checks for the existence of C<filename>. This stops you from "
21801 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21802 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
21807 #: ../src/guestfs-actions.pod:31
21809 "If you just want to add an ISO file (often you use this as an efficient way "
21810 "to transfer large files into the guest), then you should probably use "
21811 "C<guestfs_add_drive_ro> instead."
21815 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140
21816 #: ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238
21817 #: ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280
21818 #: ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307
21819 #: ../src/guestfs-actions.pod:422 ../src/guestfs-actions.pod:442
21820 #: ../src/guestfs-actions.pod:456 ../src/guestfs-actions.pod:501
21821 #: ../src/guestfs-actions.pod:529 ../src/guestfs-actions.pod:547
21822 #: ../src/guestfs-actions.pod:614 ../src/guestfs-actions.pod:647
21823 #: ../src/guestfs-actions.pod:661 ../src/guestfs-actions.pod:676
21824 #: ../src/guestfs-actions.pod:775 ../src/guestfs-actions.pod:793
21825 #: ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:821
21826 #: ../src/guestfs-actions.pod:858 ../src/guestfs-actions.pod:1041
21827 #: ../src/guestfs-actions.pod:1061 ../src/guestfs-actions.pod:1079
21828 #: ../src/guestfs-actions.pod:1163 ../src/guestfs-actions.pod:1181
21829 #: ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1214
21830 #: ../src/guestfs-actions.pod:1234 ../src/guestfs-actions.pod:1304
21831 #: ../src/guestfs-actions.pod:1335 ../src/guestfs-actions.pod:1360
21832 #: ../src/guestfs-actions.pod:1402 ../src/guestfs-actions.pod:1515
21833 #: ../src/guestfs-actions.pod:1542 ../src/guestfs-actions.pod:1757
21834 #: ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1866
21835 #: ../src/guestfs-actions.pod:2341 ../src/guestfs-actions.pod:2485
21836 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2581
21837 #: ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3636
21838 #: ../src/guestfs-actions.pod:3661 ../src/guestfs-actions.pod:3850
21839 #: ../src/guestfs-actions.pod:3864 ../src/guestfs-actions.pod:3877
21840 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3906
21841 #: ../src/guestfs-actions.pod:3942 ../src/guestfs-actions.pod:4014
21842 #: ../src/guestfs-actions.pod:4034 ../src/guestfs-actions.pod:4051
21843 #: ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4097
21844 #: ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:4151
21845 #: ../src/guestfs-actions.pod:4170 ../src/guestfs-actions.pod:4205
21846 #: ../src/guestfs-actions.pod:4217 ../src/guestfs-actions.pod:4253
21847 #: ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:4282
21848 #: ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4314
21849 #: ../src/guestfs-actions.pod:4407 ../src/guestfs-actions.pod:4427
21850 #: ../src/guestfs-actions.pod:4440 ../src/guestfs-actions.pod:4491
21851 #: ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4527
21852 #: ../src/guestfs-actions.pod:4543 ../src/guestfs-actions.pod:4557
21853 #: ../src/guestfs-actions.pod:4571 ../src/guestfs-actions.pod:4588
21854 #: ../src/guestfs-actions.pod:4603 ../src/guestfs-actions.pod:4630
21855 #: ../src/guestfs-actions.pod:4693 ../src/guestfs-actions.pod:4766
21856 #: ../src/guestfs-actions.pod:4797 ../src/guestfs-actions.pod:4816
21857 #: ../src/guestfs-actions.pod:4835 ../src/guestfs-actions.pod:4847
21858 #: ../src/guestfs-actions.pod:4864 ../src/guestfs-actions.pod:4877
21859 #: ../src/guestfs-actions.pod:4892 ../src/guestfs-actions.pod:4907
21860 #: ../src/guestfs-actions.pod:4949 ../src/guestfs-actions.pod:4975
21861 #: ../src/guestfs-actions.pod:5014 ../src/guestfs-actions.pod:5034
21862 #: ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5065
21863 #: ../src/guestfs-actions.pod:5114 ../src/guestfs-actions.pod:5167
21864 #: ../src/guestfs-actions.pod:5214 ../src/guestfs-actions.pod:5257
21865 #: ../src/guestfs-actions.pod:5285 ../src/guestfs-actions.pod:5302
21866 #: ../src/guestfs-actions.pod:5320 ../src/guestfs-actions.pod:5460
21867 #: ../src/guestfs-actions.pod:5517 ../src/guestfs-actions.pod:5539
21868 #: ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5589
21869 #: ../src/guestfs-actions.pod:5655 ../src/guestfs-actions.pod:5672
21870 #: ../src/guestfs-actions.pod:5685 ../src/guestfs-actions.pod:5699
21871 #: ../src/guestfs-actions.pod:5988 ../src/guestfs-actions.pod:6007
21872 #: ../src/guestfs-actions.pod:6026 ../src/guestfs-actions.pod:6040
21873 #: ../src/guestfs-actions.pod:6052 ../src/guestfs-actions.pod:6066
21874 #: ../src/guestfs-actions.pod:6078 ../src/guestfs-actions.pod:6092
21875 #: ../src/guestfs-actions.pod:6108 ../src/guestfs-actions.pod:6129
21876 #: ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6167
21877 #: ../src/guestfs-actions.pod:6197 ../src/guestfs-actions.pod:6215
21878 #: ../src/guestfs-actions.pod:6238 ../src/guestfs-actions.pod:6256
21879 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6296
21880 #: ../src/guestfs-actions.pod:6315 ../src/guestfs-actions.pod:6332
21881 #: ../src/guestfs-actions.pod:6351 ../src/guestfs-actions.pod:6379
21882 #: ../src/guestfs-actions.pod:6403 ../src/guestfs-actions.pod:6422
21883 #: ../src/guestfs-actions.pod:6446 ../src/guestfs-actions.pod:6465
21884 #: ../src/guestfs-actions.pod:6480 ../src/guestfs-actions.pod:6499
21885 #: ../src/guestfs-actions.pod:6543 ../src/guestfs-actions.pod:6573
21886 #: ../src/guestfs-actions.pod:6606 ../src/guestfs-actions.pod:6721
21887 #: ../src/guestfs-actions.pod:6842 ../src/guestfs-actions.pod:6854
21888 #: ../src/guestfs-actions.pod:6867 ../src/guestfs-actions.pod:6880
21889 #: ../src/guestfs-actions.pod:6902 ../src/guestfs-actions.pod:6915
21890 #: ../src/guestfs-actions.pod:6928 ../src/guestfs-actions.pod:6941
21891 #: ../src/guestfs-actions.pod:6956 ../src/guestfs-actions.pod:7015
21892 #: ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7048
21893 #: ../src/guestfs-actions.pod:7064 ../src/guestfs-actions.pod:7081
21894 #: ../src/guestfs-actions.pod:7094 ../src/guestfs-actions.pod:7114
21895 #: ../src/guestfs-actions.pod:7150 ../src/guestfs-actions.pod:7164
21896 #: ../src/guestfs-actions.pod:7205 ../src/guestfs-actions.pod:7218
21897 #: ../src/guestfs-actions.pod:7236 ../src/guestfs-actions.pod:7270
21898 #: ../src/guestfs-actions.pod:7306 ../src/guestfs-actions.pod:7422
21899 #: ../src/guestfs-actions.pod:7437 ../src/guestfs-actions.pod:7451
21900 #: ../src/guestfs-actions.pod:7506 ../src/guestfs-actions.pod:7519
21901 #: ../src/guestfs-actions.pod:7564 ../src/guestfs-actions.pod:7604
21902 #: ../src/guestfs-actions.pod:7660 ../src/guestfs-actions.pod:7680
21903 #: ../src/guestfs-actions.pod:7713 ../src/guestfs-actions.pod:7773
21904 #: ../src/guestfs-actions.pod:7792 ../src/guestfs-actions.pod:7821
21905 msgid "This function returns 0 on success or -1 on error."
21909 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142
21910 #: ../src/guestfs-actions.pod:1165 ../src/guestfs-actions.pod:1980
21911 #: ../src/guestfs-actions.pod:2078 ../src/guestfs-actions.pod:2192
21912 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3643
21913 #: ../src/guestfs-actions.pod:4951 ../src/guestfs-actions.pod:6217
21914 #: ../src/guestfs-actions.pod:6334 ../src/guestfs-actions.pod:6467
21915 #: ../src/guestfs-actions.pod:6958 ../src/guestfs-actions.pod:7083
21916 #: ../src/guestfs-actions.pod:7606
21917 msgid "(Added in 0.3)"
21921 #: ../src/guestfs-actions.pod:41
21922 msgid "guestfs_add_domain"
21926 #: ../src/guestfs-actions.pod:43
21930 " guestfs_add_domain (guestfs_h *g,\n"
21931 " const char *dom,\n"
21937 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151
21938 #: ../src/guestfs-actions.pod:832 ../src/guestfs-actions.pod:2826
21939 #: ../src/guestfs-actions.pod:4642 ../src/guestfs-actions.pod:4961
21940 #: ../src/guestfs-actions.pod:5178
21942 "You may supply a list of optional arguments to this call. Use zero or more "
21943 "of the following pairs of parameters, and terminate the list with C<-1> on "
21944 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
21948 #: ../src/guestfs-actions.pod:53
21951 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
21952 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
21953 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
21954 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
21955 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
21960 #: ../src/guestfs-actions.pod:59
21962 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21963 "It works by connecting to libvirt, requesting the domain and domain XML from "
21964 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
21969 #: ../src/guestfs-actions.pod:94
21971 "The other optional parameters are passed directly through to "
21972 "C<guestfs_add_drive_opts>."
21976 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350
21977 #: ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:693
21978 #: ../src/guestfs-actions.pod:724 ../src/guestfs-actions.pod:742
21979 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:1380
21980 #: ../src/guestfs-actions.pod:1736 ../src/guestfs-actions.pod:1939
21981 #: ../src/guestfs-actions.pod:2050 ../src/guestfs-actions.pod:2101
21982 #: ../src/guestfs-actions.pod:2156 ../src/guestfs-actions.pod:2179
21983 #: ../src/guestfs-actions.pod:2472 ../src/guestfs-actions.pod:2944
21984 #: ../src/guestfs-actions.pod:2962 ../src/guestfs-actions.pod:5137
21985 #: ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5769
21986 #: ../src/guestfs-actions.pod:5795 ../src/guestfs-actions.pod:7191
21987 #: ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:7630
21988 #: ../src/guestfs-actions.pod:7643
21989 msgid "On error this function returns -1."
21993 #: ../src/guestfs-actions.pod:99
21994 msgid "(Added in 1.7.4)"
21998 #: ../src/guestfs-actions.pod:101
21999 msgid "guestfs_add_domain_va"
22003 #: ../src/guestfs-actions.pod:103
22007 " guestfs_add_domain_va (guestfs_h *g,\n"
22008 " const char *dom,\n"
22009 " va_list args);\n"
22014 #: ../src/guestfs-actions.pod:108
22015 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
22019 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121
22020 #: ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225
22021 #: ../src/guestfs-actions.pod:871 ../src/guestfs-actions.pod:882
22022 #: ../src/guestfs-actions.pod:2910 ../src/guestfs-actions.pod:2922
22023 #: ../src/guestfs-actions.pod:4707 ../src/guestfs-actions.pod:4719
22024 #: ../src/guestfs-actions.pod:4989 ../src/guestfs-actions.pod:5001
22025 #: ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:5238
22026 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
22030 #: ../src/guestfs-actions.pod:112
22031 msgid "guestfs_add_domain_argv"
22035 #: ../src/guestfs-actions.pod:114
22039 " guestfs_add_domain_argv (guestfs_h *g,\n"
22040 " const char *dom,\n"
22041 " const struct guestfs_add_domain_argv *optargs);\n"
22046 #: ../src/guestfs-actions.pod:119
22047 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
22051 #: ../src/guestfs-actions.pod:123
22052 msgid "guestfs_add_drive"
22056 #: ../src/guestfs-actions.pod:125
22060 " guestfs_add_drive (guestfs_h *g,\n"
22061 " const char *filename);\n"
22066 #: ../src/guestfs-actions.pod:129
22068 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
22069 "optional parameters, so the disk is added writable, with the format being "
22070 "detected automatically."
22074 #: ../src/guestfs-actions.pod:133
22076 "Automatic detection of the format opens you up to a potential security hole "
22077 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
22078 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
22079 "you should think about replacing calls to this function with calls to "
22080 "C<guestfs_add_drive_opts>, and specifying the format."
22084 #: ../src/guestfs-actions.pod:144
22085 msgid "guestfs_add_drive_opts"
22089 #: ../src/guestfs-actions.pod:146
22093 " guestfs_add_drive_opts (guestfs_h *g,\n"
22094 " const char *filename,\n"
22100 #: ../src/guestfs-actions.pod:156
22103 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
22104 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
22105 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
22110 #: ../src/guestfs-actions.pod:185
22112 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
22113 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
22114 "Possible formats include C<raw> and C<qcow2>."
22118 #: ../src/guestfs-actions.pod:196
22120 "This rarely-used option lets you emulate the behaviour of the deprecated "
22121 "C<guestfs_add_drive_with_if> call (q.v.)"
22125 #: ../src/guestfs-actions.pod:203
22126 msgid "(Added in 1.5.23)"
22130 #: ../src/guestfs-actions.pod:205
22131 msgid "guestfs_add_drive_opts_va"
22135 #: ../src/guestfs-actions.pod:207
22139 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
22140 " const char *filename,\n"
22141 " va_list args);\n"
22146 #: ../src/guestfs-actions.pod:212
22147 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
22151 #: ../src/guestfs-actions.pod:216
22152 msgid "guestfs_add_drive_opts_argv"
22156 #: ../src/guestfs-actions.pod:218
22160 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
22161 " const char *filename,\n"
22162 " const struct guestfs_add_drive_opts_argv *optargs);\n"
22167 #: ../src/guestfs-actions.pod:223
22168 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
22172 #: ../src/guestfs-actions.pod:227
22173 msgid "guestfs_add_drive_ro"
22177 #: ../src/guestfs-actions.pod:229
22181 " guestfs_add_drive_ro (guestfs_h *g,\n"
22182 " const char *filename);\n"
22187 #: ../src/guestfs-actions.pod:233
22189 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
22190 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
22191 "disk is added read-only, with the format being detected automatically."
22195 #: ../src/guestfs-actions.pod:240
22196 msgid "(Added in 1.0.38)"
22200 #: ../src/guestfs-actions.pod:242
22201 msgid "guestfs_add_drive_ro_with_if"
22205 #: ../src/guestfs-actions.pod:244
22209 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
22210 " const char *filename,\n"
22211 " const char *iface);\n"
22216 #: ../src/guestfs-actions.pod:256
22218 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
22219 "QEMU interface emulation to use at run time."
22223 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282
22224 #: ../src/guestfs-actions.pod:2431
22225 msgid "(Added in 1.0.84)"
22229 #: ../src/guestfs-actions.pod:263
22230 msgid "guestfs_add_drive_with_if"
22234 #: ../src/guestfs-actions.pod:265
22238 " guestfs_add_drive_with_if (guestfs_h *g,\n"
22239 " const char *filename,\n"
22240 " const char *iface);\n"
22245 #: ../src/guestfs-actions.pod:277
22247 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
22248 "QEMU interface emulation to use at run time."
22252 #: ../src/guestfs-actions.pod:284
22253 msgid "guestfs_aug_clear"
22257 #: ../src/guestfs-actions.pod:286
22261 " guestfs_aug_clear (guestfs_h *g,\n"
22262 " const char *augpath);\n"
22267 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2181
22268 msgid "(Added in 1.3.4)"
22272 #: ../src/guestfs-actions.pod:297
22273 msgid "guestfs_aug_close"
22277 #: ../src/guestfs-actions.pod:299
22281 " guestfs_aug_close (guestfs_h *g);\n"
22286 #: ../src/guestfs-actions.pod:302
22288 "Close the current Augeas handle and free up any resources used by it. After "
22289 "calling this, you have to call C<guestfs_aug_init> again before you can use "
22290 "any other Augeas functions."
22294 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334
22295 #: ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366
22296 #: ../src/guestfs-actions.pod:424 ../src/guestfs-actions.pod:444
22297 #: ../src/guestfs-actions.pod:458 ../src/guestfs-actions.pod:489
22298 #: ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:517
22299 #: ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:549
22300 #: ../src/guestfs-actions.pod:5846
22301 msgid "(Added in 0.7)"
22305 #: ../src/guestfs-actions.pod:311
22306 msgid "guestfs_aug_defnode"
22310 #: ../src/guestfs-actions.pod:313
22313 " struct guestfs_int_bool *\n"
22314 " guestfs_aug_defnode (guestfs_h *g,\n"
22315 " const char *name,\n"
22316 " const char *expr,\n"
22317 " const char *val);\n"
22322 #: ../src/guestfs-actions.pod:322
22324 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
22325 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
22326 "containing that single node."
22330 #: ../src/guestfs-actions.pod:330
22332 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
22333 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
22337 #: ../src/guestfs-actions.pod:336
22338 msgid "guestfs_aug_defvar"
22342 #: ../src/guestfs-actions.pod:338
22346 " guestfs_aug_defvar (guestfs_h *g,\n"
22347 " const char *name,\n"
22348 " const char *expr);\n"
22353 #: ../src/guestfs-actions.pod:354
22354 msgid "guestfs_aug_get"
22358 #: ../src/guestfs-actions.pod:356
22362 " guestfs_aug_get (guestfs_h *g,\n"
22363 " const char *augpath);\n"
22368 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:922
22369 #: ../src/guestfs-actions.pod:940 ../src/guestfs-actions.pod:1000
22370 #: ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:1119
22371 #: ../src/guestfs-actions.pod:1249 ../src/guestfs-actions.pod:1266
22372 #: ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1419
22373 #: ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1719
22374 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:1899
22375 #: ../src/guestfs-actions.pod:1966 ../src/guestfs-actions.pod:2009
22376 #: ../src/guestfs-actions.pod:2030 ../src/guestfs-actions.pod:2204
22377 #: ../src/guestfs-actions.pod:2396 ../src/guestfs-actions.pod:2600
22378 #: ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2794
22379 #: ../src/guestfs-actions.pod:2813 ../src/guestfs-actions.pod:3027
22380 #: ../src/guestfs-actions.pod:3055 ../src/guestfs-actions.pod:3076
22381 #: ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3169
22382 #: ../src/guestfs-actions.pod:3189 ../src/guestfs-actions.pod:3209
22383 #: ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:4189
22384 #: ../src/guestfs-actions.pod:4359 ../src/guestfs-actions.pod:4469
22385 #: ../src/guestfs-actions.pod:5375 ../src/guestfs-actions.pod:5574
22386 #: ../src/guestfs-actions.pod:5744 ../src/guestfs-actions.pod:5922
22387 #: ../src/guestfs-actions.pod:5971 ../src/guestfs-actions.pod:6627
22388 #: ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6667
22389 #: ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:7365
22390 #: ../src/guestfs-actions.pod:7384 ../src/guestfs-actions.pod:7402
22391 #: ../src/guestfs-actions.pod:7576 ../src/guestfs-actions.pod:7885
22393 "This function returns a string, or NULL on error. I<The caller must free "
22394 "the returned string after use>."
22398 #: ../src/guestfs-actions.pod:368
22399 msgid "guestfs_aug_init"
22403 #: ../src/guestfs-actions.pod:370
22407 " guestfs_aug_init (guestfs_h *g,\n"
22408 " const char *root,\n"
22414 #: ../src/guestfs-actions.pod:379
22415 msgid "You must call this before using any other C<guestfs_aug_*> commands."
22419 #: ../src/guestfs-actions.pod:414
22420 msgid "Do not load the tree in C<guestfs_aug_init>."
22424 #: ../src/guestfs-actions.pod:418
22425 msgid "To close the handle, you can call C<guestfs_aug_close>."
22429 #: ../src/guestfs-actions.pod:426
22430 msgid "guestfs_aug_insert"
22434 #: ../src/guestfs-actions.pod:428
22438 " guestfs_aug_insert (guestfs_h *g,\n"
22439 " const char *augpath,\n"
22440 " const char *label,\n"
22446 #: ../src/guestfs-actions.pod:446
22447 msgid "guestfs_aug_load"
22451 #: ../src/guestfs-actions.pod:448
22455 " guestfs_aug_load (guestfs_h *g);\n"
22460 #: ../src/guestfs-actions.pod:460
22461 msgid "guestfs_aug_ls"
22465 #: ../src/guestfs-actions.pod:462
22469 " guestfs_aug_ls (guestfs_h *g,\n"
22470 " const char *augpath);\n"
22475 #: ../src/guestfs-actions.pod:466
22477 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
22478 "sorting the resulting nodes into alphabetical order."
22482 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:485
22483 #: ../src/guestfs-actions.pod:631 ../src/guestfs-actions.pod:1138
22484 #: ../src/guestfs-actions.pod:1434 ../src/guestfs-actions.pod:1453
22485 #: ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575
22486 #: ../src/guestfs-actions.pod:1821 ../src/guestfs-actions.pod:2276
22487 #: ../src/guestfs-actions.pod:2292 ../src/guestfs-actions.pod:2311
22488 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:2378
22489 #: ../src/guestfs-actions.pod:2449 ../src/guestfs-actions.pod:2498
22490 #: ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:3129
22491 #: ../src/guestfs-actions.pod:3405 ../src/guestfs-actions.pod:3719
22492 #: ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3756
22493 #: ../src/guestfs-actions.pod:3818 ../src/guestfs-actions.pod:3923
22494 #: ../src/guestfs-actions.pod:4331 ../src/guestfs-actions.pod:5098
22495 #: ../src/guestfs-actions.pod:5716 ../src/guestfs-actions.pod:5842
22496 #: ../src/guestfs-actions.pod:5956 ../src/guestfs-actions.pod:6707
22497 #: ../src/guestfs-actions.pod:6768 ../src/guestfs-actions.pod:6823
22498 #: ../src/guestfs-actions.pod:6969 ../src/guestfs-actions.pod:6993
22499 #: ../src/guestfs-actions.pod:7469 ../src/guestfs-actions.pod:7489
22500 #: ../src/guestfs-actions.pod:7536 ../src/guestfs-actions.pod:7730
22501 #: ../src/guestfs-actions.pod:7749 ../src/guestfs-actions.pod:7835
22502 #: ../src/guestfs-actions.pod:7854 ../src/guestfs-actions.pod:7900
22503 #: ../src/guestfs-actions.pod:7919
22505 "This function returns a NULL-terminated array of strings (like L<environ(3)"
22506 ">), or NULL if there was an error. I<The caller must free the strings and "
22507 "the array after use>."
22511 #: ../src/guestfs-actions.pod:473 ../src/guestfs-actions.pod:1063
22512 #: ../src/guestfs-actions.pod:1081 ../src/guestfs-actions.pod:1491
22513 #: ../src/guestfs-actions.pod:3483 ../src/guestfs-actions.pod:3514
22514 #: ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:4222
22515 #: ../src/guestfs-actions.pod:4409 ../src/guestfs-actions.pod:4442
22516 #: ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:5102
22517 #: ../src/guestfs-actions.pod:5657 ../src/guestfs-actions.pod:6054
22518 #: ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6080
22519 #: ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:7207
22520 #: ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7453
22521 #: ../src/guestfs-actions.pod:7718
22522 msgid "(Added in 0.8)"
22526 #: ../src/guestfs-actions.pod:475
22527 msgid "guestfs_aug_match"
22531 #: ../src/guestfs-actions.pod:477
22535 " guestfs_aug_match (guestfs_h *g,\n"
22536 " const char *augpath);\n"
22541 #: ../src/guestfs-actions.pod:491
22542 msgid "guestfs_aug_mv"
22546 #: ../src/guestfs-actions.pod:493
22550 " guestfs_aug_mv (guestfs_h *g,\n"
22551 " const char *src,\n"
22552 " const char *dest);\n"
22557 #: ../src/guestfs-actions.pod:505
22558 msgid "guestfs_aug_rm"
22562 #: ../src/guestfs-actions.pod:507
22566 " guestfs_aug_rm (guestfs_h *g,\n"
22567 " const char *augpath);\n"
22572 #: ../src/guestfs-actions.pod:519
22573 msgid "guestfs_aug_save"
22577 #: ../src/guestfs-actions.pod:521
22581 " guestfs_aug_save (guestfs_h *g);\n"
22586 #: ../src/guestfs-actions.pod:526
22588 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
22593 #: ../src/guestfs-actions.pod:533
22594 msgid "guestfs_aug_set"
22598 #: ../src/guestfs-actions.pod:535
22602 " guestfs_aug_set (guestfs_h *g,\n"
22603 " const char *augpath,\n"
22604 " const char *val);\n"
22609 #: ../src/guestfs-actions.pod:542
22611 "In the Augeas API, it is possible to clear a node by setting the value to "
22612 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
22613 "this call. Instead you must use the C<guestfs_aug_clear> call."
22617 #: ../src/guestfs-actions.pod:551
22618 msgid "guestfs_available"
22622 #: ../src/guestfs-actions.pod:553
22626 " guestfs_available (guestfs_h *g,\n"
22627 " char *const *groups);\n"
22632 #: ../src/guestfs-actions.pod:561
22634 "The libguestfs groups, and the functions that those groups correspond to, "
22635 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
22636 "runtime by calling C<guestfs_available_all_groups>."
22640 #: ../src/guestfs-actions.pod:585
22641 msgid "You must call C<guestfs_launch> before calling this function."
22645 #: ../src/guestfs-actions.pod:607
22647 "This call was added in version C<1.0.80>. In previous versions of "
22648 "libguestfs all you could do would be to speculatively execute a command to "
22649 "find out if the daemon implemented it. See also C<guestfs_version>."
22653 #: ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:1236
22654 msgid "(Added in 1.0.80)"
22658 #: ../src/guestfs-actions.pod:618
22659 msgid "guestfs_available_all_groups"
22663 #: ../src/guestfs-actions.pod:620
22667 " guestfs_available_all_groups (guestfs_h *g);\n"
22672 #: ../src/guestfs-actions.pod:623
22674 "This command returns a list of all optional groups that this daemon knows "
22675 "about. Note this returns both supported and unsupported groups. To find "
22676 "out which ones the daemon can actually support you have to call "
22677 "C<guestfs_available> on each member of the returned list."
22681 #: ../src/guestfs-actions.pod:629
22682 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
22686 #: ../src/guestfs-actions.pod:635
22687 msgid "(Added in 1.3.15)"
22691 #: ../src/guestfs-actions.pod:637
22692 msgid "guestfs_base64_in"
22696 #: ../src/guestfs-actions.pod:639
22700 " guestfs_base64_in (guestfs_h *g,\n"
22701 " const char *base64file,\n"
22702 " const char *filename);\n"
22707 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:663
22708 msgid "(Added in 1.3.5)"
22712 #: ../src/guestfs-actions.pod:651
22713 msgid "guestfs_base64_out"
22717 #: ../src/guestfs-actions.pod:653
22721 " guestfs_base64_out (guestfs_h *g,\n"
22722 " const char *filename,\n"
22723 " const char *base64file);\n"
22728 #: ../src/guestfs-actions.pod:665
22729 msgid "guestfs_blockdev_flushbufs"
22733 #: ../src/guestfs-actions.pod:667
22737 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
22738 " const char *device);\n"
22743 #: ../src/guestfs-actions.pod:678 ../src/guestfs-actions.pod:695
22744 #: ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:726
22745 #: ../src/guestfs-actions.pod:744 ../src/guestfs-actions.pod:763
22746 #: ../src/guestfs-actions.pod:777 ../src/guestfs-actions.pod:795
22747 #: ../src/guestfs-actions.pod:809 ../src/guestfs-actions.pod:823
22748 msgid "(Added in 0.9.3)"
22752 #: ../src/guestfs-actions.pod:680
22753 msgid "guestfs_blockdev_getbsz"
22757 #: ../src/guestfs-actions.pod:682
22761 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
22762 " const char *device);\n"
22767 #: ../src/guestfs-actions.pod:697
22768 msgid "guestfs_blockdev_getro"
22772 #: ../src/guestfs-actions.pod:699
22776 " guestfs_blockdev_getro (guestfs_h *g,\n"
22777 " const char *device);\n"
22782 #: ../src/guestfs-actions.pod:708 ../src/guestfs-actions.pod:1474
22783 #: ../src/guestfs-actions.pod:1489 ../src/guestfs-actions.pod:1978
22784 #: ../src/guestfs-actions.pod:1989 ../src/guestfs-actions.pod:2061
22785 #: ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2127
22786 #: ../src/guestfs-actions.pod:2142 ../src/guestfs-actions.pod:2167
22787 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:3226
22788 #: ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3260
22789 #: ../src/guestfs-actions.pod:3422 ../src/guestfs-actions.pod:3436
22790 #: ../src/guestfs-actions.pod:3451 ../src/guestfs-actions.pod:3465
22791 #: ../src/guestfs-actions.pod:3481 ../src/guestfs-actions.pod:3496
22792 #: ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:3526
22793 #: ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3553
22794 #: ../src/guestfs-actions.pod:3568 ../src/guestfs-actions.pod:3583
22795 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3610
22796 #: ../src/guestfs-actions.pod:5339
22797 msgid "This function returns a C truth value on success or -1 on error."
22801 #: ../src/guestfs-actions.pod:712
22802 msgid "guestfs_blockdev_getsize64"
22806 #: ../src/guestfs-actions.pod:714
22810 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
22811 " const char *device);\n"
22816 #: ../src/guestfs-actions.pod:720
22817 msgid "See also C<guestfs_blockdev_getsz>."
22821 #: ../src/guestfs-actions.pod:728
22822 msgid "guestfs_blockdev_getss"
22826 #: ../src/guestfs-actions.pod:730
22830 " guestfs_blockdev_getss (guestfs_h *g,\n"
22831 " const char *device);\n"
22836 #: ../src/guestfs-actions.pod:737
22838 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
22843 #: ../src/guestfs-actions.pod:746
22844 msgid "guestfs_blockdev_getsz"
22848 #: ../src/guestfs-actions.pod:748
22852 " guestfs_blockdev_getsz (guestfs_h *g,\n"
22853 " const char *device);\n"
22858 #: ../src/guestfs-actions.pod:755
22860 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
22861 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
22865 #: ../src/guestfs-actions.pod:765
22866 msgid "guestfs_blockdev_rereadpt"
22870 #: ../src/guestfs-actions.pod:767
22874 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
22875 " const char *device);\n"
22880 #: ../src/guestfs-actions.pod:779
22881 msgid "guestfs_blockdev_setbsz"
22885 #: ../src/guestfs-actions.pod:781
22889 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
22890 " const char *device,\n"
22891 " int blocksize);\n"
22896 #: ../src/guestfs-actions.pod:797
22897 msgid "guestfs_blockdev_setro"
22901 #: ../src/guestfs-actions.pod:799
22905 " guestfs_blockdev_setro (guestfs_h *g,\n"
22906 " const char *device);\n"
22911 #: ../src/guestfs-actions.pod:811
22912 msgid "guestfs_blockdev_setrw"
22916 #: ../src/guestfs-actions.pod:813
22920 " guestfs_blockdev_setrw (guestfs_h *g,\n"
22921 " const char *device);\n"
22926 #: ../src/guestfs-actions.pod:825
22927 msgid "guestfs_btrfs_filesystem_resize"
22931 #: ../src/guestfs-actions.pod:827
22935 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
22936 " const char *mountpoint,\n"
22942 #: ../src/guestfs-actions.pod:837
22945 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
22950 #: ../src/guestfs-actions.pod:860
22951 msgid "(Added in 1.11.17)"
22955 #: ../src/guestfs-actions.pod:862
22956 msgid "guestfs_btrfs_filesystem_resize_va"
22960 #: ../src/guestfs-actions.pod:864
22964 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
22965 " const char *mountpoint,\n"
22966 " va_list args);\n"
22971 #: ../src/guestfs-actions.pod:869
22972 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
22976 #: ../src/guestfs-actions.pod:873
22977 msgid "guestfs_btrfs_filesystem_resize_argv"
22981 #: ../src/guestfs-actions.pod:875
22985 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
22986 " const char *mountpoint,\n"
22987 " const struct guestfs_btrfs_filesystem_resize_argv *optargs);\n"
22992 #: ../src/guestfs-actions.pod:880
22993 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
22997 #: ../src/guestfs-actions.pod:884
22998 msgid "guestfs_case_sensitive_path"
23002 #: ../src/guestfs-actions.pod:886
23006 " guestfs_case_sensitive_path (guestfs_h *g,\n"
23007 " const char *path);\n"
23012 #: ../src/guestfs-actions.pod:912
23014 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
23015 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
23016 "how the directories were originally created under Windows)."
23020 #: ../src/guestfs-actions.pod:920
23021 msgid "See also C<guestfs_realpath>."
23025 #: ../src/guestfs-actions.pod:925 ../src/guestfs-actions.pod:7387
23026 msgid "(Added in 1.0.75)"
23030 #: ../src/guestfs-actions.pod:927
23031 msgid "guestfs_cat"
23035 #: ../src/guestfs-actions.pod:929
23039 " guestfs_cat (guestfs_h *g,\n"
23040 " const char *path);\n"
23045 #: ../src/guestfs-actions.pod:935
23047 "Note that this function cannot correctly handle binary files (specifically, "
23048 "files containing C<\\0> character which is treated as end of string). For "
23049 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
23050 "functions which have a more complex interface."
23054 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:3740
23055 #: ../src/guestfs-actions.pod:3822 ../src/guestfs-actions.pod:3839
23056 #: ../src/guestfs-actions.pod:3927 ../src/guestfs-actions.pod:4335
23057 #: ../src/guestfs-actions.pod:4349 ../src/guestfs-actions.pod:5720
23058 #: ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:7540
23059 #: ../src/guestfs-actions.pod:7554
23060 msgid "(Added in 0.4)"
23064 #: ../src/guestfs-actions.pod:948
23065 msgid "guestfs_checksum"
23069 #: ../src/guestfs-actions.pod:950
23073 " guestfs_checksum (guestfs_h *g,\n"
23074 " const char *csumtype,\n"
23075 " const char *path);\n"
23080 #: ../src/guestfs-actions.pod:996
23081 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
23085 #: ../src/guestfs-actions.pod:998
23086 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
23090 #: ../src/guestfs-actions.pod:1003 ../src/guestfs-actions.pod:1311
23091 #: ../src/guestfs-actions.pod:2158 ../src/guestfs-actions.pod:3438
23092 #: ../src/guestfs-actions.pod:3467 ../src/guestfs-actions.pod:3528
23093 #: ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:7243
23094 msgid "(Added in 1.0.2)"
23098 #: ../src/guestfs-actions.pod:1005
23099 msgid "guestfs_checksum_device"
23103 #: ../src/guestfs-actions.pod:1007
23107 " guestfs_checksum_device (guestfs_h *g,\n"
23108 " const char *csumtype,\n"
23109 " const char *device);\n"
23114 #: ../src/guestfs-actions.pod:1012
23116 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
23117 "device named C<device>. For the types of checksums supported see the "
23118 "C<guestfs_checksum> command."
23122 #: ../src/guestfs-actions.pod:1019 ../src/guestfs-actions.pod:5169
23123 #: ../src/guestfs-actions.pod:5304 ../src/guestfs-actions.pod:5341
23124 #: ../src/guestfs-actions.pod:5359 ../src/guestfs-actions.pod:5541
23125 #: ../src/guestfs-actions.pod:7152 ../src/guestfs-actions.pod:7166
23126 #: ../src/guestfs-actions.pod:7566
23127 msgid "(Added in 1.3.2)"
23131 #: ../src/guestfs-actions.pod:1021
23132 msgid "guestfs_checksums_out"
23136 #: ../src/guestfs-actions.pod:1023
23140 " guestfs_checksums_out (guestfs_h *g,\n"
23141 " const char *csumtype,\n"
23142 " const char *directory,\n"
23143 " const char *sumsfile);\n"
23148 #: ../src/guestfs-actions.pod:1043
23149 msgid "(Added in 1.3.7)"
23153 #: ../src/guestfs-actions.pod:1045
23154 msgid "guestfs_chmod"
23158 #: ../src/guestfs-actions.pod:1047
23162 " guestfs_chmod (guestfs_h *g,\n"
23164 " const char *path);\n"
23169 #: ../src/guestfs-actions.pod:1065
23170 msgid "guestfs_chown"
23174 #: ../src/guestfs-actions.pod:1067
23178 " guestfs_chown (guestfs_h *g,\n"
23181 " const char *path);\n"
23186 #: ../src/guestfs-actions.pod:1083
23187 msgid "guestfs_command"
23191 #: ../src/guestfs-actions.pod:1085
23195 " guestfs_command (guestfs_h *g,\n"
23196 " char *const *arguments);\n"
23201 #: ../src/guestfs-actions.pod:1094
23203 "The single parameter is an argv-style list of arguments. The first element "
23204 "is the name of the program to run. Subsequent elements are parameters. The "
23205 "list must be non-empty (ie. must contain a program name). Note that the "
23206 "command runs directly, and is I<not> invoked via the shell (see "
23211 #: ../src/guestfs-actions.pod:1125 ../src/guestfs-actions.pod:1145
23212 #: ../src/guestfs-actions.pod:1610
23213 msgid "(Added in 0.9.1)"
23217 #: ../src/guestfs-actions.pod:1127
23218 msgid "guestfs_command_lines"
23222 #: ../src/guestfs-actions.pod:1129
23226 " guestfs_command_lines (guestfs_h *g,\n"
23227 " char *const *arguments);\n"
23232 #: ../src/guestfs-actions.pod:1133
23234 "This is the same as C<guestfs_command>, but splits the result into a list of "
23239 #: ../src/guestfs-actions.pod:1136
23240 msgid "See also: C<guestfs_sh_lines>"
23244 #: ../src/guestfs-actions.pod:1147
23245 msgid "guestfs_config"
23249 #: ../src/guestfs-actions.pod:1149
23253 " guestfs_config (guestfs_h *g,\n"
23254 " const char *qemuparam,\n"
23255 " const char *qemuvalue);\n"
23260 #: ../src/guestfs-actions.pod:1167
23261 msgid "guestfs_copy_size"
23265 #: ../src/guestfs-actions.pod:1169
23269 " guestfs_copy_size (guestfs_h *g,\n"
23270 " const char *src,\n"
23271 " const char *dest,\n"
23272 " int64_t size);\n"
23277 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1306
23278 #: ../src/guestfs-actions.pod:1337 ../src/guestfs-actions.pod:1382
23279 #: ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:1781
23280 #: ../src/guestfs-actions.pod:3638 ../src/guestfs-actions.pod:7238
23281 #: ../src/guestfs-actions.pod:7272 ../src/guestfs-actions.pod:7775
23282 #: ../src/guestfs-actions.pod:7794
23284 "This long-running command can generate progress notification messages so "
23285 "that the caller can display a progress bar or indicator. To receive these "
23286 "messages, the caller must register a progress event callback. See L<guestfs"
23287 "(3)/GUESTFS_EVENT_PROGRESS>."
23291 #: ../src/guestfs-actions.pod:1188 ../src/guestfs-actions.pod:4362
23292 #: ../src/guestfs-actions.pod:5747 ../src/guestfs-actions.pod:7473
23293 #: ../src/guestfs-actions.pod:7493 ../src/guestfs-actions.pod:7579
23294 msgid "(Added in 1.0.87)"
23298 #: ../src/guestfs-actions.pod:1190
23303 #: ../src/guestfs-actions.pod:1192
23307 " guestfs_cp (guestfs_h *g,\n"
23308 " const char *src,\n"
23309 " const char *dest);\n"
23314 #: ../src/guestfs-actions.pod:1202 ../src/guestfs-actions.pod:1216
23315 #: ../src/guestfs-actions.pod:1288 ../src/guestfs-actions.pod:1362
23316 #: ../src/guestfs-actions.pod:1476 ../src/guestfs-actions.pod:5116
23317 #: ../src/guestfs-actions.pod:5591
23318 msgid "(Added in 1.0.18)"
23322 #: ../src/guestfs-actions.pod:1204
23323 msgid "guestfs_cp_a"
23327 #: ../src/guestfs-actions.pod:1206
23331 " guestfs_cp_a (guestfs_h *g,\n"
23332 " const char *src,\n"
23333 " const char *dest);\n"
23338 #: ../src/guestfs-actions.pod:1218
23343 #: ../src/guestfs-actions.pod:1220
23347 " guestfs_dd (guestfs_h *g,\n"
23348 " const char *src,\n"
23349 " const char *dest);\n"
23354 #: ../src/guestfs-actions.pod:1230
23356 "If the destination is a device, it must be as large or larger than the "
23357 "source file or device, otherwise the copy will fail. This command cannot do "
23358 "partial copies (see C<guestfs_copy_size>)."
23362 #: ../src/guestfs-actions.pod:1238
23367 #: ../src/guestfs-actions.pod:1240
23371 " guestfs_df (guestfs_h *g);\n"
23376 #: ../src/guestfs-actions.pod:1245 ../src/guestfs-actions.pod:1262
23378 "This command is mostly useful for interactive sessions. It is I<not> "
23379 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
23384 #: ../src/guestfs-actions.pod:1252 ../src/guestfs-actions.pod:1269
23385 #: ../src/guestfs-actions.pod:1387 ../src/guestfs-actions.pod:2361
23386 #: ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:2453
23387 #: ../src/guestfs-actions.pod:4472 ../src/guestfs-actions.pod:5016
23388 #: ../src/guestfs-actions.pod:6976 ../src/guestfs-actions.pod:7000
23389 #: ../src/guestfs-actions.pod:7619 ../src/guestfs-actions.pod:7632
23390 #: ../src/guestfs-actions.pod:7645
23391 msgid "(Added in 1.0.54)"
23395 #: ../src/guestfs-actions.pod:1254
23396 msgid "guestfs_df_h"
23400 #: ../src/guestfs-actions.pod:1256
23404 " guestfs_df_h (guestfs_h *g);\n"
23409 #: ../src/guestfs-actions.pod:1271
23410 msgid "guestfs_dmesg"
23414 #: ../src/guestfs-actions.pod:1273
23418 " guestfs_dmesg (guestfs_h *g);\n"
23423 #: ../src/guestfs-actions.pod:1280
23425 "Another way to get the same information is to enable verbose messages with "
23426 "C<guestfs_set_verbose> or by setting the environment variable "
23427 "C<LIBGUESTFS_DEBUG=1> before running the program."
23431 #: ../src/guestfs-actions.pod:1290
23432 msgid "guestfs_download"
23436 #: ../src/guestfs-actions.pod:1292
23440 " guestfs_download (guestfs_h *g,\n"
23441 " const char *remotefilename,\n"
23442 " const char *filename);\n"
23447 #: ../src/guestfs-actions.pod:1302
23448 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
23452 #: ../src/guestfs-actions.pod:1313
23453 msgid "guestfs_download_offset"
23457 #: ../src/guestfs-actions.pod:1315
23461 " guestfs_download_offset (guestfs_h *g,\n"
23462 " const char *remotefilename,\n"
23463 " const char *filename,\n"
23464 " int64_t offset,\n"
23465 " int64_t size);\n"
23470 #: ../src/guestfs-actions.pod:1328
23472 "Note that there is no limit on the amount of data that can be downloaded "
23473 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
23474 "full amount unless an error occurs."
23478 #: ../src/guestfs-actions.pod:1333
23479 msgid "See also C<guestfs_download>, C<guestfs_pread>."
23483 #: ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:7277
23484 msgid "(Added in 1.5.17)"
23488 #: ../src/guestfs-actions.pod:1344
23489 msgid "guestfs_drop_caches"
23493 #: ../src/guestfs-actions.pod:1346
23497 " guestfs_drop_caches (guestfs_h *g,\n"
23498 " int whattodrop);\n"
23503 #: ../src/guestfs-actions.pod:1364
23508 #: ../src/guestfs-actions.pod:1366
23512 " guestfs_du (guestfs_h *g,\n"
23513 " const char *path);\n"
23518 #: ../src/guestfs-actions.pod:1389
23519 msgid "guestfs_e2fsck_f"
23523 #: ../src/guestfs-actions.pod:1391
23527 " guestfs_e2fsck_f (guestfs_h *g,\n"
23528 " const char *device);\n"
23533 #: ../src/guestfs-actions.pod:1399
23535 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
23536 "Normally you should use C<guestfs_fsck>."
23540 #: ../src/guestfs-actions.pod:1404
23541 msgid "(Added in 1.0.29)"
23545 #: ../src/guestfs-actions.pod:1406
23546 msgid "guestfs_echo_daemon"
23550 #: ../src/guestfs-actions.pod:1408
23554 " guestfs_echo_daemon (guestfs_h *g,\n"
23555 " char *const *words);\n"
23560 #: ../src/guestfs-actions.pod:1417
23561 msgid "See also C<guestfs_ping_daemon>."
23565 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:2169
23566 #: ../src/guestfs-actions.pod:6448
23567 msgid "(Added in 1.0.69)"
23571 #: ../src/guestfs-actions.pod:1424
23572 msgid "guestfs_egrep"
23576 #: ../src/guestfs-actions.pod:1426
23580 " guestfs_egrep (guestfs_h *g,\n"
23581 " const char *regex,\n"
23582 " const char *path);\n"
23587 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1460
23588 #: ../src/guestfs-actions.pod:1517 ../src/guestfs-actions.pod:1563
23589 #: ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:2299
23590 #: ../src/guestfs-actions.pod:2318 ../src/guestfs-actions.pod:2474
23591 #: ../src/guestfs-actions.pod:2487 ../src/guestfs-actions.pod:2502
23592 #: ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2570
23593 #: ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:3852
23594 #: ../src/guestfs-actions.pod:3866 ../src/guestfs-actions.pod:3879
23595 #: ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:4894
23596 #: ../src/guestfs-actions.pod:5925 ../src/guestfs-actions.pod:5974
23597 #: ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6856
23598 #: ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:6882
23599 #: ../src/guestfs-actions.pod:6904 ../src/guestfs-actions.pod:6917
23600 #: ../src/guestfs-actions.pod:6930 ../src/guestfs-actions.pod:6943
23601 #: ../src/guestfs-actions.pod:7737 ../src/guestfs-actions.pod:7756
23602 #: ../src/guestfs-actions.pod:7842 ../src/guestfs-actions.pod:7861
23603 #: ../src/guestfs-actions.pod:7907 ../src/guestfs-actions.pod:7926
23604 msgid "(Added in 1.0.66)"
23608 #: ../src/guestfs-actions.pod:1443
23609 msgid "guestfs_egrepi"
23613 #: ../src/guestfs-actions.pod:1445
23617 " guestfs_egrepi (guestfs_h *g,\n"
23618 " const char *regex,\n"
23619 " const char *path);\n"
23624 #: ../src/guestfs-actions.pod:1462
23625 msgid "guestfs_equal"
23629 #: ../src/guestfs-actions.pod:1464
23633 " guestfs_equal (guestfs_h *g,\n"
23634 " const char *file1,\n"
23635 " const char *file2);\n"
23640 #: ../src/guestfs-actions.pod:1478
23641 msgid "guestfs_exists"
23645 #: ../src/guestfs-actions.pod:1480
23649 " guestfs_exists (guestfs_h *g,\n"
23650 " const char *path);\n"
23655 #: ../src/guestfs-actions.pod:1487
23656 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
23660 #: ../src/guestfs-actions.pod:1493
23661 msgid "guestfs_fallocate"
23665 #: ../src/guestfs-actions.pod:1495
23669 " guestfs_fallocate (guestfs_h *g,\n"
23670 " const char *path,\n"
23676 #: ../src/guestfs-actions.pod:1500
23678 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
23683 #: ../src/guestfs-actions.pod:1519
23684 msgid "guestfs_fallocate64"
23688 #: ../src/guestfs-actions.pod:1521
23692 " guestfs_fallocate64 (guestfs_h *g,\n"
23693 " const char *path,\n"
23699 #: ../src/guestfs-actions.pod:1530
23701 "Note that this call allocates disk blocks for the file. To create a sparse "
23702 "file use C<guestfs_truncate_size> instead."
23706 #: ../src/guestfs-actions.pod:1533
23708 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
23709 "oversight it only allowed 30 bit lengths to be specified, effectively "
23710 "limiting the maximum size of files created through that call to 1GB."
23714 #: ../src/guestfs-actions.pod:1544
23715 msgid "(Added in 1.3.17)"
23719 #: ../src/guestfs-actions.pod:1546
23720 msgid "guestfs_fgrep"
23724 #: ../src/guestfs-actions.pod:1548
23728 " guestfs_fgrep (guestfs_h *g,\n"
23729 " const char *pattern,\n"
23730 " const char *path);\n"
23735 #: ../src/guestfs-actions.pod:1565
23736 msgid "guestfs_fgrepi"
23740 #: ../src/guestfs-actions.pod:1567
23744 " guestfs_fgrepi (guestfs_h *g,\n"
23745 " const char *pattern,\n"
23746 " const char *path);\n"
23751 #: ../src/guestfs-actions.pod:1584
23752 msgid "guestfs_file"
23756 #: ../src/guestfs-actions.pod:1586
23760 " guestfs_file (guestfs_h *g,\n"
23761 " const char *path);\n"
23766 #: ../src/guestfs-actions.pod:1604
23768 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
23769 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
23773 #: ../src/guestfs-actions.pod:1612
23774 msgid "guestfs_file_architecture"
23778 #: ../src/guestfs-actions.pod:1614
23782 " guestfs_file_architecture (guestfs_h *g,\n"
23783 " const char *filename);\n"
23788 #: ../src/guestfs-actions.pod:1722 ../src/guestfs-actions.pod:1885
23789 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:2603
23790 #: ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2759
23791 #: ../src/guestfs-actions.pod:2946 ../src/guestfs-actions.pod:2964
23792 #: ../src/guestfs-actions.pod:3004 ../src/guestfs-actions.pod:3079
23793 #: ../src/guestfs-actions.pod:3172 ../src/guestfs-actions.pod:3409
23794 #: ../src/guestfs-actions.pod:3541
23795 msgid "(Added in 1.5.3)"
23799 #: ../src/guestfs-actions.pod:1724
23800 msgid "guestfs_filesize"
23804 #: ../src/guestfs-actions.pod:1726
23808 " guestfs_filesize (guestfs_h *g,\n"
23809 " const char *file);\n"
23814 #: ../src/guestfs-actions.pod:1732
23816 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
23817 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
23818 "devices, use C<guestfs_blockdev_getsize64>."
23822 #: ../src/guestfs-actions.pod:1738
23823 msgid "(Added in 1.0.82)"
23827 #: ../src/guestfs-actions.pod:1740
23828 msgid "guestfs_fill"
23832 #: ../src/guestfs-actions.pod:1742
23836 " guestfs_fill (guestfs_h *g,\n"
23839 " const char *path);\n"
23844 #: ../src/guestfs-actions.pod:1752
23846 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
23847 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
23848 "bytes use C<guestfs_fill_pattern>."
23852 #: ../src/guestfs-actions.pod:1764
23853 msgid "(Added in 1.0.79)"
23857 #: ../src/guestfs-actions.pod:1766
23858 msgid "guestfs_fill_pattern"
23862 #: ../src/guestfs-actions.pod:1768
23866 " guestfs_fill_pattern (guestfs_h *g,\n"
23867 " const char *pattern,\n"
23869 " const char *path);\n"
23874 #: ../src/guestfs-actions.pod:1774
23876 "This function is like C<guestfs_fill> except that it creates a new file of "
23877 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
23878 "pattern is truncated if necessary to ensure the length of the file is "
23879 "exactly C<len> bytes."
23883 #: ../src/guestfs-actions.pod:1786
23884 msgid "(Added in 1.3.12)"
23888 #: ../src/guestfs-actions.pod:1788
23889 msgid "guestfs_find"
23893 #: ../src/guestfs-actions.pod:1790
23897 " guestfs_find (guestfs_h *g,\n"
23898 " const char *directory);\n"
23903 #: ../src/guestfs-actions.pod:1806
23905 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
23909 #: ../src/guestfs-actions.pod:1819
23910 msgid "See also C<guestfs_find0>."
23914 #: ../src/guestfs-actions.pod:1828 ../src/guestfs-actions.pod:4299
23915 #: ../src/guestfs-actions.pod:6009
23916 msgid "(Added in 1.0.27)"
23920 #: ../src/guestfs-actions.pod:1830
23921 msgid "guestfs_find0"
23925 #: ../src/guestfs-actions.pod:1832
23929 " guestfs_find0 (guestfs_h *g,\n"
23930 " const char *directory,\n"
23931 " const char *files);\n"
23936 #: ../src/guestfs-actions.pod:1841
23938 "This command works the same way as C<guestfs_find> with the following "
23943 #: ../src/guestfs-actions.pod:1868
23944 msgid "(Added in 1.0.74)"
23948 #: ../src/guestfs-actions.pod:1870
23949 msgid "guestfs_findfs_label"
23953 #: ../src/guestfs-actions.pod:1872
23957 " guestfs_findfs_label (guestfs_h *g,\n"
23958 " const char *label);\n"
23963 #: ../src/guestfs-actions.pod:1880
23964 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
23968 #: ../src/guestfs-actions.pod:1887
23969 msgid "guestfs_findfs_uuid"
23973 #: ../src/guestfs-actions.pod:1889
23977 " guestfs_findfs_uuid (guestfs_h *g,\n"
23978 " const char *uuid);\n"
23983 #: ../src/guestfs-actions.pod:1897
23984 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
23988 #: ../src/guestfs-actions.pod:1904
23989 msgid "guestfs_fsck"
23993 #: ../src/guestfs-actions.pod:1906
23997 " guestfs_fsck (guestfs_h *g,\n"
23998 " const char *fstype,\n"
23999 " const char *device);\n"
24004 #: ../src/guestfs-actions.pod:1941 ../src/guestfs-actions.pod:7780
24005 msgid "(Added in 1.0.16)"
24009 #: ../src/guestfs-actions.pod:1943
24010 msgid "guestfs_get_append"
24014 #: ../src/guestfs-actions.pod:1945
24018 " guestfs_get_append (guestfs_h *g);\n"
24023 #: ../src/guestfs-actions.pod:1953
24025 "This function returns a string which may be NULL. There is no way to return "
24026 "an error from this function. The string is owned by the guest handle and "
24027 "must I<not> be freed."
24031 #: ../src/guestfs-actions.pod:1957 ../src/guestfs-actions.pod:5687
24032 #: ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6611
24033 #: ../src/guestfs-actions.pod:6630 ../src/guestfs-actions.pod:6646
24034 #: ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:7424
24035 #: ../src/guestfs-actions.pod:7439 ../src/guestfs-actions.pod:7823
24036 msgid "(Added in 1.0.26)"
24040 #: ../src/guestfs-actions.pod:1959
24041 msgid "guestfs_get_attach_method"
24045 #: ../src/guestfs-actions.pod:1961
24049 " guestfs_get_attach_method (guestfs_h *g);\n"
24054 #: ../src/guestfs-actions.pod:1964
24055 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
24059 #: ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:6199
24060 msgid "(Added in 1.9.8)"
24064 #: ../src/guestfs-actions.pod:1971
24065 msgid "guestfs_get_autosync"
24069 #: ../src/guestfs-actions.pod:1973
24073 " guestfs_get_autosync (guestfs_h *g);\n"
24078 #: ../src/guestfs-actions.pod:1982
24079 msgid "guestfs_get_direct"
24083 #: ../src/guestfs-actions.pod:1984
24087 " guestfs_get_direct (guestfs_h *g);\n"
24092 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:6240
24093 msgid "(Added in 1.0.72)"
24097 #: ../src/guestfs-actions.pod:1993
24098 msgid "guestfs_get_e2label"
24102 #: ../src/guestfs-actions.pod:1995
24106 " guestfs_get_e2label (guestfs_h *g,\n"
24107 " const char *device);\n"
24112 #: ../src/guestfs-actions.pod:1999
24114 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
24119 #: ../src/guestfs-actions.pod:2012 ../src/guestfs-actions.pod:2033
24120 #: ../src/guestfs-actions.pod:6258 ../src/guestfs-actions.pod:6277
24121 msgid "(Added in 1.0.15)"
24125 #: ../src/guestfs-actions.pod:2014
24126 msgid "guestfs_get_e2uuid"
24130 #: ../src/guestfs-actions.pod:2016
24134 " guestfs_get_e2uuid (guestfs_h *g,\n"
24135 " const char *device);\n"
24140 #: ../src/guestfs-actions.pod:2020
24142 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
24147 #: ../src/guestfs-actions.pod:2035
24148 msgid "guestfs_get_memsize"
24152 #: ../src/guestfs-actions.pod:2037
24156 " guestfs_get_memsize (guestfs_h *g);\n"
24161 #: ../src/guestfs-actions.pod:2043
24163 "If C<guestfs_set_memsize> was not called on this handle, and if "
24164 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
24165 "value for memsize."
24169 #: ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:4590
24170 #: ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4818
24171 #: ../src/guestfs-actions.pod:4837 ../src/guestfs-actions.pod:4849
24172 #: ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:4879
24173 #: ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:6298
24174 #: ../src/guestfs-actions.pod:6578 ../src/guestfs-actions.pod:7193
24175 msgid "(Added in 1.0.55)"
24179 #: ../src/guestfs-actions.pod:2054
24180 msgid "guestfs_get_network"
24184 #: ../src/guestfs-actions.pod:2056
24188 " guestfs_get_network (guestfs_h *g);\n"
24193 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:6317
24194 msgid "(Added in 1.5.4)"
24198 #: ../src/guestfs-actions.pod:2065
24199 msgid "guestfs_get_path"
24203 #: ../src/guestfs-actions.pod:2067
24207 " guestfs_get_path (guestfs_h *g);\n"
24212 #: ../src/guestfs-actions.pod:2075 ../src/guestfs-actions.pod:2115
24214 "This function returns a string, or NULL on error. The string is owned by "
24215 "the guest handle and must I<not> be freed."
24219 #: ../src/guestfs-actions.pod:2080
24220 msgid "guestfs_get_pgroup"
24224 #: ../src/guestfs-actions.pod:2082
24228 " guestfs_get_pgroup (guestfs_h *g);\n"
24233 #: ../src/guestfs-actions.pod:2089 ../src/guestfs-actions.pod:6353
24234 #: ../src/guestfs-actions.pod:7685
24235 msgid "(Added in 1.11.18)"
24239 #: ../src/guestfs-actions.pod:2091
24240 msgid "guestfs_get_pid"
24244 #: ../src/guestfs-actions.pod:2093
24248 " guestfs_get_pid (guestfs_h *g);\n"
24253 #: ../src/guestfs-actions.pod:2103
24254 msgid "(Added in 1.0.56)"
24258 #: ../src/guestfs-actions.pod:2105
24259 msgid "guestfs_get_qemu"
24263 #: ../src/guestfs-actions.pod:2107
24267 " guestfs_get_qemu (guestfs_h *g);\n"
24272 #: ../src/guestfs-actions.pod:2118 ../src/guestfs-actions.pod:6381
24273 msgid "(Added in 1.0.6)"
24277 #: ../src/guestfs-actions.pod:2120
24278 msgid "guestfs_get_recovery_proc"
24282 #: ../src/guestfs-actions.pod:2122
24286 " guestfs_get_recovery_proc (guestfs_h *g);\n"
24291 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3663
24292 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4397
24293 #: ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:5617
24294 #: ../src/guestfs-actions.pod:5960 ../src/guestfs-actions.pod:6405
24295 #: ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7116
24296 #: ../src/guestfs-actions.pod:7308
24297 msgid "(Added in 1.0.77)"
24301 #: ../src/guestfs-actions.pod:2131
24302 msgid "guestfs_get_selinux"
24306 #: ../src/guestfs-actions.pod:2133
24310 " guestfs_get_selinux (guestfs_h *g);\n"
24315 #: ../src/guestfs-actions.pod:2136
24317 "This returns the current setting of the selinux flag which is passed to the "
24318 "appliance at boot time. See C<guestfs_set_selinux>."
24322 #: ../src/guestfs-actions.pod:2144 ../src/guestfs-actions.pod:2207
24323 #: ../src/guestfs-actions.pod:6424 ../src/guestfs-actions.pod:6482
24324 msgid "(Added in 1.0.67)"
24328 #: ../src/guestfs-actions.pod:2146
24329 msgid "guestfs_get_state"
24333 #: ../src/guestfs-actions.pod:2148
24337 " guestfs_get_state (guestfs_h *g);\n"
24342 #: ../src/guestfs-actions.pod:2160
24343 msgid "guestfs_get_trace"
24347 #: ../src/guestfs-actions.pod:2162
24351 " guestfs_get_trace (guestfs_h *g);\n"
24356 #: ../src/guestfs-actions.pod:2171
24357 msgid "guestfs_get_umask"
24361 #: ../src/guestfs-actions.pod:2173
24365 " guestfs_get_umask (guestfs_h *g);\n"
24370 #: ../src/guestfs-actions.pod:2176
24372 "Return the current umask. By default the umask is C<022> unless it has been "
24373 "set by calling C<guestfs_umask>."
24377 #: ../src/guestfs-actions.pod:2183
24378 msgid "guestfs_get_verbose"
24382 #: ../src/guestfs-actions.pod:2185
24386 " guestfs_get_verbose (guestfs_h *g);\n"
24391 #: ../src/guestfs-actions.pod:2194
24392 msgid "guestfs_getcon"
24396 #: ../src/guestfs-actions.pod:2196
24400 " guestfs_getcon (guestfs_h *g);\n"
24405 #: ../src/guestfs-actions.pod:2201
24407 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
24411 #: ../src/guestfs-actions.pod:2209
24412 msgid "guestfs_getxattr"
24416 #: ../src/guestfs-actions.pod:2211
24420 " guestfs_getxattr (guestfs_h *g,\n"
24421 " const char *path,\n"
24422 " const char *name,\n"
24423 " size_t *size_r);\n"
24428 #: ../src/guestfs-actions.pod:2217
24430 "Get a single extended attribute from file C<path> named C<name>. This call "
24431 "follows symlinks. If you want to lookup an extended attribute for the "
24432 "symlink itself, use C<guestfs_lgetxattr>."
24436 #: ../src/guestfs-actions.pod:2221 ../src/guestfs-actions.pod:3677
24438 "Normally it is better to get all extended attributes from a file in one go "
24439 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
24440 "implementations are buggy and do not provide a way to list out attributes. "
24441 "For these filesystems (notably ntfs-3g) you have to know the names of the "
24442 "extended attributes you want in advance and call this function."
24446 #: ../src/guestfs-actions.pod:2231
24447 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
24451 #: ../src/guestfs-actions.pod:2233 ../src/guestfs-actions.pod:2424
24452 #: ../src/guestfs-actions.pod:2894 ../src/guestfs-actions.pod:3689
24453 #: ../src/guestfs-actions.pod:5610 ../src/guestfs-actions.pod:5636
24454 #: ../src/guestfs-actions.pod:5817
24456 "This function returns a buffer, or NULL on error. The size of the returned "
24457 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
24462 #: ../src/guestfs-actions.pod:2237 ../src/guestfs-actions.pod:3693
24463 msgid "(Added in 1.7.24)"
24467 #: ../src/guestfs-actions.pod:2239
24468 msgid "guestfs_getxattrs"
24472 #: ../src/guestfs-actions.pod:2241
24475 " struct guestfs_xattr_list *\n"
24476 " guestfs_getxattrs (guestfs_h *g,\n"
24477 " const char *path);\n"
24482 #: ../src/guestfs-actions.pod:2251
24483 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
24487 #: ../src/guestfs-actions.pod:2253 ../src/guestfs-actions.pod:3705
24488 #: ../src/guestfs-actions.pod:4393
24490 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
24491 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
24495 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:3709
24496 #: ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3944
24497 #: ../src/guestfs-actions.pod:5990 ../src/guestfs-actions.pod:6501
24498 #: ../src/guestfs-actions.pod:7888
24499 msgid "(Added in 1.0.59)"
24503 #: ../src/guestfs-actions.pod:2259
24504 msgid "guestfs_glob_expand"
24508 #: ../src/guestfs-actions.pod:2261
24512 " guestfs_glob_expand (guestfs_h *g,\n"
24513 " const char *pattern);\n"
24518 #: ../src/guestfs-actions.pod:2280 ../src/guestfs-actions.pod:6694
24519 #: ../src/guestfs-actions.pod:6711
24520 msgid "(Added in 1.0.50)"
24524 #: ../src/guestfs-actions.pod:2282
24525 msgid "guestfs_grep"
24529 #: ../src/guestfs-actions.pod:2284
24533 " guestfs_grep (guestfs_h *g,\n"
24534 " const char *regex,\n"
24535 " const char *path);\n"
24540 #: ../src/guestfs-actions.pod:2301
24541 msgid "guestfs_grepi"
24545 #: ../src/guestfs-actions.pod:2303
24549 " guestfs_grepi (guestfs_h *g,\n"
24550 " const char *regex,\n"
24551 " const char *path);\n"
24556 #: ../src/guestfs-actions.pod:2320
24557 msgid "guestfs_grub_install"
24561 #: ../src/guestfs-actions.pod:2322
24565 " guestfs_grub_install (guestfs_h *g,\n"
24566 " const char *root,\n"
24567 " const char *device);\n"
24572 #: ../src/guestfs-actions.pod:2343
24573 msgid "(Added in 1.0.17)"
24577 #: ../src/guestfs-actions.pod:2345
24578 msgid "guestfs_head"
24582 #: ../src/guestfs-actions.pod:2347
24586 " guestfs_head (guestfs_h *g,\n"
24587 " const char *path);\n"
24592 #: ../src/guestfs-actions.pod:2363
24593 msgid "guestfs_head_n"
24597 #: ../src/guestfs-actions.pod:2365
24601 " guestfs_head_n (guestfs_h *g,\n"
24603 " const char *path);\n"
24608 #: ../src/guestfs-actions.pod:2387
24609 msgid "guestfs_hexdump"
24613 #: ../src/guestfs-actions.pod:2389
24617 " guestfs_hexdump (guestfs_h *g,\n"
24618 " const char *path);\n"
24623 #: ../src/guestfs-actions.pod:2402 ../src/guestfs-actions.pod:6775
24624 #: ../src/guestfs-actions.pod:6830
24625 msgid "(Added in 1.0.22)"
24629 #: ../src/guestfs-actions.pod:2404
24630 msgid "guestfs_initrd_cat"
24634 #: ../src/guestfs-actions.pod:2406
24638 " guestfs_initrd_cat (guestfs_h *g,\n"
24639 " const char *initrdpath,\n"
24640 " const char *filename,\n"
24641 " size_t *size_r);\n"
24646 #: ../src/guestfs-actions.pod:2422
24647 msgid "See also C<guestfs_initrd_list>."
24651 #: ../src/guestfs-actions.pod:2433
24652 msgid "guestfs_initrd_list"
24656 #: ../src/guestfs-actions.pod:2435
24660 " guestfs_initrd_list (guestfs_h *g,\n"
24661 " const char *path);\n"
24666 #: ../src/guestfs-actions.pod:2455
24667 msgid "guestfs_inotify_add_watch"
24671 #: ../src/guestfs-actions.pod:2457
24675 " guestfs_inotify_add_watch (guestfs_h *g,\n"
24676 " const char *path,\n"
24682 #: ../src/guestfs-actions.pod:2476
24683 msgid "guestfs_inotify_close"
24687 #: ../src/guestfs-actions.pod:2478
24691 " guestfs_inotify_close (guestfs_h *g);\n"
24696 #: ../src/guestfs-actions.pod:2489
24697 msgid "guestfs_inotify_files"
24701 #: ../src/guestfs-actions.pod:2491
24705 " guestfs_inotify_files (guestfs_h *g);\n"
24710 #: ../src/guestfs-actions.pod:2494
24712 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
24713 "returns a list of pathnames of objects that were touched. The returned "
24714 "pathnames are sorted and deduplicated."
24718 #: ../src/guestfs-actions.pod:2504
24719 msgid "guestfs_inotify_init"
24723 #: ../src/guestfs-actions.pod:2506
24727 " guestfs_inotify_init (guestfs_h *g,\n"
24728 " int maxevents);\n"
24733 #: ../src/guestfs-actions.pod:2514
24735 "C<maxevents> is the maximum number of events which will be queued up between "
24736 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
24737 "passed as C<0>, then the kernel (or previously set) default is used. For "
24738 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
24739 "throws away events, but records the fact that it threw them away by setting "
24740 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
24741 "C<guestfs_inotify_read>)."
24745 #: ../src/guestfs-actions.pod:2524
24747 "Before any events are generated, you have to add some watches to the "
24748 "internal watch list. See: C<guestfs_inotify_add_watch>, "
24749 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
24753 #: ../src/guestfs-actions.pod:2530
24755 "Queued up events should be read periodically by calling "
24756 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
24757 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
24758 "often enough then you risk the internal queue overflowing."
24762 #: ../src/guestfs-actions.pod:2537
24764 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
24765 "This also removes any watches automatically."
24769 #: ../src/guestfs-actions.pod:2550
24770 msgid "guestfs_inotify_read"
24774 #: ../src/guestfs-actions.pod:2552
24777 " struct guestfs_inotify_event_list *\n"
24778 " guestfs_inotify_read (guestfs_h *g);\n"
24783 #: ../src/guestfs-actions.pod:2566
24785 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
24786 "there was an error. I<The caller must call "
24787 "C<guestfs_free_inotify_event_list> after use>."
24791 #: ../src/guestfs-actions.pod:2572
24792 msgid "guestfs_inotify_rm_watch"
24796 #: ../src/guestfs-actions.pod:2574
24800 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
24806 #: ../src/guestfs-actions.pod:2578
24808 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
24812 #: ../src/guestfs-actions.pod:2585
24813 msgid "guestfs_inspect_get_arch"
24817 #: ../src/guestfs-actions.pod:2587
24821 " guestfs_inspect_get_arch (guestfs_h *g,\n"
24822 " const char *root);\n"
24827 #: ../src/guestfs-actions.pod:2591
24829 "This returns the architecture of the inspected operating system. The "
24830 "possible return values are listed under C<guestfs_file_architecture>."
24834 #: ../src/guestfs-actions.pod:2605
24835 msgid "guestfs_inspect_get_distro"
24839 #: ../src/guestfs-actions.pod:2607
24843 " guestfs_inspect_get_distro (guestfs_h *g,\n"
24844 " const char *root);\n"
24849 #: ../src/guestfs-actions.pod:2695
24850 msgid "guestfs_inspect_get_drive_mappings"
24854 #: ../src/guestfs-actions.pod:2697
24858 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
24859 " const char *root);\n"
24864 #: ../src/guestfs-actions.pod:2726
24866 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24867 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
24871 #: ../src/guestfs-actions.pod:2730 ../src/guestfs-actions.pod:2998
24872 #: ../src/guestfs-actions.pod:3796 ../src/guestfs-actions.pod:5078
24873 #: ../src/guestfs-actions.pod:7132
24875 "This function returns a NULL-terminated array of strings, or NULL if there "
24876 "was an error. The array of strings will always have length C<2n+1>, where "
24877 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
24878 "caller must free the strings and the array after use>."
24882 #: ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:3192
24883 msgid "(Added in 1.9.17)"
24887 #: ../src/guestfs-actions.pod:2738
24888 msgid "guestfs_inspect_get_filesystems"
24892 #: ../src/guestfs-actions.pod:2740
24896 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
24897 " const char *root);\n"
24902 #: ../src/guestfs-actions.pod:2752
24904 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
24905 "C<guestfs_inspect_get_mountpoints>."
24909 #: ../src/guestfs-actions.pod:2761
24910 msgid "guestfs_inspect_get_format"
24914 #: ../src/guestfs-actions.pod:2763
24918 " guestfs_inspect_get_format (guestfs_h *g,\n"
24919 " const char *root);\n"
24924 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:3228
24925 #: ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3262
24926 #: ../src/guestfs-actions.pod:6028
24927 msgid "(Added in 1.9.4)"
24931 #: ../src/guestfs-actions.pod:2799
24932 msgid "guestfs_inspect_get_hostname"
24936 #: ../src/guestfs-actions.pod:2801
24940 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
24941 " const char *root);\n"
24946 #: ../src/guestfs-actions.pod:2816
24947 msgid "(Added in 1.7.9)"
24951 #: ../src/guestfs-actions.pod:2818
24952 msgid "guestfs_inspect_get_icon"
24956 #: ../src/guestfs-actions.pod:2820
24960 " guestfs_inspect_get_icon (guestfs_h *g,\n"
24961 " const char *root,\n"
24962 " size_t *size_r,\n"
24968 #: ../src/guestfs-actions.pod:2831
24971 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
24972 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
24977 #: ../src/guestfs-actions.pod:2898 ../src/guestfs-actions.pod:3723
24978 #: ../src/guestfs-actions.pod:4977
24979 msgid "(Added in 1.11.12)"
24983 #: ../src/guestfs-actions.pod:2900
24984 msgid "guestfs_inspect_get_icon_va"
24988 #: ../src/guestfs-actions.pod:2902
24992 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
24993 " const char *root,\n"
24994 " size_t *size_r,\n"
24995 " va_list args);\n"
25000 #: ../src/guestfs-actions.pod:2908
25001 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
25005 #: ../src/guestfs-actions.pod:2912
25006 msgid "guestfs_inspect_get_icon_argv"
25010 #: ../src/guestfs-actions.pod:2914
25014 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
25015 " const char *root,\n"
25016 " size_t *size_r,\n"
25017 " const struct guestfs_inspect_get_icon_argv *optargs);\n"
25022 #: ../src/guestfs-actions.pod:2920
25023 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
25027 #: ../src/guestfs-actions.pod:2924
25028 msgid "guestfs_inspect_get_major_version"
25032 #: ../src/guestfs-actions.pod:2926
25036 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
25037 " const char *root);\n"
25042 #: ../src/guestfs-actions.pod:2948
25043 msgid "guestfs_inspect_get_minor_version"
25047 #: ../src/guestfs-actions.pod:2950
25051 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
25052 " const char *root);\n"
25057 #: ../src/guestfs-actions.pod:2959
25059 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25060 "C<guestfs_inspect_get_major_version>."
25064 #: ../src/guestfs-actions.pod:2966
25065 msgid "guestfs_inspect_get_mountpoints"
25069 #: ../src/guestfs-actions.pod:2968
25073 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
25074 " const char *root);\n"
25079 #: ../src/guestfs-actions.pod:2989
25081 "For operating systems like Windows which still use drive letters, this call "
25082 "will only return an entry for the first drive \"mounted on\" C</>. For "
25083 "information about the mapping of drive letters to partitions, see "
25084 "C<guestfs_inspect_get_drive_mappings>."
25088 #: ../src/guestfs-actions.pod:2995
25090 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25091 "C<guestfs_inspect_get_filesystems>."
25095 #: ../src/guestfs-actions.pod:3006
25096 msgid "guestfs_inspect_get_package_format"
25100 #: ../src/guestfs-actions.pod:3008
25104 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
25105 " const char *root);\n"
25110 #: ../src/guestfs-actions.pod:3012
25112 "This function and C<guestfs_inspect_get_package_management> return the "
25113 "package format and package management tool used by the inspected operating "
25114 "system. For example for Fedora these functions would return C<rpm> (package "
25115 "format) and C<yum> (package management)."
25119 #: ../src/guestfs-actions.pod:3030 ../src/guestfs-actions.pod:3058
25120 msgid "(Added in 1.7.5)"
25124 #: ../src/guestfs-actions.pod:3032
25125 msgid "guestfs_inspect_get_package_management"
25129 #: ../src/guestfs-actions.pod:3034
25133 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
25134 " const char *root);\n"
25139 #: ../src/guestfs-actions.pod:3038
25141 "C<guestfs_inspect_get_package_format> and this function return the package "
25142 "format and package management tool used by the inspected operating system. "
25143 "For example for Fedora these functions would return C<rpm> (package format) "
25144 "and C<yum> (package management)."
25148 #: ../src/guestfs-actions.pod:3060
25149 msgid "guestfs_inspect_get_product_name"
25153 #: ../src/guestfs-actions.pod:3062
25157 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
25158 " const char *root);\n"
25163 #: ../src/guestfs-actions.pod:3081
25164 msgid "guestfs_inspect_get_product_variant"
25168 #: ../src/guestfs-actions.pod:3083
25172 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
25173 " const char *root);\n"
25178 #: ../src/guestfs-actions.pod:3106
25180 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
25181 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
25185 #: ../src/guestfs-actions.pod:3113
25186 msgid "(Added in 1.9.13)"
25190 #: ../src/guestfs-actions.pod:3115
25191 msgid "guestfs_inspect_get_roots"
25195 #: ../src/guestfs-actions.pod:3117
25199 " guestfs_inspect_get_roots (guestfs_h *g);\n"
25204 #: ../src/guestfs-actions.pod:3120
25206 "This function is a convenient way to get the list of root devices, as "
25207 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
25208 "the whole inspection process."
25212 #: ../src/guestfs-actions.pod:3124
25214 "This returns an empty list if either no root devices were found or the "
25215 "caller has not called C<guestfs_inspect_os>."
25219 #: ../src/guestfs-actions.pod:3133
25220 msgid "(Added in 1.7.3)"
25224 #: ../src/guestfs-actions.pod:3135
25225 msgid "guestfs_inspect_get_type"
25229 #: ../src/guestfs-actions.pod:3137
25233 " guestfs_inspect_get_type (guestfs_h *g,\n"
25234 " const char *root);\n"
25239 #: ../src/guestfs-actions.pod:3174
25240 msgid "guestfs_inspect_get_windows_current_control_set"
25244 #: ../src/guestfs-actions.pod:3176
25248 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
25249 " const char *root);\n"
25254 #: ../src/guestfs-actions.pod:3194
25255 msgid "guestfs_inspect_get_windows_systemroot"
25259 #: ../src/guestfs-actions.pod:3196
25263 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
25264 " const char *root);\n"
25269 #: ../src/guestfs-actions.pod:3212
25270 msgid "(Added in 1.5.25)"
25274 #: ../src/guestfs-actions.pod:3214
25275 msgid "guestfs_inspect_is_live"
25279 #: ../src/guestfs-actions.pod:3216
25283 " guestfs_inspect_is_live (guestfs_h *g,\n"
25284 " const char *root);\n"
25289 #: ../src/guestfs-actions.pod:3220
25291 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25292 "disk), then this returns true if a live image was detected on the disk."
25296 #: ../src/guestfs-actions.pod:3230
25297 msgid "guestfs_inspect_is_multipart"
25301 #: ../src/guestfs-actions.pod:3232
25305 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
25306 " const char *root);\n"
25311 #: ../src/guestfs-actions.pod:3236
25313 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25314 "disk), then this returns true if the disk is part of a set."
25318 #: ../src/guestfs-actions.pod:3246
25319 msgid "guestfs_inspect_is_netinst"
25323 #: ../src/guestfs-actions.pod:3248
25327 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
25328 " const char *root);\n"
25333 #: ../src/guestfs-actions.pod:3252
25335 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
25336 "disk), then this returns true if the disk is a network installer, ie. not a "
25337 "self-contained install CD but one which is likely to require network access "
25338 "to complete the install."
25342 #: ../src/guestfs-actions.pod:3264
25343 msgid "guestfs_inspect_list_applications"
25347 #: ../src/guestfs-actions.pod:3266
25350 " struct guestfs_application_list *\n"
25351 " guestfs_inspect_list_applications (guestfs_h *g,\n"
25352 " const char *root);\n"
25357 #: ../src/guestfs-actions.pod:3272
25359 "I<Note:> This call works differently from other parts of the inspection "
25360 "API. You have to call C<guestfs_inspect_os>, then "
25361 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
25362 "this. Listing applications is a significantly more difficult operation "
25363 "which requires access to the full filesystem. Also note that unlike the "
25364 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
25365 "the libguestfs handle, this call actually reads parts of the mounted "
25366 "filesystems during the call."
25370 #: ../src/guestfs-actions.pod:3362
25372 "This function returns a C<struct guestfs_application_list *>, or NULL if "
25373 "there was an error. I<The caller must call C<guestfs_free_application_list> "
25378 #: ../src/guestfs-actions.pod:3366
25379 msgid "(Added in 1.7.8)"
25383 #: ../src/guestfs-actions.pod:3368
25384 msgid "guestfs_inspect_os"
25388 #: ../src/guestfs-actions.pod:3370
25392 " guestfs_inspect_os (guestfs_h *g);\n"
25397 #: ../src/guestfs-actions.pod:3386
25399 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
25400 "functions in order to query further information about each operating system, "
25401 "such as the name and version."
25405 #: ../src/guestfs-actions.pod:3391
25407 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
25408 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
25409 "the contents. This should be called with no disks currently mounted. The "
25410 "function may also use Augeas, so any existing Augeas handle will be closed."
25414 #: ../src/guestfs-actions.pod:3403 ../src/guestfs-actions.pod:3734
25415 #: ../src/guestfs-actions.pod:3816
25416 msgid "See also C<guestfs_list_filesystems>."
25420 #: ../src/guestfs-actions.pod:3411
25421 msgid "guestfs_is_blockdev"
25425 #: ../src/guestfs-actions.pod:3413
25429 " guestfs_is_blockdev (guestfs_h *g,\n"
25430 " const char *path);\n"
25435 #: ../src/guestfs-actions.pod:3420 ../src/guestfs-actions.pod:3449
25436 #: ../src/guestfs-actions.pod:3479 ../src/guestfs-actions.pod:3494
25437 #: ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3566
25438 #: ../src/guestfs-actions.pod:3581
25439 msgid "See also C<guestfs_stat>."
25443 #: ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:3453
25444 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3570
25445 #: ../src/guestfs-actions.pod:3585
25446 msgid "(Added in 1.5.10)"
25450 #: ../src/guestfs-actions.pod:3426
25451 msgid "guestfs_is_busy"
25455 #: ../src/guestfs-actions.pod:3428
25459 " guestfs_is_busy (guestfs_h *g);\n"
25464 #: ../src/guestfs-actions.pod:3440
25465 msgid "guestfs_is_chardev"
25469 #: ../src/guestfs-actions.pod:3442
25473 " guestfs_is_chardev (guestfs_h *g,\n"
25474 " const char *path);\n"
25479 #: ../src/guestfs-actions.pod:3455
25480 msgid "guestfs_is_config"
25484 #: ../src/guestfs-actions.pod:3457
25488 " guestfs_is_config (guestfs_h *g);\n"
25493 #: ../src/guestfs-actions.pod:3469
25494 msgid "guestfs_is_dir"
25498 #: ../src/guestfs-actions.pod:3471
25502 " guestfs_is_dir (guestfs_h *g,\n"
25503 " const char *path);\n"
25508 #: ../src/guestfs-actions.pod:3485
25509 msgid "guestfs_is_fifo"
25513 #: ../src/guestfs-actions.pod:3487
25517 " guestfs_is_fifo (guestfs_h *g,\n"
25518 " const char *path);\n"
25523 #: ../src/guestfs-actions.pod:3500
25524 msgid "guestfs_is_file"
25528 #: ../src/guestfs-actions.pod:3502
25532 " guestfs_is_file (guestfs_h *g,\n"
25533 " const char *path);\n"
25538 #: ../src/guestfs-actions.pod:3516
25539 msgid "guestfs_is_launching"
25543 #: ../src/guestfs-actions.pod:3518
25547 " guestfs_is_launching (guestfs_h *g);\n"
25552 #: ../src/guestfs-actions.pod:3530
25553 msgid "guestfs_is_lv"
25557 #: ../src/guestfs-actions.pod:3532
25561 " guestfs_is_lv (guestfs_h *g,\n"
25562 " const char *device);\n"
25567 #: ../src/guestfs-actions.pod:3543
25568 msgid "guestfs_is_ready"
25572 #: ../src/guestfs-actions.pod:3545
25576 " guestfs_is_ready (guestfs_h *g);\n"
25581 #: ../src/guestfs-actions.pod:3557
25582 msgid "guestfs_is_socket"
25586 #: ../src/guestfs-actions.pod:3559
25590 " guestfs_is_socket (guestfs_h *g,\n"
25591 " const char *path);\n"
25596 #: ../src/guestfs-actions.pod:3572
25597 msgid "guestfs_is_symlink"
25601 #: ../src/guestfs-actions.pod:3574
25605 " guestfs_is_symlink (guestfs_h *g,\n"
25606 " const char *path);\n"
25611 #: ../src/guestfs-actions.pod:3587
25612 msgid "guestfs_is_zero"
25616 #: ../src/guestfs-actions.pod:3589
25620 " guestfs_is_zero (guestfs_h *g,\n"
25621 " const char *path);\n"
25626 #: ../src/guestfs-actions.pod:3598 ../src/guestfs-actions.pod:3612
25627 msgid "(Added in 1.11.8)"
25631 #: ../src/guestfs-actions.pod:3600
25632 msgid "guestfs_is_zero_device"
25636 #: ../src/guestfs-actions.pod:3602
25640 " guestfs_is_zero_device (guestfs_h *g,\n"
25641 " const char *device);\n"
25646 #: ../src/guestfs-actions.pod:3614
25647 msgid "guestfs_kill_subprocess"
25651 #: ../src/guestfs-actions.pod:3616
25655 " guestfs_kill_subprocess (guestfs_h *g);\n"
25660 #: ../src/guestfs-actions.pod:3625
25661 msgid "guestfs_launch"
25665 #: ../src/guestfs-actions.pod:3627
25669 " guestfs_launch (guestfs_h *g);\n"
25674 #: ../src/guestfs-actions.pod:3645
25675 msgid "guestfs_lchown"
25679 #: ../src/guestfs-actions.pod:3647
25683 " guestfs_lchown (guestfs_h *g,\n"
25686 " const char *path);\n"
25691 #: ../src/guestfs-actions.pod:3653
25693 "Change the file owner to C<owner> and group to C<group>. This is like "
25694 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
25695 "changed, not the target."
25699 #: ../src/guestfs-actions.pod:3665
25700 msgid "guestfs_lgetxattr"
25704 #: ../src/guestfs-actions.pod:3667
25708 " guestfs_lgetxattr (guestfs_h *g,\n"
25709 " const char *path,\n"
25710 " const char *name,\n"
25711 " size_t *size_r);\n"
25716 #: ../src/guestfs-actions.pod:3687
25717 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
25721 #: ../src/guestfs-actions.pod:3695
25722 msgid "guestfs_lgetxattrs"
25726 #: ../src/guestfs-actions.pod:3697
25729 " struct guestfs_xattr_list *\n"
25730 " guestfs_lgetxattrs (guestfs_h *g,\n"
25731 " const char *path);\n"
25736 #: ../src/guestfs-actions.pod:3701
25738 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
25739 "then it returns the extended attributes of the link itself."
25743 #: ../src/guestfs-actions.pod:3711
25744 msgid "guestfs_list_9p"
25748 #: ../src/guestfs-actions.pod:3713
25752 " guestfs_list_9p (guestfs_h *g);\n"
25757 #: ../src/guestfs-actions.pod:3725
25758 msgid "guestfs_list_devices"
25762 #: ../src/guestfs-actions.pod:3727
25766 " guestfs_list_devices (guestfs_h *g);\n"
25771 #: ../src/guestfs-actions.pod:3742
25772 msgid "guestfs_list_dm_devices"
25776 #: ../src/guestfs-actions.pod:3744
25780 " guestfs_list_dm_devices (guestfs_h *g);\n"
25785 #: ../src/guestfs-actions.pod:3749
25787 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
25788 "previous call to C<guestfs_luks_open>."
25792 #: ../src/guestfs-actions.pod:3752
25794 "Device mapper devices which correspond to logical volumes are I<not> "
25795 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
25800 #: ../src/guestfs-actions.pod:3760 ../src/guestfs-actions.pod:5216
25801 msgid "(Added in 1.11.15)"
25805 #: ../src/guestfs-actions.pod:3762
25806 msgid "guestfs_list_filesystems"
25810 #: ../src/guestfs-actions.pod:3764
25814 " guestfs_list_filesystems (guestfs_h *g);\n"
25819 #: ../src/guestfs-actions.pod:3784
25821 "This command runs other libguestfs commands, which might include "
25822 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
25823 "soon after launch and only when nothing is mounted."
25827 #: ../src/guestfs-actions.pod:3788
25829 "Not all of the filesystems returned will be mountable. In particular, swap "
25830 "partitions are returned in the list. Also this command does not check that "
25831 "each filesystem found is valid and mountable, and some filesystems might be "
25832 "mountable but require special options. Filesystems may not all belong to a "
25833 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
25837 #: ../src/guestfs-actions.pod:3802 ../src/guestfs-actions.pod:5577
25838 msgid "(Added in 1.5.15)"
25842 #: ../src/guestfs-actions.pod:3804
25843 msgid "guestfs_list_partitions"
25847 #: ../src/guestfs-actions.pod:3806
25851 " guestfs_list_partitions (guestfs_h *g);\n"
25856 #: ../src/guestfs-actions.pod:3813
25858 "This does not return logical volumes. For that you will need to call "
25863 #: ../src/guestfs-actions.pod:3824
25868 #: ../src/guestfs-actions.pod:3826
25872 " guestfs_ll (guestfs_h *g,\n"
25873 " const char *directory);\n"
25878 #: ../src/guestfs-actions.pod:3841
25883 #: ../src/guestfs-actions.pod:3843
25887 " guestfs_ln (guestfs_h *g,\n"
25888 " const char *target,\n"
25889 " const char *linkname);\n"
25894 #: ../src/guestfs-actions.pod:3854
25895 msgid "guestfs_ln_f"
25899 #: ../src/guestfs-actions.pod:3856
25903 " guestfs_ln_f (guestfs_h *g,\n"
25904 " const char *target,\n"
25905 " const char *linkname);\n"
25910 #: ../src/guestfs-actions.pod:3868
25911 msgid "guestfs_ln_s"
25915 #: ../src/guestfs-actions.pod:3870
25919 " guestfs_ln_s (guestfs_h *g,\n"
25920 " const char *target,\n"
25921 " const char *linkname);\n"
25926 #: ../src/guestfs-actions.pod:3881
25927 msgid "guestfs_ln_sf"
25931 #: ../src/guestfs-actions.pod:3883
25935 " guestfs_ln_sf (guestfs_h *g,\n"
25936 " const char *target,\n"
25937 " const char *linkname);\n"
25942 #: ../src/guestfs-actions.pod:3895
25943 msgid "guestfs_lremovexattr"
25947 #: ../src/guestfs-actions.pod:3897
25951 " guestfs_lremovexattr (guestfs_h *g,\n"
25952 " const char *xattr,\n"
25953 " const char *path);\n"
25958 #: ../src/guestfs-actions.pod:3902
25960 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
25961 "link, then it removes an extended attribute of the link itself."
25965 #: ../src/guestfs-actions.pod:3910
25970 #: ../src/guestfs-actions.pod:3912
25974 " guestfs_ls (guestfs_h *g,\n"
25975 " const char *directory);\n"
25980 #: ../src/guestfs-actions.pod:3920
25982 "This command is mostly useful for interactive sessions. Programs should "
25983 "probably use C<guestfs_readdir> instead."
25987 #: ../src/guestfs-actions.pod:3929
25988 msgid "guestfs_lsetxattr"
25992 #: ../src/guestfs-actions.pod:3931
25996 " guestfs_lsetxattr (guestfs_h *g,\n"
25997 " const char *xattr,\n"
25998 " const char *val,\n"
26000 " const char *path);\n"
26005 #: ../src/guestfs-actions.pod:3938
26007 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
26008 "then it sets an extended attribute of the link itself."
26012 #: ../src/guestfs-actions.pod:3946
26013 msgid "guestfs_lstat"
26017 #: ../src/guestfs-actions.pod:3948
26020 " struct guestfs_stat *\n"
26021 " guestfs_lstat (guestfs_h *g,\n"
26022 " const char *path);\n"
26027 #: ../src/guestfs-actions.pod:3954
26029 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
26030 "link, then the link is stat-ed, not the file it refers to."
26034 #: ../src/guestfs-actions.pod:3960 ../src/guestfs-actions.pod:6735
26036 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
26037 "error. I<The caller must call C<guestfs_free_stat> after use>."
26041 #: ../src/guestfs-actions.pod:3964 ../src/guestfs-actions.pod:6739
26042 #: ../src/guestfs-actions.pod:6757 ../src/guestfs-actions.pod:7138
26043 msgid "(Added in 0.9.2)"
26047 #: ../src/guestfs-actions.pod:3966
26048 msgid "guestfs_lstatlist"
26052 #: ../src/guestfs-actions.pod:3968
26055 " struct guestfs_stat_list *\n"
26056 " guestfs_lstatlist (guestfs_h *g,\n"
26057 " const char *path,\n"
26058 " char *const *names);\n"
26063 #: ../src/guestfs-actions.pod:3973
26065 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
26066 "files, where all files are in the directory C<path>. C<names> is the list "
26067 "of files from this directory."
26071 #: ../src/guestfs-actions.pod:3982
26073 "This call is intended for programs that want to efficiently list a directory "
26074 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
26075 "for a similarly efficient call for getting extended attributes. Very long "
26076 "directory listings might cause the protocol message size to be exceeded, "
26077 "causing this call to fail. The caller must split up such requests into "
26078 "smaller groups of names."
26082 #: ../src/guestfs-actions.pod:3990
26084 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
26085 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
26089 #: ../src/guestfs-actions.pod:3996
26090 msgid "guestfs_luks_add_key"
26094 #: ../src/guestfs-actions.pod:3998
26098 " guestfs_luks_add_key (guestfs_h *g,\n"
26099 " const char *device,\n"
26100 " const char *key,\n"
26101 " const char *newkey,\n"
26107 #: ../src/guestfs-actions.pod:4010
26109 "Note that if C<keyslot> already contains a key, then this command will "
26110 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
26114 #: ../src/guestfs-actions.pod:4016 ../src/guestfs-actions.pod:4056
26115 #: ../src/guestfs-actions.pod:4079 ../src/guestfs-actions.pod:4099
26116 #: ../src/guestfs-actions.pod:4134 ../src/guestfs-actions.pod:4153
26118 "This function takes a key or passphrase parameter which could contain "
26119 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
26124 #: ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4060
26125 #: ../src/guestfs-actions.pod:4083 ../src/guestfs-actions.pod:4103
26126 msgid "(Added in 1.5.2)"
26130 #: ../src/guestfs-actions.pod:4022
26131 msgid "guestfs_luks_close"
26135 #: ../src/guestfs-actions.pod:4024
26139 " guestfs_luks_close (guestfs_h *g,\n"
26140 " const char *device);\n"
26145 #: ../src/guestfs-actions.pod:4028
26147 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
26148 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
26149 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
26150 "underlying block device."
26154 #: ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4138
26155 #: ../src/guestfs-actions.pod:4157 ../src/guestfs-actions.pod:4207
26156 #: ../src/guestfs-actions.pod:4255
26157 msgid "(Added in 1.5.1)"
26161 #: ../src/guestfs-actions.pod:4038
26162 msgid "guestfs_luks_format"
26166 #: ../src/guestfs-actions.pod:4040
26170 " guestfs_luks_format (guestfs_h *g,\n"
26171 " const char *device,\n"
26172 " const char *key,\n"
26178 #: ../src/guestfs-actions.pod:4062
26179 msgid "guestfs_luks_format_cipher"
26183 #: ../src/guestfs-actions.pod:4064
26187 " guestfs_luks_format_cipher (guestfs_h *g,\n"
26188 " const char *device,\n"
26189 " const char *key,\n"
26191 " const char *cipher);\n"
26196 #: ../src/guestfs-actions.pod:4071
26198 "This command is the same as C<guestfs_luks_format> but it also allows you to "
26199 "set the C<cipher> used."
26203 #: ../src/guestfs-actions.pod:4085
26204 msgid "guestfs_luks_kill_slot"
26208 #: ../src/guestfs-actions.pod:4087
26212 " guestfs_luks_kill_slot (guestfs_h *g,\n"
26213 " const char *device,\n"
26214 " const char *key,\n"
26220 #: ../src/guestfs-actions.pod:4105
26221 msgid "guestfs_luks_open"
26225 #: ../src/guestfs-actions.pod:4107
26229 " guestfs_luks_open (guestfs_h *g,\n"
26230 " const char *device,\n"
26231 " const char *key,\n"
26232 " const char *mapname);\n"
26237 #: ../src/guestfs-actions.pod:4125
26239 "If this block device contains LVM volume groups, then calling "
26240 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
26245 #: ../src/guestfs-actions.pod:4129
26246 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
26250 #: ../src/guestfs-actions.pod:4140
26251 msgid "guestfs_luks_open_ro"
26255 #: ../src/guestfs-actions.pod:4142
26259 " guestfs_luks_open_ro (guestfs_h *g,\n"
26260 " const char *device,\n"
26261 " const char *key,\n"
26262 " const char *mapname);\n"
26267 #: ../src/guestfs-actions.pod:4148
26269 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
26274 #: ../src/guestfs-actions.pod:4159
26275 msgid "guestfs_lvcreate"
26279 #: ../src/guestfs-actions.pod:4161
26283 " guestfs_lvcreate (guestfs_h *g,\n"
26284 " const char *logvol,\n"
26285 " const char *volgroup,\n"
26291 #: ../src/guestfs-actions.pod:4174
26292 msgid "guestfs_lvm_canonical_lv_name"
26296 #: ../src/guestfs-actions.pod:4176
26300 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
26301 " const char *lvname);\n"
26306 #: ../src/guestfs-actions.pod:4187
26307 msgid "See also C<guestfs_is_lv>."
26311 #: ../src/guestfs-actions.pod:4192
26312 msgid "(Added in 1.5.24)"
26316 #: ../src/guestfs-actions.pod:4194
26317 msgid "guestfs_lvm_clear_filter"
26321 #: ../src/guestfs-actions.pod:4196
26325 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
26330 #: ../src/guestfs-actions.pod:4199
26332 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
26333 "see every block device."
26337 #: ../src/guestfs-actions.pod:4209
26338 msgid "guestfs_lvm_remove_all"
26342 #: ../src/guestfs-actions.pod:4211
26346 " guestfs_lvm_remove_all (guestfs_h *g);\n"
26351 #: ../src/guestfs-actions.pod:4224
26352 msgid "guestfs_lvm_set_filter"
26356 #: ../src/guestfs-actions.pod:4226
26360 " guestfs_lvm_set_filter (guestfs_h *g,\n"
26361 " char *const *devices);\n"
26366 #: ../src/guestfs-actions.pod:4257
26367 msgid "guestfs_lvremove"
26371 #: ../src/guestfs-actions.pod:4259
26375 " guestfs_lvremove (guestfs_h *g,\n"
26376 " const char *device);\n"
26381 #: ../src/guestfs-actions.pod:4271 ../src/guestfs-actions.pod:5674
26382 #: ../src/guestfs-actions.pod:7508
26383 msgid "(Added in 1.0.13)"
26387 #: ../src/guestfs-actions.pod:4273
26388 msgid "guestfs_lvrename"
26392 #: ../src/guestfs-actions.pod:4275
26396 " guestfs_lvrename (guestfs_h *g,\n"
26397 " const char *logvol,\n"
26398 " const char *newlogvol);\n"
26403 #: ../src/guestfs-actions.pod:4284 ../src/guestfs-actions.pod:7521
26404 msgid "(Added in 1.0.83)"
26408 #: ../src/guestfs-actions.pod:4286
26409 msgid "guestfs_lvresize"
26413 #: ../src/guestfs-actions.pod:4288
26417 " guestfs_lvresize (guestfs_h *g,\n"
26418 " const char *device,\n"
26424 #: ../src/guestfs-actions.pod:4301
26425 msgid "guestfs_lvresize_free"
26429 #: ../src/guestfs-actions.pod:4303
26433 " guestfs_lvresize_free (guestfs_h *g,\n"
26434 " const char *lv,\n"
26440 #: ../src/guestfs-actions.pod:4316
26441 msgid "(Added in 1.3.3)"
26445 #: ../src/guestfs-actions.pod:4318
26446 msgid "guestfs_lvs"
26450 #: ../src/guestfs-actions.pod:4320
26454 " guestfs_lvs (guestfs_h *g);\n"
26459 #: ../src/guestfs-actions.pod:4329
26460 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
26464 #: ../src/guestfs-actions.pod:4337
26465 msgid "guestfs_lvs_full"
26469 #: ../src/guestfs-actions.pod:4339
26472 " struct guestfs_lvm_lv_list *\n"
26473 " guestfs_lvs_full (guestfs_h *g);\n"
26478 #: ../src/guestfs-actions.pod:4345
26480 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
26481 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
26485 #: ../src/guestfs-actions.pod:4351
26486 msgid "guestfs_lvuuid"
26490 #: ../src/guestfs-actions.pod:4353
26494 " guestfs_lvuuid (guestfs_h *g,\n"
26495 " const char *device);\n"
26500 #: ../src/guestfs-actions.pod:4364
26501 msgid "guestfs_lxattrlist"
26505 #: ../src/guestfs-actions.pod:4366
26508 " struct guestfs_xattr_list *\n"
26509 " guestfs_lxattrlist (guestfs_h *g,\n"
26510 " const char *path,\n"
26511 " char *const *names);\n"
26516 #: ../src/guestfs-actions.pod:4385
26518 "This call is intended for programs that want to efficiently list a directory "
26519 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
26520 "a similarly efficient call for getting standard stats. Very long directory "
26521 "listings might cause the protocol message size to be exceeded, causing this "
26522 "call to fail. The caller must split up such requests into smaller groups of "
26527 #: ../src/guestfs-actions.pod:4399
26528 msgid "guestfs_mkdir"
26532 #: ../src/guestfs-actions.pod:4401
26536 " guestfs_mkdir (guestfs_h *g,\n"
26537 " const char *path);\n"
26542 #: ../src/guestfs-actions.pod:4411
26543 msgid "guestfs_mkdir_mode"
26547 #: ../src/guestfs-actions.pod:4413
26551 " guestfs_mkdir_mode (guestfs_h *g,\n"
26552 " const char *path,\n"
26558 #: ../src/guestfs-actions.pod:4425
26559 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
26563 #: ../src/guestfs-actions.pod:4431
26564 msgid "guestfs_mkdir_p"
26568 #: ../src/guestfs-actions.pod:4433
26572 " guestfs_mkdir_p (guestfs_h *g,\n"
26573 " const char *path);\n"
26578 #: ../src/guestfs-actions.pod:4444
26579 msgid "guestfs_mkdtemp"
26583 #: ../src/guestfs-actions.pod:4446
26587 " guestfs_mkdtemp (guestfs_h *g,\n"
26588 " const char *template);\n"
26593 #: ../src/guestfs-actions.pod:4474
26594 msgid "guestfs_mke2fs_J"
26598 #: ../src/guestfs-actions.pod:4476
26602 " guestfs_mke2fs_J (guestfs_h *g,\n"
26603 " const char *fstype,\n"
26604 " int blocksize,\n"
26605 " const char *device,\n"
26606 " const char *journal);\n"
26611 #: ../src/guestfs-actions.pod:4489
26612 msgid "See also C<guestfs_mke2journal>."
26616 #: ../src/guestfs-actions.pod:4493 ../src/guestfs-actions.pod:4511
26617 #: ../src/guestfs-actions.pod:4529 ../src/guestfs-actions.pod:4545
26618 #: ../src/guestfs-actions.pod:4559 ../src/guestfs-actions.pod:4573
26619 #: ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:4909
26620 msgid "(Added in 1.0.68)"
26624 #: ../src/guestfs-actions.pod:4495
26625 msgid "guestfs_mke2fs_JL"
26629 #: ../src/guestfs-actions.pod:4497
26633 " guestfs_mke2fs_JL (guestfs_h *g,\n"
26634 " const char *fstype,\n"
26635 " int blocksize,\n"
26636 " const char *device,\n"
26637 " const char *label);\n"
26642 #: ../src/guestfs-actions.pod:4507
26643 msgid "See also C<guestfs_mke2journal_L>."
26647 #: ../src/guestfs-actions.pod:4513
26648 msgid "guestfs_mke2fs_JU"
26652 #: ../src/guestfs-actions.pod:4515
26656 " guestfs_mke2fs_JU (guestfs_h *g,\n"
26657 " const char *fstype,\n"
26658 " int blocksize,\n"
26659 " const char *device,\n"
26660 " const char *uuid);\n"
26665 #: ../src/guestfs-actions.pod:4525
26666 msgid "See also C<guestfs_mke2journal_U>."
26670 #: ../src/guestfs-actions.pod:4531
26671 msgid "guestfs_mke2journal"
26675 #: ../src/guestfs-actions.pod:4533
26679 " guestfs_mke2journal (guestfs_h *g,\n"
26680 " int blocksize,\n"
26681 " const char *device);\n"
26686 #: ../src/guestfs-actions.pod:4547
26687 msgid "guestfs_mke2journal_L"
26691 #: ../src/guestfs-actions.pod:4549
26695 " guestfs_mke2journal_L (guestfs_h *g,\n"
26696 " int blocksize,\n"
26697 " const char *label,\n"
26698 " const char *device);\n"
26703 #: ../src/guestfs-actions.pod:4561
26704 msgid "guestfs_mke2journal_U"
26708 #: ../src/guestfs-actions.pod:4563
26712 " guestfs_mke2journal_U (guestfs_h *g,\n"
26713 " int blocksize,\n"
26714 " const char *uuid,\n"
26715 " const char *device);\n"
26720 #: ../src/guestfs-actions.pod:4575
26721 msgid "guestfs_mkfifo"
26725 #: ../src/guestfs-actions.pod:4577
26729 " guestfs_mkfifo (guestfs_h *g,\n"
26731 " const char *path);\n"
26736 #: ../src/guestfs-actions.pod:4582
26738 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
26739 "is just a convenient wrapper around C<guestfs_mknod>."
26743 #: ../src/guestfs-actions.pod:4592
26744 msgid "guestfs_mkfs"
26748 #: ../src/guestfs-actions.pod:4594
26752 " guestfs_mkfs (guestfs_h *g,\n"
26753 " const char *fstype,\n"
26754 " const char *device);\n"
26759 #: ../src/guestfs-actions.pod:4607
26760 msgid "guestfs_mkfs_b"
26764 #: ../src/guestfs-actions.pod:4609
26768 " guestfs_mkfs_b (guestfs_h *g,\n"
26769 " const char *fstype,\n"
26770 " int blocksize,\n"
26771 " const char *device);\n"
26776 #: ../src/guestfs-actions.pod:4615
26778 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
26783 #: ../src/guestfs-actions.pod:4622
26785 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
26786 "block size of the resulting filesystem. Supported block sizes depend on the "
26787 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
26791 #: ../src/guestfs-actions.pod:4634
26792 msgid "guestfs_mkfs_opts"
26796 #: ../src/guestfs-actions.pod:4636
26800 " guestfs_mkfs_opts (guestfs_h *g,\n"
26801 " const char *fstype,\n"
26802 " const char *device,\n"
26808 #: ../src/guestfs-actions.pod:4647
26811 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
26812 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
26813 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
26814 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
26819 #: ../src/guestfs-actions.pod:4695
26820 msgid "(Added in 1.7.19)"
26824 #: ../src/guestfs-actions.pod:4697
26825 msgid "guestfs_mkfs_opts_va"
26829 #: ../src/guestfs-actions.pod:4699
26833 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
26834 " const char *fstype,\n"
26835 " const char *device,\n"
26836 " va_list args);\n"
26841 #: ../src/guestfs-actions.pod:4705
26842 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
26846 #: ../src/guestfs-actions.pod:4709
26847 msgid "guestfs_mkfs_opts_argv"
26851 #: ../src/guestfs-actions.pod:4711
26855 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
26856 " const char *fstype,\n"
26857 " const char *device,\n"
26858 " const struct guestfs_mkfs_opts_argv *optargs);\n"
26863 #: ../src/guestfs-actions.pod:4717
26864 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
26868 #: ../src/guestfs-actions.pod:4721
26869 msgid "guestfs_mkmountpoint"
26873 #: ../src/guestfs-actions.pod:4723
26877 " guestfs_mkmountpoint (guestfs_h *g,\n"
26878 " const char *exemptpath);\n"
26883 #: ../src/guestfs-actions.pod:4727
26885 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
26886 "that can be used to create extra mountpoints before mounting the first "
26891 #: ../src/guestfs-actions.pod:4751
26893 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
26894 "may get unexpected errors if you try to mix these calls. It is safest to "
26895 "manually unmount filesystems and remove mountpoints after use."
26899 #: ../src/guestfs-actions.pod:4755
26901 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
26902 "first, so for this to work for manual mountpoints, you must ensure that the "
26903 "innermost mountpoints have the longest pathnames, as in the example code "
26908 #: ../src/guestfs-actions.pod:4762
26910 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
26911 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
26912 "can also trigger these issues."
26916 #: ../src/guestfs-actions.pod:4768 ../src/guestfs-actions.pod:5084
26917 #: ../src/guestfs-actions.pod:6094
26918 msgid "(Added in 1.0.62)"
26922 #: ../src/guestfs-actions.pod:4770
26923 msgid "guestfs_mknod"
26927 #: ../src/guestfs-actions.pod:4772
26931 " guestfs_mknod (guestfs_h *g,\n"
26935 " const char *path);\n"
26940 #: ../src/guestfs-actions.pod:4787
26942 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
26943 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
26944 "regular file). These constants are available in the standard Linux header "
26945 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
26946 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
26947 "the appropriate constant for you."
26951 #: ../src/guestfs-actions.pod:4801
26952 msgid "guestfs_mknod_b"
26956 #: ../src/guestfs-actions.pod:4803
26960 " guestfs_mknod_b (guestfs_h *g,\n"
26964 " const char *path);\n"
26969 #: ../src/guestfs-actions.pod:4810
26971 "This call creates a block device node called C<path> with mode C<mode> and "
26972 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26973 "wrapper around C<guestfs_mknod>."
26977 #: ../src/guestfs-actions.pod:4820
26978 msgid "guestfs_mknod_c"
26982 #: ../src/guestfs-actions.pod:4822
26986 " guestfs_mknod_c (guestfs_h *g,\n"
26990 " const char *path);\n"
26995 #: ../src/guestfs-actions.pod:4829
26997 "This call creates a char device node called C<path> with mode C<mode> and "
26998 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
26999 "wrapper around C<guestfs_mknod>."
27003 #: ../src/guestfs-actions.pod:4839
27004 msgid "guestfs_mkswap"
27008 #: ../src/guestfs-actions.pod:4841
27012 " guestfs_mkswap (guestfs_h *g,\n"
27013 " const char *device);\n"
27018 #: ../src/guestfs-actions.pod:4851
27019 msgid "guestfs_mkswap_L"
27023 #: ../src/guestfs-actions.pod:4853
27027 " guestfs_mkswap_L (guestfs_h *g,\n"
27028 " const char *label,\n"
27029 " const char *device);\n"
27034 #: ../src/guestfs-actions.pod:4868
27035 msgid "guestfs_mkswap_U"
27039 #: ../src/guestfs-actions.pod:4870
27043 " guestfs_mkswap_U (guestfs_h *g,\n"
27044 " const char *uuid,\n"
27045 " const char *device);\n"
27050 #: ../src/guestfs-actions.pod:4881
27051 msgid "guestfs_mkswap_file"
27055 #: ../src/guestfs-actions.pod:4883
27059 " guestfs_mkswap_file (guestfs_h *g,\n"
27060 " const char *path);\n"
27065 #: ../src/guestfs-actions.pod:4889
27067 "This command just writes a swap file signature to an existing file. To "
27068 "create the file itself, use something like C<guestfs_fallocate>."
27072 #: ../src/guestfs-actions.pod:4896
27073 msgid "guestfs_modprobe"
27077 #: ../src/guestfs-actions.pod:4898
27081 " guestfs_modprobe (guestfs_h *g,\n"
27082 " const char *modulename);\n"
27087 #: ../src/guestfs-actions.pod:4911
27088 msgid "guestfs_mount"
27092 #: ../src/guestfs-actions.pod:4913
27096 " guestfs_mount (guestfs_h *g,\n"
27097 " const char *device,\n"
27098 " const char *mountpoint);\n"
27103 #: ../src/guestfs-actions.pod:4918
27105 "I<This function is deprecated.> In new code, use the L</"
27106 "guestfs_mount_options> call instead."
27110 #: ../src/guestfs-actions.pod:4939
27112 "B<Important note:> When you use this call, the filesystem options C<sync> "
27113 "and C<noatime> are set implicitly. This was originally done because we "
27114 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27115 "very large negative performance impact and negligible effect on "
27116 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
27117 "in any code that needs performance, and instead use C<guestfs_mount_options> "
27118 "(use an empty string for the first parameter if you don't want any options)."
27122 #: ../src/guestfs-actions.pod:4953
27123 msgid "guestfs_mount_9p"
27127 #: ../src/guestfs-actions.pod:4955
27131 " guestfs_mount_9p (guestfs_h *g,\n"
27132 " const char *mounttag,\n"
27133 " const char *mountpoint,\n"
27139 #: ../src/guestfs-actions.pod:4966
27142 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
27147 #: ../src/guestfs-actions.pod:4979
27148 msgid "guestfs_mount_9p_va"
27152 #: ../src/guestfs-actions.pod:4981
27156 " guestfs_mount_9p_va (guestfs_h *g,\n"
27157 " const char *mounttag,\n"
27158 " const char *mountpoint,\n"
27159 " va_list args);\n"
27164 #: ../src/guestfs-actions.pod:4987
27165 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
27169 #: ../src/guestfs-actions.pod:4991
27170 msgid "guestfs_mount_9p_argv"
27174 #: ../src/guestfs-actions.pod:4993
27178 " guestfs_mount_9p_argv (guestfs_h *g,\n"
27179 " const char *mounttag,\n"
27180 " const char *mountpoint,\n"
27181 " const struct guestfs_mount_9p_argv *optargs);\n"
27186 #: ../src/guestfs-actions.pod:4999
27187 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
27191 #: ../src/guestfs-actions.pod:5003
27192 msgid "guestfs_mount_loop"
27196 #: ../src/guestfs-actions.pod:5005
27200 " guestfs_mount_loop (guestfs_h *g,\n"
27201 " const char *file,\n"
27202 " const char *mountpoint);\n"
27207 #: ../src/guestfs-actions.pod:5018
27208 msgid "guestfs_mount_options"
27212 #: ../src/guestfs-actions.pod:5020
27216 " guestfs_mount_options (guestfs_h *g,\n"
27217 " const char *options,\n"
27218 " const char *device,\n"
27219 " const char *mountpoint);\n"
27224 #: ../src/guestfs-actions.pod:5026
27226 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27227 "the mount options as for the L<mount(8)> I<-o> flag."
27231 #: ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5050
27232 #: ../src/guestfs-actions.pod:5067
27233 msgid "(Added in 1.0.10)"
27237 #: ../src/guestfs-actions.pod:5038
27238 msgid "guestfs_mount_ro"
27242 #: ../src/guestfs-actions.pod:5040
27246 " guestfs_mount_ro (guestfs_h *g,\n"
27247 " const char *device,\n"
27248 " const char *mountpoint);\n"
27253 #: ../src/guestfs-actions.pod:5045
27255 "This is the same as the C<guestfs_mount> command, but it mounts the "
27256 "filesystem with the read-only (I<-o ro>) flag."
27260 #: ../src/guestfs-actions.pod:5052
27261 msgid "guestfs_mount_vfs"
27265 #: ../src/guestfs-actions.pod:5054
27269 " guestfs_mount_vfs (guestfs_h *g,\n"
27270 " const char *options,\n"
27271 " const char *vfstype,\n"
27272 " const char *device,\n"
27273 " const char *mountpoint);\n"
27278 #: ../src/guestfs-actions.pod:5061
27280 "This is the same as the C<guestfs_mount> command, but it allows you to set "
27281 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
27286 #: ../src/guestfs-actions.pod:5069
27287 msgid "guestfs_mountpoints"
27291 #: ../src/guestfs-actions.pod:5071
27295 " guestfs_mountpoints (guestfs_h *g);\n"
27300 #: ../src/guestfs-actions.pod:5074
27302 "This call is similar to C<guestfs_mounts>. That call returns a list of "
27303 "devices. This one returns a hash table (map) of device name to directory "
27304 "where the device is mounted."
27308 #: ../src/guestfs-actions.pod:5086
27309 msgid "guestfs_mounts"
27313 #: ../src/guestfs-actions.pod:5088
27317 " guestfs_mounts (guestfs_h *g);\n"
27322 #: ../src/guestfs-actions.pod:5096
27323 msgid "See also: C<guestfs_mountpoints>"
27327 #: ../src/guestfs-actions.pod:5104
27332 #: ../src/guestfs-actions.pod:5106
27336 " guestfs_mv (guestfs_h *g,\n"
27337 " const char *src,\n"
27338 " const char *dest);\n"
27343 #: ../src/guestfs-actions.pod:5118
27344 msgid "guestfs_ntfs_3g_probe"
27348 #: ../src/guestfs-actions.pod:5120
27352 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
27354 " const char *device);\n"
27359 #: ../src/guestfs-actions.pod:5139
27360 msgid "(Added in 1.0.43)"
27364 #: ../src/guestfs-actions.pod:5141
27365 msgid "guestfs_ntfsresize"
27369 #: ../src/guestfs-actions.pod:5143
27373 " guestfs_ntfsresize (guestfs_h *g,\n"
27374 " const char *device);\n"
27379 #: ../src/guestfs-actions.pod:5147 ../src/guestfs-actions.pod:5247
27381 "I<This function is deprecated.> In new code, use the L</"
27382 "guestfs_ntfsresize_opts> call instead."
27386 #: ../src/guestfs-actions.pod:5171
27387 msgid "guestfs_ntfsresize_opts"
27391 #: ../src/guestfs-actions.pod:5173
27395 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
27396 " const char *device,\n"
27402 #: ../src/guestfs-actions.pod:5183
27405 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
27406 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
27411 #: ../src/guestfs-actions.pod:5203
27413 "After the resize operation, the filesystem is always marked as requiring a "
27414 "consistency check (for safety). You have to boot into Windows to perform "
27415 "this check and clear this condition. If you I<don't> set the C<force> "
27416 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
27417 "times on a single filesystem without booting into Windows between each "
27422 #: ../src/guestfs-actions.pod:5218
27423 msgid "guestfs_ntfsresize_opts_va"
27427 #: ../src/guestfs-actions.pod:5220
27431 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
27432 " const char *device,\n"
27433 " va_list args);\n"
27438 #: ../src/guestfs-actions.pod:5225
27439 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
27443 #: ../src/guestfs-actions.pod:5229
27444 msgid "guestfs_ntfsresize_opts_argv"
27448 #: ../src/guestfs-actions.pod:5231
27452 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
27453 " const char *device,\n"
27454 " const struct guestfs_ntfsresize_opts_argv *optargs);\n"
27459 #: ../src/guestfs-actions.pod:5236
27460 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
27464 #: ../src/guestfs-actions.pod:5240
27465 msgid "guestfs_ntfsresize_size"
27469 #: ../src/guestfs-actions.pod:5242
27473 " guestfs_ntfsresize_size (guestfs_h *g,\n"
27474 " const char *device,\n"
27475 " int64_t size);\n"
27480 #: ../src/guestfs-actions.pod:5254
27482 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
27483 "to specify the new size (in bytes) explicitly."
27487 #: ../src/guestfs-actions.pod:5259 ../src/guestfs-actions.pod:5701
27488 #: ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:6042
27489 #: ../src/guestfs-actions.pod:7665
27490 msgid "(Added in 1.3.14)"
27494 #: ../src/guestfs-actions.pod:5261
27495 msgid "guestfs_part_add"
27499 #: ../src/guestfs-actions.pod:5263
27503 " guestfs_part_add (guestfs_h *g,\n"
27504 " const char *device,\n"
27505 " const char *prlogex,\n"
27506 " int64_t startsect,\n"
27507 " int64_t endsect);\n"
27512 #: ../src/guestfs-actions.pod:5270
27514 "This command adds a partition to C<device>. If there is no partition table "
27515 "on the device, call C<guestfs_part_init> first."
27519 #: ../src/guestfs-actions.pod:5282
27521 "Creating a partition which covers the whole disk is not so easy. Use "
27522 "C<guestfs_part_disk> to do that."
27526 #: ../src/guestfs-actions.pod:5287 ../src/guestfs-actions.pod:5325
27527 #: ../src/guestfs-actions.pod:5378 ../src/guestfs-actions.pod:5462
27528 #: ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5519
27529 #: ../src/guestfs-actions.pod:5559
27530 msgid "(Added in 1.0.78)"
27534 #: ../src/guestfs-actions.pod:5289
27535 msgid "guestfs_part_del"
27539 #: ../src/guestfs-actions.pod:5291
27543 " guestfs_part_del (guestfs_h *g,\n"
27544 " const char *device,\n"
27550 #: ../src/guestfs-actions.pod:5306
27551 msgid "guestfs_part_disk"
27555 #: ../src/guestfs-actions.pod:5308
27559 " guestfs_part_disk (guestfs_h *g,\n"
27560 " const char *device,\n"
27561 " const char *parttype);\n"
27566 #: ../src/guestfs-actions.pod:5313
27568 "This command is simply a combination of C<guestfs_part_init> followed by "
27569 "C<guestfs_part_add> to create a single primary partition covering the whole "
27574 #: ../src/guestfs-actions.pod:5317
27576 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27577 "possible values are described in C<guestfs_part_init>."
27581 #: ../src/guestfs-actions.pod:5327
27582 msgid "guestfs_part_get_bootable"
27586 #: ../src/guestfs-actions.pod:5329
27590 " guestfs_part_get_bootable (guestfs_h *g,\n"
27591 " const char *device,\n"
27597 #: ../src/guestfs-actions.pod:5337
27598 msgid "See also C<guestfs_part_set_bootable>."
27602 #: ../src/guestfs-actions.pod:5343
27603 msgid "guestfs_part_get_mbr_id"
27607 #: ../src/guestfs-actions.pod:5345
27611 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
27612 " const char *device,\n"
27618 #: ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:5535
27620 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27621 "undefined results for other partition table types (see "
27622 "C<guestfs_part_get_parttype>)."
27626 #: ../src/guestfs-actions.pod:5361
27627 msgid "guestfs_part_get_parttype"
27631 #: ../src/guestfs-actions.pod:5363
27635 " guestfs_part_get_parttype (guestfs_h *g,\n"
27636 " const char *device);\n"
27641 #: ../src/guestfs-actions.pod:5370
27643 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27644 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27645 "possible, although unusual. See C<guestfs_part_init> for a full list."
27649 #: ../src/guestfs-actions.pod:5380
27650 msgid "guestfs_part_init"
27654 #: ../src/guestfs-actions.pod:5382
27658 " guestfs_part_init (guestfs_h *g,\n"
27659 " const char *device,\n"
27660 " const char *parttype);\n"
27665 #: ../src/guestfs-actions.pod:5391
27667 "Initially there are no partitions. Following this, you should call "
27668 "C<guestfs_part_add> for each partition required."
27672 #: ../src/guestfs-actions.pod:5464
27673 msgid "guestfs_part_list"
27677 #: ../src/guestfs-actions.pod:5466
27680 " struct guestfs_partition_list *\n"
27681 " guestfs_part_list (guestfs_h *g,\n"
27682 " const char *device);\n"
27687 #: ../src/guestfs-actions.pod:5483
27689 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27690 "the device's sector size, see C<guestfs_blockdev_getss>."
27694 #: ../src/guestfs-actions.pod:5496
27696 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
27697 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
27702 #: ../src/guestfs-actions.pod:5502
27703 msgid "guestfs_part_set_bootable"
27707 #: ../src/guestfs-actions.pod:5504
27711 " guestfs_part_set_bootable (guestfs_h *g,\n"
27712 " const char *device,\n"
27714 " int bootable);\n"
27719 #: ../src/guestfs-actions.pod:5521
27720 msgid "guestfs_part_set_mbr_id"
27724 #: ../src/guestfs-actions.pod:5523
27728 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
27729 " const char *device,\n"
27736 #: ../src/guestfs-actions.pod:5543
27737 msgid "guestfs_part_set_name"
27741 #: ../src/guestfs-actions.pod:5545
27745 " guestfs_part_set_name (guestfs_h *g,\n"
27746 " const char *device,\n"
27748 " const char *name);\n"
27753 #: ../src/guestfs-actions.pod:5561
27754 msgid "guestfs_part_to_dev"
27758 #: ../src/guestfs-actions.pod:5563
27762 " guestfs_part_to_dev (guestfs_h *g,\n"
27763 " const char *partition);\n"
27768 #: ../src/guestfs-actions.pod:5571
27770 "The named partition must exist, for example as a string returned from "
27771 "C<guestfs_list_partitions>."
27775 #: ../src/guestfs-actions.pod:5579
27776 msgid "guestfs_ping_daemon"
27780 #: ../src/guestfs-actions.pod:5581
27784 " guestfs_ping_daemon (guestfs_h *g);\n"
27789 #: ../src/guestfs-actions.pod:5593
27790 msgid "guestfs_pread"
27794 #: ../src/guestfs-actions.pod:5595
27798 " guestfs_pread (guestfs_h *g,\n"
27799 " const char *path,\n"
27801 " int64_t offset,\n"
27802 " size_t *size_r);\n"
27807 #: ../src/guestfs-actions.pod:5608
27808 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
27812 #: ../src/guestfs-actions.pod:5619
27813 msgid "guestfs_pread_device"
27817 #: ../src/guestfs-actions.pod:5621
27821 " guestfs_pread_device (guestfs_h *g,\n"
27822 " const char *device,\n"
27824 " int64_t offset,\n"
27825 " size_t *size_r);\n"
27830 #: ../src/guestfs-actions.pod:5634
27831 msgid "See also C<guestfs_pread>."
27835 #: ../src/guestfs-actions.pod:5643
27836 msgid "(Added in 1.5.21)"
27840 #: ../src/guestfs-actions.pod:5645
27841 msgid "guestfs_pvcreate"
27845 #: ../src/guestfs-actions.pod:5647
27849 " guestfs_pvcreate (guestfs_h *g,\n"
27850 " const char *device);\n"
27855 #: ../src/guestfs-actions.pod:5659
27856 msgid "guestfs_pvremove"
27860 #: ../src/guestfs-actions.pod:5661
27864 " guestfs_pvremove (guestfs_h *g,\n"
27865 " const char *device);\n"
27870 #: ../src/guestfs-actions.pod:5676
27871 msgid "guestfs_pvresize"
27875 #: ../src/guestfs-actions.pod:5678
27879 " guestfs_pvresize (guestfs_h *g,\n"
27880 " const char *device);\n"
27885 #: ../src/guestfs-actions.pod:5689
27886 msgid "guestfs_pvresize_size"
27890 #: ../src/guestfs-actions.pod:5691
27894 " guestfs_pvresize_size (guestfs_h *g,\n"
27895 " const char *device,\n"
27896 " int64_t size);\n"
27901 #: ../src/guestfs-actions.pod:5696
27903 "This command is the same as C<guestfs_pvresize> except that it allows you to "
27904 "specify the new size (in bytes) explicitly."
27908 #: ../src/guestfs-actions.pod:5703
27909 msgid "guestfs_pvs"
27913 #: ../src/guestfs-actions.pod:5705
27917 " guestfs_pvs (guestfs_h *g);\n"
27922 #: ../src/guestfs-actions.pod:5714
27923 msgid "See also C<guestfs_pvs_full>."
27927 #: ../src/guestfs-actions.pod:5722
27928 msgid "guestfs_pvs_full"
27932 #: ../src/guestfs-actions.pod:5724
27935 " struct guestfs_lvm_pv_list *\n"
27936 " guestfs_pvs_full (guestfs_h *g);\n"
27941 #: ../src/guestfs-actions.pod:5730
27943 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
27944 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
27948 #: ../src/guestfs-actions.pod:5736
27949 msgid "guestfs_pvuuid"
27953 #: ../src/guestfs-actions.pod:5738
27957 " guestfs_pvuuid (guestfs_h *g,\n"
27958 " const char *device);\n"
27963 #: ../src/guestfs-actions.pod:5749
27964 msgid "guestfs_pwrite"
27968 #: ../src/guestfs-actions.pod:5751
27972 " guestfs_pwrite (guestfs_h *g,\n"
27973 " const char *path,\n"
27974 " const char *content,\n"
27975 " size_t content_size,\n"
27976 " int64_t offset);\n"
27981 #: ../src/guestfs-actions.pod:5767
27982 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
27986 #: ../src/guestfs-actions.pod:5776
27987 msgid "guestfs_pwrite_device"
27991 #: ../src/guestfs-actions.pod:5778
27995 " guestfs_pwrite_device (guestfs_h *g,\n"
27996 " const char *device,\n"
27997 " const char *content,\n"
27998 " size_t content_size,\n"
27999 " int64_t offset);\n"
28004 #: ../src/guestfs-actions.pod:5793
28005 msgid "See also C<guestfs_pwrite>."
28009 #: ../src/guestfs-actions.pod:5800
28010 msgid "(Added in 1.5.20)"
28014 #: ../src/guestfs-actions.pod:5802
28015 msgid "guestfs_read_file"
28019 #: ../src/guestfs-actions.pod:5804
28023 " guestfs_read_file (guestfs_h *g,\n"
28024 " const char *path,\n"
28025 " size_t *size_r);\n"
28030 #: ../src/guestfs-actions.pod:5812
28032 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
28033 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
28034 "function is limited in the total size of file that can be handled."
28038 #: ../src/guestfs-actions.pod:5824
28039 msgid "(Added in 1.0.63)"
28043 #: ../src/guestfs-actions.pod:5826
28044 msgid "guestfs_read_lines"
28048 #: ../src/guestfs-actions.pod:5828
28052 " guestfs_read_lines (guestfs_h *g,\n"
28053 " const char *path);\n"
28058 #: ../src/guestfs-actions.pod:5837
28060 "Note that this function cannot correctly handle binary files (specifically, "
28061 "files containing C<\\0> character which is treated as end of line). For "
28062 "those you need to use the C<guestfs_read_file> function which has a more "
28063 "complex interface."
28067 #: ../src/guestfs-actions.pod:5848
28068 msgid "guestfs_readdir"
28072 #: ../src/guestfs-actions.pod:5850
28075 " struct guestfs_dirent_list *\n"
28076 " guestfs_readdir (guestfs_h *g,\n"
28077 " const char *dir);\n"
28082 #: ../src/guestfs-actions.pod:5904
28084 "This function is primarily intended for use by programs. To get a simple "
28085 "list of names, use C<guestfs_ls>. To get a printable directory for human "
28086 "consumption, use C<guestfs_ll>."
28090 #: ../src/guestfs-actions.pod:5908
28092 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
28093 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
28097 #: ../src/guestfs-actions.pod:5914
28098 msgid "guestfs_readlink"
28102 #: ../src/guestfs-actions.pod:5916
28106 " guestfs_readlink (guestfs_h *g,\n"
28107 " const char *path);\n"
28112 #: ../src/guestfs-actions.pod:5927
28113 msgid "guestfs_readlinklist"
28117 #: ../src/guestfs-actions.pod:5929
28121 " guestfs_readlinklist (guestfs_h *g,\n"
28122 " const char *path,\n"
28123 " char *const *names);\n"
28128 #: ../src/guestfs-actions.pod:5962
28129 msgid "guestfs_realpath"
28133 #: ../src/guestfs-actions.pod:5964
28137 " guestfs_realpath (guestfs_h *g,\n"
28138 " const char *path);\n"
28143 #: ../src/guestfs-actions.pod:5976
28144 msgid "guestfs_removexattr"
28148 #: ../src/guestfs-actions.pod:5978
28152 " guestfs_removexattr (guestfs_h *g,\n"
28153 " const char *xattr,\n"
28154 " const char *path);\n"
28159 #: ../src/guestfs-actions.pod:5986
28160 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
28164 #: ../src/guestfs-actions.pod:5992
28165 msgid "guestfs_resize2fs"
28169 #: ../src/guestfs-actions.pod:5994
28173 " guestfs_resize2fs (guestfs_h *g,\n"
28174 " const char *device);\n"
28179 #: ../src/guestfs-actions.pod:6001
28181 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
28182 "C<device> before calling this command. For unknown reasons C<resize2fs> "
28183 "sometimes gives an error about this and sometimes not. In any case, it is "
28184 "always safe to call C<guestfs_e2fsck_f> before calling this function."
28188 #: ../src/guestfs-actions.pod:6011
28189 msgid "guestfs_resize2fs_M"
28193 #: ../src/guestfs-actions.pod:6013
28197 " guestfs_resize2fs_M (guestfs_h *g,\n"
28198 " const char *device);\n"
28203 #: ../src/guestfs-actions.pod:6017
28205 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
28206 "resized to its minimum size. This works like the I<-M> option to the "
28207 "C<resize2fs> command."
28211 #: ../src/guestfs-actions.pod:6021
28213 "To get the resulting size of the filesystem you should call "
28214 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
28215 "These two numbers, multiplied together, give the resulting size of the "
28216 "minimal filesystem in bytes."
28220 #: ../src/guestfs-actions.pod:6030
28221 msgid "guestfs_resize2fs_size"
28225 #: ../src/guestfs-actions.pod:6032
28229 " guestfs_resize2fs_size (guestfs_h *g,\n"
28230 " const char *device,\n"
28231 " int64_t size);\n"
28236 #: ../src/guestfs-actions.pod:6037
28238 "This command is the same as C<guestfs_resize2fs> except that it allows you "
28239 "to specify the new size (in bytes) explicitly."
28243 #: ../src/guestfs-actions.pod:6044
28248 #: ../src/guestfs-actions.pod:6046
28252 " guestfs_rm (guestfs_h *g,\n"
28253 " const char *path);\n"
28258 #: ../src/guestfs-actions.pod:6056
28259 msgid "guestfs_rm_rf"
28263 #: ../src/guestfs-actions.pod:6058
28267 " guestfs_rm_rf (guestfs_h *g,\n"
28268 " const char *path);\n"
28273 #: ../src/guestfs-actions.pod:6070
28274 msgid "guestfs_rmdir"
28278 #: ../src/guestfs-actions.pod:6072
28282 " guestfs_rmdir (guestfs_h *g,\n"
28283 " const char *path);\n"
28288 #: ../src/guestfs-actions.pod:6082
28289 msgid "guestfs_rmmountpoint"
28293 #: ../src/guestfs-actions.pod:6084
28297 " guestfs_rmmountpoint (guestfs_h *g,\n"
28298 " const char *exemptpath);\n"
28303 #: ../src/guestfs-actions.pod:6088
28305 "This calls removes a mountpoint that was previously created with "
28306 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
28310 #: ../src/guestfs-actions.pod:6096
28311 msgid "guestfs_scrub_device"
28315 #: ../src/guestfs-actions.pod:6098
28319 " guestfs_scrub_device (guestfs_h *g,\n"
28320 " const char *device);\n"
28325 #: ../src/guestfs-actions.pod:6113 ../src/guestfs-actions.pod:6131
28326 #: ../src/guestfs-actions.pod:6150
28327 msgid "(Added in 1.0.52)"
28331 #: ../src/guestfs-actions.pod:6115
28332 msgid "guestfs_scrub_file"
28336 #: ../src/guestfs-actions.pod:6117
28340 " guestfs_scrub_file (guestfs_h *g,\n"
28341 " const char *file);\n"
28346 #: ../src/guestfs-actions.pod:6133
28347 msgid "guestfs_scrub_freespace"
28351 #: ../src/guestfs-actions.pod:6135
28355 " guestfs_scrub_freespace (guestfs_h *g,\n"
28356 " const char *dir);\n"
28361 #: ../src/guestfs-actions.pod:6139
28363 "This command creates the directory C<dir> and then fills it with files until "
28364 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
28365 "and deletes them. The intention is to scrub any free space on the partition "
28366 "containing C<dir>."
28370 #: ../src/guestfs-actions.pod:6152
28371 msgid "guestfs_set_append"
28375 #: ../src/guestfs-actions.pod:6154
28379 " guestfs_set_append (guestfs_h *g,\n"
28380 " const char *append);\n"
28385 #: ../src/guestfs-actions.pod:6171
28386 msgid "guestfs_set_attach_method"
28390 #: ../src/guestfs-actions.pod:6173
28394 " guestfs_set_attach_method (guestfs_h *g,\n"
28395 " const char *attachmethod);\n"
28400 #: ../src/guestfs-actions.pod:6201
28401 msgid "guestfs_set_autosync"
28405 #: ../src/guestfs-actions.pod:6203
28409 " guestfs_set_autosync (guestfs_h *g,\n"
28410 " int autosync);\n"
28415 #: ../src/guestfs-actions.pod:6219
28416 msgid "guestfs_set_direct"
28420 #: ../src/guestfs-actions.pod:6221
28424 " guestfs_set_direct (guestfs_h *g,\n"
28430 #: ../src/guestfs-actions.pod:6229
28432 "One consequence of this is that log messages aren't caught by the library "
28433 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
28438 #: ../src/guestfs-actions.pod:6242
28439 msgid "guestfs_set_e2label"
28443 #: ../src/guestfs-actions.pod:6244
28447 " guestfs_set_e2label (guestfs_h *g,\n"
28448 " const char *device,\n"
28449 " const char *label);\n"
28454 #: ../src/guestfs-actions.pod:6253
28456 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
28457 "the existing label on a filesystem."
28461 #: ../src/guestfs-actions.pod:6260
28462 msgid "guestfs_set_e2uuid"
28466 #: ../src/guestfs-actions.pod:6262
28470 " guestfs_set_e2uuid (guestfs_h *g,\n"
28471 " const char *device,\n"
28472 " const char *uuid);\n"
28477 #: ../src/guestfs-actions.pod:6272
28479 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
28480 "the existing UUID of a filesystem."
28484 #: ../src/guestfs-actions.pod:6279
28485 msgid "guestfs_set_memsize"
28489 #: ../src/guestfs-actions.pod:6281
28493 " guestfs_set_memsize (guestfs_h *g,\n"
28499 #: ../src/guestfs-actions.pod:6285
28501 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28502 "This only has any effect if called before C<guestfs_launch>."
28506 #: ../src/guestfs-actions.pod:6300
28507 msgid "guestfs_set_network"
28511 #: ../src/guestfs-actions.pod:6302
28515 " guestfs_set_network (guestfs_h *g,\n"
28521 #: ../src/guestfs-actions.pod:6312
28523 "You must call this before calling C<guestfs_launch>, otherwise it has no "
28528 #: ../src/guestfs-actions.pod:6319
28529 msgid "guestfs_set_path"
28533 #: ../src/guestfs-actions.pod:6321
28537 " guestfs_set_path (guestfs_h *g,\n"
28538 " const char *searchpath);\n"
28543 #: ../src/guestfs-actions.pod:6336
28544 msgid "guestfs_set_pgroup"
28548 #: ../src/guestfs-actions.pod:6338
28552 " guestfs_set_pgroup (guestfs_h *g,\n"
28558 #: ../src/guestfs-actions.pod:6355
28559 msgid "guestfs_set_qemu"
28563 #: ../src/guestfs-actions.pod:6357
28567 " guestfs_set_qemu (guestfs_h *g,\n"
28568 " const char *qemu);\n"
28573 #: ../src/guestfs-actions.pod:6383
28574 msgid "guestfs_set_recovery_proc"
28578 #: ../src/guestfs-actions.pod:6385
28582 " guestfs_set_recovery_proc (guestfs_h *g,\n"
28583 " int recoveryproc);\n"
28588 #: ../src/guestfs-actions.pod:6389
28590 "If this is called with the parameter C<false> then C<guestfs_launch> does "
28591 "not create a recovery process. The purpose of the recovery process is to "
28592 "stop runaway qemu processes in the case where the main program aborts "
28597 #: ../src/guestfs-actions.pod:6394
28599 "This only has any effect if called before C<guestfs_launch>, and the default "
28604 #: ../src/guestfs-actions.pod:6407
28605 msgid "guestfs_set_selinux"
28609 #: ../src/guestfs-actions.pod:6409
28613 " guestfs_set_selinux (guestfs_h *g,\n"
28619 #: ../src/guestfs-actions.pod:6426
28620 msgid "guestfs_set_trace"
28624 #: ../src/guestfs-actions.pod:6428
28628 " guestfs_set_trace (guestfs_h *g,\n"
28634 #: ../src/guestfs-actions.pod:6442
28636 "Trace messages are normally sent to C<stderr>, unless you register a "
28637 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28641 #: ../src/guestfs-actions.pod:6450
28642 msgid "guestfs_set_verbose"
28646 #: ../src/guestfs-actions.pod:6452
28650 " guestfs_set_verbose (guestfs_h *g,\n"
28656 #: ../src/guestfs-actions.pod:6461
28658 "Verbose messages are normally sent to C<stderr>, unless you register a "
28659 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
28663 #: ../src/guestfs-actions.pod:6469
28664 msgid "guestfs_setcon"
28668 #: ../src/guestfs-actions.pod:6471
28672 " guestfs_setcon (guestfs_h *g,\n"
28673 " const char *context);\n"
28678 #: ../src/guestfs-actions.pod:6484
28679 msgid "guestfs_setxattr"
28683 #: ../src/guestfs-actions.pod:6486
28687 " guestfs_setxattr (guestfs_h *g,\n"
28688 " const char *xattr,\n"
28689 " const char *val,\n"
28691 " const char *path);\n"
28696 #: ../src/guestfs-actions.pod:6497
28697 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
28701 #: ../src/guestfs-actions.pod:6503
28702 msgid "guestfs_sfdisk"
28706 #: ../src/guestfs-actions.pod:6505
28710 " guestfs_sfdisk (guestfs_h *g,\n"
28711 " const char *device,\n"
28715 " char *const *lines);\n"
28720 #: ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6557
28721 #: ../src/guestfs-actions.pod:6591
28723 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
28728 #: ../src/guestfs-actions.pod:6540
28730 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
28734 #: ../src/guestfs-actions.pod:6550
28735 msgid "guestfs_sfdiskM"
28739 #: ../src/guestfs-actions.pod:6552
28743 " guestfs_sfdiskM (guestfs_h *g,\n"
28744 " const char *device,\n"
28745 " char *const *lines);\n"
28750 #: ../src/guestfs-actions.pod:6564
28752 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
28753 "partition sizes are specified in megabytes only (rounded to the nearest "
28754 "cylinder) and you don't need to specify the cyls, heads and sectors "
28755 "parameters which were rarely if ever used anyway."
28759 #: ../src/guestfs-actions.pod:6570
28761 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
28762 "C<guestfs_part_disk>"
28766 #: ../src/guestfs-actions.pod:6580
28767 msgid "guestfs_sfdisk_N"
28771 #: ../src/guestfs-actions.pod:6582
28775 " guestfs_sfdisk_N (guestfs_h *g,\n"
28776 " const char *device,\n"
28781 " const char *line);\n"
28786 #: ../src/guestfs-actions.pod:6601
28788 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
28789 "for the cyls/heads/sectors parameters."
28793 #: ../src/guestfs-actions.pod:6604
28794 msgid "See also: C<guestfs_part_add>"
28798 #: ../src/guestfs-actions.pod:6613
28799 msgid "guestfs_sfdisk_disk_geometry"
28803 #: ../src/guestfs-actions.pod:6615
28807 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
28808 " const char *device);\n"
28813 #: ../src/guestfs-actions.pod:6619
28815 "This displays the disk geometry of C<device> read from the partition table. "
28816 "Especially in the case where the underlying block device has been resized, "
28817 "this can be different from the kernel's idea of the geometry (see "
28818 "C<guestfs_sfdisk_kernel_geometry>)."
28822 #: ../src/guestfs-actions.pod:6632
28823 msgid "guestfs_sfdisk_kernel_geometry"
28827 #: ../src/guestfs-actions.pod:6634
28831 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
28832 " const char *device);\n"
28837 #: ../src/guestfs-actions.pod:6648
28838 msgid "guestfs_sfdisk_l"
28842 #: ../src/guestfs-actions.pod:6650
28846 " guestfs_sfdisk_l (guestfs_h *g,\n"
28847 " const char *device);\n"
28852 #: ../src/guestfs-actions.pod:6654
28854 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
28859 #: ../src/guestfs-actions.pod:6665
28860 msgid "See also: C<guestfs_part_list>"
28864 #: ../src/guestfs-actions.pod:6672
28869 #: ../src/guestfs-actions.pod:6674
28873 " guestfs_sh (guestfs_h *g,\n"
28874 " const char *command);\n"
28879 #: ../src/guestfs-actions.pod:6681
28880 msgid "This is like C<guestfs_command>, but passes the command to:"
28884 #: ../src/guestfs-actions.pod:6689
28885 msgid "All the provisos about C<guestfs_command> apply to this call."
28889 #: ../src/guestfs-actions.pod:6696
28890 msgid "guestfs_sh_lines"
28894 #: ../src/guestfs-actions.pod:6698
28898 " guestfs_sh_lines (guestfs_h *g,\n"
28899 " const char *command);\n"
28904 #: ../src/guestfs-actions.pod:6702
28906 "This is the same as C<guestfs_sh>, but splits the result into a list of "
28911 #: ../src/guestfs-actions.pod:6705
28912 msgid "See also: C<guestfs_command_lines>"
28916 #: ../src/guestfs-actions.pod:6713
28917 msgid "guestfs_sleep"
28921 #: ../src/guestfs-actions.pod:6715
28925 " guestfs_sleep (guestfs_h *g,\n"
28931 #: ../src/guestfs-actions.pod:6723
28932 msgid "(Added in 1.0.41)"
28936 #: ../src/guestfs-actions.pod:6725 ../src/guestfs-structs.pod:109
28937 msgid "guestfs_stat"
28941 #: ../src/guestfs-actions.pod:6727
28944 " struct guestfs_stat *\n"
28945 " guestfs_stat (guestfs_h *g,\n"
28946 " const char *path);\n"
28951 #: ../src/guestfs-actions.pod:6741 ../src/guestfs-structs.pod:135
28952 msgid "guestfs_statvfs"
28956 #: ../src/guestfs-actions.pod:6743
28959 " struct guestfs_statvfs *\n"
28960 " guestfs_statvfs (guestfs_h *g,\n"
28961 " const char *path);\n"
28966 #: ../src/guestfs-actions.pod:6753
28968 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
28969 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
28973 #: ../src/guestfs-actions.pod:6759
28974 msgid "guestfs_strings"
28978 #: ../src/guestfs-actions.pod:6761
28982 " guestfs_strings (guestfs_h *g,\n"
28983 " const char *path);\n"
28988 #: ../src/guestfs-actions.pod:6777
28989 msgid "guestfs_strings_e"
28993 #: ../src/guestfs-actions.pod:6779
28997 " guestfs_strings_e (guestfs_h *g,\n"
28998 " const char *encoding,\n"
28999 " const char *path);\n"
29004 #: ../src/guestfs-actions.pod:6784
29006 "This is like the C<guestfs_strings> command, but allows you to specify the "
29007 "encoding of strings that are looked for in the source file C<path>."
29011 #: ../src/guestfs-actions.pod:6794
29013 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29014 "ISO-8859-X (this is what C<guestfs_strings> uses)."
29018 #: ../src/guestfs-actions.pod:6832
29019 msgid "guestfs_swapoff_device"
29023 #: ../src/guestfs-actions.pod:6834
29027 " guestfs_swapoff_device (guestfs_h *g,\n"
29028 " const char *device);\n"
29033 #: ../src/guestfs-actions.pod:6838
29035 "This command disables the libguestfs appliance swap device or partition "
29036 "named C<device>. See C<guestfs_swapon_device>."
29040 #: ../src/guestfs-actions.pod:6846
29041 msgid "guestfs_swapoff_file"
29045 #: ../src/guestfs-actions.pod:6848
29049 " guestfs_swapoff_file (guestfs_h *g,\n"
29050 " const char *file);\n"
29055 #: ../src/guestfs-actions.pod:6858
29056 msgid "guestfs_swapoff_label"
29060 #: ../src/guestfs-actions.pod:6860
29064 " guestfs_swapoff_label (guestfs_h *g,\n"
29065 " const char *label);\n"
29070 #: ../src/guestfs-actions.pod:6871
29071 msgid "guestfs_swapoff_uuid"
29075 #: ../src/guestfs-actions.pod:6873
29079 " guestfs_swapoff_uuid (guestfs_h *g,\n"
29080 " const char *uuid);\n"
29085 #: ../src/guestfs-actions.pod:6884
29086 msgid "guestfs_swapon_device"
29090 #: ../src/guestfs-actions.pod:6886
29094 " guestfs_swapon_device (guestfs_h *g,\n"
29095 " const char *device);\n"
29100 #: ../src/guestfs-actions.pod:6890
29102 "This command enables the libguestfs appliance to use the swap device or "
29103 "partition named C<device>. The increased memory is made available for all "
29104 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
29108 #: ../src/guestfs-actions.pod:6906
29109 msgid "guestfs_swapon_file"
29113 #: ../src/guestfs-actions.pod:6908
29117 " guestfs_swapon_file (guestfs_h *g,\n"
29118 " const char *file);\n"
29123 #: ../src/guestfs-actions.pod:6912
29125 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
29130 #: ../src/guestfs-actions.pod:6919
29131 msgid "guestfs_swapon_label"
29135 #: ../src/guestfs-actions.pod:6921
29139 " guestfs_swapon_label (guestfs_h *g,\n"
29140 " const char *label);\n"
29145 #: ../src/guestfs-actions.pod:6925
29147 "This command enables swap to a labeled swap partition. See "
29148 "C<guestfs_swapon_device> for other notes."
29152 #: ../src/guestfs-actions.pod:6932
29153 msgid "guestfs_swapon_uuid"
29157 #: ../src/guestfs-actions.pod:6934
29161 " guestfs_swapon_uuid (guestfs_h *g,\n"
29162 " const char *uuid);\n"
29167 #: ../src/guestfs-actions.pod:6938
29169 "This command enables swap to a swap partition with the given UUID. See "
29170 "C<guestfs_swapon_device> for other notes."
29174 #: ../src/guestfs-actions.pod:6945
29175 msgid "guestfs_sync"
29179 #: ../src/guestfs-actions.pod:6947
29183 " guestfs_sync (guestfs_h *g);\n"
29188 #: ../src/guestfs-actions.pod:6960
29189 msgid "guestfs_tail"
29193 #: ../src/guestfs-actions.pod:6962
29197 " guestfs_tail (guestfs_h *g,\n"
29198 " const char *path);\n"
29203 #: ../src/guestfs-actions.pod:6978
29204 msgid "guestfs_tail_n"
29208 #: ../src/guestfs-actions.pod:6980
29212 " guestfs_tail_n (guestfs_h *g,\n"
29214 " const char *path);\n"
29219 #: ../src/guestfs-actions.pod:7002
29220 msgid "guestfs_tar_in"
29224 #: ../src/guestfs-actions.pod:7004
29228 " guestfs_tar_in (guestfs_h *g,\n"
29229 " const char *tarfile,\n"
29230 " const char *directory);\n"
29235 #: ../src/guestfs-actions.pod:7012
29237 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
29241 #: ../src/guestfs-actions.pod:7017 ../src/guestfs-actions.pod:7034
29242 #: ../src/guestfs-actions.pod:7050 ../src/guestfs-actions.pod:7066
29243 msgid "(Added in 1.0.3)"
29247 #: ../src/guestfs-actions.pod:7019
29248 msgid "guestfs_tar_out"
29252 #: ../src/guestfs-actions.pod:7021
29256 " guestfs_tar_out (guestfs_h *g,\n"
29257 " const char *directory,\n"
29258 " const char *tarfile);\n"
29263 #: ../src/guestfs-actions.pod:7029
29265 "To download a compressed tarball, use C<guestfs_tgz_out> or "
29266 "C<guestfs_txz_out>."
29270 #: ../src/guestfs-actions.pod:7036
29271 msgid "guestfs_tgz_in"
29275 #: ../src/guestfs-actions.pod:7038
29279 " guestfs_tgz_in (guestfs_h *g,\n"
29280 " const char *tarball,\n"
29281 " const char *directory);\n"
29286 #: ../src/guestfs-actions.pod:7046
29287 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
29291 #: ../src/guestfs-actions.pod:7052
29292 msgid "guestfs_tgz_out"
29296 #: ../src/guestfs-actions.pod:7054
29300 " guestfs_tgz_out (guestfs_h *g,\n"
29301 " const char *directory,\n"
29302 " const char *tarball);\n"
29307 #: ../src/guestfs-actions.pod:7062
29308 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
29312 #: ../src/guestfs-actions.pod:7068
29313 msgid "guestfs_touch"
29317 #: ../src/guestfs-actions.pod:7070
29321 " guestfs_touch (guestfs_h *g,\n"
29322 " const char *path);\n"
29327 #: ../src/guestfs-actions.pod:7085
29328 msgid "guestfs_truncate"
29332 #: ../src/guestfs-actions.pod:7087
29336 " guestfs_truncate (guestfs_h *g,\n"
29337 " const char *path);\n"
29342 #: ../src/guestfs-actions.pod:7098
29343 msgid "guestfs_truncate_size"
29347 #: ../src/guestfs-actions.pod:7100
29351 " guestfs_truncate_size (guestfs_h *g,\n"
29352 " const char *path,\n"
29353 " int64_t size);\n"
29358 #: ../src/guestfs-actions.pod:7108
29360 "If the current file size is less than C<size> then the file is extended to "
29361 "the required size with zero bytes. This creates a sparse file (ie. disk "
29362 "blocks are not allocated for the file until you write to it). To create a "
29363 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
29367 #: ../src/guestfs-actions.pod:7118
29368 msgid "guestfs_tune2fs_l"
29372 #: ../src/guestfs-actions.pod:7120
29376 " guestfs_tune2fs_l (guestfs_h *g,\n"
29377 " const char *device);\n"
29382 #: ../src/guestfs-actions.pod:7140
29383 msgid "guestfs_txz_in"
29387 #: ../src/guestfs-actions.pod:7142
29391 " guestfs_txz_in (guestfs_h *g,\n"
29392 " const char *tarball,\n"
29393 " const char *directory);\n"
29398 #: ../src/guestfs-actions.pod:7154
29399 msgid "guestfs_txz_out"
29403 #: ../src/guestfs-actions.pod:7156
29407 " guestfs_txz_out (guestfs_h *g,\n"
29408 " const char *directory,\n"
29409 " const char *tarball);\n"
29414 #: ../src/guestfs-actions.pod:7168
29415 msgid "guestfs_umask"
29419 #: ../src/guestfs-actions.pod:7170
29423 " guestfs_umask (guestfs_h *g,\n"
29429 #: ../src/guestfs-actions.pod:7186
29431 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
29432 "C<guestfs_mkdir>."
29436 #: ../src/guestfs-actions.pod:7195
29437 msgid "guestfs_umount"
29441 #: ../src/guestfs-actions.pod:7197
29445 " guestfs_umount (guestfs_h *g,\n"
29446 " const char *pathordevice);\n"
29451 #: ../src/guestfs-actions.pod:7209
29452 msgid "guestfs_umount_all"
29456 #: ../src/guestfs-actions.pod:7211
29460 " guestfs_umount_all (guestfs_h *g);\n"
29465 #: ../src/guestfs-actions.pod:7222
29466 msgid "guestfs_upload"
29470 #: ../src/guestfs-actions.pod:7224
29474 " guestfs_upload (guestfs_h *g,\n"
29475 " const char *filename,\n"
29476 " const char *remotefilename);\n"
29481 #: ../src/guestfs-actions.pod:7234
29482 msgid "See also C<guestfs_download>."
29486 #: ../src/guestfs-actions.pod:7245
29487 msgid "guestfs_upload_offset"
29491 #: ../src/guestfs-actions.pod:7247
29495 " guestfs_upload_offset (guestfs_h *g,\n"
29496 " const char *filename,\n"
29497 " const char *remotefilename,\n"
29498 " int64_t offset);\n"
29503 #: ../src/guestfs-actions.pod:7263
29505 "Note that there is no limit on the amount of data that can be uploaded with "
29506 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
29507 "full amount unless an error occurs."
29511 #: ../src/guestfs-actions.pod:7268
29512 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
29516 #: ../src/guestfs-actions.pod:7279
29517 msgid "guestfs_utimens"
29521 #: ../src/guestfs-actions.pod:7281
29525 " guestfs_utimens (guestfs_h *g,\n"
29526 " const char *path,\n"
29527 " int64_t atsecs,\n"
29528 " int64_t atnsecs,\n"
29529 " int64_t mtsecs,\n"
29530 " int64_t mtnsecs);\n"
29535 #: ../src/guestfs-actions.pod:7310 ../src/guestfs-structs.pod:175
29536 msgid "guestfs_version"
29540 #: ../src/guestfs-actions.pod:7312
29543 " struct guestfs_version *\n"
29544 " guestfs_version (guestfs_h *g);\n"
29549 #: ../src/guestfs-actions.pod:7340
29551 "I<Note:> Don't use this call to test for availability of features. In "
29552 "enterprise distributions we backport features from later versions into "
29553 "earlier versions, making this an unreliable way to test for features. Use "
29554 "C<guestfs_available> instead."
29558 #: ../src/guestfs-actions.pod:7346
29560 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
29561 "error. I<The caller must call C<guestfs_free_version> after use>."
29565 #: ../src/guestfs-actions.pod:7350
29566 msgid "(Added in 1.0.58)"
29570 #: ../src/guestfs-actions.pod:7352
29571 msgid "guestfs_vfs_label"
29575 #: ../src/guestfs-actions.pod:7354
29579 " guestfs_vfs_label (guestfs_h *g,\n"
29580 " const char *device);\n"
29585 #: ../src/guestfs-actions.pod:7363
29586 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
29590 #: ../src/guestfs-actions.pod:7368 ../src/guestfs-actions.pod:7405
29591 msgid "(Added in 1.3.18)"
29595 #: ../src/guestfs-actions.pod:7370
29596 msgid "guestfs_vfs_type"
29600 #: ../src/guestfs-actions.pod:7372
29604 " guestfs_vfs_type (guestfs_h *g,\n"
29605 " const char *device);\n"
29610 #: ../src/guestfs-actions.pod:7389
29611 msgid "guestfs_vfs_uuid"
29615 #: ../src/guestfs-actions.pod:7391
29619 " guestfs_vfs_uuid (guestfs_h *g,\n"
29620 " const char *device);\n"
29625 #: ../src/guestfs-actions.pod:7400
29626 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
29630 #: ../src/guestfs-actions.pod:7407
29631 msgid "guestfs_vg_activate"
29635 #: ../src/guestfs-actions.pod:7409
29639 " guestfs_vg_activate (guestfs_h *g,\n"
29641 " char *const *volgroups);\n"
29646 #: ../src/guestfs-actions.pod:7426
29647 msgid "guestfs_vg_activate_all"
29651 #: ../src/guestfs-actions.pod:7428
29655 " guestfs_vg_activate_all (guestfs_h *g,\n"
29656 " int activate);\n"
29661 #: ../src/guestfs-actions.pod:7441
29662 msgid "guestfs_vgcreate"
29666 #: ../src/guestfs-actions.pod:7443
29670 " guestfs_vgcreate (guestfs_h *g,\n"
29671 " const char *volgroup,\n"
29672 " char *const *physvols);\n"
29677 #: ../src/guestfs-actions.pod:7455
29678 msgid "guestfs_vglvuuids"
29682 #: ../src/guestfs-actions.pod:7457
29686 " guestfs_vglvuuids (guestfs_h *g,\n"
29687 " const char *vgname);\n"
29692 #: ../src/guestfs-actions.pod:7464
29694 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
29695 "associate logical volumes and volume groups."
29699 #: ../src/guestfs-actions.pod:7467
29700 msgid "See also C<guestfs_vgpvuuids>."
29704 #: ../src/guestfs-actions.pod:7475
29705 msgid "guestfs_vgpvuuids"
29709 #: ../src/guestfs-actions.pod:7477
29713 " guestfs_vgpvuuids (guestfs_h *g,\n"
29714 " const char *vgname);\n"
29719 #: ../src/guestfs-actions.pod:7484
29721 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
29722 "associate physical volumes and volume groups."
29726 #: ../src/guestfs-actions.pod:7487
29727 msgid "See also C<guestfs_vglvuuids>."
29731 #: ../src/guestfs-actions.pod:7495
29732 msgid "guestfs_vgremove"
29736 #: ../src/guestfs-actions.pod:7497
29740 " guestfs_vgremove (guestfs_h *g,\n"
29741 " const char *vgname);\n"
29746 #: ../src/guestfs-actions.pod:7510
29747 msgid "guestfs_vgrename"
29751 #: ../src/guestfs-actions.pod:7512
29755 " guestfs_vgrename (guestfs_h *g,\n"
29756 " const char *volgroup,\n"
29757 " const char *newvolgroup);\n"
29762 #: ../src/guestfs-actions.pod:7523
29763 msgid "guestfs_vgs"
29767 #: ../src/guestfs-actions.pod:7525
29771 " guestfs_vgs (guestfs_h *g);\n"
29776 #: ../src/guestfs-actions.pod:7534
29777 msgid "See also C<guestfs_vgs_full>."
29781 #: ../src/guestfs-actions.pod:7542
29782 msgid "guestfs_vgs_full"
29786 #: ../src/guestfs-actions.pod:7544
29789 " struct guestfs_lvm_vg_list *\n"
29790 " guestfs_vgs_full (guestfs_h *g);\n"
29795 #: ../src/guestfs-actions.pod:7550
29797 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
29798 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
29802 #: ../src/guestfs-actions.pod:7556
29803 msgid "guestfs_vgscan"
29807 #: ../src/guestfs-actions.pod:7558
29811 " guestfs_vgscan (guestfs_h *g);\n"
29816 #: ../src/guestfs-actions.pod:7568
29817 msgid "guestfs_vguuid"
29821 #: ../src/guestfs-actions.pod:7570
29825 " guestfs_vguuid (guestfs_h *g,\n"
29826 " const char *vgname);\n"
29831 #: ../src/guestfs-actions.pod:7581
29832 msgid "guestfs_wait_ready"
29836 #: ../src/guestfs-actions.pod:7583
29840 " guestfs_wait_ready (guestfs_h *g);\n"
29845 #: ../src/guestfs-actions.pod:7586
29847 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
29852 #: ../src/guestfs-actions.pod:7593
29853 msgid "This function is a no op."
29857 #: ../src/guestfs-actions.pod:7595
29859 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
29860 "calling C<guestfs_launch> to wait for the launch to complete. However this "
29861 "is no longer necessary because C<guestfs_launch> now does the waiting."
29865 #: ../src/guestfs-actions.pod:7600
29867 "If you see any calls to this function in code then you can just remove them, "
29868 "unless you want to retain compatibility with older versions of the API."
29872 #: ../src/guestfs-actions.pod:7608
29873 msgid "guestfs_wc_c"
29877 #: ../src/guestfs-actions.pod:7610
29881 " guestfs_wc_c (guestfs_h *g,\n"
29882 " const char *path);\n"
29887 #: ../src/guestfs-actions.pod:7621
29888 msgid "guestfs_wc_l"
29892 #: ../src/guestfs-actions.pod:7623
29896 " guestfs_wc_l (guestfs_h *g,\n"
29897 " const char *path);\n"
29902 #: ../src/guestfs-actions.pod:7634
29903 msgid "guestfs_wc_w"
29907 #: ../src/guestfs-actions.pod:7636
29911 " guestfs_wc_w (guestfs_h *g,\n"
29912 " const char *path);\n"
29917 #: ../src/guestfs-actions.pod:7647
29918 msgid "guestfs_write"
29922 #: ../src/guestfs-actions.pod:7649
29926 " guestfs_write (guestfs_h *g,\n"
29927 " const char *path,\n"
29928 " const char *content,\n"
29929 " size_t content_size);\n"
29934 #: ../src/guestfs-actions.pod:7658
29935 msgid "See also C<guestfs_write_append>."
29939 #: ../src/guestfs-actions.pod:7667
29940 msgid "guestfs_write_append"
29944 #: ../src/guestfs-actions.pod:7669
29948 " guestfs_write_append (guestfs_h *g,\n"
29949 " const char *path,\n"
29950 " const char *content,\n"
29951 " size_t content_size);\n"
29956 #: ../src/guestfs-actions.pod:7678
29957 msgid "See also C<guestfs_write>."
29961 #: ../src/guestfs-actions.pod:7687
29962 msgid "guestfs_write_file"
29966 #: ../src/guestfs-actions.pod:7689
29970 " guestfs_write_file (guestfs_h *g,\n"
29971 " const char *path,\n"
29972 " const char *content,\n"
29978 #: ../src/guestfs-actions.pod:7695
29980 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
29985 #: ../src/guestfs-actions.pod:7720
29986 msgid "guestfs_zegrep"
29990 #: ../src/guestfs-actions.pod:7722
29994 " guestfs_zegrep (guestfs_h *g,\n"
29995 " const char *regex,\n"
29996 " const char *path);\n"
30001 #: ../src/guestfs-actions.pod:7739
30002 msgid "guestfs_zegrepi"
30006 #: ../src/guestfs-actions.pod:7741
30010 " guestfs_zegrepi (guestfs_h *g,\n"
30011 " const char *regex,\n"
30012 " const char *path);\n"
30017 #: ../src/guestfs-actions.pod:7758
30018 msgid "guestfs_zero"
30022 #: ../src/guestfs-actions.pod:7760
30026 " guestfs_zero (guestfs_h *g,\n"
30027 " const char *device);\n"
30032 #: ../src/guestfs-actions.pod:7770
30034 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
30035 "C<guestfs_is_zero_device>"
30039 #: ../src/guestfs-actions.pod:7782
30040 msgid "guestfs_zero_device"
30044 #: ../src/guestfs-actions.pod:7784
30048 " guestfs_zero_device (guestfs_h *g,\n"
30049 " const char *device);\n"
30054 #: ../src/guestfs-actions.pod:7788
30056 "This command writes zeroes over the entire C<device>. Compare with "
30057 "C<guestfs_zero> which just zeroes the first few blocks of a device."
30061 #: ../src/guestfs-actions.pod:7802
30062 msgid "(Added in 1.3.1)"
30066 #: ../src/guestfs-actions.pod:7804
30067 msgid "guestfs_zerofree"
30071 #: ../src/guestfs-actions.pod:7806
30075 " guestfs_zerofree (guestfs_h *g,\n"
30076 " const char *device);\n"
30081 #: ../src/guestfs-actions.pod:7825
30082 msgid "guestfs_zfgrep"
30086 #: ../src/guestfs-actions.pod:7827
30090 " guestfs_zfgrep (guestfs_h *g,\n"
30091 " const char *pattern,\n"
30092 " const char *path);\n"
30097 #: ../src/guestfs-actions.pod:7844
30098 msgid "guestfs_zfgrepi"
30102 #: ../src/guestfs-actions.pod:7846
30106 " guestfs_zfgrepi (guestfs_h *g,\n"
30107 " const char *pattern,\n"
30108 " const char *path);\n"
30113 #: ../src/guestfs-actions.pod:7863
30114 msgid "guestfs_zfile"
30118 #: ../src/guestfs-actions.pod:7865
30122 " guestfs_zfile (guestfs_h *g,\n"
30123 " const char *meth,\n"
30124 " const char *path);\n"
30129 #: ../src/guestfs-actions.pod:7870
30131 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
30136 #: ../src/guestfs-actions.pod:7882
30138 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
30143 #: ../src/guestfs-actions.pod:7890
30144 msgid "guestfs_zgrep"
30148 #: ../src/guestfs-actions.pod:7892
30152 " guestfs_zgrep (guestfs_h *g,\n"
30153 " const char *regex,\n"
30154 " const char *path);\n"
30159 #: ../src/guestfs-actions.pod:7909
30160 msgid "guestfs_zgrepi"
30164 #: ../src/guestfs-actions.pod:7911
30168 " guestfs_zgrepi (guestfs_h *g,\n"
30169 " const char *regex,\n"
30170 " const char *path);\n"
30175 #: ../src/guestfs-availability.pod:3
30180 #: ../src/guestfs-availability.pod:5
30182 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
30183 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
30184 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
30185 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
30186 "L</guestfs_aug_save> L</guestfs_aug_set>"
30190 #: ../src/guestfs-availability.pod:21
30195 #: ../src/guestfs-availability.pod:23
30196 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
30200 #: ../src/guestfs-availability.pod:26
30205 #: ../src/guestfs-availability.pod:28
30207 "The following functions: L</guestfs_inotify_add_watch> L</"
30208 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
30209 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
30213 #: ../src/guestfs-availability.pod:36
30214 msgid "B<linuxfsuuid>"
30218 #: ../src/guestfs-availability.pod:38
30220 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
30221 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
30225 #: ../src/guestfs-availability.pod:45
30226 msgid "B<linuxmodules>"
30230 #: ../src/guestfs-availability.pod:47
30231 msgid "The following functions: L</guestfs_modprobe>"
30235 #: ../src/guestfs-availability.pod:50
30236 msgid "B<linuxxattrs>"
30240 #: ../src/guestfs-availability.pod:52
30242 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
30243 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
30244 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
30245 "guestfs_setxattr>"
30249 #: ../src/guestfs-availability.pod:63
30254 #: ../src/guestfs-availability.pod:65
30256 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
30257 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
30258 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
30262 #: ../src/guestfs-availability.pod:74
30267 #: ../src/guestfs-availability.pod:76
30269 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
30270 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
30271 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
30272 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
30273 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
30274 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
30275 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
30279 #: ../src/guestfs-availability.pod:99
30284 #: ../src/guestfs-availability.pod:101
30286 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
30287 "guestfs_mknod_b> L</guestfs_mknod_c>"
30291 #: ../src/guestfs-availability.pod:107
30296 #: ../src/guestfs-availability.pod:109
30297 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
30301 #: ../src/guestfs-availability.pod:112
30302 msgid "B<ntfsprogs>"
30306 #: ../src/guestfs-availability.pod:114
30308 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
30309 "L</guestfs_ntfsresize_size>"
30313 #: ../src/guestfs-availability.pod:119
30314 msgid "B<realpath>"
30318 #: ../src/guestfs-availability.pod:121
30319 msgid "The following functions: L</guestfs_realpath>"
30323 #: ../src/guestfs-availability.pod:124
30328 #: ../src/guestfs-availability.pod:126
30330 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
30331 "guestfs_scrub_freespace>"
30335 #: ../src/guestfs-availability.pod:131
30340 #: ../src/guestfs-availability.pod:133
30341 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
30345 #: ../src/guestfs-availability.pod:137
30350 #: ../src/guestfs-availability.pod:139
30351 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
30355 #: ../src/guestfs-availability.pod:143
30356 msgid "B<zerofree>"
30360 #: ../src/guestfs-availability.pod:145
30361 msgid "The following functions: L</guestfs_zerofree>"
30365 #: ../src/guestfs-structs.pod:1
30366 msgid "guestfs_int_bool"
30370 #: ../src/guestfs-structs.pod:3
30373 " struct guestfs_int_bool {\n"
30381 #: ../src/guestfs-structs.pod:8
30384 " struct guestfs_int_bool_list {\n"
30385 " uint32_t len; /* Number of elements in list. */\n"
30386 " struct guestfs_int_bool *val; /* Elements. */\n"
30392 #: ../src/guestfs-structs.pod:13
30395 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
30396 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
30401 #: ../src/guestfs-structs.pod:16
30402 msgid "guestfs_lvm_pv"
30406 #: ../src/guestfs-structs.pod:18
30409 " struct guestfs_lvm_pv {\n"
30410 " char *pv_name;\n"
30411 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30412 " char pv_uuid[32];\n"
30414 " uint64_t pv_size;\n"
30415 " uint64_t dev_size;\n"
30416 " uint64_t pv_free;\n"
30417 " uint64_t pv_used;\n"
30418 " char *pv_attr;\n"
30419 " int64_t pv_pe_count;\n"
30420 " int64_t pv_pe_alloc_count;\n"
30421 " char *pv_tags;\n"
30422 " uint64_t pe_start;\n"
30423 " int64_t pv_mda_count;\n"
30424 " uint64_t pv_mda_free;\n"
30430 #: ../src/guestfs-structs.pod:36
30433 " struct guestfs_lvm_pv_list {\n"
30434 " uint32_t len; /* Number of elements in list. */\n"
30435 " struct guestfs_lvm_pv *val; /* Elements. */\n"
30441 #: ../src/guestfs-structs.pod:41
30444 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
30445 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
30450 #: ../src/guestfs-structs.pod:44
30451 msgid "guestfs_lvm_vg"
30455 #: ../src/guestfs-structs.pod:46
30458 " struct guestfs_lvm_vg {\n"
30459 " char *vg_name;\n"
30460 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30461 " char vg_uuid[32];\n"
30463 " char *vg_attr;\n"
30464 " uint64_t vg_size;\n"
30465 " uint64_t vg_free;\n"
30466 " char *vg_sysid;\n"
30467 " uint64_t vg_extent_size;\n"
30468 " int64_t vg_extent_count;\n"
30469 " int64_t vg_free_count;\n"
30470 " int64_t max_lv;\n"
30471 " int64_t max_pv;\n"
30472 " int64_t pv_count;\n"
30473 " int64_t lv_count;\n"
30474 " int64_t snap_count;\n"
30475 " int64_t vg_seqno;\n"
30476 " char *vg_tags;\n"
30477 " int64_t vg_mda_count;\n"
30478 " uint64_t vg_mda_free;\n"
30484 #: ../src/guestfs-structs.pod:69
30487 " struct guestfs_lvm_vg_list {\n"
30488 " uint32_t len; /* Number of elements in list. */\n"
30489 " struct guestfs_lvm_vg *val; /* Elements. */\n"
30495 #: ../src/guestfs-structs.pod:74
30498 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
30499 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
30504 #: ../src/guestfs-structs.pod:77
30505 msgid "guestfs_lvm_lv"
30509 #: ../src/guestfs-structs.pod:79
30512 " struct guestfs_lvm_lv {\n"
30513 " char *lv_name;\n"
30514 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
30515 " char lv_uuid[32];\n"
30516 " char *lv_attr;\n"
30517 " int64_t lv_major;\n"
30518 " int64_t lv_minor;\n"
30519 " int64_t lv_kernel_major;\n"
30520 " int64_t lv_kernel_minor;\n"
30521 " uint64_t lv_size;\n"
30522 " int64_t seg_count;\n"
30524 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30525 " float snap_percent;\n"
30526 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
30527 " float copy_percent;\n"
30528 " char *move_pv;\n"
30529 " char *lv_tags;\n"
30530 " char *mirror_log;\n"
30531 " char *modules;\n"
30537 #: ../src/guestfs-structs.pod:101
30540 " struct guestfs_lvm_lv_list {\n"
30541 " uint32_t len; /* Number of elements in list. */\n"
30542 " struct guestfs_lvm_lv *val; /* Elements. */\n"
30548 #: ../src/guestfs-structs.pod:106
30551 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
30552 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
30557 #: ../src/guestfs-structs.pod:111
30560 " struct guestfs_stat {\n"
30564 " int64_t nlink;\n"
30569 " int64_t blksize;\n"
30570 " int64_t blocks;\n"
30571 " int64_t atime;\n"
30572 " int64_t mtime;\n"
30573 " int64_t ctime;\n"
30579 #: ../src/guestfs-structs.pod:127
30582 " struct guestfs_stat_list {\n"
30583 " uint32_t len; /* Number of elements in list. */\n"
30584 " struct guestfs_stat *val; /* Elements. */\n"
30590 #: ../src/guestfs-structs.pod:132
30593 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
30594 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
30599 #: ../src/guestfs-structs.pod:137
30602 " struct guestfs_statvfs {\n"
30603 " int64_t bsize;\n"
30604 " int64_t frsize;\n"
30605 " int64_t blocks;\n"
30606 " int64_t bfree;\n"
30607 " int64_t bavail;\n"
30608 " int64_t files;\n"
30609 " int64_t ffree;\n"
30610 " int64_t favail;\n"
30613 " int64_t namemax;\n"
30619 #: ../src/guestfs-structs.pod:151
30622 " struct guestfs_statvfs_list {\n"
30623 " uint32_t len; /* Number of elements in list. */\n"
30624 " struct guestfs_statvfs *val; /* Elements. */\n"
30630 #: ../src/guestfs-structs.pod:156
30633 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
30634 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
30639 #: ../src/guestfs-structs.pod:159
30640 msgid "guestfs_dirent"
30644 #: ../src/guestfs-structs.pod:161
30647 " struct guestfs_dirent {\n"
30656 #: ../src/guestfs-structs.pod:167
30659 " struct guestfs_dirent_list {\n"
30660 " uint32_t len; /* Number of elements in list. */\n"
30661 " struct guestfs_dirent *val; /* Elements. */\n"
30667 #: ../src/guestfs-structs.pod:172
30670 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
30671 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
30676 #: ../src/guestfs-structs.pod:177
30679 " struct guestfs_version {\n"
30680 " int64_t major;\n"
30681 " int64_t minor;\n"
30682 " int64_t release;\n"
30689 #: ../src/guestfs-structs.pod:184
30692 " struct guestfs_version_list {\n"
30693 " uint32_t len; /* Number of elements in list. */\n"
30694 " struct guestfs_version *val; /* Elements. */\n"
30700 #: ../src/guestfs-structs.pod:189
30703 " void guestfs_free_version (struct guestfs_free_version *);\n"
30704 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
30709 #: ../src/guestfs-structs.pod:192
30710 msgid "guestfs_xattr"
30714 #: ../src/guestfs-structs.pod:194
30717 " struct guestfs_xattr {\n"
30718 " char *attrname;\n"
30719 " /* The next two fields describe a byte array. */\n"
30720 " uint32_t attrval_len;\n"
30721 " char *attrval;\n"
30727 #: ../src/guestfs-structs.pod:201
30730 " struct guestfs_xattr_list {\n"
30731 " uint32_t len; /* Number of elements in list. */\n"
30732 " struct guestfs_xattr *val; /* Elements. */\n"
30738 #: ../src/guestfs-structs.pod:206
30741 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
30742 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
30747 #: ../src/guestfs-structs.pod:209
30748 msgid "guestfs_inotify_event"
30752 #: ../src/guestfs-structs.pod:211
30755 " struct guestfs_inotify_event {\n"
30756 " int64_t in_wd;\n"
30757 " uint32_t in_mask;\n"
30758 " uint32_t in_cookie;\n"
30759 " char *in_name;\n"
30765 #: ../src/guestfs-structs.pod:218
30768 " struct guestfs_inotify_event_list {\n"
30769 " uint32_t len; /* Number of elements in list. */\n"
30770 " struct guestfs_inotify_event *val; /* Elements. */\n"
30776 #: ../src/guestfs-structs.pod:223
30779 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
30780 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
30785 #: ../src/guestfs-structs.pod:226
30786 msgid "guestfs_partition"
30790 #: ../src/guestfs-structs.pod:228
30793 " struct guestfs_partition {\n"
30794 " int32_t part_num;\n"
30795 " uint64_t part_start;\n"
30796 " uint64_t part_end;\n"
30797 " uint64_t part_size;\n"
30803 #: ../src/guestfs-structs.pod:235
30806 " struct guestfs_partition_list {\n"
30807 " uint32_t len; /* Number of elements in list. */\n"
30808 " struct guestfs_partition *val; /* Elements. */\n"
30814 #: ../src/guestfs-structs.pod:240
30817 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
30818 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
30823 #: ../src/guestfs-structs.pod:243
30824 msgid "guestfs_application"
30828 #: ../src/guestfs-structs.pod:245
30831 " struct guestfs_application {\n"
30832 " char *app_name;\n"
30833 " char *app_display_name;\n"
30834 " int32_t app_epoch;\n"
30835 " char *app_version;\n"
30836 " char *app_release;\n"
30837 " char *app_install_path;\n"
30838 " char *app_trans_path;\n"
30839 " char *app_publisher;\n"
30840 " char *app_url;\n"
30841 " char *app_source_package;\n"
30842 " char *app_summary;\n"
30843 " char *app_description;\n"
30849 #: ../src/guestfs-structs.pod:260
30852 " struct guestfs_application_list {\n"
30853 " uint32_t len; /* Number of elements in list. */\n"
30854 " struct guestfs_application *val; /* Elements. */\n"
30860 #: ../src/guestfs-structs.pod:265
30863 " void guestfs_free_application (struct guestfs_free_application *);\n"
30864 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
30869 #: ../src/guestfs.pod:5
30870 msgid "guestfs - Library for accessing and modifying virtual machine images"
30874 #: ../src/guestfs.pod:11
30877 " guestfs_h *g = guestfs_create ();\n"
30878 " guestfs_add_drive (g, \"guest.img\");\n"
30879 " guestfs_launch (g);\n"
30880 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
30881 " guestfs_touch (g, \"/hello\");\n"
30882 " guestfs_umount (g, \"/\");\n"
30883 " guestfs_close (g);\n"
30888 #: ../src/guestfs.pod:25
30890 "Libguestfs is a library for accessing and modifying guest disk images. "
30891 "Amongst the things this is good for: making batch configuration changes to "
30892 "guests, getting disk used/free statistics (see also: virt-df), migrating "
30893 "between virtualization systems (see also: virt-p2v), performing partial "
30894 "backups, performing partial guest clones, cloning guests and changing "
30895 "registry/UUID/hostname info, and much else besides."
30899 #: ../src/guestfs.pod:33
30901 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
30902 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
30903 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
30908 #: ../src/guestfs.pod:38
30910 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
30911 "what filesystem is in each LV, etc.). It can also run commands in the "
30912 "context of the guest. Also you can access filesystems over FUSE."
30916 #: ../src/guestfs.pod:43
30918 "Libguestfs is a library that can be linked with C and C++ management "
30919 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
30920 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
30925 #: ../src/guestfs.pod:48
30927 "You don't need to be root to use libguestfs, although obviously you do need "
30928 "enough permissions to access the disk images."
30932 #: ../src/guestfs.pod:51
30934 "Libguestfs is a large API because it can do many things. For a gentle "
30935 "introduction, please read the L</API OVERVIEW> section next."
30939 #: ../src/guestfs.pod:54
30941 "There are also some example programs in the L<guestfs-examples(3)> manual "
30946 #: ../src/guestfs.pod:57
30947 msgid "API OVERVIEW"
30951 #: ../src/guestfs.pod:59
30953 "This section provides a gentler overview of the libguestfs API. We also try "
30954 "to group API calls together, where that may not be obvious from reading "
30955 "about the individual calls in the main section of this manual."
30959 #: ../src/guestfs.pod:64
30964 #: ../src/guestfs.pod:66
30966 "Before you can use libguestfs calls, you have to create a handle. Then you "
30967 "must add at least one disk image to the handle, followed by launching the "
30968 "handle, then performing whatever operations you want, and finally closing "
30969 "the handle. By convention we use the single letter C<g> for the name of the "
30970 "handle variable, although of course you can use any name you want."
30974 #: ../src/guestfs.pod:73
30975 msgid "The general structure of all libguestfs-using programs looks like this:"
30979 #: ../src/guestfs.pod:76
30982 " guestfs_h *g = guestfs_create ();\n"
30987 #: ../src/guestfs.pod:78
30990 " /* Call guestfs_add_drive additional times if there are\n"
30991 " * multiple disk images.\n"
30993 " guestfs_add_drive (g, \"guest.img\");\n"
30998 #: ../src/guestfs.pod:83
31001 " /* Most manipulation calls won't work until you've launched\n"
31002 " * the handle 'g'. You have to do this _after_ adding drives\n"
31003 " * and _before_ other commands.\n"
31005 " guestfs_launch (g);\n"
31010 #: ../src/guestfs.pod:89
31013 " /* Now you can examine what partitions, LVs etc are available.\n"
31015 " char **partitions = guestfs_list_partitions (g);\n"
31016 " char **logvols = guestfs_lvs (g);\n"
31021 #: ../src/guestfs.pod:94
31024 " /* To access a filesystem in the image, you must mount it.\n"
31026 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
31031 #: ../src/guestfs.pod:98
31034 " /* Now you can perform filesystem actions on the guest\n"
31037 " guestfs_touch (g, \"/hello\");\n"
31042 #: ../src/guestfs.pod:103
31045 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
31046 " * it is done automatically when you close the handle. See\n"
31047 " * discussion of autosync in this page.\n"
31049 " guestfs_sync (g);\n"
31054 #: ../src/guestfs.pod:109
31057 " /* Close the handle 'g'. */\n"
31058 " guestfs_close (g);\n"
31063 #: ../src/guestfs.pod:112
31065 "The code above doesn't include any error checking. In real code you should "
31066 "check return values carefully for errors. In general all functions that "
31067 "return integers return C<-1> on error, and all functions that return "
31068 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
31069 "how to handle errors, and consult the documentation for each function call "
31070 "below to see precisely how they return error indications. See L<guestfs-"
31071 "examples(3)> for fully worked examples."
31075 #: ../src/guestfs.pod:121
31076 msgid "DISK IMAGES"
31080 #: ../src/guestfs.pod:123
31082 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
31083 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
31084 "actual block device, or simply an empty file of zeroes that you have created "
31085 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
31090 #: ../src/guestfs.pod:129
31092 "The call you should use in modern code for adding drives is L</"
31093 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
31094 "specifying that the format is raw, do:"
31098 #: ../src/guestfs.pod:133
31101 " guestfs_add_drive_opts (g, filename,\n"
31102 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31108 #: ../src/guestfs.pod:137
31109 msgid "You can add a disk read-only using:"
31113 #: ../src/guestfs.pod:139
31116 " guestfs_add_drive_opts (g, filename,\n"
31117 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
31118 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
31124 #: ../src/guestfs.pod:144
31126 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
31127 "libguestfs won't modify the file."
31131 #: ../src/guestfs.pod:147
31133 "Be extremely cautious if the disk image is in use, eg. if it is being used "
31134 "by a virtual machine. Adding it read-write will almost certainly cause disk "
31135 "corruption, but adding it read-only is safe."
31139 #: ../src/guestfs.pod:151
31141 "You must add at least one disk image, and you may add multiple disk images. "
31142 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
31143 "first one you added), C</dev/sdb> (for the second one you added), etc."
31147 #: ../src/guestfs.pod:156
31149 "Once L</guestfs_launch> has been called you cannot add any more images. You "
31150 "can call L</guestfs_list_devices> to get a list of the device names, in the "
31151 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
31155 #: ../src/guestfs.pod:161
31160 #: ../src/guestfs.pod:163
31162 "Before you can read or write files, create directories and so on in a disk "
31163 "image that contains filesystems, you have to mount those filesystems using "
31164 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
31165 "a disk image contains (for example) one partition with a filesystem on that "
31166 "partition, then you can mount it directly:"
31170 #: ../src/guestfs.pod:170
31173 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
31178 #: ../src/guestfs.pod:172
31180 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
31181 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
31182 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
31183 "that these are libguestfs virtual devices, and are nothing to do with host "
31188 #: ../src/guestfs.pod:178
31190 "If you are given a disk image and you don't know what it contains then you "
31191 "have to find out. Libguestfs can do that too: use L</"
31192 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
31193 "LVs, and either try mounting each to see what is mountable, or else examine "
31194 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
31195 "filesystems, use L</guestfs_list_filesystems>."
31199 #: ../src/guestfs.pod:186
31201 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
31202 "L</INSPECTION> below). But you might find it easier to look at higher level "
31203 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
31207 #: ../src/guestfs.pod:191
31209 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
31210 "several other variations of the C<guestfs_mount_*> call."
31214 #: ../src/guestfs.pod:194
31215 msgid "FILESYSTEM ACCESS AND MODIFICATION"
31219 #: ../src/guestfs.pod:196
31221 "The majority of the libguestfs API consists of fairly low-level calls for "
31222 "accessing and modifying the files, directories, symlinks etc on mounted "
31223 "filesystems. There are over a hundred such calls which you can find listed "
31224 "in detail below in this man page, and we don't even pretend to cover them "
31225 "all in this overview."
31229 #: ../src/guestfs.pod:202
31231 "Specify filenames as full paths, starting with C<\"/\"> and including the "
31236 #: ../src/guestfs.pod:205
31238 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
31239 "the file called C<\"etc/passwd\"> then you could do:"
31243 #: ../src/guestfs.pod:208
31246 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
31251 #: ../src/guestfs.pod:210
31253 "This would return C<data> as a newly allocated buffer containing the full "
31254 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
31255 "or C<NULL> if there was an error."
31259 #: ../src/guestfs.pod:214
31261 "As another example, to create a top-level directory on that filesystem "
31262 "called C<\"var\"> you would do:"
31266 #: ../src/guestfs.pod:217
31269 " guestfs_mkdir (g, \"/var\");\n"
31274 #: ../src/guestfs.pod:219
31275 msgid "To create a symlink you could do:"
31279 #: ../src/guestfs.pod:221
31282 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
31283 " \"/etc/rc3.d/S30portmap\");\n"
31288 #: ../src/guestfs.pod:224
31290 "Libguestfs will reject attempts to use relative paths and there is no "
31291 "concept of a current working directory."
31295 #: ../src/guestfs.pod:227
31297 "Libguestfs can return errors in many situations: for example if the "
31298 "filesystem isn't writable, or if a file or directory that you requested "
31299 "doesn't exist. If you are using the C API (documented here) you have to "
31300 "check for those error conditions after each call. (Other language bindings "
31301 "turn these errors into exceptions)."
31305 #: ../src/guestfs.pod:233
31307 "File writes are affected by the per-handle umask, set by calling L</"
31308 "guestfs_umask> and defaulting to 022. See L</UMASK>."
31312 #: ../src/guestfs.pod:236
31313 msgid "PARTITIONING"
31317 #: ../src/guestfs.pod:238
31319 "Libguestfs contains API calls to read, create and modify partition tables on "
31324 #: ../src/guestfs.pod:241
31326 "In the common case where you want to create a single partition covering the "
31327 "whole disk, you should use the L</guestfs_part_disk> call:"
31331 #: ../src/guestfs.pod:245
31334 " const char *parttype = \"mbr\";\n"
31335 " if (disk_is_larger_than_2TB)\n"
31336 " parttype = \"gpt\";\n"
31337 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
31342 #: ../src/guestfs.pod:250
31344 "Obviously this effectively wipes anything that was on that disk image before."
31348 #: ../src/guestfs.pod:253
31353 #: ../src/guestfs.pod:255
31355 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
31356 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
31357 "you familiarize yourself with the concepts of physical volumes, volume "
31358 "groups and logical volumes."
31362 #: ../src/guestfs.pod:260
31364 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
31365 "tldp.org/HOWTO/LVM-HOWTO/>."
31369 #: ../src/guestfs.pod:263
31370 msgid "DOWNLOADING"
31374 #: ../src/guestfs.pod:265
31376 "Use L</guestfs_cat> to download small, text only files. This call is "
31377 "limited to files which are less than 2 MB and which cannot contain any ASCII "
31378 "NUL (C<\\0>) characters. However the API is very simple to use."
31382 #: ../src/guestfs.pod:269
31384 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
31385 "bit data, since it returns a (pointer, size) pair. However it is still "
31386 "limited to \"small\" files, less than 2 MB."
31390 #: ../src/guestfs.pod:273
31392 "L</guestfs_download> can be used to download any file, with no limits on "
31393 "content or size (even files larger than 4 GB)."
31397 #: ../src/guestfs.pod:276
31399 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
31403 #: ../src/guestfs.pod:279
31408 #: ../src/guestfs.pod:281
31410 "It's often the case that you want to write a file or files to the disk image."
31414 #: ../src/guestfs.pod:284
31416 "To write a small file with fixed content, use L</guestfs_write>. To create "
31417 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
31418 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
31419 "of other functions for creating test files, for example L</guestfs_fill> and "
31420 "L</guestfs_fill_pattern>."
31424 #: ../src/guestfs.pod:290
31426 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
31427 "file content or size (even files larger than 4 GB)."
31431 #: ../src/guestfs.pod:293
31433 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
31437 #: ../src/guestfs.pod:295
31439 "However the fastest way to upload I<large numbers of arbitrary files> is to "
31440 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
31441 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
31442 "in a predictable way (eg. adding it last after all other drives) then you "
31443 "can get the device name from L</guestfs_list_devices> and mount it directly "
31444 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
31445 "portable between kernel versions, and they don't support labels or UUIDs. "
31446 "If you want to pre-build an image or you need to mount it using a label or "
31447 "UUID, use an ISO image instead."
31451 #: ../src/guestfs.pod:306
31456 #: ../src/guestfs.pod:308
31458 "There are various different commands for copying between files and devices "
31459 "and in and out of the guest filesystem. These are summarised in the table "
31464 #: ../src/guestfs.pod:314
31465 msgid "B<file> to B<file>"
31469 #: ../src/guestfs.pod:316
31471 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
31472 "directories recursively."
31476 #: ../src/guestfs.pod:319
31477 msgid "B<file or device> to B<file or device>"
31481 #: ../src/guestfs.pod:321
31483 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
31484 "devices in the guest."
31488 #: ../src/guestfs.pod:324
31489 msgid "Example: duplicate the contents of an LV:"
31493 #: ../src/guestfs.pod:326
31496 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
31501 #: ../src/guestfs.pod:328
31503 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
31504 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
31505 "guestfs_copy_size>."
31509 #: ../src/guestfs.pod:332
31510 msgid "B<file on the host> to B<file or device>"
31514 #: ../src/guestfs.pod:334
31515 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
31519 #: ../src/guestfs.pod:336
31520 msgid "B<file or device> to B<file on the host>"
31524 #: ../src/guestfs.pod:338
31525 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
31529 #: ../src/guestfs.pod:342
31530 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
31534 #: ../src/guestfs.pod:344
31536 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
31537 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
31538 "appears you can only upload and download to files. However many Un*x-like "
31539 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
31540 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
31541 "and arbitrary file descriptor N."
31545 #: ../src/guestfs.pod:352
31546 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
31550 #: ../src/guestfs.pod:355
31553 " guestfs_download (g, filename, \"/dev/stdout\");\n"
31558 #: ../src/guestfs.pod:357
31559 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
31563 #: ../src/guestfs.pod:359
31566 " char devfd[64];\n"
31567 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
31568 " guestfs_tar_out (g, \"/\", devfd);\n"
31573 #: ../src/guestfs.pod:363
31574 msgid "LISTING FILES"
31578 #: ../src/guestfs.pod:365
31580 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
31581 "L<guestfish(1)>-equivalent command C<ll>)."
31585 #: ../src/guestfs.pod:368
31587 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
31588 "programs, as a flat list of strings."
31592 #: ../src/guestfs.pod:371
31594 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
31595 "directory, plus additional information about each one. It is more "
31596 "equivalent to using the L<readdir(3)> call on a local filesystem."
31600 #: ../src/guestfs.pod:375
31602 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
31606 #: ../src/guestfs.pod:378
31607 msgid "RUNNING COMMANDS"
31611 #: ../src/guestfs.pod:380
31613 "Although libguestfs is primarily an API for manipulating files inside guest "
31614 "images, we also provide some limited facilities for running commands inside "
31619 #: ../src/guestfs.pod:384
31620 msgid "There are many limitations to this:"
31624 #: ../src/guestfs.pod:390
31626 "The kernel version that the command runs under will be different from what "
31631 #: ../src/guestfs.pod:395
31633 "If the command needs to communicate with daemons, then most likely they "
31634 "won't be running."
31638 #: ../src/guestfs.pod:400
31639 msgid "The command will be running in limited memory."
31643 #: ../src/guestfs.pod:404
31645 "The network may not be available unless you enable it (see L</"
31646 "guestfs_set_network>)."
31650 #: ../src/guestfs.pod:409
31651 msgid "Only supports Linux guests (not Windows, BSD, etc)."
31655 #: ../src/guestfs.pod:413
31657 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
31661 #: ../src/guestfs.pod:418
31663 "For SELinux guests, you may need to enable SELinux and load policy first. "
31664 "See L</SELINUX> in this manpage."
31668 #: ../src/guestfs.pod:423
31670 "I<Security:> It is not safe to run commands from untrusted, possibly "
31671 "malicious guests. These commands may attempt to exploit your program by "
31672 "sending unexpected output. They could also try to exploit the Linux kernel "
31673 "or qemu provided by the libguestfs appliance. They could use the network "
31674 "provided by the libguestfs appliance to bypass ordinary network partitions "
31675 "and firewalls. They could use the elevated privileges or different SELinux "
31676 "context of your program to their advantage."
31680 #: ../src/guestfs.pod:432
31682 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
31683 "(a script which runs when the guest next boots normally), and to have this "
31684 "script run the commands you want in the normal context of the running guest, "
31685 "network security and so on. For information about other security issues, "
31686 "see L</SECURITY>."
31690 #: ../src/guestfs.pod:440
31692 "The two main API calls to run commands are L</guestfs_command> and L</"
31693 "guestfs_sh> (there are also variations)."
31697 #: ../src/guestfs.pod:443
31699 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
31700 "shell globs, redirections, etc will work."
31704 #: ../src/guestfs.pod:446
31705 msgid "CONFIGURATION FILES"
31709 #: ../src/guestfs.pod:448
31711 "To read and write configuration files in Linux guest filesystems, we "
31712 "strongly recommend using Augeas. For example, Augeas understands how to "
31713 "read and write, say, a Linux shadow password file or X.org configuration "
31714 "file, and so avoids you having to write that code."
31718 #: ../src/guestfs.pod:453
31720 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
31721 "document Augeas itself here because there is excellent documentation on the "
31722 "L<http://augeas.net/> website."
31726 #: ../src/guestfs.pod:457
31728 "If you don't want to use Augeas (you fool!) then try calling L</"
31729 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
31734 #: ../src/guestfs.pod:461
31739 #: ../src/guestfs.pod:463
31741 "We support SELinux guests. To ensure that labeling happens correctly in "
31742 "SELinux guests, you need to enable SELinux and load the guest's policy:"
31746 #: ../src/guestfs.pod:471
31747 msgid "Before launching, do:"
31751 #: ../src/guestfs.pod:473
31754 " guestfs_set_selinux (g, 1);\n"
31759 #: ../src/guestfs.pod:477
31761 "After mounting the guest's filesystem(s), load the policy. This is best "
31762 "done by running the L<load_policy(8)> command in the guest itself:"
31766 #: ../src/guestfs.pod:481
31769 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
31774 #: ../src/guestfs.pod:483
31776 "(Older versions of C<load_policy> require you to specify the name of the "
31781 #: ../src/guestfs.pod:488
31783 "Optionally, set the security context for the API. The correct security "
31784 "context to use can only be known by inspecting the guest. As an example:"
31788 #: ../src/guestfs.pod:492
31791 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
31796 #: ../src/guestfs.pod:496
31797 msgid "This will work for running commands and editing existing files."
31801 #: ../src/guestfs.pod:498
31803 "When new files are created, you may need to label them explicitly, for "
31804 "example by running the external command C<restorecon pathname>."
31808 #: ../src/guestfs.pod:502
31813 #: ../src/guestfs.pod:504
31815 "Certain calls are affected by the current file mode creation mask (the "
31816 "\"umask\"). In particular ones which create files or directories, such as "
31817 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
31818 "either the default mode that the file is created with or modifies the mode "
31823 #: ../src/guestfs.pod:510
31825 "The default umask is C<022>, so files are created with modes such as C<0644> "
31826 "and directories with C<0755>."
31830 #: ../src/guestfs.pod:513
31832 "There are two ways to avoid being affected by umask. Either set umask to 0 "
31833 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
31834 "guestfs_chmod> after creating each file or directory."
31838 #: ../src/guestfs.pod:517
31839 msgid "For more information about umask, see L<umask(2)>."
31843 #: ../src/guestfs.pod:521
31845 "Libguestfs allows you to access Linux guests which have been encrypted using "
31846 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
31847 "standard. This includes nearly all whole disk encryption systems used by "
31848 "modern Linux guests."
31852 #: ../src/guestfs.pod:527
31854 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
31855 "returns the string C<crypto_LUKS>)."
31859 #: ../src/guestfs.pod:530
31861 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
31862 "will require the passphrase!"
31866 #: ../src/guestfs.pod:533
31868 "Opening a LUKS device creates a new device mapper device called C</dev/"
31869 "mapper/mapname> (where C<mapname> is the string you supply to L</"
31870 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
31871 "from and encrypted to the underlying block device respectively."
31875 #: ../src/guestfs.pod:539
31877 "LVM volume groups on the device can be made visible by calling L</"
31878 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
31879 "(s) can now be mounted in the usual way."
31883 #: ../src/guestfs.pod:543
31885 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
31886 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
31887 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
31888 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
31889 "underlying encrypted block device)."
31893 #: ../src/guestfs.pod:550
31898 #: ../src/guestfs.pod:552
31900 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
31901 "contains operating systems, an install CD or a live CD. (These APIs used to "
31902 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
31903 "version 1.5.3 the most frequently used part of this library has been "
31904 "rewritten in C and moved into the core code)."
31908 #: ../src/guestfs.pod:559
31910 "Add all disks belonging to the unknown virtual machine and call L</"
31911 "guestfs_launch> in the usual way."
31915 #: ../src/guestfs.pod:562
31917 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
31918 "and certain heuristics, and returns a list of operating systems that were "
31919 "found. An empty list means none were found. A single element is the root "
31920 "filesystem of the operating system. For dual- or multi-boot guests, "
31921 "multiple roots can be returned, each one corresponding to a separate "
31922 "operating system. (Multi-boot virtual machines are extremely rare in the "
31923 "world of virtualization, but since this scenario can happen, we have built "
31924 "libguestfs to deal with it.)"
31928 #: ../src/guestfs.pod:571
31930 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
31931 "to get additional details about that operating system. For example, call L</"
31932 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
31933 "Windows and Linux-based operating systems respectively."
31937 #: ../src/guestfs.pod:577
31939 "Un*x-like and Linux-based operating systems usually consist of several "
31940 "filesystems which are mounted at boot time (for example, a separate boot "
31941 "partition mounted on C</boot>). The inspection rules are able to detect how "
31942 "filesystems correspond to mount points. Call "
31943 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
31944 "hash table like this example:"
31948 #: ../src/guestfs.pod:584
31951 " /boot => /dev/sda1\n"
31952 " / => /dev/vg_guest/lv_root\n"
31953 " /usr => /dev/vg_guest/lv_usr\n"
31958 #: ../src/guestfs.pod:588
31960 "The caller can then make calls to L</guestfs_mount_options> to mount the "
31961 "filesystems as suggested."
31965 #: ../src/guestfs.pod:591
31967 "Be careful to mount filesystems in the right order (eg. C</> before C</"
31968 "usr>). Sorting the keys of the hash by length, shortest first, should work."
31972 #: ../src/guestfs.pod:595
31974 "Inspection currently only works for some common operating systems. "
31975 "Contributors are welcome to send patches for other operating systems that we "
31976 "currently cannot detect."
31980 #: ../src/guestfs.pod:599
31982 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
31983 "for more details. The L</guestfs_inspect_os> function just ignores any "
31984 "encrypted devices."
31988 #: ../src/guestfs.pod:603
31990 "A note on the implementation: The call L</guestfs_inspect_os> performs "
31991 "inspection and caches the results in the guest handle. Subsequent calls to "
31992 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
31993 "read the disks. If you change the content of the guest disks, you can redo "
31994 "inspection by calling L</guestfs_inspect_os> again. (L</"
31995 "guestfs_inspect_list_applications> works a little differently from the other "
31996 "calls and does read the disks. See documentation for that function for "
32001 #: ../src/guestfs.pod:612
32002 msgid "INSPECTING INSTALL DISKS"
32006 #: ../src/guestfs.pod:614
32008 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
32013 #: ../src/guestfs.pod:617
32015 "Call L</guestfs_inspect_get_format> to return the format of the operating "
32016 "system, which currently can be C<installed> (a regular operating system) or "
32017 "C<installer> (some sort of install disk)."
32021 #: ../src/guestfs.pod:621
32023 "Further information is available about the operating system that can be "
32024 "installed using the regular inspection APIs like L</"
32025 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
32029 #: ../src/guestfs.pod:626
32031 "Some additional information specific to installer disks is also available "
32032 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
32033 "guestfs_inspect_is_multipart> calls."
32037 #: ../src/guestfs.pod:631
32038 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
32042 #: ../src/guestfs.pod:633
32044 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
32045 "ntfs-3g.org/> driver."
32049 #: ../src/guestfs.pod:636
32050 msgid "DRIVE LETTERS AND PATHS"
32054 #: ../src/guestfs.pod:638
32056 "DOS and Windows still use drive letters, and the filesystems are always "
32057 "treated as case insensitive by Windows itself, and therefore you might find "
32058 "a Windows configuration file referring to a path like C<c:\\windows"
32059 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
32060 "might be referred to as C</WINDOWS/System32>."
32064 #: ../src/guestfs.pod:644
32066 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
32067 "L</guestfs_inspect_get_drive_mappings>)"
32071 #: ../src/guestfs.pod:647
32073 "Dealing with separator characters (backslash vs forward slash) is outside "
32074 "the scope of libguestfs, but usually a simple character replacement will "
32079 #: ../src/guestfs.pod:651
32081 "To resolve the case insensitivity of paths, call L</"
32082 "guestfs_case_sensitive_path>."
32086 #: ../src/guestfs.pod:654
32087 msgid "ACCESSING THE WINDOWS REGISTRY"
32091 #: ../src/guestfs.pod:656
32093 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
32094 "files, through the library C<hivex> which is part of the libguestfs project "
32095 "although ships as a separate tarball. You have to locate and download the "
32096 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
32097 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
32098 "reg(1)> for more help on this issue."
32102 #: ../src/guestfs.pod:664
32103 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
32107 #: ../src/guestfs.pod:666
32109 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
32110 "provide something which looks like a Linux symlink. The way it tries to do "
32111 "the rewriting is described here:"
32115 #: ../src/guestfs.pod:670
32117 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
32122 #: ../src/guestfs.pod:672
32124 "The essential problem is that ntfs-3g simply does not have enough "
32125 "information to do a correct job. NTFS links can contain drive letters and "
32126 "references to external device GUIDs that ntfs-3g has no way of resolving. "
32127 "It is almost certainly the case that libguestfs callers should ignore what "
32128 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
32132 #: ../src/guestfs.pod:679
32134 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
32135 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
32136 "attribute, and read the raw reparse data from that (you can find the format "
32137 "documented in various places around the web)."
32141 #: ../src/guestfs.pod:684
32142 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
32146 #: ../src/guestfs.pod:686
32148 "There are other useful extended attributes that can be read from ntfs-3g "
32149 "filesystems (using L</guestfs_getxattr>). See:"
32153 #: ../src/guestfs.pod:689
32155 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
32159 #: ../src/guestfs.pod:691
32160 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
32164 #: ../src/guestfs.pod:693
32166 "Although we don't want to discourage you from using the C API, we will "
32167 "mention here that the same API is also available in other languages."
32171 #: ../src/guestfs.pod:696
32173 "The API is broadly identical in all supported languages. This means that "
32174 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
32175 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
32176 "OCaml. In other words, a straightforward, predictable isomorphism between "
32181 #: ../src/guestfs.pod:702
32183 "Error messages are automatically transformed into exceptions if the language "
32188 #: ../src/guestfs.pod:705
32190 "We don't try to \"object orientify\" parts of the API in OO languages, "
32191 "although contributors are welcome to write higher level APIs above what we "
32192 "provide in their favourite languages if they wish."
32196 #: ../src/guestfs.pod:711
32201 #: ../src/guestfs.pod:713
32203 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
32204 "identical to the C API. C++ classes and exceptions are not used."
32208 #: ../src/guestfs.pod:717
32213 #: ../src/guestfs.pod:719
32215 "The C# bindings are highly experimental. Please read the warnings at the "
32216 "top of C<csharp/Libguestfs.cs>."
32220 #: ../src/guestfs.pod:722
32225 #: ../src/guestfs.pod:724
32227 "This is the only language binding that is working but incomplete. Only "
32228 "calls which return simple integers have been bound in Haskell, and we are "
32229 "looking for help to complete this binding."
32233 #: ../src/guestfs.pod:728
32238 #: ../src/guestfs.pod:730
32240 "Full documentation is contained in the Javadoc which is distributed with "
32241 "libguestfs. For examples, see L<guestfs-java(3)>."
32245 #: ../src/guestfs.pod:733
32250 #: ../src/guestfs.pod:735
32251 msgid "See L<guestfs-ocaml(3)>."
32255 #: ../src/guestfs.pod:737
32260 #: ../src/guestfs.pod:739
32261 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
32265 #: ../src/guestfs.pod:741
32270 #: ../src/guestfs.pod:743
32272 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
32273 "the php-libguestfs package for your distribution."
32277 #: ../src/guestfs.pod:746
32278 msgid "The PHP binding only works correctly on 64 bit machines."
32282 #: ../src/guestfs.pod:748
32287 #: ../src/guestfs.pod:750
32288 msgid "See L<guestfs-python(3)>."
32292 #: ../src/guestfs.pod:752
32297 #: ../src/guestfs.pod:754
32298 msgid "See L<guestfs-ruby(3)>."
32302 #: ../src/guestfs.pod:756
32303 msgid "B<shell scripts>"
32307 #: ../src/guestfs.pod:758
32308 msgid "See L<guestfish(1)>."
32312 #: ../src/guestfs.pod:762
32313 msgid "LIBGUESTFS GOTCHAS"
32317 #: ../src/guestfs.pod:764
32319 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
32320 "system [...] that works in the way it is documented but is counterintuitive "
32321 "and almost invites mistakes.\""
32325 #: ../src/guestfs.pod:768
32327 "Since we developed libguestfs and the associated tools, there are several "
32328 "things we would have designed differently, but are now stuck with for "
32329 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
32330 "release, you can expect these to change. Beware of them."
32334 #: ../src/guestfs.pod:776
32335 msgid "Autosync / forgetting to sync."
32339 #: ../src/guestfs.pod:778
32341 "I<Update:> Autosync is enabled by default for all API users starting from "
32342 "libguestfs 1.5.24. This section only applies to older versions."
32346 #: ../src/guestfs.pod:781
32348 "When modifying a filesystem from C or another language, you B<must> unmount "
32349 "all filesystems and call L</guestfs_sync> explicitly before you close the "
32350 "libguestfs handle. You can also call:"
32354 #: ../src/guestfs.pod:785
32357 " guestfs_set_autosync (g, 1);\n"
32362 #: ../src/guestfs.pod:787
32364 "to have the unmount/sync done automatically for you when the handle 'g' is "
32365 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
32369 #: ../src/guestfs.pod:791
32371 "If you forget to do this, then it is entirely possible that your changes "
32372 "won't be written out, or will be partially written, or (very rarely) that "
32373 "you'll get disk corruption."
32377 #: ../src/guestfs.pod:795
32379 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
32380 "guestfish scripts that forget to sync will work just fine, which can make "
32381 "this very puzzling if you are trying to debug a problem."
32385 #: ../src/guestfs.pod:799
32386 msgid "Mount option C<-o sync> should not be the default."
32390 #: ../src/guestfs.pod:801
32392 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
32393 "However C<-o sync> does not add any reliability benefit, but does have a "
32394 "very large performance impact."
32398 #: ../src/guestfs.pod:805
32400 "The work around is to use L</guestfs_mount_options> and set the mount "
32401 "options that you actually want to use."
32405 #: ../src/guestfs.pod:808
32406 msgid "Read-only should be the default."
32410 #: ../src/guestfs.pod:810
32412 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
32413 "specify I<--rw> if you want to make changes to the image."
32417 #: ../src/guestfs.pod:813
32418 msgid "This would reduce the potential to corrupt live VM images."
32422 #: ../src/guestfs.pod:815
32424 "Note that many filesystems change the disk when you just mount and unmount, "
32425 "even if you didn't perform any writes. You need to use L</"
32426 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
32430 #: ../src/guestfs.pod:819
32431 msgid "guestfish command line is hard to use."
32435 #: ../src/guestfs.pod:821
32437 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
32438 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
32439 "exist, so it fails. In earlier versions of guestfish the error message was "
32440 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
32441 "we should have used C<guestfish -c command> to run commands."
32445 #: ../src/guestfs.pod:828
32446 msgid "guestfish megabyte modifiers don't work right on all commands"
32450 #: ../src/guestfs.pod:830
32452 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
32453 "other modifiers). What guestfish actually does is to multiply the number "
32454 "part by the modifier part and pass the result to the C API. However this "
32455 "doesn't work for a few APIs which aren't expecting bytes, but are already "
32456 "expecting some other unit (eg. megabytes)."
32460 #: ../src/guestfs.pod:837
32461 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
32465 #: ../src/guestfs.pod:839
32468 " lvcreate LV VG 100M\n"
32473 #: ../src/guestfs.pod:841
32475 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
32476 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
32477 "megabytes * megabytes) logical volume. The error message you get from this "
32478 "is also a little obscure."
32482 #: ../src/guestfs.pod:846
32484 "This could be fixed in the generator by specially marking parameters and "
32485 "return values which take bytes or other units."
32489 #: ../src/guestfs.pod:849
32490 msgid "Ambiguity between devices and paths"
32494 #: ../src/guestfs.pod:851
32496 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
32497 "sdb2>) and a similar pathname. A file might just happen to be called "
32498 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
32502 #: ../src/guestfs.pod:856
32504 "In the current API we usually resolve this ambiguity by having two separate "
32505 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
32506 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
32507 "detecting if the path supplied begins with C</dev/>."
32511 #: ../src/guestfs.pod:862
32513 "To avoid both the ambiguity and the need to duplicate some calls, we could "
32514 "make paths/devices into structured names. One way to do this would be to "
32515 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
32516 "aspect of grub. Another way would be to use a structured type, equivalent "
32517 "to this OCaml type:"
32521 #: ../src/guestfs.pod:868
32524 " type path = Path of string | Device of int | Partition of int * int\n"
32529 #: ../src/guestfs.pod:870
32530 msgid "which would allow you to pass arguments like:"
32534 #: ../src/guestfs.pod:872
32537 " Path \"/foo/bar\"\n"
32538 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
32539 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
32540 " Path \"/dev/sdb2\" (* not a device *)\n"
32545 #: ../src/guestfs.pod:877
32547 "As you can see there are still problems to resolve even with this "
32548 "representation. Also consider how it might work in guestfish."
32552 #: ../src/guestfs.pod:882
32553 msgid "KEYS AND PASSPHRASES"
32557 #: ../src/guestfs.pod:884
32559 "Certain libguestfs calls take a parameter that contains sensitive key "
32560 "material, passed in as a C string."
32564 #: ../src/guestfs.pod:887
32566 "In the future we would hope to change the libguestfs implementation so that "
32567 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
32568 "swap. However this is I<not> done at the moment, because of the complexity "
32569 "of such an implementation."
32573 #: ../src/guestfs.pod:892
32575 "Therefore you should be aware that any key parameter you pass to libguestfs "
32576 "might end up being written out to the swap partition. If this is a concern, "
32577 "scrub the swap partition or don't use libguestfs on encrypted devices."
32581 #: ../src/guestfs.pod:897
32582 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
32586 #: ../src/guestfs.pod:899
32588 "All high-level libguestfs actions are synchronous. If you want to use "
32589 "libguestfs asynchronously then you must create a thread."
32593 #: ../src/guestfs.pod:902
32595 "Only use the handle from a single thread. Either use the handle exclusively "
32596 "from one thread, or provide your own mutex so that two threads cannot issue "
32597 "calls on the same handle at the same time."
32601 #: ../src/guestfs.pod:906
32603 "See the graphical program guestfs-browser for one possible architecture for "
32604 "multithreaded programs using libvirt and libguestfs."
32608 #: ../src/guestfs.pod:909
32613 #: ../src/guestfs.pod:911
32615 "Libguestfs needs a supermin appliance, which it finds by looking along an "
32620 #: ../src/guestfs.pod:914
32622 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
32623 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
32627 #: ../src/guestfs.pod:917
32629 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
32630 "to change the directories that libguestfs will search in. The value is a "
32631 "colon-separated list of paths. The current directory is I<not> searched "
32632 "unless the path contains an empty element or C<.>. For example "
32633 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
32634 "then C</usr/lib/guestfs>."
32638 #: ../src/guestfs.pod:924
32639 msgid "QEMU WRAPPERS"
32643 #: ../src/guestfs.pod:926
32645 "If you want to compile your own qemu, run qemu from a non-standard location, "
32646 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
32651 #: ../src/guestfs.pod:930
32653 "There is one important rule to remember: you I<must C<exec qemu>> as the "
32654 "last command in the shell script (so that qemu replaces the shell and "
32655 "becomes the direct child of the libguestfs-using program). If you don't do "
32656 "this, then the qemu process won't be cleaned up correctly."
32660 #: ../src/guestfs.pod:935
32662 "Here is an example of a wrapper, where I have built my own copy of qemu from "
32667 #: ../src/guestfs.pod:938
32671 " qemudir=/home/rjones/d/qemu\n"
32672 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
32677 #: ../src/guestfs.pod:942
32679 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
32680 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
32685 #: ../src/guestfs.pod:946
32688 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
32693 #: ../src/guestfs.pod:948
32695 "Note that libguestfs also calls qemu with the -help and -version options in "
32696 "order to determine features."
32700 #: ../src/guestfs.pod:951
32701 msgid "ATTACHING TO RUNNING DAEMONS"
32705 #: ../src/guestfs.pod:953
32707 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
32708 "babies. Use with caution."
32712 #: ../src/guestfs.pod:956
32714 "I<Note (2):> This section explains how to attach to a running daemon from a "
32715 "low level perspective. For most users, simply using virt tools such as "
32716 "L<guestfish(1)> with the I<--live> option will \"just work\"."
32720 #: ../src/guestfs.pod:960
32721 msgid "Using guestfs_set_attach_method"
32725 #: ../src/guestfs.pod:962
32727 "By calling L</guestfs_set_attach_method> you can change how the library "
32728 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
32729 "ARCHITECTURE> for some background)."
32733 #: ../src/guestfs.pod:966
32735 "The normal attach method is C<appliance>, where a small appliance is created "
32736 "containing the daemon, and then the library connects to this."
32740 #: ../src/guestfs.pod:969
32742 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
32743 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
32744 "daemon over the Unix domain socket."
32748 #: ../src/guestfs.pod:973
32750 "The normal use for this is to connect to a running virtual machine that "
32751 "contains a C<guestfsd> daemon, and send commands so you can read and write "
32752 "files inside the live virtual machine."
32756 #: ../src/guestfs.pod:977
32757 msgid "Using guestfs_add_domain with live flag"
32761 #: ../src/guestfs.pod:979
32763 "L</guestfs_add_domain> provides some help for getting the correct attach "
32764 "method. If you pass the C<live> option to this function, then (if the "
32765 "virtual machine is running) it will examine the libvirt XML looking for a "
32766 "virtio-serial channel to connect to:"
32770 #: ../src/guestfs.pod:985
32777 " <channel type='unix'>\n"
32778 " <source mode='bind' path='/path/to/socket'/>\n"
32779 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
32788 #: ../src/guestfs.pod:997
32790 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
32791 "method to C<unix:/path/to/socket>."
32795 #: ../src/guestfs.pod:1000
32797 "Some of the libguestfs tools (including guestfish) support a I<--live> "
32798 "option which is passed through to L</guestfs_add_domain> thus allowing you "
32799 "to attach to and modify live virtual machines."
32803 #: ../src/guestfs.pod:1004
32805 "The virtual machine needs to have been set up beforehand so that it has the "
32806 "virtio-serial channel and so that guestfsd is running inside it."
32810 #: ../src/guestfs.pod:1008
32811 msgid "ABI GUARANTEE"
32815 #: ../src/guestfs.pod:1010
32817 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
32818 "actions as outlined in this section. Although we will deprecate some "
32819 "actions, for example if they get replaced by newer calls, we will keep the "
32820 "old actions forever. This allows you the developer to program in confidence "
32821 "against the libguestfs API."
32825 #: ../src/guestfs.pod:1016
32826 msgid "BLOCK DEVICE NAMING"
32830 #: ../src/guestfs.pod:1018
32832 "In the kernel there is now quite a profusion of schemata for naming block "
32833 "devices (in this context, by I<block device> I mean a physical or virtual "
32834 "hard drive). The original Linux IDE driver used names starting with C</dev/"
32835 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
32836 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
32837 "for the old IDE driver (particularly for SATA devices) those devices also "
32838 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
32839 "paravirtualized drivers. This has created several different naming systems, "
32840 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
32844 #: ../src/guestfs.pod:1030
32846 "As discussed above, libguestfs uses a qemu appliance running an embedded "
32847 "Linux kernel to access block devices. We can run a variety of appliances "
32848 "based on a variety of Linux kernels."
32852 #: ../src/guestfs.pod:1034
32854 "This causes a problem for libguestfs because many API calls use device or "
32855 "partition names. Working scripts and the recipe (example) scripts that we "
32856 "make available over the internet could fail if the naming scheme changes."
32860 #: ../src/guestfs.pod:1039
32862 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
32863 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
32864 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
32865 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
32869 #: ../src/guestfs.pod:1045
32871 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
32872 "L</guestfs_list_partitions> and similar calls return the true names of the "
32873 "devices and partitions as known to the appliance."
32877 #: ../src/guestfs.pod:1050
32878 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
32882 #: ../src/guestfs.pod:1052
32884 "Usually this translation is transparent. However in some (very rare) cases "
32885 "you may need to know the exact algorithm. Such cases include where you use "
32886 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
32887 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
32891 #: ../src/guestfs.pod:1058
32893 "The algorithm is applied only to I<parameters> which are known to be either "
32894 "device or partition names. Return values from functions such as L</"
32895 "guestfs_list_devices> are never changed."
32899 #: ../src/guestfs.pod:1066
32900 msgid "Is the string a parameter which is a device or partition name?"
32904 #: ../src/guestfs.pod:1070
32905 msgid "Does the string begin with C</dev/sd>?"
32909 #: ../src/guestfs.pod:1074
32911 "Does the named device exist? If so, we use that device. However if I<not> "
32912 "then we continue with this algorithm."
32916 #: ../src/guestfs.pod:1079
32917 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
32921 #: ../src/guestfs.pod:1081
32922 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
32926 #: ../src/guestfs.pod:1083
32927 msgid "If that named device exists, use it. If not, continue."
32931 #: ../src/guestfs.pod:1087
32932 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
32936 #: ../src/guestfs.pod:1089
32937 msgid "If that named device exists, use it. If not, return an error."
32941 #: ../src/guestfs.pod:1093
32942 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
32946 #: ../src/guestfs.pod:1095
32948 "Although the standard naming scheme and automatic translation is useful for "
32949 "simple programs and guestfish scripts, for larger programs it is best not to "
32950 "rely on this mechanism."
32954 #: ../src/guestfs.pod:1099
32956 "Where possible for maximum future portability programs using libguestfs "
32957 "should use these future-proof techniques:"
32961 #: ../src/guestfs.pod:1106
32963 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
32964 "device names, and then use those names directly."
32968 #: ../src/guestfs.pod:1109
32970 "Since those device names exist by definition, they will never be translated."
32974 #: ../src/guestfs.pod:1114
32976 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
32977 "filesystem labels."
32981 #: ../src/guestfs.pod:1119
32986 #: ../src/guestfs.pod:1121
32988 "This section discusses security implications of using libguestfs, "
32989 "particularly with untrusted or malicious guests or disk images."
32993 #: ../src/guestfs.pod:1124
32994 msgid "GENERAL SECURITY CONSIDERATIONS"
32998 #: ../src/guestfs.pod:1126
33000 "Be careful with any files or data that you download from a guest (by "
33001 "\"download\" we mean not just the L</guestfs_download> command but any "
33002 "command that reads files, filenames, directories or anything else from a "
33003 "disk image). An attacker could manipulate the data to fool your program "
33004 "into doing the wrong thing. Consider cases such as:"
33008 #: ../src/guestfs.pod:1136
33009 msgid "the data (file etc) not being present"
33013 #: ../src/guestfs.pod:1140
33014 msgid "being present but empty"
33018 #: ../src/guestfs.pod:1144
33019 msgid "being much larger than normal"
33023 #: ../src/guestfs.pod:1148
33024 msgid "containing arbitrary 8 bit data"
33028 #: ../src/guestfs.pod:1152
33029 msgid "being in an unexpected character encoding"
33033 #: ../src/guestfs.pod:1156
33034 msgid "containing homoglyphs."
33038 #: ../src/guestfs.pod:1160
33039 msgid "SECURITY OF MOUNTING FILESYSTEMS"
33043 #: ../src/guestfs.pod:1162
33045 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
33046 "(VFS) module can sometimes be escalated into exploits by deliberately "
33047 "creating a malicious, malformed filesystem. These exploits are very severe "
33048 "for two reasons. Firstly there are very many filesystem drivers in the "
33049 "kernel, and many of them are infrequently used and not much developer "
33050 "attention has been paid to the code. Linux userspace helps potential "
33051 "crackers by detecting the filesystem type and automatically choosing the "
33052 "right VFS driver, even if that filesystem type is obscure or unexpected for "
33053 "the administrator. Secondly, a kernel-level exploit is like a local root "
33054 "exploit (worse in some ways), giving immediate and total access to the "
33055 "system right down to the hardware level."
33059 #: ../src/guestfs.pod:1175
33061 "That explains why you should never mount a filesystem from an untrusted "
33062 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
33063 "inside a qemu virtual machine, usually running as a non-root user. The "
33064 "attacker would need to write a filesystem which first exploited the kernel, "
33065 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
33066 "the libguestfs protocol, and finally to be as serious as the host kernel "
33067 "exploit it would need to escalate its privileges to root. This multi-step "
33068 "escalation, performed by a static piece of data, is thought to be extremely "
33069 "hard to do, although we never say 'never' about security issues."
33073 #: ../src/guestfs.pod:1186
33075 "In any case callers can reduce the attack surface by forcing the filesystem "
33076 "type when mounting (use L</guestfs_mount_vfs>)."
33080 #: ../src/guestfs.pod:1189
33081 msgid "PROTOCOL SECURITY"
33085 #: ../src/guestfs.pod:1191
33087 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
33088 "defined upper message size. However a program that uses libguestfs must "
33089 "also take care - for example you can write a program that downloads a binary "
33090 "from a disk image and executes it locally, and no amount of protocol "
33091 "security will save you from the consequences."
33095 #: ../src/guestfs.pod:1197
33096 msgid "INSPECTION SECURITY"
33100 #: ../src/guestfs.pod:1199
33102 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
33103 "directly from the guest, and these could contain any 8 bit data. Callers "
33104 "should be careful to escape these before printing them to a structured file "
33105 "(for example, use HTML escaping if creating a web page)."
33109 #: ../src/guestfs.pod:1205
33111 "Guest configuration may be altered in unusual ways by the administrator of "
33112 "the virtual machine, and may not reflect reality (particularly for untrusted "
33113 "or actively malicious guests). For example we parse the hostname from "
33114 "configuration files like C</etc/sysconfig/network> that we find in the "
33115 "guest, but the guest administrator can easily manipulate these files to "
33116 "provide the wrong hostname."
33120 #: ../src/guestfs.pod:1213
33122 "The inspection API parses guest configuration using two external libraries: "
33123 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
33124 "designed to be robust in the face of malicious data, although denial of "
33125 "service attacks are still possible, for example with oversized configuration "
33130 #: ../src/guestfs.pod:1219
33131 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
33135 #: ../src/guestfs.pod:1221
33137 "Be very cautious about running commands from the guest. By running a "
33138 "command in the guest, you are giving CPU time to a binary that you do not "
33139 "control, under the same user account as the library, albeit wrapped in qemu "
33140 "virtualization. More information and alternatives can be found in the "
33141 "section L</RUNNING COMMANDS>."
33145 #: ../src/guestfs.pod:1227
33146 msgid "CVE-2010-3851"
33150 #: ../src/guestfs.pod:1229
33151 msgid "https://bugzilla.redhat.com/642934"
33155 #: ../src/guestfs.pod:1231
33157 "This security bug concerns the automatic disk format detection that qemu "
33158 "does on disk images."
33162 #: ../src/guestfs.pod:1234
33164 "A raw disk image is just the raw bytes, there is no header. Other disk "
33165 "images like qcow2 contain a special header. Qemu deals with this by looking "
33166 "for one of the known headers, and if none is found then assuming the disk "
33167 "image must be raw."
33171 #: ../src/guestfs.pod:1239
33173 "This allows a guest which has been given a raw disk image to write some "
33174 "other header. At next boot (or when the disk image is accessed by "
33175 "libguestfs) qemu would do autodetection and think the disk image format was, "
33176 "say, qcow2 based on the header written by the guest."
33180 #: ../src/guestfs.pod:1244
33182 "This in itself would not be a problem, but qcow2 offers many features, one "
33183 "of which is to allow a disk image to refer to another image (called the "
33184 "\"backing disk\"). It does this by placing the path to the backing disk "
33185 "into the qcow2 header. This path is not validated and could point to any "
33186 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
33187 "\"holes\" in the qcow2 disk image, which of course is completely under the "
33188 "control of the attacker."
33192 #: ../src/guestfs.pod:1252
33194 "In libguestfs this is rather hard to exploit except under two circumstances:"
33198 #: ../src/guestfs.pod:1259
33199 msgid "You have enabled the network or have opened the disk in write mode."
33203 #: ../src/guestfs.pod:1263
33205 "You are also running untrusted code from the guest (see L</RUNNING "
33210 #: ../src/guestfs.pod:1268
33212 "The way to avoid this is to specify the expected disk format when adding "
33213 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
33214 "should always do this if the disk is raw format, and it's a good idea for "
33219 #: ../src/guestfs.pod:1273
33221 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
33222 "format is fetched from libvirt and passed through."
33226 #: ../src/guestfs.pod:1276
33228 "For libguestfs tools, use the I<--format> command line parameter as "
33233 #: ../src/guestfs.pod:1279
33234 msgid "CONNECTION MANAGEMENT"
33238 #: ../src/guestfs.pod:1281
33239 msgid "guestfs_h *"
33243 #: ../src/guestfs.pod:1283
33245 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
33246 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
33247 "handle and release all resources used."
33251 #: ../src/guestfs.pod:1287
33253 "For information on using multiple handles and threads, see the section L</"
33254 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
33258 #: ../src/guestfs.pod:1290
33259 msgid "guestfs_create"
33263 #: ../src/guestfs.pod:1292
33266 " guestfs_h *guestfs_create (void);\n"
33271 #: ../src/guestfs.pod:1294
33272 msgid "Create a connection handle."
33276 #: ../src/guestfs.pod:1296
33278 "On success this returns a non-NULL pointer to a handle. On error it returns "
33283 #: ../src/guestfs.pod:1299
33285 "You have to \"configure\" the handle after creating it. This includes "
33286 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
33287 "handle at least once."
33291 #: ../src/guestfs.pod:1303
33292 msgid "After configuring the handle, you have to call L</guestfs_launch>."
33296 #: ../src/guestfs.pod:1305
33298 "You may also want to configure error handling for the handle. See the L</"
33299 "ERROR HANDLING> section below."
33303 #: ../src/guestfs.pod:1308
33304 msgid "guestfs_close"
33308 #: ../src/guestfs.pod:1310
33311 " void guestfs_close (guestfs_h *g);\n"
33316 #: ../src/guestfs.pod:1312
33317 msgid "This closes the connection handle and frees up all resources used."
33321 #: ../src/guestfs.pod:1314
33323 "If autosync was set on the handle and the handle was launched, then this "
33324 "implicitly calls various functions to unmount filesystems and sync the "
33325 "disk. See L</guestfs_set_autosync> for more details."
33329 #: ../src/guestfs.pod:1318
33330 msgid "If a close callback was set on the handle, then it is called."
33334 #: ../src/guestfs.pod:1320
33335 msgid "ERROR HANDLING"
33339 #: ../src/guestfs.pod:1322
33341 "API functions can return errors. For example, almost all functions that "
33342 "return C<int> will return C<-1> to indicate an error."
33346 #: ../src/guestfs.pod:1325
33348 "Additional information is available for errors: an error message string and "
33349 "optionally an error number (errno) if the thing that failed was a system "
33354 #: ../src/guestfs.pod:1329
33356 "You can get at the additional information about the last error on the handle "
33357 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
33358 "up an error handler with L</guestfs_set_error_handler>."
33362 #: ../src/guestfs.pod:1334
33364 "When the handle is created, a default error handler is installed which "
33365 "prints the error message string to C<stderr>. For small short-running "
33366 "command line programs it is sufficient to do:"
33370 #: ../src/guestfs.pod:1338
33373 " if (guestfs_launch (g) == -1)\n"
33374 " exit (EXIT_FAILURE);\n"
33379 #: ../src/guestfs.pod:1341
33381 "since the default error handler will ensure that an error message has been "
33382 "printed to C<stderr> before the program exits."
33386 #: ../src/guestfs.pod:1344
33388 "For other programs the caller will almost certainly want to install an "
33389 "alternate error handler or do error handling in-line like this:"
33393 #: ../src/guestfs.pod:1347
33396 " /* This disables the default behaviour of printing errors\n"
33398 " guestfs_set_error_handler (g, NULL, NULL);\n"
33403 #: ../src/guestfs.pod:1351
33406 " if (guestfs_launch (g) == -1) {\n"
33407 " /* Examine the error message and print it etc. */\n"
33408 " char *msg = guestfs_last_error (g);\n"
33409 " int errnum = guestfs_last_errno (g);\n"
33410 " fprintf (stderr, \"%s\", msg);\n"
33411 " if (errnum != 0)\n"
33412 " fprintf (stderr, \": %s\", strerror (errnum));\n"
33413 " fprintf (stderr, \"\\n\");\n"
33420 #: ../src/guestfs.pod:1362
33422 "Out of memory errors are handled differently. The default action is to call "
33423 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
33424 "guestfs_set_out_of_memory_handler>."
33428 #: ../src/guestfs.pod:1366
33430 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
33431 "because there is no handle if this happens there is no way to get additional "
33432 "error information. However L</guestfs_create> is supposed to be a "
33433 "lightweight operation which can only fail because of insufficient memory (it "
33434 "returns NULL in this case)."
33438 #: ../src/guestfs.pod:1372
33439 msgid "guestfs_last_error"
33443 #: ../src/guestfs.pod:1374
33446 " const char *guestfs_last_error (guestfs_h *g);\n"
33451 #: ../src/guestfs.pod:1376
33453 "This returns the last error message that happened on C<g>. If there has not "
33454 "been an error since the handle was created, then this returns C<NULL>."
33458 #: ../src/guestfs.pod:1380
33460 "The lifetime of the returned string is until the next error occurs, or L</"
33461 "guestfs_close> is called."
33465 #: ../src/guestfs.pod:1383
33466 msgid "guestfs_last_errno"
33470 #: ../src/guestfs.pod:1385
33473 " int guestfs_last_errno (guestfs_h *g);\n"
33478 #: ../src/guestfs.pod:1387
33479 msgid "This returns the last error number (errno) that happened on C<g>."
33483 #: ../src/guestfs.pod:1389
33484 msgid "If successful, an errno integer not equal to zero is returned."
33488 #: ../src/guestfs.pod:1391
33490 "If no error, this returns 0. This call can return 0 in three situations:"
33494 #: ../src/guestfs.pod:1398
33495 msgid "There has not been any error on the handle."
33499 #: ../src/guestfs.pod:1402
33501 "There has been an error but the errno was meaningless. This corresponds to "
33502 "the case where the error did not come from a failed system call, but for "
33503 "some other reason."
33507 #: ../src/guestfs.pod:1408
33509 "There was an error from a failed system call, but for some reason the errno "
33510 "was not captured and returned. This usually indicates a bug in libguestfs."
33514 #: ../src/guestfs.pod:1414
33516 "Libguestfs tries to convert the errno from inside the applicance into a "
33517 "corresponding errno for the caller (not entirely trivial: the appliance "
33518 "might be running a completely different operating system from the library "
33519 "and error numbers are not standardized across Un*xen). If this could not be "
33520 "done, then the error is translated to C<EINVAL>. In practice this should "
33521 "only happen in very rare circumstances."
33525 #: ../src/guestfs.pod:1422
33526 msgid "guestfs_set_error_handler"
33530 #: ../src/guestfs.pod:1424
33533 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
33535 " const char *msg);\n"
33536 " void guestfs_set_error_handler (guestfs_h *g,\n"
33537 " guestfs_error_handler_cb cb,\n"
33538 " void *opaque);\n"
33543 #: ../src/guestfs.pod:1431
33545 "The callback C<cb> will be called if there is an error. The parameters "
33546 "passed to the callback are an opaque data pointer and the error message "
33551 #: ../src/guestfs.pod:1435
33553 "C<errno> is not passed to the callback. To get that the callback must call "
33554 "L</guestfs_last_errno>."
33558 #: ../src/guestfs.pod:1438
33560 "Note that the message string C<msg> is freed as soon as the callback "
33561 "function returns, so if you want to stash it somewhere you must make your "
33566 #: ../src/guestfs.pod:1442
33567 msgid "The default handler prints messages on C<stderr>."
33571 #: ../src/guestfs.pod:1444
33572 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
33576 #: ../src/guestfs.pod:1446
33577 msgid "guestfs_get_error_handler"
33581 #: ../src/guestfs.pod:1448
33584 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
33585 " void **opaque_rtn);\n"
33590 #: ../src/guestfs.pod:1451
33591 msgid "Returns the current error handler callback."
33595 #: ../src/guestfs.pod:1453
33596 msgid "guestfs_set_out_of_memory_handler"
33600 #: ../src/guestfs.pod:1455
33603 " typedef void (*guestfs_abort_cb) (void);\n"
33604 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
33605 " guestfs_abort_cb);\n"
33610 #: ../src/guestfs.pod:1459
33612 "The callback C<cb> will be called if there is an out of memory situation. "
33613 "I<Note this callback must not return>."
33617 #: ../src/guestfs.pod:1462
33618 msgid "The default is to call L<abort(3)>."
33622 #: ../src/guestfs.pod:1464
33624 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
33628 #: ../src/guestfs.pod:1467
33629 msgid "guestfs_get_out_of_memory_handler"
33633 #: ../src/guestfs.pod:1469
33636 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
33641 #: ../src/guestfs.pod:1471
33642 msgid "This returns the current out of memory handler."
33646 #: ../src/guestfs.pod:1473
33651 #: ../src/guestfs.pod:1477
33656 #: ../src/guestfs.pod:1479
33661 #: ../src/guestfs.pod:1481
33662 msgid "AVAILABILITY"
33666 #: ../src/guestfs.pod:1483
33667 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
33671 #: ../src/guestfs.pod:1485
33673 "Using L</guestfs_available> you can test availability of the following "
33674 "groups of functions. This test queries the appliance to see if the "
33675 "appliance you are currently using supports the functionality."
33679 #: ../src/guestfs.pod:1490
33680 msgid "@AVAILABILITY@"
33684 #: ../src/guestfs.pod:1492
33685 msgid "GUESTFISH supported COMMAND"
33689 #: ../src/guestfs.pod:1494
33691 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
33692 "prints out the available groups and whether they are supported by this build "
33693 "of libguestfs. Note however that you have to do C<run> first."
33697 #: ../src/guestfs.pod:1499
33698 msgid "SINGLE CALLS AT COMPILE TIME"
33702 #: ../src/guestfs.pod:1501
33704 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
33705 "function, such as:"
33709 #: ../src/guestfs.pod:1504
33712 " #define LIBGUESTFS_HAVE_DD 1\n"
33717 #: ../src/guestfs.pod:1506
33718 msgid "if L</guestfs_dd> is available."
33722 #: ../src/guestfs.pod:1508
33724 "Before version 1.5.8, if you needed to test whether a single libguestfs "
33725 "function is available at compile time, we recommended using build tools such "
33726 "as autoconf or cmake. For example in autotools you could use:"
33730 #: ../src/guestfs.pod:1513
33733 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
33734 " AC_CHECK_FUNCS([guestfs_dd])\n"
33739 #: ../src/guestfs.pod:1516
33741 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
33746 #: ../src/guestfs.pod:1519
33747 msgid "SINGLE CALLS AT RUN TIME"
33751 #: ../src/guestfs.pod:1521
33753 "Testing at compile time doesn't guarantee that a function really exists in "
33754 "the library. The reason is that you might be dynamically linked against a "
33755 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
33756 "This situation unfortunately results in a segmentation fault, which is a "
33757 "shortcoming of the C dynamic linking system itself."
33761 #: ../src/guestfs.pod:1528
33763 "You can use L<dlopen(3)> to test if a function is available at run time, as "
33764 "in this example program (note that you still need the compile time check as "
33769 #: ../src/guestfs.pod:1532
33772 " #include <stdio.h>\n"
33773 " #include <stdlib.h>\n"
33774 " #include <unistd.h>\n"
33775 " #include <dlfcn.h>\n"
33776 " #include <guestfs.h>\n"
33781 #: ../src/guestfs.pod:1538
33786 " #ifdef LIBGUESTFS_HAVE_DD\n"
33788 " int has_function;\n"
33793 #: ../src/guestfs.pod:1544
33796 " /* Test if the function guestfs_dd is really available. */\n"
33797 " dl = dlopen (NULL, RTLD_LAZY);\n"
33799 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
33800 " exit (EXIT_FAILURE);\n"
33802 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
33808 #: ../src/guestfs.pod:1553
33811 " if (!has_function)\n"
33812 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
33814 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
33815 " /* Now it's safe to call\n"
33816 " guestfs_dd (g, \"foo\", \"bar\");\n"
33820 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
33827 #: ../src/guestfs.pod:1566
33829 "You may think the above is an awful lot of hassle, and it is. There are "
33830 "other ways outside of the C linking system to ensure that this kind of "
33831 "incompatibility never arises, such as using package versioning:"
33835 #: ../src/guestfs.pod:1571
33838 " Requires: libguestfs >= 1.0.80\n"
33843 #: ../src/guestfs.pod:1573
33844 msgid "CALLS WITH OPTIONAL ARGUMENTS"
33848 #: ../src/guestfs.pod:1575
33850 "A recent feature of the API is the introduction of calls which take optional "
33851 "arguments. In C these are declared 3 ways. The main way is as a call which "
33852 "takes variable arguments (ie. C<...>), as in this example:"
33856 #: ../src/guestfs.pod:1580
33859 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
33864 #: ../src/guestfs.pod:1582
33866 "Call this with a list of optional arguments, terminated by C<-1>. So to "
33867 "call with no optional arguments specified:"
33871 #: ../src/guestfs.pod:1585
33874 " guestfs_add_drive_opts (g, filename, -1);\n"
33879 #: ../src/guestfs.pod:1587
33880 msgid "With a single optional argument:"
33884 #: ../src/guestfs.pod:1589
33887 " guestfs_add_drive_opts (g, filename,\n"
33888 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33894 #: ../src/guestfs.pod:1593
33899 #: ../src/guestfs.pod:1595
33902 " guestfs_add_drive_opts (g, filename,\n"
33903 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
33904 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33910 #: ../src/guestfs.pod:1600
33912 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
33917 #: ../src/guestfs.pod:1603
33918 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
33922 #: ../src/guestfs.pod:1605
33924 "The second variant has the same name with the suffix C<_va>, which works the "
33925 "same way but takes a C<va_list>. See the C manual for details. For the "
33926 "example function, this is declared:"
33930 #: ../src/guestfs.pod:1609
33933 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
33934 " va_list args);\n"
33939 #: ../src/guestfs.pod:1612
33940 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
33944 #: ../src/guestfs.pod:1614
33946 "The third variant is useful where you need to construct these calls. You "
33947 "pass in a structure where you fill in the optional fields. The structure "
33948 "has a bitmask as the first element which you must set to indicate which "
33949 "fields you have filled in. For our example function the structure and call "
33954 #: ../src/guestfs.pod:1620
33957 " struct guestfs_add_drive_opts_argv {\n"
33958 " uint64_t bitmask;\n"
33960 " const char *format;\n"
33963 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
33964 " const struct guestfs_add_drive_opts_argv *optargs);\n"
33969 #: ../src/guestfs.pod:1629
33970 msgid "You could call it like this:"
33974 #: ../src/guestfs.pod:1631
33977 " struct guestfs_add_drive_opts_argv optargs = {\n"
33978 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
33979 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
33980 " .readonly = 1,\n"
33981 " .format = \"qcow2\"\n"
33987 #: ../src/guestfs.pod:1638
33990 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
33995 #: ../src/guestfs.pod:1646
33996 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
34000 #: ../src/guestfs.pod:1651
34001 msgid "You do not need to fill in all fields of the structure."
34005 #: ../src/guestfs.pod:1655
34007 "There must be a one-to-one correspondence between fields of the structure "
34008 "that are filled in, and bits set in the bitmask."
34012 #: ../src/guestfs.pod:1660
34013 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
34017 #: ../src/guestfs.pod:1662
34019 "In other languages, optional arguments are expressed in the way that is "
34020 "natural for that language. We refer you to the language-specific "
34021 "documentation for more details on that."
34025 #: ../src/guestfs.pod:1666
34026 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
34030 #: ../src/guestfs.pod:1668
34031 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
34035 #: ../src/guestfs.pod:1670
34037 "B<Note:> This section documents the generic event mechanism introduced in "
34038 "libguestfs 1.10, which you should use in new code if possible. The old "
34039 "functions C<guestfs_set_log_message_callback>, "
34040 "C<guestfs_set_subprocess_quit_callback>, "
34041 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
34042 "C<guestfs_set_progress_callback> are no longer documented in this manual "
34043 "page. Because of the ABI guarantee, the old functions continue to work."
34047 #: ../src/guestfs.pod:1679
34049 "Handles generate events when certain things happen, such as log messages "
34050 "being generated, progress messages during long-running operations, or the "
34051 "handle being closed. The API calls described below let you register a "
34052 "callback to be called when events happen. You can register multiple "
34053 "callbacks (for the same, different or overlapping sets of events), and "
34054 "individually remove callbacks. If callbacks are not removed, then they "
34055 "remain in force until the handle is closed."
34059 #: ../src/guestfs.pod:1687
34061 "In the current implementation, events are only generated synchronously: that "
34062 "means that events (and hence callbacks) can only happen while you are in the "
34063 "middle of making another libguestfs call. The callback is called in the "
34068 #: ../src/guestfs.pod:1692
34070 "Events may contain a payload, usually nothing (void), an array of 64 bit "
34071 "unsigned integers, or a message buffer. Payloads are discussed later on."
34075 #: ../src/guestfs.pod:1696
34076 msgid "CLASSES OF EVENTS"
34080 #: ../src/guestfs.pod:1700
34081 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
34085 #: ../src/guestfs.pod:1703
34087 "The callback function will be called while the handle is being closed "
34088 "(synchronously from L</guestfs_close>)."
34092 #: ../src/guestfs.pod:1706
34094 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
34095 "handles that are open when the program exits. This means that this callback "
34096 "might be called indirectly from L<exit(3)>, which can cause unexpected "
34097 "problems in higher-level languages (eg. if your HLL interpreter has already "
34098 "been cleaned up by the time this is called, and if your callback then jumps "
34099 "into some HLL function)."
34103 #: ../src/guestfs.pod:1713
34105 "If no callback is registered: the handle is closed without any callback "
34110 #: ../src/guestfs.pod:1716
34111 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
34115 #: ../src/guestfs.pod:1719
34117 "The callback function will be called when the child process quits, either "
34118 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
34119 "corresponds to a transition from any state to the CONFIG state)."
34123 #: ../src/guestfs.pod:1723 ../src/guestfs.pod:1732
34124 msgid "If no callback is registered: the event is ignored."
34128 #: ../src/guestfs.pod:1725
34129 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
34133 #: ../src/guestfs.pod:1728
34135 "The callback function will be called when the child process becomes ready "
34136 "first time after it has been launched. (This corresponds to a transition "
34137 "from LAUNCHING to the READY state)."
34141 #: ../src/guestfs.pod:1734
34142 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
34146 #: ../src/guestfs.pod:1737
34148 "Some long-running operations can generate progress messages. If this "
34149 "callback is registered, then it will be called each time a progress message "
34150 "is generated (usually two seconds after the operation started, and three "
34151 "times per second thereafter until it completes, although the frequency may "
34152 "change in future versions)."
34156 #: ../src/guestfs.pod:1743
34158 "The callback receives in the payload four unsigned 64 bit numbers which are "
34159 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
34163 #: ../src/guestfs.pod:1746
34165 "The units of C<total> are not defined, although for some operations C<total> "
34166 "may relate in some way to the amount of data to be transferred (eg. in bytes "
34167 "or megabytes), and C<position> may be the portion which has been transferred."
34171 #: ../src/guestfs.pod:1751
34172 msgid "The only defined and stable parts of the API are:"
34176 #: ../src/guestfs.pod:1757
34178 "The callback can display to the user some type of progress bar or indicator "
34179 "which shows the ratio of C<position>:C<total>."
34183 #: ../src/guestfs.pod:1762
34184 msgid "0 E<lt>= C<position> E<lt>= C<total>"
34188 #: ../src/guestfs.pod:1766
34190 "If any progress notification is sent during a call, then a final progress "
34191 "notification is always sent when C<position> = C<total> (I<unless> the call "
34192 "fails with an error)."
34196 #: ../src/guestfs.pod:1770
34198 "This is to simplify caller code, so callers can easily set the progress "
34199 "indicator to \"100%\" at the end of the operation, without requiring special "
34200 "code to detect this case."
34204 #: ../src/guestfs.pod:1776
34206 "For some calls we are unable to estimate the progress of the call, but we "
34207 "can still generate progress messages to indicate activity. This is known as "
34208 "\"pulse mode\", and is directly supported by certain progress bar "
34209 "implementations (eg. GtkProgressBar)."
34213 #: ../src/guestfs.pod:1781
34215 "For these calls, zero or more progress messages are generated with "
34216 "C<position = 0> and C<total = 1>, followed by a final message with "
34217 "C<position = total = 1>."
34221 #: ../src/guestfs.pod:1785
34223 "As noted above, if the call fails with an error then the final message may "
34224 "not be generated."
34228 #: ../src/guestfs.pod:1790
34230 "The callback also receives the procedure number (C<proc_nr>) and serial "
34231 "number (C<serial>) of the call. These are only useful for debugging "
34232 "protocol issues, and the callback can normally ignore them. The callback "
34233 "may want to print these numbers in error messages or debugging messages."
34237 #: ../src/guestfs.pod:1796
34238 msgid "If no callback is registered: progress messages are discarded."
34242 #: ../src/guestfs.pod:1798
34243 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
34247 #: ../src/guestfs.pod:1801
34249 "The callback function is called whenever a log message is generated by qemu, "
34250 "the appliance kernel, guestfsd (daemon), or utility programs."
34254 #: ../src/guestfs.pod:1804
34256 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
34257 "guestfs_launch>) then additional debug messages are generated."
34261 #: ../src/guestfs.pod:1807 ../src/guestfs.pod:1821
34263 "If no callback is registered: the messages are discarded unless the verbose "
34264 "flag is set in which case they are sent to stderr. You can override the "
34265 "printing of verbose messages to stderr by setting up a callback."
34269 #: ../src/guestfs.pod:1812
34270 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
34274 #: ../src/guestfs.pod:1815
34276 "The callback function is called whenever a log message is generated by the "
34277 "library part of libguestfs."
34281 #: ../src/guestfs.pod:1818
34283 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
34284 "messages are generated."
34288 #: ../src/guestfs.pod:1826
34289 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
34293 #: ../src/guestfs.pod:1829
34295 "The callback function is called whenever a trace message is generated. This "
34296 "only applies if the trace flag (L</guestfs_set_trace>) is set."
34300 #: ../src/guestfs.pod:1832
34302 "If no callback is registered: the messages are sent to stderr. You can "
34303 "override the printing of trace messages to stderr by setting up a callback."
34307 #: ../src/guestfs.pod:1838
34308 msgid "guestfs_set_event_callback"
34312 #: ../src/guestfs.pod:1840
34315 " int guestfs_set_event_callback (guestfs_h *g,\n"
34316 " guestfs_event_callback cb,\n"
34317 " uint64_t event_bitmask,\n"
34319 " void *opaque);\n"
34324 #: ../src/guestfs.pod:1846
34326 "This function registers a callback (C<cb>) for all event classes in the "
34327 "C<event_bitmask>."
34331 #: ../src/guestfs.pod:1849
34333 "For example, to register for all log message events, you could call this "
34334 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
34335 "To register a single callback for all possible classes of events, use "
34336 "C<GUESTFS_EVENT_ALL>."
34340 #: ../src/guestfs.pod:1855
34341 msgid "C<flags> should always be passed as 0."
34345 #: ../src/guestfs.pod:1857
34347 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
34348 "it for any purpose."
34352 #: ../src/guestfs.pod:1860
34354 "The return value is the event handle (an integer) which you can use to "
34355 "delete the callback (see below)."
34359 #: ../src/guestfs.pod:1863
34361 "If there is an error, this function returns C<-1>, and sets the error in the "
34362 "handle in the usual way (see L</guestfs_last_error> etc.)"
34366 #: ../src/guestfs.pod:1866
34368 "Callbacks remain in effect until they are deleted, or until the handle is "
34373 #: ../src/guestfs.pod:1869
34375 "In the case where multiple callbacks are registered for a particular event "
34376 "class, all of the callbacks are called. The order in which multiple "
34377 "callbacks are called is not defined."
34381 #: ../src/guestfs.pod:1873
34382 msgid "guestfs_delete_event_callback"
34386 #: ../src/guestfs.pod:1875
34389 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
34394 #: ../src/guestfs.pod:1877
34396 "Delete a callback that was previously registered. C<event_handle> should be "
34397 "the integer that was returned by a previous call to "
34398 "C<guestfs_set_event_callback> on the same handle."
34402 #: ../src/guestfs.pod:1881
34403 msgid "guestfs_event_callback"
34407 #: ../src/guestfs.pod:1883
34410 " typedef void (*guestfs_event_callback) (\n"
34413 " uint64_t event,\n"
34414 " int event_handle,\n"
34416 " const char *buf, size_t buf_len,\n"
34417 " const uint64_t *array, size_t array_len);\n"
34422 #: ../src/guestfs.pod:1892
34424 "This is the type of the event callback function that you have to provide."
34428 #: ../src/guestfs.pod:1895
34430 "The basic parameters are: the handle (C<g>), the opaque user pointer "
34431 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
34432 "handle, and C<flags> which in the current API you should ignore."
34436 #: ../src/guestfs.pod:1899
34438 "The remaining parameters contain the event payload (if any). Each event may "
34439 "contain a payload, which usually relates to the event class, but for future "
34440 "proofing your code should be written to handle any payload for any event "
34445 #: ../src/guestfs.pod:1904
34447 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
34448 "there is no message buffer). Note that this message buffer can contain "
34449 "arbitrary 8 bit data, including NUL bytes."
34453 #: ../src/guestfs.pod:1908
34455 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
34456 "moment this is only used for progress messages."
34460 #: ../src/guestfs.pod:1911
34461 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
34465 #: ../src/guestfs.pod:1913
34467 "One motivation for the generic event API was to allow GUI programs to "
34468 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
34469 "unconditionally to C<stderr>."
34473 #: ../src/guestfs.pod:1917
34475 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
34476 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
34477 "messages are not events; you must capture error messages separately)."
34481 #: ../src/guestfs.pod:1922
34483 "Programs have to set up a callback to capture the classes of events of "
34488 #: ../src/guestfs.pod:1925
34492 " guestfs_set_event_callback\n"
34493 " (g, message_callback,\n"
34494 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
34495 " GUESTFS_EVENT_TRACE,\n"
34496 " 0, NULL) == -1)\n"
34497 " if (eh == -1) {\n"
34498 " // handle error in the usual way\n"
34504 #: ../src/guestfs.pod:1935
34506 "The callback can then direct messages to the appropriate place. In this "
34507 "example, messages are directed to syslog:"
34511 #: ../src/guestfs.pod:1938
34515 " message_callback (\n"
34518 " uint64_t event,\n"
34519 " int event_handle,\n"
34521 " const char *buf, size_t buf_len,\n"
34522 " const uint64_t *array, size_t array_len)\n"
34524 " const int priority = LOG_USER|LOG_INFO;\n"
34525 " if (buf_len > 0)\n"
34526 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
34532 #: ../src/guestfs.pod:1953
34533 msgid "CANCELLING LONG TRANSFERS"
34537 #: ../src/guestfs.pod:1955
34539 "Some operations can be cancelled by the caller while they are in progress. "
34540 "Currently only operations that involve uploading or downloading data can be "
34541 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
34542 "parameters in the generator)."
34546 #: ../src/guestfs.pod:1960
34547 msgid "guestfs_user_cancel"
34551 #: ../src/guestfs.pod:1962
34554 " void guestfs_user_cancel (guestfs_h *g);\n"
34559 #: ../src/guestfs.pod:1964
34561 "C<guestfs_user_cancel> cancels the current upload or download operation."
34565 #: ../src/guestfs.pod:1967
34567 "Unlike most other libguestfs calls, this function is signal safe and thread "
34568 "safe. You can call it from a signal handler or from another thread, without "
34569 "needing to do any locking."
34573 #: ../src/guestfs.pod:1971
34575 "The transfer that was in progress (if there is one) will stop shortly "
34576 "afterwards, and will return an error. The errno (see L</"
34577 "guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
34578 "out if the operation was cancelled or failed because of another error."
34582 #: ../src/guestfs.pod:1977
34584 "No cleanup is performed: for example, if a file was being uploaded then "
34585 "after cancellation there may be a partially uploaded file. It is the "
34586 "caller's responsibility to clean up if necessary."
34590 #: ../src/guestfs.pod:1981
34591 msgid "There are two common places that you might call C<guestfs_user_cancel>."
34595 #: ../src/guestfs.pod:1983
34597 "In an interactive text-based program, you might call it from a C<SIGINT> "
34598 "signal handler so that pressing C<^C> cancels the current operation. (You "
34599 "also need to call L</guestfs_set_pgroup> so that child processes don't "
34600 "receive the C<^C> signal)."
34604 #: ../src/guestfs.pod:1988
34606 "In a graphical program, when the main thread is displaying a progress bar "
34607 "with a cancel button, wire up the cancel button to call this function."
34611 #: ../src/guestfs.pod:1992
34612 msgid "PRIVATE DATA AREA"
34616 #: ../src/guestfs.pod:1994
34618 "You can attach named pieces of private data to the libguestfs handle, fetch "
34619 "them by name, and walk over them, for the lifetime of the handle. This is "
34620 "called the private data area and is only available from the C API."
34624 #: ../src/guestfs.pod:1999
34625 msgid "To attach a named piece of data, use the following call:"
34629 #: ../src/guestfs.pod:2001
34632 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
34637 #: ../src/guestfs.pod:2003
34639 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
34640 "pointer (which can be C<NULL>). Any previous item with the same key is "
34645 #: ../src/guestfs.pod:2007
34647 "You can use any C<key> you want, but your key should I<not> start with an "
34648 "underscore character. Keys beginning with an underscore character are "
34649 "reserved for internal libguestfs purposes (eg. for implementing language "
34650 "bindings). It is recommended that you prefix the key with some unique "
34651 "string to avoid collisions with other users."
34655 #: ../src/guestfs.pod:2013
34656 msgid "To retrieve the pointer, use:"
34660 #: ../src/guestfs.pod:2015
34663 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
34668 #: ../src/guestfs.pod:2017
34670 "This function returns C<NULL> if either no data is found associated with "
34671 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
34676 #: ../src/guestfs.pod:2021
34678 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
34679 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
34680 "all. In particular, libguestfs does I<not> try to free the data when the "
34681 "handle is closed. If the data must be freed, then the caller must either "
34682 "free it before calling L</guestfs_close> or must set up a close callback to "
34683 "do it (see L</GUESTFS_EVENT_CLOSE>)."
34687 #: ../src/guestfs.pod:2028
34688 msgid "To walk over all entries, use these two functions:"
34692 #: ../src/guestfs.pod:2030
34695 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
34700 #: ../src/guestfs.pod:2032
34703 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
34708 #: ../src/guestfs.pod:2034
34710 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
34711 "not have any particular meaning -- keys are not returned in any defined "
34712 "order). A pointer to the key is returned in C<*key_rtn> and the "
34713 "corresponding data pointer is returned from the function. C<NULL> is "
34714 "returned if there are no keys stored in the handle."
34718 #: ../src/guestfs.pod:2040
34720 "C<guestfs_next_private> returns the next key, pointer pair. The return "
34721 "value of this function is also C<NULL> is there are no further entries to "
34726 #: ../src/guestfs.pod:2044
34727 msgid "Notes about walking over entries:"
34731 #: ../src/guestfs.pod:2050
34733 "You must not call C<guestfs_set_private> while walking over the entries."
34737 #: ../src/guestfs.pod:2055
34739 "The handle maintains an internal iterator which is reset when you call "
34740 "C<guestfs_first_private>. This internal iterator is invalidated when you "
34741 "call C<guestfs_set_private>."
34745 #: ../src/guestfs.pod:2061
34746 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
34750 #: ../src/guestfs.pod:2063
34753 " guestfs_set_private (g, key, NULL);\n"
34758 #: ../src/guestfs.pod:2065
34759 msgid "then that C<key> is not returned when walking."
34763 #: ../src/guestfs.pod:2069
34765 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
34766 "C<guestfs_next_private> or C<guestfs_set_private>."
34770 #: ../src/guestfs.pod:2075
34772 "The following example code shows how to print all keys and data pointers "
34773 "that are associated with the handle C<g>:"
34777 #: ../src/guestfs.pod:2078
34780 " const char *key;\n"
34781 " void *data = guestfs_first_private (g, &key);\n"
34782 " while (data != NULL)\n"
34784 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34785 " data = guestfs_next_private (g, &key);\n"
34791 #: ../src/guestfs.pod:2086
34793 "More commonly you are only interested in keys that begin with an application-"
34794 "specific prefix C<foo_>. Modify the loop like so:"
34798 #: ../src/guestfs.pod:2089
34801 " const char *key;\n"
34802 " void *data = guestfs_first_private (g, &key);\n"
34803 " while (data != NULL)\n"
34805 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34806 " printf (\"key = %s, data = %p\\n\", key, data);\n"
34807 " data = guestfs_next_private (g, &key);\n"
34813 #: ../src/guestfs.pod:2098
34815 "If you need to modify keys while walking, then you have to jump back to the "
34816 "beginning of the loop. For example, to delete all keys prefixed with "
34821 #: ../src/guestfs.pod:2102
34824 " const char *key;\n"
34827 " data = guestfs_first_private (g, &key);\n"
34828 " while (data != NULL)\n"
34830 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
34832 " guestfs_set_private (g, key, NULL);\n"
34833 " /* note that 'key' pointer is now invalid, and so is\n"
34834 " the internal iterator */\n"
34837 " data = guestfs_next_private (g, &key);\n"
34843 #: ../src/guestfs.pod:2118
34845 "Note that the above loop is guaranteed to terminate because the keys are "
34846 "being deleted, but other manipulations of keys within the loop might not "
34847 "terminate unless you also maintain an indication of which keys have been "
34852 #: ../src/guestfs.pod:2123 ../src/guestfs.pod:2128
34857 #: ../src/guestfs.pod:2125
34859 "<!-- old anchor for the next section --> <a name="
34860 "\"state_machine_and_low_level_event_api\"/>"
34864 #: ../src/guestfs.pod:2130
34865 msgid "ARCHITECTURE"
34869 #: ../src/guestfs.pod:2132
34871 "Internally, libguestfs is implemented by running an appliance (a special "
34872 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
34873 "process of the main program."
34877 #: ../src/guestfs.pod:2136
34880 " ___________________\n"
34882 " | main program |\n"
34884 " | | child process / appliance\n"
34885 " | | __________________________\n"
34887 " +-------------------+ RPC | +-----------------+ |\n"
34888 " | libguestfs <--------------------> guestfsd | |\n"
34889 " | | | +-----------------+ |\n"
34890 " \\___________________/ | | Linux kernel | |\n"
34891 " | +--^--------------+ |\n"
34892 " \\_________|________________/\n"
34894 " _______v______\n"
34897 " | disk image |\n"
34898 " \\______________/\n"
34903 #: ../src/guestfs.pod:2156
34905 "The library, linked to the main program, creates the child process and hence "
34906 "the appliance in the L</guestfs_launch> function."
34910 #: ../src/guestfs.pod:2159
34912 "Inside the appliance is a Linux kernel and a complete stack of userspace "
34913 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
34914 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
34915 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
34916 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
34917 "attached to the qemu process which translates device access by the "
34918 "appliance's Linux kernel into accesses to the image."
34922 #: ../src/guestfs.pod:2168
34924 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
34925 "Although the disk image you are attached to might also be used by some "
34926 "virtual machine, libguestfs doesn't know or care about this. (But you will "
34927 "care if both libguestfs's qemu process and your virtual machine are trying "
34928 "to update the disk image at the same time, since these usually results in "
34929 "massive disk corruption)."
34933 #: ../src/guestfs.pod:2175
34934 msgid "STATE MACHINE"
34938 #: ../src/guestfs.pod:2177
34939 msgid "libguestfs uses a state machine to model the child process:"
34943 #: ../src/guestfs.pod:2179
34947 " guestfs_create\n"
34955 " / | \\ \\ guestfs_launch\n"
34956 " / | _\\__V______\n"
34958 " / | | LAUNCHING |\n"
34959 " / | \\___________/\n"
34961 " / | guestfs_launch\n"
34963 " ______ / __|____V\n"
34964 " / \\ ------> / \\\n"
34965 " | BUSY | | READY |\n"
34966 " \\______/ <------ \\________/\n"
34971 #: ../src/guestfs.pod:2201
34973 "The normal transitions are (1) CONFIG (when the handle is created, but there "
34974 "is no child process), (2) LAUNCHING (when the child process is booting up), "
34975 "(3) alternating between READY and BUSY as commands are issued to, and "
34976 "carried out by, the child process."
34980 #: ../src/guestfs.pod:2206
34982 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
34983 "asynchronously at any time (eg. due to some internal error), and that causes "
34984 "the state to transition back to CONFIG."
34988 #: ../src/guestfs.pod:2210
34990 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
34991 "issued when in the CONFIG state."
34995 #: ../src/guestfs.pod:2213
34997 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
34998 "L</guestfs_launch> blocks until the child process is READY to accept "
34999 "commands (or until some failure or timeout). L</guestfs_launch> internally "
35000 "moves the state from CONFIG to LAUNCHING while it is running."
35004 #: ../src/guestfs.pod:2219
35006 "API actions such as L</guestfs_mount> can only be issued when in the READY "
35007 "state. These API calls block waiting for the command to be carried out (ie. "
35008 "the state to transition to BUSY and then back to READY). There are no non-"
35009 "blocking versions, and no way to issue more than one command per handle at "
35014 #: ../src/guestfs.pod:2225
35016 "Finally, the child process sends asynchronous messages back to the main "
35017 "program, such as kernel log messages. You can register a callback to "
35018 "receive these messages."
35022 #: ../src/guestfs.pod:2229
35027 #: ../src/guestfs.pod:2231
35028 msgid "COMMUNICATION PROTOCOL"
35032 #: ../src/guestfs.pod:2233
35034 "Don't rely on using this protocol directly. This section documents how it "
35035 "currently works, but it may change at any time."
35039 #: ../src/guestfs.pod:2236
35041 "The protocol used to talk between the library and the daemon running inside "
35042 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
35043 "1014, RFC 1832, RFC 4506)."
35047 #: ../src/guestfs.pod:2240
35049 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
35050 "this file is automatically generated)."
35054 #: ../src/guestfs.pod:2243
35056 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
35057 "and C<FileOut> parameters, which are handled with very simple request/reply "
35058 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
35059 "parameters, which use the same request and reply messages, but they may also "
35060 "be followed by files sent using a chunked encoding."
35064 #: ../src/guestfs.pod:2250
35065 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
35069 #: ../src/guestfs.pod:2252
35070 msgid "For ordinary functions, the request message is:"
35074 #: ../src/guestfs.pod:2254
35077 " total length (header + arguments,\n"
35078 " but not including the length word itself)\n"
35079 " struct guestfs_message_header (encoded as XDR)\n"
35080 " struct guestfs_<foo>_args (encoded as XDR)\n"
35085 #: ../src/guestfs.pod:2259
35087 "The total length field allows the daemon to allocate a fixed size buffer "
35088 "into which it slurps the rest of the message. As a result, the total length "
35089 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
35090 "effective size of any request is limited to somewhere under this size."
35094 #: ../src/guestfs.pod:2265
35096 "Note also that many functions don't take any arguments, in which case the "
35097 "C<guestfs_I<foo>_args> is completely omitted."
35101 #: ../src/guestfs.pod:2268
35103 "The header contains the procedure number (C<guestfs_proc>) which is how the "
35104 "receiver knows what type of args structure to expect, or none at all."
35108 #: ../src/guestfs.pod:2272
35110 "For functions that take optional arguments, the optional arguments are "
35111 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
35112 "arguments. A bitmask in the header indicates which optional arguments are "
35113 "meaningful. The bitmask is also checked to see if it contains bits set "
35114 "which the daemon does not know about (eg. if more optional arguments were "
35115 "added in a later version of the library), and this causes the call to be "
35120 #: ../src/guestfs.pod:2280
35121 msgid "The reply message for ordinary functions is:"
35125 #: ../src/guestfs.pod:2282
35128 " total length (header + ret,\n"
35129 " but not including the length word itself)\n"
35130 " struct guestfs_message_header (encoded as XDR)\n"
35131 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35136 #: ../src/guestfs.pod:2287
35138 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
35139 "functions that return no formal return values."
35143 #: ../src/guestfs.pod:2290
35145 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
35149 #: ../src/guestfs.pod:2293
35151 "In the case of an error, a flag is set in the header, and the reply message "
35152 "is slightly changed:"
35156 #: ../src/guestfs.pod:2296
35159 " total length (header + error,\n"
35160 " but not including the length word itself)\n"
35161 " struct guestfs_message_header (encoded as XDR)\n"
35162 " struct guestfs_message_error (encoded as XDR)\n"
35167 #: ../src/guestfs.pod:2301
35169 "The C<guestfs_message_error> structure contains the error message as a "
35174 #: ../src/guestfs.pod:2304
35175 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
35179 #: ../src/guestfs.pod:2306
35181 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
35182 "The normal request message is sent (see above). However this is followed by "
35183 "a sequence of file chunks."
35187 #: ../src/guestfs.pod:2310
35190 " total length (header + arguments,\n"
35191 " but not including the length word itself,\n"
35192 " and not including the chunks)\n"
35193 " struct guestfs_message_header (encoded as XDR)\n"
35194 " struct guestfs_<foo>_args (encoded as XDR)\n"
35195 " sequence of chunks for FileIn param #0\n"
35196 " sequence of chunks for FileIn param #1 etc.\n"
35201 #: ../src/guestfs.pod:2318
35202 msgid "The \"sequence of chunks\" is:"
35206 #: ../src/guestfs.pod:2320
35209 " length of chunk (not including length word itself)\n"
35210 " struct guestfs_chunk (encoded as XDR)\n"
35211 " length of chunk\n"
35212 " struct guestfs_chunk (encoded as XDR)\n"
35214 " length of chunk\n"
35215 " struct guestfs_chunk (with data.data_len == 0)\n"
35220 #: ../src/guestfs.pod:2328
35222 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
35223 "is set in the final chunk to indicate either successful completion or early "
35228 #: ../src/guestfs.pod:2332
35230 "At time of writing there are no functions that have more than one FileIn "
35231 "parameter. However this is (theoretically) supported, by sending the "
35232 "sequence of chunks for each FileIn parameter one after another (from left to "
35237 #: ../src/guestfs.pod:2337
35239 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
35240 "transfer. The library does this by sending a chunk with a special flag set "
35241 "to indicate cancellation. When the daemon sees this, it cancels the whole "
35242 "RPC, does I<not> send any reply, and goes back to reading the next request."
35246 #: ../src/guestfs.pod:2343
35248 "The daemon may also cancel. It does this by writing a special word "
35249 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
35250 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
35251 "cancel chunk). The special word is chosen so that even if cancellation "
35252 "happens right at the end of the transfer (after the library has finished "
35253 "writing and has started listening for the reply), the \"spurious\" cancel "
35254 "flag will not be confused with the reply message."
35258 #: ../src/guestfs.pod:2352
35260 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
35261 "limit), and also files where the size is not known in advance (eg. from "
35262 "pipes or sockets). However the chunks are rather small "
35263 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
35264 "to keep much in memory."
35268 #: ../src/guestfs.pod:2358
35269 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
35273 #: ../src/guestfs.pod:2360
35275 "The protocol for FileOut parameters is exactly the same as for FileIn "
35276 "parameters, but with the roles of daemon and library reversed."
35280 #: ../src/guestfs.pod:2363
35283 " total length (header + ret,\n"
35284 " but not including the length word itself,\n"
35285 " and not including the chunks)\n"
35286 " struct guestfs_message_header (encoded as XDR)\n"
35287 " struct guestfs_<foo>_ret (encoded as XDR)\n"
35288 " sequence of chunks for FileOut param #0\n"
35289 " sequence of chunks for FileOut param #1 etc.\n"
35294 #: ../src/guestfs.pod:2371
35295 msgid "INITIAL MESSAGE"
35299 #: ../src/guestfs.pod:2373
35301 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
35302 "which indicates that the guest and daemon is alive. This is what L</"
35303 "guestfs_launch> waits for."
35307 #: ../src/guestfs.pod:2377
35308 msgid "PROGRESS NOTIFICATION MESSAGES"
35312 #: ../src/guestfs.pod:2379
35314 "The daemon may send progress notification messages at any time. These are "
35315 "distinguished by the normal length word being replaced by "
35316 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
35320 #: ../src/guestfs.pod:2383
35322 "The library turns them into progress callbacks (see L</"
35323 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
35328 #: ../src/guestfs.pod:2387
35330 "The daemon self-limits the frequency of progress messages it sends (see "
35331 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
35336 #: ../src/guestfs.pod:2391
35337 msgid "LIBGUESTFS VERSION NUMBERS"
35341 #: ../src/guestfs.pod:2393
35343 "Since April 2010, libguestfs has started to make separate development and "
35344 "stable releases, along with corresponding branches in our git repository. "
35345 "These separate releases can be identified by version number:"
35349 #: ../src/guestfs.pod:2398
35352 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
35353 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
35359 " | `-------- sub-version\n"
35361 " `------ always '1' because we don't change the ABI\n"
35366 #: ../src/guestfs.pod:2409
35367 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
35371 #: ../src/guestfs.pod:2411
35373 "As time passes we cherry pick fixes from the development branch and backport "
35374 "those into the stable branch, the effect being that the stable branch should "
35375 "get more stable and less buggy over time. So the stable releases are ideal "
35376 "for people who don't need new features but would just like the software to "
35381 #: ../src/guestfs.pod:2417
35382 msgid "Our criteria for backporting changes are:"
35386 #: ../src/guestfs.pod:2423
35388 "Documentation changes which don't affect any code are backported unless the "
35389 "documentation refers to a future feature which is not in stable."
35393 #: ../src/guestfs.pod:2429
35395 "Bug fixes which are not controversial, fix obvious problems, and have been "
35396 "well tested are backported."
35400 #: ../src/guestfs.pod:2434
35402 "Simple rearrangements of code which shouldn't affect how it works get "
35403 "backported. This is so that the code in the two branches doesn't get too "
35404 "far out of step, allowing us to backport future fixes more easily."
35408 #: ../src/guestfs.pod:2440
35410 "We I<don't> backport new features, new APIs, new tools etc, except in one "
35411 "exceptional case: the new feature is required in order to implement an "
35412 "important bug fix."
35416 #: ../src/guestfs.pod:2446
35418 "A new stable branch starts when we think the new features in development are "
35419 "substantial and compelling enough over the current stable branch to warrant "
35420 "it. When that happens we create new stable and development versions 1.N.0 "
35421 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
35422 "stable at this point, but by backporting fixes from development, that branch "
35423 "will stabilize over time."
35427 #: ../src/guestfs.pod:2454
35428 msgid "EXTENDING LIBGUESTFS"
35432 #: ../src/guestfs.pod:2456
35433 msgid "ADDING A NEW API ACTION"
35437 #: ../src/guestfs.pod:2458
35439 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
35440 "documentation) are generated, and this makes it easy to extend the "
35445 #: ../src/guestfs.pod:2462
35446 msgid "To add a new API action there are two changes:"
35450 #: ../src/guestfs.pod:2468
35452 "You need to add a description of the call (name, parameters, return type, "
35453 "tests, documentation) to C<generator/generator_actions.ml>."
35457 #: ../src/guestfs.pod:2471
35459 "There are two sorts of API action, depending on whether the call goes "
35460 "through to the daemon in the appliance, or is serviced entirely by the "
35461 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
35462 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
35463 "an example of the latter, since a trace flag is maintained in the handle and "
35464 "all tracing is done on the library side."
35468 #: ../src/guestfs.pod:2479
35470 "Most new actions are of the first type, and get added to the "
35471 "C<daemon_functions> list. Each function has a unique procedure number used "
35472 "in the RPC protocol which is assigned to that action when we publish "
35473 "libguestfs and cannot be reused. Take the latest procedure number and "
35478 #: ../src/guestfs.pod:2485
35480 "For library-only actions of the second type, add to the "
35481 "C<non_daemon_functions> list. Since these functions are serviced by the "
35482 "library and do not travel over the RPC mechanism to the daemon, these "
35483 "functions do not need a procedure number, and so the procedure number is set "
35488 #: ../src/guestfs.pod:2493
35489 msgid "Implement the action (in C):"
35493 #: ../src/guestfs.pod:2495
35495 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
35496 "C<daemon/> directory."
35500 #: ../src/guestfs.pod:2498
35502 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
35503 "(note: double underscore) in the C<src/> directory."
35507 #: ../src/guestfs.pod:2501
35508 msgid "In either case, use another function as an example of what to do."
35512 #: ../src/guestfs.pod:2505
35513 msgid "After making these changes, use C<make> to compile."
35517 #: ../src/guestfs.pod:2507
35519 "Note that you don't need to implement the RPC, language bindings, manual "
35520 "pages or anything else. It's all automatically generated from the OCaml "
35525 #: ../src/guestfs.pod:2511
35526 msgid "ADDING TESTS FOR AN API ACTION"
35530 #: ../src/guestfs.pod:2513
35532 "You can supply zero or as many tests as you want per API call. The tests "
35533 "can either be added as part of the API description (C<generator/"
35534 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
35535 "into C<regressions/>. Note that adding a script to C<regressions/> is "
35536 "slower, so if possible use the first method."
35540 #: ../src/guestfs.pod:2519
35542 "The following describes the test environment used when you add an API test "
35543 "in C<generator_actions.ml>."
35547 #: ../src/guestfs.pod:2522
35548 msgid "The test environment has 4 block devices:"
35552 #: ../src/guestfs.pod:2526
35553 msgid "C</dev/sda> 500MB"
35557 #: ../src/guestfs.pod:2528
35558 msgid "General block device for testing."
35562 #: ../src/guestfs.pod:2530
35563 msgid "C</dev/sdb> 50MB"
35567 #: ../src/guestfs.pod:2532
35569 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
35574 #: ../src/guestfs.pod:2535
35575 msgid "C</dev/sdc> 10MB"
35579 #: ../src/guestfs.pod:2537
35580 msgid "Used in a few tests where two block devices are needed."
35584 #: ../src/guestfs.pod:2539
35585 msgid "C</dev/sdd>"
35589 #: ../src/guestfs.pod:2541
35590 msgid "ISO with fixed content (see C<images/test.iso>)."
35594 #: ../src/guestfs.pod:2545
35596 "To be able to run the tests in a reasonable amount of time, the libguestfs "
35597 "appliance and block devices are reused between tests. So don't try testing "
35598 "L</guestfs_kill_subprocess> :-x"
35602 #: ../src/guestfs.pod:2549
35604 "Each test starts with an initial scenario, selected using one of the "
35605 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
35606 "initialize the disks mentioned above in a particular way as documented in "
35607 "C<generator_types.ml>. You should not assume anything about the previous "
35608 "contents of other disks that are not initialized."
35612 #: ../src/guestfs.pod:2555
35614 "You can add a prerequisite clause to any individual test. This is a run-"
35615 "time check, which, if it fails, causes the test to be skipped. Useful if "
35616 "testing a command which might not work on all variations of libguestfs "
35617 "builds. A test that has prerequisite of C<Always> means to run "
35622 #: ../src/guestfs.pod:2561
35624 "In addition, packagers can skip individual tests by setting environment "
35625 "variables before running C<make check>."
35629 #: ../src/guestfs.pod:2564
35632 " SKIP_TEST_<CMD>_<NUM>=1\n"
35637 #: ../src/guestfs.pod:2566
35638 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
35642 #: ../src/guestfs.pod:2568
35647 #: ../src/guestfs.pod:2570
35650 " SKIP_TEST_<CMD>=1\n"
35655 #: ../src/guestfs.pod:2572
35656 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
35660 #: ../src/guestfs.pod:2574
35661 msgid "Packagers can run only certain tests by setting for example:"
35665 #: ../src/guestfs.pod:2576
35668 " TEST_ONLY=\"vfs_type zerofree\"\n"
35673 #: ../src/guestfs.pod:2578
35675 "See C<capitests/tests.c> for more details of how these environment variables "
35680 #: ../src/guestfs.pod:2581
35681 msgid "DEBUGGING NEW API ACTIONS"
35685 #: ../src/guestfs.pod:2583
35686 msgid "Test new actions work before submitting them."
35690 #: ../src/guestfs.pod:2585
35691 msgid "You can use guestfish to try out new commands."
35695 #: ../src/guestfs.pod:2587
35697 "Debugging the daemon is a problem because it runs inside a minimal "
35698 "environment. However you can fprintf messages in the daemon to stderr, and "
35699 "they will show up if you use C<guestfish -v>."
35703 #: ../src/guestfs.pod:2591
35704 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
35708 #: ../src/guestfs.pod:2593
35710 "Our C source code generally adheres to some basic code-formatting "
35711 "conventions. The existing code base is not totally consistent on this "
35712 "front, but we do prefer that contributed code be formatted similarly. In "
35713 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
35714 "indentation level, and other than that, follow the K&R style."
35718 #: ../src/guestfs.pod:2599
35720 "If you use Emacs, add the following to one of one of your start-up files (e."
35721 "g., ~/.emacs), to help ensure that you get indentation right:"
35725 #: ../src/guestfs.pod:2602
35728 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
35729 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
35730 " (add-hook 'find-file-hook\n"
35731 " '(lambda () (if (and buffer-file-name\n"
35732 " (string-match \"/libguestfs\\\\>\"\n"
35733 " (buffer-file-name))\n"
35734 " (not (string-equal mode-name \"Change Log\"))\n"
35735 " (not (string-equal mode-name \"Makefile\")))\n"
35736 " (setq indent-tabs-mode nil))))\n"
35741 #: ../src/guestfs.pod:2612
35744 " ;;; When editing C sources in libguestfs, use this style.\n"
35745 " (defun libguestfs-c-mode ()\n"
35746 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
35748 " (c-set-style \"K&R\")\n"
35749 " (setq c-indent-level 2)\n"
35750 " (setq c-basic-offset 2))\n"
35751 " (add-hook 'c-mode-hook\n"
35752 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
35753 " (buffer-file-name))\n"
35754 " (libguestfs-c-mode))))\n"
35759 #: ../src/guestfs.pod:2624
35760 msgid "Enable warnings when compiling (and fix any problems this finds):"
35764 #: ../src/guestfs.pod:2627
35767 " ./configure --enable-gcc-warnings\n"
35772 #: ../src/guestfs.pod:2629
35773 msgid "Useful targets are:"
35777 #: ../src/guestfs.pod:2631
35780 " make syntax-check # checks the syntax of the C code\n"
35781 " make check # runs the test suite\n"
35786 #: ../src/guestfs.pod:2634
35787 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
35791 #: ../src/guestfs.pod:2636
35793 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
35794 "which are used to do shell quoting."
35798 #: ../src/guestfs.pod:2641
35803 #: ../src/guestfs.pod:2643
35805 "Simple shell quoted string. Any spaces or other shell characters are "
35810 #: ../src/guestfs.pod:2646
35815 #: ../src/guestfs.pod:2648
35817 "Same as C<%Q> except the string is treated as a path which is prefixed by "
35822 #: ../src/guestfs.pod:2655
35825 " asprintf (&cmd, \"cat %R\", path);\n"
35830 #: ../src/guestfs.pod:2657
35831 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
35835 #: ../src/guestfs.pod:2659
35837 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
35838 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
35839 "they are not passed via the shell (instead, straight to exec). You probably "
35840 "want to use the C<sysroot_path()> function however."
35844 #: ../src/guestfs.pod:2665
35845 msgid "SUBMITTING YOUR NEW API ACTIONS"
35849 #: ../src/guestfs.pod:2667
35851 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
35852 "libguestfs> and CC to L<rjones@redhat.com>."
35856 #: ../src/guestfs.pod:2671
35857 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
35861 #: ../src/guestfs.pod:2673
35862 msgid "We support i18n (gettext anyhow) in the library."
35866 #: ../src/guestfs.pod:2675
35868 "However many messages come from the daemon, and we don't translate those at "
35869 "the moment. One reason is that the appliance generally has all locale files "
35870 "removed from it, because they take up a lot of space. So we'd have to readd "
35871 "some of those, as well as copying our PO files into the appliance."
35875 #: ../src/guestfs.pod:2681
35877 "Debugging messages are never translated, since they are intended for the "
35882 #: ../src/guestfs.pod:2684
35883 msgid "SOURCE CODE SUBDIRECTORIES"
35887 #: ../src/guestfs.pod:2690
35888 msgid "The libguestfs appliance, build scripts and so on."
35892 #: ../src/guestfs.pod:2692
35893 msgid "C<capitests>"
35897 #: ../src/guestfs.pod:2694
35898 msgid "Automated tests of the C API."
35902 #: ../src/guestfs.pod:2696
35907 #: ../src/guestfs.pod:2698
35909 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
35914 #: ../src/guestfs.pod:2701
35919 #: ../src/guestfs.pod:2703
35921 "Safety and liveness tests of components that libguestfs depends upon (not of "
35922 "libguestfs itself). Mainly this is for qemu and the kernel."
35926 #: ../src/guestfs.pod:2706
35931 #: ../src/guestfs.pod:2708
35932 msgid "Outside contributions, experimental parts."
35936 #: ../src/guestfs.pod:2710
35941 #: ../src/guestfs.pod:2712
35943 "The daemon that runs inside the libguestfs appliance and carries out actions."
35947 #: ../src/guestfs.pod:2715
35952 #: ../src/guestfs.pod:2717
35953 msgid "L<virt-df(1)> command and documentation."
35957 #: ../src/guestfs.pod:2719
35962 #: ../src/guestfs.pod:2721
35963 msgid "L<virt-edit(1)> command and documentation."
35967 #: ../src/guestfs.pod:2723
35968 msgid "C<examples>"
35972 #: ../src/guestfs.pod:2725
35973 msgid "C API example code."
35977 #: ../src/guestfs.pod:2727
35982 #: ../src/guestfs.pod:2729
35984 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
35985 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
35986 "L<virt-tar-out(1)>."
35990 #: ../src/guestfs.pod:2733
35995 #: ../src/guestfs.pod:2735
35997 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
36001 #: ../src/guestfs.pod:2737
36002 msgid "C<generator>"
36006 #: ../src/guestfs.pod:2739
36008 "The crucially important generator, used to automatically generate large "
36009 "amounts of boilerplate C code for things like RPC and bindings."
36013 #: ../src/guestfs.pod:2742
36018 #: ../src/guestfs.pod:2744
36019 msgid "Files used by the test suite."
36023 #: ../src/guestfs.pod:2746
36024 msgid "Some \"phony\" guest images which we test against."
36028 #: ../src/guestfs.pod:2748
36029 msgid "C<inspector>"
36033 #: ../src/guestfs.pod:2750
36034 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
36038 #: ../src/guestfs.pod:2752
36043 #: ../src/guestfs.pod:2754
36044 msgid "Logo used on the website. The fish is called Arthur by the way."
36048 #: ../src/guestfs.pod:2756
36053 #: ../src/guestfs.pod:2758
36054 msgid "M4 macros used by autoconf."
36058 #: ../src/guestfs.pod:2760
36063 #: ../src/guestfs.pod:2762
36064 msgid "Translations of simple gettext strings."
36068 #: ../src/guestfs.pod:2764
36073 #: ../src/guestfs.pod:2766
36075 "The build infrastructure and PO files for translations of manpages and POD "
36076 "files. Eventually this will be combined with the C<po> directory, but that "
36077 "is rather complicated."
36081 #: ../src/guestfs.pod:2770
36082 msgid "C<regressions>"
36086 #: ../src/guestfs.pod:2772
36087 msgid "Regression tests."
36091 #: ../src/guestfs.pod:2774
36096 #: ../src/guestfs.pod:2776
36097 msgid "L<virt-rescue(1)> command and documentation."
36101 #: ../src/guestfs.pod:2778
36106 #: ../src/guestfs.pod:2780
36107 msgid "Source code to the C library."
36111 #: ../src/guestfs.pod:2782
36116 #: ../src/guestfs.pod:2784
36117 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
36121 #: ../src/guestfs.pod:2786
36122 msgid "C<test-tool>"
36126 #: ../src/guestfs.pod:2788
36128 "Test tool for end users to test if their qemu/kernel combination will work "
36133 #: ../src/guestfs.pod:2791
36138 #: ../src/guestfs.pod:2793
36143 #: ../src/guestfs.pod:2795
36148 #: ../src/guestfs.pod:2797
36153 #: ../src/guestfs.pod:2799
36158 #: ../src/guestfs.pod:2801
36163 #: ../src/guestfs.pod:2803
36168 #: ../src/guestfs.pod:2805
36173 #: ../src/guestfs.pod:2807
36174 msgid "Language bindings."
36178 #: ../src/guestfs.pod:2811
36179 msgid "MAKING A STABLE RELEASE"
36183 #: ../src/guestfs.pod:2813
36185 "When we make a stable release, there are several steps documented here. See "
36186 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
36191 #: ../src/guestfs.pod:2821
36193 "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
36197 #: ../src/guestfs.pod:2826
36198 msgid "Finalize RELEASE-NOTES."
36202 #: ../src/guestfs.pod:2830
36203 msgid "Update ROADMAP."
36207 #: ../src/guestfs.pod:2834
36208 msgid "Run C<src/api-support/update-from-tarballs.sh>."
36212 #: ../src/guestfs.pod:2838
36213 msgid "Push and pull from Transifex."
36217 #: ../src/guestfs.pod:2840
36222 #: ../src/guestfs.pod:2842
36230 #: ../src/guestfs.pod:2844
36231 msgid "to push the latest POT files to Transifex. Then run:"
36235 #: ../src/guestfs.pod:2846
36243 #: ../src/guestfs.pod:2848
36244 msgid "which is a wrapper to pull the latest translated C<*.po> files."
36248 #: ../src/guestfs.pod:2852
36250 "Create new stable and development directories under L<http://libguestfs.org/"
36255 #: ../src/guestfs.pod:2857
36256 msgid "Create the branch in git:"
36260 #: ../src/guestfs.pod:2859
36263 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
36264 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
36265 " git branch stable-1.XX\n"
36266 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
36271 #: ../src/guestfs.pod:2866
36276 #: ../src/guestfs.pod:2868
36277 msgid "PROTOCOL LIMITS"
36281 #: ../src/guestfs.pod:2870
36283 "Internally libguestfs uses a message-based protocol to pass API calls and "
36284 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
36285 "plenty more detail about this). The maximum message size used by the "
36286 "protocol is slightly less than 4 MB. For some API calls you may need to be "
36287 "aware of this limit. The API calls which may be affected are individually "
36288 "documented, with a link back to this section of the documentation."
36292 #: ../src/guestfs.pod:2878
36294 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
36295 "a simple string. Because this string is at some point internally encoded as "
36296 "a message, the maximum size that it can return is slightly under 4 MB. If "
36297 "the requested file is larger than this then you will get an error."
36301 #: ../src/guestfs.pod:2884
36303 "In order to transfer large files into and out of the guest filesystem, you "
36304 "need to use particular calls that support this. The sections L</UPLOADING> "
36305 "and L</DOWNLOADING> document how to do this."
36309 #: ../src/guestfs.pod:2888
36311 "You might also consider mounting the disk image using our FUSE filesystem "
36312 "support (L<guestmount(1)>)."
36316 #: ../src/guestfs.pod:2891
36317 msgid "MAXIMUM NUMBER OF DISKS"
36321 #: ../src/guestfs.pod:2893
36322 msgid "When using virtio disks (the default) the current limit is B<25> disks."
36326 #: ../src/guestfs.pod:2896
36328 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
36329 "slots. However febootstrap only understands disks with names C</dev/vda> "
36330 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
36335 #: ../src/guestfs.pod:2901
36337 "We are working to substantially raise this limit in future versions but it "
36338 "requires complex changes to qemu."
36342 #: ../src/guestfs.pod:2904
36344 "In future versions of libguestfs it should also be possible to \"hot plug\" "
36345 "disks (add and remove disks after calling L</guestfs_launch>). This also "
36346 "requires changes to qemu."
36350 #: ../src/guestfs.pod:2908
36351 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
36355 #: ../src/guestfs.pod:2910
36356 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
36360 #: ../src/guestfs.pod:2912
36362 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
36363 "vda>, and C</dev/vda1> through C</dev/vda15>)."
36367 #: ../src/guestfs.pod:2915
36369 "If you attach a disk with more than 15 partitions, the extra partitions are "
36370 "ignored by libguestfs."
36374 #: ../src/guestfs.pod:2918
36375 msgid "MAXIMUM SIZE OF A DISK"
36379 #: ../src/guestfs.pod:2920
36380 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
36384 #: ../src/guestfs.pod:2922
36386 "We have tested block devices up to 1 exabyte (2**60 or "
36387 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
36392 #: ../src/guestfs.pod:2926
36394 "Although libguestfs probably does not impose any limit, the underlying host "
36395 "storage will. If you store disk images on a host ext4 filesystem, then the "
36396 "maximum size will be limited by the maximum ext4 file size (currently 16 "
36397 "TB). If you store disk images as host logical volumes then you are limited "
36398 "by the maximum size of an LV."
36402 #: ../src/guestfs.pod:2932
36404 "For the hugest disk image files, we recommend using XFS on the host for "
36409 #: ../src/guestfs.pod:2935
36410 msgid "MAXIMUM SIZE OF A PARTITION"
36414 #: ../src/guestfs.pod:2937
36416 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
36417 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
36418 "address a partition located beyond 2 TB on the disk."
36422 #: ../src/guestfs.pod:2941
36424 "It is recommended that you use GPT partitions on disks which are larger than "
36425 "this size. GPT uses 64 bit sector numbers and so can address partitions "
36426 "which are theoretically larger than the largest disk we could support."
36430 #: ../src/guestfs.pod:2946
36431 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
36435 #: ../src/guestfs.pod:2948
36437 "This depends on the filesystem type. libguestfs itself does not impose any "
36438 "known limit. Consult Wikipedia or the filesystem documentation to find out "
36439 "what these limits are."
36443 #: ../src/guestfs.pod:2952
36444 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
36448 #: ../src/guestfs.pod:2954
36450 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
36451 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
36452 "uploads and downloads."
36456 #: ../src/guestfs.pod:2958
36457 msgid "INSPECTION LIMITS"
36461 #: ../src/guestfs.pod:2960
36463 "The inspection code has several arbitrary limits on things like the size of "
36464 "Windows Registry hive it will read, and the length of product name. These "
36465 "are intended to stop a malicious guest from consuming arbitrary amounts of "
36466 "memory and disk space on the host, and should not be reached in practice. "
36467 "See the source code for more information."
36471 #: ../src/guestfs.pod:2986
36473 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
36474 "effect as calling C<guestfs_set_verbose (g, 1)>."
36478 #: ../src/guestfs.pod:2998
36480 "Set the path that libguestfs uses to search for a supermin appliance. See "
36481 "the discussion of paths in section L</PATH> above."
36485 #: ../src/guestfs.pod:3007
36486 msgid "See also L</QEMU WRAPPERS> above."
36490 #: ../src/guestfs.pod:3011
36492 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
36493 "effect as calling C<guestfs_set_trace (g, 1)>."
36497 #: ../src/guestfs.pod:3029
36499 "L<guestfs-examples(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-"
36500 "perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, L<guestfish(1)>, "
36501 "L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
36502 "L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)"
36503 ">, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
36504 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
36505 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
36506 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<http://libguestfs.org/>."
36510 #: ../src/guestfs.pod:3059
36512 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
36513 "(8)>, L<disktype(1)>."
36517 #: ../src/guestfs.pod:3066 ../tools/virt-make-fs.pl:553
36518 #: ../tools/virt-win-reg.pl:761
36523 #: ../src/guestfs.pod:3068
36524 msgid "To get a list of bugs against libguestfs use this link:"
36528 #: ../src/guestfs.pod:3070
36530 "L<https://bugzilla.redhat.com/buglist.cgi?"
36531 "component=libguestfs&product=Virtualization+Tools>"
36535 #: ../src/guestfs.pod:3072
36536 msgid "To report a new bug against libguestfs use this link:"
36540 #: ../src/guestfs.pod:3074
36542 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
36543 "component=libguestfs&product=Virtualization+Tools>"
36547 #: ../src/guestfs.pod:3076
36548 msgid "When reporting a bug, please check:"
36552 #: ../src/guestfs.pod:3082
36553 msgid "That the bug hasn't been reported already."
36557 #: ../src/guestfs.pod:3086
36558 msgid "That you are testing a recent version."
36562 #: ../src/guestfs.pod:3090
36563 msgid "Describe the bug accurately, and give a way to reproduce it."
36567 #: ../src/guestfs.pod:3094
36569 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
36574 #: ../test-tool/libguestfs-test-tool.pod:5
36575 msgid "libguestfs-test-tool - End user tests for libguestfs"
36579 #: ../test-tool/libguestfs-test-tool.pod:9
36582 " libguestfs-test-tool [--options]\n"
36587 #: ../test-tool/libguestfs-test-tool.pod:13
36589 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
36590 "and developers, to allow them to check basic libguestfs functionality is "
36591 "working. This is needed because libguestfs occasionally breaks for reasons "
36592 "beyond our control: usually because of changes in the underlying qemu or "
36593 "kernel packages, or the host environment."
36597 #: ../test-tool/libguestfs-test-tool.pod:20
36598 msgid "If you suspect a problem in libguestfs, then just run:"
36602 #: ../test-tool/libguestfs-test-tool.pod:22
36605 " libguestfs-test-tool\n"
36610 #: ../test-tool/libguestfs-test-tool.pod:24
36611 msgid "It will print lots of diagnostic messages."
36615 #: ../test-tool/libguestfs-test-tool.pod:26
36616 msgid "If it runs to completion successfully, you will see this near the end:"
36620 #: ../test-tool/libguestfs-test-tool.pod:28
36623 " ===== TEST FINISHED OK =====\n"
36628 #: ../test-tool/libguestfs-test-tool.pod:30
36629 msgid "and the test tool will exit with code 0."
36633 #: ../test-tool/libguestfs-test-tool.pod:32
36635 "If it fails (and/or exits with non-zero error code), please paste the "
36636 "B<complete, unedited> output of the test tool into a bug report. More "
36637 "information about reporting bugs can be found on the L<http://libguestfs.org/"
36642 #: ../test-tool/libguestfs-test-tool.pod:41
36647 #: ../test-tool/libguestfs-test-tool.pod:43
36648 msgid "Display short usage information and exit."
36652 #: ../test-tool/libguestfs-test-tool.pod:45
36653 msgid "I<--qemu qemu_binary>"
36657 #: ../test-tool/libguestfs-test-tool.pod:47
36659 "If you have downloaded another qemu binary, point this option at the full "
36660 "path of the binary to try it."
36664 #: ../test-tool/libguestfs-test-tool.pod:50
36665 msgid "I<--qemudir qemu_source_dir>"
36669 #: ../test-tool/libguestfs-test-tool.pod:52
36671 "If you have compiled qemu from source, point this option at the source "
36672 "directory to try it."
36676 #: ../test-tool/libguestfs-test-tool.pod:55
36677 msgid "I<--timeout N>"
36681 #: ../test-tool/libguestfs-test-tool.pod:57
36683 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
36684 "does not usually need to be adjusted unless your machine is very slow."
36688 #: ../test-tool/libguestfs-test-tool.pod:63
36689 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
36693 #: ../test-tool/libguestfs-test-tool.pod:65
36695 "If you have compiled another version of qemu from source and would like to "
36696 "try that, then you can use the I<--qemudir> option to point to the qemu "
36697 "source directory."
36701 #: ../test-tool/libguestfs-test-tool.pod:69
36703 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
36704 "option to point to the binary."
36708 #: ../test-tool/libguestfs-test-tool.pod:72
36710 "When using an alternate qemu with libguestfs, usually you would need to "
36711 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
36712 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
36713 "use either of the I<--qemudir> or I<--qemu> options."
36717 #: ../test-tool/libguestfs-test-tool.pod:79
36719 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
36720 "I<1> if there was an error."
36724 #: ../test-tool/libguestfs-test-tool.pod:84
36726 "For the full list of environment variables which may affect libguestfs, "
36727 "please see the L<guestfs(3)> manual page."
36731 #: ../test-tool/libguestfs-test-tool.pod:89
36732 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
36736 #: ../tools/virt-list-filesystems.pl:32
36738 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
36742 #: ../tools/virt-list-filesystems.pl:36
36745 " virt-list-filesystems [--options] domname\n"
36750 #: ../tools/virt-list-filesystems.pl:38
36753 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
36758 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
36760 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
36765 #: ../tools/virt-list-filesystems.pl:45
36767 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
36768 "are contained in a virtual machine or disk image."
36772 #: ../tools/virt-list-filesystems.pl:49
36774 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
36775 "functionality. For more complex cases you should look at the L<guestfish(1)"
36780 #: ../tools/virt-list-filesystems.pl:112
36782 "With this option, C<virt-list-filesystems> displays the type of each "
36783 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
36787 #: ../tools/virt-list-filesystems.pl:119
36792 #: ../tools/virt-list-filesystems.pl:123
36794 "Normally we only show mountable filesystems. If this option is given then "
36795 "swap devices are shown too."
36799 #: ../tools/virt-list-filesystems.pl:197
36801 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
36802 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
36803 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36807 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
36808 msgid "Copyright (C) 2009 Red Hat Inc."
36812 #: ../tools/virt-list-partitions.pl:32
36814 "virt-list-partitions - List partitions in a virtual machine or disk image"
36818 #: ../tools/virt-list-partitions.pl:36
36821 " virt-list-partitions [--options] domname\n"
36826 #: ../tools/virt-list-partitions.pl:38
36829 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
36834 #: ../tools/virt-list-partitions.pl:45
36836 "C<virt-list-partitions> is a command line tool to list the partitions that "
36837 "are contained in a virtual machine or disk image. It is mainly useful as a "
36838 "first step to using L<virt-resize(1)>."
36842 #: ../tools/virt-list-partitions.pl:50
36844 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
36845 "functionality. For more complex cases you should look at the L<guestfish(1)"
36850 #: ../tools/virt-list-partitions.pl:113
36851 msgid "Show sizes in human-readable form (eg. \"1G\")."
36855 #: ../tools/virt-list-partitions.pl:123
36857 "With this option, C<virt-list-partitions> displays the type and size of each "
36858 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
36862 #: ../tools/virt-list-partitions.pl:130
36867 #: ../tools/virt-list-partitions.pl:132
36872 #: ../tools/virt-list-partitions.pl:134
36874 "Display the total size of each block device (as a separate row or rows)."
36878 #: ../tools/virt-list-partitions.pl:267
36880 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
36881 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
36882 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
36886 #: ../tools/virt-list-partitions.pl:283
36887 msgid "Copyright (C) 2009-2010 Red Hat Inc."
36891 #: ../tools/virt-make-fs.pl:37
36892 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
36896 #: ../tools/virt-make-fs.pl:41
36899 " virt-make-fs [--options] input.tar output.img\n"
36904 #: ../tools/virt-make-fs.pl:43
36907 " virt-make-fs [--options] input.tar.gz output.img\n"
36912 #: ../tools/virt-make-fs.pl:45
36915 " virt-make-fs [--options] directory output.img\n"
36920 #: ../tools/virt-make-fs.pl:49
36922 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
36923 "archive or some files in a directory. It is similar to tools like L<mkisofs"
36924 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
36925 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
36926 "you want to attach these filesystems to existing virtual machines (eg. to "
36927 "import large amounts of read-only data to a VM)."
36931 #: ../tools/virt-make-fs.pl:57
36932 msgid "Basic usage is:"
36936 #: ../tools/virt-make-fs.pl:59
36939 " virt-make-fs input output\n"
36944 #: ../tools/virt-make-fs.pl:61
36946 "where C<input> is either a directory containing files that you want to add, "
36947 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
36948 "C<output> is a disk image. The input type is detected automatically. The "
36949 "output disk image defaults to a raw ext2 image unless you specify extra "
36950 "flags (see L</OPTIONS> below)."
36954 #: ../tools/virt-make-fs.pl:67
36955 msgid "EXTRA SPACE"
36959 #: ../tools/virt-make-fs.pl:69
36961 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
36962 "the files that it contains, but might have extra space. Depending on how "
36963 "you are going to use the output, you might think this extra space is wasted "
36964 "and want to minimize it, or you might want to leave space so that more files "
36965 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
36966 "but you can use the I<--size> flag to leave space in the filesystem if you "
36971 #: ../tools/virt-make-fs.pl:77
36973 "An alternative way to leave extra space but not make the output image any "
36974 "bigger is to use an alternative disk image format (instead of the default "
36975 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
36976 "image format (check your hypervisor supports this before using it). This "
36977 "allows you to choose a large I<--size> but the extra space won't actually be "
36978 "allocated in the image until you try to store something in it."
36982 #: ../tools/virt-make-fs.pl:85
36984 "Don't forget that you can also use local commands including L<resize2fs(8)> "
36985 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
36986 "to build another image from scratch."
36990 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
36991 #: ../tools/virt-make-fs.pl:142
36996 #: ../tools/virt-make-fs.pl:91
36999 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
37004 #: ../tools/virt-make-fs.pl:93
37005 msgid "FILESYSTEM TYPE"
37009 #: ../tools/virt-make-fs.pl:95
37011 "The default filesystem type is C<ext2>. Just about any filesystem type that "
37012 "libguestfs supports can be used (but I<not> read-only formats like "
37013 "ISO9660). Here are some of the more common choices:"
37017 #: ../tools/virt-make-fs.pl:101
37022 #: ../tools/virt-make-fs.pl:103
37024 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
37025 "you are not going to use the filesystem in a way that requires the journal, "
37026 "then this is just wasted overhead."
37030 #: ../tools/virt-make-fs.pl:107
37031 msgid "I<ntfs> or I<vfat>"
37035 #: ../tools/virt-make-fs.pl:109
37036 msgid "Useful if exporting data to a Windows guest."
37040 #: ../tools/virt-make-fs.pl:111
37042 "I<Note for vfat>: The tar archive or local directory must only contain files "
37043 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
37044 "program running within libguestfs is unable to change the ownership of non-"
37045 "root files, since vfat itself does not support this."
37049 #: ../tools/virt-make-fs.pl:116
37054 #: ../tools/virt-make-fs.pl:118
37056 "Lower overhead than C<ext2>, but certain limitations on filename length and "
37057 "total filesystem size."
37061 #: ../tools/virt-make-fs.pl:125
37064 " virt-make-fs --type=minix input minixfs.img\n"
37069 #: ../tools/virt-make-fs.pl:127
37070 msgid "TO PARTITION OR NOT TO PARTITION"
37074 #: ../tools/virt-make-fs.pl:129
37075 msgid "Optionally virt-make-fs can add a partition table to the output disk."
37079 #: ../tools/virt-make-fs.pl:131
37081 "Adding a partition can make the disk image more compatible with certain "
37082 "virtualized operating systems which don't expect to see a filesystem "
37083 "directly located on a block device (Linux doesn't care and will happily "
37084 "handle both types)."
37088 #: ../tools/virt-make-fs.pl:136
37090 "On the other hand, if you have a partition table then the output image is no "
37091 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
37092 "directly on a partitioned disk image. (However libguestfs tools such as "
37093 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
37097 #: ../tools/virt-make-fs.pl:144
37098 msgid "Add an MBR partition:"
37102 #: ../tools/virt-make-fs.pl:146
37105 " virt-make-fs --partition -- input disk.img\n"
37110 #: ../tools/virt-make-fs.pl:148
37112 "If the output disk image could be terabyte-sized or larger, it's better to "
37113 "use an EFI/GPT-compatible partition table:"
37117 #: ../tools/virt-make-fs.pl:151
37120 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
37125 #: ../tools/virt-make-fs.pl:179
37126 msgid "Enable debugging information."
37130 #: ../tools/virt-make-fs.pl:185
37131 msgid "B<--size=E<lt>NE<gt>>"
37135 #: ../tools/virt-make-fs.pl:187
37136 msgid "B<--size=+E<lt>NE<gt>>"
37140 #: ../tools/virt-make-fs.pl:189
37141 msgid "B<-s E<lt>NE<gt>>"
37145 #: ../tools/virt-make-fs.pl:191
37146 msgid "B<-s +E<lt>NE<gt>>"
37150 #: ../tools/virt-make-fs.pl:193
37152 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
37156 #: ../tools/virt-make-fs.pl:196
37158 "If this option is I<not> given, then the output image will be just large "
37159 "enough to contain all the files, with not much wasted space."
37163 #: ../tools/virt-make-fs.pl:199
37165 "To choose a fixed size output disk, specify an absolute number followed by b/"
37166 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37167 "Petabytes or Exabytes. This must be large enough to contain all the input "
37168 "files, else you will get an error."
37172 #: ../tools/virt-make-fs.pl:204
37174 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
37175 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
37176 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
37177 "the input files, and (approximately) an extra 200 MB free space."
37181 #: ../tools/virt-make-fs.pl:210
37183 "Note that virt-make-fs estimates free space, and therefore will not produce "
37184 "filesystems containing precisely the free space requested. (It is much more "
37185 "expensive and time-consuming to produce a filesystem which has precisely the "
37186 "desired free space)."
37190 #: ../tools/virt-make-fs.pl:219
37191 msgid "B<--format=E<lt>fmtE<gt>>"
37195 #: ../tools/virt-make-fs.pl:221
37196 msgid "B<-F E<lt>fmtE<gt>>"
37200 #: ../tools/virt-make-fs.pl:223
37201 msgid "Choose the output disk image format."
37205 #: ../tools/virt-make-fs.pl:225
37206 msgid "The default is C<raw> (raw disk image)."
37210 #: ../tools/virt-make-fs.pl:227
37212 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
37213 "that would really make sense here is C<qcow2>."
37217 #: ../tools/virt-make-fs.pl:234
37218 msgid "B<--type=E<lt>fsE<gt>>"
37222 #: ../tools/virt-make-fs.pl:236
37223 msgid "B<-t E<lt>fsE<gt>>"
37227 #: ../tools/virt-make-fs.pl:238
37228 msgid "Choose the output filesystem type."
37232 #: ../tools/virt-make-fs.pl:240
37233 msgid "The default is C<ext2>."
37237 #: ../tools/virt-make-fs.pl:242
37239 "Any filesystem which is supported read-write by libguestfs can be used here."
37243 #: ../tools/virt-make-fs.pl:249
37244 msgid "B<--partition>"
37248 #: ../tools/virt-make-fs.pl:251
37249 msgid "B<--partition=E<lt>parttypeE<gt>>"
37253 #: ../tools/virt-make-fs.pl:253
37255 "If specified, this flag adds an MBR partition table to the output disk image."
37259 #: ../tools/virt-make-fs.pl:256
37261 "You can change the partition table type, eg. I<--partition=gpt> for large "
37266 #: ../tools/virt-make-fs.pl:259
37268 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
37269 "might consider the next parameter to be the partition type. For example:"
37273 #: ../tools/virt-make-fs.pl:263
37276 " virt-make-fs --partition input.tar ...\n"
37281 #: ../tools/virt-make-fs.pl:265
37283 "would cause virt-make-fs to think you wanted to use a partition type of "
37284 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
37285 "dash) between options and the input file argument:"
37289 #: ../tools/virt-make-fs.pl:269
37292 " virt-make-fs --partition -- input.tar ...\n"
37297 #: ../tools/virt-make-fs.pl:541
37299 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
37300 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
37301 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
37305 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
37307 "When reporting bugs, please enable debugging and capture the I<complete> "
37312 #: ../tools/virt-make-fs.pl:558
37315 " export LIBGUESTFS_DEBUG=1\n"
37316 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
37321 #: ../tools/virt-make-fs.pl:561
37323 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
37328 #: ../tools/virt-tar.pl:33
37329 msgid "virt-tar - Extract or upload files to a virtual machine"
37333 #: ../tools/virt-tar.pl:37
37336 " virt-tar [--options] -x domname directory tarball\n"
37341 #: ../tools/virt-tar.pl:39
37344 " virt-tar [--options] -u domname tarball directory\n"
37349 #: ../tools/virt-tar.pl:41
37352 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
37357 #: ../tools/virt-tar.pl:43
37360 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
37365 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
37370 #: ../tools/virt-tar.pl:47
37372 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
37373 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
37377 #: ../tools/virt-tar.pl:52
37378 msgid "Download C</home> from the VM into a local tarball:"
37382 #: ../tools/virt-tar.pl:54
37385 " virt-tar -x domname /home home.tar\n"
37390 #: ../tools/virt-tar.pl:56
37393 " virt-tar -zx domname /home home.tar.gz\n"
37398 #: ../tools/virt-tar.pl:58
37399 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
37403 #: ../tools/virt-tar.pl:60
37406 " virt-tar -u domname uploadstuff.tar /tmp\n"
37411 #: ../tools/virt-tar.pl:62
37414 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
37419 #: ../tools/virt-tar.pl:66
37421 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
37422 "virtual machines. If you do this, you risk disk corruption in the VM. "
37423 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
37427 #: ../tools/virt-tar.pl:71
37429 "You can use I<-x> (extract) on live virtual machines, but you might get "
37430 "inconsistent results or errors if there is filesystem activity inside the "
37431 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
37432 "work, but the only way to guarantee consistent results is if the virtual "
37433 "machine is shut down."
37437 #: ../tools/virt-tar.pl:79
37439 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
37440 "parts of a guest filesystem. There are many possibilities: making backups, "
37441 "uploading data files, snooping on guest activity, fixing or customizing "
37446 #: ../tools/virt-tar.pl:84
37448 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
37449 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
37450 "should look at the L<guestfish(1)> tool."
37454 #: ../tools/virt-tar.pl:88
37456 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
37457 "its contents (recursively) from the virtual machine into a local tarball. "
37458 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
37459 "virtual machine. You cannot use these two options together."
37463 #: ../tools/virt-tar.pl:94
37465 "In addition, you may need to use the I<-z> (gZip) option to enable "
37466 "compression. When uploading, you have to specify I<-z> if the upload file "
37467 "is compressed because virt-tar won't detect this on its own."
37471 #: ../tools/virt-tar.pl:98
37473 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
37474 "example it cannot do PKZip files or bzip2 compression. If you want that "
37475 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
37476 "the L<libguestfs(3)> API)."
37480 #: ../tools/virt-tar.pl:160
37481 msgid "B<--extract>"
37485 #: ../tools/virt-tar.pl:162
37486 msgid "B<--download>"
37490 #: ../tools/virt-tar.pl:164
37495 #: ../tools/virt-tar.pl:166
37496 msgid "B<--upload>"
37500 #: ../tools/virt-tar.pl:168
37502 "Use I<-x> to extract (download) a directory from a virtual machine to a "
37507 #: ../tools/virt-tar.pl:171
37509 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
37510 "Please read the L</WARNING> section above before using this option."
37514 #: ../tools/virt-tar.pl:175
37515 msgid "You must specify exactly one of these options."
37519 #: ../tools/virt-tar.pl:181
37524 #: ../tools/virt-tar.pl:183
37529 #: ../tools/virt-tar.pl:185
37530 msgid "Specify that the input or output tarball is gzip-compressed."
37534 #: ../tools/virt-tar.pl:298
37536 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
37537 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
37538 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
37543 #: ../tools/virt-win-reg.pl:37
37545 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
37549 #: ../tools/virt-win-reg.pl:41
37552 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
37557 #: ../tools/virt-win-reg.pl:43
37560 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
37565 #: ../tools/virt-win-reg.pl:45
37568 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
37573 #: ../tools/virt-win-reg.pl:47
37576 " virt-win-reg --merge domname [input.reg ...]\n"
37581 #: ../tools/virt-win-reg.pl:49
37584 " virt-win-reg [--options] disk.img ... # instead of domname\n"
37589 #: ../tools/virt-win-reg.pl:53
37591 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
37592 "virtual machines. If you do this, you I<will> get irreversible disk "
37593 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
37594 "but doesn't catch all cases."
37598 #: ../tools/virt-win-reg.pl:58
37600 "Modifying the Windows Registry is an inherently risky operation. The format "
37601 "is deliberately obscure and undocumented, and Registry changes can leave the "
37602 "system unbootable. Therefore when using the I<--merge> option, make sure "
37603 "you have a reliable backup first."
37607 #: ../tools/virt-win-reg.pl:65
37609 "This program can export and merge Windows Registry entries from a Windows "
37614 #: ../tools/virt-win-reg.pl:68
37616 "The first parameter is the libvirt guest name or the raw disk image of a "
37621 #: ../tools/virt-win-reg.pl:71
37623 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
37624 "exported (recursively). For example:"
37628 #: ../tools/virt-win-reg.pl:74
37631 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
37636 #: ../tools/virt-win-reg.pl:76
37638 "You can also display single values from within registry keys, for example:"
37642 #: ../tools/virt-win-reg.pl:79
37645 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
37646 " $ virt-win-reg Windows7 $cvkey ProductName\n"
37647 " Windows 7 Enterprise\n"
37652 #: ../tools/virt-win-reg.pl:83
37654 "With I<--merge>, you can merge a textual regedit file into the Windows "
37659 #: ../tools/virt-win-reg.pl:86
37662 " $ virt-win-reg --merge Windows7 changes.reg\n"
37667 #: ../tools/virt-win-reg.pl:90
37669 "This program is only meant for simple access to the registry. If you want "
37670 "to do complicated things with the registry, we suggest you download the "
37671 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
37672 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
37673 "L<hivexregedit(1)>."
37677 #: ../tools/virt-win-reg.pl:159
37682 #: ../tools/virt-win-reg.pl:161
37684 "In merge mode, this merges a textual regedit file into the Windows Registry "
37685 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
37686 "displays or exports Registry entries instead."
37690 #: ../tools/virt-win-reg.pl:165
37692 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
37693 "result in disk corruption. However exporting (without this flag) is always "
37698 #: ../tools/virt-win-reg.pl:173
37699 msgid "B<--encoding> UTF-16LE|ASCII"
37703 #: ../tools/virt-win-reg.pl:175
37705 "When merging (only), you may need to specify the encoding for strings to be "
37706 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
37707 "(3)/ENCODING STRINGS>."
37711 #: ../tools/virt-win-reg.pl:179
37713 "The default is to use UTF-16LE, which should work with recent versions of "
37718 #: ../tools/virt-win-reg.pl:186
37719 msgid "B<--unsafe-printable-strings>"
37723 #: ../tools/virt-win-reg.pl:188
37725 "When exporting (only), assume strings are UTF-16LE and print them as strings "
37726 "instead of hex sequences. Remove the final zero codepoint from strings if "
37731 #: ../tools/virt-win-reg.pl:192
37733 "This is unsafe and does not preserve the fidelity of strings in the original "
37734 "Registry for various reasons:"
37738 #: ../tools/virt-win-reg.pl:199
37740 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
37741 "other encodings will be corrupted by this transformation."
37745 #: ../tools/virt-win-reg.pl:204
37747 "Assumes that everything which has type 1 or 2 is really a string and that "
37748 "everything else is not a string, but the type field in real Registries is "
37753 #: ../tools/virt-win-reg.pl:210
37755 "Loses information about whether a zero codepoint followed the string in the "
37760 #: ../tools/virt-win-reg.pl:215
37762 "This all happens because the Registry itself contains no information about "
37763 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
37767 #: ../tools/virt-win-reg.pl:219
37769 "You should only use this option for quick hacking and debugging of the "
37770 "Registry contents, and I<never> use it if the output is going to be passed "
37771 "into another program or stored in another Registry."
37775 #: ../tools/virt-win-reg.pl:556
37776 msgid "SUPPORTED SYSTEMS"
37780 #: ../tools/virt-win-reg.pl:558
37782 "The program currently supports Windows NT-derived guests starting with "
37783 "Windows XP through to at least Windows 7."
37787 #: ../tools/virt-win-reg.pl:561
37788 msgid "The following Registry keys are supported:"
37792 #: ../tools/virt-win-reg.pl:565
37793 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
37797 #: ../tools/virt-win-reg.pl:567
37798 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
37802 #: ../tools/virt-win-reg.pl:569
37803 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
37807 #: ../tools/virt-win-reg.pl:571
37808 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
37812 #: ../tools/virt-win-reg.pl:573
37813 msgid "C<HKEY_USERS\\.DEFAULT>"
37817 #: ../tools/virt-win-reg.pl:575
37818 msgid "C<HKEY_USERS\\I<SID>>"
37822 #: ../tools/virt-win-reg.pl:577
37823 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
37827 #: ../tools/virt-win-reg.pl:579
37828 msgid "C<HKEY_USERS\\I<username>>"
37832 #: ../tools/virt-win-reg.pl:581
37834 "where I<username> is a local user name (this is a libguestfs extension)."
37838 #: ../tools/virt-win-reg.pl:585
37840 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
37845 #: ../tools/virt-win-reg.pl:588
37847 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
37848 "supported (there is no \"current user\")."
37852 #: ../tools/virt-win-reg.pl:591
37857 #: ../tools/virt-win-reg.pl:593
37859 "C<virt-win-reg> expects that regedit files have already been reencoded in "
37860 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
37861 "style line endings. Since Windows regedit files are often in UTF-16LE with "
37862 "Windows-style line endings, you may need to reencode the whole file before "
37863 "or after processing."
37867 #: ../tools/virt-win-reg.pl:599
37869 "To reencode a file from Windows format to Linux (before processing it with "
37870 "the I<--merge> option), you would do something like this:"
37874 #: ../tools/virt-win-reg.pl:602
37877 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
37882 #: ../tools/virt-win-reg.pl:604
37884 "To go in the opposite direction, after exporting and before sending the file "
37885 "to a Windows user, do something like this:"
37889 #: ../tools/virt-win-reg.pl:607
37892 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
37897 #: ../tools/virt-win-reg.pl:609
37898 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
37902 #: ../tools/virt-win-reg.pl:611
37904 "If you are unsure about the current encoding, use the L<file(1)> command. "
37905 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
37906 "style (CRLF) line endings, like this:"
37910 #: ../tools/virt-win-reg.pl:615
37913 " $ file software.reg\n"
37914 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
37915 " with CRLF line terminators\n"
37920 #: ../tools/virt-win-reg.pl:619
37921 msgid "This file would need conversion before you could I<--merge> it."
37925 #: ../tools/virt-win-reg.pl:621
37926 msgid "CurrentControlSet etc."
37930 #: ../tools/virt-win-reg.pl:623
37932 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
37933 "Registry at the level of the hive file, and therefore you cannot modify "
37938 #: ../tools/virt-win-reg.pl:627
37940 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
37941 "circumstances it might refer to another control set. The way to find out is "
37942 "to look at the C<HKLM\\SYSTEM\\Select> key:"
37946 #: ../tools/virt-win-reg.pl:631
37949 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
37950 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
37951 " \"Current\"=dword:00000001\n"
37952 " \"Default\"=dword:00000001\n"
37953 " \"Failed\"=dword:00000000\n"
37954 " \"LastKnownGood\"=dword:00000002\n"
37959 #: ../tools/virt-win-reg.pl:638
37960 msgid "\"Current\" is the one which Windows will choose when it boots."
37964 #: ../tools/virt-win-reg.pl:640
37966 "Similarly, other C<Current...> keys in the path may need to be replaced."
37970 #: ../tools/virt-win-reg.pl:643
37971 msgid "WINDOWS TIPS"
37975 #: ../tools/virt-win-reg.pl:645
37977 "Note that some of these tips modify the guest disk image. The guest I<must> "
37978 "be shut off, else you will get disk corruption."
37982 #: ../tools/virt-win-reg.pl:648
37983 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
37987 #: ../tools/virt-win-reg.pl:650
37989 "Prepare a DOS batch script, VBScript or executable. Upload this using "
37990 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
37991 "is uploaded into C<C:\\>:"
37995 #: ../tools/virt-win-reg.pl:654
37998 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
38003 #: ../tools/virt-win-reg.pl:656
38004 msgid "Prepare a regedit file containing the registry change:"
38008 #: ../tools/virt-win-reg.pl:658
38011 " cat > test.reg <<'EOF'\n"
38012 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
38013 " \"Test\"=\"c:\\\\test.bat\"\n"
38019 #: ../tools/virt-win-reg.pl:663
38021 "In this example we use the key C<RunOnce> which means that the script will "
38022 "run precisely once when the first user logs in. If you want it to run every "
38023 "time a user logs in, replace C<RunOnce> with C<Run>."
38027 #: ../tools/virt-win-reg.pl:667
38028 msgid "Now update the registry:"
38032 #: ../tools/virt-win-reg.pl:669
38035 " virt-win-reg --merge WindowsGuest test.reg\n"
38040 #: ../tools/virt-win-reg.pl:671
38041 msgid "INSTALLING A SERVICE"
38045 #: ../tools/virt-win-reg.pl:673
38047 "This section assumes you are familiar with Windows services, and you either "
38048 "have a program which handles the Windows Service Control Protocol directly "
38049 "or you want to run any program using a service wrapper like SrvAny or the "
38054 #: ../tools/virt-win-reg.pl:678
38056 "First upload the program and optionally the service wrapper. In this case "
38057 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
38061 #: ../tools/virt-win-reg.pl:682
38064 " guestfish -i -d WindowsGuest <<EOF\n"
38065 " upload rhsrvany.exe /rhsrvany.exe\n"
38066 " upload test.exe /test.exe\n"
38072 #: ../tools/virt-win-reg.pl:687
38074 "Prepare a regedit file containing the registry changes. In this example, "
38075 "the first registry change is needed for the service itself or the service "
38076 "wrapper (if used). The second registry change is only needed because I am "
38077 "using the RHSrvAny service wrapper."
38081 #: ../tools/virt-win-reg.pl:692
38084 " cat > service.reg <<'EOF'\n"
38085 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
38086 " \"Type\"=dword:00000010\n"
38087 " \"Start\"=dword:00000002\n"
38088 " \"ErrorControl\"=dword:00000001\n"
38089 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
38090 " \"DisplayName\"=\"RHSrvAny\"\n"
38091 " \"ObjectName\"=\"NetworkService\"\n"
38096 #: ../tools/virt-win-reg.pl:701
38099 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
38100 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
38101 " \"PWD\"=\"c:\\\\Temp\"\n"
38107 #: ../tools/virt-win-reg.pl:712
38109 "For use of C<ControlSet001> see the section above in this manual page. You "
38110 "may need to adjust this according to the control set that is in use by the "
38115 #: ../tools/virt-win-reg.pl:718
38117 "C<\"ObjectName\"> controls the privileges that the service will have. An "
38118 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
38119 "privileged account."
38123 #: ../tools/virt-win-reg.pl:724
38125 "For the meaning of the magic numbers, see this Microsoft KB article: "
38126 "L<http://support.microsoft.com/kb/103000>."
38130 #: ../tools/virt-win-reg.pl:729
38131 msgid "Update the registry:"
38135 #: ../tools/virt-win-reg.pl:731
38138 " virt-win-reg --merge WindowsGuest service.reg\n"
38143 #: ../tools/virt-win-reg.pl:735
38145 "Be careful when passing parameters containing C<\\> (backslash) in the "
38146 "shell. Usually you will have to use 'single quotes' or double backslashes "
38147 "(but not both) to protect them from the shell."
38151 #: ../tools/virt-win-reg.pl:739
38152 msgid "Paths and value names are case-insensitive."
38156 #: ../tools/virt-win-reg.pl:748
38158 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
38159 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
38160 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38164 #: ../tools/virt-win-reg.pl:766
38167 " export LIBGUESTFS_DEBUG=1\n"
38168 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
38173 #: ../tools/virt-win-reg.pl:769
38175 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."