1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.5.16\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2010-09-18 09:23+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=utf-8\n"
17 "Content-Transfer-Encoding: ENCODING"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1 ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1 ../inspector/virt-inspector.pl:36 ../tools/virt-cat.pl:30 ../tools/virt-df.pl:32 ../tools/virt-edit.pl:31 ../tools/virt-list-filesystems.pl:28 ../tools/virt-list-partitions.pl:28 ../tools/virt-ls.pl:31 ../tools/virt-make-fs.pl:33 ../tools/virt-rescue.pl:29 ../tools/virt-resize.pl:38 ../tools/virt-tar.pl:30 ../tools/virt-win-reg.pl:34
25 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pl:38 ../tools/virt-cat.pl:32 ../tools/virt-df.pl:34 ../tools/virt-edit.pl:33 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-ls.pl:33 ../tools/virt-make-fs.pl:35 ../tools/virt-rescue.pl:31 ../tools/virt-resize.pl:40 ../tools/virt-tar.pl:32 ../tools/virt-win-reg.pl:36
30 #: ../src/guestfs.pod:5
31 msgid "guestfs - Library for accessing and modifying virtual machine images"
35 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pl:42 ../tools/virt-cat.pl:36 ../tools/virt-df.pl:38 ../tools/virt-edit.pl:37 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-ls.pl:37 ../tools/virt-make-fs.pl:39 ../tools/virt-rescue.pl:35 ../tools/virt-resize.pl:44 ../tools/virt-tar.pl:36 ../tools/virt-win-reg.pl:40
40 #: ../src/guestfs.pod:9
43 " #include <guestfs.h>\n"
48 #: ../src/guestfs.pod:11
51 " guestfs_h *g = guestfs_create ();\n"
52 " guestfs_add_drive (g, \"guest.img\");\n"
53 " guestfs_launch (g);\n"
54 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
55 " guestfs_touch (g, \"/hello\");\n"
56 " guestfs_umount (g, \"/\");\n"
57 " guestfs_sync (g);\n"
58 " guestfs_close (g);\n"
63 #: ../src/guestfs.pod:20
66 " cc prog.c -o prog -lguestfs\n"
68 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
73 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:115 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:16 ../inspector/virt-inspector.pl:48 ../tools/virt-cat.pl:42 ../tools/virt-df.pl:46 ../tools/virt-edit.pl:51 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-ls.pl:43 ../tools/virt-make-fs.pl:47 ../tools/virt-rescue.pl:51 ../tools/virt-resize.pl:50 ../tools/virt-tar.pl:73 ../tools/virt-win-reg.pl:64
78 #: ../src/guestfs.pod:26
80 "Libguestfs is a library for accessing and modifying guest disk images. "
81 "Amongst the things this is good for: making batch configuration changes to "
82 "guests, getting disk used/free statistics (see also: virt-df), migrating "
83 "between virtualization systems (see also: virt-p2v), performing partial "
84 "backups, performing partial guest clones, cloning guests and changing "
85 "registry/UUID/hostname info, and much else besides."
89 #: ../src/guestfs.pod:34
91 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
92 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
93 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
98 #: ../src/guestfs.pod:39
100 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
101 "what filesystem is in each LV, etc.). It can also run commands in the "
102 "context of the guest. Also you can access filesystems over FUSE."
106 #: ../src/guestfs.pod:44
108 "Libguestfs is a library that can be linked with C and C++ management "
109 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
110 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
115 #: ../src/guestfs.pod:49
117 "You don't need to be root to use libguestfs, although obviously you do need "
118 "enough permissions to access the disk images."
122 #: ../src/guestfs.pod:52
124 "Libguestfs is a large API because it can do many things. For a gentle "
125 "introduction, please read the L</API OVERVIEW> section next."
129 #: ../src/guestfs.pod:55
134 #: ../src/guestfs.pod:57
136 "This section provides a gentler overview of the libguestfs API. We also try "
137 "to group API calls together, where that may not be obvious from reading "
138 "about the individual calls in the main section of this manual."
142 #: ../src/guestfs.pod:62
147 #: ../src/guestfs.pod:64
149 "Before you can use libguestfs calls, you have to create a handle. Then you "
150 "must add at least one disk image to the handle, followed by launching the "
151 "handle, then performing whatever operations you want, and finally closing "
152 "the handle. By convention we use the single letter C<g> for the name of the "
153 "handle variable, although of course you can use any name you want."
157 #: ../src/guestfs.pod:71
158 msgid "The general structure of all libguestfs-using programs looks like this:"
162 #: ../src/guestfs.pod:74
165 " guestfs_h *g = guestfs_create ();\n"
170 #: ../src/guestfs.pod:76
173 " /* Call guestfs_add_drive additional times if there are\n"
174 " * multiple disk images.\n"
176 " guestfs_add_drive (g, \"guest.img\");\n"
181 #: ../src/guestfs.pod:81
184 " /* Most manipulation calls won't work until you've launched\n"
185 " * the handle 'g'. You have to do this _after_ adding drives\n"
186 " * and _before_ other commands.\n"
188 " guestfs_launch (g);\n"
193 #: ../src/guestfs.pod:87
196 " /* Now you can examine what partitions, LVs etc are available.\n"
198 " char **partitions = guestfs_list_partitions (g);\n"
199 " char **logvols = guestfs_lvs (g);\n"
204 #: ../src/guestfs.pod:92
207 " /* To access a filesystem in the image, you must mount it.\n"
209 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
214 #: ../src/guestfs.pod:96
217 " /* Now you can perform filesystem actions on the guest\n"
220 " guestfs_touch (g, \"/hello\");\n"
225 #: ../src/guestfs.pod:101
228 " /* You only need to call guestfs_sync if you have made\n"
229 " * changes to the guest image. (But if you've made changes\n"
230 " * then you *must* sync). See also: guestfs_umount and\n"
231 " * guestfs_umount_all calls.\n"
233 " guestfs_sync (g);\n"
238 #: ../src/guestfs.pod:108
241 " /* Close the handle 'g'. */\n"
242 " guestfs_close (g);\n"
247 #: ../src/guestfs.pod:111
249 "The code above doesn't include any error checking. In real code you should "
250 "check return values carefully for errors. In general all functions that "
251 "return integers return C<-1> on error, and all functions that return "
252 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
253 "how to handle errors, and consult the documentation for each function call "
254 "below to see precisely how they return error indications."
258 #: ../src/guestfs.pod:119
263 #: ../src/guestfs.pod:121
265 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
266 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
267 "actual block device, or simply an empty file of zeroes that you have created "
268 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
273 #: ../src/guestfs.pod:127
275 "You can add a disk read-only using L</guestfs_add_drive_ro>, in which case "
276 "libguestfs won't modify the file."
280 #: ../src/guestfs.pod:130
282 "Be extremely cautious if the disk image is in use, eg. if it is being used "
283 "by a virtual machine. Adding it read-write will almost certainly cause disk "
284 "corruption, but adding it read-only is safe."
288 #: ../src/guestfs.pod:134
290 "You must add at least one disk image, and you may add multiple disk images. "
291 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
292 "first one you added), C</dev/sdb> (for the second one you added), etc."
296 #: ../src/guestfs.pod:139
298 "Once L</guestfs_launch> has been called you cannot add any more images. You "
299 "can call L</guestfs_list_devices> to get a list of the device names, in the "
300 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
304 #: ../src/guestfs.pod:144
309 #: ../src/guestfs.pod:146
311 "Before you can read or write files, create directories and so on in a disk "
312 "image that contains filesystems, you have to mount those filesystems using "
313 "L</guestfs_mount>. If you already know that a disk image contains (for "
314 "example) one partition with a filesystem on that partition, then you can "
319 #: ../src/guestfs.pod:152
322 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
327 #: ../src/guestfs.pod:154
329 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
330 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
331 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
335 #: ../src/guestfs.pod:158
337 "If you are given a disk image and you don't know what it contains then you "
338 "have to find out. Libguestfs can do that too: use "
339 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
340 "and LVs, and either try mounting each to see what is mountable, or else "
341 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also "
342 "has a set of APIs for inspection of disk images (see L</INSPECTION> below). "
343 "But you might find it easier to look at higher level programs built on top "
344 "of libguestfs, in particular L<virt-inspector(1)>."
348 #: ../src/guestfs.pod:168
350 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
351 "several other variations of the C<guestfs_mount_*> call."
355 #: ../src/guestfs.pod:171
356 msgid "FILESYSTEM ACCESS AND MODIFICATION"
360 #: ../src/guestfs.pod:173
362 "The majority of the libguestfs API consists of fairly low-level calls for "
363 "accessing and modifying the files, directories, symlinks etc on mounted "
364 "filesystems. There are over a hundred such calls which you can find listed "
365 "in detail below in this man page, and we don't even pretend to cover them "
366 "all in this overview."
370 #: ../src/guestfs.pod:179
372 "Specify filenames as full paths, starting with C<\"/\"> and including the "
377 #: ../src/guestfs.pod:182
379 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
380 "the file called C<\"etc/passwd\"> then you could do:"
384 #: ../src/guestfs.pod:185
387 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
392 #: ../src/guestfs.pod:187
394 "This would return C<data> as a newly allocated buffer containing the full "
395 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
396 "or C<NULL> if there was an error."
400 #: ../src/guestfs.pod:191
402 "As another example, to create a top-level directory on that filesystem "
403 "called C<\"var\"> you would do:"
407 #: ../src/guestfs.pod:194
410 " guestfs_mkdir (g, \"/var\");\n"
415 #: ../src/guestfs.pod:196
416 msgid "To create a symlink you could do:"
420 #: ../src/guestfs.pod:198
423 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
424 " \"/etc/rc3.d/S30portmap\");\n"
429 #: ../src/guestfs.pod:201
431 "Libguestfs will reject attempts to use relative paths and there is no "
432 "concept of a current working directory."
436 #: ../src/guestfs.pod:204
438 "Libguestfs can return errors in many situations: for example if the "
439 "filesystem isn't writable, or if a file or directory that you requested "
440 "doesn't exist. If you are using the C API (documented here) you have to "
441 "check for those error conditions after each call. (Other language bindings "
442 "turn these errors into exceptions)."
446 #: ../src/guestfs.pod:210
448 "File writes are affected by the per-handle umask, set by calling "
449 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
453 #: ../src/guestfs.pod:213
458 #: ../src/guestfs.pod:215
460 "Libguestfs contains API calls to read, create and modify partition tables on "
465 #: ../src/guestfs.pod:218
467 "In the common case where you want to create a single partition covering the "
468 "whole disk, you should use the L</guestfs_part_disk> call:"
472 #: ../src/guestfs.pod:222
475 " const char *parttype = \"mbr\";\n"
476 " if (disk_is_larger_than_2TB)\n"
477 " parttype = \"gpt\";\n"
478 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
483 #: ../src/guestfs.pod:227
485 "Obviously this effectively wipes anything that was on that disk image "
490 #: ../src/guestfs.pod:230
495 #: ../src/guestfs.pod:232
497 "Libguestfs provides access to a large part of the LVM2 API, such as "
498 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
499 "unless you familiarize yourself with the concepts of physical volumes, "
500 "volume groups and logical volumes."
504 #: ../src/guestfs.pod:237
506 "This author strongly recommends reading the LVM HOWTO, online at "
507 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
511 #: ../src/guestfs.pod:240
516 #: ../src/guestfs.pod:242
518 "Use L</guestfs_cat> to download small, text only files. This call is "
519 "limited to files which are less than 2 MB and which cannot contain any ASCII "
520 "NUL (C<\\0>) characters. However it has a very simple to use API."
524 #: ../src/guestfs.pod:247
526 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
527 "bit data, since it returns a (pointer, size) pair. However it is still "
528 "limited to \"small\" files, less than 2 MB."
532 #: ../src/guestfs.pod:251
534 "L</guestfs_download> can be used to download any file, with no limits on "
535 "content or size (even files larger than 4 GB)."
539 #: ../src/guestfs.pod:254
540 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
544 #: ../src/guestfs.pod:257
549 #: ../src/guestfs.pod:259
551 "It's often the case that you want to write a file or files to the disk "
556 #: ../src/guestfs.pod:262
558 "To write a small file with fixed content, use L</guestfs_write>. To create "
559 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
560 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
561 "variety of other functions for creating test files, for example "
562 "L</guestfs_fill> and L</guestfs_fill_pattern>."
566 #: ../src/guestfs.pod:268
568 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
569 "file content or size (even files larger than 4 GB)."
573 #: ../src/guestfs.pod:271
574 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
578 #: ../src/guestfs.pod:273
580 "However the fastest way to upload I<large numbers of arbitrary files> is to "
581 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
582 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
583 "the drive in a predictable way (eg. adding it last after all other drives) "
584 "then you can get the device name from L</guestfs_list_devices> and mount it "
585 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
586 "sometimes non-portable between kernel versions, and they don't support "
587 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
588 "using a label or UUID, use an ISO image instead."
592 #: ../src/guestfs.pod:284
597 #: ../src/guestfs.pod:286
599 "There are various different commands for copying between files and devices "
600 "and in and out of the guest filesystem. These are summarised in the table "
605 #: ../src/guestfs.pod:292
606 msgid "B<file> to B<file>"
610 #: ../src/guestfs.pod:294
612 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
613 "directories recursively."
617 #: ../src/guestfs.pod:297
618 msgid "B<file or device> to B<file or device>"
622 #: ../src/guestfs.pod:299
624 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
625 "devices in the guest."
629 #: ../src/guestfs.pod:302
630 msgid "Example: duplicate the contents of an LV:"
634 #: ../src/guestfs.pod:304
637 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
642 #: ../src/guestfs.pod:306
644 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
645 "(C</dev/VG/Original>). To copy less than the whole source device, use "
646 "L</guestfs_copy_size>."
650 #: ../src/guestfs.pod:310
651 msgid "B<file on the host> to B<file or device>"
655 #: ../src/guestfs.pod:312
656 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
660 #: ../src/guestfs.pod:314
661 msgid "B<file or device> to B<file on the host>"
665 #: ../src/guestfs.pod:316
666 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
670 #: ../src/guestfs.pod:320
671 msgid "LISTING FILES"
675 #: ../src/guestfs.pod:322
677 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
678 "L<guestfish(1)>-equivalent command C<ll>)."
682 #: ../src/guestfs.pod:325
684 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
685 "programs, as a flat list of strings."
689 #: ../src/guestfs.pod:328
691 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
692 "directory, plus additional information about each one. It is more "
693 "equivalent to using the L<readdir(3)> call on a local filesystem."
697 #: ../src/guestfs.pod:332
699 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
704 #: ../src/guestfs.pod:335
705 msgid "RUNNING COMMANDS"
709 #: ../src/guestfs.pod:337
711 "Although libguestfs is primarily an API for manipulating files inside guest "
712 "images, we also provide some limited facilities for running commands inside "
717 #: ../src/guestfs.pod:341
718 msgid "There are many limitations to this:"
722 #: ../src/guestfs.pod:345 ../src/guestfs.pod:350 ../src/guestfs.pod:355 ../src/guestfs.pod:359 ../src/guestfs.pod:364 ../src/guestfs.pod:368 ../src/guestfs.pod:373 ../src/guestfs.pod:1223 ../src/guestfs.pod:1228 ../src/guestfs.pod:1232 ../src/guestfs.pod:1334 ../src/guestfs.pod:1338 ../src/guestfs.pod:1342 ../src/guestfs.pod:1347 ../src/guestfs.pod:1355 ../src/guestfs.pod:1374 ../src/guestfs.pod:1382 ../src/guestfs.pod:1612 ../src/guestfs.pod:1618 ../src/guestfs.pod:1623 ../src/guestfs.pod:1629 ../src/guestfs.pod:1736 ../src/guestfs.pod:1740 ../src/guestfs.pod:1744 ../src/guestfs.pod:1748 ../src/guestfs-actions.pod:14 ../src/guestfs-actions.pod:21 ../src/guestfs-actions.pod:372 ../src/guestfs-actions.pod:380 ../src/guestfs-actions.pod:387 ../src/guestfs-actions.pod:394 ../src/guestfs-actions.pod:1257 ../src/guestfs-actions.pod:1261 ../src/guestfs-actions.pod:1265 ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1426 ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1435 ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1492 ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:1501 ../fish/guestfish.pod:309 ../fish/guestfish.pod:313 ../fish/guestfish.pod:317 ../fish/guestfish.pod:321 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:300 ../fish/guestfish-actions.pod:308 ../fish/guestfish-actions.pod:315 ../fish/guestfish-actions.pod:322 ../fish/guestfish-actions.pod:998 ../fish/guestfish-actions.pod:1002 ../fish/guestfish-actions.pod:1006 ../fish/guestfish-actions.pod:1010 ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1022 ../fish/guestfish-actions.pod:1026 ../fish/guestfish-actions.pod:1036 ../fish/guestfish-actions.pod:1040 ../fish/guestfish-actions.pod:1044 ../fish/guestfish-actions.pod:1134 ../fish/guestfish-actions.pod:1138 ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1148 ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1194 ../fish/guestfish-actions.pod:1199 ../tools/virt-resize.pl:324 ../tools/virt-resize.pl:329 ../tools/virt-resize.pl:339
727 #: ../src/guestfs.pod:347
729 "The kernel version that the command runs under will be different from what "
734 #: ../src/guestfs.pod:352
736 "If the command needs to communicate with daemons, then most likely they "
741 #: ../src/guestfs.pod:357
742 msgid "The command will be running in limited memory."
746 #: ../src/guestfs.pod:361
748 "The network may not be available unless you enable it (see "
749 "L</guestfs_set_network>)."
753 #: ../src/guestfs.pod:366
754 msgid "Only supports Linux guests (not Windows, BSD, etc)."
758 #: ../src/guestfs.pod:370
759 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
763 #: ../src/guestfs.pod:375
765 "For SELinux guests, you may need to enable SELinux and load policy first. "
766 "See L</SELINUX> in this manpage."
770 #: ../src/guestfs.pod:380
772 "The two main API calls to run commands are L</guestfs_command> and "
773 "L</guestfs_sh> (there are also variations)."
777 #: ../src/guestfs.pod:383
779 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
780 "shell globs, redirections, etc will work."
784 #: ../src/guestfs.pod:386
785 msgid "CONFIGURATION FILES"
789 #: ../src/guestfs.pod:388
791 "To read and write configuration files in Linux guest filesystems, we "
792 "strongly recommend using Augeas. For example, Augeas understands how to "
793 "read and write, say, a Linux shadow password file or X.org configuration "
794 "file, and so avoids you having to write that code."
798 #: ../src/guestfs.pod:393
800 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
801 "document Augeas itself here because there is excellent documentation on the "
802 "L<http://augeas.net/> website."
806 #: ../src/guestfs.pod:397
808 "If you don't want to use Augeas (you fool!) then try calling "
809 "L</guestfs_read_lines> to get the file as a list of lines which you can "
814 #: ../src/guestfs.pod:401
819 #: ../src/guestfs.pod:403
821 "We support SELinux guests. To ensure that labeling happens correctly in "
822 "SELinux guests, you need to enable SELinux and load the guest's policy:"
826 #: ../src/guestfs.pod:409
831 #: ../src/guestfs.pod:411
832 msgid "Before launching, do:"
836 #: ../src/guestfs.pod:413
839 " guestfs_set_selinux (g, 1);\n"
844 #: ../src/guestfs.pod:415
849 #: ../src/guestfs.pod:417
851 "After mounting the guest's filesystem(s), load the policy. This is best "
852 "done by running the L<load_policy(8)> command in the guest itself:"
856 #: ../src/guestfs.pod:421
859 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
864 #: ../src/guestfs.pod:423
866 "(Older versions of C<load_policy> require you to specify the name of the "
871 #: ../src/guestfs.pod:426
876 #: ../src/guestfs.pod:428
878 "Optionally, set the security context for the API. The correct security "
879 "context to use can only be known by inspecting the guest. As an example:"
883 #: ../src/guestfs.pod:432
886 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
891 #: ../src/guestfs.pod:436
892 msgid "This will work for running commands and editing existing files."
896 #: ../src/guestfs.pod:438
898 "When new files are created, you may need to label them explicitly, for "
899 "example by running the external command C<restorecon pathname>."
903 #: ../src/guestfs.pod:442
908 #: ../src/guestfs.pod:444
910 "Certain calls are affected by the current file mode creation mask (the "
911 "\"umask\"). In particular ones which create files or directories, such as "
912 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
913 "either the default mode that the file is created with or modifies the mode "
918 #: ../src/guestfs.pod:450
920 "The default umask is C<022>, so files are created with modes such as C<0644> "
921 "and directories with C<0755>."
925 #: ../src/guestfs.pod:453
927 "There are two ways to avoid being affected by umask. Either set umask to 0 "
928 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
929 "L</guestfs_chmod> after creating each file or directory."
933 #: ../src/guestfs.pod:457
934 msgid "For more information about umask, see L<umask(2)>."
938 #: ../src/guestfs.pod:459 ../fish/guestfish.pod:559
939 msgid "ENCRYPTED DISKS"
943 #: ../src/guestfs.pod:461
945 "Libguestfs allows you to access Linux guests which have been encrypted using "
946 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
947 "standard. This includes nearly all whole disk encryption systems used by "
948 "modern Linux guests."
952 #: ../src/guestfs.pod:467
954 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
955 "returns the string C<crypto_LUKS>)."
959 #: ../src/guestfs.pod:470
961 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
962 "will require the passphrase!"
966 #: ../src/guestfs.pod:473
968 "Opening a LUKS device creates a new device mapper device called "
969 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
970 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
971 "decrypted from and encrypted to the underlying block device respectively."
975 #: ../src/guestfs.pod:479
977 "LVM volume groups on the device can be made visible by calling "
978 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
979 "volume(s) can now be mounted in the usual way."
983 #: ../src/guestfs.pod:483
985 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
986 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
987 "[\"/dev/VG\"])>. Then close the mapper device by calling "
988 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
989 "underlying encrypted block device)."
993 #: ../src/guestfs.pod:490
998 #: ../src/guestfs.pod:492
1000 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1001 "contains operating systems. (These APIs used to be in a separate Perl-only "
1002 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1003 "frequently used part of this library has been rewritten in C and moved into "
1008 #: ../src/guestfs.pod:498
1010 "Add all disks belonging to the unknown virtual machine and call "
1011 "L</guestfs_launch> in the usual way."
1015 #: ../src/guestfs.pod:501
1017 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1018 "and certain heuristics, and returns a list of operating systems that were "
1019 "found. An empty list means none were found. A single element is the root "
1020 "filesystem of the operating system. For dual- or multi-boot guests, "
1021 "multiple roots can be returned, each one corresponding to a separate "
1022 "operating system. (Multi-boot virtual machines are extremely rare in the "
1023 "world of virtualization, but since this scenario can happen, we have built "
1024 "libguestfs to deal with it.)"
1028 #: ../src/guestfs.pod:510
1030 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1031 "to get additional details about that operating system. For example, call "
1032 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1033 "Windows and Linux-based operating systems respectively."
1037 #: ../src/guestfs.pod:516
1039 "Un*x-like and Linux-based operating systems usually consist of several "
1040 "filesystems which are mounted at boot time (for example, a separate boot "
1041 "partition mounted on C</boot>). The inspection rules are able to detect how "
1042 "filesystems correspond to mount points. Call "
1043 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1044 "hash table like this example:"
1048 #: ../src/guestfs.pod:523
1051 " /boot => /dev/sda1\n"
1052 " / => /dev/vg_guest/lv_root\n"
1053 " /usr => /dev/vg_guest/lv_usr\n"
1058 #: ../src/guestfs.pod:527
1060 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1061 "filesystems as suggested."
1065 #: ../src/guestfs.pod:530
1067 "Be careful to mount filesystems in the right order (eg. C</> before "
1068 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1073 #: ../src/guestfs.pod:534
1075 "Inspection currently only works for some common operating systems. "
1076 "Contributors are welcome to send patches for other operating systems that we "
1077 "currently cannot detect."
1081 #: ../src/guestfs.pod:538
1083 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1084 "for more details. The L</guestfs_inspect_os> function just ignores any "
1085 "encrypted devices."
1089 #: ../src/guestfs.pod:542
1091 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1092 "inspection and caches the results in the guest handle. Subsequent calls to "
1093 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1094 "re-read the disks. If you change the content of the guest disks, you can "
1095 "redo inspection by calling L</guestfs_inspect_os> again."
1099 #: ../src/guestfs.pod:549
1100 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1104 #: ../src/guestfs.pod:551
1106 "Libguestfs can mount NTFS partitions. It does this using the "
1107 "L<http://www.ntfs-3g.org/> driver."
1111 #: ../src/guestfs.pod:554
1113 "DOS and Windows still use drive letters, and the filesystems are always "
1114 "treated as case insensitive by Windows itself, and therefore you might find "
1115 "a Windows configuration file referring to a path like "
1116 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1117 "that directory might be referred to as C</WINDOWS/System32>."
1121 #: ../src/guestfs.pod:560
1123 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1124 "libguestfs to read the appropriate Windows Registry and configuration files, "
1125 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1126 "L<virt-inspector(1)>)."
1130 #: ../src/guestfs.pod:565
1132 "Replacing backslash characters with forward slash characters is also outside "
1133 "the scope of libguestfs, but something that you can easily do."
1137 #: ../src/guestfs.pod:568
1139 "Where we can help is in resolving the case insensitivity of paths. For "
1140 "this, call L</guestfs_case_sensitive_path>."
1144 #: ../src/guestfs.pod:571
1146 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1147 "files, through the library C<hivex> which is part of the libguestfs project "
1148 "although ships as a separate tarball. You have to locate and download the "
1149 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1150 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1151 "L<virt-win-reg(1)> for more help on this issue."
1155 #: ../src/guestfs.pod:579
1156 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1160 #: ../src/guestfs.pod:581
1162 "Although we don't want to discourage you from using the C API, we will "
1163 "mention here that the same API is also available in other languages."
1167 #: ../src/guestfs.pod:584
1169 "The API is broadly identical in all supported languages. This means that "
1170 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, "
1171 "C<g.mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1172 "words, a straightforward, predictable isomorphism between each language."
1176 #: ../src/guestfs.pod:590
1178 "Error messages are automatically transformed into exceptions if the language "
1183 #: ../src/guestfs.pod:593
1185 "We don't try to \"object orientify\" parts of the API in OO languages, "
1186 "although contributors are welcome to write higher level APIs above what we "
1187 "provide in their favourite languages if they wish."
1191 #: ../src/guestfs.pod:599
1196 #: ../src/guestfs.pod:601
1198 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1199 "identical to the C API. C++ classes and exceptions are not used."
1203 #: ../src/guestfs.pod:605
1208 #: ../src/guestfs.pod:607
1210 "The C# bindings are highly experimental. Please read the warnings at the "
1211 "top of C<csharp/Libguestfs.cs>."
1215 #: ../src/guestfs.pod:610
1220 #: ../src/guestfs.pod:612
1222 "This is the only language binding that is working but incomplete. Only "
1223 "calls which return simple integers have been bound in Haskell, and we are "
1224 "looking for help to complete this binding."
1228 #: ../src/guestfs.pod:616
1233 #: ../src/guestfs.pod:618
1235 "Full documentation is contained in the Javadoc which is distributed with "
1240 #: ../src/guestfs.pod:621
1245 #: ../src/guestfs.pod:623
1246 msgid "For documentation see the file C<guestfs.mli>."
1250 #: ../src/guestfs.pod:625
1255 #: ../src/guestfs.pod:627
1256 msgid "For documentation see L<Sys::Guestfs(3)>."
1260 #: ../src/guestfs.pod:629
1265 #: ../src/guestfs.pod:631
1267 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1268 "the php-libguestfs package for your distribution."
1272 #: ../src/guestfs.pod:634
1273 msgid "The PHP binding only works correctly on 64 bit machines."
1277 #: ../src/guestfs.pod:636
1282 #: ../src/guestfs.pod:638
1283 msgid "For documentation do:"
1287 #: ../src/guestfs.pod:640
1291 " >>> import guestfs\n"
1292 " >>> help (guestfs)\n"
1297 #: ../src/guestfs.pod:644
1302 #: ../src/guestfs.pod:646
1304 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1305 "can find examples written in Ruby in the libguestfs source."
1309 #: ../src/guestfs.pod:649
1310 msgid "B<shell scripts>"
1314 #: ../src/guestfs.pod:651
1315 msgid "For documentation see L<guestfish(1)>."
1319 #: ../src/guestfs.pod:655
1320 msgid "LIBGUESTFS GOTCHAS"
1324 #: ../src/guestfs.pod:657
1326 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1327 "system [...] that works in the way it is documented but is counterintuitive "
1328 "and almost invites mistakes.\""
1332 #: ../src/guestfs.pod:661
1334 "Since we developed libguestfs and the associated tools, there are several "
1335 "things we would have designed differently, but are now stuck with for "
1336 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1337 "release, you can expect these to change. Beware of them."
1341 #: ../src/guestfs.pod:669
1342 msgid "Autosync / forgetting to sync."
1346 #: ../src/guestfs.pod:671
1348 "When modifying a filesystem from C or another language, you B<must> unmount "
1349 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1350 "libguestfs handle. You can also call:"
1354 #: ../src/guestfs.pod:675
1357 " guestfs_set_autosync (g, 1);\n"
1362 #: ../src/guestfs.pod:677
1364 "to have the unmount/sync done automatically for you when the handle 'g' is "
1365 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1370 #: ../src/guestfs.pod:681
1372 "If you forget to do this, then it is entirely possible that your changes "
1373 "won't be written out, or will be partially written, or (very rarely) that "
1374 "you'll get disk corruption."
1378 #: ../src/guestfs.pod:685
1380 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1381 "guestfish scripts that forget to sync will work just fine, which can make "
1382 "this very puzzling if you are trying to debug a problem."
1386 #: ../src/guestfs.pod:689
1387 msgid "Mount option C<-o sync> should not be the default."
1391 #: ../src/guestfs.pod:691
1393 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1394 "However C<-o sync> does not add any reliability benefit, but does have a "
1395 "very large performance impact."
1399 #: ../src/guestfs.pod:695
1401 "The work around is to use L</guestfs_mount_options> and set the mount "
1402 "options that you actually want to use."
1406 #: ../src/guestfs.pod:698
1407 msgid "Read-only should be the default."
1411 #: ../src/guestfs.pod:700
1413 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1414 "specify I<--rw> if you want to make changes to the image."
1418 #: ../src/guestfs.pod:703
1419 msgid "This would reduce the potential to corrupt live VM images."
1423 #: ../src/guestfs.pod:705
1425 "Note that many filesystems change the disk when you just mount and unmount, "
1426 "even if you didn't perform any writes. You need to use "
1427 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1431 #: ../src/guestfs.pod:709
1432 msgid "guestfish command line is hard to use."
1436 #: ../src/guestfs.pod:711
1438 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1439 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1440 "exist, so it fails. In earlier versions of guestfish the error message was "
1441 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1442 "we should have used C<guestfish -c command> to run commands."
1446 #: ../src/guestfs.pod:718
1447 msgid "guestfish megabyte modifiers don't work right on all commands"
1451 #: ../src/guestfs.pod:720
1453 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1454 "other modifiers). What guestfish actually does is to multiply the number "
1455 "part by the modifier part and pass the result to the C API. However this "
1456 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1457 "expecting some other unit (eg. megabytes)."
1461 #: ../src/guestfs.pod:727
1462 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1466 #: ../src/guestfs.pod:729
1469 " lvcreate LV VG 100M\n"
1474 #: ../src/guestfs.pod:731
1476 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1477 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1478 "megabytes * megabytes) logical volume. The error message you get from this "
1479 "is also a little obscure."
1483 #: ../src/guestfs.pod:736
1485 "This could be fixed in the generator by specially marking parameters and "
1486 "return values which take bytes or other units."
1490 #: ../src/guestfs.pod:739
1491 msgid "Library should return errno with error messages."
1495 #: ../src/guestfs.pod:741
1497 "It would be a nice-to-have to be able to get the original value of 'errno' "
1498 "from inside the appliance along error paths (where set). Currently "
1499 "L<guestmount(1)> goes through hoops to try to reverse the error message "
1500 "string into an errno, see the function error() in fuse/guestmount.c."
1504 #: ../src/guestfs.pod:747
1506 "In libguestfs 1.5.4, the protocol was changed so that the Linux errno is "
1507 "sent back from the daemon."
1511 #: ../src/guestfs.pod:752
1512 msgid "PROTOCOL LIMITS"
1516 #: ../src/guestfs.pod:754
1518 "Internally libguestfs uses a message-based protocol to pass API calls and "
1519 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1520 "plenty more detail about this). The maximum message size used by the "
1521 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1522 "aware of this limit. The API calls which may be affected are individually "
1523 "documented, with a link back to this section of the documentation."
1527 #: ../src/guestfs.pod:762
1529 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1530 "a simple string. Because this string is at some point internally encoded as "
1531 "a message, the maximum size that it can return is slightly under 4 MB. If "
1532 "the requested file is larger than this then you will get an error."
1536 #: ../src/guestfs.pod:768
1538 "In order to transfer large files into and out of the guest filesystem, you "
1539 "need to use particular calls that support this. The sections L</UPLOADING> "
1540 "and L</DOWNLOADING> document how to do this."
1544 #: ../src/guestfs.pod:772
1546 "You might also consider mounting the disk image using our FUSE filesystem "
1547 "support (L<guestmount(1)>)."
1551 #: ../src/guestfs.pod:775
1552 msgid "KEYS AND PASSPHRASES"
1556 #: ../src/guestfs.pod:777
1558 "Certain libguestfs calls take a parameter that contains sensitive key "
1559 "material, passed in as a C string."
1563 #: ../src/guestfs.pod:780
1565 "In the future we would hope to change the libguestfs implementation so that "
1566 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1567 "swap. However this is I<not> done at the moment, because of the complexity "
1568 "of such an implementation."
1572 #: ../src/guestfs.pod:785
1574 "Therefore you should be aware that any key parameter you pass to libguestfs "
1575 "might end up being written out to the swap partition. If this is a concern, "
1576 "scrub the swap partition or don't use libguestfs on encrypted devices."
1580 #: ../src/guestfs.pod:790
1581 msgid "CONNECTION MANAGEMENT"
1585 #: ../src/guestfs.pod:792
1590 #: ../src/guestfs.pod:794
1592 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
1593 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
1594 "handle and release all resources used."
1598 #: ../src/guestfs.pod:798
1600 "For information on using multiple handles and threads, see the section "
1601 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
1605 #: ../src/guestfs.pod:801
1606 msgid "guestfs_create"
1610 #: ../src/guestfs.pod:803
1613 " guestfs_h *guestfs_create (void);\n"
1618 #: ../src/guestfs.pod:805
1619 msgid "Create a connection handle."
1623 #: ../src/guestfs.pod:807
1624 msgid "You have to call L</guestfs_add_drive> on the handle at least once."
1628 #: ../src/guestfs.pod:809
1630 "This function returns a non-NULL pointer to a handle on success or NULL on "
1635 #: ../src/guestfs.pod:812
1636 msgid "After configuring the handle, you have to call L</guestfs_launch>."
1640 #: ../src/guestfs.pod:814
1642 "You may also want to configure error handling for the handle. See L</ERROR "
1643 "HANDLING> section below."
1647 #: ../src/guestfs.pod:817
1648 msgid "guestfs_close"
1652 #: ../src/guestfs.pod:819
1655 " void guestfs_close (guestfs_h *g);\n"
1660 #: ../src/guestfs.pod:821
1661 msgid "This closes the connection handle and frees up all resources used."
1665 #: ../src/guestfs.pod:823
1666 msgid "ERROR HANDLING"
1670 #: ../src/guestfs.pod:825
1672 "The convention in all functions that return C<int> is that they return C<-1> "
1673 "to indicate an error. You can get additional information on errors by "
1674 "calling L</guestfs_last_error> and/or by setting up an error handler with "
1675 "L</guestfs_set_error_handler>."
1679 #: ../src/guestfs.pod:830
1680 msgid "The default error handler prints the information string to C<stderr>."
1684 #: ../src/guestfs.pod:832
1686 "Out of memory errors are handled differently. The default action is to call "
1687 "L<abort(3)>. If this is undesirable, then you can set a handler using "
1688 "L</guestfs_set_out_of_memory_handler>."
1692 #: ../src/guestfs.pod:836
1693 msgid "guestfs_last_error"
1697 #: ../src/guestfs.pod:838
1700 " const char *guestfs_last_error (guestfs_h *g);\n"
1705 #: ../src/guestfs.pod:840
1707 "This returns the last error message that happened on C<g>. If there has not "
1708 "been an error since the handle was created, then this returns C<NULL>."
1712 #: ../src/guestfs.pod:844
1714 "The lifetime of the returned string is until the next error occurs, or "
1715 "L</guestfs_close> is called."
1719 #: ../src/guestfs.pod:847
1721 "The error string is not localized (ie. is always in English), because this "
1722 "makes searching for error messages in search engines give the largest number "
1727 #: ../src/guestfs.pod:851
1728 msgid "guestfs_set_error_handler"
1732 #: ../src/guestfs.pod:853
1735 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
1737 " const char *msg);\n"
1738 " void guestfs_set_error_handler (guestfs_h *g,\n"
1739 " guestfs_error_handler_cb cb,\n"
1745 #: ../src/guestfs.pod:860
1747 "The callback C<cb> will be called if there is an error. The parameters "
1748 "passed to the callback are an opaque data pointer and the error message "
1753 #: ../src/guestfs.pod:864
1755 "Note that the message string C<msg> is freed as soon as the callback "
1756 "function returns, so if you want to stash it somewhere you must make your "
1761 #: ../src/guestfs.pod:868
1762 msgid "The default handler prints messages on C<stderr>."
1766 #: ../src/guestfs.pod:870
1767 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
1771 #: ../src/guestfs.pod:872
1772 msgid "guestfs_get_error_handler"
1776 #: ../src/guestfs.pod:874
1779 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
1780 " void **opaque_rtn);\n"
1785 #: ../src/guestfs.pod:877
1786 msgid "Returns the current error handler callback."
1790 #: ../src/guestfs.pod:879
1791 msgid "guestfs_set_out_of_memory_handler"
1795 #: ../src/guestfs.pod:881
1798 " typedef void (*guestfs_abort_cb) (void);\n"
1799 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
1800 " guestfs_abort_cb);\n"
1805 #: ../src/guestfs.pod:885
1807 "The callback C<cb> will be called if there is an out of memory situation. "
1808 "I<Note this callback must not return>."
1812 #: ../src/guestfs.pod:888
1813 msgid "The default is to call L<abort(3)>."
1817 #: ../src/guestfs.pod:890
1818 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
1822 #: ../src/guestfs.pod:893
1823 msgid "guestfs_get_out_of_memory_handler"
1827 #: ../src/guestfs.pod:895
1830 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
1835 #: ../src/guestfs.pod:897
1836 msgid "This returns the current out of memory handler."
1840 #: ../src/guestfs.pod:899
1845 #: ../src/guestfs.pod:901
1847 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1852 #: ../src/guestfs.pod:904
1854 "By default it looks for these in the directory C<$libdir/guestfs> "
1855 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1859 #: ../src/guestfs.pod:907
1861 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1862 "to change the directories that libguestfs will search in. The value is a "
1863 "colon-separated list of paths. The current directory is I<not> searched "
1864 "unless the path contains an empty element or C<.>. For example "
1865 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1866 "then C</usr/lib/guestfs>."
1870 #: ../src/guestfs.pod:914
1871 msgid "HIGH-LEVEL API ACTIONS"
1875 #: ../src/guestfs.pod:916
1876 msgid "ABI GUARANTEE"
1880 #: ../src/guestfs.pod:918
1882 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1883 "actions as outlined in this section. Although we will deprecate some "
1884 "actions, for example if they get replaced by newer calls, we will keep the "
1885 "old actions forever. This allows you the developer to program in confidence "
1886 "against the libguestfs API."
1890 #: ../src/guestfs.pod:924 ../fish/guestfish.pod:789
1895 #: ../src/guestfs.pod:926
1900 #: ../src/guestfs.pod:928
1905 #: ../src/guestfs.pod:930
1906 msgid "AVAILABILITY"
1910 #: ../src/guestfs.pod:932
1911 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
1915 #: ../src/guestfs.pod:934
1917 "Using L</guestfs_available> you can test availability of the following "
1918 "groups of functions. This test queries the appliance to see if the "
1919 "appliance you are currently using supports the functionality."
1923 #: ../src/guestfs.pod:939
1924 msgid "@AVAILABILITY@"
1928 #: ../src/guestfs.pod:941
1929 msgid "GUESTFISH supported COMMAND"
1933 #: ../src/guestfs.pod:943
1935 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
1936 "prints out the available groups and whether they are supported by this build "
1937 "of libguestfs. Note however that you have to do C<run> first."
1941 #: ../src/guestfs.pod:948
1942 msgid "SINGLE CALLS AT COMPILE TIME"
1946 #: ../src/guestfs.pod:950
1948 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
1949 "function, such as:"
1953 #: ../src/guestfs.pod:953
1956 " #define LIBGUESTFS_HAVE_DD 1\n"
1961 #: ../src/guestfs.pod:955
1962 msgid "if L</guestfs_dd> is available."
1966 #: ../src/guestfs.pod:957
1968 "Before version 1.5.8, if you needed to test whether a single libguestfs "
1969 "function is available at compile time, we recommended using build tools such "
1970 "as autoconf or cmake. For example in autotools you could use:"
1974 #: ../src/guestfs.pod:962
1977 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
1978 " AC_CHECK_FUNCS([guestfs_dd])\n"
1983 #: ../src/guestfs.pod:965
1985 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
1990 #: ../src/guestfs.pod:968
1991 msgid "SINGLE CALLS AT RUN TIME"
1995 #: ../src/guestfs.pod:970
1997 "Testing at compile time doesn't guarantee that a function really exists in "
1998 "the library. The reason is that you might be dynamically linked against a "
1999 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2000 "This situation unfortunately results in a segmentation fault, which is a "
2001 "shortcoming of the C dynamic linking system itself."
2005 #: ../src/guestfs.pod:977
2007 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2008 "in this example program (note that you still need the compile time check as "
2013 #: ../src/guestfs.pod:981
2016 " #include <stdio.h>\n"
2017 " #include <stdlib.h>\n"
2018 " #include <unistd.h>\n"
2019 " #include <dlfcn.h>\n"
2020 " #include <guestfs.h>\n"
2025 #: ../src/guestfs.pod:987
2030 " #ifdef LIBGUESTFS_HAVE_DD\n"
2032 " int has_function;\n"
2037 #: ../src/guestfs.pod:993
2040 " /* Test if the function guestfs_dd is really available. */\n"
2041 " dl = dlopen (NULL, RTLD_LAZY);\n"
2043 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2044 " exit (EXIT_FAILURE);\n"
2046 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2052 #: ../src/guestfs.pod:1002
2055 " if (!has_function)\n"
2056 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2058 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2059 " /* Now it's safe to call\n"
2060 " guestfs_dd (g, \"foo\", \"bar\");\n"
2064 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2071 #: ../src/guestfs.pod:1015
2073 "You may think the above is an awful lot of hassle, and it is. There are "
2074 "other ways outside of the C linking system to ensure that this kind of "
2075 "incompatibility never arises, such as using package versioning:"
2079 #: ../src/guestfs.pod:1020
2082 " Requires: libguestfs >= 1.0.80\n"
2087 #: ../src/guestfs.pod:1022 ../src/guestfs.pod:1027
2092 #: ../src/guestfs.pod:1024
2094 "<!-- old anchor for the next section --> <a "
2095 "name=\"state_machine_and_low_level_event_api\"/>"
2099 #: ../src/guestfs.pod:1029
2100 msgid "ARCHITECTURE"
2104 #: ../src/guestfs.pod:1031
2106 "Internally, libguestfs is implemented by running an appliance (a special "
2107 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
2108 "process of the main program."
2112 #: ../src/guestfs.pod:1035
2115 " ___________________\n"
2117 " | main program |\n"
2119 " | | child process / appliance\n"
2120 " | | __________________________\n"
2122 " +-------------------+ RPC | +-----------------+ |\n"
2123 " | libguestfs <--------------------> guestfsd | |\n"
2124 " | | | +-----------------+ |\n"
2125 " \\___________________/ | | Linux kernel | |\n"
2126 " | +--^--------------+ |\n"
2127 " \\_________|________________/\n"
2133 " \\______________/\n"
2138 #: ../src/guestfs.pod:1055
2140 "The library, linked to the main program, creates the child process and hence "
2141 "the appliance in the L</guestfs_launch> function."
2145 #: ../src/guestfs.pod:1058
2147 "Inside the appliance is a Linux kernel and a complete stack of userspace "
2148 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
2149 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
2150 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
2151 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
2152 "attached to the qemu process which translates device access by the "
2153 "appliance's Linux kernel into accesses to the image."
2157 #: ../src/guestfs.pod:1067
2159 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
2160 "Although the disk image you are attached to might also be used by some "
2161 "virtual machine, libguestfs doesn't know or care about this. (But you will "
2162 "care if both libguestfs's qemu process and your virtual machine are trying "
2163 "to update the disk image at the same time, since these usually results in "
2164 "massive disk corruption)."
2168 #: ../src/guestfs.pod:1074
2169 msgid "STATE MACHINE"
2173 #: ../src/guestfs.pod:1076
2174 msgid "libguestfs uses a state machine to model the child process:"
2178 #: ../src/guestfs.pod:1078
2190 " / | \\ \\ guestfs_launch\n"
2191 " / | _\\__V______\n"
2193 " / | | LAUNCHING |\n"
2194 " / | \\___________/\n"
2196 " / | guestfs_launch\n"
2198 " ______ / __|____V\n"
2199 " / \\ ------> / \\\n"
2200 " | BUSY | | READY |\n"
2201 " \\______/ <------ \\________/\n"
2206 #: ../src/guestfs.pod:1100
2208 "The normal transitions are (1) CONFIG (when the handle is created, but there "
2209 "is no child process), (2) LAUNCHING (when the child process is booting up), "
2210 "(3) alternating between READY and BUSY as commands are issued to, and "
2211 "carried out by, the child process."
2215 #: ../src/guestfs.pod:1105
2217 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
2218 "asynchronously at any time (eg. due to some internal error), and that causes "
2219 "the state to transition back to CONFIG."
2223 #: ../src/guestfs.pod:1109
2225 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
2226 "issued when in the CONFIG state."
2230 #: ../src/guestfs.pod:1112
2232 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
2233 "L</guestfs_launch> blocks until the child process is READY to accept "
2234 "commands (or until some failure or timeout). L</guestfs_launch> internally "
2235 "moves the state from CONFIG to LAUNCHING while it is running."
2239 #: ../src/guestfs.pod:1118
2241 "API actions such as L</guestfs_mount> can only be issued when in the READY "
2242 "state. These API calls block waiting for the command to be carried out "
2243 "(ie. the state to transition to BUSY and then back to READY). There are no "
2244 "non-blocking versions, and no way to issue more than one command per handle "
2249 #: ../src/guestfs.pod:1124
2251 "Finally, the child process sends asynchronous messages back to the main "
2252 "program, such as kernel log messages. You can register a callback to "
2253 "receive these messages."
2257 #: ../src/guestfs.pod:1128
2258 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
2262 #: ../src/guestfs.pod:1130
2264 "The child process generates events in some situations. Current events "
2265 "include: receiving a log message, the child process exits."
2269 #: ../src/guestfs.pod:1133
2271 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
2276 #: ../src/guestfs.pod:1136
2278 "Only I<one callback of each type> can be registered for each handle. "
2279 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
2280 "that type. Cancel all callbacks of this type by calling this function with "
2281 "C<cb> set to C<NULL>."
2285 #: ../src/guestfs.pod:1141
2286 msgid "guestfs_set_log_message_callback"
2290 #: ../src/guestfs.pod:1143
2293 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
2294 " char *buf, int len);\n"
2295 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
2296 " guestfs_log_message_cb cb,\n"
2302 #: ../src/guestfs.pod:1149
2304 "The callback function C<cb> will be called whenever qemu or the guest writes "
2305 "anything to the console."
2309 #: ../src/guestfs.pod:1152
2310 msgid "Use this function to capture kernel messages and similar."
2314 #: ../src/guestfs.pod:1154
2316 "Normally there is no log message handler, and log messages are just "
2321 #: ../src/guestfs.pod:1157
2322 msgid "guestfs_set_subprocess_quit_callback"
2326 #: ../src/guestfs.pod:1159
2329 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
2330 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
2331 " guestfs_subprocess_quit_cb cb,\n"
2337 #: ../src/guestfs.pod:1164
2339 "The callback function C<cb> will be called when the child process quits, "
2340 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
2341 "corresponds to a transition from any state to the CONFIG state)."
2345 #: ../src/guestfs.pod:1169
2346 msgid "guestfs_set_launch_done_callback"
2350 #: ../src/guestfs.pod:1171
2353 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
2354 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
2355 " guestfs_launch_done_cb cb,\n"
2361 #: ../src/guestfs.pod:1176
2363 "The callback function C<cb> will be called when the child process becomes "
2364 "ready first time after it has been launched. (This corresponds to a "
2365 "transition from LAUNCHING to the READY state)."
2369 #: ../src/guestfs.pod:1180
2370 msgid "guestfs_set_close_callback"
2374 #: ../src/guestfs.pod:1182
2377 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
2378 " void guestfs_set_close_callback (guestfs_h *g,\n"
2379 " guestfs_close_cb cb,\n"
2385 #: ../src/guestfs.pod:1187
2387 "The callback function C<cb> will be called while the handle is being closed "
2388 "(synchronously from L</guestfs_close>)."
2392 #: ../src/guestfs.pod:1190
2394 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
2395 "handles that are open when the program exits. This means that this callback "
2396 "might be called indirectly from L<exit(3)>, which can cause unexpected "
2397 "problems in higher-level languages (eg. if your HLL interpreter has already "
2398 "been cleaned up by the time this is called, and if your callback then jumps "
2399 "into some HLL function)."
2403 #: ../src/guestfs.pod:1198
2404 msgid "guestfs_set_progress_callback"
2408 #: ../src/guestfs.pod:1200
2411 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
2412 " int proc_nr, int serial,\n"
2413 " uint64_t position, uint64_t total);\n"
2414 " void guestfs_set_progress_callback (guestfs_h *g,\n"
2415 " guestfs_progress_cb cb,\n"
2421 #: ../src/guestfs.pod:1207
2423 "Some long-running operations can generate progress messages. If this "
2424 "callback is registered, then it will be called each time a progress message "
2425 "is generated (usually two seconds after the operation started, and three "
2426 "times per second thereafter until it completes, although the frequency may "
2427 "change in future versions)."
2431 #: ../src/guestfs.pod:1213
2433 "The callback receives two numbers: C<position> and C<total>. The units of "
2434 "C<total> are not defined, although for some operations C<total> may relate "
2435 "in some way to the amount of data to be transferred (eg. in bytes or "
2436 "megabytes), and C<position> may be the portion which has been transferred."
2440 #: ../src/guestfs.pod:1219
2441 msgid "The only defined and stable parts of the API are:"
2445 #: ../src/guestfs.pod:1225
2447 "The callback can display to the user some type of progress bar or indicator "
2448 "which shows the ratio of C<position>:C<total>."
2452 #: ../src/guestfs.pod:1230
2453 msgid "0 E<lt>= C<position> E<lt>= C<total>"
2457 #: ../src/guestfs.pod:1234
2459 "If any progress notification is sent during a call, then a final progress "
2460 "notification is always sent when C<position> = C<total>."
2464 #: ../src/guestfs.pod:1237
2466 "This is to simplify caller code, so callers can easily set the progress "
2467 "indicator to \"100%\" at the end of the operation, without requiring special "
2468 "code to detect this case."
2472 #: ../src/guestfs.pod:1243
2474 "The callback also receives the procedure number and serial number of the "
2475 "call. These are only useful for debugging protocol issues, and the callback "
2476 "can normally ignore them. The callback may want to print these numbers in "
2477 "error messages or debugging messages."
2481 #: ../src/guestfs.pod:1248
2482 msgid "PRIVATE DATA AREA"
2486 #: ../src/guestfs.pod:1250
2488 "You can attach named pieces of private data to the libguestfs handle, and "
2489 "fetch them by name for the lifetime of the handle. This is called the "
2490 "private data area and is only available from the C API."
2494 #: ../src/guestfs.pod:1254
2495 msgid "To attach a named piece of data, use the following call:"
2499 #: ../src/guestfs.pod:1256
2502 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
2507 #: ../src/guestfs.pod:1258
2509 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
2510 "pointer (which can be C<NULL>). Any previous item with the same name is "
2515 #: ../src/guestfs.pod:1262
2517 "You can use any C<key> you want, but names beginning with an underscore "
2518 "character are reserved for internal libguestfs purposes (for implementing "
2519 "language bindings). It is recommended to prefix the name with some unique "
2520 "string to avoid collisions with other users."
2524 #: ../src/guestfs.pod:1267
2525 msgid "To retrieve the pointer, use:"
2529 #: ../src/guestfs.pod:1269
2532 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
2537 #: ../src/guestfs.pod:1271
2539 "This function returns C<NULL> if either no data is found associated with "
2540 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
2545 #: ../src/guestfs.pod:1275
2547 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
2548 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
2549 "all. In particular, libguestfs does I<not> try to free the data when the "
2550 "handle is closed. If the data must be freed, then the caller must either "
2551 "free it before calling L</guestfs_close> or must set up a close callback to "
2552 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
2553 "can be registered for a handle)."
2557 #: ../src/guestfs.pod:1283
2559 "The private data area is implemented using a hash table, and should be "
2560 "reasonably efficient for moderate numbers of keys."
2564 #: ../src/guestfs.pod:1286
2565 msgid "BLOCK DEVICE NAMING"
2569 #: ../src/guestfs.pod:1288
2571 "In the kernel there is now quite a profusion of schemata for naming block "
2572 "devices (in this context, by I<block device> I mean a physical or virtual "
2573 "hard drive). The original Linux IDE driver used names starting with "
2574 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2575 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2576 "replacement for the old IDE driver (particularly for SATA devices) those "
2577 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2578 "machines with paravirtualized drivers. This has created several different "
2579 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2584 #: ../src/guestfs.pod:1300
2586 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2587 "Linux kernel to access block devices. We can run a variety of appliances "
2588 "based on a variety of Linux kernels."
2592 #: ../src/guestfs.pod:1304
2594 "This causes a problem for libguestfs because many API calls use device or "
2595 "partition names. Working scripts and the recipe (example) scripts that we "
2596 "make available over the internet could fail if the naming scheme changes."
2600 #: ../src/guestfs.pod:1309
2602 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2603 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2604 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2605 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2609 #: ../src/guestfs.pod:1315
2611 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2612 "L</guestfs_list_partitions> and similar calls return the true names of the "
2613 "devices and partitions as known to the appliance."
2617 #: ../src/guestfs.pod:1320
2618 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2622 #: ../src/guestfs.pod:1322
2624 "Usually this translation is transparent. However in some (very rare) cases "
2625 "you may need to know the exact algorithm. Such cases include where you use "
2626 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2627 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2632 #: ../src/guestfs.pod:1328
2634 "The algorithm is applied only to I<parameters> which are known to be either "
2635 "device or partition names. Return values from functions such as "
2636 "L</guestfs_list_devices> are never changed."
2640 #: ../src/guestfs.pod:1336
2641 msgid "Is the string a parameter which is a device or partition name?"
2645 #: ../src/guestfs.pod:1340
2646 msgid "Does the string begin with C</dev/sd>?"
2650 #: ../src/guestfs.pod:1344
2652 "Does the named device exist? If so, we use that device. However if I<not> "
2653 "then we continue with this algorithm."
2657 #: ../src/guestfs.pod:1349
2658 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2662 #: ../src/guestfs.pod:1351
2663 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2667 #: ../src/guestfs.pod:1353
2668 msgid "If that named device exists, use it. If not, continue."
2672 #: ../src/guestfs.pod:1357
2673 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2677 #: ../src/guestfs.pod:1359
2678 msgid "If that named device exists, use it. If not, return an error."
2682 #: ../src/guestfs.pod:1363
2683 msgid "PORTABILITY CONCERNS"
2687 #: ../src/guestfs.pod:1365
2689 "Although the standard naming scheme and automatic translation is useful for "
2690 "simple programs and guestfish scripts, for larger programs it is best not to "
2691 "rely on this mechanism."
2695 #: ../src/guestfs.pod:1369
2697 "Where possible for maximum future portability programs using libguestfs "
2698 "should use these future-proof techniques:"
2702 #: ../src/guestfs.pod:1376
2704 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2705 "device names, and then use those names directly."
2709 #: ../src/guestfs.pod:1379
2710 msgid "Since those device names exist by definition, they will never be translated."
2714 #: ../src/guestfs.pod:1384
2716 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2717 "filesystem labels."
2721 #: ../src/guestfs.pod:1389
2726 #: ../src/guestfs.pod:1391
2727 msgid "COMMUNICATION PROTOCOL"
2731 #: ../src/guestfs.pod:1393
2733 "Don't rely on using this protocol directly. This section documents how it "
2734 "currently works, but it may change at any time."
2738 #: ../src/guestfs.pod:1396
2740 "The protocol used to talk between the library and the daemon running inside "
2741 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
2742 "1014, RFC 1832, RFC 4506)."
2746 #: ../src/guestfs.pod:1400
2748 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
2749 "this file is automatically generated)."
2753 #: ../src/guestfs.pod:1403
2755 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
2756 "and C<FileOut> parameters, which are handled with very simple request/reply "
2757 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
2758 "parameters, which use the same request and reply messages, but they may also "
2759 "be followed by files sent using a chunked encoding."
2763 #: ../src/guestfs.pod:1410
2764 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
2768 #: ../src/guestfs.pod:1412
2769 msgid "For ordinary functions, the request message is:"
2773 #: ../src/guestfs.pod:1414
2776 " total length (header + arguments,\n"
2777 " but not including the length word itself)\n"
2778 " struct guestfs_message_header (encoded as XDR)\n"
2779 " struct guestfs_<foo>_args (encoded as XDR)\n"
2784 #: ../src/guestfs.pod:1419
2786 "The total length field allows the daemon to allocate a fixed size buffer "
2787 "into which it slurps the rest of the message. As a result, the total length "
2788 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
2789 "effective size of any request is limited to somewhere under this size."
2793 #: ../src/guestfs.pod:1425
2795 "Note also that many functions don't take any arguments, in which case the "
2796 "C<guestfs_I<foo>_args> is completely omitted."
2800 #: ../src/guestfs.pod:1428
2802 "The header contains the procedure number (C<guestfs_proc>) which is how the "
2803 "receiver knows what type of args structure to expect, or none at all."
2807 #: ../src/guestfs.pod:1432
2808 msgid "The reply message for ordinary functions is:"
2812 #: ../src/guestfs.pod:1434
2815 " total length (header + ret,\n"
2816 " but not including the length word itself)\n"
2817 " struct guestfs_message_header (encoded as XDR)\n"
2818 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2823 #: ../src/guestfs.pod:1439
2825 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
2826 "functions that return no formal return values."
2830 #: ../src/guestfs.pod:1442
2831 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
2835 #: ../src/guestfs.pod:1445
2837 "In the case of an error, a flag is set in the header, and the reply message "
2838 "is slightly changed:"
2842 #: ../src/guestfs.pod:1448
2845 " total length (header + error,\n"
2846 " but not including the length word itself)\n"
2847 " struct guestfs_message_header (encoded as XDR)\n"
2848 " struct guestfs_message_error (encoded as XDR)\n"
2853 #: ../src/guestfs.pod:1453
2855 "The C<guestfs_message_error> structure contains the error message as a "
2860 #: ../src/guestfs.pod:1456
2861 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
2865 #: ../src/guestfs.pod:1458
2867 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
2868 "The normal request message is sent (see above). However this is followed by "
2869 "a sequence of file chunks."
2873 #: ../src/guestfs.pod:1462
2876 " total length (header + arguments,\n"
2877 " but not including the length word itself,\n"
2878 " and not including the chunks)\n"
2879 " struct guestfs_message_header (encoded as XDR)\n"
2880 " struct guestfs_<foo>_args (encoded as XDR)\n"
2881 " sequence of chunks for FileIn param #0\n"
2882 " sequence of chunks for FileIn param #1 etc.\n"
2887 #: ../src/guestfs.pod:1470
2888 msgid "The \"sequence of chunks\" is:"
2892 #: ../src/guestfs.pod:1472
2895 " length of chunk (not including length word itself)\n"
2896 " struct guestfs_chunk (encoded as XDR)\n"
2897 " length of chunk\n"
2898 " struct guestfs_chunk (encoded as XDR)\n"
2900 " length of chunk\n"
2901 " struct guestfs_chunk (with data.data_len == 0)\n"
2906 #: ../src/guestfs.pod:1480
2908 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
2909 "is set in the final chunk to indicate either successful completion or early "
2914 #: ../src/guestfs.pod:1484
2916 "At time of writing there are no functions that have more than one FileIn "
2917 "parameter. However this is (theoretically) supported, by sending the "
2918 "sequence of chunks for each FileIn parameter one after another (from left to "
2923 #: ../src/guestfs.pod:1489
2925 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
2926 "transfer. The library does this by sending a chunk with a special flag set "
2927 "to indicate cancellation. When the daemon sees this, it cancels the whole "
2928 "RPC, does I<not> send any reply, and goes back to reading the next request."
2932 #: ../src/guestfs.pod:1495
2934 "The daemon may also cancel. It does this by writing a special word "
2935 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
2936 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
2937 "cancel chunk). The special word is chosen so that even if cancellation "
2938 "happens right at the end of the transfer (after the library has finished "
2939 "writing and has started listening for the reply), the \"spurious\" cancel "
2940 "flag will not be confused with the reply message."
2944 #: ../src/guestfs.pod:1504
2946 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
2947 "limit), and also files where the size is not known in advance (eg. from "
2948 "pipes or sockets). However the chunks are rather small "
2949 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
2950 "to keep much in memory."
2954 #: ../src/guestfs.pod:1510
2955 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
2959 #: ../src/guestfs.pod:1512
2961 "The protocol for FileOut parameters is exactly the same as for FileIn "
2962 "parameters, but with the roles of daemon and library reversed."
2966 #: ../src/guestfs.pod:1515
2969 " total length (header + ret,\n"
2970 " but not including the length word itself,\n"
2971 " and not including the chunks)\n"
2972 " struct guestfs_message_header (encoded as XDR)\n"
2973 " struct guestfs_<foo>_ret (encoded as XDR)\n"
2974 " sequence of chunks for FileOut param #0\n"
2975 " sequence of chunks for FileOut param #1 etc.\n"
2980 #: ../src/guestfs.pod:1523
2981 msgid "INITIAL MESSAGE"
2985 #: ../src/guestfs.pod:1525
2987 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
2988 "which indicates that the guest and daemon is alive. This is what "
2989 "L</guestfs_launch> waits for."
2993 #: ../src/guestfs.pod:1529
2994 msgid "PROGRESS NOTIFICATION MESSAGES"
2998 #: ../src/guestfs.pod:1531
3000 "The daemon may send progress notification messages at any time. These are "
3001 "distinguished by the normal length word being replaced by "
3002 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3006 #: ../src/guestfs.pod:1535
3008 "The library turns them into progress callbacks (see "
3009 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3010 "discards them if not."
3014 #: ../src/guestfs.pod:1539
3016 "The daemon self-limits the frequency of progress messages it sends (see "
3017 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3022 #: ../src/guestfs.pod:1543
3023 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
3027 #: ../src/guestfs.pod:1545
3029 "All high-level libguestfs actions are synchronous. If you want to use "
3030 "libguestfs asynchronously then you must create a thread."
3034 #: ../src/guestfs.pod:1548
3036 "Only use the handle from a single thread. Either use the handle exclusively "
3037 "from one thread, or provide your own mutex so that two threads cannot issue "
3038 "calls on the same handle at the same time."
3042 #: ../src/guestfs.pod:1552
3044 "See the graphical program guestfs-browser for one possible architecture for "
3045 "multithreaded programs using libvirt and libguestfs."
3049 #: ../src/guestfs.pod:1555
3050 msgid "QEMU WRAPPERS"
3054 #: ../src/guestfs.pod:1557
3056 "If you want to compile your own qemu, run qemu from a non-standard location, "
3057 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
3062 #: ../src/guestfs.pod:1561
3064 "There is one important rule to remember: you I<must C<exec qemu>> as the "
3065 "last command in the shell script (so that qemu replaces the shell and "
3066 "becomes the direct child of the libguestfs-using program). If you don't do "
3067 "this, then the qemu process won't be cleaned up correctly."
3071 #: ../src/guestfs.pod:1566
3073 "Here is an example of a wrapper, where I have built my own copy of qemu from "
3078 #: ../src/guestfs.pod:1569
3082 " qemudir=/home/rjones/d/qemu\n"
3083 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
3089 #: ../src/guestfs.pod:1573
3091 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
3092 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
3097 #: ../src/guestfs.pod:1577
3100 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
3105 #: ../src/guestfs.pod:1579
3107 "Note that libguestfs also calls qemu with the -help and -version options in "
3108 "order to determine features."
3112 #: ../src/guestfs.pod:1582
3113 msgid "LIBGUESTFS VERSION NUMBERS"
3117 #: ../src/guestfs.pod:1584
3119 "Since April 2010, libguestfs has started to make separate development and "
3120 "stable releases, along with corresponding branches in our git repository. "
3121 "These separate releases can be identified by version number:"
3125 #: ../src/guestfs.pod:1589
3128 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3129 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3135 " | `-------- sub-version\n"
3137 " `------ always '1' because we don't change the ABI\n"
3142 #: ../src/guestfs.pod:1600
3143 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3147 #: ../src/guestfs.pod:1602
3149 "As time passes we cherry pick fixes from the development branch and backport "
3150 "those into the stable branch, the effect being that the stable branch should "
3151 "get more stable and less buggy over time. So the stable releases are ideal "
3152 "for people who don't need new features but would just like the software to "
3157 #: ../src/guestfs.pod:1608
3158 msgid "Our criteria for backporting changes are:"
3162 #: ../src/guestfs.pod:1614
3164 "Documentation changes which don't affect any code are backported unless the "
3165 "documentation refers to a future feature which is not in stable."
3169 #: ../src/guestfs.pod:1620
3171 "Bug fixes which are not controversial, fix obvious problems, and have been "
3172 "well tested are backported."
3176 #: ../src/guestfs.pod:1625
3178 "Simple rearrangements of code which shouldn't affect how it works get "
3179 "backported. This is so that the code in the two branches doesn't get too "
3180 "far out of step, allowing us to backport future fixes more easily."
3184 #: ../src/guestfs.pod:1631
3186 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3187 "exceptional case: the new feature is required in order to implement an "
3188 "important bug fix."
3192 #: ../src/guestfs.pod:1637
3194 "A new stable branch starts when we think the new features in development are "
3195 "substantial and compelling enough over the current stable branch to warrant "
3196 "it. When that happens we create new stable and development versions 1.N.0 "
3197 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3198 "stable at this point, but by backporting fixes from development, that branch "
3199 "will stabilize over time."
3203 #: ../src/guestfs.pod:1645 ../fish/guestfish.pod:796 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:312 ../tools/virt-rescue.pl:226
3204 msgid "ENVIRONMENT VARIABLES"
3208 #: ../src/guestfs.pod:1649 ../fish/guestfish.pod:816
3209 msgid "LIBGUESTFS_APPEND"
3213 #: ../src/guestfs.pod:1651 ../fish/guestfish.pod:818
3214 msgid "Pass additional options to the guest kernel."
3218 #: ../src/guestfs.pod:1653 ../fish/guestfish.pod:820
3219 msgid "LIBGUESTFS_DEBUG"
3223 #: ../src/guestfs.pod:1655
3225 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3226 "effect as calling C<guestfs_set_verbose (g, 1)>."
3230 #: ../src/guestfs.pod:1658 ../fish/guestfish.pod:825
3231 msgid "LIBGUESTFS_MEMSIZE"
3235 #: ../src/guestfs.pod:1660 ../fish/guestfish.pod:827
3236 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
3240 #: ../src/guestfs.pod:1663 ../fish/guestfish.pod:830
3243 " LIBGUESTFS_MEMSIZE=700\n"
3248 #: ../src/guestfs.pod:1665 ../fish/guestfish.pod:832
3249 msgid "LIBGUESTFS_PATH"
3253 #: ../src/guestfs.pod:1667
3255 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
3256 "the discussion of paths in section PATH above."
3260 #: ../src/guestfs.pod:1670 ../fish/guestfish.pod:837
3261 msgid "LIBGUESTFS_QEMU"
3265 #: ../src/guestfs.pod:1672 ../fish/guestfish.pod:839
3267 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
3268 "which was found at compile time by the configure script is used."
3272 #: ../src/guestfs.pod:1676
3273 msgid "See also L</QEMU WRAPPERS> above."
3277 #: ../src/guestfs.pod:1678 ../fish/guestfish.pod:843
3278 msgid "LIBGUESTFS_TRACE"
3282 #: ../src/guestfs.pod:1680
3284 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
3285 "effect as calling C<guestfs_set_trace (g, 1)>."
3289 #: ../src/guestfs.pod:1683 ../fish/guestfish.pod:852
3294 #: ../src/guestfs.pod:1685 ../fish/guestfish.pod:854
3295 msgid "Location of temporary directory, defaults to C</tmp>."
3299 #: ../src/guestfs.pod:1687 ../fish/guestfish.pod:856
3301 "If libguestfs was compiled to use the supermin appliance then each handle "
3302 "will require rather a large amount of space in this directory for short "
3303 "periods of time (~ 80 MB). You can use C<$TMPDIR> to configure another "
3304 "directory to use in case C</tmp> is not large enough."
3308 #: ../src/guestfs.pod:1695 ../fish/guestfish.pod:914 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:178 ../inspector/virt-inspector.pl:846 ../tools/virt-cat.pl:163 ../tools/virt-df.pl:482 ../tools/virt-edit.pl:325 ../tools/virt-list-filesystems.pl:191 ../tools/virt-list-partitions.pl:229 ../tools/virt-ls.pl:210 ../tools/virt-make-fs.pl:527 ../tools/virt-rescue.pl:231 ../tools/virt-resize.pl:1390 ../tools/virt-tar.pl:257 ../tools/virt-win-reg.pl:461
3313 #: ../src/guestfs.pod:1697
3315 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
3316 "L<virt-edit(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
3317 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
3318 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
3319 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
3323 #: ../src/guestfs.pod:1715
3325 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
3326 "L<lvm(8)>, L<disktype(1)>."
3330 #: ../src/guestfs.pod:1722 ../tools/virt-make-fs.pl:541 ../tools/virt-win-reg.pl:476
3335 #: ../src/guestfs.pod:1724
3336 msgid "To get a list of bugs against libguestfs use this link:"
3340 #: ../src/guestfs.pod:1726
3341 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
3345 #: ../src/guestfs.pod:1728
3346 msgid "To report a new bug against libguestfs use this link:"
3350 #: ../src/guestfs.pod:1730
3351 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
3355 #: ../src/guestfs.pod:1732
3356 msgid "When reporting a bug, please check:"
3360 #: ../src/guestfs.pod:1738
3361 msgid "That the bug hasn't been reported already."
3365 #: ../src/guestfs.pod:1742
3366 msgid "That you are testing a recent version."
3370 #: ../src/guestfs.pod:1746
3371 msgid "Describe the bug accurately, and give a way to reproduce it."
3375 #: ../src/guestfs.pod:1750
3377 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
3382 #: ../src/guestfs.pod:1755 ../fish/guestfish.pod:930 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:189 ../inspector/virt-inspector.pl:855
3387 #: ../src/guestfs.pod:1757 ../fish/guestfish.pod:932 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:191
3388 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
3392 #: ../src/guestfs.pod:1759 ../fish/guestfish.pod:934 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:193 ../inspector/virt-inspector.pl:861 ../tools/virt-cat.pl:177 ../tools/virt-df.pl:495 ../tools/virt-edit.pl:341 ../tools/virt-list-filesystems.pl:207 ../tools/virt-list-partitions.pl:244 ../tools/virt-ls.pl:225 ../tools/virt-make-fs.pl:556 ../tools/virt-rescue.pl:245 ../tools/virt-resize.pl:1411 ../tools/virt-tar.pl:272 ../tools/virt-win-reg.pl:491
3397 #: ../src/guestfs.pod:1761 ../fish/guestfish.pod:936
3398 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
3402 #: ../src/guestfs.pod:1764
3404 "This library is free software; you can redistribute it and/or modify it "
3405 "under the terms of the GNU Lesser General Public License as published by the "
3406 "Free Software Foundation; either version 2 of the License, or (at your "
3407 "option) any later version."
3411 #: ../src/guestfs.pod:1769
3413 "This library is distributed in the hope that it will be useful, but WITHOUT "
3414 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
3415 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
3420 #: ../src/guestfs.pod:1774
3422 "You should have received a copy of the GNU Lesser General Public License "
3423 "along with this library; if not, write to the Free Software Foundation, "
3424 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
3428 #: ../src/guestfs-actions.pod:1
3429 msgid "guestfs_add_cdrom"
3433 #: ../src/guestfs-actions.pod:3
3436 " int guestfs_add_cdrom (guestfs_h *g,\n"
3437 "\t\tconst char *filename);\n"
3442 #: ../src/guestfs-actions.pod:6 ../fish/guestfish-actions.pod:5
3443 msgid "This function adds a virtual CD-ROM disk image to the guest."
3447 #: ../src/guestfs-actions.pod:8 ../fish/guestfish-actions.pod:7
3448 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
3452 #: ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:1488 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1186
3457 #: ../src/guestfs-actions.pod:16
3459 "This call checks for the existence of C<filename>. This stops you from "
3460 "specifying other types of drive which are supported by qemu such as C<nbd:> "
3461 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
3466 #: ../src/guestfs-actions.pod:23
3468 "If you just want to add an ISO file (often you use this as an efficient way "
3469 "to transfer large files into the guest), then you should probably use "
3470 "C<guestfs_add_drive_ro> instead."
3474 #: ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:63 ../src/guestfs-actions.pod:92 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:124 ../src/guestfs-actions.pod:135 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:324 ../src/guestfs-actions.pod:339 ../src/guestfs-actions.pod:403 ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:441 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:560 ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:824 ../src/guestfs-actions.pod:839 ../src/guestfs-actions.pod:855 ../src/guestfs-actions.pod:866 ../src/guestfs-actions.pod:883 ../src/guestfs-actions.pod:916 ../src/guestfs-actions.pod:974 ../src/guestfs-actions.pod:996 ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:1146 ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1446 ../src/guestfs-actions.pod:1794 ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:2002 ../src/guestfs-actions.pod:2411 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2569 ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:2592 ../src/guestfs-actions.pod:2622 ../src/guestfs-actions.pod:2686 ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2717 ../src/guestfs-actions.pod:2737 ../src/guestfs-actions.pod:2757 ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2839 ../src/guestfs-actions.pod:2872 ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:2895 ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2921 ../src/guestfs-actions.pod:3001 ../src/guestfs-actions.pod:3018 ../src/guestfs-actions.pod:3028 ../src/guestfs-actions.pod:3073 ../src/guestfs-actions.pod:3088 ../src/guestfs-actions.pod:3103 ../src/guestfs-actions.pod:3116 ../src/guestfs-actions.pod:3127 ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3152 ../src/guestfs-actions.pod:3164 ../src/guestfs-actions.pod:3181 ../src/guestfs-actions.pod:3212 ../src/guestfs-actions.pod:3240 ../src/guestfs-actions.pod:3256 ../src/guestfs-actions.pod:3272 ../src/guestfs-actions.pod:3281 ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:3317 ../src/guestfs-actions.pod:3329 ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3390 ../src/guestfs-actions.pod:3401 ../src/guestfs-actions.pod:3415 ../src/guestfs-actions.pod:3455 ../src/guestfs-actions.pod:3486 ../src/guestfs-actions.pod:3497 ../src/guestfs-actions.pod:3522 ../src/guestfs-actions.pod:3536 ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:3744 ../src/guestfs-actions.pod:3759 ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:3819 ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:3843 ../src/guestfs-actions.pod:3854 ../src/guestfs-actions.pod:4086 ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4113 ../src/guestfs-actions.pod:4122 ../src/guestfs-actions.pod:4133 ../src/guestfs-actions.pod:4142 ../src/guestfs-actions.pod:4153 ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4216 ../src/guestfs-actions.pod:4231 ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4266 ../src/guestfs-actions.pod:4282 ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4316 ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4392 ../src/guestfs-actions.pod:4413 ../src/guestfs-actions.pod:4425 ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:4453 ../src/guestfs-actions.pod:4487 ../src/guestfs-actions.pod:4507 ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4620 ../src/guestfs-actions.pod:4726 ../src/guestfs-actions.pod:4735 ../src/guestfs-actions.pod:4745 ../src/guestfs-actions.pod:4755 ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:4784 ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:4880 ../src/guestfs-actions.pod:4893 ../src/guestfs-actions.pod:4906 ../src/guestfs-actions.pod:4920 ../src/guestfs-actions.pod:4930 ../src/guestfs-actions.pod:4947 ../src/guestfs-actions.pod:4977 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5023 ../src/guestfs-actions.pod:5033 ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5076 ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:5206 ../src/guestfs-actions.pod:5252 ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5326 ../src/guestfs-actions.pod:5368 ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5448 ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5490
3475 msgid "This function returns 0 on success or -1 on error."
3479 #: ../src/guestfs-actions.pod:31
3480 msgid "guestfs_add_drive"
3484 #: ../src/guestfs-actions.pod:33
3487 " int guestfs_add_drive (guestfs_h *g,\n"
3488 "\t\tconst char *filename);\n"
3493 #: ../src/guestfs-actions.pod:36 ../fish/guestfish-actions.pod:32
3495 "This function adds a virtual machine disk image C<filename> to the guest. "
3496 "The first time you call this function, the disk appears as IDE disk 0 "
3497 "(C</dev/sda>) in the guest, the second time as C</dev/sdb>, and so on."
3501 #: ../src/guestfs-actions.pod:41 ../fish/guestfish-actions.pod:37
3503 "You don't necessarily need to be root when using libguestfs. However you "
3504 "obviously do need sufficient permissions to access the filename for whatever "
3505 "operations you want to perform (ie. read access if you just want to read the "
3506 "image or write access if you want to modify the image)."
3510 #: ../src/guestfs-actions.pod:47 ../fish/guestfish-actions.pod:43
3512 "This is equivalent to the qemu parameter C<-drive "
3513 "file=filename,cache=off,if=...>."
3517 #: ../src/guestfs-actions.pod:50 ../fish/guestfish-actions.pod:46
3519 "C<cache=off> is omitted in cases where it is not supported by the underlying "
3524 #: ../src/guestfs-actions.pod:53 ../src/guestfs-actions.pod:82
3526 "C<if=...> is set at compile time by the configuration option C<./configure "
3527 "--with-drive-if=...>. In the rare case where you might need to change this "
3528 "at run time, use C<guestfs_add_drive_with_if> or "
3529 "C<guestfs_add_drive_ro_with_if>."
3533 #: ../src/guestfs-actions.pod:58 ../src/guestfs-actions.pod:87
3535 "Note that this call checks for the existence of C<filename>. This stops you "
3536 "from specifying other types of drive which are supported by qemu such as "
3537 "C<nbd:> and C<http:> URLs. To specify those, use the general "
3538 "C<guestfs_config> call instead."
3542 #: ../src/guestfs-actions.pod:65
3543 msgid "guestfs_add_drive_ro"
3547 #: ../src/guestfs-actions.pod:67
3550 " int guestfs_add_drive_ro (guestfs_h *g,\n"
3551 "\t\tconst char *filename);\n"
3556 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:63
3557 msgid "This adds a drive in snapshot mode, making it effectively read-only."
3561 #: ../src/guestfs-actions.pod:73 ../fish/guestfish-actions.pod:66
3563 "Note that writes to the device are allowed, and will be seen for the "
3564 "duration of the guestfs handle, but they are written to a temporary file "
3565 "which is discarded as soon as the guestfs handle is closed. We don't "
3566 "currently have any method to enable changes to be committed, although qemu "
3571 #: ../src/guestfs-actions.pod:79 ../fish/guestfish-actions.pod:72
3573 "This is equivalent to the qemu parameter C<-drive "
3574 "file=filename,snapshot=on,if=...>."
3578 #: ../src/guestfs-actions.pod:94
3579 msgid "guestfs_add_drive_ro_with_if"
3583 #: ../src/guestfs-actions.pod:96
3586 " int guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
3587 "\t\tconst char *filename,\n"
3588 "\t\tconst char *iface);\n"
3593 #: ../src/guestfs-actions.pod:100
3595 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
3596 "QEMU interface emulation to use at run time."
3600 #: ../src/guestfs-actions.pod:105
3601 msgid "guestfs_add_drive_with_if"
3605 #: ../src/guestfs-actions.pod:107
3608 " int guestfs_add_drive_with_if (guestfs_h *g,\n"
3609 "\t\tconst char *filename,\n"
3610 "\t\tconst char *iface);\n"
3615 #: ../src/guestfs-actions.pod:111
3617 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
3618 "QEMU interface emulation to use at run time."
3622 #: ../src/guestfs-actions.pod:116
3623 msgid "guestfs_aug_clear"
3627 #: ../src/guestfs-actions.pod:118
3630 " int guestfs_aug_clear (guestfs_h *g,\n"
3631 "\t\tconst char *augpath);\n"
3636 #: ../src/guestfs-actions.pod:121 ../fish/guestfish-actions.pod:103
3638 "Set the value associated with C<path> to C<NULL>. This is the same as the "
3639 "L<augtool(1)> C<clear> command."
3643 #: ../src/guestfs-actions.pod:126
3644 msgid "guestfs_aug_close"
3648 #: ../src/guestfs-actions.pod:128
3651 " int guestfs_aug_close (guestfs_h *g);\n"
3656 #: ../src/guestfs-actions.pod:130
3658 "Close the current Augeas handle and free up any resources used by it. After "
3659 "calling this, you have to call C<guestfs_aug_init> again before you can use "
3660 "any other Augeas functions."
3664 #: ../src/guestfs-actions.pod:137
3665 msgid "guestfs_aug_defnode"
3669 #: ../src/guestfs-actions.pod:139
3672 " struct guestfs_int_bool *guestfs_aug_defnode (guestfs_h *g,\n"
3673 "\t\tconst char *name,\n"
3674 "\t\tconst char *expr,\n"
3675 "\t\tconst char *val);\n"
3680 #: ../src/guestfs-actions.pod:144 ../fish/guestfish-actions.pod:119
3681 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
3685 #: ../src/guestfs-actions.pod:147
3687 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
3688 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
3689 "containing that single node."
3693 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:126
3695 "On success this returns a pair containing the number of nodes in the "
3696 "nodeset, and a boolean flag if a node was created."
3700 #: ../src/guestfs-actions.pod:155
3702 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
3703 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
3707 #: ../src/guestfs-actions.pod:159
3708 msgid "guestfs_aug_defvar"
3712 #: ../src/guestfs-actions.pod:161
3715 " int guestfs_aug_defvar (guestfs_h *g,\n"
3716 "\t\tconst char *name,\n"
3717 "\t\tconst char *expr);\n"
3722 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:134
3724 "Defines an Augeas variable C<name> whose value is the result of evaluating "
3725 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
3729 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:138
3731 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
3732 "evaluates to something which is not a nodeset."
3736 #: ../src/guestfs-actions.pod:172 ../src/guestfs-actions.pod:313 ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:492 ../src/guestfs-actions.pod:507 ../src/guestfs-actions.pod:523 ../src/guestfs-actions.pod:1013 ../src/guestfs-actions.pod:1328 ../src/guestfs-actions.pod:1510 ../src/guestfs-actions.pod:1591 ../src/guestfs-actions.pod:1622 ../src/guestfs-actions.pod:1665 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1907 ../src/guestfs-actions.pod:2119 ../src/guestfs-actions.pod:2137 ../src/guestfs-actions.pod:3475 ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5012 ../src/guestfs-actions.pod:5336 ../src/guestfs-actions.pod:5346 ../src/guestfs-actions.pod:5356
3737 msgid "On error this function returns -1."
3741 #: ../src/guestfs-actions.pod:174
3742 msgid "guestfs_aug_get"
3746 #: ../src/guestfs-actions.pod:176
3749 " char *guestfs_aug_get (guestfs_h *g,\n"
3750 "\t\tconst char *augpath);\n"
3755 #: ../src/guestfs-actions.pod:179 ../fish/guestfish-actions.pod:145
3757 "Look up the value associated with C<path>. If C<path> matches exactly one "
3758 "node, the C<value> is returned."
3762 #: ../src/guestfs-actions.pod:182 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:682 ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:899 ../src/guestfs-actions.pod:928 ../src/guestfs-actions.pod:942 ../src/guestfs-actions.pod:958 ../src/guestfs-actions.pod:1041 ../src/guestfs-actions.pod:1205 ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1473 ../src/guestfs-actions.pod:1549 ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1840 ../src/guestfs-actions.pod:2021 ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2187 ../src/guestfs-actions.pod:2222 ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:3054 ../src/guestfs-actions.pod:3597 ../src/guestfs-actions.pod:3773 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:4029 ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:4548 ../src/guestfs-actions.pod:4561 ../src/guestfs-actions.pod:4575 ../src/guestfs-actions.pod:4596 ../src/guestfs-actions.pod:5129 ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5160 ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5538
3764 "This function returns a string, or NULL on error. I<The caller must free "
3765 "the returned string after use>."
3769 #: ../src/guestfs-actions.pod:185
3770 msgid "guestfs_aug_init"
3774 #: ../src/guestfs-actions.pod:187
3777 " int guestfs_aug_init (guestfs_h *g,\n"
3778 "\t\tconst char *root,\n"
3784 #: ../src/guestfs-actions.pod:191 ../fish/guestfish-actions.pod:152
3786 "Create a new Augeas handle for editing configuration files. If there was "
3787 "any previous Augeas handle associated with this guestfs session, then it is "
3792 #: ../src/guestfs-actions.pod:195
3793 msgid "You must call this before using any other C<guestfs_aug_*> commands."
3797 #: ../src/guestfs-actions.pod:198 ../fish/guestfish-actions.pod:159
3798 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
3802 #: ../src/guestfs-actions.pod:201 ../fish/guestfish-actions.pod:162
3804 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
3805 "logical I<or> of the following integers:"
3809 #: ../src/guestfs-actions.pod:207 ../fish/guestfish-actions.pod:168
3810 msgid "C<AUG_SAVE_BACKUP> = 1"
3814 #: ../src/guestfs-actions.pod:209 ../fish/guestfish-actions.pod:170
3815 msgid "Keep the original file with a C<.augsave> extension."
3819 #: ../src/guestfs-actions.pod:211 ../fish/guestfish-actions.pod:172
3820 msgid "C<AUG_SAVE_NEWFILE> = 2"
3824 #: ../src/guestfs-actions.pod:213 ../fish/guestfish-actions.pod:174
3826 "Save changes into a file with extension C<.augnew>, and do not overwrite "
3827 "original. Overrides C<AUG_SAVE_BACKUP>."
3831 #: ../src/guestfs-actions.pod:216 ../fish/guestfish-actions.pod:177
3832 msgid "C<AUG_TYPE_CHECK> = 4"
3836 #: ../src/guestfs-actions.pod:218 ../fish/guestfish-actions.pod:179
3837 msgid "Typecheck lenses (can be expensive)."
3841 #: ../src/guestfs-actions.pod:220 ../fish/guestfish-actions.pod:181
3842 msgid "C<AUG_NO_STDINC> = 8"
3846 #: ../src/guestfs-actions.pod:222 ../fish/guestfish-actions.pod:183
3847 msgid "Do not use standard load path for modules."
3851 #: ../src/guestfs-actions.pod:224 ../fish/guestfish-actions.pod:185
3852 msgid "C<AUG_SAVE_NOOP> = 16"
3856 #: ../src/guestfs-actions.pod:226 ../fish/guestfish-actions.pod:187
3857 msgid "Make save a no-op, just record what would have been changed."
3861 #: ../src/guestfs-actions.pod:228 ../fish/guestfish-actions.pod:189
3862 msgid "C<AUG_NO_LOAD> = 32"
3866 #: ../src/guestfs-actions.pod:230
3867 msgid "Do not load the tree in C<guestfs_aug_init>."
3871 #: ../src/guestfs-actions.pod:234
3872 msgid "To close the handle, you can call C<guestfs_aug_close>."
3876 #: ../src/guestfs-actions.pod:236 ../fish/guestfish-actions.pod:197
3877 msgid "To find out more about Augeas, see L<http://augeas.net/>."
3881 #: ../src/guestfs-actions.pod:240
3882 msgid "guestfs_aug_insert"
3886 #: ../src/guestfs-actions.pod:242
3889 " int guestfs_aug_insert (guestfs_h *g,\n"
3890 "\t\tconst char *augpath,\n"
3891 "\t\tconst char *label,\n"
3892 "\t\tint before);\n"
3897 #: ../src/guestfs-actions.pod:247 ../fish/guestfish-actions.pod:203
3899 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
3900 "or after C<path> (depending on the boolean flag C<before>)."
3904 #: ../src/guestfs-actions.pod:251 ../fish/guestfish-actions.pod:207
3906 "C<path> must match exactly one existing node in the tree, and C<label> must "
3907 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
3911 #: ../src/guestfs-actions.pod:257
3912 msgid "guestfs_aug_load"
3916 #: ../src/guestfs-actions.pod:259
3919 " int guestfs_aug_load (guestfs_h *g);\n"
3924 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:215
3925 msgid "Load files into the tree."
3929 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:217
3930 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
3934 #: ../src/guestfs-actions.pod:268
3935 msgid "guestfs_aug_ls"
3939 #: ../src/guestfs-actions.pod:270
3942 " char **guestfs_aug_ls (guestfs_h *g,\n"
3943 "\t\tconst char *augpath);\n"
3948 #: ../src/guestfs-actions.pod:273
3950 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
3951 "sorting the resulting nodes into alphabetical order."
3955 #: ../src/guestfs-actions.pod:276 ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:417 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:1053 ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1157 ../src/guestfs-actions.pod:1173 ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1738 ../src/guestfs-actions.pod:1751 ../src/guestfs-actions.pod:1767 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1825 ../src/guestfs-actions.pod:1887 ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:2093 ../src/guestfs-actions.pod:2261 ../src/guestfs-actions.pod:2466 ../src/guestfs-actions.pod:2522 ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2935 ../src/guestfs-actions.pod:3442 ../src/guestfs-actions.pod:3868 ../src/guestfs-actions.pod:3954 ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4609 ../src/guestfs-actions.pod:4658 ../src/guestfs-actions.pod:4710 ../src/guestfs-actions.pod:4826 ../src/guestfs-actions.pod:4847 ../src/guestfs-actions.pod:5221 ../src/guestfs-actions.pod:5238 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5501 ../src/guestfs-actions.pod:5517 ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:5573
3957 "This function returns a NULL-terminated array of strings (like "
3958 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
3959 "strings and the array after use>."
3963 #: ../src/guestfs-actions.pod:280
3964 msgid "guestfs_aug_match"
3968 #: ../src/guestfs-actions.pod:282
3971 " char **guestfs_aug_match (guestfs_h *g,\n"
3972 "\t\tconst char *augpath);\n"
3977 #: ../src/guestfs-actions.pod:285 ../fish/guestfish-actions.pod:231
3979 "Returns a list of paths which match the path expression C<path>. The "
3980 "returned paths are sufficiently qualified so that they match exactly one "
3981 "node in the current tree."
3985 #: ../src/guestfs-actions.pod:293
3986 msgid "guestfs_aug_mv"
3990 #: ../src/guestfs-actions.pod:295
3993 " int guestfs_aug_mv (guestfs_h *g,\n"
3994 "\t\tconst char *src,\n"
3995 "\t\tconst char *dest);\n"
4000 #: ../src/guestfs-actions.pod:299 ../fish/guestfish-actions.pod:239
4002 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
4003 "C<dest> is overwritten if it exists."
4007 #: ../src/guestfs-actions.pod:304
4008 msgid "guestfs_aug_rm"
4012 #: ../src/guestfs-actions.pod:306
4015 " int guestfs_aug_rm (guestfs_h *g,\n"
4016 "\t\tconst char *augpath);\n"
4021 #: ../src/guestfs-actions.pod:309 ../fish/guestfish-actions.pod:246
4022 msgid "Remove C<path> and all of its children."
4026 #: ../src/guestfs-actions.pod:311 ../fish/guestfish-actions.pod:248
4027 msgid "On success this returns the number of entries which were removed."
4031 #: ../src/guestfs-actions.pod:315
4032 msgid "guestfs_aug_save"
4036 #: ../src/guestfs-actions.pod:317
4039 " int guestfs_aug_save (guestfs_h *g);\n"
4044 #: ../src/guestfs-actions.pod:319 ../fish/guestfish-actions.pod:254
4045 msgid "This writes all pending changes to disk."
4049 #: ../src/guestfs-actions.pod:321
4051 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
4056 #: ../src/guestfs-actions.pod:326
4057 msgid "guestfs_aug_set"
4061 #: ../src/guestfs-actions.pod:328
4064 " int guestfs_aug_set (guestfs_h *g,\n"
4065 "\t\tconst char *augpath,\n"
4066 "\t\tconst char *val);\n"
4071 #: ../src/guestfs-actions.pod:332 ../fish/guestfish-actions.pod:263
4072 msgid "Set the value associated with C<path> to C<val>."
4076 #: ../src/guestfs-actions.pod:334
4078 "In the Augeas API, it is possible to clear a node by setting the value to "
4079 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
4080 "this call. Instead you must use the C<guestfs_aug_clear> call."
4084 #: ../src/guestfs-actions.pod:341
4085 msgid "guestfs_available"
4089 #: ../src/guestfs-actions.pod:343
4092 " int guestfs_available (guestfs_h *g,\n"
4093 "\t\tchar *const *groups);\n"
4098 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:274
4100 "This command is used to check the availability of some groups of "
4101 "functionality in the appliance, which not all builds of the libguestfs "
4102 "appliance will be able to provide."
4106 #: ../src/guestfs-actions.pod:350
4108 "The libguestfs groups, and the functions that those groups correspond to, "
4109 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
4110 "runtime by calling C<guestfs_available_all_groups>."
4114 #: ../src/guestfs-actions.pod:355 ../fish/guestfish-actions.pod:283
4116 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
4117 "\"augeas\"]> would check for the availability of the Linux inotify functions "
4118 "and Augeas (configuration file editing) functions."
4122 #: ../src/guestfs-actions.pod:360 ../fish/guestfish-actions.pod:288
4123 msgid "The command returns no error if I<all> requested groups are available."
4127 #: ../src/guestfs-actions.pod:362 ../fish/guestfish-actions.pod:290
4129 "It fails with an error if one or more of the requested groups is unavailable "
4134 #: ../src/guestfs-actions.pod:365 ../fish/guestfish-actions.pod:293
4136 "If an unknown group name is included in the list of groups then an error is "
4141 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:296
4146 #: ../src/guestfs-actions.pod:374
4147 msgid "You must call C<guestfs_launch> before calling this function."
4151 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:304
4153 "The reason is because we don't know what groups are supported by the "
4154 "appliance/daemon until it is running and can be queried."
4158 #: ../src/guestfs-actions.pod:382 ../fish/guestfish-actions.pod:310
4160 "If a group of functions is available, this does not necessarily mean that "
4161 "they will work. You still have to check for errors when calling individual "
4162 "API functions even if they are available."
4166 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:317
4168 "It is usually the job of distro packagers to build complete functionality "
4169 "into the libguestfs appliance. Upstream libguestfs, if built from source "
4170 "with all requirements satisfied, will support everything."
4174 #: ../src/guestfs-actions.pod:396
4176 "This call was added in version C<1.0.80>. In previous versions of "
4177 "libguestfs all you could do would be to speculatively execute a command to "
4178 "find out if the daemon implemented it. See also C<guestfs_version>."
4182 #: ../src/guestfs-actions.pod:405
4183 msgid "guestfs_available_all_groups"
4187 #: ../src/guestfs-actions.pod:407
4190 " char **guestfs_available_all_groups (guestfs_h *g);\n"
4195 #: ../src/guestfs-actions.pod:409
4197 "This command returns a list of all optional groups that this daemon knows "
4198 "about. Note this returns both supported and unsupported groups. To find "
4199 "out which ones the daemon can actually support you have to call "
4200 "C<guestfs_available> on each member of the returned list."
4204 #: ../src/guestfs-actions.pod:415
4205 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
4209 #: ../src/guestfs-actions.pod:421
4210 msgid "guestfs_base64_in"
4214 #: ../src/guestfs-actions.pod:423
4217 " int guestfs_base64_in (guestfs_h *g,\n"
4218 "\t\tconst char *base64file,\n"
4219 "\t\tconst char *filename);\n"
4224 #: ../src/guestfs-actions.pod:427 ../fish/guestfish-actions.pod:347
4225 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
4229 #: ../src/guestfs-actions.pod:432
4230 msgid "guestfs_base64_out"
4234 #: ../src/guestfs-actions.pod:434
4237 " int guestfs_base64_out (guestfs_h *g,\n"
4238 "\t\tconst char *filename,\n"
4239 "\t\tconst char *base64file);\n"
4244 #: ../src/guestfs-actions.pod:438 ../fish/guestfish-actions.pod:356
4246 "This command downloads the contents of C<filename>, writing it out to local "
4247 "file C<base64file> encoded as base64."
4251 #: ../src/guestfs-actions.pod:443
4252 msgid "guestfs_blockdev_flushbufs"
4256 #: ../src/guestfs-actions.pod:445
4259 " int guestfs_blockdev_flushbufs (guestfs_h *g,\n"
4260 "\t\tconst char *device);\n"
4265 #: ../src/guestfs-actions.pod:448 ../fish/guestfish-actions.pod:365
4266 msgid "This tells the kernel to flush internal buffers associated with C<device>."
4270 #: ../src/guestfs-actions.pod:451 ../src/guestfs-actions.pod:465 ../src/guestfs-actions.pod:477 ../src/guestfs-actions.pod:490 ../src/guestfs-actions.pod:505 ../src/guestfs-actions.pod:521 ../src/guestfs-actions.pod:532 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:569 ../fish/guestfish-actions.pod:368 ../fish/guestfish-actions.pod:379 ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:398 ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:423 ../fish/guestfish-actions.pod:431 ../fish/guestfish-actions.pod:442 ../fish/guestfish-actions.pod:450 ../fish/guestfish-actions.pod:458
4271 msgid "This uses the L<blockdev(8)> command."
4275 #: ../src/guestfs-actions.pod:455
4276 msgid "guestfs_blockdev_getbsz"
4280 #: ../src/guestfs-actions.pod:457
4283 " int guestfs_blockdev_getbsz (guestfs_h *g,\n"
4284 "\t\tconst char *device);\n"
4289 #: ../src/guestfs-actions.pod:460 ../fish/guestfish-actions.pod:374
4290 msgid "This returns the block size of a device."
4294 #: ../src/guestfs-actions.pod:462 ../src/guestfs-actions.pod:544 ../fish/guestfish-actions.pod:376 ../fish/guestfish-actions.pod:439
4296 "(Note this is different from both I<size in blocks> and I<filesystem block "
4301 #: ../src/guestfs-actions.pod:469
4302 msgid "guestfs_blockdev_getro"
4306 #: ../src/guestfs-actions.pod:471
4309 " int guestfs_blockdev_getro (guestfs_h *g,\n"
4310 "\t\tconst char *device);\n"
4315 #: ../src/guestfs-actions.pod:474 ../fish/guestfish-actions.pod:385
4317 "Returns a boolean indicating if the block device is read-only (true if "
4318 "read-only, false if not)."
4322 #: ../src/guestfs-actions.pod:479 ../src/guestfs-actions.pod:1087 ../src/guestfs-actions.pod:1099 ../src/guestfs-actions.pod:1531 ../src/guestfs-actions.pod:1539 ../src/guestfs-actions.pod:1599 ../src/guestfs-actions.pod:1642 ../src/guestfs-actions.pod:1654 ../src/guestfs-actions.pod:1673 ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2286 ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:2309 ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2347 ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:2368 ../src/guestfs-actions.pod:2379 ../src/guestfs-actions.pod:2391 ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:3567
4323 msgid "This function returns a C truth value on success or -1 on error."
4327 #: ../src/guestfs-actions.pod:481
4328 msgid "guestfs_blockdev_getsize64"
4332 #: ../src/guestfs-actions.pod:483
4335 " int64_t guestfs_blockdev_getsize64 (guestfs_h *g,\n"
4336 "\t\tconst char *device);\n"
4341 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:394
4342 msgid "This returns the size of the device in bytes."
4346 #: ../src/guestfs-actions.pod:488
4347 msgid "See also C<guestfs_blockdev_getsz>."
4351 #: ../src/guestfs-actions.pod:494
4352 msgid "guestfs_blockdev_getss"
4356 #: ../src/guestfs-actions.pod:496
4359 " int guestfs_blockdev_getss (guestfs_h *g,\n"
4360 "\t\tconst char *device);\n"
4365 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:404
4367 "This returns the size of sectors on a block device. Usually 512, but can be "
4368 "larger for modern devices."
4372 #: ../src/guestfs-actions.pod:502
4374 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
4379 #: ../src/guestfs-actions.pod:509
4380 msgid "guestfs_blockdev_getsz"
4384 #: ../src/guestfs-actions.pod:511
4387 " int64_t guestfs_blockdev_getsz (guestfs_h *g,\n"
4388 "\t\tconst char *device);\n"
4393 #: ../src/guestfs-actions.pod:514 ../fish/guestfish-actions.pod:416
4395 "This returns the size of the device in units of 512-byte sectors (even if "
4396 "the sectorsize isn't 512 bytes ... weird)."
4400 #: ../src/guestfs-actions.pod:517
4402 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
4403 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
4407 #: ../src/guestfs-actions.pod:525
4408 msgid "guestfs_blockdev_rereadpt"
4412 #: ../src/guestfs-actions.pod:527
4415 " int guestfs_blockdev_rereadpt (guestfs_h *g,\n"
4416 "\t\tconst char *device);\n"
4421 #: ../src/guestfs-actions.pod:530 ../fish/guestfish-actions.pod:429
4422 msgid "Reread the partition table on C<device>."
4426 #: ../src/guestfs-actions.pod:536
4427 msgid "guestfs_blockdev_setbsz"
4431 #: ../src/guestfs-actions.pod:538
4434 " int guestfs_blockdev_setbsz (guestfs_h *g,\n"
4435 "\t\tconst char *device,\n"
4436 "\t\tint blocksize);\n"
4441 #: ../src/guestfs-actions.pod:542 ../fish/guestfish-actions.pod:437
4442 msgid "This sets the block size of a device."
4446 #: ../src/guestfs-actions.pod:551
4447 msgid "guestfs_blockdev_setro"
4451 #: ../src/guestfs-actions.pod:553
4454 " int guestfs_blockdev_setro (guestfs_h *g,\n"
4455 "\t\tconst char *device);\n"
4460 #: ../src/guestfs-actions.pod:556 ../fish/guestfish-actions.pod:448
4461 msgid "Sets the block device named C<device> to read-only."
4465 #: ../src/guestfs-actions.pod:562
4466 msgid "guestfs_blockdev_setrw"
4470 #: ../src/guestfs-actions.pod:564
4473 " int guestfs_blockdev_setrw (guestfs_h *g,\n"
4474 "\t\tconst char *device);\n"
4479 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:456
4480 msgid "Sets the block device named C<device> to read-write."
4484 #: ../src/guestfs-actions.pod:573
4485 msgid "guestfs_case_sensitive_path"
4489 #: ../src/guestfs-actions.pod:575
4492 " char *guestfs_case_sensitive_path (guestfs_h *g,\n"
4493 "\t\tconst char *path);\n"
4498 #: ../src/guestfs-actions.pod:578 ../fish/guestfish-actions.pod:464
4500 "This can be used to resolve case insensitive paths on a filesystem which is "
4501 "case sensitive. The use case is to resolve paths which you have read from "
4502 "Windows configuration files or the Windows Registry, to the true path."
4506 #: ../src/guestfs-actions.pod:583 ../fish/guestfish-actions.pod:469
4508 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
4509 "(and probably others), which is that although the underlying filesystem is "
4510 "case-insensitive, the driver exports the filesystem to Linux as "
4515 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:474
4517 "One consequence of this is that special directories such as C<c:\\windows> "
4518 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
4519 "precise details of how they were created. In Windows itself this would not "
4524 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:480
4526 "Bug or feature? You decide: "
4527 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
4531 #: ../src/guestfs-actions.pod:597 ../fish/guestfish-actions.pod:483
4533 "This function resolves the true case of each element in the path and returns "
4534 "the case-sensitive path."
4538 #: ../src/guestfs-actions.pod:600
4540 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
4541 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
4542 "how the directories were originally created under Windows)."
4546 #: ../src/guestfs-actions.pod:605 ../fish/guestfish-actions.pod:491
4547 msgid "I<Note>: This function does not handle drive names, backslashes etc."
4551 #: ../src/guestfs-actions.pod:608
4552 msgid "See also C<guestfs_realpath>."
4556 #: ../src/guestfs-actions.pod:613
4561 #: ../src/guestfs-actions.pod:615
4564 " char *guestfs_cat (guestfs_h *g,\n"
4565 "\t\tconst char *path);\n"
4570 #: ../src/guestfs-actions.pod:618 ../src/guestfs-actions.pod:3944 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:3039
4571 msgid "Return the contents of the file named C<path>."
4575 #: ../src/guestfs-actions.pod:620
4577 "Note that this function cannot correctly handle binary files (specifically, "
4578 "files containing C<\\0> character which is treated as end of string). For "
4579 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
4580 "functions which have a more complex interface."
4584 #: ../src/guestfs-actions.pod:628 ../src/guestfs-actions.pod:789 ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:1057 ../src/guestfs-actions.pod:1073 ../src/guestfs-actions.pod:1161 ../src/guestfs-actions.pod:1177 ../src/guestfs-actions.pod:1408 ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1808 ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:3915 ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:4662 ../src/guestfs-actions.pod:4714 ../src/guestfs-actions.pod:4830 ../src/guestfs-actions.pod:4851 ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5393 ../src/guestfs-actions.pod:5416 ../src/guestfs-actions.pod:5432 ../src/guestfs-actions.pod:5505 ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5561 ../src/guestfs-actions.pod:5577 ../fish/guestfish-actions.pod:507 ../fish/guestfish-actions.pod:642 ../fish/guestfish-actions.pod:654 ../fish/guestfish-actions.pod:836 ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:913 ../fish/guestfish-actions.pod:923 ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1391 ../fish/guestfish-actions.pod:1401 ../fish/guestfish-actions.pod:1429 ../fish/guestfish-actions.pod:1444 ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:1473 ../fish/guestfish-actions.pod:2941 ../fish/guestfish-actions.pod:3017 ../fish/guestfish-actions.pod:3032 ../fish/guestfish-actions.pod:3593 ../fish/guestfish-actions.pod:3639 ../fish/guestfish-actions.pod:3724 ../fish/guestfish-actions.pod:3739 ../fish/guestfish-actions.pod:4122 ../fish/guestfish-actions.pod:4140 ../fish/guestfish-actions.pod:4157 ../fish/guestfish-actions.pod:4167 ../fish/guestfish-actions.pod:4215 ../fish/guestfish-actions.pod:4225 ../fish/guestfish-actions.pod:4254 ../fish/guestfish-actions.pod:4264
4586 "Because of the message protocol, there is a transfer limit of somewhere "
4587 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
4591 #: ../src/guestfs-actions.pod:631
4592 msgid "guestfs_checksum"
4596 #: ../src/guestfs-actions.pod:633
4599 " char *guestfs_checksum (guestfs_h *g,\n"
4600 "\t\tconst char *csumtype,\n"
4601 "\t\tconst char *path);\n"
4606 #: ../src/guestfs-actions.pod:637 ../fish/guestfish-actions.pod:514
4607 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
4611 #: ../src/guestfs-actions.pod:640 ../fish/guestfish-actions.pod:517
4613 "The type of checksum to compute is given by the C<csumtype> parameter which "
4614 "must have one of the following values:"
4618 #: ../src/guestfs-actions.pod:645 ../fish/guestfish-actions.pod:522
4623 #: ../src/guestfs-actions.pod:647 ../fish/guestfish-actions.pod:524
4625 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
4630 #: ../src/guestfs-actions.pod:650 ../fish/guestfish-actions.pod:527
4635 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:529
4636 msgid "Compute the MD5 hash (using the C<md5sum> program)."
4640 #: ../src/guestfs-actions.pod:654 ../fish/guestfish-actions.pod:531
4645 #: ../src/guestfs-actions.pod:656 ../fish/guestfish-actions.pod:533
4646 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
4650 #: ../src/guestfs-actions.pod:658 ../fish/guestfish-actions.pod:535
4655 #: ../src/guestfs-actions.pod:660 ../fish/guestfish-actions.pod:537
4656 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
4660 #: ../src/guestfs-actions.pod:662 ../fish/guestfish-actions.pod:539
4665 #: ../src/guestfs-actions.pod:664 ../fish/guestfish-actions.pod:541
4666 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
4670 #: ../src/guestfs-actions.pod:666 ../fish/guestfish-actions.pod:543
4675 #: ../src/guestfs-actions.pod:668 ../fish/guestfish-actions.pod:545
4676 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
4680 #: ../src/guestfs-actions.pod:670 ../fish/guestfish-actions.pod:547
4685 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:549
4686 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
4690 #: ../src/guestfs-actions.pod:676 ../fish/guestfish-actions.pod:553
4691 msgid "The checksum is returned as a printable string."
4695 #: ../src/guestfs-actions.pod:678
4696 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
4700 #: ../src/guestfs-actions.pod:680
4701 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
4705 #: ../src/guestfs-actions.pod:685
4706 msgid "guestfs_checksum_device"
4710 #: ../src/guestfs-actions.pod:687
4713 " char *guestfs_checksum_device (guestfs_h *g,\n"
4714 "\t\tconst char *csumtype,\n"
4715 "\t\tconst char *device);\n"
4720 #: ../src/guestfs-actions.pod:691
4722 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
4723 "device named C<device>. For the types of checksums supported see the "
4724 "C<guestfs_checksum> command."
4728 #: ../src/guestfs-actions.pod:698
4729 msgid "guestfs_checksums_out"
4733 #: ../src/guestfs-actions.pod:700
4736 " int guestfs_checksums_out (guestfs_h *g,\n"
4737 "\t\tconst char *csumtype,\n"
4738 "\t\tconst char *directory,\n"
4739 "\t\tconst char *sumsfile);\n"
4744 #: ../src/guestfs-actions.pod:705 ../fish/guestfish-actions.pod:571
4746 "This command computes the checksums of all regular files in C<directory> and "
4747 "then emits a list of those checksums to the local output file C<sumsfile>."
4751 #: ../src/guestfs-actions.pod:709 ../fish/guestfish-actions.pod:575
4753 "This can be used for verifying the integrity of a virtual machine. However "
4754 "to be properly secure you should pay attention to the output of the checksum "
4755 "command (it uses the ones from GNU coreutils). In particular when the "
4756 "filename is not printable, coreutils uses a special backslash syntax. For "
4757 "more information, see the GNU coreutils info file."
4761 #: ../src/guestfs-actions.pod:719
4762 msgid "guestfs_chmod"
4766 #: ../src/guestfs-actions.pod:721
4769 " int guestfs_chmod (guestfs_h *g,\n"
4771 "\t\tconst char *path);\n"
4776 #: ../src/guestfs-actions.pod:725 ../fish/guestfish-actions.pod:589
4778 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
4783 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:592
4785 "I<Note>: When using this command from guestfish, C<mode> by default would be "
4786 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
4791 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:3150 ../src/guestfs-actions.pod:3238 ../src/guestfs-actions.pod:3254 ../src/guestfs-actions.pod:3270 ../fish/guestfish-actions.pod:596 ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2516 ../fish/guestfish-actions.pod:2526 ../fish/guestfish-actions.pod:2536
4792 msgid "The mode actually set is affected by the umask."
4796 #: ../src/guestfs-actions.pod:736
4797 msgid "guestfs_chown"
4801 #: ../src/guestfs-actions.pod:738
4804 " int guestfs_chown (guestfs_h *g,\n"
4807 "\t\tconst char *path);\n"
4812 #: ../src/guestfs-actions.pod:743 ../fish/guestfish-actions.pod:602
4813 msgid "Change the file owner to C<owner> and group to C<group>."
4817 #: ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:2436 ../fish/guestfish-actions.pod:604 ../fish/guestfish-actions.pod:1937
4819 "Only numeric uid and gid are supported. If you want to use names, you will "
4820 "need to locate and parse the password file yourself (Augeas support makes "
4821 "this relatively easy)."
4825 #: ../src/guestfs-actions.pod:751
4826 msgid "guestfs_command"
4830 #: ../src/guestfs-actions.pod:753
4833 " char *guestfs_command (guestfs_h *g,\n"
4834 "\t\tchar *const *arguments);\n"
4839 #: ../src/guestfs-actions.pod:756 ../fish/guestfish-actions.pod:612
4841 "This call runs a command from the guest filesystem. The filesystem must be "
4842 "mounted, and must contain a compatible operating system (ie. something "
4843 "Linux, with the same or compatible processor architecture)."
4847 #: ../src/guestfs-actions.pod:761
4849 "The single parameter is an argv-style list of arguments. The first element "
4850 "is the name of the program to run. Subsequent elements are parameters. The "
4851 "list must be non-empty (ie. must contain a program name). Note that the "
4852 "command runs directly, and is I<not> invoked via the shell (see "
4857 #: ../src/guestfs-actions.pod:768 ../fish/guestfish-actions.pod:624
4858 msgid "The return value is anything printed to I<stdout> by the command."
4862 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:627
4864 "If the command returns a non-zero exit status, then this function returns an "
4865 "error message. The error message string is the content of I<stderr> from "
4870 #: ../src/guestfs-actions.pod:775 ../fish/guestfish-actions.pod:631
4872 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
4873 "C</bin>. If you require a program from another location, you should provide "
4874 "the full path in the first parameter."
4878 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:636
4880 "Shared libraries and data files required by the program must be available on "
4881 "filesystems which are mounted in the correct places. It is the caller's "
4882 "responsibility to ensure all filesystems that are needed are mounted at the "
4887 #: ../src/guestfs-actions.pod:792
4888 msgid "guestfs_command_lines"
4892 #: ../src/guestfs-actions.pod:794
4895 " char **guestfs_command_lines (guestfs_h *g,\n"
4896 "\t\tchar *const *arguments);\n"
4901 #: ../src/guestfs-actions.pod:797
4903 "This is the same as C<guestfs_command>, but splits the result into a list of "
4908 #: ../src/guestfs-actions.pod:800
4909 msgid "See also: C<guestfs_sh_lines>"
4913 #: ../src/guestfs-actions.pod:809
4914 msgid "guestfs_config"
4918 #: ../src/guestfs-actions.pod:811
4921 " int guestfs_config (guestfs_h *g,\n"
4922 "\t\tconst char *qemuparam,\n"
4923 "\t\tconst char *qemuvalue);\n"
4928 #: ../src/guestfs-actions.pod:815 ../fish/guestfish-actions.pod:661
4930 "This can be used to add arbitrary qemu command line parameters of the form "
4931 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
4932 "setting some parameters which would interfere with parameters that we use."
4936 #: ../src/guestfs-actions.pod:820 ../fish/guestfish-actions.pod:666
4937 msgid "The first character of C<param> string must be a C<-> (dash)."
4941 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:668
4942 msgid "C<value> can be NULL."
4946 #: ../src/guestfs-actions.pod:826
4947 msgid "guestfs_copy_size"
4951 #: ../src/guestfs-actions.pod:828
4954 " int guestfs_copy_size (guestfs_h *g,\n"
4955 "\t\tconst char *src,\n"
4956 "\t\tconst char *dest,\n"
4957 "\t\tint64_t size);\n"
4962 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:674
4964 "This command copies exactly C<size> bytes from one source device or file "
4965 "C<src> to another destination device or file C<dest>."
4969 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:677
4971 "Note this will fail if the source is too short or if the destination is not "
4976 #: ../src/guestfs-actions.pod:841 ../src/guestfs-actions.pod:976 ../src/guestfs-actions.pod:1348 ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:5450 ../src/guestfs-actions.pod:5466
4978 "This long-running command can generate progress notification messages so "
4979 "that the caller can display a progress bar or indicator. To receive these "
4980 "messages, the caller must register a progress callback. See "
4981 "L<guestfs(3)/guestfs_set_progress_callback>."
4985 #: ../src/guestfs-actions.pod:846
4990 #: ../src/guestfs-actions.pod:848
4993 " int guestfs_cp (guestfs_h *g,\n"
4994 "\t\tconst char *src,\n"
4995 "\t\tconst char *dest);\n"
5000 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:684
5002 "This copies a file from C<src> to C<dest> where C<dest> is either a "
5003 "destination filename or destination directory."
5007 #: ../src/guestfs-actions.pod:857
5008 msgid "guestfs_cp_a"
5012 #: ../src/guestfs-actions.pod:859
5015 " int guestfs_cp_a (guestfs_h *g,\n"
5016 "\t\tconst char *src,\n"
5017 "\t\tconst char *dest);\n"
5022 #: ../src/guestfs-actions.pod:863 ../fish/guestfish-actions.pod:691
5024 "This copies a file or directory from C<src> to C<dest> recursively using the "
5029 #: ../src/guestfs-actions.pod:868
5034 #: ../src/guestfs-actions.pod:870
5037 " int guestfs_dd (guestfs_h *g,\n"
5038 "\t\tconst char *src,\n"
5039 "\t\tconst char *dest);\n"
5044 #: ../src/guestfs-actions.pod:874 ../fish/guestfish-actions.pod:698
5046 "This command copies from one source device or file C<src> to another "
5047 "destination device or file C<dest>. Normally you would use this to copy to "
5048 "or from a device or partition, for example to duplicate a filesystem."
5052 #: ../src/guestfs-actions.pod:879
5054 "If the destination is a device, it must be as large or larger than the "
5055 "source file or device, otherwise the copy will fail. This command cannot do "
5056 "partial copies (see C<guestfs_copy_size>)."
5060 #: ../src/guestfs-actions.pod:885
5061 msgid "guestfs_debug"
5065 #: ../src/guestfs-actions.pod:887
5068 " char *guestfs_debug (guestfs_h *g,\n"
5069 "\t\tconst char *subcmd,\n"
5070 "\t\tchar *const *extraargs);\n"
5075 #: ../src/guestfs-actions.pod:891
5077 "The C<guestfs_debug> command exposes some internals of C<guestfsd> (the "
5078 "guestfs daemon) that runs inside the qemu subprocess."
5082 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:715
5084 "There is no comprehensive help for this command. You have to look at the "
5085 "file C<daemon/debug.c> in the libguestfs source to find out what you can do."
5089 #: ../src/guestfs-actions.pod:902
5090 msgid "guestfs_debug_upload"
5094 #: ../src/guestfs-actions.pod:904
5097 " int guestfs_debug_upload (guestfs_h *g,\n"
5098 "\t\tconst char *filename,\n"
5099 "\t\tconst char *tmpname,\n"
5105 #: ../src/guestfs-actions.pod:909
5107 "The C<guestfs_debug_upload> command uploads a file to the libguestfs "
5112 #: ../src/guestfs-actions.pod:912 ../fish/guestfish-actions.pod:726
5114 "There is no comprehensive help for this command. You have to look at the "
5115 "file C<daemon/debug.c> in the libguestfs source to find out what it is for."
5119 #: ../src/guestfs-actions.pod:918
5124 #: ../src/guestfs-actions.pod:920
5127 " char *guestfs_df (guestfs_h *g);\n"
5132 #: ../src/guestfs-actions.pod:922 ../fish/guestfish-actions.pod:736
5133 msgid "This command runs the C<df> command to report disk space used."
5137 #: ../src/guestfs-actions.pod:924 ../src/guestfs-actions.pod:938 ../fish/guestfish-actions.pod:738 ../fish/guestfish-actions.pod:749
5139 "This command is mostly useful for interactive sessions. It is I<not> "
5140 "intended that you try to parse the output string. Use C<statvfs> from "
5145 #: ../src/guestfs-actions.pod:931
5146 msgid "guestfs_df_h"
5150 #: ../src/guestfs-actions.pod:933
5153 " char *guestfs_df_h (guestfs_h *g);\n"
5158 #: ../src/guestfs-actions.pod:935 ../fish/guestfish-actions.pod:746
5160 "This command runs the C<df -h> command to report disk space used in "
5161 "human-readable format."
5165 #: ../src/guestfs-actions.pod:945
5166 msgid "guestfs_dmesg"
5170 #: ../src/guestfs-actions.pod:947
5173 " char *guestfs_dmesg (guestfs_h *g);\n"
5178 #: ../src/guestfs-actions.pod:949 ../fish/guestfish-actions.pod:757
5180 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
5181 "This is sometimes useful for extended debugging of problems."
5185 #: ../src/guestfs-actions.pod:953
5187 "Another way to get the same information is to enable verbose messages with "
5188 "C<guestfs_set_verbose> or by setting the environment variable "
5189 "C<LIBGUESTFS_DEBUG=1> before running the program."
5193 #: ../src/guestfs-actions.pod:961
5194 msgid "guestfs_download"
5198 #: ../src/guestfs-actions.pod:963
5201 " int guestfs_download (guestfs_h *g,\n"
5202 "\t\tconst char *remotefilename,\n"
5203 "\t\tconst char *filename);\n"
5208 #: ../src/guestfs-actions.pod:967 ../fish/guestfish-actions.pod:770
5210 "Download file C<remotefilename> and save it as C<filename> on the local "
5215 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:5044 ../fish/guestfish-actions.pod:773 ../fish/guestfish-actions.pod:3893
5216 msgid "C<filename> can also be a named pipe."
5220 #: ../src/guestfs-actions.pod:972
5221 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
5225 #: ../src/guestfs-actions.pod:981
5226 msgid "guestfs_drop_caches"
5230 #: ../src/guestfs-actions.pod:983
5233 " int guestfs_drop_caches (guestfs_h *g,\n"
5234 "\t\tint whattodrop);\n"
5239 #: ../src/guestfs-actions.pod:986 ../fish/guestfish-actions.pod:783
5241 "This instructs the guest kernel to drop its page cache, and/or dentries and "
5242 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
5243 "to drop, see L<http://linux-mm.org/Drop_Caches>"
5247 #: ../src/guestfs-actions.pod:991 ../fish/guestfish-actions.pod:788
5248 msgid "Setting C<whattodrop> to 3 should drop everything."
5252 #: ../src/guestfs-actions.pod:993 ../fish/guestfish-actions.pod:790
5254 "This automatically calls L<sync(2)> before the operation, so that the "
5255 "maximum guest memory is freed."
5259 #: ../src/guestfs-actions.pod:998
5264 #: ../src/guestfs-actions.pod:1000
5267 " int64_t guestfs_du (guestfs_h *g,\n"
5268 "\t\tconst char *path);\n"
5273 #: ../src/guestfs-actions.pod:1003 ../fish/guestfish-actions.pod:797
5275 "This command runs the C<du -s> command to estimate file space usage for "
5280 #: ../src/guestfs-actions.pod:1006 ../fish/guestfish-actions.pod:800
5282 "C<path> can be a file or a directory. If C<path> is a directory then the "
5283 "estimate includes the contents of the directory and all subdirectories "
5288 #: ../src/guestfs-actions.pod:1010 ../fish/guestfish-actions.pod:804
5289 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
5293 #: ../src/guestfs-actions.pod:1015
5294 msgid "guestfs_e2fsck_f"
5298 #: ../src/guestfs-actions.pod:1017
5301 " int guestfs_e2fsck_f (guestfs_h *g,\n"
5302 "\t\tconst char *device);\n"
5307 #: ../src/guestfs-actions.pod:1020 ../fish/guestfish-actions.pod:811
5309 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
5310 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
5315 #: ../src/guestfs-actions.pod:1024
5317 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
5318 "Normally you should use C<guestfs_fsck>."
5322 #: ../src/guestfs-actions.pod:1029
5323 msgid "guestfs_echo_daemon"
5327 #: ../src/guestfs-actions.pod:1031
5330 " char *guestfs_echo_daemon (guestfs_h *g,\n"
5331 "\t\tchar *const *words);\n"
5336 #: ../src/guestfs-actions.pod:1034 ../fish/guestfish-actions.pod:822
5338 "This command concatenates the list of C<words> passed with single spaces "
5339 "between them and returns the resulting string."
5343 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:825
5344 msgid "You can use this command to test the connection through to the daemon."
5348 #: ../src/guestfs-actions.pod:1039
5349 msgid "See also C<guestfs_ping_daemon>."
5353 #: ../src/guestfs-actions.pod:1044
5354 msgid "guestfs_egrep"
5358 #: ../src/guestfs-actions.pod:1046
5361 " char **guestfs_egrep (guestfs_h *g,\n"
5362 "\t\tconst char *regex,\n"
5363 "\t\tconst char *path);\n"
5368 #: ../src/guestfs-actions.pod:1050 ../fish/guestfish-actions.pod:833
5369 msgid "This calls the external C<egrep> program and returns the matching lines."
5373 #: ../src/guestfs-actions.pod:1060
5374 msgid "guestfs_egrepi"
5378 #: ../src/guestfs-actions.pod:1062
5381 " char **guestfs_egrepi (guestfs_h *g,\n"
5382 "\t\tconst char *regex,\n"
5383 "\t\tconst char *path);\n"
5388 #: ../src/guestfs-actions.pod:1066 ../fish/guestfish-actions.pod:843
5389 msgid "This calls the external C<egrep -i> program and returns the matching lines."
5393 #: ../src/guestfs-actions.pod:1076
5394 msgid "guestfs_equal"
5398 #: ../src/guestfs-actions.pod:1078
5401 " int guestfs_equal (guestfs_h *g,\n"
5402 "\t\tconst char *file1,\n"
5403 "\t\tconst char *file2);\n"
5408 #: ../src/guestfs-actions.pod:1082 ../fish/guestfish-actions.pod:853
5410 "This compares the two files C<file1> and C<file2> and returns true if their "
5411 "content is exactly equal, or false otherwise."
5415 #: ../src/guestfs-actions.pod:1085 ../fish/guestfish-actions.pod:856
5416 msgid "The external L<cmp(1)> program is used for the comparison."
5420 #: ../src/guestfs-actions.pod:1089
5421 msgid "guestfs_exists"
5425 #: ../src/guestfs-actions.pod:1091
5428 " int guestfs_exists (guestfs_h *g,\n"
5429 "\t\tconst char *path);\n"
5434 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:862
5436 "This returns C<true> if and only if there is a file, directory (or anything) "
5437 "with the given C<path> name."
5441 #: ../src/guestfs-actions.pod:1097
5442 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
5446 #: ../src/guestfs-actions.pod:1101
5447 msgid "guestfs_fallocate"
5451 #: ../src/guestfs-actions.pod:1103
5454 " int guestfs_fallocate (guestfs_h *g,\n"
5455 "\t\tconst char *path,\n"
5461 #: ../src/guestfs-actions.pod:1107 ../src/guestfs-actions.pod:1130 ../fish/guestfish-actions.pod:871 ../fish/guestfish-actions.pod:890
5463 "This command preallocates a file (containing zero bytes) named C<path> of "
5464 "size C<len> bytes. If the file exists already, it is overwritten."
5468 #: ../src/guestfs-actions.pod:1111 ../fish/guestfish-actions.pod:875
5470 "Do not confuse this with the guestfish-specific C<alloc> command which "
5471 "allocates a file in the host and attaches it as a device."
5475 #: ../src/guestfs-actions.pod:1117 ../fish/guestfish-actions.pod:879
5477 "This function is deprecated. In new code, use the C<fallocate64> call "
5482 #: ../src/guestfs-actions.pod:1120 ../src/guestfs-actions.pod:1555 ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:5399 ../src/guestfs-actions.pod:5544 ../fish/guestfish-actions.pod:882 ../fish/guestfish-actions.pod:1239 ../fish/guestfish-actions.pod:1253 ../fish/guestfish-actions.pod:4146 ../fish/guestfish-actions.pod:4243
5484 "Deprecated functions will not be removed from the API, but the fact that "
5485 "they are deprecated indicates that there are problems with correct use of "
5490 #: ../src/guestfs-actions.pod:1124
5491 msgid "guestfs_fallocate64"
5495 #: ../src/guestfs-actions.pod:1126
5498 " int guestfs_fallocate64 (guestfs_h *g,\n"
5499 "\t\tconst char *path,\n"
5500 "\t\tint64_t len);\n"
5505 #: ../src/guestfs-actions.pod:1134
5507 "Note that this call allocates disk blocks for the file. To create a sparse "
5508 "file use C<guestfs_truncate_size> instead."
5512 #: ../src/guestfs-actions.pod:1137
5514 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
5515 "oversight it only allowed 30 bit lengths to be specified, effectively "
5516 "limiting the maximum size of files created through that call to 1GB."
5520 #: ../src/guestfs-actions.pod:1142 ../fish/guestfish-actions.pod:902
5522 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
5523 "commands which create a file in the host and attach it as a device."
5527 #: ../src/guestfs-actions.pod:1148
5528 msgid "guestfs_fgrep"
5532 #: ../src/guestfs-actions.pod:1150
5535 " char **guestfs_fgrep (guestfs_h *g,\n"
5536 "\t\tconst char *pattern,\n"
5537 "\t\tconst char *path);\n"
5542 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:910
5543 msgid "This calls the external C<fgrep> program and returns the matching lines."
5547 #: ../src/guestfs-actions.pod:1164
5548 msgid "guestfs_fgrepi"
5552 #: ../src/guestfs-actions.pod:1166
5555 " char **guestfs_fgrepi (guestfs_h *g,\n"
5556 "\t\tconst char *pattern,\n"
5557 "\t\tconst char *path);\n"
5562 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:920
5563 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
5567 #: ../src/guestfs-actions.pod:1180
5568 msgid "guestfs_file"
5572 #: ../src/guestfs-actions.pod:1182
5575 " char *guestfs_file (guestfs_h *g,\n"
5576 "\t\tconst char *path);\n"
5581 #: ../src/guestfs-actions.pod:1185 ../fish/guestfish-actions.pod:930
5583 "This call uses the standard L<file(1)> command to determine the type or "
5584 "contents of the file."
5588 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:933
5590 "This call will also transparently look inside various types of compressed "
5595 #: ../src/guestfs-actions.pod:1191 ../fish/guestfish-actions.pod:936
5597 "The exact command which runs is C<file -zb path>. Note in particular that "
5598 "the filename is not prepended to the output (the C<-b> option)."
5602 #: ../src/guestfs-actions.pod:1195
5604 "This command can also be used on C</dev/> devices (and partitions, LV "
5605 "names). You can for example use this to determine if a device contains a "
5606 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
5610 #: ../src/guestfs-actions.pod:1200 ../fish/guestfish-actions.pod:945
5612 "If the C<path> does not begin with C</dev/> then this command only works for "
5613 "the content of regular files. For other file types (directory, symbolic "
5614 "link etc) it will just return the string C<directory> etc."
5618 #: ../src/guestfs-actions.pod:1208
5619 msgid "guestfs_file_architecture"
5623 #: ../src/guestfs-actions.pod:1210
5626 " char *guestfs_file_architecture (guestfs_h *g,\n"
5627 "\t\tconst char *filename);\n"
5632 #: ../src/guestfs-actions.pod:1213 ../fish/guestfish-actions.pod:954
5634 "This detects the architecture of the binary C<filename>, and returns it if "
5639 #: ../src/guestfs-actions.pod:1216 ../fish/guestfish-actions.pod:957
5640 msgid "Currently defined architectures are:"
5644 #: ../src/guestfs-actions.pod:1220 ../fish/guestfish-actions.pod:961
5649 #: ../src/guestfs-actions.pod:1222 ../fish/guestfish-actions.pod:963
5651 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
5652 "irrespective of the precise processor requirements of the binary."
5656 #: ../src/guestfs-actions.pod:1225 ../fish/guestfish-actions.pod:966
5661 #: ../src/guestfs-actions.pod:1227 ../fish/guestfish-actions.pod:968
5662 msgid "64 bit x86-64."
5666 #: ../src/guestfs-actions.pod:1229 ../fish/guestfish-actions.pod:970
5671 #: ../src/guestfs-actions.pod:1231 ../fish/guestfish-actions.pod:972
5672 msgid "32 bit SPARC."
5676 #: ../src/guestfs-actions.pod:1233 ../fish/guestfish-actions.pod:974
5681 #: ../src/guestfs-actions.pod:1235 ../fish/guestfish-actions.pod:976
5682 msgid "64 bit SPARC V9 and above."
5686 #: ../src/guestfs-actions.pod:1237 ../fish/guestfish-actions.pod:978
5691 #: ../src/guestfs-actions.pod:1239 ../fish/guestfish-actions.pod:980
5692 msgid "Intel Itanium."
5696 #: ../src/guestfs-actions.pod:1241 ../fish/guestfish-actions.pod:982
5701 #: ../src/guestfs-actions.pod:1243 ../fish/guestfish-actions.pod:984
5702 msgid "32 bit Power PC."
5706 #: ../src/guestfs-actions.pod:1245 ../fish/guestfish-actions.pod:986
5711 #: ../src/guestfs-actions.pod:1247 ../fish/guestfish-actions.pod:988
5712 msgid "64 bit Power PC."
5716 #: ../src/guestfs-actions.pod:1251 ../fish/guestfish-actions.pod:992
5717 msgid "Libguestfs may return other architecture strings in future."
5721 #: ../src/guestfs-actions.pod:1253 ../fish/guestfish-actions.pod:994
5722 msgid "The function works on at least the following types of files:"
5726 #: ../src/guestfs-actions.pod:1259 ../fish/guestfish-actions.pod:1000
5727 msgid "many types of Un*x and Linux binary"
5731 #: ../src/guestfs-actions.pod:1263 ../fish/guestfish-actions.pod:1004
5732 msgid "many types of Un*x and Linux shared library"
5736 #: ../src/guestfs-actions.pod:1267 ../fish/guestfish-actions.pod:1008
5737 msgid "Windows Win32 and Win64 binaries"
5741 #: ../src/guestfs-actions.pod:1271 ../fish/guestfish-actions.pod:1012
5742 msgid "Windows Win32 and Win64 DLLs"
5746 #: ../src/guestfs-actions.pod:1273 ../fish/guestfish-actions.pod:1014
5747 msgid "Win32 binaries and DLLs return C<i386>."
5751 #: ../src/guestfs-actions.pod:1275 ../fish/guestfish-actions.pod:1016
5752 msgid "Win64 binaries and DLLs return C<x86_64>."
5756 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:1020
5757 msgid "Linux kernel modules"
5761 #: ../src/guestfs-actions.pod:1283 ../fish/guestfish-actions.pod:1024
5762 msgid "Linux new-style initrd images"
5766 #: ../src/guestfs-actions.pod:1287 ../fish/guestfish-actions.pod:1028
5767 msgid "some non-x86 Linux vmlinuz kernels"
5771 #: ../src/guestfs-actions.pod:1291 ../fish/guestfish-actions.pod:1032
5772 msgid "What it can't do currently:"
5776 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:1038
5777 msgid "static libraries (libfoo.a)"
5781 #: ../src/guestfs-actions.pod:1301 ../fish/guestfish-actions.pod:1042
5782 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
5786 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:1046
5787 msgid "x86 Linux vmlinuz kernels"
5791 #: ../src/guestfs-actions.pod:1307 ../fish/guestfish-actions.pod:1048
5793 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
5794 "compressed code, and are horribly hard to unpack. If you want to find the "
5795 "architecture of a kernel, use the architecture of the associated initrd or "
5796 "kernel module(s) instead."
5800 #: ../src/guestfs-actions.pod:1317
5801 msgid "guestfs_filesize"
5805 #: ../src/guestfs-actions.pod:1319
5808 " int64_t guestfs_filesize (guestfs_h *g,\n"
5809 "\t\tconst char *file);\n"
5814 #: ../src/guestfs-actions.pod:1322 ../fish/guestfish-actions.pod:1059
5815 msgid "This command returns the size of C<file> in bytes."
5819 #: ../src/guestfs-actions.pod:1324
5821 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
5822 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
5823 "devices, use C<guestfs_blockdev_getsize64>."
5827 #: ../src/guestfs-actions.pod:1330
5828 msgid "guestfs_fill"
5832 #: ../src/guestfs-actions.pod:1332
5835 " int guestfs_fill (guestfs_h *g,\n"
5838 "\t\tconst char *path);\n"
5843 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:1069
5845 "This command creates a new file called C<path>. The initial content of the "
5846 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
5851 #: ../src/guestfs-actions.pod:1341
5853 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
5854 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
5855 "bytes use C<guestfs_fill_pattern>."
5859 #: ../src/guestfs-actions.pod:1353
5860 msgid "guestfs_fill_pattern"
5864 #: ../src/guestfs-actions.pod:1355
5867 " int guestfs_fill_pattern (guestfs_h *g,\n"
5868 "\t\tconst char *pattern,\n"
5870 "\t\tconst char *path);\n"
5875 #: ../src/guestfs-actions.pod:1360
5877 "This function is like C<guestfs_fill> except that it creates a new file of "
5878 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
5879 "pattern is truncated if necessary to ensure the length of the file is "
5880 "exactly C<len> bytes."
5884 #: ../src/guestfs-actions.pod:1372
5885 msgid "guestfs_find"
5889 #: ../src/guestfs-actions.pod:1374
5892 " char **guestfs_find (guestfs_h *g,\n"
5893 "\t\tconst char *directory);\n"
5898 #: ../src/guestfs-actions.pod:1377 ../fish/guestfish-actions.pod:1091
5900 "This command lists out all files and directories, recursively, starting at "
5901 "C<directory>. It is essentially equivalent to running the shell command "
5902 "C<find directory -print> but some post-processing happens on the output, "
5907 #: ../src/guestfs-actions.pod:1382 ../fish/guestfish-actions.pod:1096
5909 "This returns a list of strings I<without any prefix>. Thus if the directory "
5914 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:1099
5924 #: ../src/guestfs-actions.pod:1389
5925 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
5929 #: ../src/guestfs-actions.pod:1392 ../fish/guestfish-actions.pod:1106
5940 #: ../src/guestfs-actions.pod:1397 ../fish/guestfish-actions.pod:1111
5941 msgid "If C<directory> is not a directory, then this command returns an error."
5945 #: ../src/guestfs-actions.pod:1400 ../fish/guestfish-actions.pod:1114
5946 msgid "The returned list is sorted."
5950 #: ../src/guestfs-actions.pod:1402
5951 msgid "See also C<guestfs_find0>."
5955 #: ../src/guestfs-actions.pod:1411
5956 msgid "guestfs_find0"
5960 #: ../src/guestfs-actions.pod:1413
5963 " int guestfs_find0 (guestfs_h *g,\n"
5964 "\t\tconst char *directory,\n"
5965 "\t\tconst char *files);\n"
5970 #: ../src/guestfs-actions.pod:1417 ../fish/guestfish-actions.pod:1125
5972 "This command lists out all files and directories, recursively, starting at "
5973 "C<directory>, placing the resulting list in the external file called "
5978 #: ../src/guestfs-actions.pod:1421
5980 "This command works the same way as C<guestfs_find> with the following "
5985 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:1136
5986 msgid "The resulting list is written to an external file."
5990 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:1140
5992 "Items (filenames) in the result are separated by C<\\0> characters. See "
5993 "L<find(1)> option I<-print0>."
5997 #: ../src/guestfs-actions.pod:1437 ../fish/guestfish-actions.pod:1145
5998 msgid "This command is not limited in the number of names that it can return."
6002 #: ../src/guestfs-actions.pod:1442 ../fish/guestfish-actions.pod:1150
6003 msgid "The result list is not sorted."
6007 #: ../src/guestfs-actions.pod:1448
6008 msgid "guestfs_findfs_label"
6012 #: ../src/guestfs-actions.pod:1450
6015 " char *guestfs_findfs_label (guestfs_h *g,\n"
6016 "\t\tconst char *label);\n"
6021 #: ../src/guestfs-actions.pod:1453 ../fish/guestfish-actions.pod:1160
6023 "This command searches the filesystems and returns the one which has the "
6024 "given label. An error is returned if no such filesystem can be found."
6028 #: ../src/guestfs-actions.pod:1457
6029 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
6033 #: ../src/guestfs-actions.pod:1462
6034 msgid "guestfs_findfs_uuid"
6038 #: ../src/guestfs-actions.pod:1464
6041 " char *guestfs_findfs_uuid (guestfs_h *g,\n"
6042 "\t\tconst char *uuid);\n"
6047 #: ../src/guestfs-actions.pod:1467 ../fish/guestfish-actions.pod:1170
6049 "This command searches the filesystems and returns the one which has the "
6050 "given UUID. An error is returned if no such filesystem can be found."
6054 #: ../src/guestfs-actions.pod:1471
6055 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
6059 #: ../src/guestfs-actions.pod:1476
6060 msgid "guestfs_fsck"
6064 #: ../src/guestfs-actions.pod:1478
6067 " int guestfs_fsck (guestfs_h *g,\n"
6068 "\t\tconst char *fstype,\n"
6069 "\t\tconst char *device);\n"
6074 #: ../src/guestfs-actions.pod:1482 ../fish/guestfish-actions.pod:1180
6076 "This runs the filesystem checker (fsck) on C<device> which should have "
6077 "filesystem type C<fstype>."
6081 #: ../src/guestfs-actions.pod:1485 ../fish/guestfish-actions.pod:1183
6083 "The returned integer is the status. See L<fsck(8)> for the list of status "
6084 "codes from C<fsck>."
6088 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:1192
6089 msgid "Multiple status codes can be summed together."
6093 #: ../src/guestfs-actions.pod:1498 ../fish/guestfish-actions.pod:1196
6095 "A non-zero return code can mean \"success\", for example if errors have been "
6096 "corrected on the filesystem."
6100 #: ../src/guestfs-actions.pod:1503 ../fish/guestfish-actions.pod:1201
6101 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
6105 #: ../src/guestfs-actions.pod:1508 ../fish/guestfish-actions.pod:1206
6106 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
6110 #: ../src/guestfs-actions.pod:1512
6111 msgid "guestfs_get_append"
6115 #: ../src/guestfs-actions.pod:1514
6118 " const char *guestfs_get_append (guestfs_h *g);\n"
6123 #: ../src/guestfs-actions.pod:1516 ../fish/guestfish-actions.pod:1212
6125 "Return the additional kernel options which are added to the guest kernel "
6130 #: ../src/guestfs-actions.pod:1519 ../fish/guestfish-actions.pod:1215
6131 msgid "If C<NULL> then no options are added."
6135 #: ../src/guestfs-actions.pod:1521
6137 "This function returns a string which may be NULL. There is no way to return "
6138 "an error from this function. The string is owned by the guest handle and "
6139 "must I<not> be freed."
6143 #: ../src/guestfs-actions.pod:1525
6144 msgid "guestfs_get_autosync"
6148 #: ../src/guestfs-actions.pod:1527
6151 " int guestfs_get_autosync (guestfs_h *g);\n"
6156 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1221
6157 msgid "Get the autosync flag."
6161 #: ../src/guestfs-actions.pod:1533
6162 msgid "guestfs_get_direct"
6166 #: ../src/guestfs-actions.pod:1535
6169 " int guestfs_get_direct (guestfs_h *g);\n"
6174 #: ../src/guestfs-actions.pod:1537 ../fish/guestfish-actions.pod:1227
6175 msgid "Return the direct appliance mode flag."
6179 #: ../src/guestfs-actions.pod:1541
6180 msgid "guestfs_get_e2label"
6184 #: ../src/guestfs-actions.pod:1543
6187 " char *guestfs_get_e2label (guestfs_h *g,\n"
6188 "\t\tconst char *device);\n"
6193 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1233
6194 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
6198 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1236
6200 "This function is deprecated. In new code, use the C<vfs_label> call "
6205 #: ../src/guestfs-actions.pod:1559
6206 msgid "guestfs_get_e2uuid"
6210 #: ../src/guestfs-actions.pod:1561
6213 " char *guestfs_get_e2uuid (guestfs_h *g,\n"
6214 "\t\tconst char *device);\n"
6219 #: ../src/guestfs-actions.pod:1564 ../fish/guestfish-actions.pod:1247
6220 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
6224 #: ../src/guestfs-actions.pod:1570 ../fish/guestfish-actions.pod:1250
6225 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
6229 #: ../src/guestfs-actions.pod:1577
6230 msgid "guestfs_get_memsize"
6234 #: ../src/guestfs-actions.pod:1579
6237 " int guestfs_get_memsize (guestfs_h *g);\n"
6242 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1261
6243 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
6247 #: ../src/guestfs-actions.pod:1584
6249 "If C<guestfs_set_memsize> was not called on this handle, and if "
6250 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
6251 "value for memsize."
6255 #: ../src/guestfs-actions.pod:1588 ../src/guestfs-actions.pod:1651 ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1317 ../fish/guestfish-actions.pod:3318 ../fish/guestfish-actions.pod:3395
6256 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
6260 #: ../src/guestfs-actions.pod:1593
6261 msgid "guestfs_get_network"
6265 #: ../src/guestfs-actions.pod:1595
6268 " int guestfs_get_network (guestfs_h *g);\n"
6273 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1275
6274 msgid "This returns the enable network flag."
6278 #: ../src/guestfs-actions.pod:1601
6279 msgid "guestfs_get_path"
6283 #: ../src/guestfs-actions.pod:1603
6286 " const char *guestfs_get_path (guestfs_h *g);\n"
6291 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1281
6292 msgid "Return the current search path."
6296 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1283
6298 "This is always non-NULL. If it wasn't set already, then this will return "
6303 #: ../src/guestfs-actions.pod:1610 ../src/guestfs-actions.pod:1633
6305 "This function returns a string, or NULL on error. The string is owned by "
6306 "the guest handle and must I<not> be freed."
6310 #: ../src/guestfs-actions.pod:1613
6311 msgid "guestfs_get_pid"
6315 #: ../src/guestfs-actions.pod:1615
6318 " int guestfs_get_pid (guestfs_h *g);\n"
6323 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1290
6325 "Return the process ID of the qemu subprocess. If there is no qemu "
6326 "subprocess, then this will return an error."
6330 #: ../src/guestfs-actions.pod:1620 ../fish/guestfish-actions.pod:1293
6331 msgid "This is an internal call used for debugging and testing."
6335 #: ../src/guestfs-actions.pod:1624
6336 msgid "guestfs_get_qemu"
6340 #: ../src/guestfs-actions.pod:1626
6343 " const char *guestfs_get_qemu (guestfs_h *g);\n"
6348 #: ../src/guestfs-actions.pod:1628 ../fish/guestfish-actions.pod:1299
6349 msgid "Return the current qemu binary."
6353 #: ../src/guestfs-actions.pod:1630 ../fish/guestfish-actions.pod:1301
6355 "This is always non-NULL. If it wasn't set already, then this will return "
6356 "the default qemu binary name."
6360 #: ../src/guestfs-actions.pod:1636
6361 msgid "guestfs_get_recovery_proc"
6365 #: ../src/guestfs-actions.pod:1638
6368 " int guestfs_get_recovery_proc (guestfs_h *g);\n"
6373 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1308
6374 msgid "Return the recovery process enabled flag."
6378 #: ../src/guestfs-actions.pod:1644
6379 msgid "guestfs_get_selinux"
6383 #: ../src/guestfs-actions.pod:1646
6386 " int guestfs_get_selinux (guestfs_h *g);\n"
6391 #: ../src/guestfs-actions.pod:1648
6393 "This returns the current setting of the selinux flag which is passed to the "
6394 "appliance at boot time. See C<guestfs_set_selinux>."
6398 #: ../src/guestfs-actions.pod:1656
6399 msgid "guestfs_get_state"
6403 #: ../src/guestfs-actions.pod:1658
6406 " int guestfs_get_state (guestfs_h *g);\n"
6411 #: ../src/guestfs-actions.pod:1660 ../fish/guestfish-actions.pod:1324
6413 "This returns the current state as an opaque integer. This is only useful "
6414 "for printing debug and internal error messages."
6418 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:2284 ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:2356 ../src/guestfs-actions.pod:2377 ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1821 ../fish/guestfish-actions.pod:1839 ../fish/guestfish-actions.pod:1877 ../fish/guestfish-actions.pod:1893
6419 msgid "For more information on states, see L<guestfs(3)>."
6423 #: ../src/guestfs-actions.pod:1667
6424 msgid "guestfs_get_trace"
6428 #: ../src/guestfs-actions.pod:1669
6431 " int guestfs_get_trace (guestfs_h *g);\n"
6436 #: ../src/guestfs-actions.pod:1671 ../fish/guestfish-actions.pod:1333
6437 msgid "Return the command trace flag."
6441 #: ../src/guestfs-actions.pod:1675
6442 msgid "guestfs_get_umask"
6446 #: ../src/guestfs-actions.pod:1677
6449 " int guestfs_get_umask (guestfs_h *g);\n"
6454 #: ../src/guestfs-actions.pod:1679
6456 "Return the current umask. By default the umask is C<022> unless it has been "
6457 "set by calling C<guestfs_umask>."
6461 #: ../src/guestfs-actions.pod:1684
6462 msgid "guestfs_get_verbose"
6466 #: ../src/guestfs-actions.pod:1686
6469 " int guestfs_get_verbose (guestfs_h *g);\n"
6474 #: ../src/guestfs-actions.pod:1688 ../fish/guestfish-actions.pod:1346
6475 msgid "This returns the verbose messages flag."
6479 #: ../src/guestfs-actions.pod:1692
6480 msgid "guestfs_getcon"
6484 #: ../src/guestfs-actions.pod:1694
6487 " char *guestfs_getcon (guestfs_h *g);\n"
6492 #: ../src/guestfs-actions.pod:1696 ../fish/guestfish-actions.pod:1352
6493 msgid "This gets the SELinux security context of the daemon."
6497 #: ../src/guestfs-actions.pod:1698
6498 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
6502 #: ../src/guestfs-actions.pod:1704
6503 msgid "guestfs_getxattrs"
6507 #: ../src/guestfs-actions.pod:1706
6510 " struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,\n"
6511 "\t\tconst char *path);\n"
6516 #: ../src/guestfs-actions.pod:1709 ../fish/guestfish-actions.pod:1361
6517 msgid "This call lists the extended attributes of the file or directory C<path>."
6521 #: ../src/guestfs-actions.pod:1712 ../fish/guestfish-actions.pod:1364
6523 "At the system call level, this is a combination of the L<listxattr(2)> and "
6524 "L<getxattr(2)> calls."
6528 #: ../src/guestfs-actions.pod:1715
6529 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
6533 #: ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2989
6535 "This function returns a C<struct guestfs_xattr_list *> (see "
6536 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
6537 "must call C<guestfs_free_xattr_list> after use>."
6541 #: ../src/guestfs-actions.pod:1722
6542 msgid "guestfs_glob_expand"
6546 #: ../src/guestfs-actions.pod:1724
6549 " char **guestfs_glob_expand (guestfs_h *g,\n"
6550 "\t\tconst char *pattern);\n"
6555 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1373
6557 "This command searches for all the pathnames matching C<pattern> according to "
6558 "the wildcard expansion rules used by the shell."
6562 #: ../src/guestfs-actions.pod:1731 ../fish/guestfish-actions.pod:1377
6563 msgid "If no paths match, then this returns an empty list (note: not an error)."
6567 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1380
6569 "It is just a wrapper around the C L<glob(3)> function with flags "
6570 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
6574 #: ../src/guestfs-actions.pod:1742
6575 msgid "guestfs_grep"
6579 #: ../src/guestfs-actions.pod:1744
6582 " char **guestfs_grep (guestfs_h *g,\n"
6583 "\t\tconst char *regex,\n"
6584 "\t\tconst char *path);\n"
6589 #: ../src/guestfs-actions.pod:1748 ../fish/guestfish-actions.pod:1388
6590 msgid "This calls the external C<grep> program and returns the matching lines."
6594 #: ../src/guestfs-actions.pod:1758
6595 msgid "guestfs_grepi"
6599 #: ../src/guestfs-actions.pod:1760
6602 " char **guestfs_grepi (guestfs_h *g,\n"
6603 "\t\tconst char *regex,\n"
6604 "\t\tconst char *path);\n"
6609 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1398
6610 msgid "This calls the external C<grep -i> program and returns the matching lines."
6614 #: ../src/guestfs-actions.pod:1774
6615 msgid "guestfs_grub_install"
6619 #: ../src/guestfs-actions.pod:1776
6622 " int guestfs_grub_install (guestfs_h *g,\n"
6623 "\t\tconst char *root,\n"
6624 "\t\tconst char *device);\n"
6629 #: ../src/guestfs-actions.pod:1780 ../fish/guestfish-actions.pod:1408
6631 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
6632 "the root directory being C<root>."
6636 #: ../src/guestfs-actions.pod:1783 ../fish/guestfish-actions.pod:1411
6638 "Note: If grub-install reports the error \"No suitable drive was found in the "
6639 "generated device map.\" it may be that you need to create a "
6640 "C</boot/grub/device.map> file first that contains the mapping between grub "
6641 "device names and Linux device names. It is usually sufficient to create a "
6646 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1418
6654 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1420
6655 msgid "replacing C</dev/vda> with the name of the installation device."
6659 #: ../src/guestfs-actions.pod:1796
6660 msgid "guestfs_head"
6664 #: ../src/guestfs-actions.pod:1798
6667 " char **guestfs_head (guestfs_h *g,\n"
6668 "\t\tconst char *path);\n"
6673 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1426
6675 "This command returns up to the first 10 lines of a file as a list of "
6680 #: ../src/guestfs-actions.pod:1811
6681 msgid "guestfs_head_n"
6685 #: ../src/guestfs-actions.pod:1813
6688 " char **guestfs_head_n (guestfs_h *g,\n"
6689 "\t\tint nrlines,\n"
6690 "\t\tconst char *path);\n"
6695 #: ../src/guestfs-actions.pod:1817 ../fish/guestfish-actions.pod:1436
6697 "If the parameter C<nrlines> is a positive number, this returns the first "
6698 "C<nrlines> lines of the file C<path>."
6702 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1439
6704 "If the parameter C<nrlines> is a negative number, this returns lines from "
6705 "the file C<path>, excluding the last C<nrlines> lines."
6709 #: ../src/guestfs-actions.pod:1823 ../src/guestfs-actions.pod:4845 ../fish/guestfish-actions.pod:1442 ../fish/guestfish-actions.pod:3737
6710 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
6714 #: ../src/guestfs-actions.pod:1832
6715 msgid "guestfs_hexdump"
6719 #: ../src/guestfs-actions.pod:1834
6722 " char *guestfs_hexdump (guestfs_h *g,\n"
6723 "\t\tconst char *path);\n"
6728 #: ../src/guestfs-actions.pod:1837 ../fish/guestfish-actions.pod:1451
6730 "This runs C<hexdump -C> on the given C<path>. The result is the "
6731 "human-readable, canonical hex dump of the file."
6735 #: ../src/guestfs-actions.pod:1846
6736 msgid "guestfs_initrd_cat"
6740 #: ../src/guestfs-actions.pod:1848
6743 " char *guestfs_initrd_cat (guestfs_h *g,\n"
6744 "\t\tconst char *initrdpath,\n"
6745 "\t\tconst char *filename,\n"
6746 "\t\tsize_t *size_r);\n"
6751 #: ../src/guestfs-actions.pod:1853 ../fish/guestfish-actions.pod:1461
6753 "This command unpacks the file C<filename> from the initrd file called "
6754 "C<initrdpath>. The filename must be given I<without> the initial C</> "
6759 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1465
6761 "For example, in guestfish you could use the following command to examine the "
6762 "boot script (usually called C</init>) contained in a Linux initrd or "
6767 #: ../src/guestfs-actions.pod:1861 ../fish/guestfish-actions.pod:1469
6770 " initrd-cat /boot/initrd-<version>.img init\n"
6775 #: ../src/guestfs-actions.pod:1863
6776 msgid "See also C<guestfs_initrd_list>."
6780 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:3803 ../src/guestfs-actions.pod:3932
6782 "This function returns a buffer, or NULL on error. The size of the returned "
6783 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
6788 #: ../src/guestfs-actions.pod:1872
6789 msgid "guestfs_initrd_list"
6793 #: ../src/guestfs-actions.pod:1874
6796 " char **guestfs_initrd_list (guestfs_h *g,\n"
6797 "\t\tconst char *path);\n"
6802 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1480
6803 msgid "This command lists out files contained in an initrd."
6807 #: ../src/guestfs-actions.pod:1879 ../fish/guestfish-actions.pod:1482
6809 "The files are listed without any initial C</> character. The files are "
6810 "listed in the order they appear (not necessarily alphabetical). Directory "
6811 "names are listed as separate items."
6815 #: ../src/guestfs-actions.pod:1883 ../fish/guestfish-actions.pod:1486
6817 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
6818 "initrd. We I<only> support the newer initramfs format (compressed cpio "
6823 #: ../src/guestfs-actions.pod:1891
6824 msgid "guestfs_inotify_add_watch"
6828 #: ../src/guestfs-actions.pod:1893
6831 " int64_t guestfs_inotify_add_watch (guestfs_h *g,\n"
6832 "\t\tconst char *path,\n"
6838 #: ../src/guestfs-actions.pod:1897 ../fish/guestfish-actions.pod:1494
6839 msgid "Watch C<path> for the events listed in C<mask>."
6843 #: ../src/guestfs-actions.pod:1899 ../fish/guestfish-actions.pod:1496
6845 "Note that if C<path> is a directory then events within that directory are "
6846 "watched, but this does I<not> happen recursively (in subdirectories)."
6850 #: ../src/guestfs-actions.pod:1903 ../fish/guestfish-actions.pod:1500
6852 "Note for non-C or non-Linux callers: the inotify events are defined by the "
6853 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
6857 #: ../src/guestfs-actions.pod:1909
6858 msgid "guestfs_inotify_close"
6862 #: ../src/guestfs-actions.pod:1911
6865 " int guestfs_inotify_close (guestfs_h *g);\n"
6870 #: ../src/guestfs-actions.pod:1913 ../fish/guestfish-actions.pod:1508
6872 "This closes the inotify handle which was previously opened by inotify_init. "
6873 "It removes all watches, throws away any pending events, and deallocates all "
6878 #: ../src/guestfs-actions.pod:1919
6879 msgid "guestfs_inotify_files"
6883 #: ../src/guestfs-actions.pod:1921
6886 " char **guestfs_inotify_files (guestfs_h *g);\n"
6891 #: ../src/guestfs-actions.pod:1923
6893 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
6894 "returns a list of pathnames of objects that were touched. The returned "
6895 "pathnames are sorted and deduplicated."
6899 #: ../src/guestfs-actions.pod:1931
6900 msgid "guestfs_inotify_init"
6904 #: ../src/guestfs-actions.pod:1933
6907 " int guestfs_inotify_init (guestfs_h *g,\n"
6908 "\t\tint maxevents);\n"
6913 #: ../src/guestfs-actions.pod:1936 ../fish/guestfish-actions.pod:1524
6915 "This command creates a new inotify handle. The inotify subsystem can be "
6916 "used to notify events which happen to objects in the guest filesystem."
6920 #: ../src/guestfs-actions.pod:1940
6922 "C<maxevents> is the maximum number of events which will be queued up between "
6923 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
6924 "passed as C<0>, then the kernel (or previously set) default is used. For "
6925 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
6926 "throws away events, but records the fact that it threw them away by setting "
6927 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
6928 "C<guestfs_inotify_read>)."
6932 #: ../src/guestfs-actions.pod:1950
6934 "Before any events are generated, you have to add some watches to the "
6935 "internal watch list. See: C<guestfs_inotify_add_watch>, "
6936 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
6940 #: ../src/guestfs-actions.pod:1956
6942 "Queued up events should be read periodically by calling "
6943 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
6944 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
6945 "often enough then you risk the internal queue overflowing."
6949 #: ../src/guestfs-actions.pod:1963
6951 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
6952 "This also removes any watches automatically."
6956 #: ../src/guestfs-actions.pod:1967 ../fish/guestfish-actions.pod:1555
6958 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
6959 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
6960 "that there is one global inotify handle per libguestfs instance."
6964 #: ../src/guestfs-actions.pod:1974
6965 msgid "guestfs_inotify_read"
6969 #: ../src/guestfs-actions.pod:1976
6972 " struct guestfs_inotify_event_list *guestfs_inotify_read (guestfs_h *g);\n"
6977 #: ../src/guestfs-actions.pod:1978 ../fish/guestfish-actions.pod:1564
6979 "Return the complete queue of events that have happened since the previous "
6984 #: ../src/guestfs-actions.pod:1981 ../fish/guestfish-actions.pod:1567
6985 msgid "If no events have happened, this returns an empty list."
6989 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1569
6991 "I<Note>: In order to make sure that all events have been read, you must call "
6992 "this function repeatedly until it returns an empty list. The reason is that "
6993 "the call will read events up to the maximum appliance-to-host message size "
6994 "and leave remaining events in the queue."
6998 #: ../src/guestfs-actions.pod:1989
7000 "This function returns a C<struct guestfs_inotify_event_list *> (see "
7001 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
7002 "must call C<guestfs_free_inotify_event_list> after use>."
7006 #: ../src/guestfs-actions.pod:1994
7007 msgid "guestfs_inotify_rm_watch"
7011 #: ../src/guestfs-actions.pod:1996
7014 " int guestfs_inotify_rm_watch (guestfs_h *g,\n"
7020 #: ../src/guestfs-actions.pod:1999
7022 "Remove a previously defined inotify watch. See "
7023 "C<guestfs_inotify_add_watch>."
7027 #: ../src/guestfs-actions.pod:2004
7028 msgid "guestfs_inspect_get_arch"
7032 #: ../src/guestfs-actions.pod:2006
7035 " char *guestfs_inspect_get_arch (guestfs_h *g,\n"
7036 "\t\tconst char *root);\n"
7041 #: ../src/guestfs-actions.pod:2009 ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2102 ../src/guestfs-actions.pod:2126 ../src/guestfs-actions.pod:2144 ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:2195
7043 "This function should only be called with a root device string as returned by "
7044 "C<guestfs_inspect_os>."
7048 #: ../src/guestfs-actions.pod:2012
7050 "This returns the architecture of the inspected operating system. The "
7051 "possible return values are listed under C<guestfs_file_architecture>."
7055 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1593
7057 "If the architecture could not be determined, then the string C<unknown> is "
7062 #: ../src/guestfs-actions.pod:2019 ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2257 ../fish/guestfish-actions.pod:1596 ../fish/guestfish-actions.pod:1642 ../fish/guestfish-actions.pod:1681 ../fish/guestfish-actions.pod:1736 ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1801
7063 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
7067 #: ../src/guestfs-actions.pod:2024
7068 msgid "guestfs_inspect_get_distro"
7072 #: ../src/guestfs-actions.pod:2026
7075 " char *guestfs_inspect_get_distro (guestfs_h *g,\n"
7076 "\t\tconst char *root);\n"
7081 #: ../src/guestfs-actions.pod:2032 ../fish/guestfish-actions.pod:1605
7082 msgid "This returns the distro (distribution) of the inspected operating system."
7086 #: ../src/guestfs-actions.pod:2035 ../fish/guestfish-actions.pod:1608
7087 msgid "Currently defined distros are:"
7091 #: ../src/guestfs-actions.pod:2039 ../fish/guestfish-actions.pod:1612
7096 #: ../src/guestfs-actions.pod:2041 ../fish/guestfish-actions.pod:1614
7097 msgid "Debian or a Debian-derived distro such as Ubuntu."
7101 #: ../src/guestfs-actions.pod:2043 ../fish/guestfish-actions.pod:1616
7106 #: ../src/guestfs-actions.pod:2045 ../fish/guestfish-actions.pod:1618
7111 #: ../src/guestfs-actions.pod:2047 ../fish/guestfish-actions.pod:1620
7112 msgid "\"redhat-based\""
7116 #: ../src/guestfs-actions.pod:2049 ../fish/guestfish-actions.pod:1622
7117 msgid "Some Red Hat-derived distro."
7121 #: ../src/guestfs-actions.pod:2051 ../fish/guestfish-actions.pod:1624
7126 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1626
7127 msgid "Red Hat Enterprise Linux and some derivatives."
7131 #: ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2207 ../fish/guestfish-actions.pod:1628 ../fish/guestfish-actions.pod:1754
7136 #: ../src/guestfs-actions.pod:2057 ../fish/guestfish-actions.pod:1630
7138 "Windows does not have distributions. This string is returned if the OS type "
7143 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1633 ../fish/guestfish-actions.pod:1758
7148 #: ../src/guestfs-actions.pod:2062 ../fish/guestfish-actions.pod:1635
7149 msgid "The distro could not be determined."
7153 #: ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2217 ../fish/guestfish-actions.pod:1639 ../fish/guestfish-actions.pod:1764
7155 "Future versions of libguestfs may return other strings here. The caller "
7156 "should be prepared to handle any string."
7160 #: ../src/guestfs-actions.pod:2074
7161 msgid "guestfs_inspect_get_filesystems"
7165 #: ../src/guestfs-actions.pod:2076
7168 " char **guestfs_inspect_get_filesystems (guestfs_h *g,\n"
7169 "\t\tconst char *root);\n"
7174 #: ../src/guestfs-actions.pod:2082 ../fish/guestfish-actions.pod:1651
7176 "This returns a list of all the filesystems that we think are associated with "
7177 "this operating system. This includes the root filesystem, other ordinary "
7178 "filesystems, and non-mounted devices like swap partitions."
7182 #: ../src/guestfs-actions.pod:2087 ../fish/guestfish-actions.pod:1656
7184 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
7185 "to be shared between operating systems."
7189 #: ../src/guestfs-actions.pod:2090
7191 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7192 "C<guestfs_inspect_get_mountpoints>."
7196 #: ../src/guestfs-actions.pod:2097
7197 msgid "guestfs_inspect_get_major_version"
7201 #: ../src/guestfs-actions.pod:2099
7204 " int guestfs_inspect_get_major_version (guestfs_h *g,\n"
7205 "\t\tconst char *root);\n"
7210 #: ../src/guestfs-actions.pod:2105 ../fish/guestfish-actions.pod:1669
7211 msgid "This returns the major version number of the inspected operating system."
7215 #: ../src/guestfs-actions.pod:2108 ../fish/guestfish-actions.pod:1672
7217 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
7218 "popular public names used by the operating system. Notably the operating "
7219 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
7220 "1). You can find out the real versions corresponding to releases of Windows "
7221 "by consulting Wikipedia or MSDN."
7225 #: ../src/guestfs-actions.pod:2115 ../src/guestfs-actions.pod:2132 ../fish/guestfish-actions.pod:1679 ../fish/guestfish-actions.pod:1693
7226 msgid "If the version could not be determined, then C<0> is returned."
7230 #: ../src/guestfs-actions.pod:2121
7231 msgid "guestfs_inspect_get_minor_version"
7235 #: ../src/guestfs-actions.pod:2123
7238 " int guestfs_inspect_get_minor_version (guestfs_h *g,\n"
7239 "\t\tconst char *root);\n"
7244 #: ../src/guestfs-actions.pod:2129 ../fish/guestfish-actions.pod:1690
7245 msgid "This returns the minor version number of the inspected operating system."
7249 #: ../src/guestfs-actions.pod:2134
7251 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7252 "C<guestfs_inspect_get_major_version>."
7256 #: ../src/guestfs-actions.pod:2139
7257 msgid "guestfs_inspect_get_mountpoints"
7261 #: ../src/guestfs-actions.pod:2141
7264 " char **guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
7265 "\t\tconst char *root);\n"
7270 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1705
7272 "This returns a hash of where we think the filesystems associated with this "
7273 "operating system should be mounted. Callers should note that this is at "
7274 "best an educated guess made by reading configuration files such as "
7279 #: ../src/guestfs-actions.pod:2152 ../fish/guestfish-actions.pod:1710
7281 "Each element in the returned hashtable has a key which is the path of the "
7282 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
7283 "mounted there (eg. C</dev/sda1>)."
7287 #: ../src/guestfs-actions.pod:2157 ../fish/guestfish-actions.pod:1715
7288 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
7292 #: ../src/guestfs-actions.pod:2160
7294 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
7295 "C<guestfs_inspect_get_filesystems>."
7299 #: ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:3425 ../src/guestfs-actions.pod:4962
7301 "This function returns a NULL-terminated array of strings, or NULL if there "
7302 "was an error. The array of strings will always have length C<2n+1>, where "
7303 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
7304 "caller must free the strings and the array after use>."
7308 #: ../src/guestfs-actions.pod:2169
7309 msgid "guestfs_inspect_get_product_name"
7313 #: ../src/guestfs-actions.pod:2171
7316 " char *guestfs_inspect_get_product_name (guestfs_h *g,\n"
7317 "\t\tconst char *root);\n"
7322 #: ../src/guestfs-actions.pod:2177 ../fish/guestfish-actions.pod:1728
7324 "This returns the product name of the inspected operating system. The "
7325 "product name is generally some freeform string which can be displayed to the "
7326 "user, but should not be parsed by programs."
7330 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1733
7332 "If the product name could not be determined, then the string C<unknown> is "
7337 #: ../src/guestfs-actions.pod:2190
7338 msgid "guestfs_inspect_get_type"
7342 #: ../src/guestfs-actions.pod:2192
7345 " char *guestfs_inspect_get_type (guestfs_h *g,\n"
7346 "\t\tconst char *root);\n"
7351 #: ../src/guestfs-actions.pod:2198 ../fish/guestfish-actions.pod:1745
7353 "This returns the type of the inspected operating system. Currently defined "
7358 #: ../src/guestfs-actions.pod:2203 ../fish/guestfish-actions.pod:1750
7363 #: ../src/guestfs-actions.pod:2205 ../fish/guestfish-actions.pod:1752
7364 msgid "Any Linux-based operating system."
7368 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1756
7369 msgid "Any Microsoft Windows operating system."
7373 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1760
7374 msgid "The operating system type could not be determined."
7378 #: ../src/guestfs-actions.pod:2225
7379 msgid "guestfs_inspect_os"
7383 #: ../src/guestfs-actions.pod:2227
7386 " char **guestfs_inspect_os (guestfs_h *g);\n"
7391 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1773
7393 "This function uses other libguestfs functions and certain heuristics to "
7394 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
7395 "for operating systems."
7399 #: ../src/guestfs-actions.pod:2233 ../fish/guestfish-actions.pod:1777
7400 msgid "The list returned is empty if no operating systems were found."
7404 #: ../src/guestfs-actions.pod:2235 ../fish/guestfish-actions.pod:1779
7406 "If one operating system was found, then this returns a list with a single "
7407 "element, which is the name of the root filesystem of this operating system. "
7408 "It is also possible for this function to return a list containing more than "
7409 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
7410 "element being the root filesystem of one of the operating systems."
7414 #: ../src/guestfs-actions.pod:2242
7416 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
7417 "functions in order to query further information about each operating system, "
7418 "such as the name and version."
7422 #: ../src/guestfs-actions.pod:2247
7424 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
7425 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
7426 "the contents. This should be called with no disks currently mounted. The "
7427 "function may also use Augeas, so any existing Augeas handle will be closed."
7431 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1797
7433 "This function cannot decrypt encrypted disks. The caller must do that first "
7434 "(supplying the necessary keys) if the disk is encrypted."
7438 #: ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2464 ../src/guestfs-actions.pod:2520
7439 msgid "See also C<guestfs_list_filesystems>."
7443 #: ../src/guestfs-actions.pod:2265
7444 msgid "guestfs_is_blockdev"
7448 #: ../src/guestfs-actions.pod:2267
7451 " int guestfs_is_blockdev (guestfs_h *g,\n"
7452 "\t\tconst char *path);\n"
7457 #: ../src/guestfs-actions.pod:2270 ../fish/guestfish-actions.pod:1809
7459 "This returns C<true> if and only if there is a block device with the given "
7464 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:2320 ../src/guestfs-actions.pod:2332 ../src/guestfs-actions.pod:2345 ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2401
7465 msgid "See also C<guestfs_stat>."
7469 #: ../src/guestfs-actions.pod:2277
7470 msgid "guestfs_is_busy"
7474 #: ../src/guestfs-actions.pod:2279
7477 " int guestfs_is_busy (guestfs_h *g);\n"
7482 #: ../src/guestfs-actions.pod:2281 ../fish/guestfish-actions.pod:1818
7484 "This returns true iff this handle is busy processing a command (in the "
7489 #: ../src/guestfs-actions.pod:2288
7490 msgid "guestfs_is_chardev"
7494 #: ../src/guestfs-actions.pod:2290
7497 " int guestfs_is_chardev (guestfs_h *g,\n"
7498 "\t\tconst char *path);\n"
7503 #: ../src/guestfs-actions.pod:2293 ../fish/guestfish-actions.pod:1827
7505 "This returns C<true> if and only if there is a character device with the "
7506 "given C<path> name."
7510 #: ../src/guestfs-actions.pod:2300
7511 msgid "guestfs_is_config"
7515 #: ../src/guestfs-actions.pod:2302
7518 " int guestfs_is_config (guestfs_h *g);\n"
7523 #: ../src/guestfs-actions.pod:2304 ../fish/guestfish-actions.pod:1836
7525 "This returns true iff this handle is being configured (in the C<CONFIG> "
7530 #: ../src/guestfs-actions.pod:2311
7531 msgid "guestfs_is_dir"
7535 #: ../src/guestfs-actions.pod:2313
7538 " int guestfs_is_dir (guestfs_h *g,\n"
7539 "\t\tconst char *path);\n"
7544 #: ../src/guestfs-actions.pod:2316 ../fish/guestfish-actions.pod:1845
7546 "This returns C<true> if and only if there is a directory with the given "
7547 "C<path> name. Note that it returns false for other objects like files."
7551 #: ../src/guestfs-actions.pod:2324
7552 msgid "guestfs_is_fifo"
7556 #: ../src/guestfs-actions.pod:2326
7559 " int guestfs_is_fifo (guestfs_h *g,\n"
7560 "\t\tconst char *path);\n"
7565 #: ../src/guestfs-actions.pod:2329 ../fish/guestfish-actions.pod:1855
7567 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
7568 "given C<path> name."
7572 #: ../src/guestfs-actions.pod:2336
7573 msgid "guestfs_is_file"
7577 #: ../src/guestfs-actions.pod:2338
7580 " int guestfs_is_file (guestfs_h *g,\n"
7581 "\t\tconst char *path);\n"
7586 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1864
7588 "This returns C<true> if and only if there is a regular file with the given "
7589 "C<path> name. Note that it returns false for other objects like "
7594 #: ../src/guestfs-actions.pod:2349
7595 msgid "guestfs_is_launching"
7599 #: ../src/guestfs-actions.pod:2351
7602 " int guestfs_is_launching (guestfs_h *g);\n"
7607 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1874
7609 "This returns true iff this handle is launching the subprocess (in the "
7610 "C<LAUNCHING> state)."
7614 #: ../src/guestfs-actions.pod:2360
7615 msgid "guestfs_is_lv"
7619 #: ../src/guestfs-actions.pod:2362
7622 " int guestfs_is_lv (guestfs_h *g,\n"
7623 "\t\tconst char *device);\n"
7628 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1883
7630 "This command tests whether C<device> is a logical volume, and returns true "
7631 "iff this is the case."
7635 #: ../src/guestfs-actions.pod:2370
7636 msgid "guestfs_is_ready"
7640 #: ../src/guestfs-actions.pod:2372
7643 " int guestfs_is_ready (guestfs_h *g);\n"
7648 #: ../src/guestfs-actions.pod:2374 ../fish/guestfish-actions.pod:1890
7650 "This returns true iff this handle is ready to accept commands (in the "
7655 #: ../src/guestfs-actions.pod:2381
7656 msgid "guestfs_is_socket"
7660 #: ../src/guestfs-actions.pod:2383
7663 " int guestfs_is_socket (guestfs_h *g,\n"
7664 "\t\tconst char *path);\n"
7669 #: ../src/guestfs-actions.pod:2386 ../fish/guestfish-actions.pod:1899
7671 "This returns C<true> if and only if there is a Unix domain socket with the "
7672 "given C<path> name."
7676 #: ../src/guestfs-actions.pod:2393
7677 msgid "guestfs_is_symlink"
7681 #: ../src/guestfs-actions.pod:2395
7684 " int guestfs_is_symlink (guestfs_h *g,\n"
7685 "\t\tconst char *path);\n"
7690 #: ../src/guestfs-actions.pod:2398 ../fish/guestfish-actions.pod:1908
7692 "This returns C<true> if and only if there is a symbolic link with the given "
7697 #: ../src/guestfs-actions.pod:2405
7698 msgid "guestfs_kill_subprocess"
7702 #: ../src/guestfs-actions.pod:2407
7705 " int guestfs_kill_subprocess (guestfs_h *g);\n"
7710 #: ../src/guestfs-actions.pod:2409 ../fish/guestfish-actions.pod:1917
7711 msgid "This kills the qemu subprocess. You should never need to call this."
7715 #: ../src/guestfs-actions.pod:2413
7716 msgid "guestfs_launch"
7720 #: ../src/guestfs-actions.pod:2415
7723 " int guestfs_launch (guestfs_h *g);\n"
7728 #: ../src/guestfs-actions.pod:2417 ../fish/guestfish-actions.pod:1923
7730 "Internally libguestfs is implemented by running a virtual machine using "
7735 #: ../src/guestfs-actions.pod:2420 ../fish/guestfish-actions.pod:1926
7737 "You should call this after configuring the handle (eg. adding drives) but "
7738 "before performing any actions."
7742 #: ../src/guestfs-actions.pod:2425
7743 msgid "guestfs_lchown"
7747 #: ../src/guestfs-actions.pod:2427
7750 " int guestfs_lchown (guestfs_h *g,\n"
7753 "\t\tconst char *path);\n"
7758 #: ../src/guestfs-actions.pod:2432
7760 "Change the file owner to C<owner> and group to C<group>. This is like "
7761 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
7762 "changed, not the target."
7766 #: ../src/guestfs-actions.pod:2442
7767 msgid "guestfs_lgetxattrs"
7771 #: ../src/guestfs-actions.pod:2444
7774 " struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,\n"
7775 "\t\tconst char *path);\n"
7780 #: ../src/guestfs-actions.pod:2447
7782 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
7783 "then it returns the extended attributes of the link itself."
7787 #: ../src/guestfs-actions.pod:2456
7788 msgid "guestfs_list_devices"
7792 #: ../src/guestfs-actions.pod:2458
7795 " char **guestfs_list_devices (guestfs_h *g);\n"
7800 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1953
7801 msgid "List all the block devices."
7805 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1955
7806 msgid "The full block device names are returned, eg. C</dev/sda>."
7810 #: ../src/guestfs-actions.pod:2470
7811 msgid "guestfs_list_filesystems"
7815 #: ../src/guestfs-actions.pod:2472
7818 " char **guestfs_list_filesystems (guestfs_h *g);\n"
7823 #: ../src/guestfs-actions.pod:2474 ../fish/guestfish-actions.pod:1963
7825 "This inspection command looks for filesystems on partitions, block devices "
7826 "and logical volumes, returning a list of devices containing filesystems and "
7831 #: ../src/guestfs-actions.pod:2478 ../fish/guestfish-actions.pod:1967
7833 "The return value is a hash, where the keys are the devices containing "
7834 "filesystems, and the values are the filesystem types. For example:"
7838 #: ../src/guestfs-actions.pod:2482 ../fish/guestfish-actions.pod:1971
7841 " \"/dev/sda1\" => \"ntfs\"\n"
7842 " \"/dev/sda2\" => \"ext2\"\n"
7843 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
7844 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
7849 #: ../src/guestfs-actions.pod:2487 ../fish/guestfish-actions.pod:1976
7851 "The value can have the special value \"unknown\", meaning the content of the "
7852 "device is undetermined or empty. \"swap\" means a Linux swap partition."
7856 #: ../src/guestfs-actions.pod:2491
7858 "This command runs other libguestfs commands, which might include "
7859 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
7860 "soon after launch and only when nothing is mounted."
7864 #: ../src/guestfs-actions.pod:2495
7866 "Not all of the filesystems returned will be mountable. In particular, swap "
7867 "partitions are returned in the list. Also this command does not check that "
7868 "each filesystem found is valid and mountable, and some filesystems might be "
7869 "mountable but require special options. Filesystems may not all belong to a "
7870 "single logical operating system (use C<guestfs_inspect_os> to look for "
7875 #: ../src/guestfs-actions.pod:2509
7876 msgid "guestfs_list_partitions"
7880 #: ../src/guestfs-actions.pod:2511
7883 " char **guestfs_list_partitions (guestfs_h *g);\n"
7888 #: ../src/guestfs-actions.pod:2513 ../fish/guestfish-actions.pod:1996
7889 msgid "List all the partitions detected on all block devices."
7893 #: ../src/guestfs-actions.pod:2515 ../fish/guestfish-actions.pod:1998
7894 msgid "The full partition device names are returned, eg. C</dev/sda1>"
7898 #: ../src/guestfs-actions.pod:2517
7900 "This does not return logical volumes. For that you will need to call "
7905 #: ../src/guestfs-actions.pod:2526
7910 #: ../src/guestfs-actions.pod:2528
7913 " char *guestfs_ll (guestfs_h *g,\n"
7914 "\t\tconst char *directory);\n"
7919 #: ../src/guestfs-actions.pod:2531 ../fish/guestfish-actions.pod:2009
7921 "List the files in C<directory> (relative to the root directory, there is no "
7922 "cwd) in the format of 'ls -la'."
7926 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:2012
7928 "This command is mostly useful for interactive sessions. It is I<not> "
7929 "intended that you try to parse the output string."
7933 #: ../src/guestfs-actions.pod:2540
7938 #: ../src/guestfs-actions.pod:2542
7941 " int guestfs_ln (guestfs_h *g,\n"
7942 "\t\tconst char *target,\n"
7943 "\t\tconst char *linkname);\n"
7948 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:2019
7949 msgid "This command creates a hard link using the C<ln> command."
7953 #: ../src/guestfs-actions.pod:2550
7954 msgid "guestfs_ln_f"
7958 #: ../src/guestfs-actions.pod:2552
7961 " int guestfs_ln_f (guestfs_h *g,\n"
7962 "\t\tconst char *target,\n"
7963 "\t\tconst char *linkname);\n"
7968 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:2025
7970 "This command creates a hard link using the C<ln -f> command. The C<-f> "
7971 "option removes the link (C<linkname>) if it exists already."
7975 #: ../src/guestfs-actions.pod:2561
7976 msgid "guestfs_ln_s"
7980 #: ../src/guestfs-actions.pod:2563
7983 " int guestfs_ln_s (guestfs_h *g,\n"
7984 "\t\tconst char *target,\n"
7985 "\t\tconst char *linkname);\n"
7990 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:2032
7991 msgid "This command creates a symbolic link using the C<ln -s> command."
7995 #: ../src/guestfs-actions.pod:2571
7996 msgid "guestfs_ln_sf"
8000 #: ../src/guestfs-actions.pod:2573
8003 " int guestfs_ln_sf (guestfs_h *g,\n"
8004 "\t\tconst char *target,\n"
8005 "\t\tconst char *linkname);\n"
8010 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:2038
8012 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
8013 "option removes the link (C<linkname>) if it exists already."
8017 #: ../src/guestfs-actions.pod:2582
8018 msgid "guestfs_lremovexattr"
8022 #: ../src/guestfs-actions.pod:2584
8025 " int guestfs_lremovexattr (guestfs_h *g,\n"
8026 "\t\tconst char *xattr,\n"
8027 "\t\tconst char *path);\n"
8032 #: ../src/guestfs-actions.pod:2588
8034 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
8035 "link, then it removes an extended attribute of the link itself."
8039 #: ../src/guestfs-actions.pod:2594
8044 #: ../src/guestfs-actions.pod:2596
8047 " char **guestfs_ls (guestfs_h *g,\n"
8048 "\t\tconst char *directory);\n"
8053 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:2053
8055 "List the files in C<directory> (relative to the root directory, there is no "
8056 "cwd). The '.' and '..' entries are not returned, but hidden files are "
8061 #: ../src/guestfs-actions.pod:2603
8063 "This command is mostly useful for interactive sessions. Programs should "
8064 "probably use C<guestfs_readdir> instead."
8068 #: ../src/guestfs-actions.pod:2610
8069 msgid "guestfs_lsetxattr"
8073 #: ../src/guestfs-actions.pod:2612
8076 " int guestfs_lsetxattr (guestfs_h *g,\n"
8077 "\t\tconst char *xattr,\n"
8078 "\t\tconst char *val,\n"
8080 "\t\tconst char *path);\n"
8085 #: ../src/guestfs-actions.pod:2618
8087 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
8088 "then it sets an extended attribute of the link itself."
8092 #: ../src/guestfs-actions.pod:2624
8093 msgid "guestfs_lstat"
8097 #: ../src/guestfs-actions.pod:2626
8100 " struct guestfs_stat *guestfs_lstat (guestfs_h *g,\n"
8101 "\t\tconst char *path);\n"
8106 #: ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:4627 ../fish/guestfish-actions.pod:2072 ../fish/guestfish-actions.pod:3572
8107 msgid "Returns file information for the given C<path>."
8111 #: ../src/guestfs-actions.pod:2631
8113 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
8114 "link, then the link is stat-ed, not the file it refers to."
8118 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:2078
8119 msgid "This is the same as the C<lstat(2)> system call."
8123 #: ../src/guestfs-actions.pod:2637 ../src/guestfs-actions.pod:4631
8125 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
8126 "error. I<The caller must call C<guestfs_free_stat> after use>."
8130 #: ../src/guestfs-actions.pod:2641
8131 msgid "guestfs_lstatlist"
8135 #: ../src/guestfs-actions.pod:2643
8138 " struct guestfs_stat_list *guestfs_lstatlist (guestfs_h *g,\n"
8139 "\t\tconst char *path,\n"
8140 "\t\tchar *const *names);\n"
8145 #: ../src/guestfs-actions.pod:2647
8147 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
8148 "files, where all files are in the directory C<path>. C<names> is the list "
8149 "of files from this directory."
8153 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:2088
8155 "On return you get a list of stat structs, with a one-to-one correspondence "
8156 "to the C<names> list. If any name did not exist or could not be lstat'd, "
8157 "then the C<ino> field of that structure is set to C<-1>."
8161 #: ../src/guestfs-actions.pod:2656
8163 "This call is intended for programs that want to efficiently list a directory "
8164 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
8165 "for a similarly efficient call for getting extended attributes. Very long "
8166 "directory listings might cause the protocol message size to be exceeded, "
8167 "causing this call to fail. The caller must split up such requests into "
8168 "smaller groups of names."
8172 #: ../src/guestfs-actions.pod:2664
8174 "This function returns a C<struct guestfs_stat_list *> (see "
8175 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8176 "must call C<guestfs_free_stat_list> after use>."
8180 #: ../src/guestfs-actions.pod:2669
8181 msgid "guestfs_luks_add_key"
8185 #: ../src/guestfs-actions.pod:2671
8188 " int guestfs_luks_add_key (guestfs_h *g,\n"
8189 "\t\tconst char *device,\n"
8190 "\t\tconst char *key,\n"
8191 "\t\tconst char *newkey,\n"
8192 "\t\tint keyslot);\n"
8197 #: ../src/guestfs-actions.pod:2677 ../fish/guestfish-actions.pod:2105
8199 "This command adds a new key on LUKS device C<device>. C<key> is any "
8200 "existing key, and is used to access the device. C<newkey> is the new key to "
8201 "add. C<keyslot> is the key slot that will be replaced."
8205 #: ../src/guestfs-actions.pod:2682
8207 "Note that if C<keyslot> already contains a key, then this command will "
8208 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
8212 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2722 ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2759 ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:2804
8214 "This function takes a key or passphrase parameter which could contain "
8215 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
8220 #: ../src/guestfs-actions.pod:2692
8221 msgid "guestfs_luks_close"
8225 #: ../src/guestfs-actions.pod:2694
8228 " int guestfs_luks_close (guestfs_h *g,\n"
8229 "\t\tconst char *device);\n"
8234 #: ../src/guestfs-actions.pod:2697
8236 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
8237 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
8238 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
8239 "underlying block device."
8243 #: ../src/guestfs-actions.pod:2705
8244 msgid "guestfs_luks_format"
8248 #: ../src/guestfs-actions.pod:2707
8251 " int guestfs_luks_format (guestfs_h *g,\n"
8252 "\t\tconst char *device,\n"
8253 "\t\tconst char *key,\n"
8254 "\t\tint keyslot);\n"
8259 #: ../src/guestfs-actions.pod:2712 ../fish/guestfish-actions.pod:2131
8261 "This command erases existing data on C<device> and formats the device as a "
8262 "LUKS encrypted device. C<key> is the initial key, which is added to key "
8263 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
8267 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2739 ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:3553 ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4489 ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4532 ../src/guestfs-actions.pod:5471 ../fish/guestfish-actions.pod:2139 ../fish/guestfish-actions.pod:2152 ../fish/guestfish-actions.pod:2223 ../fish/guestfish-actions.pod:2738 ../fish/guestfish-actions.pod:3213 ../fish/guestfish-actions.pod:3471 ../fish/guestfish-actions.pod:3487 ../fish/guestfish-actions.pod:3502 ../fish/guestfish-actions.pod:4190
8269 "B<This command is dangerous. Without careful use you can easily destroy all "
8274 #: ../src/guestfs-actions.pod:2726
8275 msgid "guestfs_luks_format_cipher"
8279 #: ../src/guestfs-actions.pod:2728
8282 " int guestfs_luks_format_cipher (guestfs_h *g,\n"
8283 "\t\tconst char *device,\n"
8284 "\t\tconst char *key,\n"
8285 "\t\tint keyslot,\n"
8286 "\t\tconst char *cipher);\n"
8291 #: ../src/guestfs-actions.pod:2734
8293 "This command is the same as C<guestfs_luks_format> but it also allows you to "
8294 "set the C<cipher> used."
8298 #: ../src/guestfs-actions.pod:2746
8299 msgid "guestfs_luks_kill_slot"
8303 #: ../src/guestfs-actions.pod:2748
8306 " int guestfs_luks_kill_slot (guestfs_h *g,\n"
8307 "\t\tconst char *device,\n"
8308 "\t\tconst char *key,\n"
8309 "\t\tint keyslot);\n"
8314 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:2159
8316 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
8317 "device C<device>. C<key> must be one of the I<other> keys."
8321 #: ../src/guestfs-actions.pod:2763
8322 msgid "guestfs_luks_open"
8326 #: ../src/guestfs-actions.pod:2765
8329 " int guestfs_luks_open (guestfs_h *g,\n"
8330 "\t\tconst char *device,\n"
8331 "\t\tconst char *key,\n"
8332 "\t\tconst char *mapname);\n"
8337 #: ../src/guestfs-actions.pod:2770 ../fish/guestfish-actions.pod:2170
8339 "This command opens a block device which has been encrypted according to the "
8340 "Linux Unified Key Setup (LUKS) standard."
8344 #: ../src/guestfs-actions.pod:2773 ../fish/guestfish-actions.pod:2173
8345 msgid "C<device> is the encrypted block device or partition."
8349 #: ../src/guestfs-actions.pod:2775 ../fish/guestfish-actions.pod:2175
8351 "The caller must supply one of the keys associated with the LUKS block "
8352 "device, in the C<key> parameter."
8356 #: ../src/guestfs-actions.pod:2778 ../fish/guestfish-actions.pod:2178
8358 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
8359 "writes to this block device are decrypted from and encrypted to the "
8360 "underlying C<device> respectively."
8364 #: ../src/guestfs-actions.pod:2782
8366 "If this block device contains LVM volume groups, then calling "
8367 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
8372 #: ../src/guestfs-actions.pod:2792
8373 msgid "guestfs_luks_open_ro"
8377 #: ../src/guestfs-actions.pod:2794
8380 " int guestfs_luks_open_ro (guestfs_h *g,\n"
8381 "\t\tconst char *device,\n"
8382 "\t\tconst char *key,\n"
8383 "\t\tconst char *mapname);\n"
8388 #: ../src/guestfs-actions.pod:2799
8390 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
8395 #: ../src/guestfs-actions.pod:2808
8396 msgid "guestfs_lvcreate"
8400 #: ../src/guestfs-actions.pod:2810
8403 " int guestfs_lvcreate (guestfs_h *g,\n"
8404 "\t\tconst char *logvol,\n"
8405 "\t\tconst char *volgroup,\n"
8406 "\t\tint mbytes);\n"
8411 #: ../src/guestfs-actions.pod:2815 ../fish/guestfish-actions.pod:2203
8413 "This creates an LVM logical volume called C<logvol> on the volume group "
8414 "C<volgroup>, with C<size> megabytes."
8418 #: ../src/guestfs-actions.pod:2820
8419 msgid "guestfs_lvm_clear_filter"
8423 #: ../src/guestfs-actions.pod:2822
8426 " int guestfs_lvm_clear_filter (guestfs_h *g);\n"
8431 #: ../src/guestfs-actions.pod:2824
8433 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
8434 "see every block device."
8438 #: ../src/guestfs-actions.pod:2827 ../src/guestfs-actions.pod:2863 ../fish/guestfish-actions.pod:2213 ../fish/guestfish-actions.pod:2244
8439 msgid "This command also clears the LVM cache and performs a volume group scan."
8443 #: ../src/guestfs-actions.pod:2832
8444 msgid "guestfs_lvm_remove_all"
8448 #: ../src/guestfs-actions.pod:2834
8451 " int guestfs_lvm_remove_all (guestfs_h *g);\n"
8456 #: ../src/guestfs-actions.pod:2836 ../fish/guestfish-actions.pod:2220
8458 "This command removes all LVM logical volumes, volume groups and physical "
8463 #: ../src/guestfs-actions.pod:2844
8464 msgid "guestfs_lvm_set_filter"
8468 #: ../src/guestfs-actions.pod:2846
8471 " int guestfs_lvm_set_filter (guestfs_h *g,\n"
8472 "\t\tchar *const *devices);\n"
8477 #: ../src/guestfs-actions.pod:2849 ../fish/guestfish-actions.pod:2230
8479 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
8480 "block devices in the list C<devices>, and will ignore all other attached "
8485 #: ../src/guestfs-actions.pod:2853 ../fish/guestfish-actions.pod:2234
8487 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
8488 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
8489 "there are two types of duplication possible: either cloned PVs/VGs which "
8490 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
8491 "same name. In normal operation you cannot create this situation, but you "
8492 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
8493 "inside the LVM metadata."
8497 #: ../src/guestfs-actions.pod:2866 ../fish/guestfish-actions.pod:2247
8498 msgid "You can filter whole block devices or individual partitions."
8502 #: ../src/guestfs-actions.pod:2868 ../fish/guestfish-actions.pod:2249
8504 "You cannot use this if any VG is currently in use (eg. contains a mounted "
8505 "filesystem), even if you are not filtering out that VG."
8509 #: ../src/guestfs-actions.pod:2874
8510 msgid "guestfs_lvremove"
8514 #: ../src/guestfs-actions.pod:2876
8517 " int guestfs_lvremove (guestfs_h *g,\n"
8518 "\t\tconst char *device);\n"
8523 #: ../src/guestfs-actions.pod:2879 ../fish/guestfish-actions.pod:2257
8525 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
8526 "LV, such as C</dev/VG/LV>."
8530 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:2260
8532 "You can also remove all LVs in a volume group by specifying the VG name, "
8537 #: ../src/guestfs-actions.pod:2887
8538 msgid "guestfs_lvrename"
8542 #: ../src/guestfs-actions.pod:2889
8545 " int guestfs_lvrename (guestfs_h *g,\n"
8546 "\t\tconst char *logvol,\n"
8547 "\t\tconst char *newlogvol);\n"
8552 #: ../src/guestfs-actions.pod:2893 ../fish/guestfish-actions.pod:2267
8553 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
8557 #: ../src/guestfs-actions.pod:2897
8558 msgid "guestfs_lvresize"
8562 #: ../src/guestfs-actions.pod:2899
8565 " int guestfs_lvresize (guestfs_h *g,\n"
8566 "\t\tconst char *device,\n"
8567 "\t\tint mbytes);\n"
8572 #: ../src/guestfs-actions.pod:2903 ../fish/guestfish-actions.pod:2273
8574 "This resizes (expands or shrinks) an existing LVM logical volume to "
8575 "C<mbytes>. When reducing, data in the reduced part is lost."
8579 #: ../src/guestfs-actions.pod:2909
8580 msgid "guestfs_lvresize_free"
8584 #: ../src/guestfs-actions.pod:2911
8587 " int guestfs_lvresize_free (guestfs_h *g,\n"
8588 "\t\tconst char *lv,\n"
8589 "\t\tint percent);\n"
8594 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2281
8596 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
8597 "remaining free space in the volume group. Commonly you would call this with "
8598 "pc = 100 which expands the logical volume as much as possible, using all "
8599 "remaining free space in the volume group."
8603 #: ../src/guestfs-actions.pod:2923
8608 #: ../src/guestfs-actions.pod:2925
8611 " char **guestfs_lvs (guestfs_h *g);\n"
8616 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2291
8618 "List all the logical volumes detected. This is the equivalent of the "
8619 "L<lvs(8)> command."
8623 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2294
8625 "This returns a list of the logical volume device names "
8626 "(eg. C</dev/VolGroup00/LogVol00>)."
8630 #: ../src/guestfs-actions.pod:2933
8631 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
8635 #: ../src/guestfs-actions.pod:2939
8636 msgid "guestfs_lvs_full"
8640 #: ../src/guestfs-actions.pod:2941
8643 " struct guestfs_lvm_lv_list *guestfs_lvs_full (guestfs_h *g);\n"
8648 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2303
8650 "List all the logical volumes detected. This is the equivalent of the "
8651 "L<lvs(8)> command. The \"full\" version includes all fields."
8655 #: ../src/guestfs-actions.pod:2946
8657 "This function returns a C<struct guestfs_lvm_lv_list *> (see "
8658 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
8659 "must call C<guestfs_free_lvm_lv_list> after use>."
8663 #: ../src/guestfs-actions.pod:2951
8664 msgid "guestfs_lvuuid"
8668 #: ../src/guestfs-actions.pod:2953
8671 " char *guestfs_lvuuid (guestfs_h *g,\n"
8672 "\t\tconst char *device);\n"
8677 #: ../src/guestfs-actions.pod:2956 ../fish/guestfish-actions.pod:2310
8678 msgid "This command returns the UUID of the LVM LV C<device>."
8682 #: ../src/guestfs-actions.pod:2961
8683 msgid "guestfs_lxattrlist"
8687 #: ../src/guestfs-actions.pod:2963
8690 " struct guestfs_xattr_list *guestfs_lxattrlist (guestfs_h *g,\n"
8691 "\t\tconst char *path,\n"
8692 "\t\tchar *const *names);\n"
8697 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2316
8699 "This call allows you to get the extended attributes of multiple files, where "
8700 "all files are in the directory C<path>. C<names> is the list of files from "
8705 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2320
8707 "On return you get a flat list of xattr structs which must be interpreted "
8708 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
8709 "C<attrval> in this struct is zero-length to indicate there was an error "
8710 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
8711 "number (the number of following attributes for this file, which could be "
8712 "C<\"0\">). Then after the first xattr struct are the zero or more "
8713 "attributes for the first named file. This repeats for the second and "
8718 #: ../src/guestfs-actions.pod:2981
8720 "This call is intended for programs that want to efficiently list a directory "
8721 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
8722 "a similarly efficient call for getting standard stats. Very long directory "
8723 "listings might cause the protocol message size to be exceeded, causing this "
8724 "call to fail. The caller must split up such requests into smaller groups of "
8729 #: ../src/guestfs-actions.pod:2994
8730 msgid "guestfs_mkdir"
8734 #: ../src/guestfs-actions.pod:2996
8737 " int guestfs_mkdir (guestfs_h *g,\n"
8738 "\t\tconst char *path);\n"
8743 #: ../src/guestfs-actions.pod:2999 ../fish/guestfish-actions.pod:2342
8744 msgid "Create a directory named C<path>."
8748 #: ../src/guestfs-actions.pod:3003
8749 msgid "guestfs_mkdir_mode"
8753 #: ../src/guestfs-actions.pod:3005
8756 " int guestfs_mkdir_mode (guestfs_h *g,\n"
8757 "\t\tconst char *path,\n"
8763 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2348
8765 "This command creates a directory, setting the initial permissions of the "
8766 "directory to C<mode>."
8770 #: ../src/guestfs-actions.pod:3012 ../fish/guestfish-actions.pod:2351
8772 "For common Linux filesystems, the actual mode which is set will be C<mode & "
8773 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
8778 #: ../src/guestfs-actions.pod:3016
8779 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
8783 #: ../src/guestfs-actions.pod:3020
8784 msgid "guestfs_mkdir_p"
8788 #: ../src/guestfs-actions.pod:3022
8791 " int guestfs_mkdir_p (guestfs_h *g,\n"
8792 "\t\tconst char *path);\n"
8797 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2361
8799 "Create a directory named C<path>, creating any parent directories as "
8800 "necessary. This is like the C<mkdir -p> shell command."
8804 #: ../src/guestfs-actions.pod:3030
8805 msgid "guestfs_mkdtemp"
8809 #: ../src/guestfs-actions.pod:3032
8812 " char *guestfs_mkdtemp (guestfs_h *g,\n"
8813 "\t\tconst char *template);\n"
8818 #: ../src/guestfs-actions.pod:3035 ../fish/guestfish-actions.pod:2368
8820 "This command creates a temporary directory. The C<template> parameter "
8821 "should be a full pathname for the temporary directory name with the final "
8822 "six characters being \"XXXXXX\"."
8826 #: ../src/guestfs-actions.pod:3040 ../fish/guestfish-actions.pod:2373
8828 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
8829 "being suitable for Windows filesystems."
8833 #: ../src/guestfs-actions.pod:3043 ../fish/guestfish-actions.pod:2376
8834 msgid "The name of the temporary directory that was created is returned."
8838 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2379
8839 msgid "The temporary directory is created with mode 0700 and is owned by root."
8843 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2382
8845 "The caller is responsible for deleting the temporary directory and its "
8846 "contents after use."
8850 #: ../src/guestfs-actions.pod:3052 ../fish/guestfish-actions.pod:2385
8851 msgid "See also: L<mkdtemp(3)>"
8855 #: ../src/guestfs-actions.pod:3057
8856 msgid "guestfs_mke2fs_J"
8860 #: ../src/guestfs-actions.pod:3059
8863 " int guestfs_mke2fs_J (guestfs_h *g,\n"
8864 "\t\tconst char *fstype,\n"
8865 "\t\tint blocksize,\n"
8866 "\t\tconst char *device,\n"
8867 "\t\tconst char *journal);\n"
8872 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2391
8874 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8875 "C<journal>. It is equivalent to the command:"
8879 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2395
8882 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
8887 #: ../src/guestfs-actions.pod:3071
8888 msgid "See also C<guestfs_mke2journal>."
8892 #: ../src/guestfs-actions.pod:3075
8893 msgid "guestfs_mke2fs_JL"
8897 #: ../src/guestfs-actions.pod:3077
8900 " int guestfs_mke2fs_JL (guestfs_h *g,\n"
8901 "\t\tconst char *fstype,\n"
8902 "\t\tint blocksize,\n"
8903 "\t\tconst char *device,\n"
8904 "\t\tconst char *label);\n"
8909 #: ../src/guestfs-actions.pod:3083 ../fish/guestfish-actions.pod:2403
8911 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8912 "the journal labeled C<label>."
8916 #: ../src/guestfs-actions.pod:3086
8917 msgid "See also C<guestfs_mke2journal_L>."
8921 #: ../src/guestfs-actions.pod:3090
8922 msgid "guestfs_mke2fs_JU"
8926 #: ../src/guestfs-actions.pod:3092
8929 " int guestfs_mke2fs_JU (guestfs_h *g,\n"
8930 "\t\tconst char *fstype,\n"
8931 "\t\tint blocksize,\n"
8932 "\t\tconst char *device,\n"
8933 "\t\tconst char *uuid);\n"
8938 #: ../src/guestfs-actions.pod:3098 ../fish/guestfish-actions.pod:2412
8940 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
8941 "the journal with UUID C<uuid>."
8945 #: ../src/guestfs-actions.pod:3101
8946 msgid "See also C<guestfs_mke2journal_U>."
8950 #: ../src/guestfs-actions.pod:3105
8951 msgid "guestfs_mke2journal"
8955 #: ../src/guestfs-actions.pod:3107
8958 " int guestfs_mke2journal (guestfs_h *g,\n"
8959 "\t\tint blocksize,\n"
8960 "\t\tconst char *device);\n"
8965 #: ../src/guestfs-actions.pod:3111 ../fish/guestfish-actions.pod:2421
8967 "This creates an ext2 external journal on C<device>. It is equivalent to the "
8972 #: ../src/guestfs-actions.pod:3114 ../fish/guestfish-actions.pod:2424
8975 " mke2fs -O journal_dev -b blocksize device\n"
8980 #: ../src/guestfs-actions.pod:3118
8981 msgid "guestfs_mke2journal_L"
8985 #: ../src/guestfs-actions.pod:3120
8988 " int guestfs_mke2journal_L (guestfs_h *g,\n"
8989 "\t\tint blocksize,\n"
8990 "\t\tconst char *label,\n"
8991 "\t\tconst char *device);\n"
8996 #: ../src/guestfs-actions.pod:3125 ../fish/guestfish-actions.pod:2430
8997 msgid "This creates an ext2 external journal on C<device> with label C<label>."
9001 #: ../src/guestfs-actions.pod:3129
9002 msgid "guestfs_mke2journal_U"
9006 #: ../src/guestfs-actions.pod:3131
9009 " int guestfs_mke2journal_U (guestfs_h *g,\n"
9010 "\t\tint blocksize,\n"
9011 "\t\tconst char *uuid,\n"
9012 "\t\tconst char *device);\n"
9017 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2436
9018 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
9022 #: ../src/guestfs-actions.pod:3140
9023 msgid "guestfs_mkfifo"
9027 #: ../src/guestfs-actions.pod:3142
9030 " int guestfs_mkfifo (guestfs_h *g,\n"
9032 "\t\tconst char *path);\n"
9037 #: ../src/guestfs-actions.pod:3146
9039 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
9040 "is just a convenient wrapper around C<guestfs_mknod>."
9044 #: ../src/guestfs-actions.pod:3154
9045 msgid "guestfs_mkfs"
9049 #: ../src/guestfs-actions.pod:3156
9052 " int guestfs_mkfs (guestfs_h *g,\n"
9053 "\t\tconst char *fstype,\n"
9054 "\t\tconst char *device);\n"
9059 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2452
9061 "This creates a filesystem on C<device> (usually a partition or LVM logical "
9062 "volume). The filesystem type is C<fstype>, for example C<ext3>."
9066 #: ../src/guestfs-actions.pod:3166
9067 msgid "guestfs_mkfs_b"
9071 #: ../src/guestfs-actions.pod:3168
9074 " int guestfs_mkfs_b (guestfs_h *g,\n"
9075 "\t\tconst char *fstype,\n"
9076 "\t\tint blocksize,\n"
9077 "\t\tconst char *device);\n"
9082 #: ../src/guestfs-actions.pod:3173
9084 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
9085 "block size of the resulting filesystem. Supported block sizes depend on the "
9086 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
9090 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2465
9092 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
9097 #: ../src/guestfs-actions.pod:3183
9098 msgid "guestfs_mkmountpoint"
9102 #: ../src/guestfs-actions.pod:3185
9105 " int guestfs_mkmountpoint (guestfs_h *g,\n"
9106 "\t\tconst char *exemptpath);\n"
9111 #: ../src/guestfs-actions.pod:3188
9113 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
9114 "that can be used to create extra mountpoints before mounting the first "
9119 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2476
9121 "These calls are I<only> necessary in some very limited circumstances, mainly "
9122 "the case where you want to mount a mix of unrelated and/or read-only "
9123 "filesystems together."
9127 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2480
9129 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
9130 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
9131 "inside that. You can unpack this as follows in guestfish:"
9135 #: ../src/guestfs-actions.pod:3201 ../fish/guestfish-actions.pod:2485
9138 " add-ro Fedora-11-i686-Live.iso\n"
9140 " mkmountpoint /cd\n"
9141 " mkmountpoint /squash\n"
9142 " mkmountpoint /ext3\n"
9143 " mount /dev/sda /cd\n"
9144 " mount-loop /cd/LiveOS/squashfs.img /squash\n"
9145 " mount-loop /squash/LiveOS/ext3fs.img /ext3\n"
9150 #: ../src/guestfs-actions.pod:3210 ../fish/guestfish-actions.pod:2494
9151 msgid "The inner filesystem is now unpacked under the /ext3 mountpoint."
9155 #: ../src/guestfs-actions.pod:3214
9156 msgid "guestfs_mknod"
9160 #: ../src/guestfs-actions.pod:3216
9163 " int guestfs_mknod (guestfs_h *g,\n"
9165 "\t\tint devmajor,\n"
9166 "\t\tint devminor,\n"
9167 "\t\tconst char *path);\n"
9172 #: ../src/guestfs-actions.pod:3222 ../fish/guestfish-actions.pod:2500
9174 "This call creates block or character special devices, or named pipes "
9179 #: ../src/guestfs-actions.pod:3225 ../fish/guestfish-actions.pod:2503
9181 "The C<mode> parameter should be the mode, using the standard constants. "
9182 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
9183 "used when creating block and character special devices."
9187 #: ../src/guestfs-actions.pod:3230
9189 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
9190 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
9191 "regular file). These constants are available in the standard Linux header "
9192 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
9193 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
9194 "the appropriate constant for you."
9198 #: ../src/guestfs-actions.pod:3242
9199 msgid "guestfs_mknod_b"
9203 #: ../src/guestfs-actions.pod:3244
9206 " int guestfs_mknod_b (guestfs_h *g,\n"
9208 "\t\tint devmajor,\n"
9209 "\t\tint devminor,\n"
9210 "\t\tconst char *path);\n"
9215 #: ../src/guestfs-actions.pod:3250
9217 "This call creates a block device node called C<path> with mode C<mode> and "
9218 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9219 "wrapper around C<guestfs_mknod>."
9223 #: ../src/guestfs-actions.pod:3258
9224 msgid "guestfs_mknod_c"
9228 #: ../src/guestfs-actions.pod:3260
9231 " int guestfs_mknod_c (guestfs_h *g,\n"
9233 "\t\tint devmajor,\n"
9234 "\t\tint devminor,\n"
9235 "\t\tconst char *path);\n"
9240 #: ../src/guestfs-actions.pod:3266
9242 "This call creates a char device node called C<path> with mode C<mode> and "
9243 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
9244 "wrapper around C<guestfs_mknod>."
9248 #: ../src/guestfs-actions.pod:3274
9249 msgid "guestfs_mkswap"
9253 #: ../src/guestfs-actions.pod:3276
9256 " int guestfs_mkswap (guestfs_h *g,\n"
9257 "\t\tconst char *device);\n"
9262 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2542
9263 msgid "Create a swap partition on C<device>."
9267 #: ../src/guestfs-actions.pod:3283
9268 msgid "guestfs_mkswap_L"
9272 #: ../src/guestfs-actions.pod:3285
9275 " int guestfs_mkswap_L (guestfs_h *g,\n"
9276 "\t\tconst char *label,\n"
9277 "\t\tconst char *device);\n"
9282 #: ../src/guestfs-actions.pod:3289 ../fish/guestfish-actions.pod:2548
9283 msgid "Create a swap partition on C<device> with label C<label>."
9287 #: ../src/guestfs-actions.pod:3291 ../fish/guestfish-actions.pod:2550
9289 "Note that you cannot attach a swap label to a block device "
9290 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
9291 "the kernel or swap tools."
9295 #: ../src/guestfs-actions.pod:3297
9296 msgid "guestfs_mkswap_U"
9300 #: ../src/guestfs-actions.pod:3299
9303 " int guestfs_mkswap_U (guestfs_h *g,\n"
9304 "\t\tconst char *uuid,\n"
9305 "\t\tconst char *device);\n"
9310 #: ../src/guestfs-actions.pod:3303 ../fish/guestfish-actions.pod:2558
9311 msgid "Create a swap partition on C<device> with UUID C<uuid>."
9315 #: ../src/guestfs-actions.pod:3307
9316 msgid "guestfs_mkswap_file"
9320 #: ../src/guestfs-actions.pod:3309
9323 " int guestfs_mkswap_file (guestfs_h *g,\n"
9324 "\t\tconst char *path);\n"
9329 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2564
9330 msgid "Create a swap file."
9334 #: ../src/guestfs-actions.pod:3314
9336 "This command just writes a swap file signature to an existing file. To "
9337 "create the file itself, use something like C<guestfs_fallocate>."
9341 #: ../src/guestfs-actions.pod:3319
9342 msgid "guestfs_modprobe"
9346 #: ../src/guestfs-actions.pod:3321
9349 " int guestfs_modprobe (guestfs_h *g,\n"
9350 "\t\tconst char *modulename);\n"
9355 #: ../src/guestfs-actions.pod:3324 ../fish/guestfish-actions.pod:2573
9356 msgid "This loads a kernel module in the appliance."
9360 #: ../src/guestfs-actions.pod:3326 ../fish/guestfish-actions.pod:2575
9362 "The kernel module must have been whitelisted when libguestfs was built (see "
9363 "C<appliance/kmod.whitelist.in> in the source)."
9367 #: ../src/guestfs-actions.pod:3331
9368 msgid "guestfs_mount"
9372 #: ../src/guestfs-actions.pod:3333
9375 " int guestfs_mount (guestfs_h *g,\n"
9376 "\t\tconst char *device,\n"
9377 "\t\tconst char *mountpoint);\n"
9382 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2582
9384 "Mount a guest disk at a position in the filesystem. Block devices are named "
9385 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
9386 "those block devices contain partitions, they will have the usual names "
9387 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
9391 #: ../src/guestfs-actions.pod:3343 ../fish/guestfish-actions.pod:2588
9393 "The rules are the same as for L<mount(2)>: A filesystem must first be "
9394 "mounted on C</> before others can be mounted. Other filesystems can only be "
9395 "mounted on directories which already exist."
9399 #: ../src/guestfs-actions.pod:3348 ../fish/guestfish-actions.pod:2593
9401 "The mounted filesystem is writable, if we have sufficient permissions on the "
9402 "underlying device."
9406 #: ../src/guestfs-actions.pod:3351
9408 "B<Important note:> When you use this call, the filesystem options C<sync> "
9409 "and C<noatime> are set implicitly. This was originally done because we "
9410 "thought it would improve reliability, but it turns out that I<-o sync> has a "
9411 "very large negative performance impact and negligible effect on "
9412 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
9413 "in any code that needs performance, and instead use C<guestfs_mount_options> "
9414 "(use an empty string for the first parameter if you don't want any options)."
9418 #: ../src/guestfs-actions.pod:3363
9419 msgid "guestfs_mount_loop"
9423 #: ../src/guestfs-actions.pod:3365
9426 " int guestfs_mount_loop (guestfs_h *g,\n"
9427 "\t\tconst char *file,\n"
9428 "\t\tconst char *mountpoint);\n"
9433 #: ../src/guestfs-actions.pod:3369 ../fish/guestfish-actions.pod:2610
9435 "This command lets you mount C<file> (a filesystem image in a file) on a "
9436 "mount point. It is entirely equivalent to the command C<mount -o loop file "
9441 #: ../src/guestfs-actions.pod:3375
9442 msgid "guestfs_mount_options"
9446 #: ../src/guestfs-actions.pod:3377
9449 " int guestfs_mount_options (guestfs_h *g,\n"
9450 "\t\tconst char *options,\n"
9451 "\t\tconst char *device,\n"
9452 "\t\tconst char *mountpoint);\n"
9457 #: ../src/guestfs-actions.pod:3382
9459 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9460 "the mount options as for the L<mount(8)> I<-o> flag."
9464 #: ../src/guestfs-actions.pod:3386 ../fish/guestfish-actions.pod:2622
9466 "If the C<options> parameter is an empty string, then no options are passed "
9467 "(all options default to whatever the filesystem uses)."
9471 #: ../src/guestfs-actions.pod:3392
9472 msgid "guestfs_mount_ro"
9476 #: ../src/guestfs-actions.pod:3394
9479 " int guestfs_mount_ro (guestfs_h *g,\n"
9480 "\t\tconst char *device,\n"
9481 "\t\tconst char *mountpoint);\n"
9486 #: ../src/guestfs-actions.pod:3398
9488 "This is the same as the C<guestfs_mount> command, but it mounts the "
9489 "filesystem with the read-only (I<-o ro>) flag."
9493 #: ../src/guestfs-actions.pod:3403
9494 msgid "guestfs_mount_vfs"
9498 #: ../src/guestfs-actions.pod:3405
9501 " int guestfs_mount_vfs (guestfs_h *g,\n"
9502 "\t\tconst char *options,\n"
9503 "\t\tconst char *vfstype,\n"
9504 "\t\tconst char *device,\n"
9505 "\t\tconst char *mountpoint);\n"
9510 #: ../src/guestfs-actions.pod:3411
9512 "This is the same as the C<guestfs_mount> command, but it allows you to set "
9513 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
9518 #: ../src/guestfs-actions.pod:3417
9519 msgid "guestfs_mountpoints"
9523 #: ../src/guestfs-actions.pod:3419
9526 " char **guestfs_mountpoints (guestfs_h *g);\n"
9531 #: ../src/guestfs-actions.pod:3421
9533 "This call is similar to C<guestfs_mounts>. That call returns a list of "
9534 "devices. This one returns a hash table (map) of device name to directory "
9535 "where the device is mounted."
9539 #: ../src/guestfs-actions.pod:3431
9540 msgid "guestfs_mounts"
9544 #: ../src/guestfs-actions.pod:3433
9547 " char **guestfs_mounts (guestfs_h *g);\n"
9552 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2653
9554 "This returns the list of currently mounted filesystems. It returns the list "
9555 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
9559 #: ../src/guestfs-actions.pod:3438 ../fish/guestfish-actions.pod:2656
9560 msgid "Some internal mounts are not shown."
9564 #: ../src/guestfs-actions.pod:3440
9565 msgid "See also: C<guestfs_mountpoints>"
9569 #: ../src/guestfs-actions.pod:3446
9574 #: ../src/guestfs-actions.pod:3448
9577 " int guestfs_mv (guestfs_h *g,\n"
9578 "\t\tconst char *src,\n"
9579 "\t\tconst char *dest);\n"
9584 #: ../src/guestfs-actions.pod:3452 ../fish/guestfish-actions.pod:2664
9586 "This moves a file from C<src> to C<dest> where C<dest> is either a "
9587 "destination filename or destination directory."
9591 #: ../src/guestfs-actions.pod:3457
9592 msgid "guestfs_ntfs_3g_probe"
9596 #: ../src/guestfs-actions.pod:3459
9599 " int guestfs_ntfs_3g_probe (guestfs_h *g,\n"
9601 "\t\tconst char *device);\n"
9606 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2671
9608 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
9609 "C<device> for mountability. (Not all NTFS volumes can be mounted "
9610 "read-write, and some cannot be mounted at all)."
9614 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2675
9616 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
9617 "can be mounted read-write. Set it to false if you want to test if the "
9618 "volume can be mounted read-only."
9622 #: ../src/guestfs-actions.pod:3471 ../fish/guestfish-actions.pod:2679
9624 "The return value is an integer which C<0> if the operation would succeed, or "
9625 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
9629 #: ../src/guestfs-actions.pod:3477
9630 msgid "guestfs_ntfsresize"
9634 #: ../src/guestfs-actions.pod:3479
9637 " int guestfs_ntfsresize (guestfs_h *g,\n"
9638 "\t\tconst char *device);\n"
9643 #: ../src/guestfs-actions.pod:3482 ../fish/guestfish-actions.pod:2687
9645 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
9646 "size of the underlying device. See also L<ntfsresize(8)>."
9650 #: ../src/guestfs-actions.pod:3488
9651 msgid "guestfs_ntfsresize_size"
9655 #: ../src/guestfs-actions.pod:3490
9658 " int guestfs_ntfsresize_size (guestfs_h *g,\n"
9659 "\t\tconst char *device,\n"
9660 "\t\tint64_t size);\n"
9665 #: ../src/guestfs-actions.pod:3494
9667 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
9668 "to specify the new size (in bytes) explicitly."
9672 #: ../src/guestfs-actions.pod:3499
9673 msgid "guestfs_part_add"
9677 #: ../src/guestfs-actions.pod:3501
9680 " int guestfs_part_add (guestfs_h *g,\n"
9681 "\t\tconst char *device,\n"
9682 "\t\tconst char *prlogex,\n"
9683 "\t\tint64_t startsect,\n"
9684 "\t\tint64_t endsect);\n"
9689 #: ../src/guestfs-actions.pod:3507
9691 "This command adds a partition to C<device>. If there is no partition table "
9692 "on the device, call C<guestfs_part_init> first."
9696 #: ../src/guestfs-actions.pod:3510 ../fish/guestfish-actions.pod:2705
9698 "The C<prlogex> parameter is the type of partition. Normally you should pass "
9699 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
9700 "C<logical>) and C<e> (or C<extended>) partition types."
9704 #: ../src/guestfs-actions.pod:3515 ../fish/guestfish-actions.pod:2710
9706 "C<startsect> and C<endsect> are the start and end of the partition in "
9707 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
9708 "from the end of the disk (C<-1> is the last sector)."
9712 #: ../src/guestfs-actions.pod:3519
9714 "Creating a partition which covers the whole disk is not so easy. Use "
9715 "C<guestfs_part_disk> to do that."
9719 #: ../src/guestfs-actions.pod:3524
9720 msgid "guestfs_part_del"
9724 #: ../src/guestfs-actions.pod:3526
9727 " int guestfs_part_del (guestfs_h *g,\n"
9728 "\t\tconst char *device,\n"
9729 "\t\tint partnum);\n"
9734 #: ../src/guestfs-actions.pod:3530 ../fish/guestfish-actions.pod:2721
9735 msgid "This command deletes the partition numbered C<partnum> on C<device>."
9739 #: ../src/guestfs-actions.pod:3532 ../fish/guestfish-actions.pod:2723
9741 "Note that in the case of MBR partitioning, deleting an extended partition "
9742 "also deletes any logical partitions it contains."
9746 #: ../src/guestfs-actions.pod:3538
9747 msgid "guestfs_part_disk"
9751 #: ../src/guestfs-actions.pod:3540
9754 " int guestfs_part_disk (guestfs_h *g,\n"
9755 "\t\tconst char *device,\n"
9756 "\t\tconst char *parttype);\n"
9761 #: ../src/guestfs-actions.pod:3544
9763 "This command is simply a combination of C<guestfs_part_init> followed by "
9764 "C<guestfs_part_add> to create a single primary partition covering the whole "
9769 #: ../src/guestfs-actions.pod:3548
9771 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
9772 "possible values are described in C<guestfs_part_init>."
9776 #: ../src/guestfs-actions.pod:3556
9777 msgid "guestfs_part_get_bootable"
9781 #: ../src/guestfs-actions.pod:3558
9784 " int guestfs_part_get_bootable (guestfs_h *g,\n"
9785 "\t\tconst char *device,\n"
9786 "\t\tint partnum);\n"
9791 #: ../src/guestfs-actions.pod:3562 ../fish/guestfish-actions.pod:2745
9793 "This command returns true if the partition C<partnum> on C<device> has the "
9794 "bootable flag set."
9798 #: ../src/guestfs-actions.pod:3565
9799 msgid "See also C<guestfs_part_set_bootable>."
9803 #: ../src/guestfs-actions.pod:3569
9804 msgid "guestfs_part_get_mbr_id"
9808 #: ../src/guestfs-actions.pod:3571
9811 " int guestfs_part_get_mbr_id (guestfs_h *g,\n"
9812 "\t\tconst char *device,\n"
9813 "\t\tint partnum);\n"
9818 #: ../src/guestfs-actions.pod:3575 ../fish/guestfish-actions.pod:2754
9820 "Returns the MBR type byte (also known as the ID byte) from the numbered "
9821 "partition C<partnum>."
9825 #: ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3740
9827 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
9828 "undefined results for other partition table types (see "
9829 "C<guestfs_part_get_parttype>)."
9833 #: ../src/guestfs-actions.pod:3584
9834 msgid "guestfs_part_get_parttype"
9838 #: ../src/guestfs-actions.pod:3586
9841 " char *guestfs_part_get_parttype (guestfs_h *g,\n"
9842 "\t\tconst char *device);\n"
9847 #: ../src/guestfs-actions.pod:3589 ../fish/guestfish-actions.pod:2765
9849 "This command examines the partition table on C<device> and returns the "
9850 "partition table type (format) being used."
9854 #: ../src/guestfs-actions.pod:3592
9856 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
9857 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
9858 "possible, although unusual. See C<guestfs_part_init> for a full list."
9862 #: ../src/guestfs-actions.pod:3600
9863 msgid "guestfs_part_init"
9867 #: ../src/guestfs-actions.pod:3602
9870 " int guestfs_part_init (guestfs_h *g,\n"
9871 "\t\tconst char *device,\n"
9872 "\t\tconst char *parttype);\n"
9877 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2777
9879 "This creates an empty partition table on C<device> of one of the partition "
9880 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
9881 "(for large disks)."
9885 #: ../src/guestfs-actions.pod:3610
9887 "Initially there are no partitions. Following this, you should call "
9888 "C<guestfs_part_add> for each partition required."
9892 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2784
9893 msgid "Possible values for C<parttype> are:"
9897 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2788
9898 msgid "B<efi> | B<gpt>"
9902 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2790
9903 msgid "Intel EFI / GPT partition table."
9907 #: ../src/guestfs-actions.pod:3621 ../fish/guestfish-actions.pod:2792
9909 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
9910 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
9911 "the C<mbr> format."
9915 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2796
9916 msgid "B<mbr> | B<msdos>"
9920 #: ../src/guestfs-actions.pod:3627 ../fish/guestfish-actions.pod:2798
9922 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
9923 "Windows. This partition type will B<only> work for device sizes up to 2 "
9924 "TB. For large disks we recommend using C<gpt>."
9928 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2805
9929 msgid "Other partition table types that may work but are not supported include:"
9933 #: ../src/guestfs-actions.pod:3639 ../fish/guestfish-actions.pod:2810
9938 #: ../src/guestfs-actions.pod:3641 ../fish/guestfish-actions.pod:2812
9939 msgid "AIX disk labels."
9943 #: ../src/guestfs-actions.pod:3643 ../fish/guestfish-actions.pod:2814
9944 msgid "B<amiga> | B<rdb>"
9948 #: ../src/guestfs-actions.pod:3645 ../fish/guestfish-actions.pod:2816
9949 msgid "Amiga \"Rigid Disk Block\" format."
9953 #: ../src/guestfs-actions.pod:3647 ../fish/guestfish-actions.pod:2818
9958 #: ../src/guestfs-actions.pod:3649 ../fish/guestfish-actions.pod:2820
9959 msgid "BSD disk labels."
9963 #: ../src/guestfs-actions.pod:3651 ../fish/guestfish-actions.pod:2822
9968 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2824
9969 msgid "DASD, used on IBM mainframes."
9973 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2826
9978 #: ../src/guestfs-actions.pod:3657 ../fish/guestfish-actions.pod:2828
9979 msgid "MIPS/SGI volumes."
9983 #: ../src/guestfs-actions.pod:3659 ../fish/guestfish-actions.pod:2830
9988 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2832
9989 msgid "Old Mac partition format. Modern Macs use C<gpt>."
9993 #: ../src/guestfs-actions.pod:3663 ../fish/guestfish-actions.pod:2834
9998 #: ../src/guestfs-actions.pod:3665 ../fish/guestfish-actions.pod:2836
9999 msgid "NEC PC-98 format, common in Japan apparently."
10003 #: ../src/guestfs-actions.pod:3667 ../fish/guestfish-actions.pod:2838
10008 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2840
10009 msgid "Sun disk labels."
10013 #: ../src/guestfs-actions.pod:3675
10014 msgid "guestfs_part_list"
10018 #: ../src/guestfs-actions.pod:3677
10021 " struct guestfs_partition_list *guestfs_part_list (guestfs_h *g,\n"
10022 "\t\tconst char *device);\n"
10027 #: ../src/guestfs-actions.pod:3680 ../fish/guestfish-actions.pod:2848
10029 "This command parses the partition table on C<device> and returns the list of "
10030 "partitions found."
10034 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2851
10035 msgid "The fields in the returned structure are:"
10039 #: ../src/guestfs-actions.pod:3687 ../fish/guestfish-actions.pod:2855
10040 msgid "B<part_num>"
10044 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2857
10045 msgid "Partition number, counting from 1."
10049 #: ../src/guestfs-actions.pod:3691 ../fish/guestfish-actions.pod:2859
10050 msgid "B<part_start>"
10054 #: ../src/guestfs-actions.pod:3693
10056 "Start of the partition I<in bytes>. To get sectors you have to divide by "
10057 "the device's sector size, see C<guestfs_blockdev_getss>."
10061 #: ../src/guestfs-actions.pod:3696 ../fish/guestfish-actions.pod:2864
10062 msgid "B<part_end>"
10066 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2866
10067 msgid "End of the partition in bytes."
10071 #: ../src/guestfs-actions.pod:3700 ../fish/guestfish-actions.pod:2868
10072 msgid "B<part_size>"
10076 #: ../src/guestfs-actions.pod:3702 ../fish/guestfish-actions.pod:2870
10077 msgid "Size of the partition in bytes."
10081 #: ../src/guestfs-actions.pod:3706
10083 "This function returns a C<struct guestfs_partition_list *> (see "
10084 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10085 "must call C<guestfs_free_partition_list> after use>."
10089 #: ../src/guestfs-actions.pod:3711
10090 msgid "guestfs_part_set_bootable"
10094 #: ../src/guestfs-actions.pod:3713
10097 " int guestfs_part_set_bootable (guestfs_h *g,\n"
10098 "\t\tconst char *device,\n"
10099 "\t\tint partnum,\n"
10100 "\t\tint bootable);\n"
10105 #: ../src/guestfs-actions.pod:3718 ../fish/guestfish-actions.pod:2878
10107 "This sets the bootable flag on partition numbered C<partnum> on device "
10108 "C<device>. Note that partitions are numbered from 1."
10112 #: ../src/guestfs-actions.pod:3721 ../fish/guestfish-actions.pod:2881
10114 "The bootable flag is used by some operating systems (notably Windows) to "
10115 "determine which partition to boot from. It is by no means universally "
10120 #: ../src/guestfs-actions.pod:3727
10121 msgid "guestfs_part_set_mbr_id"
10125 #: ../src/guestfs-actions.pod:3729
10128 " int guestfs_part_set_mbr_id (guestfs_h *g,\n"
10129 "\t\tconst char *device,\n"
10130 "\t\tint partnum,\n"
10131 "\t\tint idbyte);\n"
10136 #: ../src/guestfs-actions.pod:3734 ../fish/guestfish-actions.pod:2889
10138 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
10139 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
10140 "documentation are in fact hexadecimal numbers, but usually documented "
10141 "without any leading \"0x\" which might be confusing."
10145 #: ../src/guestfs-actions.pod:3746
10146 msgid "guestfs_part_set_name"
10150 #: ../src/guestfs-actions.pod:3748
10153 " int guestfs_part_set_name (guestfs_h *g,\n"
10154 "\t\tconst char *device,\n"
10155 "\t\tint partnum,\n"
10156 "\t\tconst char *name);\n"
10161 #: ../src/guestfs-actions.pod:3753 ../fish/guestfish-actions.pod:2903
10163 "This sets the partition name on partition numbered C<partnum> on device "
10164 "C<device>. Note that partitions are numbered from 1."
10168 #: ../src/guestfs-actions.pod:3756 ../fish/guestfish-actions.pod:2906
10170 "The partition name can only be set on certain types of partition table. "
10171 "This works on C<gpt> but not on C<mbr> partitions."
10175 #: ../src/guestfs-actions.pod:3761
10176 msgid "guestfs_part_to_dev"
10180 #: ../src/guestfs-actions.pod:3763
10183 " char *guestfs_part_to_dev (guestfs_h *g,\n"
10184 "\t\tconst char *partition);\n"
10189 #: ../src/guestfs-actions.pod:3766 ../fish/guestfish-actions.pod:2913
10191 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
10192 "partition number, returning the device name (eg. \"/dev/sdb\")."
10196 #: ../src/guestfs-actions.pod:3770
10198 "The named partition must exist, for example as a string returned from "
10199 "C<guestfs_list_partitions>."
10203 #: ../src/guestfs-actions.pod:3776
10204 msgid "guestfs_ping_daemon"
10208 #: ../src/guestfs-actions.pod:3778
10211 " int guestfs_ping_daemon (guestfs_h *g);\n"
10216 #: ../src/guestfs-actions.pod:3780 ../fish/guestfish-actions.pod:2924
10218 "This is a test probe into the guestfs daemon running inside the qemu "
10219 "subprocess. Calling this function checks that the daemon responds to the "
10220 "ping message, without affecting the daemon or attached block device(s) in "
10225 #: ../src/guestfs-actions.pod:3787
10226 msgid "guestfs_pread"
10230 #: ../src/guestfs-actions.pod:3789
10233 " char *guestfs_pread (guestfs_h *g,\n"
10234 "\t\tconst char *path,\n"
10236 "\t\tint64_t offset,\n"
10237 "\t\tsize_t *size_r);\n"
10242 #: ../src/guestfs-actions.pod:3795 ../fish/guestfish-actions.pod:2933
10244 "This command lets you read part of a file. It reads C<count> bytes of the "
10245 "file, starting at C<offset>, from file C<path>."
10249 #: ../src/guestfs-actions.pod:3798 ../fish/guestfish-actions.pod:2936
10251 "This may read fewer bytes than requested. For further details see the "
10252 "L<pread(2)> system call."
10256 #: ../src/guestfs-actions.pod:3801
10257 msgid "See also C<guestfs_pwrite>."
10261 #: ../src/guestfs-actions.pod:3810
10262 msgid "guestfs_pvcreate"
10266 #: ../src/guestfs-actions.pod:3812
10269 " int guestfs_pvcreate (guestfs_h *g,\n"
10270 "\t\tconst char *device);\n"
10275 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2948
10277 "This creates an LVM physical volume on the named C<device>, where C<device> "
10278 "should usually be a partition name such as C</dev/sda1>."
10282 #: ../src/guestfs-actions.pod:3821
10283 msgid "guestfs_pvremove"
10287 #: ../src/guestfs-actions.pod:3823
10290 " int guestfs_pvremove (guestfs_h *g,\n"
10291 "\t\tconst char *device);\n"
10296 #: ../src/guestfs-actions.pod:3826 ../fish/guestfish-actions.pod:2956
10298 "This wipes a physical volume C<device> so that LVM will no longer recognise "
10303 #: ../src/guestfs-actions.pod:3829 ../fish/guestfish-actions.pod:2959
10305 "The implementation uses the C<pvremove> command which refuses to wipe "
10306 "physical volumes that contain any volume groups, so you have to remove those "
10311 #: ../src/guestfs-actions.pod:3835
10312 msgid "guestfs_pvresize"
10316 #: ../src/guestfs-actions.pod:3837
10319 " int guestfs_pvresize (guestfs_h *g,\n"
10320 "\t\tconst char *device);\n"
10325 #: ../src/guestfs-actions.pod:3840 ../fish/guestfish-actions.pod:2967
10327 "This resizes (expands or shrinks) an existing LVM physical volume to match "
10328 "the new size of the underlying device."
10332 #: ../src/guestfs-actions.pod:3845
10333 msgid "guestfs_pvresize_size"
10337 #: ../src/guestfs-actions.pod:3847
10340 " int guestfs_pvresize_size (guestfs_h *g,\n"
10341 "\t\tconst char *device,\n"
10342 "\t\tint64_t size);\n"
10347 #: ../src/guestfs-actions.pod:3851
10349 "This command is the same as C<guestfs_pvresize> except that it allows you to "
10350 "specify the new size (in bytes) explicitly."
10354 #: ../src/guestfs-actions.pod:3856
10355 msgid "guestfs_pvs"
10359 #: ../src/guestfs-actions.pod:3858
10362 " char **guestfs_pvs (guestfs_h *g);\n"
10367 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2981
10369 "List all the physical volumes detected. This is the equivalent of the "
10370 "L<pvs(8)> command."
10374 #: ../src/guestfs-actions.pod:3863 ../fish/guestfish-actions.pod:2984
10376 "This returns a list of just the device names that contain PVs "
10377 "(eg. C</dev/sda2>)."
10381 #: ../src/guestfs-actions.pod:3866
10382 msgid "See also C<guestfs_pvs_full>."
10386 #: ../src/guestfs-actions.pod:3872
10387 msgid "guestfs_pvs_full"
10391 #: ../src/guestfs-actions.pod:3874
10394 " struct guestfs_lvm_pv_list *guestfs_pvs_full (guestfs_h *g);\n"
10399 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2993
10401 "List all the physical volumes detected. This is the equivalent of the "
10402 "L<pvs(8)> command. The \"full\" version includes all fields."
10406 #: ../src/guestfs-actions.pod:3879
10408 "This function returns a C<struct guestfs_lvm_pv_list *> (see "
10409 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10410 "must call C<guestfs_free_lvm_pv_list> after use>."
10414 #: ../src/guestfs-actions.pod:3884
10415 msgid "guestfs_pvuuid"
10419 #: ../src/guestfs-actions.pod:3886
10422 " char *guestfs_pvuuid (guestfs_h *g,\n"
10423 "\t\tconst char *device);\n"
10428 #: ../src/guestfs-actions.pod:3889 ../fish/guestfish-actions.pod:3000
10429 msgid "This command returns the UUID of the LVM PV C<device>."
10433 #: ../src/guestfs-actions.pod:3894
10434 msgid "guestfs_pwrite"
10438 #: ../src/guestfs-actions.pod:3896
10441 " int guestfs_pwrite (guestfs_h *g,\n"
10442 "\t\tconst char *path,\n"
10443 "\t\tconst char *content,\n"
10444 "\t\tsize_t content_size,\n"
10445 "\t\tint64_t offset);\n"
10450 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:3006
10452 "This command writes to part of a file. It writes the data buffer C<content> "
10453 "to the file C<path> starting at offset C<offset>."
10457 #: ../src/guestfs-actions.pod:3905 ../fish/guestfish-actions.pod:3009
10459 "This command implements the L<pwrite(2)> system call, and like that system "
10460 "call it may not write the full data requested. The return value is the "
10461 "number of bytes that were actually written to the file. This could even be "
10462 "0, although short writes are unlikely for regular files in ordinary "
10467 #: ../src/guestfs-actions.pod:3911
10468 msgid "See also C<guestfs_pread>."
10472 #: ../src/guestfs-actions.pod:3918
10473 msgid "guestfs_read_file"
10477 #: ../src/guestfs-actions.pod:3920
10480 " char *guestfs_read_file (guestfs_h *g,\n"
10481 "\t\tconst char *path,\n"
10482 "\t\tsize_t *size_r);\n"
10487 #: ../src/guestfs-actions.pod:3924 ../fish/guestfish-actions.pod:3024
10488 msgid "This calls returns the contents of the file C<path> as a buffer."
10492 #: ../src/guestfs-actions.pod:3927
10494 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
10495 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
10496 "function is limited in the total size of file that can be handled."
10500 #: ../src/guestfs-actions.pod:3939
10501 msgid "guestfs_read_lines"
10505 #: ../src/guestfs-actions.pod:3941
10508 " char **guestfs_read_lines (guestfs_h *g,\n"
10509 "\t\tconst char *path);\n"
10514 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:3041
10516 "The file contents are returned as a list of lines. Trailing C<LF> and "
10517 "C<CRLF> character sequences are I<not> returned."
10521 #: ../src/guestfs-actions.pod:3949
10523 "Note that this function cannot correctly handle binary files (specifically, "
10524 "files containing C<\\0> character which is treated as end of line). For "
10525 "those you need to use the C<guestfs_read_file> function which has a more "
10526 "complex interface."
10530 #: ../src/guestfs-actions.pod:3958
10531 msgid "guestfs_readdir"
10535 #: ../src/guestfs-actions.pod:3960
10538 " struct guestfs_dirent_list *guestfs_readdir (guestfs_h *g,\n"
10539 "\t\tconst char *dir);\n"
10544 #: ../src/guestfs-actions.pod:3963 ../fish/guestfish-actions.pod:3053
10545 msgid "This returns the list of directory entries in directory C<dir>."
10549 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:3055
10551 "All entries in the directory are returned, including C<.> and C<..>. The "
10552 "entries are I<not> sorted, but returned in the same order as the underlying "
10557 #: ../src/guestfs-actions.pod:3969 ../fish/guestfish-actions.pod:3059
10559 "Also this call returns basic file type information about each file. The "
10560 "C<ftyp> field will contain one of the following characters:"
10564 #: ../src/guestfs-actions.pod:3974 ../fish/guestfish-actions.pod:3064
10569 #: ../src/guestfs-actions.pod:3976 ../fish/guestfish-actions.pod:3066
10570 msgid "Block special"
10574 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:3068
10579 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:3070
10580 msgid "Char special"
10584 #: ../src/guestfs-actions.pod:3982 ../fish/guestfish-actions.pod:3072
10589 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:3074
10594 #: ../src/guestfs-actions.pod:3986 ../fish/guestfish-actions.pod:3076
10599 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:3078
10600 msgid "FIFO (named pipe)"
10604 #: ../src/guestfs-actions.pod:3990 ../fish/guestfish-actions.pod:3080
10609 #: ../src/guestfs-actions.pod:3992 ../fish/guestfish-actions.pod:3082
10610 msgid "Symbolic link"
10614 #: ../src/guestfs-actions.pod:3994 ../fish/guestfish-actions.pod:3084
10619 #: ../src/guestfs-actions.pod:3996 ../fish/guestfish-actions.pod:3086
10620 msgid "Regular file"
10624 #: ../src/guestfs-actions.pod:3998 ../fish/guestfish-actions.pod:3088
10629 #: ../src/guestfs-actions.pod:4000 ../fish/guestfish-actions.pod:3090
10634 #: ../src/guestfs-actions.pod:4002 ../fish/guestfish-actions.pod:3092
10639 #: ../src/guestfs-actions.pod:4004 ../fish/guestfish-actions.pod:3094
10640 msgid "Unknown file type"
10644 #: ../src/guestfs-actions.pod:4006 ../fish/guestfish-actions.pod:3096
10649 #: ../src/guestfs-actions.pod:4008 ../fish/guestfish-actions.pod:3098
10650 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
10654 #: ../src/guestfs-actions.pod:4013
10656 "This function is primarily intended for use by programs. To get a simple "
10657 "list of names, use C<guestfs_ls>. To get a printable directory for human "
10658 "consumption, use C<guestfs_ll>."
10662 #: ../src/guestfs-actions.pod:4017
10664 "This function returns a C<struct guestfs_dirent_list *> (see "
10665 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
10666 "must call C<guestfs_free_dirent_list> after use>."
10670 #: ../src/guestfs-actions.pod:4022
10671 msgid "guestfs_readlink"
10675 #: ../src/guestfs-actions.pod:4024
10678 " char *guestfs_readlink (guestfs_h *g,\n"
10679 "\t\tconst char *path);\n"
10684 #: ../src/guestfs-actions.pod:4027 ../fish/guestfish-actions.pod:3111
10685 msgid "This command reads the target of a symbolic link."
10689 #: ../src/guestfs-actions.pod:4032
10690 msgid "guestfs_readlinklist"
10694 #: ../src/guestfs-actions.pod:4034
10697 " char **guestfs_readlinklist (guestfs_h *g,\n"
10698 "\t\tconst char *path,\n"
10699 "\t\tchar *const *names);\n"
10704 #: ../src/guestfs-actions.pod:4038 ../fish/guestfish-actions.pod:3117
10706 "This call allows you to do a C<readlink> operation on multiple files, where "
10707 "all files are in the directory C<path>. C<names> is the list of files from "
10712 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:3121
10714 "On return you get a list of strings, with a one-to-one correspondence to the "
10715 "C<names> list. Each string is the value of the symbolic link."
10719 #: ../src/guestfs-actions.pod:4046 ../fish/guestfish-actions.pod:3125
10721 "If the C<readlink(2)> operation fails on any name, then the corresponding "
10722 "result string is the empty string C<\"\">. However the whole operation is "
10723 "completed even if there were C<readlink(2)> errors, and so you can call this "
10724 "function with names where you don't know if they are symbolic links already "
10725 "(albeit slightly less efficient)."
10729 #: ../src/guestfs-actions.pod:4053 ../fish/guestfish-actions.pod:3132
10731 "This call is intended for programs that want to efficiently list a directory "
10732 "contents without making many round-trips. Very long directory listings "
10733 "might cause the protocol message size to be exceeded, causing this call to "
10734 "fail. The caller must split up such requests into smaller groups of names."
10738 #: ../src/guestfs-actions.pod:4064
10739 msgid "guestfs_realpath"
10743 #: ../src/guestfs-actions.pod:4066
10746 " char *guestfs_realpath (guestfs_h *g,\n"
10747 "\t\tconst char *path);\n"
10752 #: ../src/guestfs-actions.pod:4069 ../fish/guestfish-actions.pod:3143
10754 "Return the canonicalized absolute pathname of C<path>. The returned path "
10755 "has no C<.>, C<..> or symbolic link path elements."
10759 #: ../src/guestfs-actions.pod:4075
10760 msgid "guestfs_removexattr"
10764 #: ../src/guestfs-actions.pod:4077
10767 " int guestfs_removexattr (guestfs_h *g,\n"
10768 "\t\tconst char *xattr,\n"
10769 "\t\tconst char *path);\n"
10774 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:3150
10775 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
10779 #: ../src/guestfs-actions.pod:4084
10780 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
10784 #: ../src/guestfs-actions.pod:4088
10785 msgid "guestfs_resize2fs"
10789 #: ../src/guestfs-actions.pod:4090
10792 " int guestfs_resize2fs (guestfs_h *g,\n"
10793 "\t\tconst char *device);\n"
10798 #: ../src/guestfs-actions.pod:4093 ../fish/guestfish-actions.pod:3159
10800 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
10801 "underlying device."
10805 #: ../src/guestfs-actions.pod:4096
10807 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
10808 "C<device> before calling this command. For unknown reasons C<resize2fs> "
10809 "sometimes gives an error about this and sometimes not. In any case, it is "
10810 "always safe to call C<guestfs_e2fsck_f> before calling this function."
10814 #: ../src/guestfs-actions.pod:4104
10815 msgid "guestfs_resize2fs_size"
10819 #: ../src/guestfs-actions.pod:4106
10822 " int guestfs_resize2fs_size (guestfs_h *g,\n"
10823 "\t\tconst char *device,\n"
10824 "\t\tint64_t size);\n"
10829 #: ../src/guestfs-actions.pod:4110
10831 "This command is the same as C<guestfs_resize2fs> except that it allows you "
10832 "to specify the new size (in bytes) explicitly."
10836 #: ../src/guestfs-actions.pod:4115
10841 #: ../src/guestfs-actions.pod:4117
10844 " int guestfs_rm (guestfs_h *g,\n"
10845 "\t\tconst char *path);\n"
10850 #: ../src/guestfs-actions.pod:4120 ../fish/guestfish-actions.pod:3179
10851 msgid "Remove the single file C<path>."
10855 #: ../src/guestfs-actions.pod:4124
10856 msgid "guestfs_rm_rf"
10860 #: ../src/guestfs-actions.pod:4126
10863 " int guestfs_rm_rf (guestfs_h *g,\n"
10864 "\t\tconst char *path);\n"
10869 #: ../src/guestfs-actions.pod:4129 ../fish/guestfish-actions.pod:3185
10871 "Remove the file or directory C<path>, recursively removing the contents if "
10872 "its a directory. This is like the C<rm -rf> shell command."
10876 #: ../src/guestfs-actions.pod:4135
10877 msgid "guestfs_rmdir"
10881 #: ../src/guestfs-actions.pod:4137
10884 " int guestfs_rmdir (guestfs_h *g,\n"
10885 "\t\tconst char *path);\n"
10890 #: ../src/guestfs-actions.pod:4140 ../fish/guestfish-actions.pod:3193
10891 msgid "Remove the single directory C<path>."
10895 #: ../src/guestfs-actions.pod:4144
10896 msgid "guestfs_rmmountpoint"
10900 #: ../src/guestfs-actions.pod:4146
10903 " int guestfs_rmmountpoint (guestfs_h *g,\n"
10904 "\t\tconst char *exemptpath);\n"
10909 #: ../src/guestfs-actions.pod:4149
10911 "This calls removes a mountpoint that was previously created with "
10912 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
10916 #: ../src/guestfs-actions.pod:4155
10917 msgid "guestfs_scrub_device"
10921 #: ../src/guestfs-actions.pod:4157
10924 " int guestfs_scrub_device (guestfs_h *g,\n"
10925 "\t\tconst char *device);\n"
10930 #: ../src/guestfs-actions.pod:4160 ../fish/guestfish-actions.pod:3207
10932 "This command writes patterns over C<device> to make data retrieval more "
10937 #: ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:4181 ../src/guestfs-actions.pod:4197 ../fish/guestfish-actions.pod:3210 ../fish/guestfish-actions.pod:3225 ../fish/guestfish-actions.pod:3238
10939 "It is an interface to the L<scrub(1)> program. See that manual page for "
10944 #: ../src/guestfs-actions.pod:4171
10945 msgid "guestfs_scrub_file"
10949 #: ../src/guestfs-actions.pod:4173
10952 " int guestfs_scrub_file (guestfs_h *g,\n"
10953 "\t\tconst char *file);\n"
10958 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:3220
10960 "This command writes patterns over a file to make data retrieval more "
10965 #: ../src/guestfs-actions.pod:4179 ../fish/guestfish-actions.pod:3223
10966 msgid "The file is I<removed> after scrubbing."
10970 #: ../src/guestfs-actions.pod:4186
10971 msgid "guestfs_scrub_freespace"
10975 #: ../src/guestfs-actions.pod:4188
10978 " int guestfs_scrub_freespace (guestfs_h *g,\n"
10979 "\t\tconst char *dir);\n"
10984 #: ../src/guestfs-actions.pod:4191
10986 "This command creates the directory C<dir> and then fills it with files until "
10987 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
10988 "and deletes them. The intention is to scrub any free space on the partition "
10989 "containing C<dir>."
10993 #: ../src/guestfs-actions.pod:4202
10994 msgid "guestfs_set_append"
10998 #: ../src/guestfs-actions.pod:4204
11001 " int guestfs_set_append (guestfs_h *g,\n"
11002 "\t\tconst char *append);\n"
11007 #: ../src/guestfs-actions.pod:4207 ../fish/guestfish-actions.pod:3245
11009 "This function is used to add additional options to the guest kernel command "
11014 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:3248
11016 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
11017 "environment variable."
11021 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:3251
11023 "Setting C<append> to C<NULL> means I<no> additional options are passed "
11024 "(libguestfs always adds a few of its own)."
11028 #: ../src/guestfs-actions.pod:4218
11029 msgid "guestfs_set_autosync"
11033 #: ../src/guestfs-actions.pod:4220
11036 " int guestfs_set_autosync (guestfs_h *g,\n"
11037 "\t\tint autosync);\n"
11042 #: ../src/guestfs-actions.pod:4223
11044 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
11045 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
11046 "the handle is closed (also if the program exits without closing handles)."
11050 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:3263
11052 "This is disabled by default (except in guestfish where it is enabled by "
11057 #: ../src/guestfs-actions.pod:4233
11058 msgid "guestfs_set_direct"
11062 #: ../src/guestfs-actions.pod:4235
11065 " int guestfs_set_direct (guestfs_h *g,\n"
11066 "\t\tint direct);\n"
11071 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:3270
11073 "If the direct appliance mode flag is enabled, then stdin and stdout are "
11074 "passed directly through to the appliance once it is launched."
11078 #: ../src/guestfs-actions.pod:4242
11080 "One consequence of this is that log messages aren't caught by the library "
11081 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
11086 #: ../src/guestfs-actions.pod:4246 ../fish/guestfish-actions.pod:3278
11087 msgid "You probably don't want to use this unless you know what you are doing."
11091 #: ../src/guestfs-actions.pod:4249 ../fish/guestfish-actions.pod:3281
11092 msgid "The default is disabled."
11096 #: ../src/guestfs-actions.pod:4253
11097 msgid "guestfs_set_e2label"
11101 #: ../src/guestfs-actions.pod:4255
11104 " int guestfs_set_e2label (guestfs_h *g,\n"
11105 "\t\tconst char *device,\n"
11106 "\t\tconst char *label);\n"
11111 #: ../src/guestfs-actions.pod:4259 ../fish/guestfish-actions.pod:3287
11113 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
11114 "C<label>. Filesystem labels are limited to 16 characters."
11118 #: ../src/guestfs-actions.pod:4263
11120 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
11121 "the existing label on a filesystem."
11125 #: ../src/guestfs-actions.pod:4268
11126 msgid "guestfs_set_e2uuid"
11130 #: ../src/guestfs-actions.pod:4270
11133 " int guestfs_set_e2uuid (guestfs_h *g,\n"
11134 "\t\tconst char *device,\n"
11135 "\t\tconst char *uuid);\n"
11140 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:3298
11142 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
11143 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
11144 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
11148 #: ../src/guestfs-actions.pod:4279
11150 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
11151 "the existing UUID of a filesystem."
11155 #: ../src/guestfs-actions.pod:4284
11156 msgid "guestfs_set_memsize"
11160 #: ../src/guestfs-actions.pod:4286
11163 " int guestfs_set_memsize (guestfs_h *g,\n"
11164 "\t\tint memsize);\n"
11169 #: ../src/guestfs-actions.pod:4289
11171 "This sets the memory size in megabytes allocated to the qemu subprocess. "
11172 "This only has any effect if called before C<guestfs_launch>."
11176 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:3314
11178 "You can also change this by setting the environment variable "
11179 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
11183 #: ../src/guestfs-actions.pod:4302
11184 msgid "guestfs_set_network"
11188 #: ../src/guestfs-actions.pod:4304
11191 " int guestfs_set_network (guestfs_h *g,\n"
11192 "\t\tint network);\n"
11197 #: ../src/guestfs-actions.pod:4307 ../fish/guestfish-actions.pod:3325
11199 "If C<network> is true, then the network is enabled in the libguestfs "
11200 "appliance. The default is false."
11204 #: ../src/guestfs-actions.pod:4310 ../fish/guestfish-actions.pod:3328
11206 "This affects whether commands are able to access the network (see "
11207 "L<guestfs(3)/RUNNING COMMANDS>)."
11211 #: ../src/guestfs-actions.pod:4313
11213 "You must call this before calling C<guestfs_launch>, otherwise it has no "
11218 #: ../src/guestfs-actions.pod:4318
11219 msgid "guestfs_set_path"
11223 #: ../src/guestfs-actions.pod:4320
11226 " int guestfs_set_path (guestfs_h *g,\n"
11227 "\t\tconst char *searchpath);\n"
11232 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:3338
11233 msgid "Set the path that libguestfs searches for kernel and initrd.img."
11237 #: ../src/guestfs-actions.pod:4325 ../fish/guestfish-actions.pod:3340
11239 "The default is C<$libdir/guestfs> unless overridden by setting "
11240 "C<LIBGUESTFS_PATH> environment variable."
11244 #: ../src/guestfs-actions.pod:4328 ../fish/guestfish-actions.pod:3343
11245 msgid "Setting C<path> to C<NULL> restores the default path."
11249 #: ../src/guestfs-actions.pod:4332
11250 msgid "guestfs_set_qemu"
11254 #: ../src/guestfs-actions.pod:4334
11257 " int guestfs_set_qemu (guestfs_h *g,\n"
11258 "\t\tconst char *qemu);\n"
11263 #: ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:3349
11264 msgid "Set the qemu binary that we will use."
11268 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:3351
11269 msgid "The default is chosen when the library was compiled by the configure script."
11273 #: ../src/guestfs-actions.pod:4342 ../fish/guestfish-actions.pod:3354
11275 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
11280 #: ../src/guestfs-actions.pod:4345 ../fish/guestfish-actions.pod:3357
11281 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
11285 #: ../src/guestfs-actions.pod:4347 ../fish/guestfish-actions.pod:3359
11287 "Note that you should call this function as early as possible after creating "
11288 "the handle. This is because some pre-launch operations depend on testing "
11289 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
11290 "don't retest features, and so you might see inconsistent results. Using the "
11291 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
11292 "the qemu binary at the same time as the handle is created."
11296 #: ../src/guestfs-actions.pod:4357
11297 msgid "guestfs_set_recovery_proc"
11301 #: ../src/guestfs-actions.pod:4359
11304 " int guestfs_set_recovery_proc (guestfs_h *g,\n"
11305 "\t\tint recoveryproc);\n"
11310 #: ../src/guestfs-actions.pod:4362
11312 "If this is called with the parameter C<false> then C<guestfs_launch> does "
11313 "not create a recovery process. The purpose of the recovery process is to "
11314 "stop runaway qemu processes in the case where the main program aborts "
11319 #: ../src/guestfs-actions.pod:4367
11321 "This only has any effect if called before C<guestfs_launch>, and the default "
11326 #: ../src/guestfs-actions.pod:4370 ../fish/guestfish-actions.pod:3379
11328 "About the only time when you would want to disable this is if the main "
11329 "process will fork itself into the background (\"daemonize\" itself). In "
11330 "this case the recovery process thinks that the main program has disappeared "
11331 "and so kills qemu, which is not very helpful."
11335 #: ../src/guestfs-actions.pod:4378
11336 msgid "guestfs_set_selinux"
11340 #: ../src/guestfs-actions.pod:4380
11343 " int guestfs_set_selinux (guestfs_h *g,\n"
11344 "\t\tint selinux);\n"
11349 #: ../src/guestfs-actions.pod:4383 ../fish/guestfish-actions.pod:3389
11351 "This sets the selinux flag that is passed to the appliance at boot time. "
11352 "The default is C<selinux=0> (disabled)."
11356 #: ../src/guestfs-actions.pod:4386 ../fish/guestfish-actions.pod:3392
11358 "Note that if SELinux is enabled, it is always in Permissive mode "
11359 "(C<enforcing=0>)."
11363 #: ../src/guestfs-actions.pod:4394
11364 msgid "guestfs_set_trace"
11368 #: ../src/guestfs-actions.pod:4396
11371 " int guestfs_set_trace (guestfs_h *g,\n"
11372 "\t\tint trace);\n"
11377 #: ../src/guestfs-actions.pod:4399 ../fish/guestfish-actions.pod:3402
11379 "If the command trace flag is set to 1, then commands are printed on stderr "
11380 "before they are executed in a format which is very similar to the one used "
11381 "by guestfish. In other words, you can run a program with this enabled, and "
11382 "you will get out a script which you can feed to guestfish to perform the "
11383 "same set of actions."
11387 #: ../src/guestfs-actions.pod:4406 ../fish/guestfish-actions.pod:3409
11389 "If you want to trace C API calls into libguestfs (and other libraries) then "
11390 "possibly a better way is to use the external ltrace(1) command."
11394 #: ../src/guestfs-actions.pod:4410 ../fish/guestfish-actions.pod:3413
11396 "Command traces are disabled unless the environment variable "
11397 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
11401 #: ../src/guestfs-actions.pod:4415
11402 msgid "guestfs_set_verbose"
11406 #: ../src/guestfs-actions.pod:4417
11409 " int guestfs_set_verbose (guestfs_h *g,\n"
11410 "\t\tint verbose);\n"
11415 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:3420
11416 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
11420 #: ../src/guestfs-actions.pod:4422 ../fish/guestfish-actions.pod:3422
11422 "Verbose messages are disabled unless the environment variable "
11423 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
11427 #: ../src/guestfs-actions.pod:4427
11428 msgid "guestfs_setcon"
11432 #: ../src/guestfs-actions.pod:4429
11435 " int guestfs_setcon (guestfs_h *g,\n"
11436 "\t\tconst char *context);\n"
11441 #: ../src/guestfs-actions.pod:4432 ../fish/guestfish-actions.pod:3429
11443 "This sets the SELinux security context of the daemon to the string "
11448 #: ../src/guestfs-actions.pod:4435 ../fish/guestfish-actions.pod:3432
11449 msgid "See the documentation about SELINUX in L<guestfs(3)>."
11453 #: ../src/guestfs-actions.pod:4439
11454 msgid "guestfs_setxattr"
11458 #: ../src/guestfs-actions.pod:4441
11461 " int guestfs_setxattr (guestfs_h *g,\n"
11462 "\t\tconst char *xattr,\n"
11463 "\t\tconst char *val,\n"
11464 "\t\tint vallen,\n"
11465 "\t\tconst char *path);\n"
11470 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:3438
11472 "This call sets the extended attribute named C<xattr> of the file C<path> to "
11473 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
11477 #: ../src/guestfs-actions.pod:4451
11478 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
11482 #: ../src/guestfs-actions.pod:4455
11483 msgid "guestfs_sfdisk"
11487 #: ../src/guestfs-actions.pod:4457
11490 " int guestfs_sfdisk (guestfs_h *g,\n"
11491 "\t\tconst char *device,\n"
11494 "\t\tint sectors,\n"
11495 "\t\tchar *const *lines);\n"
11500 #: ../src/guestfs-actions.pod:4464 ../fish/guestfish-actions.pod:3448
11502 "This is a direct interface to the L<sfdisk(8)> program for creating "
11503 "partitions on block devices."
11507 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:3451
11508 msgid "C<device> should be a block device, for example C</dev/sda>."
11512 #: ../src/guestfs-actions.pod:4469 ../fish/guestfish-actions.pod:3453
11514 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
11515 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
11516 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
11517 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
11518 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
11519 "the kernel) cannot work out the right geometry and you will need to tell it."
11523 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3461
11525 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
11526 "refer to the L<sfdisk(8)> manpage."
11530 #: ../src/guestfs-actions.pod:4480 ../fish/guestfish-actions.pod:3464
11532 "To create a single partition occupying the whole disk, you would pass "
11533 "C<lines> as a single element list, when the single element being the string "
11538 #: ../src/guestfs-actions.pod:4484
11539 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
11543 #: ../src/guestfs-actions.pod:4492
11544 msgid "guestfs_sfdiskM"
11548 #: ../src/guestfs-actions.pod:4494
11551 " int guestfs_sfdiskM (guestfs_h *g,\n"
11552 "\t\tconst char *device,\n"
11553 "\t\tchar *const *lines);\n"
11558 #: ../src/guestfs-actions.pod:4498
11560 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
11561 "partition sizes are specified in megabytes only (rounded to the nearest "
11562 "cylinder) and you don't need to specify the cyls, heads and sectors "
11563 "parameters which were rarely if ever used anyway."
11567 #: ../src/guestfs-actions.pod:4504
11569 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
11570 "C<guestfs_part_disk>"
11574 #: ../src/guestfs-actions.pod:4512
11575 msgid "guestfs_sfdisk_N"
11579 #: ../src/guestfs-actions.pod:4514
11582 " int guestfs_sfdisk_N (guestfs_h *g,\n"
11583 "\t\tconst char *device,\n"
11584 "\t\tint partnum,\n"
11587 "\t\tint sectors,\n"
11588 "\t\tconst char *line);\n"
11593 #: ../src/guestfs-actions.pod:4522 ../fish/guestfish-actions.pod:3494
11595 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
11596 "(note: C<n> counts from 1)."
11600 #: ../src/guestfs-actions.pod:4525
11602 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
11603 "for the cyls/heads/sectors parameters."
11607 #: ../src/guestfs-actions.pod:4528
11608 msgid "See also: C<guestfs_part_add>"
11612 #: ../src/guestfs-actions.pod:4535
11613 msgid "guestfs_sfdisk_disk_geometry"
11617 #: ../src/guestfs-actions.pod:4537
11620 " char *guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
11621 "\t\tconst char *device);\n"
11626 #: ../src/guestfs-actions.pod:4540
11628 "This displays the disk geometry of C<device> read from the partition table. "
11629 "Especially in the case where the underlying block device has been resized, "
11630 "this can be different from the kernel's idea of the geometry (see "
11631 "C<guestfs_sfdisk_kernel_geometry>)."
11635 #: ../src/guestfs-actions.pod:4545 ../src/guestfs-actions.pod:4558 ../fish/guestfish-actions.pod:3514 ../fish/guestfish-actions.pod:3523
11636 msgid "The result is in human-readable format, and not designed to be parsed."
11640 #: ../src/guestfs-actions.pod:4551
11641 msgid "guestfs_sfdisk_kernel_geometry"
11645 #: ../src/guestfs-actions.pod:4553
11648 " char *guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
11649 "\t\tconst char *device);\n"
11654 #: ../src/guestfs-actions.pod:4556 ../fish/guestfish-actions.pod:3521
11655 msgid "This displays the kernel's idea of the geometry of C<device>."
11659 #: ../src/guestfs-actions.pod:4564
11660 msgid "guestfs_sfdisk_l"
11664 #: ../src/guestfs-actions.pod:4566
11667 " char *guestfs_sfdisk_l (guestfs_h *g,\n"
11668 "\t\tconst char *device);\n"
11673 #: ../src/guestfs-actions.pod:4569 ../fish/guestfish-actions.pod:3530
11675 "This displays the partition table on C<device>, in the human-readable output "
11676 "of the L<sfdisk(8)> command. It is not intended to be parsed."
11680 #: ../src/guestfs-actions.pod:4573
11681 msgid "See also: C<guestfs_part_list>"
11685 #: ../src/guestfs-actions.pod:4578
11690 #: ../src/guestfs-actions.pod:4580
11693 " char *guestfs_sh (guestfs_h *g,\n"
11694 "\t\tconst char *command);\n"
11699 #: ../src/guestfs-actions.pod:4583 ../fish/guestfish-actions.pod:3540
11701 "This call runs a command from the guest filesystem via the guest's "
11706 #: ../src/guestfs-actions.pod:4586
11707 msgid "This is like C<guestfs_command>, but passes the command to:"
11711 #: ../src/guestfs-actions.pod:4588 ../fish/guestfish-actions.pod:3545
11714 " /bin/sh -c \"command\"\n"
11719 #: ../src/guestfs-actions.pod:4590 ../fish/guestfish-actions.pod:3547
11721 "Depending on the guest's shell, this usually results in wildcards being "
11722 "expanded, shell expressions being interpolated and so on."
11726 #: ../src/guestfs-actions.pod:4594
11727 msgid "All the provisos about C<guestfs_command> apply to this call."
11731 #: ../src/guestfs-actions.pod:4599
11732 msgid "guestfs_sh_lines"
11736 #: ../src/guestfs-actions.pod:4601
11739 " char **guestfs_sh_lines (guestfs_h *g,\n"
11740 "\t\tconst char *command);\n"
11745 #: ../src/guestfs-actions.pod:4604
11747 "This is the same as C<guestfs_sh>, but splits the result into a list of "
11752 #: ../src/guestfs-actions.pod:4607
11753 msgid "See also: C<guestfs_command_lines>"
11757 #: ../src/guestfs-actions.pod:4613
11758 msgid "guestfs_sleep"
11762 #: ../src/guestfs-actions.pod:4615
11765 " int guestfs_sleep (guestfs_h *g,\n"
11771 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3566
11772 msgid "Sleep for C<secs> seconds."
11776 #: ../src/guestfs-actions.pod:4622 ../src/guestfs-structs.pod:109
11777 msgid "guestfs_stat"
11781 #: ../src/guestfs-actions.pod:4624
11784 " struct guestfs_stat *guestfs_stat (guestfs_h *g,\n"
11785 "\t\tconst char *path);\n"
11790 #: ../src/guestfs-actions.pod:4629 ../fish/guestfish-actions.pod:3574
11791 msgid "This is the same as the C<stat(2)> system call."
11795 #: ../src/guestfs-actions.pod:4635 ../src/guestfs-structs.pod:135
11796 msgid "guestfs_statvfs"
11800 #: ../src/guestfs-actions.pod:4637
11803 " struct guestfs_statvfs *guestfs_statvfs (guestfs_h *g,\n"
11804 "\t\tconst char *path);\n"
11809 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3580
11811 "Returns file system statistics for any mounted file system. C<path> should "
11812 "be a file or directory in the mounted file system (typically it is the mount "
11813 "point itself, but it doesn't need to be)."
11817 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3584
11818 msgid "This is the same as the C<statvfs(2)> system call."
11822 #: ../src/guestfs-actions.pod:4646
11824 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
11825 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
11829 #: ../src/guestfs-actions.pod:4650
11830 msgid "guestfs_strings"
11834 #: ../src/guestfs-actions.pod:4652
11837 " char **guestfs_strings (guestfs_h *g,\n"
11838 "\t\tconst char *path);\n"
11843 #: ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:3590
11845 "This runs the L<strings(1)> command on a file and returns the list of "
11846 "printable strings found."
11850 #: ../src/guestfs-actions.pod:4665
11851 msgid "guestfs_strings_e"
11855 #: ../src/guestfs-actions.pod:4667
11858 " char **guestfs_strings_e (guestfs_h *g,\n"
11859 "\t\tconst char *encoding,\n"
11860 "\t\tconst char *path);\n"
11865 #: ../src/guestfs-actions.pod:4671
11867 "This is like the C<guestfs_strings> command, but allows you to specify the "
11868 "encoding of strings that are looked for in the source file C<path>."
11872 #: ../src/guestfs-actions.pod:4675 ../fish/guestfish-actions.pod:3604
11873 msgid "Allowed encodings are:"
11877 #: ../src/guestfs-actions.pod:4679 ../fish/guestfish-actions.pod:3608
11882 #: ../src/guestfs-actions.pod:4681
11884 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
11885 "ISO-8859-X (this is what C<guestfs_strings> uses)."
11889 #: ../src/guestfs-actions.pod:4684 ../fish/guestfish-actions.pod:3613
11894 #: ../src/guestfs-actions.pod:4686 ../fish/guestfish-actions.pod:3615
11895 msgid "Single 8-bit-byte characters."
11899 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3617
11904 #: ../src/guestfs-actions.pod:4690 ../fish/guestfish-actions.pod:3619
11905 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
11909 #: ../src/guestfs-actions.pod:4693 ../fish/guestfish-actions.pod:3622
11910 msgid "l (lower case letter L)"
11914 #: ../src/guestfs-actions.pod:4695 ../fish/guestfish-actions.pod:3624
11916 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
11917 "examining binaries in Windows guests."
11921 #: ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3627
11926 #: ../src/guestfs-actions.pod:4700 ../fish/guestfish-actions.pod:3629
11927 msgid "32-bit big endian such as UCS-4BE."
11931 #: ../src/guestfs-actions.pod:4702 ../fish/guestfish-actions.pod:3631
11936 #: ../src/guestfs-actions.pod:4704 ../fish/guestfish-actions.pod:3633
11937 msgid "32-bit little endian such as UCS-4LE."
11941 #: ../src/guestfs-actions.pod:4708 ../fish/guestfish-actions.pod:3637
11942 msgid "The returned strings are transcoded to UTF-8."
11946 #: ../src/guestfs-actions.pod:4717
11947 msgid "guestfs_swapoff_device"
11951 #: ../src/guestfs-actions.pod:4719
11954 " int guestfs_swapoff_device (guestfs_h *g,\n"
11955 "\t\tconst char *device);\n"
11960 #: ../src/guestfs-actions.pod:4722
11962 "This command disables the libguestfs appliance swap device or partition "
11963 "named C<device>. See C<guestfs_swapon_device>."
11967 #: ../src/guestfs-actions.pod:4728
11968 msgid "guestfs_swapoff_file"
11972 #: ../src/guestfs-actions.pod:4730
11975 " int guestfs_swapoff_file (guestfs_h *g,\n"
11976 "\t\tconst char *file);\n"
11981 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3654
11982 msgid "This command disables the libguestfs appliance swap on file."
11986 #: ../src/guestfs-actions.pod:4737
11987 msgid "guestfs_swapoff_label"
11991 #: ../src/guestfs-actions.pod:4739
11994 " int guestfs_swapoff_label (guestfs_h *g,\n"
11995 "\t\tconst char *label);\n"
12000 #: ../src/guestfs-actions.pod:4742 ../fish/guestfish-actions.pod:3660
12002 "This command disables the libguestfs appliance swap on labeled swap "
12007 #: ../src/guestfs-actions.pod:4747
12008 msgid "guestfs_swapoff_uuid"
12012 #: ../src/guestfs-actions.pod:4749
12015 " int guestfs_swapoff_uuid (guestfs_h *g,\n"
12016 "\t\tconst char *uuid);\n"
12021 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3667
12023 "This command disables the libguestfs appliance swap partition with the given "
12028 #: ../src/guestfs-actions.pod:4757
12029 msgid "guestfs_swapon_device"
12033 #: ../src/guestfs-actions.pod:4759
12036 " int guestfs_swapon_device (guestfs_h *g,\n"
12037 "\t\tconst char *device);\n"
12042 #: ../src/guestfs-actions.pod:4762
12044 "This command enables the libguestfs appliance to use the swap device or "
12045 "partition named C<device>. The increased memory is made available for all "
12046 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
12050 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3679
12052 "Note that you should not swap to existing guest swap partitions unless you "
12053 "know what you are doing. They may contain hibernation information, or other "
12054 "information that the guest doesn't want you to trash. You also risk leaking "
12055 "information about the host to the guest this way. Instead, attach a new "
12056 "host device to the guest and swap on that."
12060 #: ../src/guestfs-actions.pod:4776
12061 msgid "guestfs_swapon_file"
12065 #: ../src/guestfs-actions.pod:4778
12068 " int guestfs_swapon_file (guestfs_h *g,\n"
12069 "\t\tconst char *file);\n"
12074 #: ../src/guestfs-actions.pod:4781
12076 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
12081 #: ../src/guestfs-actions.pod:4786
12082 msgid "guestfs_swapon_label"
12086 #: ../src/guestfs-actions.pod:4788
12089 " int guestfs_swapon_label (guestfs_h *g,\n"
12090 "\t\tconst char *label);\n"
12095 #: ../src/guestfs-actions.pod:4791
12097 "This command enables swap to a labeled swap partition. See "
12098 "C<guestfs_swapon_device> for other notes."
12102 #: ../src/guestfs-actions.pod:4796
12103 msgid "guestfs_swapon_uuid"
12107 #: ../src/guestfs-actions.pod:4798
12110 " int guestfs_swapon_uuid (guestfs_h *g,\n"
12111 "\t\tconst char *uuid);\n"
12116 #: ../src/guestfs-actions.pod:4801
12118 "This command enables swap to a swap partition with the given UUID. See "
12119 "C<guestfs_swapon_device> for other notes."
12123 #: ../src/guestfs-actions.pod:4806
12124 msgid "guestfs_sync"
12128 #: ../src/guestfs-actions.pod:4808
12131 " int guestfs_sync (guestfs_h *g);\n"
12136 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3711
12138 "This syncs the disk, so that any writes are flushed through to the "
12139 "underlying disk image."
12143 #: ../src/guestfs-actions.pod:4813 ../fish/guestfish-actions.pod:3714
12145 "You should always call this if you have modified a disk image, before "
12146 "closing the handle."
12150 #: ../src/guestfs-actions.pod:4818
12151 msgid "guestfs_tail"
12155 #: ../src/guestfs-actions.pod:4820
12158 " char **guestfs_tail (guestfs_h *g,\n"
12159 "\t\tconst char *path);\n"
12164 #: ../src/guestfs-actions.pod:4823 ../fish/guestfish-actions.pod:3721
12165 msgid "This command returns up to the last 10 lines of a file as a list of strings."
12169 #: ../src/guestfs-actions.pod:4833
12170 msgid "guestfs_tail_n"
12174 #: ../src/guestfs-actions.pod:4835
12177 " char **guestfs_tail_n (guestfs_h *g,\n"
12178 "\t\tint nrlines,\n"
12179 "\t\tconst char *path);\n"
12184 #: ../src/guestfs-actions.pod:4839 ../fish/guestfish-actions.pod:3731
12186 "If the parameter C<nrlines> is a positive number, this returns the last "
12187 "C<nrlines> lines of the file C<path>."
12191 #: ../src/guestfs-actions.pod:4842 ../fish/guestfish-actions.pod:3734
12193 "If the parameter C<nrlines> is a negative number, this returns lines from "
12194 "the file C<path>, starting with the C<-nrlines>th line."
12198 #: ../src/guestfs-actions.pod:4854
12199 msgid "guestfs_tar_in"
12203 #: ../src/guestfs-actions.pod:4856
12206 " int guestfs_tar_in (guestfs_h *g,\n"
12207 "\t\tconst char *tarfile,\n"
12208 "\t\tconst char *directory);\n"
12213 #: ../src/guestfs-actions.pod:4860 ../fish/guestfish-actions.pod:3746
12215 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
12216 "tar file) into C<directory>."
12220 #: ../src/guestfs-actions.pod:4863
12221 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
12225 #: ../src/guestfs-actions.pod:4868
12226 msgid "guestfs_tar_out"
12230 #: ../src/guestfs-actions.pod:4870
12233 " int guestfs_tar_out (guestfs_h *g,\n"
12234 "\t\tconst char *directory,\n"
12235 "\t\tconst char *tarfile);\n"
12240 #: ../src/guestfs-actions.pod:4874 ../fish/guestfish-actions.pod:3758
12242 "This command packs the contents of C<directory> and downloads it to local "
12247 #: ../src/guestfs-actions.pod:4877
12249 "To download a compressed tarball, use C<guestfs_tgz_out> or "
12250 "C<guestfs_txz_out>."
12254 #: ../src/guestfs-actions.pod:4882
12255 msgid "guestfs_tgz_in"
12259 #: ../src/guestfs-actions.pod:4884
12262 " int guestfs_tgz_in (guestfs_h *g,\n"
12263 "\t\tconst char *tarball,\n"
12264 "\t\tconst char *directory);\n"
12269 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3770
12271 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
12272 "tar file) into C<directory>."
12276 #: ../src/guestfs-actions.pod:4891
12277 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
12281 #: ../src/guestfs-actions.pod:4895
12282 msgid "guestfs_tgz_out"
12286 #: ../src/guestfs-actions.pod:4897
12289 " int guestfs_tgz_out (guestfs_h *g,\n"
12290 "\t\tconst char *directory,\n"
12291 "\t\tconst char *tarball);\n"
12296 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3781
12298 "This command packs the contents of C<directory> and downloads it to local "
12303 #: ../src/guestfs-actions.pod:4904
12304 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
12308 #: ../src/guestfs-actions.pod:4908
12309 msgid "guestfs_touch"
12313 #: ../src/guestfs-actions.pod:4910
12316 " int guestfs_touch (guestfs_h *g,\n"
12317 "\t\tconst char *path);\n"
12322 #: ../src/guestfs-actions.pod:4913 ../fish/guestfish-actions.pod:3792
12324 "Touch acts like the L<touch(1)> command. It can be used to update the "
12325 "timestamps on a file, or, if the file does not exist, to create a new "
12326 "zero-length file."
12330 #: ../src/guestfs-actions.pod:4917 ../fish/guestfish-actions.pod:3796
12332 "This command only works on regular files, and will fail on other file types "
12333 "such as directories, symbolic links, block special etc."
12337 #: ../src/guestfs-actions.pod:4922
12338 msgid "guestfs_truncate"
12342 #: ../src/guestfs-actions.pod:4924
12345 " int guestfs_truncate (guestfs_h *g,\n"
12346 "\t\tconst char *path);\n"
12351 #: ../src/guestfs-actions.pod:4927 ../fish/guestfish-actions.pod:3803
12353 "This command truncates C<path> to a zero-length file. The file must exist "
12358 #: ../src/guestfs-actions.pod:4932
12359 msgid "guestfs_truncate_size"
12363 #: ../src/guestfs-actions.pod:4934
12366 " int guestfs_truncate_size (guestfs_h *g,\n"
12367 "\t\tconst char *path,\n"
12368 "\t\tint64_t size);\n"
12373 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3810
12375 "This command truncates C<path> to size C<size> bytes. The file must exist "
12380 #: ../src/guestfs-actions.pod:4941
12382 "If the current file size is less than C<size> then the file is extended to "
12383 "the required size with zero bytes. This creates a sparse file (ie. disk "
12384 "blocks are not allocated for the file until you write to it). To create a "
12385 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
12389 #: ../src/guestfs-actions.pod:4949
12390 msgid "guestfs_tune2fs_l"
12394 #: ../src/guestfs-actions.pod:4951
12397 " char **guestfs_tune2fs_l (guestfs_h *g,\n"
12398 "\t\tconst char *device);\n"
12403 #: ../src/guestfs-actions.pod:4954 ../fish/guestfish-actions.pod:3823
12405 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
12410 #: ../src/guestfs-actions.pod:4957 ../fish/guestfish-actions.pod:3826
12412 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
12413 "for more details. The list of fields returned isn't clearly defined, and "
12414 "depends on both the version of C<tune2fs> that libguestfs was built against, "
12415 "and the filesystem itself."
12419 #: ../src/guestfs-actions.pod:4968
12420 msgid "guestfs_txz_in"
12424 #: ../src/guestfs-actions.pod:4970
12427 " int guestfs_txz_in (guestfs_h *g,\n"
12428 "\t\tconst char *tarball,\n"
12429 "\t\tconst char *directory);\n"
12434 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3835
12436 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
12437 "tar file) into C<directory>."
12441 #: ../src/guestfs-actions.pod:4979
12442 msgid "guestfs_txz_out"
12446 #: ../src/guestfs-actions.pod:4981
12449 " int guestfs_txz_out (guestfs_h *g,\n"
12450 "\t\tconst char *directory,\n"
12451 "\t\tconst char *tarball);\n"
12456 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3844
12458 "This command packs the contents of C<directory> and downloads it to local "
12459 "file C<tarball> (as an xz compressed tar archive)."
12463 #: ../src/guestfs-actions.pod:4990
12464 msgid "guestfs_umask"
12468 #: ../src/guestfs-actions.pod:4992
12471 " int guestfs_umask (guestfs_h *g,\n"
12477 #: ../src/guestfs-actions.pod:4995 ../fish/guestfish-actions.pod:3853
12479 "This function sets the mask used for creating new files and device nodes to "
12484 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3856
12486 "Typical umask values would be C<022> which creates new files with "
12487 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
12488 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
12492 #: ../src/guestfs-actions.pod:5003 ../fish/guestfish-actions.pod:3861
12494 "The default umask is C<022>. This is important because it means that "
12495 "directories and device nodes will be created with C<0644> or C<0755> mode "
12496 "even if you specify C<0777>."
12500 #: ../src/guestfs-actions.pod:5007
12502 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
12503 "C<guestfs_mkdir>."
12507 #: ../src/guestfs-actions.pod:5010 ../fish/guestfish-actions.pod:3868
12508 msgid "This call returns the previous umask."
12512 #: ../src/guestfs-actions.pod:5014
12513 msgid "guestfs_umount"
12517 #: ../src/guestfs-actions.pod:5016
12520 " int guestfs_umount (guestfs_h *g,\n"
12521 "\t\tconst char *pathordevice);\n"
12526 #: ../src/guestfs-actions.pod:5019 ../fish/guestfish-actions.pod:3874
12528 "This unmounts the given filesystem. The filesystem may be specified either "
12529 "by its mountpoint (path) or the device which contains the filesystem."
12533 #: ../src/guestfs-actions.pod:5025
12534 msgid "guestfs_umount_all"
12538 #: ../src/guestfs-actions.pod:5027
12541 " int guestfs_umount_all (guestfs_h *g);\n"
12546 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3882
12547 msgid "This unmounts all mounted filesystems."
12551 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3884
12552 msgid "Some internal mounts are not unmounted by this call."
12556 #: ../src/guestfs-actions.pod:5035
12557 msgid "guestfs_upload"
12561 #: ../src/guestfs-actions.pod:5037
12564 " int guestfs_upload (guestfs_h *g,\n"
12565 "\t\tconst char *filename,\n"
12566 "\t\tconst char *remotefilename);\n"
12571 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3890
12572 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
12576 #: ../src/guestfs-actions.pod:5046
12577 msgid "See also C<guestfs_download>."
12581 #: ../src/guestfs-actions.pod:5050
12582 msgid "guestfs_utimens"
12586 #: ../src/guestfs-actions.pod:5052
12589 " int guestfs_utimens (guestfs_h *g,\n"
12590 "\t\tconst char *path,\n"
12591 "\t\tint64_t atsecs,\n"
12592 "\t\tint64_t atnsecs,\n"
12593 "\t\tint64_t mtsecs,\n"
12594 "\t\tint64_t mtnsecs);\n"
12599 #: ../src/guestfs-actions.pod:5059 ../fish/guestfish-actions.pod:3903
12600 msgid "This command sets the timestamps of a file with nanosecond precision."
12604 #: ../src/guestfs-actions.pod:5062 ../fish/guestfish-actions.pod:3906
12606 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
12611 #: ../src/guestfs-actions.pod:5065 ../fish/guestfish-actions.pod:3909
12613 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
12614 "nanoseconds from the epoch."
12618 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3912
12620 "If the C<*nsecs> field contains the special value C<-1> then the "
12621 "corresponding timestamp is set to the current time. (The C<*secs> field is "
12622 "ignored in this case)."
12626 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3916
12628 "If the C<*nsecs> field contains the special value C<-2> then the "
12629 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
12634 #: ../src/guestfs-actions.pod:5078 ../src/guestfs-structs.pod:175
12635 msgid "guestfs_version"
12639 #: ../src/guestfs-actions.pod:5080
12642 " struct guestfs_version *guestfs_version (guestfs_h *g);\n"
12647 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3924
12648 msgid "Return the libguestfs version number that the program is linked against."
12652 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3927
12654 "Note that because of dynamic linking this is not necessarily the version of "
12655 "libguestfs that you compiled against. You can compile the program, and then "
12656 "at runtime dynamically link against a completely different C<libguestfs.so> "
12661 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3932
12663 "This call was added in version C<1.0.58>. In previous versions of "
12664 "libguestfs there was no way to get the version number. From C code you can "
12665 "use dynamic linker functions to find out if this symbol exists (if it "
12666 "doesn't, then it's an earlier version)."
12670 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3938
12672 "The call returns a structure with four elements. The first three (C<major>, "
12673 "C<minor> and C<release>) are numbers and correspond to the usual version "
12674 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
12675 "but may be used for distro-specific information."
12679 #: ../src/guestfs-actions.pod:5102 ../fish/guestfish-actions.pod:3944
12680 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
12684 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3947
12685 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
12689 #: ../src/guestfs-actions.pod:5107
12691 "I<Note:> Don't use this call to test for availability of features. In "
12692 "enterprise distributions we backport features from later versions into "
12693 "earlier versions, making this an unreliable way to test for features. Use "
12694 "C<guestfs_available> instead."
12698 #: ../src/guestfs-actions.pod:5113
12700 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
12701 "error. I<The caller must call C<guestfs_free_version> after use>."
12705 #: ../src/guestfs-actions.pod:5117
12706 msgid "guestfs_vfs_label"
12710 #: ../src/guestfs-actions.pod:5119
12713 " char *guestfs_vfs_label (guestfs_h *g,\n"
12714 "\t\tconst char *device);\n"
12719 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3959
12720 msgid "This returns the filesystem label of the filesystem on C<device>."
12724 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3962
12725 msgid "If the filesystem is unlabeled, this returns the empty string."
12729 #: ../src/guestfs-actions.pod:5127
12730 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
12734 #: ../src/guestfs-actions.pod:5132
12735 msgid "guestfs_vfs_type"
12739 #: ../src/guestfs-actions.pod:5134
12742 " char *guestfs_vfs_type (guestfs_h *g,\n"
12743 "\t\tconst char *device);\n"
12748 #: ../src/guestfs-actions.pod:5137 ../fish/guestfish-actions.pod:3970
12750 "This command gets the filesystem type corresponding to the filesystem on "
12755 #: ../src/guestfs-actions.pod:5140 ../fish/guestfish-actions.pod:3973
12757 "For most filesystems, the result is the name of the Linux VFS module which "
12758 "would be used to mount this filesystem if you mounted it without specifying "
12759 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
12763 #: ../src/guestfs-actions.pod:5148
12764 msgid "guestfs_vfs_uuid"
12768 #: ../src/guestfs-actions.pod:5150
12771 " char *guestfs_vfs_uuid (guestfs_h *g,\n"
12772 "\t\tconst char *device);\n"
12777 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3982
12778 msgid "This returns the filesystem UUID of the filesystem on C<device>."
12782 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:3985
12783 msgid "If the filesystem does not have a UUID, this returns the empty string."
12787 #: ../src/guestfs-actions.pod:5158
12788 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
12792 #: ../src/guestfs-actions.pod:5163
12793 msgid "guestfs_vg_activate"
12797 #: ../src/guestfs-actions.pod:5165
12800 " int guestfs_vg_activate (guestfs_h *g,\n"
12801 "\t\tint activate,\n"
12802 "\t\tchar *const *volgroups);\n"
12807 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:3993
12809 "This command activates or (if C<activate> is false) deactivates all logical "
12810 "volumes in the listed volume groups C<volgroups>. If activated, then they "
12811 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
12812 "deactivated, then those devices disappear."
12816 #: ../src/guestfs-actions.pod:5175 ../fish/guestfish-actions.pod:3999
12817 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
12821 #: ../src/guestfs-actions.pod:5177 ../fish/guestfish-actions.pod:4001
12823 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
12824 "activated or deactivated."
12828 #: ../src/guestfs-actions.pod:5182
12829 msgid "guestfs_vg_activate_all"
12833 #: ../src/guestfs-actions.pod:5184
12836 " int guestfs_vg_activate_all (guestfs_h *g,\n"
12837 "\t\tint activate);\n"
12842 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:4008
12844 "This command activates or (if C<activate> is false) deactivates all logical "
12845 "volumes in all volume groups. If activated, then they are made known to the "
12846 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
12847 "those devices disappear."
12851 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:4014
12852 msgid "This command is the same as running C<vgchange -a y|n>"
12856 #: ../src/guestfs-actions.pod:5197
12857 msgid "guestfs_vgcreate"
12861 #: ../src/guestfs-actions.pod:5199
12864 " int guestfs_vgcreate (guestfs_h *g,\n"
12865 "\t\tconst char *volgroup,\n"
12866 "\t\tchar *const *physvols);\n"
12871 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:4020
12873 "This creates an LVM volume group called C<volgroup> from the non-empty list "
12874 "of physical volumes C<physvols>."
12878 #: ../src/guestfs-actions.pod:5208
12879 msgid "guestfs_vglvuuids"
12883 #: ../src/guestfs-actions.pod:5210
12886 " char **guestfs_vglvuuids (guestfs_h *g,\n"
12887 "\t\tconst char *vgname);\n"
12892 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:4027
12894 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
12895 "volumes created in this volume group."
12899 #: ../src/guestfs-actions.pod:5216
12901 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
12902 "associate logical volumes and volume groups."
12906 #: ../src/guestfs-actions.pod:5219
12907 msgid "See also C<guestfs_vgpvuuids>."
12911 #: ../src/guestfs-actions.pod:5225
12912 msgid "guestfs_vgpvuuids"
12916 #: ../src/guestfs-actions.pod:5227
12919 " char **guestfs_vgpvuuids (guestfs_h *g,\n"
12920 "\t\tconst char *vgname);\n"
12925 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:4039
12927 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
12928 "volumes that this volume group resides on."
12932 #: ../src/guestfs-actions.pod:5233
12934 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
12935 "associate physical volumes and volume groups."
12939 #: ../src/guestfs-actions.pod:5236
12940 msgid "See also C<guestfs_vglvuuids>."
12944 #: ../src/guestfs-actions.pod:5242
12945 msgid "guestfs_vgremove"
12949 #: ../src/guestfs-actions.pod:5244
12952 " int guestfs_vgremove (guestfs_h *g,\n"
12953 "\t\tconst char *vgname);\n"
12958 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:4051
12959 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
12963 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:4053
12964 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
12968 #: ../src/guestfs-actions.pod:5254
12969 msgid "guestfs_vgrename"
12973 #: ../src/guestfs-actions.pod:5256
12976 " int guestfs_vgrename (guestfs_h *g,\n"
12977 "\t\tconst char *volgroup,\n"
12978 "\t\tconst char *newvolgroup);\n"
12983 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:4060
12984 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
12988 #: ../src/guestfs-actions.pod:5264
12989 msgid "guestfs_vgs"
12993 #: ../src/guestfs-actions.pod:5266
12996 " char **guestfs_vgs (guestfs_h *g);\n"
13001 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:4066
13003 "List all the volumes groups detected. This is the equivalent of the "
13004 "L<vgs(8)> command."
13008 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:4069
13010 "This returns a list of just the volume group names that were detected "
13011 "(eg. C<VolGroup00>)."
13015 #: ../src/guestfs-actions.pod:5274
13016 msgid "See also C<guestfs_vgs_full>."
13020 #: ../src/guestfs-actions.pod:5280
13021 msgid "guestfs_vgs_full"
13025 #: ../src/guestfs-actions.pod:5282
13028 " struct guestfs_lvm_vg_list *guestfs_vgs_full (guestfs_h *g);\n"
13033 #: ../src/guestfs-actions.pod:5284 ../fish/guestfish-actions.pod:4078
13035 "List all the volumes groups detected. This is the equivalent of the "
13036 "L<vgs(8)> command. The \"full\" version includes all fields."
13040 #: ../src/guestfs-actions.pod:5287
13042 "This function returns a C<struct guestfs_lvm_vg_list *> (see "
13043 "E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller "
13044 "must call C<guestfs_free_lvm_vg_list> after use>."
13048 #: ../src/guestfs-actions.pod:5292
13049 msgid "guestfs_vgscan"
13053 #: ../src/guestfs-actions.pod:5294
13056 " int guestfs_vgscan (guestfs_h *g);\n"
13061 #: ../src/guestfs-actions.pod:5296 ../fish/guestfish-actions.pod:4085
13063 "This rescans all block devices and rebuilds the list of LVM physical "
13064 "volumes, volume groups and logical volumes."
13068 #: ../src/guestfs-actions.pod:5301
13069 msgid "guestfs_vguuid"
13073 #: ../src/guestfs-actions.pod:5303
13076 " char *guestfs_vguuid (guestfs_h *g,\n"
13077 "\t\tconst char *vgname);\n"
13082 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:4092
13083 msgid "This command returns the UUID of the LVM VG named C<vgname>."
13087 #: ../src/guestfs-actions.pod:5311
13088 msgid "guestfs_wait_ready"
13092 #: ../src/guestfs-actions.pod:5313
13095 " int guestfs_wait_ready (guestfs_h *g);\n"
13100 #: ../src/guestfs-actions.pod:5315
13101 msgid "This function is a no op."
13105 #: ../src/guestfs-actions.pod:5317
13107 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
13108 "calling C<guestfs_launch> to wait for the launch to complete. However this "
13109 "is no longer necessary because C<guestfs_launch> now does the waiting."
13113 #: ../src/guestfs-actions.pod:5322
13115 "If you see any calls to this function in code then you can just remove them, "
13116 "unless you want to retain compatibility with older versions of the API."
13120 #: ../src/guestfs-actions.pod:5328
13121 msgid "guestfs_wc_c"
13125 #: ../src/guestfs-actions.pod:5330
13128 " int guestfs_wc_c (guestfs_h *g,\n"
13129 "\t\tconst char *path);\n"
13134 #: ../src/guestfs-actions.pod:5333 ../fish/guestfish-actions.pod:4098
13136 "This command counts the characters in a file, using the C<wc -c> external "
13141 #: ../src/guestfs-actions.pod:5338
13142 msgid "guestfs_wc_l"
13146 #: ../src/guestfs-actions.pod:5340
13149 " int guestfs_wc_l (guestfs_h *g,\n"
13150 "\t\tconst char *path);\n"
13155 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:4105
13157 "This command counts the lines in a file, using the C<wc -l> external "
13162 #: ../src/guestfs-actions.pod:5348
13163 msgid "guestfs_wc_w"
13167 #: ../src/guestfs-actions.pod:5350
13170 " int guestfs_wc_w (guestfs_h *g,\n"
13171 "\t\tconst char *path);\n"
13176 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:4112
13178 "This command counts the words in a file, using the C<wc -w> external "
13183 #: ../src/guestfs-actions.pod:5358
13184 msgid "guestfs_write"
13188 #: ../src/guestfs-actions.pod:5360
13191 " int guestfs_write (guestfs_h *g,\n"
13192 "\t\tconst char *path,\n"
13193 "\t\tconst char *content,\n"
13194 "\t\tsize_t content_size);\n"
13199 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:4119
13201 "This call creates a file called C<path>. The content of the file is the "
13202 "string C<content> (which can contain any 8 bit data)."
13206 #: ../src/guestfs-actions.pod:5373
13207 msgid "guestfs_write_file"
13211 #: ../src/guestfs-actions.pod:5375
13214 " int guestfs_write_file (guestfs_h *g,\n"
13215 "\t\tconst char *path,\n"
13216 "\t\tconst char *content,\n"
13222 #: ../src/guestfs-actions.pod:5380 ../fish/guestfish-actions.pod:4129
13224 "This call creates a file called C<path>. The contents of the file is the "
13225 "string C<content> (which can contain any 8 bit data), with length C<size>."
13229 #: ../src/guestfs-actions.pod:5384 ../fish/guestfish-actions.pod:4133
13231 "As a special case, if C<size> is C<0> then the length is calculated using "
13232 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
13236 #: ../src/guestfs-actions.pod:5388 ../fish/guestfish-actions.pod:4137
13238 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
13239 "I<not> work, even if the length is specified."
13243 #: ../src/guestfs-actions.pod:5396 ../fish/guestfish-actions.pod:4143
13244 msgid "This function is deprecated. In new code, use the C<write> call instead."
13248 #: ../src/guestfs-actions.pod:5403
13249 msgid "guestfs_zegrep"
13253 #: ../src/guestfs-actions.pod:5405
13256 " char **guestfs_zegrep (guestfs_h *g,\n"
13257 "\t\tconst char *regex,\n"
13258 "\t\tconst char *path);\n"
13263 #: ../src/guestfs-actions.pod:5409 ../fish/guestfish-actions.pod:4154
13264 msgid "This calls the external C<zegrep> program and returns the matching lines."
13268 #: ../src/guestfs-actions.pod:5419
13269 msgid "guestfs_zegrepi"
13273 #: ../src/guestfs-actions.pod:5421
13276 " char **guestfs_zegrepi (guestfs_h *g,\n"
13277 "\t\tconst char *regex,\n"
13278 "\t\tconst char *path);\n"
13283 #: ../src/guestfs-actions.pod:5425 ../fish/guestfish-actions.pod:4164
13284 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
13288 #: ../src/guestfs-actions.pod:5435
13289 msgid "guestfs_zero"
13293 #: ../src/guestfs-actions.pod:5437
13296 " int guestfs_zero (guestfs_h *g,\n"
13297 "\t\tconst char *device);\n"
13302 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:4174
13303 msgid "This command writes zeroes over the first few blocks of C<device>."
13307 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:4176
13309 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
13310 "securely wipe the device). It should be sufficient to remove any partition "
13311 "tables, filesystem superblocks and so on."
13315 #: ../src/guestfs-actions.pod:5446
13316 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
13320 #: ../src/guestfs-actions.pod:5455
13321 msgid "guestfs_zero_device"
13325 #: ../src/guestfs-actions.pod:5457
13328 " int guestfs_zero_device (guestfs_h *g,\n"
13329 "\t\tconst char *device);\n"
13334 #: ../src/guestfs-actions.pod:5460
13336 "This command writes zeroes over the entire C<device>. Compare with "
13337 "C<guestfs_zero> which just zeroes the first few blocks of a device."
13341 #: ../src/guestfs-actions.pod:5474
13342 msgid "guestfs_zerofree"
13346 #: ../src/guestfs-actions.pod:5476
13349 " int guestfs_zerofree (guestfs_h *g,\n"
13350 "\t\tconst char *device);\n"
13355 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:4197
13357 "This runs the I<zerofree> program on C<device>. This program claims to zero "
13358 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
13359 "possible to compress the filesystem more effectively."
13363 #: ../src/guestfs-actions.pod:5484 ../fish/guestfish-actions.pod:4202
13364 msgid "You should B<not> run this program if the filesystem is mounted."
13368 #: ../src/guestfs-actions.pod:5487 ../fish/guestfish-actions.pod:4205
13370 "It is possible that using this program can damage the filesystem or data on "
13375 #: ../src/guestfs-actions.pod:5492
13376 msgid "guestfs_zfgrep"
13380 #: ../src/guestfs-actions.pod:5494
13383 " char **guestfs_zfgrep (guestfs_h *g,\n"
13384 "\t\tconst char *pattern,\n"
13385 "\t\tconst char *path);\n"
13390 #: ../src/guestfs-actions.pod:5498 ../fish/guestfish-actions.pod:4212
13391 msgid "This calls the external C<zfgrep> program and returns the matching lines."
13395 #: ../src/guestfs-actions.pod:5508
13396 msgid "guestfs_zfgrepi"
13400 #: ../src/guestfs-actions.pod:5510
13403 " char **guestfs_zfgrepi (guestfs_h *g,\n"
13404 "\t\tconst char *pattern,\n"
13405 "\t\tconst char *path);\n"
13410 #: ../src/guestfs-actions.pod:5514 ../fish/guestfish-actions.pod:4222
13411 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
13415 #: ../src/guestfs-actions.pod:5524
13416 msgid "guestfs_zfile"
13420 #: ../src/guestfs-actions.pod:5526
13423 " char *guestfs_zfile (guestfs_h *g,\n"
13424 "\t\tconst char *meth,\n"
13425 "\t\tconst char *path);\n"
13430 #: ../src/guestfs-actions.pod:5530 ../fish/guestfish-actions.pod:4232
13431 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
13435 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:4235
13436 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
13440 #: ../src/guestfs-actions.pod:5535
13442 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
13447 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:4240
13448 msgid "This function is deprecated. In new code, use the C<file> call instead."
13452 #: ../src/guestfs-actions.pod:5548
13453 msgid "guestfs_zgrep"
13457 #: ../src/guestfs-actions.pod:5550
13460 " char **guestfs_zgrep (guestfs_h *g,\n"
13461 "\t\tconst char *regex,\n"
13462 "\t\tconst char *path);\n"
13467 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:4251
13468 msgid "This calls the external C<zgrep> program and returns the matching lines."
13472 #: ../src/guestfs-actions.pod:5564
13473 msgid "guestfs_zgrepi"
13477 #: ../src/guestfs-actions.pod:5566
13480 " char **guestfs_zgrepi (guestfs_h *g,\n"
13481 "\t\tconst char *regex,\n"
13482 "\t\tconst char *path);\n"
13487 #: ../src/guestfs-actions.pod:5570 ../fish/guestfish-actions.pod:4261
13488 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
13492 #: ../src/guestfs-availability.pod:3
13497 #: ../src/guestfs-availability.pod:5
13499 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
13500 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
13501 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
13502 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
13503 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
13507 #: ../src/guestfs-availability.pod:21
13512 #: ../src/guestfs-availability.pod:23
13514 "The following functions: L</guestfs_inotify_add_watch> "
13515 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
13516 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
13520 #: ../src/guestfs-availability.pod:31
13521 msgid "B<linuxfsuuid>"
13525 #: ../src/guestfs-availability.pod:33
13527 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
13528 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
13532 #: ../src/guestfs-availability.pod:40
13533 msgid "B<linuxmodules>"
13537 #: ../src/guestfs-availability.pod:42
13538 msgid "The following functions: L</guestfs_modprobe>"
13542 #: ../src/guestfs-availability.pod:45
13543 msgid "B<linuxxattrs>"
13547 #: ../src/guestfs-availability.pod:47
13549 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> "
13550 "L</guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> "
13551 "L</guestfs_removexattr> L</guestfs_setxattr>"
13555 #: ../src/guestfs-availability.pod:56
13560 #: ../src/guestfs-availability.pod:58
13562 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
13563 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
13564 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
13568 #: ../src/guestfs-availability.pod:67
13573 #: ../src/guestfs-availability.pod:69
13575 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
13576 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
13577 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
13578 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
13579 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
13580 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
13581 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
13582 "L</guestfs_vgs_full>"
13586 #: ../src/guestfs-availability.pod:92
13591 #: ../src/guestfs-availability.pod:94
13593 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
13594 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
13598 #: ../src/guestfs-availability.pod:100
13603 #: ../src/guestfs-availability.pod:102
13604 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
13608 #: ../src/guestfs-availability.pod:105
13609 msgid "B<ntfsprogs>"
13613 #: ../src/guestfs-availability.pod:107
13614 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
13618 #: ../src/guestfs-availability.pod:111
13619 msgid "B<realpath>"
13623 #: ../src/guestfs-availability.pod:113
13624 msgid "The following functions: L</guestfs_realpath>"
13628 #: ../src/guestfs-availability.pod:116
13633 #: ../src/guestfs-availability.pod:118
13635 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
13636 "L</guestfs_scrub_freespace>"
13640 #: ../src/guestfs-availability.pod:123
13645 #: ../src/guestfs-availability.pod:125
13646 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
13650 #: ../src/guestfs-availability.pod:129
13655 #: ../src/guestfs-availability.pod:131
13656 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
13660 #: ../src/guestfs-availability.pod:135
13661 msgid "B<zerofree>"
13665 #: ../src/guestfs-availability.pod:137
13666 msgid "The following functions: L</guestfs_zerofree>"
13670 #: ../src/guestfs-structs.pod:1
13671 msgid "guestfs_int_bool"
13675 #: ../src/guestfs-structs.pod:3
13678 " struct guestfs_int_bool {\n"
13686 #: ../src/guestfs-structs.pod:8
13689 " struct guestfs_int_bool_list {\n"
13690 " uint32_t len; /* Number of elements in list. */\n"
13691 " struct guestfs_int_bool *val; /* Elements. */\n"
13697 #: ../src/guestfs-structs.pod:13
13700 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
13701 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
13706 #: ../src/guestfs-structs.pod:16
13707 msgid "guestfs_lvm_pv"
13711 #: ../src/guestfs-structs.pod:18
13714 " struct guestfs_lvm_pv {\n"
13715 " char *pv_name;\n"
13716 " /* The next field is NOT nul-terminated, be careful when printing it: "
13718 " char pv_uuid[32];\n"
13720 " uint64_t pv_size;\n"
13721 " uint64_t dev_size;\n"
13722 " uint64_t pv_free;\n"
13723 " uint64_t pv_used;\n"
13724 " char *pv_attr;\n"
13725 " int64_t pv_pe_count;\n"
13726 " int64_t pv_pe_alloc_count;\n"
13727 " char *pv_tags;\n"
13728 " uint64_t pe_start;\n"
13729 " int64_t pv_mda_count;\n"
13730 " uint64_t pv_mda_free;\n"
13736 #: ../src/guestfs-structs.pod:36
13739 " struct guestfs_lvm_pv_list {\n"
13740 " uint32_t len; /* Number of elements in list. */\n"
13741 " struct guestfs_lvm_pv *val; /* Elements. */\n"
13747 #: ../src/guestfs-structs.pod:41
13750 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
13751 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
13756 #: ../src/guestfs-structs.pod:44
13757 msgid "guestfs_lvm_vg"
13761 #: ../src/guestfs-structs.pod:46
13764 " struct guestfs_lvm_vg {\n"
13765 " char *vg_name;\n"
13766 " /* The next field is NOT nul-terminated, be careful when printing it: "
13768 " char vg_uuid[32];\n"
13770 " char *vg_attr;\n"
13771 " uint64_t vg_size;\n"
13772 " uint64_t vg_free;\n"
13773 " char *vg_sysid;\n"
13774 " uint64_t vg_extent_size;\n"
13775 " int64_t vg_extent_count;\n"
13776 " int64_t vg_free_count;\n"
13777 " int64_t max_lv;\n"
13778 " int64_t max_pv;\n"
13779 " int64_t pv_count;\n"
13780 " int64_t lv_count;\n"
13781 " int64_t snap_count;\n"
13782 " int64_t vg_seqno;\n"
13783 " char *vg_tags;\n"
13784 " int64_t vg_mda_count;\n"
13785 " uint64_t vg_mda_free;\n"
13791 #: ../src/guestfs-structs.pod:69
13794 " struct guestfs_lvm_vg_list {\n"
13795 " uint32_t len; /* Number of elements in list. */\n"
13796 " struct guestfs_lvm_vg *val; /* Elements. */\n"
13802 #: ../src/guestfs-structs.pod:74
13805 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
13806 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
13811 #: ../src/guestfs-structs.pod:77
13812 msgid "guestfs_lvm_lv"
13816 #: ../src/guestfs-structs.pod:79
13819 " struct guestfs_lvm_lv {\n"
13820 " char *lv_name;\n"
13821 " /* The next field is NOT nul-terminated, be careful when printing it: "
13823 " char lv_uuid[32];\n"
13824 " char *lv_attr;\n"
13825 " int64_t lv_major;\n"
13826 " int64_t lv_minor;\n"
13827 " int64_t lv_kernel_major;\n"
13828 " int64_t lv_kernel_minor;\n"
13829 " uint64_t lv_size;\n"
13830 " int64_t seg_count;\n"
13832 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
13833 " float snap_percent;\n"
13834 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
13835 " float copy_percent;\n"
13836 " char *move_pv;\n"
13837 " char *lv_tags;\n"
13838 " char *mirror_log;\n"
13839 " char *modules;\n"
13845 #: ../src/guestfs-structs.pod:101
13848 " struct guestfs_lvm_lv_list {\n"
13849 " uint32_t len; /* Number of elements in list. */\n"
13850 " struct guestfs_lvm_lv *val; /* Elements. */\n"
13856 #: ../src/guestfs-structs.pod:106
13859 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
13860 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
13865 #: ../src/guestfs-structs.pod:111
13868 " struct guestfs_stat {\n"
13872 " int64_t nlink;\n"
13877 " int64_t blksize;\n"
13878 " int64_t blocks;\n"
13879 " int64_t atime;\n"
13880 " int64_t mtime;\n"
13881 " int64_t ctime;\n"
13887 #: ../src/guestfs-structs.pod:127
13890 " struct guestfs_stat_list {\n"
13891 " uint32_t len; /* Number of elements in list. */\n"
13892 " struct guestfs_stat *val; /* Elements. */\n"
13898 #: ../src/guestfs-structs.pod:132
13901 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
13902 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
13907 #: ../src/guestfs-structs.pod:137
13910 " struct guestfs_statvfs {\n"
13911 " int64_t bsize;\n"
13912 " int64_t frsize;\n"
13913 " int64_t blocks;\n"
13914 " int64_t bfree;\n"
13915 " int64_t bavail;\n"
13916 " int64_t files;\n"
13917 " int64_t ffree;\n"
13918 " int64_t favail;\n"
13921 " int64_t namemax;\n"
13927 #: ../src/guestfs-structs.pod:151
13930 " struct guestfs_statvfs_list {\n"
13931 " uint32_t len; /* Number of elements in list. */\n"
13932 " struct guestfs_statvfs *val; /* Elements. */\n"
13938 #: ../src/guestfs-structs.pod:156
13941 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
13942 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
13947 #: ../src/guestfs-structs.pod:159
13948 msgid "guestfs_dirent"
13952 #: ../src/guestfs-structs.pod:161
13955 " struct guestfs_dirent {\n"
13964 #: ../src/guestfs-structs.pod:167
13967 " struct guestfs_dirent_list {\n"
13968 " uint32_t len; /* Number of elements in list. */\n"
13969 " struct guestfs_dirent *val; /* Elements. */\n"
13975 #: ../src/guestfs-structs.pod:172
13978 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
13979 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
13984 #: ../src/guestfs-structs.pod:177
13987 " struct guestfs_version {\n"
13988 " int64_t major;\n"
13989 " int64_t minor;\n"
13990 " int64_t release;\n"
13997 #: ../src/guestfs-structs.pod:184
14000 " struct guestfs_version_list {\n"
14001 " uint32_t len; /* Number of elements in list. */\n"
14002 " struct guestfs_version *val; /* Elements. */\n"
14008 #: ../src/guestfs-structs.pod:189
14011 " void guestfs_free_version (struct guestfs_free_version *);\n"
14012 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
14017 #: ../src/guestfs-structs.pod:192
14018 msgid "guestfs_xattr"
14022 #: ../src/guestfs-structs.pod:194
14025 " struct guestfs_xattr {\n"
14026 " char *attrname;\n"
14027 " /* The next two fields describe a byte array. */\n"
14028 " uint32_t attrval_len;\n"
14029 " char *attrval;\n"
14035 #: ../src/guestfs-structs.pod:201
14038 " struct guestfs_xattr_list {\n"
14039 " uint32_t len; /* Number of elements in list. */\n"
14040 " struct guestfs_xattr *val; /* Elements. */\n"
14046 #: ../src/guestfs-structs.pod:206
14049 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
14050 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
14055 #: ../src/guestfs-structs.pod:209
14056 msgid "guestfs_inotify_event"
14060 #: ../src/guestfs-structs.pod:211
14063 " struct guestfs_inotify_event {\n"
14064 " int64_t in_wd;\n"
14065 " uint32_t in_mask;\n"
14066 " uint32_t in_cookie;\n"
14067 " char *in_name;\n"
14073 #: ../src/guestfs-structs.pod:218
14076 " struct guestfs_inotify_event_list {\n"
14077 " uint32_t len; /* Number of elements in list. */\n"
14078 " struct guestfs_inotify_event *val; /* Elements. */\n"
14084 #: ../src/guestfs-structs.pod:223
14087 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
14088 " void guestfs_free_inotify_event_list (struct "
14089 "guestfs_free_inotify_event_list *);\n"
14094 #: ../src/guestfs-structs.pod:226
14095 msgid "guestfs_partition"
14099 #: ../src/guestfs-structs.pod:228
14102 " struct guestfs_partition {\n"
14103 " int32_t part_num;\n"
14104 " uint64_t part_start;\n"
14105 " uint64_t part_end;\n"
14106 " uint64_t part_size;\n"
14112 #: ../src/guestfs-structs.pod:235
14115 " struct guestfs_partition_list {\n"
14116 " uint32_t len; /* Number of elements in list. */\n"
14117 " struct guestfs_partition *val; /* Elements. */\n"
14123 #: ../src/guestfs-structs.pod:240
14126 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
14127 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
14132 #: ../fish/guestfish.pod:5
14133 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
14137 #: ../fish/guestfish.pod:9
14140 " guestfish [--options] [commands]\n"
14145 #: ../fish/guestfish.pod:11
14153 #: ../fish/guestfish.pod:13
14156 " guestfish -a disk.img\n"
14161 #: ../fish/guestfish.pod:15
14164 " guestfish -a disk.img -m dev[:mountpoint]\n"
14169 #: ../fish/guestfish.pod:17
14172 " guestfish -d libvirt-domain\n"
14177 #: ../fish/guestfish.pod:19
14180 " guestfish -a disk.img -i\n"
14185 #: ../fish/guestfish.pod:21
14188 " guestfish -d libvirt-domain -i\n"
14193 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:11 ../tools/virt-edit.pl:45 ../tools/virt-rescue.pl:41 ../tools/virt-tar.pl:60 ../tools/virt-win-reg.pl:52
14198 #: ../fish/guestfish.pod:25
14200 "Using guestfish in read/write mode on live virtual machines can be "
14201 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
14202 "option to use guestfish safely if the disk image or virtual machine might be "
14207 #: ../fish/guestfish.pod:30 ../fish/guestfish.pod:729 ../fuse/guestmount.pod:35 ../tools/virt-cat.pl:51 ../tools/virt-edit.pl:59 ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:46
14212 #: ../fish/guestfish.pod:32
14213 msgid "As an interactive shell"
14217 #: ../fish/guestfish.pod:34
14225 #: ../fish/guestfish.pod:36
14228 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
14229 " editing virtual machine filesystems.\n"
14234 #: ../fish/guestfish.pod:39
14237 " Type: 'help' for a list of commands\n"
14238 " 'man' to read the manual\n"
14239 " 'quit' to quit the shell\n"
14244 #: ../fish/guestfish.pod:43
14252 #: ../fish/guestfish.pod:45
14253 msgid "From shell scripts"
14257 #: ../fish/guestfish.pod:47
14258 msgid "Create a new C</etc/motd> file in a guest:"
14262 #: ../fish/guestfish.pod:49
14265 " guestfish <<_EOF_\n"
14268 " mount /dev/vg_guest/lv_root /\n"
14269 " write /etc/motd \"Welcome, new users\"\n"
14275 #: ../fish/guestfish.pod:56
14276 msgid "List the LVM logical volumes in a guest:"
14280 #: ../fish/guestfish.pod:58
14283 " guestfish -a disk.img --ro <<_EOF_\n"
14291 #: ../fish/guestfish.pod:63
14292 msgid "On one command line"
14296 #: ../fish/guestfish.pod:65
14297 msgid "Update C</etc/resolv.conf> in a guest:"
14301 #: ../fish/guestfish.pod:67
14305 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
14306 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
14311 #: ../fish/guestfish.pod:71
14312 msgid "Edit C</boot/grub/grub.conf> interactively:"
14316 #: ../fish/guestfish.pod:73
14319 " guestfish --add disk.img \\\n"
14320 " --mount /dev/vg_guest/lv_root \\\n"
14321 " --mount /dev/sda1:/boot \\\n"
14322 " edit /boot/grub/grub.conf\n"
14327 #: ../fish/guestfish.pod:78
14328 msgid "Mount disks automatically"
14332 #: ../fish/guestfish.pod:80
14334 "Use the I<-i> option to automatically mount the disks from a virtual "
14339 #: ../fish/guestfish.pod:83
14342 " guestfish --ro -a disk.img -i cat /etc/group\n"
14347 #: ../fish/guestfish.pod:85
14350 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
14355 #: ../fish/guestfish.pod:87
14356 msgid "As a script interpreter"
14360 #: ../fish/guestfish.pod:89
14361 msgid "Create a 100MB disk containing an ext2-formatted partition:"
14365 #: ../fish/guestfish.pod:91
14368 " #!/usr/bin/guestfish -f\n"
14369 " sparse test1.img 100M\n"
14371 " part-disk /dev/sda mbr\n"
14372 " mkfs ext2 /dev/sda1\n"
14377 #: ../fish/guestfish.pod:97
14378 msgid "Start with a prepared disk"
14382 #: ../fish/guestfish.pod:99
14384 "An alternate way to create a 100MB disk called C<test1.img> containing a "
14385 "single ext2-formatted partition:"
14389 #: ../fish/guestfish.pod:102
14392 " guestfish -N fs\n"
14397 #: ../fish/guestfish.pod:104
14398 msgid "To list what is available do:"
14402 #: ../fish/guestfish.pod:106 ../fish/guestfish.pod:720
14405 " guestfish -N help | less\n"
14410 #: ../fish/guestfish.pod:108
14411 msgid "Remote control"
14415 #: ../fish/guestfish.pod:110
14418 " eval `guestfish --listen --ro`\n"
14419 " guestfish --remote add disk.img\n"
14420 " guestfish --remote run\n"
14421 " guestfish --remote lvs\n"
14426 #: ../fish/guestfish.pod:117
14428 "Guestfish is a shell and command-line tool for examining and modifying "
14429 "virtual machine filesystems. It uses libguestfs and exposes all of the "
14430 "functionality of the guestfs API, see L<guestfs(3)>."
14434 #: ../fish/guestfish.pod:121
14436 "Guestfish gives you structured access to the libguestfs API, from shell "
14437 "scripts or the command line or interactively. If you want to rescue a "
14438 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
14443 #: ../fish/guestfish.pod:126 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:70 ../inspector/virt-inspector.pl:75 ../tools/virt-cat.pl:80 ../tools/virt-df.pl:71 ../tools/virt-edit.pl:73 ../tools/virt-list-filesystems.pl:50 ../tools/virt-list-partitions.pl:51 ../tools/virt-ls.pl:79 ../tools/virt-make-fs.pl:153 ../tools/virt-rescue.pl:103 ../tools/virt-resize.pl:233 ../tools/virt-tar.pl:99 ../tools/virt-win-reg.pl:172
14448 #: ../fish/guestfish.pod:130 ../fuse/guestmount.pod:94 ../inspector/virt-inspector.pl:83 ../tools/virt-cat.pl:88 ../tools/virt-df.pl:79 ../tools/virt-edit.pl:81 ../tools/virt-list-filesystems.pl:58 ../tools/virt-list-partitions.pl:59 ../tools/virt-ls.pl:87 ../tools/virt-make-fs.pl:161 ../tools/virt-rescue.pl:111 ../tools/virt-resize.pl:241 ../tools/virt-tar.pl:107 ../tools/virt-win-reg.pl:180
14453 #: ../fish/guestfish.pod:132
14454 msgid "Displays general help on options."
14458 #: ../fish/guestfish.pod:134
14459 msgid "B<-h> | B<--cmd-help>"
14463 #: ../fish/guestfish.pod:136
14464 msgid "Lists all available guestfish commands."
14468 #: ../fish/guestfish.pod:138
14469 msgid "B<-h cmd> | B<--cmd-help cmd>"
14473 #: ../fish/guestfish.pod:140
14474 msgid "Displays detailed help on a single command C<cmd>."
14478 #: ../fish/guestfish.pod:142 ../fuse/guestmount.pod:74
14479 msgid "B<-a image> | B<--add image>"
14483 #: ../fish/guestfish.pod:144
14484 msgid "Add a block device or virtual machine image to the shell."
14488 #: ../fish/guestfish.pod:146
14489 msgid "B<-c URI> | B<--connect URI>"
14493 #: ../fish/guestfish.pod:148
14495 "When used in conjunction with the I<-d> option, this specifies the libvirt "
14496 "URI to use. The default is to use the default libvirt connection."
14500 #: ../fish/guestfish.pod:152
14501 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
14505 #: ../fish/guestfish.pod:154
14507 "Add disks from the named libvirt domain. If the I<--ro> option is also "
14508 "used, then any libvirt domain can be used. However in write mode, only "
14509 "libvirt domains which are shut down can be named here."
14513 #: ../fish/guestfish.pod:158
14514 msgid "B<-D> | B<--no-dest-paths>"
14518 #: ../fish/guestfish.pod:160
14520 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
14521 "to hit the tab key to complete paths on the guest filesystem, but this "
14522 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
14523 "allow this feature to be disabled."
14527 #: ../fish/guestfish.pod:165
14528 msgid "B<-f file> | B<--file file>"
14532 #: ../fish/guestfish.pod:167
14533 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
14537 #: ../fish/guestfish.pod:170
14540 " #!/usr/bin/guestfish -f\n"
14545 #: ../fish/guestfish.pod:172
14546 msgid "B<-i> | B<--inspector>"
14550 #: ../fish/guestfish.pod:174
14552 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
14553 "system and mount filesystems as they would be mounted on the real virtual "
14558 #: ../fish/guestfish.pod:178
14559 msgid "Typical usage is either:"
14563 #: ../fish/guestfish.pod:180
14566 " guestfish -d myguest -i\n"
14571 #: ../fish/guestfish.pod:182
14572 msgid "(for an inactive libvirt domain called I<myguest>), or:"
14576 #: ../fish/guestfish.pod:184
14579 " guestfish --ro -d myguest -i\n"
14584 #: ../fish/guestfish.pod:186
14585 msgid "(for active domains, readonly), or specify the block device directly:"
14589 #: ../fish/guestfish.pod:188
14592 " guestfish -a /dev/Guests/MyGuest -i\n"
14597 #: ../fish/guestfish.pod:190
14599 "Note that the command line syntax changed slightly over older versions of "
14600 "guestfish. You can still use the old syntax:"
14604 #: ../fish/guestfish.pod:193
14607 " guestfish [--ro] -i disk.img\n"
14612 #: ../fish/guestfish.pod:195
14615 " guestfish [--ro] -i libvirt-domain\n"
14620 #: ../fish/guestfish.pod:197
14621 msgid "B<--keys-from-stdin>"
14625 #: ../fish/guestfish.pod:199
14627 "Read key or passphrase parameters from stdin. The default is to try to read "
14628 "passphrases from the user by opening C</dev/tty>."
14632 #: ../fish/guestfish.pod:202
14633 msgid "B<--listen>"
14637 #: ../fish/guestfish.pod:204
14639 "Fork into the background and listen for remote commands. See section "
14640 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
14644 #: ../fish/guestfish.pod:207
14645 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
14649 #: ../fish/guestfish.pod:209
14650 msgid "Mount the named partition or logical volume on the given mountpoint."
14654 #: ../fish/guestfish.pod:211
14655 msgid "If the mountpoint is omitted, it defaults to C</>."
14659 #: ../fish/guestfish.pod:213
14660 msgid "You have to mount something on C</> before most commands will work."
14664 #: ../fish/guestfish.pod:215
14666 "If any I<-m> or I<--mount> options are given, the guest is automatically "
14671 #: ../fish/guestfish.pod:218
14673 "If you don't know what filesystems a disk image contains, you can either run "
14674 "guestfish without this option, then list the partitions and LVs available "
14675 "(see L</list-partitions> and L</lvs> commands), or you can use the "
14676 "L<virt-list-filesystems(1)> program."
14680 #: ../fish/guestfish.pod:223 ../fuse/guestmount.pod:106
14681 msgid "B<-n> | B<--no-sync>"
14685 #: ../fish/guestfish.pod:225
14687 "Disable autosync. This is enabled by default. See the discussion of "
14688 "autosync in the L<guestfs(3)> manpage."
14692 #: ../fish/guestfish.pod:228
14693 msgid "B<-N type> | B<--new type> | B<-N help>"
14697 #: ../fish/guestfish.pod:230
14699 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
14700 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
14701 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
14706 #: ../fish/guestfish.pod:235
14707 msgid "B<--progress-bars>"
14711 #: ../fish/guestfish.pod:237
14712 msgid "Enable progress bars, even when guestfish is used non-interactively."
14716 #: ../fish/guestfish.pod:239
14718 "Progress bars are enabled by default when guestfish is used as an "
14719 "interactive shell."
14723 #: ../fish/guestfish.pod:242
14724 msgid "B<--no-progress-bars>"
14728 #: ../fish/guestfish.pod:244
14729 msgid "Disable progress bars."
14733 #: ../fish/guestfish.pod:246
14734 msgid "B<--remote[=pid]>"
14738 #: ../fish/guestfish.pod:248
14740 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
14741 "CONTROL GUESTFISH OVER A SOCKET> below."
14745 #: ../fish/guestfish.pod:251 ../fuse/guestmount.pod:148
14746 msgid "B<-r> | B<--ro>"
14750 #: ../fish/guestfish.pod:253
14752 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
14753 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
14757 #: ../fish/guestfish.pod:256 ../tools/virt-rescue.pl:162
14759 "The option must always be used if the disk image or virtual machine might be "
14760 "running, and is generally recommended in cases where you don't need write "
14761 "access to the disk."
14765 #: ../fish/guestfish.pod:260
14767 "Note that prepared disk images created with I<-N> are not affected by the "
14772 #: ../fish/guestfish.pod:263 ../fuse/guestmount.pod:158 ../tools/virt-rescue.pl:170
14773 msgid "B<--selinux>"
14777 #: ../fish/guestfish.pod:265
14778 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
14782 #: ../fish/guestfish.pod:267 ../fuse/guestmount.pod:168
14783 msgid "B<-v> | B<--verbose>"
14787 #: ../fish/guestfish.pod:269
14789 "Enable very verbose messages. This is particularly useful if you find a "
14794 #: ../fish/guestfish.pod:272 ../fuse/guestmount.pod:172
14795 msgid "B<-V> | B<--version>"
14799 #: ../fish/guestfish.pod:274
14800 msgid "Display the guestfish / libguestfs version number and exit."
14804 #: ../fish/guestfish.pod:276
14809 #: ../fish/guestfish.pod:278
14810 msgid "Echo each command before executing it."
14814 #: ../fish/guestfish.pod:282
14815 msgid "COMMANDS ON COMMAND LINE"
14819 #: ../fish/guestfish.pod:284
14820 msgid "Any additional (non-option) arguments are treated as commands to execute."
14824 #: ../fish/guestfish.pod:287
14826 "Commands to execute should be separated by a colon (C<:>), where the colon "
14827 "is a separate parameter. Thus:"
14831 #: ../fish/guestfish.pod:290
14834 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
14839 #: ../fish/guestfish.pod:292
14841 "If there are no additional arguments, then we enter a shell, either an "
14842 "interactive shell with a prompt (if the input is a terminal) or a "
14843 "non-interactive shell."
14847 #: ../fish/guestfish.pod:296
14849 "In either command line mode or non-interactive shell, the first command that "
14850 "gives an error causes the whole shell to exit. In interactive mode (with a "
14851 "prompt) if a command fails, you can continue to enter commands."
14855 #: ../fish/guestfish.pod:301
14856 msgid "USING launch (OR run)"
14860 #: ../fish/guestfish.pod:303
14862 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
14863 "then launch it, then mount any disks you need, and finally issue "
14864 "actions/commands. So the general order of the day is:"
14868 #: ../fish/guestfish.pod:311
14869 msgid "add or -a/--add"
14873 #: ../fish/guestfish.pod:315
14874 msgid "launch (aka run)"
14878 #: ../fish/guestfish.pod:319
14879 msgid "mount or -m/--mount"
14883 #: ../fish/guestfish.pod:323
14884 msgid "any other commands"
14888 #: ../fish/guestfish.pod:327
14890 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
14891 "guest before mounting or performing any other commands."
14895 #: ../fish/guestfish.pod:330
14897 "The only exception is that if the I<-m> or I<--mount> option was given, the "
14898 "guest is automatically run for you (simply because guestfish can't mount the "
14899 "disks you asked for without doing this)."
14903 #: ../fish/guestfish.pod:334
14908 #: ../fish/guestfish.pod:336
14910 "You can quote ordinary parameters using either single or double quotes. For "
14915 #: ../fish/guestfish.pod:339
14918 " add \"file with a space.img\"\n"
14923 #: ../fish/guestfish.pod:341
14926 " rm '/file name'\n"
14931 #: ../fish/guestfish.pod:343
14939 #: ../fish/guestfish.pod:345
14941 "A few commands require a list of strings to be passed. For these, use a "
14942 "whitespace-separated list, enclosed in quotes. Strings containing "
14943 "whitespace to be passed through must be enclosed in single quotes. A "
14944 "literal single quote must be escaped with a backslash."
14948 #: ../fish/guestfish.pod:350
14951 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
14952 " command \"/bin/echo 'foo bar'\"\n"
14953 " command \"/bin/echo \\'foo\\'\"\n"
14958 #: ../fish/guestfish.pod:354
14963 #: ../fish/guestfish.pod:356
14964 msgid "This section applies to all commands which can take integers as parameters."
14968 #: ../fish/guestfish.pod:359
14969 msgid "SIZE SUFFIX"
14973 #: ../fish/guestfish.pod:361
14975 "When the command takes a parameter measured in bytes, you can use one of the "
14976 "following suffixes to specify kilobytes, megabytes and larger sizes:"
14980 #: ../fish/guestfish.pod:367
14981 msgid "B<k> or B<K> or B<KiB>"
14985 #: ../fish/guestfish.pod:369
14986 msgid "The size in kilobytes (multiplied by 1024)."
14990 #: ../fish/guestfish.pod:371
14995 #: ../fish/guestfish.pod:373
14996 msgid "The size in SI 1000 byte units."
15000 #: ../fish/guestfish.pod:375
15001 msgid "B<M> or B<MiB>"
15005 #: ../fish/guestfish.pod:377
15006 msgid "The size in megabytes (multiplied by 1048576)."
15010 #: ../fish/guestfish.pod:379
15015 #: ../fish/guestfish.pod:381
15016 msgid "The size in SI 1000000 byte units."
15020 #: ../fish/guestfish.pod:383
15021 msgid "B<G> or B<GiB>"
15025 #: ../fish/guestfish.pod:385
15026 msgid "The size in gigabytes (multiplied by 2**30)."
15030 #: ../fish/guestfish.pod:387
15035 #: ../fish/guestfish.pod:389
15036 msgid "The size in SI 10**9 byte units."
15040 #: ../fish/guestfish.pod:391
15041 msgid "B<T> or B<TiB>"
15045 #: ../fish/guestfish.pod:393
15046 msgid "The size in terabytes (multiplied by 2**40)."
15050 #: ../fish/guestfish.pod:395
15055 #: ../fish/guestfish.pod:397
15056 msgid "The size in SI 10**12 byte units."
15060 #: ../fish/guestfish.pod:399
15061 msgid "B<P> or B<PiB>"
15065 #: ../fish/guestfish.pod:401
15066 msgid "The size in petabytes (multiplied by 2**50)."
15070 #: ../fish/guestfish.pod:403
15075 #: ../fish/guestfish.pod:405
15076 msgid "The size in SI 10**15 byte units."
15080 #: ../fish/guestfish.pod:407
15081 msgid "B<E> or B<EiB>"
15085 #: ../fish/guestfish.pod:409
15086 msgid "The size in exabytes (multiplied by 2**60)."
15090 #: ../fish/guestfish.pod:411
15095 #: ../fish/guestfish.pod:413
15096 msgid "The size in SI 10**18 byte units."
15100 #: ../fish/guestfish.pod:415
15101 msgid "B<Z> or B<ZiB>"
15105 #: ../fish/guestfish.pod:417
15106 msgid "The size in zettabytes (multiplied by 2**70)."
15110 #: ../fish/guestfish.pod:419
15115 #: ../fish/guestfish.pod:421
15116 msgid "The size in SI 10**21 byte units."
15120 #: ../fish/guestfish.pod:423
15121 msgid "B<Y> or B<YiB>"
15125 #: ../fish/guestfish.pod:425
15126 msgid "The size in yottabytes (multiplied by 2**80)."
15130 #: ../fish/guestfish.pod:427
15135 #: ../fish/guestfish.pod:429
15136 msgid "The size in SI 10**24 byte units."
15140 #: ../fish/guestfish.pod:433
15141 msgid "For example:"
15145 #: ../fish/guestfish.pod:435
15148 " truncate-size /file 1G\n"
15153 #: ../fish/guestfish.pod:437
15154 msgid "would truncate the file to 1 gigabyte."
15158 #: ../fish/guestfish.pod:439
15160 "Be careful because a few commands take sizes in kilobytes or megabytes "
15161 "(eg. the parameter to L</memsize> is specified in megabytes already). "
15162 "Adding a suffix will probably not do what you expect."
15166 #: ../fish/guestfish.pod:443
15167 msgid "OCTAL AND HEXADECIMAL NUMBERS"
15171 #: ../fish/guestfish.pod:445
15173 "For specifying the radix (base) use the C convention: C<0> to prefix an "
15174 "octal number or C<0x> to prefix a hexadecimal number. For example:"
15178 #: ../fish/guestfish.pod:448
15181 " 1234 decimal number 1234\n"
15182 " 02322 octal number, equivalent to decimal 1234\n"
15183 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
15188 #: ../fish/guestfish.pod:452
15190 "When using the C<chmod> command, you almost always want to specify an octal "
15191 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
15192 "L<chmod(1)> program):"
15196 #: ../fish/guestfish.pod:456
15199 " chmod 0777 /public # OK\n"
15200 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
15205 #: ../fish/guestfish.pod:459
15207 "Commands that return numbers usually print them in decimal, but some "
15208 "commands print numbers in other radices (eg. C<umask> prints the mode in "
15209 "octal, preceeded by C<0>)."
15213 #: ../fish/guestfish.pod:463
15214 msgid "WILDCARDS AND GLOBBING"
15218 #: ../fish/guestfish.pod:465
15220 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
15221 "(globbing) by default. So for example the following will not do what you "
15226 #: ../fish/guestfish.pod:469
15234 #: ../fish/guestfish.pod:471
15236 "Assuming you don't have a directory literally called C</home/*> then the "
15237 "above command will return an error."
15241 #: ../fish/guestfish.pod:474
15242 msgid "To perform wildcard expansion, use the C<glob> command."
15246 #: ../fish/guestfish.pod:476
15249 " glob rm-rf /home/*\n"
15254 #: ../fish/guestfish.pod:478
15256 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
15257 "many times), equivalent to:"
15261 #: ../fish/guestfish.pod:481
15264 " rm-rf /home/jim\n"
15265 " rm-rf /home/joe\n"
15266 " rm-rf /home/mary\n"
15271 #: ../fish/guestfish.pod:485
15272 msgid "C<glob> only works on simple guest paths and not on device names."
15276 #: ../fish/guestfish.pod:487
15278 "If you have several parameters, each containing a wildcard, then glob will "
15279 "perform a cartesian product."
15283 #: ../fish/guestfish.pod:490
15288 #: ../fish/guestfish.pod:492
15290 "Any line which starts with a I<#> character is treated as a comment and "
15291 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
15292 "a command. For example:"
15296 #: ../fish/guestfish.pod:496
15299 " # this is a comment\n"
15300 " # this is a comment\n"
15301 " foo # NOT a comment\n"
15306 #: ../fish/guestfish.pod:500
15307 msgid "Blank lines are also ignored."
15311 #: ../fish/guestfish.pod:502
15312 msgid "RUNNING COMMANDS LOCALLY"
15316 #: ../fish/guestfish.pod:504
15318 "Any line which starts with a I<!> character is treated as a command sent to "
15319 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
15323 #: ../fish/guestfish.pod:508
15327 " tgz-out /remote local/remote-data.tar.gz\n"
15332 #: ../fish/guestfish.pod:511
15334 "will create a directory C<local> on the host, and then export the contents "
15335 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
15336 "(See C<tgz-out>)."
15340 #: ../fish/guestfish.pod:515
15342 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
15343 "effect, due to the way that subprocesses work in Unix."
15347 #: ../fish/guestfish.pod:518
15352 #: ../fish/guestfish.pod:520
15354 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
15355 "command (a guestfish command) to the second command (any host command). For "
15360 #: ../fish/guestfish.pod:524
15363 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
15368 #: ../fish/guestfish.pod:526
15370 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
15371 "program). The above command would list all accounts in the guest filesystem "
15372 "which have UID 0, ie. root accounts including backdoors. Other examples:"
15376 #: ../fish/guestfish.pod:531
15379 " hexdump /bin/ls | head\n"
15380 " list-devices | tail -1\n"
15381 " tgz-out / - | tar ztf -\n"
15386 #: ../fish/guestfish.pod:535
15388 "The space before the pipe symbol is required, any space after the pipe "
15389 "symbol is optional. Everything after the pipe symbol is just passed "
15390 "straight to the host shell, so it can contain redirections, globs and "
15391 "anything else that makes sense on the host side."
15395 #: ../fish/guestfish.pod:540
15397 "To use a literal argument which begins with a pipe symbol, you have to quote "
15402 #: ../fish/guestfish.pod:543
15410 #: ../fish/guestfish.pod:545
15411 msgid "HOME DIRECTORIES"
15415 #: ../fish/guestfish.pod:547
15417 "If a parameter starts with the character C<~> then the tilde may be expanded "
15418 "as a home directory path (either C<~> for the current user's home directory, "
15419 "or C<~user> for another user)."
15423 #: ../fish/guestfish.pod:551
15425 "Note that home directory expansion happens for users known I<on the host>, "
15426 "not in the guest filesystem."
15430 #: ../fish/guestfish.pod:554
15432 "To use a literal argument which begins with a tilde, you have to quote it, "
15437 #: ../fish/guestfish.pod:557
15445 #: ../fish/guestfish.pod:561
15447 "Libguestfs has some support for Linux guests encrypted according to the "
15448 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
15449 "disk encryption systems used by modern Linux guests. Currently only "
15450 "LVM-on-LUKS is supported."
15454 #: ../fish/guestfish.pod:566
15455 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
15459 #: ../fish/guestfish.pod:568
15462 " ><fs> vfs-type /dev/sda2\n"
15468 #: ../fish/guestfish.pod:571
15470 "Then open those devices using L</luks-open>. This creates a device-mapper "
15471 "device called C</dev/mapper/luksdev>."
15475 #: ../fish/guestfish.pod:574
15478 " ><fs> luks-open /dev/sda2 luksdev\n"
15479 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
15484 #: ../fish/guestfish.pod:577
15486 "Finally you have to tell LVM to scan for volume groups on the newly created "
15491 #: ../fish/guestfish.pod:580
15495 " ><fs> vg-activate-all true\n"
15500 #: ../fish/guestfish.pod:583
15501 msgid "The logical volume(s) can now be mounted in the usual way."
15505 #: ../fish/guestfish.pod:585
15507 "Before closing a LUKS device you must unmount any logical volumes on it and "
15508 "deactivate the volume groups by calling C<vg-activate false VG> on each "
15509 "one. Then you can close the mapper device:"
15513 #: ../fish/guestfish.pod:589
15516 " ><fs> vg-activate false /dev/VG\n"
15517 " ><fs> luks-close /dev/mapper/luksdev\n"
15522 #: ../fish/guestfish.pod:592
15523 msgid "WINDOWS PATHS"
15527 #: ../fish/guestfish.pod:594
15529 "If a path is prefixed with C<win:> then you can use Windows-style paths "
15530 "(with some limitations). The following commands are equivalent:"
15534 #: ../fish/guestfish.pod:597
15537 " file /WINDOWS/system32/config/system.LOG\n"
15542 #: ../fish/guestfish.pod:599
15545 " file win:/windows/system32/config/system.log\n"
15550 #: ../fish/guestfish.pod:601
15553 " file win:\\windows\\system32\\config\\system.log\n"
15558 #: ../fish/guestfish.pod:603
15561 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
15566 #: ../fish/guestfish.pod:605
15568 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
15569 "handles case insensitivity like Windows would. This only works in argument "
15570 "positions that expect a path."
15574 #: ../fish/guestfish.pod:609
15575 msgid "UPLOADING AND DOWNLOADING FILES"
15579 #: ../fish/guestfish.pod:611
15581 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
15582 "others which upload from or download to a local file, you can use the "
15583 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
15587 #: ../fish/guestfish.pod:615
15595 #: ../fish/guestfish.pod:617
15596 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
15600 #: ../fish/guestfish.pod:620
15603 " tar-out /etc - | tar tf -\n"
15608 #: ../fish/guestfish.pod:622
15610 "writes the tarball to stdout and then pipes that into the external \"tar\" "
15611 "command (see L</PIPES>)."
15615 #: ../fish/guestfish.pod:625
15617 "When using C<-> to read from stdin, the input is read up to the end of "
15618 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
15619 "some arbitrary end marker:"
15623 #: ../fish/guestfish.pod:629
15626 " upload -<<END /foo\n"
15635 #: ../fish/guestfish.pod:635
15637 "Any string of characters can be used instead of C<END>. The end marker must "
15638 "appear on a line of its own, without any preceeding or following characters "
15639 "(not even spaces)."
15643 #: ../fish/guestfish.pod:639
15645 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
15646 "upload local files (so-called \"FileIn\" parameters in the generator)."
15650 #: ../fish/guestfish.pod:642
15651 msgid "EXIT ON ERROR BEHAVIOUR"
15655 #: ../fish/guestfish.pod:644
15657 "By default, guestfish will ignore any errors when in interactive mode "
15658 "(ie. taking commands from a human over a tty), and will exit on the first "
15659 "error in non-interactive mode (scripts, commands given on the command line)."
15663 #: ../fish/guestfish.pod:649
15665 "If you prefix a command with a I<-> character, then that command will not "
15666 "cause guestfish to exit, even if that (one) command returns an error."
15670 #: ../fish/guestfish.pod:653
15671 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
15675 #: ../fish/guestfish.pod:655
15677 "Guestfish can be remote-controlled over a socket. This is useful "
15678 "particularly in shell scripts where you want to make several different "
15679 "changes to a filesystem, but you don't want the overhead of starting up a "
15680 "guestfish process each time."
15684 #: ../fish/guestfish.pod:660
15685 msgid "Start a guestfish server process using:"
15689 #: ../fish/guestfish.pod:662
15692 " eval `guestfish --listen`\n"
15697 #: ../fish/guestfish.pod:664
15698 msgid "and then send it commands by doing:"
15702 #: ../fish/guestfish.pod:666
15705 " guestfish --remote cmd [...]\n"
15710 #: ../fish/guestfish.pod:668
15711 msgid "To cause the server to exit, send it the exit command:"
15715 #: ../fish/guestfish.pod:670
15718 " guestfish --remote exit\n"
15723 #: ../fish/guestfish.pod:672
15725 "Note that the server will normally exit if there is an error in a command. "
15726 "You can change this in the usual way. See section L</EXIT ON ERROR "
15731 #: ../fish/guestfish.pod:676
15732 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
15736 #: ../fish/guestfish.pod:678
15738 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
15739 "is how the I<--remote> option knows where to send the commands. You can "
15740 "have several guestfish listener processes running using:"
15744 #: ../fish/guestfish.pod:682
15747 " eval `guestfish --listen`\n"
15748 " pid1=$GUESTFISH_PID\n"
15749 " eval `guestfish --listen`\n"
15750 " pid2=$GUESTFISH_PID\n"
15752 " guestfish --remote=$pid1 cmd\n"
15753 " guestfish --remote=$pid2 cmd\n"
15758 #: ../fish/guestfish.pod:690
15759 msgid "REMOTE CONTROL DETAILS"
15763 #: ../fish/guestfish.pod:692
15765 "Remote control happens over a Unix domain socket called "
15766 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
15767 "of the process, and C<$PID> is the process ID of the server."
15771 #: ../fish/guestfish.pod:696
15772 msgid "Guestfish client and server versions must match exactly."
15776 #: ../fish/guestfish.pod:698
15777 msgid "PREPARED DISK IMAGES"
15781 #: ../fish/guestfish.pod:700
15783 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
15784 "preformatted disk images that guestfish can make for you to save typing. "
15785 "This is particularly useful for testing purposes. This option is used "
15786 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
15787 "can be mixed with I<-a>)."
15791 #: ../fish/guestfish.pod:706
15793 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
15794 "the second and so on. Existing files in the current directory are "
15799 #: ../fish/guestfish.pod:710
15801 "The type briefly describes how the disk should be sized, partitioned, how "
15802 "filesystem(s) should be created, and how content should be added. "
15803 "Optionally the type can be followed by extra parameters, separated by C<:> "
15804 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
15805 "sparsely-allocated disk, containing a single partition, with the partition "
15806 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
15807 "on a 1GB disk instead."
15811 #: ../fish/guestfish.pod:718
15812 msgid "To list the available types and any extra parameters they take, run:"
15816 #: ../fish/guestfish.pod:722
15818 "Note that the prepared filesystem is not mounted. You would usually have to "
15819 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
15823 #: ../fish/guestfish.pod:726
15825 "If any I<-N> or I<--new> options are given, the guest is automatically "
15830 #: ../fish/guestfish.pod:731
15831 msgid "Create a 100MB disk with an ext4-formatted partition:"
15835 #: ../fish/guestfish.pod:733
15838 " guestfish -N fs:ext4\n"
15843 #: ../fish/guestfish.pod:735
15844 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
15848 #: ../fish/guestfish.pod:737
15851 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
15856 #: ../fish/guestfish.pod:739
15857 msgid "Create a blank 200MB disk:"
15861 #: ../fish/guestfish.pod:741
15864 " guestfish -N disk:200M\n"
15869 #: ../fish/guestfish.pod:743
15870 msgid "PROGRESS BARS"
15874 #: ../fish/guestfish.pod:745
15876 "Some (not all) long-running commands send progress notification messages as "
15877 "they are running. Guestfish turns these messages into progress bars."
15881 #: ../fish/guestfish.pod:749
15883 "When a command that supports progress bars takes longer than two seconds to "
15884 "run, and if progress bars are enabled, then you will see one appearing below "
15889 #: ../fish/guestfish.pod:753
15892 " ><fs> copy-size /large-file /another-file 2048M\n"
15893 " / 10% [#####-----------------------------------------] 00:30\n"
15898 #: ../fish/guestfish.pod:756
15900 "The spinner on the left hand side moves round once for every progress "
15901 "notification received from the backend. This is a (reasonably) golden "
15902 "assurance that the command is \"doing something\" even if the progress bar "
15903 "is not moving, because the command is able to send the progress "
15904 "notifications. When the bar reaches 100% and the command finishes, the "
15905 "spinner disappears."
15909 #: ../fish/guestfish.pod:763
15911 "Progress bars are enabled by default when guestfish is used interactively. "
15912 "You can enable them even for non-interactive modes using I<--progress-bars>, "
15913 "and you can disable them completely using I<--no-progress-bars>."
15917 #: ../fish/guestfish.pod:768
15918 msgid "GUESTFISH COMMANDS"
15922 #: ../fish/guestfish.pod:770
15924 "The commands in this section are guestfish convenience commands, in other "
15925 "words, they are not part of the L<guestfs(3)> API."
15929 #: ../fish/guestfish.pod:773
15934 #: ../fish/guestfish.pod:775
15943 #: ../fish/guestfish.pod:778
15945 "Without any parameter, this lists all commands. With a C<cmd> parameter, "
15946 "this displays detailed help for a command."
15950 #: ../fish/guestfish.pod:781
15951 msgid "quit | exit"
15955 #: ../fish/guestfish.pod:783
15956 msgid "This exits guestfish. You can also use C<^D> key."
15960 #: ../fish/guestfish.pod:785
15961 msgid "@FISH_COMMANDS@"
15965 #: ../fish/guestfish.pod:787
15970 #: ../fish/guestfish.pod:791 ../test-tool/libguestfs-test-tool.pod:83
15975 #: ../fish/guestfish.pod:793
15977 "guestfish returns 0 if the commands completed without error, or 1 if there "
15982 #: ../fish/guestfish.pod:800
15987 #: ../fish/guestfish.pod:802
15989 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
15994 #: ../fish/guestfish.pod:805
15995 msgid "GUESTFISH_PID"
15999 #: ../fish/guestfish.pod:807
16001 "Used with the I<--remote> option to specify the remote guestfish process to "
16002 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
16006 #: ../fish/guestfish.pod:811
16011 #: ../fish/guestfish.pod:813
16013 "If compiled with GNU readline support, various files in the home directory "
16014 "can be used. See L</FILES>."
16018 #: ../fish/guestfish.pod:822
16020 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
16021 "effect as using the B<-v> option."
16025 #: ../fish/guestfish.pod:834
16027 "Set the path that guestfish uses to search for kernel and initrd.img. See "
16028 "the discussion of paths in L<guestfs(3)>."
16032 #: ../fish/guestfish.pod:845
16033 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
16037 #: ../fish/guestfish.pod:847
16042 #: ../fish/guestfish.pod:849
16044 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
16049 #: ../fish/guestfish.pod:864 ../test-tool/libguestfs-test-tool.pod:88
16054 #: ../fish/guestfish.pod:868
16055 msgid "$HOME/.guestfish"
16059 #: ../fish/guestfish.pod:870
16061 "If compiled with GNU readline support, then the command history is saved in "
16066 #: ../fish/guestfish.pod:873
16067 msgid "$HOME/.inputrc"
16071 #: ../fish/guestfish.pod:875
16072 msgid "/etc/inputrc"
16076 #: ../fish/guestfish.pod:877
16078 "If compiled with GNU readline support, then these files can be used to "
16079 "configure readline. For further information, please see "
16080 "L<readline(3)/INITIALIZATION FILE>."
16084 #: ../fish/guestfish.pod:881
16085 msgid "To write rules which only apply to guestfish, use:"
16089 #: ../fish/guestfish.pod:883
16099 #: ../fish/guestfish.pod:887
16101 "Variables that you can set in inputrc that change the behaviour of guestfish "
16102 "in useful ways include:"
16106 #: ../fish/guestfish.pod:892
16107 msgid "completion-ignore-case (default: on)"
16111 #: ../fish/guestfish.pod:894
16113 "By default, guestfish will ignore case when tab-completing paths on the "
16118 #: ../fish/guestfish.pod:897
16121 " set completion-ignore-case off\n"
16126 #: ../fish/guestfish.pod:899
16127 msgid "to make guestfish case sensitive."
16131 #: ../fish/guestfish.pod:903
16136 #: ../fish/guestfish.pod:905
16137 msgid "test2.img (etc)"
16141 #: ../fish/guestfish.pod:907
16143 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
16144 "will be created in the file C<test1.img> in the current directory. The "
16145 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
16146 "the same name will be overwritten."
16150 #: ../fish/guestfish.pod:916
16152 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
16153 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
16154 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
16155 "L<virt-tar(1)>, L<virt-win-reg(1)>."
16159 #: ../fish/guestfish.pod:939 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:198 ../inspector/virt-inspector.pl:865 ../tools/virt-cat.pl:181 ../tools/virt-df.pl:499 ../tools/virt-edit.pl:345 ../tools/virt-list-filesystems.pl:211 ../tools/virt-list-partitions.pl:248 ../tools/virt-ls.pl:229 ../tools/virt-make-fs.pl:560 ../tools/virt-rescue.pl:249 ../tools/virt-resize.pl:1415 ../tools/virt-tar.pl:276 ../tools/virt-win-reg.pl:495
16161 "This program is free software; you can redistribute it and/or modify it "
16162 "under the terms of the GNU General Public License as published by the Free "
16163 "Software Foundation; either version 2 of the License, or (at your option) "
16164 "any later version."
16168 #: ../fish/guestfish.pod:944 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:203 ../inspector/virt-inspector.pl:870 ../tools/virt-cat.pl:186 ../tools/virt-df.pl:504 ../tools/virt-edit.pl:350 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:253 ../tools/virt-ls.pl:234 ../tools/virt-make-fs.pl:565 ../tools/virt-rescue.pl:254 ../tools/virt-resize.pl:1420 ../tools/virt-tar.pl:281 ../tools/virt-win-reg.pl:500
16170 "This program is distributed in the hope that it will be useful, but WITHOUT "
16171 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
16172 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
16177 #: ../fish/guestfish.pod:949 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:208 ../inspector/virt-inspector.pl:875 ../tools/virt-cat.pl:191 ../tools/virt-df.pl:509 ../tools/virt-edit.pl:355 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:258 ../tools/virt-ls.pl:239 ../tools/virt-make-fs.pl:570 ../tools/virt-rescue.pl:259 ../tools/virt-resize.pl:1425 ../tools/virt-tar.pl:286 ../tools/virt-win-reg.pl:505
16179 "You should have received a copy of the GNU General Public License along with "
16180 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
16181 "Ave, Cambridge, MA 02139, USA."
16185 #: ../fish/guestfish-actions.pod:1
16186 msgid "add-cdrom | cdrom"
16190 #: ../fish/guestfish-actions.pod:3
16193 " add-cdrom filename\n"
16198 #: ../fish/guestfish-actions.pod:15
16200 "This call checks for the existence of C<filename>. This stops you from "
16201 "specifying other types of drive which are supported by qemu such as C<nbd:> "
16202 "and C<http:> URLs. To specify those, use the general L</config> call "
16207 #: ../fish/guestfish-actions.pod:22
16209 "If you just want to add an ISO file (often you use this as an efficient way "
16210 "to transfer large files into the guest), then you should probably use "
16211 "L</add-drive-ro> instead."
16215 #: ../fish/guestfish-actions.pod:28
16216 msgid "add-drive | add"
16220 #: ../fish/guestfish-actions.pod:30
16223 " add-drive filename\n"
16228 #: ../fish/guestfish-actions.pod:49 ../fish/guestfish-actions.pod:75
16230 "C<if=...> is set at compile time by the configuration option C<./configure "
16231 "--with-drive-if=...>. In the rare case where you might need to change this "
16232 "at run time, use L</add-drive-with-if> or L</add-drive-ro-with-if>."
16236 #: ../fish/guestfish-actions.pod:54 ../fish/guestfish-actions.pod:80
16238 "Note that this call checks for the existence of C<filename>. This stops you "
16239 "from specifying other types of drive which are supported by qemu such as "
16240 "C<nbd:> and C<http:> URLs. To specify those, use the general L</config> "
16245 #: ../fish/guestfish-actions.pod:59
16246 msgid "add-drive-ro | add-ro"
16250 #: ../fish/guestfish-actions.pod:61
16253 " add-drive-ro filename\n"
16258 #: ../fish/guestfish-actions.pod:85
16259 msgid "add-drive-ro-with-if"
16263 #: ../fish/guestfish-actions.pod:87
16266 " add-drive-ro-with-if filename iface\n"
16271 #: ../fish/guestfish-actions.pod:89
16273 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
16274 "interface emulation to use at run time."
16278 #: ../fish/guestfish-actions.pod:92
16279 msgid "add-drive-with-if"
16283 #: ../fish/guestfish-actions.pod:94
16286 " add-drive-with-if filename iface\n"
16291 #: ../fish/guestfish-actions.pod:96
16293 "This is the same as L</add-drive> but it allows you to specify the QEMU "
16294 "interface emulation to use at run time."
16298 #: ../fish/guestfish-actions.pod:99
16303 #: ../fish/guestfish-actions.pod:101
16306 " aug-clear augpath\n"
16311 #: ../fish/guestfish-actions.pod:106
16316 #: ../fish/guestfish-actions.pod:108
16324 #: ../fish/guestfish-actions.pod:110
16326 "Close the current Augeas handle and free up any resources used by it. After "
16327 "calling this, you have to call L</aug-init> again before you can use any "
16328 "other Augeas functions."
16332 #: ../fish/guestfish-actions.pod:115
16333 msgid "aug-defnode"
16337 #: ../fish/guestfish-actions.pod:117
16340 " aug-defnode name expr val\n"
16345 #: ../fish/guestfish-actions.pod:122
16347 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
16348 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
16349 "containing that single node."
16353 #: ../fish/guestfish-actions.pod:130
16358 #: ../fish/guestfish-actions.pod:132
16361 " aug-defvar name expr\n"
16366 #: ../fish/guestfish-actions.pod:141
16371 #: ../fish/guestfish-actions.pod:143
16374 " aug-get augpath\n"
16379 #: ../fish/guestfish-actions.pod:148
16384 #: ../fish/guestfish-actions.pod:150
16387 " aug-init root flags\n"
16392 #: ../fish/guestfish-actions.pod:156
16393 msgid "You must call this before using any other L</aug-*> commands."
16397 #: ../fish/guestfish-actions.pod:191
16398 msgid "Do not load the tree in L</aug-init>."
16402 #: ../fish/guestfish-actions.pod:195
16403 msgid "To close the handle, you can call L</aug-close>."
16407 #: ../fish/guestfish-actions.pod:199
16412 #: ../fish/guestfish-actions.pod:201
16415 " aug-insert augpath label true|false\n"
16420 #: ../fish/guestfish-actions.pod:211
16425 #: ../fish/guestfish-actions.pod:213
16433 #: ../fish/guestfish-actions.pod:220
16438 #: ../fish/guestfish-actions.pod:222
16441 " aug-ls augpath\n"
16446 #: ../fish/guestfish-actions.pod:224
16448 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
16449 "resulting nodes into alphabetical order."
16453 #: ../fish/guestfish-actions.pod:227
16458 #: ../fish/guestfish-actions.pod:229
16461 " aug-match augpath\n"
16466 #: ../fish/guestfish-actions.pod:235
16471 #: ../fish/guestfish-actions.pod:237
16474 " aug-mv src dest\n"
16479 #: ../fish/guestfish-actions.pod:242
16484 #: ../fish/guestfish-actions.pod:244
16487 " aug-rm augpath\n"
16492 #: ../fish/guestfish-actions.pod:250
16497 #: ../fish/guestfish-actions.pod:252
16505 #: ../fish/guestfish-actions.pod:256
16507 "The flags which were passed to L</aug-init> affect exactly how files are "
16512 #: ../fish/guestfish-actions.pod:259
16517 #: ../fish/guestfish-actions.pod:261
16520 " aug-set augpath val\n"
16525 #: ../fish/guestfish-actions.pod:265
16527 "In the Augeas API, it is possible to clear a node by setting the value to "
16528 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
16529 "this call. Instead you must use the L</aug-clear> call."
16533 #: ../fish/guestfish-actions.pod:270
16538 #: ../fish/guestfish-actions.pod:272
16541 " available 'groups ...'\n"
16546 #: ../fish/guestfish-actions.pod:278
16548 "The libguestfs groups, and the functions that those groups correspond to, "
16549 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
16550 "runtime by calling L</available-all-groups>."
16554 #: ../fish/guestfish-actions.pod:302
16555 msgid "You must call L</launch> before calling this function."
16559 #: ../fish/guestfish-actions.pod:324
16561 "This call was added in version C<1.0.80>. In previous versions of "
16562 "libguestfs all you could do would be to speculatively execute a command to "
16563 "find out if the daemon implemented it. See also L</version>."
16567 #: ../fish/guestfish-actions.pod:331
16568 msgid "available-all-groups"
16572 #: ../fish/guestfish-actions.pod:333
16575 " available-all-groups\n"
16580 #: ../fish/guestfish-actions.pod:335
16582 "This command returns a list of all optional groups that this daemon knows "
16583 "about. Note this returns both supported and unsupported groups. To find "
16584 "out which ones the daemon can actually support you have to call "
16585 "L</available> on each member of the returned list."
16589 #: ../fish/guestfish-actions.pod:341
16590 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
16594 #: ../fish/guestfish-actions.pod:343
16599 #: ../fish/guestfish-actions.pod:345
16602 " base64-in (base64file|-) filename\n"
16607 #: ../fish/guestfish-actions.pod:350 ../fish/guestfish-actions.pod:359 ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:730 ../fish/guestfish-actions.pod:777 ../fish/guestfish-actions.pod:1154 ../fish/guestfish-actions.pod:3752 ../fish/guestfish-actions.pod:3764 ../fish/guestfish-actions.pod:3775 ../fish/guestfish-actions.pod:3786 ../fish/guestfish-actions.pod:3838 ../fish/guestfish-actions.pod:3847 ../fish/guestfish-actions.pod:3897
16608 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
16612 #: ../fish/guestfish-actions.pod:352
16617 #: ../fish/guestfish-actions.pod:354
16620 " base64-out filename (base64file|-)\n"
16625 #: ../fish/guestfish-actions.pod:361
16626 msgid "blockdev-flushbufs"
16630 #: ../fish/guestfish-actions.pod:363
16633 " blockdev-flushbufs device\n"
16638 #: ../fish/guestfish-actions.pod:370
16639 msgid "blockdev-getbsz"
16643 #: ../fish/guestfish-actions.pod:372
16646 " blockdev-getbsz device\n"
16651 #: ../fish/guestfish-actions.pod:381
16652 msgid "blockdev-getro"
16656 #: ../fish/guestfish-actions.pod:383
16659 " blockdev-getro device\n"
16664 #: ../fish/guestfish-actions.pod:390
16665 msgid "blockdev-getsize64"
16669 #: ../fish/guestfish-actions.pod:392
16672 " blockdev-getsize64 device\n"
16677 #: ../fish/guestfish-actions.pod:396
16678 msgid "See also L</blockdev-getsz>."
16682 #: ../fish/guestfish-actions.pod:400
16683 msgid "blockdev-getss"
16687 #: ../fish/guestfish-actions.pod:402
16690 " blockdev-getss device\n"
16695 #: ../fish/guestfish-actions.pod:407
16696 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
16700 #: ../fish/guestfish-actions.pod:412
16701 msgid "blockdev-getsz"
16705 #: ../fish/guestfish-actions.pod:414
16708 " blockdev-getsz device\n"
16713 #: ../fish/guestfish-actions.pod:419
16715 "See also L</blockdev-getss> for the real sector size of the device, and "
16716 "L</blockdev-getsize64> for the more useful I<size in bytes>."
16720 #: ../fish/guestfish-actions.pod:425
16721 msgid "blockdev-rereadpt"
16725 #: ../fish/guestfish-actions.pod:427
16728 " blockdev-rereadpt device\n"
16733 #: ../fish/guestfish-actions.pod:433
16734 msgid "blockdev-setbsz"
16738 #: ../fish/guestfish-actions.pod:435
16741 " blockdev-setbsz device blocksize\n"
16746 #: ../fish/guestfish-actions.pod:444
16747 msgid "blockdev-setro"
16751 #: ../fish/guestfish-actions.pod:446
16754 " blockdev-setro device\n"
16759 #: ../fish/guestfish-actions.pod:452
16760 msgid "blockdev-setrw"
16764 #: ../fish/guestfish-actions.pod:454
16767 " blockdev-setrw device\n"
16772 #: ../fish/guestfish-actions.pod:460
16773 msgid "case-sensitive-path"
16777 #: ../fish/guestfish-actions.pod:462
16780 " case-sensitive-path path\n"
16785 #: ../fish/guestfish-actions.pod:486
16787 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
16788 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
16789 "how the directories were originally created under Windows)."
16793 #: ../fish/guestfish-actions.pod:494
16794 msgid "See also L</realpath>."
16798 #: ../fish/guestfish-actions.pod:496
16803 #: ../fish/guestfish-actions.pod:498
16811 #: ../fish/guestfish-actions.pod:502
16813 "Note that this function cannot correctly handle binary files (specifically, "
16814 "files containing C<\\0> character which is treated as end of string). For "
16815 "those you need to use the L</read-file> or L</download> functions which have "
16816 "a more complex interface."
16820 #: ../fish/guestfish-actions.pod:510
16825 #: ../fish/guestfish-actions.pod:512
16828 " checksum csumtype path\n"
16833 #: ../fish/guestfish-actions.pod:555
16834 msgid "To get the checksum for a device, use L</checksum-device>."
16838 #: ../fish/guestfish-actions.pod:557
16839 msgid "To get the checksums for many files, use L</checksums-out>."
16843 #: ../fish/guestfish-actions.pod:559
16844 msgid "checksum-device"
16848 #: ../fish/guestfish-actions.pod:561
16851 " checksum-device csumtype device\n"
16856 #: ../fish/guestfish-actions.pod:563
16858 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
16859 "device named C<device>. For the types of checksums supported see the "
16860 "L</checksum> command."
16864 #: ../fish/guestfish-actions.pod:567
16865 msgid "checksums-out"
16869 #: ../fish/guestfish-actions.pod:569
16872 " checksums-out csumtype directory (sumsfile|-)\n"
16877 #: ../fish/guestfish-actions.pod:585
16882 #: ../fish/guestfish-actions.pod:587
16885 " chmod mode path\n"
16890 #: ../fish/guestfish-actions.pod:598
16895 #: ../fish/guestfish-actions.pod:600
16898 " chown owner group path\n"
16903 #: ../fish/guestfish-actions.pod:608
16908 #: ../fish/guestfish-actions.pod:610
16911 " command 'arguments ...'\n"
16916 #: ../fish/guestfish-actions.pod:617
16918 "The single parameter is an argv-style list of arguments. The first element "
16919 "is the name of the program to run. Subsequent elements are parameters. The "
16920 "list must be non-empty (ie. must contain a program name). Note that the "
16921 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
16925 #: ../fish/guestfish-actions.pod:645
16926 msgid "command-lines"
16930 #: ../fish/guestfish-actions.pod:647
16933 " command-lines 'arguments ...'\n"
16938 #: ../fish/guestfish-actions.pod:649
16939 msgid "This is the same as L</command>, but splits the result into a list of lines."
16943 #: ../fish/guestfish-actions.pod:652
16944 msgid "See also: L</sh-lines>"
16948 #: ../fish/guestfish-actions.pod:657
16953 #: ../fish/guestfish-actions.pod:659
16956 " config qemuparam qemuvalue\n"
16961 #: ../fish/guestfish-actions.pod:670
16966 #: ../fish/guestfish-actions.pod:672
16969 " copy-size src dest size\n"
16974 #: ../fish/guestfish-actions.pod:680
16979 #: ../fish/guestfish-actions.pod:682
16987 #: ../fish/guestfish-actions.pod:687
16992 #: ../fish/guestfish-actions.pod:689
17000 #: ../fish/guestfish-actions.pod:694
17005 #: ../fish/guestfish-actions.pod:696
17013 #: ../fish/guestfish-actions.pod:703
17015 "If the destination is a device, it must be as large or larger than the "
17016 "source file or device, otherwise the copy will fail. This command cannot do "
17017 "partial copies (see L</copy-size>)."
17021 #: ../fish/guestfish-actions.pod:707
17026 #: ../fish/guestfish-actions.pod:709
17029 " debug subcmd 'extraargs ...'\n"
17034 #: ../fish/guestfish-actions.pod:711
17036 "The L</debug> command exposes some internals of C<guestfsd> (the guestfs "
17037 "daemon) that runs inside the qemu subprocess."
17041 #: ../fish/guestfish-actions.pod:719
17042 msgid "debug-upload"
17046 #: ../fish/guestfish-actions.pod:721
17049 " debug-upload (filename|-) tmpname mode\n"
17054 #: ../fish/guestfish-actions.pod:723
17055 msgid "The L</debug-upload> command uploads a file to the libguestfs appliance."
17059 #: ../fish/guestfish-actions.pod:732
17064 #: ../fish/guestfish-actions.pod:734
17072 #: ../fish/guestfish-actions.pod:742
17077 #: ../fish/guestfish-actions.pod:744
17085 #: ../fish/guestfish-actions.pod:753
17090 #: ../fish/guestfish-actions.pod:755
17098 #: ../fish/guestfish-actions.pod:761
17100 "Another way to get the same information is to enable verbose messages with "
17101 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
17102 "before running the program."
17106 #: ../fish/guestfish-actions.pod:766
17111 #: ../fish/guestfish-actions.pod:768
17114 " download remotefilename (filename|-)\n"
17119 #: ../fish/guestfish-actions.pod:775
17120 msgid "See also L</upload>, L</cat>."
17124 #: ../fish/guestfish-actions.pod:779
17125 msgid "drop-caches"
17129 #: ../fish/guestfish-actions.pod:781
17132 " drop-caches whattodrop\n"
17137 #: ../fish/guestfish-actions.pod:793
17142 #: ../fish/guestfish-actions.pod:795
17150 #: ../fish/guestfish-actions.pod:807
17155 #: ../fish/guestfish-actions.pod:809
17158 " e2fsck-f device\n"
17163 #: ../fish/guestfish-actions.pod:815
17165 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
17166 "should use L</fsck>."
17170 #: ../fish/guestfish-actions.pod:818
17171 msgid "echo-daemon"
17175 #: ../fish/guestfish-actions.pod:820
17178 " echo-daemon 'words ...'\n"
17183 #: ../fish/guestfish-actions.pod:827
17184 msgid "See also L</ping-daemon>."
17188 #: ../fish/guestfish-actions.pod:829
17193 #: ../fish/guestfish-actions.pod:831
17196 " egrep regex path\n"
17201 #: ../fish/guestfish-actions.pod:839
17206 #: ../fish/guestfish-actions.pod:841
17209 " egrepi regex path\n"
17214 #: ../fish/guestfish-actions.pod:849
17219 #: ../fish/guestfish-actions.pod:851
17222 " equal file1 file2\n"
17227 #: ../fish/guestfish-actions.pod:858
17232 #: ../fish/guestfish-actions.pod:860
17240 #: ../fish/guestfish-actions.pod:865
17241 msgid "See also L</is-file>, L</is-dir>, L</stat>."
17245 #: ../fish/guestfish-actions.pod:867
17250 #: ../fish/guestfish-actions.pod:869
17253 " fallocate path len\n"
17258 #: ../fish/guestfish-actions.pod:886
17259 msgid "fallocate64"
17263 #: ../fish/guestfish-actions.pod:888
17266 " fallocate64 path len\n"
17271 #: ../fish/guestfish-actions.pod:894
17273 "Note that this call allocates disk blocks for the file. To create a sparse "
17274 "file use L</truncate-size> instead."
17278 #: ../fish/guestfish-actions.pod:897
17280 "The deprecated call L</fallocate> does the same, but owing to an oversight "
17281 "it only allowed 30 bit lengths to be specified, effectively limiting the "
17282 "maximum size of files created through that call to 1GB."
17286 #: ../fish/guestfish-actions.pod:906
17291 #: ../fish/guestfish-actions.pod:908
17294 " fgrep pattern path\n"
17299 #: ../fish/guestfish-actions.pod:916
17304 #: ../fish/guestfish-actions.pod:918
17307 " fgrepi pattern path\n"
17312 #: ../fish/guestfish-actions.pod:926
17317 #: ../fish/guestfish-actions.pod:928
17325 #: ../fish/guestfish-actions.pod:940
17327 "This command can also be used on C</dev/> devices (and partitions, LV "
17328 "names). You can for example use this to determine if a device contains a "
17329 "filesystem, although it's usually better to use L</vfs-type>."
17333 #: ../fish/guestfish-actions.pod:950
17334 msgid "file-architecture"
17338 #: ../fish/guestfish-actions.pod:952
17341 " file-architecture filename\n"
17346 #: ../fish/guestfish-actions.pod:1055
17351 #: ../fish/guestfish-actions.pod:1057
17359 #: ../fish/guestfish-actions.pod:1061
17361 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
17362 "L</is-file> etc. To get the size of block devices, use "
17363 "L</blockdev-getsize64>."
17367 #: ../fish/guestfish-actions.pod:1065
17372 #: ../fish/guestfish-actions.pod:1067
17375 " fill c len path\n"
17380 #: ../fish/guestfish-actions.pod:1073
17382 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
17383 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
17384 "L</fill-pattern>."
17388 #: ../fish/guestfish-actions.pod:1078
17389 msgid "fill-pattern"
17393 #: ../fish/guestfish-actions.pod:1080
17396 " fill-pattern pattern len path\n"
17401 #: ../fish/guestfish-actions.pod:1082
17403 "This function is like L</fill> except that it creates a new file of length "
17404 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
17405 "is truncated if necessary to ensure the length of the file is exactly C<len> "
17410 #: ../fish/guestfish-actions.pod:1087
17415 #: ../fish/guestfish-actions.pod:1089
17418 " find directory\n"
17423 #: ../fish/guestfish-actions.pod:1103
17424 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
17428 #: ../fish/guestfish-actions.pod:1116
17429 msgid "See also L</find0>."
17433 #: ../fish/guestfish-actions.pod:1121
17438 #: ../fish/guestfish-actions.pod:1123
17441 " find0 directory (files|-)\n"
17446 #: ../fish/guestfish-actions.pod:1129
17447 msgid "This command works the same way as L</find> with the following exceptions:"
17451 #: ../fish/guestfish-actions.pod:1156
17452 msgid "findfs-label"
17456 #: ../fish/guestfish-actions.pod:1158
17459 " findfs-label label\n"
17464 #: ../fish/guestfish-actions.pod:1164
17465 msgid "To find the label of a filesystem, use L</vfs-label>."
17469 #: ../fish/guestfish-actions.pod:1166
17470 msgid "findfs-uuid"
17474 #: ../fish/guestfish-actions.pod:1168
17477 " findfs-uuid uuid\n"
17482 #: ../fish/guestfish-actions.pod:1174
17483 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
17487 #: ../fish/guestfish-actions.pod:1176
17492 #: ../fish/guestfish-actions.pod:1178
17495 " fsck fstype device\n"
17500 #: ../fish/guestfish-actions.pod:1208
17505 #: ../fish/guestfish-actions.pod:1210
17513 #: ../fish/guestfish-actions.pod:1217
17514 msgid "get-autosync"
17518 #: ../fish/guestfish-actions.pod:1219
17526 #: ../fish/guestfish-actions.pod:1223
17531 #: ../fish/guestfish-actions.pod:1225
17539 #: ../fish/guestfish-actions.pod:1229
17540 msgid "get-e2label"
17544 #: ../fish/guestfish-actions.pod:1231
17547 " get-e2label device\n"
17552 #: ../fish/guestfish-actions.pod:1243
17557 #: ../fish/guestfish-actions.pod:1245
17560 " get-e2uuid device\n"
17565 #: ../fish/guestfish-actions.pod:1257
17566 msgid "get-memsize"
17570 #: ../fish/guestfish-actions.pod:1259
17578 #: ../fish/guestfish-actions.pod:1264
17580 "If L</set-memsize> was not called on this handle, and if "
17581 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
17582 "value for memsize."
17586 #: ../fish/guestfish-actions.pod:1271
17587 msgid "get-network"
17591 #: ../fish/guestfish-actions.pod:1273
17599 #: ../fish/guestfish-actions.pod:1277
17604 #: ../fish/guestfish-actions.pod:1279
17612 #: ../fish/guestfish-actions.pod:1286
17613 msgid "get-pid | pid"
17617 #: ../fish/guestfish-actions.pod:1288
17625 #: ../fish/guestfish-actions.pod:1295
17630 #: ../fish/guestfish-actions.pod:1297
17638 #: ../fish/guestfish-actions.pod:1304
17639 msgid "get-recovery-proc"
17643 #: ../fish/guestfish-actions.pod:1306
17646 " get-recovery-proc\n"
17651 #: ../fish/guestfish-actions.pod:1310
17652 msgid "get-selinux"
17656 #: ../fish/guestfish-actions.pod:1312
17664 #: ../fish/guestfish-actions.pod:1314
17666 "This returns the current setting of the selinux flag which is passed to the "
17667 "appliance at boot time. See L</set-selinux>."
17671 #: ../fish/guestfish-actions.pod:1320
17676 #: ../fish/guestfish-actions.pod:1322
17684 #: ../fish/guestfish-actions.pod:1329
17689 #: ../fish/guestfish-actions.pod:1331
17697 #: ../fish/guestfish-actions.pod:1335
17702 #: ../fish/guestfish-actions.pod:1337
17710 #: ../fish/guestfish-actions.pod:1339
17712 "Return the current umask. By default the umask is C<022> unless it has been "
17713 "set by calling L</umask>."
17717 #: ../fish/guestfish-actions.pod:1342
17718 msgid "get-verbose"
17722 #: ../fish/guestfish-actions.pod:1344
17730 #: ../fish/guestfish-actions.pod:1348
17735 #: ../fish/guestfish-actions.pod:1350
17743 #: ../fish/guestfish-actions.pod:1354
17744 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
17748 #: ../fish/guestfish-actions.pod:1357
17753 #: ../fish/guestfish-actions.pod:1359
17756 " getxattrs path\n"
17761 #: ../fish/guestfish-actions.pod:1367
17762 msgid "See also: L</lgetxattrs>, L<attr(5)>."
17766 #: ../fish/guestfish-actions.pod:1369
17767 msgid "glob-expand"
17771 #: ../fish/guestfish-actions.pod:1371
17774 " glob-expand pattern\n"
17779 #: ../fish/guestfish-actions.pod:1384
17784 #: ../fish/guestfish-actions.pod:1386
17787 " grep regex path\n"
17792 #: ../fish/guestfish-actions.pod:1394
17797 #: ../fish/guestfish-actions.pod:1396
17800 " grepi regex path\n"
17805 #: ../fish/guestfish-actions.pod:1404
17806 msgid "grub-install"
17810 #: ../fish/guestfish-actions.pod:1406
17813 " grub-install root device\n"
17818 #: ../fish/guestfish-actions.pod:1422
17823 #: ../fish/guestfish-actions.pod:1424
17831 #: ../fish/guestfish-actions.pod:1432
17836 #: ../fish/guestfish-actions.pod:1434
17839 " head-n nrlines path\n"
17844 #: ../fish/guestfish-actions.pod:1447
17849 #: ../fish/guestfish-actions.pod:1449
17857 #: ../fish/guestfish-actions.pod:1457
17862 #: ../fish/guestfish-actions.pod:1459
17865 " initrd-cat initrdpath filename\n"
17870 #: ../fish/guestfish-actions.pod:1471
17871 msgid "See also L</initrd-list>."
17875 #: ../fish/guestfish-actions.pod:1476
17876 msgid "initrd-list"
17880 #: ../fish/guestfish-actions.pod:1478
17883 " initrd-list path\n"
17888 #: ../fish/guestfish-actions.pod:1490
17889 msgid "inotify-add-watch"
17893 #: ../fish/guestfish-actions.pod:1492
17896 " inotify-add-watch path mask\n"
17901 #: ../fish/guestfish-actions.pod:1504
17902 msgid "inotify-close"
17906 #: ../fish/guestfish-actions.pod:1506
17914 #: ../fish/guestfish-actions.pod:1512
17915 msgid "inotify-files"
17919 #: ../fish/guestfish-actions.pod:1514
17927 #: ../fish/guestfish-actions.pod:1516
17929 "This function is a helpful wrapper around L</inotify-read> which just "
17930 "returns a list of pathnames of objects that were touched. The returned "
17931 "pathnames are sorted and deduplicated."
17935 #: ../fish/guestfish-actions.pod:1520
17936 msgid "inotify-init"
17940 #: ../fish/guestfish-actions.pod:1522
17943 " inotify-init maxevents\n"
17948 #: ../fish/guestfish-actions.pod:1528
17950 "C<maxevents> is the maximum number of events which will be queued up between "
17951 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
17952 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
17953 "default was 16384 events. Beyond this limit, the kernel throws away events, "
17954 "but records the fact that it threw them away by setting a flag "
17955 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
17959 #: ../fish/guestfish-actions.pod:1538
17961 "Before any events are generated, you have to add some watches to the "
17962 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
17963 "L</inotify-watch-all>."
17967 #: ../fish/guestfish-actions.pod:1544
17969 "Queued up events should be read periodically by calling L</inotify-read> (or "
17970 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
17971 "If you don't read the events out often enough then you risk the internal "
17972 "queue overflowing."
17976 #: ../fish/guestfish-actions.pod:1551
17978 "The handle should be closed after use by calling L</inotify-close>. This "
17979 "also removes any watches automatically."
17983 #: ../fish/guestfish-actions.pod:1560
17984 msgid "inotify-read"
17988 #: ../fish/guestfish-actions.pod:1562
17996 #: ../fish/guestfish-actions.pod:1575
17997 msgid "inotify-rm-watch"
18001 #: ../fish/guestfish-actions.pod:1577
18004 " inotify-rm-watch wd\n"
18009 #: ../fish/guestfish-actions.pod:1579
18010 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
18014 #: ../fish/guestfish-actions.pod:1582
18015 msgid "inspect-get-arch"
18019 #: ../fish/guestfish-actions.pod:1584
18022 " inspect-get-arch root\n"
18027 #: ../fish/guestfish-actions.pod:1586 ../fish/guestfish-actions.pod:1602 ../fish/guestfish-actions.pod:1648 ../fish/guestfish-actions.pod:1666 ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1702 ../fish/guestfish-actions.pod:1725 ../fish/guestfish-actions.pod:1742
18029 "This function should only be called with a root device string as returned by "
18034 #: ../fish/guestfish-actions.pod:1589
18036 "This returns the architecture of the inspected operating system. The "
18037 "possible return values are listed under L</file-architecture>."
18041 #: ../fish/guestfish-actions.pod:1598
18042 msgid "inspect-get-distro"
18046 #: ../fish/guestfish-actions.pod:1600
18049 " inspect-get-distro root\n"
18054 #: ../fish/guestfish-actions.pod:1644
18055 msgid "inspect-get-filesystems"
18059 #: ../fish/guestfish-actions.pod:1646
18062 " inspect-get-filesystems root\n"
18067 #: ../fish/guestfish-actions.pod:1659
18069 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18070 "L</inspect-get-mountpoints>."
18074 #: ../fish/guestfish-actions.pod:1662
18075 msgid "inspect-get-major-version"
18079 #: ../fish/guestfish-actions.pod:1664
18082 " inspect-get-major-version root\n"
18087 #: ../fish/guestfish-actions.pod:1683
18088 msgid "inspect-get-minor-version"
18092 #: ../fish/guestfish-actions.pod:1685
18095 " inspect-get-minor-version root\n"
18100 #: ../fish/guestfish-actions.pod:1695
18102 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18103 "L</inspect-get-major-version>."
18107 #: ../fish/guestfish-actions.pod:1698
18108 msgid "inspect-get-mountpoints"
18112 #: ../fish/guestfish-actions.pod:1700
18115 " inspect-get-mountpoints root\n"
18120 #: ../fish/guestfish-actions.pod:1718
18122 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
18123 "L</inspect-get-filesystems>."
18127 #: ../fish/guestfish-actions.pod:1721
18128 msgid "inspect-get-product-name"
18132 #: ../fish/guestfish-actions.pod:1723
18135 " inspect-get-product-name root\n"
18140 #: ../fish/guestfish-actions.pod:1738
18141 msgid "inspect-get-type"
18145 #: ../fish/guestfish-actions.pod:1740
18148 " inspect-get-type root\n"
18153 #: ../fish/guestfish-actions.pod:1769
18158 #: ../fish/guestfish-actions.pod:1771
18166 #: ../fish/guestfish-actions.pod:1786
18168 "You can pass the root string(s) returned to other L</inspect-get-*> "
18169 "functions in order to query further information about each operating system, "
18170 "such as the name and version."
18174 #: ../fish/guestfish-actions.pod:1791
18176 "This function uses other libguestfs features such as L</mount-ro> and "
18177 "L</umount-all> in order to mount and unmount filesystems and look at the "
18178 "contents. This should be called with no disks currently mounted. The "
18179 "function may also use Augeas, so any existing Augeas handle will be closed."
18183 #: ../fish/guestfish-actions.pod:1803 ../fish/guestfish-actions.pod:1957 ../fish/guestfish-actions.pod:2003
18184 msgid "See also L</list-filesystems>."
18188 #: ../fish/guestfish-actions.pod:1805
18189 msgid "is-blockdev"
18193 #: ../fish/guestfish-actions.pod:1807
18196 " is-blockdev path\n"
18201 #: ../fish/guestfish-actions.pod:1812 ../fish/guestfish-actions.pod:1830 ../fish/guestfish-actions.pod:1849 ../fish/guestfish-actions.pod:1858 ../fish/guestfish-actions.pod:1868 ../fish/guestfish-actions.pod:1902 ../fish/guestfish-actions.pod:1911
18202 msgid "See also L</stat>."
18206 #: ../fish/guestfish-actions.pod:1814
18211 #: ../fish/guestfish-actions.pod:1816
18219 #: ../fish/guestfish-actions.pod:1823
18224 #: ../fish/guestfish-actions.pod:1825
18227 " is-chardev path\n"
18232 #: ../fish/guestfish-actions.pod:1832
18237 #: ../fish/guestfish-actions.pod:1834
18245 #: ../fish/guestfish-actions.pod:1841
18250 #: ../fish/guestfish-actions.pod:1843
18258 #: ../fish/guestfish-actions.pod:1851
18263 #: ../fish/guestfish-actions.pod:1853
18271 #: ../fish/guestfish-actions.pod:1860
18276 #: ../fish/guestfish-actions.pod:1862
18284 #: ../fish/guestfish-actions.pod:1870
18285 msgid "is-launching"
18289 #: ../fish/guestfish-actions.pod:1872
18297 #: ../fish/guestfish-actions.pod:1879
18302 #: ../fish/guestfish-actions.pod:1881
18310 #: ../fish/guestfish-actions.pod:1886
18315 #: ../fish/guestfish-actions.pod:1888
18323 #: ../fish/guestfish-actions.pod:1895
18328 #: ../fish/guestfish-actions.pod:1897
18331 " is-socket path\n"
18336 #: ../fish/guestfish-actions.pod:1904
18341 #: ../fish/guestfish-actions.pod:1906
18344 " is-symlink path\n"
18349 #: ../fish/guestfish-actions.pod:1913
18350 msgid "kill-subprocess"
18354 #: ../fish/guestfish-actions.pod:1915
18357 " kill-subprocess\n"
18362 #: ../fish/guestfish-actions.pod:1919
18363 msgid "launch | run"
18367 #: ../fish/guestfish-actions.pod:1921
18375 #: ../fish/guestfish-actions.pod:1929
18380 #: ../fish/guestfish-actions.pod:1931
18383 " lchown owner group path\n"
18388 #: ../fish/guestfish-actions.pod:1933
18390 "Change the file owner to C<owner> and group to C<group>. This is like "
18391 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
18396 #: ../fish/guestfish-actions.pod:1941
18401 #: ../fish/guestfish-actions.pod:1943
18404 " lgetxattrs path\n"
18409 #: ../fish/guestfish-actions.pod:1945
18411 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
18412 "it returns the extended attributes of the link itself."
18416 #: ../fish/guestfish-actions.pod:1949
18417 msgid "list-devices"
18421 #: ../fish/guestfish-actions.pod:1951
18429 #: ../fish/guestfish-actions.pod:1959
18430 msgid "list-filesystems"
18434 #: ../fish/guestfish-actions.pod:1961
18437 " list-filesystems\n"
18442 #: ../fish/guestfish-actions.pod:1980
18444 "This command runs other libguestfs commands, which might include L</mount> "
18445 "and L</umount>, and therefore you should use this soon after launch and only "
18446 "when nothing is mounted."
18450 #: ../fish/guestfish-actions.pod:1984
18452 "Not all of the filesystems returned will be mountable. In particular, swap "
18453 "partitions are returned in the list. Also this command does not check that "
18454 "each filesystem found is valid and mountable, and some filesystems might be "
18455 "mountable but require special options. Filesystems may not all belong to a "
18456 "single logical operating system (use L</inspect-os> to look for OSes)."
18460 #: ../fish/guestfish-actions.pod:1992
18461 msgid "list-partitions"
18465 #: ../fish/guestfish-actions.pod:1994
18468 " list-partitions\n"
18473 #: ../fish/guestfish-actions.pod:2000
18475 "This does not return logical volumes. For that you will need to call "
18480 #: ../fish/guestfish-actions.pod:2005
18485 #: ../fish/guestfish-actions.pod:2007
18493 #: ../fish/guestfish-actions.pod:2015
18498 #: ../fish/guestfish-actions.pod:2017
18501 " ln target linkname\n"
18506 #: ../fish/guestfish-actions.pod:2021
18511 #: ../fish/guestfish-actions.pod:2023
18514 " ln-f target linkname\n"
18519 #: ../fish/guestfish-actions.pod:2028
18524 #: ../fish/guestfish-actions.pod:2030
18527 " ln-s target linkname\n"
18532 #: ../fish/guestfish-actions.pod:2034
18537 #: ../fish/guestfish-actions.pod:2036
18540 " ln-sf target linkname\n"
18545 #: ../fish/guestfish-actions.pod:2041
18546 msgid "lremovexattr"
18550 #: ../fish/guestfish-actions.pod:2043
18553 " lremovexattr xattr path\n"
18558 #: ../fish/guestfish-actions.pod:2045
18560 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
18561 "it removes an extended attribute of the link itself."
18565 #: ../fish/guestfish-actions.pod:2049
18570 #: ../fish/guestfish-actions.pod:2051
18578 #: ../fish/guestfish-actions.pod:2057
18580 "This command is mostly useful for interactive sessions. Programs should "
18581 "probably use L</readdir> instead."
18585 #: ../fish/guestfish-actions.pod:2060
18590 #: ../fish/guestfish-actions.pod:2062
18593 " lsetxattr xattr val vallen path\n"
18598 #: ../fish/guestfish-actions.pod:2064
18600 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
18601 "sets an extended attribute of the link itself."
18605 #: ../fish/guestfish-actions.pod:2068
18610 #: ../fish/guestfish-actions.pod:2070
18618 #: ../fish/guestfish-actions.pod:2074
18620 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
18621 "the link is stat-ed, not the file it refers to."
18625 #: ../fish/guestfish-actions.pod:2080
18630 #: ../fish/guestfish-actions.pod:2082
18633 " lstatlist path 'names ...'\n"
18638 #: ../fish/guestfish-actions.pod:2084
18640 "This call allows you to perform the L</lstat> operation on multiple files, "
18641 "where all files are in the directory C<path>. C<names> is the list of files "
18642 "from this directory."
18646 #: ../fish/guestfish-actions.pod:2093
18648 "This call is intended for programs that want to efficiently list a directory "
18649 "contents without making many round-trips. See also L</lxattrlist> for a "
18650 "similarly efficient call for getting extended attributes. Very long "
18651 "directory listings might cause the protocol message size to be exceeded, "
18652 "causing this call to fail. The caller must split up such requests into "
18653 "smaller groups of names."
18657 #: ../fish/guestfish-actions.pod:2101
18658 msgid "luks-add-key"
18662 #: ../fish/guestfish-actions.pod:2103
18665 " luks-add-key device keyslot\n"
18670 #: ../fish/guestfish-actions.pod:2110
18672 "Note that if C<keyslot> already contains a key, then this command will "
18673 "fail. You have to use L</luks-kill-slot> first to remove that key."
18677 #: ../fish/guestfish-actions.pod:2114 ../fish/guestfish-actions.pod:2136 ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2163 ../fish/guestfish-actions.pod:2186 ../fish/guestfish-actions.pod:2196
18679 "This command has one or more key or passphrase parameters. Guestfish will "
18680 "prompt for these separately."
18684 #: ../fish/guestfish-actions.pod:2117
18689 #: ../fish/guestfish-actions.pod:2119
18692 " luks-close device\n"
18697 #: ../fish/guestfish-actions.pod:2121
18699 "This closes a LUKS device that was created earlier by L</luks-open> or "
18700 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
18701 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
18702 "underlying block device."
18706 #: ../fish/guestfish-actions.pod:2127
18707 msgid "luks-format"
18711 #: ../fish/guestfish-actions.pod:2129
18714 " luks-format device keyslot\n"
18719 #: ../fish/guestfish-actions.pod:2142
18720 msgid "luks-format-cipher"
18724 #: ../fish/guestfish-actions.pod:2144
18727 " luks-format-cipher device keyslot cipher\n"
18732 #: ../fish/guestfish-actions.pod:2146
18734 "This command is the same as L</luks-format> but it also allows you to set "
18735 "the C<cipher> used."
18739 #: ../fish/guestfish-actions.pod:2155
18740 msgid "luks-kill-slot"
18744 #: ../fish/guestfish-actions.pod:2157
18747 " luks-kill-slot device keyslot\n"
18752 #: ../fish/guestfish-actions.pod:2166
18757 #: ../fish/guestfish-actions.pod:2168
18760 " luks-open device mapname\n"
18765 #: ../fish/guestfish-actions.pod:2182
18767 "If this block device contains LVM volume groups, then calling L</vgscan> "
18768 "followed by L</vg-activate-all> will make them visible."
18772 #: ../fish/guestfish-actions.pod:2189
18773 msgid "luks-open-ro"
18777 #: ../fish/guestfish-actions.pod:2191
18780 " luks-open-ro device mapname\n"
18785 #: ../fish/guestfish-actions.pod:2193
18787 "This is the same as L</luks-open> except that a read-only mapping is "
18792 #: ../fish/guestfish-actions.pod:2199
18797 #: ../fish/guestfish-actions.pod:2201
18800 " lvcreate logvol volgroup mbytes\n"
18805 #: ../fish/guestfish-actions.pod:2206
18806 msgid "lvm-clear-filter"
18810 #: ../fish/guestfish-actions.pod:2208
18813 " lvm-clear-filter\n"
18818 #: ../fish/guestfish-actions.pod:2210
18820 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
18825 #: ../fish/guestfish-actions.pod:2216
18826 msgid "lvm-remove-all"
18830 #: ../fish/guestfish-actions.pod:2218
18833 " lvm-remove-all\n"
18838 #: ../fish/guestfish-actions.pod:2226
18839 msgid "lvm-set-filter"
18843 #: ../fish/guestfish-actions.pod:2228
18846 " lvm-set-filter 'devices ...'\n"
18851 #: ../fish/guestfish-actions.pod:2253
18856 #: ../fish/guestfish-actions.pod:2255
18859 " lvremove device\n"
18864 #: ../fish/guestfish-actions.pod:2263
18869 #: ../fish/guestfish-actions.pod:2265
18872 " lvrename logvol newlogvol\n"
18877 #: ../fish/guestfish-actions.pod:2269
18882 #: ../fish/guestfish-actions.pod:2271
18885 " lvresize device mbytes\n"
18890 #: ../fish/guestfish-actions.pod:2277
18891 msgid "lvresize-free"
18895 #: ../fish/guestfish-actions.pod:2279
18898 " lvresize-free lv percent\n"
18903 #: ../fish/guestfish-actions.pod:2287
18908 #: ../fish/guestfish-actions.pod:2289
18916 #: ../fish/guestfish-actions.pod:2297
18917 msgid "See also L</lvs-full>, L</list-filesystems>."
18921 #: ../fish/guestfish-actions.pod:2299
18926 #: ../fish/guestfish-actions.pod:2301
18934 #: ../fish/guestfish-actions.pod:2306
18939 #: ../fish/guestfish-actions.pod:2308
18947 #: ../fish/guestfish-actions.pod:2312
18952 #: ../fish/guestfish-actions.pod:2314
18955 " lxattrlist path 'names ...'\n"
18960 #: ../fish/guestfish-actions.pod:2330
18962 "This call is intended for programs that want to efficiently list a directory "
18963 "contents without making many round-trips. See also L</lstatlist> for a "
18964 "similarly efficient call for getting standard stats. Very long directory "
18965 "listings might cause the protocol message size to be exceeded, causing this "
18966 "call to fail. The caller must split up such requests into smaller groups of "
18971 #: ../fish/guestfish-actions.pod:2338
18976 #: ../fish/guestfish-actions.pod:2340
18984 #: ../fish/guestfish-actions.pod:2344
18989 #: ../fish/guestfish-actions.pod:2346
18992 " mkdir-mode path mode\n"
18997 #: ../fish/guestfish-actions.pod:2355
18998 msgid "See also L</mkdir>, L</umask>"
19002 #: ../fish/guestfish-actions.pod:2357
19007 #: ../fish/guestfish-actions.pod:2359
19015 #: ../fish/guestfish-actions.pod:2364
19020 #: ../fish/guestfish-actions.pod:2366
19023 " mkdtemp template\n"
19028 #: ../fish/guestfish-actions.pod:2387
19033 #: ../fish/guestfish-actions.pod:2389
19036 " mke2fs-J fstype blocksize device journal\n"
19041 #: ../fish/guestfish-actions.pod:2397
19042 msgid "See also L</mke2journal>."
19046 #: ../fish/guestfish-actions.pod:2399
19051 #: ../fish/guestfish-actions.pod:2401
19054 " mke2fs-JL fstype blocksize device label\n"
19059 #: ../fish/guestfish-actions.pod:2406
19060 msgid "See also L</mke2journal-L>."
19064 #: ../fish/guestfish-actions.pod:2408
19069 #: ../fish/guestfish-actions.pod:2410
19072 " mke2fs-JU fstype blocksize device uuid\n"
19077 #: ../fish/guestfish-actions.pod:2415
19078 msgid "See also L</mke2journal-U>."
19082 #: ../fish/guestfish-actions.pod:2417
19083 msgid "mke2journal"
19087 #: ../fish/guestfish-actions.pod:2419
19090 " mke2journal blocksize device\n"
19095 #: ../fish/guestfish-actions.pod:2426
19096 msgid "mke2journal-L"
19100 #: ../fish/guestfish-actions.pod:2428
19103 " mke2journal-L blocksize label device\n"
19108 #: ../fish/guestfish-actions.pod:2432
19109 msgid "mke2journal-U"
19113 #: ../fish/guestfish-actions.pod:2434
19116 " mke2journal-U blocksize uuid device\n"
19121 #: ../fish/guestfish-actions.pod:2438
19126 #: ../fish/guestfish-actions.pod:2440
19129 " mkfifo mode path\n"
19134 #: ../fish/guestfish-actions.pod:2442
19136 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
19137 "is just a convenient wrapper around L</mknod>."
19141 #: ../fish/guestfish-actions.pod:2448
19146 #: ../fish/guestfish-actions.pod:2450
19149 " mkfs fstype device\n"
19154 #: ../fish/guestfish-actions.pod:2456
19159 #: ../fish/guestfish-actions.pod:2458
19162 " mkfs-b fstype blocksize device\n"
19167 #: ../fish/guestfish-actions.pod:2460
19169 "This call is similar to L</mkfs>, but it allows you to control the block "
19170 "size of the resulting filesystem. Supported block sizes depend on the "
19171 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
19175 #: ../fish/guestfish-actions.pod:2468
19176 msgid "mkmountpoint"
19180 #: ../fish/guestfish-actions.pod:2470
19183 " mkmountpoint exemptpath\n"
19188 #: ../fish/guestfish-actions.pod:2472
19190 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
19191 "to create extra mountpoints before mounting the first filesystem."
19195 #: ../fish/guestfish-actions.pod:2496
19200 #: ../fish/guestfish-actions.pod:2498
19203 " mknod mode devmajor devminor path\n"
19208 #: ../fish/guestfish-actions.pod:2508
19210 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
19211 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
19212 "regular file). These constants are available in the standard Linux header "
19213 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
19214 "wrappers around this command which bitwise OR in the appropriate constant "
19219 #: ../fish/guestfish-actions.pod:2518
19224 #: ../fish/guestfish-actions.pod:2520
19227 " mknod-b mode devmajor devminor path\n"
19232 #: ../fish/guestfish-actions.pod:2522
19234 "This call creates a block device node called C<path> with mode C<mode> and "
19235 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19236 "wrapper around L</mknod>."
19240 #: ../fish/guestfish-actions.pod:2528
19245 #: ../fish/guestfish-actions.pod:2530
19248 " mknod-c mode devmajor devminor path\n"
19253 #: ../fish/guestfish-actions.pod:2532
19255 "This call creates a char device node called C<path> with mode C<mode> and "
19256 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
19257 "wrapper around L</mknod>."
19261 #: ../fish/guestfish-actions.pod:2538
19266 #: ../fish/guestfish-actions.pod:2540
19274 #: ../fish/guestfish-actions.pod:2544
19279 #: ../fish/guestfish-actions.pod:2546
19282 " mkswap-L label device\n"
19287 #: ../fish/guestfish-actions.pod:2554
19292 #: ../fish/guestfish-actions.pod:2556
19295 " mkswap-U uuid device\n"
19300 #: ../fish/guestfish-actions.pod:2560
19301 msgid "mkswap-file"
19305 #: ../fish/guestfish-actions.pod:2562
19308 " mkswap-file path\n"
19313 #: ../fish/guestfish-actions.pod:2566
19315 "This command just writes a swap file signature to an existing file. To "
19316 "create the file itself, use something like L</fallocate>."
19320 #: ../fish/guestfish-actions.pod:2569
19325 #: ../fish/guestfish-actions.pod:2571
19328 " modprobe modulename\n"
19333 #: ../fish/guestfish-actions.pod:2578
19338 #: ../fish/guestfish-actions.pod:2580
19341 " mount device mountpoint\n"
19346 #: ../fish/guestfish-actions.pod:2596
19348 "B<Important note:> When you use this call, the filesystem options C<sync> "
19349 "and C<noatime> are set implicitly. This was originally done because we "
19350 "thought it would improve reliability, but it turns out that I<-o sync> has a "
19351 "very large negative performance impact and negligible effect on "
19352 "reliability. Therefore we recommend that you avoid using L</mount> in any "
19353 "code that needs performance, and instead use L</mount-options> (use an empty "
19354 "string for the first parameter if you don't want any options)."
19358 #: ../fish/guestfish-actions.pod:2606
19363 #: ../fish/guestfish-actions.pod:2608
19366 " mount-loop file mountpoint\n"
19371 #: ../fish/guestfish-actions.pod:2614
19372 msgid "mount-options"
19376 #: ../fish/guestfish-actions.pod:2616
19379 " mount-options options device mountpoint\n"
19384 #: ../fish/guestfish-actions.pod:2618
19386 "This is the same as the L</mount> command, but it allows you to set the "
19387 "mount options as for the L<mount(8)> I<-o> flag."
19391 #: ../fish/guestfish-actions.pod:2626
19396 #: ../fish/guestfish-actions.pod:2628
19399 " mount-ro device mountpoint\n"
19404 #: ../fish/guestfish-actions.pod:2630
19406 "This is the same as the L</mount> command, but it mounts the filesystem with "
19407 "the read-only (I<-o ro>) flag."
19411 #: ../fish/guestfish-actions.pod:2633
19416 #: ../fish/guestfish-actions.pod:2635
19419 " mount-vfs options vfstype device mountpoint\n"
19424 #: ../fish/guestfish-actions.pod:2637
19426 "This is the same as the L</mount> command, but it allows you to set both the "
19427 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
19431 #: ../fish/guestfish-actions.pod:2641
19432 msgid "mountpoints"
19436 #: ../fish/guestfish-actions.pod:2643
19444 #: ../fish/guestfish-actions.pod:2645
19446 "This call is similar to L</mounts>. That call returns a list of devices. "
19447 "This one returns a hash table (map) of device name to directory where the "
19448 "device is mounted."
19452 #: ../fish/guestfish-actions.pod:2649
19457 #: ../fish/guestfish-actions.pod:2651
19465 #: ../fish/guestfish-actions.pod:2658
19466 msgid "See also: L</mountpoints>"
19470 #: ../fish/guestfish-actions.pod:2660
19475 #: ../fish/guestfish-actions.pod:2662
19483 #: ../fish/guestfish-actions.pod:2667
19484 msgid "ntfs-3g-probe"
19488 #: ../fish/guestfish-actions.pod:2669
19491 " ntfs-3g-probe true|false device\n"
19496 #: ../fish/guestfish-actions.pod:2683
19501 #: ../fish/guestfish-actions.pod:2685
19504 " ntfsresize device\n"
19509 #: ../fish/guestfish-actions.pod:2691
19510 msgid "ntfsresize-size"
19514 #: ../fish/guestfish-actions.pod:2693
19517 " ntfsresize-size device size\n"
19522 #: ../fish/guestfish-actions.pod:2695
19524 "This command is the same as L</ntfsresize> except that it allows you to "
19525 "specify the new size (in bytes) explicitly."
19529 #: ../fish/guestfish-actions.pod:2698
19534 #: ../fish/guestfish-actions.pod:2700
19537 " part-add device prlogex startsect endsect\n"
19542 #: ../fish/guestfish-actions.pod:2702
19544 "This command adds a partition to C<device>. If there is no partition table "
19545 "on the device, call L</part-init> first."
19549 #: ../fish/guestfish-actions.pod:2714
19551 "Creating a partition which covers the whole disk is not so easy. Use "
19552 "L</part-disk> to do that."
19556 #: ../fish/guestfish-actions.pod:2717
19561 #: ../fish/guestfish-actions.pod:2719
19564 " part-del device partnum\n"
19569 #: ../fish/guestfish-actions.pod:2727
19574 #: ../fish/guestfish-actions.pod:2729
19577 " part-disk device parttype\n"
19582 #: ../fish/guestfish-actions.pod:2731
19584 "This command is simply a combination of L</part-init> followed by "
19585 "L</part-add> to create a single primary partition covering the whole disk."
19589 #: ../fish/guestfish-actions.pod:2735
19591 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
19592 "possible values are described in L</part-init>."
19596 #: ../fish/guestfish-actions.pod:2741
19597 msgid "part-get-bootable"
19601 #: ../fish/guestfish-actions.pod:2743
19604 " part-get-bootable device partnum\n"
19609 #: ../fish/guestfish-actions.pod:2748
19610 msgid "See also L</part-set-bootable>."
19614 #: ../fish/guestfish-actions.pod:2750
19615 msgid "part-get-mbr-id"
19619 #: ../fish/guestfish-actions.pod:2752
19622 " part-get-mbr-id device partnum\n"
19627 #: ../fish/guestfish-actions.pod:2757 ../fish/guestfish-actions.pod:2895
19629 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
19630 "undefined results for other partition table types (see "
19631 "L</part-get-parttype>)."
19635 #: ../fish/guestfish-actions.pod:2761
19636 msgid "part-get-parttype"
19640 #: ../fish/guestfish-actions.pod:2763
19643 " part-get-parttype device\n"
19648 #: ../fish/guestfish-actions.pod:2768
19650 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
19651 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
19652 "possible, although unusual. See L</part-init> for a full list."
19656 #: ../fish/guestfish-actions.pod:2773
19661 #: ../fish/guestfish-actions.pod:2775
19664 " part-init device parttype\n"
19669 #: ../fish/guestfish-actions.pod:2781
19671 "Initially there are no partitions. Following this, you should call "
19672 "L</part-add> for each partition required."
19676 #: ../fish/guestfish-actions.pod:2844
19681 #: ../fish/guestfish-actions.pod:2846
19684 " part-list device\n"
19689 #: ../fish/guestfish-actions.pod:2861
19691 "Start of the partition I<in bytes>. To get sectors you have to divide by "
19692 "the device's sector size, see L</blockdev-getss>."
19696 #: ../fish/guestfish-actions.pod:2874
19697 msgid "part-set-bootable"
19701 #: ../fish/guestfish-actions.pod:2876
19704 " part-set-bootable device partnum true|false\n"
19709 #: ../fish/guestfish-actions.pod:2885
19710 msgid "part-set-mbr-id"
19714 #: ../fish/guestfish-actions.pod:2887
19717 " part-set-mbr-id device partnum idbyte\n"
19722 #: ../fish/guestfish-actions.pod:2899
19723 msgid "part-set-name"
19727 #: ../fish/guestfish-actions.pod:2901
19730 " part-set-name device partnum name\n"
19735 #: ../fish/guestfish-actions.pod:2909
19736 msgid "part-to-dev"
19740 #: ../fish/guestfish-actions.pod:2911
19743 " part-to-dev partition\n"
19748 #: ../fish/guestfish-actions.pod:2917
19750 "The named partition must exist, for example as a string returned from "
19751 "L</list-partitions>."
19755 #: ../fish/guestfish-actions.pod:2920
19756 msgid "ping-daemon"
19760 #: ../fish/guestfish-actions.pod:2922
19768 #: ../fish/guestfish-actions.pod:2929
19773 #: ../fish/guestfish-actions.pod:2931
19776 " pread path count offset\n"
19781 #: ../fish/guestfish-actions.pod:2939
19782 msgid "See also L</pwrite>."
19786 #: ../fish/guestfish-actions.pod:2944
19791 #: ../fish/guestfish-actions.pod:2946
19794 " pvcreate device\n"
19799 #: ../fish/guestfish-actions.pod:2952
19804 #: ../fish/guestfish-actions.pod:2954
19807 " pvremove device\n"
19812 #: ../fish/guestfish-actions.pod:2963
19817 #: ../fish/guestfish-actions.pod:2965
19820 " pvresize device\n"
19825 #: ../fish/guestfish-actions.pod:2970
19826 msgid "pvresize-size"
19830 #: ../fish/guestfish-actions.pod:2972
19833 " pvresize-size device size\n"
19838 #: ../fish/guestfish-actions.pod:2974
19840 "This command is the same as L</pvresize> except that it allows you to "
19841 "specify the new size (in bytes) explicitly."
19845 #: ../fish/guestfish-actions.pod:2977
19850 #: ../fish/guestfish-actions.pod:2979
19858 #: ../fish/guestfish-actions.pod:2987
19859 msgid "See also L</pvs-full>."
19863 #: ../fish/guestfish-actions.pod:2989
19868 #: ../fish/guestfish-actions.pod:2991
19876 #: ../fish/guestfish-actions.pod:2996
19881 #: ../fish/guestfish-actions.pod:2998
19889 #: ../fish/guestfish-actions.pod:3002
19894 #: ../fish/guestfish-actions.pod:3004
19897 " pwrite path content offset\n"
19902 #: ../fish/guestfish-actions.pod:3015
19903 msgid "See also L</pread>."
19907 #: ../fish/guestfish-actions.pod:3020
19912 #: ../fish/guestfish-actions.pod:3022
19915 " read-file path\n"
19920 #: ../fish/guestfish-actions.pod:3027
19922 "Unlike L</cat>, this function can correctly handle files that contain "
19923 "embedded ASCII NUL characters. However unlike L</download>, this function "
19924 "is limited in the total size of file that can be handled."
19928 #: ../fish/guestfish-actions.pod:3035
19933 #: ../fish/guestfish-actions.pod:3037
19936 " read-lines path\n"
19941 #: ../fish/guestfish-actions.pod:3044
19943 "Note that this function cannot correctly handle binary files (specifically, "
19944 "files containing C<\\0> character which is treated as end of line). For "
19945 "those you need to use the L</read-file> function which has a more complex "
19950 #: ../fish/guestfish-actions.pod:3049
19955 #: ../fish/guestfish-actions.pod:3051
19963 #: ../fish/guestfish-actions.pod:3103
19965 "This function is primarily intended for use by programs. To get a simple "
19966 "list of names, use L</ls>. To get a printable directory for human "
19967 "consumption, use L</ll>."
19971 #: ../fish/guestfish-actions.pod:3107
19976 #: ../fish/guestfish-actions.pod:3109
19984 #: ../fish/guestfish-actions.pod:3113
19985 msgid "readlinklist"
19989 #: ../fish/guestfish-actions.pod:3115
19992 " readlinklist path 'names ...'\n"
19997 #: ../fish/guestfish-actions.pod:3139
20002 #: ../fish/guestfish-actions.pod:3141
20010 #: ../fish/guestfish-actions.pod:3146
20011 msgid "removexattr"
20015 #: ../fish/guestfish-actions.pod:3148
20018 " removexattr xattr path\n"
20023 #: ../fish/guestfish-actions.pod:3153
20024 msgid "See also: L</lremovexattr>, L<attr(5)>."
20028 #: ../fish/guestfish-actions.pod:3155
20033 #: ../fish/guestfish-actions.pod:3157
20036 " resize2fs device\n"
20041 #: ../fish/guestfish-actions.pod:3162
20043 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
20044 "before calling this command. For unknown reasons C<resize2fs> sometimes "
20045 "gives an error about this and sometimes not. In any case, it is always safe "
20046 "to call L</e2fsck-f> before calling this function."
20050 #: ../fish/guestfish-actions.pod:3168
20051 msgid "resize2fs-size"
20055 #: ../fish/guestfish-actions.pod:3170
20058 " resize2fs-size device size\n"
20063 #: ../fish/guestfish-actions.pod:3172
20065 "This command is the same as L</resize2fs> except that it allows you to "
20066 "specify the new size (in bytes) explicitly."
20070 #: ../fish/guestfish-actions.pod:3175
20075 #: ../fish/guestfish-actions.pod:3177
20083 #: ../fish/guestfish-actions.pod:3181
20088 #: ../fish/guestfish-actions.pod:3183
20096 #: ../fish/guestfish-actions.pod:3189
20101 #: ../fish/guestfish-actions.pod:3191
20109 #: ../fish/guestfish-actions.pod:3195
20110 msgid "rmmountpoint"
20114 #: ../fish/guestfish-actions.pod:3197
20117 " rmmountpoint exemptpath\n"
20122 #: ../fish/guestfish-actions.pod:3199
20124 "This calls removes a mountpoint that was previously created with "
20125 "L</mkmountpoint>. See L</mkmountpoint> for full details."
20129 #: ../fish/guestfish-actions.pod:3203
20130 msgid "scrub-device"
20134 #: ../fish/guestfish-actions.pod:3205
20137 " scrub-device device\n"
20142 #: ../fish/guestfish-actions.pod:3216
20147 #: ../fish/guestfish-actions.pod:3218
20150 " scrub-file file\n"
20155 #: ../fish/guestfish-actions.pod:3228
20156 msgid "scrub-freespace"
20160 #: ../fish/guestfish-actions.pod:3230
20163 " scrub-freespace dir\n"
20168 #: ../fish/guestfish-actions.pod:3232
20170 "This command creates the directory C<dir> and then fills it with files until "
20171 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
20172 "deletes them. The intention is to scrub any free space on the partition "
20173 "containing C<dir>."
20177 #: ../fish/guestfish-actions.pod:3241
20178 msgid "set-append | append"
20182 #: ../fish/guestfish-actions.pod:3243
20185 " set-append append\n"
20190 #: ../fish/guestfish-actions.pod:3254
20191 msgid "set-autosync | autosync"
20195 #: ../fish/guestfish-actions.pod:3256
20198 " set-autosync true|false\n"
20203 #: ../fish/guestfish-actions.pod:3258
20205 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
20206 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
20207 "closed (also if the program exits without closing handles)."
20211 #: ../fish/guestfish-actions.pod:3266
20212 msgid "set-direct | direct"
20216 #: ../fish/guestfish-actions.pod:3268
20219 " set-direct true|false\n"
20224 #: ../fish/guestfish-actions.pod:3274
20226 "One consequence of this is that log messages aren't caught by the library "
20227 "and handled by L</set-log-message-callback>, but go straight to stdout."
20231 #: ../fish/guestfish-actions.pod:3283
20232 msgid "set-e2label"
20236 #: ../fish/guestfish-actions.pod:3285
20239 " set-e2label device label\n"
20244 #: ../fish/guestfish-actions.pod:3291
20246 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
20247 "label on a filesystem."
20251 #: ../fish/guestfish-actions.pod:3294
20256 #: ../fish/guestfish-actions.pod:3296
20259 " set-e2uuid device uuid\n"
20264 #: ../fish/guestfish-actions.pod:3303
20266 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
20267 "UUID of a filesystem."
20271 #: ../fish/guestfish-actions.pod:3306
20272 msgid "set-memsize | memsize"
20276 #: ../fish/guestfish-actions.pod:3308
20279 " set-memsize memsize\n"
20284 #: ../fish/guestfish-actions.pod:3310
20286 "This sets the memory size in megabytes allocated to the qemu subprocess. "
20287 "This only has any effect if called before L</launch>."
20291 #: ../fish/guestfish-actions.pod:3321
20292 msgid "set-network | network"
20296 #: ../fish/guestfish-actions.pod:3323
20299 " set-network true|false\n"
20304 #: ../fish/guestfish-actions.pod:3331
20305 msgid "You must call this before calling L</launch>, otherwise it has no effect."
20309 #: ../fish/guestfish-actions.pod:3334
20310 msgid "set-path | path"
20314 #: ../fish/guestfish-actions.pod:3336
20317 " set-path searchpath\n"
20322 #: ../fish/guestfish-actions.pod:3345
20323 msgid "set-qemu | qemu"
20327 #: ../fish/guestfish-actions.pod:3347
20335 #: ../fish/guestfish-actions.pod:3367
20336 msgid "set-recovery-proc | recovery-proc"
20340 #: ../fish/guestfish-actions.pod:3369
20343 " set-recovery-proc true|false\n"
20348 #: ../fish/guestfish-actions.pod:3371
20350 "If this is called with the parameter C<false> then L</launch> does not "
20351 "create a recovery process. The purpose of the recovery process is to stop "
20352 "runaway qemu processes in the case where the main program aborts abruptly."
20356 #: ../fish/guestfish-actions.pod:3376
20358 "This only has any effect if called before L</launch>, and the default is "
20363 #: ../fish/guestfish-actions.pod:3385
20364 msgid "set-selinux | selinux"
20368 #: ../fish/guestfish-actions.pod:3387
20371 " set-selinux true|false\n"
20376 #: ../fish/guestfish-actions.pod:3398
20377 msgid "set-trace | trace"
20381 #: ../fish/guestfish-actions.pod:3400
20384 " set-trace true|false\n"
20389 #: ../fish/guestfish-actions.pod:3416
20390 msgid "set-verbose | verbose"
20394 #: ../fish/guestfish-actions.pod:3418
20397 " set-verbose true|false\n"
20402 #: ../fish/guestfish-actions.pod:3425
20407 #: ../fish/guestfish-actions.pod:3427
20410 " setcon context\n"
20415 #: ../fish/guestfish-actions.pod:3434
20420 #: ../fish/guestfish-actions.pod:3436
20423 " setxattr xattr val vallen path\n"
20428 #: ../fish/guestfish-actions.pod:3442
20429 msgid "See also: L</lsetxattr>, L<attr(5)>."
20433 #: ../fish/guestfish-actions.pod:3444
20438 #: ../fish/guestfish-actions.pod:3446
20441 " sfdisk device cyls heads sectors 'lines ...'\n"
20446 #: ../fish/guestfish-actions.pod:3468
20447 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
20451 #: ../fish/guestfish-actions.pod:3474
20456 #: ../fish/guestfish-actions.pod:3476
20459 " sfdiskM device 'lines ...'\n"
20464 #: ../fish/guestfish-actions.pod:3478
20466 "This is a simplified interface to the L</sfdisk> command, where partition "
20467 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
20468 "you don't need to specify the cyls, heads and sectors parameters which were "
20469 "rarely if ever used anyway."
20473 #: ../fish/guestfish-actions.pod:3484
20474 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
20478 #: ../fish/guestfish-actions.pod:3490
20483 #: ../fish/guestfish-actions.pod:3492
20486 " sfdisk-N device partnum cyls heads sectors line\n"
20491 #: ../fish/guestfish-actions.pod:3497
20493 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
20494 "cyls/heads/sectors parameters."
20498 #: ../fish/guestfish-actions.pod:3500
20499 msgid "See also: L</part-add>"
20503 #: ../fish/guestfish-actions.pod:3505
20504 msgid "sfdisk-disk-geometry"
20508 #: ../fish/guestfish-actions.pod:3507
20511 " sfdisk-disk-geometry device\n"
20516 #: ../fish/guestfish-actions.pod:3509
20518 "This displays the disk geometry of C<device> read from the partition table. "
20519 "Especially in the case where the underlying block device has been resized, "
20520 "this can be different from the kernel's idea of the geometry (see "
20521 "L</sfdisk-kernel-geometry>)."
20525 #: ../fish/guestfish-actions.pod:3517
20526 msgid "sfdisk-kernel-geometry"
20530 #: ../fish/guestfish-actions.pod:3519
20533 " sfdisk-kernel-geometry device\n"
20538 #: ../fish/guestfish-actions.pod:3526
20543 #: ../fish/guestfish-actions.pod:3528
20546 " sfdisk-l device\n"
20551 #: ../fish/guestfish-actions.pod:3534
20552 msgid "See also: L</part-list>"
20556 #: ../fish/guestfish-actions.pod:3536
20561 #: ../fish/guestfish-actions.pod:3538
20569 #: ../fish/guestfish-actions.pod:3543
20570 msgid "This is like L</command>, but passes the command to:"
20574 #: ../fish/guestfish-actions.pod:3551
20575 msgid "All the provisos about L</command> apply to this call."
20579 #: ../fish/guestfish-actions.pod:3553
20584 #: ../fish/guestfish-actions.pod:3555
20587 " sh-lines command\n"
20592 #: ../fish/guestfish-actions.pod:3557
20593 msgid "This is the same as L</sh>, but splits the result into a list of lines."
20597 #: ../fish/guestfish-actions.pod:3560
20598 msgid "See also: L</command-lines>"
20602 #: ../fish/guestfish-actions.pod:3562
20607 #: ../fish/guestfish-actions.pod:3564
20615 #: ../fish/guestfish-actions.pod:3568
20620 #: ../fish/guestfish-actions.pod:3570
20628 #: ../fish/guestfish-actions.pod:3576
20633 #: ../fish/guestfish-actions.pod:3578
20641 #: ../fish/guestfish-actions.pod:3586
20646 #: ../fish/guestfish-actions.pod:3588
20654 #: ../fish/guestfish-actions.pod:3596
20659 #: ../fish/guestfish-actions.pod:3598
20662 " strings-e encoding path\n"
20667 #: ../fish/guestfish-actions.pod:3600
20669 "This is like the L</strings> command, but allows you to specify the encoding "
20670 "of strings that are looked for in the source file C<path>."
20674 #: ../fish/guestfish-actions.pod:3610
20676 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
20677 "ISO-8859-X (this is what L</strings> uses)."
20681 #: ../fish/guestfish-actions.pod:3642
20682 msgid "swapoff-device"
20686 #: ../fish/guestfish-actions.pod:3644
20689 " swapoff-device device\n"
20694 #: ../fish/guestfish-actions.pod:3646
20696 "This command disables the libguestfs appliance swap device or partition "
20697 "named C<device>. See L</swapon-device>."
20701 #: ../fish/guestfish-actions.pod:3650
20702 msgid "swapoff-file"
20706 #: ../fish/guestfish-actions.pod:3652
20709 " swapoff-file file\n"
20714 #: ../fish/guestfish-actions.pod:3656
20715 msgid "swapoff-label"
20719 #: ../fish/guestfish-actions.pod:3658
20722 " swapoff-label label\n"
20727 #: ../fish/guestfish-actions.pod:3663
20728 msgid "swapoff-uuid"
20732 #: ../fish/guestfish-actions.pod:3665
20735 " swapoff-uuid uuid\n"
20740 #: ../fish/guestfish-actions.pod:3670
20741 msgid "swapon-device"
20745 #: ../fish/guestfish-actions.pod:3672
20748 " swapon-device device\n"
20753 #: ../fish/guestfish-actions.pod:3674
20755 "This command enables the libguestfs appliance to use the swap device or "
20756 "partition named C<device>. The increased memory is made available for all "
20757 "commands, for example those run using L</command> or L</sh>."
20761 #: ../fish/guestfish-actions.pod:3686
20762 msgid "swapon-file"
20766 #: ../fish/guestfish-actions.pod:3688
20769 " swapon-file file\n"
20774 #: ../fish/guestfish-actions.pod:3690
20775 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
20779 #: ../fish/guestfish-actions.pod:3693
20780 msgid "swapon-label"
20784 #: ../fish/guestfish-actions.pod:3695
20787 " swapon-label label\n"
20792 #: ../fish/guestfish-actions.pod:3697
20794 "This command enables swap to a labeled swap partition. See "
20795 "L</swapon-device> for other notes."
20799 #: ../fish/guestfish-actions.pod:3700
20800 msgid "swapon-uuid"
20804 #: ../fish/guestfish-actions.pod:3702
20807 " swapon-uuid uuid\n"
20812 #: ../fish/guestfish-actions.pod:3704
20814 "This command enables swap to a swap partition with the given UUID. See "
20815 "L</swapon-device> for other notes."
20819 #: ../fish/guestfish-actions.pod:3707
20824 #: ../fish/guestfish-actions.pod:3709
20832 #: ../fish/guestfish-actions.pod:3717
20837 #: ../fish/guestfish-actions.pod:3719
20845 #: ../fish/guestfish-actions.pod:3727
20850 #: ../fish/guestfish-actions.pod:3729
20853 " tail-n nrlines path\n"
20858 #: ../fish/guestfish-actions.pod:3742
20863 #: ../fish/guestfish-actions.pod:3744
20866 " tar-in (tarfile|-) directory\n"
20871 #: ../fish/guestfish-actions.pod:3749
20872 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
20876 #: ../fish/guestfish-actions.pod:3754
20881 #: ../fish/guestfish-actions.pod:3756
20884 " tar-out directory (tarfile|-)\n"
20889 #: ../fish/guestfish-actions.pod:3761
20890 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
20894 #: ../fish/guestfish-actions.pod:3766
20899 #: ../fish/guestfish-actions.pod:3768
20902 " tgz-in (tarball|-) directory\n"
20907 #: ../fish/guestfish-actions.pod:3773
20908 msgid "To upload an uncompressed tarball, use L</tar-in>."
20912 #: ../fish/guestfish-actions.pod:3777
20917 #: ../fish/guestfish-actions.pod:3779
20920 " tgz-out directory (tarball|-)\n"
20925 #: ../fish/guestfish-actions.pod:3784
20926 msgid "To download an uncompressed tarball, use L</tar-out>."
20930 #: ../fish/guestfish-actions.pod:3788
20935 #: ../fish/guestfish-actions.pod:3790
20943 #: ../fish/guestfish-actions.pod:3799
20948 #: ../fish/guestfish-actions.pod:3801
20956 #: ../fish/guestfish-actions.pod:3806
20957 msgid "truncate-size"
20961 #: ../fish/guestfish-actions.pod:3808
20964 " truncate-size path size\n"
20969 #: ../fish/guestfish-actions.pod:3813
20971 "If the current file size is less than C<size> then the file is extended to "
20972 "the required size with zero bytes. This creates a sparse file (ie. disk "
20973 "blocks are not allocated for the file until you write to it). To create a "
20974 "non-sparse file of zeroes, use L</fallocate64> instead."
20978 #: ../fish/guestfish-actions.pod:3819
20983 #: ../fish/guestfish-actions.pod:3821
20986 " tune2fs-l device\n"
20991 #: ../fish/guestfish-actions.pod:3831
20996 #: ../fish/guestfish-actions.pod:3833
20999 " txz-in (tarball|-) directory\n"
21004 #: ../fish/guestfish-actions.pod:3840
21009 #: ../fish/guestfish-actions.pod:3842
21012 " txz-out directory (tarball|-)\n"
21017 #: ../fish/guestfish-actions.pod:3849
21022 #: ../fish/guestfish-actions.pod:3851
21030 #: ../fish/guestfish-actions.pod:3865
21031 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
21035 #: ../fish/guestfish-actions.pod:3870
21036 msgid "umount | unmount"
21040 #: ../fish/guestfish-actions.pod:3872
21043 " umount pathordevice\n"
21048 #: ../fish/guestfish-actions.pod:3878
21049 msgid "umount-all | unmount-all"
21053 #: ../fish/guestfish-actions.pod:3880
21061 #: ../fish/guestfish-actions.pod:3886
21066 #: ../fish/guestfish-actions.pod:3888
21069 " upload (filename|-) remotefilename\n"
21074 #: ../fish/guestfish-actions.pod:3895
21075 msgid "See also L</download>."
21079 #: ../fish/guestfish-actions.pod:3899
21084 #: ../fish/guestfish-actions.pod:3901
21087 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
21092 #: ../fish/guestfish-actions.pod:3920
21097 #: ../fish/guestfish-actions.pod:3922
21105 #: ../fish/guestfish-actions.pod:3949
21107 "I<Note:> Don't use this call to test for availability of features. In "
21108 "enterprise distributions we backport features from later versions into "
21109 "earlier versions, making this an unreliable way to test for features. Use "
21110 "L</available> instead."
21114 #: ../fish/guestfish-actions.pod:3955
21119 #: ../fish/guestfish-actions.pod:3957
21122 " vfs-label device\n"
21127 #: ../fish/guestfish-actions.pod:3964
21128 msgid "To find a filesystem from the label, use L</findfs-label>."
21132 #: ../fish/guestfish-actions.pod:3966
21137 #: ../fish/guestfish-actions.pod:3968
21140 " vfs-type device\n"
21145 #: ../fish/guestfish-actions.pod:3978
21150 #: ../fish/guestfish-actions.pod:3980
21153 " vfs-uuid device\n"
21158 #: ../fish/guestfish-actions.pod:3987
21159 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
21163 #: ../fish/guestfish-actions.pod:3989
21164 msgid "vg-activate"
21168 #: ../fish/guestfish-actions.pod:3991
21171 " vg-activate true|false 'volgroups ...'\n"
21176 #: ../fish/guestfish-actions.pod:4004
21177 msgid "vg-activate-all"
21181 #: ../fish/guestfish-actions.pod:4006
21184 " vg-activate-all true|false\n"
21189 #: ../fish/guestfish-actions.pod:4016
21194 #: ../fish/guestfish-actions.pod:4018
21197 " vgcreate volgroup 'physvols ...'\n"
21202 #: ../fish/guestfish-actions.pod:4023
21207 #: ../fish/guestfish-actions.pod:4025
21210 " vglvuuids vgname\n"
21215 #: ../fish/guestfish-actions.pod:4030
21217 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
21218 "logical volumes and volume groups."
21222 #: ../fish/guestfish-actions.pod:4033
21223 msgid "See also L</vgpvuuids>."
21227 #: ../fish/guestfish-actions.pod:4035
21232 #: ../fish/guestfish-actions.pod:4037
21235 " vgpvuuids vgname\n"
21240 #: ../fish/guestfish-actions.pod:4042
21242 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
21243 "physical volumes and volume groups."
21247 #: ../fish/guestfish-actions.pod:4045
21248 msgid "See also L</vglvuuids>."
21252 #: ../fish/guestfish-actions.pod:4047
21257 #: ../fish/guestfish-actions.pod:4049
21260 " vgremove vgname\n"
21265 #: ../fish/guestfish-actions.pod:4056
21270 #: ../fish/guestfish-actions.pod:4058
21273 " vgrename volgroup newvolgroup\n"
21278 #: ../fish/guestfish-actions.pod:4062
21283 #: ../fish/guestfish-actions.pod:4064
21291 #: ../fish/guestfish-actions.pod:4072
21292 msgid "See also L</vgs-full>."
21296 #: ../fish/guestfish-actions.pod:4074
21301 #: ../fish/guestfish-actions.pod:4076
21309 #: ../fish/guestfish-actions.pod:4081
21314 #: ../fish/guestfish-actions.pod:4083
21322 #: ../fish/guestfish-actions.pod:4088
21327 #: ../fish/guestfish-actions.pod:4090
21335 #: ../fish/guestfish-actions.pod:4094
21340 #: ../fish/guestfish-actions.pod:4096
21348 #: ../fish/guestfish-actions.pod:4101
21353 #: ../fish/guestfish-actions.pod:4103
21361 #: ../fish/guestfish-actions.pod:4108
21366 #: ../fish/guestfish-actions.pod:4110
21374 #: ../fish/guestfish-actions.pod:4115
21379 #: ../fish/guestfish-actions.pod:4117
21382 " write path content\n"
21387 #: ../fish/guestfish-actions.pod:4125
21392 #: ../fish/guestfish-actions.pod:4127
21395 " write-file path content size\n"
21400 #: ../fish/guestfish-actions.pod:4150
21405 #: ../fish/guestfish-actions.pod:4152
21408 " zegrep regex path\n"
21413 #: ../fish/guestfish-actions.pod:4160
21418 #: ../fish/guestfish-actions.pod:4162
21421 " zegrepi regex path\n"
21426 #: ../fish/guestfish-actions.pod:4170
21431 #: ../fish/guestfish-actions.pod:4172
21439 #: ../fish/guestfish-actions.pod:4180
21440 msgid "See also: L</zero-device>, L</scrub-device>."
21444 #: ../fish/guestfish-actions.pod:4182
21445 msgid "zero-device"
21449 #: ../fish/guestfish-actions.pod:4184
21452 " zero-device device\n"
21457 #: ../fish/guestfish-actions.pod:4186
21459 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
21460 "which just zeroes the first few blocks of a device."
21464 #: ../fish/guestfish-actions.pod:4193
21469 #: ../fish/guestfish-actions.pod:4195
21472 " zerofree device\n"
21477 #: ../fish/guestfish-actions.pod:4208
21482 #: ../fish/guestfish-actions.pod:4210
21485 " zfgrep pattern path\n"
21490 #: ../fish/guestfish-actions.pod:4218
21495 #: ../fish/guestfish-actions.pod:4220
21498 " zfgrepi pattern path\n"
21503 #: ../fish/guestfish-actions.pod:4228
21508 #: ../fish/guestfish-actions.pod:4230
21511 " zfile meth path\n"
21516 #: ../fish/guestfish-actions.pod:4237
21517 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
21521 #: ../fish/guestfish-actions.pod:4247
21526 #: ../fish/guestfish-actions.pod:4249
21529 " zgrep regex path\n"
21534 #: ../fish/guestfish-actions.pod:4257
21539 #: ../fish/guestfish-actions.pod:4259
21542 " zgrepi regex path\n"
21547 #: ../fish/guestfish-commands.pod:1
21552 #: ../fish/guestfish-commands.pod:3
21557 #: ../fish/guestfish-commands.pod:5
21560 " alloc filename size\n"
21565 #: ../fish/guestfish-commands.pod:7
21567 "This creates an empty (zeroed) file of the given size, and then adds so it "
21568 "can be further examined."
21572 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:132
21573 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
21577 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:134
21578 msgid "Size can be specified using standard suffixes, eg. C<1M>."
21582 #: ../fish/guestfish-commands.pod:14
21584 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
21585 "image, see L</PREPARED DISK IMAGES>."
21589 #: ../fish/guestfish-commands.pod:17
21594 #: ../fish/guestfish-commands.pod:19
21597 " copy-in local [local ...] /remotedir\n"
21602 #: ../fish/guestfish-commands.pod:21
21604 "C<copy-in> copies local files or directories recursively into the disk "
21605 "image, placing them in the directory called C</remotedir> (which must "
21606 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
21607 "other commands as necessary."
21611 #: ../fish/guestfish-commands.pod:26
21613 "Multiple local files and directories can be specified, but the last "
21614 "parameter must always be a remote directory. Wildcards cannot be used."
21618 #: ../fish/guestfish-commands.pod:30
21623 #: ../fish/guestfish-commands.pod:32
21626 " copy-out remote [remote ...] localdir\n"
21631 #: ../fish/guestfish-commands.pod:34
21633 "C<copy-out> copies remote files or directories recursively out of the disk "
21634 "image, placing them on the host disk in a local directory called C<localdir> "
21635 "(which must exist). This guestfish meta-command turns into a sequence of "
21636 "L</download>, L</tar-out> and other commands as necessary."
21640 #: ../fish/guestfish-commands.pod:40
21642 "Multiple remote files and directories can be specified, but the last "
21643 "parameter must always be a local directory. To download to the current "
21644 "directory, use C<.> as in:"
21648 #: ../fish/guestfish-commands.pod:44
21651 " copy-out /home .\n"
21656 #: ../fish/guestfish-commands.pod:46
21658 "Wildcards cannot be used in the ordinary command, but you can use them with "
21659 "the help of L</glob> like this:"
21663 #: ../fish/guestfish-commands.pod:49
21666 " glob copy-out /home/* .\n"
21671 #: ../fish/guestfish-commands.pod:51
21676 #: ../fish/guestfish-commands.pod:53
21679 " echo [params ...]\n"
21684 #: ../fish/guestfish-commands.pod:55
21685 msgid "This echos the parameters to the terminal."
21689 #: ../fish/guestfish-commands.pod:57
21694 #: ../fish/guestfish-commands.pod:59
21699 #: ../fish/guestfish-commands.pod:61
21704 #: ../fish/guestfish-commands.pod:63
21712 #: ../fish/guestfish-commands.pod:65
21714 "This is used to edit a file. It downloads the file, edits it locally using "
21715 "your editor, then uploads the result."
21719 #: ../fish/guestfish-commands.pod:68
21721 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
21722 "or C<emacs> you will get those corresponding editors."
21726 #: ../fish/guestfish-commands.pod:72
21731 #: ../fish/guestfish-commands.pod:74
21734 " glob command args...\n"
21739 #: ../fish/guestfish-commands.pod:76
21741 "Expand wildcards in any paths in the args list, and run C<command> "
21742 "repeatedly on each matching path."
21746 #: ../fish/guestfish-commands.pod:79
21747 msgid "See L</WILDCARDS AND GLOBBING>."
21751 #: ../fish/guestfish-commands.pod:81
21756 #: ../fish/guestfish-commands.pod:83
21764 #: ../fish/guestfish-commands.pod:85
21765 msgid "Change the local directory, ie. the current directory of guestfish itself."
21769 #: ../fish/guestfish-commands.pod:88
21770 msgid "Note that C<!cd> won't do what you might expect."
21774 #: ../fish/guestfish-commands.pod:90
21779 #: ../fish/guestfish-commands.pod:92
21784 #: ../fish/guestfish-commands.pod:94
21792 #: ../fish/guestfish-commands.pod:96
21793 msgid "Opens the manual page for guestfish."
21797 #: ../fish/guestfish-commands.pod:98
21802 #: ../fish/guestfish-commands.pod:100
21807 #: ../fish/guestfish-commands.pod:102
21815 #: ../fish/guestfish-commands.pod:104
21823 #: ../fish/guestfish-commands.pod:106
21824 msgid "This is used to view a file."
21828 #: ../fish/guestfish-commands.pod:108
21830 "The default viewer is C<$PAGER>. However if you use the alternate command "
21831 "C<less> you will get the C<less> command specifically."
21835 #: ../fish/guestfish-commands.pod:111
21840 #: ../fish/guestfish-commands.pod:113
21848 #: ../fish/guestfish-commands.pod:115
21850 "Close and reopen the libguestfs handle. It is not necessary to use this "
21851 "normally, because the handle is closed properly when guestfish exits. "
21852 "However this is occasionally useful for testing."
21856 #: ../fish/guestfish-commands.pod:119
21861 #: ../fish/guestfish-commands.pod:121
21864 " sparse filename size\n"
21869 #: ../fish/guestfish-commands.pod:123
21871 "This creates an empty sparse file of the given size, and then adds so it can "
21872 "be further examined."
21876 #: ../fish/guestfish-commands.pod:126
21878 "In all respects it works the same as the L</alloc> command, except that the "
21879 "image file is allocated sparsely, which means that disk blocks are not "
21880 "assigned to the file until they are needed. Sparse disk files only use "
21881 "space when written to, but they are slower and there is a danger you could "
21882 "run out of real disk space during a write operation."
21886 #: ../fish/guestfish-commands.pod:136
21891 #: ../fish/guestfish-commands.pod:138
21899 #: ../fish/guestfish-commands.pod:140
21901 "This command returns a list of the optional groups known to the daemon, and "
21902 "indicates which ones are supported by this build of the libguestfs "
21907 #: ../fish/guestfish-commands.pod:144
21908 msgid "See also L<guestfs(3)/AVAILABILITY>."
21912 #: ../fish/guestfish-commands.pod:146
21917 #: ../fish/guestfish-commands.pod:148
21920 " time command args...\n"
21925 #: ../fish/guestfish-commands.pod:150
21927 "Run the command as usual, but print the elapsed time afterwards. This can "
21928 "be useful for benchmarking operations."
21932 #: ../test-tool/libguestfs-test-tool.pod:5
21933 msgid "libguestfs-test-tool - End user tests for libguestfs"
21937 #: ../test-tool/libguestfs-test-tool.pod:9
21940 " libguestfs-test-tool [--options]\n"
21945 #: ../test-tool/libguestfs-test-tool.pod:13
21947 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
21948 "and developers, to allow them to check basic libguestfs functionality is "
21949 "working. This is needed because libguestfs occasionally breaks for reasons "
21950 "beyond our control: usually because of changes in the underlying qemu or "
21951 "kernel packages, or the host environment."
21955 #: ../test-tool/libguestfs-test-tool.pod:20
21956 msgid "If you suspect a problem in libguestfs, then just run:"
21960 #: ../test-tool/libguestfs-test-tool.pod:22
21963 " libguestfs-test-tool\n"
21968 #: ../test-tool/libguestfs-test-tool.pod:24
21969 msgid "It will print lots of diagnostic messages."
21973 #: ../test-tool/libguestfs-test-tool.pod:26
21974 msgid "If it runs to completion successfully, you will see this near the end:"
21978 #: ../test-tool/libguestfs-test-tool.pod:28
21981 " ===== TEST FINISHED OK =====\n"
21986 #: ../test-tool/libguestfs-test-tool.pod:30
21987 msgid "and the test tool will exit with code 0."
21991 #: ../test-tool/libguestfs-test-tool.pod:32
21993 "If it fails (and/or exits with non-zero error code), please paste the "
21994 "B<complete, unedited> output of the test tool into a bug report. More "
21995 "information about reporting bugs can be found on the "
21996 "L<http://libguestfs.org/> website."
22000 #: ../test-tool/libguestfs-test-tool.pod:41
22005 #: ../test-tool/libguestfs-test-tool.pod:43
22006 msgid "Display short usage information and exit."
22010 #: ../test-tool/libguestfs-test-tool.pod:45
22011 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
22015 #: ../test-tool/libguestfs-test-tool.pod:47
22017 "Pass an alternate name for the helper program. libguestfs-test-tool will "
22018 "normally look in the C<$libexec> directory that was configured when the tool "
22023 #: ../test-tool/libguestfs-test-tool.pod:51
22024 msgid "I<--qemu qemu_binary>"
22028 #: ../test-tool/libguestfs-test-tool.pod:53
22030 "If you have downloaded another qemu binary, point this option at the full "
22031 "path of the binary to try it."
22035 #: ../test-tool/libguestfs-test-tool.pod:56
22036 msgid "I<--qemudir qemu_source_dir>"
22040 #: ../test-tool/libguestfs-test-tool.pod:58
22042 "If you have compiled qemu from source, point this option at the source "
22043 "directory to try it."
22047 #: ../test-tool/libguestfs-test-tool.pod:61
22048 msgid "I<--timeout N>"
22052 #: ../test-tool/libguestfs-test-tool.pod:63
22054 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
22055 "does not usually need to be adjusted unless your machine is very slow."
22059 #: ../test-tool/libguestfs-test-tool.pod:69
22060 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
22064 #: ../test-tool/libguestfs-test-tool.pod:71
22066 "If you have compiled another version of qemu from source and would like to "
22067 "try that, then you can use the I<--qemudir> option to point to the qemu "
22068 "source directory."
22072 #: ../test-tool/libguestfs-test-tool.pod:75
22074 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
22075 "option to point to the binary."
22079 #: ../test-tool/libguestfs-test-tool.pod:78
22081 "When using an alternate qemu with libguestfs, usually you would need to "
22082 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
22083 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
22084 "when you use either of the I<--qemudir> or I<--qemu> options."
22088 #: ../test-tool/libguestfs-test-tool.pod:85
22090 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
22091 "I<1> if there was an error."
22095 #: ../test-tool/libguestfs-test-tool.pod:92
22096 msgid "/usr/libexec/libguestfs-test-tool-helper"
22100 #: ../test-tool/libguestfs-test-tool.pod:94
22102 "This helper program is run inside the appliance and provides additional "
22107 #: ../test-tool/libguestfs-test-tool.pod:97
22108 msgid "/usr/bin/mkisofs"
22112 #: ../test-tool/libguestfs-test-tool.pod:99
22114 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
22115 "which is used as part of the tests."
22119 #: ../test-tool/libguestfs-test-tool.pod:106
22121 "For the full list of environment variables which may affect libguestfs, "
22122 "please see the L<guestfs(3)> manual page."
22126 #: ../test-tool/libguestfs-test-tool.pod:111
22127 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
22131 #: ../test-tool/libguestfs-test-tool.pod:121 ../fuse/guestmount.pod:195
22132 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
22136 #: ../fuse/guestmount.pod:5
22137 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
22141 #: ../fuse/guestmount.pod:9
22144 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
22149 #: ../fuse/guestmount.pod:13
22151 "You must I<not> use C<guestmount> in read-write mode on live virtual "
22152 "machines. If you do this, you risk disk corruption in the VM."
22156 #: ../fuse/guestmount.pod:18
22158 "The guestmount program can be used to mount virtual machine filesystems and "
22159 "other disk images on the host. It uses libguestfs for access to the guest "
22160 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
22161 "a mountable device."
22165 #: ../fuse/guestmount.pod:23
22167 "Along with other options, you have to give at least one device (I<-a> "
22168 "option) and at least one mountpoint (I<-m> option). How this works is "
22169 "better explained in the L<guestfish(1)> manual page, or you can use "
22170 "L<virt-inspector(1)> and/or the wrapper script C<guestmount-wrapper> to help "
22175 #: ../fuse/guestmount.pod:29
22177 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
22178 "by you, and the filesystem will not be visible to any other users unless you "
22179 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
22180 "the filesystem, use the C<fusermount -u> command."
22184 #: ../fuse/guestmount.pod:37
22186 "For a typical Windows guest which has its main filesystem on the first "
22191 #: ../fuse/guestmount.pod:40
22194 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
22199 #: ../fuse/guestmount.pod:42
22201 "For a typical Linux guest which has a /boot filesystem on the first "
22202 "partition, and the root filesystem on a logical volume:"
22206 #: ../fuse/guestmount.pod:45
22209 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
22214 #: ../fuse/guestmount.pod:47
22216 "To get L<virt-inspector(1)> to do the hard work of detecting guest "
22217 "mountpoints for you:"
22221 #: ../fuse/guestmount.pod:50
22224 " guestmount $(virt-inspector --ro-fish MyGuest) /mnt\n"
22229 #: ../fuse/guestmount.pod:52
22231 "(or use --fish if you don't want it to be a read only mount). The option is "
22232 "called I<--ro-fish> or I<--fish> because these parameters are compatible "
22233 "with L<guestfish(1)>."
22237 #: ../fuse/guestmount.pod:56
22239 "If you don't know what filesystems are contained in a guest or disk image, "
22240 "use L<virt-list-filesystems(1)> first:"
22244 #: ../fuse/guestmount.pod:59
22247 " virt-list-filesystems MyGuest\n"
22252 #: ../fuse/guestmount.pod:61
22254 "If you want to trace the libguestfs calls but without excessive debugging, "
22259 #: ../fuse/guestmount.pod:64
22262 " guestmount [-a ... -m ...] --trace /mnt\n"
22267 #: ../fuse/guestmount.pod:66
22268 msgid "If you want to debug the program, we recommend:"
22272 #: ../fuse/guestmount.pod:68
22275 " guestmount [-a ... -m ...] --trace --verbose /mnt\n"
22280 #: ../fuse/guestmount.pod:76
22281 msgid "Add a block device or virtual machine image."
22285 #: ../fuse/guestmount.pod:78
22286 msgid "B<--dir-cache-timeout N>"
22290 #: ../fuse/guestmount.pod:80
22292 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22293 "seconds. The readdir cache [actually, there are several semi-independent "
22294 "caches] is populated after a readdir(2) call with the stat and extended "
22295 "attributes of the files in the directory, in anticipation that they will be "
22296 "requested soon after."
22300 #: ../fuse/guestmount.pod:86
22302 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22303 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22304 "requests, only cache existing ones."
22308 #: ../fuse/guestmount.pod:90
22309 msgid "B<--fuse-help>"
22313 #: ../fuse/guestmount.pod:92
22314 msgid "Display help on special FUSE options (see I<-o> below)."
22318 #: ../fuse/guestmount.pod:96
22319 msgid "Display brief help and exit."
22323 #: ../fuse/guestmount.pod:98
22324 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
22328 #: ../fuse/guestmount.pod:100
22330 "Mount the named partition or logical volume on the given mountpoint B<in the "
22331 "guest> (this has nothing to do with mountpoints in the host)."
22335 #: ../fuse/guestmount.pod:103
22337 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22338 "something on C</>."
22342 #: ../fuse/guestmount.pod:108
22344 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22345 "unmounted. If you specify this option, then we don't attempt to sync the "
22346 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22350 #: ../fuse/guestmount.pod:113
22351 msgid "B<-o option> | B<--option option>"
22355 #: ../fuse/guestmount.pod:115
22356 msgid "Pass extra options to FUSE."
22360 #: ../fuse/guestmount.pod:117
22362 "To get a list of all the extra options supported by FUSE, use the command "
22363 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22364 "of them are a good idea."
22368 #: ../fuse/guestmount.pod:121
22371 " guestmount --fuse-help\n"
22376 #: ../fuse/guestmount.pod:123
22377 msgid "Some potentially useful FUSE options:"
22381 #: ../fuse/guestmount.pod:127
22382 msgid "B<-o allow_other>"
22386 #: ../fuse/guestmount.pod:129
22387 msgid "Allow other users to see the filesystem."
22391 #: ../fuse/guestmount.pod:131
22392 msgid "B<-o attr_timeout=N>"
22396 #: ../fuse/guestmount.pod:133
22397 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22401 #: ../fuse/guestmount.pod:135
22402 msgid "B<-o kernel_cache>"
22406 #: ../fuse/guestmount.pod:137
22408 "Allow the kernel to cache files (reduces the number of reads that have to go "
22409 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22410 "afford the extra memory usage."
22414 #: ../fuse/guestmount.pod:141
22415 msgid "B<-o uid=N> B<-o gid=N>"
22419 #: ../fuse/guestmount.pod:143
22421 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22422 "the chosen values."
22426 #: ../fuse/guestmount.pod:150
22428 "Add devices and mount everything read-only. Also disallow writes and make "
22429 "the disk appear read-only to FUSE."
22433 #: ../fuse/guestmount.pod:153
22435 "This is highly recommended if you are not going to edit the guest disk. If "
22436 "the guest is running and this option is I<not> supplied, then there is a "
22437 "strong risk of disk corruption in the guest. We try to prevent this from "
22438 "happening, but it is not always possible."
22442 #: ../fuse/guestmount.pod:160
22443 msgid "Enable SELinux support for the guest."
22447 #: ../fuse/guestmount.pod:162
22452 #: ../fuse/guestmount.pod:164
22453 msgid "Trace libguestfs calls (to stderr)."
22457 #: ../fuse/guestmount.pod:166
22458 msgid "This also stops the daemon from forking into the background."
22462 #: ../fuse/guestmount.pod:170
22463 msgid "Enable verbose messages from underlying libguestfs."
22467 #: ../fuse/guestmount.pod:174
22468 msgid "Display the program version and exit."
22472 #: ../fuse/guestmount.pod:180
22474 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22475 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
22476 "L<http://fuse.sf.net/>."
22480 #: ../inspector/virt-inspector.pl:40
22482 "virt-inspector - Display OS version, kernel, drivers, mount points, "
22483 "applications, etc. in a virtual machine"
22487 #: ../inspector/virt-inspector.pl:44
22490 " virt-inspector [--connect URI] domname\n"
22495 #: ../inspector/virt-inspector.pl:46
22498 " virt-inspector guest.img [guest.img ...]\n"
22503 #: ../inspector/virt-inspector.pl:50
22505 "B<virt-inspector> examines a virtual machine and tries to determine the "
22506 "version of the OS, the kernel version, what drivers are installed, whether "
22507 "the virtual machine is fully virtualized (FV) or para-virtualized (PV), what "
22508 "applications are installed and more."
22512 #: ../inspector/virt-inspector.pl:55
22514 "Virt-inspector can produce output in several formats, including a readable "
22515 "text report, and XML for feeding into other programs."
22519 #: ../inspector/virt-inspector.pl:58
22521 "In the normal usage, use C<virt-inspector domname> where C<domname> is the "
22522 "libvirt domain (see: C<virsh list --all>)."
22526 #: ../inspector/virt-inspector.pl:61
22528 "You can also run virt-inspector directly on disk images from a single "
22529 "virtual machine. Use C<virt-inspector guest.img>. In rare cases a domain "
22530 "has several block devices, in which case you should list them one after "
22531 "another, with the first corresponding to the guest's C</dev/sda>, the second "
22532 "to the guest's C</dev/sdb> and so on."
22536 #: ../inspector/virt-inspector.pl:67
22538 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22539 "inspect several virtual machines, you have to run virt-inspector several "
22540 "times (for example, from a shell script for-loop)."
22544 #: ../inspector/virt-inspector.pl:72
22546 "Because virt-inspector needs direct access to guest images, it won't "
22547 "normally work over remote libvirt connections."
22551 #: ../inspector/virt-inspector.pl:85 ../tools/virt-cat.pl:90 ../tools/virt-df.pl:81 ../tools/virt-edit.pl:83 ../tools/virt-list-filesystems.pl:60 ../tools/virt-list-partitions.pl:61 ../tools/virt-ls.pl:89 ../tools/virt-make-fs.pl:163 ../tools/virt-rescue.pl:113 ../tools/virt-tar.pl:109 ../tools/virt-win-reg.pl:182
22552 msgid "Display brief help."
22556 #: ../inspector/virt-inspector.pl:91 ../tools/virt-cat.pl:96 ../tools/virt-df.pl:87 ../tools/virt-edit.pl:89 ../tools/virt-list-filesystems.pl:66 ../tools/virt-list-partitions.pl:67 ../tools/virt-ls.pl:95 ../tools/virt-make-fs.pl:169 ../tools/virt-rescue.pl:119 ../tools/virt-resize.pl:249 ../tools/virt-tar.pl:115 ../tools/virt-win-reg.pl:188
22557 msgid "B<--version>"
22561 #: ../inspector/virt-inspector.pl:93 ../tools/virt-cat.pl:98 ../tools/virt-df.pl:89 ../tools/virt-edit.pl:91 ../tools/virt-list-filesystems.pl:68 ../tools/virt-list-partitions.pl:69 ../tools/virt-ls.pl:97 ../tools/virt-make-fs.pl:171 ../tools/virt-rescue.pl:121 ../tools/virt-resize.pl:251 ../tools/virt-tar.pl:117 ../tools/virt-win-reg.pl:190
22562 msgid "Display version number and exit."
22566 #: ../inspector/virt-inspector.pl:99 ../tools/virt-cat.pl:104 ../tools/virt-df.pl:95 ../tools/virt-edit.pl:113 ../tools/virt-list-filesystems.pl:74 ../tools/virt-list-partitions.pl:75 ../tools/virt-ls.pl:103 ../tools/virt-rescue.pl:135 ../tools/virt-tar.pl:123 ../tools/virt-win-reg.pl:204
22567 msgid "B<--connect URI> | B<-c URI>"
22571 #: ../inspector/virt-inspector.pl:101 ../tools/virt-cat.pl:106 ../tools/virt-df.pl:97 ../tools/virt-edit.pl:115 ../tools/virt-list-filesystems.pl:76 ../tools/virt-list-partitions.pl:77 ../tools/virt-ls.pl:105 ../tools/virt-rescue.pl:137 ../tools/virt-tar.pl:125 ../tools/virt-win-reg.pl:206
22573 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
22574 "to the default libvirt hypervisor."
22578 #: ../inspector/virt-inspector.pl:104
22580 "Libvirt is only used if you specify a C<domname> on the command line. If "
22581 "you specify guest block devices directly, then libvirt is not used at all."
22585 #: ../inspector/virt-inspector.pl:114
22587 "The following options select the output format. Use only one of them. The "
22588 "default is a readable text report."
22592 #: ../inspector/virt-inspector.pl:119
22593 msgid "B<--text> (default)"
22597 #: ../inspector/virt-inspector.pl:121
22598 msgid "Plain text report."
22602 #: ../inspector/virt-inspector.pl:123
22607 #: ../inspector/virt-inspector.pl:125
22608 msgid "Produce no output at all."
22612 #: ../inspector/virt-inspector.pl:127
22617 #: ../inspector/virt-inspector.pl:129
22619 "If you select I<--xml> then you get XML output which can be fed to other "
22624 #: ../inspector/virt-inspector.pl:132
22629 #: ../inspector/virt-inspector.pl:134
22631 "If you select I<--yaml> then you get YAML output which can be fed to other "
22636 #: ../inspector/virt-inspector.pl:137
22641 #: ../inspector/virt-inspector.pl:139
22643 "If you select I<--perl> then you get Perl structures output which can be "
22644 "used directly in another Perl program."
22648 #: ../inspector/virt-inspector.pl:142
22653 #: ../inspector/virt-inspector.pl:144
22654 msgid "B<--ro-fish>"
22658 #: ../inspector/virt-inspector.pl:146
22660 "If you select I<--fish> then we print a L<guestfish(1)> command line which "
22661 "will automatically mount up the filesystems on the correct mount points. "
22662 "Try this for example:"
22666 #: ../inspector/virt-inspector.pl:150
22669 " guestfish $(virt-inspector --fish guest.img)\n"
22674 #: ../inspector/virt-inspector.pl:152
22676 "I<--ro-fish> is the same, but the I<--ro> option is passed to guestfish so "
22677 "that the filesystems are mounted read-only."
22681 #: ../inspector/virt-inspector.pl:155
22686 #: ../inspector/virt-inspector.pl:157
22688 "In \"query mode\" we answer common questions about the guest, such as "
22689 "whether it is fullvirt or needs a Xen hypervisor to run."
22693 #: ../inspector/virt-inspector.pl:160
22694 msgid "See section I<QUERY MODE> below."
22698 #: ../inspector/virt-inspector.pl:166
22699 msgid "B<--windows-registry>"
22703 #: ../inspector/virt-inspector.pl:168
22705 "This flag is ignored for compatibility with earlier releases of the "
22710 #: ../inspector/virt-inspector.pl:171
22712 "In this version, if L<Win::Hivex(3)> is available, then we attempt to parse "
22713 "information out of the Registry for any Windows guest."
22717 #: ../inspector/virt-inspector.pl:218
22718 msgid "OUTPUT FORMAT"
22722 #: ../inspector/virt-inspector.pl:220
22725 " Operating system(s)\n"
22726 " -------------------\n"
22727 " Linux (distro + version)\n"
22728 " Windows (version)\n"
22731 " +--- Filesystems ---------- Installed apps --- Kernel & drivers\n"
22732 " ----------- -------------- ----------------\n"
22733 " mount point => device List of apps Extra information\n"
22734 " mount point => device and versions about kernel(s)\n"
22735 " ... and drivers\n"
22736 " swap => swap device\n"
22737 " (plus lots of extra information\n"
22738 " about each filesystem)\n"
22743 #: ../inspector/virt-inspector.pl:235
22744 msgid "The output of virt-inspector is a complex two-level data structure."
22748 #: ../inspector/virt-inspector.pl:237
22750 "At the top level is a list of the operating systems installed on the guest. "
22751 "(For the vast majority of guests, only a single OS is installed.) The data "
22752 "returned for the OS includes the name (Linux, Windows), the distribution and "
22757 #: ../inspector/virt-inspector.pl:242
22758 msgid "The diagram above shows what we return for each OS."
22762 #: ../inspector/virt-inspector.pl:244
22764 "With the I<--xml> option the output is mapped into an XML document. There "
22765 "is a RELAX-NG schema for this XML in the file I<virt-inspector.rng> which "
22766 "normally ships with virt-inspector, or can be found in the source."
22770 #: ../inspector/virt-inspector.pl:249
22772 "With the I<--fish> or I<--ro-fish> option the mount points are mapped to "
22773 "L<guestfish(1)> command line parameters, so that you can go in afterwards "
22774 "and inspect the guest with everything mounted in the right place. For "
22779 #: ../inspector/virt-inspector.pl:254
22782 " guestfish $(virt-inspector --ro-fish guest.img)\n"
22783 " ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot\n"
22788 #: ../inspector/virt-inspector.pl:589
22793 #: ../inspector/virt-inspector.pl:591
22795 "When you use C<virt-inspector --query>, the output is a series of lines of "
22800 #: ../inspector/virt-inspector.pl:594
22806 " xen_pv_drivers=no\n"
22811 #: ../inspector/virt-inspector.pl:599
22813 "(each answer is usually C<yes> or C<no>, or the line is completely missing "
22814 "if we could not determine the answer at all)."
22818 #: ../inspector/virt-inspector.pl:602
22820 "If the guest is multiboot, you can get apparently conflicting answers "
22821 "(eg. C<windows=yes> and C<linux=yes>, or a guest which is both fullvirt and "
22822 "has a Xen PV kernel). This is normal, and just means that the guest can do "
22823 "both things, although it might require operator intervention such as "
22824 "selecting a boot option when the guest is booting."
22828 #: ../inspector/virt-inspector.pl:609
22829 msgid "This section describes the full range of answers possible."
22833 #: ../inspector/virt-inspector.pl:630
22834 msgid "windows=(yes|no)"
22838 #: ../inspector/virt-inspector.pl:632
22839 msgid "Answer C<yes> if Microsoft Windows is installed in the guest."
22843 #: ../inspector/virt-inspector.pl:645
22844 msgid "linux=(yes|no)"
22848 #: ../inspector/virt-inspector.pl:647
22849 msgid "Answer C<yes> if a Linux kernel is installed in the guest."
22853 #: ../inspector/virt-inspector.pl:660
22854 msgid "rhel=(yes|no)"
22858 #: ../inspector/virt-inspector.pl:662
22859 msgid "Answer C<yes> if the guest contains Red Hat Enterprise Linux."
22863 #: ../inspector/virt-inspector.pl:676
22864 msgid "fedora=(yes|no)"
22868 #: ../inspector/virt-inspector.pl:678
22869 msgid "Answer C<yes> if the guest contains the Fedora Linux distribution."
22873 #: ../inspector/virt-inspector.pl:691
22874 msgid "debian=(yes|no)"
22878 #: ../inspector/virt-inspector.pl:693
22879 msgid "Answer C<yes> if the guest contains the Debian Linux distribution."
22883 #: ../inspector/virt-inspector.pl:706
22884 msgid "fullvirt=(yes|no)"
22888 #: ../inspector/virt-inspector.pl:708
22890 "Answer C<yes> if there is at least one operating system kernel installed in "
22891 "the guest which runs fully virtualized. Such a guest would require a "
22892 "hypervisor which supports full system virtualization."
22896 #: ../inspector/virt-inspector.pl:731
22897 msgid "xen_domU_kernel=(yes|no)"
22901 #: ../inspector/virt-inspector.pl:733
22903 "Answer C<yes> if there is at least one Linux kernel installed in the guest "
22904 "which is compiled as a Xen DomU (a Xen paravirtualized guest)."
22908 #: ../inspector/virt-inspector.pl:753
22909 msgid "xen_pv_drivers=(yes|no)"
22913 #: ../inspector/virt-inspector.pl:755
22915 "Answer C<yes> if the guest has Xen paravirtualized drivers installed "
22916 "(usually the kernel itself will be fully virtualized, but the PV drivers "
22917 "have been installed by the administrator for performance reasons)."
22921 #: ../inspector/virt-inspector.pl:777
22922 msgid "virtio_drivers=(yes|no)"
22926 #: ../inspector/virt-inspector.pl:779
22928 "Answer C<yes> if the guest has virtio paravirtualized drivers installed. "
22929 "Virtio drivers are commonly used to improve the performance of KVM."
22933 #: ../inspector/virt-inspector.pl:800
22934 msgid "userspace_arch=(x86_64|...)"
22938 #: ../inspector/virt-inspector.pl:802
22939 msgid "Print the architecture of userspace."
22943 #: ../inspector/virt-inspector.pl:804 ../inspector/virt-inspector.pl:825
22944 msgid "NB. For multi-boot VMs this can print several lines."
22948 #: ../inspector/virt-inspector.pl:821
22949 msgid "kernel_arch=(x86_64|...)"
22953 #: ../inspector/virt-inspector.pl:823
22954 msgid "Print the architecture of the kernel."
22958 #: ../inspector/virt-inspector.pl:848 ../tools/virt-df.pl:484
22960 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
22961 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
22965 #: ../inspector/virt-inspector.pl:857 ../tools/virt-cat.pl:175 ../tools/virt-df.pl:493 ../tools/virt-edit.pl:339 ../tools/virt-list-filesystems.pl:205 ../tools/virt-list-partitions.pl:242 ../tools/virt-ls.pl:223 ../tools/virt-make-fs.pl:554 ../tools/virt-rescue.pl:243 ../tools/virt-resize.pl:1409 ../tools/virt-tar.pl:270 ../tools/virt-win-reg.pl:489
22966 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
22970 #: ../inspector/virt-inspector.pl:859
22971 msgid "Matthew Booth L<mbooth@redhat.com>"
22975 #: ../inspector/virt-inspector.pl:863 ../tools/virt-cat.pl:179 ../tools/virt-list-filesystems.pl:209 ../tools/virt-ls.pl:227 ../tools/virt-tar.pl:274
22976 msgid "Copyright (C) 2009 Red Hat Inc."
22980 #: ../tools/virt-cat.pl:34
22981 msgid "virt-cat - Display a file in a virtual machine"
22985 #: ../tools/virt-cat.pl:38
22988 " virt-cat [--options] domname file\n"
22993 #: ../tools/virt-cat.pl:40
22996 " virt-cat [--options] disk.img [disk.img ...] file\n"
23001 #: ../tools/virt-cat.pl:44
23003 "C<virt-cat> is a command line tool to display the contents of C<file> where "
23004 "C<file> exists in the named virtual machine (or disk image)."
23008 #: ../tools/virt-cat.pl:47
23010 "C<virt-cat> can be used to quickly view a single file. To edit a file, use "
23011 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
23016 #: ../tools/virt-cat.pl:53
23017 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
23021 #: ../tools/virt-cat.pl:56
23024 " virt-cat mydomain /etc/fstab\n"
23029 #: ../tools/virt-cat.pl:58
23030 msgid "List syslog messages from a VM:"
23034 #: ../tools/virt-cat.pl:60
23037 " virt-cat mydomain /var/log/messages | tail\n"
23042 #: ../tools/virt-cat.pl:62
23043 msgid "Find out what DHCP IP address a VM acquired:"
23047 #: ../tools/virt-cat.pl:64
23050 " virt-cat mydomain /var/log/messages | grep 'dhclient: bound to' | tail\n"
23055 #: ../tools/virt-cat.pl:66
23056 msgid "Find out what packages were recently installed:"
23060 #: ../tools/virt-cat.pl:68
23063 " virt-cat mydomain /var/log/yum.log | tail\n"
23068 #: ../tools/virt-cat.pl:70
23069 msgid "Find out who is logged on inside a virtual machine:"
23073 #: ../tools/virt-cat.pl:72
23076 " virt-cat mydomain /var/run/utmp > /tmp/utmp\n"
23082 #: ../tools/virt-cat.pl:75
23083 msgid "or who was logged on:"
23087 #: ../tools/virt-cat.pl:77
23090 " virt-cat mydomain /var/log/wtmp > /tmp/wtmp\n"
23091 " last -f /tmp/wtmp\n"
23096 #: ../tools/virt-cat.pl:109 ../tools/virt-df.pl:100 ../tools/virt-edit.pl:118 ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80 ../tools/virt-ls.pl:108 ../tools/virt-rescue.pl:140 ../tools/virt-tar.pl:128 ../tools/virt-win-reg.pl:209
23098 "If you specify guest block devices directly, then libvirt is not used at "
23103 #: ../tools/virt-cat.pl:165
23105 "L<guestfs(3)>, L<guestfish(1)>, L<virt-edit(1)>, L<Sys::Guestfs(3)>, "
23106 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23110 #: ../tools/virt-cat.pl:173 ../tools/virt-df.pl:491 ../tools/virt-edit.pl:337 ../tools/virt-list-filesystems.pl:203 ../tools/virt-list-partitions.pl:240 ../tools/virt-ls.pl:221 ../tools/virt-make-fs.pl:552 ../tools/virt-rescue.pl:241 ../tools/virt-resize.pl:1407 ../tools/virt-tar.pl:268 ../tools/virt-win-reg.pl:487
23115 #: ../tools/virt-df.pl:36
23116 msgid "virt-df - Display free space on virtual filesystems"
23120 #: ../tools/virt-df.pl:40
23123 " virt-df [--options]\n"
23128 #: ../tools/virt-df.pl:42
23131 " virt-df [--options] domname\n"
23136 #: ../tools/virt-df.pl:44
23139 " virt-df [--options] disk.img [disk.img ...]\n"
23144 #: ../tools/virt-df.pl:48
23146 "C<virt-df> is a command line tool to display free space on virtual machine "
23147 "filesystems. Unlike other tools, it doesn't just display the amount of "
23148 "space allocated to a virtual machine, but can look inside the virtual "
23149 "machine to see how much space is really being used."
23153 #: ../tools/virt-df.pl:53
23155 "It is like the L<df(1)> command, but for virtual machines, except that it "
23156 "also works for Windows virtual machines."
23160 #: ../tools/virt-df.pl:56
23162 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
23163 "of all active and inactive guests, and performs a C<df>-type operation on "
23164 "each one in turn, printing out the results."
23168 #: ../tools/virt-df.pl:60
23170 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
23171 "either the single named libvirt domain, or on the disk image(s) listed on "
23172 "the command line (which must all belong to a single VM). In this mode (with "
23173 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
23174 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
23178 #: ../tools/virt-df.pl:67
23180 "Use the C<--csv> option to get a format which can be easily parsed by other "
23181 "programs. Other options are mostly similar to standard C<df> options. See "
23182 "below for the complete list."
23186 #: ../tools/virt-df.pl:107
23191 #: ../tools/virt-df.pl:109
23193 "Write out the results in CSV format (comma-separated values). This format "
23194 "can be imported easily into databases and spreadsheets, but read L</NOTE "
23195 "ABOUT CSV FORMAT> below."
23199 #: ../tools/virt-df.pl:117
23200 msgid "B<--human-readable> | B<-h>"
23204 #: ../tools/virt-df.pl:119
23205 msgid "Print sizes in human-readable format."
23209 #: ../tools/virt-df.pl:121
23210 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
23214 #: ../tools/virt-df.pl:127
23215 msgid "B<--inodes> | B<-i>"
23219 #: ../tools/virt-df.pl:129
23220 msgid "Print inodes instead of blocks."
23224 #: ../tools/virt-df.pl:458
23225 msgid "NOTE ABOUT CSV FORMAT"
23229 #: ../tools/virt-df.pl:460
23231 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
23232 "should be easy to parse, but it is definitely not easy to parse."
23236 #: ../tools/virt-df.pl:463
23238 "Myth: Just split fields at commas. Reality: This does I<not> work "
23239 "reliably. This example has two columns:"
23243 #: ../tools/virt-df.pl:466
23246 " \"foo,bar\",baz\n"
23251 #: ../tools/virt-df.pl:468
23253 "Myth: Read the file one line at a time. Reality: This does I<not> work "
23254 "reliably. This example has one row:"
23258 #: ../tools/virt-df.pl:471
23267 #: ../tools/virt-df.pl:474
23269 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
23270 "packaged in major Linux distributions)."
23274 #: ../tools/virt-df.pl:477
23276 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
23277 "or Python's built-in csv library)."
23281 #: ../tools/virt-df.pl:480
23282 msgid "Most spreadsheets and databases can import CSV directly."
23286 #: ../tools/virt-df.pl:497 ../tools/virt-edit.pl:343 ../tools/virt-list-partitions.pl:246 ../tools/virt-rescue.pl:247
23287 msgid "Copyright (C) 2009-2010 Red Hat Inc."
23291 #: ../tools/virt-edit.pl:35
23292 msgid "virt-edit - Edit a file in a virtual machine"
23296 #: ../tools/virt-edit.pl:39
23299 " virt-edit [--options] domname file\n"
23304 #: ../tools/virt-edit.pl:41
23307 " virt-edit [--options] disk.img [disk.img ...] file\n"
23312 #: ../tools/virt-edit.pl:43
23315 " virt-edit [domname|disk.img] file -e 'expr'\n"
23320 #: ../tools/virt-edit.pl:47
23322 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
23323 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
23324 "doing this, but doesn't catch all cases."
23328 #: ../tools/virt-edit.pl:53
23330 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
23331 "the named virtual machine (or disk image)."
23335 #: ../tools/virt-edit.pl:56
23337 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
23338 "you should look at the L<guestfish(1)> tool."
23342 #: ../tools/virt-edit.pl:61
23343 msgid "Edit the named files interactively:"
23347 #: ../tools/virt-edit.pl:63
23350 " virt-edit mydomain /boot/grub/grub.conf\n"
23355 #: ../tools/virt-edit.pl:65
23358 " virt-edit mydomain /etc/passwd\n"
23363 #: ../tools/virt-edit.pl:67
23365 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
23366 "below). To change the init default level to 5:"
23370 #: ../tools/virt-edit.pl:71
23373 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
23378 #: ../tools/virt-edit.pl:97
23379 msgid "B<--backup extension> | B<-b extension>"
23383 #: ../tools/virt-edit.pl:99
23385 "Create a backup of the original file I<in the guest disk image>. The backup "
23386 "has the original filename with C<extension> added."
23390 #: ../tools/virt-edit.pl:102
23392 "Usually the first character of C<extension> would be a dot C<.> so you would "
23397 #: ../tools/virt-edit.pl:105
23400 " virt-edit -b .orig [etc]\n"
23405 #: ../tools/virt-edit.pl:107
23406 msgid "By default, no backup file is made."
23410 #: ../tools/virt-edit.pl:125
23411 msgid "B<--expr EXPR> | B<-e EXPR>"
23415 #: ../tools/virt-edit.pl:127
23417 "Instead of launching the external editor, non-interactively apply the Perl "
23418 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
23423 #: ../tools/virt-edit.pl:131
23425 "Be careful to properly quote the expression to prevent it from being altered "
23430 #: ../tools/virt-edit.pl:250
23431 msgid "NON-INTERACTIVE EDITING"
23435 #: ../tools/virt-edit.pl:252
23437 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
23438 "administrator can interactively edit the file."
23442 #: ../tools/virt-edit.pl:255
23444 "There are two ways also to use C<virt-edit> from scripts in order to make "
23445 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
23446 "like this, it's less error-prone to write scripts directly using the "
23447 "libguestfs API and Augeas for configuration file editing.)"
23451 #: ../tools/virt-edit.pl:261
23453 "The first method is to temporarily set C<$EDITOR> to any script or program "
23454 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
23455 "update C<tmpfile> in place however it likes."
23459 #: ../tools/virt-edit.pl:265
23461 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
23462 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
23463 "instances of C<foo> with C<bar> in a file:"
23467 #: ../tools/virt-edit.pl:269
23470 " virt-edit domname filename -e 's/foo/bar/'\n"
23475 #: ../tools/virt-edit.pl:271
23477 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
23478 "For example to delete root's password you could do:"
23482 #: ../tools/virt-edit.pl:274
23485 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
23490 #: ../tools/virt-edit.pl:276
23492 "What really happens is that the snippet is evaluated as a Perl expression "
23493 "for each line of the file. The line, including the final C<\\n>, is passed "
23494 "in C<$_> and the expression should update C<$_> or leave it unchanged."
23498 #: ../tools/virt-edit.pl:281
23500 "To delete a line, set C<$_> to the empty string. For example, to delete the "
23501 "C<apache> user account from the password file you can do:"
23505 #: ../tools/virt-edit.pl:284
23508 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
23513 #: ../tools/virt-edit.pl:286
23515 "To insert a line, prepend or append it to C<$_>. However appending lines to "
23516 "the end of the file is rather difficult this way since there is no concept "
23517 "of \"last line of the file\" - your expression just doesn't get called "
23518 "again. You might want to use the first method (setting C<$EDITOR>) if you "
23523 #: ../tools/virt-edit.pl:292
23525 "The variable C<$lineno> contains the current line number. As is "
23526 "traditional, the first line in the file is number C<1>."
23530 #: ../tools/virt-edit.pl:295
23532 "The return value from the expression is ignored, but the expression may call "
23533 "C<die> in order to abort the whole program, leaving the original file "
23538 #: ../tools/virt-edit.pl:299
23540 "Remember when matching the end of a line that C<$_> may contain the final "
23541 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
23542 "newline then neither of these. Thus to match or substitute some text at the "
23543 "end of a line, use this regular expression:"
23547 #: ../tools/virt-edit.pl:304
23550 " /some text(\\r?\\n)?$/\n"
23555 #: ../tools/virt-edit.pl:306
23557 "Alternately, use the perl C<chomp> function, being careful not to chomp "
23558 "C<$_> itself (since that would remove all newlines from the file):"
23562 #: ../tools/virt-edit.pl:310
23565 " my $m = $_; chomp $m; $m =~ /some text$/\n"
23570 #: ../tools/virt-edit.pl:316
23575 #: ../tools/virt-edit.pl:318
23577 "If set, this string is used as the editor. It may contain arguments, "
23578 "eg. C<\"emacs -nw\">"
23582 #: ../tools/virt-edit.pl:321
23583 msgid "If not set, C<vi> is used."
23587 #: ../tools/virt-edit.pl:327
23589 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
23590 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, "
23591 "L<perl(1)>, L<perlre(1)>."
23595 #: ../tools/virt-list-filesystems.pl:32
23596 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
23600 #: ../tools/virt-list-filesystems.pl:36
23603 " virt-list-filesystems [--options] domname\n"
23608 #: ../tools/virt-list-filesystems.pl:38
23611 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
23616 #: ../tools/virt-list-filesystems.pl:42
23618 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
23619 "are contained in a virtual machine or disk image."
23623 #: ../tools/virt-list-filesystems.pl:46
23625 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
23626 "functionality. For more complex cases you should look at the "
23627 "L<guestfish(1)> tool."
23631 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-list-partitions.pl:95 ../tools/virt-ls.pl:115
23632 msgid "B<-l> | B<--long>"
23636 #: ../tools/virt-list-filesystems.pl:88
23638 "With this option, C<virt-list-filesystems> displays the type of each "
23639 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
23643 #: ../tools/virt-list-filesystems.pl:95
23644 msgid "B<-a> | B<--all>"
23648 #: ../tools/virt-list-filesystems.pl:97
23650 "Normally we only show mountable filesystems. If this option is given then "
23651 "swap devices are shown too."
23655 #: ../tools/virt-list-filesystems.pl:193
23657 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
23658 "L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23659 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23663 #: ../tools/virt-list-partitions.pl:32
23664 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
23668 #: ../tools/virt-list-partitions.pl:36
23671 " virt-list-partitions [--options] domname\n"
23676 #: ../tools/virt-list-partitions.pl:38
23679 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
23684 #: ../tools/virt-list-partitions.pl:42
23686 "C<virt-list-partitions> is a command line tool to list the partitions that "
23687 "are contained in a virtual machine or disk image. It is mainly useful as a "
23688 "first step to using L<virt-resize(1)>."
23692 #: ../tools/virt-list-partitions.pl:47
23694 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
23695 "functionality. For more complex cases you should look at the "
23696 "L<guestfish(1)> tool."
23700 #: ../tools/virt-list-partitions.pl:87
23701 msgid "B<-h> | B<--human-readable>"
23705 #: ../tools/virt-list-partitions.pl:89
23706 msgid "Show sizes in human-readable form (eg. \"1G\")."
23710 #: ../tools/virt-list-partitions.pl:97
23712 "With this option, C<virt-list-partitions> displays the type and size of each "
23713 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
23717 #: ../tools/virt-list-partitions.pl:104
23718 msgid "B<-t> | B<--total>"
23722 #: ../tools/virt-list-partitions.pl:106
23723 msgid "Display the total size of each block device (as a separate row or rows)."
23727 #: ../tools/virt-list-partitions.pl:231
23729 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, "
23730 "L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
23731 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
23735 #: ../tools/virt-ls.pl:35
23736 msgid "virt-ls - List files in a virtual machine"
23740 #: ../tools/virt-ls.pl:39
23743 " virt-ls [--options] domname directory\n"
23748 #: ../tools/virt-ls.pl:41
23751 " virt-ls [--options] disk.img [disk.img ...] directory\n"
23756 #: ../tools/virt-ls.pl:45
23758 "C<virt-ls> is a command line tool to list the names of files in a directory "
23759 "inside a virtual machine or disk image."
23763 #: ../tools/virt-ls.pl:48
23765 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
23766 "For more complex cases you should look at the L<guestfish(1)> tool."
23770 #: ../tools/virt-ls.pl:52
23772 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
23773 "simple listing is like the ordinary L<ls(1)> command:"
23777 #: ../tools/virt-ls.pl:55
23780 " $ virt-ls myguest /\n"
23788 #: ../tools/virt-ls.pl:60
23789 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
23793 #: ../tools/virt-ls.pl:62
23796 " $ virt-ls -l myguest /\n"
23798 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
23799 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
23805 #: ../tools/virt-ls.pl:68
23807 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
23808 "and directories recursively:"
23812 #: ../tools/virt-ls.pl:71
23815 " $ virt-ls -R myguest /tmp\n"
23823 #: ../tools/virt-ls.pl:76
23825 "You I<cannot> combine these options. To do more complicated things, use "
23830 #: ../tools/virt-ls.pl:117
23831 msgid "B<-R> | B<--recursive>"
23835 #: ../tools/virt-ls.pl:119
23837 "Select the mode. With neither of these options, C<virt-ls> produces a "
23838 "simple, flat list of the files in the named directory."
23842 #: ../tools/virt-ls.pl:122
23844 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
23845 "like the plain C<ls -l> command)."
23849 #: ../tools/virt-ls.pl:125
23851 "C<virt-ls -R> produces a recursive list of files starting at the named "
23852 "directory. See the documentation for the C<guestfs_find> command "
23853 "L<guestfs(3)> for precise details."
23857 #: ../tools/virt-ls.pl:129
23858 msgid "You cannot combine these options."
23862 #: ../tools/virt-ls.pl:212
23864 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
23865 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
23866 "L<http://libguestfs.org/>."
23870 #: ../tools/virt-make-fs.pl:37
23871 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
23875 #: ../tools/virt-make-fs.pl:41
23878 " virt-make-fs [--options] input.tar output.img\n"
23883 #: ../tools/virt-make-fs.pl:43
23886 " virt-make-fs [--options] input.tar.gz output.img\n"
23891 #: ../tools/virt-make-fs.pl:45
23894 " virt-make-fs [--options] directory output.img\n"
23899 #: ../tools/virt-make-fs.pl:49
23901 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
23902 "archive or some files in a directory. It is similar to tools like "
23903 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
23904 "it can create common filesystem types like ext2/3 or NTFS, which can be "
23905 "useful if you want to attach these filesystems to existing virtual machines "
23906 "(eg. to import large amounts of read-only data to a VM)."
23910 #: ../tools/virt-make-fs.pl:57
23911 msgid "Basic usage is:"
23915 #: ../tools/virt-make-fs.pl:59
23918 " virt-make-fs input output\n"
23923 #: ../tools/virt-make-fs.pl:61
23925 "where C<input> is either a directory containing files that you want to add, "
23926 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
23927 "C<output> is a disk image. The input type is detected automatically. The "
23928 "output disk image defaults to a raw ext2 image unless you specify extra "
23929 "flags (see L</OPTIONS> below)."
23933 #: ../tools/virt-make-fs.pl:67
23934 msgid "EXTRA SPACE"
23938 #: ../tools/virt-make-fs.pl:69
23940 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
23941 "the files that it contains, but might have extra space. Depending on how "
23942 "you are going to use the output, you might think this extra space is wasted "
23943 "and want to minimize it, or you might want to leave space so that more files "
23944 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
23945 "but you can use the C<--size> flag to leave space in the filesystem if you "
23950 #: ../tools/virt-make-fs.pl:77
23952 "An alternative way to leave extra space but not make the output image any "
23953 "bigger is to use an alternative disk image format (instead of the default "
23954 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
23955 "image format (check your hypervisor supports this before using it). This "
23956 "allows you to choose a large C<--size> but the extra space won't actually be "
23957 "allocated in the image until you try to store something in it."
23961 #: ../tools/virt-make-fs.pl:85
23963 "Don't forget that you can also use local commands including L<resize2fs(8)> "
23964 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
23965 "virt-make-resize to build another image from scratch."
23969 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
23974 #: ../tools/virt-make-fs.pl:91
23977 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
23982 #: ../tools/virt-make-fs.pl:93
23983 msgid "FILESYSTEM TYPE"
23987 #: ../tools/virt-make-fs.pl:95
23989 "The default filesystem type is C<ext2>. Just about any filesystem type that "
23990 "libguestfs supports can be used (but I<not> read-only formats like "
23991 "ISO9660). Here are some of the more common choices:"
23995 #: ../tools/virt-make-fs.pl:101
24000 #: ../tools/virt-make-fs.pl:103
24002 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
24003 "you are not going to use the filesystem in a way that requires the journal, "
24004 "then this is just wasted overhead."
24008 #: ../tools/virt-make-fs.pl:107
24009 msgid "I<ntfs> or I<vfat>"
24013 #: ../tools/virt-make-fs.pl:109
24014 msgid "Useful if exporting data to a Windows guest."
24018 #: ../tools/virt-make-fs.pl:111
24020 "I<Note for vfat>: The tar archive or local directory must only contain files "
24021 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
24022 "program running within libguestfs is unable to change the ownership of "
24023 "non-root files, since vfat itself does not support this."
24027 #: ../tools/virt-make-fs.pl:116
24032 #: ../tools/virt-make-fs.pl:118
24034 "Lower overhead than C<ext2>, but certain limitations on filename length and "
24035 "total filesystem size."
24039 #: ../tools/virt-make-fs.pl:125
24042 " virt-make-fs --type=minix input minixfs.img\n"
24047 #: ../tools/virt-make-fs.pl:127
24048 msgid "TO PARTITION OR NOT TO PARTITION"
24052 #: ../tools/virt-make-fs.pl:129
24053 msgid "Optionally virt-make-fs can add a partition table to the output disk."
24057 #: ../tools/virt-make-fs.pl:131
24059 "Adding a partition can make the disk image more compatible with certain "
24060 "virtualized operating systems which don't expect to see a filesystem "
24061 "directly located on a block device (Linux doesn't care and will happily "
24062 "handle both types)."
24066 #: ../tools/virt-make-fs.pl:136
24068 "On the other hand, if you have a partition table then the output image is no "
24069 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
24070 "directly on a partitioned disk image. (However libguestfs tools such as "
24071 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
24075 #: ../tools/virt-make-fs.pl:144
24076 msgid "Add an MBR partition:"
24080 #: ../tools/virt-make-fs.pl:146
24083 " virt-make-fs --partition -- input disk.img\n"
24088 #: ../tools/virt-make-fs.pl:148
24090 "If the output disk image could be terabyte-sized or larger, it's better to "
24091 "use an EFI/GPT-compatible partition table:"
24095 #: ../tools/virt-make-fs.pl:151
24098 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
24103 #: ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:196
24108 #: ../tools/virt-make-fs.pl:179
24109 msgid "Enable debugging information."
24113 #: ../tools/virt-make-fs.pl:185
24114 msgid "B<--size=E<lt>NE<gt>>"
24118 #: ../tools/virt-make-fs.pl:187
24119 msgid "B<--size=+E<lt>NE<gt>>"
24123 #: ../tools/virt-make-fs.pl:189
24124 msgid "B<-s E<lt>NE<gt>>"
24128 #: ../tools/virt-make-fs.pl:191
24129 msgid "B<-s +E<lt>NE<gt>>"
24133 #: ../tools/virt-make-fs.pl:193
24134 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
24138 #: ../tools/virt-make-fs.pl:196
24140 "If this option is I<not> given, then the output image will be just large "
24141 "enough to contain all the files, with not much wasted space."
24145 #: ../tools/virt-make-fs.pl:199
24147 "To choose a fixed size output disk, specify an absolute number followed by "
24148 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24149 "Petabytes or Exabytes. This must be large enough to contain all the input "
24150 "files, else you will get an error."
24154 #: ../tools/virt-make-fs.pl:204
24156 "To leave extra space, specify C<+> (plus sign) and a number followed by "
24157 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
24158 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
24159 "the input files, and (approximately) an extra 200 MB free space."
24163 #: ../tools/virt-make-fs.pl:210
24165 "Note that virt-make-fs estimates free space, and therefore will not produce "
24166 "filesystems containing precisely the free space requested. (It is much more "
24167 "expensive and time-consuming to produce a filesystem which has precisely the "
24168 "desired free space)."
24172 #: ../tools/virt-make-fs.pl:219
24173 msgid "B<--format=E<lt>fmtE<gt>>"
24177 #: ../tools/virt-make-fs.pl:221
24178 msgid "B<-F E<lt>fmtE<gt>>"
24182 #: ../tools/virt-make-fs.pl:223
24183 msgid "Choose the output disk image format."
24187 #: ../tools/virt-make-fs.pl:225
24188 msgid "The default is C<raw> (raw disk image)."
24192 #: ../tools/virt-make-fs.pl:227
24194 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
24195 "that would really make sense here is C<qcow2>."
24199 #: ../tools/virt-make-fs.pl:234
24200 msgid "B<--type=E<lt>fsE<gt>>"
24204 #: ../tools/virt-make-fs.pl:236
24205 msgid "B<-t E<lt>fsE<gt>>"
24209 #: ../tools/virt-make-fs.pl:238
24210 msgid "Choose the output filesystem type."
24214 #: ../tools/virt-make-fs.pl:240
24215 msgid "The default is C<ext2>."
24219 #: ../tools/virt-make-fs.pl:242
24220 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
24224 #: ../tools/virt-make-fs.pl:249
24225 msgid "B<--partition>"
24229 #: ../tools/virt-make-fs.pl:251
24230 msgid "B<--partition=E<lt>parttypeE<gt>>"
24234 #: ../tools/virt-make-fs.pl:253
24236 "If specified, this flag adds an MBR partition table to the output disk "
24241 #: ../tools/virt-make-fs.pl:256
24243 "You can change the partition table type, eg. C<--partition=gpt> for large "
24248 #: ../tools/virt-make-fs.pl:259
24250 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
24251 "might consider the next parameter to be the partition type. For example:"
24255 #: ../tools/virt-make-fs.pl:263
24258 " virt-make-fs --partition input.tar ...\n"
24263 #: ../tools/virt-make-fs.pl:265
24265 "would cause virt-make-fs to think you wanted to use a partition type of "
24266 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
24267 "dash) between options and the input file argument:"
24271 #: ../tools/virt-make-fs.pl:269
24274 " virt-make-fs --partition -- input.tar ...\n"
24279 #: ../tools/virt-make-fs.pl:529
24281 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
24282 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
24283 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
24287 #: ../tools/virt-make-fs.pl:543 ../tools/virt-win-reg.pl:478
24289 "When reporting bugs, please enable debugging and capture the I<complete> "
24294 #: ../tools/virt-make-fs.pl:546
24297 " export LIBGUESTFS_DEBUG=1\n"
24298 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
24303 #: ../tools/virt-make-fs.pl:549
24305 "Attach /tmp/virt-make-fs.log to a new bug report at "
24306 "L<https://bugzilla.redhat.com/>"
24310 #: ../tools/virt-make-fs.pl:558 ../tools/virt-resize.pl:1413 ../tools/virt-win-reg.pl:493
24311 msgid "Copyright (C) 2010 Red Hat Inc."
24315 #: ../tools/virt-rescue.pl:33
24316 msgid "virt-rescue - Run a rescue shell on a virtual machine"
24320 #: ../tools/virt-rescue.pl:37
24323 " virt-rescue [--options] domname\n"
24328 #: ../tools/virt-rescue.pl:39
24331 " virt-rescue [--options] disk.img [disk.img ...]\n"
24336 #: ../tools/virt-rescue.pl:43
24338 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
24339 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
24340 "you from doing this, but doesn't catch all cases."
24344 #: ../tools/virt-rescue.pl:47
24346 "However if you use the I<--ro> (read only) option, then you can attach a "
24347 "shell to a live virtual machine. The results might be strange or "
24348 "inconsistent at times but you won't get disk corruption."
24352 #: ../tools/virt-rescue.pl:53
24354 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
24355 "need for a CD. virt-rescue gives you a rescue shell and some simple "
24356 "recovery tools which you can use to examine or rescue a virtual machine or "
24361 #: ../tools/virt-rescue.pl:58
24363 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
24364 "on disk image(s):"
24368 #: ../tools/virt-rescue.pl:61
24371 " virt-rescue GuestName\n"
24376 #: ../tools/virt-rescue.pl:63
24379 " virt-rescue --ro /path/to/disk.img\n"
24384 #: ../tools/virt-rescue.pl:65
24387 " virt-rescue /dev/sdc\n"
24392 #: ../tools/virt-rescue.pl:67
24393 msgid "For live VMs you I<must> use the --ro option."
24397 #: ../tools/virt-rescue.pl:69
24399 "When you run virt-rescue on a virtual machine or disk image, you are placed "
24400 "in an interactive bash shell where you can use many ordinary Linux "
24401 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
24402 "appliance. You must mount the virtual machine's filesystems by hand. There "
24403 "is an empty directory called C</sysroot> where you can mount filesystems."
24407 #: ../tools/virt-rescue.pl:76
24409 "In the example below, we list logical volumes, then choose one to mount "
24410 "under C</sysroot>:"
24414 #: ../tools/virt-rescue.pl:79
24418 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
24419 " lv_root vg_f11x64 -wi-a- 8.83G\n"
24420 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
24421 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
24422 " ><rescue> ls /sysroot\n"
24427 #: ../tools/virt-rescue.pl:86
24429 "If you don't know what filesystems are available on the virtual machine then "
24430 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
24434 #: ../tools/virt-rescue.pl:90 ../tools/virt-resize.pl:1350
24439 #: ../tools/virt-rescue.pl:92
24441 "Virt-rescue can be used on I<any> disk image file or device, not just a "
24442 "virtual machine. For example you can use it on a blank file if you want to "
24443 "partition that file (although we would recommend using L<guestfish(1)> "
24444 "instead as it is more suitable for this purpose). You can even use "
24445 "virt-rescue on things like SD cards."
24449 #: ../tools/virt-rescue.pl:98
24451 "This tool is just designed for quick interactive hacking on a virtual "
24452 "machine. For more structured access to a virtual machine disk image, you "
24453 "should use L<guestfs(3)>. To get a structured shell that you can use to "
24454 "make scripted changes to guests, use L<guestfish(1)>."
24458 #: ../tools/virt-rescue.pl:127
24459 msgid "B<--append kernelopts>"
24463 #: ../tools/virt-rescue.pl:129
24464 msgid "Pass additional options to the rescue kernel."
24468 #: ../tools/virt-rescue.pl:147
24469 msgid "B<--memsize MB> | B<-m MB>"
24473 #: ../tools/virt-rescue.pl:149
24475 "Change the amount of memory allocated to the rescue system. The default is "
24476 "set by libguestfs and is small but adequate for running system tools. The "
24477 "occasional program might need more memory. The parameter is specified in "
24482 #: ../tools/virt-rescue.pl:158
24483 msgid "B<--ro> | B<-r>"
24487 #: ../tools/virt-rescue.pl:160
24488 msgid "Open the image read-only."
24492 #: ../tools/virt-rescue.pl:172
24494 "Enable SELinux in the rescue appliance. You should read "
24495 "L<guestfs(3)/SELINUX> before using this option."
24499 #: ../tools/virt-rescue.pl:228
24501 "Several environment variables affect virt-rescue. See "
24502 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
24506 #: ../tools/virt-rescue.pl:233
24508 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
24509 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
24513 #: ../tools/virt-resize.pl:42
24514 msgid "virt-resize - Resize a virtual machine disk"
24518 #: ../tools/virt-resize.pl:46
24521 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
24522 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
24523 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
24528 #: ../tools/virt-resize.pl:52
24530 "Virt-resize is a tool which can resize a virtual machine disk, making it "
24531 "larger or smaller overall, and resizing or deleting any partitions contained "
24536 #: ../tools/virt-resize.pl:56
24538 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
24539 "not> be used on live virtual machines - for consistent results, shut the "
24540 "virtual machine down before resizing it."
24544 #: ../tools/virt-resize.pl:60
24546 "If you are not familiar with the associated tools: "
24547 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)> and L<virt-df(1)>, "
24548 "we recommend you go and read those manual pages first."
24552 #: ../tools/virt-resize.pl:68
24554 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
24555 "fill the extra 5GB of space."
24559 #: ../tools/virt-resize.pl:71
24562 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
24563 " virt-list-partitions -lht olddisk\n"
24564 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
24565 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
24570 #: ../tools/virt-resize.pl:76
24572 "As above, but make the /boot partition 200MB bigger, while giving the "
24573 "remaining space to /dev/sda2:"
24577 #: ../tools/virt-resize.pl:79
24580 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
24585 #: ../tools/virt-resize.pl:81
24586 msgid "DETAILED USAGE"
24590 #: ../tools/virt-resize.pl:83
24591 msgid "EXPANDING A VIRTUAL MACHINE DISK"
24595 #: ../tools/virt-resize.pl:87
24596 msgid "1. Shut down the virtual machine"
24600 #: ../tools/virt-resize.pl:89
24601 msgid "2. Locate input disk image"
24605 #: ../tools/virt-resize.pl:91
24607 "Locate the input disk image (ie. the file or device on the host containing "
24608 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
24609 "dumpxml> like this to find the disk image name:"
24613 #: ../tools/virt-resize.pl:95
24616 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
24617 " Found 1 nodes:\n"
24619 " <source dev=\"/dev/vg/lv_guest\" />\n"
24624 #: ../tools/virt-resize.pl:100
24625 msgid "3. Look at current sizing"
24629 #: ../tools/virt-resize.pl:102
24630 msgid "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
24634 #: ../tools/virt-resize.pl:105
24637 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
24638 " /dev/sda1 ext3 101.9M\n"
24639 " /dev/sda2 pv 7.9G\n"
24640 " /dev/sda device 8.0G\n"
24645 #: ../tools/virt-resize.pl:110
24647 "(This example is a virtual machine with an 8 GB disk which we would like to "
24648 "expand up to 10 GB)."
24652 #: ../tools/virt-resize.pl:113
24653 msgid "4. Create output disk"
24657 #: ../tools/virt-resize.pl:115
24659 "Virt-resize cannot do in-place disk modifications. You have to have space "
24660 "to store the resized output disk."
24664 #: ../tools/virt-resize.pl:118
24665 msgid "To store the resized disk image in a file, create a file of a suitable size:"
24669 #: ../tools/virt-resize.pl:121
24672 " # rm -f outdisk\n"
24673 " # truncate -s 10G outdisk\n"
24678 #: ../tools/virt-resize.pl:124
24679 msgid "Or use L<lvcreate(1)> to create a logical volume:"
24683 #: ../tools/virt-resize.pl:126
24686 " # lvcreate -L 10G -n lv_name vg_name\n"
24691 #: ../tools/virt-resize.pl:128
24692 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
24696 #: ../tools/virt-resize.pl:130
24699 " # virsh pool-list\n"
24700 " # virsh vol-create-as poolname newvol 10G\n"
24705 #: ../tools/virt-resize.pl:133
24710 #: ../tools/virt-resize.pl:135
24712 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
24713 "file) and the output disk. The output disk is the one created in the "
24718 #: ../tools/virt-resize.pl:139
24721 " # virt-resize indisk outdisk\n"
24726 #: ../tools/virt-resize.pl:141
24728 "This command just copies disk image C<indisk> to disk image C<outdisk> "
24729 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
24730 "larger, then an extra, empty partition is created at the end of the disk "
24731 "covering the extra space. If C<outdisk> is smaller, then it will give an "
24736 #: ../tools/virt-resize.pl:147
24738 "More realistically you'd want to expand existing partitions in the disk "
24739 "image by passing extra options (for the full list see the L</OPTIONS> "
24744 #: ../tools/virt-resize.pl:151
24746 "L</--expand> is the most useful option. It expands the named partition "
24747 "within the disk to fill any extra space:"
24751 #: ../tools/virt-resize.pl:154
24754 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
24759 #: ../tools/virt-resize.pl:156
24761 "(In this case, an extra partition is I<not> created at the end of the disk, "
24762 "because there will be no unused space)."
24766 #: ../tools/virt-resize.pl:159
24768 "L</--resize> is the other commonly used option. The following would "
24769 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
24770 "rest of the available space:"
24774 #: ../tools/virt-resize.pl:163
24777 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
24778 " indisk outdisk\n"
24783 #: ../tools/virt-resize.pl:166
24785 "If the expanded partition in the image contains a filesystem or LVM PV, then "
24786 "if virt-resize knows how, it will resize the contents, the equivalent of "
24787 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
24788 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
24789 "filesystems, so you would have to online resize them after booting the "
24790 "guest. And virt-resize also does not resize anything inside an LVM PV, it "
24791 "just resizes the PV itself and leaves the user to resize any LVs inside that "
24796 #: ../tools/virt-resize.pl:175
24797 msgid "Other options are covered below."
24801 #: ../tools/virt-resize.pl:177
24806 #: ../tools/virt-resize.pl:179
24807 msgid "Thoroughly test the new disk image I<before> discarding the old one."
24811 #: ../tools/virt-resize.pl:181
24812 msgid "If you are using libvirt, edit the XML to point at the new disk:"
24816 #: ../tools/virt-resize.pl:183
24819 " # virsh edit guestname\n"
24824 #: ../tools/virt-resize.pl:185
24826 "Change E<lt>source ...E<gt>, see "
24827 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
24831 #: ../tools/virt-resize.pl:188
24832 msgid "Then start up the domain with the new, resized disk:"
24836 #: ../tools/virt-resize.pl:190
24839 " # virsh start guestname\n"
24844 #: ../tools/virt-resize.pl:192
24846 "and check that it still works. See also the L</NOTES> section below for "
24847 "additional information."
24851 #: ../tools/virt-resize.pl:195
24852 msgid "7. Resize LVs etc inside the guest"
24856 #: ../tools/virt-resize.pl:197
24857 msgid "(This can also be done offline using L<guestfish(1)>)"
24861 #: ../tools/virt-resize.pl:199
24863 "Once the guest has booted you should see the new space available, at least "
24864 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
24865 "may need to resize LVs inside PVs, and also resize filesystem types that "
24866 "virt-resize does not know how to expand."
24870 #: ../tools/virt-resize.pl:206
24871 msgid "SHRINKING A VIRTUAL MACHINE DISK"
24875 #: ../tools/virt-resize.pl:208
24877 "Shrinking is somewhat more complex than expanding, and only an overview is "
24882 #: ../tools/virt-resize.pl:211
24884 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
24885 "filesystems). The user has to shrink content before passing the disk image "
24886 "to virt-resize, and virt-resize will check that the content has been shrunk "
24891 #: ../tools/virt-resize.pl:216
24892 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
24896 #: ../tools/virt-resize.pl:218
24898 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
24899 "steps 3 and 4 above to allocate a new disk image."
24903 #: ../tools/virt-resize.pl:221
24904 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
24908 #: ../tools/virt-resize.pl:224
24909 msgid "IGNORING OR DELETING PARTITIONS"
24913 #: ../tools/virt-resize.pl:226
24915 "virt-resize also gives a convenient way to ignore or delete partitions when "
24916 "copying from the input disk to the output disk. Ignoring a partition speeds "
24917 "up the copy where you don't care about the existing contents of a "
24918 "partition. Deleting a partition removes it completely, but note that it "
24919 "also renumbers any partitions after the one which is deleted, which can "
24920 "leave some guests unbootable."
24924 #: ../tools/virt-resize.pl:243
24925 msgid "Display help."
24929 #: ../tools/virt-resize.pl:257
24930 msgid "B<--resize part=size>"
24934 #: ../tools/virt-resize.pl:259
24936 "Resize the named partition (expanding or shrinking it) so that it has the "
24941 #: ../tools/virt-resize.pl:262
24943 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
24944 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
24945 "Exabytes; or as a percentage of the current size; or as a relative number or "
24946 "percentage. For example:"
24950 #: ../tools/virt-resize.pl:267
24953 " --resize /dev/sda2=10G\n"
24958 #: ../tools/virt-resize.pl:269
24961 " --resize /dev/sda4=90%\n"
24966 #: ../tools/virt-resize.pl:271
24969 " --resize /dev/sda2=+1G\n"
24974 #: ../tools/virt-resize.pl:273
24977 " --resize /dev/sda2=-200M\n"
24982 #: ../tools/virt-resize.pl:275
24985 " --resize /dev/sda1=+128K\n"
24990 #: ../tools/virt-resize.pl:277
24993 " --resize /dev/sda1=+10%\n"
24998 #: ../tools/virt-resize.pl:279
25001 " --resize /dev/sda1=-10%\n"
25006 #: ../tools/virt-resize.pl:281
25008 "You can increase the size of any partition. Virt-resize will expand the "
25009 "direct content of the partition if it knows how (see C<--expand> below)."
25013 #: ../tools/virt-resize.pl:285
25015 "You can only I<decrease> the size of partitions that contain filesystems or "
25016 "PVs which have already been shrunk. Virt-resize will check this has been "
25017 "done before proceeding, or else will print an error (see also "
25018 "C<--resize-force>)."
25022 #: ../tools/virt-resize.pl:290 ../tools/virt-resize.pl:382 ../tools/virt-resize.pl:399
25023 msgid "You can give this option multiple times."
25027 #: ../tools/virt-resize.pl:296
25028 msgid "B<--resize-force part=size>"
25032 #: ../tools/virt-resize.pl:298
25034 "This is the same as C<--resize> except that it will let you decrease the "
25035 "size of any partition. Generally this means you will lose any data which "
25036 "was at the end of the partition you shrink, but you may not care about that "
25037 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
25038 "as a swap partition)."
25042 #: ../tools/virt-resize.pl:304
25043 msgid "See also the C<--ignore> option."
25047 #: ../tools/virt-resize.pl:310
25048 msgid "B<--expand part>"
25052 #: ../tools/virt-resize.pl:312
25054 "Expand the named partition so it uses up all extra space (space left over "
25055 "after any other resize changes that you request have been done)."
25059 #: ../tools/virt-resize.pl:315
25061 "If virt-resize knows how, it will expand the direct content of the "
25062 "partition. For example, if the partition is an LVM PV, it will expand the "
25063 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
25064 "content it doesn't know about alone."
25068 #: ../tools/virt-resize.pl:320
25069 msgid "Currently virt-resize can resize:"
25073 #: ../tools/virt-resize.pl:326
25075 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
25080 #: ../tools/virt-resize.pl:331
25082 "NTFS filesystems contained directly in a partition, if libguestfs was "
25083 "compiled with support for NTFS."
25087 #: ../tools/virt-resize.pl:334
25089 "The filesystem must have been shut down consistently last time it was used. "
25090 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
25091 "consistency check, so at the first boot after resizing Windows will check "
25096 #: ../tools/virt-resize.pl:341
25098 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
25099 "inside the PV. The user will have to resize LVs as desired."
25103 #: ../tools/virt-resize.pl:347 ../tools/virt-resize.pl:369
25104 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
25108 #: ../tools/virt-resize.pl:353
25109 msgid "B<--shrink part>"
25113 #: ../tools/virt-resize.pl:355
25115 "Shrink the named partition until the overall disk image fits in the "
25116 "destination. The named partition B<must> contain a filesystem or PV which "
25117 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
25118 "online tools). Virt-resize will check this and give an error if it has not "
25123 #: ../tools/virt-resize.pl:361
25125 "The amount by which the overall disk must be shrunk (after carrying out all "
25126 "other operations requested by the user) is called the \"deficit\". For "
25127 "example, a straight copy (assume no other operations) from a 5GB disk image "
25128 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
25129 "would give an error unless the user specified a partition to shrink and that "
25130 "partition had more than a gigabyte of free space."
25134 #: ../tools/virt-resize.pl:375
25135 msgid "B<--ignore part>"
25139 #: ../tools/virt-resize.pl:377
25141 "Ignore the named partition. Effectively this means the partition is "
25142 "allocated on the destination disk, but the content is not copied across from "
25143 "the source disk. The content of the partition will be blank (all zero "
25148 #: ../tools/virt-resize.pl:388
25149 msgid "B<--delete part>"
25153 #: ../tools/virt-resize.pl:390
25155 "Delete the named partition. It would be more accurate to describe this as "
25156 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
25157 "the original disk image is left intact."
25161 #: ../tools/virt-resize.pl:394
25163 "Note that when you delete a partition, then anything contained in the "
25164 "partition is also deleted. Furthermore, this causes any partitions that "
25165 "come after to be I<renumbered>, which can easily make your guest unbootable."
25169 #: ../tools/virt-resize.pl:405
25170 msgid "B<--LV-expand logvol>"
25174 #: ../tools/virt-resize.pl:407
25176 "This takes the logical volume and, as a final step, expands it to fill all "
25177 "the space available in its volume group. A typical usage, assuming a Linux "
25178 "guest with a single PV C</dev/sda2> and a root device called "
25179 "C</dev/vg_guest/lv_root> would be:"
25183 #: ../tools/virt-resize.pl:412
25186 " virt-resize indisk outdisk \\\n"
25187 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
25192 #: ../tools/virt-resize.pl:415
25194 "This would first expand the partition (and PV), and then expand the root "
25195 "device to fill the extra space in the PV."
25199 #: ../tools/virt-resize.pl:418
25201 "The contents of the LV are also resized if virt-resize knows how to do "
25202 "that. You can stop virt-resize from trying to expand the content by using "
25203 "the option C<--no-expand-content>."
25207 #: ../tools/virt-resize.pl:422
25208 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
25212 #: ../tools/virt-resize.pl:425
25214 "You can give this option multiple times, I<but> it doesn't make sense to do "
25215 "this unless the logical volumes you specify are all in different volume "
25220 #: ../tools/virt-resize.pl:433
25221 msgid "B<--no-copy-boot-loader>"
25225 #: ../tools/virt-resize.pl:435
25227 "By default, virt-resize copies over some sectors at the start of the disk "
25228 "(up to the beginning of the first partition). Commonly these sectors "
25229 "contain the Master Boot Record (MBR) and the boot loader, and are required "
25230 "in order for the guest to boot correctly."
25234 #: ../tools/virt-resize.pl:440
25236 "If you specify this flag, then this initial copy is not done. You may need "
25237 "to reinstall the boot loader in this case."
25241 #: ../tools/virt-resize.pl:448
25242 msgid "B<--no-extra-partition>"
25246 #: ../tools/virt-resize.pl:450
25248 "By default, virt-resize creates an extra partition if there is any extra, "
25249 "unused space after all resizing has happened. Use this option to prevent "
25250 "the extra partition from being created. If you do this then the extra space "
25251 "will be inaccessible until you run fdisk, parted, or some other partitioning "
25252 "tool in the guest."
25256 #: ../tools/virt-resize.pl:456
25258 "Note that if the surplus space is smaller than 10 MB, no extra partition "
25263 #: ../tools/virt-resize.pl:463
25264 msgid "B<--no-expand-content>"
25268 #: ../tools/virt-resize.pl:465
25270 "By default, virt-resize will try to expand the direct contents of "
25271 "partitions, if it knows how (see C<--expand> option above)."
25275 #: ../tools/virt-resize.pl:468
25277 "If you give the C<--no-expand-content> option then virt-resize will not "
25282 #: ../tools/virt-resize.pl:475
25283 msgid "B<-d> | B<--debug>"
25287 #: ../tools/virt-resize.pl:477 ../tools/virt-win-reg.pl:198
25288 msgid "Enable debugging messages."
25292 #: ../tools/virt-resize.pl:483
25293 msgid "B<-n> | B<--dryrun>"
25297 #: ../tools/virt-resize.pl:485
25298 msgid "Print a summary of what would be done, but don't do anything."
25302 #: ../tools/virt-resize.pl:491
25303 msgid "B<-q> | B<--quiet>"
25307 #: ../tools/virt-resize.pl:493
25308 msgid "Don't print the summary."
25312 #: ../tools/virt-resize.pl:1352
25313 msgid "\"Partition 1 does not end on cylinder boundary.\""
25317 #: ../tools/virt-resize.pl:1354
25319 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
25320 "means the partitions will not be aligned to the ancient CHS geometry. "
25321 "However CHS geometry is meaningless for disks manufactured since the early "
25322 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
25323 "cylinders is not required by any modern operating system."
25327 #: ../tools/virt-resize.pl:1361
25328 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
25332 #: ../tools/virt-resize.pl:1363
25334 "In Windows Vista and later versions, Microsoft switched to using a separate "
25335 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
25336 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
25337 "the boot partition. Doing so seems to break the guest completely. However "
25338 "expanding the second partition (ie. C: drive) should work."
25342 #: ../tools/virt-resize.pl:1370
25344 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
25345 "NTFS partitions have been expanded. This is just a safety check and (unless "
25346 "it find errors) is nothing to worry about."
25350 #: ../tools/virt-resize.pl:1374
25351 msgid "ALTERNATIVE TOOLS"
25355 #: ../tools/virt-resize.pl:1376
25357 "There are several proprietary tools for resizing partitions. We won't "
25358 "mention any here."
25362 #: ../tools/virt-resize.pl:1379
25364 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
25365 "operations on disk images. They can resize and move partitions, but I don't "
25366 "think they can do anything with the contents, and they certainly don't "
25371 #: ../tools/virt-resize.pl:1384
25373 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
25374 "but at a much lower level. You will probably end up hand-calculating sector "
25375 "offsets, which is something that virt-resize was designed to avoid. If you "
25376 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
25381 #: ../tools/virt-resize.pl:1392
25383 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
25384 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
25385 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, "
25386 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
25390 #: ../tools/virt-tar.pl:34
25391 msgid "virt-tar - Extract or upload files to a virtual machine"
25395 #: ../tools/virt-tar.pl:38
25398 " virt-tar [--options] -x domname directory tarball\n"
25403 #: ../tools/virt-tar.pl:40
25406 " virt-tar [--options] -u domname tarball directory\n"
25411 #: ../tools/virt-tar.pl:42
25414 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
25419 #: ../tools/virt-tar.pl:44
25422 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
25427 #: ../tools/virt-tar.pl:48
25428 msgid "Download C</home> from the VM into a local tarball:"
25432 #: ../tools/virt-tar.pl:50
25435 " virt-tar -x domname /home home.tar\n"
25440 #: ../tools/virt-tar.pl:52
25443 " virt-tar -zx domname /home home.tar.gz\n"
25448 #: ../tools/virt-tar.pl:54
25449 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
25453 #: ../tools/virt-tar.pl:56
25456 " virt-tar -u domname uploadstuff.tar /tmp\n"
25461 #: ../tools/virt-tar.pl:58
25464 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
25469 #: ../tools/virt-tar.pl:62
25471 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
25472 "virtual machines. If you do this, you risk disk corruption in the VM. "
25473 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
25477 #: ../tools/virt-tar.pl:67
25479 "You can use C<-x> (extract) on live virtual machines, but you might get "
25480 "inconsistent results or errors if there is filesystem activity inside the "
25481 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
25482 "work, but the only way to guarantee consistent results is if the virtual "
25483 "machine is shut down."
25487 #: ../tools/virt-tar.pl:75
25489 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
25490 "parts of a guest filesystem. There are many possibilities: making backups, "
25491 "uploading data files, snooping on guest activity, fixing or customizing "
25496 #: ../tools/virt-tar.pl:80
25498 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
25499 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
25500 "should look at the L<guestfish(1)> tool."
25504 #: ../tools/virt-tar.pl:84
25506 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
25507 "its contents (recursively) from the virtual machine into a local tarball. "
25508 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
25509 "virtual machine. You cannot use these two options together."
25513 #: ../tools/virt-tar.pl:90
25515 "In addition, you may need to use the C<-z> (gZip) option to enable "
25516 "compression. When uploading, you have to specify C<-z> if the upload file "
25517 "is compressed because virt-tar won't detect this on its own."
25521 #: ../tools/virt-tar.pl:94
25523 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
25524 "example it cannot do PKZip files or bzip2 compression. If you want that "
25525 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
25526 "the L<libguestfs(3)> API)."
25530 #: ../tools/virt-tar.pl:135
25531 msgid "B<-x> | B<--extract> | B<--download>"
25535 #: ../tools/virt-tar.pl:137
25536 msgid "B<-u> | B<--upload>"
25540 #: ../tools/virt-tar.pl:139
25542 "Use C<-x> to extract (download) a directory from a virtual machine to a "
25547 #: ../tools/virt-tar.pl:142
25549 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
25550 "Please read the L</WARNING> section above before using this option."
25554 #: ../tools/virt-tar.pl:146
25555 msgid "You must specify exactly one of these options."
25559 #: ../tools/virt-tar.pl:152
25560 msgid "B<-z> | B<--gzip>"
25564 #: ../tools/virt-tar.pl:154
25565 msgid "Specify that the input or output tarball is gzip-compressed."
25569 #: ../tools/virt-tar.pl:259
25571 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
25572 "L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
25573 "L<http://libguestfs.org/>."
25577 #: ../tools/virt-win-reg.pl:38
25579 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
25584 #: ../tools/virt-win-reg.pl:42
25587 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
25592 #: ../tools/virt-win-reg.pl:44
25595 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
25600 #: ../tools/virt-win-reg.pl:46
25603 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
25608 #: ../tools/virt-win-reg.pl:48
25611 " virt-win-reg --merge domname [input.reg ...]\n"
25616 #: ../tools/virt-win-reg.pl:50
25619 " virt-win-reg [--options] disk.img ... # instead of domname\n"
25624 #: ../tools/virt-win-reg.pl:54
25626 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
25627 "virtual machines. If you do this, you I<will> get irreversible disk "
25628 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
25629 "but doesn't catch all cases."
25633 #: ../tools/virt-win-reg.pl:59
25635 "Modifying the Windows Registry is an inherently risky operation. The format "
25636 "is deliberately obscure and undocumented, and Registry changes can leave the "
25637 "system unbootable. Therefore when using the C<--merge> option, make sure "
25638 "you have a reliable backup first."
25642 #: ../tools/virt-win-reg.pl:66
25644 "This program can export and merge Windows Registry entries from a Windows "
25649 #: ../tools/virt-win-reg.pl:69
25651 "The first parameter is the libvirt guest name or the raw disk image of a "
25656 #: ../tools/virt-win-reg.pl:72
25658 "If C<--merge> is I<not> specified, then the chosen registry key is "
25659 "displayed/exported (recursively). For example:"
25663 #: ../tools/virt-win-reg.pl:75
25666 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
25671 #: ../tools/virt-win-reg.pl:77
25672 msgid "You can also display single values from within registry keys, for example:"
25676 #: ../tools/virt-win-reg.pl:80
25679 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
25680 " $ virt-win-reg Windows7 $cvkey ProductName\n"
25681 " Windows 7 Enterprise\n"
25686 #: ../tools/virt-win-reg.pl:84
25688 "With C<--merge>, you can merge a textual regedit file into the Windows "
25693 #: ../tools/virt-win-reg.pl:87
25696 " $ virt-win-reg --merge Windows7 changes.reg\n"
25701 #: ../tools/virt-win-reg.pl:89
25702 msgid "SUPPORTED SYSTEMS"
25706 #: ../tools/virt-win-reg.pl:91
25708 "The program currently supports Windows NT-derived guests starting with "
25709 "Windows XP through to at least Windows 7."
25713 #: ../tools/virt-win-reg.pl:94
25715 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
25716 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
25717 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
25721 #: ../tools/virt-win-reg.pl:98
25723 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
25728 #: ../tools/virt-win-reg.pl:101
25730 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
25735 #: ../tools/virt-win-reg.pl:104
25740 #: ../tools/virt-win-reg.pl:106
25742 "This program is only meant for simple access to the registry. If you want "
25743 "to do complicated things with the registry, we suggest you download the "
25744 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
25745 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
25746 "L<hivexregedit(1)>."
25750 #: ../tools/virt-win-reg.pl:112
25755 #: ../tools/virt-win-reg.pl:114
25757 "C<virt-win-reg> expects that regedit files have already been reencoded in "
25758 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
25759 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
25760 "with Windows-style line endings, you may need to reencode the whole file "
25761 "before or after processing."
25765 #: ../tools/virt-win-reg.pl:120
25767 "To reencode a file from Windows format to Linux (before processing it with "
25768 "the C<--merge> option), you would do something like this:"
25772 #: ../tools/virt-win-reg.pl:123
25775 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
25780 #: ../tools/virt-win-reg.pl:125
25782 "To go in the opposite direction, after exporting and before sending the file "
25783 "to a Windows user, do something like this:"
25787 #: ../tools/virt-win-reg.pl:128
25790 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
25795 #: ../tools/virt-win-reg.pl:130
25796 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
25800 #: ../tools/virt-win-reg.pl:132
25802 "If you are unsure about the current encoding, use the L<file(1)> command. "
25803 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
25804 "Windows-style (CRLF) line endings, like this:"
25808 #: ../tools/virt-win-reg.pl:136
25811 " $ file software.reg\n"
25812 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
25813 " with CRLF line terminators\n"
25818 #: ../tools/virt-win-reg.pl:140
25819 msgid "This file would need conversion before you could C<--merge> it."
25823 #: ../tools/virt-win-reg.pl:142
25824 msgid "SHELL QUOTING"
25828 #: ../tools/virt-win-reg.pl:144
25830 "Be careful when passing parameters containing C<\\> (backslash) in the "
25831 "shell. Usually you will have to use 'single quotes' or double backslashes "
25832 "(but not both) to protect them from the shell."
25836 #: ../tools/virt-win-reg.pl:148
25837 msgid "Paths and value names are case-insensitive."
25841 #: ../tools/virt-win-reg.pl:150
25842 msgid "CurrentControlSet etc."
25846 #: ../tools/virt-win-reg.pl:152
25848 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
25849 "Registry at the level of the hive file, and therefore you cannot modify "
25854 #: ../tools/virt-win-reg.pl:156
25856 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
25857 "circumstances it might refer to another control set. The way to find out is "
25858 "to look at the C<HKLM\\SYSTEM\\Select> key:"
25862 #: ../tools/virt-win-reg.pl:160
25865 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
25866 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
25867 " \"Current\"=dword:00000001\n"
25868 " \"Default\"=dword:00000001\n"
25869 " \"Failed\"=dword:00000000\n"
25870 " \"LastKnownGood\"=dword:00000002\n"
25875 #: ../tools/virt-win-reg.pl:167
25876 msgid "\"Default\" is the one which Windows will choose when it boots."
25880 #: ../tools/virt-win-reg.pl:169
25881 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
25885 #: ../tools/virt-win-reg.pl:216
25890 #: ../tools/virt-win-reg.pl:218
25892 "In merge mode, this merges a textual regedit file into the Windows Registry "
25893 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
25894 "displays or exports Registry entries instead."
25898 #: ../tools/virt-win-reg.pl:222
25900 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
25901 "result in disk corruption. However exporting (without this flag) is always "
25906 #: ../tools/virt-win-reg.pl:230
25907 msgid "B<--encoding> UTF-16LE|ASCII"
25911 #: ../tools/virt-win-reg.pl:232
25913 "When merging (only), you may need to specify the encoding for strings to be "
25914 "used in the hive file. This is explained in detail in "
25915 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
25919 #: ../tools/virt-win-reg.pl:236
25921 "The default is to use UTF-16LE, which should work with recent versions of "
25926 #: ../tools/virt-win-reg.pl:463
25928 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
25929 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
25930 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
25931 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
25935 #: ../tools/virt-win-reg.pl:481
25938 " export LIBGUESTFS_DEBUG=1\n"
25939 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
25944 #: ../tools/virt-win-reg.pl:484
25946 "Attach /tmp/virt-win-reg.log to a new bug report at "
25947 "L<https://bugzilla.redhat.com/>"