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.11.4\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-05-08 16:51+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"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-list-filesystems.pl:30 ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
26 #: ../src/guestfs.pod:5
27 msgid "guestfs - Library for accessing and modifying virtual machine images"
31 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
36 #: ../src/guestfs.pod:9
39 " #include <guestfs.h>\n"
44 #: ../src/guestfs.pod:11
47 " guestfs_h *g = guestfs_create ();\n"
48 " guestfs_add_drive (g, \"guest.img\");\n"
49 " guestfs_launch (g);\n"
50 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
51 " guestfs_touch (g, \"/hello\");\n"
52 " guestfs_umount (g, \"/\");\n"
53 " guestfs_close (g);\n"
58 #: ../src/guestfs.pod:19
61 " cc prog.c -o prog -lguestfs\n"
63 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
68 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20 ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:77 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
73 #: ../src/guestfs.pod:25
75 "Libguestfs is a library for accessing and modifying guest disk images. "
76 "Amongst the things this is good for: making batch configuration changes to "
77 "guests, getting disk used/free statistics (see also: virt-df), migrating "
78 "between virtualization systems (see also: virt-p2v), performing partial "
79 "backups, performing partial guest clones, cloning guests and changing "
80 "registry/UUID/hostname info, and much else besides."
84 #: ../src/guestfs.pod:33
86 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
87 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
88 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
93 #: ../src/guestfs.pod:38
95 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
96 "what filesystem is in each LV, etc.). It can also run commands in the "
97 "context of the guest. Also you can access filesystems over FUSE."
101 #: ../src/guestfs.pod:43
103 "Libguestfs is a library that can be linked with C and C++ management "
104 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
105 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
110 #: ../src/guestfs.pod:48
112 "You don't need to be root to use libguestfs, although obviously you do need "
113 "enough permissions to access the disk images."
117 #: ../src/guestfs.pod:51
119 "Libguestfs is a large API because it can do many things. For a gentle "
120 "introduction, please read the L</API OVERVIEW> section next."
124 #: ../src/guestfs.pod:54
126 "There are also some example programs in the L<guestfs-examples(3)> manual "
131 #: ../src/guestfs.pod:57
136 #: ../src/guestfs.pod:59
138 "This section provides a gentler overview of the libguestfs API. We also try "
139 "to group API calls together, where that may not be obvious from reading "
140 "about the individual calls in the main section of this manual."
144 #: ../src/guestfs.pod:64
149 #: ../src/guestfs.pod:66
151 "Before you can use libguestfs calls, you have to create a handle. Then you "
152 "must add at least one disk image to the handle, followed by launching the "
153 "handle, then performing whatever operations you want, and finally closing "
154 "the handle. By convention we use the single letter C<g> for the name of the "
155 "handle variable, although of course you can use any name you want."
159 #: ../src/guestfs.pod:73
160 msgid "The general structure of all libguestfs-using programs looks like this:"
164 #: ../src/guestfs.pod:76
167 " guestfs_h *g = guestfs_create ();\n"
172 #: ../src/guestfs.pod:78
175 " /* Call guestfs_add_drive additional times if there are\n"
176 " * multiple disk images.\n"
178 " guestfs_add_drive (g, \"guest.img\");\n"
183 #: ../src/guestfs.pod:83
186 " /* Most manipulation calls won't work until you've launched\n"
187 " * the handle 'g'. You have to do this _after_ adding drives\n"
188 " * and _before_ other commands.\n"
190 " guestfs_launch (g);\n"
195 #: ../src/guestfs.pod:89
198 " /* Now you can examine what partitions, LVs etc are available.\n"
200 " char **partitions = guestfs_list_partitions (g);\n"
201 " char **logvols = guestfs_lvs (g);\n"
206 #: ../src/guestfs.pod:94
209 " /* To access a filesystem in the image, you must mount it.\n"
211 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
216 #: ../src/guestfs.pod:98
219 " /* Now you can perform filesystem actions on the guest\n"
222 " guestfs_touch (g, \"/hello\");\n"
227 #: ../src/guestfs.pod:103
230 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
231 " * it is done automatically when you close the handle. See\n"
232 " * discussion of autosync in this page.\n"
234 " guestfs_sync (g);\n"
239 #: ../src/guestfs.pod:109
242 " /* Close the handle 'g'. */\n"
243 " guestfs_close (g);\n"
248 #: ../src/guestfs.pod:112
250 "The code above doesn't include any error checking. In real code you should "
251 "check return values carefully for errors. In general all functions that "
252 "return integers return C<-1> on error, and all functions that return "
253 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
254 "how to handle errors, and consult the documentation for each function call "
255 "below to see precisely how they return error indications. See "
256 "L<guestfs-examples(3)> for fully worked examples."
260 #: ../src/guestfs.pod:121
265 #: ../src/guestfs.pod:123
267 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
268 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
269 "actual block device, or simply an empty file of zeroes that you have created "
270 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
275 #: ../src/guestfs.pod:129
277 "The call you should use in modern code for adding drives is "
278 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
279 "specifying that the format is raw, do:"
283 #: ../src/guestfs.pod:133
286 " guestfs_add_drive_opts (g, filename,\n"
287 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
293 #: ../src/guestfs.pod:137
294 msgid "You can add a disk read-only using:"
298 #: ../src/guestfs.pod:139
301 " guestfs_add_drive_opts (g, filename,\n"
302 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
303 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
309 #: ../src/guestfs.pod:144
311 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
312 "libguestfs won't modify the file."
316 #: ../src/guestfs.pod:147
318 "Be extremely cautious if the disk image is in use, eg. if it is being used "
319 "by a virtual machine. Adding it read-write will almost certainly cause disk "
320 "corruption, but adding it read-only is safe."
324 #: ../src/guestfs.pod:151
326 "You must add at least one disk image, and you may add multiple disk images. "
327 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
328 "first one you added), C</dev/sdb> (for the second one you added), etc."
332 #: ../src/guestfs.pod:156
334 "Once L</guestfs_launch> has been called you cannot add any more images. You "
335 "can call L</guestfs_list_devices> to get a list of the device names, in the "
336 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
340 #: ../src/guestfs.pod:161
345 #: ../src/guestfs.pod:163
347 "Before you can read or write files, create directories and so on in a disk "
348 "image that contains filesystems, you have to mount those filesystems using "
349 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
350 "a disk image contains (for example) one partition with a filesystem on that "
351 "partition, then you can mount it directly:"
355 #: ../src/guestfs.pod:170
358 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
363 #: ../src/guestfs.pod:172
365 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
366 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
367 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
368 "that these are libguestfs virtual devices, and are nothing to do with host "
373 #: ../src/guestfs.pod:178
375 "If you are given a disk image and you don't know what it contains then you "
376 "have to find out. Libguestfs can do that too: use "
377 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
378 "and LVs, and either try mounting each to see what is mountable, or else "
379 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
380 "filesystems, use L</guestfs_list_filesystems>."
384 #: ../src/guestfs.pod:186
386 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
387 "L</INSPECTION> below). But you might find it easier to look at higher level "
388 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
392 #: ../src/guestfs.pod:191
394 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
395 "several other variations of the C<guestfs_mount_*> call."
399 #: ../src/guestfs.pod:194
400 msgid "FILESYSTEM ACCESS AND MODIFICATION"
404 #: ../src/guestfs.pod:196
406 "The majority of the libguestfs API consists of fairly low-level calls for "
407 "accessing and modifying the files, directories, symlinks etc on mounted "
408 "filesystems. There are over a hundred such calls which you can find listed "
409 "in detail below in this man page, and we don't even pretend to cover them "
410 "all in this overview."
414 #: ../src/guestfs.pod:202
416 "Specify filenames as full paths, starting with C<\"/\"> and including the "
421 #: ../src/guestfs.pod:205
423 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
424 "the file called C<\"etc/passwd\"> then you could do:"
428 #: ../src/guestfs.pod:208
431 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
436 #: ../src/guestfs.pod:210
438 "This would return C<data> as a newly allocated buffer containing the full "
439 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
440 "or C<NULL> if there was an error."
444 #: ../src/guestfs.pod:214
446 "As another example, to create a top-level directory on that filesystem "
447 "called C<\"var\"> you would do:"
451 #: ../src/guestfs.pod:217
454 " guestfs_mkdir (g, \"/var\");\n"
459 #: ../src/guestfs.pod:219
460 msgid "To create a symlink you could do:"
464 #: ../src/guestfs.pod:221
467 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
468 " \"/etc/rc3.d/S30portmap\");\n"
473 #: ../src/guestfs.pod:224
475 "Libguestfs will reject attempts to use relative paths and there is no "
476 "concept of a current working directory."
480 #: ../src/guestfs.pod:227
482 "Libguestfs can return errors in many situations: for example if the "
483 "filesystem isn't writable, or if a file or directory that you requested "
484 "doesn't exist. If you are using the C API (documented here) you have to "
485 "check for those error conditions after each call. (Other language bindings "
486 "turn these errors into exceptions)."
490 #: ../src/guestfs.pod:233
492 "File writes are affected by the per-handle umask, set by calling "
493 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
497 #: ../src/guestfs.pod:236
502 #: ../src/guestfs.pod:238
504 "Libguestfs contains API calls to read, create and modify partition tables on "
509 #: ../src/guestfs.pod:241
511 "In the common case where you want to create a single partition covering the "
512 "whole disk, you should use the L</guestfs_part_disk> call:"
516 #: ../src/guestfs.pod:245
519 " const char *parttype = \"mbr\";\n"
520 " if (disk_is_larger_than_2TB)\n"
521 " parttype = \"gpt\";\n"
522 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
527 #: ../src/guestfs.pod:250
529 "Obviously this effectively wipes anything that was on that disk image "
534 #: ../src/guestfs.pod:253
539 #: ../src/guestfs.pod:255
541 "Libguestfs provides access to a large part of the LVM2 API, such as "
542 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
543 "unless you familiarize yourself with the concepts of physical volumes, "
544 "volume groups and logical volumes."
548 #: ../src/guestfs.pod:260
550 "This author strongly recommends reading the LVM HOWTO, online at "
551 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
555 #: ../src/guestfs.pod:263
560 #: ../src/guestfs.pod:265
562 "Use L</guestfs_cat> to download small, text only files. This call is "
563 "limited to files which are less than 2 MB and which cannot contain any ASCII "
564 "NUL (C<\\0>) characters. However the API is very simple to use."
568 #: ../src/guestfs.pod:269
570 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
571 "bit data, since it returns a (pointer, size) pair. However it is still "
572 "limited to \"small\" files, less than 2 MB."
576 #: ../src/guestfs.pod:273
578 "L</guestfs_download> can be used to download any file, with no limits on "
579 "content or size (even files larger than 4 GB)."
583 #: ../src/guestfs.pod:276
584 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
588 #: ../src/guestfs.pod:279
593 #: ../src/guestfs.pod:281
595 "It's often the case that you want to write a file or files to the disk "
600 #: ../src/guestfs.pod:284
602 "To write a small file with fixed content, use L</guestfs_write>. To create "
603 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
604 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
605 "variety of other functions for creating test files, for example "
606 "L</guestfs_fill> and L</guestfs_fill_pattern>."
610 #: ../src/guestfs.pod:290
612 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
613 "file content or size (even files larger than 4 GB)."
617 #: ../src/guestfs.pod:293
618 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
622 #: ../src/guestfs.pod:295
624 "However the fastest way to upload I<large numbers of arbitrary files> is to "
625 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
626 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
627 "the drive in a predictable way (eg. adding it last after all other drives) "
628 "then you can get the device name from L</guestfs_list_devices> and mount it "
629 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
630 "sometimes non-portable between kernel versions, and they don't support "
631 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
632 "using a label or UUID, use an ISO image instead."
636 #: ../src/guestfs.pod:306
641 #: ../src/guestfs.pod:308
643 "There are various different commands for copying between files and devices "
644 "and in and out of the guest filesystem. These are summarised in the table "
649 #: ../src/guestfs.pod:314
650 msgid "B<file> to B<file>"
654 #: ../src/guestfs.pod:316
656 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
657 "directories recursively."
661 #: ../src/guestfs.pod:319
662 msgid "B<file or device> to B<file or device>"
666 #: ../src/guestfs.pod:321
668 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
669 "devices in the guest."
673 #: ../src/guestfs.pod:324
674 msgid "Example: duplicate the contents of an LV:"
678 #: ../src/guestfs.pod:326
681 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
686 #: ../src/guestfs.pod:328
688 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
689 "(C</dev/VG/Original>). To copy less than the whole source device, use "
690 "L</guestfs_copy_size>."
694 #: ../src/guestfs.pod:332
695 msgid "B<file on the host> to B<file or device>"
699 #: ../src/guestfs.pod:334
700 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
704 #: ../src/guestfs.pod:336
705 msgid "B<file or device> to B<file on the host>"
709 #: ../src/guestfs.pod:338
710 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
714 #: ../src/guestfs.pod:342
715 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
719 #: ../src/guestfs.pod:344
721 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
722 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
723 "appears you can only upload and download to files. However many Un*x-like "
724 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
725 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
726 "stderr, and arbitrary file descriptor N."
730 #: ../src/guestfs.pod:352
731 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
735 #: ../src/guestfs.pod:355
738 " guestfs_download (g, filename, \"/dev/stdout\");\n"
743 #: ../src/guestfs.pod:357
744 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
748 #: ../src/guestfs.pod:359
752 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
753 " guestfs_tar_out (g, \"/\", devfd);\n"
758 #: ../src/guestfs.pod:363
759 msgid "LISTING FILES"
763 #: ../src/guestfs.pod:365
765 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
766 "L<guestfish(1)>-equivalent command C<ll>)."
770 #: ../src/guestfs.pod:368
772 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
773 "programs, as a flat list of strings."
777 #: ../src/guestfs.pod:371
779 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
780 "directory, plus additional information about each one. It is more "
781 "equivalent to using the L<readdir(3)> call on a local filesystem."
785 #: ../src/guestfs.pod:375
787 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
792 #: ../src/guestfs.pod:378
793 msgid "RUNNING COMMANDS"
797 #: ../src/guestfs.pod:380
799 "Although libguestfs is primarily an API for manipulating files inside guest "
800 "images, we also provide some limited facilities for running commands inside "
805 #: ../src/guestfs.pod:384
806 msgid "There are many limitations to this:"
810 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1064 ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077 ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112 ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142 ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154 ../src/guestfs.pod:1643 ../src/guestfs.pod:1648 ../src/guestfs.pod:1652 ../src/guestfs.pod:1754 ../src/guestfs.pod:1759 ../src/guestfs.pod:1763 ../src/guestfs.pod:1773 ../src/guestfs.pod:2008 ../src/guestfs.pod:2013 ../src/guestfs.pod:2019 ../src/guestfs.pod:2027 ../src/guestfs.pod:2381 ../src/guestfs.pod:2387 ../src/guestfs.pod:2392 ../src/guestfs.pod:2398 ../src/guestfs.pod:2963 ../src/guestfs.pod:2967 ../src/guestfs.pod:2971 ../src/guestfs.pod:2975 ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:583 ../src/guestfs-actions.pod:591 ../src/guestfs-actions.pod:598 ../src/guestfs-actions.pod:605 ../src/guestfs-actions.pod:1606 ../src/guestfs-actions.pod:1610 ../src/guestfs-actions.pod:1614 ../src/guestfs-actions.pod:1618 ../src/guestfs-actions.pod:1626 ../src/guestfs-actions.pod:1630 ../src/guestfs-actions.pod:1634 ../src/guestfs-actions.pod:1644 ../src/guestfs-actions.pod:1648 ../src/guestfs-actions.pod:1652 ../src/guestfs-actions.pod:1790 ../src/guestfs-actions.pod:1794 ../src/guestfs-actions.pod:1799 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:1874 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:385 ../fish/guestfish-actions.pod:393 ../fish/guestfish-actions.pod:400 ../fish/guestfish-actions.pod:407 ../fish/guestfish-actions.pod:1077 ../fish/guestfish-actions.pod:1081 ../fish/guestfish-actions.pod:1085 ../fish/guestfish-actions.pod:1089 ../fish/guestfish-actions.pod:1097 ../fish/guestfish-actions.pod:1101 ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1115 ../fish/guestfish-actions.pod:1119 ../fish/guestfish-actions.pod:1123 ../fish/guestfish-actions.pod:1213 ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1222 ../fish/guestfish-actions.pod:1227 ../fish/guestfish-actions.pod:1269 ../fish/guestfish-actions.pod:1273 ../fish/guestfish-actions.pod:1278 ../tools/virt-edit.pl:351 ../tools/virt-edit.pl:356 ../tools/virt-edit.pl:361 ../tools/virt-edit.pl:372 ../tools/virt-edit.pl:376 ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542 ../tools/virt-win-reg.pl:548
815 #: ../src/guestfs.pod:390
817 "The kernel version that the command runs under will be different from what "
822 #: ../src/guestfs.pod:395
824 "If the command needs to communicate with daemons, then most likely they "
829 #: ../src/guestfs.pod:400
830 msgid "The command will be running in limited memory."
834 #: ../src/guestfs.pod:404
836 "The network may not be available unless you enable it (see "
837 "L</guestfs_set_network>)."
841 #: ../src/guestfs.pod:409
842 msgid "Only supports Linux guests (not Windows, BSD, etc)."
846 #: ../src/guestfs.pod:413
847 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
851 #: ../src/guestfs.pod:418
853 "For SELinux guests, you may need to enable SELinux and load policy first. "
854 "See L</SELINUX> in this manpage."
858 #: ../src/guestfs.pod:423
860 "I<Security:> It is not safe to run commands from untrusted, possibly "
861 "malicious guests. These commands may attempt to exploit your program by "
862 "sending unexpected output. They could also try to exploit the Linux kernel "
863 "or qemu provided by the libguestfs appliance. They could use the network "
864 "provided by the libguestfs appliance to bypass ordinary network partitions "
865 "and firewalls. They could use the elevated privileges or different SELinux "
866 "context of your program to their advantage."
870 #: ../src/guestfs.pod:432
872 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
873 "(a script which runs when the guest next boots normally), and to have this "
874 "script run the commands you want in the normal context of the running guest, "
875 "network security and so on. For information about other security issues, "
880 #: ../src/guestfs.pod:440
882 "The two main API calls to run commands are L</guestfs_command> and "
883 "L</guestfs_sh> (there are also variations)."
887 #: ../src/guestfs.pod:443
889 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
890 "shell globs, redirections, etc will work."
894 #: ../src/guestfs.pod:446
895 msgid "CONFIGURATION FILES"
899 #: ../src/guestfs.pod:448
901 "To read and write configuration files in Linux guest filesystems, we "
902 "strongly recommend using Augeas. For example, Augeas understands how to "
903 "read and write, say, a Linux shadow password file or X.org configuration "
904 "file, and so avoids you having to write that code."
908 #: ../src/guestfs.pod:453
910 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
911 "document Augeas itself here because there is excellent documentation on the "
912 "L<http://augeas.net/> website."
916 #: ../src/guestfs.pod:457
918 "If you don't want to use Augeas (you fool!) then try calling "
919 "L</guestfs_read_lines> to get the file as a list of lines which you can "
924 #: ../src/guestfs.pod:461
929 #: ../src/guestfs.pod:463
931 "We support SELinux guests. To ensure that labeling happens correctly in "
932 "SELinux guests, you need to enable SELinux and load the guest's policy:"
936 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1395 ../src/guestfs.pod:2426
941 #: ../src/guestfs.pod:471
942 msgid "Before launching, do:"
946 #: ../src/guestfs.pod:473
949 " guestfs_set_selinux (g, 1);\n"
954 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1399 ../src/guestfs.pod:2451
959 #: ../src/guestfs.pod:477
961 "After mounting the guest's filesystem(s), load the policy. This is best "
962 "done by running the L<load_policy(8)> command in the guest itself:"
966 #: ../src/guestfs.pod:481
969 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
974 #: ../src/guestfs.pod:483
976 "(Older versions of C<load_policy> require you to specify the name of the "
981 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1405
986 #: ../src/guestfs.pod:488
988 "Optionally, set the security context for the API. The correct security "
989 "context to use can only be known by inspecting the guest. As an example:"
993 #: ../src/guestfs.pod:492
996 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1001 #: ../src/guestfs.pod:496
1002 msgid "This will work for running commands and editing existing files."
1006 #: ../src/guestfs.pod:498
1008 "When new files are created, you may need to label them explicitly, for "
1009 "example by running the external command C<restorecon pathname>."
1013 #: ../src/guestfs.pod:502
1018 #: ../src/guestfs.pod:504
1020 "Certain calls are affected by the current file mode creation mask (the "
1021 "\"umask\"). In particular ones which create files or directories, such as "
1022 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1023 "either the default mode that the file is created with or modifies the mode "
1028 #: ../src/guestfs.pod:510
1030 "The default umask is C<022>, so files are created with modes such as C<0644> "
1031 "and directories with C<0755>."
1035 #: ../src/guestfs.pod:513
1037 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1038 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
1039 "L</guestfs_chmod> after creating each file or directory."
1043 #: ../src/guestfs.pod:517
1044 msgid "For more information about umask, see L<umask(2)>."
1048 #: ../src/guestfs.pod:519 ../fish/guestfish.pod:767
1049 msgid "ENCRYPTED DISKS"
1053 #: ../src/guestfs.pod:521
1055 "Libguestfs allows you to access Linux guests which have been encrypted using "
1056 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1057 "standard. This includes nearly all whole disk encryption systems used by "
1058 "modern Linux guests."
1062 #: ../src/guestfs.pod:527
1064 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1065 "returns the string C<crypto_LUKS>)."
1069 #: ../src/guestfs.pod:530
1071 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1072 "will require the passphrase!"
1076 #: ../src/guestfs.pod:533
1078 "Opening a LUKS device creates a new device mapper device called "
1079 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1080 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1081 "decrypted from and encrypted to the underlying block device respectively."
1085 #: ../src/guestfs.pod:539
1087 "LVM volume groups on the device can be made visible by calling "
1088 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1089 "volume(s) can now be mounted in the usual way."
1093 #: ../src/guestfs.pod:543
1095 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1096 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1097 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1098 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1099 "underlying encrypted block device)."
1103 #: ../src/guestfs.pod:550
1108 #: ../src/guestfs.pod:552
1110 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1111 "contains operating systems, an install CD or a live CD. (These APIs used to "
1112 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
1113 "version 1.5.3 the most frequently used part of this library has been "
1114 "rewritten in C and moved into the core code)."
1118 #: ../src/guestfs.pod:559
1120 "Add all disks belonging to the unknown virtual machine and call "
1121 "L</guestfs_launch> in the usual way."
1125 #: ../src/guestfs.pod:562
1127 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1128 "and certain heuristics, and returns a list of operating systems that were "
1129 "found. An empty list means none were found. A single element is the root "
1130 "filesystem of the operating system. For dual- or multi-boot guests, "
1131 "multiple roots can be returned, each one corresponding to a separate "
1132 "operating system. (Multi-boot virtual machines are extremely rare in the "
1133 "world of virtualization, but since this scenario can happen, we have built "
1134 "libguestfs to deal with it.)"
1138 #: ../src/guestfs.pod:571
1140 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1141 "to get additional details about that operating system. For example, call "
1142 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1143 "Windows and Linux-based operating systems respectively."
1147 #: ../src/guestfs.pod:577
1149 "Un*x-like and Linux-based operating systems usually consist of several "
1150 "filesystems which are mounted at boot time (for example, a separate boot "
1151 "partition mounted on C</boot>). The inspection rules are able to detect how "
1152 "filesystems correspond to mount points. Call "
1153 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1154 "hash table like this example:"
1158 #: ../src/guestfs.pod:584
1161 " /boot => /dev/sda1\n"
1162 " / => /dev/vg_guest/lv_root\n"
1163 " /usr => /dev/vg_guest/lv_usr\n"
1168 #: ../src/guestfs.pod:588
1170 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1171 "filesystems as suggested."
1175 #: ../src/guestfs.pod:591
1177 "Be careful to mount filesystems in the right order (eg. C</> before "
1178 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1183 #: ../src/guestfs.pod:595
1185 "Inspection currently only works for some common operating systems. "
1186 "Contributors are welcome to send patches for other operating systems that we "
1187 "currently cannot detect."
1191 #: ../src/guestfs.pod:599
1193 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1194 "for more details. The L</guestfs_inspect_os> function just ignores any "
1195 "encrypted devices."
1199 #: ../src/guestfs.pod:603
1201 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1202 "inspection and caches the results in the guest handle. Subsequent calls to "
1203 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1204 "re-read the disks. If you change the content of the guest disks, you can "
1205 "redo inspection by calling L</guestfs_inspect_os> again. "
1206 "(L</guestfs_inspect_list_applications> works a little differently from the "
1207 "other calls and does read the disks. See documentation for that function "
1212 #: ../src/guestfs.pod:612
1213 msgid "INSPECTING INSTALL DISKS"
1217 #: ../src/guestfs.pod:614
1219 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
1224 #: ../src/guestfs.pod:617
1226 "Call L</guestfs_inspect_get_format> to return the format of the operating "
1227 "system, which currently can be C<installed> (a regular operating system) or "
1228 "C<installer> (some sort of install disk)."
1232 #: ../src/guestfs.pod:621
1234 "Further information is available about the operating system that can be "
1235 "installed using the regular inspection APIs like "
1236 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
1241 #: ../src/guestfs.pod:626
1243 "Some additional information specific to installer disks is also available "
1244 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
1245 "L</guestfs_inspect_is_multipart> calls."
1249 #: ../src/guestfs.pod:631
1250 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1254 #: ../src/guestfs.pod:633
1256 "Libguestfs can mount NTFS partitions. It does this using the "
1257 "L<http://www.ntfs-3g.org/> driver."
1261 #: ../src/guestfs.pod:636
1262 msgid "DRIVE LETTERS AND PATHS"
1266 #: ../src/guestfs.pod:638
1268 "DOS and Windows still use drive letters, and the filesystems are always "
1269 "treated as case insensitive by Windows itself, and therefore you might find "
1270 "a Windows configuration file referring to a path like "
1271 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1272 "that directory might be referred to as C</WINDOWS/System32>."
1276 #: ../src/guestfs.pod:644
1278 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
1279 "L</guestfs_inspect_get_drive_mappings>)"
1283 #: ../src/guestfs.pod:647
1285 "Dealing with separator characters (backslash vs forward slash) is outside "
1286 "the scope of libguestfs, but usually a simple character replacement will "
1291 #: ../src/guestfs.pod:651
1293 "To resolve the case insensitivity of paths, call "
1294 "L</guestfs_case_sensitive_path>."
1298 #: ../src/guestfs.pod:654
1299 msgid "ACCESSING THE WINDOWS REGISTRY"
1303 #: ../src/guestfs.pod:656
1305 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1306 "files, through the library C<hivex> which is part of the libguestfs project "
1307 "although ships as a separate tarball. You have to locate and download the "
1308 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1309 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1310 "L<virt-win-reg(1)> for more help on this issue."
1314 #: ../src/guestfs.pod:664
1315 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1319 #: ../src/guestfs.pod:666
1321 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1322 "provide something which looks like a Linux symlink. The way it tries to do "
1323 "the rewriting is described here:"
1327 #: ../src/guestfs.pod:670
1328 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
1332 #: ../src/guestfs.pod:672
1334 "The essential problem is that ntfs-3g simply does not have enough "
1335 "information to do a correct job. NTFS links can contain drive letters and "
1336 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1337 "It is almost certainly the case that libguestfs callers should ignore what "
1338 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1342 #: ../src/guestfs.pod:679
1344 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
1345 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1346 "attribute, and read the raw reparse data from that (you can find the format "
1347 "documented in various places around the web)."
1351 #: ../src/guestfs.pod:684
1352 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1356 #: ../src/guestfs.pod:686
1358 "There are other useful extended attributes that can be read from ntfs-3g "
1359 "filesystems (using L</guestfs_getxattr>). See:"
1363 #: ../src/guestfs.pod:689
1364 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1368 #: ../src/guestfs.pod:691
1369 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1373 #: ../src/guestfs.pod:693
1375 "Although we don't want to discourage you from using the C API, we will "
1376 "mention here that the same API is also available in other languages."
1380 #: ../src/guestfs.pod:696
1382 "The API is broadly identical in all supported languages. This means that "
1383 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1384 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1385 "OCaml. In other words, a straightforward, predictable isomorphism between "
1390 #: ../src/guestfs.pod:702
1392 "Error messages are automatically transformed into exceptions if the language "
1397 #: ../src/guestfs.pod:705
1399 "We don't try to \"object orientify\" parts of the API in OO languages, "
1400 "although contributors are welcome to write higher level APIs above what we "
1401 "provide in their favourite languages if they wish."
1405 #: ../src/guestfs.pod:711
1410 #: ../src/guestfs.pod:713
1412 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1413 "identical to the C API. C++ classes and exceptions are not used."
1417 #: ../src/guestfs.pod:717
1422 #: ../src/guestfs.pod:719
1424 "The C# bindings are highly experimental. Please read the warnings at the "
1425 "top of C<csharp/Libguestfs.cs>."
1429 #: ../src/guestfs.pod:722
1434 #: ../src/guestfs.pod:724
1436 "This is the only language binding that is working but incomplete. Only "
1437 "calls which return simple integers have been bound in Haskell, and we are "
1438 "looking for help to complete this binding."
1442 #: ../src/guestfs.pod:728
1447 #: ../src/guestfs.pod:730
1449 "Full documentation is contained in the Javadoc which is distributed with "
1454 #: ../src/guestfs.pod:733
1459 #: ../src/guestfs.pod:735
1460 msgid "See L<guestfs-ocaml(3)>."
1464 #: ../src/guestfs.pod:737
1469 #: ../src/guestfs.pod:739
1470 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
1474 #: ../src/guestfs.pod:741
1479 #: ../src/guestfs.pod:743
1481 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1482 "the php-libguestfs package for your distribution."
1486 #: ../src/guestfs.pod:746
1487 msgid "The PHP binding only works correctly on 64 bit machines."
1491 #: ../src/guestfs.pod:748
1496 #: ../src/guestfs.pod:750
1497 msgid "See L<guestfs-python(3)>."
1501 #: ../src/guestfs.pod:752
1506 #: ../src/guestfs.pod:754
1507 msgid "See L<guestfs-ruby(3)>."
1511 #: ../src/guestfs.pod:756
1512 msgid "B<shell scripts>"
1516 #: ../src/guestfs.pod:758
1517 msgid "See L<guestfish(1)>."
1521 #: ../src/guestfs.pod:762
1522 msgid "LIBGUESTFS GOTCHAS"
1526 #: ../src/guestfs.pod:764
1528 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1529 "system [...] that works in the way it is documented but is counterintuitive "
1530 "and almost invites mistakes.\""
1534 #: ../src/guestfs.pod:768
1536 "Since we developed libguestfs and the associated tools, there are several "
1537 "things we would have designed differently, but are now stuck with for "
1538 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1539 "release, you can expect these to change. Beware of them."
1543 #: ../src/guestfs.pod:776
1544 msgid "Autosync / forgetting to sync."
1548 #: ../src/guestfs.pod:778
1550 "I<Update:> Autosync is enabled by default for all API users starting from "
1551 "libguestfs 1.5.24. This section only applies to older versions."
1555 #: ../src/guestfs.pod:781
1557 "When modifying a filesystem from C or another language, you B<must> unmount "
1558 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1559 "libguestfs handle. You can also call:"
1563 #: ../src/guestfs.pod:785
1566 " guestfs_set_autosync (g, 1);\n"
1571 #: ../src/guestfs.pod:787
1573 "to have the unmount/sync done automatically for you when the handle 'g' is "
1574 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1579 #: ../src/guestfs.pod:791
1581 "If you forget to do this, then it is entirely possible that your changes "
1582 "won't be written out, or will be partially written, or (very rarely) that "
1583 "you'll get disk corruption."
1587 #: ../src/guestfs.pod:795
1589 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1590 "guestfish scripts that forget to sync will work just fine, which can make "
1591 "this very puzzling if you are trying to debug a problem."
1595 #: ../src/guestfs.pod:799
1596 msgid "Mount option C<-o sync> should not be the default."
1600 #: ../src/guestfs.pod:801
1602 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1603 "However C<-o sync> does not add any reliability benefit, but does have a "
1604 "very large performance impact."
1608 #: ../src/guestfs.pod:805
1610 "The work around is to use L</guestfs_mount_options> and set the mount "
1611 "options that you actually want to use."
1615 #: ../src/guestfs.pod:808
1616 msgid "Read-only should be the default."
1620 #: ../src/guestfs.pod:810
1622 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1623 "specify I<--rw> if you want to make changes to the image."
1627 #: ../src/guestfs.pod:813
1628 msgid "This would reduce the potential to corrupt live VM images."
1632 #: ../src/guestfs.pod:815
1634 "Note that many filesystems change the disk when you just mount and unmount, "
1635 "even if you didn't perform any writes. You need to use "
1636 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1640 #: ../src/guestfs.pod:819
1641 msgid "guestfish command line is hard to use."
1645 #: ../src/guestfs.pod:821
1647 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1648 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1649 "exist, so it fails. In earlier versions of guestfish the error message was "
1650 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1651 "we should have used C<guestfish -c command> to run commands."
1655 #: ../src/guestfs.pod:828
1656 msgid "guestfish megabyte modifiers don't work right on all commands"
1660 #: ../src/guestfs.pod:830
1662 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1663 "other modifiers). What guestfish actually does is to multiply the number "
1664 "part by the modifier part and pass the result to the C API. However this "
1665 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1666 "expecting some other unit (eg. megabytes)."
1670 #: ../src/guestfs.pod:837
1671 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1675 #: ../src/guestfs.pod:839
1678 " lvcreate LV VG 100M\n"
1683 #: ../src/guestfs.pod:841
1685 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1686 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1687 "megabytes * megabytes) logical volume. The error message you get from this "
1688 "is also a little obscure."
1692 #: ../src/guestfs.pod:846
1694 "This could be fixed in the generator by specially marking parameters and "
1695 "return values which take bytes or other units."
1699 #: ../src/guestfs.pod:849
1700 msgid "Ambiguity between devices and paths"
1704 #: ../src/guestfs.pod:851
1706 "There is a subtle ambiguity in the API between a device name "
1707 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1708 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1712 #: ../src/guestfs.pod:856
1714 "In the current API we usually resolve this ambiguity by having two separate "
1715 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1716 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1717 "detecting if the path supplied begins with C</dev/>."
1721 #: ../src/guestfs.pod:862
1723 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1724 "make paths/devices into structured names. One way to do this would be to "
1725 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1726 "aspect of grub. Another way would be to use a structured type, equivalent "
1727 "to this OCaml type:"
1731 #: ../src/guestfs.pod:868
1734 " type path = Path of string | Device of int | Partition of int * int\n"
1739 #: ../src/guestfs.pod:870
1740 msgid "which would allow you to pass arguments like:"
1744 #: ../src/guestfs.pod:872
1747 " Path \"/foo/bar\"\n"
1748 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1749 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1750 " Path \"/dev/sdb2\" (* not a device *)\n"
1755 #: ../src/guestfs.pod:877
1757 "As you can see there are still problems to resolve even with this "
1758 "representation. Also consider how it might work in guestfish."
1762 #: ../src/guestfs.pod:882
1763 msgid "KEYS AND PASSPHRASES"
1767 #: ../src/guestfs.pod:884
1769 "Certain libguestfs calls take a parameter that contains sensitive key "
1770 "material, passed in as a C string."
1774 #: ../src/guestfs.pod:887
1776 "In the future we would hope to change the libguestfs implementation so that "
1777 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1778 "swap. However this is I<not> done at the moment, because of the complexity "
1779 "of such an implementation."
1783 #: ../src/guestfs.pod:892
1785 "Therefore you should be aware that any key parameter you pass to libguestfs "
1786 "might end up being written out to the swap partition. If this is a concern, "
1787 "scrub the swap partition or don't use libguestfs on encrypted devices."
1791 #: ../src/guestfs.pod:897
1792 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1796 #: ../src/guestfs.pod:899
1798 "All high-level libguestfs actions are synchronous. If you want to use "
1799 "libguestfs asynchronously then you must create a thread."
1803 #: ../src/guestfs.pod:902
1805 "Only use the handle from a single thread. Either use the handle exclusively "
1806 "from one thread, or provide your own mutex so that two threads cannot issue "
1807 "calls on the same handle at the same time."
1811 #: ../src/guestfs.pod:906
1813 "See the graphical program guestfs-browser for one possible architecture for "
1814 "multithreaded programs using libvirt and libguestfs."
1818 #: ../src/guestfs.pod:909
1823 #: ../src/guestfs.pod:911
1825 "Libguestfs needs a supermin appliance, which it finds by looking along an "
1830 #: ../src/guestfs.pod:914
1832 "By default it looks for these in the directory C<$libdir/guestfs> "
1833 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1837 #: ../src/guestfs.pod:917
1839 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1840 "to change the directories that libguestfs will search in. The value is a "
1841 "colon-separated list of paths. The current directory is I<not> searched "
1842 "unless the path contains an empty element or C<.>. For example "
1843 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1844 "then C</usr/lib/guestfs>."
1848 #: ../src/guestfs.pod:924
1849 msgid "QEMU WRAPPERS"
1853 #: ../src/guestfs.pod:926
1855 "If you want to compile your own qemu, run qemu from a non-standard location, "
1856 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1861 #: ../src/guestfs.pod:930
1863 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1864 "last command in the shell script (so that qemu replaces the shell and "
1865 "becomes the direct child of the libguestfs-using program). If you don't do "
1866 "this, then the qemu process won't be cleaned up correctly."
1870 #: ../src/guestfs.pod:935
1872 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1877 #: ../src/guestfs.pod:938
1881 " qemudir=/home/rjones/d/qemu\n"
1882 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
1888 #: ../src/guestfs.pod:942
1890 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1891 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1896 #: ../src/guestfs.pod:946
1899 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1904 #: ../src/guestfs.pod:948
1906 "Note that libguestfs also calls qemu with the -help and -version options in "
1907 "order to determine features."
1911 #: ../src/guestfs.pod:951
1912 msgid "ATTACHING TO RUNNING DAEMONS"
1916 #: ../src/guestfs.pod:953
1918 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
1919 "babies. Use with caution."
1923 #: ../src/guestfs.pod:956
1925 "I<Note (2):> This section explains how to attach to a running daemon from a "
1926 "low level perspective. For most users, simply using virt tools such as "
1927 "L<guestfish(1)> with the I<--live> option will \"just work\"."
1931 #: ../src/guestfs.pod:960
1932 msgid "Using guestfs_set_attach_method"
1936 #: ../src/guestfs.pod:962
1938 "By calling L</guestfs_set_attach_method> you can change how the library "
1939 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
1940 "L</ARCHITECTURE> for some background)."
1944 #: ../src/guestfs.pod:966
1946 "The normal attach method is C<appliance>, where a small appliance is created "
1947 "containing the daemon, and then the library connects to this."
1951 #: ../src/guestfs.pod:969
1953 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
1954 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
1955 "daemon over the Unix domain socket."
1959 #: ../src/guestfs.pod:973
1961 "The normal use for this is to connect to a running virtual machine that "
1962 "contains a C<guestfsd> daemon, and send commands so you can read and write "
1963 "files inside the live virtual machine."
1967 #: ../src/guestfs.pod:977
1968 msgid "Using guestfs_add_domain with live flag"
1972 #: ../src/guestfs.pod:979
1974 "L</guestfs_add_domain> provides some help for getting the correct attach "
1975 "method. If you pass the C<live> option to this function, then (if the "
1976 "virtual machine is running) it will examine the libvirt XML looking for a "
1977 "virtio-serial channel to connect to:"
1981 #: ../src/guestfs.pod:985
1988 " <channel type='unix'>\n"
1989 " <source mode='bind' path='/path/to/socket'/>\n"
1990 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
1999 #: ../src/guestfs.pod:997
2001 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
2002 "method to C<unix:/path/to/socket>."
2006 #: ../src/guestfs.pod:1000
2008 "Some of the libguestfs tools (including guestfish) support a I<--live> "
2009 "option which is passed through to L</guestfs_add_domain> thus allowing you "
2010 "to attach to and modify live virtual machines."
2014 #: ../src/guestfs.pod:1004
2016 "The virtual machine needs to have been set up beforehand so that it has the "
2017 "virtio-serial channel and so that guestfsd is running inside it."
2021 #: ../src/guestfs.pod:1008
2022 msgid "ABI GUARANTEE"
2026 #: ../src/guestfs.pod:1010
2028 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2029 "actions as outlined in this section. Although we will deprecate some "
2030 "actions, for example if they get replaced by newer calls, we will keep the "
2031 "old actions forever. This allows you the developer to program in confidence "
2032 "against the libguestfs API."
2036 #: ../src/guestfs.pod:1016
2037 msgid "BLOCK DEVICE NAMING"
2041 #: ../src/guestfs.pod:1018
2043 "In the kernel there is now quite a profusion of schemata for naming block "
2044 "devices (in this context, by I<block device> I mean a physical or virtual "
2045 "hard drive). The original Linux IDE driver used names starting with "
2046 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2047 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2048 "replacement for the old IDE driver (particularly for SATA devices) those "
2049 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2050 "machines with paravirtualized drivers. This has created several different "
2051 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2056 #: ../src/guestfs.pod:1030
2058 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2059 "Linux kernel to access block devices. We can run a variety of appliances "
2060 "based on a variety of Linux kernels."
2064 #: ../src/guestfs.pod:1034
2066 "This causes a problem for libguestfs because many API calls use device or "
2067 "partition names. Working scripts and the recipe (example) scripts that we "
2068 "make available over the internet could fail if the naming scheme changes."
2072 #: ../src/guestfs.pod:1039
2074 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2075 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2076 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2077 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2081 #: ../src/guestfs.pod:1045
2083 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2084 "L</guestfs_list_partitions> and similar calls return the true names of the "
2085 "devices and partitions as known to the appliance."
2089 #: ../src/guestfs.pod:1050
2090 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2094 #: ../src/guestfs.pod:1052
2096 "Usually this translation is transparent. However in some (very rare) cases "
2097 "you may need to know the exact algorithm. Such cases include where you use "
2098 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2099 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2104 #: ../src/guestfs.pod:1058
2106 "The algorithm is applied only to I<parameters> which are known to be either "
2107 "device or partition names. Return values from functions such as "
2108 "L</guestfs_list_devices> are never changed."
2112 #: ../src/guestfs.pod:1066
2113 msgid "Is the string a parameter which is a device or partition name?"
2117 #: ../src/guestfs.pod:1070
2118 msgid "Does the string begin with C</dev/sd>?"
2122 #: ../src/guestfs.pod:1074
2124 "Does the named device exist? If so, we use that device. However if I<not> "
2125 "then we continue with this algorithm."
2129 #: ../src/guestfs.pod:1079
2130 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2134 #: ../src/guestfs.pod:1081
2135 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2139 #: ../src/guestfs.pod:1083
2140 msgid "If that named device exists, use it. If not, continue."
2144 #: ../src/guestfs.pod:1087
2145 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2149 #: ../src/guestfs.pod:1089
2150 msgid "If that named device exists, use it. If not, return an error."
2154 #: ../src/guestfs.pod:1093
2155 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2159 #: ../src/guestfs.pod:1095
2161 "Although the standard naming scheme and automatic translation is useful for "
2162 "simple programs and guestfish scripts, for larger programs it is best not to "
2163 "rely on this mechanism."
2167 #: ../src/guestfs.pod:1099
2169 "Where possible for maximum future portability programs using libguestfs "
2170 "should use these future-proof techniques:"
2174 #: ../src/guestfs.pod:1106
2176 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2177 "device names, and then use those names directly."
2181 #: ../src/guestfs.pod:1109
2182 msgid "Since those device names exist by definition, they will never be translated."
2186 #: ../src/guestfs.pod:1114
2188 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2189 "filesystem labels."
2193 #: ../src/guestfs.pod:1119
2198 #: ../src/guestfs.pod:1121
2200 "This section discusses security implications of using libguestfs, "
2201 "particularly with untrusted or malicious guests or disk images."
2205 #: ../src/guestfs.pod:1124
2206 msgid "GENERAL SECURITY CONSIDERATIONS"
2210 #: ../src/guestfs.pod:1126
2212 "Be careful with any files or data that you download from a guest (by "
2213 "\"download\" we mean not just the L</guestfs_download> command but any "
2214 "command that reads files, filenames, directories or anything else from a "
2215 "disk image). An attacker could manipulate the data to fool your program "
2216 "into doing the wrong thing. Consider cases such as:"
2220 #: ../src/guestfs.pod:1136
2221 msgid "the data (file etc) not being present"
2225 #: ../src/guestfs.pod:1140
2226 msgid "being present but empty"
2230 #: ../src/guestfs.pod:1144
2231 msgid "being much larger than normal"
2235 #: ../src/guestfs.pod:1148
2236 msgid "containing arbitrary 8 bit data"
2240 #: ../src/guestfs.pod:1152
2241 msgid "being in an unexpected character encoding"
2245 #: ../src/guestfs.pod:1156
2246 msgid "containing homoglyphs."
2250 #: ../src/guestfs.pod:1160
2251 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2255 #: ../src/guestfs.pod:1162
2257 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2258 "(VFS) module can sometimes be escalated into exploits by deliberately "
2259 "creating a malicious, malformed filesystem. These exploits are very severe "
2260 "for two reasons. Firstly there are very many filesystem drivers in the "
2261 "kernel, and many of them are infrequently used and not much developer "
2262 "attention has been paid to the code. Linux userspace helps potential "
2263 "crackers by detecting the filesystem type and automatically choosing the "
2264 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2265 "the administrator. Secondly, a kernel-level exploit is like a local root "
2266 "exploit (worse in some ways), giving immediate and total access to the "
2267 "system right down to the hardware level."
2271 #: ../src/guestfs.pod:1175
2273 "That explains why you should never mount a filesystem from an untrusted "
2274 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2275 "inside a qemu virtual machine, usually running as a non-root user. The "
2276 "attacker would need to write a filesystem which first exploited the kernel, "
2277 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2278 "the libguestfs protocol, and finally to be as serious as the host kernel "
2279 "exploit it would need to escalate its privileges to root. This multi-step "
2280 "escalation, performed by a static piece of data, is thought to be extremely "
2281 "hard to do, although we never say 'never' about security issues."
2285 #: ../src/guestfs.pod:1186
2287 "In any case callers can reduce the attack surface by forcing the filesystem "
2288 "type when mounting (use L</guestfs_mount_vfs>)."
2292 #: ../src/guestfs.pod:1189
2293 msgid "PROTOCOL SECURITY"
2297 #: ../src/guestfs.pod:1191
2299 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2300 "defined upper message size. However a program that uses libguestfs must "
2301 "also take care - for example you can write a program that downloads a binary "
2302 "from a disk image and executes it locally, and no amount of protocol "
2303 "security will save you from the consequences."
2307 #: ../src/guestfs.pod:1197
2308 msgid "INSPECTION SECURITY"
2312 #: ../src/guestfs.pod:1199
2314 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2315 "directly from the guest, and these could contain any 8 bit data. Callers "
2316 "should be careful to escape these before printing them to a structured file "
2317 "(for example, use HTML escaping if creating a web page)."
2321 #: ../src/guestfs.pod:1205
2323 "Guest configuration may be altered in unusual ways by the administrator of "
2324 "the virtual machine, and may not reflect reality (particularly for untrusted "
2325 "or actively malicious guests). For example we parse the hostname from "
2326 "configuration files like C</etc/sysconfig/network> that we find in the "
2327 "guest, but the guest administrator can easily manipulate these files to "
2328 "provide the wrong hostname."
2332 #: ../src/guestfs.pod:1213
2334 "The inspection API parses guest configuration using two external libraries: "
2335 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2336 "designed to be robust in the face of malicious data, although denial of "
2337 "service attacks are still possible, for example with oversized configuration "
2342 #: ../src/guestfs.pod:1219
2343 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2347 #: ../src/guestfs.pod:1221
2349 "Be very cautious about running commands from the guest. By running a "
2350 "command in the guest, you are giving CPU time to a binary that you do not "
2351 "control, under the same user account as the library, albeit wrapped in qemu "
2352 "virtualization. More information and alternatives can be found in the "
2353 "section L</RUNNING COMMANDS>."
2357 #: ../src/guestfs.pod:1227
2358 msgid "CVE-2010-3851"
2362 #: ../src/guestfs.pod:1229
2363 msgid "https://bugzilla.redhat.com/642934"
2367 #: ../src/guestfs.pod:1231
2369 "This security bug concerns the automatic disk format detection that qemu "
2370 "does on disk images."
2374 #: ../src/guestfs.pod:1234
2376 "A raw disk image is just the raw bytes, there is no header. Other disk "
2377 "images like qcow2 contain a special header. Qemu deals with this by looking "
2378 "for one of the known headers, and if none is found then assuming the disk "
2379 "image must be raw."
2383 #: ../src/guestfs.pod:1239
2385 "This allows a guest which has been given a raw disk image to write some "
2386 "other header. At next boot (or when the disk image is accessed by "
2387 "libguestfs) qemu would do autodetection and think the disk image format was, "
2388 "say, qcow2 based on the header written by the guest."
2392 #: ../src/guestfs.pod:1244
2394 "This in itself would not be a problem, but qcow2 offers many features, one "
2395 "of which is to allow a disk image to refer to another image (called the "
2396 "\"backing disk\"). It does this by placing the path to the backing disk "
2397 "into the qcow2 header. This path is not validated and could point to any "
2398 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2399 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2400 "control of the attacker."
2404 #: ../src/guestfs.pod:1252
2405 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
2409 #: ../src/guestfs.pod:1259
2410 msgid "You have enabled the network or have opened the disk in write mode."
2414 #: ../src/guestfs.pod:1263
2416 "You are also running untrusted code from the guest (see L</RUNNING "
2421 #: ../src/guestfs.pod:1268
2423 "The way to avoid this is to specify the expected disk format when adding "
2424 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2425 "should always do this if the disk is raw format, and it's a good idea for "
2430 #: ../src/guestfs.pod:1273
2432 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2433 "format is fetched from libvirt and passed through."
2437 #: ../src/guestfs.pod:1276
2439 "For libguestfs tools, use the I<--format> command line parameter as "
2444 #: ../src/guestfs.pod:1279
2445 msgid "CONNECTION MANAGEMENT"
2449 #: ../src/guestfs.pod:1281
2454 #: ../src/guestfs.pod:1283
2456 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2457 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2458 "handle and release all resources used."
2462 #: ../src/guestfs.pod:1287
2464 "For information on using multiple handles and threads, see the section "
2465 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
2469 #: ../src/guestfs.pod:1290
2470 msgid "guestfs_create"
2474 #: ../src/guestfs.pod:1292
2477 " guestfs_h *guestfs_create (void);\n"
2482 #: ../src/guestfs.pod:1294
2483 msgid "Create a connection handle."
2487 #: ../src/guestfs.pod:1296
2489 "On success this returns a non-NULL pointer to a handle. On error it returns "
2494 #: ../src/guestfs.pod:1299
2496 "You have to \"configure\" the handle after creating it. This includes "
2497 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
2498 "handle at least once."
2502 #: ../src/guestfs.pod:1303
2503 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2507 #: ../src/guestfs.pod:1305
2509 "You may also want to configure error handling for the handle. See the "
2510 "L</ERROR HANDLING> section below."
2514 #: ../src/guestfs.pod:1308
2515 msgid "guestfs_close"
2519 #: ../src/guestfs.pod:1310
2522 " void guestfs_close (guestfs_h *g);\n"
2527 #: ../src/guestfs.pod:1312
2528 msgid "This closes the connection handle and frees up all resources used."
2532 #: ../src/guestfs.pod:1314
2534 "If autosync was set on the handle and the handle was launched, then this "
2535 "implicitly calls various functions to unmount filesystems and sync the "
2536 "disk. See L</guestfs_set_autosync> for more details."
2540 #: ../src/guestfs.pod:1318
2541 msgid "If a close callback was set on the handle, then it is called."
2545 #: ../src/guestfs.pod:1320
2546 msgid "ERROR HANDLING"
2550 #: ../src/guestfs.pod:1322
2552 "API functions can return errors. For example, almost all functions that "
2553 "return C<int> will return C<-1> to indicate an error."
2557 #: ../src/guestfs.pod:1325
2559 "Additional information is available for errors: an error message string and "
2560 "optionally an error number (errno) if the thing that failed was a system "
2565 #: ../src/guestfs.pod:1329
2567 "You can get at the additional information about the last error on the handle "
2568 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2569 "up an error handler with L</guestfs_set_error_handler>."
2573 #: ../src/guestfs.pod:1334
2575 "When the handle is created, a default error handler is installed which "
2576 "prints the error message string to C<stderr>. For small short-running "
2577 "command line programs it is sufficient to do:"
2581 #: ../src/guestfs.pod:1338
2584 " if (guestfs_launch (g) == -1)\n"
2585 " exit (EXIT_FAILURE);\n"
2590 #: ../src/guestfs.pod:1341
2592 "since the default error handler will ensure that an error message has been "
2593 "printed to C<stderr> before the program exits."
2597 #: ../src/guestfs.pod:1344
2599 "For other programs the caller will almost certainly want to install an "
2600 "alternate error handler or do error handling in-line like this:"
2604 #: ../src/guestfs.pod:1347
2607 " g = guestfs_create ();\n"
2612 #: ../src/guestfs.pod:1349
2615 " /* This disables the default behaviour of printing errors\n"
2617 " guestfs_set_error_handler (g, NULL, NULL);\n"
2622 #: ../src/guestfs.pod:1353
2625 " if (guestfs_launch (g) == -1) {\n"
2626 " /* Examine the error message and print it etc. */\n"
2627 " char *msg = guestfs_last_error (g);\n"
2628 " int errnum = guestfs_last_errno (g);\n"
2629 " fprintf (stderr, \"%s\\n\", msg);\n"
2636 #: ../src/guestfs.pod:1361
2638 "Out of memory errors are handled differently. The default action is to call "
2639 "L<abort(3)>. If this is undesirable, then you can set a handler using "
2640 "L</guestfs_set_out_of_memory_handler>."
2644 #: ../src/guestfs.pod:1365
2646 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2647 "because there is no handle if this happens there is no way to get additional "
2648 "error information. However L</guestfs_create> is supposed to be a "
2649 "lightweight operation which can only fail because of insufficient memory (it "
2650 "returns NULL in this case)."
2654 #: ../src/guestfs.pod:1371
2655 msgid "guestfs_last_error"
2659 #: ../src/guestfs.pod:1373
2662 " const char *guestfs_last_error (guestfs_h *g);\n"
2667 #: ../src/guestfs.pod:1375
2669 "This returns the last error message that happened on C<g>. If there has not "
2670 "been an error since the handle was created, then this returns C<NULL>."
2674 #: ../src/guestfs.pod:1379
2676 "The lifetime of the returned string is until the next error occurs, or "
2677 "L</guestfs_close> is called."
2681 #: ../src/guestfs.pod:1382
2682 msgid "guestfs_last_errno"
2686 #: ../src/guestfs.pod:1384
2689 " int guestfs_last_errno (guestfs_h *g);\n"
2694 #: ../src/guestfs.pod:1386
2695 msgid "This returns the last error number (errno) that happened on C<g>."
2699 #: ../src/guestfs.pod:1388
2700 msgid "If successful, an errno integer not equal to zero is returned."
2704 #: ../src/guestfs.pod:1390
2705 msgid "If no error, this returns 0. This call can return 0 in three situations:"
2709 #: ../src/guestfs.pod:1397
2710 msgid "There has not been any error on the handle."
2714 #: ../src/guestfs.pod:1401
2716 "There has been an error but the errno was meaningless. This corresponds to "
2717 "the case where the error did not come from a failed system call, but for "
2718 "some other reason."
2722 #: ../src/guestfs.pod:1407
2724 "There was an error from a failed system call, but for some reason the errno "
2725 "was not captured and returned. This usually indicates a bug in libguestfs."
2729 #: ../src/guestfs.pod:1413
2731 "Libguestfs tries to convert the errno from inside the applicance into a "
2732 "corresponding errno for the caller (not entirely trivial: the appliance "
2733 "might be running a completely different operating system from the library "
2734 "and error numbers are not standardized across Un*xen). If this could not be "
2735 "done, then the error is translated to C<EINVAL>. In practice this should "
2736 "only happen in very rare circumstances."
2740 #: ../src/guestfs.pod:1421
2741 msgid "guestfs_set_error_handler"
2745 #: ../src/guestfs.pod:1423
2748 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2750 " const char *msg);\n"
2751 " void guestfs_set_error_handler (guestfs_h *g,\n"
2752 " guestfs_error_handler_cb cb,\n"
2758 #: ../src/guestfs.pod:1430
2760 "The callback C<cb> will be called if there is an error. The parameters "
2761 "passed to the callback are an opaque data pointer and the error message "
2766 #: ../src/guestfs.pod:1434
2768 "C<errno> is not passed to the callback. To get that the callback must call "
2769 "L</guestfs_last_errno>."
2773 #: ../src/guestfs.pod:1437
2775 "Note that the message string C<msg> is freed as soon as the callback "
2776 "function returns, so if you want to stash it somewhere you must make your "
2781 #: ../src/guestfs.pod:1441
2782 msgid "The default handler prints messages on C<stderr>."
2786 #: ../src/guestfs.pod:1443
2787 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2791 #: ../src/guestfs.pod:1445
2792 msgid "guestfs_get_error_handler"
2796 #: ../src/guestfs.pod:1447
2799 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2800 " void **opaque_rtn);\n"
2805 #: ../src/guestfs.pod:1450
2806 msgid "Returns the current error handler callback."
2810 #: ../src/guestfs.pod:1452
2811 msgid "guestfs_set_out_of_memory_handler"
2815 #: ../src/guestfs.pod:1454
2818 " typedef void (*guestfs_abort_cb) (void);\n"
2819 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2820 " guestfs_abort_cb);\n"
2825 #: ../src/guestfs.pod:1458
2827 "The callback C<cb> will be called if there is an out of memory situation. "
2828 "I<Note this callback must not return>."
2832 #: ../src/guestfs.pod:1461
2833 msgid "The default is to call L<abort(3)>."
2837 #: ../src/guestfs.pod:1463
2838 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2842 #: ../src/guestfs.pod:1466
2843 msgid "guestfs_get_out_of_memory_handler"
2847 #: ../src/guestfs.pod:1468
2850 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2855 #: ../src/guestfs.pod:1470
2856 msgid "This returns the current out of memory handler."
2860 #: ../src/guestfs.pod:1472
2865 #: ../src/guestfs.pod:1474 ../fish/guestfish.pod:1010
2870 #: ../src/guestfs.pod:1476
2875 #: ../src/guestfs.pod:1478
2880 #: ../src/guestfs.pod:1480
2881 msgid "AVAILABILITY"
2885 #: ../src/guestfs.pod:1482
2886 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2890 #: ../src/guestfs.pod:1484
2892 "Using L</guestfs_available> you can test availability of the following "
2893 "groups of functions. This test queries the appliance to see if the "
2894 "appliance you are currently using supports the functionality."
2898 #: ../src/guestfs.pod:1489
2899 msgid "@AVAILABILITY@"
2903 #: ../src/guestfs.pod:1491
2904 msgid "GUESTFISH supported COMMAND"
2908 #: ../src/guestfs.pod:1493
2910 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2911 "prints out the available groups and whether they are supported by this build "
2912 "of libguestfs. Note however that you have to do C<run> first."
2916 #: ../src/guestfs.pod:1498
2917 msgid "SINGLE CALLS AT COMPILE TIME"
2921 #: ../src/guestfs.pod:1500
2923 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2924 "function, such as:"
2928 #: ../src/guestfs.pod:1503
2931 " #define LIBGUESTFS_HAVE_DD 1\n"
2936 #: ../src/guestfs.pod:1505
2937 msgid "if L</guestfs_dd> is available."
2941 #: ../src/guestfs.pod:1507
2943 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2944 "function is available at compile time, we recommended using build tools such "
2945 "as autoconf or cmake. For example in autotools you could use:"
2949 #: ../src/guestfs.pod:1512
2952 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2953 " AC_CHECK_FUNCS([guestfs_dd])\n"
2958 #: ../src/guestfs.pod:1515
2960 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2965 #: ../src/guestfs.pod:1518
2966 msgid "SINGLE CALLS AT RUN TIME"
2970 #: ../src/guestfs.pod:1520
2972 "Testing at compile time doesn't guarantee that a function really exists in "
2973 "the library. The reason is that you might be dynamically linked against a "
2974 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2975 "This situation unfortunately results in a segmentation fault, which is a "
2976 "shortcoming of the C dynamic linking system itself."
2980 #: ../src/guestfs.pod:1527
2982 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2983 "in this example program (note that you still need the compile time check as "
2988 #: ../src/guestfs.pod:1531
2991 " #include <stdio.h>\n"
2992 " #include <stdlib.h>\n"
2993 " #include <unistd.h>\n"
2994 " #include <dlfcn.h>\n"
2995 " #include <guestfs.h>\n"
3000 #: ../src/guestfs.pod:1537
3005 " #ifdef LIBGUESTFS_HAVE_DD\n"
3007 " int has_function;\n"
3012 #: ../src/guestfs.pod:1543
3015 " /* Test if the function guestfs_dd is really available. */\n"
3016 " dl = dlopen (NULL, RTLD_LAZY);\n"
3018 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3019 " exit (EXIT_FAILURE);\n"
3021 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3027 #: ../src/guestfs.pod:1552
3030 " if (!has_function)\n"
3031 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3033 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3034 " /* Now it's safe to call\n"
3035 " guestfs_dd (g, \"foo\", \"bar\");\n"
3039 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3046 #: ../src/guestfs.pod:1565
3048 "You may think the above is an awful lot of hassle, and it is. There are "
3049 "other ways outside of the C linking system to ensure that this kind of "
3050 "incompatibility never arises, such as using package versioning:"
3054 #: ../src/guestfs.pod:1570
3057 " Requires: libguestfs >= 1.0.80\n"
3062 #: ../src/guestfs.pod:1572
3063 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3067 #: ../src/guestfs.pod:1574
3069 "A recent feature of the API is the introduction of calls which take optional "
3070 "arguments. In C these are declared 3 ways. The main way is as a call which "
3071 "takes variable arguments (ie. C<...>), as in this example:"
3075 #: ../src/guestfs.pod:1579
3078 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3083 #: ../src/guestfs.pod:1581
3085 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3086 "call with no optional arguments specified:"
3090 #: ../src/guestfs.pod:1584
3093 " guestfs_add_drive_opts (g, filename, -1);\n"
3098 #: ../src/guestfs.pod:1586
3099 msgid "With a single optional argument:"
3103 #: ../src/guestfs.pod:1588
3106 " guestfs_add_drive_opts (g, filename,\n"
3107 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3113 #: ../src/guestfs.pod:1592
3118 #: ../src/guestfs.pod:1594
3121 " guestfs_add_drive_opts (g, filename,\n"
3122 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3123 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3129 #: ../src/guestfs.pod:1599
3131 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3136 #: ../src/guestfs.pod:1602
3137 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3141 #: ../src/guestfs.pod:1604
3143 "The second variant has the same name with the suffix C<_va>, which works the "
3144 "same way but takes a C<va_list>. See the C manual for details. For the "
3145 "example function, this is declared:"
3149 #: ../src/guestfs.pod:1608
3152 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3158 #: ../src/guestfs.pod:1611
3159 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3163 #: ../src/guestfs.pod:1613
3165 "The third variant is useful where you need to construct these calls. You "
3166 "pass in a structure where you fill in the optional fields. The structure "
3167 "has a bitmask as the first element which you must set to indicate which "
3168 "fields you have filled in. For our example function the structure and call "
3173 #: ../src/guestfs.pod:1619
3176 " struct guestfs_add_drive_opts_argv {\n"
3177 " uint64_t bitmask;\n"
3179 " const char *format;\n"
3182 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3183 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3188 #: ../src/guestfs.pod:1628
3189 msgid "You could call it like this:"
3193 #: ../src/guestfs.pod:1630
3196 " struct guestfs_add_drive_opts_argv optargs = {\n"
3197 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3198 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3200 " .format = \"qcow2\"\n"
3206 #: ../src/guestfs.pod:1637
3209 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3214 #: ../src/guestfs.pod:1639 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1861 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1265 ../tools/virt-win-reg.pl:532
3219 #: ../src/guestfs.pod:1645
3220 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3224 #: ../src/guestfs.pod:1650
3225 msgid "You do not need to fill in all fields of the structure."
3229 #: ../src/guestfs.pod:1654
3231 "There must be a one-to-one correspondence between fields of the structure "
3232 "that are filled in, and bits set in the bitmask."
3236 #: ../src/guestfs.pod:1659
3237 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3241 #: ../src/guestfs.pod:1661
3243 "In other languages, optional arguments are expressed in the way that is "
3244 "natural for that language. We refer you to the language-specific "
3245 "documentation for more details on that."
3249 #: ../src/guestfs.pod:1665
3250 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3254 #: ../src/guestfs.pod:1667
3255 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3259 #: ../src/guestfs.pod:1669
3261 "B<Note:> This section documents the generic event mechanism introduced in "
3262 "libguestfs 1.10, which you should use in new code if possible. The old "
3263 "functions C<guestfs_set_log_message_callback>, "
3264 "C<guestfs_set_subprocess_quit_callback>, "
3265 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
3266 "C<guestfs_set_progress_callback> are no longer documented in this manual "
3267 "page. Because of the ABI guarantee, the old functions continue to work."
3271 #: ../src/guestfs.pod:1678
3273 "Handles generate events when certain things happen, such as log messages "
3274 "being generated, progress messages during long-running operations, or the "
3275 "handle being closed. The API calls described below let you register a "
3276 "callback to be called when events happen. You can register multiple "
3277 "callbacks (for the same, different or overlapping sets of events), and "
3278 "individually remove callbacks. If callbacks are not removed, then they "
3279 "remain in force until the handle is closed."
3283 #: ../src/guestfs.pod:1686
3285 "In the current implementation, events are only generated synchronously: that "
3286 "means that events (and hence callbacks) can only happen while you are in the "
3287 "middle of making another libguestfs call. The callback is called in the "
3292 #: ../src/guestfs.pod:1691
3294 "Events may contain a payload, usually nothing (void), an array of 64 bit "
3295 "unsigned integers, or a message buffer. Payloads are discussed later on."
3299 #: ../src/guestfs.pod:1695
3300 msgid "CLASSES OF EVENTS"
3304 #: ../src/guestfs.pod:1699
3305 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
3309 #: ../src/guestfs.pod:1702
3311 "The callback function will be called while the handle is being closed "
3312 "(synchronously from L</guestfs_close>)."
3316 #: ../src/guestfs.pod:1705
3318 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3319 "handles that are open when the program exits. This means that this callback "
3320 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3321 "problems in higher-level languages (eg. if your HLL interpreter has already "
3322 "been cleaned up by the time this is called, and if your callback then jumps "
3323 "into some HLL function)."
3327 #: ../src/guestfs.pod:1712
3329 "If no callback is registered: the handle is closed without any callback "
3334 #: ../src/guestfs.pod:1715
3335 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
3339 #: ../src/guestfs.pod:1718
3341 "The callback function will be called when the child process quits, either "
3342 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3343 "corresponds to a transition from any state to the CONFIG state)."
3347 #: ../src/guestfs.pod:1722 ../src/guestfs.pod:1731
3348 msgid "If no callback is registered: the event is ignored."
3352 #: ../src/guestfs.pod:1724
3353 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
3357 #: ../src/guestfs.pod:1727
3359 "The callback function will be called when the child process becomes ready "
3360 "first time after it has been launched. (This corresponds to a transition "
3361 "from LAUNCHING to the READY state)."
3365 #: ../src/guestfs.pod:1733
3366 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
3370 #: ../src/guestfs.pod:1736
3372 "Some long-running operations can generate progress messages. If this "
3373 "callback is registered, then it will be called each time a progress message "
3374 "is generated (usually two seconds after the operation started, and three "
3375 "times per second thereafter until it completes, although the frequency may "
3376 "change in future versions)."
3380 #: ../src/guestfs.pod:1742
3382 "The callback receives in the payload four unsigned 64 bit numbers which are "
3383 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
3387 #: ../src/guestfs.pod:1745
3389 "The units of C<total> are not defined, although for some operations C<total> "
3390 "may relate in some way to the amount of data to be transferred (eg. in bytes "
3391 "or megabytes), and C<position> may be the portion which has been "
3396 #: ../src/guestfs.pod:1750
3397 msgid "The only defined and stable parts of the API are:"
3401 #: ../src/guestfs.pod:1756
3403 "The callback can display to the user some type of progress bar or indicator "
3404 "which shows the ratio of C<position>:C<total>."
3408 #: ../src/guestfs.pod:1761
3409 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3413 #: ../src/guestfs.pod:1765
3415 "If any progress notification is sent during a call, then a final progress "
3416 "notification is always sent when C<position> = C<total> (I<unless> the call "
3417 "fails with an error)."
3421 #: ../src/guestfs.pod:1769
3423 "This is to simplify caller code, so callers can easily set the progress "
3424 "indicator to \"100%\" at the end of the operation, without requiring special "
3425 "code to detect this case."
3429 #: ../src/guestfs.pod:1775
3431 "For some calls we are unable to estimate the progress of the call, but we "
3432 "can still generate progress messages to indicate activity. This is known as "
3433 "\"pulse mode\", and is directly supported by certain progress bar "
3434 "implementations (eg. GtkProgressBar)."
3438 #: ../src/guestfs.pod:1780
3440 "For these calls, zero or more progress messages are generated with "
3441 "C<position = 0> and C<total = 1>, followed by a final message with "
3442 "C<position = total = 1>."
3446 #: ../src/guestfs.pod:1784
3448 "As noted above, if the call fails with an error then the final message may "
3453 #: ../src/guestfs.pod:1789
3455 "The callback also receives the procedure number (C<proc_nr>) and serial "
3456 "number (C<serial>) of the call. These are only useful for debugging "
3457 "protocol issues, and the callback can normally ignore them. The callback "
3458 "may want to print these numbers in error messages or debugging messages."
3462 #: ../src/guestfs.pod:1795
3463 msgid "If no callback is registered: progress messages are discarded."
3467 #: ../src/guestfs.pod:1797
3468 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
3472 #: ../src/guestfs.pod:1800
3474 "The callback function is called whenever a log message is generated by qemu, "
3475 "the appliance kernel, guestfsd (daemon), or utility programs."
3479 #: ../src/guestfs.pod:1803
3481 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
3482 "(L</guestfs_launch>) then additional debug messages are generated."
3486 #: ../src/guestfs.pod:1806 ../src/guestfs.pod:1820
3488 "If no callback is registered: the messages are discarded unless the verbose "
3489 "flag is set in which case they are sent to stderr. You can override the "
3490 "printing of verbose messages to stderr by setting up a callback."
3494 #: ../src/guestfs.pod:1811
3495 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
3499 #: ../src/guestfs.pod:1814
3501 "The callback function is called whenever a log message is generated by the "
3502 "library part of libguestfs."
3506 #: ../src/guestfs.pod:1817
3508 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
3509 "messages are generated."
3513 #: ../src/guestfs.pod:1825
3514 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
3518 #: ../src/guestfs.pod:1828
3520 "The callback function is called whenever a trace message is generated. This "
3521 "only applies if the trace flag (L</guestfs_set_trace>) is set."
3525 #: ../src/guestfs.pod:1831
3527 "If no callback is registered: the messages are sent to stderr. You can "
3528 "override the printing of trace messages to stderr by setting up a callback."
3532 #: ../src/guestfs.pod:1837
3533 msgid "guestfs_set_event_callback"
3537 #: ../src/guestfs.pod:1839
3540 " int guestfs_set_event_callback (guestfs_h *g,\n"
3541 " guestfs_event_callback cb,\n"
3542 " uint64_t event_bitmask,\n"
3549 #: ../src/guestfs.pod:1845
3551 "This function registers a callback (C<cb>) for all event classes in the "
3556 #: ../src/guestfs.pod:1848
3558 "For example, to register for all log message events, you could call this "
3559 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
3560 "To register a single callback for all possible classes of events, use "
3561 "C<GUESTFS_EVENT_ALL>."
3565 #: ../src/guestfs.pod:1854
3566 msgid "C<flags> should always be passed as 0."
3570 #: ../src/guestfs.pod:1856
3572 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
3573 "it for any purpose."
3577 #: ../src/guestfs.pod:1859
3579 "The return value is the event handle (an integer) which you can use to "
3580 "delete the callback (see below)."
3584 #: ../src/guestfs.pod:1862
3586 "If there is an error, this function returns C<-1>, and sets the error in the "
3587 "handle in the usual way (see L</guestfs_last_error> etc.)"
3591 #: ../src/guestfs.pod:1865
3593 "Callbacks remain in effect until they are deleted, or until the handle is "
3598 #: ../src/guestfs.pod:1868
3600 "In the case where multiple callbacks are registered for a particular event "
3601 "class, all of the callbacks are called. The order in which multiple "
3602 "callbacks are called is not defined."
3606 #: ../src/guestfs.pod:1872
3607 msgid "guestfs_delete_event_callback"
3611 #: ../src/guestfs.pod:1874
3614 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
3619 #: ../src/guestfs.pod:1876
3621 "Delete a callback that was previously registered. C<event_handle> should be "
3622 "the integer that was returned by a previous call to "
3623 "C<guestfs_set_event_callback> on the same handle."
3627 #: ../src/guestfs.pod:1880
3628 msgid "guestfs_event_callback"
3632 #: ../src/guestfs.pod:1882
3635 " typedef void (*guestfs_event_callback) (\n"
3638 " uint64_t event,\n"
3639 " int event_handle,\n"
3641 " const char *buf, size_t buf_len,\n"
3642 " const uint64_t *array, size_t array_len);\n"
3647 #: ../src/guestfs.pod:1891
3648 msgid "This is the type of the event callback function that you have to provide."
3652 #: ../src/guestfs.pod:1894
3654 "The basic parameters are: the handle (C<g>), the opaque user pointer "
3655 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
3656 "handle, and C<flags> which in the current API you should ignore."
3660 #: ../src/guestfs.pod:1898
3662 "The remaining parameters contain the event payload (if any). Each event may "
3663 "contain a payload, which usually relates to the event class, but for future "
3664 "proofing your code should be written to handle any payload for any event "
3669 #: ../src/guestfs.pod:1903
3671 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
3672 "there is no message buffer). Note that this message buffer can contain "
3673 "arbitrary 8 bit data, including NUL bytes."
3677 #: ../src/guestfs.pod:1907
3679 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
3680 "moment this is only used for progress messages."
3684 #: ../src/guestfs.pod:1910
3685 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
3689 #: ../src/guestfs.pod:1912
3691 "One motivation for the generic event API was to allow GUI programs to "
3692 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
3693 "unconditionally to C<stderr>."
3697 #: ../src/guestfs.pod:1916
3699 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
3700 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
3701 "messages are not events; you must capture error messages separately)."
3705 #: ../src/guestfs.pod:1921
3707 "Programs have to set up a callback to capture the classes of events of "
3712 #: ../src/guestfs.pod:1924
3716 " guestfs_set_event_callback\n"
3717 " (g, message_callback,\n"
3718 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
3719 " GUESTFS_EVENT_TRACE,\n"
3720 " 0, NULL) == -1)\n"
3721 " if (eh == -1) {\n"
3722 " // handle error in the usual way\n"
3728 #: ../src/guestfs.pod:1934
3730 "The callback can then direct messages to the appropriate place. In this "
3731 "example, messages are directed to syslog:"
3735 #: ../src/guestfs.pod:1937
3739 " message_callback (\n"
3742 " uint64_t event,\n"
3743 " int event_handle,\n"
3745 " const char *buf, size_t buf_len,\n"
3746 " const uint64_t *array, size_t array_len)\n"
3748 " const int priority = LOG_USER|LOG_INFO;\n"
3749 " if (buf_len > 0)\n"
3750 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
3756 #: ../src/guestfs.pod:1952
3757 msgid "PRIVATE DATA AREA"
3761 #: ../src/guestfs.pod:1954
3763 "You can attach named pieces of private data to the libguestfs handle, fetch "
3764 "them by name, and walk over them, for the lifetime of the handle. This is "
3765 "called the private data area and is only available from the C API."
3769 #: ../src/guestfs.pod:1959
3770 msgid "To attach a named piece of data, use the following call:"
3774 #: ../src/guestfs.pod:1961
3777 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3782 #: ../src/guestfs.pod:1963
3784 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3785 "pointer (which can be C<NULL>). Any previous item with the same key is "
3790 #: ../src/guestfs.pod:1967
3792 "You can use any C<key> you want, but your key should I<not> start with an "
3793 "underscore character. Keys beginning with an underscore character are "
3794 "reserved for internal libguestfs purposes (eg. for implementing language "
3795 "bindings). It is recommended that you prefix the key with some unique "
3796 "string to avoid collisions with other users."
3800 #: ../src/guestfs.pod:1973
3801 msgid "To retrieve the pointer, use:"
3805 #: ../src/guestfs.pod:1975
3808 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3813 #: ../src/guestfs.pod:1977
3815 "This function returns C<NULL> if either no data is found associated with "
3816 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3821 #: ../src/guestfs.pod:1981
3823 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3824 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3825 "all. In particular, libguestfs does I<not> try to free the data when the "
3826 "handle is closed. If the data must be freed, then the caller must either "
3827 "free it before calling L</guestfs_close> or must set up a close callback to "
3828 "do it (see L</GUESTFS_EVENT_CLOSE>)."
3832 #: ../src/guestfs.pod:1988
3833 msgid "To walk over all entries, use these two functions:"
3837 #: ../src/guestfs.pod:1990
3840 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
3845 #: ../src/guestfs.pod:1992
3848 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
3853 #: ../src/guestfs.pod:1994
3855 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
3856 "not have any particular meaning -- keys are not returned in any defined "
3857 "order). A pointer to the key is returned in C<*key_rtn> and the "
3858 "corresponding data pointer is returned from the function. C<NULL> is "
3859 "returned if there are no keys stored in the handle."
3863 #: ../src/guestfs.pod:2000
3865 "C<guestfs_next_private> returns the next key, pointer pair. The return "
3866 "value of this function is also C<NULL> is there are no further entries to "
3871 #: ../src/guestfs.pod:2004
3872 msgid "Notes about walking over entries:"
3876 #: ../src/guestfs.pod:2010
3877 msgid "You must not call C<guestfs_set_private> while walking over the entries."
3881 #: ../src/guestfs.pod:2015
3883 "The handle maintains an internal iterator which is reset when you call "
3884 "C<guestfs_first_private>. This internal iterator is invalidated when you "
3885 "call C<guestfs_set_private>."
3889 #: ../src/guestfs.pod:2021
3890 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
3894 #: ../src/guestfs.pod:2023
3897 " guestfs_set_private (g, key, NULL);\n"
3902 #: ../src/guestfs.pod:2025
3903 msgid "then that C<key> is not returned when walking."
3907 #: ../src/guestfs.pod:2029
3909 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
3910 "C<guestfs_next_private> or C<guestfs_set_private>."
3914 #: ../src/guestfs.pod:2035
3916 "The following example code shows how to print all keys and data pointers "
3917 "that are associated with the handle C<g>:"
3921 #: ../src/guestfs.pod:2038
3924 " const char *key;\n"
3925 " void *data = guestfs_first_private (g, &key);\n"
3926 " while (data != NULL)\n"
3928 " printf (\"key = %s, data = %p\\n\", key, data);\n"
3929 " data = guestfs_next_private (g, &key);\n"
3935 #: ../src/guestfs.pod:2046
3937 "More commonly you are only interested in keys that begin with an "
3938 "application-specific prefix C<foo_>. Modify the loop like so:"
3942 #: ../src/guestfs.pod:2049
3945 " const char *key;\n"
3946 " void *data = guestfs_first_private (g, &key);\n"
3947 " while (data != NULL)\n"
3949 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
3950 " printf (\"key = %s, data = %p\\n\", key, data);\n"
3951 " data = guestfs_next_private (g, &key);\n"
3957 #: ../src/guestfs.pod:2058
3959 "If you need to modify keys while walking, then you have to jump back to the "
3960 "beginning of the loop. For example, to delete all keys prefixed with "
3965 #: ../src/guestfs.pod:2062
3968 " const char *key;\n"
3971 " data = guestfs_first_private (g, &key);\n"
3972 " while (data != NULL)\n"
3974 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
3976 " guestfs_set_private (g, key, NULL);\n"
3977 " /* note that 'key' pointer is now invalid, and so is\n"
3978 " the internal iterator */\n"
3981 " data = guestfs_next_private (g, &key);\n"
3987 #: ../src/guestfs.pod:2078
3989 "Note that the above loop is guaranteed to terminate because the keys are "
3990 "being deleted, but other manipulations of keys within the loop might not "
3991 "terminate unless you also maintain an indication of which keys have been "
3996 #: ../src/guestfs.pod:2083 ../src/guestfs.pod:2088
4001 #: ../src/guestfs.pod:2085
4003 "<!-- old anchor for the next section --> <a "
4004 "name=\"state_machine_and_low_level_event_api\"/>"
4008 #: ../src/guestfs.pod:2090
4009 msgid "ARCHITECTURE"
4013 #: ../src/guestfs.pod:2092
4015 "Internally, libguestfs is implemented by running an appliance (a special "
4016 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4017 "process of the main program."
4021 #: ../src/guestfs.pod:2096
4024 " ___________________\n"
4026 " | main program |\n"
4028 " | | child process / appliance\n"
4029 " | | __________________________\n"
4031 " +-------------------+ RPC | +-----------------+ |\n"
4032 " | libguestfs <--------------------> guestfsd | |\n"
4033 " | | | +-----------------+ |\n"
4034 " \\___________________/ | | Linux kernel | |\n"
4035 " | +--^--------------+ |\n"
4036 " \\_________|________________/\n"
4042 " \\______________/\n"
4047 #: ../src/guestfs.pod:2116
4049 "The library, linked to the main program, creates the child process and hence "
4050 "the appliance in the L</guestfs_launch> function."
4054 #: ../src/guestfs.pod:2119
4056 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4057 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4058 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4059 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4060 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4061 "attached to the qemu process which translates device access by the "
4062 "appliance's Linux kernel into accesses to the image."
4066 #: ../src/guestfs.pod:2128
4068 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4069 "Although the disk image you are attached to might also be used by some "
4070 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4071 "care if both libguestfs's qemu process and your virtual machine are trying "
4072 "to update the disk image at the same time, since these usually results in "
4073 "massive disk corruption)."
4077 #: ../src/guestfs.pod:2135
4078 msgid "STATE MACHINE"
4082 #: ../src/guestfs.pod:2137
4083 msgid "libguestfs uses a state machine to model the child process:"
4087 #: ../src/guestfs.pod:2139
4099 " / | \\ \\ guestfs_launch\n"
4100 " / | _\\__V______\n"
4102 " / | | LAUNCHING |\n"
4103 " / | \\___________/\n"
4105 " / | guestfs_launch\n"
4107 " ______ / __|____V\n"
4108 " / \\ ------> / \\\n"
4109 " | BUSY | | READY |\n"
4110 " \\______/ <------ \\________/\n"
4115 #: ../src/guestfs.pod:2161
4117 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4118 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4119 "(3) alternating between READY and BUSY as commands are issued to, and "
4120 "carried out by, the child process."
4124 #: ../src/guestfs.pod:2166
4126 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4127 "asynchronously at any time (eg. due to some internal error), and that causes "
4128 "the state to transition back to CONFIG."
4132 #: ../src/guestfs.pod:2170
4134 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4135 "issued when in the CONFIG state."
4139 #: ../src/guestfs.pod:2173
4141 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4142 "L</guestfs_launch> blocks until the child process is READY to accept "
4143 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4144 "moves the state from CONFIG to LAUNCHING while it is running."
4148 #: ../src/guestfs.pod:2179
4150 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4151 "state. These API calls block waiting for the command to be carried out "
4152 "(ie. the state to transition to BUSY and then back to READY). There are no "
4153 "non-blocking versions, and no way to issue more than one command per handle "
4158 #: ../src/guestfs.pod:2185
4160 "Finally, the child process sends asynchronous messages back to the main "
4161 "program, such as kernel log messages. You can register a callback to "
4162 "receive these messages."
4166 #: ../src/guestfs.pod:2189
4171 #: ../src/guestfs.pod:2191
4172 msgid "COMMUNICATION PROTOCOL"
4176 #: ../src/guestfs.pod:2193
4178 "Don't rely on using this protocol directly. This section documents how it "
4179 "currently works, but it may change at any time."
4183 #: ../src/guestfs.pod:2196
4185 "The protocol used to talk between the library and the daemon running inside "
4186 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4187 "1014, RFC 1832, RFC 4506)."
4191 #: ../src/guestfs.pod:2200
4193 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4194 "this file is automatically generated)."
4198 #: ../src/guestfs.pod:2203
4200 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4201 "and C<FileOut> parameters, which are handled with very simple request/reply "
4202 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4203 "parameters, which use the same request and reply messages, but they may also "
4204 "be followed by files sent using a chunked encoding."
4208 #: ../src/guestfs.pod:2210
4209 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4213 #: ../src/guestfs.pod:2212
4214 msgid "For ordinary functions, the request message is:"
4218 #: ../src/guestfs.pod:2214
4221 " total length (header + arguments,\n"
4222 " but not including the length word itself)\n"
4223 " struct guestfs_message_header (encoded as XDR)\n"
4224 " struct guestfs_<foo>_args (encoded as XDR)\n"
4229 #: ../src/guestfs.pod:2219
4231 "The total length field allows the daemon to allocate a fixed size buffer "
4232 "into which it slurps the rest of the message. As a result, the total length "
4233 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4234 "effective size of any request is limited to somewhere under this size."
4238 #: ../src/guestfs.pod:2225
4240 "Note also that many functions don't take any arguments, in which case the "
4241 "C<guestfs_I<foo>_args> is completely omitted."
4245 #: ../src/guestfs.pod:2228
4247 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4248 "receiver knows what type of args structure to expect, or none at all."
4252 #: ../src/guestfs.pod:2232
4254 "For functions that take optional arguments, the optional arguments are "
4255 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4256 "arguments. A bitmask in the header indicates which optional arguments are "
4257 "meaningful. The bitmask is also checked to see if it contains bits set "
4258 "which the daemon does not know about (eg. if more optional arguments were "
4259 "added in a later version of the library), and this causes the call to be "
4264 #: ../src/guestfs.pod:2240
4265 msgid "The reply message for ordinary functions is:"
4269 #: ../src/guestfs.pod:2242
4272 " total length (header + ret,\n"
4273 " but not including the length word itself)\n"
4274 " struct guestfs_message_header (encoded as XDR)\n"
4275 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4280 #: ../src/guestfs.pod:2247
4282 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4283 "functions that return no formal return values."
4287 #: ../src/guestfs.pod:2250
4288 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4292 #: ../src/guestfs.pod:2253
4294 "In the case of an error, a flag is set in the header, and the reply message "
4295 "is slightly changed:"
4299 #: ../src/guestfs.pod:2256
4302 " total length (header + error,\n"
4303 " but not including the length word itself)\n"
4304 " struct guestfs_message_header (encoded as XDR)\n"
4305 " struct guestfs_message_error (encoded as XDR)\n"
4310 #: ../src/guestfs.pod:2261
4312 "The C<guestfs_message_error> structure contains the error message as a "
4317 #: ../src/guestfs.pod:2264
4318 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4322 #: ../src/guestfs.pod:2266
4324 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4325 "The normal request message is sent (see above). However this is followed by "
4326 "a sequence of file chunks."
4330 #: ../src/guestfs.pod:2270
4333 " total length (header + arguments,\n"
4334 " but not including the length word itself,\n"
4335 " and not including the chunks)\n"
4336 " struct guestfs_message_header (encoded as XDR)\n"
4337 " struct guestfs_<foo>_args (encoded as XDR)\n"
4338 " sequence of chunks for FileIn param #0\n"
4339 " sequence of chunks for FileIn param #1 etc.\n"
4344 #: ../src/guestfs.pod:2278
4345 msgid "The \"sequence of chunks\" is:"
4349 #: ../src/guestfs.pod:2280
4352 " length of chunk (not including length word itself)\n"
4353 " struct guestfs_chunk (encoded as XDR)\n"
4354 " length of chunk\n"
4355 " struct guestfs_chunk (encoded as XDR)\n"
4357 " length of chunk\n"
4358 " struct guestfs_chunk (with data.data_len == 0)\n"
4363 #: ../src/guestfs.pod:2288
4365 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4366 "is set in the final chunk to indicate either successful completion or early "
4371 #: ../src/guestfs.pod:2292
4373 "At time of writing there are no functions that have more than one FileIn "
4374 "parameter. However this is (theoretically) supported, by sending the "
4375 "sequence of chunks for each FileIn parameter one after another (from left to "
4380 #: ../src/guestfs.pod:2297
4382 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4383 "transfer. The library does this by sending a chunk with a special flag set "
4384 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4385 "RPC, does I<not> send any reply, and goes back to reading the next request."
4389 #: ../src/guestfs.pod:2303
4391 "The daemon may also cancel. It does this by writing a special word "
4392 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4393 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4394 "cancel chunk). The special word is chosen so that even if cancellation "
4395 "happens right at the end of the transfer (after the library has finished "
4396 "writing and has started listening for the reply), the \"spurious\" cancel "
4397 "flag will not be confused with the reply message."
4401 #: ../src/guestfs.pod:2312
4403 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4404 "limit), and also files where the size is not known in advance (eg. from "
4405 "pipes or sockets). However the chunks are rather small "
4406 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4407 "to keep much in memory."
4411 #: ../src/guestfs.pod:2318
4412 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4416 #: ../src/guestfs.pod:2320
4418 "The protocol for FileOut parameters is exactly the same as for FileIn "
4419 "parameters, but with the roles of daemon and library reversed."
4423 #: ../src/guestfs.pod:2323
4426 " total length (header + ret,\n"
4427 " but not including the length word itself,\n"
4428 " and not including the chunks)\n"
4429 " struct guestfs_message_header (encoded as XDR)\n"
4430 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4431 " sequence of chunks for FileOut param #0\n"
4432 " sequence of chunks for FileOut param #1 etc.\n"
4437 #: ../src/guestfs.pod:2331
4438 msgid "INITIAL MESSAGE"
4442 #: ../src/guestfs.pod:2333
4444 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4445 "which indicates that the guest and daemon is alive. This is what "
4446 "L</guestfs_launch> waits for."
4450 #: ../src/guestfs.pod:2337
4451 msgid "PROGRESS NOTIFICATION MESSAGES"
4455 #: ../src/guestfs.pod:2339
4457 "The daemon may send progress notification messages at any time. These are "
4458 "distinguished by the normal length word being replaced by "
4459 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
4463 #: ../src/guestfs.pod:2343
4465 "The library turns them into progress callbacks (see "
4466 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
4471 #: ../src/guestfs.pod:2347
4473 "The daemon self-limits the frequency of progress messages it sends (see "
4474 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
4479 #: ../src/guestfs.pod:2351
4480 msgid "LIBGUESTFS VERSION NUMBERS"
4484 #: ../src/guestfs.pod:2353
4486 "Since April 2010, libguestfs has started to make separate development and "
4487 "stable releases, along with corresponding branches in our git repository. "
4488 "These separate releases can be identified by version number:"
4492 #: ../src/guestfs.pod:2358
4495 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
4496 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
4502 " | `-------- sub-version\n"
4504 " `------ always '1' because we don't change the ABI\n"
4509 #: ../src/guestfs.pod:2369
4510 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
4514 #: ../src/guestfs.pod:2371
4516 "As time passes we cherry pick fixes from the development branch and backport "
4517 "those into the stable branch, the effect being that the stable branch should "
4518 "get more stable and less buggy over time. So the stable releases are ideal "
4519 "for people who don't need new features but would just like the software to "
4524 #: ../src/guestfs.pod:2377
4525 msgid "Our criteria for backporting changes are:"
4529 #: ../src/guestfs.pod:2383
4531 "Documentation changes which don't affect any code are backported unless the "
4532 "documentation refers to a future feature which is not in stable."
4536 #: ../src/guestfs.pod:2389
4538 "Bug fixes which are not controversial, fix obvious problems, and have been "
4539 "well tested are backported."
4543 #: ../src/guestfs.pod:2394
4545 "Simple rearrangements of code which shouldn't affect how it works get "
4546 "backported. This is so that the code in the two branches doesn't get too "
4547 "far out of step, allowing us to backport future fixes more easily."
4551 #: ../src/guestfs.pod:2400
4553 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4554 "exceptional case: the new feature is required in order to implement an "
4555 "important bug fix."
4559 #: ../src/guestfs.pod:2406
4561 "A new stable branch starts when we think the new features in development are "
4562 "substantial and compelling enough over the current stable branch to warrant "
4563 "it. When that happens we create new stable and development versions 1.N.0 "
4564 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4565 "stable at this point, but by backporting fixes from development, that branch "
4566 "will stabilize over time."
4570 #: ../src/guestfs.pod:2414
4571 msgid "EXTENDING LIBGUESTFS"
4575 #: ../src/guestfs.pod:2416
4576 msgid "ADDING A NEW API ACTION"
4580 #: ../src/guestfs.pod:2418
4582 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
4583 "documentation) are generated, and this makes it easy to extend the "
4588 #: ../src/guestfs.pod:2422
4589 msgid "To add a new API action there are two changes:"
4593 #: ../src/guestfs.pod:2428
4595 "You need to add a description of the call (name, parameters, return type, "
4596 "tests, documentation) to C<generator/generator_actions.ml>."
4600 #: ../src/guestfs.pod:2431
4602 "There are two sorts of API action, depending on whether the call goes "
4603 "through to the daemon in the appliance, or is serviced entirely by the "
4604 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
4605 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
4606 "an example of the latter, since a trace flag is maintained in the handle and "
4607 "all tracing is done on the library side."
4611 #: ../src/guestfs.pod:2439
4613 "Most new actions are of the first type, and get added to the "
4614 "C<daemon_functions> list. Each function has a unique procedure number used "
4615 "in the RPC protocol which is assigned to that action when we publish "
4616 "libguestfs and cannot be reused. Take the latest procedure number and "
4621 #: ../src/guestfs.pod:2445
4623 "For library-only actions of the second type, add to the "
4624 "C<non_daemon_functions> list. Since these functions are serviced by the "
4625 "library and do not travel over the RPC mechanism to the daemon, these "
4626 "functions do not need a procedure number, and so the procedure number is set "
4631 #: ../src/guestfs.pod:2453
4632 msgid "Implement the action (in C):"
4636 #: ../src/guestfs.pod:2455
4638 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
4639 "C<daemon/> directory."
4643 #: ../src/guestfs.pod:2458
4645 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
4646 "(note: double underscore) in the C<src/> directory."
4650 #: ../src/guestfs.pod:2461
4651 msgid "In either case, use another function as an example of what to do."
4655 #: ../src/guestfs.pod:2465
4656 msgid "After making these changes, use C<make> to compile."
4660 #: ../src/guestfs.pod:2467
4662 "Note that you don't need to implement the RPC, language bindings, manual "
4663 "pages or anything else. It's all automatically generated from the OCaml "
4668 #: ../src/guestfs.pod:2471
4669 msgid "ADDING TESTS FOR AN API ACTION"
4673 #: ../src/guestfs.pod:2473
4675 "You can supply zero or as many tests as you want per API call. The tests "
4676 "can either be added as part of the API description "
4677 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
4678 "drop a script into C<regressions/>. Note that adding a script to "
4679 "C<regressions/> is slower, so if possible use the first method."
4683 #: ../src/guestfs.pod:2479
4685 "The following describes the test environment used when you add an API test "
4686 "in C<generator_actions.ml>."
4690 #: ../src/guestfs.pod:2482
4691 msgid "The test environment has 4 block devices:"
4695 #: ../src/guestfs.pod:2486
4696 msgid "C</dev/sda> 500MB"
4700 #: ../src/guestfs.pod:2488
4701 msgid "General block device for testing."
4705 #: ../src/guestfs.pod:2490
4706 msgid "C</dev/sdb> 50MB"
4710 #: ../src/guestfs.pod:2492
4712 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
4717 #: ../src/guestfs.pod:2495
4718 msgid "C</dev/sdc> 10MB"
4722 #: ../src/guestfs.pod:2497
4723 msgid "Used in a few tests where two block devices are needed."
4727 #: ../src/guestfs.pod:2499
4732 #: ../src/guestfs.pod:2501
4733 msgid "ISO with fixed content (see C<images/test.iso>)."
4737 #: ../src/guestfs.pod:2505
4739 "To be able to run the tests in a reasonable amount of time, the libguestfs "
4740 "appliance and block devices are reused between tests. So don't try testing "
4741 "L</guestfs_kill_subprocess> :-x"
4745 #: ../src/guestfs.pod:2509
4747 "Each test starts with an initial scenario, selected using one of the "
4748 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
4749 "initialize the disks mentioned above in a particular way as documented in "
4750 "C<generator_types.ml>. You should not assume anything about the previous "
4751 "contents of other disks that are not initialized."
4755 #: ../src/guestfs.pod:2515
4757 "You can add a prerequisite clause to any individual test. This is a "
4758 "run-time check, which, if it fails, causes the test to be skipped. Useful "
4759 "if testing a command which might not work on all variations of libguestfs "
4760 "builds. A test that has prerequisite of C<Always> means to run "
4765 #: ../src/guestfs.pod:2521
4767 "In addition, packagers can skip individual tests by setting environment "
4768 "variables before running C<make check>."
4772 #: ../src/guestfs.pod:2524
4775 " SKIP_TEST_<CMD>_<NUM>=1\n"
4780 #: ../src/guestfs.pod:2526
4781 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
4785 #: ../src/guestfs.pod:2528
4790 #: ../src/guestfs.pod:2530
4793 " SKIP_TEST_<CMD>=1\n"
4798 #: ../src/guestfs.pod:2532
4799 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
4803 #: ../src/guestfs.pod:2534
4804 msgid "Packagers can run only certain tests by setting for example:"
4808 #: ../src/guestfs.pod:2536
4811 " TEST_ONLY=\"vfs_type zerofree\"\n"
4816 #: ../src/guestfs.pod:2538
4818 "See C<capitests/tests.c> for more details of how these environment variables "
4823 #: ../src/guestfs.pod:2541
4824 msgid "DEBUGGING NEW API ACTIONS"
4828 #: ../src/guestfs.pod:2543
4829 msgid "Test new actions work before submitting them."
4833 #: ../src/guestfs.pod:2545
4834 msgid "You can use guestfish to try out new commands."
4838 #: ../src/guestfs.pod:2547
4840 "Debugging the daemon is a problem because it runs inside a minimal "
4841 "environment. However you can fprintf messages in the daemon to stderr, and "
4842 "they will show up if you use C<guestfish -v>."
4846 #: ../src/guestfs.pod:2551
4847 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
4851 #: ../src/guestfs.pod:2553
4853 "Our C source code generally adheres to some basic code-formatting "
4854 "conventions. The existing code base is not totally consistent on this "
4855 "front, but we do prefer that contributed code be formatted similarly. In "
4856 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
4857 "indentation level, and other than that, follow the K&R style."
4861 #: ../src/guestfs.pod:2559
4863 "If you use Emacs, add the following to one of one of your start-up files "
4864 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
4868 #: ../src/guestfs.pod:2562
4871 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
4872 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
4873 " (add-hook 'find-file-hook\n"
4874 " '(lambda () (if (and buffer-file-name\n"
4875 " (string-match \"/libguestfs\\\\>\"\n"
4876 " (buffer-file-name))\n"
4877 " (not (string-equal mode-name \"Change Log\"))\n"
4878 " (not (string-equal mode-name \"Makefile\")))\n"
4879 " (setq indent-tabs-mode nil))))\n"
4884 #: ../src/guestfs.pod:2572
4887 " ;;; When editing C sources in libguestfs, use this style.\n"
4888 " (defun libguestfs-c-mode ()\n"
4889 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
4891 " (c-set-style \"K&R\")\n"
4892 " (setq c-indent-level 2)\n"
4893 " (setq c-basic-offset 2))\n"
4894 " (add-hook 'c-mode-hook\n"
4895 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
4896 " (buffer-file-name))\n"
4897 " (libguestfs-c-mode))))\n"
4902 #: ../src/guestfs.pod:2584
4903 msgid "Enable warnings when compiling (and fix any problems this finds):"
4907 #: ../src/guestfs.pod:2587
4910 " ./configure --enable-gcc-warnings\n"
4915 #: ../src/guestfs.pod:2589
4916 msgid "Useful targets are:"
4920 #: ../src/guestfs.pod:2591
4923 " make syntax-check # checks the syntax of the C code\n"
4924 " make check # runs the test suite\n"
4929 #: ../src/guestfs.pod:2594
4930 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
4934 #: ../src/guestfs.pod:2596
4936 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
4937 "which are used to do shell quoting."
4941 #: ../src/guestfs.pod:2601
4946 #: ../src/guestfs.pod:2603
4948 "Simple shell quoted string. Any spaces or other shell characters are "
4953 #: ../src/guestfs.pod:2606
4958 #: ../src/guestfs.pod:2608
4960 "Same as C<%Q> except the string is treated as a path which is prefixed by "
4965 #: ../src/guestfs.pod:2613 ../fish/guestfish.pod:242 ../fish/guestfish.pod:615
4966 msgid "For example:"
4970 #: ../src/guestfs.pod:2615
4973 " asprintf (&cmd, \"cat %R\", path);\n"
4978 #: ../src/guestfs.pod:2617
4979 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
4983 #: ../src/guestfs.pod:2619
4985 "I<Note:> Do I<not> use these when you are passing parameters to the "
4986 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
4987 "because they are not passed via the shell (instead, straight to exec). You "
4988 "probably want to use the C<sysroot_path()> function however."
4992 #: ../src/guestfs.pod:2625
4993 msgid "SUBMITTING YOUR NEW API ACTIONS"
4997 #: ../src/guestfs.pod:2627
4999 "Submit patches to the mailing list: "
5000 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
5001 "L<rjones@redhat.com>."
5005 #: ../src/guestfs.pod:2631
5006 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5010 #: ../src/guestfs.pod:2633
5011 msgid "We support i18n (gettext anyhow) in the library."
5015 #: ../src/guestfs.pod:2635
5017 "However many messages come from the daemon, and we don't translate those at "
5018 "the moment. One reason is that the appliance generally has all locale files "
5019 "removed from it, because they take up a lot of space. So we'd have to readd "
5020 "some of those, as well as copying our PO files into the appliance."
5024 #: ../src/guestfs.pod:2641
5026 "Debugging messages are never translated, since they are intended for the "
5031 #: ../src/guestfs.pod:2644
5032 msgid "SOURCE CODE SUBDIRECTORIES"
5036 #: ../src/guestfs.pod:2648 ../src/guestfs-actions.pod:5820 ../fish/guestfish-actions.pod:3913
5037 msgid "C<appliance>"
5041 #: ../src/guestfs.pod:2650
5042 msgid "The libguestfs appliance, build scripts and so on."
5046 #: ../src/guestfs.pod:2652
5047 msgid "C<capitests>"
5051 #: ../src/guestfs.pod:2654
5052 msgid "Automated tests of the C API."
5056 #: ../src/guestfs.pod:2656
5061 #: ../src/guestfs.pod:2658
5063 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5068 #: ../src/guestfs.pod:2661
5073 #: ../src/guestfs.pod:2663
5074 msgid "Outside contributions, experimental parts."
5078 #: ../src/guestfs.pod:2665
5083 #: ../src/guestfs.pod:2667
5085 "The daemon that runs inside the libguestfs appliance and carries out "
5090 #: ../src/guestfs.pod:2670
5095 #: ../src/guestfs.pod:2672
5096 msgid "L<virt-df(1)> command and documentation."
5100 #: ../src/guestfs.pod:2674
5105 #: ../src/guestfs.pod:2676
5106 msgid "C API example code."
5110 #: ../src/guestfs.pod:2678
5115 #: ../src/guestfs.pod:2680
5117 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5118 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5119 "L<virt-tar-out(1)>."
5123 #: ../src/guestfs.pod:2684
5128 #: ../src/guestfs.pod:2686
5129 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5133 #: ../src/guestfs.pod:2688
5134 msgid "C<generator>"
5138 #: ../src/guestfs.pod:2690
5140 "The crucially important generator, used to automatically generate large "
5141 "amounts of boilerplate C code for things like RPC and bindings."
5145 #: ../src/guestfs.pod:2693
5150 #: ../src/guestfs.pod:2695
5151 msgid "Files used by the test suite."
5155 #: ../src/guestfs.pod:2697
5156 msgid "Some \"phony\" guest images which we test against."
5160 #: ../src/guestfs.pod:2699
5161 msgid "C<inspector>"
5165 #: ../src/guestfs.pod:2701
5166 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5170 #: ../src/guestfs.pod:2703
5175 #: ../src/guestfs.pod:2705
5176 msgid "Logo used on the website. The fish is called Arthur by the way."
5180 #: ../src/guestfs.pod:2707
5185 #: ../src/guestfs.pod:2709
5186 msgid "M4 macros used by autoconf."
5190 #: ../src/guestfs.pod:2711
5195 #: ../src/guestfs.pod:2713
5196 msgid "Translations of simple gettext strings."
5200 #: ../src/guestfs.pod:2715
5205 #: ../src/guestfs.pod:2717
5207 "The build infrastructure and PO files for translations of manpages and POD "
5208 "files. Eventually this will be combined with the C<po> directory, but that "
5209 "is rather complicated."
5213 #: ../src/guestfs.pod:2721
5214 msgid "C<regressions>"
5218 #: ../src/guestfs.pod:2723
5219 msgid "Regression tests."
5223 #: ../src/guestfs.pod:2725
5228 #: ../src/guestfs.pod:2727
5229 msgid "L<virt-rescue(1)> command and documentation."
5233 #: ../src/guestfs.pod:2729
5238 #: ../src/guestfs.pod:2731
5239 msgid "Source code to the C library."
5243 #: ../src/guestfs.pod:2733
5248 #: ../src/guestfs.pod:2735
5249 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5253 #: ../src/guestfs.pod:2737
5254 msgid "C<test-tool>"
5258 #: ../src/guestfs.pod:2739
5260 "Test tool for end users to test if their qemu/kernel combination will work "
5265 #: ../src/guestfs.pod:2742
5270 #: ../src/guestfs.pod:2744
5275 #: ../src/guestfs.pod:2746
5280 #: ../src/guestfs.pod:2748
5285 #: ../src/guestfs.pod:2750
5290 #: ../src/guestfs.pod:2752
5295 #: ../src/guestfs.pod:2754
5300 #: ../src/guestfs.pod:2756
5305 #: ../src/guestfs.pod:2758
5306 msgid "Language bindings."
5310 #: ../src/guestfs.pod:2762
5315 #: ../src/guestfs.pod:2764
5316 msgid "PROTOCOL LIMITS"
5320 #: ../src/guestfs.pod:2766
5322 "Internally libguestfs uses a message-based protocol to pass API calls and "
5323 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
5324 "plenty more detail about this). The maximum message size used by the "
5325 "protocol is slightly less than 4 MB. For some API calls you may need to be "
5326 "aware of this limit. The API calls which may be affected are individually "
5327 "documented, with a link back to this section of the documentation."
5331 #: ../src/guestfs.pod:2774
5333 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
5334 "a simple string. Because this string is at some point internally encoded as "
5335 "a message, the maximum size that it can return is slightly under 4 MB. If "
5336 "the requested file is larger than this then you will get an error."
5340 #: ../src/guestfs.pod:2780
5342 "In order to transfer large files into and out of the guest filesystem, you "
5343 "need to use particular calls that support this. The sections L</UPLOADING> "
5344 "and L</DOWNLOADING> document how to do this."
5348 #: ../src/guestfs.pod:2784
5350 "You might also consider mounting the disk image using our FUSE filesystem "
5351 "support (L<guestmount(1)>)."
5355 #: ../src/guestfs.pod:2787
5356 msgid "MAXIMUM NUMBER OF DISKS"
5360 #: ../src/guestfs.pod:2789
5361 msgid "When using virtio disks (the default) the current limit is B<25> disks."
5365 #: ../src/guestfs.pod:2792
5367 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
5368 "slots. However febootstrap only understands disks with names C</dev/vda> "
5369 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
5374 #: ../src/guestfs.pod:2797
5376 "We are working to substantially raise this limit in future versions but it "
5377 "requires complex changes to qemu."
5381 #: ../src/guestfs.pod:2800
5383 "In future versions of libguestfs it should also be possible to \"hot plug\" "
5384 "disks (add and remove disks after calling L</guestfs_launch>). This also "
5385 "requires changes to qemu."
5389 #: ../src/guestfs.pod:2804
5390 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
5394 #: ../src/guestfs.pod:2806
5395 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
5399 #: ../src/guestfs.pod:2808
5401 "This is because it reserves 4 bits for the minor device number (thus "
5402 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
5406 #: ../src/guestfs.pod:2811
5408 "If you attach a disk with more than 15 partitions, the extra partitions are "
5409 "ignored by libguestfs."
5413 #: ../src/guestfs.pod:2814
5414 msgid "MAXIMUM SIZE OF A DISK"
5418 #: ../src/guestfs.pod:2816
5419 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
5423 #: ../src/guestfs.pod:2818
5425 "We have tested block devices up to 1 exabyte (2**60 or "
5426 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
5431 #: ../src/guestfs.pod:2822
5433 "Although libguestfs probably does not impose any limit, the underlying host "
5434 "storage will. If you store disk images on a host ext4 filesystem, then the "
5435 "maximum size will be limited by the maximum ext4 file size (currently 16 "
5436 "TB). If you store disk images as host logical volumes then you are limited "
5437 "by the maximum size of an LV."
5441 #: ../src/guestfs.pod:2828
5443 "For the hugest disk image files, we recommend using XFS on the host for "
5448 #: ../src/guestfs.pod:2831
5449 msgid "MAXIMUM SIZE OF A PARTITION"
5453 #: ../src/guestfs.pod:2833
5455 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
5456 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
5457 "address a partition located beyond 2 TB on the disk."
5461 #: ../src/guestfs.pod:2837
5463 "It is recommended that you use GPT partitions on disks which are larger than "
5464 "this size. GPT uses 64 bit sector numbers and so can address partitions "
5465 "which are theoretically larger than the largest disk we could support."
5469 #: ../src/guestfs.pod:2842
5470 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
5474 #: ../src/guestfs.pod:2844
5476 "This depends on the filesystem type. libguestfs itself does not impose any "
5477 "known limit. Consult Wikipedia or the filesystem documentation to find out "
5478 "what these limits are."
5482 #: ../src/guestfs.pod:2848
5483 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
5487 #: ../src/guestfs.pod:2850
5489 "The API functions L</guestfs_upload>, L</guestfs_download>, "
5490 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
5491 "uploads and downloads."
5495 #: ../src/guestfs.pod:2854
5496 msgid "INSPECTION LIMITS"
5500 #: ../src/guestfs.pod:2856
5502 "The inspection code has several arbitrary limits on things like the size of "
5503 "Windows Registry hive it will read, and the length of product name. These "
5504 "are intended to stop a malicious guest from consuming arbitrary amounts of "
5505 "memory and disk space on the host, and should not be reached in practice. "
5506 "See the source code for more information."
5510 #: ../src/guestfs.pod:2862 ../fish/guestfish.pod:1017 ../test-tool/libguestfs-test-tool.pod:82 ../tools/virt-edit.pl:476
5511 msgid "ENVIRONMENT VARIABLES"
5515 #: ../src/guestfs.pod:2866 ../fish/guestfish.pod:1043
5516 msgid "LIBGUESTFS_APPEND"
5520 #: ../src/guestfs.pod:2868 ../fish/guestfish.pod:1045
5521 msgid "Pass additional options to the guest kernel."
5525 #: ../src/guestfs.pod:2870 ../fish/guestfish.pod:1047
5526 msgid "LIBGUESTFS_DEBUG"
5530 #: ../src/guestfs.pod:2872
5532 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
5533 "effect as calling C<guestfs_set_verbose (g, 1)>."
5537 #: ../src/guestfs.pod:2875 ../fish/guestfish.pod:1052
5538 msgid "LIBGUESTFS_MEMSIZE"
5542 #: ../src/guestfs.pod:2877 ../fish/guestfish.pod:1054
5543 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
5547 #: ../src/guestfs.pod:2880 ../fish/guestfish.pod:1057
5550 " LIBGUESTFS_MEMSIZE=700\n"
5555 #: ../src/guestfs.pod:2882 ../fish/guestfish.pod:1059
5556 msgid "LIBGUESTFS_PATH"
5560 #: ../src/guestfs.pod:2884
5562 "Set the path that libguestfs uses to search for a supermin appliance. See "
5563 "the discussion of paths in section L</PATH> above."
5567 #: ../src/guestfs.pod:2887 ../fish/guestfish.pod:1064
5568 msgid "LIBGUESTFS_QEMU"
5572 #: ../src/guestfs.pod:2889 ../fish/guestfish.pod:1066
5574 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
5575 "which was found at compile time by the configure script is used."
5579 #: ../src/guestfs.pod:2893
5580 msgid "See also L</QEMU WRAPPERS> above."
5584 #: ../src/guestfs.pod:2895 ../fish/guestfish.pod:1070
5585 msgid "LIBGUESTFS_TRACE"
5589 #: ../src/guestfs.pod:2897
5591 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
5592 "effect as calling C<guestfs_set_trace (g, 1)>."
5596 #: ../src/guestfs.pod:2900 ../fish/guestfish.pod:1079
5601 #: ../src/guestfs.pod:2902 ../fish/guestfish.pod:1081
5603 "Location of temporary directory, defaults to C</tmp> except for the cached "
5604 "supermin appliance which defaults to C</var/tmp>."
5608 #: ../src/guestfs.pod:2905 ../fish/guestfish.pod:1084
5610 "If libguestfs was compiled to use the supermin appliance then the real "
5611 "appliance is cached in this directory, shared between all handles belonging "
5612 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
5613 "use in case C</var/tmp> is not large enough."
5617 #: ../src/guestfs.pod:2913 ../fish/guestfish.pod:1151 ../test-tool/libguestfs-test-tool.pod:87 ../fuse/guestmount.pod:269 ../tools/virt-edit.pl:496 ../tools/virt-win-reg.pl:572 ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:539 ../tools/virt-list-partitions.pl:257
5622 #: ../src/guestfs.pod:2915
5624 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
5625 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, "
5626 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
5627 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
5628 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
5629 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
5630 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
5631 "L<http://libguestfs.org/>."
5635 #: ../src/guestfs.pod:2942
5637 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
5638 "L<lvm(8)>, L<disktype(1)>."
5642 #: ../src/guestfs.pod:2949 ../tools/virt-win-reg.pl:587 ../tools/virt-make-fs.pl:553
5647 #: ../src/guestfs.pod:2951
5648 msgid "To get a list of bugs against libguestfs use this link:"
5652 #: ../src/guestfs.pod:2953
5653 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
5657 #: ../src/guestfs.pod:2955
5658 msgid "To report a new bug against libguestfs use this link:"
5662 #: ../src/guestfs.pod:2957
5663 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
5667 #: ../src/guestfs.pod:2959
5668 msgid "When reporting a bug, please check:"
5672 #: ../src/guestfs.pod:2965
5673 msgid "That the bug hasn't been reported already."
5677 #: ../src/guestfs.pod:2969
5678 msgid "That you are testing a recent version."
5682 #: ../src/guestfs.pod:2973
5683 msgid "Describe the bug accurately, and give a way to reproduce it."
5687 #: ../src/guestfs.pod:2977
5689 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
5694 #: ../src/guestfs.pod:2982 ../fish/guestfish.pod:1174 ../test-tool/libguestfs-test-tool.pod:93 ../fuse/guestmount.pod:280
5699 #: ../src/guestfs.pod:2984 ../fish/guestfish.pod:1176 ../test-tool/libguestfs-test-tool.pod:95 ../fuse/guestmount.pod:282
5700 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
5704 #: ../src/guestfs.pod:2986 ../fish/guestfish.pod:1178 ../test-tool/libguestfs-test-tool.pod:97 ../fuse/guestmount.pod:284 ../tools/virt-edit.pl:514 ../tools/virt-win-reg.pl:602 ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:568 ../tools/virt-list-partitions.pl:273
5709 #: ../src/guestfs.pod:2988 ../fish/guestfish.pod:1180 ../test-tool/libguestfs-test-tool.pod:99
5710 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5714 #: ../src/guestfs.pod:2991
5716 "This library is free software; you can redistribute it and/or modify it "
5717 "under the terms of the GNU Lesser General Public License as published by the "
5718 "Free Software Foundation; either version 2 of the License, or (at your "
5719 "option) any later version."
5723 #: ../src/guestfs.pod:2996
5725 "This library is distributed in the hope that it will be useful, but WITHOUT "
5726 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
5727 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
5732 #: ../src/guestfs.pod:3001
5734 "You should have received a copy of the GNU Lesser General Public License "
5735 "along with this library; if not, write to the Free Software Foundation, "
5736 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
5740 #: ../src/guestfs-actions.pod:1
5741 msgid "guestfs_add_cdrom"
5745 #: ../src/guestfs-actions.pod:3
5749 " guestfs_add_cdrom (guestfs_h *g,\n"
5750 " const char *filename);\n"
5755 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
5756 msgid "This function adds a virtual CD-ROM disk image to the guest."
5760 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
5761 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5765 #: ../src/guestfs-actions.pod:17
5767 "This call checks for the existence of C<filename>. This stops you from "
5768 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5769 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
5774 #: ../src/guestfs-actions.pod:24
5776 "If you just want to add an ISO file (often you use this as an efficient way "
5777 "to transfer large files into the guest), then you should probably use "
5778 "C<guestfs_add_drive_ro> instead."
5782 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307 ../src/guestfs-actions.pod:422 ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:456 ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:529 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:614 ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:661 ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:775 ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:821 ../src/guestfs-actions.pod:982 ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:1020 ../src/guestfs-actions.pod:1104 ../src/guestfs-actions.pod:1122 ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1155 ../src/guestfs-actions.pod:1175 ../src/guestfs-actions.pod:1245 ../src/guestfs-actions.pod:1276 ../src/guestfs-actions.pod:1301 ../src/guestfs-actions.pod:1343 ../src/guestfs-actions.pod:1449 ../src/guestfs-actions.pod:1483 ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1810 ../src/guestfs-actions.pod:2272 ../src/guestfs-actions.pod:2416 ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2512 ../src/guestfs-actions.pod:3465 ../src/guestfs-actions.pod:3480 ../src/guestfs-actions.pod:3505 ../src/guestfs-actions.pod:3660 ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:3687 ../src/guestfs-actions.pod:3701 ../src/guestfs-actions.pod:3716 ../src/guestfs-actions.pod:3752 ../src/guestfs-actions.pod:3824 ../src/guestfs-actions.pod:3844 ../src/guestfs-actions.pod:3861 ../src/guestfs-actions.pod:3884 ../src/guestfs-actions.pod:3907 ../src/guestfs-actions.pod:3939 ../src/guestfs-actions.pod:3958 ../src/guestfs-actions.pod:3977 ../src/guestfs-actions.pod:4012 ../src/guestfs-actions.pod:4024 ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4104 ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4214 ../src/guestfs-actions.pod:4234 ../src/guestfs-actions.pod:4247 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4316 ../src/guestfs-actions.pod:4334 ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:4378 ../src/guestfs-actions.pod:4395 ../src/guestfs-actions.pod:4410 ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:4488 ../src/guestfs-actions.pod:4561 ../src/guestfs-actions.pod:4592 ../src/guestfs-actions.pod:4611 ../src/guestfs-actions.pod:4630 ../src/guestfs-actions.pod:4642 ../src/guestfs-actions.pod:4659 ../src/guestfs-actions.pod:4672 ../src/guestfs-actions.pod:4687 ../src/guestfs-actions.pod:4702 ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4752 ../src/guestfs-actions.pod:4772 ../src/guestfs-actions.pod:4786 ../src/guestfs-actions.pod:4803 ../src/guestfs-actions.pod:4852 ../src/guestfs-actions.pod:4889 ../src/guestfs-actions.pod:4903 ../src/guestfs-actions.pod:4931 ../src/guestfs-actions.pod:4948 ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:5100 ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5179 ../src/guestfs-actions.pod:5197 ../src/guestfs-actions.pod:5229 ../src/guestfs-actions.pod:5295 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5339 ../src/guestfs-actions.pod:5628 ../src/guestfs-actions.pod:5647 ../src/guestfs-actions.pod:5666 ../src/guestfs-actions.pod:5678 ../src/guestfs-actions.pod:5690 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:5716 ../src/guestfs-actions.pod:5730 ../src/guestfs-actions.pod:5746 ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5786 ../src/guestfs-actions.pod:5805 ../src/guestfs-actions.pod:5835 ../src/guestfs-actions.pod:5851 ../src/guestfs-actions.pod:5874 ../src/guestfs-actions.pod:5892 ../src/guestfs-actions.pod:5911 ../src/guestfs-actions.pod:5932 ../src/guestfs-actions.pod:5951 ../src/guestfs-actions.pod:5968 ../src/guestfs-actions.pod:5996 ../src/guestfs-actions.pod:6020 ../src/guestfs-actions.pod:6039 ../src/guestfs-actions.pod:6063 ../src/guestfs-actions.pod:6082 ../src/guestfs-actions.pod:6097 ../src/guestfs-actions.pod:6116 ../src/guestfs-actions.pod:6153 ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6431 ../src/guestfs-actions.pod:6443 ../src/guestfs-actions.pod:6456 ../src/guestfs-actions.pod:6469 ../src/guestfs-actions.pod:6491 ../src/guestfs-actions.pod:6504 ../src/guestfs-actions.pod:6517 ../src/guestfs-actions.pod:6530 ../src/guestfs-actions.pod:6545 ../src/guestfs-actions.pod:6604 ../src/guestfs-actions.pod:6621 ../src/guestfs-actions.pod:6637 ../src/guestfs-actions.pod:6653 ../src/guestfs-actions.pod:6670 ../src/guestfs-actions.pod:6683 ../src/guestfs-actions.pod:6703 ../src/guestfs-actions.pod:6739 ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6794 ../src/guestfs-actions.pod:6807 ../src/guestfs-actions.pod:6825 ../src/guestfs-actions.pod:6859 ../src/guestfs-actions.pod:6895 ../src/guestfs-actions.pod:7014 ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7046 ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7114 ../src/guestfs-actions.pod:7159 ../src/guestfs-actions.pod:7192 ../src/guestfs-actions.pod:7246 ../src/guestfs-actions.pod:7272 ../src/guestfs-actions.pod:7338 ../src/guestfs-actions.pod:7357 ../src/guestfs-actions.pod:7386
5783 msgid "This function returns 0 on success or -1 on error."
5787 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:275 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
5789 "This function is deprecated. In new code, use the C<add_drive_opts> call "
5794 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:257 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:1454 ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:4435 ../src/guestfs-actions.pod:7280 ../src/guestfs-actions.pod:7449 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166 ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:961 ../fish/guestfish-actions.pod:1324 ../fish/guestfish-actions.pod:1338 ../fish/guestfish-actions.pod:3013 ../fish/guestfish-actions.pod:4871 ../fish/guestfish-actions.pod:4968
5796 "Deprecated functions will not be removed from the API, but the fact that "
5797 "they are deprecated indicates that there are problems with correct use of "
5802 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1106 ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:3467 ../src/guestfs-actions.pod:3487 ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:5853 ../src/guestfs-actions.pod:5970 ../src/guestfs-actions.pod:6084 ../src/guestfs-actions.pod:6547 ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:7194
5803 msgid "(Added in 0.3)"
5807 #: ../src/guestfs-actions.pod:41
5808 msgid "guestfs_add_domain"
5812 #: ../src/guestfs-actions.pod:43
5816 " guestfs_add_domain (guestfs_h *g,\n"
5817 " const char *dom,\n"
5823 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:4449
5825 "You may supply a list of optional arguments to this call. Use zero or more "
5826 "of the following pairs of parameters, and terminate the list with C<-1> on "
5827 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
5831 #: ../src/guestfs-actions.pod:53
5834 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
5835 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
5836 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
5837 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
5838 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
5843 #: ../src/guestfs-actions.pod:59
5845 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5846 "It works by connecting to libvirt, requesting the domain and domain XML from "
5847 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
5852 #: ../src/guestfs-actions.pod:64 ../fish/guestfish-actions.pod:46
5854 "The number of disks added is returned. This operation is atomic: if an "
5855 "error is returned, then no disks are added."
5859 #: ../src/guestfs-actions.pod:67 ../fish/guestfish-actions.pod:49
5861 "This function does some minimal checks to make sure the libvirt domain is "
5862 "not running (unless C<readonly> is true). In a future version we will try "
5863 "to acquire the libvirt lock on each disk."
5867 #: ../src/guestfs-actions.pod:71 ../fish/guestfish-actions.pod:53
5869 "Disks must be accessible locally. This often means that adding disks from a "
5870 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5871 "unless those disks are accessible via the same device path locally too."
5875 #: ../src/guestfs-actions.pod:76 ../fish/guestfish-actions.pod:58
5877 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5878 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5879 "default libvirt URI (or one set through an environment variable, see the "
5880 "libvirt documentation for full details)."
5884 #: ../src/guestfs-actions.pod:82 ../fish/guestfish-actions.pod:64
5886 "The optional C<live> flag controls whether this call will try to connect to "
5887 "a running virtual machine C<guestfsd> process if it sees a suitable "
5888 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5889 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5890 "DAEMONS> for more information."
5894 #: ../src/guestfs-actions.pod:89 ../fish/guestfish-actions.pod:71
5896 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5897 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5898 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5903 #: ../src/guestfs-actions.pod:94
5905 "The other optional parameters are passed directly through to "
5906 "C<guestfs_add_drive_opts>."
5910 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350 ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:724 ../src/guestfs-actions.pod:742 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:1321 ../src/guestfs-actions.pod:1680 ../src/guestfs-actions.pod:1883 ../src/guestfs-actions.pod:1992 ../src/guestfs-actions.pod:2032 ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2110 ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2807 ../src/guestfs-actions.pod:4875 ../src/guestfs-actions.pod:5003 ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5435 ../src/guestfs-actions.pod:6780 ../src/guestfs-actions.pod:7205 ../src/guestfs-actions.pod:7218 ../src/guestfs-actions.pod:7231
5911 msgid "On error this function returns -1."
5915 #: ../src/guestfs-actions.pod:99
5916 msgid "(Added in 1.7.4)"
5920 #: ../src/guestfs-actions.pod:101
5921 msgid "guestfs_add_domain_va"
5925 #: ../src/guestfs-actions.pod:103
5929 " guestfs_add_domain_va (guestfs_h *g,\n"
5930 " const char *dom,\n"
5936 #: ../src/guestfs-actions.pod:108
5937 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
5941 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225 ../src/guestfs-actions.pod:4502 ../src/guestfs-actions.pod:4514
5942 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
5946 #: ../src/guestfs-actions.pod:112
5947 msgid "guestfs_add_domain_argv"
5951 #: ../src/guestfs-actions.pod:114
5955 " guestfs_add_domain_argv (guestfs_h *g,\n"
5956 " const char *dom,\n"
5957 " const struct guestfs_add_domain_argv *optargs);\n"
5962 #: ../src/guestfs-actions.pod:119
5963 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
5967 #: ../src/guestfs-actions.pod:123
5968 msgid "guestfs_add_drive"
5972 #: ../src/guestfs-actions.pod:125
5976 " guestfs_add_drive (guestfs_h *g,\n"
5977 " const char *filename);\n"
5982 #: ../src/guestfs-actions.pod:129
5984 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
5985 "optional parameters, so the disk is added writable, with the format being "
5986 "detected automatically."
5990 #: ../src/guestfs-actions.pod:133
5992 "Automatic detection of the format opens you up to a potential security hole "
5993 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5994 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5995 "you should think about replacing calls to this function with calls to "
5996 "C<guestfs_add_drive_opts>, and specifying the format."
6000 #: ../src/guestfs-actions.pod:144
6001 msgid "guestfs_add_drive_opts"
6005 #: ../src/guestfs-actions.pod:146
6009 " guestfs_add_drive_opts (guestfs_h *g,\n"
6010 " const char *filename,\n"
6016 #: ../src/guestfs-actions.pod:156
6019 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
6020 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
6021 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
6026 #: ../src/guestfs-actions.pod:160 ../fish/guestfish-actions.pod:102
6028 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6029 "The first time you call this function, the disk appears as C</dev/sda>, the "
6030 "second time as C</dev/sdb>, and so on."
6034 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:107
6036 "You don't necessarily need to be root when using libguestfs. However you "
6037 "obviously do need sufficient permissions to access the filename for whatever "
6038 "operations you want to perform (ie. read access if you just want to read the "
6039 "image or write access if you want to modify the image)."
6043 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:113
6044 msgid "This call checks that C<filename> exists."
6048 #: ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4460 ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3024
6049 msgid "The optional arguments are:"
6053 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:119
6058 #: ../src/guestfs-actions.pod:179 ../fish/guestfish-actions.pod:121
6060 "If true then the image is treated as read-only. Writes are still allowed, "
6061 "but they are stored in a temporary snapshot overlay which is discarded at "
6062 "the end. The disk that you add is not modified."
6066 #: ../src/guestfs-actions.pod:183 ../fish/guestfish-actions.pod:125
6071 #: ../src/guestfs-actions.pod:185
6073 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
6074 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
6075 "Possible formats include C<raw> and C<qcow2>."
6079 #: ../src/guestfs-actions.pod:189 ../fish/guestfish-actions.pod:131
6081 "Automatic detection of the format opens you up to a potential security hole "
6082 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6083 "RHBZ#642934. Specifying the format closes this security hole."
6087 #: ../src/guestfs-actions.pod:194 ../fish/guestfish-actions.pod:136
6092 #: ../src/guestfs-actions.pod:196
6094 "This rarely-used option lets you emulate the behaviour of the deprecated "
6095 "C<guestfs_add_drive_with_if> call (q.v.)"
6099 #: ../src/guestfs-actions.pod:203
6100 msgid "(Added in 1.5.23)"
6104 #: ../src/guestfs-actions.pod:205
6105 msgid "guestfs_add_drive_opts_va"
6109 #: ../src/guestfs-actions.pod:207
6113 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
6114 " const char *filename,\n"
6120 #: ../src/guestfs-actions.pod:212
6121 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
6125 #: ../src/guestfs-actions.pod:216
6126 msgid "guestfs_add_drive_opts_argv"
6130 #: ../src/guestfs-actions.pod:218
6134 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
6135 " const char *filename,\n"
6136 " const struct guestfs_add_drive_opts_argv "
6142 #: ../src/guestfs-actions.pod:223
6143 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
6147 #: ../src/guestfs-actions.pod:227
6148 msgid "guestfs_add_drive_ro"
6152 #: ../src/guestfs-actions.pod:229
6156 " guestfs_add_drive_ro (guestfs_h *g,\n"
6157 " const char *filename);\n"
6162 #: ../src/guestfs-actions.pod:233
6164 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
6165 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
6166 "disk is added read-only, with the format being detected automatically."
6170 #: ../src/guestfs-actions.pod:240
6171 msgid "(Added in 1.0.38)"
6175 #: ../src/guestfs-actions.pod:242
6176 msgid "guestfs_add_drive_ro_with_if"
6180 #: ../src/guestfs-actions.pod:244
6184 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6185 " const char *filename,\n"
6186 " const char *iface);\n"
6191 #: ../src/guestfs-actions.pod:249
6193 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6194 "QEMU interface emulation to use at run time."
6198 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2362
6199 msgid "(Added in 1.0.84)"
6203 #: ../src/guestfs-actions.pod:263
6204 msgid "guestfs_add_drive_with_if"
6208 #: ../src/guestfs-actions.pod:265
6212 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6213 " const char *filename,\n"
6214 " const char *iface);\n"
6219 #: ../src/guestfs-actions.pod:270
6221 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
6222 "QEMU interface emulation to use at run time."
6226 #: ../src/guestfs-actions.pod:284
6227 msgid "guestfs_aug_clear"
6231 #: ../src/guestfs-actions.pod:286
6235 " guestfs_aug_clear (guestfs_h *g,\n"
6236 " const char *augpath);\n"
6241 #: ../src/guestfs-actions.pod:290 ../fish/guestfish-actions.pod:188
6243 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6244 "L<augtool(1)> C<clear> command."
6248 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2112
6249 msgid "(Added in 1.3.4)"
6253 #: ../src/guestfs-actions.pod:297
6254 msgid "guestfs_aug_close"
6258 #: ../src/guestfs-actions.pod:299
6262 " guestfs_aug_close (guestfs_h *g);\n"
6267 #: ../src/guestfs-actions.pod:302
6269 "Close the current Augeas handle and free up any resources used by it. After "
6270 "calling this, you have to call C<guestfs_aug_init> again before you can use "
6271 "any other Augeas functions."
6275 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366 ../src/guestfs-actions.pod:424 ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:458 ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:549 ../src/guestfs-actions.pod:5486
6276 msgid "(Added in 0.7)"
6280 #: ../src/guestfs-actions.pod:311
6281 msgid "guestfs_aug_defnode"
6285 #: ../src/guestfs-actions.pod:313
6288 " struct guestfs_int_bool *\n"
6289 " guestfs_aug_defnode (guestfs_h *g,\n"
6290 " const char *name,\n"
6291 " const char *expr,\n"
6292 " const char *val);\n"
6297 #: ../src/guestfs-actions.pod:319 ../fish/guestfish-actions.pod:204
6298 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6302 #: ../src/guestfs-actions.pod:322
6304 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6305 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
6306 "containing that single node."
6310 #: ../src/guestfs-actions.pod:326 ../fish/guestfish-actions.pod:211
6312 "On success this returns a pair containing the number of nodes in the "
6313 "nodeset, and a boolean flag if a node was created."
6317 #: ../src/guestfs-actions.pod:330
6319 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
6320 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
6324 #: ../src/guestfs-actions.pod:336
6325 msgid "guestfs_aug_defvar"
6329 #: ../src/guestfs-actions.pod:338
6333 " guestfs_aug_defvar (guestfs_h *g,\n"
6334 " const char *name,\n"
6335 " const char *expr);\n"
6340 #: ../src/guestfs-actions.pod:343 ../fish/guestfish-actions.pod:219
6342 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6343 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6347 #: ../src/guestfs-actions.pod:347 ../fish/guestfish-actions.pod:223
6349 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6350 "evaluates to something which is not a nodeset."
6354 #: ../src/guestfs-actions.pod:354
6355 msgid "guestfs_aug_get"
6359 #: ../src/guestfs-actions.pod:356
6363 " guestfs_aug_get (guestfs_h *g,\n"
6364 " const char *augpath);\n"
6369 #: ../src/guestfs-actions.pod:360 ../fish/guestfish-actions.pod:230
6371 "Look up the value associated with C<path>. If C<path> matches exactly one "
6372 "node, the C<value> is returned."
6376 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:881 ../src/guestfs-actions.pod:941 ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:1060 ../src/guestfs-actions.pod:1190 ../src/guestfs-actions.pod:1207 ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1360 ../src/guestfs-actions.pod:1551 ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:1910 ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2135 ../src/guestfs-actions.pod:2327 ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2627 ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:2878 ../src/guestfs-actions.pod:2909 ../src/guestfs-actions.pod:2933 ../src/guestfs-actions.pod:2970 ../src/guestfs-actions.pod:3030 ../src/guestfs-actions.pod:3053 ../src/guestfs-actions.pod:3074 ../src/guestfs-actions.pod:3646 ../src/guestfs-actions.pod:3996 ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4276 ../src/guestfs-actions.pod:5021 ../src/guestfs-actions.pod:5214 ../src/guestfs-actions.pod:5384 ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5611 ../src/guestfs-actions.pod:6223 ../src/guestfs-actions.pod:6239 ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6280 ../src/guestfs-actions.pod:6954 ../src/guestfs-actions.pod:6973 ../src/guestfs-actions.pod:6991 ../src/guestfs-actions.pod:7171 ../src/guestfs-actions.pod:7443
6378 "This function returns a string, or NULL on error. I<The caller must free "
6379 "the returned string after use>."
6383 #: ../src/guestfs-actions.pod:368
6384 msgid "guestfs_aug_init"
6388 #: ../src/guestfs-actions.pod:370
6392 " guestfs_aug_init (guestfs_h *g,\n"
6393 " const char *root,\n"
6399 #: ../src/guestfs-actions.pod:375 ../fish/guestfish-actions.pod:237
6401 "Create a new Augeas handle for editing configuration files. If there was "
6402 "any previous Augeas handle associated with this guestfs session, then it is "
6407 #: ../src/guestfs-actions.pod:379
6408 msgid "You must call this before using any other C<guestfs_aug_*> commands."
6412 #: ../src/guestfs-actions.pod:382 ../fish/guestfish-actions.pod:244
6413 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6417 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:247
6419 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6420 "logical I<or> of the following integers:"
6424 #: ../src/guestfs-actions.pod:391 ../fish/guestfish-actions.pod:253
6425 msgid "C<AUG_SAVE_BACKUP> = 1"
6429 #: ../src/guestfs-actions.pod:393 ../fish/guestfish-actions.pod:255
6430 msgid "Keep the original file with a C<.augsave> extension."
6434 #: ../src/guestfs-actions.pod:395 ../fish/guestfish-actions.pod:257
6435 msgid "C<AUG_SAVE_NEWFILE> = 2"
6439 #: ../src/guestfs-actions.pod:397 ../fish/guestfish-actions.pod:259
6441 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6442 "original. Overrides C<AUG_SAVE_BACKUP>."
6446 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:262
6447 msgid "C<AUG_TYPE_CHECK> = 4"
6451 #: ../src/guestfs-actions.pod:402 ../fish/guestfish-actions.pod:264
6452 msgid "Typecheck lenses (can be expensive)."
6456 #: ../src/guestfs-actions.pod:404 ../fish/guestfish-actions.pod:266
6457 msgid "C<AUG_NO_STDINC> = 8"
6461 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:268
6462 msgid "Do not use standard load path for modules."
6466 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:270
6467 msgid "C<AUG_SAVE_NOOP> = 16"
6471 #: ../src/guestfs-actions.pod:410 ../fish/guestfish-actions.pod:272
6472 msgid "Make save a no-op, just record what would have been changed."
6476 #: ../src/guestfs-actions.pod:412 ../fish/guestfish-actions.pod:274
6477 msgid "C<AUG_NO_LOAD> = 32"
6481 #: ../src/guestfs-actions.pod:414
6482 msgid "Do not load the tree in C<guestfs_aug_init>."
6486 #: ../src/guestfs-actions.pod:418
6487 msgid "To close the handle, you can call C<guestfs_aug_close>."
6491 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:282
6492 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6496 #: ../src/guestfs-actions.pod:426
6497 msgid "guestfs_aug_insert"
6501 #: ../src/guestfs-actions.pod:428
6505 " guestfs_aug_insert (guestfs_h *g,\n"
6506 " const char *augpath,\n"
6507 " const char *label,\n"
6513 #: ../src/guestfs-actions.pod:434 ../fish/guestfish-actions.pod:288
6515 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6516 "or after C<path> (depending on the boolean flag C<before>)."
6520 #: ../src/guestfs-actions.pod:438 ../fish/guestfish-actions.pod:292
6522 "C<path> must match exactly one existing node in the tree, and C<label> must "
6523 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6527 #: ../src/guestfs-actions.pod:446
6528 msgid "guestfs_aug_load"
6532 #: ../src/guestfs-actions.pod:448
6536 " guestfs_aug_load (guestfs_h *g);\n"
6541 #: ../src/guestfs-actions.pod:451 ../fish/guestfish-actions.pod:300
6542 msgid "Load files into the tree."
6546 #: ../src/guestfs-actions.pod:453 ../fish/guestfish-actions.pod:302
6547 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6551 #: ../src/guestfs-actions.pod:460
6552 msgid "guestfs_aug_ls"
6556 #: ../src/guestfs-actions.pod:462
6560 " guestfs_aug_ls (guestfs_h *g,\n"
6561 " const char *augpath);\n"
6566 #: ../src/guestfs-actions.pod:466
6568 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
6569 "sorting the resulting nodes into alphabetical order."
6573 #: ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:485 ../src/guestfs-actions.pod:631 ../src/guestfs-actions.pod:1079 ../src/guestfs-actions.pod:1375 ../src/guestfs-actions.pod:1394 ../src/guestfs-actions.pod:1497 ../src/guestfs-actions.pod:1516 ../src/guestfs-actions.pod:1765 ../src/guestfs-actions.pod:2207 ../src/guestfs-actions.pod:2223 ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:2309 ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2696 ../src/guestfs-actions.pod:2987 ../src/guestfs-actions.pod:3276 ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:3733 ../src/guestfs-actions.pod:4138 ../src/guestfs-actions.pod:4836 ../src/guestfs-actions.pod:5356 ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:6296 ../src/guestfs-actions.pod:6357 ../src/guestfs-actions.pod:6412 ../src/guestfs-actions.pod:6558 ../src/guestfs-actions.pod:6582 ../src/guestfs-actions.pod:7064 ../src/guestfs-actions.pod:7084 ../src/guestfs-actions.pod:7131 ../src/guestfs-actions.pod:7296 ../src/guestfs-actions.pod:7315 ../src/guestfs-actions.pod:7400 ../src/guestfs-actions.pod:7419 ../src/guestfs-actions.pod:7465 ../src/guestfs-actions.pod:7484
6575 "This function returns a NULL-terminated array of strings (like "
6576 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
6577 "strings and the array after use>."
6581 #: ../src/guestfs-actions.pod:473 ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:1022 ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3385 ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:4029 ../src/guestfs-actions.pod:4216 ../src/guestfs-actions.pod:4249 ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:4840 ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5692 ../src/guestfs-actions.pod:5706 ../src/guestfs-actions.pod:5718 ../src/guestfs-actions.pod:6158 ../src/guestfs-actions.pod:6796 ../src/guestfs-actions.pod:6809 ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7284
6582 msgid "(Added in 0.8)"
6586 #: ../src/guestfs-actions.pod:475
6587 msgid "guestfs_aug_match"
6591 #: ../src/guestfs-actions.pod:477
6595 " guestfs_aug_match (guestfs_h *g,\n"
6596 " const char *augpath);\n"
6601 #: ../src/guestfs-actions.pod:481 ../fish/guestfish-actions.pod:316
6603 "Returns a list of paths which match the path expression C<path>. The "
6604 "returned paths are sufficiently qualified so that they match exactly one "
6605 "node in the current tree."
6609 #: ../src/guestfs-actions.pod:491
6610 msgid "guestfs_aug_mv"
6614 #: ../src/guestfs-actions.pod:493
6618 " guestfs_aug_mv (guestfs_h *g,\n"
6619 " const char *src,\n"
6620 " const char *dest);\n"
6625 #: ../src/guestfs-actions.pod:498 ../fish/guestfish-actions.pod:324
6627 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6628 "C<dest> is overwritten if it exists."
6632 #: ../src/guestfs-actions.pod:505
6633 msgid "guestfs_aug_rm"
6637 #: ../src/guestfs-actions.pod:507
6641 " guestfs_aug_rm (guestfs_h *g,\n"
6642 " const char *augpath);\n"
6647 #: ../src/guestfs-actions.pod:511 ../fish/guestfish-actions.pod:331
6648 msgid "Remove C<path> and all of its children."
6652 #: ../src/guestfs-actions.pod:513 ../fish/guestfish-actions.pod:333
6653 msgid "On success this returns the number of entries which were removed."
6657 #: ../src/guestfs-actions.pod:519
6658 msgid "guestfs_aug_save"
6662 #: ../src/guestfs-actions.pod:521
6666 " guestfs_aug_save (guestfs_h *g);\n"
6671 #: ../src/guestfs-actions.pod:524 ../fish/guestfish-actions.pod:339
6672 msgid "This writes all pending changes to disk."
6676 #: ../src/guestfs-actions.pod:526
6678 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
6683 #: ../src/guestfs-actions.pod:533
6684 msgid "guestfs_aug_set"
6688 #: ../src/guestfs-actions.pod:535
6692 " guestfs_aug_set (guestfs_h *g,\n"
6693 " const char *augpath,\n"
6694 " const char *val);\n"
6699 #: ../src/guestfs-actions.pod:540 ../fish/guestfish-actions.pod:348
6700 msgid "Set the value associated with C<path> to C<val>."
6704 #: ../src/guestfs-actions.pod:542
6706 "In the Augeas API, it is possible to clear a node by setting the value to "
6707 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6708 "this call. Instead you must use the C<guestfs_aug_clear> call."
6712 #: ../src/guestfs-actions.pod:551
6713 msgid "guestfs_available"
6717 #: ../src/guestfs-actions.pod:553
6721 " guestfs_available (guestfs_h *g,\n"
6722 " char *const *groups);\n"
6727 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:359
6729 "This command is used to check the availability of some groups of "
6730 "functionality in the appliance, which not all builds of the libguestfs "
6731 "appliance will be able to provide."
6735 #: ../src/guestfs-actions.pod:561
6737 "The libguestfs groups, and the functions that those groups correspond to, "
6738 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6739 "runtime by calling C<guestfs_available_all_groups>."
6743 #: ../src/guestfs-actions.pod:566 ../fish/guestfish-actions.pod:368
6745 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6746 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6747 "and Augeas (configuration file editing) functions."
6751 #: ../src/guestfs-actions.pod:571 ../fish/guestfish-actions.pod:373
6752 msgid "The command returns no error if I<all> requested groups are available."
6756 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:375
6758 "It fails with an error if one or more of the requested groups is unavailable "
6763 #: ../src/guestfs-actions.pod:576 ../fish/guestfish-actions.pod:378
6765 "If an unknown group name is included in the list of groups then an error is "
6770 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:381
6775 #: ../src/guestfs-actions.pod:585
6776 msgid "You must call C<guestfs_launch> before calling this function."
6780 #: ../src/guestfs-actions.pod:587 ../fish/guestfish-actions.pod:389
6782 "The reason is because we don't know what groups are supported by the "
6783 "appliance/daemon until it is running and can be queried."
6787 #: ../src/guestfs-actions.pod:593 ../fish/guestfish-actions.pod:395
6789 "If a group of functions is available, this does not necessarily mean that "
6790 "they will work. You still have to check for errors when calling individual "
6791 "API functions even if they are available."
6795 #: ../src/guestfs-actions.pod:600 ../fish/guestfish-actions.pod:402
6797 "It is usually the job of distro packagers to build complete functionality "
6798 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6799 "with all requirements satisfied, will support everything."
6803 #: ../src/guestfs-actions.pod:607
6805 "This call was added in version C<1.0.80>. In previous versions of "
6806 "libguestfs all you could do would be to speculatively execute a command to "
6807 "find out if the daemon implemented it. See also C<guestfs_version>."
6811 #: ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:1177
6812 msgid "(Added in 1.0.80)"
6816 #: ../src/guestfs-actions.pod:618
6817 msgid "guestfs_available_all_groups"
6821 #: ../src/guestfs-actions.pod:620
6825 " guestfs_available_all_groups (guestfs_h *g);\n"
6830 #: ../src/guestfs-actions.pod:623
6832 "This command returns a list of all optional groups that this daemon knows "
6833 "about. Note this returns both supported and unsupported groups. To find "
6834 "out which ones the daemon can actually support you have to call "
6835 "C<guestfs_available> on each member of the returned list."
6839 #: ../src/guestfs-actions.pod:629
6840 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
6844 #: ../src/guestfs-actions.pod:635
6845 msgid "(Added in 1.3.15)"
6849 #: ../src/guestfs-actions.pod:637
6850 msgid "guestfs_base64_in"
6854 #: ../src/guestfs-actions.pod:639
6858 " guestfs_base64_in (guestfs_h *g,\n"
6859 " const char *base64file,\n"
6860 " const char *filename);\n"
6865 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:432
6866 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6870 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:663
6871 msgid "(Added in 1.3.5)"
6875 #: ../src/guestfs-actions.pod:651
6876 msgid "guestfs_base64_out"
6880 #: ../src/guestfs-actions.pod:653
6884 " guestfs_base64_out (guestfs_h *g,\n"
6885 " const char *filename,\n"
6886 " const char *base64file);\n"
6891 #: ../src/guestfs-actions.pod:658 ../fish/guestfish-actions.pod:441
6893 "This command downloads the contents of C<filename>, writing it out to local "
6894 "file C<base64file> encoded as base64."
6898 #: ../src/guestfs-actions.pod:665
6899 msgid "guestfs_blockdev_flushbufs"
6903 #: ../src/guestfs-actions.pod:667
6907 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
6908 " const char *device);\n"
6913 #: ../src/guestfs-actions.pod:671 ../fish/guestfish-actions.pod:450
6914 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6918 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:691 ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:722 ../src/guestfs-actions.pod:740 ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:773 ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805 ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:453 ../fish/guestfish-actions.pod:464 ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:495 ../fish/guestfish-actions.pod:508 ../fish/guestfish-actions.pod:516 ../fish/guestfish-actions.pod:527 ../fish/guestfish-actions.pod:535 ../fish/guestfish-actions.pod:543
6919 msgid "This uses the L<blockdev(8)> command."
6923 #: ../src/guestfs-actions.pod:678 ../src/guestfs-actions.pod:695 ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:744 ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:777 ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809 ../src/guestfs-actions.pod:823
6924 msgid "(Added in 0.9.3)"
6928 #: ../src/guestfs-actions.pod:680
6929 msgid "guestfs_blockdev_getbsz"
6933 #: ../src/guestfs-actions.pod:682
6937 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
6938 " const char *device);\n"
6943 #: ../src/guestfs-actions.pod:686 ../fish/guestfish-actions.pod:459
6944 msgid "This returns the block size of a device."
6948 #: ../src/guestfs-actions.pod:688 ../src/guestfs-actions.pod:788 ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:524
6950 "(Note this is different from both I<size in blocks> and I<filesystem block "
6955 #: ../src/guestfs-actions.pod:697
6956 msgid "guestfs_blockdev_getro"
6960 #: ../src/guestfs-actions.pod:699
6964 " guestfs_blockdev_getro (guestfs_h *g,\n"
6965 " const char *device);\n"
6970 #: ../src/guestfs-actions.pod:703 ../fish/guestfish-actions.pod:470
6972 "Returns a boolean indicating if the block device is read-only (true if "
6973 "read-only, false if not)."
6977 #: ../src/guestfs-actions.pod:708 ../src/guestfs-actions.pod:1415 ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1920 ../src/guestfs-actions.pod:1931 ../src/guestfs-actions.pod:2003 ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:2098 ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:3094 ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3130 ../src/guestfs-actions.pod:3293 ../src/guestfs-actions.pod:3307 ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3336 ../src/guestfs-actions.pod:3352 ../src/guestfs-actions.pod:3367 ../src/guestfs-actions.pod:3383 ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:3439 ../src/guestfs-actions.pod:3454 ../src/guestfs-actions.pod:4985
6978 msgid "This function returns a C truth value on success or -1 on error."
6982 #: ../src/guestfs-actions.pod:712
6983 msgid "guestfs_blockdev_getsize64"
6987 #: ../src/guestfs-actions.pod:714
6991 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
6992 " const char *device);\n"
6997 #: ../src/guestfs-actions.pod:718 ../fish/guestfish-actions.pod:479
6998 msgid "This returns the size of the device in bytes."
7002 #: ../src/guestfs-actions.pod:720
7003 msgid "See also C<guestfs_blockdev_getsz>."
7007 #: ../src/guestfs-actions.pod:728
7008 msgid "guestfs_blockdev_getss"
7012 #: ../src/guestfs-actions.pod:730
7016 " guestfs_blockdev_getss (guestfs_h *g,\n"
7017 " const char *device);\n"
7022 #: ../src/guestfs-actions.pod:734 ../fish/guestfish-actions.pod:489
7024 "This returns the size of sectors on a block device. Usually 512, but can be "
7025 "larger for modern devices."
7029 #: ../src/guestfs-actions.pod:737
7031 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
7036 #: ../src/guestfs-actions.pod:746
7037 msgid "guestfs_blockdev_getsz"
7041 #: ../src/guestfs-actions.pod:748
7045 " guestfs_blockdev_getsz (guestfs_h *g,\n"
7046 " const char *device);\n"
7051 #: ../src/guestfs-actions.pod:752 ../fish/guestfish-actions.pod:501
7053 "This returns the size of the device in units of 512-byte sectors (even if "
7054 "the sectorsize isn't 512 bytes ... weird)."
7058 #: ../src/guestfs-actions.pod:755
7060 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
7061 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
7065 #: ../src/guestfs-actions.pod:765
7066 msgid "guestfs_blockdev_rereadpt"
7070 #: ../src/guestfs-actions.pod:767
7074 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
7075 " const char *device);\n"
7080 #: ../src/guestfs-actions.pod:771 ../fish/guestfish-actions.pod:514
7081 msgid "Reread the partition table on C<device>."
7085 #: ../src/guestfs-actions.pod:779
7086 msgid "guestfs_blockdev_setbsz"
7090 #: ../src/guestfs-actions.pod:781
7094 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
7095 " const char *device,\n"
7096 " int blocksize);\n"
7101 #: ../src/guestfs-actions.pod:786 ../fish/guestfish-actions.pod:522
7102 msgid "This sets the block size of a device."
7106 #: ../src/guestfs-actions.pod:797
7107 msgid "guestfs_blockdev_setro"
7111 #: ../src/guestfs-actions.pod:799
7115 " guestfs_blockdev_setro (guestfs_h *g,\n"
7116 " const char *device);\n"
7121 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:533
7122 msgid "Sets the block device named C<device> to read-only."
7126 #: ../src/guestfs-actions.pod:811
7127 msgid "guestfs_blockdev_setrw"
7131 #: ../src/guestfs-actions.pod:813
7135 " guestfs_blockdev_setrw (guestfs_h *g,\n"
7136 " const char *device);\n"
7141 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:541
7142 msgid "Sets the block device named C<device> to read-write."
7146 #: ../src/guestfs-actions.pod:825
7147 msgid "guestfs_case_sensitive_path"
7151 #: ../src/guestfs-actions.pod:827
7155 " guestfs_case_sensitive_path (guestfs_h *g,\n"
7156 " const char *path);\n"
7161 #: ../src/guestfs-actions.pod:831 ../fish/guestfish-actions.pod:549
7163 "This can be used to resolve case insensitive paths on a filesystem which is "
7164 "case sensitive. The use case is to resolve paths which you have read from "
7165 "Windows configuration files or the Windows Registry, to the true path."
7169 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:554
7171 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7172 "(and probably others), which is that although the underlying filesystem is "
7173 "case-insensitive, the driver exports the filesystem to Linux as "
7178 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:559
7180 "One consequence of this is that special directories such as C<c:\\windows> "
7181 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7182 "precise details of how they were created. In Windows itself this would not "
7187 #: ../src/guestfs-actions.pod:847 ../fish/guestfish-actions.pod:565
7189 "Bug or feature? You decide: "
7190 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
7194 #: ../src/guestfs-actions.pod:850 ../fish/guestfish-actions.pod:568
7196 "This function resolves the true case of each element in the path and returns "
7197 "the case-sensitive path."
7201 #: ../src/guestfs-actions.pod:853
7203 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
7204 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7205 "how the directories were originally created under Windows)."
7209 #: ../src/guestfs-actions.pod:858 ../fish/guestfish-actions.pod:576
7210 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7214 #: ../src/guestfs-actions.pod:861
7215 msgid "See also C<guestfs_realpath>."
7219 #: ../src/guestfs-actions.pod:866 ../src/guestfs-actions.pod:6976
7220 msgid "(Added in 1.0.75)"
7224 #: ../src/guestfs-actions.pod:868
7229 #: ../src/guestfs-actions.pod:870
7233 " guestfs_cat (guestfs_h *g,\n"
7234 " const char *path);\n"
7239 #: ../src/guestfs-actions.pod:874 ../src/guestfs-actions.pod:5472 ../fish/guestfish-actions.pod:585 ../fish/guestfish-actions.pod:3672
7240 msgid "Return the contents of the file named C<path>."
7244 #: ../src/guestfs-actions.pod:876
7246 "Note that this function cannot correctly handle binary files (specifically, "
7247 "files containing C<\\0> character which is treated as end of string). For "
7248 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
7249 "functions which have a more complex interface."
7253 #: ../src/guestfs-actions.pod:884 ../src/guestfs-actions.pod:1063 ../src/guestfs-actions.pod:1083 ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1520 ../src/guestfs-actions.pod:1769 ../src/guestfs-actions.pod:2227 ../src/guestfs-actions.pod:2246 ../src/guestfs-actions.pod:2289 ../src/guestfs-actions.pod:2313 ../src/guestfs-actions.pod:2330 ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5411 ../src/guestfs-actions.pod:5437 ../src/guestfs-actions.pod:5461 ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6416 ../src/guestfs-actions.pod:6562 ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:7248 ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7300 ../src/guestfs-actions.pod:7319 ../src/guestfs-actions.pod:7404 ../src/guestfs-actions.pod:7423 ../src/guestfs-actions.pod:7469 ../src/guestfs-actions.pod:7488 ../fish/guestfish-actions.pod:592 ../fish/guestfish-actions.pod:727 ../fish/guestfish-actions.pod:739 ../fish/guestfish-actions.pod:915 ../fish/guestfish-actions.pod:925 ../fish/guestfish-actions.pod:992 ../fish/guestfish-actions.pod:1002 ../fish/guestfish-actions.pod:1197 ../fish/guestfish-actions.pod:1498 ../fish/guestfish-actions.pod:1508 ../fish/guestfish-actions.pod:1536 ../fish/guestfish-actions.pod:1551 ../fish/guestfish-actions.pod:1561 ../fish/guestfish-actions.pod:1580 ../fish/guestfish-actions.pod:3542 ../fish/guestfish-actions.pod:3557 ../fish/guestfish-actions.pod:3633 ../fish/guestfish-actions.pod:3650 ../fish/guestfish-actions.pod:3665 ../fish/guestfish-actions.pod:4291 ../fish/guestfish-actions.pod:4337 ../fish/guestfish-actions.pod:4422 ../fish/guestfish-actions.pod:4437 ../fish/guestfish-actions.pod:4847 ../fish/guestfish-actions.pod:4865 ../fish/guestfish-actions.pod:4882 ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4940 ../fish/guestfish-actions.pod:4950 ../fish/guestfish-actions.pod:4979 ../fish/guestfish-actions.pod:4989
7255 "Because of the message protocol, there is a transfer limit of somewhere "
7256 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7260 #: ../src/guestfs-actions.pod:887 ../src/guestfs-actions.pod:3570 ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3649 ../src/guestfs-actions.pod:3737 ../src/guestfs-actions.pod:4142 ../src/guestfs-actions.pod:4156 ../src/guestfs-actions.pod:5360 ../src/guestfs-actions.pod:5374 ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7149
7261 msgid "(Added in 0.4)"
7265 #: ../src/guestfs-actions.pod:889
7266 msgid "guestfs_checksum"
7270 #: ../src/guestfs-actions.pod:891
7274 " guestfs_checksum (guestfs_h *g,\n"
7275 " const char *csumtype,\n"
7276 " const char *path);\n"
7281 #: ../src/guestfs-actions.pod:896 ../fish/guestfish-actions.pod:599
7282 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7286 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:602
7288 "The type of checksum to compute is given by the C<csumtype> parameter which "
7289 "must have one of the following values:"
7293 #: ../src/guestfs-actions.pod:904 ../fish/guestfish-actions.pod:607
7298 #: ../src/guestfs-actions.pod:906 ../fish/guestfish-actions.pod:609
7300 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7305 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:612
7310 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:614
7311 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7315 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:616
7320 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:618
7321 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7325 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:620
7330 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:622
7331 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7335 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:624
7340 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:626
7341 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7345 #: ../src/guestfs-actions.pod:925 ../fish/guestfish-actions.pod:628
7350 #: ../src/guestfs-actions.pod:927 ../fish/guestfish-actions.pod:630
7351 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7355 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:632
7360 #: ../src/guestfs-actions.pod:931 ../fish/guestfish-actions.pod:634
7361 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7365 #: ../src/guestfs-actions.pod:935 ../fish/guestfish-actions.pod:638
7366 msgid "The checksum is returned as a printable string."
7370 #: ../src/guestfs-actions.pod:937
7371 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
7375 #: ../src/guestfs-actions.pod:939
7376 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
7380 #: ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:1252 ../src/guestfs-actions.pod:2089 ../src/guestfs-actions.pod:3309 ../src/guestfs-actions.pod:3338 ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:6832
7381 msgid "(Added in 1.0.2)"
7385 #: ../src/guestfs-actions.pod:946
7386 msgid "guestfs_checksum_device"
7390 #: ../src/guestfs-actions.pod:948
7394 " guestfs_checksum_device (guestfs_h *g,\n"
7395 " const char *csumtype,\n"
7396 " const char *device);\n"
7401 #: ../src/guestfs-actions.pod:953
7403 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7404 "device named C<device>. For the types of checksums supported see the "
7405 "C<guestfs_checksum> command."
7409 #: ../src/guestfs-actions.pod:960 ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4987 ../src/guestfs-actions.pod:5005 ../src/guestfs-actions.pod:5181 ../src/guestfs-actions.pod:6741 ../src/guestfs-actions.pod:6755 ../src/guestfs-actions.pod:7161
7410 msgid "(Added in 1.3.2)"
7414 #: ../src/guestfs-actions.pod:962
7415 msgid "guestfs_checksums_out"
7419 #: ../src/guestfs-actions.pod:964
7423 " guestfs_checksums_out (guestfs_h *g,\n"
7424 " const char *csumtype,\n"
7425 " const char *directory,\n"
7426 " const char *sumsfile);\n"
7431 #: ../src/guestfs-actions.pod:970 ../fish/guestfish-actions.pod:656
7433 "This command computes the checksums of all regular files in C<directory> and "
7434 "then emits a list of those checksums to the local output file C<sumsfile>."
7438 #: ../src/guestfs-actions.pod:974 ../fish/guestfish-actions.pod:660
7440 "This can be used for verifying the integrity of a virtual machine. However "
7441 "to be properly secure you should pay attention to the output of the checksum "
7442 "command (it uses the ones from GNU coreutils). In particular when the "
7443 "filename is not printable, coreutils uses a special backslash syntax. For "
7444 "more information, see the GNU coreutils info file."
7448 #: ../src/guestfs-actions.pod:984
7449 msgid "(Added in 1.3.7)"
7453 #: ../src/guestfs-actions.pod:986
7454 msgid "guestfs_chmod"
7458 #: ../src/guestfs-actions.pod:988
7462 " guestfs_chmod (guestfs_h *g,\n"
7464 " const char *path);\n"
7469 #: ../src/guestfs-actions.pod:993 ../fish/guestfish-actions.pod:674
7471 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7476 #: ../src/guestfs-actions.pod:996 ../fish/guestfish-actions.pod:677
7478 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7479 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7484 #: ../src/guestfs-actions.pod:1000 ../src/guestfs-actions.pod:4393 ../src/guestfs-actions.pod:4590 ../src/guestfs-actions.pod:4609 ../src/guestfs-actions.pod:4628 ../fish/guestfish-actions.pod:681 ../fish/guestfish-actions.pod:2988 ../fish/guestfish-actions.pod:3117 ../fish/guestfish-actions.pod:3127 ../fish/guestfish-actions.pod:3137
7485 msgid "The mode actually set is affected by the umask."
7489 #: ../src/guestfs-actions.pod:1006
7490 msgid "guestfs_chown"
7494 #: ../src/guestfs-actions.pod:1008
7498 " guestfs_chown (guestfs_h *g,\n"
7501 " const char *path);\n"
7506 #: ../src/guestfs-actions.pod:1014 ../fish/guestfish-actions.pod:687
7507 msgid "Change the file owner to C<owner> and group to C<group>."
7511 #: ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:3501 ../fish/guestfish-actions.pod:689 ../fish/guestfish-actions.pod:2446
7513 "Only numeric uid and gid are supported. If you want to use names, you will "
7514 "need to locate and parse the password file yourself (Augeas support makes "
7515 "this relatively easy)."
7519 #: ../src/guestfs-actions.pod:1024
7520 msgid "guestfs_command"
7524 #: ../src/guestfs-actions.pod:1026
7528 " guestfs_command (guestfs_h *g,\n"
7529 " char *const *arguments);\n"
7534 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:697
7536 "This call runs a command from the guest filesystem. The filesystem must be "
7537 "mounted, and must contain a compatible operating system (ie. something "
7538 "Linux, with the same or compatible processor architecture)."
7542 #: ../src/guestfs-actions.pod:1035
7544 "The single parameter is an argv-style list of arguments. The first element "
7545 "is the name of the program to run. Subsequent elements are parameters. The "
7546 "list must be non-empty (ie. must contain a program name). Note that the "
7547 "command runs directly, and is I<not> invoked via the shell (see "
7552 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:709
7553 msgid "The return value is anything printed to I<stdout> by the command."
7557 #: ../src/guestfs-actions.pod:1045 ../fish/guestfish-actions.pod:712
7559 "If the command returns a non-zero exit status, then this function returns an "
7560 "error message. The error message string is the content of I<stderr> from "
7565 #: ../src/guestfs-actions.pod:1049 ../fish/guestfish-actions.pod:716
7567 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
7568 "C</bin>. If you require a program from another location, you should provide "
7569 "the full path in the first parameter."
7573 #: ../src/guestfs-actions.pod:1054 ../fish/guestfish-actions.pod:721
7575 "Shared libraries and data files required by the program must be available on "
7576 "filesystems which are mounted in the correct places. It is the caller's "
7577 "responsibility to ensure all filesystems that are needed are mounted at the "
7582 #: ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1554
7583 msgid "(Added in 0.9.1)"
7587 #: ../src/guestfs-actions.pod:1068
7588 msgid "guestfs_command_lines"
7592 #: ../src/guestfs-actions.pod:1070
7596 " guestfs_command_lines (guestfs_h *g,\n"
7597 " char *const *arguments);\n"
7602 #: ../src/guestfs-actions.pod:1074
7604 "This is the same as C<guestfs_command>, but splits the result into a list of "
7609 #: ../src/guestfs-actions.pod:1077
7610 msgid "See also: C<guestfs_sh_lines>"
7614 #: ../src/guestfs-actions.pod:1088
7615 msgid "guestfs_config"
7619 #: ../src/guestfs-actions.pod:1090
7623 " guestfs_config (guestfs_h *g,\n"
7624 " const char *qemuparam,\n"
7625 " const char *qemuvalue);\n"
7630 #: ../src/guestfs-actions.pod:1095 ../fish/guestfish-actions.pod:746
7632 "This can be used to add arbitrary qemu command line parameters of the form "
7633 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7634 "setting some parameters which would interfere with parameters that we use."
7638 #: ../src/guestfs-actions.pod:1100 ../fish/guestfish-actions.pod:751
7639 msgid "The first character of C<param> string must be a C<-> (dash)."
7643 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:753
7644 msgid "C<value> can be NULL."
7648 #: ../src/guestfs-actions.pod:1108
7649 msgid "guestfs_copy_size"
7653 #: ../src/guestfs-actions.pod:1110
7657 " guestfs_copy_size (guestfs_h *g,\n"
7658 " const char *src,\n"
7659 " const char *dest,\n"
7665 #: ../src/guestfs-actions.pod:1116 ../fish/guestfish-actions.pod:759
7667 "This command copies exactly C<size> bytes from one source device or file "
7668 "C<src> to another destination device or file C<dest>."
7672 #: ../src/guestfs-actions.pod:1119 ../fish/guestfish-actions.pod:762
7674 "Note this will fail if the source is too short or if the destination is not "
7679 #: ../src/guestfs-actions.pod:1124 ../src/guestfs-actions.pod:1247 ../src/guestfs-actions.pod:1278 ../src/guestfs-actions.pod:1323 ../src/guestfs-actions.pod:1703 ../src/guestfs-actions.pod:1725 ../src/guestfs-actions.pod:3482 ../src/guestfs-actions.pod:6827 ../src/guestfs-actions.pod:6861 ../src/guestfs-actions.pod:7340 ../src/guestfs-actions.pod:7359
7681 "This long-running command can generate progress notification messages so "
7682 "that the caller can display a progress bar or indicator. To receive these "
7683 "messages, the caller must register a progress event callback. See "
7684 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
7688 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:5387 ../src/guestfs-actions.pod:7068 ../src/guestfs-actions.pod:7088 ../src/guestfs-actions.pod:7174
7689 msgid "(Added in 1.0.87)"
7693 #: ../src/guestfs-actions.pod:1131
7698 #: ../src/guestfs-actions.pod:1133
7702 " guestfs_cp (guestfs_h *g,\n"
7703 " const char *src,\n"
7704 " const char *dest);\n"
7709 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:769
7711 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7712 "destination filename or destination directory."
7716 #: ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1157 ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1417 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:5231
7717 msgid "(Added in 1.0.18)"
7721 #: ../src/guestfs-actions.pod:1145
7722 msgid "guestfs_cp_a"
7726 #: ../src/guestfs-actions.pod:1147
7730 " guestfs_cp_a (guestfs_h *g,\n"
7731 " const char *src,\n"
7732 " const char *dest);\n"
7737 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:776
7739 "This copies a file or directory from C<src> to C<dest> recursively using the "
7744 #: ../src/guestfs-actions.pod:1159
7749 #: ../src/guestfs-actions.pod:1161
7753 " guestfs_dd (guestfs_h *g,\n"
7754 " const char *src,\n"
7755 " const char *dest);\n"
7760 #: ../src/guestfs-actions.pod:1166 ../fish/guestfish-actions.pod:783
7762 "This command copies from one source device or file C<src> to another "
7763 "destination device or file C<dest>. Normally you would use this to copy to "
7764 "or from a device or partition, for example to duplicate a filesystem."
7768 #: ../src/guestfs-actions.pod:1171
7770 "If the destination is a device, it must be as large or larger than the "
7771 "source file or device, otherwise the copy will fail. This command cannot do "
7772 "partial copies (see C<guestfs_copy_size>)."
7776 #: ../src/guestfs-actions.pod:1179
7781 #: ../src/guestfs-actions.pod:1181
7785 " guestfs_df (guestfs_h *g);\n"
7790 #: ../src/guestfs-actions.pod:1184 ../fish/guestfish-actions.pod:796
7791 msgid "This command runs the C<df> command to report disk space used."
7795 #: ../src/guestfs-actions.pod:1186 ../src/guestfs-actions.pod:1203
7797 "This command is mostly useful for interactive sessions. It is I<not> "
7798 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
7803 #: ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:1210 ../src/guestfs-actions.pod:1328 ../src/guestfs-actions.pod:2292 ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:4279 ../src/guestfs-actions.pod:4754 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6589 ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7233
7804 msgid "(Added in 1.0.54)"
7808 #: ../src/guestfs-actions.pod:1195
7809 msgid "guestfs_df_h"
7813 #: ../src/guestfs-actions.pod:1197
7817 " guestfs_df_h (guestfs_h *g);\n"
7822 #: ../src/guestfs-actions.pod:1200 ../fish/guestfish-actions.pod:806
7824 "This command runs the C<df -h> command to report disk space used in "
7825 "human-readable format."
7829 #: ../src/guestfs-actions.pod:1212
7830 msgid "guestfs_dmesg"
7834 #: ../src/guestfs-actions.pod:1214
7838 " guestfs_dmesg (guestfs_h *g);\n"
7843 #: ../src/guestfs-actions.pod:1217 ../fish/guestfish-actions.pod:817
7845 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7846 "This is sometimes useful for extended debugging of problems."
7850 #: ../src/guestfs-actions.pod:1221
7852 "Another way to get the same information is to enable verbose messages with "
7853 "C<guestfs_set_verbose> or by setting the environment variable "
7854 "C<LIBGUESTFS_DEBUG=1> before running the program."
7858 #: ../src/guestfs-actions.pod:1231
7859 msgid "guestfs_download"
7863 #: ../src/guestfs-actions.pod:1233
7867 " guestfs_download (guestfs_h *g,\n"
7868 " const char *remotefilename,\n"
7869 " const char *filename);\n"
7874 #: ../src/guestfs-actions.pod:1238 ../src/guestfs-actions.pod:1263 ../fish/guestfish-actions.pod:830 ../fish/guestfish-actions.pod:843
7876 "Download file C<remotefilename> and save it as C<filename> on the local "
7881 #: ../src/guestfs-actions.pod:1241 ../src/guestfs-actions.pod:6821 ../fish/guestfish-actions.pod:833 ../fish/guestfish-actions.pod:4595
7882 msgid "C<filename> can also be a named pipe."
7886 #: ../src/guestfs-actions.pod:1243
7887 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
7891 #: ../src/guestfs-actions.pod:1254
7892 msgid "guestfs_download_offset"
7896 #: ../src/guestfs-actions.pod:1256
7900 " guestfs_download_offset (guestfs_h *g,\n"
7901 " const char *remotefilename,\n"
7902 " const char *filename,\n"
7903 " int64_t offset,\n"
7909 #: ../src/guestfs-actions.pod:1266 ../fish/guestfish-actions.pod:846
7911 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7912 "region must be within the file or device)."
7916 #: ../src/guestfs-actions.pod:1269
7918 "Note that there is no limit on the amount of data that can be downloaded "
7919 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
7920 "full amount unless an error occurs."
7924 #: ../src/guestfs-actions.pod:1274
7925 msgid "See also C<guestfs_download>, C<guestfs_pread>."
7929 #: ../src/guestfs-actions.pod:1283 ../src/guestfs-actions.pod:6866
7930 msgid "(Added in 1.5.17)"
7934 #: ../src/guestfs-actions.pod:1285
7935 msgid "guestfs_drop_caches"
7939 #: ../src/guestfs-actions.pod:1287
7943 " guestfs_drop_caches (guestfs_h *g,\n"
7944 " int whattodrop);\n"
7949 #: ../src/guestfs-actions.pod:1291 ../fish/guestfish-actions.pod:862
7951 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7952 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7953 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7957 #: ../src/guestfs-actions.pod:1296 ../fish/guestfish-actions.pod:867
7958 msgid "Setting C<whattodrop> to 3 should drop everything."
7962 #: ../src/guestfs-actions.pod:1298 ../fish/guestfish-actions.pod:869
7964 "This automatically calls L<sync(2)> before the operation, so that the "
7965 "maximum guest memory is freed."
7969 #: ../src/guestfs-actions.pod:1305
7974 #: ../src/guestfs-actions.pod:1307
7978 " guestfs_du (guestfs_h *g,\n"
7979 " const char *path);\n"
7984 #: ../src/guestfs-actions.pod:1311 ../fish/guestfish-actions.pod:876
7986 "This command runs the C<du -s> command to estimate file space usage for "
7991 #: ../src/guestfs-actions.pod:1314 ../fish/guestfish-actions.pod:879
7993 "C<path> can be a file or a directory. If C<path> is a directory then the "
7994 "estimate includes the contents of the directory and all subdirectories "
7999 #: ../src/guestfs-actions.pod:1318 ../fish/guestfish-actions.pod:883
8000 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8004 #: ../src/guestfs-actions.pod:1330
8005 msgid "guestfs_e2fsck_f"
8009 #: ../src/guestfs-actions.pod:1332
8013 " guestfs_e2fsck_f (guestfs_h *g,\n"
8014 " const char *device);\n"
8019 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:890
8021 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8022 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
8027 #: ../src/guestfs-actions.pod:1340
8029 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
8030 "Normally you should use C<guestfs_fsck>."
8034 #: ../src/guestfs-actions.pod:1345
8035 msgid "(Added in 1.0.29)"
8039 #: ../src/guestfs-actions.pod:1347
8040 msgid "guestfs_echo_daemon"
8044 #: ../src/guestfs-actions.pod:1349
8048 " guestfs_echo_daemon (guestfs_h *g,\n"
8049 " char *const *words);\n"
8054 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:901
8056 "This command concatenates the list of C<words> passed with single spaces "
8057 "between them and returns the resulting string."
8061 #: ../src/guestfs-actions.pod:1356 ../fish/guestfish-actions.pod:904
8062 msgid "You can use this command to test the connection through to the daemon."
8066 #: ../src/guestfs-actions.pod:1358
8067 msgid "See also C<guestfs_ping_daemon>."
8071 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:2100 ../src/guestfs-actions.pod:6065
8072 msgid "(Added in 1.0.69)"
8076 #: ../src/guestfs-actions.pod:1365
8077 msgid "guestfs_egrep"
8081 #: ../src/guestfs-actions.pod:1367
8085 " guestfs_egrep (guestfs_h *g,\n"
8086 " const char *regex,\n"
8087 " const char *path);\n"
8092 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:912
8093 msgid "This calls the external C<egrep> program and returns the matching lines."
8097 #: ../src/guestfs-actions.pod:1382 ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:1523 ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2249 ../src/guestfs-actions.pod:2405 ../src/guestfs-actions.pod:2418 ../src/guestfs-actions.pod:2433 ../src/guestfs-actions.pod:2479 ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:2514 ../src/guestfs-actions.pod:3662 ../src/guestfs-actions.pod:3676 ../src/guestfs-actions.pod:3689 ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:4689 ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:6433 ../src/guestfs-actions.pod:6445 ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6471 ../src/guestfs-actions.pod:6493 ../src/guestfs-actions.pod:6506 ../src/guestfs-actions.pod:6519 ../src/guestfs-actions.pod:6532 ../src/guestfs-actions.pod:7303 ../src/guestfs-actions.pod:7322 ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7426 ../src/guestfs-actions.pod:7472 ../src/guestfs-actions.pod:7491
8098 msgid "(Added in 1.0.66)"
8102 #: ../src/guestfs-actions.pod:1384
8103 msgid "guestfs_egrepi"
8107 #: ../src/guestfs-actions.pod:1386
8111 " guestfs_egrepi (guestfs_h *g,\n"
8112 " const char *regex,\n"
8113 " const char *path);\n"
8118 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:922
8119 msgid "This calls the external C<egrep -i> program and returns the matching lines."
8123 #: ../src/guestfs-actions.pod:1403
8124 msgid "guestfs_equal"
8128 #: ../src/guestfs-actions.pod:1405
8132 " guestfs_equal (guestfs_h *g,\n"
8133 " const char *file1,\n"
8134 " const char *file2);\n"
8139 #: ../src/guestfs-actions.pod:1410 ../fish/guestfish-actions.pod:932
8141 "This compares the two files C<file1> and C<file2> and returns true if their "
8142 "content is exactly equal, or false otherwise."
8146 #: ../src/guestfs-actions.pod:1413 ../fish/guestfish-actions.pod:935
8147 msgid "The external L<cmp(1)> program is used for the comparison."
8151 #: ../src/guestfs-actions.pod:1419
8152 msgid "guestfs_exists"
8156 #: ../src/guestfs-actions.pod:1421
8160 " guestfs_exists (guestfs_h *g,\n"
8161 " const char *path);\n"
8166 #: ../src/guestfs-actions.pod:1425 ../fish/guestfish-actions.pod:941
8168 "This returns C<true> if and only if there is a file, directory (or anything) "
8169 "with the given C<path> name."
8173 #: ../src/guestfs-actions.pod:1428
8174 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
8178 #: ../src/guestfs-actions.pod:1434
8179 msgid "guestfs_fallocate"
8183 #: ../src/guestfs-actions.pod:1436
8187 " guestfs_fallocate (guestfs_h *g,\n"
8188 " const char *path,\n"
8194 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1467 ../fish/guestfish-actions.pod:950 ../fish/guestfish-actions.pod:969
8196 "This command preallocates a file (containing zero bytes) named C<path> of "
8197 "size C<len> bytes. If the file exists already, it is overwritten."
8201 #: ../src/guestfs-actions.pod:1445 ../fish/guestfish-actions.pod:954
8203 "Do not confuse this with the guestfish-specific C<alloc> command which "
8204 "allocates a file in the host and attaches it as a device."
8208 #: ../src/guestfs-actions.pod:1451 ../fish/guestfish-actions.pod:958
8210 "This function is deprecated. In new code, use the C<fallocate64> call "
8215 #: ../src/guestfs-actions.pod:1460
8216 msgid "guestfs_fallocate64"
8220 #: ../src/guestfs-actions.pod:1462
8224 " guestfs_fallocate64 (guestfs_h *g,\n"
8225 " const char *path,\n"
8231 #: ../src/guestfs-actions.pod:1471
8233 "Note that this call allocates disk blocks for the file. To create a sparse "
8234 "file use C<guestfs_truncate_size> instead."
8238 #: ../src/guestfs-actions.pod:1474
8240 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
8241 "oversight it only allowed 30 bit lengths to be specified, effectively "
8242 "limiting the maximum size of files created through that call to 1GB."
8246 #: ../src/guestfs-actions.pod:1479 ../fish/guestfish-actions.pod:981
8248 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8249 "commands which create a file in the host and attach it as a device."
8253 #: ../src/guestfs-actions.pod:1485
8254 msgid "(Added in 1.3.17)"
8258 #: ../src/guestfs-actions.pod:1487
8259 msgid "guestfs_fgrep"
8263 #: ../src/guestfs-actions.pod:1489
8267 " guestfs_fgrep (guestfs_h *g,\n"
8268 " const char *pattern,\n"
8269 " const char *path);\n"
8274 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:989
8275 msgid "This calls the external C<fgrep> program and returns the matching lines."
8279 #: ../src/guestfs-actions.pod:1506
8280 msgid "guestfs_fgrepi"
8284 #: ../src/guestfs-actions.pod:1508
8288 " guestfs_fgrepi (guestfs_h *g,\n"
8289 " const char *pattern,\n"
8290 " const char *path);\n"
8295 #: ../src/guestfs-actions.pod:1513 ../fish/guestfish-actions.pod:999
8296 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
8300 #: ../src/guestfs-actions.pod:1525
8301 msgid "guestfs_file"
8305 #: ../src/guestfs-actions.pod:1527
8309 " guestfs_file (guestfs_h *g,\n"
8310 " const char *path);\n"
8315 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1009
8317 "This call uses the standard L<file(1)> command to determine the type or "
8318 "contents of the file."
8322 #: ../src/guestfs-actions.pod:1534 ../fish/guestfish-actions.pod:1012
8324 "This call will also transparently look inside various types of compressed "
8329 #: ../src/guestfs-actions.pod:1537 ../fish/guestfish-actions.pod:1015
8331 "The exact command which runs is C<file -zb path>. Note in particular that "
8332 "the filename is not prepended to the output (the I<-b> option)."
8336 #: ../src/guestfs-actions.pod:1541
8338 "This command can also be used on C</dev/> devices (and partitions, LV "
8339 "names). You can for example use this to determine if a device contains a "
8340 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
8344 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1024
8346 "If the C<path> does not begin with C</dev/> then this command only works for "
8347 "the content of regular files. For other file types (directory, symbolic "
8348 "link etc) it will just return the string C<directory> etc."
8352 #: ../src/guestfs-actions.pod:1556
8353 msgid "guestfs_file_architecture"
8357 #: ../src/guestfs-actions.pod:1558
8361 " guestfs_file_architecture (guestfs_h *g,\n"
8362 " const char *filename);\n"
8367 #: ../src/guestfs-actions.pod:1562 ../fish/guestfish-actions.pod:1033
8369 "This detects the architecture of the binary C<filename>, and returns it if "
8374 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1036
8375 msgid "Currently defined architectures are:"
8379 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1040
8384 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1042
8386 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8387 "irrespective of the precise processor requirements of the binary."
8391 #: ../src/guestfs-actions.pod:1574 ../fish/guestfish-actions.pod:1045
8396 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1047
8397 msgid "64 bit x86-64."
8401 #: ../src/guestfs-actions.pod:1578 ../fish/guestfish-actions.pod:1049
8406 #: ../src/guestfs-actions.pod:1580 ../fish/guestfish-actions.pod:1051
8407 msgid "32 bit SPARC."
8411 #: ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:1053
8416 #: ../src/guestfs-actions.pod:1584 ../fish/guestfish-actions.pod:1055
8417 msgid "64 bit SPARC V9 and above."
8421 #: ../src/guestfs-actions.pod:1586 ../fish/guestfish-actions.pod:1057
8426 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1059
8427 msgid "Intel Itanium."
8431 #: ../src/guestfs-actions.pod:1590 ../fish/guestfish-actions.pod:1061
8436 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1063
8437 msgid "32 bit Power PC."
8441 #: ../src/guestfs-actions.pod:1594 ../fish/guestfish-actions.pod:1065
8446 #: ../src/guestfs-actions.pod:1596 ../fish/guestfish-actions.pod:1067
8447 msgid "64 bit Power PC."
8451 #: ../src/guestfs-actions.pod:1600 ../fish/guestfish-actions.pod:1071
8452 msgid "Libguestfs may return other architecture strings in future."
8456 #: ../src/guestfs-actions.pod:1602 ../fish/guestfish-actions.pod:1073
8457 msgid "The function works on at least the following types of files:"
8461 #: ../src/guestfs-actions.pod:1608 ../fish/guestfish-actions.pod:1079
8462 msgid "many types of Un*x and Linux binary"
8466 #: ../src/guestfs-actions.pod:1612 ../fish/guestfish-actions.pod:1083
8467 msgid "many types of Un*x and Linux shared library"
8471 #: ../src/guestfs-actions.pod:1616 ../fish/guestfish-actions.pod:1087
8472 msgid "Windows Win32 and Win64 binaries"
8476 #: ../src/guestfs-actions.pod:1620 ../fish/guestfish-actions.pod:1091
8477 msgid "Windows Win32 and Win64 DLLs"
8481 #: ../src/guestfs-actions.pod:1622 ../fish/guestfish-actions.pod:1093
8482 msgid "Win32 binaries and DLLs return C<i386>."
8486 #: ../src/guestfs-actions.pod:1624 ../fish/guestfish-actions.pod:1095
8487 msgid "Win64 binaries and DLLs return C<x86_64>."
8491 #: ../src/guestfs-actions.pod:1628 ../fish/guestfish-actions.pod:1099
8492 msgid "Linux kernel modules"
8496 #: ../src/guestfs-actions.pod:1632 ../fish/guestfish-actions.pod:1103
8497 msgid "Linux new-style initrd images"
8501 #: ../src/guestfs-actions.pod:1636 ../fish/guestfish-actions.pod:1107
8502 msgid "some non-x86 Linux vmlinuz kernels"
8506 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1111
8507 msgid "What it can't do currently:"
8511 #: ../src/guestfs-actions.pod:1646 ../fish/guestfish-actions.pod:1117
8512 msgid "static libraries (libfoo.a)"
8516 #: ../src/guestfs-actions.pod:1650 ../fish/guestfish-actions.pod:1121
8517 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8521 #: ../src/guestfs-actions.pod:1654 ../fish/guestfish-actions.pod:1125
8522 msgid "x86 Linux vmlinuz kernels"
8526 #: ../src/guestfs-actions.pod:1656 ../fish/guestfish-actions.pod:1127
8528 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8529 "compressed code, and are horribly hard to unpack. If you want to find the "
8530 "architecture of a kernel, use the architecture of the associated initrd or "
8531 "kernel module(s) instead."
8535 #: ../src/guestfs-actions.pod:1666 ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2700 ../src/guestfs-actions.pod:2788 ../src/guestfs-actions.pod:2809 ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:3280 ../src/guestfs-actions.pod:3412
8536 msgid "(Added in 1.5.3)"
8540 #: ../src/guestfs-actions.pod:1668
8541 msgid "guestfs_filesize"
8545 #: ../src/guestfs-actions.pod:1670
8549 " guestfs_filesize (guestfs_h *g,\n"
8550 " const char *file);\n"
8555 #: ../src/guestfs-actions.pod:1674 ../fish/guestfish-actions.pod:1138
8556 msgid "This command returns the size of C<file> in bytes."
8560 #: ../src/guestfs-actions.pod:1676
8562 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
8563 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
8564 "devices, use C<guestfs_blockdev_getsize64>."
8568 #: ../src/guestfs-actions.pod:1682
8569 msgid "(Added in 1.0.82)"
8573 #: ../src/guestfs-actions.pod:1684
8574 msgid "guestfs_fill"
8578 #: ../src/guestfs-actions.pod:1686
8582 " guestfs_fill (guestfs_h *g,\n"
8585 " const char *path);\n"
8590 #: ../src/guestfs-actions.pod:1692 ../fish/guestfish-actions.pod:1148
8592 "This command creates a new file called C<path>. The initial content of the "
8593 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
8598 #: ../src/guestfs-actions.pod:1696
8600 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8601 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
8602 "bytes use C<guestfs_fill_pattern>."
8606 #: ../src/guestfs-actions.pod:1708
8607 msgid "(Added in 1.0.79)"
8611 #: ../src/guestfs-actions.pod:1710
8612 msgid "guestfs_fill_pattern"
8616 #: ../src/guestfs-actions.pod:1712
8620 " guestfs_fill_pattern (guestfs_h *g,\n"
8621 " const char *pattern,\n"
8623 " const char *path);\n"
8628 #: ../src/guestfs-actions.pod:1718
8630 "This function is like C<guestfs_fill> except that it creates a new file of "
8631 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
8632 "pattern is truncated if necessary to ensure the length of the file is "
8633 "exactly C<len> bytes."
8637 #: ../src/guestfs-actions.pod:1730
8638 msgid "(Added in 1.3.12)"
8642 #: ../src/guestfs-actions.pod:1732
8643 msgid "guestfs_find"
8647 #: ../src/guestfs-actions.pod:1734
8651 " guestfs_find (guestfs_h *g,\n"
8652 " const char *directory);\n"
8657 #: ../src/guestfs-actions.pod:1738 ../fish/guestfish-actions.pod:1170
8659 "This command lists out all files and directories, recursively, starting at "
8660 "C<directory>. It is essentially equivalent to running the shell command "
8661 "C<find directory -print> but some post-processing happens on the output, "
8666 #: ../src/guestfs-actions.pod:1743 ../fish/guestfish-actions.pod:1175
8668 "This returns a list of strings I<without any prefix>. Thus if the directory "
8673 #: ../src/guestfs-actions.pod:1746 ../fish/guestfish-actions.pod:1178
8683 #: ../src/guestfs-actions.pod:1750
8684 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
8688 #: ../src/guestfs-actions.pod:1753 ../fish/guestfish-actions.pod:1185
8699 #: ../src/guestfs-actions.pod:1758 ../fish/guestfish-actions.pod:1190
8700 msgid "If C<directory> is not a directory, then this command returns an error."
8704 #: ../src/guestfs-actions.pod:1761 ../fish/guestfish-actions.pod:1193
8705 msgid "The returned list is sorted."
8709 #: ../src/guestfs-actions.pod:1763
8710 msgid "See also C<guestfs_find0>."
8714 #: ../src/guestfs-actions.pod:1772 ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:5649
8715 msgid "(Added in 1.0.27)"
8719 #: ../src/guestfs-actions.pod:1774
8720 msgid "guestfs_find0"
8724 #: ../src/guestfs-actions.pod:1776
8728 " guestfs_find0 (guestfs_h *g,\n"
8729 " const char *directory,\n"
8730 " const char *files);\n"
8735 #: ../src/guestfs-actions.pod:1781 ../fish/guestfish-actions.pod:1204
8737 "This command lists out all files and directories, recursively, starting at "
8738 "C<directory>, placing the resulting list in the external file called "
8743 #: ../src/guestfs-actions.pod:1785
8745 "This command works the same way as C<guestfs_find> with the following "
8750 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1215
8751 msgid "The resulting list is written to an external file."
8755 #: ../src/guestfs-actions.pod:1796 ../fish/guestfish-actions.pod:1219
8757 "Items (filenames) in the result are separated by C<\\0> characters. See "
8758 "L<find(1)> option I<-print0>."
8762 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1224
8763 msgid "This command is not limited in the number of names that it can return."
8767 #: ../src/guestfs-actions.pod:1806 ../fish/guestfish-actions.pod:1229
8768 msgid "The result list is not sorted."
8772 #: ../src/guestfs-actions.pod:1812
8773 msgid "(Added in 1.0.74)"
8777 #: ../src/guestfs-actions.pod:1814
8778 msgid "guestfs_findfs_label"
8782 #: ../src/guestfs-actions.pod:1816
8786 " guestfs_findfs_label (guestfs_h *g,\n"
8787 " const char *label);\n"
8792 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
8794 "This command searches the filesystems and returns the one which has the "
8795 "given label. An error is returned if no such filesystem can be found."
8799 #: ../src/guestfs-actions.pod:1824
8800 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
8804 #: ../src/guestfs-actions.pod:1831
8805 msgid "guestfs_findfs_uuid"
8809 #: ../src/guestfs-actions.pod:1833
8813 " guestfs_findfs_uuid (guestfs_h *g,\n"
8814 " const char *uuid);\n"
8819 #: ../src/guestfs-actions.pod:1837 ../fish/guestfish-actions.pod:1249
8821 "This command searches the filesystems and returns the one which has the "
8822 "given UUID. An error is returned if no such filesystem can be found."
8826 #: ../src/guestfs-actions.pod:1841
8827 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
8831 #: ../src/guestfs-actions.pod:1848
8832 msgid "guestfs_fsck"
8836 #: ../src/guestfs-actions.pod:1850
8840 " guestfs_fsck (guestfs_h *g,\n"
8841 " const char *fstype,\n"
8842 " const char *device);\n"
8847 #: ../src/guestfs-actions.pod:1855 ../fish/guestfish-actions.pod:1259
8849 "This runs the filesystem checker (fsck) on C<device> which should have "
8850 "filesystem type C<fstype>."
8854 #: ../src/guestfs-actions.pod:1858 ../fish/guestfish-actions.pod:1262
8856 "The returned integer is the status. See L<fsck(8)> for the list of status "
8857 "codes from C<fsck>."
8861 #: ../src/guestfs-actions.pod:1867 ../fish/guestfish-actions.pod:1271
8862 msgid "Multiple status codes can be summed together."
8866 #: ../src/guestfs-actions.pod:1871 ../fish/guestfish-actions.pod:1275
8868 "A non-zero return code can mean \"success\", for example if errors have been "
8869 "corrected on the filesystem."
8873 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1280
8874 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8878 #: ../src/guestfs-actions.pod:1881 ../fish/guestfish-actions.pod:1285
8879 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8883 #: ../src/guestfs-actions.pod:1885 ../src/guestfs-actions.pod:7345
8884 msgid "(Added in 1.0.16)"
8888 #: ../src/guestfs-actions.pod:1887
8889 msgid "guestfs_get_append"
8893 #: ../src/guestfs-actions.pod:1889
8897 " guestfs_get_append (guestfs_h *g);\n"
8902 #: ../src/guestfs-actions.pod:1892 ../fish/guestfish-actions.pod:1291
8904 "Return the additional kernel options which are added to the guest kernel "
8909 #: ../src/guestfs-actions.pod:1895 ../fish/guestfish-actions.pod:1294
8910 msgid "If C<NULL> then no options are added."
8914 #: ../src/guestfs-actions.pod:1897
8916 "This function returns a string which may be NULL. There is no way to return "
8917 "an error from this function. The string is owned by the guest handle and "
8918 "must I<not> be freed."
8922 #: ../src/guestfs-actions.pod:1901 ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:6207 ../src/guestfs-actions.pod:6226 ../src/guestfs-actions.pod:6242 ../src/guestfs-actions.pod:6259 ../src/guestfs-actions.pod:7016 ../src/guestfs-actions.pod:7034 ../src/guestfs-actions.pod:7388
8923 msgid "(Added in 1.0.26)"
8927 #: ../src/guestfs-actions.pod:1903
8928 msgid "guestfs_get_attach_method"
8932 #: ../src/guestfs-actions.pod:1905
8936 " guestfs_get_attach_method (guestfs_h *g);\n"
8941 #: ../src/guestfs-actions.pod:1908
8942 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
8946 #: ../src/guestfs-actions.pod:1913
8947 msgid "guestfs_get_autosync"
8951 #: ../src/guestfs-actions.pod:1915
8955 " guestfs_get_autosync (guestfs_h *g);\n"
8960 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1306
8961 msgid "Get the autosync flag."
8965 #: ../src/guestfs-actions.pod:1924
8966 msgid "guestfs_get_direct"
8970 #: ../src/guestfs-actions.pod:1926
8974 " guestfs_get_direct (guestfs_h *g);\n"
8979 #: ../src/guestfs-actions.pod:1929 ../fish/guestfish-actions.pod:1312
8980 msgid "Return the direct appliance mode flag."
8984 #: ../src/guestfs-actions.pod:1933 ../src/guestfs-actions.pod:5876
8985 msgid "(Added in 1.0.72)"
8989 #: ../src/guestfs-actions.pod:1935
8990 msgid "guestfs_get_e2label"
8994 #: ../src/guestfs-actions.pod:1937
8998 " guestfs_get_e2label (guestfs_h *g,\n"
8999 " const char *device);\n"
9004 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1318
9005 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9009 #: ../src/guestfs-actions.pod:1947 ../fish/guestfish-actions.pod:1321
9011 "This function is deprecated. In new code, use the C<vfs_label> call "
9016 #: ../src/guestfs-actions.pod:1954 ../src/guestfs-actions.pod:1975 ../src/guestfs-actions.pod:5894 ../src/guestfs-actions.pod:5913
9017 msgid "(Added in 1.0.15)"
9021 #: ../src/guestfs-actions.pod:1956
9022 msgid "guestfs_get_e2uuid"
9026 #: ../src/guestfs-actions.pod:1958
9030 " guestfs_get_e2uuid (guestfs_h *g,\n"
9031 " const char *device);\n"
9036 #: ../src/guestfs-actions.pod:1962 ../fish/guestfish-actions.pod:1332
9037 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9041 #: ../src/guestfs-actions.pod:1968 ../fish/guestfish-actions.pod:1335
9042 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
9046 #: ../src/guestfs-actions.pod:1977
9047 msgid "guestfs_get_memsize"
9051 #: ../src/guestfs-actions.pod:1979
9055 " guestfs_get_memsize (guestfs_h *g);\n"
9060 #: ../src/guestfs-actions.pod:1982 ../fish/guestfish-actions.pod:1346
9061 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
9065 #: ../src/guestfs-actions.pod:1985
9067 "If C<guestfs_set_memsize> was not called on this handle, and if "
9068 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9069 "value for memsize."
9073 #: ../src/guestfs-actions.pod:1989 ../src/guestfs-actions.pod:2070 ../src/guestfs-actions.pod:5929 ../src/guestfs-actions.pod:6036 ../fish/guestfish-actions.pod:1353 ../fish/guestfish-actions.pod:1404 ../fish/guestfish-actions.pod:3998 ../fish/guestfish-actions.pod:4085
9074 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9078 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:4397 ../src/guestfs-actions.pod:4594 ../src/guestfs-actions.pod:4613 ../src/guestfs-actions.pod:4632 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:4661 ../src/guestfs-actions.pod:4674 ../src/guestfs-actions.pod:5552 ../src/guestfs-actions.pod:5934 ../src/guestfs-actions.pod:6181 ../src/guestfs-actions.pod:6782
9079 msgid "(Added in 1.0.55)"
9083 #: ../src/guestfs-actions.pod:1996
9084 msgid "guestfs_get_network"
9088 #: ../src/guestfs-actions.pod:1998
9092 " guestfs_get_network (guestfs_h *g);\n"
9097 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1360
9098 msgid "This returns the enable network flag."
9102 #: ../src/guestfs-actions.pod:2005 ../src/guestfs-actions.pod:5953
9103 msgid "(Added in 1.5.4)"
9107 #: ../src/guestfs-actions.pod:2007
9108 msgid "guestfs_get_path"
9112 #: ../src/guestfs-actions.pod:2009
9116 " guestfs_get_path (guestfs_h *g);\n"
9121 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1366
9122 msgid "Return the current search path."
9126 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1368
9128 "This is always non-NULL. If it wasn't set already, then this will return "
9133 #: ../src/guestfs-actions.pod:2017 ../src/guestfs-actions.pod:2046
9135 "This function returns a string, or NULL on error. The string is owned by "
9136 "the guest handle and must I<not> be freed."
9140 #: ../src/guestfs-actions.pod:2022
9141 msgid "guestfs_get_pid"
9145 #: ../src/guestfs-actions.pod:2024
9149 " guestfs_get_pid (guestfs_h *g);\n"
9154 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1377
9156 "Return the process ID of the qemu subprocess. If there is no qemu "
9157 "subprocess, then this will return an error."
9161 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1380
9162 msgid "This is an internal call used for debugging and testing."
9166 #: ../src/guestfs-actions.pod:2034
9167 msgid "(Added in 1.0.56)"
9171 #: ../src/guestfs-actions.pod:2036
9172 msgid "guestfs_get_qemu"
9176 #: ../src/guestfs-actions.pod:2038
9180 " guestfs_get_qemu (guestfs_h *g);\n"
9185 #: ../src/guestfs-actions.pod:2041 ../fish/guestfish-actions.pod:1386
9186 msgid "Return the current qemu binary."
9190 #: ../src/guestfs-actions.pod:2043 ../fish/guestfish-actions.pod:1388
9192 "This is always non-NULL. If it wasn't set already, then this will return "
9193 "the default qemu binary name."
9197 #: ../src/guestfs-actions.pod:2049 ../src/guestfs-actions.pod:5998
9198 msgid "(Added in 1.0.6)"
9202 #: ../src/guestfs-actions.pod:2051
9203 msgid "guestfs_get_recovery_proc"
9207 #: ../src/guestfs-actions.pod:2053
9211 " guestfs_get_recovery_proc (guestfs_h *g);\n"
9216 #: ../src/guestfs-actions.pod:2056 ../fish/guestfish-actions.pod:1395
9217 msgid "Return the recovery process enabled flag."
9221 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:3507 ../src/guestfs-actions.pod:3804 ../src/guestfs-actions.pod:4204 ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5600 ../src/guestfs-actions.pod:6022 ../src/guestfs-actions.pod:6685 ../src/guestfs-actions.pod:6705 ../src/guestfs-actions.pod:6897
9222 msgid "(Added in 1.0.77)"
9226 #: ../src/guestfs-actions.pod:2062
9227 msgid "guestfs_get_selinux"
9231 #: ../src/guestfs-actions.pod:2064
9235 " guestfs_get_selinux (guestfs_h *g);\n"
9240 #: ../src/guestfs-actions.pod:2067
9242 "This returns the current setting of the selinux flag which is passed to the "
9243 "appliance at boot time. See C<guestfs_set_selinux>."
9247 #: ../src/guestfs-actions.pod:2075 ../src/guestfs-actions.pod:2138 ../src/guestfs-actions.pod:6041 ../src/guestfs-actions.pod:6099
9248 msgid "(Added in 1.0.67)"
9252 #: ../src/guestfs-actions.pod:2077
9253 msgid "guestfs_get_state"
9257 #: ../src/guestfs-actions.pod:2079
9261 " guestfs_get_state (guestfs_h *g);\n"
9266 #: ../src/guestfs-actions.pod:2082 ../fish/guestfish-actions.pod:1411
9268 "This returns the current state as an opaque integer. This is only useful "
9269 "for printing debug and internal error messages."
9273 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:3334 ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3422 ../fish/guestfish-actions.pod:1414 ../fish/guestfish-actions.pod:2328 ../fish/guestfish-actions.pod:2346 ../fish/guestfish-actions.pod:2384 ../fish/guestfish-actions.pod:2400
9274 msgid "For more information on states, see L<guestfs(3)>."
9278 #: ../src/guestfs-actions.pod:2091
9279 msgid "guestfs_get_trace"
9283 #: ../src/guestfs-actions.pod:2093
9287 " guestfs_get_trace (guestfs_h *g);\n"
9292 #: ../src/guestfs-actions.pod:2096 ../fish/guestfish-actions.pod:1420
9293 msgid "Return the command trace flag."
9297 #: ../src/guestfs-actions.pod:2102
9298 msgid "guestfs_get_umask"
9302 #: ../src/guestfs-actions.pod:2104
9306 " guestfs_get_umask (guestfs_h *g);\n"
9311 #: ../src/guestfs-actions.pod:2107
9313 "Return the current umask. By default the umask is C<022> unless it has been "
9314 "set by calling C<guestfs_umask>."
9318 #: ../src/guestfs-actions.pod:2114
9319 msgid "guestfs_get_verbose"
9323 #: ../src/guestfs-actions.pod:2116
9327 " guestfs_get_verbose (guestfs_h *g);\n"
9332 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1433
9333 msgid "This returns the verbose messages flag."
9337 #: ../src/guestfs-actions.pod:2125
9338 msgid "guestfs_getcon"
9342 #: ../src/guestfs-actions.pod:2127
9346 " guestfs_getcon (guestfs_h *g);\n"
9351 #: ../src/guestfs-actions.pod:2130 ../fish/guestfish-actions.pod:1439
9352 msgid "This gets the SELinux security context of the daemon."
9356 #: ../src/guestfs-actions.pod:2132
9357 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
9361 #: ../src/guestfs-actions.pod:2140
9362 msgid "guestfs_getxattr"
9366 #: ../src/guestfs-actions.pod:2142
9370 " guestfs_getxattr (guestfs_h *g,\n"
9371 " const char *path,\n"
9372 " const char *name,\n"
9373 " size_t *size_r);\n"
9378 #: ../src/guestfs-actions.pod:2148
9380 "Get a single extended attribute from file C<path> named C<name>. This call "
9381 "follows symlinks. If you want to lookup an extended attribute for the "
9382 "symlink itself, use C<guestfs_lgetxattr>."
9386 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:3521
9388 "Normally it is better to get all extended attributes from a file in one go "
9389 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
9390 "implementations are buggy and do not provide a way to list out attributes. "
9391 "For these filesystems (notably ntfs-3g) you have to know the names of the "
9392 "extended attributes you want in advance and call this function."
9396 #: ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3528 ../fish/guestfish-actions.pod:1459 ../fish/guestfish-actions.pod:2465
9398 "Extended attribute values are blobs of binary data. If there is no extended "
9399 "attribute named C<name>, this returns an error."
9403 #: ../src/guestfs-actions.pod:2162
9404 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
9408 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3533 ../src/guestfs-actions.pod:5250 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5457
9410 "This function returns a buffer, or NULL on error. The size of the returned "
9411 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
9416 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:3537
9417 msgid "(Added in 1.7.24)"
9421 #: ../src/guestfs-actions.pod:2170
9422 msgid "guestfs_getxattrs"
9426 #: ../src/guestfs-actions.pod:2172
9429 " struct guestfs_xattr_list *\n"
9430 " guestfs_getxattrs (guestfs_h *g,\n"
9431 " const char *path);\n"
9436 #: ../src/guestfs-actions.pod:2176 ../fish/guestfish-actions.pod:1468
9437 msgid "This call lists the extended attributes of the file or directory C<path>."
9441 #: ../src/guestfs-actions.pod:2179 ../fish/guestfish-actions.pod:1471
9443 "At the system call level, this is a combination of the L<listxattr(2)> and "
9444 "L<getxattr(2)> calls."
9448 #: ../src/guestfs-actions.pod:2182
9449 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
9453 #: ../src/guestfs-actions.pod:2184 ../src/guestfs-actions.pod:3549 ../src/guestfs-actions.pod:4200
9455 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
9456 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
9460 #: ../src/guestfs-actions.pod:2188 ../src/guestfs-actions.pod:3553 ../src/guestfs-actions.pod:3718 ../src/guestfs-actions.pod:3754 ../src/guestfs-actions.pod:5630 ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:7453
9461 msgid "(Added in 1.0.59)"
9465 #: ../src/guestfs-actions.pod:2190
9466 msgid "guestfs_glob_expand"
9470 #: ../src/guestfs-actions.pod:2192
9474 " guestfs_glob_expand (guestfs_h *g,\n"
9475 " const char *pattern);\n"
9480 #: ../src/guestfs-actions.pod:2196 ../fish/guestfish-actions.pod:1480
9482 "This command searches for all the pathnames matching C<pattern> according to "
9483 "the wildcard expansion rules used by the shell."
9487 #: ../src/guestfs-actions.pod:2200 ../fish/guestfish-actions.pod:1484
9488 msgid "If no paths match, then this returns an empty list (note: not an error)."
9492 #: ../src/guestfs-actions.pod:2203 ../fish/guestfish-actions.pod:1487
9494 "It is just a wrapper around the C L<glob(3)> function with flags "
9495 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
9499 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:6283 ../src/guestfs-actions.pod:6300
9500 msgid "(Added in 1.0.50)"
9504 #: ../src/guestfs-actions.pod:2213
9505 msgid "guestfs_grep"
9509 #: ../src/guestfs-actions.pod:2215
9513 " guestfs_grep (guestfs_h *g,\n"
9514 " const char *regex,\n"
9515 " const char *path);\n"
9520 #: ../src/guestfs-actions.pod:2220 ../fish/guestfish-actions.pod:1495
9521 msgid "This calls the external C<grep> program and returns the matching lines."
9525 #: ../src/guestfs-actions.pod:2232
9526 msgid "guestfs_grepi"
9530 #: ../src/guestfs-actions.pod:2234
9534 " guestfs_grepi (guestfs_h *g,\n"
9535 " const char *regex,\n"
9536 " const char *path);\n"
9541 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1505
9542 msgid "This calls the external C<grep -i> program and returns the matching lines."
9546 #: ../src/guestfs-actions.pod:2251
9547 msgid "guestfs_grub_install"
9551 #: ../src/guestfs-actions.pod:2253
9555 " guestfs_grub_install (guestfs_h *g,\n"
9556 " const char *root,\n"
9557 " const char *device);\n"
9562 #: ../src/guestfs-actions.pod:2258 ../fish/guestfish-actions.pod:1515
9564 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
9565 "the root directory being C<root>."
9569 #: ../src/guestfs-actions.pod:2261 ../fish/guestfish-actions.pod:1518
9571 "Note: If grub-install reports the error \"No suitable drive was found in the "
9572 "generated device map.\" it may be that you need to create a "
9573 "C</boot/grub/device.map> file first that contains the mapping between grub "
9574 "device names and Linux device names. It is usually sufficient to create a "
9579 #: ../src/guestfs-actions.pod:2268 ../fish/guestfish-actions.pod:1525
9587 #: ../src/guestfs-actions.pod:2270 ../fish/guestfish-actions.pod:1527
9588 msgid "replacing C</dev/vda> with the name of the installation device."
9592 #: ../src/guestfs-actions.pod:2274
9593 msgid "(Added in 1.0.17)"
9597 #: ../src/guestfs-actions.pod:2276
9598 msgid "guestfs_head"
9602 #: ../src/guestfs-actions.pod:2278
9606 " guestfs_head (guestfs_h *g,\n"
9607 " const char *path);\n"
9612 #: ../src/guestfs-actions.pod:2282 ../fish/guestfish-actions.pod:1533
9614 "This command returns up to the first 10 lines of a file as a list of "
9619 #: ../src/guestfs-actions.pod:2294
9620 msgid "guestfs_head_n"
9624 #: ../src/guestfs-actions.pod:2296
9628 " guestfs_head_n (guestfs_h *g,\n"
9630 " const char *path);\n"
9635 #: ../src/guestfs-actions.pod:2301 ../fish/guestfish-actions.pod:1543
9637 "If the parameter C<nrlines> is a positive number, this returns the first "
9638 "C<nrlines> lines of the file C<path>."
9642 #: ../src/guestfs-actions.pod:2304 ../fish/guestfish-actions.pod:1546
9644 "If the parameter C<nrlines> is a negative number, this returns lines from "
9645 "the file C<path>, excluding the last C<nrlines> lines."
9649 #: ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:6580 ../fish/guestfish-actions.pod:1549 ../fish/guestfish-actions.pod:4435
9650 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9654 #: ../src/guestfs-actions.pod:2318
9655 msgid "guestfs_hexdump"
9659 #: ../src/guestfs-actions.pod:2320
9663 " guestfs_hexdump (guestfs_h *g,\n"
9664 " const char *path);\n"
9669 #: ../src/guestfs-actions.pod:2324 ../fish/guestfish-actions.pod:1558
9671 "This runs C<hexdump -C> on the given C<path>. The result is the "
9672 "human-readable, canonical hex dump of the file."
9676 #: ../src/guestfs-actions.pod:2333 ../src/guestfs-actions.pod:6364 ../src/guestfs-actions.pod:6419
9677 msgid "(Added in 1.0.22)"
9681 #: ../src/guestfs-actions.pod:2335
9682 msgid "guestfs_initrd_cat"
9686 #: ../src/guestfs-actions.pod:2337
9690 " guestfs_initrd_cat (guestfs_h *g,\n"
9691 " const char *initrdpath,\n"
9692 " const char *filename,\n"
9693 " size_t *size_r);\n"
9698 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1568
9700 "This command unpacks the file C<filename> from the initrd file called "
9701 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9706 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1572
9708 "For example, in guestfish you could use the following command to examine the "
9709 "boot script (usually called C</init>) contained in a Linux initrd or "
9714 #: ../src/guestfs-actions.pod:2351 ../fish/guestfish-actions.pod:1576
9717 " initrd-cat /boot/initrd-<version>.img init\n"
9722 #: ../src/guestfs-actions.pod:2353
9723 msgid "See also C<guestfs_initrd_list>."
9727 #: ../src/guestfs-actions.pod:2364
9728 msgid "guestfs_initrd_list"
9732 #: ../src/guestfs-actions.pod:2366
9736 " guestfs_initrd_list (guestfs_h *g,\n"
9737 " const char *path);\n"
9742 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1587
9743 msgid "This command lists out files contained in an initrd."
9747 #: ../src/guestfs-actions.pod:2372 ../fish/guestfish-actions.pod:1589
9749 "The files are listed without any initial C</> character. The files are "
9750 "listed in the order they appear (not necessarily alphabetical). Directory "
9751 "names are listed as separate items."
9755 #: ../src/guestfs-actions.pod:2376 ../fish/guestfish-actions.pod:1593
9757 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9758 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9763 #: ../src/guestfs-actions.pod:2386
9764 msgid "guestfs_inotify_add_watch"
9768 #: ../src/guestfs-actions.pod:2388
9772 " guestfs_inotify_add_watch (guestfs_h *g,\n"
9773 " const char *path,\n"
9779 #: ../src/guestfs-actions.pod:2393 ../fish/guestfish-actions.pod:1601
9780 msgid "Watch C<path> for the events listed in C<mask>."
9784 #: ../src/guestfs-actions.pod:2395 ../fish/guestfish-actions.pod:1603
9786 "Note that if C<path> is a directory then events within that directory are "
9787 "watched, but this does I<not> happen recursively (in subdirectories)."
9791 #: ../src/guestfs-actions.pod:2399 ../fish/guestfish-actions.pod:1607
9793 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9794 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9798 #: ../src/guestfs-actions.pod:2407
9799 msgid "guestfs_inotify_close"
9803 #: ../src/guestfs-actions.pod:2409
9807 " guestfs_inotify_close (guestfs_h *g);\n"
9812 #: ../src/guestfs-actions.pod:2412 ../fish/guestfish-actions.pod:1615
9814 "This closes the inotify handle which was previously opened by inotify_init. "
9815 "It removes all watches, throws away any pending events, and deallocates all "
9820 #: ../src/guestfs-actions.pod:2420
9821 msgid "guestfs_inotify_files"
9825 #: ../src/guestfs-actions.pod:2422
9829 " guestfs_inotify_files (guestfs_h *g);\n"
9834 #: ../src/guestfs-actions.pod:2425
9836 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
9837 "returns a list of pathnames of objects that were touched. The returned "
9838 "pathnames are sorted and deduplicated."
9842 #: ../src/guestfs-actions.pod:2435
9843 msgid "guestfs_inotify_init"
9847 #: ../src/guestfs-actions.pod:2437
9851 " guestfs_inotify_init (guestfs_h *g,\n"
9852 " int maxevents);\n"
9857 #: ../src/guestfs-actions.pod:2441 ../fish/guestfish-actions.pod:1631
9859 "This command creates a new inotify handle. The inotify subsystem can be "
9860 "used to notify events which happen to objects in the guest filesystem."
9864 #: ../src/guestfs-actions.pod:2445
9866 "C<maxevents> is the maximum number of events which will be queued up between "
9867 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
9868 "passed as C<0>, then the kernel (or previously set) default is used. For "
9869 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
9870 "throws away events, but records the fact that it threw them away by setting "
9871 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
9872 "C<guestfs_inotify_read>)."
9876 #: ../src/guestfs-actions.pod:2455
9878 "Before any events are generated, you have to add some watches to the "
9879 "internal watch list. See: C<guestfs_inotify_add_watch>, "
9880 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
9884 #: ../src/guestfs-actions.pod:2461
9886 "Queued up events should be read periodically by calling "
9887 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
9888 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
9889 "often enough then you risk the internal queue overflowing."
9893 #: ../src/guestfs-actions.pod:2468
9895 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
9896 "This also removes any watches automatically."
9900 #: ../src/guestfs-actions.pod:2472 ../fish/guestfish-actions.pod:1662
9902 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9903 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9904 "that there is one global inotify handle per libguestfs instance."
9908 #: ../src/guestfs-actions.pod:2481
9909 msgid "guestfs_inotify_read"
9913 #: ../src/guestfs-actions.pod:2483
9916 " struct guestfs_inotify_event_list *\n"
9917 " guestfs_inotify_read (guestfs_h *g);\n"
9922 #: ../src/guestfs-actions.pod:2486 ../fish/guestfish-actions.pod:1671
9924 "Return the complete queue of events that have happened since the previous "
9929 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1674
9930 msgid "If no events have happened, this returns an empty list."
9934 #: ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1676
9936 "I<Note>: In order to make sure that all events have been read, you must call "
9937 "this function repeatedly until it returns an empty list. The reason is that "
9938 "the call will read events up to the maximum appliance-to-host message size "
9939 "and leave remaining events in the queue."
9943 #: ../src/guestfs-actions.pod:2497
9945 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
9946 "there was an error. I<The caller must call "
9947 "C<guestfs_free_inotify_event_list> after use>."
9951 #: ../src/guestfs-actions.pod:2503
9952 msgid "guestfs_inotify_rm_watch"
9956 #: ../src/guestfs-actions.pod:2505
9960 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
9966 #: ../src/guestfs-actions.pod:2509
9968 "Remove a previously defined inotify watch. See "
9969 "C<guestfs_inotify_add_watch>."
9973 #: ../src/guestfs-actions.pod:2516
9974 msgid "guestfs_inspect_get_arch"
9978 #: ../src/guestfs-actions.pod:2518
9982 " guestfs_inspect_get_arch (guestfs_h *g,\n"
9983 " const char *root);\n"
9988 #: ../src/guestfs-actions.pod:2522 ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2638 ../src/guestfs-actions.pod:2682 ../src/guestfs-actions.pod:2708 ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2796 ../src/guestfs-actions.pod:2817 ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:2920 ../src/guestfs-actions.pod:2944 ../src/guestfs-actions.pod:2999 ../src/guestfs-actions.pod:3041 ../src/guestfs-actions.pod:3062 ../src/guestfs-actions.pod:3085 ../src/guestfs-actions.pod:3102 ../src/guestfs-actions.pod:3119 ../src/guestfs-actions.pod:3138
9990 "This function should only be called with a root device string as returned by "
9991 "C<guestfs_inspect_os>."
9995 #: ../src/guestfs-actions.pod:2525
9997 "This returns the architecture of the inspected operating system. The "
9998 "possible return values are listed under C<guestfs_file_architecture>."
10002 #: ../src/guestfs-actions.pod:2529 ../fish/guestfish-actions.pod:1700
10004 "If the architecture could not be determined, then the string C<unknown> is "
10009 #: ../src/guestfs-actions.pod:2532 ../src/guestfs-actions.pod:2625 ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:2756 ../src/guestfs-actions.pod:2784 ../src/guestfs-actions.pod:2876 ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2931 ../src/guestfs-actions.pod:2985 ../src/guestfs-actions.pod:3028 ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3072 ../src/guestfs-actions.pod:3092 ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3128 ../src/guestfs-actions.pod:3231 ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:1703 ../fish/guestfish-actions.pod:1789 ../fish/guestfish-actions.pod:1877 ../fish/guestfish-actions.pod:1892 ../fish/guestfish-actions.pod:1913 ../fish/guestfish-actions.pod:1983 ../fish/guestfish-actions.pod:2007 ../fish/guestfish-actions.pod:2024 ../fish/guestfish-actions.pod:2067 ../fish/guestfish-actions.pod:2102 ../fish/guestfish-actions.pod:2118 ../fish/guestfish-actions.pod:2134 ../fish/guestfish-actions.pod:2147 ../fish/guestfish-actions.pod:2160 ../fish/guestfish-actions.pod:2175 ../fish/guestfish-actions.pod:2274 ../fish/guestfish-actions.pod:2308
10010 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
10014 #: ../src/guestfs-actions.pod:2539
10015 msgid "guestfs_inspect_get_distro"
10019 #: ../src/guestfs-actions.pod:2541
10023 " guestfs_inspect_get_distro (guestfs_h *g,\n"
10024 " const char *root);\n"
10029 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1712
10030 msgid "This returns the distro (distribution) of the inspected operating system."
10034 #: ../src/guestfs-actions.pod:2551 ../fish/guestfish-actions.pod:1715
10035 msgid "Currently defined distros are:"
10039 #: ../src/guestfs-actions.pod:2555 ../fish/guestfish-actions.pod:1719
10040 msgid "\"archlinux\""
10044 #: ../src/guestfs-actions.pod:2557 ../fish/guestfish-actions.pod:1721
10045 msgid "Arch Linux."
10049 #: ../src/guestfs-actions.pod:2559 ../fish/guestfish-actions.pod:1723
10054 #: ../src/guestfs-actions.pod:2561 ../fish/guestfish-actions.pod:1725
10059 #: ../src/guestfs-actions.pod:2563 ../fish/guestfish-actions.pod:1727
10064 #: ../src/guestfs-actions.pod:2565 ../fish/guestfish-actions.pod:1729
10069 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:1731
10074 #: ../src/guestfs-actions.pod:2569 ../fish/guestfish-actions.pod:1733
10079 #: ../src/guestfs-actions.pod:2571 ../fish/guestfish-actions.pod:1735
10084 #: ../src/guestfs-actions.pod:2573 ../fish/guestfish-actions.pod:1737
10089 #: ../src/guestfs-actions.pod:2575 ../fish/guestfish-actions.pod:1739
10090 msgid "\"linuxmint\""
10094 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1741
10095 msgid "Linux Mint."
10099 #: ../src/guestfs-actions.pod:2579 ../fish/guestfish-actions.pod:1743
10100 msgid "\"mandriva\""
10104 #: ../src/guestfs-actions.pod:2581 ../fish/guestfish-actions.pod:1745
10109 #: ../src/guestfs-actions.pod:2583 ../fish/guestfish-actions.pod:1747
10114 #: ../src/guestfs-actions.pod:2585 ../fish/guestfish-actions.pod:1749
10119 #: ../src/guestfs-actions.pod:2587 ../fish/guestfish-actions.pod:1751
10124 #: ../src/guestfs-actions.pod:2589 ../fish/guestfish-actions.pod:1753
10129 #: ../src/guestfs-actions.pod:2591 ../fish/guestfish-actions.pod:1755
10130 msgid "\"redhat-based\""
10134 #: ../src/guestfs-actions.pod:2593 ../fish/guestfish-actions.pod:1757
10135 msgid "Some Red Hat-derived distro."
10139 #: ../src/guestfs-actions.pod:2595 ../fish/guestfish-actions.pod:1759
10144 #: ../src/guestfs-actions.pod:2597 ../fish/guestfish-actions.pod:1761
10145 msgid "Red Hat Enterprise Linux."
10149 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:1763
10150 msgid "\"scientificlinux\""
10154 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1765
10155 msgid "Scientific Linux."
10159 #: ../src/guestfs-actions.pod:2603 ../fish/guestfish-actions.pod:1767
10160 msgid "\"slackware\""
10164 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1769
10169 #: ../src/guestfs-actions.pod:2607 ../fish/guestfish-actions.pod:1771
10174 #: ../src/guestfs-actions.pod:2609 ../fish/guestfish-actions.pod:1773
10179 #: ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:3019 ../fish/guestfish-actions.pod:1775 ../fish/guestfish-actions.pod:1868 ../fish/guestfish-actions.pod:2093
10180 msgid "\"unknown\""
10184 #: ../src/guestfs-actions.pod:2613 ../fish/guestfish-actions.pod:1777
10185 msgid "The distro could not be determined."
10189 #: ../src/guestfs-actions.pod:2615 ../src/guestfs-actions.pod:3011 ../fish/guestfish-actions.pod:1779 ../fish/guestfish-actions.pod:2085
10190 msgid "\"windows\""
10194 #: ../src/guestfs-actions.pod:2617 ../fish/guestfish-actions.pod:1781
10196 "Windows does not have distributions. This string is returned if the OS type "
10201 #: ../src/guestfs-actions.pod:2622 ../src/guestfs-actions.pod:2733 ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:1786 ../fish/guestfish-actions.pod:1874 ../fish/guestfish-actions.pod:2099
10203 "Future versions of libguestfs may return other strings here. The caller "
10204 "should be prepared to handle any string."
10208 #: ../src/guestfs-actions.pod:2632
10209 msgid "guestfs_inspect_get_drive_mappings"
10213 #: ../src/guestfs-actions.pod:2634
10217 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
10218 " const char *root);\n"
10223 #: ../src/guestfs-actions.pod:2641 ../fish/guestfish-actions.pod:1798
10225 "This call is useful for Windows which uses a primitive system of assigning "
10226 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10227 "Windows Registry to find out how disks/partitions are mapped to drive "
10228 "letters, and returns a hash table as in the example below:"
10232 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:1804
10235 " C => /dev/vda2\n"
10236 " E => /dev/vdb1\n"
10237 " F => /dev/vdc1\n"
10242 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1808
10244 "Note that keys are drive letters. For Windows, the key is case insensitive "
10245 "and just contains the drive letter, without the customary colon separator "
10250 #: ../src/guestfs-actions.pod:2655 ../fish/guestfish-actions.pod:1812
10252 "In future we may support other operating systems that also used drive "
10253 "letters, but the keys for those might not be case insensitive and might be "
10254 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10259 #: ../src/guestfs-actions.pod:2660 ../fish/guestfish-actions.pod:1817
10261 "For Windows guests, currently only hard drive mappings are returned. "
10262 "Removable disks (eg. DVD-ROMs) are ignored."
10266 #: ../src/guestfs-actions.pod:2663 ../fish/guestfish-actions.pod:1820
10268 "For guests that do not use drive mappings, or if the drive mappings could "
10269 "not be determined, this returns an empty hash table."
10273 #: ../src/guestfs-actions.pod:2666
10275 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10276 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
10280 #: ../src/guestfs-actions.pod:2670 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:6721
10282 "This function returns a NULL-terminated array of strings, or NULL if there "
10283 "was an error. The array of strings will always have length C<2n+1>, where "
10284 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
10285 "caller must free the strings and the array after use>."
10289 #: ../src/guestfs-actions.pod:2676
10290 msgid "guestfs_inspect_get_filesystems"
10294 #: ../src/guestfs-actions.pod:2678
10298 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
10299 " const char *root);\n"
10304 #: ../src/guestfs-actions.pod:2685 ../fish/guestfish-actions.pod:1834
10306 "This returns a list of all the filesystems that we think are associated with "
10307 "this operating system. This includes the root filesystem, other ordinary "
10308 "filesystems, and non-mounted devices like swap partitions."
10312 #: ../src/guestfs-actions.pod:2690 ../fish/guestfish-actions.pod:1839
10314 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10315 "to be shared between operating systems."
10319 #: ../src/guestfs-actions.pod:2693
10321 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10322 "C<guestfs_inspect_get_mountpoints>."
10326 #: ../src/guestfs-actions.pod:2702
10327 msgid "guestfs_inspect_get_format"
10331 #: ../src/guestfs-actions.pod:2704
10335 " guestfs_inspect_get_format (guestfs_h *g,\n"
10336 " const char *root);\n"
10341 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:1852
10343 "This returns the format of the inspected operating system. You can use it "
10344 "to detect install images, live CDs and similar."
10348 #: ../src/guestfs-actions.pod:2714 ../fish/guestfish-actions.pod:1855
10349 msgid "Currently defined formats are:"
10353 #: ../src/guestfs-actions.pod:2718 ../fish/guestfish-actions.pod:1859
10354 msgid "\"installed\""
10358 #: ../src/guestfs-actions.pod:2720 ../fish/guestfish-actions.pod:1861
10359 msgid "This is an installed operating system."
10363 #: ../src/guestfs-actions.pod:2722 ../fish/guestfish-actions.pod:1863
10364 msgid "\"installer\""
10368 #: ../src/guestfs-actions.pod:2724 ../fish/guestfish-actions.pod:1865
10370 "The disk image being inspected is not an installed operating system, but a "
10371 "I<bootable> install disk, live CD, or similar."
10375 #: ../src/guestfs-actions.pod:2729 ../fish/guestfish-actions.pod:1870
10376 msgid "The format of this disk image is not known."
10380 #: ../src/guestfs-actions.pod:2741
10381 msgid "guestfs_inspect_get_hostname"
10385 #: ../src/guestfs-actions.pod:2743
10389 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
10390 " const char *root);\n"
10395 #: ../src/guestfs-actions.pod:2750 ../fish/guestfish-actions.pod:1886
10397 "This function returns the hostname of the operating system as found by "
10398 "inspection of the guest's configuration files."
10402 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:1889
10404 "If the hostname could not be determined, then the string C<unknown> is "
10409 #: ../src/guestfs-actions.pod:2761
10410 msgid "(Added in 1.7.9)"
10414 #: ../src/guestfs-actions.pod:2763
10415 msgid "guestfs_inspect_get_major_version"
10419 #: ../src/guestfs-actions.pod:2765
10423 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
10424 " const char *root);\n"
10429 #: ../src/guestfs-actions.pod:2772 ../fish/guestfish-actions.pod:1901
10430 msgid "This returns the major version number of the inspected operating system."
10434 #: ../src/guestfs-actions.pod:2775 ../fish/guestfish-actions.pod:1904
10436 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10437 "popular public names used by the operating system. Notably the operating "
10438 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10439 "1). You can find out the real versions corresponding to releases of Windows "
10440 "by consulting Wikipedia or MSDN."
10444 #: ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:2802 ../fish/guestfish-actions.pod:1911 ../fish/guestfish-actions.pod:1925
10445 msgid "If the version could not be determined, then C<0> is returned."
10449 #: ../src/guestfs-actions.pod:2790
10450 msgid "guestfs_inspect_get_minor_version"
10454 #: ../src/guestfs-actions.pod:2792
10458 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
10459 " const char *root);\n"
10464 #: ../src/guestfs-actions.pod:2799 ../fish/guestfish-actions.pod:1922
10465 msgid "This returns the minor version number of the inspected operating system."
10469 #: ../src/guestfs-actions.pod:2804
10471 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10472 "C<guestfs_inspect_get_major_version>."
10476 #: ../src/guestfs-actions.pod:2811
10477 msgid "guestfs_inspect_get_mountpoints"
10481 #: ../src/guestfs-actions.pod:2813
10485 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
10486 " const char *root);\n"
10491 #: ../src/guestfs-actions.pod:2820 ../fish/guestfish-actions.pod:1937
10493 "This returns a hash of where we think the filesystems associated with this "
10494 "operating system should be mounted. Callers should note that this is at "
10495 "best an educated guess made by reading configuration files such as "
10496 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
10497 "are non-existent or not mountable and callers should be prepared to handle "
10498 "or ignore failures if they try to mount them."
10502 #: ../src/guestfs-actions.pod:2829 ../fish/guestfish-actions.pod:1946
10504 "Each element in the returned hashtable has a key which is the path of the "
10505 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10506 "mounted there (eg. C</dev/sda1>)."
10510 #: ../src/guestfs-actions.pod:2834 ../fish/guestfish-actions.pod:1951
10511 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
10515 #: ../src/guestfs-actions.pod:2837
10517 "For operating systems like Windows which still use drive letters, this call "
10518 "will only return an entry for the first drive \"mounted on\" C</>. For "
10519 "information about the mapping of drive letters to partitions, see "
10520 "C<guestfs_inspect_get_drive_mappings>."
10524 #: ../src/guestfs-actions.pod:2843
10526 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10527 "C<guestfs_inspect_get_filesystems>."
10531 #: ../src/guestfs-actions.pod:2854
10532 msgid "guestfs_inspect_get_package_format"
10536 #: ../src/guestfs-actions.pod:2856
10540 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
10541 " const char *root);\n"
10546 #: ../src/guestfs-actions.pod:2863
10548 "This function and C<guestfs_inspect_get_package_management> return the "
10549 "package format and package management tool used by the inspected operating "
10550 "system. For example for Fedora these functions would return C<rpm> (package "
10551 "format) and C<yum> (package management)."
10555 #: ../src/guestfs-actions.pod:2869 ../fish/guestfish-actions.pod:1976
10557 "This returns the string C<unknown> if we could not determine the package "
10558 "format I<or> if the operating system does not have a real packaging system "
10563 #: ../src/guestfs-actions.pod:2873 ../fish/guestfish-actions.pod:1980
10565 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
10566 "Future versions of libguestfs may return other strings."
10570 #: ../src/guestfs-actions.pod:2881 ../src/guestfs-actions.pod:2912
10571 msgid "(Added in 1.7.5)"
10575 #: ../src/guestfs-actions.pod:2883
10576 msgid "guestfs_inspect_get_package_management"
10580 #: ../src/guestfs-actions.pod:2885
10584 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
10585 " const char *root);\n"
10590 #: ../src/guestfs-actions.pod:2892
10592 "C<guestfs_inspect_get_package_format> and this function return the package "
10593 "format and package management tool used by the inspected operating system. "
10594 "For example for Fedora these functions would return C<rpm> (package format) "
10595 "and C<yum> (package management)."
10599 #: ../src/guestfs-actions.pod:2898 ../fish/guestfish-actions.pod:1998
10601 "This returns the string C<unknown> if we could not determine the package "
10602 "management tool I<or> if the operating system does not have a real packaging "
10603 "system (eg. Windows)."
10607 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2002
10609 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10610 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
10611 "libguestfs may return other strings."
10615 #: ../src/guestfs-actions.pod:2914
10616 msgid "guestfs_inspect_get_product_name"
10620 #: ../src/guestfs-actions.pod:2916
10624 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
10625 " const char *root);\n"
10630 #: ../src/guestfs-actions.pod:2923 ../fish/guestfish-actions.pod:2016
10632 "This returns the product name of the inspected operating system. The "
10633 "product name is generally some freeform string which can be displayed to the "
10634 "user, but should not be parsed by programs."
10638 #: ../src/guestfs-actions.pod:2928 ../fish/guestfish-actions.pod:2021
10640 "If the product name could not be determined, then the string C<unknown> is "
10645 #: ../src/guestfs-actions.pod:2938
10646 msgid "guestfs_inspect_get_product_variant"
10650 #: ../src/guestfs-actions.pod:2940
10654 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
10655 " const char *root);\n"
10660 #: ../src/guestfs-actions.pod:2947 ../fish/guestfish-actions.pod:2033
10661 msgid "This returns the product variant of the inspected operating system."
10665 #: ../src/guestfs-actions.pod:2950 ../fish/guestfish-actions.pod:2036
10667 "For Windows guests, this returns the contents of the Registry key "
10668 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
10669 "which is usually a string such as C<Client> or C<Server> (other values are "
10670 "possible). This can be used to distinguish consumer and enterprise versions "
10671 "of Windows that have the same version number (for example, Windows 7 and "
10672 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10673 "the latter is C<Server>)."
10677 #: ../src/guestfs-actions.pod:2959 ../fish/guestfish-actions.pod:2045
10679 "For enterprise Linux guests, in future we intend this to return the product "
10680 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10681 "implemented at present."
10685 #: ../src/guestfs-actions.pod:2963 ../fish/guestfish-actions.pod:2049
10687 "If the product variant could not be determined, then the string C<unknown> "
10692 #: ../src/guestfs-actions.pod:2966
10694 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10695 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
10699 #: ../src/guestfs-actions.pod:2973
10700 msgid "guestfs_inspect_get_roots"
10704 #: ../src/guestfs-actions.pod:2975
10708 " guestfs_inspect_get_roots (guestfs_h *g);\n"
10713 #: ../src/guestfs-actions.pod:2978
10715 "This function is a convenient way to get the list of root devices, as "
10716 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
10717 "the whole inspection process."
10721 #: ../src/guestfs-actions.pod:2982
10723 "This returns an empty list if either no root devices were found or the "
10724 "caller has not called C<guestfs_inspect_os>."
10728 #: ../src/guestfs-actions.pod:2991
10729 msgid "(Added in 1.7.3)"
10733 #: ../src/guestfs-actions.pod:2993
10734 msgid "guestfs_inspect_get_type"
10738 #: ../src/guestfs-actions.pod:2995
10742 " guestfs_inspect_get_type (guestfs_h *g,\n"
10743 " const char *root);\n"
10748 #: ../src/guestfs-actions.pod:3002 ../fish/guestfish-actions.pod:2076
10750 "This returns the type of the inspected operating system. Currently defined "
10755 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2081
10760 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2083
10761 msgid "Any Linux-based operating system."
10765 #: ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:2087
10766 msgid "Any Microsoft Windows operating system."
10770 #: ../src/guestfs-actions.pod:3015 ../fish/guestfish-actions.pod:2089
10771 msgid "\"freebsd\""
10775 #: ../src/guestfs-actions.pod:3017 ../fish/guestfish-actions.pod:2091
10780 #: ../src/guestfs-actions.pod:3021 ../fish/guestfish-actions.pod:2095
10781 msgid "The operating system type could not be determined."
10785 #: ../src/guestfs-actions.pod:3035
10786 msgid "guestfs_inspect_get_windows_current_control_set"
10790 #: ../src/guestfs-actions.pod:3037
10794 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
10795 " const char *root);\n"
10800 #: ../src/guestfs-actions.pod:3044 ../fish/guestfish-actions.pod:2111
10802 "This returns the Windows CurrentControlSet of the inspected guest. The "
10803 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10807 #: ../src/guestfs-actions.pod:3047 ../fish/guestfish-actions.pod:2114
10809 "This call assumes that the guest is Windows and that the Registry could be "
10810 "examined by inspection. If this is not the case then an error is returned."
10814 #: ../src/guestfs-actions.pod:3056
10815 msgid "guestfs_inspect_get_windows_systemroot"
10819 #: ../src/guestfs-actions.pod:3058
10823 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
10824 " const char *root);\n"
10829 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2127
10831 "This returns the Windows systemroot of the inspected guest. The systemroot "
10832 "is a directory path such as C</WINDOWS>."
10836 #: ../src/guestfs-actions.pod:3068 ../fish/guestfish-actions.pod:2130
10838 "This call assumes that the guest is Windows and that the systemroot could be "
10839 "determined by inspection. If this is not the case then an error is "
10844 #: ../src/guestfs-actions.pod:3077
10845 msgid "(Added in 1.5.25)"
10849 #: ../src/guestfs-actions.pod:3079
10850 msgid "guestfs_inspect_is_live"
10854 #: ../src/guestfs-actions.pod:3081
10858 " guestfs_inspect_is_live (guestfs_h *g,\n"
10859 " const char *root);\n"
10864 #: ../src/guestfs-actions.pod:3088
10866 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10867 "disk), then this returns true if a live image was detected on the disk."
10871 #: ../src/guestfs-actions.pod:3096
10872 msgid "guestfs_inspect_is_multipart"
10876 #: ../src/guestfs-actions.pod:3098
10880 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
10881 " const char *root);\n"
10886 #: ../src/guestfs-actions.pod:3105
10888 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10889 "disk), then this returns true if the disk is part of a set."
10893 #: ../src/guestfs-actions.pod:3113
10894 msgid "guestfs_inspect_is_netinst"
10898 #: ../src/guestfs-actions.pod:3115
10902 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
10903 " const char *root);\n"
10908 #: ../src/guestfs-actions.pod:3122
10910 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10911 "disk), then this returns true if the disk is a network installer, ie. not a "
10912 "self-contained install CD but one which is likely to require network access "
10913 "to complete the install."
10917 #: ../src/guestfs-actions.pod:3132
10918 msgid "guestfs_inspect_list_applications"
10922 #: ../src/guestfs-actions.pod:3134
10925 " struct guestfs_application_list *\n"
10926 " guestfs_inspect_list_applications (guestfs_h *g,\n"
10927 " const char *root);\n"
10932 #: ../src/guestfs-actions.pod:3141 ../fish/guestfish-actions.pod:2184
10933 msgid "Return the list of applications installed in the operating system."
10937 #: ../src/guestfs-actions.pod:3143
10939 "I<Note:> This call works differently from other parts of the inspection "
10940 "API. You have to call C<guestfs_inspect_os>, then "
10941 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
10942 "this. Listing applications is a significantly more difficult operation "
10943 "which requires access to the full filesystem. Also note that unlike the "
10944 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
10945 "the libguestfs handle, this call actually reads parts of the mounted "
10946 "filesystems during the call."
10950 #: ../src/guestfs-actions.pod:3153 ../fish/guestfish-actions.pod:2196
10952 "This returns an empty list if the inspection code was not able to determine "
10953 "the list of applications."
10957 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2199
10958 msgid "The application structure contains the following fields:"
10962 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2203
10963 msgid "C<app_name>"
10967 #: ../src/guestfs-actions.pod:3162 ../fish/guestfish-actions.pod:2205
10969 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10970 "guests, this is the package name."
10974 #: ../src/guestfs-actions.pod:3165 ../fish/guestfish-actions.pod:2208
10975 msgid "C<app_display_name>"
10979 #: ../src/guestfs-actions.pod:3167 ../fish/guestfish-actions.pod:2210
10981 "The display name of the application, sometimes localized to the install "
10982 "language of the guest operating system."
10986 #: ../src/guestfs-actions.pod:3170 ../fish/guestfish-actions.pod:2213
10988 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10989 "to display something can use C<app_name> instead."
10993 #: ../src/guestfs-actions.pod:3173 ../fish/guestfish-actions.pod:2216
10994 msgid "C<app_epoch>"
10998 #: ../src/guestfs-actions.pod:3175 ../fish/guestfish-actions.pod:2218
11000 "For package managers which use epochs, this contains the epoch of the "
11001 "package (an integer). If unavailable, this is returned as C<0>."
11005 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2221
11006 msgid "C<app_version>"
11010 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2223
11012 "The version string of the application or package. If unavailable this is "
11013 "returned as an empty string C<\"\">."
11017 #: ../src/guestfs-actions.pod:3183 ../fish/guestfish-actions.pod:2226
11018 msgid "C<app_release>"
11022 #: ../src/guestfs-actions.pod:3185 ../fish/guestfish-actions.pod:2228
11024 "The release string of the application or package, for package managers that "
11025 "use this. If unavailable this is returned as an empty string C<\"\">."
11029 #: ../src/guestfs-actions.pod:3189 ../fish/guestfish-actions.pod:2232
11030 msgid "C<app_install_path>"
11034 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2234
11036 "The installation path of the application (on operating systems such as "
11037 "Windows which use installation paths). This path is in the format used by "
11038 "the guest operating system, it is not a libguestfs path."
11042 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2239
11043 msgid "If unavailable this is returned as an empty string C<\"\">."
11047 #: ../src/guestfs-actions.pod:3198 ../fish/guestfish-actions.pod:2241
11048 msgid "C<app_trans_path>"
11052 #: ../src/guestfs-actions.pod:3200 ../fish/guestfish-actions.pod:2243
11054 "The install path translated into a libguestfs path. If unavailable this is "
11055 "returned as an empty string C<\"\">."
11059 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2246
11060 msgid "C<app_publisher>"
11064 #: ../src/guestfs-actions.pod:3205 ../fish/guestfish-actions.pod:2248
11066 "The name of the publisher of the application, for package managers that use "
11067 "this. If unavailable this is returned as an empty string C<\"\">."
11071 #: ../src/guestfs-actions.pod:3209 ../fish/guestfish-actions.pod:2252
11076 #: ../src/guestfs-actions.pod:3211 ../fish/guestfish-actions.pod:2254
11078 "The URL (eg. upstream URL) of the application. If unavailable this is "
11079 "returned as an empty string C<\"\">."
11083 #: ../src/guestfs-actions.pod:3214 ../fish/guestfish-actions.pod:2257
11084 msgid "C<app_source_package>"
11088 #: ../src/guestfs-actions.pod:3216 ../fish/guestfish-actions.pod:2259
11090 "For packaging systems which support this, the name of the source package. "
11091 "If unavailable this is returned as an empty string C<\"\">."
11095 #: ../src/guestfs-actions.pod:3219 ../fish/guestfish-actions.pod:2262
11096 msgid "C<app_summary>"
11100 #: ../src/guestfs-actions.pod:3221 ../fish/guestfish-actions.pod:2264
11102 "A short (usually one line) description of the application or package. If "
11103 "unavailable this is returned as an empty string C<\"\">."
11107 #: ../src/guestfs-actions.pod:3224 ../fish/guestfish-actions.pod:2267
11108 msgid "C<app_description>"
11112 #: ../src/guestfs-actions.pod:3226 ../fish/guestfish-actions.pod:2269
11114 "A longer description of the application or package. If unavailable this is "
11115 "returned as an empty string C<\"\">."
11119 #: ../src/guestfs-actions.pod:3233
11121 "This function returns a C<struct guestfs_application_list *>, or NULL if "
11122 "there was an error. I<The caller must call C<guestfs_free_application_list> "
11127 #: ../src/guestfs-actions.pod:3237
11128 msgid "(Added in 1.7.8)"
11132 #: ../src/guestfs-actions.pod:3239
11133 msgid "guestfs_inspect_os"
11137 #: ../src/guestfs-actions.pod:3241
11141 " guestfs_inspect_os (guestfs_h *g);\n"
11146 #: ../src/guestfs-actions.pod:3244 ../fish/guestfish-actions.pod:2280
11148 "This function uses other libguestfs functions and certain heuristics to "
11149 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
11150 "for operating systems."
11154 #: ../src/guestfs-actions.pod:3248 ../fish/guestfish-actions.pod:2284
11155 msgid "The list returned is empty if no operating systems were found."
11159 #: ../src/guestfs-actions.pod:3250 ../fish/guestfish-actions.pod:2286
11161 "If one operating system was found, then this returns a list with a single "
11162 "element, which is the name of the root filesystem of this operating system. "
11163 "It is also possible for this function to return a list containing more than "
11164 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
11165 "element being the root filesystem of one of the operating systems."
11169 #: ../src/guestfs-actions.pod:3257
11171 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
11172 "functions in order to query further information about each operating system, "
11173 "such as the name and version."
11177 #: ../src/guestfs-actions.pod:3262
11179 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
11180 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
11181 "the contents. This should be called with no disks currently mounted. The "
11182 "function may also use Augeas, so any existing Augeas handle will be closed."
11186 #: ../src/guestfs-actions.pod:3268 ../fish/guestfish-actions.pod:2304
11188 "This function cannot decrypt encrypted disks. The caller must do that first "
11189 "(supplying the necessary keys) if the disk is encrypted."
11193 #: ../src/guestfs-actions.pod:3274 ../src/guestfs-actions.pod:3564 ../src/guestfs-actions.pod:3626
11194 msgid "See also C<guestfs_list_filesystems>."
11198 #: ../src/guestfs-actions.pod:3282
11199 msgid "guestfs_is_blockdev"
11203 #: ../src/guestfs-actions.pod:3284
11207 " guestfs_is_blockdev (guestfs_h *g,\n"
11208 " const char *path);\n"
11213 #: ../src/guestfs-actions.pod:3288 ../fish/guestfish-actions.pod:2316
11215 "This returns C<true> if and only if there is a block device with the given "
11220 #: ../src/guestfs-actions.pod:3291 ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3350 ../src/guestfs-actions.pod:3365 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3437 ../src/guestfs-actions.pod:3452
11221 msgid "See also C<guestfs_stat>."
11225 #: ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3324 ../src/guestfs-actions.pod:3369 ../src/guestfs-actions.pod:3441 ../src/guestfs-actions.pod:3456
11226 msgid "(Added in 1.5.10)"
11230 #: ../src/guestfs-actions.pod:3297
11231 msgid "guestfs_is_busy"
11235 #: ../src/guestfs-actions.pod:3299
11239 " guestfs_is_busy (guestfs_h *g);\n"
11244 #: ../src/guestfs-actions.pod:3302 ../fish/guestfish-actions.pod:2325
11246 "This returns true iff this handle is busy processing a command (in the "
11251 #: ../src/guestfs-actions.pod:3311
11252 msgid "guestfs_is_chardev"
11256 #: ../src/guestfs-actions.pod:3313
11260 " guestfs_is_chardev (guestfs_h *g,\n"
11261 " const char *path);\n"
11266 #: ../src/guestfs-actions.pod:3317 ../fish/guestfish-actions.pod:2334
11268 "This returns C<true> if and only if there is a character device with the "
11269 "given C<path> name."
11273 #: ../src/guestfs-actions.pod:3326
11274 msgid "guestfs_is_config"
11278 #: ../src/guestfs-actions.pod:3328
11282 " guestfs_is_config (guestfs_h *g);\n"
11287 #: ../src/guestfs-actions.pod:3331 ../fish/guestfish-actions.pod:2343
11289 "This returns true iff this handle is being configured (in the C<CONFIG> "
11294 #: ../src/guestfs-actions.pod:3340
11295 msgid "guestfs_is_dir"
11299 #: ../src/guestfs-actions.pod:3342
11303 " guestfs_is_dir (guestfs_h *g,\n"
11304 " const char *path);\n"
11309 #: ../src/guestfs-actions.pod:3346 ../fish/guestfish-actions.pod:2352
11311 "This returns C<true> if and only if there is a directory with the given "
11312 "C<path> name. Note that it returns false for other objects like files."
11316 #: ../src/guestfs-actions.pod:3356
11317 msgid "guestfs_is_fifo"
11321 #: ../src/guestfs-actions.pod:3358
11325 " guestfs_is_fifo (guestfs_h *g,\n"
11326 " const char *path);\n"
11331 #: ../src/guestfs-actions.pod:3362 ../fish/guestfish-actions.pod:2362
11333 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11334 "given C<path> name."
11338 #: ../src/guestfs-actions.pod:3371
11339 msgid "guestfs_is_file"
11343 #: ../src/guestfs-actions.pod:3373
11347 " guestfs_is_file (guestfs_h *g,\n"
11348 " const char *path);\n"
11353 #: ../src/guestfs-actions.pod:3377 ../fish/guestfish-actions.pod:2371
11355 "This returns C<true> if and only if there is a regular file with the given "
11356 "C<path> name. Note that it returns false for other objects like "
11361 #: ../src/guestfs-actions.pod:3387
11362 msgid "guestfs_is_launching"
11366 #: ../src/guestfs-actions.pod:3389
11370 " guestfs_is_launching (guestfs_h *g);\n"
11375 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2381
11377 "This returns true iff this handle is launching the subprocess (in the "
11378 "C<LAUNCHING> state)."
11382 #: ../src/guestfs-actions.pod:3401
11383 msgid "guestfs_is_lv"
11387 #: ../src/guestfs-actions.pod:3403
11391 " guestfs_is_lv (guestfs_h *g,\n"
11392 " const char *device);\n"
11397 #: ../src/guestfs-actions.pod:3407 ../fish/guestfish-actions.pod:2390
11399 "This command tests whether C<device> is a logical volume, and returns true "
11400 "iff this is the case."
11404 #: ../src/guestfs-actions.pod:3414
11405 msgid "guestfs_is_ready"
11409 #: ../src/guestfs-actions.pod:3416
11413 " guestfs_is_ready (guestfs_h *g);\n"
11418 #: ../src/guestfs-actions.pod:3419 ../fish/guestfish-actions.pod:2397
11420 "This returns true iff this handle is ready to accept commands (in the "
11425 #: ../src/guestfs-actions.pod:3428
11426 msgid "guestfs_is_socket"
11430 #: ../src/guestfs-actions.pod:3430
11434 " guestfs_is_socket (guestfs_h *g,\n"
11435 " const char *path);\n"
11440 #: ../src/guestfs-actions.pod:3434 ../fish/guestfish-actions.pod:2406
11442 "This returns C<true> if and only if there is a Unix domain socket with the "
11443 "given C<path> name."
11447 #: ../src/guestfs-actions.pod:3443
11448 msgid "guestfs_is_symlink"
11452 #: ../src/guestfs-actions.pod:3445
11456 " guestfs_is_symlink (guestfs_h *g,\n"
11457 " const char *path);\n"
11462 #: ../src/guestfs-actions.pod:3449 ../fish/guestfish-actions.pod:2415
11464 "This returns C<true> if and only if there is a symbolic link with the given "
11469 #: ../src/guestfs-actions.pod:3458
11470 msgid "guestfs_kill_subprocess"
11474 #: ../src/guestfs-actions.pod:3460
11478 " guestfs_kill_subprocess (guestfs_h *g);\n"
11483 #: ../src/guestfs-actions.pod:3463 ../fish/guestfish-actions.pod:2424
11484 msgid "This kills the qemu subprocess. You should never need to call this."
11488 #: ../src/guestfs-actions.pod:3469
11489 msgid "guestfs_launch"
11493 #: ../src/guestfs-actions.pod:3471
11497 " guestfs_launch (guestfs_h *g);\n"
11502 #: ../src/guestfs-actions.pod:3474 ../fish/guestfish-actions.pod:2432
11504 "Internally libguestfs is implemented by running a virtual machine using "
11509 #: ../src/guestfs-actions.pod:3477 ../fish/guestfish-actions.pod:2435
11511 "You should call this after configuring the handle (eg. adding drives) but "
11512 "before performing any actions."
11516 #: ../src/guestfs-actions.pod:3489
11517 msgid "guestfs_lchown"
11521 #: ../src/guestfs-actions.pod:3491
11525 " guestfs_lchown (guestfs_h *g,\n"
11528 " const char *path);\n"
11533 #: ../src/guestfs-actions.pod:3497
11535 "Change the file owner to C<owner> and group to C<group>. This is like "
11536 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
11537 "changed, not the target."
11541 #: ../src/guestfs-actions.pod:3509
11542 msgid "guestfs_lgetxattr"
11546 #: ../src/guestfs-actions.pod:3511
11550 " guestfs_lgetxattr (guestfs_h *g,\n"
11551 " const char *path,\n"
11552 " const char *name,\n"
11553 " size_t *size_r);\n"
11558 #: ../src/guestfs-actions.pod:3517 ../fish/guestfish-actions.pod:2454
11560 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11561 "is a symlink, then this call returns an extended attribute from the symlink."
11565 #: ../src/guestfs-actions.pod:3531
11566 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
11570 #: ../src/guestfs-actions.pod:3539
11571 msgid "guestfs_lgetxattrs"
11575 #: ../src/guestfs-actions.pod:3541
11578 " struct guestfs_xattr_list *\n"
11579 " guestfs_lgetxattrs (guestfs_h *g,\n"
11580 " const char *path);\n"
11585 #: ../src/guestfs-actions.pod:3545
11587 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
11588 "then it returns the extended attributes of the link itself."
11592 #: ../src/guestfs-actions.pod:3555
11593 msgid "guestfs_list_devices"
11597 #: ../src/guestfs-actions.pod:3557
11601 " guestfs_list_devices (guestfs_h *g);\n"
11606 #: ../src/guestfs-actions.pod:3560 ../fish/guestfish-actions.pod:2482
11607 msgid "List all the block devices."
11611 #: ../src/guestfs-actions.pod:3562 ../fish/guestfish-actions.pod:2484
11612 msgid "The full block device names are returned, eg. C</dev/sda>."
11616 #: ../src/guestfs-actions.pod:3572
11617 msgid "guestfs_list_filesystems"
11621 #: ../src/guestfs-actions.pod:3574
11625 " guestfs_list_filesystems (guestfs_h *g);\n"
11630 #: ../src/guestfs-actions.pod:3577 ../fish/guestfish-actions.pod:2492
11632 "This inspection command looks for filesystems on partitions, block devices "
11633 "and logical volumes, returning a list of devices containing filesystems and "
11638 #: ../src/guestfs-actions.pod:3581 ../fish/guestfish-actions.pod:2496
11640 "The return value is a hash, where the keys are the devices containing "
11641 "filesystems, and the values are the filesystem types. For example:"
11645 #: ../src/guestfs-actions.pod:3585 ../fish/guestfish-actions.pod:2500
11648 " \"/dev/sda1\" => \"ntfs\"\n"
11649 " \"/dev/sda2\" => \"ext2\"\n"
11650 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11651 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11656 #: ../src/guestfs-actions.pod:3590 ../fish/guestfish-actions.pod:2505
11658 "The value can have the special value \"unknown\", meaning the content of the "
11659 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11663 #: ../src/guestfs-actions.pod:3594
11665 "This command runs other libguestfs commands, which might include "
11666 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
11667 "soon after launch and only when nothing is mounted."
11671 #: ../src/guestfs-actions.pod:3598
11673 "Not all of the filesystems returned will be mountable. In particular, swap "
11674 "partitions are returned in the list. Also this command does not check that "
11675 "each filesystem found is valid and mountable, and some filesystems might be "
11676 "mountable but require special options. Filesystems may not all belong to a "
11677 "single logical operating system (use C<guestfs_inspect_os> to look for "
11682 #: ../src/guestfs-actions.pod:3612 ../src/guestfs-actions.pod:5217
11683 msgid "(Added in 1.5.15)"
11687 #: ../src/guestfs-actions.pod:3614
11688 msgid "guestfs_list_partitions"
11692 #: ../src/guestfs-actions.pod:3616
11696 " guestfs_list_partitions (guestfs_h *g);\n"
11701 #: ../src/guestfs-actions.pod:3619 ../fish/guestfish-actions.pod:2525
11702 msgid "List all the partitions detected on all block devices."
11706 #: ../src/guestfs-actions.pod:3621 ../fish/guestfish-actions.pod:2527
11707 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11711 #: ../src/guestfs-actions.pod:3623
11713 "This does not return logical volumes. For that you will need to call "
11718 #: ../src/guestfs-actions.pod:3634
11723 #: ../src/guestfs-actions.pod:3636
11727 " guestfs_ll (guestfs_h *g,\n"
11728 " const char *directory);\n"
11733 #: ../src/guestfs-actions.pod:3640 ../fish/guestfish-actions.pod:2538
11735 "List the files in C<directory> (relative to the root directory, there is no "
11736 "cwd) in the format of 'ls -la'."
11740 #: ../src/guestfs-actions.pod:3643 ../fish/guestfish-actions.pod:2541
11742 "This command is mostly useful for interactive sessions. It is I<not> "
11743 "intended that you try to parse the output string."
11747 #: ../src/guestfs-actions.pod:3651
11752 #: ../src/guestfs-actions.pod:3653
11756 " guestfs_ln (guestfs_h *g,\n"
11757 " const char *target,\n"
11758 " const char *linkname);\n"
11763 #: ../src/guestfs-actions.pod:3658 ../fish/guestfish-actions.pod:2548
11764 msgid "This command creates a hard link using the C<ln> command."
11768 #: ../src/guestfs-actions.pod:3664
11769 msgid "guestfs_ln_f"
11773 #: ../src/guestfs-actions.pod:3666
11777 " guestfs_ln_f (guestfs_h *g,\n"
11778 " const char *target,\n"
11779 " const char *linkname);\n"
11784 #: ../src/guestfs-actions.pod:3671 ../fish/guestfish-actions.pod:2554
11786 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11787 "option removes the link (C<linkname>) if it exists already."
11791 #: ../src/guestfs-actions.pod:3678
11792 msgid "guestfs_ln_s"
11796 #: ../src/guestfs-actions.pod:3680
11800 " guestfs_ln_s (guestfs_h *g,\n"
11801 " const char *target,\n"
11802 " const char *linkname);\n"
11807 #: ../src/guestfs-actions.pod:3685 ../fish/guestfish-actions.pod:2561
11808 msgid "This command creates a symbolic link using the C<ln -s> command."
11812 #: ../src/guestfs-actions.pod:3691
11813 msgid "guestfs_ln_sf"
11817 #: ../src/guestfs-actions.pod:3693
11821 " guestfs_ln_sf (guestfs_h *g,\n"
11822 " const char *target,\n"
11823 " const char *linkname);\n"
11828 #: ../src/guestfs-actions.pod:3698 ../fish/guestfish-actions.pod:2567
11830 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11831 "option removes the link (C<linkname>) if it exists already."
11835 #: ../src/guestfs-actions.pod:3705
11836 msgid "guestfs_lremovexattr"
11840 #: ../src/guestfs-actions.pod:3707
11844 " guestfs_lremovexattr (guestfs_h *g,\n"
11845 " const char *xattr,\n"
11846 " const char *path);\n"
11851 #: ../src/guestfs-actions.pod:3712
11853 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
11854 "link, then it removes an extended attribute of the link itself."
11858 #: ../src/guestfs-actions.pod:3720
11863 #: ../src/guestfs-actions.pod:3722
11867 " guestfs_ls (guestfs_h *g,\n"
11868 " const char *directory);\n"
11873 #: ../src/guestfs-actions.pod:3726 ../fish/guestfish-actions.pod:2582
11875 "List the files in C<directory> (relative to the root directory, there is no "
11876 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11881 #: ../src/guestfs-actions.pod:3730
11883 "This command is mostly useful for interactive sessions. Programs should "
11884 "probably use C<guestfs_readdir> instead."
11888 #: ../src/guestfs-actions.pod:3739
11889 msgid "guestfs_lsetxattr"
11893 #: ../src/guestfs-actions.pod:3741
11897 " guestfs_lsetxattr (guestfs_h *g,\n"
11898 " const char *xattr,\n"
11899 " const char *val,\n"
11901 " const char *path);\n"
11906 #: ../src/guestfs-actions.pod:3748
11908 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
11909 "then it sets an extended attribute of the link itself."
11913 #: ../src/guestfs-actions.pod:3756
11914 msgid "guestfs_lstat"
11918 #: ../src/guestfs-actions.pod:3758
11921 " struct guestfs_stat *\n"
11922 " guestfs_lstat (guestfs_h *g,\n"
11923 " const char *path);\n"
11928 #: ../src/guestfs-actions.pod:3762 ../src/guestfs-actions.pod:6320 ../fish/guestfish-actions.pod:2601 ../fish/guestfish-actions.pod:4270
11929 msgid "Returns file information for the given C<path>."
11933 #: ../src/guestfs-actions.pod:3764
11935 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
11936 "link, then the link is stat-ed, not the file it refers to."
11940 #: ../src/guestfs-actions.pod:3768 ../fish/guestfish-actions.pod:2607
11941 msgid "This is the same as the C<lstat(2)> system call."
11945 #: ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:6324
11947 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
11948 "error. I<The caller must call C<guestfs_free_stat> after use>."
11952 #: ../src/guestfs-actions.pod:3774 ../src/guestfs-actions.pod:6328 ../src/guestfs-actions.pod:6346 ../src/guestfs-actions.pod:6727
11953 msgid "(Added in 0.9.2)"
11957 #: ../src/guestfs-actions.pod:3776
11958 msgid "guestfs_lstatlist"
11962 #: ../src/guestfs-actions.pod:3778
11965 " struct guestfs_stat_list *\n"
11966 " guestfs_lstatlist (guestfs_h *g,\n"
11967 " const char *path,\n"
11968 " char *const *names);\n"
11973 #: ../src/guestfs-actions.pod:3783
11975 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
11976 "files, where all files are in the directory C<path>. C<names> is the list "
11977 "of files from this directory."
11981 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2617
11983 "On return you get a list of stat structs, with a one-to-one correspondence "
11984 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11985 "then the C<ino> field of that structure is set to C<-1>."
11989 #: ../src/guestfs-actions.pod:3792
11991 "This call is intended for programs that want to efficiently list a directory "
11992 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
11993 "for a similarly efficient call for getting extended attributes. Very long "
11994 "directory listings might cause the protocol message size to be exceeded, "
11995 "causing this call to fail. The caller must split up such requests into "
11996 "smaller groups of names."
12000 #: ../src/guestfs-actions.pod:3800
12002 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
12003 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
12007 #: ../src/guestfs-actions.pod:3806
12008 msgid "guestfs_luks_add_key"
12012 #: ../src/guestfs-actions.pod:3808
12016 " guestfs_luks_add_key (guestfs_h *g,\n"
12017 " const char *device,\n"
12018 " const char *key,\n"
12019 " const char *newkey,\n"
12025 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2634
12027 "This command adds a new key on LUKS device C<device>. C<key> is any "
12028 "existing key, and is used to access the device. C<newkey> is the new key to "
12029 "add. C<keyslot> is the key slot that will be replaced."
12033 #: ../src/guestfs-actions.pod:3820
12035 "Note that if C<keyslot> already contains a key, then this command will "
12036 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
12040 #: ../src/guestfs-actions.pod:3826 ../src/guestfs-actions.pod:3866 ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3909 ../src/guestfs-actions.pod:3941 ../src/guestfs-actions.pod:3960
12042 "This function takes a key or passphrase parameter which could contain "
12043 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
12048 #: ../src/guestfs-actions.pod:3830 ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3913
12049 msgid "(Added in 1.5.2)"
12053 #: ../src/guestfs-actions.pod:3832
12054 msgid "guestfs_luks_close"
12058 #: ../src/guestfs-actions.pod:3834
12062 " guestfs_luks_close (guestfs_h *g,\n"
12063 " const char *device);\n"
12068 #: ../src/guestfs-actions.pod:3838
12070 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
12071 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
12072 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
12073 "underlying block device."
12077 #: ../src/guestfs-actions.pod:3846 ../src/guestfs-actions.pod:3945 ../src/guestfs-actions.pod:3964 ../src/guestfs-actions.pod:4014 ../src/guestfs-actions.pod:4062
12078 msgid "(Added in 1.5.1)"
12082 #: ../src/guestfs-actions.pod:3848
12083 msgid "guestfs_luks_format"
12087 #: ../src/guestfs-actions.pod:3850
12091 " guestfs_luks_format (guestfs_h *g,\n"
12092 " const char *device,\n"
12093 " const char *key,\n"
12099 #: ../src/guestfs-actions.pod:3856 ../fish/guestfish-actions.pod:2660
12101 "This command erases existing data on C<device> and formats the device as a "
12102 "LUKS encrypted device. C<key> is the initial key, which is added to key "
12103 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
12107 #: ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:3886 ../src/guestfs-actions.pod:4026 ../src/guestfs-actions.pod:4968 ../src/guestfs-actions.pod:5748 ../src/guestfs-actions.pod:6155 ../src/guestfs-actions.pod:6178 ../src/guestfs-actions.pod:6204 ../src/guestfs-actions.pod:7364 ../fish/guestfish-actions.pod:2668 ../fish/guestfish-actions.pod:2681 ../fish/guestfish-actions.pod:2765 ../fish/guestfish-actions.pod:3339 ../fish/guestfish-actions.pod:3859 ../fish/guestfish-actions.pod:4169 ../fish/guestfish-actions.pod:4185 ../fish/guestfish-actions.pod:4200 ../fish/guestfish-actions.pod:4915
12109 "B<This command is dangerous. Without careful use you can easily destroy all "
12114 #: ../src/guestfs-actions.pod:3872
12115 msgid "guestfs_luks_format_cipher"
12119 #: ../src/guestfs-actions.pod:3874
12123 " guestfs_luks_format_cipher (guestfs_h *g,\n"
12124 " const char *device,\n"
12125 " const char *key,\n"
12127 " const char *cipher);\n"
12132 #: ../src/guestfs-actions.pod:3881
12134 "This command is the same as C<guestfs_luks_format> but it also allows you to "
12135 "set the C<cipher> used."
12139 #: ../src/guestfs-actions.pod:3895
12140 msgid "guestfs_luks_kill_slot"
12144 #: ../src/guestfs-actions.pod:3897
12148 " guestfs_luks_kill_slot (guestfs_h *g,\n"
12149 " const char *device,\n"
12150 " const char *key,\n"
12156 #: ../src/guestfs-actions.pod:3903 ../fish/guestfish-actions.pod:2688
12158 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
12159 "device C<device>. C<key> must be one of the I<other> keys."
12163 #: ../src/guestfs-actions.pod:3915
12164 msgid "guestfs_luks_open"
12168 #: ../src/guestfs-actions.pod:3917
12172 " guestfs_luks_open (guestfs_h *g,\n"
12173 " const char *device,\n"
12174 " const char *key,\n"
12175 " const char *mapname);\n"
12180 #: ../src/guestfs-actions.pod:3923 ../fish/guestfish-actions.pod:2699
12182 "This command opens a block device which has been encrypted according to the "
12183 "Linux Unified Key Setup (LUKS) standard."
12187 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:2702
12188 msgid "C<device> is the encrypted block device or partition."
12192 #: ../src/guestfs-actions.pod:3928 ../fish/guestfish-actions.pod:2704
12194 "The caller must supply one of the keys associated with the LUKS block "
12195 "device, in the C<key> parameter."
12199 #: ../src/guestfs-actions.pod:3931 ../fish/guestfish-actions.pod:2707
12201 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
12202 "writes to this block device are decrypted from and encrypted to the "
12203 "underlying C<device> respectively."
12207 #: ../src/guestfs-actions.pod:3935
12209 "If this block device contains LVM volume groups, then calling "
12210 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
12215 #: ../src/guestfs-actions.pod:3947
12216 msgid "guestfs_luks_open_ro"
12220 #: ../src/guestfs-actions.pod:3949
12224 " guestfs_luks_open_ro (guestfs_h *g,\n"
12225 " const char *device,\n"
12226 " const char *key,\n"
12227 " const char *mapname);\n"
12232 #: ../src/guestfs-actions.pod:3955
12234 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
12239 #: ../src/guestfs-actions.pod:3966
12240 msgid "guestfs_lvcreate"
12244 #: ../src/guestfs-actions.pod:3968
12248 " guestfs_lvcreate (guestfs_h *g,\n"
12249 " const char *logvol,\n"
12250 " const char *volgroup,\n"
12256 #: ../src/guestfs-actions.pod:3974 ../fish/guestfish-actions.pod:2732
12258 "This creates an LVM logical volume called C<logvol> on the volume group "
12259 "C<volgroup>, with C<size> megabytes."
12263 #: ../src/guestfs-actions.pod:3981
12264 msgid "guestfs_lvm_canonical_lv_name"
12268 #: ../src/guestfs-actions.pod:3983
12272 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
12273 " const char *lvname);\n"
12278 #: ../src/guestfs-actions.pod:3987 ../fish/guestfish-actions.pod:2739
12280 "This converts alternative naming schemes for LVs that you might find to the "
12281 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
12286 #: ../src/guestfs-actions.pod:3991 ../fish/guestfish-actions.pod:2743
12288 "This command returns an error if the C<lvname> parameter does not refer to a "
12293 #: ../src/guestfs-actions.pod:3994
12294 msgid "See also C<guestfs_is_lv>."
12298 #: ../src/guestfs-actions.pod:3999
12299 msgid "(Added in 1.5.24)"
12303 #: ../src/guestfs-actions.pod:4001
12304 msgid "guestfs_lvm_clear_filter"
12308 #: ../src/guestfs-actions.pod:4003
12312 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
12317 #: ../src/guestfs-actions.pod:4006
12319 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
12320 "see every block device."
12324 #: ../src/guestfs-actions.pod:4009 ../src/guestfs-actions.pod:4051 ../fish/guestfish-actions.pod:2755 ../fish/guestfish-actions.pod:2786
12325 msgid "This command also clears the LVM cache and performs a volume group scan."
12329 #: ../src/guestfs-actions.pod:4016
12330 msgid "guestfs_lvm_remove_all"
12334 #: ../src/guestfs-actions.pod:4018
12338 " guestfs_lvm_remove_all (guestfs_h *g);\n"
12343 #: ../src/guestfs-actions.pod:4021 ../fish/guestfish-actions.pod:2762
12345 "This command removes all LVM logical volumes, volume groups and physical "
12350 #: ../src/guestfs-actions.pod:4031
12351 msgid "guestfs_lvm_set_filter"
12355 #: ../src/guestfs-actions.pod:4033
12359 " guestfs_lvm_set_filter (guestfs_h *g,\n"
12360 " char *const *devices);\n"
12365 #: ../src/guestfs-actions.pod:4037 ../fish/guestfish-actions.pod:2772
12367 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12368 "block devices in the list C<devices>, and will ignore all other attached "
12373 #: ../src/guestfs-actions.pod:4041 ../fish/guestfish-actions.pod:2776
12375 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12376 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12377 "there are two types of duplication possible: either cloned PVs/VGs which "
12378 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12379 "same name. In normal operation you cannot create this situation, but you "
12380 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12381 "inside the LVM metadata."
12385 #: ../src/guestfs-actions.pod:4054 ../fish/guestfish-actions.pod:2789
12386 msgid "You can filter whole block devices or individual partitions."
12390 #: ../src/guestfs-actions.pod:4056 ../fish/guestfish-actions.pod:2791
12392 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12393 "filesystem), even if you are not filtering out that VG."
12397 #: ../src/guestfs-actions.pod:4064
12398 msgid "guestfs_lvremove"
12402 #: ../src/guestfs-actions.pod:4066
12406 " guestfs_lvremove (guestfs_h *g,\n"
12407 " const char *device);\n"
12412 #: ../src/guestfs-actions.pod:4070 ../fish/guestfish-actions.pod:2799
12414 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12415 "LV, such as C</dev/VG/LV>."
12419 #: ../src/guestfs-actions.pod:4073 ../fish/guestfish-actions.pod:2802
12421 "You can also remove all LVs in a volume group by specifying the VG name, "
12426 #: ../src/guestfs-actions.pod:4078 ../src/guestfs-actions.pod:5314 ../src/guestfs-actions.pod:7103
12427 msgid "(Added in 1.0.13)"
12431 #: ../src/guestfs-actions.pod:4080
12432 msgid "guestfs_lvrename"
12436 #: ../src/guestfs-actions.pod:4082
12440 " guestfs_lvrename (guestfs_h *g,\n"
12441 " const char *logvol,\n"
12442 " const char *newlogvol);\n"
12447 #: ../src/guestfs-actions.pod:4087 ../fish/guestfish-actions.pod:2809
12448 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12452 #: ../src/guestfs-actions.pod:4091 ../src/guestfs-actions.pod:7116
12453 msgid "(Added in 1.0.83)"
12457 #: ../src/guestfs-actions.pod:4093
12458 msgid "guestfs_lvresize"
12462 #: ../src/guestfs-actions.pod:4095
12466 " guestfs_lvresize (guestfs_h *g,\n"
12467 " const char *device,\n"
12473 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:2815
12475 "This resizes (expands or shrinks) an existing LVM logical volume to "
12476 "C<mbytes>. When reducing, data in the reduced part is lost."
12480 #: ../src/guestfs-actions.pod:4108
12481 msgid "guestfs_lvresize_free"
12485 #: ../src/guestfs-actions.pod:4110
12489 " guestfs_lvresize_free (guestfs_h *g,\n"
12490 " const char *lv,\n"
12496 #: ../src/guestfs-actions.pod:4115 ../fish/guestfish-actions.pod:2823
12498 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12499 "remaining free space in the volume group. Commonly you would call this with "
12500 "pc = 100 which expands the logical volume as much as possible, using all "
12501 "remaining free space in the volume group."
12505 #: ../src/guestfs-actions.pod:4123
12506 msgid "(Added in 1.3.3)"
12510 #: ../src/guestfs-actions.pod:4125
12511 msgid "guestfs_lvs"
12515 #: ../src/guestfs-actions.pod:4127
12519 " guestfs_lvs (guestfs_h *g);\n"
12524 #: ../src/guestfs-actions.pod:4130 ../fish/guestfish-actions.pod:2833
12526 "List all the logical volumes detected. This is the equivalent of the "
12527 "L<lvs(8)> command."
12531 #: ../src/guestfs-actions.pod:4133 ../fish/guestfish-actions.pod:2836
12533 "This returns a list of the logical volume device names "
12534 "(eg. C</dev/VolGroup00/LogVol00>)."
12538 #: ../src/guestfs-actions.pod:4136
12539 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
12543 #: ../src/guestfs-actions.pod:4144
12544 msgid "guestfs_lvs_full"
12548 #: ../src/guestfs-actions.pod:4146
12551 " struct guestfs_lvm_lv_list *\n"
12552 " guestfs_lvs_full (guestfs_h *g);\n"
12557 #: ../src/guestfs-actions.pod:4149 ../fish/guestfish-actions.pod:2845
12559 "List all the logical volumes detected. This is the equivalent of the "
12560 "L<lvs(8)> command. The \"full\" version includes all fields."
12564 #: ../src/guestfs-actions.pod:4152
12566 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
12567 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
12572 #: ../src/guestfs-actions.pod:4158
12573 msgid "guestfs_lvuuid"
12577 #: ../src/guestfs-actions.pod:4160
12581 " guestfs_lvuuid (guestfs_h *g,\n"
12582 " const char *device);\n"
12587 #: ../src/guestfs-actions.pod:4164 ../fish/guestfish-actions.pod:2852
12588 msgid "This command returns the UUID of the LVM LV C<device>."
12592 #: ../src/guestfs-actions.pod:4171
12593 msgid "guestfs_lxattrlist"
12597 #: ../src/guestfs-actions.pod:4173
12600 " struct guestfs_xattr_list *\n"
12601 " guestfs_lxattrlist (guestfs_h *g,\n"
12602 " const char *path,\n"
12603 " char *const *names);\n"
12608 #: ../src/guestfs-actions.pod:4178 ../fish/guestfish-actions.pod:2858
12610 "This call allows you to get the extended attributes of multiple files, where "
12611 "all files are in the directory C<path>. C<names> is the list of files from "
12616 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:2862
12618 "On return you get a flat list of xattr structs which must be interpreted "
12619 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12620 "C<attrval> in this struct is zero-length to indicate there was an error "
12621 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12622 "number (the number of following attributes for this file, which could be "
12623 "C<\"0\">). Then after the first xattr struct are the zero or more "
12624 "attributes for the first named file. This repeats for the second and "
12625 "subsequent files."
12629 #: ../src/guestfs-actions.pod:4192
12631 "This call is intended for programs that want to efficiently list a directory "
12632 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
12633 "a similarly efficient call for getting standard stats. Very long directory "
12634 "listings might cause the protocol message size to be exceeded, causing this "
12635 "call to fail. The caller must split up such requests into smaller groups of "
12640 #: ../src/guestfs-actions.pod:4206
12641 msgid "guestfs_mkdir"
12645 #: ../src/guestfs-actions.pod:4208
12649 " guestfs_mkdir (guestfs_h *g,\n"
12650 " const char *path);\n"
12655 #: ../src/guestfs-actions.pod:4212 ../fish/guestfish-actions.pod:2884
12656 msgid "Create a directory named C<path>."
12660 #: ../src/guestfs-actions.pod:4218
12661 msgid "guestfs_mkdir_mode"
12665 #: ../src/guestfs-actions.pod:4220
12669 " guestfs_mkdir_mode (guestfs_h *g,\n"
12670 " const char *path,\n"
12676 #: ../src/guestfs-actions.pod:4225 ../fish/guestfish-actions.pod:2890
12678 "This command creates a directory, setting the initial permissions of the "
12679 "directory to C<mode>."
12683 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:2893
12685 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12686 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12691 #: ../src/guestfs-actions.pod:4232
12692 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
12696 #: ../src/guestfs-actions.pod:4238
12697 msgid "guestfs_mkdir_p"
12701 #: ../src/guestfs-actions.pod:4240
12705 " guestfs_mkdir_p (guestfs_h *g,\n"
12706 " const char *path);\n"
12711 #: ../src/guestfs-actions.pod:4244 ../fish/guestfish-actions.pod:2903
12713 "Create a directory named C<path>, creating any parent directories as "
12714 "necessary. This is like the C<mkdir -p> shell command."
12718 #: ../src/guestfs-actions.pod:4251
12719 msgid "guestfs_mkdtemp"
12723 #: ../src/guestfs-actions.pod:4253
12727 " guestfs_mkdtemp (guestfs_h *g,\n"
12728 " const char *template);\n"
12733 #: ../src/guestfs-actions.pod:4257 ../fish/guestfish-actions.pod:2910
12735 "This command creates a temporary directory. The C<template> parameter "
12736 "should be a full pathname for the temporary directory name with the final "
12737 "six characters being \"XXXXXX\"."
12741 #: ../src/guestfs-actions.pod:4262 ../fish/guestfish-actions.pod:2915
12743 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12744 "being suitable for Windows filesystems."
12748 #: ../src/guestfs-actions.pod:4265 ../fish/guestfish-actions.pod:2918
12749 msgid "The name of the temporary directory that was created is returned."
12753 #: ../src/guestfs-actions.pod:4268 ../fish/guestfish-actions.pod:2921
12754 msgid "The temporary directory is created with mode 0700 and is owned by root."
12758 #: ../src/guestfs-actions.pod:4271 ../fish/guestfish-actions.pod:2924
12760 "The caller is responsible for deleting the temporary directory and its "
12761 "contents after use."
12765 #: ../src/guestfs-actions.pod:4274 ../fish/guestfish-actions.pod:2927
12766 msgid "See also: L<mkdtemp(3)>"
12770 #: ../src/guestfs-actions.pod:4281
12771 msgid "guestfs_mke2fs_J"
12775 #: ../src/guestfs-actions.pod:4283
12779 " guestfs_mke2fs_J (guestfs_h *g,\n"
12780 " const char *fstype,\n"
12781 " int blocksize,\n"
12782 " const char *device,\n"
12783 " const char *journal);\n"
12788 #: ../src/guestfs-actions.pod:4290 ../fish/guestfish-actions.pod:2933
12790 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12791 "C<journal>. It is equivalent to the command:"
12795 #: ../src/guestfs-actions.pod:4294 ../fish/guestfish-actions.pod:2937
12798 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12803 #: ../src/guestfs-actions.pod:4296
12804 msgid "See also C<guestfs_mke2journal>."
12808 #: ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4318 ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:4366 ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4439 ../src/guestfs-actions.pod:4704
12809 msgid "(Added in 1.0.68)"
12813 #: ../src/guestfs-actions.pod:4302
12814 msgid "guestfs_mke2fs_JL"
12818 #: ../src/guestfs-actions.pod:4304
12822 " guestfs_mke2fs_JL (guestfs_h *g,\n"
12823 " const char *fstype,\n"
12824 " int blocksize,\n"
12825 " const char *device,\n"
12826 " const char *label);\n"
12831 #: ../src/guestfs-actions.pod:4311 ../fish/guestfish-actions.pod:2945
12833 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12834 "the journal labeled C<label>."
12838 #: ../src/guestfs-actions.pod:4314
12839 msgid "See also C<guestfs_mke2journal_L>."
12843 #: ../src/guestfs-actions.pod:4320
12844 msgid "guestfs_mke2fs_JU"
12848 #: ../src/guestfs-actions.pod:4322
12852 " guestfs_mke2fs_JU (guestfs_h *g,\n"
12853 " const char *fstype,\n"
12854 " int blocksize,\n"
12855 " const char *device,\n"
12856 " const char *uuid);\n"
12861 #: ../src/guestfs-actions.pod:4329 ../fish/guestfish-actions.pod:2954
12863 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12864 "the journal with UUID C<uuid>."
12868 #: ../src/guestfs-actions.pod:4332
12869 msgid "See also C<guestfs_mke2journal_U>."
12873 #: ../src/guestfs-actions.pod:4338
12874 msgid "guestfs_mke2journal"
12878 #: ../src/guestfs-actions.pod:4340
12882 " guestfs_mke2journal (guestfs_h *g,\n"
12883 " int blocksize,\n"
12884 " const char *device);\n"
12889 #: ../src/guestfs-actions.pod:4345 ../fish/guestfish-actions.pod:2963
12891 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12896 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2966
12899 " mke2fs -O journal_dev -b blocksize device\n"
12904 #: ../src/guestfs-actions.pod:4354
12905 msgid "guestfs_mke2journal_L"
12909 #: ../src/guestfs-actions.pod:4356
12913 " guestfs_mke2journal_L (guestfs_h *g,\n"
12914 " int blocksize,\n"
12915 " const char *label,\n"
12916 " const char *device);\n"
12921 #: ../src/guestfs-actions.pod:4362 ../fish/guestfish-actions.pod:2972
12922 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12926 #: ../src/guestfs-actions.pod:4368
12927 msgid "guestfs_mke2journal_U"
12931 #: ../src/guestfs-actions.pod:4370
12935 " guestfs_mke2journal_U (guestfs_h *g,\n"
12936 " int blocksize,\n"
12937 " const char *uuid,\n"
12938 " const char *device);\n"
12943 #: ../src/guestfs-actions.pod:4376 ../fish/guestfish-actions.pod:2978
12944 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12948 #: ../src/guestfs-actions.pod:4382
12949 msgid "guestfs_mkfifo"
12953 #: ../src/guestfs-actions.pod:4384
12957 " guestfs_mkfifo (guestfs_h *g,\n"
12959 " const char *path);\n"
12964 #: ../src/guestfs-actions.pod:4389
12966 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12967 "is just a convenient wrapper around C<guestfs_mknod>."
12971 #: ../src/guestfs-actions.pod:4399
12972 msgid "guestfs_mkfs"
12976 #: ../src/guestfs-actions.pod:4401
12980 " guestfs_mkfs (guestfs_h *g,\n"
12981 " const char *fstype,\n"
12982 " const char *device);\n"
12987 #: ../src/guestfs-actions.pod:4406 ../fish/guestfish-actions.pod:2994
12989 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12990 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12994 #: ../src/guestfs-actions.pod:4414
12995 msgid "guestfs_mkfs_b"
12999 #: ../src/guestfs-actions.pod:4416
13003 " guestfs_mkfs_b (guestfs_h *g,\n"
13004 " const char *fstype,\n"
13005 " int blocksize,\n"
13006 " const char *device);\n"
13011 #: ../src/guestfs-actions.pod:4422
13013 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
13014 "block size of the resulting filesystem. Supported block sizes depend on the "
13015 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
13019 #: ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:4470 ../fish/guestfish-actions.pod:3007 ../fish/guestfish-actions.pod:3034
13021 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
13026 #: ../src/guestfs-actions.pod:4432 ../fish/guestfish-actions.pod:3010
13028 "This function is deprecated. In new code, use the C<mkfs_opts> call "
13033 #: ../src/guestfs-actions.pod:4441
13034 msgid "guestfs_mkfs_opts"
13038 #: ../src/guestfs-actions.pod:4443
13042 " guestfs_mkfs_opts (guestfs_h *g,\n"
13043 " const char *fstype,\n"
13044 " const char *device,\n"
13050 #: ../src/guestfs-actions.pod:4454
13053 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
13054 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
13059 #: ../src/guestfs-actions.pod:4457 ../fish/guestfish-actions.pod:3021
13061 "This function creates a filesystem on C<device>. The filesystem type is "
13062 "C<fstype>, for example C<ext3>."
13066 #: ../src/guestfs-actions.pod:4464 ../fish/guestfish-actions.pod:3028
13067 msgid "C<blocksize>"
13071 #: ../src/guestfs-actions.pod:4466 ../fish/guestfish-actions.pod:3030
13073 "The filesystem block size. Supported block sizes depend on the filesystem "
13074 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
13079 #: ../src/guestfs-actions.pod:4473 ../fish/guestfish-actions.pod:3037
13080 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
13084 #: ../src/guestfs-actions.pod:4475 ../fish/guestfish-actions.pod:3039
13085 msgid "C<features>"
13089 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3041
13090 msgid "This passes the I<-O> parameter to the external mkfs program."
13094 #: ../src/guestfs-actions.pod:4479 ../fish/guestfish-actions.pod:3043
13096 "For certain filesystem types, this allows extra filesystem features to be "
13097 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
13101 #: ../src/guestfs-actions.pod:4483 ../fish/guestfish-actions.pod:3047
13103 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
13108 #: ../src/guestfs-actions.pod:4490
13109 msgid "(Added in 1.7.19)"
13113 #: ../src/guestfs-actions.pod:4492
13114 msgid "guestfs_mkfs_opts_va"
13118 #: ../src/guestfs-actions.pod:4494
13122 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
13123 " const char *fstype,\n"
13124 " const char *device,\n"
13125 " va_list args);\n"
13130 #: ../src/guestfs-actions.pod:4500
13131 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
13135 #: ../src/guestfs-actions.pod:4504
13136 msgid "guestfs_mkfs_opts_argv"
13140 #: ../src/guestfs-actions.pod:4506
13144 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
13145 " const char *fstype,\n"
13146 " const char *device,\n"
13147 " const struct guestfs_mkfs_opts_argv *optargs);\n"
13152 #: ../src/guestfs-actions.pod:4512
13153 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
13157 #: ../src/guestfs-actions.pod:4516
13158 msgid "guestfs_mkmountpoint"
13162 #: ../src/guestfs-actions.pod:4518
13166 " guestfs_mkmountpoint (guestfs_h *g,\n"
13167 " const char *exemptpath);\n"
13172 #: ../src/guestfs-actions.pod:4522
13174 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
13175 "that can be used to create extra mountpoints before mounting the first "
13180 #: ../src/guestfs-actions.pod:4526 ../fish/guestfish-actions.pod:3062
13182 "These calls are I<only> necessary in some very limited circumstances, mainly "
13183 "the case where you want to mount a mix of unrelated and/or read-only "
13184 "filesystems together."
13188 #: ../src/guestfs-actions.pod:4530 ../fish/guestfish-actions.pod:3066
13190 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
13191 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
13192 "inside that. You can unpack this as follows in guestfish:"
13196 #: ../src/guestfs-actions.pod:4535 ../fish/guestfish-actions.pod:3071
13199 " add-ro Fedora-11-i686-Live.iso\n"
13201 " mkmountpoint /cd\n"
13202 " mkmountpoint /sqsh\n"
13203 " mkmountpoint /ext3fs\n"
13204 " mount /dev/sda /cd\n"
13205 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
13206 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
13211 #: ../src/guestfs-actions.pod:4544 ../fish/guestfish-actions.pod:3080
13212 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
13216 #: ../src/guestfs-actions.pod:4546
13218 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
13219 "may get unexpected errors if you try to mix these calls. It is safest to "
13220 "manually unmount filesystems and remove mountpoints after use."
13224 #: ../src/guestfs-actions.pod:4550
13226 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
13227 "first, so for this to work for manual mountpoints, you must ensure that the "
13228 "innermost mountpoints have the longest pathnames, as in the example code "
13233 #: ../src/guestfs-actions.pod:4555 ../fish/guestfish-actions.pod:3091
13234 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
13238 #: ../src/guestfs-actions.pod:4557
13240 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
13241 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
13242 "can also trigger these issues."
13246 #: ../src/guestfs-actions.pod:4563 ../src/guestfs-actions.pod:4822 ../src/guestfs-actions.pod:5732
13247 msgid "(Added in 1.0.62)"
13251 #: ../src/guestfs-actions.pod:4565
13252 msgid "guestfs_mknod"
13256 #: ../src/guestfs-actions.pod:4567
13260 " guestfs_mknod (guestfs_h *g,\n"
13264 " const char *path);\n"
13269 #: ../src/guestfs-actions.pod:4574 ../fish/guestfish-actions.pod:3101
13271 "This call creates block or character special devices, or named pipes "
13276 #: ../src/guestfs-actions.pod:4577 ../fish/guestfish-actions.pod:3104
13278 "The C<mode> parameter should be the mode, using the standard constants. "
13279 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
13280 "used when creating block and character special devices."
13284 #: ../src/guestfs-actions.pod:4582
13286 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
13287 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
13288 "regular file). These constants are available in the standard Linux header "
13289 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
13290 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
13291 "the appropriate constant for you."
13295 #: ../src/guestfs-actions.pod:4596
13296 msgid "guestfs_mknod_b"
13300 #: ../src/guestfs-actions.pod:4598
13304 " guestfs_mknod_b (guestfs_h *g,\n"
13308 " const char *path);\n"
13313 #: ../src/guestfs-actions.pod:4605
13315 "This call creates a block device node called C<path> with mode C<mode> and "
13316 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13317 "wrapper around C<guestfs_mknod>."
13321 #: ../src/guestfs-actions.pod:4615
13322 msgid "guestfs_mknod_c"
13326 #: ../src/guestfs-actions.pod:4617
13330 " guestfs_mknod_c (guestfs_h *g,\n"
13334 " const char *path);\n"
13339 #: ../src/guestfs-actions.pod:4624
13341 "This call creates a char device node called C<path> with mode C<mode> and "
13342 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13343 "wrapper around C<guestfs_mknod>."
13347 #: ../src/guestfs-actions.pod:4634
13348 msgid "guestfs_mkswap"
13352 #: ../src/guestfs-actions.pod:4636
13356 " guestfs_mkswap (guestfs_h *g,\n"
13357 " const char *device);\n"
13362 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3143
13363 msgid "Create a swap partition on C<device>."
13367 #: ../src/guestfs-actions.pod:4646
13368 msgid "guestfs_mkswap_L"
13372 #: ../src/guestfs-actions.pod:4648
13376 " guestfs_mkswap_L (guestfs_h *g,\n"
13377 " const char *label,\n"
13378 " const char *device);\n"
13383 #: ../src/guestfs-actions.pod:4653 ../fish/guestfish-actions.pod:3149
13384 msgid "Create a swap partition on C<device> with label C<label>."
13388 #: ../src/guestfs-actions.pod:4655 ../fish/guestfish-actions.pod:3151
13390 "Note that you cannot attach a swap label to a block device "
13391 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
13392 "the kernel or swap tools."
13396 #: ../src/guestfs-actions.pod:4663
13397 msgid "guestfs_mkswap_U"
13401 #: ../src/guestfs-actions.pod:4665
13405 " guestfs_mkswap_U (guestfs_h *g,\n"
13406 " const char *uuid,\n"
13407 " const char *device);\n"
13412 #: ../src/guestfs-actions.pod:4670 ../fish/guestfish-actions.pod:3159
13413 msgid "Create a swap partition on C<device> with UUID C<uuid>."
13417 #: ../src/guestfs-actions.pod:4676
13418 msgid "guestfs_mkswap_file"
13422 #: ../src/guestfs-actions.pod:4678
13426 " guestfs_mkswap_file (guestfs_h *g,\n"
13427 " const char *path);\n"
13432 #: ../src/guestfs-actions.pod:4682 ../fish/guestfish-actions.pod:3165
13433 msgid "Create a swap file."
13437 #: ../src/guestfs-actions.pod:4684
13439 "This command just writes a swap file signature to an existing file. To "
13440 "create the file itself, use something like C<guestfs_fallocate>."
13444 #: ../src/guestfs-actions.pod:4691
13445 msgid "guestfs_modprobe"
13449 #: ../src/guestfs-actions.pod:4693
13453 " guestfs_modprobe (guestfs_h *g,\n"
13454 " const char *modulename);\n"
13459 #: ../src/guestfs-actions.pod:4697 ../fish/guestfish-actions.pod:3174
13460 msgid "This loads a kernel module in the appliance."
13464 #: ../src/guestfs-actions.pod:4699 ../fish/guestfish-actions.pod:3176
13466 "The kernel module must have been whitelisted when libguestfs was built (see "
13467 "C<appliance/kmod.whitelist.in> in the source)."
13471 #: ../src/guestfs-actions.pod:4706
13472 msgid "guestfs_mount"
13476 #: ../src/guestfs-actions.pod:4708
13480 " guestfs_mount (guestfs_h *g,\n"
13481 " const char *device,\n"
13482 " const char *mountpoint);\n"
13487 #: ../src/guestfs-actions.pod:4713 ../fish/guestfish-actions.pod:3183
13489 "Mount a guest disk at a position in the filesystem. Block devices are named "
13490 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
13491 "those block devices contain partitions, they will have the usual names "
13492 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
13496 #: ../src/guestfs-actions.pod:4719 ../fish/guestfish-actions.pod:3189
13498 "The rules are the same as for L<mount(2)>: A filesystem must first be "
13499 "mounted on C</> before others can be mounted. Other filesystems can only be "
13500 "mounted on directories which already exist."
13504 #: ../src/guestfs-actions.pod:4724 ../fish/guestfish-actions.pod:3194
13506 "The mounted filesystem is writable, if we have sufficient permissions on the "
13507 "underlying device."
13511 #: ../src/guestfs-actions.pod:4727
13513 "B<Important note:> When you use this call, the filesystem options C<sync> "
13514 "and C<noatime> are set implicitly. This was originally done because we "
13515 "thought it would improve reliability, but it turns out that I<-o sync> has a "
13516 "very large negative performance impact and negligible effect on "
13517 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
13518 "in any code that needs performance, and instead use C<guestfs_mount_options> "
13519 "(use an empty string for the first parameter if you don't want any options)."
13523 #: ../src/guestfs-actions.pod:4741
13524 msgid "guestfs_mount_loop"
13528 #: ../src/guestfs-actions.pod:4743
13532 " guestfs_mount_loop (guestfs_h *g,\n"
13533 " const char *file,\n"
13534 " const char *mountpoint);\n"
13539 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3211
13541 "This command lets you mount C<file> (a filesystem image in a file) on a "
13542 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13547 #: ../src/guestfs-actions.pod:4756
13548 msgid "guestfs_mount_options"
13552 #: ../src/guestfs-actions.pod:4758
13556 " guestfs_mount_options (guestfs_h *g,\n"
13557 " const char *options,\n"
13558 " const char *device,\n"
13559 " const char *mountpoint);\n"
13564 #: ../src/guestfs-actions.pod:4764
13566 "This is the same as the C<guestfs_mount> command, but it allows you to set "
13567 "the mount options as for the L<mount(8)> I<-o> flag."
13571 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3223
13573 "If the C<options> parameter is an empty string, then no options are passed "
13574 "(all options default to whatever the filesystem uses)."
13578 #: ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:4788 ../src/guestfs-actions.pod:4805
13579 msgid "(Added in 1.0.10)"
13583 #: ../src/guestfs-actions.pod:4776
13584 msgid "guestfs_mount_ro"
13588 #: ../src/guestfs-actions.pod:4778
13592 " guestfs_mount_ro (guestfs_h *g,\n"
13593 " const char *device,\n"
13594 " const char *mountpoint);\n"
13599 #: ../src/guestfs-actions.pod:4783
13601 "This is the same as the C<guestfs_mount> command, but it mounts the "
13602 "filesystem with the read-only (I<-o ro>) flag."
13606 #: ../src/guestfs-actions.pod:4790
13607 msgid "guestfs_mount_vfs"
13611 #: ../src/guestfs-actions.pod:4792
13615 " guestfs_mount_vfs (guestfs_h *g,\n"
13616 " const char *options,\n"
13617 " const char *vfstype,\n"
13618 " const char *device,\n"
13619 " const char *mountpoint);\n"
13624 #: ../src/guestfs-actions.pod:4799
13626 "This is the same as the C<guestfs_mount> command, but it allows you to set "
13627 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
13632 #: ../src/guestfs-actions.pod:4807
13633 msgid "guestfs_mountpoints"
13637 #: ../src/guestfs-actions.pod:4809
13641 " guestfs_mountpoints (guestfs_h *g);\n"
13646 #: ../src/guestfs-actions.pod:4812
13648 "This call is similar to C<guestfs_mounts>. That call returns a list of "
13649 "devices. This one returns a hash table (map) of device name to directory "
13650 "where the device is mounted."
13654 #: ../src/guestfs-actions.pod:4824
13655 msgid "guestfs_mounts"
13659 #: ../src/guestfs-actions.pod:4826
13663 " guestfs_mounts (guestfs_h *g);\n"
13668 #: ../src/guestfs-actions.pod:4829 ../fish/guestfish-actions.pod:3254
13670 "This returns the list of currently mounted filesystems. It returns the list "
13671 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13675 #: ../src/guestfs-actions.pod:4832 ../fish/guestfish-actions.pod:3257
13676 msgid "Some internal mounts are not shown."
13680 #: ../src/guestfs-actions.pod:4834
13681 msgid "See also: C<guestfs_mountpoints>"
13685 #: ../src/guestfs-actions.pod:4842
13690 #: ../src/guestfs-actions.pod:4844
13694 " guestfs_mv (guestfs_h *g,\n"
13695 " const char *src,\n"
13696 " const char *dest);\n"
13701 #: ../src/guestfs-actions.pod:4849 ../fish/guestfish-actions.pod:3265
13703 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13704 "destination filename or destination directory."
13708 #: ../src/guestfs-actions.pod:4856
13709 msgid "guestfs_ntfs_3g_probe"
13713 #: ../src/guestfs-actions.pod:4858
13717 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
13719 " const char *device);\n"
13724 #: ../src/guestfs-actions.pod:4863 ../fish/guestfish-actions.pod:3272
13726 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13727 "C<device> for mountability. (Not all NTFS volumes can be mounted "
13728 "read-write, and some cannot be mounted at all)."
13732 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3276
13734 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13735 "can be mounted read-write. Set it to false if you want to test if the "
13736 "volume can be mounted read-only."
13740 #: ../src/guestfs-actions.pod:4871 ../fish/guestfish-actions.pod:3280
13742 "The return value is an integer which C<0> if the operation would succeed, or "
13743 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13747 #: ../src/guestfs-actions.pod:4877
13748 msgid "(Added in 1.0.43)"
13752 #: ../src/guestfs-actions.pod:4879
13753 msgid "guestfs_ntfsresize"
13757 #: ../src/guestfs-actions.pod:4881
13761 " guestfs_ntfsresize (guestfs_h *g,\n"
13762 " const char *device);\n"
13767 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3288
13769 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13770 "size of the underlying device. See also L<ntfsresize(8)>."
13774 #: ../src/guestfs-actions.pod:4893
13775 msgid "guestfs_ntfsresize_size"
13779 #: ../src/guestfs-actions.pod:4895
13783 " guestfs_ntfsresize_size (guestfs_h *g,\n"
13784 " const char *device,\n"
13785 " int64_t size);\n"
13790 #: ../src/guestfs-actions.pod:4900
13792 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
13793 "to specify the new size (in bytes) explicitly."
13797 #: ../src/guestfs-actions.pod:4905 ../src/guestfs-actions.pod:5341 ../src/guestfs-actions.pod:5414 ../src/guestfs-actions.pod:5680 ../src/guestfs-actions.pod:7251
13798 msgid "(Added in 1.3.14)"
13802 #: ../src/guestfs-actions.pod:4907
13803 msgid "guestfs_part_add"
13807 #: ../src/guestfs-actions.pod:4909
13811 " guestfs_part_add (guestfs_h *g,\n"
13812 " const char *device,\n"
13813 " const char *prlogex,\n"
13814 " int64_t startsect,\n"
13815 " int64_t endsect);\n"
13820 #: ../src/guestfs-actions.pod:4916
13822 "This command adds a partition to C<device>. If there is no partition table "
13823 "on the device, call C<guestfs_part_init> first."
13827 #: ../src/guestfs-actions.pod:4919 ../fish/guestfish-actions.pod:3306
13829 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13830 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13831 "C<logical>) and C<e> (or C<extended>) partition types."
13835 #: ../src/guestfs-actions.pod:4924 ../fish/guestfish-actions.pod:3311
13837 "C<startsect> and C<endsect> are the start and end of the partition in "
13838 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13839 "from the end of the disk (C<-1> is the last sector)."
13843 #: ../src/guestfs-actions.pod:4928
13845 "Creating a partition which covers the whole disk is not so easy. Use "
13846 "C<guestfs_part_disk> to do that."
13850 #: ../src/guestfs-actions.pod:4933 ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:5024 ../src/guestfs-actions.pod:5102 ../src/guestfs-actions.pod:5140 ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5199
13851 msgid "(Added in 1.0.78)"
13855 #: ../src/guestfs-actions.pod:4935
13856 msgid "guestfs_part_del"
13860 #: ../src/guestfs-actions.pod:4937
13864 " guestfs_part_del (guestfs_h *g,\n"
13865 " const char *device,\n"
13871 #: ../src/guestfs-actions.pod:4942 ../fish/guestfish-actions.pod:3322
13872 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13876 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3324
13878 "Note that in the case of MBR partitioning, deleting an extended partition "
13879 "also deletes any logical partitions it contains."
13883 #: ../src/guestfs-actions.pod:4952
13884 msgid "guestfs_part_disk"
13888 #: ../src/guestfs-actions.pod:4954
13892 " guestfs_part_disk (guestfs_h *g,\n"
13893 " const char *device,\n"
13894 " const char *parttype);\n"
13899 #: ../src/guestfs-actions.pod:4959
13901 "This command is simply a combination of C<guestfs_part_init> followed by "
13902 "C<guestfs_part_add> to create a single primary partition covering the whole "
13907 #: ../src/guestfs-actions.pod:4963
13909 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13910 "possible values are described in C<guestfs_part_init>."
13914 #: ../src/guestfs-actions.pod:4973
13915 msgid "guestfs_part_get_bootable"
13919 #: ../src/guestfs-actions.pod:4975
13923 " guestfs_part_get_bootable (guestfs_h *g,\n"
13924 " const char *device,\n"
13930 #: ../src/guestfs-actions.pod:4980 ../fish/guestfish-actions.pod:3346
13932 "This command returns true if the partition C<partnum> on C<device> has the "
13933 "bootable flag set."
13937 #: ../src/guestfs-actions.pod:4983
13938 msgid "See also C<guestfs_part_set_bootable>."
13942 #: ../src/guestfs-actions.pod:4989
13943 msgid "guestfs_part_get_mbr_id"
13947 #: ../src/guestfs-actions.pod:4991
13951 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
13952 " const char *device,\n"
13958 #: ../src/guestfs-actions.pod:4996 ../fish/guestfish-actions.pod:3355
13960 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13961 "partition C<partnum>."
13965 #: ../src/guestfs-actions.pod:4999 ../src/guestfs-actions.pod:5175
13967 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13968 "undefined results for other partition table types (see "
13969 "C<guestfs_part_get_parttype>)."
13973 #: ../src/guestfs-actions.pod:5007
13974 msgid "guestfs_part_get_parttype"
13978 #: ../src/guestfs-actions.pod:5009
13982 " guestfs_part_get_parttype (guestfs_h *g,\n"
13983 " const char *device);\n"
13988 #: ../src/guestfs-actions.pod:5013 ../fish/guestfish-actions.pod:3366
13990 "This command examines the partition table on C<device> and returns the "
13991 "partition table type (format) being used."
13995 #: ../src/guestfs-actions.pod:5016
13997 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13998 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13999 "possible, although unusual. See C<guestfs_part_init> for a full list."
14003 #: ../src/guestfs-actions.pod:5026
14004 msgid "guestfs_part_init"
14008 #: ../src/guestfs-actions.pod:5028
14012 " guestfs_part_init (guestfs_h *g,\n"
14013 " const char *device,\n"
14014 " const char *parttype);\n"
14019 #: ../src/guestfs-actions.pod:5033 ../fish/guestfish-actions.pod:3378
14021 "This creates an empty partition table on C<device> of one of the partition "
14022 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
14023 "(for large disks)."
14027 #: ../src/guestfs-actions.pod:5037
14029 "Initially there are no partitions. Following this, you should call "
14030 "C<guestfs_part_add> for each partition required."
14034 #: ../src/guestfs-actions.pod:5040 ../fish/guestfish-actions.pod:3385
14035 msgid "Possible values for C<parttype> are:"
14039 #: ../src/guestfs-actions.pod:5044 ../fish/guestfish-actions.pod:3389
14040 msgid "B<efi> | B<gpt>"
14044 #: ../src/guestfs-actions.pod:5046 ../fish/guestfish-actions.pod:3391
14045 msgid "Intel EFI / GPT partition table."
14049 #: ../src/guestfs-actions.pod:5048 ../fish/guestfish-actions.pod:3393
14051 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
14052 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
14053 "the C<mbr> format."
14057 #: ../src/guestfs-actions.pod:5052 ../fish/guestfish-actions.pod:3397
14058 msgid "B<mbr> | B<msdos>"
14062 #: ../src/guestfs-actions.pod:5054 ../fish/guestfish-actions.pod:3399
14064 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
14065 "Windows. This partition type will B<only> work for device sizes up to 2 "
14066 "TB. For large disks we recommend using C<gpt>."
14070 #: ../src/guestfs-actions.pod:5061 ../fish/guestfish-actions.pod:3406
14071 msgid "Other partition table types that may work but are not supported include:"
14075 #: ../src/guestfs-actions.pod:5066 ../fish/guestfish-actions.pod:3411
14080 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3413
14081 msgid "AIX disk labels."
14085 #: ../src/guestfs-actions.pod:5070 ../fish/guestfish-actions.pod:3415
14086 msgid "B<amiga> | B<rdb>"
14090 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3417
14091 msgid "Amiga \"Rigid Disk Block\" format."
14095 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3419
14100 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3421
14101 msgid "BSD disk labels."
14105 #: ../src/guestfs-actions.pod:5078 ../fish/guestfish-actions.pod:3423
14110 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3425
14111 msgid "DASD, used on IBM mainframes."
14115 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3427
14120 #: ../src/guestfs-actions.pod:5084 ../fish/guestfish-actions.pod:3429
14121 msgid "MIPS/SGI volumes."
14125 #: ../src/guestfs-actions.pod:5086 ../fish/guestfish-actions.pod:3431
14130 #: ../src/guestfs-actions.pod:5088 ../fish/guestfish-actions.pod:3433
14131 msgid "Old Mac partition format. Modern Macs use C<gpt>."
14135 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3435
14140 #: ../src/guestfs-actions.pod:5092 ../fish/guestfish-actions.pod:3437
14141 msgid "NEC PC-98 format, common in Japan apparently."
14145 #: ../src/guestfs-actions.pod:5094 ../fish/guestfish-actions.pod:3439
14150 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3441
14151 msgid "Sun disk labels."
14155 #: ../src/guestfs-actions.pod:5104
14156 msgid "guestfs_part_list"
14160 #: ../src/guestfs-actions.pod:5106
14163 " struct guestfs_partition_list *\n"
14164 " guestfs_part_list (guestfs_h *g,\n"
14165 " const char *device);\n"
14170 #: ../src/guestfs-actions.pod:5110 ../fish/guestfish-actions.pod:3449
14172 "This command parses the partition table on C<device> and returns the list of "
14173 "partitions found."
14177 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3452
14178 msgid "The fields in the returned structure are:"
14182 #: ../src/guestfs-actions.pod:5117 ../fish/guestfish-actions.pod:3456
14183 msgid "B<part_num>"
14187 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3458
14188 msgid "Partition number, counting from 1."
14192 #: ../src/guestfs-actions.pod:5121 ../fish/guestfish-actions.pod:3460
14193 msgid "B<part_start>"
14197 #: ../src/guestfs-actions.pod:5123
14199 "Start of the partition I<in bytes>. To get sectors you have to divide by "
14200 "the device's sector size, see C<guestfs_blockdev_getss>."
14204 #: ../src/guestfs-actions.pod:5126 ../fish/guestfish-actions.pod:3465
14205 msgid "B<part_end>"
14209 #: ../src/guestfs-actions.pod:5128 ../fish/guestfish-actions.pod:3467
14210 msgid "End of the partition in bytes."
14214 #: ../src/guestfs-actions.pod:5130 ../fish/guestfish-actions.pod:3469
14215 msgid "B<part_size>"
14219 #: ../src/guestfs-actions.pod:5132 ../fish/guestfish-actions.pod:3471
14220 msgid "Size of the partition in bytes."
14224 #: ../src/guestfs-actions.pod:5136
14226 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
14227 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
14232 #: ../src/guestfs-actions.pod:5142
14233 msgid "guestfs_part_set_bootable"
14237 #: ../src/guestfs-actions.pod:5144
14241 " guestfs_part_set_bootable (guestfs_h *g,\n"
14242 " const char *device,\n"
14244 " int bootable);\n"
14249 #: ../src/guestfs-actions.pod:5150 ../fish/guestfish-actions.pod:3479
14251 "This sets the bootable flag on partition numbered C<partnum> on device "
14252 "C<device>. Note that partitions are numbered from 1."
14256 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3482
14258 "The bootable flag is used by some operating systems (notably Windows) to "
14259 "determine which partition to boot from. It is by no means universally "
14264 #: ../src/guestfs-actions.pod:5161
14265 msgid "guestfs_part_set_mbr_id"
14269 #: ../src/guestfs-actions.pod:5163
14273 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
14274 " const char *device,\n"
14281 #: ../src/guestfs-actions.pod:5169 ../fish/guestfish-actions.pod:3490
14283 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
14284 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
14285 "documentation are in fact hexadecimal numbers, but usually documented "
14286 "without any leading \"0x\" which might be confusing."
14290 #: ../src/guestfs-actions.pod:5183
14291 msgid "guestfs_part_set_name"
14295 #: ../src/guestfs-actions.pod:5185
14299 " guestfs_part_set_name (guestfs_h *g,\n"
14300 " const char *device,\n"
14302 " const char *name);\n"
14307 #: ../src/guestfs-actions.pod:5191 ../fish/guestfish-actions.pod:3504
14309 "This sets the partition name on partition numbered C<partnum> on device "
14310 "C<device>. Note that partitions are numbered from 1."
14314 #: ../src/guestfs-actions.pod:5194 ../fish/guestfish-actions.pod:3507
14316 "The partition name can only be set on certain types of partition table. "
14317 "This works on C<gpt> but not on C<mbr> partitions."
14321 #: ../src/guestfs-actions.pod:5201
14322 msgid "guestfs_part_to_dev"
14326 #: ../src/guestfs-actions.pod:5203
14330 " guestfs_part_to_dev (guestfs_h *g,\n"
14331 " const char *partition);\n"
14336 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:3514
14338 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
14339 "partition number, returning the device name (eg. \"/dev/sdb\")."
14343 #: ../src/guestfs-actions.pod:5211
14345 "The named partition must exist, for example as a string returned from "
14346 "C<guestfs_list_partitions>."
14350 #: ../src/guestfs-actions.pod:5219
14351 msgid "guestfs_ping_daemon"
14355 #: ../src/guestfs-actions.pod:5221
14359 " guestfs_ping_daemon (guestfs_h *g);\n"
14364 #: ../src/guestfs-actions.pod:5224 ../fish/guestfish-actions.pod:3525
14366 "This is a test probe into the guestfs daemon running inside the qemu "
14367 "subprocess. Calling this function checks that the daemon responds to the "
14368 "ping message, without affecting the daemon or attached block device(s) in "
14373 #: ../src/guestfs-actions.pod:5233
14374 msgid "guestfs_pread"
14378 #: ../src/guestfs-actions.pod:5235
14382 " guestfs_pread (guestfs_h *g,\n"
14383 " const char *path,\n"
14385 " int64_t offset,\n"
14386 " size_t *size_r);\n"
14391 #: ../src/guestfs-actions.pod:5242 ../fish/guestfish-actions.pod:3534
14393 "This command lets you read part of a file. It reads C<count> bytes of the "
14394 "file, starting at C<offset>, from file C<path>."
14398 #: ../src/guestfs-actions.pod:5245 ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:3537 ../fish/guestfish-actions.pod:3552
14400 "This may read fewer bytes than requested. For further details see the "
14401 "L<pread(2)> system call."
14405 #: ../src/guestfs-actions.pod:5248
14406 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
14410 #: ../src/guestfs-actions.pod:5259
14411 msgid "guestfs_pread_device"
14415 #: ../src/guestfs-actions.pod:5261
14419 " guestfs_pread_device (guestfs_h *g,\n"
14420 " const char *device,\n"
14422 " int64_t offset,\n"
14423 " size_t *size_r);\n"
14428 #: ../src/guestfs-actions.pod:5268 ../fish/guestfish-actions.pod:3549
14430 "This command lets you read part of a file. It reads C<count> bytes of "
14431 "C<device>, starting at C<offset>."
14435 #: ../src/guestfs-actions.pod:5274
14436 msgid "See also C<guestfs_pread>."
14440 #: ../src/guestfs-actions.pod:5283
14441 msgid "(Added in 1.5.21)"
14445 #: ../src/guestfs-actions.pod:5285
14446 msgid "guestfs_pvcreate"
14450 #: ../src/guestfs-actions.pod:5287
14454 " guestfs_pvcreate (guestfs_h *g,\n"
14455 " const char *device);\n"
14460 #: ../src/guestfs-actions.pod:5291 ../fish/guestfish-actions.pod:3564
14462 "This creates an LVM physical volume on the named C<device>, where C<device> "
14463 "should usually be a partition name such as C</dev/sda1>."
14467 #: ../src/guestfs-actions.pod:5299
14468 msgid "guestfs_pvremove"
14472 #: ../src/guestfs-actions.pod:5301
14476 " guestfs_pvremove (guestfs_h *g,\n"
14477 " const char *device);\n"
14482 #: ../src/guestfs-actions.pod:5305 ../fish/guestfish-actions.pod:3572
14484 "This wipes a physical volume C<device> so that LVM will no longer recognise "
14489 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:3575
14491 "The implementation uses the C<pvremove> command which refuses to wipe "
14492 "physical volumes that contain any volume groups, so you have to remove those "
14497 #: ../src/guestfs-actions.pod:5316
14498 msgid "guestfs_pvresize"
14502 #: ../src/guestfs-actions.pod:5318
14506 " guestfs_pvresize (guestfs_h *g,\n"
14507 " const char *device);\n"
14512 #: ../src/guestfs-actions.pod:5322 ../fish/guestfish-actions.pod:3583
14514 "This resizes (expands or shrinks) an existing LVM physical volume to match "
14515 "the new size of the underlying device."
14519 #: ../src/guestfs-actions.pod:5329
14520 msgid "guestfs_pvresize_size"
14524 #: ../src/guestfs-actions.pod:5331
14528 " guestfs_pvresize_size (guestfs_h *g,\n"
14529 " const char *device,\n"
14530 " int64_t size);\n"
14535 #: ../src/guestfs-actions.pod:5336
14537 "This command is the same as C<guestfs_pvresize> except that it allows you to "
14538 "specify the new size (in bytes) explicitly."
14542 #: ../src/guestfs-actions.pod:5343
14543 msgid "guestfs_pvs"
14547 #: ../src/guestfs-actions.pod:5345
14551 " guestfs_pvs (guestfs_h *g);\n"
14556 #: ../src/guestfs-actions.pod:5348 ../fish/guestfish-actions.pod:3597
14558 "List all the physical volumes detected. This is the equivalent of the "
14559 "L<pvs(8)> command."
14563 #: ../src/guestfs-actions.pod:5351 ../fish/guestfish-actions.pod:3600
14565 "This returns a list of just the device names that contain PVs "
14566 "(eg. C</dev/sda2>)."
14570 #: ../src/guestfs-actions.pod:5354
14571 msgid "See also C<guestfs_pvs_full>."
14575 #: ../src/guestfs-actions.pod:5362
14576 msgid "guestfs_pvs_full"
14580 #: ../src/guestfs-actions.pod:5364
14583 " struct guestfs_lvm_pv_list *\n"
14584 " guestfs_pvs_full (guestfs_h *g);\n"
14589 #: ../src/guestfs-actions.pod:5367 ../fish/guestfish-actions.pod:3609
14591 "List all the physical volumes detected. This is the equivalent of the "
14592 "L<pvs(8)> command. The \"full\" version includes all fields."
14596 #: ../src/guestfs-actions.pod:5370
14598 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
14599 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
14604 #: ../src/guestfs-actions.pod:5376
14605 msgid "guestfs_pvuuid"
14609 #: ../src/guestfs-actions.pod:5378
14613 " guestfs_pvuuid (guestfs_h *g,\n"
14614 " const char *device);\n"
14619 #: ../src/guestfs-actions.pod:5382 ../fish/guestfish-actions.pod:3616
14620 msgid "This command returns the UUID of the LVM PV C<device>."
14624 #: ../src/guestfs-actions.pod:5389
14625 msgid "guestfs_pwrite"
14629 #: ../src/guestfs-actions.pod:5391
14633 " guestfs_pwrite (guestfs_h *g,\n"
14634 " const char *path,\n"
14635 " const char *content,\n"
14636 " size_t content_size,\n"
14637 " int64_t offset);\n"
14642 #: ../src/guestfs-actions.pod:5398 ../fish/guestfish-actions.pod:3622
14644 "This command writes to part of a file. It writes the data buffer C<content> "
14645 "to the file C<path> starting at offset C<offset>."
14649 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3625
14651 "This command implements the L<pwrite(2)> system call, and like that system "
14652 "call it may not write the full data requested. The return value is the "
14653 "number of bytes that were actually written to the file. This could even be "
14654 "0, although short writes are unlikely for regular files in ordinary "
14659 #: ../src/guestfs-actions.pod:5407
14660 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
14664 #: ../src/guestfs-actions.pod:5416
14665 msgid "guestfs_pwrite_device"
14669 #: ../src/guestfs-actions.pod:5418
14673 " guestfs_pwrite_device (guestfs_h *g,\n"
14674 " const char *device,\n"
14675 " const char *content,\n"
14676 " size_t content_size,\n"
14677 " int64_t offset);\n"
14682 #: ../src/guestfs-actions.pod:5425 ../fish/guestfish-actions.pod:3640
14684 "This command writes to part of a device. It writes the data buffer "
14685 "C<content> to C<device> starting at offset C<offset>."
14689 #: ../src/guestfs-actions.pod:5428 ../fish/guestfish-actions.pod:3643
14691 "This command implements the L<pwrite(2)> system call, and like that system "
14692 "call it may not write the full data requested (although short writes to disk "
14693 "devices and partitions are probably impossible with standard Linux kernels)."
14697 #: ../src/guestfs-actions.pod:5433
14698 msgid "See also C<guestfs_pwrite>."
14702 #: ../src/guestfs-actions.pod:5440
14703 msgid "(Added in 1.5.20)"
14707 #: ../src/guestfs-actions.pod:5442
14708 msgid "guestfs_read_file"
14712 #: ../src/guestfs-actions.pod:5444
14716 " guestfs_read_file (guestfs_h *g,\n"
14717 " const char *path,\n"
14718 " size_t *size_r);\n"
14723 #: ../src/guestfs-actions.pod:5449 ../fish/guestfish-actions.pod:3657
14724 msgid "This calls returns the contents of the file C<path> as a buffer."
14728 #: ../src/guestfs-actions.pod:5452
14730 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
14731 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
14732 "function is limited in the total size of file that can be handled."
14736 #: ../src/guestfs-actions.pod:5464
14737 msgid "(Added in 1.0.63)"
14741 #: ../src/guestfs-actions.pod:5466
14742 msgid "guestfs_read_lines"
14746 #: ../src/guestfs-actions.pod:5468
14750 " guestfs_read_lines (guestfs_h *g,\n"
14751 " const char *path);\n"
14756 #: ../src/guestfs-actions.pod:5474 ../fish/guestfish-actions.pod:3674
14758 "The file contents are returned as a list of lines. Trailing C<LF> and "
14759 "C<CRLF> character sequences are I<not> returned."
14763 #: ../src/guestfs-actions.pod:5477
14765 "Note that this function cannot correctly handle binary files (specifically, "
14766 "files containing C<\\0> character which is treated as end of line). For "
14767 "those you need to use the C<guestfs_read_file> function which has a more "
14768 "complex interface."
14772 #: ../src/guestfs-actions.pod:5488
14773 msgid "guestfs_readdir"
14777 #: ../src/guestfs-actions.pod:5490
14780 " struct guestfs_dirent_list *\n"
14781 " guestfs_readdir (guestfs_h *g,\n"
14782 " const char *dir);\n"
14787 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3686
14788 msgid "This returns the list of directory entries in directory C<dir>."
14792 #: ../src/guestfs-actions.pod:5496 ../fish/guestfish-actions.pod:3688
14794 "All entries in the directory are returned, including C<.> and C<..>. The "
14795 "entries are I<not> sorted, but returned in the same order as the underlying "
14800 #: ../src/guestfs-actions.pod:5500 ../fish/guestfish-actions.pod:3692
14802 "Also this call returns basic file type information about each file. The "
14803 "C<ftyp> field will contain one of the following characters:"
14807 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:3697
14812 #: ../src/guestfs-actions.pod:5507 ../fish/guestfish-actions.pod:3699
14813 msgid "Block special"
14817 #: ../src/guestfs-actions.pod:5509 ../fish/guestfish-actions.pod:3701
14822 #: ../src/guestfs-actions.pod:5511 ../fish/guestfish-actions.pod:3703
14823 msgid "Char special"
14827 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3705
14832 #: ../src/guestfs-actions.pod:5515 ../fish/guestfish-actions.pod:3707
14837 #: ../src/guestfs-actions.pod:5517 ../fish/guestfish-actions.pod:3709
14842 #: ../src/guestfs-actions.pod:5519 ../fish/guestfish-actions.pod:3711
14843 msgid "FIFO (named pipe)"
14847 #: ../src/guestfs-actions.pod:5521 ../fish/guestfish-actions.pod:3713
14852 #: ../src/guestfs-actions.pod:5523 ../fish/guestfish-actions.pod:3715
14853 msgid "Symbolic link"
14857 #: ../src/guestfs-actions.pod:5525 ../fish/guestfish-actions.pod:3717
14862 #: ../src/guestfs-actions.pod:5527 ../fish/guestfish-actions.pod:3719
14863 msgid "Regular file"
14867 #: ../src/guestfs-actions.pod:5529 ../fish/guestfish-actions.pod:3721
14872 #: ../src/guestfs-actions.pod:5531 ../fish/guestfish-actions.pod:3723
14877 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:3725
14882 #: ../src/guestfs-actions.pod:5535 ../fish/guestfish-actions.pod:3727
14883 msgid "Unknown file type"
14887 #: ../src/guestfs-actions.pod:5537 ../fish/guestfish-actions.pod:3729
14892 #: ../src/guestfs-actions.pod:5539 ../fish/guestfish-actions.pod:3731
14893 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14897 #: ../src/guestfs-actions.pod:5544
14899 "This function is primarily intended for use by programs. To get a simple "
14900 "list of names, use C<guestfs_ls>. To get a printable directory for human "
14901 "consumption, use C<guestfs_ll>."
14905 #: ../src/guestfs-actions.pod:5548
14907 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
14908 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
14913 #: ../src/guestfs-actions.pod:5554
14914 msgid "guestfs_readlink"
14918 #: ../src/guestfs-actions.pod:5556
14922 " guestfs_readlink (guestfs_h *g,\n"
14923 " const char *path);\n"
14928 #: ../src/guestfs-actions.pod:5560 ../fish/guestfish-actions.pod:3744
14929 msgid "This command reads the target of a symbolic link."
14933 #: ../src/guestfs-actions.pod:5567
14934 msgid "guestfs_readlinklist"
14938 #: ../src/guestfs-actions.pod:5569
14942 " guestfs_readlinklist (guestfs_h *g,\n"
14943 " const char *path,\n"
14944 " char *const *names);\n"
14949 #: ../src/guestfs-actions.pod:5574 ../fish/guestfish-actions.pod:3750
14951 "This call allows you to do a C<readlink> operation on multiple files, where "
14952 "all files are in the directory C<path>. C<names> is the list of files from "
14957 #: ../src/guestfs-actions.pod:5578 ../fish/guestfish-actions.pod:3754
14959 "On return you get a list of strings, with a one-to-one correspondence to the "
14960 "C<names> list. Each string is the value of the symbolic link."
14964 #: ../src/guestfs-actions.pod:5582 ../fish/guestfish-actions.pod:3758
14966 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14967 "result string is the empty string C<\"\">. However the whole operation is "
14968 "completed even if there were C<readlink(2)> errors, and so you can call this "
14969 "function with names where you don't know if they are symbolic links already "
14970 "(albeit slightly less efficient)."
14974 #: ../src/guestfs-actions.pod:5589 ../fish/guestfish-actions.pod:3765
14976 "This call is intended for programs that want to efficiently list a directory "
14977 "contents without making many round-trips. Very long directory listings "
14978 "might cause the protocol message size to be exceeded, causing this call to "
14979 "fail. The caller must split up such requests into smaller groups of names."
14983 #: ../src/guestfs-actions.pod:5602
14984 msgid "guestfs_realpath"
14988 #: ../src/guestfs-actions.pod:5604
14992 " guestfs_realpath (guestfs_h *g,\n"
14993 " const char *path);\n"
14998 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:3776
15000 "Return the canonicalized absolute pathname of C<path>. The returned path "
15001 "has no C<.>, C<..> or symbolic link path elements."
15005 #: ../src/guestfs-actions.pod:5616
15006 msgid "guestfs_removexattr"
15010 #: ../src/guestfs-actions.pod:5618
15014 " guestfs_removexattr (guestfs_h *g,\n"
15015 " const char *xattr,\n"
15016 " const char *path);\n"
15021 #: ../src/guestfs-actions.pod:5623 ../fish/guestfish-actions.pod:3783
15022 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
15026 #: ../src/guestfs-actions.pod:5626
15027 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
15031 #: ../src/guestfs-actions.pod:5632
15032 msgid "guestfs_resize2fs"
15036 #: ../src/guestfs-actions.pod:5634
15040 " guestfs_resize2fs (guestfs_h *g,\n"
15041 " const char *device);\n"
15046 #: ../src/guestfs-actions.pod:5638 ../fish/guestfish-actions.pod:3792
15048 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
15049 "underlying device."
15053 #: ../src/guestfs-actions.pod:5641
15055 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
15056 "C<device> before calling this command. For unknown reasons C<resize2fs> "
15057 "sometimes gives an error about this and sometimes not. In any case, it is "
15058 "always safe to call C<guestfs_e2fsck_f> before calling this function."
15062 #: ../src/guestfs-actions.pod:5651
15063 msgid "guestfs_resize2fs_M"
15067 #: ../src/guestfs-actions.pod:5653
15071 " guestfs_resize2fs_M (guestfs_h *g,\n"
15072 " const char *device);\n"
15077 #: ../src/guestfs-actions.pod:5657
15079 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
15080 "resized to its minimum size. This works like the I<-M> option to the "
15081 "C<resize2fs> command."
15085 #: ../src/guestfs-actions.pod:5661
15087 "To get the resulting size of the filesystem you should call "
15088 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
15089 "These two numbers, multiplied together, give the resulting size of the "
15090 "minimal filesystem in bytes."
15094 #: ../src/guestfs-actions.pod:5668
15095 msgid "guestfs_resize2fs_size"
15099 #: ../src/guestfs-actions.pod:5670
15103 " guestfs_resize2fs_size (guestfs_h *g,\n"
15104 " const char *device,\n"
15105 " int64_t size);\n"
15110 #: ../src/guestfs-actions.pod:5675
15112 "This command is the same as C<guestfs_resize2fs> except that it allows you "
15113 "to specify the new size (in bytes) explicitly."
15117 #: ../src/guestfs-actions.pod:5682
15122 #: ../src/guestfs-actions.pod:5684
15126 " guestfs_rm (guestfs_h *g,\n"
15127 " const char *path);\n"
15132 #: ../src/guestfs-actions.pod:5688 ../fish/guestfish-actions.pod:3825
15133 msgid "Remove the single file C<path>."
15137 #: ../src/guestfs-actions.pod:5694
15138 msgid "guestfs_rm_rf"
15142 #: ../src/guestfs-actions.pod:5696
15146 " guestfs_rm_rf (guestfs_h *g,\n"
15147 " const char *path);\n"
15152 #: ../src/guestfs-actions.pod:5700 ../fish/guestfish-actions.pod:3831
15154 "Remove the file or directory C<path>, recursively removing the contents if "
15155 "its a directory. This is like the C<rm -rf> shell command."
15159 #: ../src/guestfs-actions.pod:5708
15160 msgid "guestfs_rmdir"
15164 #: ../src/guestfs-actions.pod:5710
15168 " guestfs_rmdir (guestfs_h *g,\n"
15169 " const char *path);\n"
15174 #: ../src/guestfs-actions.pod:5714 ../fish/guestfish-actions.pod:3839
15175 msgid "Remove the single directory C<path>."
15179 #: ../src/guestfs-actions.pod:5720
15180 msgid "guestfs_rmmountpoint"
15184 #: ../src/guestfs-actions.pod:5722
15188 " guestfs_rmmountpoint (guestfs_h *g,\n"
15189 " const char *exemptpath);\n"
15194 #: ../src/guestfs-actions.pod:5726
15196 "This calls removes a mountpoint that was previously created with "
15197 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
15201 #: ../src/guestfs-actions.pod:5734
15202 msgid "guestfs_scrub_device"
15206 #: ../src/guestfs-actions.pod:5736
15210 " guestfs_scrub_device (guestfs_h *g,\n"
15211 " const char *device);\n"
15216 #: ../src/guestfs-actions.pod:5740 ../fish/guestfish-actions.pod:3853
15218 "This command writes patterns over C<device> to make data retrieval more "
15223 #: ../src/guestfs-actions.pod:5743 ../src/guestfs-actions.pod:5764 ../src/guestfs-actions.pod:5783 ../fish/guestfish-actions.pod:3856 ../fish/guestfish-actions.pod:3871 ../fish/guestfish-actions.pod:3884
15225 "It is an interface to the L<scrub(1)> program. See that manual page for "
15230 #: ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5769 ../src/guestfs-actions.pod:5788
15231 msgid "(Added in 1.0.52)"
15235 #: ../src/guestfs-actions.pod:5753
15236 msgid "guestfs_scrub_file"
15240 #: ../src/guestfs-actions.pod:5755
15244 " guestfs_scrub_file (guestfs_h *g,\n"
15245 " const char *file);\n"
15250 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:3866
15252 "This command writes patterns over a file to make data retrieval more "
15257 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3869
15258 msgid "The file is I<removed> after scrubbing."
15262 #: ../src/guestfs-actions.pod:5771
15263 msgid "guestfs_scrub_freespace"
15267 #: ../src/guestfs-actions.pod:5773
15271 " guestfs_scrub_freespace (guestfs_h *g,\n"
15272 " const char *dir);\n"
15277 #: ../src/guestfs-actions.pod:5777
15279 "This command creates the directory C<dir> and then fills it with files until "
15280 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
15281 "and deletes them. The intention is to scrub any free space on the partition "
15282 "containing C<dir>."
15286 #: ../src/guestfs-actions.pod:5790
15287 msgid "guestfs_set_append"
15291 #: ../src/guestfs-actions.pod:5792
15295 " guestfs_set_append (guestfs_h *g,\n"
15296 " const char *append);\n"
15301 #: ../src/guestfs-actions.pod:5796 ../fish/guestfish-actions.pod:3893
15303 "This function is used to add additional options to the guest kernel command "
15308 #: ../src/guestfs-actions.pod:5799 ../fish/guestfish-actions.pod:3896
15310 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
15311 "environment variable."
15315 #: ../src/guestfs-actions.pod:5802 ../fish/guestfish-actions.pod:3899
15317 "Setting C<append> to C<NULL> means I<no> additional options are passed "
15318 "(libguestfs always adds a few of its own)."
15322 #: ../src/guestfs-actions.pod:5809
15323 msgid "guestfs_set_attach_method"
15327 #: ../src/guestfs-actions.pod:5811
15331 " guestfs_set_attach_method (guestfs_h *g,\n"
15332 " const char *attachmethod);\n"
15337 #: ../src/guestfs-actions.pod:5815 ../fish/guestfish-actions.pod:3908
15339 "Set the method that libguestfs uses to connect to the back end guestfsd "
15340 "daemon. Possible methods are:"
15344 #: ../src/guestfs-actions.pod:5822 ../fish/guestfish-actions.pod:3915
15346 "Launch an appliance and connect to it. This is the ordinary method and the "
15351 #: ../src/guestfs-actions.pod:5825 ../fish/guestfish-actions.pod:3918
15352 msgid "C<unix:I<path>>"
15356 #: ../src/guestfs-actions.pod:5827 ../fish/guestfish-actions.pod:3920
15357 msgid "Connect to the Unix domain socket I<path>."
15361 #: ../src/guestfs-actions.pod:5829 ../fish/guestfish-actions.pod:3922
15363 "This method lets you connect to an existing daemon or (using virtio-serial) "
15364 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
15365 "RUNNING DAEMONS>."
15369 #: ../src/guestfs-actions.pod:5837
15370 msgid "guestfs_set_autosync"
15374 #: ../src/guestfs-actions.pod:5839
15378 " guestfs_set_autosync (guestfs_h *g,\n"
15379 " int autosync);\n"
15384 #: ../src/guestfs-actions.pod:5843 ../fish/guestfish-actions.pod:3934
15386 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
15387 "effort attempt to make filesystems consistent and synchronized when the "
15388 "handle is closed (also if the program exits without closing handles)."
15392 #: ../src/guestfs-actions.pod:5848 ../fish/guestfish-actions.pod:3939
15394 "This is enabled by default (since libguestfs 1.5.24, previously it was "
15395 "disabled by default)."
15399 #: ../src/guestfs-actions.pod:5855
15400 msgid "guestfs_set_direct"
15404 #: ../src/guestfs-actions.pod:5857
15408 " guestfs_set_direct (guestfs_h *g,\n"
15414 #: ../src/guestfs-actions.pod:5861 ../fish/guestfish-actions.pod:3948
15416 "If the direct appliance mode flag is enabled, then stdin and stdout are "
15417 "passed directly through to the appliance once it is launched."
15421 #: ../src/guestfs-actions.pod:5865
15423 "One consequence of this is that log messages aren't caught by the library "
15424 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
15429 #: ../src/guestfs-actions.pod:5869 ../fish/guestfish-actions.pod:3956
15430 msgid "You probably don't want to use this unless you know what you are doing."
15434 #: ../src/guestfs-actions.pod:5872 ../fish/guestfish-actions.pod:3959
15435 msgid "The default is disabled."
15439 #: ../src/guestfs-actions.pod:5878
15440 msgid "guestfs_set_e2label"
15444 #: ../src/guestfs-actions.pod:5880
15448 " guestfs_set_e2label (guestfs_h *g,\n"
15449 " const char *device,\n"
15450 " const char *label);\n"
15455 #: ../src/guestfs-actions.pod:5885 ../fish/guestfish-actions.pod:3965
15457 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15458 "C<label>. Filesystem labels are limited to 16 characters."
15462 #: ../src/guestfs-actions.pod:5889
15464 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
15465 "the existing label on a filesystem."
15469 #: ../src/guestfs-actions.pod:5896
15470 msgid "guestfs_set_e2uuid"
15474 #: ../src/guestfs-actions.pod:5898
15478 " guestfs_set_e2uuid (guestfs_h *g,\n"
15479 " const char *device,\n"
15480 " const char *uuid);\n"
15485 #: ../src/guestfs-actions.pod:5903 ../fish/guestfish-actions.pod:3976
15487 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
15488 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
15489 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
15493 #: ../src/guestfs-actions.pod:5908
15495 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
15496 "the existing UUID of a filesystem."
15500 #: ../src/guestfs-actions.pod:5915
15501 msgid "guestfs_set_memsize"
15505 #: ../src/guestfs-actions.pod:5917
15509 " guestfs_set_memsize (guestfs_h *g,\n"
15515 #: ../src/guestfs-actions.pod:5921
15517 "This sets the memory size in megabytes allocated to the qemu subprocess. "
15518 "This only has any effect if called before C<guestfs_launch>."
15522 #: ../src/guestfs-actions.pod:5925 ../fish/guestfish-actions.pod:3994
15524 "You can also change this by setting the environment variable "
15525 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
15529 #: ../src/guestfs-actions.pod:5936
15530 msgid "guestfs_set_network"
15534 #: ../src/guestfs-actions.pod:5938
15538 " guestfs_set_network (guestfs_h *g,\n"
15544 #: ../src/guestfs-actions.pod:5942 ../fish/guestfish-actions.pod:4007
15546 "If C<network> is true, then the network is enabled in the libguestfs "
15547 "appliance. The default is false."
15551 #: ../src/guestfs-actions.pod:5945 ../fish/guestfish-actions.pod:4010
15553 "This affects whether commands are able to access the network (see "
15554 "L<guestfs(3)/RUNNING COMMANDS>)."
15558 #: ../src/guestfs-actions.pod:5948
15560 "You must call this before calling C<guestfs_launch>, otherwise it has no "
15565 #: ../src/guestfs-actions.pod:5955
15566 msgid "guestfs_set_path"
15570 #: ../src/guestfs-actions.pod:5957
15574 " guestfs_set_path (guestfs_h *g,\n"
15575 " const char *searchpath);\n"
15580 #: ../src/guestfs-actions.pod:5961 ../fish/guestfish-actions.pod:4022
15581 msgid "Set the path that libguestfs searches for kernel and initrd.img."
15585 #: ../src/guestfs-actions.pod:5963 ../fish/guestfish-actions.pod:4024
15587 "The default is C<$libdir/guestfs> unless overridden by setting "
15588 "C<LIBGUESTFS_PATH> environment variable."
15592 #: ../src/guestfs-actions.pod:5966 ../fish/guestfish-actions.pod:4027
15593 msgid "Setting C<path> to C<NULL> restores the default path."
15597 #: ../src/guestfs-actions.pod:5972
15598 msgid "guestfs_set_qemu"
15602 #: ../src/guestfs-actions.pod:5974
15606 " guestfs_set_qemu (guestfs_h *g,\n"
15607 " const char *qemu);\n"
15612 #: ../src/guestfs-actions.pod:5978 ../fish/guestfish-actions.pod:4035
15613 msgid "Set the qemu binary that we will use."
15617 #: ../src/guestfs-actions.pod:5980 ../fish/guestfish-actions.pod:4037
15618 msgid "The default is chosen when the library was compiled by the configure script."
15622 #: ../src/guestfs-actions.pod:5983 ../fish/guestfish-actions.pod:4040
15624 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15629 #: ../src/guestfs-actions.pod:5986 ../fish/guestfish-actions.pod:4043
15630 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15634 #: ../src/guestfs-actions.pod:5988 ../fish/guestfish-actions.pod:4045
15636 "Note that you should call this function as early as possible after creating "
15637 "the handle. This is because some pre-launch operations depend on testing "
15638 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15639 "don't retest features, and so you might see inconsistent results. Using the "
15640 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15641 "the qemu binary at the same time as the handle is created."
15645 #: ../src/guestfs-actions.pod:6000
15646 msgid "guestfs_set_recovery_proc"
15650 #: ../src/guestfs-actions.pod:6002
15654 " guestfs_set_recovery_proc (guestfs_h *g,\n"
15655 " int recoveryproc);\n"
15660 #: ../src/guestfs-actions.pod:6006
15662 "If this is called with the parameter C<false> then C<guestfs_launch> does "
15663 "not create a recovery process. The purpose of the recovery process is to "
15664 "stop runaway qemu processes in the case where the main program aborts "
15669 #: ../src/guestfs-actions.pod:6011
15671 "This only has any effect if called before C<guestfs_launch>, and the default "
15676 #: ../src/guestfs-actions.pod:6014 ../fish/guestfish-actions.pod:4067
15678 "About the only time when you would want to disable this is if the main "
15679 "process will fork itself into the background (\"daemonize\" itself). In "
15680 "this case the recovery process thinks that the main program has disappeared "
15681 "and so kills qemu, which is not very helpful."
15685 #: ../src/guestfs-actions.pod:6024
15686 msgid "guestfs_set_selinux"
15690 #: ../src/guestfs-actions.pod:6026
15694 " guestfs_set_selinux (guestfs_h *g,\n"
15700 #: ../src/guestfs-actions.pod:6030 ../fish/guestfish-actions.pod:4079
15702 "This sets the selinux flag that is passed to the appliance at boot time. "
15703 "The default is C<selinux=0> (disabled)."
15707 #: ../src/guestfs-actions.pod:6033 ../fish/guestfish-actions.pod:4082
15709 "Note that if SELinux is enabled, it is always in Permissive mode "
15710 "(C<enforcing=0>)."
15714 #: ../src/guestfs-actions.pod:6043
15715 msgid "guestfs_set_trace"
15719 #: ../src/guestfs-actions.pod:6045
15723 " guestfs_set_trace (guestfs_h *g,\n"
15729 #: ../src/guestfs-actions.pod:6049 ../fish/guestfish-actions.pod:4094
15731 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15732 "return values are traced."
15736 #: ../src/guestfs-actions.pod:6052 ../fish/guestfish-actions.pod:4097
15738 "If you want to trace C API calls into libguestfs (and other libraries) then "
15739 "possibly a better way is to use the external ltrace(1) command."
15743 #: ../src/guestfs-actions.pod:6056 ../fish/guestfish-actions.pod:4101
15745 "Command traces are disabled unless the environment variable "
15746 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15750 #: ../src/guestfs-actions.pod:6059
15752 "Trace messages are normally sent to C<stderr>, unless you register a "
15753 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
15757 #: ../src/guestfs-actions.pod:6067
15758 msgid "guestfs_set_verbose"
15762 #: ../src/guestfs-actions.pod:6069
15766 " guestfs_set_verbose (guestfs_h *g,\n"
15772 #: ../src/guestfs-actions.pod:6073 ../fish/guestfish-actions.pod:4114
15773 msgid "If C<verbose> is true, this turns on verbose messages."
15777 #: ../src/guestfs-actions.pod:6075 ../fish/guestfish-actions.pod:4116
15779 "Verbose messages are disabled unless the environment variable "
15780 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15784 #: ../src/guestfs-actions.pod:6078
15786 "Verbose messages are normally sent to C<stderr>, unless you register a "
15787 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
15791 #: ../src/guestfs-actions.pod:6086
15792 msgid "guestfs_setcon"
15796 #: ../src/guestfs-actions.pod:6088
15800 " guestfs_setcon (guestfs_h *g,\n"
15801 " const char *context);\n"
15806 #: ../src/guestfs-actions.pod:6092 ../fish/guestfish-actions.pod:4127
15808 "This sets the SELinux security context of the daemon to the string "
15813 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4130
15814 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15818 #: ../src/guestfs-actions.pod:6101
15819 msgid "guestfs_setxattr"
15823 #: ../src/guestfs-actions.pod:6103
15827 " guestfs_setxattr (guestfs_h *g,\n"
15828 " const char *xattr,\n"
15829 " const char *val,\n"
15831 " const char *path);\n"
15836 #: ../src/guestfs-actions.pod:6110 ../fish/guestfish-actions.pod:4136
15838 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15839 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15843 #: ../src/guestfs-actions.pod:6114
15844 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
15848 #: ../src/guestfs-actions.pod:6120
15849 msgid "guestfs_sfdisk"
15853 #: ../src/guestfs-actions.pod:6122
15857 " guestfs_sfdisk (guestfs_h *g,\n"
15858 " const char *device,\n"
15862 " char *const *lines);\n"
15867 #: ../src/guestfs-actions.pod:6130 ../fish/guestfish-actions.pod:4146
15869 "This is a direct interface to the L<sfdisk(8)> program for creating "
15870 "partitions on block devices."
15874 #: ../src/guestfs-actions.pod:6133 ../fish/guestfish-actions.pod:4149
15875 msgid "C<device> should be a block device, for example C</dev/sda>."
15879 #: ../src/guestfs-actions.pod:6135 ../fish/guestfish-actions.pod:4151
15881 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15882 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
15883 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15884 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15885 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15886 "the kernel) cannot work out the right geometry and you will need to tell it."
15890 #: ../src/guestfs-actions.pod:6143 ../fish/guestfish-actions.pod:4159
15892 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15893 "refer to the L<sfdisk(8)> manpage."
15897 #: ../src/guestfs-actions.pod:6146 ../fish/guestfish-actions.pod:4162
15899 "To create a single partition occupying the whole disk, you would pass "
15900 "C<lines> as a single element list, when the single element being the string "
15905 #: ../src/guestfs-actions.pod:6150
15906 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
15910 #: ../src/guestfs-actions.pod:6160
15911 msgid "guestfs_sfdiskM"
15915 #: ../src/guestfs-actions.pod:6162
15919 " guestfs_sfdiskM (guestfs_h *g,\n"
15920 " const char *device,\n"
15921 " char *const *lines);\n"
15926 #: ../src/guestfs-actions.pod:6167
15928 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
15929 "partition sizes are specified in megabytes only (rounded to the nearest "
15930 "cylinder) and you don't need to specify the cyls, heads and sectors "
15931 "parameters which were rarely if ever used anyway."
15935 #: ../src/guestfs-actions.pod:6173
15937 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
15938 "C<guestfs_part_disk>"
15942 #: ../src/guestfs-actions.pod:6183
15943 msgid "guestfs_sfdisk_N"
15947 #: ../src/guestfs-actions.pod:6185
15951 " guestfs_sfdisk_N (guestfs_h *g,\n"
15952 " const char *device,\n"
15957 " const char *line);\n"
15962 #: ../src/guestfs-actions.pod:6194 ../fish/guestfish-actions.pod:4192
15964 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15965 "(note: C<n> counts from 1)."
15969 #: ../src/guestfs-actions.pod:6197
15971 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
15972 "for the cyls/heads/sectors parameters."
15976 #: ../src/guestfs-actions.pod:6200
15977 msgid "See also: C<guestfs_part_add>"
15981 #: ../src/guestfs-actions.pod:6209
15982 msgid "guestfs_sfdisk_disk_geometry"
15986 #: ../src/guestfs-actions.pod:6211
15990 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
15991 " const char *device);\n"
15996 #: ../src/guestfs-actions.pod:6215
15998 "This displays the disk geometry of C<device> read from the partition table. "
15999 "Especially in the case where the underlying block device has been resized, "
16000 "this can be different from the kernel's idea of the geometry (see "
16001 "C<guestfs_sfdisk_kernel_geometry>)."
16005 #: ../src/guestfs-actions.pod:6220 ../src/guestfs-actions.pod:6236 ../fish/guestfish-actions.pod:4212 ../fish/guestfish-actions.pod:4221
16006 msgid "The result is in human-readable format, and not designed to be parsed."
16010 #: ../src/guestfs-actions.pod:6228
16011 msgid "guestfs_sfdisk_kernel_geometry"
16015 #: ../src/guestfs-actions.pod:6230
16019 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
16020 " const char *device);\n"
16025 #: ../src/guestfs-actions.pod:6234 ../fish/guestfish-actions.pod:4219
16026 msgid "This displays the kernel's idea of the geometry of C<device>."
16030 #: ../src/guestfs-actions.pod:6244
16031 msgid "guestfs_sfdisk_l"
16035 #: ../src/guestfs-actions.pod:6246
16039 " guestfs_sfdisk_l (guestfs_h *g,\n"
16040 " const char *device);\n"
16045 #: ../src/guestfs-actions.pod:6250 ../fish/guestfish-actions.pod:4228
16047 "This displays the partition table on C<device>, in the human-readable output "
16048 "of the L<sfdisk(8)> command. It is not intended to be parsed."
16052 #: ../src/guestfs-actions.pod:6254
16053 msgid "See also: C<guestfs_part_list>"
16057 #: ../src/guestfs-actions.pod:6261
16062 #: ../src/guestfs-actions.pod:6263
16066 " guestfs_sh (guestfs_h *g,\n"
16067 " const char *command);\n"
16072 #: ../src/guestfs-actions.pod:6267 ../fish/guestfish-actions.pod:4238
16074 "This call runs a command from the guest filesystem via the guest's "
16079 #: ../src/guestfs-actions.pod:6270
16080 msgid "This is like C<guestfs_command>, but passes the command to:"
16084 #: ../src/guestfs-actions.pod:6272 ../fish/guestfish-actions.pod:4243
16087 " /bin/sh -c \"command\"\n"
16092 #: ../src/guestfs-actions.pod:6274 ../fish/guestfish-actions.pod:4245
16094 "Depending on the guest's shell, this usually results in wildcards being "
16095 "expanded, shell expressions being interpolated and so on."
16099 #: ../src/guestfs-actions.pod:6278
16100 msgid "All the provisos about C<guestfs_command> apply to this call."
16104 #: ../src/guestfs-actions.pod:6285
16105 msgid "guestfs_sh_lines"
16109 #: ../src/guestfs-actions.pod:6287
16113 " guestfs_sh_lines (guestfs_h *g,\n"
16114 " const char *command);\n"
16119 #: ../src/guestfs-actions.pod:6291
16121 "This is the same as C<guestfs_sh>, but splits the result into a list of "
16126 #: ../src/guestfs-actions.pod:6294
16127 msgid "See also: C<guestfs_command_lines>"
16131 #: ../src/guestfs-actions.pod:6302
16132 msgid "guestfs_sleep"
16136 #: ../src/guestfs-actions.pod:6304
16140 " guestfs_sleep (guestfs_h *g,\n"
16146 #: ../src/guestfs-actions.pod:6308 ../fish/guestfish-actions.pod:4264
16147 msgid "Sleep for C<secs> seconds."
16151 #: ../src/guestfs-actions.pod:6312
16152 msgid "(Added in 1.0.41)"
16156 #: ../src/guestfs-actions.pod:6314 ../src/guestfs-structs.pod:109
16157 msgid "guestfs_stat"
16161 #: ../src/guestfs-actions.pod:6316
16164 " struct guestfs_stat *\n"
16165 " guestfs_stat (guestfs_h *g,\n"
16166 " const char *path);\n"
16171 #: ../src/guestfs-actions.pod:6322 ../fish/guestfish-actions.pod:4272
16172 msgid "This is the same as the C<stat(2)> system call."
16176 #: ../src/guestfs-actions.pod:6330 ../src/guestfs-structs.pod:135
16177 msgid "guestfs_statvfs"
16181 #: ../src/guestfs-actions.pod:6332
16184 " struct guestfs_statvfs *\n"
16185 " guestfs_statvfs (guestfs_h *g,\n"
16186 " const char *path);\n"
16191 #: ../src/guestfs-actions.pod:6336 ../fish/guestfish-actions.pod:4278
16193 "Returns file system statistics for any mounted file system. C<path> should "
16194 "be a file or directory in the mounted file system (typically it is the mount "
16195 "point itself, but it doesn't need to be)."
16199 #: ../src/guestfs-actions.pod:6340 ../fish/guestfish-actions.pod:4282
16200 msgid "This is the same as the C<statvfs(2)> system call."
16204 #: ../src/guestfs-actions.pod:6342
16206 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
16207 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
16211 #: ../src/guestfs-actions.pod:6348
16212 msgid "guestfs_strings"
16216 #: ../src/guestfs-actions.pod:6350
16220 " guestfs_strings (guestfs_h *g,\n"
16221 " const char *path);\n"
16226 #: ../src/guestfs-actions.pod:6354 ../fish/guestfish-actions.pod:4288
16228 "This runs the L<strings(1)> command on a file and returns the list of "
16229 "printable strings found."
16233 #: ../src/guestfs-actions.pod:6366
16234 msgid "guestfs_strings_e"
16238 #: ../src/guestfs-actions.pod:6368
16242 " guestfs_strings_e (guestfs_h *g,\n"
16243 " const char *encoding,\n"
16244 " const char *path);\n"
16249 #: ../src/guestfs-actions.pod:6373
16251 "This is like the C<guestfs_strings> command, but allows you to specify the "
16252 "encoding of strings that are looked for in the source file C<path>."
16256 #: ../src/guestfs-actions.pod:6377 ../fish/guestfish-actions.pod:4302
16257 msgid "Allowed encodings are:"
16261 #: ../src/guestfs-actions.pod:6381 ../fish/guestfish-actions.pod:4306
16266 #: ../src/guestfs-actions.pod:6383
16268 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
16269 "ISO-8859-X (this is what C<guestfs_strings> uses)."
16273 #: ../src/guestfs-actions.pod:6386 ../fish/guestfish-actions.pod:4311
16278 #: ../src/guestfs-actions.pod:6388 ../fish/guestfish-actions.pod:4313
16279 msgid "Single 8-bit-byte characters."
16283 #: ../src/guestfs-actions.pod:6390 ../fish/guestfish-actions.pod:4315
16288 #: ../src/guestfs-actions.pod:6392 ../fish/guestfish-actions.pod:4317
16289 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
16293 #: ../src/guestfs-actions.pod:6395 ../fish/guestfish-actions.pod:4320
16294 msgid "l (lower case letter L)"
16298 #: ../src/guestfs-actions.pod:6397 ../fish/guestfish-actions.pod:4322
16300 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
16301 "examining binaries in Windows guests."
16305 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4325
16310 #: ../src/guestfs-actions.pod:6402 ../fish/guestfish-actions.pod:4327
16311 msgid "32-bit big endian such as UCS-4BE."
16315 #: ../src/guestfs-actions.pod:6404 ../fish/guestfish-actions.pod:4329
16320 #: ../src/guestfs-actions.pod:6406 ../fish/guestfish-actions.pod:4331
16321 msgid "32-bit little endian such as UCS-4LE."
16325 #: ../src/guestfs-actions.pod:6410 ../fish/guestfish-actions.pod:4335
16326 msgid "The returned strings are transcoded to UTF-8."
16330 #: ../src/guestfs-actions.pod:6421
16331 msgid "guestfs_swapoff_device"
16335 #: ../src/guestfs-actions.pod:6423
16339 " guestfs_swapoff_device (guestfs_h *g,\n"
16340 " const char *device);\n"
16345 #: ../src/guestfs-actions.pod:6427
16347 "This command disables the libguestfs appliance swap device or partition "
16348 "named C<device>. See C<guestfs_swapon_device>."
16352 #: ../src/guestfs-actions.pod:6435
16353 msgid "guestfs_swapoff_file"
16357 #: ../src/guestfs-actions.pod:6437
16361 " guestfs_swapoff_file (guestfs_h *g,\n"
16362 " const char *file);\n"
16367 #: ../src/guestfs-actions.pod:6441 ../fish/guestfish-actions.pod:4352
16368 msgid "This command disables the libguestfs appliance swap on file."
16372 #: ../src/guestfs-actions.pod:6447
16373 msgid "guestfs_swapoff_label"
16377 #: ../src/guestfs-actions.pod:6449
16381 " guestfs_swapoff_label (guestfs_h *g,\n"
16382 " const char *label);\n"
16387 #: ../src/guestfs-actions.pod:6453 ../fish/guestfish-actions.pod:4358
16389 "This command disables the libguestfs appliance swap on labeled swap "
16394 #: ../src/guestfs-actions.pod:6460
16395 msgid "guestfs_swapoff_uuid"
16399 #: ../src/guestfs-actions.pod:6462
16403 " guestfs_swapoff_uuid (guestfs_h *g,\n"
16404 " const char *uuid);\n"
16409 #: ../src/guestfs-actions.pod:6466 ../fish/guestfish-actions.pod:4365
16411 "This command disables the libguestfs appliance swap partition with the given "
16416 #: ../src/guestfs-actions.pod:6473
16417 msgid "guestfs_swapon_device"
16421 #: ../src/guestfs-actions.pod:6475
16425 " guestfs_swapon_device (guestfs_h *g,\n"
16426 " const char *device);\n"
16431 #: ../src/guestfs-actions.pod:6479
16433 "This command enables the libguestfs appliance to use the swap device or "
16434 "partition named C<device>. The increased memory is made available for all "
16435 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
16439 #: ../src/guestfs-actions.pod:6484 ../fish/guestfish-actions.pod:4377
16441 "Note that you should not swap to existing guest swap partitions unless you "
16442 "know what you are doing. They may contain hibernation information, or other "
16443 "information that the guest doesn't want you to trash. You also risk leaking "
16444 "information about the host to the guest this way. Instead, attach a new "
16445 "host device to the guest and swap on that."
16449 #: ../src/guestfs-actions.pod:6495
16450 msgid "guestfs_swapon_file"
16454 #: ../src/guestfs-actions.pod:6497
16458 " guestfs_swapon_file (guestfs_h *g,\n"
16459 " const char *file);\n"
16464 #: ../src/guestfs-actions.pod:6501
16466 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
16471 #: ../src/guestfs-actions.pod:6508
16472 msgid "guestfs_swapon_label"
16476 #: ../src/guestfs-actions.pod:6510
16480 " guestfs_swapon_label (guestfs_h *g,\n"
16481 " const char *label);\n"
16486 #: ../src/guestfs-actions.pod:6514
16488 "This command enables swap to a labeled swap partition. See "
16489 "C<guestfs_swapon_device> for other notes."
16493 #: ../src/guestfs-actions.pod:6521
16494 msgid "guestfs_swapon_uuid"
16498 #: ../src/guestfs-actions.pod:6523
16502 " guestfs_swapon_uuid (guestfs_h *g,\n"
16503 " const char *uuid);\n"
16508 #: ../src/guestfs-actions.pod:6527
16510 "This command enables swap to a swap partition with the given UUID. See "
16511 "C<guestfs_swapon_device> for other notes."
16515 #: ../src/guestfs-actions.pod:6534
16516 msgid "guestfs_sync"
16520 #: ../src/guestfs-actions.pod:6536
16524 " guestfs_sync (guestfs_h *g);\n"
16529 #: ../src/guestfs-actions.pod:6539 ../fish/guestfish-actions.pod:4409
16531 "This syncs the disk, so that any writes are flushed through to the "
16532 "underlying disk image."
16536 #: ../src/guestfs-actions.pod:6542 ../fish/guestfish-actions.pod:4412
16538 "You should always call this if you have modified a disk image, before "
16539 "closing the handle."
16543 #: ../src/guestfs-actions.pod:6549
16544 msgid "guestfs_tail"
16548 #: ../src/guestfs-actions.pod:6551
16552 " guestfs_tail (guestfs_h *g,\n"
16553 " const char *path);\n"
16558 #: ../src/guestfs-actions.pod:6555 ../fish/guestfish-actions.pod:4419
16559 msgid "This command returns up to the last 10 lines of a file as a list of strings."
16563 #: ../src/guestfs-actions.pod:6567
16564 msgid "guestfs_tail_n"
16568 #: ../src/guestfs-actions.pod:6569
16572 " guestfs_tail_n (guestfs_h *g,\n"
16574 " const char *path);\n"
16579 #: ../src/guestfs-actions.pod:6574 ../fish/guestfish-actions.pod:4429
16581 "If the parameter C<nrlines> is a positive number, this returns the last "
16582 "C<nrlines> lines of the file C<path>."
16586 #: ../src/guestfs-actions.pod:6577 ../fish/guestfish-actions.pod:4432
16588 "If the parameter C<nrlines> is a negative number, this returns lines from "
16589 "the file C<path>, starting with the C<-nrlines>th line."
16593 #: ../src/guestfs-actions.pod:6591
16594 msgid "guestfs_tar_in"
16598 #: ../src/guestfs-actions.pod:6593
16602 " guestfs_tar_in (guestfs_h *g,\n"
16603 " const char *tarfile,\n"
16604 " const char *directory);\n"
16609 #: ../src/guestfs-actions.pod:6598 ../fish/guestfish-actions.pod:4444
16611 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16612 "tar file) into C<directory>."
16616 #: ../src/guestfs-actions.pod:6601
16617 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
16621 #: ../src/guestfs-actions.pod:6606 ../src/guestfs-actions.pod:6623 ../src/guestfs-actions.pod:6639 ../src/guestfs-actions.pod:6655
16622 msgid "(Added in 1.0.3)"
16626 #: ../src/guestfs-actions.pod:6608
16627 msgid "guestfs_tar_out"
16631 #: ../src/guestfs-actions.pod:6610
16635 " guestfs_tar_out (guestfs_h *g,\n"
16636 " const char *directory,\n"
16637 " const char *tarfile);\n"
16642 #: ../src/guestfs-actions.pod:6615 ../fish/guestfish-actions.pod:4456
16644 "This command packs the contents of C<directory> and downloads it to local "
16649 #: ../src/guestfs-actions.pod:6618
16651 "To download a compressed tarball, use C<guestfs_tgz_out> or "
16652 "C<guestfs_txz_out>."
16656 #: ../src/guestfs-actions.pod:6625
16657 msgid "guestfs_tgz_in"
16661 #: ../src/guestfs-actions.pod:6627
16665 " guestfs_tgz_in (guestfs_h *g,\n"
16666 " const char *tarball,\n"
16667 " const char *directory);\n"
16672 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4468
16674 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16675 "tar file) into C<directory>."
16679 #: ../src/guestfs-actions.pod:6635
16680 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
16684 #: ../src/guestfs-actions.pod:6641
16685 msgid "guestfs_tgz_out"
16689 #: ../src/guestfs-actions.pod:6643
16693 " guestfs_tgz_out (guestfs_h *g,\n"
16694 " const char *directory,\n"
16695 " const char *tarball);\n"
16700 #: ../src/guestfs-actions.pod:6648 ../fish/guestfish-actions.pod:4479
16702 "This command packs the contents of C<directory> and downloads it to local "
16707 #: ../src/guestfs-actions.pod:6651
16708 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
16712 #: ../src/guestfs-actions.pod:6657
16713 msgid "guestfs_touch"
16717 #: ../src/guestfs-actions.pod:6659
16721 " guestfs_touch (guestfs_h *g,\n"
16722 " const char *path);\n"
16727 #: ../src/guestfs-actions.pod:6663 ../fish/guestfish-actions.pod:4490
16729 "Touch acts like the L<touch(1)> command. It can be used to update the "
16730 "timestamps on a file, or, if the file does not exist, to create a new "
16731 "zero-length file."
16735 #: ../src/guestfs-actions.pod:6667 ../fish/guestfish-actions.pod:4494
16737 "This command only works on regular files, and will fail on other file types "
16738 "such as directories, symbolic links, block special etc."
16742 #: ../src/guestfs-actions.pod:6674
16743 msgid "guestfs_truncate"
16747 #: ../src/guestfs-actions.pod:6676
16751 " guestfs_truncate (guestfs_h *g,\n"
16752 " const char *path);\n"
16757 #: ../src/guestfs-actions.pod:6680 ../fish/guestfish-actions.pod:4501
16759 "This command truncates C<path> to a zero-length file. The file must exist "
16764 #: ../src/guestfs-actions.pod:6687
16765 msgid "guestfs_truncate_size"
16769 #: ../src/guestfs-actions.pod:6689
16773 " guestfs_truncate_size (guestfs_h *g,\n"
16774 " const char *path,\n"
16775 " int64_t size);\n"
16780 #: ../src/guestfs-actions.pod:6694 ../fish/guestfish-actions.pod:4508
16782 "This command truncates C<path> to size C<size> bytes. The file must exist "
16787 #: ../src/guestfs-actions.pod:6697
16789 "If the current file size is less than C<size> then the file is extended to "
16790 "the required size with zero bytes. This creates a sparse file (ie. disk "
16791 "blocks are not allocated for the file until you write to it). To create a "
16792 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
16796 #: ../src/guestfs-actions.pod:6707
16797 msgid "guestfs_tune2fs_l"
16801 #: ../src/guestfs-actions.pod:6709
16805 " guestfs_tune2fs_l (guestfs_h *g,\n"
16806 " const char *device);\n"
16811 #: ../src/guestfs-actions.pod:6713 ../fish/guestfish-actions.pod:4521
16813 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16818 #: ../src/guestfs-actions.pod:6716 ../fish/guestfish-actions.pod:4524
16820 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16821 "for more details. The list of fields returned isn't clearly defined, and "
16822 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16823 "and the filesystem itself."
16827 #: ../src/guestfs-actions.pod:6729
16828 msgid "guestfs_txz_in"
16832 #: ../src/guestfs-actions.pod:6731
16836 " guestfs_txz_in (guestfs_h *g,\n"
16837 " const char *tarball,\n"
16838 " const char *directory);\n"
16843 #: ../src/guestfs-actions.pod:6736 ../fish/guestfish-actions.pod:4533
16845 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16846 "tar file) into C<directory>."
16850 #: ../src/guestfs-actions.pod:6743
16851 msgid "guestfs_txz_out"
16855 #: ../src/guestfs-actions.pod:6745
16859 " guestfs_txz_out (guestfs_h *g,\n"
16860 " const char *directory,\n"
16861 " const char *tarball);\n"
16866 #: ../src/guestfs-actions.pod:6750 ../fish/guestfish-actions.pod:4542
16868 "This command packs the contents of C<directory> and downloads it to local "
16869 "file C<tarball> (as an xz compressed tar archive)."
16873 #: ../src/guestfs-actions.pod:6757
16874 msgid "guestfs_umask"
16878 #: ../src/guestfs-actions.pod:6759
16882 " guestfs_umask (guestfs_h *g,\n"
16888 #: ../src/guestfs-actions.pod:6763 ../fish/guestfish-actions.pod:4551
16890 "This function sets the mask used for creating new files and device nodes to "
16895 #: ../src/guestfs-actions.pod:6766 ../fish/guestfish-actions.pod:4554
16897 "Typical umask values would be C<022> which creates new files with "
16898 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
16899 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
16903 #: ../src/guestfs-actions.pod:6771 ../fish/guestfish-actions.pod:4559
16905 "The default umask is C<022>. This is important because it means that "
16906 "directories and device nodes will be created with C<0644> or C<0755> mode "
16907 "even if you specify C<0777>."
16911 #: ../src/guestfs-actions.pod:6775
16913 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
16914 "C<guestfs_mkdir>."
16918 #: ../src/guestfs-actions.pod:6778 ../fish/guestfish-actions.pod:4566
16919 msgid "This call returns the previous umask."
16923 #: ../src/guestfs-actions.pod:6784
16924 msgid "guestfs_umount"
16928 #: ../src/guestfs-actions.pod:6786
16932 " guestfs_umount (guestfs_h *g,\n"
16933 " const char *pathordevice);\n"
16938 #: ../src/guestfs-actions.pod:6790 ../fish/guestfish-actions.pod:4574
16940 "This unmounts the given filesystem. The filesystem may be specified either "
16941 "by its mountpoint (path) or the device which contains the filesystem."
16945 #: ../src/guestfs-actions.pod:6798
16946 msgid "guestfs_umount_all"
16950 #: ../src/guestfs-actions.pod:6800
16954 " guestfs_umount_all (guestfs_h *g);\n"
16959 #: ../src/guestfs-actions.pod:6803 ../fish/guestfish-actions.pod:4584
16960 msgid "This unmounts all mounted filesystems."
16964 #: ../src/guestfs-actions.pod:6805 ../fish/guestfish-actions.pod:4586
16965 msgid "Some internal mounts are not unmounted by this call."
16969 #: ../src/guestfs-actions.pod:6811
16970 msgid "guestfs_upload"
16974 #: ../src/guestfs-actions.pod:6813
16978 " guestfs_upload (guestfs_h *g,\n"
16979 " const char *filename,\n"
16980 " const char *remotefilename);\n"
16985 #: ../src/guestfs-actions.pod:6818 ../src/guestfs-actions.pod:6842 ../fish/guestfish-actions.pod:4592 ../fish/guestfish-actions.pod:4605
16986 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16990 #: ../src/guestfs-actions.pod:6823
16991 msgid "See also C<guestfs_download>."
16995 #: ../src/guestfs-actions.pod:6834
16996 msgid "guestfs_upload_offset"
17000 #: ../src/guestfs-actions.pod:6836
17004 " guestfs_upload_offset (guestfs_h *g,\n"
17005 " const char *filename,\n"
17006 " const char *remotefilename,\n"
17007 " int64_t offset);\n"
17012 #: ../src/guestfs-actions.pod:6845 ../fish/guestfish-actions.pod:4608
17014 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
17015 "The intention is to overwrite parts of existing files or devices, although "
17016 "if a non-existant file is specified then it is created with a \"hole\" "
17017 "before C<offset>. The size of the data written is implicit in the size of "
17018 "the source C<filename>."
17022 #: ../src/guestfs-actions.pod:6852
17024 "Note that there is no limit on the amount of data that can be uploaded with "
17025 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
17026 "full amount unless an error occurs."
17030 #: ../src/guestfs-actions.pod:6857
17031 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
17035 #: ../src/guestfs-actions.pod:6868
17036 msgid "guestfs_utimens"
17040 #: ../src/guestfs-actions.pod:6870
17044 " guestfs_utimens (guestfs_h *g,\n"
17045 " const char *path,\n"
17046 " int64_t atsecs,\n"
17047 " int64_t atnsecs,\n"
17048 " int64_t mtsecs,\n"
17049 " int64_t mtnsecs);\n"
17054 #: ../src/guestfs-actions.pod:6878 ../fish/guestfish-actions.pod:4628
17055 msgid "This command sets the timestamps of a file with nanosecond precision."
17059 #: ../src/guestfs-actions.pod:6881 ../fish/guestfish-actions.pod:4631
17061 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
17066 #: ../src/guestfs-actions.pod:6884 ../fish/guestfish-actions.pod:4634
17068 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
17069 "nanoseconds from the epoch."
17073 #: ../src/guestfs-actions.pod:6887 ../fish/guestfish-actions.pod:4637
17075 "If the C<*nsecs> field contains the special value C<-1> then the "
17076 "corresponding timestamp is set to the current time. (The C<*secs> field is "
17077 "ignored in this case)."
17081 #: ../src/guestfs-actions.pod:6891 ../fish/guestfish-actions.pod:4641
17083 "If the C<*nsecs> field contains the special value C<-2> then the "
17084 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
17089 #: ../src/guestfs-actions.pod:6899 ../src/guestfs-structs.pod:175
17090 msgid "guestfs_version"
17094 #: ../src/guestfs-actions.pod:6901
17097 " struct guestfs_version *\n"
17098 " guestfs_version (guestfs_h *g);\n"
17103 #: ../src/guestfs-actions.pod:6904 ../fish/guestfish-actions.pod:4649
17104 msgid "Return the libguestfs version number that the program is linked against."
17108 #: ../src/guestfs-actions.pod:6907 ../fish/guestfish-actions.pod:4652
17110 "Note that because of dynamic linking this is not necessarily the version of "
17111 "libguestfs that you compiled against. You can compile the program, and then "
17112 "at runtime dynamically link against a completely different C<libguestfs.so> "
17117 #: ../src/guestfs-actions.pod:6912 ../fish/guestfish-actions.pod:4657
17119 "This call was added in version C<1.0.58>. In previous versions of "
17120 "libguestfs there was no way to get the version number. From C code you can "
17121 "use dynamic linker functions to find out if this symbol exists (if it "
17122 "doesn't, then it's an earlier version)."
17126 #: ../src/guestfs-actions.pod:6918 ../fish/guestfish-actions.pod:4663
17128 "The call returns a structure with four elements. The first three (C<major>, "
17129 "C<minor> and C<release>) are numbers and correspond to the usual version "
17130 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
17131 "but may be used for distro-specific information."
17135 #: ../src/guestfs-actions.pod:6924 ../fish/guestfish-actions.pod:4669
17136 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
17140 #: ../src/guestfs-actions.pod:6927 ../fish/guestfish-actions.pod:4672
17141 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
17145 #: ../src/guestfs-actions.pod:6929
17147 "I<Note:> Don't use this call to test for availability of features. In "
17148 "enterprise distributions we backport features from later versions into "
17149 "earlier versions, making this an unreliable way to test for features. Use "
17150 "C<guestfs_available> instead."
17154 #: ../src/guestfs-actions.pod:6935
17156 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
17157 "error. I<The caller must call C<guestfs_free_version> after use>."
17161 #: ../src/guestfs-actions.pod:6939
17162 msgid "(Added in 1.0.58)"
17166 #: ../src/guestfs-actions.pod:6941
17167 msgid "guestfs_vfs_label"
17171 #: ../src/guestfs-actions.pod:6943
17175 " guestfs_vfs_label (guestfs_h *g,\n"
17176 " const char *device);\n"
17181 #: ../src/guestfs-actions.pod:6947 ../fish/guestfish-actions.pod:4684
17182 msgid "This returns the filesystem label of the filesystem on C<device>."
17186 #: ../src/guestfs-actions.pod:6950 ../fish/guestfish-actions.pod:4687
17187 msgid "If the filesystem is unlabeled, this returns the empty string."
17191 #: ../src/guestfs-actions.pod:6952
17192 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
17196 #: ../src/guestfs-actions.pod:6957 ../src/guestfs-actions.pod:6994
17197 msgid "(Added in 1.3.18)"
17201 #: ../src/guestfs-actions.pod:6959
17202 msgid "guestfs_vfs_type"
17206 #: ../src/guestfs-actions.pod:6961
17210 " guestfs_vfs_type (guestfs_h *g,\n"
17211 " const char *device);\n"
17216 #: ../src/guestfs-actions.pod:6965 ../fish/guestfish-actions.pod:4695
17218 "This command gets the filesystem type corresponding to the filesystem on "
17223 #: ../src/guestfs-actions.pod:6968 ../fish/guestfish-actions.pod:4698
17225 "For most filesystems, the result is the name of the Linux VFS module which "
17226 "would be used to mount this filesystem if you mounted it without specifying "
17227 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
17231 #: ../src/guestfs-actions.pod:6978
17232 msgid "guestfs_vfs_uuid"
17236 #: ../src/guestfs-actions.pod:6980
17240 " guestfs_vfs_uuid (guestfs_h *g,\n"
17241 " const char *device);\n"
17246 #: ../src/guestfs-actions.pod:6984 ../fish/guestfish-actions.pod:4707
17247 msgid "This returns the filesystem UUID of the filesystem on C<device>."
17251 #: ../src/guestfs-actions.pod:6987 ../fish/guestfish-actions.pod:4710
17252 msgid "If the filesystem does not have a UUID, this returns the empty string."
17256 #: ../src/guestfs-actions.pod:6989
17257 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
17261 #: ../src/guestfs-actions.pod:6996
17262 msgid "guestfs_vg_activate"
17266 #: ../src/guestfs-actions.pod:6998
17270 " guestfs_vg_activate (guestfs_h *g,\n"
17272 " char *const *volgroups);\n"
17277 #: ../src/guestfs-actions.pod:7003 ../fish/guestfish-actions.pod:4718
17279 "This command activates or (if C<activate> is false) deactivates all logical "
17280 "volumes in the listed volume groups C<volgroups>. If activated, then they "
17281 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
17282 "deactivated, then those devices disappear."
17286 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:4724
17287 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
17291 #: ../src/guestfs-actions.pod:7011 ../fish/guestfish-actions.pod:4726
17293 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
17294 "activated or deactivated."
17298 #: ../src/guestfs-actions.pod:7018
17299 msgid "guestfs_vg_activate_all"
17303 #: ../src/guestfs-actions.pod:7020
17307 " guestfs_vg_activate_all (guestfs_h *g,\n"
17308 " int activate);\n"
17313 #: ../src/guestfs-actions.pod:7024 ../fish/guestfish-actions.pod:4733
17315 "This command activates or (if C<activate> is false) deactivates all logical "
17316 "volumes in all volume groups. If activated, then they are made known to the "
17317 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
17318 "those devices disappear."
17322 #: ../src/guestfs-actions.pod:7030 ../fish/guestfish-actions.pod:4739
17323 msgid "This command is the same as running C<vgchange -a y|n>"
17327 #: ../src/guestfs-actions.pod:7036
17328 msgid "guestfs_vgcreate"
17332 #: ../src/guestfs-actions.pod:7038
17336 " guestfs_vgcreate (guestfs_h *g,\n"
17337 " const char *volgroup,\n"
17338 " char *const *physvols);\n"
17343 #: ../src/guestfs-actions.pod:7043 ../fish/guestfish-actions.pod:4745
17345 "This creates an LVM volume group called C<volgroup> from the non-empty list "
17346 "of physical volumes C<physvols>."
17350 #: ../src/guestfs-actions.pod:7050
17351 msgid "guestfs_vglvuuids"
17355 #: ../src/guestfs-actions.pod:7052
17359 " guestfs_vglvuuids (guestfs_h *g,\n"
17360 " const char *vgname);\n"
17365 #: ../src/guestfs-actions.pod:7056 ../fish/guestfish-actions.pod:4752
17367 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
17368 "volumes created in this volume group."
17372 #: ../src/guestfs-actions.pod:7059
17374 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
17375 "associate logical volumes and volume groups."
17379 #: ../src/guestfs-actions.pod:7062
17380 msgid "See also C<guestfs_vgpvuuids>."
17384 #: ../src/guestfs-actions.pod:7070
17385 msgid "guestfs_vgpvuuids"
17389 #: ../src/guestfs-actions.pod:7072
17393 " guestfs_vgpvuuids (guestfs_h *g,\n"
17394 " const char *vgname);\n"
17399 #: ../src/guestfs-actions.pod:7076 ../fish/guestfish-actions.pod:4764
17401 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
17402 "volumes that this volume group resides on."
17406 #: ../src/guestfs-actions.pod:7079
17408 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
17409 "associate physical volumes and volume groups."
17413 #: ../src/guestfs-actions.pod:7082
17414 msgid "See also C<guestfs_vglvuuids>."
17418 #: ../src/guestfs-actions.pod:7090
17419 msgid "guestfs_vgremove"
17423 #: ../src/guestfs-actions.pod:7092
17427 " guestfs_vgremove (guestfs_h *g,\n"
17428 " const char *vgname);\n"
17433 #: ../src/guestfs-actions.pod:7096 ../fish/guestfish-actions.pod:4776
17434 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
17438 #: ../src/guestfs-actions.pod:7098 ../fish/guestfish-actions.pod:4778
17439 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
17443 #: ../src/guestfs-actions.pod:7105
17444 msgid "guestfs_vgrename"
17448 #: ../src/guestfs-actions.pod:7107
17452 " guestfs_vgrename (guestfs_h *g,\n"
17453 " const char *volgroup,\n"
17454 " const char *newvolgroup);\n"
17459 #: ../src/guestfs-actions.pod:7112 ../fish/guestfish-actions.pod:4785
17460 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
17464 #: ../src/guestfs-actions.pod:7118
17465 msgid "guestfs_vgs"
17469 #: ../src/guestfs-actions.pod:7120
17473 " guestfs_vgs (guestfs_h *g);\n"
17478 #: ../src/guestfs-actions.pod:7123 ../fish/guestfish-actions.pod:4791
17480 "List all the volumes groups detected. This is the equivalent of the "
17481 "L<vgs(8)> command."
17485 #: ../src/guestfs-actions.pod:7126 ../fish/guestfish-actions.pod:4794
17487 "This returns a list of just the volume group names that were detected "
17488 "(eg. C<VolGroup00>)."
17492 #: ../src/guestfs-actions.pod:7129
17493 msgid "See also C<guestfs_vgs_full>."
17497 #: ../src/guestfs-actions.pod:7137
17498 msgid "guestfs_vgs_full"
17502 #: ../src/guestfs-actions.pod:7139
17505 " struct guestfs_lvm_vg_list *\n"
17506 " guestfs_vgs_full (guestfs_h *g);\n"
17511 #: ../src/guestfs-actions.pod:7142 ../fish/guestfish-actions.pod:4803
17513 "List all the volumes groups detected. This is the equivalent of the "
17514 "L<vgs(8)> command. The \"full\" version includes all fields."
17518 #: ../src/guestfs-actions.pod:7145
17520 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
17521 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
17526 #: ../src/guestfs-actions.pod:7151
17527 msgid "guestfs_vgscan"
17531 #: ../src/guestfs-actions.pod:7153
17535 " guestfs_vgscan (guestfs_h *g);\n"
17540 #: ../src/guestfs-actions.pod:7156 ../fish/guestfish-actions.pod:4810
17542 "This rescans all block devices and rebuilds the list of LVM physical "
17543 "volumes, volume groups and logical volumes."
17547 #: ../src/guestfs-actions.pod:7163
17548 msgid "guestfs_vguuid"
17552 #: ../src/guestfs-actions.pod:7165
17556 " guestfs_vguuid (guestfs_h *g,\n"
17557 " const char *vgname);\n"
17562 #: ../src/guestfs-actions.pod:7169 ../fish/guestfish-actions.pod:4817
17563 msgid "This command returns the UUID of the LVM VG named C<vgname>."
17567 #: ../src/guestfs-actions.pod:7176
17568 msgid "guestfs_wait_ready"
17572 #: ../src/guestfs-actions.pod:7178
17576 " guestfs_wait_ready (guestfs_h *g);\n"
17581 #: ../src/guestfs-actions.pod:7181
17582 msgid "This function is a no op."
17586 #: ../src/guestfs-actions.pod:7183
17588 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
17589 "calling C<guestfs_launch> to wait for the launch to complete. However this "
17590 "is no longer necessary because C<guestfs_launch> now does the waiting."
17594 #: ../src/guestfs-actions.pod:7188
17596 "If you see any calls to this function in code then you can just remove them, "
17597 "unless you want to retain compatibility with older versions of the API."
17601 #: ../src/guestfs-actions.pod:7196
17602 msgid "guestfs_wc_c"
17606 #: ../src/guestfs-actions.pod:7198
17610 " guestfs_wc_c (guestfs_h *g,\n"
17611 " const char *path);\n"
17616 #: ../src/guestfs-actions.pod:7202 ../fish/guestfish-actions.pod:4823
17618 "This command counts the characters in a file, using the C<wc -c> external "
17623 #: ../src/guestfs-actions.pod:7209
17624 msgid "guestfs_wc_l"
17628 #: ../src/guestfs-actions.pod:7211
17632 " guestfs_wc_l (guestfs_h *g,\n"
17633 " const char *path);\n"
17638 #: ../src/guestfs-actions.pod:7215 ../fish/guestfish-actions.pod:4830
17640 "This command counts the lines in a file, using the C<wc -l> external "
17645 #: ../src/guestfs-actions.pod:7222
17646 msgid "guestfs_wc_w"
17650 #: ../src/guestfs-actions.pod:7224
17654 " guestfs_wc_w (guestfs_h *g,\n"
17655 " const char *path);\n"
17660 #: ../src/guestfs-actions.pod:7228 ../fish/guestfish-actions.pod:4837
17662 "This command counts the words in a file, using the C<wc -w> external "
17667 #: ../src/guestfs-actions.pod:7235
17668 msgid "guestfs_write"
17672 #: ../src/guestfs-actions.pod:7237
17676 " guestfs_write (guestfs_h *g,\n"
17677 " const char *path,\n"
17678 " const char *content,\n"
17679 " size_t content_size);\n"
17684 #: ../src/guestfs-actions.pod:7243 ../fish/guestfish-actions.pod:4844
17686 "This call creates a file called C<path>. The content of the file is the "
17687 "string C<content> (which can contain any 8 bit data)."
17691 #: ../src/guestfs-actions.pod:7253
17692 msgid "guestfs_write_file"
17696 #: ../src/guestfs-actions.pod:7255
17700 " guestfs_write_file (guestfs_h *g,\n"
17701 " const char *path,\n"
17702 " const char *content,\n"
17708 #: ../src/guestfs-actions.pod:7261 ../fish/guestfish-actions.pod:4854
17710 "This call creates a file called C<path>. The contents of the file is the "
17711 "string C<content> (which can contain any 8 bit data), with length C<size>."
17715 #: ../src/guestfs-actions.pod:7265 ../fish/guestfish-actions.pod:4858
17717 "As a special case, if C<size> is C<0> then the length is calculated using "
17718 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17722 #: ../src/guestfs-actions.pod:7269 ../fish/guestfish-actions.pod:4862
17724 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17725 "I<not> work, even if the length is specified."
17729 #: ../src/guestfs-actions.pod:7277 ../fish/guestfish-actions.pod:4868
17730 msgid "This function is deprecated. In new code, use the C<write> call instead."
17734 #: ../src/guestfs-actions.pod:7286
17735 msgid "guestfs_zegrep"
17739 #: ../src/guestfs-actions.pod:7288
17743 " guestfs_zegrep (guestfs_h *g,\n"
17744 " const char *regex,\n"
17745 " const char *path);\n"
17750 #: ../src/guestfs-actions.pod:7293 ../fish/guestfish-actions.pod:4879
17751 msgid "This calls the external C<zegrep> program and returns the matching lines."
17755 #: ../src/guestfs-actions.pod:7305
17756 msgid "guestfs_zegrepi"
17760 #: ../src/guestfs-actions.pod:7307
17764 " guestfs_zegrepi (guestfs_h *g,\n"
17765 " const char *regex,\n"
17766 " const char *path);\n"
17771 #: ../src/guestfs-actions.pod:7312 ../fish/guestfish-actions.pod:4889
17772 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
17776 #: ../src/guestfs-actions.pod:7324
17777 msgid "guestfs_zero"
17781 #: ../src/guestfs-actions.pod:7326
17785 " guestfs_zero (guestfs_h *g,\n"
17786 " const char *device);\n"
17791 #: ../src/guestfs-actions.pod:7330 ../fish/guestfish-actions.pod:4899
17792 msgid "This command writes zeroes over the first few blocks of C<device>."
17796 #: ../src/guestfs-actions.pod:7332 ../fish/guestfish-actions.pod:4901
17798 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17799 "securely wipe the device). It should be sufficient to remove any partition "
17800 "tables, filesystem superblocks and so on."
17804 #: ../src/guestfs-actions.pod:7336
17805 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
17809 #: ../src/guestfs-actions.pod:7347
17810 msgid "guestfs_zero_device"
17814 #: ../src/guestfs-actions.pod:7349
17818 " guestfs_zero_device (guestfs_h *g,\n"
17819 " const char *device);\n"
17824 #: ../src/guestfs-actions.pod:7353
17826 "This command writes zeroes over the entire C<device>. Compare with "
17827 "C<guestfs_zero> which just zeroes the first few blocks of a device."
17831 #: ../src/guestfs-actions.pod:7367
17832 msgid "(Added in 1.3.1)"
17836 #: ../src/guestfs-actions.pod:7369
17837 msgid "guestfs_zerofree"
17841 #: ../src/guestfs-actions.pod:7371
17845 " guestfs_zerofree (guestfs_h *g,\n"
17846 " const char *device);\n"
17851 #: ../src/guestfs-actions.pod:7375 ../fish/guestfish-actions.pod:4922
17853 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17854 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17855 "possible to compress the filesystem more effectively."
17859 #: ../src/guestfs-actions.pod:7380 ../fish/guestfish-actions.pod:4927
17860 msgid "You should B<not> run this program if the filesystem is mounted."
17864 #: ../src/guestfs-actions.pod:7383 ../fish/guestfish-actions.pod:4930
17866 "It is possible that using this program can damage the filesystem or data on "
17871 #: ../src/guestfs-actions.pod:7390
17872 msgid "guestfs_zfgrep"
17876 #: ../src/guestfs-actions.pod:7392
17880 " guestfs_zfgrep (guestfs_h *g,\n"
17881 " const char *pattern,\n"
17882 " const char *path);\n"
17887 #: ../src/guestfs-actions.pod:7397 ../fish/guestfish-actions.pod:4937
17888 msgid "This calls the external C<zfgrep> program and returns the matching lines."
17892 #: ../src/guestfs-actions.pod:7409
17893 msgid "guestfs_zfgrepi"
17897 #: ../src/guestfs-actions.pod:7411
17901 " guestfs_zfgrepi (guestfs_h *g,\n"
17902 " const char *pattern,\n"
17903 " const char *path);\n"
17908 #: ../src/guestfs-actions.pod:7416 ../fish/guestfish-actions.pod:4947
17909 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
17913 #: ../src/guestfs-actions.pod:7428
17914 msgid "guestfs_zfile"
17918 #: ../src/guestfs-actions.pod:7430
17922 " guestfs_zfile (guestfs_h *g,\n"
17923 " const char *meth,\n"
17924 " const char *path);\n"
17929 #: ../src/guestfs-actions.pod:7435 ../fish/guestfish-actions.pod:4957
17930 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
17934 #: ../src/guestfs-actions.pod:7438 ../fish/guestfish-actions.pod:4960
17935 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17939 #: ../src/guestfs-actions.pod:7440
17941 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
17946 #: ../src/guestfs-actions.pod:7446 ../fish/guestfish-actions.pod:4965
17947 msgid "This function is deprecated. In new code, use the C<file> call instead."
17951 #: ../src/guestfs-actions.pod:7455
17952 msgid "guestfs_zgrep"
17956 #: ../src/guestfs-actions.pod:7457
17960 " guestfs_zgrep (guestfs_h *g,\n"
17961 " const char *regex,\n"
17962 " const char *path);\n"
17967 #: ../src/guestfs-actions.pod:7462 ../fish/guestfish-actions.pod:4976
17968 msgid "This calls the external C<zgrep> program and returns the matching lines."
17972 #: ../src/guestfs-actions.pod:7474
17973 msgid "guestfs_zgrepi"
17977 #: ../src/guestfs-actions.pod:7476
17981 " guestfs_zgrepi (guestfs_h *g,\n"
17982 " const char *regex,\n"
17983 " const char *path);\n"
17988 #: ../src/guestfs-actions.pod:7481 ../fish/guestfish-actions.pod:4986
17989 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
17993 #: ../src/guestfs-availability.pod:3
17998 #: ../src/guestfs-availability.pod:5
18000 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
18001 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
18002 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
18003 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
18004 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
18008 #: ../src/guestfs-availability.pod:21
18013 #: ../src/guestfs-availability.pod:23
18015 "The following functions: L</guestfs_inotify_add_watch> "
18016 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
18017 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
18021 #: ../src/guestfs-availability.pod:31
18022 msgid "B<linuxfsuuid>"
18026 #: ../src/guestfs-availability.pod:33
18028 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
18029 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
18033 #: ../src/guestfs-availability.pod:40
18034 msgid "B<linuxmodules>"
18038 #: ../src/guestfs-availability.pod:42
18039 msgid "The following functions: L</guestfs_modprobe>"
18043 #: ../src/guestfs-availability.pod:45
18044 msgid "B<linuxxattrs>"
18048 #: ../src/guestfs-availability.pod:47
18050 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
18051 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
18052 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
18053 "L</guestfs_setxattr>"
18057 #: ../src/guestfs-availability.pod:58
18062 #: ../src/guestfs-availability.pod:60
18064 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
18065 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
18066 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
18070 #: ../src/guestfs-availability.pod:69
18075 #: ../src/guestfs-availability.pod:71
18077 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
18078 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
18079 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
18080 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
18081 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
18082 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
18083 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
18084 "L</guestfs_vgs_full>"
18088 #: ../src/guestfs-availability.pod:94
18093 #: ../src/guestfs-availability.pod:96
18095 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
18096 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
18100 #: ../src/guestfs-availability.pod:102
18105 #: ../src/guestfs-availability.pod:104
18106 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
18110 #: ../src/guestfs-availability.pod:107
18111 msgid "B<ntfsprogs>"
18115 #: ../src/guestfs-availability.pod:109
18116 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
18120 #: ../src/guestfs-availability.pod:113
18121 msgid "B<realpath>"
18125 #: ../src/guestfs-availability.pod:115
18126 msgid "The following functions: L</guestfs_realpath>"
18130 #: ../src/guestfs-availability.pod:118
18135 #: ../src/guestfs-availability.pod:120
18137 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
18138 "L</guestfs_scrub_freespace>"
18142 #: ../src/guestfs-availability.pod:125
18147 #: ../src/guestfs-availability.pod:127
18148 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
18152 #: ../src/guestfs-availability.pod:131
18157 #: ../src/guestfs-availability.pod:133
18158 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
18162 #: ../src/guestfs-availability.pod:137
18163 msgid "B<zerofree>"
18167 #: ../src/guestfs-availability.pod:139
18168 msgid "The following functions: L</guestfs_zerofree>"
18172 #: ../src/guestfs-structs.pod:1
18173 msgid "guestfs_int_bool"
18177 #: ../src/guestfs-structs.pod:3
18180 " struct guestfs_int_bool {\n"
18188 #: ../src/guestfs-structs.pod:8
18191 " struct guestfs_int_bool_list {\n"
18192 " uint32_t len; /* Number of elements in list. */\n"
18193 " struct guestfs_int_bool *val; /* Elements. */\n"
18199 #: ../src/guestfs-structs.pod:13
18202 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
18203 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
18208 #: ../src/guestfs-structs.pod:16
18209 msgid "guestfs_lvm_pv"
18213 #: ../src/guestfs-structs.pod:18
18216 " struct guestfs_lvm_pv {\n"
18217 " char *pv_name;\n"
18218 " /* The next field is NOT nul-terminated, be careful when printing it: "
18220 " char pv_uuid[32];\n"
18222 " uint64_t pv_size;\n"
18223 " uint64_t dev_size;\n"
18224 " uint64_t pv_free;\n"
18225 " uint64_t pv_used;\n"
18226 " char *pv_attr;\n"
18227 " int64_t pv_pe_count;\n"
18228 " int64_t pv_pe_alloc_count;\n"
18229 " char *pv_tags;\n"
18230 " uint64_t pe_start;\n"
18231 " int64_t pv_mda_count;\n"
18232 " uint64_t pv_mda_free;\n"
18238 #: ../src/guestfs-structs.pod:36
18241 " struct guestfs_lvm_pv_list {\n"
18242 " uint32_t len; /* Number of elements in list. */\n"
18243 " struct guestfs_lvm_pv *val; /* Elements. */\n"
18249 #: ../src/guestfs-structs.pod:41
18252 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
18253 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
18258 #: ../src/guestfs-structs.pod:44
18259 msgid "guestfs_lvm_vg"
18263 #: ../src/guestfs-structs.pod:46
18266 " struct guestfs_lvm_vg {\n"
18267 " char *vg_name;\n"
18268 " /* The next field is NOT nul-terminated, be careful when printing it: "
18270 " char vg_uuid[32];\n"
18272 " char *vg_attr;\n"
18273 " uint64_t vg_size;\n"
18274 " uint64_t vg_free;\n"
18275 " char *vg_sysid;\n"
18276 " uint64_t vg_extent_size;\n"
18277 " int64_t vg_extent_count;\n"
18278 " int64_t vg_free_count;\n"
18279 " int64_t max_lv;\n"
18280 " int64_t max_pv;\n"
18281 " int64_t pv_count;\n"
18282 " int64_t lv_count;\n"
18283 " int64_t snap_count;\n"
18284 " int64_t vg_seqno;\n"
18285 " char *vg_tags;\n"
18286 " int64_t vg_mda_count;\n"
18287 " uint64_t vg_mda_free;\n"
18293 #: ../src/guestfs-structs.pod:69
18296 " struct guestfs_lvm_vg_list {\n"
18297 " uint32_t len; /* Number of elements in list. */\n"
18298 " struct guestfs_lvm_vg *val; /* Elements. */\n"
18304 #: ../src/guestfs-structs.pod:74
18307 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
18308 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
18313 #: ../src/guestfs-structs.pod:77
18314 msgid "guestfs_lvm_lv"
18318 #: ../src/guestfs-structs.pod:79
18321 " struct guestfs_lvm_lv {\n"
18322 " char *lv_name;\n"
18323 " /* The next field is NOT nul-terminated, be careful when printing it: "
18325 " char lv_uuid[32];\n"
18326 " char *lv_attr;\n"
18327 " int64_t lv_major;\n"
18328 " int64_t lv_minor;\n"
18329 " int64_t lv_kernel_major;\n"
18330 " int64_t lv_kernel_minor;\n"
18331 " uint64_t lv_size;\n"
18332 " int64_t seg_count;\n"
18334 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
18335 " float snap_percent;\n"
18336 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
18337 " float copy_percent;\n"
18338 " char *move_pv;\n"
18339 " char *lv_tags;\n"
18340 " char *mirror_log;\n"
18341 " char *modules;\n"
18347 #: ../src/guestfs-structs.pod:101
18350 " struct guestfs_lvm_lv_list {\n"
18351 " uint32_t len; /* Number of elements in list. */\n"
18352 " struct guestfs_lvm_lv *val; /* Elements. */\n"
18358 #: ../src/guestfs-structs.pod:106
18361 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
18362 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
18367 #: ../src/guestfs-structs.pod:111
18370 " struct guestfs_stat {\n"
18374 " int64_t nlink;\n"
18379 " int64_t blksize;\n"
18380 " int64_t blocks;\n"
18381 " int64_t atime;\n"
18382 " int64_t mtime;\n"
18383 " int64_t ctime;\n"
18389 #: ../src/guestfs-structs.pod:127
18392 " struct guestfs_stat_list {\n"
18393 " uint32_t len; /* Number of elements in list. */\n"
18394 " struct guestfs_stat *val; /* Elements. */\n"
18400 #: ../src/guestfs-structs.pod:132
18403 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
18404 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
18409 #: ../src/guestfs-structs.pod:137
18412 " struct guestfs_statvfs {\n"
18413 " int64_t bsize;\n"
18414 " int64_t frsize;\n"
18415 " int64_t blocks;\n"
18416 " int64_t bfree;\n"
18417 " int64_t bavail;\n"
18418 " int64_t files;\n"
18419 " int64_t ffree;\n"
18420 " int64_t favail;\n"
18423 " int64_t namemax;\n"
18429 #: ../src/guestfs-structs.pod:151
18432 " struct guestfs_statvfs_list {\n"
18433 " uint32_t len; /* Number of elements in list. */\n"
18434 " struct guestfs_statvfs *val; /* Elements. */\n"
18440 #: ../src/guestfs-structs.pod:156
18443 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
18444 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
18449 #: ../src/guestfs-structs.pod:159
18450 msgid "guestfs_dirent"
18454 #: ../src/guestfs-structs.pod:161
18457 " struct guestfs_dirent {\n"
18466 #: ../src/guestfs-structs.pod:167
18469 " struct guestfs_dirent_list {\n"
18470 " uint32_t len; /* Number of elements in list. */\n"
18471 " struct guestfs_dirent *val; /* Elements. */\n"
18477 #: ../src/guestfs-structs.pod:172
18480 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
18481 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
18486 #: ../src/guestfs-structs.pod:177
18489 " struct guestfs_version {\n"
18490 " int64_t major;\n"
18491 " int64_t minor;\n"
18492 " int64_t release;\n"
18499 #: ../src/guestfs-structs.pod:184
18502 " struct guestfs_version_list {\n"
18503 " uint32_t len; /* Number of elements in list. */\n"
18504 " struct guestfs_version *val; /* Elements. */\n"
18510 #: ../src/guestfs-structs.pod:189
18513 " void guestfs_free_version (struct guestfs_free_version *);\n"
18514 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
18519 #: ../src/guestfs-structs.pod:192
18520 msgid "guestfs_xattr"
18524 #: ../src/guestfs-structs.pod:194
18527 " struct guestfs_xattr {\n"
18528 " char *attrname;\n"
18529 " /* The next two fields describe a byte array. */\n"
18530 " uint32_t attrval_len;\n"
18531 " char *attrval;\n"
18537 #: ../src/guestfs-structs.pod:201
18540 " struct guestfs_xattr_list {\n"
18541 " uint32_t len; /* Number of elements in list. */\n"
18542 " struct guestfs_xattr *val; /* Elements. */\n"
18548 #: ../src/guestfs-structs.pod:206
18551 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
18552 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
18557 #: ../src/guestfs-structs.pod:209
18558 msgid "guestfs_inotify_event"
18562 #: ../src/guestfs-structs.pod:211
18565 " struct guestfs_inotify_event {\n"
18566 " int64_t in_wd;\n"
18567 " uint32_t in_mask;\n"
18568 " uint32_t in_cookie;\n"
18569 " char *in_name;\n"
18575 #: ../src/guestfs-structs.pod:218
18578 " struct guestfs_inotify_event_list {\n"
18579 " uint32_t len; /* Number of elements in list. */\n"
18580 " struct guestfs_inotify_event *val; /* Elements. */\n"
18586 #: ../src/guestfs-structs.pod:223
18589 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
18590 " void guestfs_free_inotify_event_list (struct "
18591 "guestfs_free_inotify_event_list *);\n"
18596 #: ../src/guestfs-structs.pod:226
18597 msgid "guestfs_partition"
18601 #: ../src/guestfs-structs.pod:228
18604 " struct guestfs_partition {\n"
18605 " int32_t part_num;\n"
18606 " uint64_t part_start;\n"
18607 " uint64_t part_end;\n"
18608 " uint64_t part_size;\n"
18614 #: ../src/guestfs-structs.pod:235
18617 " struct guestfs_partition_list {\n"
18618 " uint32_t len; /* Number of elements in list. */\n"
18619 " struct guestfs_partition *val; /* Elements. */\n"
18625 #: ../src/guestfs-structs.pod:240
18628 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
18629 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
18634 #: ../src/guestfs-structs.pod:243
18635 msgid "guestfs_application"
18639 #: ../src/guestfs-structs.pod:245
18642 " struct guestfs_application {\n"
18643 " char *app_name;\n"
18644 " char *app_display_name;\n"
18645 " int32_t app_epoch;\n"
18646 " char *app_version;\n"
18647 " char *app_release;\n"
18648 " char *app_install_path;\n"
18649 " char *app_trans_path;\n"
18650 " char *app_publisher;\n"
18651 " char *app_url;\n"
18652 " char *app_source_package;\n"
18653 " char *app_summary;\n"
18654 " char *app_description;\n"
18660 #: ../src/guestfs-structs.pod:260
18663 " struct guestfs_application_list {\n"
18664 " uint32_t len; /* Number of elements in list. */\n"
18665 " struct guestfs_application *val; /* Elements. */\n"
18671 #: ../src/guestfs-structs.pod:265
18674 " void guestfs_free_application (struct guestfs_free_application *);\n"
18675 " void guestfs_free_application_list (struct guestfs_free_application_list "
18681 #: ../fish/guestfish.pod:5
18682 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
18686 #: ../fish/guestfish.pod:9
18689 " guestfish [--options] [commands]\n"
18694 #: ../fish/guestfish.pod:11
18702 #: ../fish/guestfish.pod:13
18705 " guestfish [--ro|--rw] -a disk.img\n"
18710 #: ../fish/guestfish.pod:15
18713 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
18718 #: ../fish/guestfish.pod:17
18721 " guestfish -d libvirt-domain\n"
18726 #: ../fish/guestfish.pod:19
18729 " guestfish [--ro|--rw] -a disk.img -i\n"
18734 #: ../fish/guestfish.pod:21
18737 " guestfish -d libvirt-domain -i\n"
18742 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
18747 #: ../fish/guestfish.pod:25
18749 "Using guestfish in read/write mode on live virtual machines can be "
18750 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
18751 "option to use guestfish safely if the disk image or virtual machine might be "
18756 #: ../fish/guestfish.pod:32
18758 "Guestfish is a shell and command-line tool for examining and modifying "
18759 "virtual machine filesystems. It uses libguestfs and exposes all of the "
18760 "functionality of the guestfs API, see L<guestfs(3)>."
18764 #: ../fish/guestfish.pod:36
18766 "Guestfish gives you structured access to the libguestfs API, from shell "
18767 "scripts or the command line or interactively. If you want to rescue a "
18768 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
18773 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:949 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:63 ../tools/virt-tar.pl:50
18778 #: ../fish/guestfish.pod:43
18779 msgid "As an interactive shell"
18783 #: ../fish/guestfish.pod:45
18791 #: ../fish/guestfish.pod:47
18794 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
18795 " editing virtual machine filesystems.\n"
18800 #: ../fish/guestfish.pod:50
18803 " Type: 'help' for a list of commands\n"
18804 " 'man' to read the manual\n"
18805 " 'quit' to quit the shell\n"
18810 #: ../fish/guestfish.pod:54
18813 " ><fs> add-ro disk.img\n"
18815 " ><fs> list-filesystems\n"
18816 " /dev/sda1: ext4\n"
18817 " /dev/vg_guest/lv_root: ext4\n"
18818 " /dev/vg_guest/lv_swap: swap\n"
18819 " ><fs> mount /dev/vg_guest/lv_root /\n"
18820 " ><fs> cat /etc/fstab\n"
18822 " # Created by anaconda\n"
18829 #: ../fish/guestfish.pod:67
18830 msgid "From shell scripts"
18834 #: ../fish/guestfish.pod:69
18835 msgid "Create a new C</etc/motd> file in a guest or disk image:"
18839 #: ../fish/guestfish.pod:71
18842 " guestfish <<_EOF_\n"
18845 " mount /dev/vg_guest/lv_root /\n"
18846 " write /etc/motd \"Welcome, new users\"\n"
18852 #: ../fish/guestfish.pod:78
18853 msgid "List the LVM logical volumes in a disk image:"
18857 #: ../fish/guestfish.pod:80
18860 " guestfish -a disk.img --ro <<_EOF_\n"
18868 #: ../fish/guestfish.pod:85
18869 msgid "List all the filesystems in a disk image:"
18873 #: ../fish/guestfish.pod:87
18876 " guestfish -a disk.img --ro <<_EOF_\n"
18878 " list-filesystems\n"
18884 #: ../fish/guestfish.pod:92
18885 msgid "On one command line"
18889 #: ../fish/guestfish.pod:94
18890 msgid "Update C</etc/resolv.conf> in a guest:"
18894 #: ../fish/guestfish.pod:96
18898 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18899 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18904 #: ../fish/guestfish.pod:100
18905 msgid "Edit C</boot/grub/grub.conf> interactively:"
18909 #: ../fish/guestfish.pod:102
18912 " guestfish --rw --add disk.img \\\n"
18913 " --mount /dev/vg_guest/lv_root \\\n"
18914 " --mount /dev/sda1:/boot \\\n"
18915 " edit /boot/grub/grub.conf\n"
18920 #: ../fish/guestfish.pod:107
18921 msgid "Mount disks automatically"
18925 #: ../fish/guestfish.pod:109
18927 "Use the I<-i> option to automatically mount the disks from a virtual "
18932 #: ../fish/guestfish.pod:112
18935 " guestfish --ro -a disk.img -i cat /etc/group\n"
18940 #: ../fish/guestfish.pod:114
18943 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18948 #: ../fish/guestfish.pod:116
18949 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18953 #: ../fish/guestfish.pod:118
18956 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18961 #: ../fish/guestfish.pod:120
18962 msgid "As a script interpreter"
18966 #: ../fish/guestfish.pod:122
18967 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18971 #: ../fish/guestfish.pod:124
18974 " #!/usr/bin/guestfish -f\n"
18975 " sparse test1.img 100M\n"
18977 " part-disk /dev/sda mbr\n"
18978 " mkfs ext2 /dev/sda1\n"
18983 #: ../fish/guestfish.pod:130
18984 msgid "Start with a prepared disk"
18988 #: ../fish/guestfish.pod:132
18990 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18991 "single ext2-formatted partition:"
18995 #: ../fish/guestfish.pod:135
18998 " guestfish -N fs\n"
19003 #: ../fish/guestfish.pod:137
19004 msgid "To list what is available do:"
19008 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:940
19011 " guestfish -N help | less\n"
19016 #: ../fish/guestfish.pod:141
19017 msgid "Remote control"
19021 #: ../fish/guestfish.pod:143
19024 " eval \"`guestfish --listen`\"\n"
19025 " guestfish --remote add-ro disk.img\n"
19026 " guestfish --remote run\n"
19027 " guestfish --remote lvs\n"
19032 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:81 ../tools/virt-win-reg.pl:96 ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
19037 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:133 ../tools/virt-edit.pl:89 ../tools/virt-win-reg.pl:104 ../tools/virt-list-filesystems.pl:61 ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:62
19042 #: ../fish/guestfish.pod:154
19043 msgid "Displays general help on options."
19047 #: ../fish/guestfish.pod:156
19052 #: ../fish/guestfish.pod:158
19053 msgid "B<--cmd-help>"
19057 #: ../fish/guestfish.pod:160
19058 msgid "Lists all available guestfish commands."
19062 #: ../fish/guestfish.pod:162
19067 #: ../fish/guestfish.pod:164
19068 msgid "B<--cmd-help cmd>"
19072 #: ../fish/guestfish.pod:166
19073 msgid "Displays detailed help on a single command C<cmd>."
19077 #: ../fish/guestfish.pod:168
19078 msgid "B<-a image>"
19082 #: ../fish/guestfish.pod:170
19083 msgid "B<--add image>"
19087 #: ../fish/guestfish.pod:172
19088 msgid "Add a block device or virtual machine image to the shell."
19092 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
19094 "The format of the disk image is auto-detected. To override this and force a "
19095 "particular format use the I<--format=..> option."
19099 #: ../fish/guestfish.pod:177
19101 "Using this flag is mostly equivalent to using the C<add> command, with "
19102 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
19103 "the I<--format=...> flag was given."
19107 #: ../fish/guestfish.pod:181
19112 #: ../fish/guestfish.pod:183
19113 msgid "B<--connect URI>"
19117 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
19119 "When used in conjunction with the I<-d> option, this specifies the libvirt "
19120 "URI to use. The default is to use the default libvirt connection."
19124 #: ../fish/guestfish.pod:189
19129 #: ../fish/guestfish.pod:191
19131 "If using the I<--listen> option and a csh-like shell, use this option. See "
19132 "section L</REMOTE CONTROL AND CSH> below."
19136 #: ../fish/guestfish.pod:194
19137 msgid "B<-d libvirt-domain>"
19141 #: ../fish/guestfish.pod:196
19142 msgid "B<--domain libvirt-domain>"
19146 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
19148 "Add disks from the named libvirt domain. If the I<--ro> option is also "
19149 "used, then any libvirt domain can be used. However in write mode, only "
19150 "libvirt domains which are shut down can be named here."
19154 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:96
19155 msgid "Domain UUIDs can be used instead of names."
19159 #: ../fish/guestfish.pod:204
19161 "Using this flag is mostly equivalent to using the C<add-domain> command, "
19162 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
19163 "if the I<--format:...> flag was given."
19167 #: ../fish/guestfish.pod:208
19172 #: ../fish/guestfish.pod:210
19173 msgid "B<--no-dest-paths>"
19177 #: ../fish/guestfish.pod:212
19179 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
19180 "to hit the tab key to complete paths on the guest filesystem, but this "
19181 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
19182 "allow this feature to be disabled."
19186 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
19187 msgid "B<--echo-keys>"
19191 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:112
19193 "When prompting for keys and passphrases, guestfish normally turns echoing "
19194 "off so you cannot see what you are typing. If you are not worried about "
19195 "Tempest attacks and there is no one else in the room you can specify this "
19196 "flag to see what you are typing."
19200 #: ../fish/guestfish.pod:224
19205 #: ../fish/guestfish.pod:226
19206 msgid "B<--file file>"
19210 #: ../fish/guestfish.pod:228
19211 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
19215 #: ../fish/guestfish.pod:231
19218 " #!/usr/bin/guestfish -f\n"
19223 #: ../fish/guestfish.pod:233
19224 msgid "B<--format=raw|qcow2|..>"
19228 #: ../fish/guestfish.pod:235
19229 msgid "B<--format>"
19233 #: ../fish/guestfish.pod:237 ../fuse/guestmount.pod:119
19235 "The default for the I<-a> option is to auto-detect the format of the disk "
19236 "image. Using this forces the disk format for I<-a> options which follow on "
19237 "the command line. Using I<--format> with no argument switches back to "
19238 "auto-detection for subsequent I<-a> options."
19242 #: ../fish/guestfish.pod:244
19245 " guestfish --format=raw -a disk.img\n"
19250 #: ../fish/guestfish.pod:246
19251 msgid "forces raw format (no auto-detection) for C<disk.img>."
19255 #: ../fish/guestfish.pod:248
19258 " guestfish --format=raw -a disk.img --format -a another.img\n"
19263 #: ../fish/guestfish.pod:250
19265 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
19266 "auto-detection for C<another.img>."
19270 #: ../fish/guestfish.pod:253
19272 "If you have untrusted raw-format guest disk images, you should use this "
19273 "option to specify the disk format. This avoids a possible security problem "
19274 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
19278 #: ../fish/guestfish.pod:258
19283 #: ../fish/guestfish.pod:260
19284 msgid "B<--inspector>"
19288 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:139
19290 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
19291 "system and mount filesystems as they would be mounted on the real virtual "
19296 #: ../fish/guestfish.pod:266
19297 msgid "Typical usage is either:"
19301 #: ../fish/guestfish.pod:268
19304 " guestfish -d myguest -i\n"
19309 #: ../fish/guestfish.pod:270
19310 msgid "(for an inactive libvirt domain called I<myguest>), or:"
19314 #: ../fish/guestfish.pod:272
19317 " guestfish --ro -d myguest -i\n"
19322 #: ../fish/guestfish.pod:274
19323 msgid "(for active domains, readonly), or specify the block device directly:"
19327 #: ../fish/guestfish.pod:276
19330 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
19335 #: ../fish/guestfish.pod:278
19337 "Note that the command line syntax changed slightly over older versions of "
19338 "guestfish. You can still use the old syntax:"
19342 #: ../fish/guestfish.pod:281
19345 " guestfish [--ro] -i disk.img\n"
19350 #: ../fish/guestfish.pod:283
19353 " guestfish [--ro] -i libvirt-domain\n"
19358 #: ../fish/guestfish.pod:285
19360 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
19361 "then using other commands to mount the filesystems that were found."
19365 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
19366 msgid "B<--keys-from-stdin>"
19370 #: ../fish/guestfish.pod:291 ../fuse/guestmount.pod:145
19372 "Read key or passphrase parameters from stdin. The default is to try to read "
19373 "passphrases from the user by opening C</dev/tty>."
19377 #: ../fish/guestfish.pod:294
19378 msgid "B<--listen>"
19382 #: ../fish/guestfish.pod:296
19384 "Fork into the background and listen for remote commands. See section "
19385 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
19389 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:148
19394 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:150
19396 "Connect to a live virtual machine. (Experimental, see "
19397 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
19401 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:153
19402 msgid "B<-m dev[:mountpoint[:options]]>"
19406 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:155
19407 msgid "B<--mount dev[:mountpoint[:options]]>"
19411 #: ../fish/guestfish.pod:308
19412 msgid "Mount the named partition or logical volume on the given mountpoint."
19416 #: ../fish/guestfish.pod:310
19417 msgid "If the mountpoint is omitted, it defaults to C</>."
19421 #: ../fish/guestfish.pod:312
19422 msgid "You have to mount something on C</> before most commands will work."
19426 #: ../fish/guestfish.pod:314
19428 "If any I<-m> or I<--mount> options are given, the guest is automatically "
19433 #: ../fish/guestfish.pod:317
19435 "If you don't know what filesystems a disk image contains, you can either run "
19436 "guestfish without this option, then list the partitions, filesystems and LVs "
19437 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
19438 "commands), or you can use the L<virt-filesystems(1)> program."
19442 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:163
19444 "The third (and rarely used) part of the mount parameter is the list of mount "
19445 "options used to mount the underlying filesystem. If this is not given, then "
19446 "the mount options are either the empty string or C<ro> (the latter if the "
19447 "I<--ro> flag is used). By specifying the mount options, you override this "
19448 "default choice. Probably the only time you would use this is to enable ACLs "
19449 "and/or extended attributes if the filesystem can support them:"
19453 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:171
19456 " -m /dev/sda1:/:acl,user_xattr\n"
19461 #: ../fish/guestfish.pod:333
19462 msgid "Using this flag is equivalent to using the C<mount-options> command."
19466 #: ../fish/guestfish.pod:335
19471 #: ../fish/guestfish.pod:337
19472 msgid "B<--no-sync>"
19476 #: ../fish/guestfish.pod:339
19478 "Disable autosync. This is enabled by default. See the discussion of "
19479 "autosync in the L<guestfs(3)> manpage."
19483 #: ../fish/guestfish.pod:342
19488 #: ../fish/guestfish.pod:344
19489 msgid "B<--new type>"
19493 #: ../fish/guestfish.pod:346
19498 #: ../fish/guestfish.pod:348
19500 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
19501 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
19502 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
19507 #: ../fish/guestfish.pod:353
19508 msgid "B<--progress-bars>"
19512 #: ../fish/guestfish.pod:355
19513 msgid "Enable progress bars, even when guestfish is used non-interactively."
19517 #: ../fish/guestfish.pod:357
19519 "Progress bars are enabled by default when guestfish is used as an "
19520 "interactive shell."
19524 #: ../fish/guestfish.pod:360
19525 msgid "B<--no-progress-bars>"
19529 #: ../fish/guestfish.pod:362
19530 msgid "Disable progress bars."
19534 #: ../fish/guestfish.pod:364
19535 msgid "B<--remote[=pid]>"
19539 #: ../fish/guestfish.pod:366
19541 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
19542 "CONTROL GUESTFISH OVER A SOCKET> below."
19546 #: ../fish/guestfish.pod:369
19551 #: ../fish/guestfish.pod:371
19556 #: ../fish/guestfish.pod:373
19558 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19559 "mounts are done read-only."
19563 #: ../fish/guestfish.pod:376
19565 "The option must always be used if the disk image or virtual machine might be "
19566 "running, and is generally recommended in cases where you don't need write "
19567 "access to the disk."
19571 #: ../fish/guestfish.pod:380
19573 "Note that prepared disk images created with I<-N> are not affected by this "
19574 "option. Also commands like C<add> are not affected - you have to specify "
19575 "the C<readonly:true> option explicitly if you need it."
19579 #: ../fish/guestfish.pod:384
19580 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
19584 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:227
19585 msgid "B<--selinux>"
19589 #: ../fish/guestfish.pod:388
19590 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
19594 #: ../fish/guestfish.pod:390
19599 #: ../fish/guestfish.pod:392
19600 msgid "B<--verbose>"
19604 #: ../fish/guestfish.pod:394
19606 "Enable very verbose messages. This is particularly useful if you find a "
19611 #: ../fish/guestfish.pod:397
19616 #: ../fish/guestfish.pod:399 ../tools/virt-edit.pl:97 ../tools/virt-win-reg.pl:112 ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
19617 msgid "B<--version>"
19621 #: ../fish/guestfish.pod:401
19622 msgid "Display the guestfish / libguestfs version number and exit."
19626 #: ../fish/guestfish.pod:403
19631 #: ../fish/guestfish.pod:405
19636 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:241
19638 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19639 "mounts are done read-write."
19643 #: ../fish/guestfish.pod:410
19644 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
19648 #: ../fish/guestfish.pod:412
19653 #: ../fish/guestfish.pod:414
19654 msgid "Echo each command before executing it."
19658 #: ../fish/guestfish.pod:418
19659 msgid "COMMANDS ON COMMAND LINE"
19663 #: ../fish/guestfish.pod:420
19664 msgid "Any additional (non-option) arguments are treated as commands to execute."
19668 #: ../fish/guestfish.pod:423
19670 "Commands to execute should be separated by a colon (C<:>), where the colon "
19671 "is a separate parameter. Thus:"
19675 #: ../fish/guestfish.pod:426
19678 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
19683 #: ../fish/guestfish.pod:428
19685 "If there are no additional arguments, then we enter a shell, either an "
19686 "interactive shell with a prompt (if the input is a terminal) or a "
19687 "non-interactive shell."
19691 #: ../fish/guestfish.pod:432
19693 "In either command line mode or non-interactive shell, the first command that "
19694 "gives an error causes the whole shell to exit. In interactive mode (with a "
19695 "prompt) if a command fails, you can continue to enter commands."
19699 #: ../fish/guestfish.pod:437
19700 msgid "USING launch (OR run)"
19704 #: ../fish/guestfish.pod:439
19706 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
19707 "then launch it, then mount any disks you need, and finally issue "
19708 "actions/commands. So the general order of the day is:"
19712 #: ../fish/guestfish.pod:447
19713 msgid "add or -a/--add"
19717 #: ../fish/guestfish.pod:451
19718 msgid "launch (aka run)"
19722 #: ../fish/guestfish.pod:455
19723 msgid "mount or -m/--mount"
19727 #: ../fish/guestfish.pod:459
19728 msgid "any other commands"
19732 #: ../fish/guestfish.pod:463
19734 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
19735 "guest before mounting or performing any other commands."
19739 #: ../fish/guestfish.pod:466
19741 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
19742 "I<--new> options were given then C<run> is done automatically, simply "
19743 "because guestfish can't perform the action you asked for without doing this."
19747 #: ../fish/guestfish.pod:471
19748 msgid "OPENING DISKS FOR READ AND WRITE"
19752 #: ../fish/guestfish.pod:473
19754 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
19755 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
19756 "I<-i> and I<-m> open disk images read-only or for writing."
19760 #: ../fish/guestfish.pod:478
19762 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
19763 "opening disk images supplied on the command line for write. To open a disk "
19764 "image read-only you have to do I<-a image --ro>."
19768 #: ../fish/guestfish.pod:482
19770 "This matters: If you accidentally open a live VM disk image writable then "
19771 "you will cause irreversible disk corruption."
19775 #: ../fish/guestfish.pod:485
19777 "By libguestfs 1.12 we intend to change the default the other way. Disk "
19778 "images will be opened read-only. You will have to either specify "
19779 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
19780 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
19781 "access for disk images specified by those other command line options."
19785 #: ../fish/guestfish.pod:492
19787 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
19788 "which does nothing (it is already the default). However it is highly "
19789 "recommended that you use this option to indicate that you need write access, "
19790 "and prepare your scripts for the day when this option will be required for "
19795 #: ../fish/guestfish.pod:498
19797 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
19798 "other libguestfs program apart from guestfish and guestmount."
19802 #: ../fish/guestfish.pod:501
19807 #: ../fish/guestfish.pod:503
19809 "You can quote ordinary parameters using either single or double quotes. For "
19814 #: ../fish/guestfish.pod:506
19817 " add \"file with a space.img\"\n"
19822 #: ../fish/guestfish.pod:508
19825 " rm '/file name'\n"
19830 #: ../fish/guestfish.pod:510
19838 #: ../fish/guestfish.pod:512
19840 "A few commands require a list of strings to be passed. For these, use a "
19841 "whitespace-separated list, enclosed in quotes. Strings containing "
19842 "whitespace to be passed through must be enclosed in single quotes. A "
19843 "literal single quote must be escaped with a backslash."
19847 #: ../fish/guestfish.pod:517
19850 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
19851 " command \"/bin/echo 'foo bar'\"\n"
19852 " command \"/bin/echo \\'foo\\'\"\n"
19857 #: ../fish/guestfish.pod:521
19858 msgid "OPTIONAL ARGUMENTS"
19862 #: ../fish/guestfish.pod:523
19864 "Some commands take optional arguments. These arguments appear in this "
19865 "documentation as C<[argname:..]>. You can use them as in these examples:"
19869 #: ../fish/guestfish.pod:527
19872 " add-drive-opts filename\n"
19877 #: ../fish/guestfish.pod:529
19880 " add-drive-opts filename readonly:true\n"
19885 #: ../fish/guestfish.pod:531
19888 " add-drive-opts filename format:qcow2 readonly:false\n"
19893 #: ../fish/guestfish.pod:533
19895 "Each optional argument can appear at most once. All optional arguments must "
19896 "appear after the required ones."
19900 #: ../fish/guestfish.pod:536
19905 #: ../fish/guestfish.pod:538
19906 msgid "This section applies to all commands which can take integers as parameters."
19910 #: ../fish/guestfish.pod:541
19911 msgid "SIZE SUFFIX"
19915 #: ../fish/guestfish.pod:543
19917 "When the command takes a parameter measured in bytes, you can use one of the "
19918 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19922 #: ../fish/guestfish.pod:549
19923 msgid "B<k> or B<K> or B<KiB>"
19927 #: ../fish/guestfish.pod:551
19928 msgid "The size in kilobytes (multiplied by 1024)."
19932 #: ../fish/guestfish.pod:553
19937 #: ../fish/guestfish.pod:555
19938 msgid "The size in SI 1000 byte units."
19942 #: ../fish/guestfish.pod:557
19943 msgid "B<M> or B<MiB>"
19947 #: ../fish/guestfish.pod:559
19948 msgid "The size in megabytes (multiplied by 1048576)."
19952 #: ../fish/guestfish.pod:561
19957 #: ../fish/guestfish.pod:563
19958 msgid "The size in SI 1000000 byte units."
19962 #: ../fish/guestfish.pod:565
19963 msgid "B<G> or B<GiB>"
19967 #: ../fish/guestfish.pod:567
19968 msgid "The size in gigabytes (multiplied by 2**30)."
19972 #: ../fish/guestfish.pod:569
19977 #: ../fish/guestfish.pod:571
19978 msgid "The size in SI 10**9 byte units."
19982 #: ../fish/guestfish.pod:573
19983 msgid "B<T> or B<TiB>"
19987 #: ../fish/guestfish.pod:575
19988 msgid "The size in terabytes (multiplied by 2**40)."
19992 #: ../fish/guestfish.pod:577
19997 #: ../fish/guestfish.pod:579
19998 msgid "The size in SI 10**12 byte units."
20002 #: ../fish/guestfish.pod:581
20003 msgid "B<P> or B<PiB>"
20007 #: ../fish/guestfish.pod:583
20008 msgid "The size in petabytes (multiplied by 2**50)."
20012 #: ../fish/guestfish.pod:585
20017 #: ../fish/guestfish.pod:587
20018 msgid "The size in SI 10**15 byte units."
20022 #: ../fish/guestfish.pod:589
20023 msgid "B<E> or B<EiB>"
20027 #: ../fish/guestfish.pod:591
20028 msgid "The size in exabytes (multiplied by 2**60)."
20032 #: ../fish/guestfish.pod:593
20037 #: ../fish/guestfish.pod:595
20038 msgid "The size in SI 10**18 byte units."
20042 #: ../fish/guestfish.pod:597
20043 msgid "B<Z> or B<ZiB>"
20047 #: ../fish/guestfish.pod:599
20048 msgid "The size in zettabytes (multiplied by 2**70)."
20052 #: ../fish/guestfish.pod:601
20057 #: ../fish/guestfish.pod:603
20058 msgid "The size in SI 10**21 byte units."
20062 #: ../fish/guestfish.pod:605
20063 msgid "B<Y> or B<YiB>"
20067 #: ../fish/guestfish.pod:607
20068 msgid "The size in yottabytes (multiplied by 2**80)."
20072 #: ../fish/guestfish.pod:609
20077 #: ../fish/guestfish.pod:611
20078 msgid "The size in SI 10**24 byte units."
20082 #: ../fish/guestfish.pod:617
20085 " truncate-size /file 1G\n"
20090 #: ../fish/guestfish.pod:619
20091 msgid "would truncate the file to 1 gigabyte."
20095 #: ../fish/guestfish.pod:621
20097 "Be careful because a few commands take sizes in kilobytes or megabytes "
20098 "(eg. the parameter to L</memsize> is specified in megabytes already). "
20099 "Adding a suffix will probably not do what you expect."
20103 #: ../fish/guestfish.pod:625
20104 msgid "OCTAL AND HEXADECIMAL NUMBERS"
20108 #: ../fish/guestfish.pod:627
20110 "For specifying the radix (base) use the C convention: C<0> to prefix an "
20111 "octal number or C<0x> to prefix a hexadecimal number. For example:"
20115 #: ../fish/guestfish.pod:630
20118 " 1234 decimal number 1234\n"
20119 " 02322 octal number, equivalent to decimal 1234\n"
20120 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
20125 #: ../fish/guestfish.pod:634
20127 "When using the C<chmod> command, you almost always want to specify an octal "
20128 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
20129 "L<chmod(1)> program):"
20133 #: ../fish/guestfish.pod:638
20136 " chmod 0777 /public # OK\n"
20137 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
20142 #: ../fish/guestfish.pod:641
20144 "Commands that return numbers usually print them in decimal, but some "
20145 "commands print numbers in other radices (eg. C<umask> prints the mode in "
20146 "octal, preceeded by C<0>)."
20150 #: ../fish/guestfish.pod:645
20151 msgid "WILDCARDS AND GLOBBING"
20155 #: ../fish/guestfish.pod:647
20157 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
20158 "(globbing) by default. So for example the following will not do what you "
20163 #: ../fish/guestfish.pod:651
20171 #: ../fish/guestfish.pod:653
20173 "Assuming you don't have a directory called literally C</home/*> then the "
20174 "above command will return an error."
20178 #: ../fish/guestfish.pod:656
20179 msgid "To perform wildcard expansion, use the C<glob> command."
20183 #: ../fish/guestfish.pod:658
20186 " glob rm-rf /home/*\n"
20191 #: ../fish/guestfish.pod:660
20193 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
20194 "many times), equivalent to:"
20198 #: ../fish/guestfish.pod:663
20201 " rm-rf /home/jim\n"
20202 " rm-rf /home/joe\n"
20203 " rm-rf /home/mary\n"
20208 #: ../fish/guestfish.pod:667
20209 msgid "C<glob> only works on simple guest paths and not on device names."
20213 #: ../fish/guestfish.pod:669
20215 "If you have several parameters, each containing a wildcard, then glob will "
20216 "perform a Cartesian product."
20220 #: ../fish/guestfish.pod:672
20225 #: ../fish/guestfish.pod:674
20227 "Any line which starts with a I<#> character is treated as a comment and "
20228 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
20229 "a command. For example:"
20233 #: ../fish/guestfish.pod:678
20236 " # this is a comment\n"
20237 " # this is a comment\n"
20238 " foo # NOT a comment\n"
20243 #: ../fish/guestfish.pod:682
20244 msgid "Blank lines are also ignored."
20248 #: ../fish/guestfish.pod:684
20249 msgid "RUNNING COMMANDS LOCALLY"
20253 #: ../fish/guestfish.pod:686
20255 "Any line which starts with a I<!> character is treated as a command sent to "
20256 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
20260 #: ../fish/guestfish.pod:690
20264 " tgz-out /remote local/remote-data.tar.gz\n"
20269 #: ../fish/guestfish.pod:693
20271 "will create a directory C<local> on the host, and then export the contents "
20272 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
20273 "(See C<tgz-out>)."
20277 #: ../fish/guestfish.pod:697
20279 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
20280 "effect, due to the way that subprocesses work in Unix."
20284 #: ../fish/guestfish.pod:700
20285 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
20289 #: ../fish/guestfish.pod:702
20291 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
20292 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
20293 "and executed as guestfish commands."
20297 #: ../fish/guestfish.pod:706
20299 "Thus you can use shell script to construct arbitrary guestfish commands "
20300 "which are then parsed by guestfish."
20304 #: ../fish/guestfish.pod:709
20306 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
20307 "through C</foo.100>) using guestfish commands alone. However this is simple "
20308 "if we use a shell script to create the guestfish commands for us:"
20312 #: ../fish/guestfish.pod:714
20315 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
20320 #: ../fish/guestfish.pod:716
20321 msgid "or with names like C</foo.001>:"
20325 #: ../fish/guestfish.pod:718
20328 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
20333 #: ../fish/guestfish.pod:720
20335 "When using guestfish interactively it can be helpful to just run the shell "
20336 "script first (ie. remove the initial C<E<lt>> character so it is just an "
20337 "ordinary I<!> local command), see what guestfish commands it would run, and "
20338 "when you are happy with those prepend the C<E<lt>> character to run the "
20339 "guestfish commands for real."
20343 #: ../fish/guestfish.pod:726
20348 #: ../fish/guestfish.pod:728
20350 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
20351 "command (a guestfish command) to the second command (any host command). For "
20356 #: ../fish/guestfish.pod:732
20359 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
20364 #: ../fish/guestfish.pod:734
20366 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
20367 "program). The above command would list all accounts in the guest filesystem "
20368 "which have UID 0, ie. root accounts including backdoors. Other examples:"
20372 #: ../fish/guestfish.pod:739
20375 " hexdump /bin/ls | head\n"
20376 " list-devices | tail -1\n"
20377 " tgz-out / - | tar ztf -\n"
20382 #: ../fish/guestfish.pod:743
20384 "The space before the pipe symbol is required, any space after the pipe "
20385 "symbol is optional. Everything after the pipe symbol is just passed "
20386 "straight to the host shell, so it can contain redirections, globs and "
20387 "anything else that makes sense on the host side."
20391 #: ../fish/guestfish.pod:748
20393 "To use a literal argument which begins with a pipe symbol, you have to quote "
20398 #: ../fish/guestfish.pod:751
20406 #: ../fish/guestfish.pod:753
20407 msgid "HOME DIRECTORIES"
20411 #: ../fish/guestfish.pod:755
20413 "If a parameter starts with the character C<~> then the tilde may be expanded "
20414 "as a home directory path (either C<~> for the current user's home directory, "
20415 "or C<~user> for another user)."
20419 #: ../fish/guestfish.pod:759
20421 "Note that home directory expansion happens for users known I<on the host>, "
20422 "not in the guest filesystem."
20426 #: ../fish/guestfish.pod:762
20428 "To use a literal argument which begins with a tilde, you have to quote it, "
20433 #: ../fish/guestfish.pod:765
20441 #: ../fish/guestfish.pod:769
20443 "Libguestfs has some support for Linux guests encrypted according to the "
20444 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
20445 "disk encryption systems used by modern Linux guests. Currently only "
20446 "LVM-on-LUKS is supported."
20450 #: ../fish/guestfish.pod:774
20451 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
20455 #: ../fish/guestfish.pod:776
20458 " ><fs> vfs-type /dev/sda2\n"
20464 #: ../fish/guestfish.pod:779
20466 "Then open those devices using L</luks-open>. This creates a device-mapper "
20467 "device called C</dev/mapper/luksdev>."
20471 #: ../fish/guestfish.pod:782
20474 " ><fs> luks-open /dev/sda2 luksdev\n"
20475 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
20480 #: ../fish/guestfish.pod:785
20482 "Finally you have to tell LVM to scan for volume groups on the newly created "
20487 #: ../fish/guestfish.pod:788
20491 " vg-activate-all true\n"
20496 #: ../fish/guestfish.pod:791
20497 msgid "The logical volume(s) can now be mounted in the usual way."
20501 #: ../fish/guestfish.pod:793
20503 "Before closing a LUKS device you must unmount any logical volumes on it and "
20504 "deactivate the volume groups by calling C<vg-activate false VG> on each "
20505 "one. Then you can close the mapper device:"
20509 #: ../fish/guestfish.pod:797
20512 " vg-activate false /dev/VG\n"
20513 " luks-close /dev/mapper/luksdev\n"
20518 #: ../fish/guestfish.pod:800 ../tools/virt-edit.pl:342
20519 msgid "WINDOWS PATHS"
20523 #: ../fish/guestfish.pod:802
20525 "If a path is prefixed with C<win:> then you can use Windows-style drive "
20526 "letters and paths (with some limitations). The following commands are "
20531 #: ../fish/guestfish.pod:806
20534 " file /WINDOWS/system32/config/system.LOG\n"
20539 #: ../fish/guestfish.pod:808
20542 " file win:\\windows\\system32\\config\\system.log\n"
20547 #: ../fish/guestfish.pod:810
20550 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
20555 #: ../fish/guestfish.pod:812
20557 "The parameter is rewritten \"behind the scenes\" by looking up the position "
20558 "where the drive is mounted, prepending that to the path, changing all "
20559 "backslash characters to forward slash, then resolving the result using "
20560 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
20561 "then the parameter might be rewritten like this:"
20565 #: ../fish/guestfish.pod:818
20568 " win:e:\\foo\\bar => /e/FOO/bar\n"
20573 #: ../fish/guestfish.pod:820
20574 msgid "This only works in argument positions that expect a path."
20578 #: ../fish/guestfish.pod:822
20579 msgid "UPLOADING AND DOWNLOADING FILES"
20583 #: ../fish/guestfish.pod:824
20585 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
20586 "others which upload from or download to a local file, you can use the "
20587 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
20591 #: ../fish/guestfish.pod:828
20599 #: ../fish/guestfish.pod:830
20600 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
20604 #: ../fish/guestfish.pod:833
20607 " tar-out /etc - | tar tf -\n"
20612 #: ../fish/guestfish.pod:835
20614 "writes the tarball to stdout and then pipes that into the external \"tar\" "
20615 "command (see L</PIPES>)."
20619 #: ../fish/guestfish.pod:838
20621 "When using C<-> to read from stdin, the input is read up to the end of "
20622 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
20623 "some arbitrary end marker:"
20627 #: ../fish/guestfish.pod:842
20630 " upload -<<END /foo\n"
20639 #: ../fish/guestfish.pod:848
20641 "Any string of characters can be used instead of C<END>. The end marker must "
20642 "appear on a line of its own, without any preceeding or following characters "
20643 "(not even spaces)."
20647 #: ../fish/guestfish.pod:852
20649 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
20650 "upload local files (so-called \"FileIn\" parameters in the generator)."
20654 #: ../fish/guestfish.pod:855
20655 msgid "EXIT ON ERROR BEHAVIOUR"
20659 #: ../fish/guestfish.pod:857
20661 "By default, guestfish will ignore any errors when in interactive mode "
20662 "(ie. taking commands from a human over a tty), and will exit on the first "
20663 "error in non-interactive mode (scripts, commands given on the command line)."
20667 #: ../fish/guestfish.pod:862
20669 "If you prefix a command with a I<-> character, then that command will not "
20670 "cause guestfish to exit, even if that (one) command returns an error."
20674 #: ../fish/guestfish.pod:866
20675 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
20679 #: ../fish/guestfish.pod:868
20681 "Guestfish can be remote-controlled over a socket. This is useful "
20682 "particularly in shell scripts where you want to make several different "
20683 "changes to a filesystem, but you don't want the overhead of starting up a "
20684 "guestfish process each time."
20688 #: ../fish/guestfish.pod:873
20689 msgid "Start a guestfish server process using:"
20693 #: ../fish/guestfish.pod:875
20696 " eval \"`guestfish --listen`\"\n"
20701 #: ../fish/guestfish.pod:877
20702 msgid "and then send it commands by doing:"
20706 #: ../fish/guestfish.pod:879
20709 " guestfish --remote cmd [...]\n"
20714 #: ../fish/guestfish.pod:881
20715 msgid "To cause the server to exit, send it the exit command:"
20719 #: ../fish/guestfish.pod:883
20722 " guestfish --remote exit\n"
20727 #: ../fish/guestfish.pod:885
20729 "Note that the server will normally exit if there is an error in a command. "
20730 "You can change this in the usual way. See section L</EXIT ON ERROR "
20735 #: ../fish/guestfish.pod:889
20736 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
20740 #: ../fish/guestfish.pod:891
20742 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
20743 "is how the I<--remote> option knows where to send the commands. You can "
20744 "have several guestfish listener processes running using:"
20748 #: ../fish/guestfish.pod:895
20751 " eval \"`guestfish --listen`\"\n"
20752 " pid1=$GUESTFISH_PID\n"
20753 " eval \"`guestfish --listen`\"\n"
20754 " pid2=$GUESTFISH_PID\n"
20756 " guestfish --remote=$pid1 cmd\n"
20757 " guestfish --remote=$pid2 cmd\n"
20762 #: ../fish/guestfish.pod:903
20763 msgid "REMOTE CONTROL AND CSH"
20767 #: ../fish/guestfish.pod:905
20769 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
20774 #: ../fish/guestfish.pod:908
20777 " eval \"`guestfish --listen --csh`\"\n"
20782 #: ../fish/guestfish.pod:910
20783 msgid "REMOTE CONTROL DETAILS"
20787 #: ../fish/guestfish.pod:912
20789 "Remote control happens over a Unix domain socket called "
20790 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
20791 "of the process, and C<$PID> is the process ID of the server."
20795 #: ../fish/guestfish.pod:916
20796 msgid "Guestfish client and server versions must match exactly."
20800 #: ../fish/guestfish.pod:918
20801 msgid "PREPARED DISK IMAGES"
20805 #: ../fish/guestfish.pod:920
20807 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20808 "preformatted disk images that guestfish can make for you to save typing. "
20809 "This is particularly useful for testing purposes. This option is used "
20810 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20811 "can be mixed with I<-a>)."
20815 #: ../fish/guestfish.pod:926
20817 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20818 "the second and so on. Existing files in the current directory are "
20823 #: ../fish/guestfish.pod:930
20825 "The type briefly describes how the disk should be sized, partitioned, how "
20826 "filesystem(s) should be created, and how content should be added. "
20827 "Optionally the type can be followed by extra parameters, separated by C<:> "
20828 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
20829 "sparsely-allocated disk, containing a single partition, with the partition "
20830 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
20831 "on a 1GB disk instead."
20835 #: ../fish/guestfish.pod:938
20836 msgid "To list the available types and any extra parameters they take, run:"
20840 #: ../fish/guestfish.pod:942
20842 "Note that the prepared filesystem is not mounted. You would usually have to "
20843 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20847 #: ../fish/guestfish.pod:946
20849 "If any I<-N> or I<--new> options are given, the guest is automatically "
20854 #: ../fish/guestfish.pod:951
20855 msgid "Create a 100MB disk with an ext4-formatted partition:"
20859 #: ../fish/guestfish.pod:953
20862 " guestfish -N fs:ext4\n"
20867 #: ../fish/guestfish.pod:955
20868 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20872 #: ../fish/guestfish.pod:957
20875 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20880 #: ../fish/guestfish.pod:959
20881 msgid "Create a blank 200MB disk:"
20885 #: ../fish/guestfish.pod:961
20888 " guestfish -N disk:200M\n"
20893 #: ../fish/guestfish.pod:963
20894 msgid "PROGRESS BARS"
20898 #: ../fish/guestfish.pod:965
20900 "Some (not all) long-running commands send progress notification messages as "
20901 "they are running. Guestfish turns these messages into progress bars."
20905 #: ../fish/guestfish.pod:969
20907 "When a command that supports progress bars takes longer than two seconds to "
20908 "run, and if progress bars are enabled, then you will see one appearing below "
20913 #: ../fish/guestfish.pod:973
20916 " ><fs> copy-size /large-file /another-file 2048M\n"
20917 " / 10% [#####-----------------------------------------] 00:30\n"
20922 #: ../fish/guestfish.pod:976
20924 "The spinner on the left hand side moves round once for every progress "
20925 "notification received from the backend. This is a (reasonably) golden "
20926 "assurance that the command is \"doing something\" even if the progress bar "
20927 "is not moving, because the command is able to send the progress "
20928 "notifications. When the bar reaches 100% and the command finishes, the "
20929 "spinner disappears."
20933 #: ../fish/guestfish.pod:983
20935 "Progress bars are enabled by default when guestfish is used interactively. "
20936 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20937 "and you can disable them completely using I<--no-progress-bars>."
20941 #: ../fish/guestfish.pod:988
20942 msgid "GUESTFISH COMMANDS"
20946 #: ../fish/guestfish.pod:990
20948 "The commands in this section are guestfish convenience commands, in other "
20949 "words, they are not part of the L<guestfs(3)> API."
20953 #: ../fish/guestfish.pod:993
20958 #: ../fish/guestfish.pod:995
20967 #: ../fish/guestfish.pod:998
20968 msgid "Without any parameter, this provides general help."
20972 #: ../fish/guestfish.pod:1000
20973 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20977 #: ../fish/guestfish.pod:1002
20978 msgid "quit | exit"
20982 #: ../fish/guestfish.pod:1004
20983 msgid "This exits guestfish. You can also use C<^D> key."
20987 #: ../fish/guestfish.pod:1006
20988 msgid "@FISH_COMMANDS@"
20992 #: ../fish/guestfish.pod:1008
20997 #: ../fish/guestfish.pod:1012 ../test-tool/libguestfs-test-tool.pod:77
21002 #: ../fish/guestfish.pod:1014
21004 "guestfish returns 0 if the commands completed without error, or 1 if there "
21009 #: ../fish/guestfish.pod:1021
21014 #: ../fish/guestfish.pod:1023
21016 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
21021 #: ../fish/guestfish.pod:1026
21022 msgid "GUESTFISH_PID"
21026 #: ../fish/guestfish.pod:1028
21028 "Used with the I<--remote> option to specify the remote guestfish process to "
21029 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
21033 #: ../fish/guestfish.pod:1032
21038 #: ../fish/guestfish.pod:1034
21040 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
21041 "not specified, the external L<hexedit(1)> program is used."
21045 #: ../fish/guestfish.pod:1038
21050 #: ../fish/guestfish.pod:1040
21052 "If compiled with GNU readline support, various files in the home directory "
21053 "can be used. See L</FILES>."
21057 #: ../fish/guestfish.pod:1049
21059 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
21060 "effect as using the B<-v> option."
21064 #: ../fish/guestfish.pod:1061
21066 "Set the path that guestfish uses to search for kernel and initrd.img. See "
21067 "the discussion of paths in L<guestfs(3)>."
21071 #: ../fish/guestfish.pod:1072
21072 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
21076 #: ../fish/guestfish.pod:1074
21081 #: ../fish/guestfish.pod:1076
21083 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
21088 #: ../fish/guestfish.pod:1092 ../fuse/guestmount.pod:254
21093 #: ../fish/guestfish.pod:1096 ../fuse/guestmount.pod:258
21094 msgid "$HOME/.libguestfs-tools.rc"
21098 #: ../fish/guestfish.pod:1098 ../fuse/guestmount.pod:260
21099 msgid "/etc/libguestfs-tools.conf"
21103 #: ../fish/guestfish.pod:1100 ../fuse/guestmount.pod:262
21105 "This configuration file controls the default read-only or read-write mode "
21106 "(I<--ro> or I<--rw>)."
21110 #: ../fish/guestfish.pod:1103
21111 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
21115 #: ../fish/guestfish.pod:1105
21116 msgid "$HOME/.guestfish"
21120 #: ../fish/guestfish.pod:1107
21122 "If compiled with GNU readline support, then the command history is saved in "
21127 #: ../fish/guestfish.pod:1110
21128 msgid "$HOME/.inputrc"
21132 #: ../fish/guestfish.pod:1112
21133 msgid "/etc/inputrc"
21137 #: ../fish/guestfish.pod:1114
21139 "If compiled with GNU readline support, then these files can be used to "
21140 "configure readline. For further information, please see "
21141 "L<readline(3)/INITIALIZATION FILE>."
21145 #: ../fish/guestfish.pod:1118
21146 msgid "To write rules which only apply to guestfish, use:"
21150 #: ../fish/guestfish.pod:1120
21160 #: ../fish/guestfish.pod:1124
21162 "Variables that you can set in inputrc that change the behaviour of guestfish "
21163 "in useful ways include:"
21167 #: ../fish/guestfish.pod:1129
21168 msgid "completion-ignore-case (default: on)"
21172 #: ../fish/guestfish.pod:1131
21174 "By default, guestfish will ignore case when tab-completing paths on the "
21179 #: ../fish/guestfish.pod:1134
21182 " set completion-ignore-case off\n"
21187 #: ../fish/guestfish.pod:1136
21188 msgid "to make guestfish case sensitive."
21192 #: ../fish/guestfish.pod:1140
21197 #: ../fish/guestfish.pod:1142
21198 msgid "test2.img (etc)"
21202 #: ../fish/guestfish.pod:1144
21204 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
21205 "will be created in the file C<test1.img> in the current directory. The "
21206 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
21207 "the same name will be overwritten."
21211 #: ../fish/guestfish.pod:1153
21213 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
21214 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
21215 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
21216 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
21217 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
21218 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
21222 #: ../fish/guestfish.pod:1183 ../test-tool/libguestfs-test-tool.pod:102 ../fuse/guestmount.pod:289 ../tools/virt-edit.pl:518 ../tools/virt-win-reg.pl:606 ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:277
21224 "This program is free software; you can redistribute it and/or modify it "
21225 "under the terms of the GNU General Public License as published by the Free "
21226 "Software Foundation; either version 2 of the License, or (at your option) "
21227 "any later version."
21231 #: ../fish/guestfish.pod:1188 ../test-tool/libguestfs-test-tool.pod:107 ../fuse/guestmount.pod:294 ../tools/virt-edit.pl:523 ../tools/virt-win-reg.pl:611 ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:282
21233 "This program is distributed in the hope that it will be useful, but WITHOUT "
21234 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
21235 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
21240 #: ../fish/guestfish.pod:1193 ../test-tool/libguestfs-test-tool.pod:112 ../fuse/guestmount.pod:299 ../tools/virt-edit.pl:528 ../tools/virt-win-reg.pl:616 ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319 ../tools/virt-make-fs.pl:582 ../tools/virt-list-partitions.pl:287
21242 "You should have received a copy of the GNU General Public License along with "
21243 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
21244 "Ave, Cambridge, MA 02139, USA."
21248 #: ../fish/guestfish-actions.pod:1
21253 #: ../fish/guestfish-actions.pod:3
21256 " add-cdrom filename\n"
21261 #: ../fish/guestfish-actions.pod:15
21263 "This call checks for the existence of C<filename>. This stops you from "
21264 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21265 "and C<http:> URLs. To specify those, use the general L</config> call "
21270 #: ../fish/guestfish-actions.pod:22
21272 "If you just want to add an ISO file (often you use this as an efficient way "
21273 "to transfer large files into the guest), then you should probably use "
21274 "L</add-drive-ro> instead."
21278 #: ../fish/guestfish-actions.pod:35
21283 #: ../fish/guestfish-actions.pod:37
21288 #: ../fish/guestfish-actions.pod:39
21291 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
21297 #: ../fish/guestfish-actions.pod:41
21299 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21300 "It works by connecting to libvirt, requesting the domain and domain XML from "
21301 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
21305 #: ../fish/guestfish-actions.pod:76
21307 "The other optional parameters are passed directly through to "
21308 "L</add-drive-opts>."
21312 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143 ../fish/guestfish-actions.pod:3052
21314 "This command has one or more optional arguments. See L</OPTIONAL "
21319 #: ../fish/guestfish-actions.pod:81
21324 #: ../fish/guestfish-actions.pod:83
21327 " add-drive filename\n"
21332 #: ../fish/guestfish-actions.pod:85
21334 "This function is the equivalent of calling L</add-drive-opts> with no "
21335 "optional parameters, so the disk is added writable, with the format being "
21336 "detected automatically."
21340 #: ../fish/guestfish-actions.pod:89
21342 "Automatic detection of the format opens you up to a potential security hole "
21343 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21344 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21345 "you should think about replacing calls to this function with calls to "
21346 "L</add-drive-opts>, and specifying the format."
21350 #: ../fish/guestfish-actions.pod:96
21351 msgid "add-drive-opts"
21355 #: ../fish/guestfish-actions.pod:98
21360 #: ../fish/guestfish-actions.pod:100
21363 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
21368 #: ../fish/guestfish-actions.pod:127
21370 "This forces the image format. If you omit this (or use L</add-drive> or "
21371 "L</add-drive-ro>) then the format is automatically detected. Possible "
21372 "formats include C<raw> and C<qcow2>."
21376 #: ../fish/guestfish-actions.pod:138
21378 "This rarely-used option lets you emulate the behaviour of the deprecated "
21379 "L</add-drive-with-if> call (q.v.)"
21383 #: ../fish/guestfish-actions.pod:145
21384 msgid "add-drive-ro"
21388 #: ../fish/guestfish-actions.pod:147
21393 #: ../fish/guestfish-actions.pod:149
21396 " add-drive-ro filename\n"
21401 #: ../fish/guestfish-actions.pod:151
21403 "This function is the equivalent of calling L</add-drive-opts> with the "
21404 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
21405 "is added read-only, with the format being detected automatically."
21409 #: ../fish/guestfish-actions.pod:156
21410 msgid "add-drive-ro-with-if"
21414 #: ../fish/guestfish-actions.pod:158
21417 " add-drive-ro-with-if filename iface\n"
21422 #: ../fish/guestfish-actions.pod:160
21424 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
21425 "interface emulation to use at run time."
21429 #: ../fish/guestfish-actions.pod:170
21430 msgid "add-drive-with-if"
21434 #: ../fish/guestfish-actions.pod:172
21437 " add-drive-with-if filename iface\n"
21442 #: ../fish/guestfish-actions.pod:174
21444 "This is the same as L</add-drive> but it allows you to specify the QEMU "
21445 "interface emulation to use at run time."
21449 #: ../fish/guestfish-actions.pod:184
21454 #: ../fish/guestfish-actions.pod:186
21457 " aug-clear augpath\n"
21462 #: ../fish/guestfish-actions.pod:191
21467 #: ../fish/guestfish-actions.pod:193
21475 #: ../fish/guestfish-actions.pod:195
21477 "Close the current Augeas handle and free up any resources used by it. After "
21478 "calling this, you have to call L</aug-init> again before you can use any "
21479 "other Augeas functions."
21483 #: ../fish/guestfish-actions.pod:200
21484 msgid "aug-defnode"
21488 #: ../fish/guestfish-actions.pod:202
21491 " aug-defnode name expr val\n"
21496 #: ../fish/guestfish-actions.pod:207
21498 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
21499 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
21500 "containing that single node."
21504 #: ../fish/guestfish-actions.pod:215
21509 #: ../fish/guestfish-actions.pod:217
21512 " aug-defvar name expr\n"
21517 #: ../fish/guestfish-actions.pod:226
21522 #: ../fish/guestfish-actions.pod:228
21525 " aug-get augpath\n"
21530 #: ../fish/guestfish-actions.pod:233
21535 #: ../fish/guestfish-actions.pod:235
21538 " aug-init root flags\n"
21543 #: ../fish/guestfish-actions.pod:241
21544 msgid "You must call this before using any other L</aug-*> commands."
21548 #: ../fish/guestfish-actions.pod:276
21549 msgid "Do not load the tree in L</aug-init>."
21553 #: ../fish/guestfish-actions.pod:280
21554 msgid "To close the handle, you can call L</aug-close>."
21558 #: ../fish/guestfish-actions.pod:284
21563 #: ../fish/guestfish-actions.pod:286
21566 " aug-insert augpath label true|false\n"
21571 #: ../fish/guestfish-actions.pod:296
21576 #: ../fish/guestfish-actions.pod:298
21584 #: ../fish/guestfish-actions.pod:305
21589 #: ../fish/guestfish-actions.pod:307
21592 " aug-ls augpath\n"
21597 #: ../fish/guestfish-actions.pod:309
21599 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
21600 "resulting nodes into alphabetical order."
21604 #: ../fish/guestfish-actions.pod:312
21609 #: ../fish/guestfish-actions.pod:314
21612 " aug-match augpath\n"
21617 #: ../fish/guestfish-actions.pod:320
21622 #: ../fish/guestfish-actions.pod:322
21625 " aug-mv src dest\n"
21630 #: ../fish/guestfish-actions.pod:327
21635 #: ../fish/guestfish-actions.pod:329
21638 " aug-rm augpath\n"
21643 #: ../fish/guestfish-actions.pod:335
21648 #: ../fish/guestfish-actions.pod:337
21656 #: ../fish/guestfish-actions.pod:341
21658 "The flags which were passed to L</aug-init> affect exactly how files are "
21663 #: ../fish/guestfish-actions.pod:344
21668 #: ../fish/guestfish-actions.pod:346
21671 " aug-set augpath val\n"
21676 #: ../fish/guestfish-actions.pod:350
21678 "In the Augeas API, it is possible to clear a node by setting the value to "
21679 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
21680 "this call. Instead you must use the L</aug-clear> call."
21684 #: ../fish/guestfish-actions.pod:355
21689 #: ../fish/guestfish-actions.pod:357
21692 " available 'groups ...'\n"
21697 #: ../fish/guestfish-actions.pod:363
21699 "The libguestfs groups, and the functions that those groups correspond to, "
21700 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
21701 "runtime by calling L</available-all-groups>."
21705 #: ../fish/guestfish-actions.pod:387
21706 msgid "You must call L</launch> before calling this function."
21710 #: ../fish/guestfish-actions.pod:409
21712 "This call was added in version C<1.0.80>. In previous versions of "
21713 "libguestfs all you could do would be to speculatively execute a command to "
21714 "find out if the daemon implemented it. See also L</version>."
21718 #: ../fish/guestfish-actions.pod:416
21719 msgid "available-all-groups"
21723 #: ../fish/guestfish-actions.pod:418
21726 " available-all-groups\n"
21731 #: ../fish/guestfish-actions.pod:420
21733 "This command returns a list of all optional groups that this daemon knows "
21734 "about. Note this returns both supported and unsupported groups. To find "
21735 "out which ones the daemon can actually support you have to call "
21736 "L</available> on each member of the returned list."
21740 #: ../fish/guestfish-actions.pod:426
21741 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
21745 #: ../fish/guestfish-actions.pod:428
21750 #: ../fish/guestfish-actions.pod:430
21753 " base64-in (base64file|-) filename\n"
21758 #: ../fish/guestfish-actions.pod:435 ../fish/guestfish-actions.pod:444 ../fish/guestfish-actions.pod:668 ../fish/guestfish-actions.pod:837 ../fish/guestfish-actions.pod:856 ../fish/guestfish-actions.pod:1233 ../fish/guestfish-actions.pod:4450 ../fish/guestfish-actions.pod:4462 ../fish/guestfish-actions.pod:4473 ../fish/guestfish-actions.pod:4484 ../fish/guestfish-actions.pod:4536 ../fish/guestfish-actions.pod:4545 ../fish/guestfish-actions.pod:4599 ../fish/guestfish-actions.pod:4622
21759 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
21763 #: ../fish/guestfish-actions.pod:437
21768 #: ../fish/guestfish-actions.pod:439
21771 " base64-out filename (base64file|-)\n"
21776 #: ../fish/guestfish-actions.pod:446
21777 msgid "blockdev-flushbufs"
21781 #: ../fish/guestfish-actions.pod:448
21784 " blockdev-flushbufs device\n"
21789 #: ../fish/guestfish-actions.pod:455
21790 msgid "blockdev-getbsz"
21794 #: ../fish/guestfish-actions.pod:457
21797 " blockdev-getbsz device\n"
21802 #: ../fish/guestfish-actions.pod:466
21803 msgid "blockdev-getro"
21807 #: ../fish/guestfish-actions.pod:468
21810 " blockdev-getro device\n"
21815 #: ../fish/guestfish-actions.pod:475
21816 msgid "blockdev-getsize64"
21820 #: ../fish/guestfish-actions.pod:477
21823 " blockdev-getsize64 device\n"
21828 #: ../fish/guestfish-actions.pod:481
21829 msgid "See also L</blockdev-getsz>."
21833 #: ../fish/guestfish-actions.pod:485
21834 msgid "blockdev-getss"
21838 #: ../fish/guestfish-actions.pod:487
21841 " blockdev-getss device\n"
21846 #: ../fish/guestfish-actions.pod:492
21847 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
21851 #: ../fish/guestfish-actions.pod:497
21852 msgid "blockdev-getsz"
21856 #: ../fish/guestfish-actions.pod:499
21859 " blockdev-getsz device\n"
21864 #: ../fish/guestfish-actions.pod:504
21866 "See also L</blockdev-getss> for the real sector size of the device, and "
21867 "L</blockdev-getsize64> for the more useful I<size in bytes>."
21871 #: ../fish/guestfish-actions.pod:510
21872 msgid "blockdev-rereadpt"
21876 #: ../fish/guestfish-actions.pod:512
21879 " blockdev-rereadpt device\n"
21884 #: ../fish/guestfish-actions.pod:518
21885 msgid "blockdev-setbsz"
21889 #: ../fish/guestfish-actions.pod:520
21892 " blockdev-setbsz device blocksize\n"
21897 #: ../fish/guestfish-actions.pod:529
21898 msgid "blockdev-setro"
21902 #: ../fish/guestfish-actions.pod:531
21905 " blockdev-setro device\n"
21910 #: ../fish/guestfish-actions.pod:537
21911 msgid "blockdev-setrw"
21915 #: ../fish/guestfish-actions.pod:539
21918 " blockdev-setrw device\n"
21923 #: ../fish/guestfish-actions.pod:545
21924 msgid "case-sensitive-path"
21928 #: ../fish/guestfish-actions.pod:547
21931 " case-sensitive-path path\n"
21936 #: ../fish/guestfish-actions.pod:571
21938 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
21939 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
21940 "how the directories were originally created under Windows)."
21944 #: ../fish/guestfish-actions.pod:579
21945 msgid "See also L</realpath>."
21949 #: ../fish/guestfish-actions.pod:581
21954 #: ../fish/guestfish-actions.pod:583
21962 #: ../fish/guestfish-actions.pod:587
21964 "Note that this function cannot correctly handle binary files (specifically, "
21965 "files containing C<\\0> character which is treated as end of string). For "
21966 "those you need to use the L</read-file> or L</download> functions which have "
21967 "a more complex interface."
21971 #: ../fish/guestfish-actions.pod:595
21976 #: ../fish/guestfish-actions.pod:597
21979 " checksum csumtype path\n"
21984 #: ../fish/guestfish-actions.pod:640
21985 msgid "To get the checksum for a device, use L</checksum-device>."
21989 #: ../fish/guestfish-actions.pod:642
21990 msgid "To get the checksums for many files, use L</checksums-out>."
21994 #: ../fish/guestfish-actions.pod:644
21995 msgid "checksum-device"
21999 #: ../fish/guestfish-actions.pod:646
22002 " checksum-device csumtype device\n"
22007 #: ../fish/guestfish-actions.pod:648
22009 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
22010 "device named C<device>. For the types of checksums supported see the "
22011 "L</checksum> command."
22015 #: ../fish/guestfish-actions.pod:652
22016 msgid "checksums-out"
22020 #: ../fish/guestfish-actions.pod:654
22023 " checksums-out csumtype directory (sumsfile|-)\n"
22028 #: ../fish/guestfish-actions.pod:670
22033 #: ../fish/guestfish-actions.pod:672
22036 " chmod mode path\n"
22041 #: ../fish/guestfish-actions.pod:683
22046 #: ../fish/guestfish-actions.pod:685
22049 " chown owner group path\n"
22054 #: ../fish/guestfish-actions.pod:693
22059 #: ../fish/guestfish-actions.pod:695
22062 " command 'arguments ...'\n"
22067 #: ../fish/guestfish-actions.pod:702
22069 "The single parameter is an argv-style list of arguments. The first element "
22070 "is the name of the program to run. Subsequent elements are parameters. The "
22071 "list must be non-empty (ie. must contain a program name). Note that the "
22072 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
22076 #: ../fish/guestfish-actions.pod:730
22077 msgid "command-lines"
22081 #: ../fish/guestfish-actions.pod:732
22084 " command-lines 'arguments ...'\n"
22089 #: ../fish/guestfish-actions.pod:734
22090 msgid "This is the same as L</command>, but splits the result into a list of lines."
22094 #: ../fish/guestfish-actions.pod:737
22095 msgid "See also: L</sh-lines>"
22099 #: ../fish/guestfish-actions.pod:742
22104 #: ../fish/guestfish-actions.pod:744
22107 " config qemuparam qemuvalue\n"
22112 #: ../fish/guestfish-actions.pod:755
22117 #: ../fish/guestfish-actions.pod:757
22120 " copy-size src dest size\n"
22125 #: ../fish/guestfish-actions.pod:765
22130 #: ../fish/guestfish-actions.pod:767
22138 #: ../fish/guestfish-actions.pod:772
22143 #: ../fish/guestfish-actions.pod:774
22151 #: ../fish/guestfish-actions.pod:779
22156 #: ../fish/guestfish-actions.pod:781
22164 #: ../fish/guestfish-actions.pod:788
22166 "If the destination is a device, it must be as large or larger than the "
22167 "source file or device, otherwise the copy will fail. This command cannot do "
22168 "partial copies (see L</copy-size>)."
22172 #: ../fish/guestfish-actions.pod:792
22177 #: ../fish/guestfish-actions.pod:794
22185 #: ../fish/guestfish-actions.pod:798 ../fish/guestfish-actions.pod:809
22187 "This command is mostly useful for interactive sessions. It is I<not> "
22188 "intended that you try to parse the output string. Use L</statvfs> from "
22193 #: ../fish/guestfish-actions.pod:802
22198 #: ../fish/guestfish-actions.pod:804
22206 #: ../fish/guestfish-actions.pod:813
22211 #: ../fish/guestfish-actions.pod:815
22219 #: ../fish/guestfish-actions.pod:821
22221 "Another way to get the same information is to enable verbose messages with "
22222 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
22223 "before running the program."
22227 #: ../fish/guestfish-actions.pod:826
22232 #: ../fish/guestfish-actions.pod:828
22235 " download remotefilename (filename|-)\n"
22240 #: ../fish/guestfish-actions.pod:835
22241 msgid "See also L</upload>, L</cat>."
22245 #: ../fish/guestfish-actions.pod:839
22246 msgid "download-offset"
22250 #: ../fish/guestfish-actions.pod:841
22253 " download-offset remotefilename (filename|-) offset size\n"
22258 #: ../fish/guestfish-actions.pod:849
22260 "Note that there is no limit on the amount of data that can be downloaded "
22261 "with this call, unlike with L</pread>, and this call always reads the full "
22262 "amount unless an error occurs."
22266 #: ../fish/guestfish-actions.pod:854
22267 msgid "See also L</download>, L</pread>."
22271 #: ../fish/guestfish-actions.pod:858
22272 msgid "drop-caches"
22276 #: ../fish/guestfish-actions.pod:860
22279 " drop-caches whattodrop\n"
22284 #: ../fish/guestfish-actions.pod:872
22289 #: ../fish/guestfish-actions.pod:874
22297 #: ../fish/guestfish-actions.pod:886
22302 #: ../fish/guestfish-actions.pod:888
22305 " e2fsck-f device\n"
22310 #: ../fish/guestfish-actions.pod:894
22312 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
22313 "should use L</fsck>."
22317 #: ../fish/guestfish-actions.pod:897
22318 msgid "echo-daemon"
22322 #: ../fish/guestfish-actions.pod:899
22325 " echo-daemon 'words ...'\n"
22330 #: ../fish/guestfish-actions.pod:906
22331 msgid "See also L</ping-daemon>."
22335 #: ../fish/guestfish-actions.pod:908
22340 #: ../fish/guestfish-actions.pod:910
22343 " egrep regex path\n"
22348 #: ../fish/guestfish-actions.pod:918
22353 #: ../fish/guestfish-actions.pod:920
22356 " egrepi regex path\n"
22361 #: ../fish/guestfish-actions.pod:928
22366 #: ../fish/guestfish-actions.pod:930
22369 " equal file1 file2\n"
22374 #: ../fish/guestfish-actions.pod:937
22379 #: ../fish/guestfish-actions.pod:939
22387 #: ../fish/guestfish-actions.pod:944
22388 msgid "See also L</is-file>, L</is-dir>, L</stat>."
22392 #: ../fish/guestfish-actions.pod:946
22397 #: ../fish/guestfish-actions.pod:948
22400 " fallocate path len\n"
22405 #: ../fish/guestfish-actions.pod:965
22406 msgid "fallocate64"
22410 #: ../fish/guestfish-actions.pod:967
22413 " fallocate64 path len\n"
22418 #: ../fish/guestfish-actions.pod:973
22420 "Note that this call allocates disk blocks for the file. To create a sparse "
22421 "file use L</truncate-size> instead."
22425 #: ../fish/guestfish-actions.pod:976
22427 "The deprecated call L</fallocate> does the same, but owing to an oversight "
22428 "it only allowed 30 bit lengths to be specified, effectively limiting the "
22429 "maximum size of files created through that call to 1GB."
22433 #: ../fish/guestfish-actions.pod:985
22438 #: ../fish/guestfish-actions.pod:987
22441 " fgrep pattern path\n"
22446 #: ../fish/guestfish-actions.pod:995
22451 #: ../fish/guestfish-actions.pod:997
22454 " fgrepi pattern path\n"
22459 #: ../fish/guestfish-actions.pod:1005
22464 #: ../fish/guestfish-actions.pod:1007
22472 #: ../fish/guestfish-actions.pod:1019
22474 "This command can also be used on C</dev/> devices (and partitions, LV "
22475 "names). You can for example use this to determine if a device contains a "
22476 "filesystem, although it's usually better to use L</vfs-type>."
22480 #: ../fish/guestfish-actions.pod:1029
22481 msgid "file-architecture"
22485 #: ../fish/guestfish-actions.pod:1031
22488 " file-architecture filename\n"
22493 #: ../fish/guestfish-actions.pod:1134
22498 #: ../fish/guestfish-actions.pod:1136
22506 #: ../fish/guestfish-actions.pod:1140
22508 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
22509 "L</is-file> etc. To get the size of block devices, use "
22510 "L</blockdev-getsize64>."
22514 #: ../fish/guestfish-actions.pod:1144
22519 #: ../fish/guestfish-actions.pod:1146
22522 " fill c len path\n"
22527 #: ../fish/guestfish-actions.pod:1152
22529 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
22530 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
22531 "L</fill-pattern>."
22535 #: ../fish/guestfish-actions.pod:1157
22536 msgid "fill-pattern"
22540 #: ../fish/guestfish-actions.pod:1159
22543 " fill-pattern pattern len path\n"
22548 #: ../fish/guestfish-actions.pod:1161
22550 "This function is like L</fill> except that it creates a new file of length "
22551 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
22552 "is truncated if necessary to ensure the length of the file is exactly C<len> "
22557 #: ../fish/guestfish-actions.pod:1166
22562 #: ../fish/guestfish-actions.pod:1168
22565 " find directory\n"
22570 #: ../fish/guestfish-actions.pod:1182
22571 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
22575 #: ../fish/guestfish-actions.pod:1195
22576 msgid "See also L</find0>."
22580 #: ../fish/guestfish-actions.pod:1200
22585 #: ../fish/guestfish-actions.pod:1202
22588 " find0 directory (files|-)\n"
22593 #: ../fish/guestfish-actions.pod:1208
22594 msgid "This command works the same way as L</find> with the following exceptions:"
22598 #: ../fish/guestfish-actions.pod:1235
22599 msgid "findfs-label"
22603 #: ../fish/guestfish-actions.pod:1237
22606 " findfs-label label\n"
22611 #: ../fish/guestfish-actions.pod:1243
22612 msgid "To find the label of a filesystem, use L</vfs-label>."
22616 #: ../fish/guestfish-actions.pod:1245
22617 msgid "findfs-uuid"
22621 #: ../fish/guestfish-actions.pod:1247
22624 " findfs-uuid uuid\n"
22629 #: ../fish/guestfish-actions.pod:1253
22630 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
22634 #: ../fish/guestfish-actions.pod:1255
22639 #: ../fish/guestfish-actions.pod:1257
22642 " fsck fstype device\n"
22647 #: ../fish/guestfish-actions.pod:1287
22652 #: ../fish/guestfish-actions.pod:1289
22660 #: ../fish/guestfish-actions.pod:1296
22661 msgid "get-attach-method"
22665 #: ../fish/guestfish-actions.pod:1298
22668 " get-attach-method\n"
22673 #: ../fish/guestfish-actions.pod:1300
22674 msgid "Return the current attach method. See L</set-attach-method>."
22678 #: ../fish/guestfish-actions.pod:1302
22679 msgid "get-autosync"
22683 #: ../fish/guestfish-actions.pod:1304
22691 #: ../fish/guestfish-actions.pod:1308
22696 #: ../fish/guestfish-actions.pod:1310
22704 #: ../fish/guestfish-actions.pod:1314
22705 msgid "get-e2label"
22709 #: ../fish/guestfish-actions.pod:1316
22712 " get-e2label device\n"
22717 #: ../fish/guestfish-actions.pod:1328
22722 #: ../fish/guestfish-actions.pod:1330
22725 " get-e2uuid device\n"
22730 #: ../fish/guestfish-actions.pod:1342
22731 msgid "get-memsize"
22735 #: ../fish/guestfish-actions.pod:1344
22743 #: ../fish/guestfish-actions.pod:1349
22745 "If L</set-memsize> was not called on this handle, and if "
22746 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
22747 "value for memsize."
22751 #: ../fish/guestfish-actions.pod:1356
22752 msgid "get-network"
22756 #: ../fish/guestfish-actions.pod:1358
22764 #: ../fish/guestfish-actions.pod:1362
22769 #: ../fish/guestfish-actions.pod:1364
22777 #: ../fish/guestfish-actions.pod:1371
22782 #: ../fish/guestfish-actions.pod:1373
22787 #: ../fish/guestfish-actions.pod:1375
22795 #: ../fish/guestfish-actions.pod:1382
22800 #: ../fish/guestfish-actions.pod:1384
22808 #: ../fish/guestfish-actions.pod:1391
22809 msgid "get-recovery-proc"
22813 #: ../fish/guestfish-actions.pod:1393
22816 " get-recovery-proc\n"
22821 #: ../fish/guestfish-actions.pod:1397
22822 msgid "get-selinux"
22826 #: ../fish/guestfish-actions.pod:1399
22834 #: ../fish/guestfish-actions.pod:1401
22836 "This returns the current setting of the selinux flag which is passed to the "
22837 "appliance at boot time. See L</set-selinux>."
22841 #: ../fish/guestfish-actions.pod:1407
22846 #: ../fish/guestfish-actions.pod:1409
22854 #: ../fish/guestfish-actions.pod:1416
22859 #: ../fish/guestfish-actions.pod:1418
22867 #: ../fish/guestfish-actions.pod:1422
22872 #: ../fish/guestfish-actions.pod:1424
22880 #: ../fish/guestfish-actions.pod:1426
22882 "Return the current umask. By default the umask is C<022> unless it has been "
22883 "set by calling L</umask>."
22887 #: ../fish/guestfish-actions.pod:1429
22888 msgid "get-verbose"
22892 #: ../fish/guestfish-actions.pod:1431
22900 #: ../fish/guestfish-actions.pod:1435
22905 #: ../fish/guestfish-actions.pod:1437
22913 #: ../fish/guestfish-actions.pod:1441
22914 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
22918 #: ../fish/guestfish-actions.pod:1444
22923 #: ../fish/guestfish-actions.pod:1446
22926 " getxattr path name\n"
22931 #: ../fish/guestfish-actions.pod:1448
22933 "Get a single extended attribute from file C<path> named C<name>. This call "
22934 "follows symlinks. If you want to lookup an extended attribute for the "
22935 "symlink itself, use L</lgetxattr>."
22939 #: ../fish/guestfish-actions.pod:1452 ../fish/guestfish-actions.pod:2458
22941 "Normally it is better to get all extended attributes from a file in one go "
22942 "by calling L</getxattrs>. However some Linux filesystem implementations are "
22943 "buggy and do not provide a way to list out attributes. For these "
22944 "filesystems (notably ntfs-3g) you have to know the names of the extended "
22945 "attributes you want in advance and call this function."
22949 #: ../fish/guestfish-actions.pod:1462
22950 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
22954 #: ../fish/guestfish-actions.pod:1464
22959 #: ../fish/guestfish-actions.pod:1466
22962 " getxattrs path\n"
22967 #: ../fish/guestfish-actions.pod:1474
22968 msgid "See also: L</lgetxattrs>, L<attr(5)>."
22972 #: ../fish/guestfish-actions.pod:1476
22973 msgid "glob-expand"
22977 #: ../fish/guestfish-actions.pod:1478
22980 " glob-expand pattern\n"
22985 #: ../fish/guestfish-actions.pod:1491
22990 #: ../fish/guestfish-actions.pod:1493
22993 " grep regex path\n"
22998 #: ../fish/guestfish-actions.pod:1501
23003 #: ../fish/guestfish-actions.pod:1503
23006 " grepi regex path\n"
23011 #: ../fish/guestfish-actions.pod:1511
23012 msgid "grub-install"
23016 #: ../fish/guestfish-actions.pod:1513
23019 " grub-install root device\n"
23024 #: ../fish/guestfish-actions.pod:1529
23029 #: ../fish/guestfish-actions.pod:1531
23037 #: ../fish/guestfish-actions.pod:1539
23042 #: ../fish/guestfish-actions.pod:1541
23045 " head-n nrlines path\n"
23050 #: ../fish/guestfish-actions.pod:1554
23055 #: ../fish/guestfish-actions.pod:1556
23063 #: ../fish/guestfish-actions.pod:1564
23068 #: ../fish/guestfish-actions.pod:1566
23071 " initrd-cat initrdpath filename\n"
23076 #: ../fish/guestfish-actions.pod:1578
23077 msgid "See also L</initrd-list>."
23081 #: ../fish/guestfish-actions.pod:1583
23082 msgid "initrd-list"
23086 #: ../fish/guestfish-actions.pod:1585
23089 " initrd-list path\n"
23094 #: ../fish/guestfish-actions.pod:1597
23095 msgid "inotify-add-watch"
23099 #: ../fish/guestfish-actions.pod:1599
23102 " inotify-add-watch path mask\n"
23107 #: ../fish/guestfish-actions.pod:1611
23108 msgid "inotify-close"
23112 #: ../fish/guestfish-actions.pod:1613
23120 #: ../fish/guestfish-actions.pod:1619
23121 msgid "inotify-files"
23125 #: ../fish/guestfish-actions.pod:1621
23133 #: ../fish/guestfish-actions.pod:1623
23135 "This function is a helpful wrapper around L</inotify-read> which just "
23136 "returns a list of pathnames of objects that were touched. The returned "
23137 "pathnames are sorted and deduplicated."
23141 #: ../fish/guestfish-actions.pod:1627
23142 msgid "inotify-init"
23146 #: ../fish/guestfish-actions.pod:1629
23149 " inotify-init maxevents\n"
23154 #: ../fish/guestfish-actions.pod:1635
23156 "C<maxevents> is the maximum number of events which will be queued up between "
23157 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
23158 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
23159 "default was 16384 events. Beyond this limit, the kernel throws away events, "
23160 "but records the fact that it threw them away by setting a flag "
23161 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
23165 #: ../fish/guestfish-actions.pod:1645
23167 "Before any events are generated, you have to add some watches to the "
23168 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
23169 "L</inotify-watch-all>."
23173 #: ../fish/guestfish-actions.pod:1651
23175 "Queued up events should be read periodically by calling L</inotify-read> (or "
23176 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
23177 "If you don't read the events out often enough then you risk the internal "
23178 "queue overflowing."
23182 #: ../fish/guestfish-actions.pod:1658
23184 "The handle should be closed after use by calling L</inotify-close>. This "
23185 "also removes any watches automatically."
23189 #: ../fish/guestfish-actions.pod:1667
23190 msgid "inotify-read"
23194 #: ../fish/guestfish-actions.pod:1669
23202 #: ../fish/guestfish-actions.pod:1682
23203 msgid "inotify-rm-watch"
23207 #: ../fish/guestfish-actions.pod:1684
23210 " inotify-rm-watch wd\n"
23215 #: ../fish/guestfish-actions.pod:1686
23216 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
23220 #: ../fish/guestfish-actions.pod:1689
23221 msgid "inspect-get-arch"
23225 #: ../fish/guestfish-actions.pod:1691
23228 " inspect-get-arch root\n"
23233 #: ../fish/guestfish-actions.pod:1693 ../fish/guestfish-actions.pod:1709 ../fish/guestfish-actions.pod:1795 ../fish/guestfish-actions.pod:1831 ../fish/guestfish-actions.pod:1849 ../fish/guestfish-actions.pod:1883 ../fish/guestfish-actions.pod:1898 ../fish/guestfish-actions.pod:1919 ../fish/guestfish-actions.pod:1934 ../fish/guestfish-actions.pod:1967 ../fish/guestfish-actions.pod:1989 ../fish/guestfish-actions.pod:2013 ../fish/guestfish-actions.pod:2030 ../fish/guestfish-actions.pod:2073 ../fish/guestfish-actions.pod:2108 ../fish/guestfish-actions.pod:2124 ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2153 ../fish/guestfish-actions.pod:2166 ../fish/guestfish-actions.pod:2181
23235 "This function should only be called with a root device string as returned by "
23240 #: ../fish/guestfish-actions.pod:1696
23242 "This returns the architecture of the inspected operating system. The "
23243 "possible return values are listed under L</file-architecture>."
23247 #: ../fish/guestfish-actions.pod:1705
23248 msgid "inspect-get-distro"
23252 #: ../fish/guestfish-actions.pod:1707
23255 " inspect-get-distro root\n"
23260 #: ../fish/guestfish-actions.pod:1791
23261 msgid "inspect-get-drive-mappings"
23265 #: ../fish/guestfish-actions.pod:1793
23268 " inspect-get-drive-mappings root\n"
23273 #: ../fish/guestfish-actions.pod:1823
23275 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23276 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
23280 #: ../fish/guestfish-actions.pod:1827
23281 msgid "inspect-get-filesystems"
23285 #: ../fish/guestfish-actions.pod:1829
23288 " inspect-get-filesystems root\n"
23293 #: ../fish/guestfish-actions.pod:1842
23295 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23296 "L</inspect-get-mountpoints>."
23300 #: ../fish/guestfish-actions.pod:1845
23301 msgid "inspect-get-format"
23305 #: ../fish/guestfish-actions.pod:1847
23308 " inspect-get-format root\n"
23313 #: ../fish/guestfish-actions.pod:1879
23314 msgid "inspect-get-hostname"
23318 #: ../fish/guestfish-actions.pod:1881
23321 " inspect-get-hostname root\n"
23326 #: ../fish/guestfish-actions.pod:1894
23327 msgid "inspect-get-major-version"
23331 #: ../fish/guestfish-actions.pod:1896
23334 " inspect-get-major-version root\n"
23339 #: ../fish/guestfish-actions.pod:1915
23340 msgid "inspect-get-minor-version"
23344 #: ../fish/guestfish-actions.pod:1917
23347 " inspect-get-minor-version root\n"
23352 #: ../fish/guestfish-actions.pod:1927
23354 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23355 "L</inspect-get-major-version>."
23359 #: ../fish/guestfish-actions.pod:1930
23360 msgid "inspect-get-mountpoints"
23364 #: ../fish/guestfish-actions.pod:1932
23367 " inspect-get-mountpoints root\n"
23372 #: ../fish/guestfish-actions.pod:1954
23374 "For operating systems like Windows which still use drive letters, this call "
23375 "will only return an entry for the first drive \"mounted on\" C</>. For "
23376 "information about the mapping of drive letters to partitions, see "
23377 "L</inspect-get-drive-mappings>."
23381 #: ../fish/guestfish-actions.pod:1960
23383 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23384 "L</inspect-get-filesystems>."
23388 #: ../fish/guestfish-actions.pod:1963
23389 msgid "inspect-get-package-format"
23393 #: ../fish/guestfish-actions.pod:1965
23396 " inspect-get-package-format root\n"
23401 #: ../fish/guestfish-actions.pod:1970
23403 "This function and L</inspect-get-package-management> return the package "
23404 "format and package management tool used by the inspected operating system. "
23405 "For example for Fedora these functions would return C<rpm> (package format) "
23406 "and C<yum> (package management)."
23410 #: ../fish/guestfish-actions.pod:1985
23411 msgid "inspect-get-package-management"
23415 #: ../fish/guestfish-actions.pod:1987
23418 " inspect-get-package-management root\n"
23423 #: ../fish/guestfish-actions.pod:1992
23425 "L</inspect-get-package-format> and this function return the package format "
23426 "and package management tool used by the inspected operating system. For "
23427 "example for Fedora these functions would return C<rpm> (package format) and "
23428 "C<yum> (package management)."
23432 #: ../fish/guestfish-actions.pod:2009
23433 msgid "inspect-get-product-name"
23437 #: ../fish/guestfish-actions.pod:2011
23440 " inspect-get-product-name root\n"
23445 #: ../fish/guestfish-actions.pod:2026
23446 msgid "inspect-get-product-variant"
23450 #: ../fish/guestfish-actions.pod:2028
23453 " inspect-get-product-variant root\n"
23458 #: ../fish/guestfish-actions.pod:2052
23460 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23461 "L</inspect-get-product-name>, L</inspect-get-major-version>."
23465 #: ../fish/guestfish-actions.pod:2056
23466 msgid "inspect-get-roots"
23470 #: ../fish/guestfish-actions.pod:2058
23473 " inspect-get-roots\n"
23478 #: ../fish/guestfish-actions.pod:2060
23480 "This function is a convenient way to get the list of root devices, as "
23481 "returned from a previous call to L</inspect-os>, but without redoing the "
23482 "whole inspection process."
23486 #: ../fish/guestfish-actions.pod:2064
23488 "This returns an empty list if either no root devices were found or the "
23489 "caller has not called L</inspect-os>."
23493 #: ../fish/guestfish-actions.pod:2069
23494 msgid "inspect-get-type"
23498 #: ../fish/guestfish-actions.pod:2071
23501 " inspect-get-type root\n"
23506 #: ../fish/guestfish-actions.pod:2104
23507 msgid "inspect-get-windows-current-control-set"
23511 #: ../fish/guestfish-actions.pod:2106
23514 " inspect-get-windows-current-control-set root\n"
23519 #: ../fish/guestfish-actions.pod:2120
23520 msgid "inspect-get-windows-systemroot"
23524 #: ../fish/guestfish-actions.pod:2122
23527 " inspect-get-windows-systemroot root\n"
23532 #: ../fish/guestfish-actions.pod:2136
23533 msgid "inspect-is-live"
23537 #: ../fish/guestfish-actions.pod:2138
23540 " inspect-is-live root\n"
23545 #: ../fish/guestfish-actions.pod:2143
23547 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23548 "then this returns true if a live image was detected on the disk."
23552 #: ../fish/guestfish-actions.pod:2149
23553 msgid "inspect-is-multipart"
23557 #: ../fish/guestfish-actions.pod:2151
23560 " inspect-is-multipart root\n"
23565 #: ../fish/guestfish-actions.pod:2156
23567 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23568 "then this returns true if the disk is part of a set."
23572 #: ../fish/guestfish-actions.pod:2162
23573 msgid "inspect-is-netinst"
23577 #: ../fish/guestfish-actions.pod:2164
23580 " inspect-is-netinst root\n"
23585 #: ../fish/guestfish-actions.pod:2169
23587 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23588 "then this returns true if the disk is a network installer, ie. not a "
23589 "self-contained install CD but one which is likely to require network access "
23590 "to complete the install."
23594 #: ../fish/guestfish-actions.pod:2177
23595 msgid "inspect-list-applications"
23599 #: ../fish/guestfish-actions.pod:2179
23602 " inspect-list-applications root\n"
23607 #: ../fish/guestfish-actions.pod:2186
23609 "I<Note:> This call works differently from other parts of the inspection "
23610 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
23611 "then mount up the disks, before calling this. Listing applications is a "
23612 "significantly more difficult operation which requires access to the full "
23613 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
23614 "are just returning data cached in the libguestfs handle, this call actually "
23615 "reads parts of the mounted filesystems during the call."
23619 #: ../fish/guestfish-actions.pod:2276
23624 #: ../fish/guestfish-actions.pod:2278
23632 #: ../fish/guestfish-actions.pod:2293
23634 "You can pass the root string(s) returned to other L</inspect-get-*> "
23635 "functions in order to query further information about each operating system, "
23636 "such as the name and version."
23640 #: ../fish/guestfish-actions.pod:2298
23642 "This function uses other libguestfs features such as L</mount-ro> and "
23643 "L</umount-all> in order to mount and unmount filesystems and look at the "
23644 "contents. This should be called with no disks currently mounted. The "
23645 "function may also use Augeas, so any existing Augeas handle will be closed."
23649 #: ../fish/guestfish-actions.pod:2310 ../fish/guestfish-actions.pod:2486 ../fish/guestfish-actions.pod:2532
23650 msgid "See also L</list-filesystems>."
23654 #: ../fish/guestfish-actions.pod:2312
23655 msgid "is-blockdev"
23659 #: ../fish/guestfish-actions.pod:2314
23662 " is-blockdev path\n"
23667 #: ../fish/guestfish-actions.pod:2319 ../fish/guestfish-actions.pod:2337 ../fish/guestfish-actions.pod:2356 ../fish/guestfish-actions.pod:2365 ../fish/guestfish-actions.pod:2375 ../fish/guestfish-actions.pod:2409 ../fish/guestfish-actions.pod:2418
23668 msgid "See also L</stat>."
23672 #: ../fish/guestfish-actions.pod:2321
23677 #: ../fish/guestfish-actions.pod:2323
23685 #: ../fish/guestfish-actions.pod:2330
23690 #: ../fish/guestfish-actions.pod:2332
23693 " is-chardev path\n"
23698 #: ../fish/guestfish-actions.pod:2339
23703 #: ../fish/guestfish-actions.pod:2341
23711 #: ../fish/guestfish-actions.pod:2348
23716 #: ../fish/guestfish-actions.pod:2350
23724 #: ../fish/guestfish-actions.pod:2358
23729 #: ../fish/guestfish-actions.pod:2360
23737 #: ../fish/guestfish-actions.pod:2367
23742 #: ../fish/guestfish-actions.pod:2369
23750 #: ../fish/guestfish-actions.pod:2377
23751 msgid "is-launching"
23755 #: ../fish/guestfish-actions.pod:2379
23763 #: ../fish/guestfish-actions.pod:2386
23768 #: ../fish/guestfish-actions.pod:2388
23776 #: ../fish/guestfish-actions.pod:2393
23781 #: ../fish/guestfish-actions.pod:2395
23789 #: ../fish/guestfish-actions.pod:2402
23794 #: ../fish/guestfish-actions.pod:2404
23797 " is-socket path\n"
23802 #: ../fish/guestfish-actions.pod:2411
23807 #: ../fish/guestfish-actions.pod:2413
23810 " is-symlink path\n"
23815 #: ../fish/guestfish-actions.pod:2420
23816 msgid "kill-subprocess"
23820 #: ../fish/guestfish-actions.pod:2422
23823 " kill-subprocess\n"
23828 #: ../fish/guestfish-actions.pod:2426
23833 #: ../fish/guestfish-actions.pod:2428
23838 #: ../fish/guestfish-actions.pod:2430
23846 #: ../fish/guestfish-actions.pod:2438
23851 #: ../fish/guestfish-actions.pod:2440
23854 " lchown owner group path\n"
23859 #: ../fish/guestfish-actions.pod:2442
23861 "Change the file owner to C<owner> and group to C<group>. This is like "
23862 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
23867 #: ../fish/guestfish-actions.pod:2450
23872 #: ../fish/guestfish-actions.pod:2452
23875 " lgetxattr path name\n"
23880 #: ../fish/guestfish-actions.pod:2468
23881 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
23885 #: ../fish/guestfish-actions.pod:2470
23890 #: ../fish/guestfish-actions.pod:2472
23893 " lgetxattrs path\n"
23898 #: ../fish/guestfish-actions.pod:2474
23900 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
23901 "it returns the extended attributes of the link itself."
23905 #: ../fish/guestfish-actions.pod:2478
23906 msgid "list-devices"
23910 #: ../fish/guestfish-actions.pod:2480
23918 #: ../fish/guestfish-actions.pod:2488
23919 msgid "list-filesystems"
23923 #: ../fish/guestfish-actions.pod:2490
23926 " list-filesystems\n"
23931 #: ../fish/guestfish-actions.pod:2509
23933 "This command runs other libguestfs commands, which might include L</mount> "
23934 "and L</umount>, and therefore you should use this soon after launch and only "
23935 "when nothing is mounted."
23939 #: ../fish/guestfish-actions.pod:2513
23941 "Not all of the filesystems returned will be mountable. In particular, swap "
23942 "partitions are returned in the list. Also this command does not check that "
23943 "each filesystem found is valid and mountable, and some filesystems might be "
23944 "mountable but require special options. Filesystems may not all belong to a "
23945 "single logical operating system (use L</inspect-os> to look for OSes)."
23949 #: ../fish/guestfish-actions.pod:2521
23950 msgid "list-partitions"
23954 #: ../fish/guestfish-actions.pod:2523
23957 " list-partitions\n"
23962 #: ../fish/guestfish-actions.pod:2529
23964 "This does not return logical volumes. For that you will need to call "
23969 #: ../fish/guestfish-actions.pod:2534
23974 #: ../fish/guestfish-actions.pod:2536
23982 #: ../fish/guestfish-actions.pod:2544
23987 #: ../fish/guestfish-actions.pod:2546
23990 " ln target linkname\n"
23995 #: ../fish/guestfish-actions.pod:2550
24000 #: ../fish/guestfish-actions.pod:2552
24003 " ln-f target linkname\n"
24008 #: ../fish/guestfish-actions.pod:2557
24013 #: ../fish/guestfish-actions.pod:2559
24016 " ln-s target linkname\n"
24021 #: ../fish/guestfish-actions.pod:2563
24026 #: ../fish/guestfish-actions.pod:2565
24029 " ln-sf target linkname\n"
24034 #: ../fish/guestfish-actions.pod:2570
24035 msgid "lremovexattr"
24039 #: ../fish/guestfish-actions.pod:2572
24042 " lremovexattr xattr path\n"
24047 #: ../fish/guestfish-actions.pod:2574
24049 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
24050 "it removes an extended attribute of the link itself."
24054 #: ../fish/guestfish-actions.pod:2578
24059 #: ../fish/guestfish-actions.pod:2580
24067 #: ../fish/guestfish-actions.pod:2586
24069 "This command is mostly useful for interactive sessions. Programs should "
24070 "probably use L</readdir> instead."
24074 #: ../fish/guestfish-actions.pod:2589
24079 #: ../fish/guestfish-actions.pod:2591
24082 " lsetxattr xattr val vallen path\n"
24087 #: ../fish/guestfish-actions.pod:2593
24089 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
24090 "sets an extended attribute of the link itself."
24094 #: ../fish/guestfish-actions.pod:2597
24099 #: ../fish/guestfish-actions.pod:2599
24107 #: ../fish/guestfish-actions.pod:2603
24109 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
24110 "the link is stat-ed, not the file it refers to."
24114 #: ../fish/guestfish-actions.pod:2609
24119 #: ../fish/guestfish-actions.pod:2611
24122 " lstatlist path 'names ...'\n"
24127 #: ../fish/guestfish-actions.pod:2613
24129 "This call allows you to perform the L</lstat> operation on multiple files, "
24130 "where all files are in the directory C<path>. C<names> is the list of files "
24131 "from this directory."
24135 #: ../fish/guestfish-actions.pod:2622
24137 "This call is intended for programs that want to efficiently list a directory "
24138 "contents without making many round-trips. See also L</lxattrlist> for a "
24139 "similarly efficient call for getting extended attributes. Very long "
24140 "directory listings might cause the protocol message size to be exceeded, "
24141 "causing this call to fail. The caller must split up such requests into "
24142 "smaller groups of names."
24146 #: ../fish/guestfish-actions.pod:2630
24147 msgid "luks-add-key"
24151 #: ../fish/guestfish-actions.pod:2632
24154 " luks-add-key device keyslot\n"
24159 #: ../fish/guestfish-actions.pod:2639
24161 "Note that if C<keyslot> already contains a key, then this command will "
24162 "fail. You have to use L</luks-kill-slot> first to remove that key."
24166 #: ../fish/guestfish-actions.pod:2643 ../fish/guestfish-actions.pod:2665 ../fish/guestfish-actions.pod:2678 ../fish/guestfish-actions.pod:2692 ../fish/guestfish-actions.pod:2715 ../fish/guestfish-actions.pod:2725
24168 "This command has one or more key or passphrase parameters. Guestfish will "
24169 "prompt for these separately."
24173 #: ../fish/guestfish-actions.pod:2646
24178 #: ../fish/guestfish-actions.pod:2648
24181 " luks-close device\n"
24186 #: ../fish/guestfish-actions.pod:2650
24188 "This closes a LUKS device that was created earlier by L</luks-open> or "
24189 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
24190 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
24191 "underlying block device."
24195 #: ../fish/guestfish-actions.pod:2656
24196 msgid "luks-format"
24200 #: ../fish/guestfish-actions.pod:2658
24203 " luks-format device keyslot\n"
24208 #: ../fish/guestfish-actions.pod:2671
24209 msgid "luks-format-cipher"
24213 #: ../fish/guestfish-actions.pod:2673
24216 " luks-format-cipher device keyslot cipher\n"
24221 #: ../fish/guestfish-actions.pod:2675
24223 "This command is the same as L</luks-format> but it also allows you to set "
24224 "the C<cipher> used."
24228 #: ../fish/guestfish-actions.pod:2684
24229 msgid "luks-kill-slot"
24233 #: ../fish/guestfish-actions.pod:2686
24236 " luks-kill-slot device keyslot\n"
24241 #: ../fish/guestfish-actions.pod:2695
24246 #: ../fish/guestfish-actions.pod:2697
24249 " luks-open device mapname\n"
24254 #: ../fish/guestfish-actions.pod:2711
24256 "If this block device contains LVM volume groups, then calling L</vgscan> "
24257 "followed by L</vg-activate-all> will make them visible."
24261 #: ../fish/guestfish-actions.pod:2718
24262 msgid "luks-open-ro"
24266 #: ../fish/guestfish-actions.pod:2720
24269 " luks-open-ro device mapname\n"
24274 #: ../fish/guestfish-actions.pod:2722
24276 "This is the same as L</luks-open> except that a read-only mapping is "
24281 #: ../fish/guestfish-actions.pod:2728
24286 #: ../fish/guestfish-actions.pod:2730
24289 " lvcreate logvol volgroup mbytes\n"
24294 #: ../fish/guestfish-actions.pod:2735
24295 msgid "lvm-canonical-lv-name"
24299 #: ../fish/guestfish-actions.pod:2737
24302 " lvm-canonical-lv-name lvname\n"
24307 #: ../fish/guestfish-actions.pod:2746
24308 msgid "See also L</is-lv>."
24312 #: ../fish/guestfish-actions.pod:2748
24313 msgid "lvm-clear-filter"
24317 #: ../fish/guestfish-actions.pod:2750
24320 " lvm-clear-filter\n"
24325 #: ../fish/guestfish-actions.pod:2752
24327 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
24332 #: ../fish/guestfish-actions.pod:2758
24333 msgid "lvm-remove-all"
24337 #: ../fish/guestfish-actions.pod:2760
24340 " lvm-remove-all\n"
24345 #: ../fish/guestfish-actions.pod:2768
24346 msgid "lvm-set-filter"
24350 #: ../fish/guestfish-actions.pod:2770
24353 " lvm-set-filter 'devices ...'\n"
24358 #: ../fish/guestfish-actions.pod:2795
24363 #: ../fish/guestfish-actions.pod:2797
24366 " lvremove device\n"
24371 #: ../fish/guestfish-actions.pod:2805
24376 #: ../fish/guestfish-actions.pod:2807
24379 " lvrename logvol newlogvol\n"
24384 #: ../fish/guestfish-actions.pod:2811
24389 #: ../fish/guestfish-actions.pod:2813
24392 " lvresize device mbytes\n"
24397 #: ../fish/guestfish-actions.pod:2819
24398 msgid "lvresize-free"
24402 #: ../fish/guestfish-actions.pod:2821
24405 " lvresize-free lv percent\n"
24410 #: ../fish/guestfish-actions.pod:2829
24415 #: ../fish/guestfish-actions.pod:2831
24423 #: ../fish/guestfish-actions.pod:2839
24424 msgid "See also L</lvs-full>, L</list-filesystems>."
24428 #: ../fish/guestfish-actions.pod:2841
24433 #: ../fish/guestfish-actions.pod:2843
24441 #: ../fish/guestfish-actions.pod:2848
24446 #: ../fish/guestfish-actions.pod:2850
24454 #: ../fish/guestfish-actions.pod:2854
24459 #: ../fish/guestfish-actions.pod:2856
24462 " lxattrlist path 'names ...'\n"
24467 #: ../fish/guestfish-actions.pod:2872
24469 "This call is intended for programs that want to efficiently list a directory "
24470 "contents without making many round-trips. See also L</lstatlist> for a "
24471 "similarly efficient call for getting standard stats. Very long directory "
24472 "listings might cause the protocol message size to be exceeded, causing this "
24473 "call to fail. The caller must split up such requests into smaller groups of "
24478 #: ../fish/guestfish-actions.pod:2880
24483 #: ../fish/guestfish-actions.pod:2882
24491 #: ../fish/guestfish-actions.pod:2886
24496 #: ../fish/guestfish-actions.pod:2888
24499 " mkdir-mode path mode\n"
24504 #: ../fish/guestfish-actions.pod:2897
24505 msgid "See also L</mkdir>, L</umask>"
24509 #: ../fish/guestfish-actions.pod:2899
24514 #: ../fish/guestfish-actions.pod:2901
24522 #: ../fish/guestfish-actions.pod:2906
24527 #: ../fish/guestfish-actions.pod:2908
24530 " mkdtemp template\n"
24535 #: ../fish/guestfish-actions.pod:2929
24540 #: ../fish/guestfish-actions.pod:2931
24543 " mke2fs-J fstype blocksize device journal\n"
24548 #: ../fish/guestfish-actions.pod:2939
24549 msgid "See also L</mke2journal>."
24553 #: ../fish/guestfish-actions.pod:2941
24558 #: ../fish/guestfish-actions.pod:2943
24561 " mke2fs-JL fstype blocksize device label\n"
24566 #: ../fish/guestfish-actions.pod:2948
24567 msgid "See also L</mke2journal-L>."
24571 #: ../fish/guestfish-actions.pod:2950
24576 #: ../fish/guestfish-actions.pod:2952
24579 " mke2fs-JU fstype blocksize device uuid\n"
24584 #: ../fish/guestfish-actions.pod:2957
24585 msgid "See also L</mke2journal-U>."
24589 #: ../fish/guestfish-actions.pod:2959
24590 msgid "mke2journal"
24594 #: ../fish/guestfish-actions.pod:2961
24597 " mke2journal blocksize device\n"
24602 #: ../fish/guestfish-actions.pod:2968
24603 msgid "mke2journal-L"
24607 #: ../fish/guestfish-actions.pod:2970
24610 " mke2journal-L blocksize label device\n"
24615 #: ../fish/guestfish-actions.pod:2974
24616 msgid "mke2journal-U"
24620 #: ../fish/guestfish-actions.pod:2976
24623 " mke2journal-U blocksize uuid device\n"
24628 #: ../fish/guestfish-actions.pod:2980
24633 #: ../fish/guestfish-actions.pod:2982
24636 " mkfifo mode path\n"
24641 #: ../fish/guestfish-actions.pod:2984
24643 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
24644 "is just a convenient wrapper around L</mknod>."
24648 #: ../fish/guestfish-actions.pod:2990
24653 #: ../fish/guestfish-actions.pod:2992
24656 " mkfs fstype device\n"
24661 #: ../fish/guestfish-actions.pod:2998
24666 #: ../fish/guestfish-actions.pod:3000
24669 " mkfs-b fstype blocksize device\n"
24674 #: ../fish/guestfish-actions.pod:3002
24676 "This call is similar to L</mkfs>, but it allows you to control the block "
24677 "size of the resulting filesystem. Supported block sizes depend on the "
24678 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
24682 #: ../fish/guestfish-actions.pod:3017
24687 #: ../fish/guestfish-actions.pod:3019
24690 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
24695 #: ../fish/guestfish-actions.pod:3054
24696 msgid "mkmountpoint"
24700 #: ../fish/guestfish-actions.pod:3056
24703 " mkmountpoint exemptpath\n"
24708 #: ../fish/guestfish-actions.pod:3058
24710 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
24711 "to create extra mountpoints before mounting the first filesystem."
24715 #: ../fish/guestfish-actions.pod:3082
24717 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
24718 "unexpected errors if you try to mix these calls. It is safest to manually "
24719 "unmount filesystems and remove mountpoints after use."
24723 #: ../fish/guestfish-actions.pod:3086
24725 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
24726 "for this to work for manual mountpoints, you must ensure that the innermost "
24727 "mountpoints have the longest pathnames, as in the example code above."
24731 #: ../fish/guestfish-actions.pod:3093
24733 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
24734 "L</umount-all> to be called when the handle is closed which can also trigger "
24739 #: ../fish/guestfish-actions.pod:3097
24744 #: ../fish/guestfish-actions.pod:3099
24747 " mknod mode devmajor devminor path\n"
24752 #: ../fish/guestfish-actions.pod:3109
24754 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
24755 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
24756 "regular file). These constants are available in the standard Linux header "
24757 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
24758 "wrappers around this command which bitwise OR in the appropriate constant "
24763 #: ../fish/guestfish-actions.pod:3119
24768 #: ../fish/guestfish-actions.pod:3121
24771 " mknod-b mode devmajor devminor path\n"
24776 #: ../fish/guestfish-actions.pod:3123
24778 "This call creates a block device node called C<path> with mode C<mode> and "
24779 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
24780 "wrapper around L</mknod>."
24784 #: ../fish/guestfish-actions.pod:3129
24789 #: ../fish/guestfish-actions.pod:3131
24792 " mknod-c mode devmajor devminor path\n"
24797 #: ../fish/guestfish-actions.pod:3133
24799 "This call creates a char device node called C<path> with mode C<mode> and "
24800 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
24801 "wrapper around L</mknod>."
24805 #: ../fish/guestfish-actions.pod:3139
24810 #: ../fish/guestfish-actions.pod:3141
24818 #: ../fish/guestfish-actions.pod:3145
24823 #: ../fish/guestfish-actions.pod:3147
24826 " mkswap-L label device\n"
24831 #: ../fish/guestfish-actions.pod:3155
24836 #: ../fish/guestfish-actions.pod:3157
24839 " mkswap-U uuid device\n"
24844 #: ../fish/guestfish-actions.pod:3161
24845 msgid "mkswap-file"
24849 #: ../fish/guestfish-actions.pod:3163
24852 " mkswap-file path\n"
24857 #: ../fish/guestfish-actions.pod:3167
24859 "This command just writes a swap file signature to an existing file. To "
24860 "create the file itself, use something like L</fallocate>."
24864 #: ../fish/guestfish-actions.pod:3170
24869 #: ../fish/guestfish-actions.pod:3172
24872 " modprobe modulename\n"
24877 #: ../fish/guestfish-actions.pod:3179
24882 #: ../fish/guestfish-actions.pod:3181
24885 " mount device mountpoint\n"
24890 #: ../fish/guestfish-actions.pod:3197
24892 "B<Important note:> When you use this call, the filesystem options C<sync> "
24893 "and C<noatime> are set implicitly. This was originally done because we "
24894 "thought it would improve reliability, but it turns out that I<-o sync> has a "
24895 "very large negative performance impact and negligible effect on "
24896 "reliability. Therefore we recommend that you avoid using L</mount> in any "
24897 "code that needs performance, and instead use L</mount-options> (use an empty "
24898 "string for the first parameter if you don't want any options)."
24902 #: ../fish/guestfish-actions.pod:3207
24907 #: ../fish/guestfish-actions.pod:3209
24910 " mount-loop file mountpoint\n"
24915 #: ../fish/guestfish-actions.pod:3215
24916 msgid "mount-options"
24920 #: ../fish/guestfish-actions.pod:3217
24923 " mount-options options device mountpoint\n"
24928 #: ../fish/guestfish-actions.pod:3219
24930 "This is the same as the L</mount> command, but it allows you to set the "
24931 "mount options as for the L<mount(8)> I<-o> flag."
24935 #: ../fish/guestfish-actions.pod:3227
24940 #: ../fish/guestfish-actions.pod:3229
24943 " mount-ro device mountpoint\n"
24948 #: ../fish/guestfish-actions.pod:3231
24950 "This is the same as the L</mount> command, but it mounts the filesystem with "
24951 "the read-only (I<-o ro>) flag."
24955 #: ../fish/guestfish-actions.pod:3234
24960 #: ../fish/guestfish-actions.pod:3236
24963 " mount-vfs options vfstype device mountpoint\n"
24968 #: ../fish/guestfish-actions.pod:3238
24970 "This is the same as the L</mount> command, but it allows you to set both the "
24971 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
24975 #: ../fish/guestfish-actions.pod:3242
24976 msgid "mountpoints"
24980 #: ../fish/guestfish-actions.pod:3244
24988 #: ../fish/guestfish-actions.pod:3246
24990 "This call is similar to L</mounts>. That call returns a list of devices. "
24991 "This one returns a hash table (map) of device name to directory where the "
24992 "device is mounted."
24996 #: ../fish/guestfish-actions.pod:3250
25001 #: ../fish/guestfish-actions.pod:3252
25009 #: ../fish/guestfish-actions.pod:3259
25010 msgid "See also: L</mountpoints>"
25014 #: ../fish/guestfish-actions.pod:3261
25019 #: ../fish/guestfish-actions.pod:3263
25027 #: ../fish/guestfish-actions.pod:3268
25028 msgid "ntfs-3g-probe"
25032 #: ../fish/guestfish-actions.pod:3270
25035 " ntfs-3g-probe true|false device\n"
25040 #: ../fish/guestfish-actions.pod:3284
25045 #: ../fish/guestfish-actions.pod:3286
25048 " ntfsresize device\n"
25053 #: ../fish/guestfish-actions.pod:3292
25054 msgid "ntfsresize-size"
25058 #: ../fish/guestfish-actions.pod:3294
25061 " ntfsresize-size device size\n"
25066 #: ../fish/guestfish-actions.pod:3296
25068 "This command is the same as L</ntfsresize> except that it allows you to "
25069 "specify the new size (in bytes) explicitly."
25073 #: ../fish/guestfish-actions.pod:3299
25078 #: ../fish/guestfish-actions.pod:3301
25081 " part-add device prlogex startsect endsect\n"
25086 #: ../fish/guestfish-actions.pod:3303
25088 "This command adds a partition to C<device>. If there is no partition table "
25089 "on the device, call L</part-init> first."
25093 #: ../fish/guestfish-actions.pod:3315
25095 "Creating a partition which covers the whole disk is not so easy. Use "
25096 "L</part-disk> to do that."
25100 #: ../fish/guestfish-actions.pod:3318
25105 #: ../fish/guestfish-actions.pod:3320
25108 " part-del device partnum\n"
25113 #: ../fish/guestfish-actions.pod:3328
25118 #: ../fish/guestfish-actions.pod:3330
25121 " part-disk device parttype\n"
25126 #: ../fish/guestfish-actions.pod:3332
25128 "This command is simply a combination of L</part-init> followed by "
25129 "L</part-add> to create a single primary partition covering the whole disk."
25133 #: ../fish/guestfish-actions.pod:3336
25135 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
25136 "possible values are described in L</part-init>."
25140 #: ../fish/guestfish-actions.pod:3342
25141 msgid "part-get-bootable"
25145 #: ../fish/guestfish-actions.pod:3344
25148 " part-get-bootable device partnum\n"
25153 #: ../fish/guestfish-actions.pod:3349
25154 msgid "See also L</part-set-bootable>."
25158 #: ../fish/guestfish-actions.pod:3351
25159 msgid "part-get-mbr-id"
25163 #: ../fish/guestfish-actions.pod:3353
25166 " part-get-mbr-id device partnum\n"
25171 #: ../fish/guestfish-actions.pod:3358 ../fish/guestfish-actions.pod:3496
25173 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
25174 "undefined results for other partition table types (see "
25175 "L</part-get-parttype>)."
25179 #: ../fish/guestfish-actions.pod:3362
25180 msgid "part-get-parttype"
25184 #: ../fish/guestfish-actions.pod:3364
25187 " part-get-parttype device\n"
25192 #: ../fish/guestfish-actions.pod:3369
25194 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
25195 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
25196 "possible, although unusual. See L</part-init> for a full list."
25200 #: ../fish/guestfish-actions.pod:3374
25205 #: ../fish/guestfish-actions.pod:3376
25208 " part-init device parttype\n"
25213 #: ../fish/guestfish-actions.pod:3382
25215 "Initially there are no partitions. Following this, you should call "
25216 "L</part-add> for each partition required."
25220 #: ../fish/guestfish-actions.pod:3445
25225 #: ../fish/guestfish-actions.pod:3447
25228 " part-list device\n"
25233 #: ../fish/guestfish-actions.pod:3462
25235 "Start of the partition I<in bytes>. To get sectors you have to divide by "
25236 "the device's sector size, see L</blockdev-getss>."
25240 #: ../fish/guestfish-actions.pod:3475
25241 msgid "part-set-bootable"
25245 #: ../fish/guestfish-actions.pod:3477
25248 " part-set-bootable device partnum true|false\n"
25253 #: ../fish/guestfish-actions.pod:3486
25254 msgid "part-set-mbr-id"
25258 #: ../fish/guestfish-actions.pod:3488
25261 " part-set-mbr-id device partnum idbyte\n"
25266 #: ../fish/guestfish-actions.pod:3500
25267 msgid "part-set-name"
25271 #: ../fish/guestfish-actions.pod:3502
25274 " part-set-name device partnum name\n"
25279 #: ../fish/guestfish-actions.pod:3510
25280 msgid "part-to-dev"
25284 #: ../fish/guestfish-actions.pod:3512
25287 " part-to-dev partition\n"
25292 #: ../fish/guestfish-actions.pod:3518
25294 "The named partition must exist, for example as a string returned from "
25295 "L</list-partitions>."
25299 #: ../fish/guestfish-actions.pod:3521
25300 msgid "ping-daemon"
25304 #: ../fish/guestfish-actions.pod:3523
25312 #: ../fish/guestfish-actions.pod:3530
25317 #: ../fish/guestfish-actions.pod:3532
25320 " pread path count offset\n"
25325 #: ../fish/guestfish-actions.pod:3540
25326 msgid "See also L</pwrite>, L</pread-device>."
25330 #: ../fish/guestfish-actions.pod:3545
25331 msgid "pread-device"
25335 #: ../fish/guestfish-actions.pod:3547
25338 " pread-device device count offset\n"
25343 #: ../fish/guestfish-actions.pod:3555
25344 msgid "See also L</pread>."
25348 #: ../fish/guestfish-actions.pod:3560
25353 #: ../fish/guestfish-actions.pod:3562
25356 " pvcreate device\n"
25361 #: ../fish/guestfish-actions.pod:3568
25366 #: ../fish/guestfish-actions.pod:3570
25369 " pvremove device\n"
25374 #: ../fish/guestfish-actions.pod:3579
25379 #: ../fish/guestfish-actions.pod:3581
25382 " pvresize device\n"
25387 #: ../fish/guestfish-actions.pod:3586
25388 msgid "pvresize-size"
25392 #: ../fish/guestfish-actions.pod:3588
25395 " pvresize-size device size\n"
25400 #: ../fish/guestfish-actions.pod:3590
25402 "This command is the same as L</pvresize> except that it allows you to "
25403 "specify the new size (in bytes) explicitly."
25407 #: ../fish/guestfish-actions.pod:3593
25412 #: ../fish/guestfish-actions.pod:3595
25420 #: ../fish/guestfish-actions.pod:3603
25421 msgid "See also L</pvs-full>."
25425 #: ../fish/guestfish-actions.pod:3605
25430 #: ../fish/guestfish-actions.pod:3607
25438 #: ../fish/guestfish-actions.pod:3612
25443 #: ../fish/guestfish-actions.pod:3614
25451 #: ../fish/guestfish-actions.pod:3618
25456 #: ../fish/guestfish-actions.pod:3620
25459 " pwrite path content offset\n"
25464 #: ../fish/guestfish-actions.pod:3631
25465 msgid "See also L</pread>, L</pwrite-device>."
25469 #: ../fish/guestfish-actions.pod:3636
25470 msgid "pwrite-device"
25474 #: ../fish/guestfish-actions.pod:3638
25477 " pwrite-device device content offset\n"
25482 #: ../fish/guestfish-actions.pod:3648
25483 msgid "See also L</pwrite>."
25487 #: ../fish/guestfish-actions.pod:3653
25492 #: ../fish/guestfish-actions.pod:3655
25495 " read-file path\n"
25500 #: ../fish/guestfish-actions.pod:3660
25502 "Unlike L</cat>, this function can correctly handle files that contain "
25503 "embedded ASCII NUL characters. However unlike L</download>, this function "
25504 "is limited in the total size of file that can be handled."
25508 #: ../fish/guestfish-actions.pod:3668
25513 #: ../fish/guestfish-actions.pod:3670
25516 " read-lines path\n"
25521 #: ../fish/guestfish-actions.pod:3677
25523 "Note that this function cannot correctly handle binary files (specifically, "
25524 "files containing C<\\0> character which is treated as end of line). For "
25525 "those you need to use the L</read-file> function which has a more complex "
25530 #: ../fish/guestfish-actions.pod:3682
25535 #: ../fish/guestfish-actions.pod:3684
25543 #: ../fish/guestfish-actions.pod:3736
25545 "This function is primarily intended for use by programs. To get a simple "
25546 "list of names, use L</ls>. To get a printable directory for human "
25547 "consumption, use L</ll>."
25551 #: ../fish/guestfish-actions.pod:3740
25556 #: ../fish/guestfish-actions.pod:3742
25564 #: ../fish/guestfish-actions.pod:3746
25565 msgid "readlinklist"
25569 #: ../fish/guestfish-actions.pod:3748
25572 " readlinklist path 'names ...'\n"
25577 #: ../fish/guestfish-actions.pod:3772
25582 #: ../fish/guestfish-actions.pod:3774
25590 #: ../fish/guestfish-actions.pod:3779
25591 msgid "removexattr"
25595 #: ../fish/guestfish-actions.pod:3781
25598 " removexattr xattr path\n"
25603 #: ../fish/guestfish-actions.pod:3786
25604 msgid "See also: L</lremovexattr>, L<attr(5)>."
25608 #: ../fish/guestfish-actions.pod:3788
25613 #: ../fish/guestfish-actions.pod:3790
25616 " resize2fs device\n"
25621 #: ../fish/guestfish-actions.pod:3795
25623 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
25624 "before calling this command. For unknown reasons C<resize2fs> sometimes "
25625 "gives an error about this and sometimes not. In any case, it is always safe "
25626 "to call L</e2fsck-f> before calling this function."
25630 #: ../fish/guestfish-actions.pod:3801
25631 msgid "resize2fs-M"
25635 #: ../fish/guestfish-actions.pod:3803
25638 " resize2fs-M device\n"
25643 #: ../fish/guestfish-actions.pod:3805
25645 "This command is the same as L</resize2fs>, but the filesystem is resized to "
25646 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
25651 #: ../fish/guestfish-actions.pod:3809
25653 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
25654 "and read the C<Block size> and C<Block count> values. These two numbers, "
25655 "multiplied together, give the resulting size of the minimal filesystem in "
25660 #: ../fish/guestfish-actions.pod:3814
25661 msgid "resize2fs-size"
25665 #: ../fish/guestfish-actions.pod:3816
25668 " resize2fs-size device size\n"
25673 #: ../fish/guestfish-actions.pod:3818
25675 "This command is the same as L</resize2fs> except that it allows you to "
25676 "specify the new size (in bytes) explicitly."
25680 #: ../fish/guestfish-actions.pod:3821
25685 #: ../fish/guestfish-actions.pod:3823
25693 #: ../fish/guestfish-actions.pod:3827
25698 #: ../fish/guestfish-actions.pod:3829
25706 #: ../fish/guestfish-actions.pod:3835
25711 #: ../fish/guestfish-actions.pod:3837
25719 #: ../fish/guestfish-actions.pod:3841
25720 msgid "rmmountpoint"
25724 #: ../fish/guestfish-actions.pod:3843
25727 " rmmountpoint exemptpath\n"
25732 #: ../fish/guestfish-actions.pod:3845
25734 "This calls removes a mountpoint that was previously created with "
25735 "L</mkmountpoint>. See L</mkmountpoint> for full details."
25739 #: ../fish/guestfish-actions.pod:3849
25740 msgid "scrub-device"
25744 #: ../fish/guestfish-actions.pod:3851
25747 " scrub-device device\n"
25752 #: ../fish/guestfish-actions.pod:3862
25757 #: ../fish/guestfish-actions.pod:3864
25760 " scrub-file file\n"
25765 #: ../fish/guestfish-actions.pod:3874
25766 msgid "scrub-freespace"
25770 #: ../fish/guestfish-actions.pod:3876
25773 " scrub-freespace dir\n"
25778 #: ../fish/guestfish-actions.pod:3878
25780 "This command creates the directory C<dir> and then fills it with files until "
25781 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
25782 "deletes them. The intention is to scrub any free space on the partition "
25783 "containing C<dir>."
25787 #: ../fish/guestfish-actions.pod:3887
25792 #: ../fish/guestfish-actions.pod:3889
25797 #: ../fish/guestfish-actions.pod:3891
25800 " set-append append\n"
25805 #: ../fish/guestfish-actions.pod:3902
25806 msgid "set-attach-method"
25810 #: ../fish/guestfish-actions.pod:3904
25811 msgid "attach-method"
25815 #: ../fish/guestfish-actions.pod:3906
25818 " set-attach-method attachmethod\n"
25823 #: ../fish/guestfish-actions.pod:3928
25824 msgid "set-autosync"
25828 #: ../fish/guestfish-actions.pod:3930
25833 #: ../fish/guestfish-actions.pod:3932
25836 " set-autosync true|false\n"
25841 #: ../fish/guestfish-actions.pod:3942
25846 #: ../fish/guestfish-actions.pod:3944
25851 #: ../fish/guestfish-actions.pod:3946
25854 " set-direct true|false\n"
25859 #: ../fish/guestfish-actions.pod:3952
25861 "One consequence of this is that log messages aren't caught by the library "
25862 "and handled by L</set-log-message-callback>, but go straight to stdout."
25866 #: ../fish/guestfish-actions.pod:3961
25867 msgid "set-e2label"
25871 #: ../fish/guestfish-actions.pod:3963
25874 " set-e2label device label\n"
25879 #: ../fish/guestfish-actions.pod:3969
25881 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
25882 "label on a filesystem."
25886 #: ../fish/guestfish-actions.pod:3972
25891 #: ../fish/guestfish-actions.pod:3974
25894 " set-e2uuid device uuid\n"
25899 #: ../fish/guestfish-actions.pod:3981
25901 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
25902 "UUID of a filesystem."
25906 #: ../fish/guestfish-actions.pod:3984
25907 msgid "set-memsize"
25911 #: ../fish/guestfish-actions.pod:3986
25916 #: ../fish/guestfish-actions.pod:3988
25919 " set-memsize memsize\n"
25924 #: ../fish/guestfish-actions.pod:3990
25926 "This sets the memory size in megabytes allocated to the qemu subprocess. "
25927 "This only has any effect if called before L</launch>."
25931 #: ../fish/guestfish-actions.pod:4001
25932 msgid "set-network"
25936 #: ../fish/guestfish-actions.pod:4003
25941 #: ../fish/guestfish-actions.pod:4005
25944 " set-network true|false\n"
25949 #: ../fish/guestfish-actions.pod:4013
25950 msgid "You must call this before calling L</launch>, otherwise it has no effect."
25954 #: ../fish/guestfish-actions.pod:4016
25959 #: ../fish/guestfish-actions.pod:4018
25964 #: ../fish/guestfish-actions.pod:4020
25967 " set-path searchpath\n"
25972 #: ../fish/guestfish-actions.pod:4029
25977 #: ../fish/guestfish-actions.pod:4031
25982 #: ../fish/guestfish-actions.pod:4033
25990 #: ../fish/guestfish-actions.pod:4053
25991 msgid "set-recovery-proc"
25995 #: ../fish/guestfish-actions.pod:4055
25996 msgid "recovery-proc"
26000 #: ../fish/guestfish-actions.pod:4057
26003 " set-recovery-proc true|false\n"
26008 #: ../fish/guestfish-actions.pod:4059
26010 "If this is called with the parameter C<false> then L</launch> does not "
26011 "create a recovery process. The purpose of the recovery process is to stop "
26012 "runaway qemu processes in the case where the main program aborts abruptly."
26016 #: ../fish/guestfish-actions.pod:4064
26018 "This only has any effect if called before L</launch>, and the default is "
26023 #: ../fish/guestfish-actions.pod:4073
26024 msgid "set-selinux"
26028 #: ../fish/guestfish-actions.pod:4075
26033 #: ../fish/guestfish-actions.pod:4077
26036 " set-selinux true|false\n"
26041 #: ../fish/guestfish-actions.pod:4088
26046 #: ../fish/guestfish-actions.pod:4090
26051 #: ../fish/guestfish-actions.pod:4092
26054 " set-trace true|false\n"
26059 #: ../fish/guestfish-actions.pod:4104
26061 "Trace messages are normally sent to C<stderr>, unless you register a "
26062 "callback to send them somewhere else (see L</set-event-callback>)."
26066 #: ../fish/guestfish-actions.pod:4108
26067 msgid "set-verbose"
26071 #: ../fish/guestfish-actions.pod:4110
26076 #: ../fish/guestfish-actions.pod:4112
26079 " set-verbose true|false\n"
26084 #: ../fish/guestfish-actions.pod:4119
26086 "Verbose messages are normally sent to C<stderr>, unless you register a "
26087 "callback to send them somewhere else (see L</set-event-callback>)."
26091 #: ../fish/guestfish-actions.pod:4123
26096 #: ../fish/guestfish-actions.pod:4125
26099 " setcon context\n"
26104 #: ../fish/guestfish-actions.pod:4132
26109 #: ../fish/guestfish-actions.pod:4134
26112 " setxattr xattr val vallen path\n"
26117 #: ../fish/guestfish-actions.pod:4140
26118 msgid "See also: L</lsetxattr>, L<attr(5)>."
26122 #: ../fish/guestfish-actions.pod:4142
26127 #: ../fish/guestfish-actions.pod:4144
26130 " sfdisk device cyls heads sectors 'lines ...'\n"
26135 #: ../fish/guestfish-actions.pod:4166
26136 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
26140 #: ../fish/guestfish-actions.pod:4172
26145 #: ../fish/guestfish-actions.pod:4174
26148 " sfdiskM device 'lines ...'\n"
26153 #: ../fish/guestfish-actions.pod:4176
26155 "This is a simplified interface to the L</sfdisk> command, where partition "
26156 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
26157 "you don't need to specify the cyls, heads and sectors parameters which were "
26158 "rarely if ever used anyway."
26162 #: ../fish/guestfish-actions.pod:4182
26163 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
26167 #: ../fish/guestfish-actions.pod:4188
26172 #: ../fish/guestfish-actions.pod:4190
26175 " sfdisk-N device partnum cyls heads sectors line\n"
26180 #: ../fish/guestfish-actions.pod:4195
26182 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
26183 "cyls/heads/sectors parameters."
26187 #: ../fish/guestfish-actions.pod:4198
26188 msgid "See also: L</part-add>"
26192 #: ../fish/guestfish-actions.pod:4203
26193 msgid "sfdisk-disk-geometry"
26197 #: ../fish/guestfish-actions.pod:4205
26200 " sfdisk-disk-geometry device\n"
26205 #: ../fish/guestfish-actions.pod:4207
26207 "This displays the disk geometry of C<device> read from the partition table. "
26208 "Especially in the case where the underlying block device has been resized, "
26209 "this can be different from the kernel's idea of the geometry (see "
26210 "L</sfdisk-kernel-geometry>)."
26214 #: ../fish/guestfish-actions.pod:4215
26215 msgid "sfdisk-kernel-geometry"
26219 #: ../fish/guestfish-actions.pod:4217
26222 " sfdisk-kernel-geometry device\n"
26227 #: ../fish/guestfish-actions.pod:4224
26232 #: ../fish/guestfish-actions.pod:4226
26235 " sfdisk-l device\n"
26240 #: ../fish/guestfish-actions.pod:4232
26241 msgid "See also: L</part-list>"
26245 #: ../fish/guestfish-actions.pod:4234
26250 #: ../fish/guestfish-actions.pod:4236
26258 #: ../fish/guestfish-actions.pod:4241
26259 msgid "This is like L</command>, but passes the command to:"
26263 #: ../fish/guestfish-actions.pod:4249
26264 msgid "All the provisos about L</command> apply to this call."
26268 #: ../fish/guestfish-actions.pod:4251
26273 #: ../fish/guestfish-actions.pod:4253
26276 " sh-lines command\n"
26281 #: ../fish/guestfish-actions.pod:4255
26282 msgid "This is the same as L</sh>, but splits the result into a list of lines."
26286 #: ../fish/guestfish-actions.pod:4258
26287 msgid "See also: L</command-lines>"
26291 #: ../fish/guestfish-actions.pod:4260
26296 #: ../fish/guestfish-actions.pod:4262
26304 #: ../fish/guestfish-actions.pod:4266
26309 #: ../fish/guestfish-actions.pod:4268
26317 #: ../fish/guestfish-actions.pod:4274
26322 #: ../fish/guestfish-actions.pod:4276
26330 #: ../fish/guestfish-actions.pod:4284
26335 #: ../fish/guestfish-actions.pod:4286
26343 #: ../fish/guestfish-actions.pod:4294
26348 #: ../fish/guestfish-actions.pod:4296
26351 " strings-e encoding path\n"
26356 #: ../fish/guestfish-actions.pod:4298
26358 "This is like the L</strings> command, but allows you to specify the encoding "
26359 "of strings that are looked for in the source file C<path>."
26363 #: ../fish/guestfish-actions.pod:4308
26365 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
26366 "ISO-8859-X (this is what L</strings> uses)."
26370 #: ../fish/guestfish-actions.pod:4340
26371 msgid "swapoff-device"
26375 #: ../fish/guestfish-actions.pod:4342
26378 " swapoff-device device\n"
26383 #: ../fish/guestfish-actions.pod:4344
26385 "This command disables the libguestfs appliance swap device or partition "
26386 "named C<device>. See L</swapon-device>."
26390 #: ../fish/guestfish-actions.pod:4348
26391 msgid "swapoff-file"
26395 #: ../fish/guestfish-actions.pod:4350
26398 " swapoff-file file\n"
26403 #: ../fish/guestfish-actions.pod:4354
26404 msgid "swapoff-label"
26408 #: ../fish/guestfish-actions.pod:4356
26411 " swapoff-label label\n"
26416 #: ../fish/guestfish-actions.pod:4361
26417 msgid "swapoff-uuid"
26421 #: ../fish/guestfish-actions.pod:4363
26424 " swapoff-uuid uuid\n"
26429 #: ../fish/guestfish-actions.pod:4368
26430 msgid "swapon-device"
26434 #: ../fish/guestfish-actions.pod:4370
26437 " swapon-device device\n"
26442 #: ../fish/guestfish-actions.pod:4372
26444 "This command enables the libguestfs appliance to use the swap device or "
26445 "partition named C<device>. The increased memory is made available for all "
26446 "commands, for example those run using L</command> or L</sh>."
26450 #: ../fish/guestfish-actions.pod:4384
26451 msgid "swapon-file"
26455 #: ../fish/guestfish-actions.pod:4386
26458 " swapon-file file\n"
26463 #: ../fish/guestfish-actions.pod:4388
26464 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
26468 #: ../fish/guestfish-actions.pod:4391
26469 msgid "swapon-label"
26473 #: ../fish/guestfish-actions.pod:4393
26476 " swapon-label label\n"
26481 #: ../fish/guestfish-actions.pod:4395
26483 "This command enables swap to a labeled swap partition. See "
26484 "L</swapon-device> for other notes."
26488 #: ../fish/guestfish-actions.pod:4398
26489 msgid "swapon-uuid"
26493 #: ../fish/guestfish-actions.pod:4400
26496 " swapon-uuid uuid\n"
26501 #: ../fish/guestfish-actions.pod:4402
26503 "This command enables swap to a swap partition with the given UUID. See "
26504 "L</swapon-device> for other notes."
26508 #: ../fish/guestfish-actions.pod:4405
26513 #: ../fish/guestfish-actions.pod:4407
26521 #: ../fish/guestfish-actions.pod:4415
26526 #: ../fish/guestfish-actions.pod:4417
26534 #: ../fish/guestfish-actions.pod:4425
26539 #: ../fish/guestfish-actions.pod:4427
26542 " tail-n nrlines path\n"
26547 #: ../fish/guestfish-actions.pod:4440
26552 #: ../fish/guestfish-actions.pod:4442
26555 " tar-in (tarfile|-) directory\n"
26560 #: ../fish/guestfish-actions.pod:4447
26561 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
26565 #: ../fish/guestfish-actions.pod:4452
26570 #: ../fish/guestfish-actions.pod:4454
26573 " tar-out directory (tarfile|-)\n"
26578 #: ../fish/guestfish-actions.pod:4459
26579 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
26583 #: ../fish/guestfish-actions.pod:4464
26588 #: ../fish/guestfish-actions.pod:4466
26591 " tgz-in (tarball|-) directory\n"
26596 #: ../fish/guestfish-actions.pod:4471
26597 msgid "To upload an uncompressed tarball, use L</tar-in>."
26601 #: ../fish/guestfish-actions.pod:4475
26606 #: ../fish/guestfish-actions.pod:4477
26609 " tgz-out directory (tarball|-)\n"
26614 #: ../fish/guestfish-actions.pod:4482
26615 msgid "To download an uncompressed tarball, use L</tar-out>."
26619 #: ../fish/guestfish-actions.pod:4486
26624 #: ../fish/guestfish-actions.pod:4488
26632 #: ../fish/guestfish-actions.pod:4497
26637 #: ../fish/guestfish-actions.pod:4499
26645 #: ../fish/guestfish-actions.pod:4504
26646 msgid "truncate-size"
26650 #: ../fish/guestfish-actions.pod:4506
26653 " truncate-size path size\n"
26658 #: ../fish/guestfish-actions.pod:4511
26660 "If the current file size is less than C<size> then the file is extended to "
26661 "the required size with zero bytes. This creates a sparse file (ie. disk "
26662 "blocks are not allocated for the file until you write to it). To create a "
26663 "non-sparse file of zeroes, use L</fallocate64> instead."
26667 #: ../fish/guestfish-actions.pod:4517
26672 #: ../fish/guestfish-actions.pod:4519
26675 " tune2fs-l device\n"
26680 #: ../fish/guestfish-actions.pod:4529
26685 #: ../fish/guestfish-actions.pod:4531
26688 " txz-in (tarball|-) directory\n"
26693 #: ../fish/guestfish-actions.pod:4538
26698 #: ../fish/guestfish-actions.pod:4540
26701 " txz-out directory (tarball|-)\n"
26706 #: ../fish/guestfish-actions.pod:4547
26711 #: ../fish/guestfish-actions.pod:4549
26719 #: ../fish/guestfish-actions.pod:4563
26720 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
26724 #: ../fish/guestfish-actions.pod:4568
26729 #: ../fish/guestfish-actions.pod:4570
26734 #: ../fish/guestfish-actions.pod:4572
26737 " umount pathordevice\n"
26742 #: ../fish/guestfish-actions.pod:4578
26747 #: ../fish/guestfish-actions.pod:4580
26748 msgid "unmount-all"
26752 #: ../fish/guestfish-actions.pod:4582
26760 #: ../fish/guestfish-actions.pod:4588
26765 #: ../fish/guestfish-actions.pod:4590
26768 " upload (filename|-) remotefilename\n"
26773 #: ../fish/guestfish-actions.pod:4597
26774 msgid "See also L</download>."
26778 #: ../fish/guestfish-actions.pod:4601
26779 msgid "upload-offset"
26783 #: ../fish/guestfish-actions.pod:4603
26786 " upload-offset (filename|-) remotefilename offset\n"
26791 #: ../fish/guestfish-actions.pod:4615
26793 "Note that there is no limit on the amount of data that can be uploaded with "
26794 "this call, unlike with L</pwrite>, and this call always writes the full "
26795 "amount unless an error occurs."
26799 #: ../fish/guestfish-actions.pod:4620
26800 msgid "See also L</upload>, L</pwrite>."
26804 #: ../fish/guestfish-actions.pod:4624
26809 #: ../fish/guestfish-actions.pod:4626
26812 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
26817 #: ../fish/guestfish-actions.pod:4645
26822 #: ../fish/guestfish-actions.pod:4647
26830 #: ../fish/guestfish-actions.pod:4674
26832 "I<Note:> Don't use this call to test for availability of features. In "
26833 "enterprise distributions we backport features from later versions into "
26834 "earlier versions, making this an unreliable way to test for features. Use "
26835 "L</available> instead."
26839 #: ../fish/guestfish-actions.pod:4680
26844 #: ../fish/guestfish-actions.pod:4682
26847 " vfs-label device\n"
26852 #: ../fish/guestfish-actions.pod:4689
26853 msgid "To find a filesystem from the label, use L</findfs-label>."
26857 #: ../fish/guestfish-actions.pod:4691
26862 #: ../fish/guestfish-actions.pod:4693
26865 " vfs-type device\n"
26870 #: ../fish/guestfish-actions.pod:4703
26875 #: ../fish/guestfish-actions.pod:4705
26878 " vfs-uuid device\n"
26883 #: ../fish/guestfish-actions.pod:4712
26884 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
26888 #: ../fish/guestfish-actions.pod:4714
26889 msgid "vg-activate"
26893 #: ../fish/guestfish-actions.pod:4716
26896 " vg-activate true|false 'volgroups ...'\n"
26901 #: ../fish/guestfish-actions.pod:4729
26902 msgid "vg-activate-all"
26906 #: ../fish/guestfish-actions.pod:4731
26909 " vg-activate-all true|false\n"
26914 #: ../fish/guestfish-actions.pod:4741
26919 #: ../fish/guestfish-actions.pod:4743
26922 " vgcreate volgroup 'physvols ...'\n"
26927 #: ../fish/guestfish-actions.pod:4748
26932 #: ../fish/guestfish-actions.pod:4750
26935 " vglvuuids vgname\n"
26940 #: ../fish/guestfish-actions.pod:4755
26942 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
26943 "logical volumes and volume groups."
26947 #: ../fish/guestfish-actions.pod:4758
26948 msgid "See also L</vgpvuuids>."
26952 #: ../fish/guestfish-actions.pod:4760
26957 #: ../fish/guestfish-actions.pod:4762
26960 " vgpvuuids vgname\n"
26965 #: ../fish/guestfish-actions.pod:4767
26967 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
26968 "physical volumes and volume groups."
26972 #: ../fish/guestfish-actions.pod:4770
26973 msgid "See also L</vglvuuids>."
26977 #: ../fish/guestfish-actions.pod:4772
26982 #: ../fish/guestfish-actions.pod:4774
26985 " vgremove vgname\n"
26990 #: ../fish/guestfish-actions.pod:4781
26995 #: ../fish/guestfish-actions.pod:4783
26998 " vgrename volgroup newvolgroup\n"
27003 #: ../fish/guestfish-actions.pod:4787
27008 #: ../fish/guestfish-actions.pod:4789
27016 #: ../fish/guestfish-actions.pod:4797
27017 msgid "See also L</vgs-full>."
27021 #: ../fish/guestfish-actions.pod:4799
27026 #: ../fish/guestfish-actions.pod:4801
27034 #: ../fish/guestfish-actions.pod:4806
27039 #: ../fish/guestfish-actions.pod:4808
27047 #: ../fish/guestfish-actions.pod:4813
27052 #: ../fish/guestfish-actions.pod:4815
27060 #: ../fish/guestfish-actions.pod:4819
27065 #: ../fish/guestfish-actions.pod:4821
27073 #: ../fish/guestfish-actions.pod:4826
27078 #: ../fish/guestfish-actions.pod:4828
27086 #: ../fish/guestfish-actions.pod:4833
27091 #: ../fish/guestfish-actions.pod:4835
27099 #: ../fish/guestfish-actions.pod:4840
27104 #: ../fish/guestfish-actions.pod:4842
27107 " write path content\n"
27112 #: ../fish/guestfish-actions.pod:4850
27117 #: ../fish/guestfish-actions.pod:4852
27120 " write-file path content size\n"
27125 #: ../fish/guestfish-actions.pod:4875
27130 #: ../fish/guestfish-actions.pod:4877
27133 " zegrep regex path\n"
27138 #: ../fish/guestfish-actions.pod:4885
27143 #: ../fish/guestfish-actions.pod:4887
27146 " zegrepi regex path\n"
27151 #: ../fish/guestfish-actions.pod:4895
27156 #: ../fish/guestfish-actions.pod:4897
27164 #: ../fish/guestfish-actions.pod:4905
27165 msgid "See also: L</zero-device>, L</scrub-device>."
27169 #: ../fish/guestfish-actions.pod:4907
27170 msgid "zero-device"
27174 #: ../fish/guestfish-actions.pod:4909
27177 " zero-device device\n"
27182 #: ../fish/guestfish-actions.pod:4911
27184 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
27185 "which just zeroes the first few blocks of a device."
27189 #: ../fish/guestfish-actions.pod:4918
27194 #: ../fish/guestfish-actions.pod:4920
27197 " zerofree device\n"
27202 #: ../fish/guestfish-actions.pod:4933
27207 #: ../fish/guestfish-actions.pod:4935
27210 " zfgrep pattern path\n"
27215 #: ../fish/guestfish-actions.pod:4943
27220 #: ../fish/guestfish-actions.pod:4945
27223 " zfgrepi pattern path\n"
27228 #: ../fish/guestfish-actions.pod:4953
27233 #: ../fish/guestfish-actions.pod:4955
27236 " zfile meth path\n"
27241 #: ../fish/guestfish-actions.pod:4962
27242 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
27246 #: ../fish/guestfish-actions.pod:4972
27251 #: ../fish/guestfish-actions.pod:4974
27254 " zgrep regex path\n"
27259 #: ../fish/guestfish-actions.pod:4982
27264 #: ../fish/guestfish-actions.pod:4984
27267 " zgrepi regex path\n"
27272 #: ../fish/guestfish-commands.pod:1
27277 #: ../fish/guestfish-commands.pod:3
27282 #: ../fish/guestfish-commands.pod:5
27285 " alloc filename size\n"
27290 #: ../fish/guestfish-commands.pod:7
27292 "This creates an empty (zeroed) file of the given size, and then adds so it "
27293 "can be further examined."
27297 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
27298 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
27302 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
27303 msgid "Size can be specified using standard suffixes, eg. C<1M>."
27307 #: ../fish/guestfish-commands.pod:14
27309 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
27310 "image, see L</PREPARED DISK IMAGES>."
27314 #: ../fish/guestfish-commands.pod:17
27319 #: ../fish/guestfish-commands.pod:19
27322 " copy-in local [local ...] /remotedir\n"
27327 #: ../fish/guestfish-commands.pod:21
27329 "C<copy-in> copies local files or directories recursively into the disk "
27330 "image, placing them in the directory called C</remotedir> (which must "
27331 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
27332 "other commands as necessary."
27336 #: ../fish/guestfish-commands.pod:26
27338 "Multiple local files and directories can be specified, but the last "
27339 "parameter must always be a remote directory. Wildcards cannot be used."
27343 #: ../fish/guestfish-commands.pod:30
27348 #: ../fish/guestfish-commands.pod:32
27351 " copy-out remote [remote ...] localdir\n"
27356 #: ../fish/guestfish-commands.pod:34
27358 "C<copy-out> copies remote files or directories recursively out of the disk "
27359 "image, placing them on the host disk in a local directory called C<localdir> "
27360 "(which must exist). This guestfish meta-command turns into a sequence of "
27361 "L</download>, L</tar-out> and other commands as necessary."
27365 #: ../fish/guestfish-commands.pod:40
27367 "Multiple remote files and directories can be specified, but the last "
27368 "parameter must always be a local directory. To download to the current "
27369 "directory, use C<.> as in:"
27373 #: ../fish/guestfish-commands.pod:44
27376 " copy-out /home .\n"
27381 #: ../fish/guestfish-commands.pod:46
27383 "Wildcards cannot be used in the ordinary command, but you can use them with "
27384 "the help of L</glob> like this:"
27388 #: ../fish/guestfish-commands.pod:49
27391 " glob copy-out /home/* .\n"
27396 #: ../fish/guestfish-commands.pod:51
27401 #: ../fish/guestfish-commands.pod:53
27404 " echo [params ...]\n"
27409 #: ../fish/guestfish-commands.pod:55
27410 msgid "This echos the parameters to the terminal."
27414 #: ../fish/guestfish-commands.pod:57
27419 #: ../fish/guestfish-commands.pod:59
27424 #: ../fish/guestfish-commands.pod:61
27429 #: ../fish/guestfish-commands.pod:63
27437 #: ../fish/guestfish-commands.pod:65
27439 "This is used to edit a file. It downloads the file, edits it locally using "
27440 "your editor, then uploads the result."
27444 #: ../fish/guestfish-commands.pod:68
27446 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
27447 "or C<emacs> you will get those corresponding editors."
27451 #: ../fish/guestfish-commands.pod:72
27456 #: ../fish/guestfish-commands.pod:74
27459 " glob command args...\n"
27464 #: ../fish/guestfish-commands.pod:76
27466 "Expand wildcards in any paths in the args list, and run C<command> "
27467 "repeatedly on each matching path."
27471 #: ../fish/guestfish-commands.pod:79
27472 msgid "See L</WILDCARDS AND GLOBBING>."
27476 #: ../fish/guestfish-commands.pod:81
27481 #: ../fish/guestfish-commands.pod:83
27484 " hexedit <filename|device>\n"
27485 " hexedit <filename|device> <max>\n"
27486 " hexedit <filename|device> <start> <max>\n"
27491 #: ../fish/guestfish-commands.pod:87
27493 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
27498 #: ../fish/guestfish-commands.pod:90
27500 "This command works by downloading potentially the whole file or device, "
27501 "editing it locally, then uploading it. If the file or device is large, you "
27502 "have to specify which part you wish to edit by using C<max> and/or C<start> "
27503 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
27504 "usual modifiers allowed such as C<1M> (1 megabyte)."
27508 #: ../fish/guestfish-commands.pod:97
27509 msgid "For example to edit the first few sectors of a disk you might do:"
27513 #: ../fish/guestfish-commands.pod:100
27516 " hexedit /dev/sda 1M\n"
27521 #: ../fish/guestfish-commands.pod:102
27523 "which would allow you to edit anywhere within the first megabyte of the "
27528 #: ../fish/guestfish-commands.pod:105
27529 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
27533 #: ../fish/guestfish-commands.pod:107
27536 " hexedit /dev/sda1 0x400 0x400\n"
27541 #: ../fish/guestfish-commands.pod:109
27542 msgid "(assuming the superblock is in the standard location)."
27546 #: ../fish/guestfish-commands.pod:111
27548 "This command requires the external L<hexedit(1)> program. You can specify "
27549 "another program to use by setting the C<HEXEDITOR> environment variable."
27553 #: ../fish/guestfish-commands.pod:115
27554 msgid "See also L</hexdump>."
27558 #: ../fish/guestfish-commands.pod:117
27563 #: ../fish/guestfish-commands.pod:119
27571 #: ../fish/guestfish-commands.pod:121
27572 msgid "Change the local directory, ie. the current directory of guestfish itself."
27576 #: ../fish/guestfish-commands.pod:124
27577 msgid "Note that C<!cd> won't do what you might expect."
27581 #: ../fish/guestfish-commands.pod:126
27586 #: ../fish/guestfish-commands.pod:128
27591 #: ../fish/guestfish-commands.pod:130
27599 #: ../fish/guestfish-commands.pod:132
27600 msgid "Opens the manual page for guestfish."
27604 #: ../fish/guestfish-commands.pod:134
27609 #: ../fish/guestfish-commands.pod:136
27614 #: ../fish/guestfish-commands.pod:138
27622 #: ../fish/guestfish-commands.pod:140
27630 #: ../fish/guestfish-commands.pod:142
27631 msgid "This is used to view a file."
27635 #: ../fish/guestfish-commands.pod:144
27637 "The default viewer is C<$PAGER>. However if you use the alternate command "
27638 "C<less> you will get the C<less> command specifically."
27642 #: ../fish/guestfish-commands.pod:147
27647 #: ../fish/guestfish-commands.pod:149
27655 #: ../fish/guestfish-commands.pod:151
27657 "Close and reopen the libguestfs handle. It is not necessary to use this "
27658 "normally, because the handle is closed properly when guestfish exits. "
27659 "However this is occasionally useful for testing."
27663 #: ../fish/guestfish-commands.pod:155
27668 #: ../fish/guestfish-commands.pod:157
27671 " sparse filename size\n"
27676 #: ../fish/guestfish-commands.pod:159
27678 "This creates an empty sparse file of the given size, and then adds so it can "
27679 "be further examined."
27683 #: ../fish/guestfish-commands.pod:162
27685 "In all respects it works the same as the L</alloc> command, except that the "
27686 "image file is allocated sparsely, which means that disk blocks are not "
27687 "assigned to the file until they are needed. Sparse disk files only use "
27688 "space when written to, but they are slower and there is a danger you could "
27689 "run out of real disk space during a write operation."
27693 #: ../fish/guestfish-commands.pod:172
27698 #: ../fish/guestfish-commands.pod:174
27706 #: ../fish/guestfish-commands.pod:176
27708 "This command returns a list of the optional groups known to the daemon, and "
27709 "indicates which ones are supported by this build of the libguestfs "
27714 #: ../fish/guestfish-commands.pod:180
27715 msgid "See also L<guestfs(3)/AVAILABILITY>."
27719 #: ../fish/guestfish-commands.pod:182
27724 #: ../fish/guestfish-commands.pod:184
27727 " time command args...\n"
27732 #: ../fish/guestfish-commands.pod:186
27734 "Run the command as usual, but print the elapsed time afterwards. This can "
27735 "be useful for benchmarking operations."
27739 #: ../test-tool/libguestfs-test-tool.pod:5
27740 msgid "libguestfs-test-tool - End user tests for libguestfs"
27744 #: ../test-tool/libguestfs-test-tool.pod:9
27747 " libguestfs-test-tool [--options]\n"
27752 #: ../test-tool/libguestfs-test-tool.pod:13
27754 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
27755 "and developers, to allow them to check basic libguestfs functionality is "
27756 "working. This is needed because libguestfs occasionally breaks for reasons "
27757 "beyond our control: usually because of changes in the underlying qemu or "
27758 "kernel packages, or the host environment."
27762 #: ../test-tool/libguestfs-test-tool.pod:20
27763 msgid "If you suspect a problem in libguestfs, then just run:"
27767 #: ../test-tool/libguestfs-test-tool.pod:22
27770 " libguestfs-test-tool\n"
27775 #: ../test-tool/libguestfs-test-tool.pod:24
27776 msgid "It will print lots of diagnostic messages."
27780 #: ../test-tool/libguestfs-test-tool.pod:26
27781 msgid "If it runs to completion successfully, you will see this near the end:"
27785 #: ../test-tool/libguestfs-test-tool.pod:28
27788 " ===== TEST FINISHED OK =====\n"
27793 #: ../test-tool/libguestfs-test-tool.pod:30
27794 msgid "and the test tool will exit with code 0."
27798 #: ../test-tool/libguestfs-test-tool.pod:32
27800 "If it fails (and/or exits with non-zero error code), please paste the "
27801 "B<complete, unedited> output of the test tool into a bug report. More "
27802 "information about reporting bugs can be found on the "
27803 "L<http://libguestfs.org/> website."
27807 #: ../test-tool/libguestfs-test-tool.pod:41
27812 #: ../test-tool/libguestfs-test-tool.pod:43
27813 msgid "Display short usage information and exit."
27817 #: ../test-tool/libguestfs-test-tool.pod:45
27818 msgid "I<--qemu qemu_binary>"
27822 #: ../test-tool/libguestfs-test-tool.pod:47
27824 "If you have downloaded another qemu binary, point this option at the full "
27825 "path of the binary to try it."
27829 #: ../test-tool/libguestfs-test-tool.pod:50
27830 msgid "I<--qemudir qemu_source_dir>"
27834 #: ../test-tool/libguestfs-test-tool.pod:52
27836 "If you have compiled qemu from source, point this option at the source "
27837 "directory to try it."
27841 #: ../test-tool/libguestfs-test-tool.pod:55
27842 msgid "I<--timeout N>"
27846 #: ../test-tool/libguestfs-test-tool.pod:57
27848 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
27849 "does not usually need to be adjusted unless your machine is very slow."
27853 #: ../test-tool/libguestfs-test-tool.pod:63
27854 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
27858 #: ../test-tool/libguestfs-test-tool.pod:65
27860 "If you have compiled another version of qemu from source and would like to "
27861 "try that, then you can use the I<--qemudir> option to point to the qemu "
27862 "source directory."
27866 #: ../test-tool/libguestfs-test-tool.pod:69
27868 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
27869 "option to point to the binary."
27873 #: ../test-tool/libguestfs-test-tool.pod:72
27875 "When using an alternate qemu with libguestfs, usually you would need to "
27876 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
27877 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
27878 "when you use either of the I<--qemudir> or I<--qemu> options."
27882 #: ../test-tool/libguestfs-test-tool.pod:79
27884 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
27885 "I<1> if there was an error."
27889 #: ../test-tool/libguestfs-test-tool.pod:84
27891 "For the full list of environment variables which may affect libguestfs, "
27892 "please see the L<guestfs(3)> manual page."
27896 #: ../test-tool/libguestfs-test-tool.pod:89
27897 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
27901 #: ../fuse/guestmount.pod:5
27902 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
27906 #: ../fuse/guestmount.pod:9
27909 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
27914 #: ../fuse/guestmount.pod:11
27917 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
27922 #: ../fuse/guestmount.pod:13
27925 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
27930 #: ../fuse/guestmount.pod:17
27932 "You must I<not> use C<guestmount> in read-write mode on live virtual "
27933 "machines. If you do this, you risk disk corruption in the VM."
27937 #: ../fuse/guestmount.pod:22
27939 "The guestmount program can be used to mount virtual machine filesystems and "
27940 "other disk images on the host. It uses libguestfs for access to the guest "
27941 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
27942 "a mountable device."
27946 #: ../fuse/guestmount.pod:27
27948 "Along with other options, you have to give at least one device (I<-a> "
27949 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
27950 "option) or use the I<-i> inspection option. How this works is better "
27951 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
27956 #: ../fuse/guestmount.pod:33
27958 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
27959 "by you, and the filesystem will not be visible to any other users unless you "
27960 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
27961 "the filesystem, use the C<fusermount -u> command."
27965 #: ../fuse/guestmount.pod:41
27967 "For a typical Windows guest which has its main filesystem on the first "
27972 #: ../fuse/guestmount.pod:44
27975 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
27980 #: ../fuse/guestmount.pod:46
27982 "For a typical Linux guest which has a /boot filesystem on the first "
27983 "partition, and the root filesystem on a logical volume:"
27987 #: ../fuse/guestmount.pod:49
27990 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
27995 #: ../fuse/guestmount.pod:51
27996 msgid "To get libguestfs to detect guest mountpoints for you:"
28000 #: ../fuse/guestmount.pod:53
28003 " guestmount -a guest.img -i --ro /mnt\n"
28008 #: ../fuse/guestmount.pod:55
28009 msgid "For a libvirt guest called \"Guest\" you could do:"
28013 #: ../fuse/guestmount.pod:57
28016 " guestmount -d Guest -i --ro /mnt\n"
28021 #: ../fuse/guestmount.pod:59
28023 "If you don't know what filesystems are contained in a guest or disk image, "
28024 "use L<virt-filesystems(1)> first:"
28028 #: ../fuse/guestmount.pod:62
28031 " virt-filesystems MyGuest\n"
28036 #: ../fuse/guestmount.pod:64
28038 "If you want to trace the libguestfs calls but without excessive debugging "
28039 "information, we recommend:"
28043 #: ../fuse/guestmount.pod:67
28046 " guestmount [...] --trace /mnt\n"
28051 #: ../fuse/guestmount.pod:69
28052 msgid "If you want to debug the program, we recommend:"
28056 #: ../fuse/guestmount.pod:71
28059 " guestmount [...] --trace --verbose /mnt\n"
28064 #: ../fuse/guestmount.pod:77
28065 msgid "B<-a image> | B<--add image>"
28069 #: ../fuse/guestmount.pod:79
28070 msgid "Add a block device or virtual machine image."
28074 #: ../fuse/guestmount.pod:84
28075 msgid "B<-c URI> | B<--connect URI>"
28079 #: ../fuse/guestmount.pod:90
28080 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
28084 #: ../fuse/guestmount.pod:98
28085 msgid "B<--dir-cache-timeout N>"
28089 #: ../fuse/guestmount.pod:100
28091 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
28092 "seconds. The readdir cache [actually, there are several semi-independent "
28093 "caches] is populated after a readdir(2) call with the stat and extended "
28094 "attributes of the files in the directory, in anticipation that they will be "
28095 "requested soon after."
28099 #: ../fuse/guestmount.pod:106
28101 "There is also a different attribute cache implemented by FUSE (see the FUSE "
28102 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
28103 "requests, only cache existing ones."
28107 #: ../fuse/guestmount.pod:117
28108 msgid "B<--format=raw|qcow2|..> | B<--format>"
28112 #: ../fuse/guestmount.pod:124
28114 "If you have untrusted raw-format guest disk images, you should use this "
28115 "option to specify the disk format. This avoids a possible security problem "
28116 "with malicious guests (CVE-2010-3851). See also "
28117 "L<guestfs(3)/guestfs_add_drive_opts>."
28121 #: ../fuse/guestmount.pod:129
28122 msgid "B<--fuse-help>"
28126 #: ../fuse/guestmount.pod:131
28127 msgid "Display help on special FUSE options (see I<-o> below)."
28131 #: ../fuse/guestmount.pod:135
28132 msgid "Display brief help and exit."
28136 #: ../fuse/guestmount.pod:137
28137 msgid "B<-i> | B<--inspector>"
28141 #: ../fuse/guestmount.pod:157
28143 "Mount the named partition or logical volume on the given mountpoint B<in the "
28144 "guest> (this has nothing to do with mountpoints in the host)."
28148 #: ../fuse/guestmount.pod:160
28150 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
28151 "something on C</>."
28155 #: ../fuse/guestmount.pod:173
28156 msgid "B<-n> | B<--no-sync>"
28160 #: ../fuse/guestmount.pod:175
28162 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
28163 "unmounted. If you specify this option, then we don't attempt to sync the "
28164 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
28168 #: ../fuse/guestmount.pod:180
28169 msgid "B<-o option> | B<--option option>"
28173 #: ../fuse/guestmount.pod:182
28174 msgid "Pass extra options to FUSE."
28178 #: ../fuse/guestmount.pod:184
28180 "To get a list of all the extra options supported by FUSE, use the command "
28181 "below. Note that only the FUSE I<-o> options can be passed, and only some "
28182 "of them are a good idea."
28186 #: ../fuse/guestmount.pod:188
28189 " guestmount --fuse-help\n"
28194 #: ../fuse/guestmount.pod:190
28195 msgid "Some potentially useful FUSE options:"
28199 #: ../fuse/guestmount.pod:194
28200 msgid "B<-o allow_other>"
28204 #: ../fuse/guestmount.pod:196
28205 msgid "Allow other users to see the filesystem."
28209 #: ../fuse/guestmount.pod:198
28210 msgid "B<-o attr_timeout=N>"
28214 #: ../fuse/guestmount.pod:200
28215 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
28219 #: ../fuse/guestmount.pod:202
28220 msgid "B<-o kernel_cache>"
28224 #: ../fuse/guestmount.pod:204
28226 "Allow the kernel to cache files (reduces the number of reads that have to go "
28227 "through the L<guestfs(3)> API). This is generally a good idea if you can "
28228 "afford the extra memory usage."
28232 #: ../fuse/guestmount.pod:208
28233 msgid "B<-o uid=N> B<-o gid=N>"
28237 #: ../fuse/guestmount.pod:210
28239 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
28240 "the chosen values."
28244 #: ../fuse/guestmount.pod:215
28245 msgid "B<-r> | B<--ro>"
28249 #: ../fuse/guestmount.pod:217
28251 "Add devices and mount everything read-only. Also disallow writes and make "
28252 "the disk appear read-only to FUSE."
28256 #: ../fuse/guestmount.pod:220
28258 "This is highly recommended if you are not going to edit the guest disk. If "
28259 "the guest is running and this option is I<not> supplied, then there is a "
28260 "strong risk of disk corruption in the guest. We try to prevent this from "
28261 "happening, but it is not always possible."
28265 #: ../fuse/guestmount.pod:225
28266 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
28270 #: ../fuse/guestmount.pod:229
28271 msgid "Enable SELinux support for the guest."
28275 #: ../fuse/guestmount.pod:231
28276 msgid "B<-v> | B<--verbose>"
28280 #: ../fuse/guestmount.pod:233
28281 msgid "Enable verbose messages from underlying libguestfs."
28285 #: ../fuse/guestmount.pod:235
28286 msgid "B<-V> | B<--version>"
28290 #: ../fuse/guestmount.pod:237
28291 msgid "Display the program version and exit."
28295 #: ../fuse/guestmount.pod:239
28296 msgid "B<-w> | B<--rw>"
28300 #: ../fuse/guestmount.pod:244 ../fuse/guestmount.pod:265
28301 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
28305 #: ../fuse/guestmount.pod:246
28306 msgid "B<-x> | B<--trace>"
28310 #: ../fuse/guestmount.pod:248
28311 msgid "Trace libguestfs calls and entry into each FUSE function."
28315 #: ../fuse/guestmount.pod:250
28316 msgid "This also stops the daemon from forking into the background."
28320 #: ../fuse/guestmount.pod:271
28322 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
28323 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
28324 "L<http://fuse.sf.net/>."
28328 #: ../fuse/guestmount.pod:286
28329 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
28333 #: ../tools/virt-edit.pl:34
28334 msgid "virt-edit - Edit a file in a virtual machine"
28338 #: ../tools/virt-edit.pl:38
28341 " virt-edit [--options] domname file\n"
28346 #: ../tools/virt-edit.pl:40
28349 " virt-edit [--options] disk.img [disk.img ...] file\n"
28354 #: ../tools/virt-edit.pl:42
28357 " virt-edit [domname|disk.img] file -e 'expr'\n"
28362 #: ../tools/virt-edit.pl:46
28364 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
28365 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
28366 "doing this, but doesn't catch all cases."
28370 #: ../tools/virt-edit.pl:52
28372 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
28373 "the named virtual machine (or disk image)."
28377 #: ../tools/virt-edit.pl:55
28378 msgid "If you want to just view a file, use L<virt-cat(1)>."
28382 #: ../tools/virt-edit.pl:57
28384 "For more complex cases you should look at the L<guestfish(1)> tool (see "
28385 "L</USING GUESTFISH> below)."
28389 #: ../tools/virt-edit.pl:60
28391 "C<virt-edit> cannot be used to create a new file, nor to edit multiple "
28392 "files. L<guestfish(1)> can do that and much more."
28396 #: ../tools/virt-edit.pl:65
28397 msgid "Edit the named files interactively:"
28401 #: ../tools/virt-edit.pl:67
28404 " virt-edit mydomain /boot/grub/grub.conf\n"
28409 #: ../tools/virt-edit.pl:69
28412 " virt-edit mydomain /etc/passwd\n"
28417 #: ../tools/virt-edit.pl:71
28418 msgid "For Windows guests, some Windows paths are understood:"
28422 #: ../tools/virt-edit.pl:73
28425 " virt-edit mywindomain 'c:\\autoexec.bat'\n"
28430 #: ../tools/virt-edit.pl:75
28432 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
28433 "below). To change the init default level to 5:"
28437 #: ../tools/virt-edit.pl:79
28440 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
28445 #: ../tools/virt-edit.pl:91 ../tools/virt-win-reg.pl:106 ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
28446 msgid "Display brief help."
28450 #: ../tools/virt-edit.pl:99 ../tools/virt-win-reg.pl:114 ../tools/virt-list-filesystems.pl:71 ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:72
28451 msgid "Display version number and exit."
28455 #: ../tools/virt-edit.pl:105
28456 msgid "B<--backup extension> | B<-b extension>"
28460 #: ../tools/virt-edit.pl:107
28462 "Create a backup of the original file I<in the guest disk image>. The backup "
28463 "has the original filename with C<extension> added."
28467 #: ../tools/virt-edit.pl:110
28469 "Usually the first character of C<extension> would be a dot C<.> so you would "
28474 #: ../tools/virt-edit.pl:113
28477 " virt-edit -b .orig [etc]\n"
28482 #: ../tools/virt-edit.pl:115
28483 msgid "By default, no backup file is made."
28487 #: ../tools/virt-edit.pl:121 ../tools/virt-win-reg.pl:128 ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127 ../tools/virt-list-partitions.pl:78
28488 msgid "B<--connect URI> | B<-c URI>"
28492 #: ../tools/virt-edit.pl:123 ../tools/virt-win-reg.pl:130 ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129 ../tools/virt-list-partitions.pl:80
28494 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
28495 "to the default libvirt hypervisor."
28499 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:133 ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132 ../tools/virt-list-partitions.pl:83
28501 "If you specify guest block devices directly, then libvirt is not used at "
28506 #: ../tools/virt-edit.pl:133 ../tools/virt-win-reg.pl:140 ../tools/virt-list-filesystems.pl:89 ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
28507 msgid "B<--format> raw"
28511 #: ../tools/virt-edit.pl:135 ../tools/virt-win-reg.pl:142 ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141 ../tools/virt-list-partitions.pl:92
28513 "Specify the format of disk images given on the command line. If this is "
28514 "omitted then the format is autodetected from the content of the disk image."
28518 #: ../tools/virt-edit.pl:139 ../tools/virt-win-reg.pl:146 ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145 ../tools/virt-list-partitions.pl:96
28520 "If disk images are requested from libvirt, then this program asks libvirt "
28521 "for this information. In this case, the value of the format parameter is "
28526 #: ../tools/virt-edit.pl:143 ../tools/virt-win-reg.pl:150 ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149 ../tools/virt-list-partitions.pl:100
28528 "If working with untrusted raw-format guest disk images, you should ensure "
28529 "the format is always specified."
28533 #: ../tools/virt-edit.pl:150
28534 msgid "B<--expr EXPR> | B<-e EXPR>"
28538 #: ../tools/virt-edit.pl:152
28540 "Instead of launching the external editor, non-interactively apply the Perl "
28541 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
28546 #: ../tools/virt-edit.pl:156
28548 "Be careful to properly quote the expression to prevent it from being altered "
28553 #: ../tools/virt-edit.pl:280
28554 msgid "NON-INTERACTIVE EDITING"
28558 #: ../tools/virt-edit.pl:282
28560 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
28561 "administrator can interactively edit the file."
28565 #: ../tools/virt-edit.pl:285
28567 "There are two ways also to use C<virt-edit> from scripts in order to make "
28568 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
28569 "like this, it's less error-prone to write scripts directly using the "
28570 "libguestfs API and Augeas for configuration file editing.)"
28574 #: ../tools/virt-edit.pl:291
28576 "The first method is to temporarily set C<$EDITOR> to any script or program "
28577 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
28578 "update C<tmpfile> in place however it likes."
28582 #: ../tools/virt-edit.pl:295
28584 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
28585 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
28586 "instances of C<foo> with C<bar> in a file:"
28590 #: ../tools/virt-edit.pl:299
28593 " virt-edit domname filename -e 's/foo/bar/'\n"
28598 #: ../tools/virt-edit.pl:301
28600 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
28601 "For example to delete root's password you could do:"
28605 #: ../tools/virt-edit.pl:304
28608 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
28613 #: ../tools/virt-edit.pl:306
28615 "What really happens is that the snippet is evaluated as a Perl expression "
28616 "for each line of the file. The line, including the final C<\\n>, is passed "
28617 "in C<$_> and the expression should update C<$_> or leave it unchanged."
28621 #: ../tools/virt-edit.pl:311
28623 "To delete a line, set C<$_> to the empty string. For example, to delete the "
28624 "C<apache> user account from the password file you can do:"
28628 #: ../tools/virt-edit.pl:314
28631 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
28636 #: ../tools/virt-edit.pl:316
28638 "To insert a line, prepend or append it to C<$_>. However appending lines to "
28639 "the end of the file is rather difficult this way since there is no concept "
28640 "of \"last line of the file\" - your expression just doesn't get called "
28641 "again. You might want to use the first method (setting C<$EDITOR>) if you "
28646 #: ../tools/virt-edit.pl:322
28648 "The variable C<$lineno> contains the current line number. As is "
28649 "traditional, the first line in the file is number C<1>."
28653 #: ../tools/virt-edit.pl:325
28655 "The return value from the expression is ignored, but the expression may call "
28656 "C<die> in order to abort the whole program, leaving the original file "
28661 #: ../tools/virt-edit.pl:329
28663 "Remember when matching the end of a line that C<$_> may contain the final "
28664 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
28665 "newline then neither of these. Thus to match or substitute some text at the "
28666 "end of a line, use this regular expression:"
28670 #: ../tools/virt-edit.pl:334
28673 " /some text(\\r?\\n)?$/\n"
28678 #: ../tools/virt-edit.pl:336
28680 "Alternately, use the perl C<chomp> function, being careful not to chomp "
28681 "C<$_> itself (since that would remove all newlines from the file):"
28685 #: ../tools/virt-edit.pl:340
28688 " my $m = $_; chomp $m; $m =~ /some text$/\n"
28693 #: ../tools/virt-edit.pl:344
28695 "C<virt-edit> has a limited ability to understand Windows drive letters and "
28696 "paths (eg. C<E:\\foo\\bar.txt>)."
28700 #: ../tools/virt-edit.pl:347
28701 msgid "If and only if the guest is running Windows then:"
28705 #: ../tools/virt-edit.pl:353
28707 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
28708 "to the correct filesystem."
28712 #: ../tools/virt-edit.pl:358
28714 "Any backslash (C<\\>) characters in the path are replaced with forward "
28715 "slashes so that libguestfs can process it."
28719 #: ../tools/virt-edit.pl:363
28721 "The path is resolved case insensitively to locate the file that should be "
28726 #: ../tools/virt-edit.pl:368
28727 msgid "There are some known shortcomings:"
28731 #: ../tools/virt-edit.pl:374
28732 msgid "Some NTFS symbolic links may not be followed correctly."
28736 #: ../tools/virt-edit.pl:378
28737 msgid "NTFS junction points that cross filesystems are not followed."
28741 #: ../tools/virt-edit.pl:435
28742 msgid "USING GUESTFISH"
28746 #: ../tools/virt-edit.pl:437
28748 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
28749 "C<virt-edit> doesn't work."
28753 #: ../tools/virt-edit.pl:440
28754 msgid "Using C<virt-edit> is approximately equivalent to doing:"
28758 #: ../tools/virt-edit.pl:442
28761 " guestfish --rw -i -d domname edit /file\n"
28766 #: ../tools/virt-edit.pl:444
28768 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
28769 "path to the file."
28773 #: ../tools/virt-edit.pl:447
28775 "The command above uses libguestfs's guest inspection feature and so does not "
28776 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
28777 "disk images that don't contain guests. To edit a file on a disk image "
28782 #: ../tools/virt-edit.pl:452
28785 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
28790 #: ../tools/virt-edit.pl:454
28792 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
28793 "the disk image to edit, and C</file> is the full path to the file."
28797 #: ../tools/virt-edit.pl:458
28799 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
28800 "C<write> or C<upload> instead:"
28804 #: ../tools/virt-edit.pl:461
28807 " guestfish --rw -i -d domname touch /newfile\n"
28812 #: ../tools/virt-edit.pl:463
28815 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
28820 #: ../tools/virt-edit.pl:465
28823 " guestfish --rw -i -d domname upload localfile /newfile\n"
28828 #: ../tools/virt-edit.pl:467
28829 msgid "C<virt-edit> cannot edit multiple files, but guestfish can do it like this:"
28833 #: ../tools/virt-edit.pl:470
28836 " guestfish --rw -i -d domname edit /file1 : edit /file2\n"
28841 #: ../tools/virt-edit.pl:480
28846 #: ../tools/virt-edit.pl:482
28848 "If set, this string is used as the editor. It may contain arguments, "
28849 "eg. C<\"emacs -nw\">"
28853 #: ../tools/virt-edit.pl:485
28854 msgid "If not set, C<vi> is used."
28858 #: ../tools/virt-edit.pl:489 ../tools/virt-win-reg.pl:559 ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:532 ../tools/virt-list-partitions.pl:250
28859 msgid "SHELL QUOTING"
28863 #: ../tools/virt-edit.pl:491 ../tools/virt-win-reg.pl:567 ../tools/virt-list-filesystems.pl:184 ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:252
28865 "Libvirt guest names can contain arbitrary characters, some of which have "
28866 "meaning to the shell such as C<#> and space. You may need to quote or "
28867 "escape these characters on the command line. See the shell manual page "
28868 "L<sh(1)> for details."
28872 #: ../tools/virt-edit.pl:498
28874 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
28875 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
28876 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
28880 #: ../tools/virt-edit.pl:510 ../tools/virt-win-reg.pl:598 ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:564 ../tools/virt-list-partitions.pl:269
28885 #: ../tools/virt-edit.pl:512 ../tools/virt-win-reg.pl:600 ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:566 ../tools/virt-list-partitions.pl:271
28886 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
28890 #: ../tools/virt-edit.pl:516
28891 msgid "Copyright (C) 2009-2011 Red Hat Inc."
28895 #: ../tools/virt-win-reg.pl:37
28897 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
28902 #: ../tools/virt-win-reg.pl:41
28905 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
28910 #: ../tools/virt-win-reg.pl:43
28913 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
28918 #: ../tools/virt-win-reg.pl:45
28921 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
28926 #: ../tools/virt-win-reg.pl:47
28929 " virt-win-reg --merge domname [input.reg ...]\n"
28934 #: ../tools/virt-win-reg.pl:49
28937 " virt-win-reg [--options] disk.img ... # instead of domname\n"
28942 #: ../tools/virt-win-reg.pl:53
28944 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
28945 "virtual machines. If you do this, you I<will> get irreversible disk "
28946 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
28947 "but doesn't catch all cases."
28951 #: ../tools/virt-win-reg.pl:58
28953 "Modifying the Windows Registry is an inherently risky operation. The format "
28954 "is deliberately obscure and undocumented, and Registry changes can leave the "
28955 "system unbootable. Therefore when using the I<--merge> option, make sure "
28956 "you have a reliable backup first."
28960 #: ../tools/virt-win-reg.pl:65
28962 "This program can export and merge Windows Registry entries from a Windows "
28967 #: ../tools/virt-win-reg.pl:68
28969 "The first parameter is the libvirt guest name or the raw disk image of a "
28974 #: ../tools/virt-win-reg.pl:71
28976 "If I<--merge> is I<not> specified, then the chosen registry key is "
28977 "displayed/exported (recursively). For example:"
28981 #: ../tools/virt-win-reg.pl:74
28984 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
28989 #: ../tools/virt-win-reg.pl:76
28990 msgid "You can also display single values from within registry keys, for example:"
28994 #: ../tools/virt-win-reg.pl:79
28997 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
28998 " $ virt-win-reg Windows7 $cvkey ProductName\n"
28999 " Windows 7 Enterprise\n"
29004 #: ../tools/virt-win-reg.pl:83
29006 "With I<--merge>, you can merge a textual regedit file into the Windows "
29011 #: ../tools/virt-win-reg.pl:86
29014 " $ virt-win-reg --merge Windows7 changes.reg\n"
29019 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
29024 #: ../tools/virt-win-reg.pl:90
29026 "This program is only meant for simple access to the registry. If you want "
29027 "to do complicated things with the registry, we suggest you download the "
29028 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
29029 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
29030 "L<hivexregedit(1)>."
29034 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
29039 #: ../tools/virt-win-reg.pl:122
29040 msgid "Enable debugging messages."
29044 #: ../tools/virt-win-reg.pl:157
29049 #: ../tools/virt-win-reg.pl:159
29051 "In merge mode, this merges a textual regedit file into the Windows Registry "
29052 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
29053 "displays or exports Registry entries instead."
29057 #: ../tools/virt-win-reg.pl:163
29059 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
29060 "result in disk corruption. However exporting (without this flag) is always "
29065 #: ../tools/virt-win-reg.pl:171
29066 msgid "B<--encoding> UTF-16LE|ASCII"
29070 #: ../tools/virt-win-reg.pl:173
29072 "When merging (only), you may need to specify the encoding for strings to be "
29073 "used in the hive file. This is explained in detail in "
29074 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
29078 #: ../tools/virt-win-reg.pl:177
29080 "The default is to use UTF-16LE, which should work with recent versions of "
29085 #: ../tools/virt-win-reg.pl:402
29086 msgid "SUPPORTED SYSTEMS"
29090 #: ../tools/virt-win-reg.pl:404
29092 "The program currently supports Windows NT-derived guests starting with "
29093 "Windows XP through to at least Windows 7."
29097 #: ../tools/virt-win-reg.pl:407
29099 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
29100 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
29101 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
29105 #: ../tools/virt-win-reg.pl:411
29107 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
29112 #: ../tools/virt-win-reg.pl:414
29114 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
29119 #: ../tools/virt-win-reg.pl:417
29124 #: ../tools/virt-win-reg.pl:419
29126 "C<virt-win-reg> expects that regedit files have already been reencoded in "
29127 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
29128 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
29129 "with Windows-style line endings, you may need to reencode the whole file "
29130 "before or after processing."
29134 #: ../tools/virt-win-reg.pl:425
29136 "To reencode a file from Windows format to Linux (before processing it with "
29137 "the I<--merge> option), you would do something like this:"
29141 #: ../tools/virt-win-reg.pl:428
29144 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
29149 #: ../tools/virt-win-reg.pl:430
29151 "To go in the opposite direction, after exporting and before sending the file "
29152 "to a Windows user, do something like this:"
29156 #: ../tools/virt-win-reg.pl:433
29159 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
29164 #: ../tools/virt-win-reg.pl:435
29165 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
29169 #: ../tools/virt-win-reg.pl:437
29171 "If you are unsure about the current encoding, use the L<file(1)> command. "
29172 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
29173 "Windows-style (CRLF) line endings, like this:"
29177 #: ../tools/virt-win-reg.pl:441
29180 " $ file software.reg\n"
29181 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
29182 " with CRLF line terminators\n"
29187 #: ../tools/virt-win-reg.pl:445
29188 msgid "This file would need conversion before you could I<--merge> it."
29192 #: ../tools/virt-win-reg.pl:447
29193 msgid "CurrentControlSet etc."
29197 #: ../tools/virt-win-reg.pl:449
29199 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
29200 "Registry at the level of the hive file, and therefore you cannot modify "
29205 #: ../tools/virt-win-reg.pl:453
29207 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
29208 "circumstances it might refer to another control set. The way to find out is "
29209 "to look at the C<HKLM\\SYSTEM\\Select> key:"
29213 #: ../tools/virt-win-reg.pl:457
29216 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
29217 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
29218 " \"Current\"=dword:00000001\n"
29219 " \"Default\"=dword:00000001\n"
29220 " \"Failed\"=dword:00000000\n"
29221 " \"LastKnownGood\"=dword:00000002\n"
29226 #: ../tools/virt-win-reg.pl:464
29227 msgid "\"Current\" is the one which Windows will choose when it boots."
29231 #: ../tools/virt-win-reg.pl:466
29232 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
29236 #: ../tools/virt-win-reg.pl:469
29237 msgid "WINDOWS TIPS"
29241 #: ../tools/virt-win-reg.pl:471
29243 "Note that some of these tips modify the guest disk image. The guest I<must> "
29244 "be shut off, else you will get disk corruption."
29248 #: ../tools/virt-win-reg.pl:474
29249 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
29253 #: ../tools/virt-win-reg.pl:476
29255 "Prepare a DOS batch script, VBScript or executable. Upload this using "
29256 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
29257 "is uploaded into C<C:\\>:"
29261 #: ../tools/virt-win-reg.pl:480
29264 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
29269 #: ../tools/virt-win-reg.pl:482
29270 msgid "Prepare a regedit file containing the registry change:"
29274 #: ../tools/virt-win-reg.pl:484
29277 " cat > test.reg <<'EOF'\n"
29278 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
29279 " \"Test\"=\"c:\\\\test.bat\"\n"
29285 #: ../tools/virt-win-reg.pl:489
29287 "In this example we use the key C<RunOnce> which means that the script will "
29288 "run precisely once when the first user logs in. If you want it to run every "
29289 "time a user logs in, replace C<RunOnce> with C<Run>."
29293 #: ../tools/virt-win-reg.pl:493
29294 msgid "Now update the registry:"
29298 #: ../tools/virt-win-reg.pl:495
29301 " virt-win-reg --merge WindowsGuest test.reg\n"
29306 #: ../tools/virt-win-reg.pl:497
29307 msgid "INSTALLING A SERVICE"
29311 #: ../tools/virt-win-reg.pl:499
29313 "This section assumes you are familiar with Windows services, and you either "
29314 "have a program which handles the Windows Service Control Protocol directly "
29315 "or you want to run any program using a service wrapper like SrvAny or the "
29320 #: ../tools/virt-win-reg.pl:504
29322 "First upload the program and optionally the service wrapper. In this case "
29323 "the test program is called C<test.exe> and we are using the RHSrvAny "
29328 #: ../tools/virt-win-reg.pl:508
29331 " guestfish -i -d WindowsGuest <<EOF\n"
29332 " upload rhsrvany.exe /rhsrvany.exe\n"
29333 " upload test.exe /test.exe\n"
29339 #: ../tools/virt-win-reg.pl:513
29341 "Prepare a regedit file containing the registry changes. In this example, "
29342 "the first registry change is needed for the service itself or the service "
29343 "wrapper (if used). The second registry change is only needed because I am "
29344 "using the RHSrvAny service wrapper."
29348 #: ../tools/virt-win-reg.pl:518
29351 " cat > service.reg <<'EOF'\n"
29352 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
29353 " \"Type\"=dword:00000010\n"
29354 " \"Start\"=dword:00000002\n"
29355 " \"ErrorControl\"=dword:00000001\n"
29356 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
29357 " \"DisplayName\"=\"RHSrvAny\"\n"
29358 " \"ObjectName\"=\"NetworkService\"\n"
29363 #: ../tools/virt-win-reg.pl:527
29366 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
29367 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
29368 " \"PWD\"=\"c:\\\\Temp\"\n"
29374 #: ../tools/virt-win-reg.pl:538
29376 "For use of C<ControlSet001> see the section above in this manual page. You "
29377 "may need to adjust this according to the control set that is in use by the "
29382 #: ../tools/virt-win-reg.pl:544
29384 "C<\"ObjectName\"> controls the privileges that the service will have. An "
29385 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
29386 "privileged account."
29390 #: ../tools/virt-win-reg.pl:550
29392 "For the meaning of the magic numbers, see this Microsoft KB article: "
29393 "L<http://support.microsoft.com/kb/103000>."
29397 #: ../tools/virt-win-reg.pl:555
29398 msgid "Update the registry:"
29402 #: ../tools/virt-win-reg.pl:557
29405 " virt-win-reg --merge WindowsGuest service.reg\n"
29410 #: ../tools/virt-win-reg.pl:561
29412 "Be careful when passing parameters containing C<\\> (backslash) in the "
29413 "shell. Usually you will have to use 'single quotes' or double backslashes "
29414 "(but not both) to protect them from the shell."
29418 #: ../tools/virt-win-reg.pl:565
29419 msgid "Paths and value names are case-insensitive."
29423 #: ../tools/virt-win-reg.pl:574
29425 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
29426 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
29427 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
29428 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29432 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:555
29434 "When reporting bugs, please enable debugging and capture the I<complete> "
29439 #: ../tools/virt-win-reg.pl:592
29442 " export LIBGUESTFS_DEBUG=1\n"
29443 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
29448 #: ../tools/virt-win-reg.pl:595
29450 "Attach /tmp/virt-win-reg.log to a new bug report at "
29451 "L<https://bugzilla.redhat.com/>"
29455 #: ../tools/virt-win-reg.pl:604 ../tools/virt-make-fs.pl:570
29456 msgid "Copyright (C) 2010 Red Hat Inc."
29460 #: ../tools/virt-list-filesystems.pl:32
29461 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
29465 #: ../tools/virt-list-filesystems.pl:36
29468 " virt-list-filesystems [--options] domname\n"
29473 #: ../tools/virt-list-filesystems.pl:38
29476 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
29481 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
29483 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
29488 #: ../tools/virt-list-filesystems.pl:45
29490 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
29491 "are contained in a virtual machine or disk image."
29495 #: ../tools/virt-list-filesystems.pl:49
29497 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
29498 "functionality. For more complex cases you should look at the "
29499 "L<guestfish(1)> tool."
29503 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
29504 msgid "B<-l> | B<--long>"
29508 #: ../tools/virt-list-filesystems.pl:108
29510 "With this option, C<virt-list-filesystems> displays the type of each "
29511 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
29515 #: ../tools/virt-list-filesystems.pl:115
29516 msgid "B<-a> | B<--all>"
29520 #: ../tools/virt-list-filesystems.pl:117
29522 "Normally we only show mountable filesystems. If this option is given then "
29523 "swap devices are shown too."
29527 #: ../tools/virt-list-filesystems.pl:191
29529 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
29530 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
29531 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29535 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
29536 msgid "Copyright (C) 2009 Red Hat Inc."
29540 #: ../tools/virt-tar.pl:33
29541 msgid "virt-tar - Extract or upload files to a virtual machine"
29545 #: ../tools/virt-tar.pl:37
29548 " virt-tar [--options] -x domname directory tarball\n"
29553 #: ../tools/virt-tar.pl:39
29556 " virt-tar [--options] -u domname tarball directory\n"
29561 #: ../tools/virt-tar.pl:41
29564 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
29569 #: ../tools/virt-tar.pl:43
29572 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
29577 #: ../tools/virt-tar.pl:47
29579 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
29580 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
29584 #: ../tools/virt-tar.pl:52
29585 msgid "Download C</home> from the VM into a local tarball:"
29589 #: ../tools/virt-tar.pl:54
29592 " virt-tar -x domname /home home.tar\n"
29597 #: ../tools/virt-tar.pl:56
29600 " virt-tar -zx domname /home home.tar.gz\n"
29605 #: ../tools/virt-tar.pl:58
29606 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
29610 #: ../tools/virt-tar.pl:60
29613 " virt-tar -u domname uploadstuff.tar /tmp\n"
29618 #: ../tools/virt-tar.pl:62
29621 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
29626 #: ../tools/virt-tar.pl:66
29628 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
29629 "virtual machines. If you do this, you risk disk corruption in the VM. "
29630 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
29634 #: ../tools/virt-tar.pl:71
29636 "You can use I<-x> (extract) on live virtual machines, but you might get "
29637 "inconsistent results or errors if there is filesystem activity inside the "
29638 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
29639 "work, but the only way to guarantee consistent results is if the virtual "
29640 "machine is shut down."
29644 #: ../tools/virt-tar.pl:79
29646 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
29647 "parts of a guest filesystem. There are many possibilities: making backups, "
29648 "uploading data files, snooping on guest activity, fixing or customizing "
29653 #: ../tools/virt-tar.pl:84
29655 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
29656 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
29657 "should look at the L<guestfish(1)> tool."
29661 #: ../tools/virt-tar.pl:88
29663 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
29664 "its contents (recursively) from the virtual machine into a local tarball. "
29665 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
29666 "virtual machine. You cannot use these two options together."
29670 #: ../tools/virt-tar.pl:94
29672 "In addition, you may need to use the I<-z> (gZip) option to enable "
29673 "compression. When uploading, you have to specify I<-z> if the upload file "
29674 "is compressed because virt-tar won't detect this on its own."
29678 #: ../tools/virt-tar.pl:98
29680 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
29681 "example it cannot do PKZip files or bzip2 compression. If you want that "
29682 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
29683 "the L<libguestfs(3)> API)."
29687 #: ../tools/virt-tar.pl:156
29688 msgid "B<-x> | B<--extract> | B<--download>"
29692 #: ../tools/virt-tar.pl:158
29693 msgid "B<-u> | B<--upload>"
29697 #: ../tools/virt-tar.pl:160
29699 "Use I<-x> to extract (download) a directory from a virtual machine to a "
29704 #: ../tools/virt-tar.pl:163
29706 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
29707 "Please read the L</WARNING> section above before using this option."
29711 #: ../tools/virt-tar.pl:167
29712 msgid "You must specify exactly one of these options."
29716 #: ../tools/virt-tar.pl:173
29717 msgid "B<-z> | B<--gzip>"
29721 #: ../tools/virt-tar.pl:175
29722 msgid "Specify that the input or output tarball is gzip-compressed."
29726 #: ../tools/virt-tar.pl:288
29728 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
29729 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
29730 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
29731 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29735 #: ../tools/virt-make-fs.pl:37
29736 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
29740 #: ../tools/virt-make-fs.pl:41
29743 " virt-make-fs [--options] input.tar output.img\n"
29748 #: ../tools/virt-make-fs.pl:43
29751 " virt-make-fs [--options] input.tar.gz output.img\n"
29756 #: ../tools/virt-make-fs.pl:45
29759 " virt-make-fs [--options] directory output.img\n"
29764 #: ../tools/virt-make-fs.pl:49
29766 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
29767 "archive or some files in a directory. It is similar to tools like "
29768 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
29769 "it can create common filesystem types like ext2/3 or NTFS, which can be "
29770 "useful if you want to attach these filesystems to existing virtual machines "
29771 "(eg. to import large amounts of read-only data to a VM)."
29775 #: ../tools/virt-make-fs.pl:57
29776 msgid "Basic usage is:"
29780 #: ../tools/virt-make-fs.pl:59
29783 " virt-make-fs input output\n"
29788 #: ../tools/virt-make-fs.pl:61
29790 "where C<input> is either a directory containing files that you want to add, "
29791 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
29792 "C<output> is a disk image. The input type is detected automatically. The "
29793 "output disk image defaults to a raw ext2 image unless you specify extra "
29794 "flags (see L</OPTIONS> below)."
29798 #: ../tools/virt-make-fs.pl:67
29799 msgid "EXTRA SPACE"
29803 #: ../tools/virt-make-fs.pl:69
29805 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
29806 "the files that it contains, but might have extra space. Depending on how "
29807 "you are going to use the output, you might think this extra space is wasted "
29808 "and want to minimize it, or you might want to leave space so that more files "
29809 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
29810 "but you can use the I<--size> flag to leave space in the filesystem if you "
29815 #: ../tools/virt-make-fs.pl:77
29817 "An alternative way to leave extra space but not make the output image any "
29818 "bigger is to use an alternative disk image format (instead of the default "
29819 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
29820 "image format (check your hypervisor supports this before using it). This "
29821 "allows you to choose a large I<--size> but the extra space won't actually be "
29822 "allocated in the image until you try to store something in it."
29826 #: ../tools/virt-make-fs.pl:85
29828 "Don't forget that you can also use local commands including L<resize2fs(8)> "
29829 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
29830 "to build another image from scratch."
29834 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
29839 #: ../tools/virt-make-fs.pl:91
29842 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
29847 #: ../tools/virt-make-fs.pl:93
29848 msgid "FILESYSTEM TYPE"
29852 #: ../tools/virt-make-fs.pl:95
29854 "The default filesystem type is C<ext2>. Just about any filesystem type that "
29855 "libguestfs supports can be used (but I<not> read-only formats like "
29856 "ISO9660). Here are some of the more common choices:"
29860 #: ../tools/virt-make-fs.pl:101
29865 #: ../tools/virt-make-fs.pl:103
29867 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
29868 "you are not going to use the filesystem in a way that requires the journal, "
29869 "then this is just wasted overhead."
29873 #: ../tools/virt-make-fs.pl:107
29874 msgid "I<ntfs> or I<vfat>"
29878 #: ../tools/virt-make-fs.pl:109
29879 msgid "Useful if exporting data to a Windows guest."
29883 #: ../tools/virt-make-fs.pl:111
29885 "I<Note for vfat>: The tar archive or local directory must only contain files "
29886 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
29887 "program running within libguestfs is unable to change the ownership of "
29888 "non-root files, since vfat itself does not support this."
29892 #: ../tools/virt-make-fs.pl:116
29897 #: ../tools/virt-make-fs.pl:118
29899 "Lower overhead than C<ext2>, but certain limitations on filename length and "
29900 "total filesystem size."
29904 #: ../tools/virt-make-fs.pl:125
29907 " virt-make-fs --type=minix input minixfs.img\n"
29912 #: ../tools/virt-make-fs.pl:127
29913 msgid "TO PARTITION OR NOT TO PARTITION"
29917 #: ../tools/virt-make-fs.pl:129
29918 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29922 #: ../tools/virt-make-fs.pl:131
29924 "Adding a partition can make the disk image more compatible with certain "
29925 "virtualized operating systems which don't expect to see a filesystem "
29926 "directly located on a block device (Linux doesn't care and will happily "
29927 "handle both types)."
29931 #: ../tools/virt-make-fs.pl:136
29933 "On the other hand, if you have a partition table then the output image is no "
29934 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29935 "directly on a partitioned disk image. (However libguestfs tools such as "
29936 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29940 #: ../tools/virt-make-fs.pl:144
29941 msgid "Add an MBR partition:"
29945 #: ../tools/virt-make-fs.pl:146
29948 " virt-make-fs --partition -- input disk.img\n"
29953 #: ../tools/virt-make-fs.pl:148
29955 "If the output disk image could be terabyte-sized or larger, it's better to "
29956 "use an EFI/GPT-compatible partition table:"
29960 #: ../tools/virt-make-fs.pl:151
29963 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29968 #: ../tools/virt-make-fs.pl:179
29969 msgid "Enable debugging information."
29973 #: ../tools/virt-make-fs.pl:185
29974 msgid "B<--size=E<lt>NE<gt>>"
29978 #: ../tools/virt-make-fs.pl:187
29979 msgid "B<--size=+E<lt>NE<gt>>"
29983 #: ../tools/virt-make-fs.pl:189
29984 msgid "B<-s E<lt>NE<gt>>"
29988 #: ../tools/virt-make-fs.pl:191
29989 msgid "B<-s +E<lt>NE<gt>>"
29993 #: ../tools/virt-make-fs.pl:193
29994 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
29998 #: ../tools/virt-make-fs.pl:196
30000 "If this option is I<not> given, then the output image will be just large "
30001 "enough to contain all the files, with not much wasted space."
30005 #: ../tools/virt-make-fs.pl:199
30007 "To choose a fixed size output disk, specify an absolute number followed by "
30008 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
30009 "Petabytes or Exabytes. This must be large enough to contain all the input "
30010 "files, else you will get an error."
30014 #: ../tools/virt-make-fs.pl:204
30016 "To leave extra space, specify C<+> (plus sign) and a number followed by "
30017 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
30018 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
30019 "the input files, and (approximately) an extra 200 MB free space."
30023 #: ../tools/virt-make-fs.pl:210
30025 "Note that virt-make-fs estimates free space, and therefore will not produce "
30026 "filesystems containing precisely the free space requested. (It is much more "
30027 "expensive and time-consuming to produce a filesystem which has precisely the "
30028 "desired free space)."
30032 #: ../tools/virt-make-fs.pl:219
30033 msgid "B<--format=E<lt>fmtE<gt>>"
30037 #: ../tools/virt-make-fs.pl:221
30038 msgid "B<-F E<lt>fmtE<gt>>"
30042 #: ../tools/virt-make-fs.pl:223
30043 msgid "Choose the output disk image format."
30047 #: ../tools/virt-make-fs.pl:225
30048 msgid "The default is C<raw> (raw disk image)."
30052 #: ../tools/virt-make-fs.pl:227
30054 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
30055 "that would really make sense here is C<qcow2>."
30059 #: ../tools/virt-make-fs.pl:234
30060 msgid "B<--type=E<lt>fsE<gt>>"
30064 #: ../tools/virt-make-fs.pl:236
30065 msgid "B<-t E<lt>fsE<gt>>"
30069 #: ../tools/virt-make-fs.pl:238
30070 msgid "Choose the output filesystem type."
30074 #: ../tools/virt-make-fs.pl:240
30075 msgid "The default is C<ext2>."
30079 #: ../tools/virt-make-fs.pl:242
30080 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
30084 #: ../tools/virt-make-fs.pl:249
30085 msgid "B<--partition>"
30089 #: ../tools/virt-make-fs.pl:251
30090 msgid "B<--partition=E<lt>parttypeE<gt>>"
30094 #: ../tools/virt-make-fs.pl:253
30096 "If specified, this flag adds an MBR partition table to the output disk "
30101 #: ../tools/virt-make-fs.pl:256
30103 "You can change the partition table type, eg. I<--partition=gpt> for large "
30108 #: ../tools/virt-make-fs.pl:259
30110 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
30111 "might consider the next parameter to be the partition type. For example:"
30115 #: ../tools/virt-make-fs.pl:263
30118 " virt-make-fs --partition input.tar ...\n"
30123 #: ../tools/virt-make-fs.pl:265
30125 "would cause virt-make-fs to think you wanted to use a partition type of "
30126 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
30127 "dash) between options and the input file argument:"
30131 #: ../tools/virt-make-fs.pl:269
30134 " virt-make-fs --partition -- input.tar ...\n"
30139 #: ../tools/virt-make-fs.pl:541
30141 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
30142 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
30143 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
30147 #: ../tools/virt-make-fs.pl:558
30150 " export LIBGUESTFS_DEBUG=1\n"
30151 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
30156 #: ../tools/virt-make-fs.pl:561
30158 "Attach /tmp/virt-make-fs.log to a new bug report at "
30159 "L<https://bugzilla.redhat.com/>"
30163 #: ../tools/virt-list-partitions.pl:32
30164 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
30168 #: ../tools/virt-list-partitions.pl:36
30171 " virt-list-partitions [--options] domname\n"
30176 #: ../tools/virt-list-partitions.pl:38
30179 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
30184 #: ../tools/virt-list-partitions.pl:45
30186 "C<virt-list-partitions> is a command line tool to list the partitions that "
30187 "are contained in a virtual machine or disk image. It is mainly useful as a "
30188 "first step to using L<virt-resize(1)>."
30192 #: ../tools/virt-list-partitions.pl:50
30194 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
30195 "functionality. For more complex cases you should look at the "
30196 "L<guestfish(1)> tool."
30200 #: ../tools/virt-list-partitions.pl:107
30201 msgid "B<-h> | B<--human-readable>"
30205 #: ../tools/virt-list-partitions.pl:109
30206 msgid "Show sizes in human-readable form (eg. \"1G\")."
30210 #: ../tools/virt-list-partitions.pl:117
30212 "With this option, C<virt-list-partitions> displays the type and size of each "
30213 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
30217 #: ../tools/virt-list-partitions.pl:124
30218 msgid "B<-t> | B<--total>"
30222 #: ../tools/virt-list-partitions.pl:126
30223 msgid "Display the total size of each block device (as a separate row or rows)."
30227 #: ../tools/virt-list-partitions.pl:259
30229 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
30230 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
30231 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
30235 #: ../tools/virt-list-partitions.pl:275
30236 msgid "Copyright (C) 2009-2010 Red Hat Inc."