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.9.2\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-01-03 18:07+0000\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-resize.pl:40 ../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-resize.pl:44 ../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-resize.pl:50 ../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 pipe 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:1011 ../src/guestfs.pod:1015 ../src/guestfs.pod:1019 ../src/guestfs.pod:1024 ../src/guestfs.pod:1032 ../src/guestfs.pod:1051 ../src/guestfs.pod:1059 ../src/guestfs.pod:1081 ../src/guestfs.pod:1085 ../src/guestfs.pod:1089 ../src/guestfs.pod:1093 ../src/guestfs.pod:1097 ../src/guestfs.pod:1101 ../src/guestfs.pod:1583 ../src/guestfs.pod:1588 ../src/guestfs.pod:1592 ../src/guestfs.pod:1702 ../src/guestfs.pod:1707 ../src/guestfs.pod:1711 ../src/guestfs.pod:2063 ../src/guestfs.pod:2069 ../src/guestfs.pod:2074 ../src/guestfs.pod:2080 ../src/guestfs.pod:2540 ../src/guestfs.pod:2544 ../src/guestfs.pod:2548 ../src/guestfs.pod:2552 ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:569 ../src/guestfs-actions.pod:577 ../src/guestfs-actions.pod:584 ../src/guestfs-actions.pod:591 ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:1591 ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599 ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1775 ../src/guestfs-actions.pod:1780 ../src/guestfs-actions.pod:1785 ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850 ../src/guestfs-actions.pod:1855 ../fish/guestfish.pod:427 ../fish/guestfish.pod:431 ../fish/guestfish.pod:435 ../fish/guestfish.pod:439 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:373 ../fish/guestfish-actions.pod:381 ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:1065 ../fish/guestfish-actions.pod:1069 ../fish/guestfish-actions.pod:1073 ../fish/guestfish-actions.pod:1077 ../fish/guestfish-actions.pod:1085 ../fish/guestfish-actions.pod:1089 ../fish/guestfish-actions.pod:1093 ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1107 ../fish/guestfish-actions.pod:1111 ../fish/guestfish-actions.pod:1201 ../fish/guestfish-actions.pod:1205 ../fish/guestfish-actions.pod:1210 ../fish/guestfish-actions.pod:1215 ../fish/guestfish-actions.pod:1257 ../fish/guestfish-actions.pod:1261 ../fish/guestfish-actions.pod:1266 ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542 ../tools/virt-win-reg.pl:548 ../tools/virt-resize.pl:345 ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
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:1204 ../src/guestfs.pod:1335 ../src/guestfs.pod:2108
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:1208 ../src/guestfs.pod:1339 ../src/guestfs.pod:2133
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:1345
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:720
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. (These APIs used to be in a separate Perl-only "
1112 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1113 "frequently used part of this library has been rewritten in C and moved into "
1118 #: ../src/guestfs.pod:558
1120 "Add all disks belonging to the unknown virtual machine and call "
1121 "L</guestfs_launch> in the usual way."
1125 #: ../src/guestfs.pod:561
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:570
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:576
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:583
1161 " /boot => /dev/sda1\n"
1162 " / => /dev/vg_guest/lv_root\n"
1163 " /usr => /dev/vg_guest/lv_usr\n"
1168 #: ../src/guestfs.pod:587
1170 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1171 "filesystems as suggested."
1175 #: ../src/guestfs.pod:590
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:594
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:598
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:602
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:611
1213 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1217 #: ../src/guestfs.pod:613
1219 "Libguestfs can mount NTFS partitions. It does this using the "
1220 "L<http://www.ntfs-3g.org/> driver."
1224 #: ../src/guestfs.pod:616
1225 msgid "DRIVE LETTERS AND PATHS"
1229 #: ../src/guestfs.pod:618
1231 "DOS and Windows still use drive letters, and the filesystems are always "
1232 "treated as case insensitive by Windows itself, and therefore you might find "
1233 "a Windows configuration file referring to a path like "
1234 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1235 "that directory might be referred to as C</WINDOWS/System32>."
1239 #: ../src/guestfs.pod:624
1241 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1242 "libguestfs to read the appropriate Windows Registry and configuration files, "
1243 "to determine yourself how drives are mapped (see also L<hivex(3)> and "
1244 "L<virt-inspector(1)>)."
1248 #: ../src/guestfs.pod:629
1250 "Replacing backslash characters with forward slash characters is also outside "
1251 "the scope of libguestfs, but something that you can easily do."
1255 #: ../src/guestfs.pod:632
1257 "Where we can help is in resolving the case insensitivity of paths. For "
1258 "this, call L</guestfs_case_sensitive_path>."
1262 #: ../src/guestfs.pod:635
1263 msgid "ACCESSING THE WINDOWS REGISTRY"
1267 #: ../src/guestfs.pod:637
1269 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1270 "files, through the library C<hivex> which is part of the libguestfs project "
1271 "although ships as a separate tarball. You have to locate and download the "
1272 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1273 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1274 "L<virt-win-reg(1)> for more help on this issue."
1278 #: ../src/guestfs.pod:645
1279 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1283 #: ../src/guestfs.pod:647
1285 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1286 "provide something which looks like a Linux symlink. The way it tries to do "
1287 "the rewriting is described here:"
1291 #: ../src/guestfs.pod:651
1292 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
1296 #: ../src/guestfs.pod:653
1298 "The essential problem is that ntfs-3g simply does not have enough "
1299 "information to do a correct job. NTFS links can contain drive letters and "
1300 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1301 "It is almost certainly the case that libguestfs callers should ignore what "
1302 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1306 #: ../src/guestfs.pod:660
1308 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
1309 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1310 "attribute, and read the raw reparse data from that (you can find the format "
1311 "documented in various places around the web)."
1315 #: ../src/guestfs.pod:665
1316 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1320 #: ../src/guestfs.pod:667
1322 "There are other useful extended attributes that can be read from ntfs-3g "
1323 "filesystems (using L</guestfs_getxattr>). See:"
1327 #: ../src/guestfs.pod:670
1328 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1332 #: ../src/guestfs.pod:672
1333 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1337 #: ../src/guestfs.pod:674
1339 "Although we don't want to discourage you from using the C API, we will "
1340 "mention here that the same API is also available in other languages."
1344 #: ../src/guestfs.pod:677
1346 "The API is broadly identical in all supported languages. This means that "
1347 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1348 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1349 "OCaml. In other words, a straightforward, predictable isomorphism between "
1354 #: ../src/guestfs.pod:683
1356 "Error messages are automatically transformed into exceptions if the language "
1361 #: ../src/guestfs.pod:686
1363 "We don't try to \"object orientify\" parts of the API in OO languages, "
1364 "although contributors are welcome to write higher level APIs above what we "
1365 "provide in their favourite languages if they wish."
1369 #: ../src/guestfs.pod:692
1374 #: ../src/guestfs.pod:694
1376 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1377 "identical to the C API. C++ classes and exceptions are not used."
1381 #: ../src/guestfs.pod:698
1386 #: ../src/guestfs.pod:700
1388 "The C# bindings are highly experimental. Please read the warnings at the "
1389 "top of C<csharp/Libguestfs.cs>."
1393 #: ../src/guestfs.pod:703
1398 #: ../src/guestfs.pod:705
1400 "This is the only language binding that is working but incomplete. Only "
1401 "calls which return simple integers have been bound in Haskell, and we are "
1402 "looking for help to complete this binding."
1406 #: ../src/guestfs.pod:709
1411 #: ../src/guestfs.pod:711
1413 "Full documentation is contained in the Javadoc which is distributed with "
1418 #: ../src/guestfs.pod:714
1423 #: ../src/guestfs.pod:716
1424 msgid "See L<guestfs-ocaml(3)>."
1428 #: ../src/guestfs.pod:718
1433 #: ../src/guestfs.pod:720
1434 msgid "See L<Sys::Guestfs(3)>."
1438 #: ../src/guestfs.pod:722
1443 #: ../src/guestfs.pod:724
1445 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1446 "the php-libguestfs package for your distribution."
1450 #: ../src/guestfs.pod:727
1451 msgid "The PHP binding only works correctly on 64 bit machines."
1455 #: ../src/guestfs.pod:729
1460 #: ../src/guestfs.pod:731
1461 msgid "See L<guestfs-python(3)>."
1465 #: ../src/guestfs.pod:733
1470 #: ../src/guestfs.pod:735
1471 msgid "See L<guestfs-ruby(3)>."
1475 #: ../src/guestfs.pod:737
1476 msgid "B<shell scripts>"
1480 #: ../src/guestfs.pod:739
1481 msgid "See L<guestfish(1)>."
1485 #: ../src/guestfs.pod:743
1486 msgid "LIBGUESTFS GOTCHAS"
1490 #: ../src/guestfs.pod:745
1492 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1493 "system [...] that works in the way it is documented but is counterintuitive "
1494 "and almost invites mistakes.\""
1498 #: ../src/guestfs.pod:749
1500 "Since we developed libguestfs and the associated tools, there are several "
1501 "things we would have designed differently, but are now stuck with for "
1502 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1503 "release, you can expect these to change. Beware of them."
1507 #: ../src/guestfs.pod:757
1508 msgid "Autosync / forgetting to sync."
1512 #: ../src/guestfs.pod:759
1514 "When modifying a filesystem from C or another language, you B<must> unmount "
1515 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1516 "libguestfs handle. You can also call:"
1520 #: ../src/guestfs.pod:763
1523 " guestfs_set_autosync (g, 1);\n"
1528 #: ../src/guestfs.pod:765
1530 "to have the unmount/sync done automatically for you when the handle 'g' is "
1531 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1536 #: ../src/guestfs.pod:769
1538 "If you forget to do this, then it is entirely possible that your changes "
1539 "won't be written out, or will be partially written, or (very rarely) that "
1540 "you'll get disk corruption."
1544 #: ../src/guestfs.pod:773
1546 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1547 "guestfish scripts that forget to sync will work just fine, which can make "
1548 "this very puzzling if you are trying to debug a problem."
1552 #: ../src/guestfs.pod:777
1554 "Update: Autosync is enabled by default for all API users starting from "
1555 "libguestfs 1.5.24."
1559 #: ../src/guestfs.pod:780
1560 msgid "Mount option C<-o sync> should not be the default."
1564 #: ../src/guestfs.pod:782
1566 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1567 "However C<-o sync> does not add any reliability benefit, but does have a "
1568 "very large performance impact."
1572 #: ../src/guestfs.pod:786
1574 "The work around is to use L</guestfs_mount_options> and set the mount "
1575 "options that you actually want to use."
1579 #: ../src/guestfs.pod:789
1580 msgid "Read-only should be the default."
1584 #: ../src/guestfs.pod:791
1586 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1587 "specify I<--rw> if you want to make changes to the image."
1591 #: ../src/guestfs.pod:794
1592 msgid "This would reduce the potential to corrupt live VM images."
1596 #: ../src/guestfs.pod:796
1598 "Note that many filesystems change the disk when you just mount and unmount, "
1599 "even if you didn't perform any writes. You need to use "
1600 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1604 #: ../src/guestfs.pod:800
1605 msgid "guestfish command line is hard to use."
1609 #: ../src/guestfs.pod:802
1611 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1612 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1613 "exist, so it fails. In earlier versions of guestfish the error message was "
1614 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1615 "we should have used C<guestfish -c command> to run commands."
1619 #: ../src/guestfs.pod:809
1620 msgid "guestfish megabyte modifiers don't work right on all commands"
1624 #: ../src/guestfs.pod:811
1626 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1627 "other modifiers). What guestfish actually does is to multiply the number "
1628 "part by the modifier part and pass the result to the C API. However this "
1629 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1630 "expecting some other unit (eg. megabytes)."
1634 #: ../src/guestfs.pod:818
1635 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1639 #: ../src/guestfs.pod:820
1642 " lvcreate LV VG 100M\n"
1647 #: ../src/guestfs.pod:822
1649 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1650 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1651 "megabytes * megabytes) logical volume. The error message you get from this "
1652 "is also a little obscure."
1656 #: ../src/guestfs.pod:827
1658 "This could be fixed in the generator by specially marking parameters and "
1659 "return values which take bytes or other units."
1663 #: ../src/guestfs.pod:830
1664 msgid "Ambiguity between devices and paths"
1668 #: ../src/guestfs.pod:832
1670 "There is a subtle ambiguity in the API between a device name "
1671 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1672 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1676 #: ../src/guestfs.pod:837
1678 "In the current API we usually resolve this ambiguity by having two separate "
1679 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1680 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1681 "detecting if the path supplied begins with C</dev/>."
1685 #: ../src/guestfs.pod:843
1687 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1688 "make paths/devices into structured names. One way to do this would be to "
1689 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1690 "aspect of grub. Another way would be to use a structured type, equivalent "
1691 "to this OCaml type:"
1695 #: ../src/guestfs.pod:849
1698 " type path = Path of string | Device of int | Partition of int * int\n"
1703 #: ../src/guestfs.pod:851
1704 msgid "which would allow you to pass arguments like:"
1708 #: ../src/guestfs.pod:853
1711 " Path \"/foo/bar\"\n"
1712 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1713 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1714 " Path \"/dev/sdb2\" (* not a device *)\n"
1719 #: ../src/guestfs.pod:858
1721 "As you can see there are still problems to resolve even with this "
1722 "representation. Also consider how it might work in guestfish."
1726 #: ../src/guestfs.pod:863
1727 msgid "PROTOCOL LIMITS"
1731 #: ../src/guestfs.pod:865
1733 "Internally libguestfs uses a message-based protocol to pass API calls and "
1734 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1735 "plenty more detail about this). The maximum message size used by the "
1736 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1737 "aware of this limit. The API calls which may be affected are individually "
1738 "documented, with a link back to this section of the documentation."
1742 #: ../src/guestfs.pod:873
1744 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1745 "a simple string. Because this string is at some point internally encoded as "
1746 "a message, the maximum size that it can return is slightly under 4 MB. If "
1747 "the requested file is larger than this then you will get an error."
1751 #: ../src/guestfs.pod:879
1753 "In order to transfer large files into and out of the guest filesystem, you "
1754 "need to use particular calls that support this. The sections L</UPLOADING> "
1755 "and L</DOWNLOADING> document how to do this."
1759 #: ../src/guestfs.pod:883
1761 "You might also consider mounting the disk image using our FUSE filesystem "
1762 "support (L<guestmount(1)>)."
1766 #: ../src/guestfs.pod:886
1767 msgid "KEYS AND PASSPHRASES"
1771 #: ../src/guestfs.pod:888
1773 "Certain libguestfs calls take a parameter that contains sensitive key "
1774 "material, passed in as a C string."
1778 #: ../src/guestfs.pod:891
1780 "In the future we would hope to change the libguestfs implementation so that "
1781 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1782 "swap. However this is I<not> done at the moment, because of the complexity "
1783 "of such an implementation."
1787 #: ../src/guestfs.pod:896
1789 "Therefore you should be aware that any key parameter you pass to libguestfs "
1790 "might end up being written out to the swap partition. If this is a concern, "
1791 "scrub the swap partition or don't use libguestfs on encrypted devices."
1795 #: ../src/guestfs.pod:901
1796 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1800 #: ../src/guestfs.pod:903
1802 "All high-level libguestfs actions are synchronous. If you want to use "
1803 "libguestfs asynchronously then you must create a thread."
1807 #: ../src/guestfs.pod:906
1809 "Only use the handle from a single thread. Either use the handle exclusively "
1810 "from one thread, or provide your own mutex so that two threads cannot issue "
1811 "calls on the same handle at the same time."
1815 #: ../src/guestfs.pod:910
1817 "See the graphical program guestfs-browser for one possible architecture for "
1818 "multithreaded programs using libvirt and libguestfs."
1822 #: ../src/guestfs.pod:913
1827 #: ../src/guestfs.pod:915
1829 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1834 #: ../src/guestfs.pod:918
1836 "By default it looks for these in the directory C<$libdir/guestfs> "
1837 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1841 #: ../src/guestfs.pod:921
1843 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1844 "to change the directories that libguestfs will search in. The value is a "
1845 "colon-separated list of paths. The current directory is I<not> searched "
1846 "unless the path contains an empty element or C<.>. For example "
1847 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1848 "then C</usr/lib/guestfs>."
1852 #: ../src/guestfs.pod:928
1853 msgid "QEMU WRAPPERS"
1857 #: ../src/guestfs.pod:930
1859 "If you want to compile your own qemu, run qemu from a non-standard location, "
1860 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1865 #: ../src/guestfs.pod:934
1867 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1868 "last command in the shell script (so that qemu replaces the shell and "
1869 "becomes the direct child of the libguestfs-using program). If you don't do "
1870 "this, then the qemu process won't be cleaned up correctly."
1874 #: ../src/guestfs.pod:939
1876 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1881 #: ../src/guestfs.pod:942
1885 " qemudir=/home/rjones/d/qemu\n"
1886 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
1892 #: ../src/guestfs.pod:946
1894 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1895 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1900 #: ../src/guestfs.pod:950
1903 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1908 #: ../src/guestfs.pod:952
1910 "Note that libguestfs also calls qemu with the -help and -version options in "
1911 "order to determine features."
1915 #: ../src/guestfs.pod:955
1916 msgid "ABI GUARANTEE"
1920 #: ../src/guestfs.pod:957
1922 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1923 "actions as outlined in this section. Although we will deprecate some "
1924 "actions, for example if they get replaced by newer calls, we will keep the "
1925 "old actions forever. This allows you the developer to program in confidence "
1926 "against the libguestfs API."
1930 #: ../src/guestfs.pod:963
1931 msgid "BLOCK DEVICE NAMING"
1935 #: ../src/guestfs.pod:965
1937 "In the kernel there is now quite a profusion of schemata for naming block "
1938 "devices (in this context, by I<block device> I mean a physical or virtual "
1939 "hard drive). The original Linux IDE driver used names starting with "
1940 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
1941 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
1942 "replacement for the old IDE driver (particularly for SATA devices) those "
1943 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
1944 "machines with paravirtualized drivers. This has created several different "
1945 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
1950 #: ../src/guestfs.pod:977
1952 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1953 "Linux kernel to access block devices. We can run a variety of appliances "
1954 "based on a variety of Linux kernels."
1958 #: ../src/guestfs.pod:981
1960 "This causes a problem for libguestfs because many API calls use device or "
1961 "partition names. Working scripts and the recipe (example) scripts that we "
1962 "make available over the internet could fail if the naming scheme changes."
1966 #: ../src/guestfs.pod:986
1968 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1969 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1970 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1971 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1975 #: ../src/guestfs.pod:992
1977 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1978 "L</guestfs_list_partitions> and similar calls return the true names of the "
1979 "devices and partitions as known to the appliance."
1983 #: ../src/guestfs.pod:997
1984 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1988 #: ../src/guestfs.pod:999
1990 "Usually this translation is transparent. However in some (very rare) cases "
1991 "you may need to know the exact algorithm. Such cases include where you use "
1992 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
1993 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
1998 #: ../src/guestfs.pod:1005
2000 "The algorithm is applied only to I<parameters> which are known to be either "
2001 "device or partition names. Return values from functions such as "
2002 "L</guestfs_list_devices> are never changed."
2006 #: ../src/guestfs.pod:1013
2007 msgid "Is the string a parameter which is a device or partition name?"
2011 #: ../src/guestfs.pod:1017
2012 msgid "Does the string begin with C</dev/sd>?"
2016 #: ../src/guestfs.pod:1021
2018 "Does the named device exist? If so, we use that device. However if I<not> "
2019 "then we continue with this algorithm."
2023 #: ../src/guestfs.pod:1026
2024 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2028 #: ../src/guestfs.pod:1028
2029 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2033 #: ../src/guestfs.pod:1030
2034 msgid "If that named device exists, use it. If not, continue."
2038 #: ../src/guestfs.pod:1034
2039 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2043 #: ../src/guestfs.pod:1036
2044 msgid "If that named device exists, use it. If not, return an error."
2048 #: ../src/guestfs.pod:1040
2049 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2053 #: ../src/guestfs.pod:1042
2055 "Although the standard naming scheme and automatic translation is useful for "
2056 "simple programs and guestfish scripts, for larger programs it is best not to "
2057 "rely on this mechanism."
2061 #: ../src/guestfs.pod:1046
2063 "Where possible for maximum future portability programs using libguestfs "
2064 "should use these future-proof techniques:"
2068 #: ../src/guestfs.pod:1053
2070 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2071 "device names, and then use those names directly."
2075 #: ../src/guestfs.pod:1056
2076 msgid "Since those device names exist by definition, they will never be translated."
2080 #: ../src/guestfs.pod:1061
2082 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2083 "filesystem labels."
2087 #: ../src/guestfs.pod:1066
2092 #: ../src/guestfs.pod:1068
2094 "This section discusses security implications of using libguestfs, "
2095 "particularly with untrusted or malicious guests or disk images."
2099 #: ../src/guestfs.pod:1071
2100 msgid "GENERAL SECURITY CONSIDERATIONS"
2104 #: ../src/guestfs.pod:1073
2106 "Be careful with any files or data that you download from a guest (by "
2107 "\"download\" we mean not just the L</guestfs_download> command but any "
2108 "command that reads files, filenames, directories or anything else from a "
2109 "disk image). An attacker could manipulate the data to fool your program "
2110 "into doing the wrong thing. Consider cases such as:"
2114 #: ../src/guestfs.pod:1083
2115 msgid "the data (file etc) not being present"
2119 #: ../src/guestfs.pod:1087
2120 msgid "being present but empty"
2124 #: ../src/guestfs.pod:1091
2125 msgid "being much larger than normal"
2129 #: ../src/guestfs.pod:1095
2130 msgid "containing arbitrary 8 bit data"
2134 #: ../src/guestfs.pod:1099
2135 msgid "being in an unexpected character encoding"
2139 #: ../src/guestfs.pod:1103
2140 msgid "containing homoglyphs."
2144 #: ../src/guestfs.pod:1107
2145 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2149 #: ../src/guestfs.pod:1109
2151 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2152 "(VFS) module can sometimes be escalated into exploits by deliberately "
2153 "creating a malicious, malformed filesystem. These exploits are very severe "
2154 "for two reasons. Firstly there are very many filesystem drivers in the "
2155 "kernel, and many of them are infrequently used and not much developer "
2156 "attention has been paid to the code. Linux userspace helps potential "
2157 "crackers by detecting the filesystem type and automatically choosing the "
2158 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2159 "the administrator. Secondly, a kernel-level exploit is like a local root "
2160 "exploit (worse in some ways), giving immediate and total access to the "
2161 "system right down to the hardware level."
2165 #: ../src/guestfs.pod:1122
2167 "That explains why you should never mount a filesystem from an untrusted "
2168 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2169 "inside a qemu virtual machine, usually running as a non-root user. The "
2170 "attacker would need to write a filesystem which first exploited the kernel, "
2171 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2172 "the libguestfs protocol, and finally to be as serious as the host kernel "
2173 "exploit it would need to escalate its privileges to root. This multi-step "
2174 "escalation, performed by a static piece of data, is thought to be extremely "
2175 "hard to do, although we never say 'never' about security issues."
2179 #: ../src/guestfs.pod:1133
2181 "In any case callers can reduce the attack surface by forcing the filesystem "
2182 "type when mounting (use L</guestfs_mount_vfs>)."
2186 #: ../src/guestfs.pod:1136
2187 msgid "PROTOCOL SECURITY"
2191 #: ../src/guestfs.pod:1138
2193 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2194 "defined upper message size. However a program that uses libguestfs must "
2195 "also take care - for example you can write a program that downloads a binary "
2196 "from a disk image and executes it locally, and no amount of protocol "
2197 "security will save you from the consequences."
2201 #: ../src/guestfs.pod:1144
2202 msgid "INSPECTION SECURITY"
2206 #: ../src/guestfs.pod:1146
2208 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2209 "directly from the guest, and these could contain any 8 bit data. Callers "
2210 "should be careful to escape these before printing them to a structured file "
2211 "(for example, use HTML escaping if creating a web page)."
2215 #: ../src/guestfs.pod:1152
2217 "Guest configuration may be altered in unusual ways by the administrator of "
2218 "the virtual machine, and may not reflect reality (particularly for untrusted "
2219 "or actively malicious guests). For example we parse the hostname from "
2220 "configuration files like C</etc/sysconfig/network> that we find in the "
2221 "guest, but the guest administrator can easily manipulate these files to "
2222 "provide the wrong hostname."
2226 #: ../src/guestfs.pod:1160
2228 "The inspection API parses guest configuration using two external libraries: "
2229 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2230 "designed to be robust in the face of malicious data, although denial of "
2231 "service attacks are still possible, for example with oversized configuration "
2236 #: ../src/guestfs.pod:1166
2237 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2241 #: ../src/guestfs.pod:1168
2243 "Be very cautious about running commands from the guest. By running a "
2244 "command in the guest, you are giving CPU time to a binary that you do not "
2245 "control, under the same user account as the library, albeit wrapped in qemu "
2246 "virtualization. More information and alternatives can be found in the "
2247 "section L</RUNNING COMMANDS>."
2251 #: ../src/guestfs.pod:1174
2252 msgid "CVE-2010-3851"
2256 #: ../src/guestfs.pod:1176
2257 msgid "https://bugzilla.redhat.com/642934"
2261 #: ../src/guestfs.pod:1178
2263 "This security bug concerns the automatic disk format detection that qemu "
2264 "does on disk images."
2268 #: ../src/guestfs.pod:1181
2270 "A raw disk image is just the raw bytes, there is no header. Other disk "
2271 "images like qcow2 contain a special header. Qemu deals with this by looking "
2272 "for one of the known headers, and if none is found then assuming the disk "
2273 "image must be raw."
2277 #: ../src/guestfs.pod:1186
2279 "This allows a guest which has been given a raw disk image to write some "
2280 "other header. At next boot (or when the disk image is accessed by "
2281 "libguestfs) qemu would do autodetection and think the disk image format was, "
2282 "say, qcow2 based on the header written by the guest."
2286 #: ../src/guestfs.pod:1191
2288 "This in itself would not be a problem, but qcow2 offers many features, one "
2289 "of which is to allow a disk image to refer to another image (called the "
2290 "\"backing disk\"). It does this by placing the path to the backing disk "
2291 "into the qcow2 header. This path is not validated and could point to any "
2292 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2293 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2294 "control of the attacker."
2298 #: ../src/guestfs.pod:1199
2299 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
2303 #: ../src/guestfs.pod:1206
2304 msgid "You have enabled the network or have opened the disk in write mode."
2308 #: ../src/guestfs.pod:1210
2310 "You are also running untrusted code from the guest (see L</RUNNING "
2315 #: ../src/guestfs.pod:1215
2317 "The way to avoid this is to specify the expected disk format when adding "
2318 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2319 "should always do this if the disk is raw format, and it's a good idea for "
2324 #: ../src/guestfs.pod:1220
2326 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2327 "format is fetched from libvirt and passed through."
2331 #: ../src/guestfs.pod:1223
2333 "For libguestfs tools, use the I<--format> command line parameter as "
2338 #: ../src/guestfs.pod:1226
2339 msgid "CONNECTION MANAGEMENT"
2343 #: ../src/guestfs.pod:1228
2348 #: ../src/guestfs.pod:1230
2350 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2351 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2352 "handle and release all resources used."
2356 #: ../src/guestfs.pod:1234
2358 "For information on using multiple handles and threads, see the section "
2359 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2363 #: ../src/guestfs.pod:1237
2364 msgid "guestfs_create"
2368 #: ../src/guestfs.pod:1239
2371 " guestfs_h *guestfs_create (void);\n"
2376 #: ../src/guestfs.pod:1241
2377 msgid "Create a connection handle."
2381 #: ../src/guestfs.pod:1243
2383 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2384 "on the handle at least once."
2388 #: ../src/guestfs.pod:1246
2390 "This function returns a non-NULL pointer to a handle on success or NULL on "
2395 #: ../src/guestfs.pod:1249
2396 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2400 #: ../src/guestfs.pod:1251
2402 "You may also want to configure error handling for the handle. See L</ERROR "
2403 "HANDLING> section below."
2407 #: ../src/guestfs.pod:1254
2408 msgid "guestfs_close"
2412 #: ../src/guestfs.pod:1256
2415 " void guestfs_close (guestfs_h *g);\n"
2420 #: ../src/guestfs.pod:1258
2421 msgid "This closes the connection handle and frees up all resources used."
2425 #: ../src/guestfs.pod:1260
2426 msgid "ERROR HANDLING"
2430 #: ../src/guestfs.pod:1262
2432 "API functions can return errors. For example, almost all functions that "
2433 "return C<int> will return C<-1> to indicate an error."
2437 #: ../src/guestfs.pod:1265
2439 "Additional information is available for errors: an error message string and "
2440 "optionally an error number (errno) if the thing that failed was a system "
2445 #: ../src/guestfs.pod:1269
2447 "You can get at the additional information about the last error on the handle "
2448 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2449 "up an error handler with L</guestfs_set_error_handler>."
2453 #: ../src/guestfs.pod:1274
2455 "When the handle is created, a default error handler is installed which "
2456 "prints the error message string to C<stderr>. For small short-running "
2457 "command line programs it is sufficient to do:"
2461 #: ../src/guestfs.pod:1278
2464 " if (guestfs_launch (g) == -1)\n"
2465 " exit (EXIT_FAILURE);\n"
2470 #: ../src/guestfs.pod:1281
2472 "since the default error handler will ensure that an error message has been "
2473 "printed to C<stderr> before the program exits."
2477 #: ../src/guestfs.pod:1284
2479 "For other programs the caller will almost certainly want to install an "
2480 "alternate error handler or do error handling in-line like this:"
2484 #: ../src/guestfs.pod:1287
2487 " g = guestfs_create ();\n"
2492 #: ../src/guestfs.pod:1289
2495 " /* This disables the default behaviour of printing errors\n"
2497 " guestfs_set_error_handler (g, NULL, NULL);\n"
2502 #: ../src/guestfs.pod:1293
2505 " if (guestfs_launch (g) == -1) {\n"
2506 " /* Examine the error message and print it etc. */\n"
2507 " char *msg = guestfs_last_error (g);\n"
2508 " int errnum = guestfs_last_errno (g);\n"
2509 " fprintf (stderr, \"%s\\n\", msg);\n"
2516 #: ../src/guestfs.pod:1301
2518 "Out of memory errors are handled differently. The default action is to call "
2519 "L<abort(3)>. If this is undesirable, then you can set a handler using "
2520 "L</guestfs_set_out_of_memory_handler>."
2524 #: ../src/guestfs.pod:1305
2526 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2527 "because there is no handle if this happens there is no way to get additional "
2528 "error information. However L</guestfs_create> is supposed to be a "
2529 "lightweight operation which can only fail because of insufficient memory (it "
2530 "returns NULL in this case)."
2534 #: ../src/guestfs.pod:1311
2535 msgid "guestfs_last_error"
2539 #: ../src/guestfs.pod:1313
2542 " const char *guestfs_last_error (guestfs_h *g);\n"
2547 #: ../src/guestfs.pod:1315
2549 "This returns the last error message that happened on C<g>. If there has not "
2550 "been an error since the handle was created, then this returns C<NULL>."
2554 #: ../src/guestfs.pod:1319
2556 "The lifetime of the returned string is until the next error occurs, or "
2557 "L</guestfs_close> is called."
2561 #: ../src/guestfs.pod:1322
2562 msgid "guestfs_last_errno"
2566 #: ../src/guestfs.pod:1324
2569 " int guestfs_last_errno (guestfs_h *g);\n"
2574 #: ../src/guestfs.pod:1326
2575 msgid "This returns the last error number (errno) that happened on C<g>."
2579 #: ../src/guestfs.pod:1328
2580 msgid "If successful, an errno integer not equal to zero is returned."
2584 #: ../src/guestfs.pod:1330
2585 msgid "If no error, this returns 0. This call can return 0 in three situations:"
2589 #: ../src/guestfs.pod:1337
2590 msgid "There has not been any error on the handle."
2594 #: ../src/guestfs.pod:1341
2596 "There has been an error but the errno was meaningless. This corresponds to "
2597 "the case where the error did not come from a failed system call, but for "
2598 "some other reason."
2602 #: ../src/guestfs.pod:1347
2604 "There was an error from a failed system call, but for some reason the errno "
2605 "was not captured and returned. This usually indicates a bug in libguestfs."
2609 #: ../src/guestfs.pod:1353
2611 "Libguestfs tries to convert the errno from inside the applicance into a "
2612 "corresponding errno for the caller (not entirely trivial: the appliance "
2613 "might be running a completely different operating system from the library "
2614 "and error numbers are not standardized across Un*xen). If this could not be "
2615 "done, then the error is translated to C<EINVAL>. In practice this should "
2616 "only happen in very rare circumstances."
2620 #: ../src/guestfs.pod:1361
2621 msgid "guestfs_set_error_handler"
2625 #: ../src/guestfs.pod:1363
2628 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2630 " const char *msg);\n"
2631 " void guestfs_set_error_handler (guestfs_h *g,\n"
2632 " guestfs_error_handler_cb cb,\n"
2638 #: ../src/guestfs.pod:1370
2640 "The callback C<cb> will be called if there is an error. The parameters "
2641 "passed to the callback are an opaque data pointer and the error message "
2646 #: ../src/guestfs.pod:1374
2648 "C<errno> is not passed to the callback. To get that the callback must call "
2649 "L</guestfs_last_errno>."
2653 #: ../src/guestfs.pod:1377
2655 "Note that the message string C<msg> is freed as soon as the callback "
2656 "function returns, so if you want to stash it somewhere you must make your "
2661 #: ../src/guestfs.pod:1381
2662 msgid "The default handler prints messages on C<stderr>."
2666 #: ../src/guestfs.pod:1383
2667 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2671 #: ../src/guestfs.pod:1385
2672 msgid "guestfs_get_error_handler"
2676 #: ../src/guestfs.pod:1387
2679 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2680 " void **opaque_rtn);\n"
2685 #: ../src/guestfs.pod:1390
2686 msgid "Returns the current error handler callback."
2690 #: ../src/guestfs.pod:1392
2691 msgid "guestfs_set_out_of_memory_handler"
2695 #: ../src/guestfs.pod:1394
2698 " typedef void (*guestfs_abort_cb) (void);\n"
2699 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2700 " guestfs_abort_cb);\n"
2705 #: ../src/guestfs.pod:1398
2707 "The callback C<cb> will be called if there is an out of memory situation. "
2708 "I<Note this callback must not return>."
2712 #: ../src/guestfs.pod:1401
2713 msgid "The default is to call L<abort(3)>."
2717 #: ../src/guestfs.pod:1403
2718 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2722 #: ../src/guestfs.pod:1406
2723 msgid "guestfs_get_out_of_memory_handler"
2727 #: ../src/guestfs.pod:1408
2730 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2735 #: ../src/guestfs.pod:1410
2736 msgid "This returns the current out of memory handler."
2740 #: ../src/guestfs.pod:1412
2745 #: ../src/guestfs.pod:1414 ../fish/guestfish.pod:958
2750 #: ../src/guestfs.pod:1416
2755 #: ../src/guestfs.pod:1418
2760 #: ../src/guestfs.pod:1420
2761 msgid "AVAILABILITY"
2765 #: ../src/guestfs.pod:1422
2766 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2770 #: ../src/guestfs.pod:1424
2772 "Using L</guestfs_available> you can test availability of the following "
2773 "groups of functions. This test queries the appliance to see if the "
2774 "appliance you are currently using supports the functionality."
2778 #: ../src/guestfs.pod:1429
2779 msgid "@AVAILABILITY@"
2783 #: ../src/guestfs.pod:1431
2784 msgid "GUESTFISH supported COMMAND"
2788 #: ../src/guestfs.pod:1433
2790 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2791 "prints out the available groups and whether they are supported by this build "
2792 "of libguestfs. Note however that you have to do C<run> first."
2796 #: ../src/guestfs.pod:1438
2797 msgid "SINGLE CALLS AT COMPILE TIME"
2801 #: ../src/guestfs.pod:1440
2803 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2804 "function, such as:"
2808 #: ../src/guestfs.pod:1443
2811 " #define LIBGUESTFS_HAVE_DD 1\n"
2816 #: ../src/guestfs.pod:1445
2817 msgid "if L</guestfs_dd> is available."
2821 #: ../src/guestfs.pod:1447
2823 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2824 "function is available at compile time, we recommended using build tools such "
2825 "as autoconf or cmake. For example in autotools you could use:"
2829 #: ../src/guestfs.pod:1452
2832 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2833 " AC_CHECK_FUNCS([guestfs_dd])\n"
2838 #: ../src/guestfs.pod:1455
2840 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2845 #: ../src/guestfs.pod:1458
2846 msgid "SINGLE CALLS AT RUN TIME"
2850 #: ../src/guestfs.pod:1460
2852 "Testing at compile time doesn't guarantee that a function really exists in "
2853 "the library. The reason is that you might be dynamically linked against a "
2854 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2855 "This situation unfortunately results in a segmentation fault, which is a "
2856 "shortcoming of the C dynamic linking system itself."
2860 #: ../src/guestfs.pod:1467
2862 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2863 "in this example program (note that you still need the compile time check as "
2868 #: ../src/guestfs.pod:1471
2871 " #include <stdio.h>\n"
2872 " #include <stdlib.h>\n"
2873 " #include <unistd.h>\n"
2874 " #include <dlfcn.h>\n"
2875 " #include <guestfs.h>\n"
2880 #: ../src/guestfs.pod:1477
2885 " #ifdef LIBGUESTFS_HAVE_DD\n"
2887 " int has_function;\n"
2892 #: ../src/guestfs.pod:1483
2895 " /* Test if the function guestfs_dd is really available. */\n"
2896 " dl = dlopen (NULL, RTLD_LAZY);\n"
2898 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2899 " exit (EXIT_FAILURE);\n"
2901 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2907 #: ../src/guestfs.pod:1492
2910 " if (!has_function)\n"
2911 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2913 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2914 " /* Now it's safe to call\n"
2915 " guestfs_dd (g, \"foo\", \"bar\");\n"
2919 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2926 #: ../src/guestfs.pod:1505
2928 "You may think the above is an awful lot of hassle, and it is. There are "
2929 "other ways outside of the C linking system to ensure that this kind of "
2930 "incompatibility never arises, such as using package versioning:"
2934 #: ../src/guestfs.pod:1510
2937 " Requires: libguestfs >= 1.0.80\n"
2942 #: ../src/guestfs.pod:1512
2943 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2947 #: ../src/guestfs.pod:1514
2949 "A recent feature of the API is the introduction of calls which take optional "
2950 "arguments. In C these are declared 3 ways. The main way is as a call which "
2951 "takes variable arguments (ie. C<...>), as in this example:"
2955 #: ../src/guestfs.pod:1519
2958 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2963 #: ../src/guestfs.pod:1521
2965 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2966 "call with no optional arguments specified:"
2970 #: ../src/guestfs.pod:1524
2973 " guestfs_add_drive_opts (g, filename, -1);\n"
2978 #: ../src/guestfs.pod:1526
2979 msgid "With a single optional argument:"
2983 #: ../src/guestfs.pod:1528
2986 " guestfs_add_drive_opts (g, filename,\n"
2987 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2993 #: ../src/guestfs.pod:1532
2998 #: ../src/guestfs.pod:1534
3001 " guestfs_add_drive_opts (g, filename,\n"
3002 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3003 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3009 #: ../src/guestfs.pod:1539
3011 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3016 #: ../src/guestfs.pod:1542
3017 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3021 #: ../src/guestfs.pod:1544
3023 "The second variant has the same name with the suffix C<_va>, which works the "
3024 "same way but takes a C<va_list>. See the C manual for details. For the "
3025 "example function, this is declared:"
3029 #: ../src/guestfs.pod:1548
3032 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3038 #: ../src/guestfs.pod:1551
3039 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3043 #: ../src/guestfs.pod:1553
3045 "The third variant is useful where you need to construct these calls. You "
3046 "pass in a structure where you fill in the optional fields. The structure "
3047 "has a bitmask as the first element which you must set to indicate which "
3048 "fields you have filled in. For our example function the structure and call "
3053 #: ../src/guestfs.pod:1559
3056 " struct guestfs_add_drive_opts_argv {\n"
3057 " uint64_t bitmask;\n"
3059 " const char *format;\n"
3062 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3063 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3068 #: ../src/guestfs.pod:1568
3069 msgid "You could call it like this:"
3073 #: ../src/guestfs.pod:1570
3076 " struct guestfs_add_drive_opts_argv optargs = {\n"
3077 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3078 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3080 " .format = \"qcow2\"\n"
3086 #: ../src/guestfs.pod:1577
3089 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3094 #: ../src/guestfs.pod:1579 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1253 ../tools/virt-win-reg.pl:532
3099 #: ../src/guestfs.pod:1585
3100 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3104 #: ../src/guestfs.pod:1590
3105 msgid "You do not need to fill in all fields of the structure."
3109 #: ../src/guestfs.pod:1594
3111 "There must be a one-to-one correspondence between fields of the structure "
3112 "that are filled in, and bits set in the bitmask."
3116 #: ../src/guestfs.pod:1599
3117 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3121 #: ../src/guestfs.pod:1601
3123 "In other languages, optional arguments are expressed in the way that is "
3124 "natural for that language. We refer you to the language-specific "
3125 "documentation for more details on that."
3129 #: ../src/guestfs.pod:1605
3130 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3134 #: ../src/guestfs.pod:1607
3135 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3139 #: ../src/guestfs.pod:1609
3141 "The child process generates events in some situations. Current events "
3142 "include: receiving a log message, the child process exits."
3146 #: ../src/guestfs.pod:1612
3148 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3153 #: ../src/guestfs.pod:1615
3155 "Only I<one callback of each type> can be registered for each handle. "
3156 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3157 "that type. Cancel all callbacks of this type by calling this function with "
3158 "C<cb> set to C<NULL>."
3162 #: ../src/guestfs.pod:1620
3163 msgid "guestfs_set_log_message_callback"
3167 #: ../src/guestfs.pod:1622
3170 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3171 " char *buf, int len);\n"
3172 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3173 " guestfs_log_message_cb cb,\n"
3179 #: ../src/guestfs.pod:1628
3181 "The callback function C<cb> will be called whenever qemu or the guest writes "
3182 "anything to the console."
3186 #: ../src/guestfs.pod:1631
3187 msgid "Use this function to capture kernel messages and similar."
3191 #: ../src/guestfs.pod:1633
3193 "Normally there is no log message handler, and log messages are just "
3198 #: ../src/guestfs.pod:1636
3199 msgid "guestfs_set_subprocess_quit_callback"
3203 #: ../src/guestfs.pod:1638
3206 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3207 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3208 " guestfs_subprocess_quit_cb cb,\n"
3214 #: ../src/guestfs.pod:1643
3216 "The callback function C<cb> will be called when the child process quits, "
3217 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3218 "corresponds to a transition from any state to the CONFIG state)."
3222 #: ../src/guestfs.pod:1648
3223 msgid "guestfs_set_launch_done_callback"
3227 #: ../src/guestfs.pod:1650
3230 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3231 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3232 " guestfs_launch_done_cb cb,\n"
3238 #: ../src/guestfs.pod:1655
3240 "The callback function C<cb> will be called when the child process becomes "
3241 "ready first time after it has been launched. (This corresponds to a "
3242 "transition from LAUNCHING to the READY state)."
3246 #: ../src/guestfs.pod:1659
3247 msgid "guestfs_set_close_callback"
3251 #: ../src/guestfs.pod:1661
3254 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3255 " void guestfs_set_close_callback (guestfs_h *g,\n"
3256 " guestfs_close_cb cb,\n"
3262 #: ../src/guestfs.pod:1666
3264 "The callback function C<cb> will be called while the handle is being closed "
3265 "(synchronously from L</guestfs_close>)."
3269 #: ../src/guestfs.pod:1669
3271 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3272 "handles that are open when the program exits. This means that this callback "
3273 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3274 "problems in higher-level languages (eg. if your HLL interpreter has already "
3275 "been cleaned up by the time this is called, and if your callback then jumps "
3276 "into some HLL function)."
3280 #: ../src/guestfs.pod:1677
3281 msgid "guestfs_set_progress_callback"
3285 #: ../src/guestfs.pod:1679
3288 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3289 " int proc_nr, int serial,\n"
3290 " uint64_t position, uint64_t total);\n"
3291 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3292 " guestfs_progress_cb cb,\n"
3298 #: ../src/guestfs.pod:1686
3300 "Some long-running operations can generate progress messages. If this "
3301 "callback is registered, then it will be called each time a progress message "
3302 "is generated (usually two seconds after the operation started, and three "
3303 "times per second thereafter until it completes, although the frequency may "
3304 "change in future versions)."
3308 #: ../src/guestfs.pod:1692
3310 "The callback receives two numbers: C<position> and C<total>. The units of "
3311 "C<total> are not defined, although for some operations C<total> may relate "
3312 "in some way to the amount of data to be transferred (eg. in bytes or "
3313 "megabytes), and C<position> may be the portion which has been transferred."
3317 #: ../src/guestfs.pod:1698
3318 msgid "The only defined and stable parts of the API are:"
3322 #: ../src/guestfs.pod:1704
3324 "The callback can display to the user some type of progress bar or indicator "
3325 "which shows the ratio of C<position>:C<total>."
3329 #: ../src/guestfs.pod:1709
3330 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3334 #: ../src/guestfs.pod:1713
3336 "If any progress notification is sent during a call, then a final progress "
3337 "notification is always sent when C<position> = C<total>."
3341 #: ../src/guestfs.pod:1716
3343 "This is to simplify caller code, so callers can easily set the progress "
3344 "indicator to \"100%\" at the end of the operation, without requiring special "
3345 "code to detect this case."
3349 #: ../src/guestfs.pod:1722
3351 "The callback also receives the procedure number and serial number of the "
3352 "call. These are only useful for debugging protocol issues, and the callback "
3353 "can normally ignore them. The callback may want to print these numbers in "
3354 "error messages or debugging messages."
3358 #: ../src/guestfs.pod:1727
3359 msgid "PRIVATE DATA AREA"
3363 #: ../src/guestfs.pod:1729
3365 "You can attach named pieces of private data to the libguestfs handle, and "
3366 "fetch them by name for the lifetime of the handle. This is called the "
3367 "private data area and is only available from the C API."
3371 #: ../src/guestfs.pod:1733
3372 msgid "To attach a named piece of data, use the following call:"
3376 #: ../src/guestfs.pod:1735
3379 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3384 #: ../src/guestfs.pod:1737
3386 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3387 "pointer (which can be C<NULL>). Any previous item with the same name is "
3392 #: ../src/guestfs.pod:1741
3394 "You can use any C<key> you want, but names beginning with an underscore "
3395 "character are reserved for internal libguestfs purposes (for implementing "
3396 "language bindings). It is recommended to prefix the name with some unique "
3397 "string to avoid collisions with other users."
3401 #: ../src/guestfs.pod:1746
3402 msgid "To retrieve the pointer, use:"
3406 #: ../src/guestfs.pod:1748
3409 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3414 #: ../src/guestfs.pod:1750
3416 "This function returns C<NULL> if either no data is found associated with "
3417 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3422 #: ../src/guestfs.pod:1754
3424 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3425 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3426 "all. In particular, libguestfs does I<not> try to free the data when the "
3427 "handle is closed. If the data must be freed, then the caller must either "
3428 "free it before calling L</guestfs_close> or must set up a close callback to "
3429 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3430 "can be registered for a handle)."
3434 #: ../src/guestfs.pod:1762
3436 "The private data area is implemented using a hash table, and should be "
3437 "reasonably efficient for moderate numbers of keys."
3441 #: ../src/guestfs.pod:1765 ../src/guestfs.pod:1770
3446 #: ../src/guestfs.pod:1767
3448 "<!-- old anchor for the next section --> <a "
3449 "name=\"state_machine_and_low_level_event_api\"/>"
3453 #: ../src/guestfs.pod:1772
3454 msgid "ARCHITECTURE"
3458 #: ../src/guestfs.pod:1774
3460 "Internally, libguestfs is implemented by running an appliance (a special "
3461 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3462 "process of the main program."
3466 #: ../src/guestfs.pod:1778
3469 " ___________________\n"
3471 " | main program |\n"
3473 " | | child process / appliance\n"
3474 " | | __________________________\n"
3476 " +-------------------+ RPC | +-----------------+ |\n"
3477 " | libguestfs <--------------------> guestfsd | |\n"
3478 " | | | +-----------------+ |\n"
3479 " \\___________________/ | | Linux kernel | |\n"
3480 " | +--^--------------+ |\n"
3481 " \\_________|________________/\n"
3487 " \\______________/\n"
3492 #: ../src/guestfs.pod:1798
3494 "The library, linked to the main program, creates the child process and hence "
3495 "the appliance in the L</guestfs_launch> function."
3499 #: ../src/guestfs.pod:1801
3501 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3502 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3503 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3504 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3505 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3506 "attached to the qemu process which translates device access by the "
3507 "appliance's Linux kernel into accesses to the image."
3511 #: ../src/guestfs.pod:1810
3513 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3514 "Although the disk image you are attached to might also be used by some "
3515 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3516 "care if both libguestfs's qemu process and your virtual machine are trying "
3517 "to update the disk image at the same time, since these usually results in "
3518 "massive disk corruption)."
3522 #: ../src/guestfs.pod:1817
3523 msgid "STATE MACHINE"
3527 #: ../src/guestfs.pod:1819
3528 msgid "libguestfs uses a state machine to model the child process:"
3532 #: ../src/guestfs.pod:1821
3544 " / | \\ \\ guestfs_launch\n"
3545 " / | _\\__V______\n"
3547 " / | | LAUNCHING |\n"
3548 " / | \\___________/\n"
3550 " / | guestfs_launch\n"
3552 " ______ / __|____V\n"
3553 " / \\ ------> / \\\n"
3554 " | BUSY | | READY |\n"
3555 " \\______/ <------ \\________/\n"
3560 #: ../src/guestfs.pod:1843
3562 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3563 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3564 "(3) alternating between READY and BUSY as commands are issued to, and "
3565 "carried out by, the child process."
3569 #: ../src/guestfs.pod:1848
3571 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3572 "asynchronously at any time (eg. due to some internal error), and that causes "
3573 "the state to transition back to CONFIG."
3577 #: ../src/guestfs.pod:1852
3579 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3580 "issued when in the CONFIG state."
3584 #: ../src/guestfs.pod:1855
3586 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3587 "L</guestfs_launch> blocks until the child process is READY to accept "
3588 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3589 "moves the state from CONFIG to LAUNCHING while it is running."
3593 #: ../src/guestfs.pod:1861
3595 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3596 "state. These API calls block waiting for the command to be carried out "
3597 "(ie. the state to transition to BUSY and then back to READY). There are no "
3598 "non-blocking versions, and no way to issue more than one command per handle "
3603 #: ../src/guestfs.pod:1867
3605 "Finally, the child process sends asynchronous messages back to the main "
3606 "program, such as kernel log messages. You can register a callback to "
3607 "receive these messages."
3611 #: ../src/guestfs.pod:1871
3616 #: ../src/guestfs.pod:1873
3617 msgid "COMMUNICATION PROTOCOL"
3621 #: ../src/guestfs.pod:1875
3623 "Don't rely on using this protocol directly. This section documents how it "
3624 "currently works, but it may change at any time."
3628 #: ../src/guestfs.pod:1878
3630 "The protocol used to talk between the library and the daemon running inside "
3631 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3632 "1014, RFC 1832, RFC 4506)."
3636 #: ../src/guestfs.pod:1882
3638 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3639 "this file is automatically generated)."
3643 #: ../src/guestfs.pod:1885
3645 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3646 "and C<FileOut> parameters, which are handled with very simple request/reply "
3647 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3648 "parameters, which use the same request and reply messages, but they may also "
3649 "be followed by files sent using a chunked encoding."
3653 #: ../src/guestfs.pod:1892
3654 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3658 #: ../src/guestfs.pod:1894
3659 msgid "For ordinary functions, the request message is:"
3663 #: ../src/guestfs.pod:1896
3666 " total length (header + arguments,\n"
3667 " but not including the length word itself)\n"
3668 " struct guestfs_message_header (encoded as XDR)\n"
3669 " struct guestfs_<foo>_args (encoded as XDR)\n"
3674 #: ../src/guestfs.pod:1901
3676 "The total length field allows the daemon to allocate a fixed size buffer "
3677 "into which it slurps the rest of the message. As a result, the total length "
3678 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3679 "effective size of any request is limited to somewhere under this size."
3683 #: ../src/guestfs.pod:1907
3685 "Note also that many functions don't take any arguments, in which case the "
3686 "C<guestfs_I<foo>_args> is completely omitted."
3690 #: ../src/guestfs.pod:1910
3692 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3693 "receiver knows what type of args structure to expect, or none at all."
3697 #: ../src/guestfs.pod:1914
3699 "For functions that take optional arguments, the optional arguments are "
3700 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3701 "arguments. A bitmask in the header indicates which optional arguments are "
3702 "meaningful. The bitmask is also checked to see if it contains bits set "
3703 "which the daemon does not know about (eg. if more optional arguments were "
3704 "added in a later version of the library), and this causes the call to be "
3709 #: ../src/guestfs.pod:1922
3710 msgid "The reply message for ordinary functions is:"
3714 #: ../src/guestfs.pod:1924
3717 " total length (header + ret,\n"
3718 " but not including the length word itself)\n"
3719 " struct guestfs_message_header (encoded as XDR)\n"
3720 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3725 #: ../src/guestfs.pod:1929
3727 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3728 "functions that return no formal return values."
3732 #: ../src/guestfs.pod:1932
3733 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3737 #: ../src/guestfs.pod:1935
3739 "In the case of an error, a flag is set in the header, and the reply message "
3740 "is slightly changed:"
3744 #: ../src/guestfs.pod:1938
3747 " total length (header + error,\n"
3748 " but not including the length word itself)\n"
3749 " struct guestfs_message_header (encoded as XDR)\n"
3750 " struct guestfs_message_error (encoded as XDR)\n"
3755 #: ../src/guestfs.pod:1943
3757 "The C<guestfs_message_error> structure contains the error message as a "
3762 #: ../src/guestfs.pod:1946
3763 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3767 #: ../src/guestfs.pod:1948
3769 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3770 "The normal request message is sent (see above). However this is followed by "
3771 "a sequence of file chunks."
3775 #: ../src/guestfs.pod:1952
3778 " total length (header + arguments,\n"
3779 " but not including the length word itself,\n"
3780 " and not including the chunks)\n"
3781 " struct guestfs_message_header (encoded as XDR)\n"
3782 " struct guestfs_<foo>_args (encoded as XDR)\n"
3783 " sequence of chunks for FileIn param #0\n"
3784 " sequence of chunks for FileIn param #1 etc.\n"
3789 #: ../src/guestfs.pod:1960
3790 msgid "The \"sequence of chunks\" is:"
3794 #: ../src/guestfs.pod:1962
3797 " length of chunk (not including length word itself)\n"
3798 " struct guestfs_chunk (encoded as XDR)\n"
3799 " length of chunk\n"
3800 " struct guestfs_chunk (encoded as XDR)\n"
3802 " length of chunk\n"
3803 " struct guestfs_chunk (with data.data_len == 0)\n"
3808 #: ../src/guestfs.pod:1970
3810 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3811 "is set in the final chunk to indicate either successful completion or early "
3816 #: ../src/guestfs.pod:1974
3818 "At time of writing there are no functions that have more than one FileIn "
3819 "parameter. However this is (theoretically) supported, by sending the "
3820 "sequence of chunks for each FileIn parameter one after another (from left to "
3825 #: ../src/guestfs.pod:1979
3827 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3828 "transfer. The library does this by sending a chunk with a special flag set "
3829 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3830 "RPC, does I<not> send any reply, and goes back to reading the next request."
3834 #: ../src/guestfs.pod:1985
3836 "The daemon may also cancel. It does this by writing a special word "
3837 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3838 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3839 "cancel chunk). The special word is chosen so that even if cancellation "
3840 "happens right at the end of the transfer (after the library has finished "
3841 "writing and has started listening for the reply), the \"spurious\" cancel "
3842 "flag will not be confused with the reply message."
3846 #: ../src/guestfs.pod:1994
3848 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3849 "limit), and also files where the size is not known in advance (eg. from "
3850 "pipes or sockets). However the chunks are rather small "
3851 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3852 "to keep much in memory."
3856 #: ../src/guestfs.pod:2000
3857 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3861 #: ../src/guestfs.pod:2002
3863 "The protocol for FileOut parameters is exactly the same as for FileIn "
3864 "parameters, but with the roles of daemon and library reversed."
3868 #: ../src/guestfs.pod:2005
3871 " total length (header + ret,\n"
3872 " but not including the length word itself,\n"
3873 " and not including the chunks)\n"
3874 " struct guestfs_message_header (encoded as XDR)\n"
3875 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3876 " sequence of chunks for FileOut param #0\n"
3877 " sequence of chunks for FileOut param #1 etc.\n"
3882 #: ../src/guestfs.pod:2013
3883 msgid "INITIAL MESSAGE"
3887 #: ../src/guestfs.pod:2015
3889 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3890 "which indicates that the guest and daemon is alive. This is what "
3891 "L</guestfs_launch> waits for."
3895 #: ../src/guestfs.pod:2019
3896 msgid "PROGRESS NOTIFICATION MESSAGES"
3900 #: ../src/guestfs.pod:2021
3902 "The daemon may send progress notification messages at any time. These are "
3903 "distinguished by the normal length word being replaced by "
3904 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3908 #: ../src/guestfs.pod:2025
3910 "The library turns them into progress callbacks (see "
3911 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3912 "discards them if not."
3916 #: ../src/guestfs.pod:2029
3918 "The daemon self-limits the frequency of progress messages it sends (see "
3919 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3924 #: ../src/guestfs.pod:2033
3925 msgid "LIBGUESTFS VERSION NUMBERS"
3929 #: ../src/guestfs.pod:2035
3931 "Since April 2010, libguestfs has started to make separate development and "
3932 "stable releases, along with corresponding branches in our git repository. "
3933 "These separate releases can be identified by version number:"
3937 #: ../src/guestfs.pod:2040
3940 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3941 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3947 " | `-------- sub-version\n"
3949 " `------ always '1' because we don't change the ABI\n"
3954 #: ../src/guestfs.pod:2051
3955 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3959 #: ../src/guestfs.pod:2053
3961 "As time passes we cherry pick fixes from the development branch and backport "
3962 "those into the stable branch, the effect being that the stable branch should "
3963 "get more stable and less buggy over time. So the stable releases are ideal "
3964 "for people who don't need new features but would just like the software to "
3969 #: ../src/guestfs.pod:2059
3970 msgid "Our criteria for backporting changes are:"
3974 #: ../src/guestfs.pod:2065
3976 "Documentation changes which don't affect any code are backported unless the "
3977 "documentation refers to a future feature which is not in stable."
3981 #: ../src/guestfs.pod:2071
3983 "Bug fixes which are not controversial, fix obvious problems, and have been "
3984 "well tested are backported."
3988 #: ../src/guestfs.pod:2076
3990 "Simple rearrangements of code which shouldn't affect how it works get "
3991 "backported. This is so that the code in the two branches doesn't get too "
3992 "far out of step, allowing us to backport future fixes more easily."
3996 #: ../src/guestfs.pod:2082
3998 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3999 "exceptional case: the new feature is required in order to implement an "
4000 "important bug fix."
4004 #: ../src/guestfs.pod:2088
4006 "A new stable branch starts when we think the new features in development are "
4007 "substantial and compelling enough over the current stable branch to warrant "
4008 "it. When that happens we create new stable and development versions 1.N.0 "
4009 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4010 "stable at this point, but by backporting fixes from development, that branch "
4011 "will stabilize over time."
4015 #: ../src/guestfs.pod:2096
4016 msgid "EXTENDING LIBGUESTFS"
4020 #: ../src/guestfs.pod:2098
4021 msgid "ADDING A NEW API ACTION"
4025 #: ../src/guestfs.pod:2100
4027 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
4028 "documentation) are generated, and this makes it easy to extend the "
4033 #: ../src/guestfs.pod:2104
4034 msgid "To add a new API action there are two changes:"
4038 #: ../src/guestfs.pod:2110
4040 "You need to add a description of the call (name, parameters, return type, "
4041 "tests, documentation) to C<generator/generator_actions.ml>."
4045 #: ../src/guestfs.pod:2113
4047 "There are two sorts of API action, depending on whether the call goes "
4048 "through to the daemon in the appliance, or is serviced entirely by the "
4049 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
4050 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
4051 "an example of the latter, since a trace flag is maintained in the handle and "
4052 "all tracing is done on the library side."
4056 #: ../src/guestfs.pod:2121
4058 "Most new actions are of the first type, and get added to the "
4059 "C<daemon_functions> list. Each function has a unique procedure number used "
4060 "in the RPC protocol which is assigned to that action when we publish "
4061 "libguestfs and cannot be reused. Take the latest procedure number and "
4066 #: ../src/guestfs.pod:2127
4068 "For library-only actions of the second type, add to the "
4069 "C<non_daemon_functions> list. Since these functions are serviced by the "
4070 "library and do not travel over the RPC mechanism to the daemon, these "
4071 "functions do not need a procedure number, and so the procedure number is set "
4076 #: ../src/guestfs.pod:2135
4077 msgid "Implement the action (in C):"
4081 #: ../src/guestfs.pod:2137
4083 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
4084 "C<daemon/> directory."
4088 #: ../src/guestfs.pod:2140
4090 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
4091 "(note: double underscore) in the C<src/> directory."
4095 #: ../src/guestfs.pod:2143
4096 msgid "In either case, use another function as an example of what to do."
4100 #: ../src/guestfs.pod:2147
4101 msgid "After making these changes, use C<make> to compile."
4105 #: ../src/guestfs.pod:2149
4107 "Note that you don't need to implement the RPC, language bindings, manual "
4108 "pages or anything else. It's all automatically generated from the OCaml "
4113 #: ../src/guestfs.pod:2153
4114 msgid "ADDING TESTS FOR AN API ACTION"
4118 #: ../src/guestfs.pod:2155
4120 "You can supply zero or as many tests as you want per API call. The tests "
4121 "can either be added as part of the API description "
4122 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
4123 "drop a script into C<regressions/>. Note that adding a script to "
4124 "C<regressions/> is slower, so if possible use the first method."
4128 #: ../src/guestfs.pod:2161
4130 "The following describes the test environment used when you add an API test "
4131 "in C<generator_actions.ml>."
4135 #: ../src/guestfs.pod:2164
4136 msgid "The test environment has 4 block devices:"
4140 #: ../src/guestfs.pod:2168
4141 msgid "C</dev/sda> 500MB"
4145 #: ../src/guestfs.pod:2170
4146 msgid "General block device for testing."
4150 #: ../src/guestfs.pod:2172
4151 msgid "C</dev/sdb> 50MB"
4155 #: ../src/guestfs.pod:2174
4157 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
4162 #: ../src/guestfs.pod:2177
4163 msgid "C</dev/sdc> 10MB"
4167 #: ../src/guestfs.pod:2179
4168 msgid "Used in a few tests where two block devices are needed."
4172 #: ../src/guestfs.pod:2181
4177 #: ../src/guestfs.pod:2183
4178 msgid "ISO with fixed content (see C<images/test.iso>)."
4182 #: ../src/guestfs.pod:2187
4184 "To be able to run the tests in a reasonable amount of time, the libguestfs "
4185 "appliance and block devices are reused between tests. So don't try testing "
4186 "L</guestfs_kill_subprocess> :-x"
4190 #: ../src/guestfs.pod:2191
4192 "Each test starts with an initial scenario, selected using one of the "
4193 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
4194 "initialize the disks mentioned above in a particular way as documented in "
4195 "C<generator_types.ml>. You should not assume anything about the previous "
4196 "contents of other disks that are not initialized."
4200 #: ../src/guestfs.pod:2197
4202 "You can add a prerequisite clause to any individual test. This is a "
4203 "run-time check, which, if it fails, causes the test to be skipped. Useful "
4204 "if testing a command which might not work on all variations of libguestfs "
4205 "builds. A test that has prerequisite of C<Always> means to run "
4210 #: ../src/guestfs.pod:2203
4212 "In addition, packagers can skip individual tests by setting environment "
4213 "variables before running C<make check>."
4217 #: ../src/guestfs.pod:2206
4220 " SKIP_TEST_<CMD>_<NUM>=1\n"
4225 #: ../src/guestfs.pod:2208
4226 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
4230 #: ../src/guestfs.pod:2210
4235 #: ../src/guestfs.pod:2212
4238 " SKIP_TEST_<CMD>=1\n"
4243 #: ../src/guestfs.pod:2214
4244 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
4248 #: ../src/guestfs.pod:2216
4249 msgid "Packagers can run only certain tests by setting for example:"
4253 #: ../src/guestfs.pod:2218
4256 " TEST_ONLY=\"vfs_type zerofree\"\n"
4261 #: ../src/guestfs.pod:2220
4263 "See C<capitests/tests.c> for more details of how these environment variables "
4268 #: ../src/guestfs.pod:2223
4269 msgid "DEBUGGING NEW API ACTIONS"
4273 #: ../src/guestfs.pod:2225
4274 msgid "Test new actions work before submitting them."
4278 #: ../src/guestfs.pod:2227
4279 msgid "You can use guestfish to try out new commands."
4283 #: ../src/guestfs.pod:2229
4285 "Debugging the daemon is a problem because it runs inside a minimal "
4286 "environment. However you can fprintf messages in the daemon to stderr, and "
4287 "they will show up if you use C<guestfish -v>."
4291 #: ../src/guestfs.pod:2233
4292 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
4296 #: ../src/guestfs.pod:2235
4298 "Our C source code generally adheres to some basic code-formatting "
4299 "conventions. The existing code base is not totally consistent on this "
4300 "front, but we do prefer that contributed code be formatted similarly. In "
4301 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
4302 "indentation level, and other than that, follow the K&R style."
4306 #: ../src/guestfs.pod:2241
4308 "If you use Emacs, add the following to one of one of your start-up files "
4309 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
4313 #: ../src/guestfs.pod:2244
4316 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
4317 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
4318 " (add-hook 'find-file-hook\n"
4319 " '(lambda () (if (and buffer-file-name\n"
4320 " (string-match \"/libguestfs\\\\>\"\n"
4321 " (buffer-file-name))\n"
4322 " (not (string-equal mode-name \"Change Log\"))\n"
4323 " (not (string-equal mode-name \"Makefile\")))\n"
4324 " (setq indent-tabs-mode nil))))\n"
4329 #: ../src/guestfs.pod:2254
4332 " ;;; When editing C sources in libguestfs, use this style.\n"
4333 " (defun libguestfs-c-mode ()\n"
4334 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
4336 " (c-set-style \"K&R\")\n"
4337 " (setq c-indent-level 2)\n"
4338 " (setq c-basic-offset 2))\n"
4339 " (add-hook 'c-mode-hook\n"
4340 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
4341 " (buffer-file-name))\n"
4342 " (libguestfs-c-mode))))\n"
4347 #: ../src/guestfs.pod:2266
4348 msgid "Enable warnings when compiling (and fix any problems this finds):"
4352 #: ../src/guestfs.pod:2269
4355 " ./configure --enable-gcc-warnings\n"
4360 #: ../src/guestfs.pod:2271
4361 msgid "Useful targets are:"
4365 #: ../src/guestfs.pod:2273
4368 " make syntax-check # checks the syntax of the C code\n"
4369 " make check # runs the test suite\n"
4374 #: ../src/guestfs.pod:2276
4375 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
4379 #: ../src/guestfs.pod:2278
4381 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
4382 "which are used to do shell quoting."
4386 #: ../src/guestfs.pod:2283
4391 #: ../src/guestfs.pod:2285
4393 "Simple shell quoted string. Any spaces or other shell characters are "
4398 #: ../src/guestfs.pod:2288
4403 #: ../src/guestfs.pod:2290
4405 "Same as C<%Q> except the string is treated as a path which is prefixed by "
4410 #: ../src/guestfs.pod:2295 ../fish/guestfish.pod:240 ../fish/guestfish.pod:594
4411 msgid "For example:"
4415 #: ../src/guestfs.pod:2297
4418 " asprintf (&cmd, \"cat %R\", path);\n"
4423 #: ../src/guestfs.pod:2299
4424 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
4428 #: ../src/guestfs.pod:2301
4430 "I<Note:> Do I<not> use these when you are passing parameters to the "
4431 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
4432 "because they are not passed via the shell (instead, straight to exec). You "
4433 "probably want to use the C<sysroot_path()> function however."
4437 #: ../src/guestfs.pod:2307
4438 msgid "SUBMITTING YOUR NEW API ACTIONS"
4442 #: ../src/guestfs.pod:2309
4444 "Submit patches to the mailing list: "
4445 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
4446 "L<rjones@redhat.com>."
4450 #: ../src/guestfs.pod:2313
4451 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
4455 #: ../src/guestfs.pod:2315
4456 msgid "We support i18n (gettext anyhow) in the library."
4460 #: ../src/guestfs.pod:2317
4462 "However many messages come from the daemon, and we don't translate those at "
4463 "the moment. One reason is that the appliance generally has all locale files "
4464 "removed from it, because they take up a lot of space. So we'd have to readd "
4465 "some of those, as well as copying our PO files into the appliance."
4469 #: ../src/guestfs.pod:2323
4471 "Debugging messages are never translated, since they are intended for the "
4476 #: ../src/guestfs.pod:2326
4477 msgid "SOURCE CODE SUBDIRECTORIES"
4481 #: ../src/guestfs.pod:2330
4482 msgid "C<appliance>"
4486 #: ../src/guestfs.pod:2332
4487 msgid "The libguestfs appliance, build scripts and so on."
4491 #: ../src/guestfs.pod:2334
4492 msgid "C<capitests>"
4496 #: ../src/guestfs.pod:2336
4497 msgid "Automated tests of the C API."
4501 #: ../src/guestfs.pod:2338
4506 #: ../src/guestfs.pod:2340
4508 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
4513 #: ../src/guestfs.pod:2343
4518 #: ../src/guestfs.pod:2345
4519 msgid "Outside contributions, experimental parts."
4523 #: ../src/guestfs.pod:2347
4528 #: ../src/guestfs.pod:2349
4530 "The daemon that runs inside the libguestfs appliance and carries out "
4535 #: ../src/guestfs.pod:2352
4540 #: ../src/guestfs.pod:2354
4541 msgid "L<virt-df(1)> command and documentation."
4545 #: ../src/guestfs.pod:2356
4550 #: ../src/guestfs.pod:2358
4551 msgid "C API example code."
4555 #: ../src/guestfs.pod:2360
4560 #: ../src/guestfs.pod:2362
4562 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
4563 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
4564 "L<virt-tar-out(1)>."
4568 #: ../src/guestfs.pod:2366
4573 #: ../src/guestfs.pod:2368
4574 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
4578 #: ../src/guestfs.pod:2370
4579 msgid "C<generator>"
4583 #: ../src/guestfs.pod:2372
4585 "The crucially important generator, used to automatically generate large "
4586 "amounts of boilerplate C code for things like RPC and bindings."
4590 #: ../src/guestfs.pod:2375
4595 #: ../src/guestfs.pod:2377
4596 msgid "Files used by the test suite."
4600 #: ../src/guestfs.pod:2379
4601 msgid "Some \"phony\" guest images which we test against."
4605 #: ../src/guestfs.pod:2381
4606 msgid "C<inspector>"
4610 #: ../src/guestfs.pod:2383
4611 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
4615 #: ../src/guestfs.pod:2385
4620 #: ../src/guestfs.pod:2387
4621 msgid "M4 macros used by autoconf."
4625 #: ../src/guestfs.pod:2389
4630 #: ../src/guestfs.pod:2391
4631 msgid "Translations of simple gettext strings."
4635 #: ../src/guestfs.pod:2393
4640 #: ../src/guestfs.pod:2395
4642 "The build infrastructure and PO files for translations of manpages and POD "
4643 "files. Eventually this will be combined with the C<po> directory, but that "
4644 "is rather complicated."
4648 #: ../src/guestfs.pod:2399
4649 msgid "C<regressions>"
4653 #: ../src/guestfs.pod:2401
4654 msgid "Regression tests."
4658 #: ../src/guestfs.pod:2403
4663 #: ../src/guestfs.pod:2405
4664 msgid "L<virt-rescue(1)> command and documentation."
4668 #: ../src/guestfs.pod:2407
4673 #: ../src/guestfs.pod:2409
4674 msgid "Source code to the C library."
4678 #: ../src/guestfs.pod:2411
4683 #: ../src/guestfs.pod:2413
4684 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
4688 #: ../src/guestfs.pod:2415
4689 msgid "C<test-tool>"
4693 #: ../src/guestfs.pod:2417
4695 "Test tool for end users to test if their qemu/kernel combination will work "
4700 #: ../src/guestfs.pod:2420
4705 #: ../src/guestfs.pod:2422
4710 #: ../src/guestfs.pod:2424
4715 #: ../src/guestfs.pod:2426
4720 #: ../src/guestfs.pod:2428
4725 #: ../src/guestfs.pod:2430
4730 #: ../src/guestfs.pod:2432
4735 #: ../src/guestfs.pod:2434
4740 #: ../src/guestfs.pod:2436
4741 msgid "Language bindings."
4745 #: ../src/guestfs.pod:2440 ../fish/guestfish.pod:965 ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
4746 msgid "ENVIRONMENT VARIABLES"
4750 #: ../src/guestfs.pod:2444 ../fish/guestfish.pod:991
4751 msgid "LIBGUESTFS_APPEND"
4755 #: ../src/guestfs.pod:2446 ../fish/guestfish.pod:993
4756 msgid "Pass additional options to the guest kernel."
4760 #: ../src/guestfs.pod:2448 ../fish/guestfish.pod:995
4761 msgid "LIBGUESTFS_DEBUG"
4765 #: ../src/guestfs.pod:2450
4767 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
4768 "effect as calling C<guestfs_set_verbose (g, 1)>."
4772 #: ../src/guestfs.pod:2453 ../fish/guestfish.pod:1000
4773 msgid "LIBGUESTFS_MEMSIZE"
4777 #: ../src/guestfs.pod:2455 ../fish/guestfish.pod:1002
4778 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
4782 #: ../src/guestfs.pod:2458 ../fish/guestfish.pod:1005
4785 " LIBGUESTFS_MEMSIZE=700\n"
4790 #: ../src/guestfs.pod:2460 ../fish/guestfish.pod:1007
4791 msgid "LIBGUESTFS_PATH"
4795 #: ../src/guestfs.pod:2462
4797 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4798 "the discussion of paths in section PATH above."
4802 #: ../src/guestfs.pod:2465 ../fish/guestfish.pod:1012
4803 msgid "LIBGUESTFS_QEMU"
4807 #: ../src/guestfs.pod:2467 ../fish/guestfish.pod:1014
4809 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4810 "which was found at compile time by the configure script is used."
4814 #: ../src/guestfs.pod:2471
4815 msgid "See also L</QEMU WRAPPERS> above."
4819 #: ../src/guestfs.pod:2473 ../fish/guestfish.pod:1018
4820 msgid "LIBGUESTFS_TRACE"
4824 #: ../src/guestfs.pod:2475
4826 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4827 "effect as calling C<guestfs_set_trace (g, 1)>."
4831 #: ../src/guestfs.pod:2478 ../fish/guestfish.pod:1027
4836 #: ../src/guestfs.pod:2480 ../fish/guestfish.pod:1029
4837 msgid "Location of temporary directory, defaults to C</tmp>."
4841 #: ../src/guestfs.pod:2482 ../fish/guestfish.pod:1031
4843 "If libguestfs was compiled to use the supermin appliance then the real "
4844 "appliance is cached in this directory, shared between all handles belonging "
4845 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4846 "use in case C</tmp> is not large enough."
4850 #: ../src/guestfs.pod:2490 ../fish/guestfish.pod:1089 ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233 ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572 ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:257
4855 #: ../src/guestfs.pod:2492
4857 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
4858 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, "
4859 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
4860 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
4861 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
4862 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
4863 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
4864 "L<http://libguestfs.org/>."
4868 #: ../src/guestfs.pod:2519
4870 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
4871 "L<lvm(8)>, L<disktype(1)>."
4875 #: ../src/guestfs.pod:2526 ../tools/virt-win-reg.pl:587 ../tools/virt-make-fs.pl:548
4880 #: ../src/guestfs.pod:2528
4881 msgid "To get a list of bugs against libguestfs use this link:"
4885 #: ../src/guestfs.pod:2530
4886 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
4890 #: ../src/guestfs.pod:2532
4891 msgid "To report a new bug against libguestfs use this link:"
4895 #: ../src/guestfs.pod:2534
4896 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
4900 #: ../src/guestfs.pod:2536
4901 msgid "When reporting a bug, please check:"
4905 #: ../src/guestfs.pod:2542
4906 msgid "That the bug hasn't been reported already."
4910 #: ../src/guestfs.pod:2546
4911 msgid "That you are testing a recent version."
4915 #: ../src/guestfs.pod:2550
4916 msgid "Describe the bug accurately, and give a way to reproduce it."
4920 #: ../src/guestfs.pod:2554
4922 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4927 #: ../src/guestfs.pod:2559 ../fish/guestfish.pod:1112 ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4932 #: ../src/guestfs.pod:2561 ../fish/guestfish.pod:1114 ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4933 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4937 #: ../src/guestfs.pod:2563 ../fish/guestfish.pod:1116 ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248 ../tools/virt-edit.pl:368 ../tools/virt-win-reg.pl:602 ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:273
4942 #: ../src/guestfs.pod:2565 ../fish/guestfish.pod:1118 ../fuse/guestmount.pod:250
4943 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4947 #: ../src/guestfs.pod:2568
4949 "This library is free software; you can redistribute it and/or modify it "
4950 "under the terms of the GNU Lesser General Public License as published by the "
4951 "Free Software Foundation; either version 2 of the License, or (at your "
4952 "option) any later version."
4956 #: ../src/guestfs.pod:2573
4958 "This library is distributed in the hope that it will be useful, but WITHOUT "
4959 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4960 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4965 #: ../src/guestfs.pod:2578
4967 "You should have received a copy of the GNU Lesser General Public License "
4968 "along with this library; if not, write to the Free Software Foundation, "
4969 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4973 #: ../src/guestfs-actions.pod:1
4974 msgid "guestfs_add_cdrom"
4978 #: ../src/guestfs-actions.pod:3
4982 " guestfs_add_cdrom (guestfs_h *g,\n"
4983 " const char *filename);\n"
4988 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4989 msgid "This function adds a virtual CD-ROM disk image to the guest."
4993 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4994 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4998 #: ../src/guestfs-actions.pod:17
5000 "This call checks for the existence of C<filename>. This stops you from "
5001 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5002 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
5007 #: ../src/guestfs-actions.pod:24
5009 "If you just want to add an ISO file (often you use this as an efficient way "
5010 "to transfer large files into the guest), then you should probably use "
5011 "C<guestfs_add_drive_ro> instead."
5015 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126 ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428 ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487 ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533 ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633 ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779 ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161 ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262 ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2243 ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2448 ../src/guestfs-actions.pod:2483 ../src/guestfs-actions.pod:3222 ../src/guestfs-actions.pod:3237 ../src/guestfs-actions.pod:3257 ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:3439 ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:3504 ../src/guestfs-actions.pod:3576 ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3613 ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3659 ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3710 ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:3764 ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:3812 ../src/guestfs-actions.pod:3828 ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:3856 ../src/guestfs-actions.pod:3873 ../src/guestfs-actions.pod:3966 ../src/guestfs-actions.pod:3986 ../src/guestfs-actions.pod:3999 ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:4068 ../src/guestfs-actions.pod:4086 ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:4116 ../src/guestfs-actions.pod:4130 ../src/guestfs-actions.pod:4147 ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4182 ../src/guestfs-actions.pod:4226 ../src/guestfs-actions.pod:4299 ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4349 ../src/guestfs-actions.pod:4368 ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4397 ../src/guestfs-actions.pod:4410 ../src/guestfs-actions.pod:4425 ../src/guestfs-actions.pod:4440 ../src/guestfs-actions.pod:4475 ../src/guestfs-actions.pod:4490 ../src/guestfs-actions.pod:4510 ../src/guestfs-actions.pod:4524 ../src/guestfs-actions.pod:4541 ../src/guestfs-actions.pod:4590 ../src/guestfs-actions.pod:4627 ../src/guestfs-actions.pod:4641 ../src/guestfs-actions.pod:4669 ../src/guestfs-actions.pod:4686 ../src/guestfs-actions.pod:4704 ../src/guestfs-actions.pod:4838 ../src/guestfs-actions.pod:4895 ../src/guestfs-actions.pod:4917 ../src/guestfs-actions.pod:4935 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:5033 ../src/guestfs-actions.pod:5050 ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5077 ../src/guestfs-actions.pod:5366 ../src/guestfs-actions.pod:5385 ../src/guestfs-actions.pod:5399 ../src/guestfs-actions.pod:5411 ../src/guestfs-actions.pod:5425 ../src/guestfs-actions.pod:5437 ../src/guestfs-actions.pod:5451 ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5488 ../src/guestfs-actions.pod:5507 ../src/guestfs-actions.pod:5526 ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5567 ../src/guestfs-actions.pod:5585 ../src/guestfs-actions.pod:5604 ../src/guestfs-actions.pod:5625 ../src/guestfs-actions.pod:5644 ../src/guestfs-actions.pod:5661 ../src/guestfs-actions.pod:5689 ../src/guestfs-actions.pod:5713 ../src/guestfs-actions.pod:5732 ../src/guestfs-actions.pod:5756 ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5786 ../src/guestfs-actions.pod:5805 ../src/guestfs-actions.pod:5842 ../src/guestfs-actions.pod:5865 ../src/guestfs-actions.pod:5891 ../src/guestfs-actions.pod:5999 ../src/guestfs-actions.pod:6120 ../src/guestfs-actions.pod:6132 ../src/guestfs-actions.pod:6145 ../src/guestfs-actions.pod:6158 ../src/guestfs-actions.pod:6180 ../src/guestfs-actions.pod:6193 ../src/guestfs-actions.pod:6206 ../src/guestfs-actions.pod:6219 ../src/guestfs-actions.pod:6234 ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6326 ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6372 ../src/guestfs-actions.pod:6392 ../src/guestfs-actions.pod:6428 ../src/guestfs-actions.pod:6442 ../src/guestfs-actions.pod:6483 ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6514 ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:6584 ../src/guestfs-actions.pod:6703 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6790 ../src/guestfs-actions.pod:6803 ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:6881 ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:6961 ../src/guestfs-actions.pod:7027 ../src/guestfs-actions.pod:7046 ../src/guestfs-actions.pod:7075
5016 msgid "This function returns 0 on success or -1 on error."
5020 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:151 ../fish/guestfish-actions.pod:165
5022 "This function is deprecated. In new code, use the C<add_drive_opts> call "
5027 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243 ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435 ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942 ../src/guestfs-actions.pod:4187 ../src/guestfs-actions.pod:6969 ../src/guestfs-actions.pod:7138 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:154 ../fish/guestfish-actions.pod:168 ../fish/guestfish-actions.pod:949 ../fish/guestfish-actions.pod:1306 ../fish/guestfish-actions.pod:1320 ../fish/guestfish-actions.pod:2816 ../fish/guestfish-actions.pod:4618 ../fish/guestfish-actions.pod:4715
5029 "Deprecated functions will not be removed from the API, but the fact that "
5030 "they are deprecated indicates that there are problems with correct use of "
5035 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:3224 ../src/guestfs-actions.pod:3239 ../src/guestfs-actions.pod:4477 ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:5663 ../src/guestfs-actions.pod:5773 ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6883
5036 msgid "(Added in 0.3)"
5040 #: ../src/guestfs-actions.pod:41
5041 msgid "guestfs_add_domain"
5045 #: ../src/guestfs-actions.pod:43
5049 " guestfs_add_domain (guestfs_h *g,\n"
5050 " const char *dom,\n"
5056 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137 ../src/guestfs-actions.pod:4201
5058 "You may supply a list of optional arguments to this call. Use zero or more "
5059 "of the following pairs of parameters, and terminate the list with C<-1> on "
5060 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
5064 #: ../src/guestfs-actions.pod:53
5067 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
5068 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
5069 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
5074 #: ../src/guestfs-actions.pod:57
5076 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5077 "It works by connecting to libvirt, requesting the domain and domain XML from "
5078 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
5083 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
5085 "The number of disks added is returned. This operation is atomic: if an "
5086 "error is returned, then no disks are added."
5090 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
5092 "This function does some minimal checks to make sure the libvirt domain is "
5093 "not running (unless C<readonly> is true). In a future version we will try "
5094 "to acquire the libvirt lock on each disk."
5098 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
5100 "Disks must be accessible locally. This often means that adding disks from a "
5101 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5102 "unless those disks are accessible via the same device path locally too."
5106 #: ../src/guestfs-actions.pod:74 ../fish/guestfish-actions.pod:58
5108 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5109 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5110 "default libvirt URI (or one set through an environment variable, see the "
5111 "libvirt documentation for full details)."
5115 #: ../src/guestfs-actions.pod:80
5117 "The other optional parameters are passed directly through to "
5118 "C<guestfs_add_drive_opts>."
5122 #: ../src/guestfs-actions.pod:83 ../src/guestfs-actions.pod:336 ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307 ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864 ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003 ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2662 ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:4613 ../src/guestfs-actions.pod:4741 ../src/guestfs-actions.pod:5147 ../src/guestfs-actions.pod:5173 ../src/guestfs-actions.pod:6469 ../src/guestfs-actions.pod:6894 ../src/guestfs-actions.pod:6907 ../src/guestfs-actions.pod:6920
5123 msgid "On error this function returns -1."
5127 #: ../src/guestfs-actions.pod:85
5128 msgid "(Added in 1.7.4)"
5132 #: ../src/guestfs-actions.pod:87
5133 msgid "guestfs_add_domain_va"
5137 #: ../src/guestfs-actions.pod:89
5141 " guestfs_add_domain_va (guestfs_h *g,\n"
5142 " const char *dom,\n"
5148 #: ../src/guestfs-actions.pod:94
5149 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
5153 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107 ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211 ../src/guestfs-actions.pod:4240 ../src/guestfs-actions.pod:4252
5154 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
5158 #: ../src/guestfs-actions.pod:98
5159 msgid "guestfs_add_domain_argv"
5163 #: ../src/guestfs-actions.pod:100
5167 " guestfs_add_domain_argv (guestfs_h *g,\n"
5168 " const char *dom,\n"
5169 " const struct guestfs_add_domain_argv *optargs);\n"
5174 #: ../src/guestfs-actions.pod:105
5175 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
5179 #: ../src/guestfs-actions.pod:109
5180 msgid "guestfs_add_drive"
5184 #: ../src/guestfs-actions.pod:111
5188 " guestfs_add_drive (guestfs_h *g,\n"
5189 " const char *filename);\n"
5194 #: ../src/guestfs-actions.pod:115
5196 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
5197 "optional parameters, so the disk is added writable, with the format being "
5198 "detected automatically."
5202 #: ../src/guestfs-actions.pod:119
5204 "Automatic detection of the format opens you up to a potential security hole "
5205 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5206 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5207 "you should think about replacing calls to this function with calls to "
5208 "C<guestfs_add_drive_opts>, and specifying the format."
5212 #: ../src/guestfs-actions.pod:130
5213 msgid "guestfs_add_drive_opts"
5217 #: ../src/guestfs-actions.pod:132
5221 " guestfs_add_drive_opts (guestfs_h *g,\n"
5222 " const char *filename,\n"
5228 #: ../src/guestfs-actions.pod:142
5231 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
5232 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
5233 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
5238 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:90
5240 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5241 "The first time you call this function, the disk appears as C</dev/sda>, the "
5242 "second time as C</dev/sdb>, and so on."
5246 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:95
5248 "You don't necessarily need to be root when using libguestfs. However you "
5249 "obviously do need sufficient permissions to access the filename for whatever "
5250 "operations you want to perform (ie. read access if you just want to read the "
5251 "image or write access if you want to modify the image)."
5255 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:101
5256 msgid "This call checks that C<filename> exists."
5260 #: ../src/guestfs-actions.pod:159 ../src/guestfs-actions.pod:4211 ../fish/guestfish-actions.pod:103 ../fish/guestfish-actions.pod:2827
5261 msgid "The optional arguments are:"
5265 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:107
5270 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
5272 "If true then the image is treated as read-only. Writes are still allowed, "
5273 "but they are stored in a temporary snapshot overlay which is discarded at "
5274 "the end. The disk that you add is not modified."
5278 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:113
5283 #: ../src/guestfs-actions.pod:171
5285 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
5286 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
5287 "Possible formats include C<raw> and C<qcow2>."
5291 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:119
5293 "Automatic detection of the format opens you up to a potential security hole "
5294 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5295 "RHBZ#642934. Specifying the format closes this security hole."
5299 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:124
5304 #: ../src/guestfs-actions.pod:182
5306 "This rarely-used option lets you emulate the behaviour of the deprecated "
5307 "C<guestfs_add_drive_with_if> call (q.v.)"
5311 #: ../src/guestfs-actions.pod:189
5312 msgid "(Added in 1.5.23)"
5316 #: ../src/guestfs-actions.pod:191
5317 msgid "guestfs_add_drive_opts_va"
5321 #: ../src/guestfs-actions.pod:193
5325 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
5326 " const char *filename,\n"
5332 #: ../src/guestfs-actions.pod:198
5333 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
5337 #: ../src/guestfs-actions.pod:202
5338 msgid "guestfs_add_drive_opts_argv"
5342 #: ../src/guestfs-actions.pod:204
5346 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
5347 " const char *filename,\n"
5348 " const struct guestfs_add_drive_opts_argv "
5354 #: ../src/guestfs-actions.pod:209
5355 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
5359 #: ../src/guestfs-actions.pod:213
5360 msgid "guestfs_add_drive_ro"
5364 #: ../src/guestfs-actions.pod:215
5368 " guestfs_add_drive_ro (guestfs_h *g,\n"
5369 " const char *filename);\n"
5374 #: ../src/guestfs-actions.pod:219
5376 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
5377 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
5378 "disk is added read-only, with the format being detected automatically."
5382 #: ../src/guestfs-actions.pod:226
5383 msgid "(Added in 1.0.38)"
5387 #: ../src/guestfs-actions.pod:228
5388 msgid "guestfs_add_drive_ro_with_if"
5392 #: ../src/guestfs-actions.pod:230
5396 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
5397 " const char *filename,\n"
5398 " const char *iface);\n"
5403 #: ../src/guestfs-actions.pod:235
5405 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
5406 "QEMU interface emulation to use at run time."
5410 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268 ../src/guestfs-actions.pod:2333
5411 msgid "(Added in 1.0.84)"
5415 #: ../src/guestfs-actions.pod:249
5416 msgid "guestfs_add_drive_with_if"
5420 #: ../src/guestfs-actions.pod:251
5424 " guestfs_add_drive_with_if (guestfs_h *g,\n"
5425 " const char *filename,\n"
5426 " const char *iface);\n"
5431 #: ../src/guestfs-actions.pod:256
5433 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
5434 "QEMU interface emulation to use at run time."
5438 #: ../src/guestfs-actions.pod:270
5439 msgid "guestfs_aug_clear"
5443 #: ../src/guestfs-actions.pod:272
5447 " guestfs_aug_clear (guestfs_h *g,\n"
5448 " const char *augpath);\n"
5453 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:176
5455 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5456 "L<augtool(1)> C<clear> command."
5460 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
5461 msgid "(Added in 1.3.4)"
5465 #: ../src/guestfs-actions.pod:283
5466 msgid "guestfs_aug_close"
5470 #: ../src/guestfs-actions.pod:285
5474 " guestfs_aug_close (guestfs_h *g);\n"
5479 #: ../src/guestfs-actions.pod:288
5481 "Close the current Augeas handle and free up any resources used by it. After "
5482 "calling this, you have to call C<guestfs_aug_init> again before you can use "
5483 "any other Augeas functions."
5487 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320 ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430 ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475 ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535 ../src/guestfs-actions.pod:5224
5488 msgid "(Added in 0.7)"
5492 #: ../src/guestfs-actions.pod:297
5493 msgid "guestfs_aug_defnode"
5497 #: ../src/guestfs-actions.pod:299
5500 " struct guestfs_int_bool *\n"
5501 " guestfs_aug_defnode (guestfs_h *g,\n"
5502 " const char *name,\n"
5503 " const char *expr,\n"
5504 " const char *val);\n"
5509 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:192
5510 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5514 #: ../src/guestfs-actions.pod:308
5516 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5517 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
5518 "containing that single node."
5522 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:199
5524 "On success this returns a pair containing the number of nodes in the "
5525 "nodeset, and a boolean flag if a node was created."
5529 #: ../src/guestfs-actions.pod:316
5531 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
5532 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
5536 #: ../src/guestfs-actions.pod:322
5537 msgid "guestfs_aug_defvar"
5541 #: ../src/guestfs-actions.pod:324
5545 " guestfs_aug_defvar (guestfs_h *g,\n"
5546 " const char *name,\n"
5547 " const char *expr);\n"
5552 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:207
5554 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5555 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5559 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:211
5561 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5562 "evaluates to something which is not a nodeset."
5566 #: ../src/guestfs-actions.pod:340
5567 msgid "guestfs_aug_get"
5571 #: ../src/guestfs-actions.pod:342
5575 " guestfs_aug_get (guestfs_h *g,\n"
5576 " const char *augpath);\n"
5581 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:218
5583 "Look up the value associated with C<path>. If C<path> matches exactly one "
5584 "node, the C<value> is returned."
5588 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927 ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046 ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193 ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341 ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644 ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824 ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936 ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2586 ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2744 ../src/guestfs-actions.pod:2775 ../src/guestfs-actions.pod:2799 ../src/guestfs-actions.pod:2861 ../src/guestfs-actions.pod:2884 ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3748 ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:4028 ../src/guestfs-actions.pod:4759 ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:5122 ../src/guestfs-actions.pod:5300 ../src/guestfs-actions.pod:5349 ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5928 ../src/guestfs-actions.pod:5945 ../src/guestfs-actions.pod:5969 ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6662 ../src/guestfs-actions.pod:6680 ../src/guestfs-actions.pod:6860 ../src/guestfs-actions.pod:7132
5590 "This function returns a string, or NULL on error. I<The caller must free "
5591 "the returned string after use>."
5595 #: ../src/guestfs-actions.pod:354
5596 msgid "guestfs_aug_init"
5600 #: ../src/guestfs-actions.pod:356
5604 " guestfs_aug_init (guestfs_h *g,\n"
5605 " const char *root,\n"
5611 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:225
5613 "Create a new Augeas handle for editing configuration files. If there was "
5614 "any previous Augeas handle associated with this guestfs session, then it is "
5619 #: ../src/guestfs-actions.pod:365
5620 msgid "You must call this before using any other C<guestfs_aug_*> commands."
5624 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:232
5625 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5629 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:235
5631 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5632 "logical I<or> of the following integers:"
5636 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:241
5637 msgid "C<AUG_SAVE_BACKUP> = 1"
5641 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
5642 msgid "Keep the original file with a C<.augsave> extension."
5646 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
5647 msgid "C<AUG_SAVE_NEWFILE> = 2"
5651 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
5653 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5654 "original. Overrides C<AUG_SAVE_BACKUP>."
5658 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:250
5659 msgid "C<AUG_TYPE_CHECK> = 4"
5663 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
5664 msgid "Typecheck lenses (can be expensive)."
5668 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
5669 msgid "C<AUG_NO_STDINC> = 8"
5673 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
5674 msgid "Do not use standard load path for modules."
5678 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
5679 msgid "C<AUG_SAVE_NOOP> = 16"
5683 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
5684 msgid "Make save a no-op, just record what would have been changed."
5688 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
5689 msgid "C<AUG_NO_LOAD> = 32"
5693 #: ../src/guestfs-actions.pod:400
5694 msgid "Do not load the tree in C<guestfs_aug_init>."
5698 #: ../src/guestfs-actions.pod:404
5699 msgid "To close the handle, you can call C<guestfs_aug_close>."
5703 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:270
5704 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5708 #: ../src/guestfs-actions.pod:412
5709 msgid "guestfs_aug_insert"
5713 #: ../src/guestfs-actions.pod:414
5717 " guestfs_aug_insert (guestfs_h *g,\n"
5718 " const char *augpath,\n"
5719 " const char *label,\n"
5725 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:276
5727 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5728 "or after C<path> (depending on the boolean flag C<before>)."
5732 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:280
5734 "C<path> must match exactly one existing node in the tree, and C<label> must "
5735 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5739 #: ../src/guestfs-actions.pod:432
5740 msgid "guestfs_aug_load"
5744 #: ../src/guestfs-actions.pod:434
5748 " guestfs_aug_load (guestfs_h *g);\n"
5753 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:288
5754 msgid "Load files into the tree."
5758 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
5759 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5763 #: ../src/guestfs-actions.pod:446
5764 msgid "guestfs_aug_ls"
5768 #: ../src/guestfs-actions.pod:448
5772 " guestfs_aug_ls (guestfs_h *g,\n"
5773 " const char *augpath);\n"
5778 #: ../src/guestfs-actions.pod:452
5780 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5781 "sorting the resulting nodes into alphabetical order."
5785 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471 ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065 ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375 ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497 ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2178 ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2280 ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2400 ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:3318 ../src/guestfs-actions.pod:3380 ../src/guestfs-actions.pod:3485 ../src/guestfs-actions.pod:3890 ../src/guestfs-actions.pod:4574 ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:5220 ../src/guestfs-actions.pod:5334 ../src/guestfs-actions.pod:5985 ../src/guestfs-actions.pod:6046 ../src/guestfs-actions.pod:6101 ../src/guestfs-actions.pod:6247 ../src/guestfs-actions.pod:6271 ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6820 ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7004 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7173
5787 "This function returns a NULL-terminated array of strings (like "
5788 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
5789 "strings and the array after use>."
5793 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990 ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3142 ../src/guestfs-actions.pod:3731 ../src/guestfs-actions.pod:3781 ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:4001 ../src/guestfs-actions.pod:4164 ../src/guestfs-actions.pod:4578 ../src/guestfs-actions.pod:5035 ../src/guestfs-actions.pod:5413 ../src/guestfs-actions.pod:5427 ../src/guestfs-actions.pod:5439 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:6485 ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:6973
5794 msgid "(Added in 0.8)"
5798 #: ../src/guestfs-actions.pod:461
5799 msgid "guestfs_aug_match"
5803 #: ../src/guestfs-actions.pod:463
5807 " guestfs_aug_match (guestfs_h *g,\n"
5808 " const char *augpath);\n"
5813 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:304
5815 "Returns a list of paths which match the path expression C<path>. The "
5816 "returned paths are sufficiently qualified so that they match exactly one "
5817 "node in the current tree."
5821 #: ../src/guestfs-actions.pod:477
5822 msgid "guestfs_aug_mv"
5826 #: ../src/guestfs-actions.pod:479
5830 " guestfs_aug_mv (guestfs_h *g,\n"
5831 " const char *src,\n"
5832 " const char *dest);\n"
5837 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:312
5839 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5840 "C<dest> is overwritten if it exists."
5844 #: ../src/guestfs-actions.pod:491
5845 msgid "guestfs_aug_rm"
5849 #: ../src/guestfs-actions.pod:493
5853 " guestfs_aug_rm (guestfs_h *g,\n"
5854 " const char *augpath);\n"
5859 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:319
5860 msgid "Remove C<path> and all of its children."
5864 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5865 msgid "On success this returns the number of entries which were removed."
5869 #: ../src/guestfs-actions.pod:505
5870 msgid "guestfs_aug_save"
5874 #: ../src/guestfs-actions.pod:507
5878 " guestfs_aug_save (guestfs_h *g);\n"
5883 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:327
5884 msgid "This writes all pending changes to disk."
5888 #: ../src/guestfs-actions.pod:512
5890 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5895 #: ../src/guestfs-actions.pod:519
5896 msgid "guestfs_aug_set"
5900 #: ../src/guestfs-actions.pod:521
5904 " guestfs_aug_set (guestfs_h *g,\n"
5905 " const char *augpath,\n"
5906 " const char *val);\n"
5911 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:336
5912 msgid "Set the value associated with C<path> to C<val>."
5916 #: ../src/guestfs-actions.pod:528
5918 "In the Augeas API, it is possible to clear a node by setting the value to "
5919 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5920 "this call. Instead you must use the C<guestfs_aug_clear> call."
5924 #: ../src/guestfs-actions.pod:537
5925 msgid "guestfs_available"
5929 #: ../src/guestfs-actions.pod:539
5933 " guestfs_available (guestfs_h *g,\n"
5934 " char *const *groups);\n"
5939 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:347
5941 "This command is used to check the availability of some groups of "
5942 "functionality in the appliance, which not all builds of the libguestfs "
5943 "appliance will be able to provide."
5947 #: ../src/guestfs-actions.pod:547
5949 "The libguestfs groups, and the functions that those groups correspond to, "
5950 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5951 "runtime by calling C<guestfs_available_all_groups>."
5955 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:356
5957 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
5958 "\"augeas\"]> would check for the availability of the Linux inotify functions "
5959 "and Augeas (configuration file editing) functions."
5963 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:361
5964 msgid "The command returns no error if I<all> requested groups are available."
5968 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5970 "It fails with an error if one or more of the requested groups is unavailable "
5975 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:366
5977 "If an unknown group name is included in the list of groups then an error is "
5982 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:369
5987 #: ../src/guestfs-actions.pod:571
5988 msgid "You must call C<guestfs_launch> before calling this function."
5992 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:377
5994 "The reason is because we don't know what groups are supported by the "
5995 "appliance/daemon until it is running and can be queried."
5999 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:383
6001 "If a group of functions is available, this does not necessarily mean that "
6002 "they will work. You still have to check for errors when calling individual "
6003 "API functions even if they are available."
6007 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:390
6009 "It is usually the job of distro packagers to build complete functionality "
6010 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6011 "with all requirements satisfied, will support everything."
6015 #: ../src/guestfs-actions.pod:593
6017 "This call was added in version C<1.0.80>. In previous versions of "
6018 "libguestfs all you could do would be to speculatively execute a command to "
6019 "find out if the daemon implemented it. See also C<guestfs_version>."
6023 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
6024 msgid "(Added in 1.0.80)"
6028 #: ../src/guestfs-actions.pod:604
6029 msgid "guestfs_available_all_groups"
6033 #: ../src/guestfs-actions.pod:606
6037 " guestfs_available_all_groups (guestfs_h *g);\n"
6042 #: ../src/guestfs-actions.pod:609
6044 "This command returns a list of all optional groups that this daemon knows "
6045 "about. Note this returns both supported and unsupported groups. To find "
6046 "out which ones the daemon can actually support you have to call "
6047 "C<guestfs_available> on each member of the returned list."
6051 #: ../src/guestfs-actions.pod:615
6052 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
6056 #: ../src/guestfs-actions.pod:621
6057 msgid "(Added in 1.3.15)"
6061 #: ../src/guestfs-actions.pod:623
6062 msgid "guestfs_base64_in"
6066 #: ../src/guestfs-actions.pod:625
6070 " guestfs_base64_in (guestfs_h *g,\n"
6071 " const char *base64file,\n"
6072 " const char *filename);\n"
6077 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:420
6078 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6082 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
6083 msgid "(Added in 1.3.5)"
6087 #: ../src/guestfs-actions.pod:637
6088 msgid "guestfs_base64_out"
6092 #: ../src/guestfs-actions.pod:639
6096 " guestfs_base64_out (guestfs_h *g,\n"
6097 " const char *filename,\n"
6098 " const char *base64file);\n"
6103 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:429
6105 "This command downloads the contents of C<filename>, writing it out to local "
6106 "file C<base64file> encoded as base64."
6110 #: ../src/guestfs-actions.pod:651
6111 msgid "guestfs_blockdev_flushbufs"
6115 #: ../src/guestfs-actions.pod:653
6119 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
6120 " const char *device);\n"
6125 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:438
6126 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6130 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677 ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708 ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777 ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:452 ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:496 ../fish/guestfish-actions.pod:504 ../fish/guestfish-actions.pod:515 ../fish/guestfish-actions.pod:523 ../fish/guestfish-actions.pod:531
6131 msgid "This uses the L<blockdev(8)> command."
6135 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781 ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
6136 msgid "(Added in 0.9.3)"
6140 #: ../src/guestfs-actions.pod:666
6141 msgid "guestfs_blockdev_getbsz"
6145 #: ../src/guestfs-actions.pod:668
6149 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
6150 " const char *device);\n"
6155 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:447
6156 msgid "This returns the block size of a device."
6160 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:512
6162 "(Note this is different from both I<size in blocks> and I<filesystem block "
6167 #: ../src/guestfs-actions.pod:683
6168 msgid "guestfs_blockdev_getro"
6172 #: ../src/guestfs-actions.pod:685
6176 " guestfs_blockdev_getro (guestfs_h *g,\n"
6177 " const char *device);\n"
6182 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:458
6184 "Returns a boolean indicating if the block device is read-only (true if "
6185 "read-only, false if not)."
6189 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396 ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891 ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974 ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044 ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:3050 ../src/guestfs-actions.pod:3064 ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3124 ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3154 ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3181 ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211 ../src/guestfs-actions.pod:4723
6190 msgid "This function returns a C truth value on success or -1 on error."
6194 #: ../src/guestfs-actions.pod:698
6195 msgid "guestfs_blockdev_getsize64"
6199 #: ../src/guestfs-actions.pod:700
6203 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
6204 " const char *device);\n"
6209 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:467
6210 msgid "This returns the size of the device in bytes."
6214 #: ../src/guestfs-actions.pod:706
6215 msgid "See also C<guestfs_blockdev_getsz>."
6219 #: ../src/guestfs-actions.pod:714
6220 msgid "guestfs_blockdev_getss"
6224 #: ../src/guestfs-actions.pod:716
6228 " guestfs_blockdev_getss (guestfs_h *g,\n"
6229 " const char *device);\n"
6234 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:477
6236 "This returns the size of sectors on a block device. Usually 512, but can be "
6237 "larger for modern devices."
6241 #: ../src/guestfs-actions.pod:723
6243 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
6248 #: ../src/guestfs-actions.pod:732
6249 msgid "guestfs_blockdev_getsz"
6253 #: ../src/guestfs-actions.pod:734
6257 " guestfs_blockdev_getsz (guestfs_h *g,\n"
6258 " const char *device);\n"
6263 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:489
6265 "This returns the size of the device in units of 512-byte sectors (even if "
6266 "the sectorsize isn't 512 bytes ... weird)."
6270 #: ../src/guestfs-actions.pod:741
6272 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
6273 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
6277 #: ../src/guestfs-actions.pod:751
6278 msgid "guestfs_blockdev_rereadpt"
6282 #: ../src/guestfs-actions.pod:753
6286 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
6287 " const char *device);\n"
6292 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:502
6293 msgid "Reread the partition table on C<device>."
6297 #: ../src/guestfs-actions.pod:765
6298 msgid "guestfs_blockdev_setbsz"
6302 #: ../src/guestfs-actions.pod:767
6306 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
6307 " const char *device,\n"
6308 " int blocksize);\n"
6313 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:510
6314 msgid "This sets the block size of a device."
6318 #: ../src/guestfs-actions.pod:783
6319 msgid "guestfs_blockdev_setro"
6323 #: ../src/guestfs-actions.pod:785
6327 " guestfs_blockdev_setro (guestfs_h *g,\n"
6328 " const char *device);\n"
6333 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:521
6334 msgid "Sets the block device named C<device> to read-only."
6338 #: ../src/guestfs-actions.pod:797
6339 msgid "guestfs_blockdev_setrw"
6343 #: ../src/guestfs-actions.pod:799
6347 " guestfs_blockdev_setrw (guestfs_h *g,\n"
6348 " const char *device);\n"
6353 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:529
6354 msgid "Sets the block device named C<device> to read-write."
6358 #: ../src/guestfs-actions.pod:811
6359 msgid "guestfs_case_sensitive_path"
6363 #: ../src/guestfs-actions.pod:813
6367 " guestfs_case_sensitive_path (guestfs_h *g,\n"
6368 " const char *path);\n"
6373 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:537
6375 "This can be used to resolve case insensitive paths on a filesystem which is "
6376 "case sensitive. The use case is to resolve paths which you have read from "
6377 "Windows configuration files or the Windows Registry, to the true path."
6381 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:542
6383 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6384 "(and probably others), which is that although the underlying filesystem is "
6385 "case-insensitive, the driver exports the filesystem to Linux as "
6390 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:547
6392 "One consequence of this is that special directories such as C<c:\\windows> "
6393 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6394 "precise details of how they were created. In Windows itself this would not "
6399 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:553
6401 "Bug or feature? You decide: "
6402 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6406 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:556
6408 "This function resolves the true case of each element in the path and returns "
6409 "the case-sensitive path."
6413 #: ../src/guestfs-actions.pod:839
6415 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
6416 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6417 "how the directories were originally created under Windows)."
6421 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:564
6422 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6426 #: ../src/guestfs-actions.pod:847
6427 msgid "See also C<guestfs_realpath>."
6431 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6665
6432 msgid "(Added in 1.0.75)"
6436 #: ../src/guestfs-actions.pod:854
6441 #: ../src/guestfs-actions.pod:856
6445 " guestfs_cat (guestfs_h *g,\n"
6446 " const char *path);\n"
6451 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5210 ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:3462
6452 msgid "Return the contents of the file named C<path>."
6456 #: ../src/guestfs-actions.pod:862
6458 "Note that this function cannot correctly handle binary files (specifically, "
6459 "files containing C<\\0> character which is treated as end of string). For "
6460 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
6461 "functions which have a more complex interface."
6465 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049 ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360 ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482 ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750 ../src/guestfs-actions.pod:2198 ../src/guestfs-actions.pod:2217 ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2284 ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2330 ../src/guestfs-actions.pod:4992 ../src/guestfs-actions.pod:5018 ../src/guestfs-actions.pod:5149 ../src/guestfs-actions.pod:5175 ../src/guestfs-actions.pod:5199 ../src/guestfs-actions.pod:6050 ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6937 ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:6989 ../src/guestfs-actions.pod:7008 ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7112 ../src/guestfs-actions.pod:7158 ../src/guestfs-actions.pod:7177 ../fish/guestfish-actions.pod:580 ../fish/guestfish-actions.pod:715 ../fish/guestfish-actions.pod:727 ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:913 ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1185 ../fish/guestfish-actions.pod:1480 ../fish/guestfish-actions.pod:1490 ../fish/guestfish-actions.pod:1518 ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:1543 ../fish/guestfish-actions.pod:1562 ../fish/guestfish-actions.pod:3332 ../fish/guestfish-actions.pod:3347 ../fish/guestfish-actions.pod:3423 ../fish/guestfish-actions.pod:3440 ../fish/guestfish-actions.pod:3455 ../fish/guestfish-actions.pod:4038 ../fish/guestfish-actions.pod:4084 ../fish/guestfish-actions.pod:4169 ../fish/guestfish-actions.pod:4184 ../fish/guestfish-actions.pod:4594 ../fish/guestfish-actions.pod:4612 ../fish/guestfish-actions.pod:4629 ../fish/guestfish-actions.pod:4639 ../fish/guestfish-actions.pod:4687 ../fish/guestfish-actions.pod:4697 ../fish/guestfish-actions.pod:4726 ../fish/guestfish-actions.pod:4736
6467 "Because of the message protocol, there is a transfer limit of somewhere "
6468 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6472 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3384 ../src/guestfs-actions.pod:3401 ../src/guestfs-actions.pod:3489 ../src/guestfs-actions.pod:3894 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:5098 ../src/guestfs-actions.pod:5112 ../src/guestfs-actions.pod:6824 ../src/guestfs-actions.pod:6838
6473 msgid "(Added in 0.4)"
6477 #: ../src/guestfs-actions.pod:875
6478 msgid "guestfs_checksum"
6482 #: ../src/guestfs-actions.pod:877
6486 " guestfs_checksum (guestfs_h *g,\n"
6487 " const char *csumtype,\n"
6488 " const char *path);\n"
6493 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:587
6494 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6498 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:590
6500 "The type of checksum to compute is given by the C<csumtype> parameter which "
6501 "must have one of the following values:"
6505 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:595
6510 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
6512 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6517 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:600
6522 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
6523 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6527 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
6532 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
6533 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6537 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
6542 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
6543 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6547 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
6552 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
6553 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6557 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
6562 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
6563 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6567 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
6572 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
6573 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6577 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:626
6578 msgid "The checksum is returned as a printable string."
6582 #: ../src/guestfs-actions.pod:923
6583 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6587 #: ../src/guestfs-actions.pod:925
6588 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6592 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238 ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:3066 ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3156 ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:6521
6593 msgid "(Added in 1.0.2)"
6597 #: ../src/guestfs-actions.pod:932
6598 msgid "guestfs_checksum_device"
6602 #: ../src/guestfs-actions.pod:934
6606 " guestfs_checksum_device (guestfs_h *g,\n"
6607 " const char *csumtype,\n"
6608 " const char *device);\n"
6613 #: ../src/guestfs-actions.pod:939
6615 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6616 "device named C<device>. For the types of checksums supported see the "
6617 "C<guestfs_checksum> command."
6621 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4688 ../src/guestfs-actions.pod:4725 ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4919 ../src/guestfs-actions.pod:6430 ../src/guestfs-actions.pod:6444 ../src/guestfs-actions.pod:6850
6622 msgid "(Added in 1.3.2)"
6626 #: ../src/guestfs-actions.pod:948
6627 msgid "guestfs_checksums_out"
6631 #: ../src/guestfs-actions.pod:950
6635 " guestfs_checksums_out (guestfs_h *g,\n"
6636 " const char *csumtype,\n"
6637 " const char *directory,\n"
6638 " const char *sumsfile);\n"
6643 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:644
6645 "This command computes the checksums of all regular files in C<directory> and "
6646 "then emits a list of those checksums to the local output file C<sumsfile>."
6650 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:648
6652 "This can be used for verifying the integrity of a virtual machine. However "
6653 "to be properly secure you should pay attention to the output of the checksum "
6654 "command (it uses the ones from GNU coreutils). In particular when the "
6655 "filename is not printable, coreutils uses a special backslash syntax. For "
6656 "more information, see the GNU coreutils info file."
6660 #: ../src/guestfs-actions.pod:970
6661 msgid "(Added in 1.3.7)"
6665 #: ../src/guestfs-actions.pod:972
6666 msgid "guestfs_chmod"
6670 #: ../src/guestfs-actions.pod:974
6674 " guestfs_chmod (guestfs_h *g,\n"
6676 " const char *path);\n"
6681 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:662
6683 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6688 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:665
6690 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6691 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6696 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:4145 ../src/guestfs-actions.pod:4328 ../src/guestfs-actions.pod:4347 ../src/guestfs-actions.pod:4366 ../fish/guestfish-actions.pod:669 ../fish/guestfish-actions.pod:2791 ../fish/guestfish-actions.pod:2907 ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:2927
6697 msgid "The mode actually set is affected by the umask."
6701 #: ../src/guestfs-actions.pod:992
6702 msgid "guestfs_chown"
6706 #: ../src/guestfs-actions.pod:994
6710 " guestfs_chown (guestfs_h *g,\n"
6713 " const char *path);\n"
6718 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:675
6719 msgid "Change the file owner to C<owner> and group to C<group>."
6723 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3253 ../fish/guestfish-actions.pod:677 ../fish/guestfish-actions.pod:2249
6725 "Only numeric uid and gid are supported. If you want to use names, you will "
6726 "need to locate and parse the password file yourself (Augeas support makes "
6727 "this relatively easy)."
6731 #: ../src/guestfs-actions.pod:1010
6732 msgid "guestfs_command"
6736 #: ../src/guestfs-actions.pod:1012
6740 " guestfs_command (guestfs_h *g,\n"
6741 " char *const *arguments);\n"
6746 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:685
6748 "This call runs a command from the guest filesystem. The filesystem must be "
6749 "mounted, and must contain a compatible operating system (ie. something "
6750 "Linux, with the same or compatible processor architecture)."
6754 #: ../src/guestfs-actions.pod:1021
6756 "The single parameter is an argv-style list of arguments. The first element "
6757 "is the name of the program to run. Subsequent elements are parameters. The "
6758 "list must be non-empty (ie. must contain a program name). Note that the "
6759 "command runs directly, and is I<not> invoked via the shell (see "
6764 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:697
6765 msgid "The return value is anything printed to I<stdout> by the command."
6769 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:700
6771 "If the command returns a non-zero exit status, then this function returns an "
6772 "error message. The error message string is the content of I<stderr> from "
6777 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:704
6779 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6780 "C</bin>. If you require a program from another location, you should provide "
6781 "the full path in the first parameter."
6785 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:709
6787 "Shared libraries and data files required by the program must be available on "
6788 "filesystems which are mounted in the correct places. It is the caller's "
6789 "responsibility to ensure all filesystems that are needed are mounted at the "
6794 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1535
6795 msgid "(Added in 0.9.1)"
6799 #: ../src/guestfs-actions.pod:1054
6800 msgid "guestfs_command_lines"
6804 #: ../src/guestfs-actions.pod:1056
6808 " guestfs_command_lines (guestfs_h *g,\n"
6809 " char *const *arguments);\n"
6814 #: ../src/guestfs-actions.pod:1060
6816 "This is the same as C<guestfs_command>, but splits the result into a list of "
6821 #: ../src/guestfs-actions.pod:1063
6822 msgid "See also: C<guestfs_sh_lines>"
6826 #: ../src/guestfs-actions.pod:1074
6827 msgid "guestfs_config"
6831 #: ../src/guestfs-actions.pod:1076
6835 " guestfs_config (guestfs_h *g,\n"
6836 " const char *qemuparam,\n"
6837 " const char *qemuvalue);\n"
6842 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:734
6844 "This can be used to add arbitrary qemu command line parameters of the form "
6845 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6846 "setting some parameters which would interfere with parameters that we use."
6850 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:739
6851 msgid "The first character of C<param> string must be a C<-> (dash)."
6855 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6856 msgid "C<value> can be NULL."
6860 #: ../src/guestfs-actions.pod:1094
6861 msgid "guestfs_copy_size"
6865 #: ../src/guestfs-actions.pod:1096
6869 " guestfs_copy_size (guestfs_h *g,\n"
6870 " const char *src,\n"
6871 " const char *dest,\n"
6877 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:747
6879 "This command copies exactly C<size> bytes from one source device or file "
6880 "C<src> to another destination device or file C<dest>."
6884 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:750
6886 "Note this will fail if the source is too short or if the destination is not "
6891 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6516 ../src/guestfs-actions.pod:6550 ../src/guestfs-actions.pod:7029 ../src/guestfs-actions.pod:7048
6893 "This long-running command can generate progress notification messages so "
6894 "that the caller can display a progress bar or indicator. To receive these "
6895 "messages, the caller must register a progress callback. See "
6896 "L<guestfs(3)/guestfs_set_progress_callback>."
6900 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:3921 ../src/guestfs-actions.pod:5125 ../src/guestfs-actions.pod:6757 ../src/guestfs-actions.pod:6777 ../src/guestfs-actions.pod:6863
6901 msgid "(Added in 1.0.87)"
6905 #: ../src/guestfs-actions.pod:1117
6910 #: ../src/guestfs-actions.pod:1119
6914 " guestfs_cp (guestfs_h *g,\n"
6915 " const char *src,\n"
6916 " const char *dest);\n"
6921 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:757
6923 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6924 "destination filename or destination directory."
6928 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4592 ../src/guestfs-actions.pod:4969
6929 msgid "(Added in 1.0.18)"
6933 #: ../src/guestfs-actions.pod:1131
6934 msgid "guestfs_cp_a"
6938 #: ../src/guestfs-actions.pod:1133
6942 " guestfs_cp_a (guestfs_h *g,\n"
6943 " const char *src,\n"
6944 " const char *dest);\n"
6949 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:764
6951 "This copies a file or directory from C<src> to C<dest> recursively using the "
6956 #: ../src/guestfs-actions.pod:1145
6961 #: ../src/guestfs-actions.pod:1147
6965 " guestfs_dd (guestfs_h *g,\n"
6966 " const char *src,\n"
6967 " const char *dest);\n"
6972 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:771
6974 "This command copies from one source device or file C<src> to another "
6975 "destination device or file C<dest>. Normally you would use this to copy to "
6976 "or from a device or partition, for example to duplicate a filesystem."
6980 #: ../src/guestfs-actions.pod:1157
6982 "If the destination is a device, it must be as large or larger than the "
6983 "source file or device, otherwise the copy will fail. This command cannot do "
6984 "partial copies (see C<guestfs_copy_size>)."
6988 #: ../src/guestfs-actions.pod:1165
6993 #: ../src/guestfs-actions.pod:1167
6997 " guestfs_df (guestfs_h *g);\n"
7002 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:784
7003 msgid "This command runs the C<df> command to report disk space used."
7007 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189
7009 "This command is mostly useful for interactive sessions. It is I<not> "
7010 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
7015 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196 ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2263 ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:4031 ../src/guestfs-actions.pod:4492 ../src/guestfs-actions.pod:6254 ../src/guestfs-actions.pod:6278 ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:6922
7016 msgid "(Added in 1.0.54)"
7020 #: ../src/guestfs-actions.pod:1181
7021 msgid "guestfs_df_h"
7025 #: ../src/guestfs-actions.pod:1183
7029 " guestfs_df_h (guestfs_h *g);\n"
7034 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:794
7036 "This command runs the C<df -h> command to report disk space used in "
7037 "human-readable format."
7041 #: ../src/guestfs-actions.pod:1198
7042 msgid "guestfs_dmesg"
7046 #: ../src/guestfs-actions.pod:1200
7050 " guestfs_dmesg (guestfs_h *g);\n"
7055 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:805
7057 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7058 "This is sometimes useful for extended debugging of problems."
7062 #: ../src/guestfs-actions.pod:1207
7064 "Another way to get the same information is to enable verbose messages with "
7065 "C<guestfs_set_verbose> or by setting the environment variable "
7066 "C<LIBGUESTFS_DEBUG=1> before running the program."
7070 #: ../src/guestfs-actions.pod:1217
7071 msgid "guestfs_download"
7075 #: ../src/guestfs-actions.pod:1219
7079 " guestfs_download (guestfs_h *g,\n"
7080 " const char *remotefilename,\n"
7081 " const char *filename);\n"
7086 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249 ../fish/guestfish-actions.pod:818 ../fish/guestfish-actions.pod:831
7088 "Download file C<remotefilename> and save it as C<filename> on the local "
7093 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:821 ../fish/guestfish-actions.pod:4342
7094 msgid "C<filename> can also be a named pipe."
7098 #: ../src/guestfs-actions.pod:1229
7099 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
7103 #: ../src/guestfs-actions.pod:1240
7104 msgid "guestfs_download_offset"
7108 #: ../src/guestfs-actions.pod:1242
7112 " guestfs_download_offset (guestfs_h *g,\n"
7113 " const char *remotefilename,\n"
7114 " const char *filename,\n"
7115 " int64_t offset,\n"
7121 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:834
7123 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7124 "region must be within the file or device)."
7128 #: ../src/guestfs-actions.pod:1255
7130 "Note that there is no limit on the amount of data that can be downloaded "
7131 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
7132 "full amount unless an error occurs."
7136 #: ../src/guestfs-actions.pod:1260
7137 msgid "See also C<guestfs_download>, C<guestfs_pread>."
7141 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6555
7142 msgid "(Added in 1.5.17)"
7146 #: ../src/guestfs-actions.pod:1271
7147 msgid "guestfs_drop_caches"
7151 #: ../src/guestfs-actions.pod:1273
7155 " guestfs_drop_caches (guestfs_h *g,\n"
7156 " int whattodrop);\n"
7161 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:850
7163 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7164 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7165 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7169 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:855
7170 msgid "Setting C<whattodrop> to 3 should drop everything."
7174 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
7176 "This automatically calls L<sync(2)> before the operation, so that the "
7177 "maximum guest memory is freed."
7181 #: ../src/guestfs-actions.pod:1291
7186 #: ../src/guestfs-actions.pod:1293
7190 " guestfs_du (guestfs_h *g,\n"
7191 " const char *path);\n"
7196 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:864
7198 "This command runs the C<du -s> command to estimate file space usage for "
7203 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:867
7205 "C<path> can be a file or a directory. If C<path> is a directory then the "
7206 "estimate includes the contents of the directory and all subdirectories "
7211 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:871
7212 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7216 #: ../src/guestfs-actions.pod:1311
7217 msgid "guestfs_e2fsck_f"
7221 #: ../src/guestfs-actions.pod:1313
7225 " guestfs_e2fsck_f (guestfs_h *g,\n"
7226 " const char *device);\n"
7231 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:878
7233 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7234 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
7239 #: ../src/guestfs-actions.pod:1321
7241 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
7242 "Normally you should use C<guestfs_fsck>."
7246 #: ../src/guestfs-actions.pod:1326
7247 msgid "(Added in 1.0.29)"
7251 #: ../src/guestfs-actions.pod:1328
7252 msgid "guestfs_echo_daemon"
7256 #: ../src/guestfs-actions.pod:1330
7260 " guestfs_echo_daemon (guestfs_h *g,\n"
7261 " char *const *words);\n"
7266 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:889
7268 "This command concatenates the list of C<words> passed with single spaces "
7269 "between them and returns the resulting string."
7273 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:892
7274 msgid "You can use this command to test the connection through to the daemon."
7278 #: ../src/guestfs-actions.pod:1339
7279 msgid "See also C<guestfs_ping_daemon>."
7283 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:5758
7284 msgid "(Added in 1.0.69)"
7288 #: ../src/guestfs-actions.pod:1346
7289 msgid "guestfs_egrep"
7293 #: ../src/guestfs-actions.pod:1348
7297 " guestfs_egrep (guestfs_h *g,\n"
7298 " const char *regex,\n"
7299 " const char *path);\n"
7304 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:900
7305 msgid "This calls the external C<egrep> program and returns the matching lines."
7309 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382 ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2201 ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2376 ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2404 ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2472 ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3428 ../src/guestfs-actions.pod:3441 ../src/guestfs-actions.pod:3455 ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:5303 ../src/guestfs-actions.pod:5352 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6134 ../src/guestfs-actions.pod:6147 ../src/guestfs-actions.pod:6160 ../src/guestfs-actions.pod:6182 ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6208 ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6992 ../src/guestfs-actions.pod:7011 ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7115 ../src/guestfs-actions.pod:7161 ../src/guestfs-actions.pod:7180
7310 msgid "(Added in 1.0.66)"
7314 #: ../src/guestfs-actions.pod:1365
7315 msgid "guestfs_egrepi"
7319 #: ../src/guestfs-actions.pod:1367
7323 " guestfs_egrepi (guestfs_h *g,\n"
7324 " const char *regex,\n"
7325 " const char *path);\n"
7330 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:910
7331 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7335 #: ../src/guestfs-actions.pod:1384
7336 msgid "guestfs_equal"
7340 #: ../src/guestfs-actions.pod:1386
7344 " guestfs_equal (guestfs_h *g,\n"
7345 " const char *file1,\n"
7346 " const char *file2);\n"
7351 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:920
7353 "This compares the two files C<file1> and C<file2> and returns true if their "
7354 "content is exactly equal, or false otherwise."
7358 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:923
7359 msgid "The external L<cmp(1)> program is used for the comparison."
7363 #: ../src/guestfs-actions.pod:1400
7364 msgid "guestfs_exists"
7368 #: ../src/guestfs-actions.pod:1402
7372 " guestfs_exists (guestfs_h *g,\n"
7373 " const char *path);\n"
7378 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:929
7380 "This returns C<true> if and only if there is a file, directory (or anything) "
7381 "with the given C<path> name."
7385 #: ../src/guestfs-actions.pod:1409
7386 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
7390 #: ../src/guestfs-actions.pod:1415
7391 msgid "guestfs_fallocate"
7395 #: ../src/guestfs-actions.pod:1417
7399 " guestfs_fallocate (guestfs_h *g,\n"
7400 " const char *path,\n"
7406 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448 ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:957
7408 "This command preallocates a file (containing zero bytes) named C<path> of "
7409 "size C<len> bytes. If the file exists already, it is overwritten."
7413 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:942
7415 "Do not confuse this with the guestfish-specific C<alloc> command which "
7416 "allocates a file in the host and attaches it as a device."
7420 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:946
7422 "This function is deprecated. In new code, use the C<fallocate64> call "
7427 #: ../src/guestfs-actions.pod:1441
7428 msgid "guestfs_fallocate64"
7432 #: ../src/guestfs-actions.pod:1443
7436 " guestfs_fallocate64 (guestfs_h *g,\n"
7437 " const char *path,\n"
7443 #: ../src/guestfs-actions.pod:1452
7445 "Note that this call allocates disk blocks for the file. To create a sparse "
7446 "file use C<guestfs_truncate_size> instead."
7450 #: ../src/guestfs-actions.pod:1455
7452 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
7453 "oversight it only allowed 30 bit lengths to be specified, effectively "
7454 "limiting the maximum size of files created through that call to 1GB."
7458 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:969
7460 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7461 "commands which create a file in the host and attach it as a device."
7465 #: ../src/guestfs-actions.pod:1466
7466 msgid "(Added in 1.3.17)"
7470 #: ../src/guestfs-actions.pod:1468
7471 msgid "guestfs_fgrep"
7475 #: ../src/guestfs-actions.pod:1470
7479 " guestfs_fgrep (guestfs_h *g,\n"
7480 " const char *pattern,\n"
7481 " const char *path);\n"
7486 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:977
7487 msgid "This calls the external C<fgrep> program and returns the matching lines."
7491 #: ../src/guestfs-actions.pod:1487
7492 msgid "guestfs_fgrepi"
7496 #: ../src/guestfs-actions.pod:1489
7500 " guestfs_fgrepi (guestfs_h *g,\n"
7501 " const char *pattern,\n"
7502 " const char *path);\n"
7507 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:987
7508 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7512 #: ../src/guestfs-actions.pod:1506
7513 msgid "guestfs_file"
7517 #: ../src/guestfs-actions.pod:1508
7521 " guestfs_file (guestfs_h *g,\n"
7522 " const char *path);\n"
7527 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:997
7529 "This call uses the standard L<file(1)> command to determine the type or "
7530 "contents of the file."
7534 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1000
7536 "This call will also transparently look inside various types of compressed "
7541 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1003
7543 "The exact command which runs is C<file -zb path>. Note in particular that "
7544 "the filename is not prepended to the output (the C<-b> option)."
7548 #: ../src/guestfs-actions.pod:1522
7550 "This command can also be used on C</dev/> devices (and partitions, LV "
7551 "names). You can for example use this to determine if a device contains a "
7552 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7556 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1012
7558 "If the C<path> does not begin with C</dev/> then this command only works for "
7559 "the content of regular files. For other file types (directory, symbolic "
7560 "link etc) it will just return the string C<directory> etc."
7564 #: ../src/guestfs-actions.pod:1537
7565 msgid "guestfs_file_architecture"
7569 #: ../src/guestfs-actions.pod:1539
7573 " guestfs_file_architecture (guestfs_h *g,\n"
7574 " const char *filename);\n"
7579 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1021
7581 "This detects the architecture of the binary C<filename>, and returns it if "
7586 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1024
7587 msgid "Currently defined architectures are:"
7591 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1028
7596 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
7598 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7599 "irrespective of the precise processor requirements of the binary."
7603 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1033
7608 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
7609 msgid "64 bit x86-64."
7613 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
7618 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
7619 msgid "32 bit SPARC."
7623 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
7628 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
7629 msgid "64 bit SPARC V9 and above."
7633 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
7638 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
7639 msgid "Intel Itanium."
7643 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
7648 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
7649 msgid "32 bit Power PC."
7653 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
7658 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
7659 msgid "64 bit Power PC."
7663 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1059
7664 msgid "Libguestfs may return other architecture strings in future."
7668 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
7669 msgid "The function works on at least the following types of files:"
7673 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1067
7674 msgid "many types of Un*x and Linux binary"
7678 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1071
7679 msgid "many types of Un*x and Linux shared library"
7683 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1075
7684 msgid "Windows Win32 and Win64 binaries"
7688 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1079
7689 msgid "Windows Win32 and Win64 DLLs"
7693 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
7694 msgid "Win32 binaries and DLLs return C<i386>."
7698 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
7699 msgid "Win64 binaries and DLLs return C<x86_64>."
7703 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1087
7704 msgid "Linux kernel modules"
7708 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1091
7709 msgid "Linux new-style initrd images"
7713 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1095
7714 msgid "some non-x86 Linux vmlinuz kernels"
7718 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1099
7719 msgid "What it can't do currently:"
7723 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1105
7724 msgid "static libraries (libfoo.a)"
7728 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1109
7729 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7733 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1113
7734 msgid "x86 Linux vmlinuz kernels"
7738 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
7740 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7741 "compressed code, and are horribly hard to unpack. If you want to find the "
7742 "architecture of a kernel, use the architecture of the associated initrd or "
7743 "kernel module(s) instead."
7747 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810 ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2508 ../src/guestfs-actions.pod:2589 ../src/guestfs-actions.pod:2615 ../src/guestfs-actions.pod:2664 ../src/guestfs-actions.pod:2685 ../src/guestfs-actions.pod:2718 ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2864 ../src/guestfs-actions.pod:3037 ../src/guestfs-actions.pod:3169
7748 msgid "(Added in 1.5.3)"
7752 #: ../src/guestfs-actions.pod:1649
7753 msgid "guestfs_filesize"
7757 #: ../src/guestfs-actions.pod:1651
7761 " guestfs_filesize (guestfs_h *g,\n"
7762 " const char *file);\n"
7767 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1126
7768 msgid "This command returns the size of C<file> in bytes."
7772 #: ../src/guestfs-actions.pod:1657
7774 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7775 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7776 "devices, use C<guestfs_blockdev_getsize64>."
7780 #: ../src/guestfs-actions.pod:1663
7781 msgid "(Added in 1.0.82)"
7785 #: ../src/guestfs-actions.pod:1665
7786 msgid "guestfs_fill"
7790 #: ../src/guestfs-actions.pod:1667
7794 " guestfs_fill (guestfs_h *g,\n"
7797 " const char *path);\n"
7802 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1136
7804 "This command creates a new file called C<path>. The initial content of the "
7805 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7810 #: ../src/guestfs-actions.pod:1677
7812 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7813 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7814 "bytes use C<guestfs_fill_pattern>."
7818 #: ../src/guestfs-actions.pod:1689
7819 msgid "(Added in 1.0.79)"
7823 #: ../src/guestfs-actions.pod:1691
7824 msgid "guestfs_fill_pattern"
7828 #: ../src/guestfs-actions.pod:1693
7832 " guestfs_fill_pattern (guestfs_h *g,\n"
7833 " const char *pattern,\n"
7835 " const char *path);\n"
7840 #: ../src/guestfs-actions.pod:1699
7842 "This function is like C<guestfs_fill> except that it creates a new file of "
7843 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7844 "pattern is truncated if necessary to ensure the length of the file is "
7845 "exactly C<len> bytes."
7849 #: ../src/guestfs-actions.pod:1711
7850 msgid "(Added in 1.3.12)"
7854 #: ../src/guestfs-actions.pod:1713
7855 msgid "guestfs_find"
7859 #: ../src/guestfs-actions.pod:1715
7863 " guestfs_find (guestfs_h *g,\n"
7864 " const char *directory);\n"
7869 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1158
7871 "This command lists out all files and directories, recursively, starting at "
7872 "C<directory>. It is essentially equivalent to running the shell command "
7873 "C<find directory -print> but some post-processing happens on the output, "
7878 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1163
7880 "This returns a list of strings I<without any prefix>. Thus if the directory "
7885 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1166
7895 #: ../src/guestfs-actions.pod:1731
7896 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7900 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1173
7911 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1178
7912 msgid "If C<directory> is not a directory, then this command returns an error."
7916 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1181
7917 msgid "The returned list is sorted."
7921 #: ../src/guestfs-actions.pod:1744
7922 msgid "See also C<guestfs_find0>."
7926 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3858 ../src/guestfs-actions.pod:5387
7927 msgid "(Added in 1.0.27)"
7931 #: ../src/guestfs-actions.pod:1755
7932 msgid "guestfs_find0"
7936 #: ../src/guestfs-actions.pod:1757
7940 " guestfs_find0 (guestfs_h *g,\n"
7941 " const char *directory,\n"
7942 " const char *files);\n"
7947 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1192
7949 "This command lists out all files and directories, recursively, starting at "
7950 "C<directory>, placing the resulting list in the external file called "
7955 #: ../src/guestfs-actions.pod:1766
7957 "This command works the same way as C<guestfs_find> with the following "
7962 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1203
7963 msgid "The resulting list is written to an external file."
7967 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1207
7969 "Items (filenames) in the result are separated by C<\\0> characters. See "
7970 "L<find(1)> option I<-print0>."
7974 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1212
7975 msgid "This command is not limited in the number of names that it can return."
7979 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1217
7980 msgid "The result list is not sorted."
7984 #: ../src/guestfs-actions.pod:1793
7985 msgid "(Added in 1.0.74)"
7989 #: ../src/guestfs-actions.pod:1795
7990 msgid "guestfs_findfs_label"
7994 #: ../src/guestfs-actions.pod:1797
7998 " guestfs_findfs_label (guestfs_h *g,\n"
7999 " const char *label);\n"
8004 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1227
8006 "This command searches the filesystems and returns the one which has the "
8007 "given label. An error is returned if no such filesystem can be found."
8011 #: ../src/guestfs-actions.pod:1805
8012 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
8016 #: ../src/guestfs-actions.pod:1812
8017 msgid "guestfs_findfs_uuid"
8021 #: ../src/guestfs-actions.pod:1814
8025 " guestfs_findfs_uuid (guestfs_h *g,\n"
8026 " const char *uuid);\n"
8031 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1237
8033 "This command searches the filesystems and returns the one which has the "
8034 "given UUID. An error is returned if no such filesystem can be found."
8038 #: ../src/guestfs-actions.pod:1822
8039 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
8043 #: ../src/guestfs-actions.pod:1829
8044 msgid "guestfs_fsck"
8048 #: ../src/guestfs-actions.pod:1831
8052 " guestfs_fsck (guestfs_h *g,\n"
8053 " const char *fstype,\n"
8054 " const char *device);\n"
8059 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1247
8061 "This runs the filesystem checker (fsck) on C<device> which should have "
8062 "filesystem type C<fstype>."
8066 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1250
8068 "The returned integer is the status. See L<fsck(8)> for the list of status "
8069 "codes from C<fsck>."
8073 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1259
8074 msgid "Multiple status codes can be summed together."
8078 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1263
8080 "A non-zero return code can mean \"success\", for example if errors have been "
8081 "corrected on the filesystem."
8085 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1268
8086 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8090 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1273
8091 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8095 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:7034
8096 msgid "(Added in 1.0.16)"
8100 #: ../src/guestfs-actions.pod:1868
8101 msgid "guestfs_get_append"
8105 #: ../src/guestfs-actions.pod:1870
8109 " guestfs_get_append (guestfs_h *g);\n"
8114 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1279
8116 "Return the additional kernel options which are added to the guest kernel "
8121 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1282
8122 msgid "If C<NULL> then no options are added."
8126 #: ../src/guestfs-actions.pod:1878
8128 "This function returns a string which may be NULL. There is no way to return "
8129 "an error from this function. The string is owned by the guest handle and "
8130 "must I<not> be freed."
8134 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:5065 ../src/guestfs-actions.pod:5528 ../src/guestfs-actions.pod:5896 ../src/guestfs-actions.pod:5915 ../src/guestfs-actions.pod:5931 ../src/guestfs-actions.pod:5948 ../src/guestfs-actions.pod:6705 ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:7077
8135 msgid "(Added in 1.0.26)"
8139 #: ../src/guestfs-actions.pod:1884
8140 msgid "guestfs_get_autosync"
8144 #: ../src/guestfs-actions.pod:1886
8148 " guestfs_get_autosync (guestfs_h *g);\n"
8153 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1288
8154 msgid "Get the autosync flag."
8158 #: ../src/guestfs-actions.pod:1895
8159 msgid "guestfs_get_direct"
8163 #: ../src/guestfs-actions.pod:1897
8167 " guestfs_get_direct (guestfs_h *g);\n"
8172 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1294
8173 msgid "Return the direct appliance mode flag."
8177 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5569
8178 msgid "(Added in 1.0.72)"
8182 #: ../src/guestfs-actions.pod:1906
8183 msgid "guestfs_get_e2label"
8187 #: ../src/guestfs-actions.pod:1908
8191 " guestfs_get_e2label (guestfs_h *g,\n"
8192 " const char *device);\n"
8197 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1300
8198 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8202 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1303
8204 "This function is deprecated. In new code, use the C<vfs_label> call "
8209 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:5587 ../src/guestfs-actions.pod:5606
8210 msgid "(Added in 1.0.15)"
8214 #: ../src/guestfs-actions.pod:1927
8215 msgid "guestfs_get_e2uuid"
8219 #: ../src/guestfs-actions.pod:1929
8223 " guestfs_get_e2uuid (guestfs_h *g,\n"
8224 " const char *device);\n"
8229 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1314
8230 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8234 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1317
8235 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
8239 #: ../src/guestfs-actions.pod:1948
8240 msgid "guestfs_get_memsize"
8244 #: ../src/guestfs-actions.pod:1950
8248 " guestfs_get_memsize (guestfs_h *g);\n"
8253 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1328
8254 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8258 #: ../src/guestfs-actions.pod:1956
8260 "If C<guestfs_set_memsize> was not called on this handle, and if "
8261 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8262 "value for memsize."
8266 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041 ../src/guestfs-actions.pod:5622 ../src/guestfs-actions.pod:5729 ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:3749 ../fish/guestfish-actions.pod:3836
8267 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8271 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:4149 ../src/guestfs-actions.pod:4332 ../src/guestfs-actions.pod:4351 ../src/guestfs-actions.pod:4370 ../src/guestfs-actions.pod:4382 ../src/guestfs-actions.pod:4399 ../src/guestfs-actions.pod:4412 ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5627 ../src/guestfs-actions.pod:5870 ../src/guestfs-actions.pod:6471
8272 msgid "(Added in 1.0.55)"
8276 #: ../src/guestfs-actions.pod:1967
8277 msgid "guestfs_get_network"
8281 #: ../src/guestfs-actions.pod:1969
8285 " guestfs_get_network (guestfs_h *g);\n"
8290 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1342
8291 msgid "This returns the enable network flag."
8295 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5646
8296 msgid "(Added in 1.5.4)"
8300 #: ../src/guestfs-actions.pod:1978
8301 msgid "guestfs_get_path"
8305 #: ../src/guestfs-actions.pod:1980
8309 " guestfs_get_path (guestfs_h *g);\n"
8314 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1348
8315 msgid "Return the current search path."
8319 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
8321 "This is always non-NULL. If it wasn't set already, then this will return "
8326 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
8328 "This function returns a string, or NULL on error. The string is owned by "
8329 "the guest handle and must I<not> be freed."
8333 #: ../src/guestfs-actions.pod:1993
8334 msgid "guestfs_get_pid"
8338 #: ../src/guestfs-actions.pod:1995
8342 " guestfs_get_pid (guestfs_h *g);\n"
8347 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1359
8349 "Return the process ID of the qemu subprocess. If there is no qemu "
8350 "subprocess, then this will return an error."
8354 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1362
8355 msgid "This is an internal call used for debugging and testing."
8359 #: ../src/guestfs-actions.pod:2005
8360 msgid "(Added in 1.0.56)"
8364 #: ../src/guestfs-actions.pod:2007
8365 msgid "guestfs_get_qemu"
8369 #: ../src/guestfs-actions.pod:2009
8373 " guestfs_get_qemu (guestfs_h *g);\n"
8378 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1368
8379 msgid "Return the current qemu binary."
8383 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
8385 "This is always non-NULL. If it wasn't set already, then this will return "
8386 "the default qemu binary name."
8390 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5691
8391 msgid "(Added in 1.0.6)"
8395 #: ../src/guestfs-actions.pod:2022
8396 msgid "guestfs_get_recovery_proc"
8400 #: ../src/guestfs-actions.pod:2024
8404 " guestfs_get_recovery_proc (guestfs_h *g);\n"
8409 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1377
8410 msgid "Return the recovery process enabled flag."
8414 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3259 ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3956 ../src/guestfs-actions.pod:3988 ../src/guestfs-actions.pod:4995 ../src/guestfs-actions.pod:5338 ../src/guestfs-actions.pod:5715 ../src/guestfs-actions.pod:6374 ../src/guestfs-actions.pod:6394 ../src/guestfs-actions.pod:6586
8415 msgid "(Added in 1.0.77)"
8419 #: ../src/guestfs-actions.pod:2033
8420 msgid "guestfs_get_selinux"
8424 #: ../src/guestfs-actions.pod:2035
8428 " guestfs_get_selinux (guestfs_h *g);\n"
8433 #: ../src/guestfs-actions.pod:2038
8435 "This returns the current setting of the selinux flag which is passed to the "
8436 "appliance at boot time. See C<guestfs_set_selinux>."
8440 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109 ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:5788
8441 msgid "(Added in 1.0.67)"
8445 #: ../src/guestfs-actions.pod:2048
8446 msgid "guestfs_get_state"
8450 #: ../src/guestfs-actions.pod:2050
8454 " guestfs_get_state (guestfs_h *g);\n"
8459 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1393
8461 "This returns the current state as an opaque integer. This is only useful "
8462 "for printing debug and internal error messages."
8466 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:3062 ../src/guestfs-actions.pod:3091 ../src/guestfs-actions.pod:3152 ../src/guestfs-actions.pod:3179 ../fish/guestfish-actions.pod:1396 ../fish/guestfish-actions.pod:2131 ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2187 ../fish/guestfish-actions.pod:2203
8467 msgid "For more information on states, see L<guestfs(3)>."
8471 #: ../src/guestfs-actions.pod:2062
8472 msgid "guestfs_get_trace"
8476 #: ../src/guestfs-actions.pod:2064
8480 " guestfs_get_trace (guestfs_h *g);\n"
8485 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1402
8486 msgid "Return the command trace flag."
8490 #: ../src/guestfs-actions.pod:2073
8491 msgid "guestfs_get_umask"
8495 #: ../src/guestfs-actions.pod:2075
8499 " guestfs_get_umask (guestfs_h *g);\n"
8504 #: ../src/guestfs-actions.pod:2078
8506 "Return the current umask. By default the umask is C<022> unless it has been "
8507 "set by calling C<guestfs_umask>."
8511 #: ../src/guestfs-actions.pod:2085
8512 msgid "guestfs_get_verbose"
8516 #: ../src/guestfs-actions.pod:2087
8520 " guestfs_get_verbose (guestfs_h *g);\n"
8525 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1415
8526 msgid "This returns the verbose messages flag."
8530 #: ../src/guestfs-actions.pod:2096
8531 msgid "guestfs_getcon"
8535 #: ../src/guestfs-actions.pod:2098
8539 " guestfs_getcon (guestfs_h *g);\n"
8544 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1421
8545 msgid "This gets the SELinux security context of the daemon."
8549 #: ../src/guestfs-actions.pod:2103
8550 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8554 #: ../src/guestfs-actions.pod:2111
8555 msgid "guestfs_getxattr"
8559 #: ../src/guestfs-actions.pod:2113
8563 " guestfs_getxattr (guestfs_h *g,\n"
8564 " const char *path,\n"
8565 " const char *name,\n"
8566 " size_t *size_r);\n"
8571 #: ../src/guestfs-actions.pod:2119
8573 "Get a single extended attribute from file C<path> named C<name>. This call "
8574 "follows symlinks. If you want to lookup an extended attribute for the "
8575 "symlink itself, use C<guestfs_lgetxattr>."
8579 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:3273
8581 "Normally it is better to get all extended attributes from a file in one go "
8582 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
8583 "implementations are buggy and do not provide a way to list out attributes. "
8584 "For these filesystems (notably ntfs-3g) you have to know the names of the "
8585 "extended attributes you want in advance and call this function."
8589 #: ../src/guestfs-actions.pod:2130 ../src/guestfs-actions.pod:3280 ../fish/guestfish-actions.pod:1441 ../fish/guestfish-actions.pod:2268
8591 "Extended attribute values are blobs of binary data. If there is no extended "
8592 "attribute named C<name>, this returns an error."
8596 #: ../src/guestfs-actions.pod:2133
8597 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
8601 #: ../src/guestfs-actions.pod:2135 ../src/guestfs-actions.pod:2326 ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5014 ../src/guestfs-actions.pod:5195
8603 "This function returns a buffer, or NULL on error. The size of the returned "
8604 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8609 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:3289
8610 msgid "(Added in 1.7.24)"
8614 #: ../src/guestfs-actions.pod:2141
8615 msgid "guestfs_getxattrs"
8619 #: ../src/guestfs-actions.pod:2143
8622 " struct guestfs_xattr_list *\n"
8623 " guestfs_getxattrs (guestfs_h *g,\n"
8624 " const char *path);\n"
8629 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1450
8630 msgid "This call lists the extended attributes of the file or directory C<path>."
8634 #: ../src/guestfs-actions.pod:2150 ../fish/guestfish-actions.pod:1453
8636 "At the system call level, this is a combination of the L<listxattr(2)> and "
8637 "L<getxattr(2)> calls."
8641 #: ../src/guestfs-actions.pod:2153
8642 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8646 #: ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:3301 ../src/guestfs-actions.pod:3952
8648 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8649 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8653 #: ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:3470 ../src/guestfs-actions.pod:3506 ../src/guestfs-actions.pod:5368 ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:7142
8654 msgid "(Added in 1.0.59)"
8658 #: ../src/guestfs-actions.pod:2161
8659 msgid "guestfs_glob_expand"
8663 #: ../src/guestfs-actions.pod:2163
8667 " guestfs_glob_expand (guestfs_h *g,\n"
8668 " const char *pattern);\n"
8673 #: ../src/guestfs-actions.pod:2167 ../fish/guestfish-actions.pod:1462
8675 "This command searches for all the pathnames matching C<pattern> according to "
8676 "the wildcard expansion rules used by the shell."
8680 #: ../src/guestfs-actions.pod:2171 ../fish/guestfish-actions.pod:1466
8681 msgid "If no paths match, then this returns an empty list (note: not an error)."
8685 #: ../src/guestfs-actions.pod:2174 ../fish/guestfish-actions.pod:1469
8687 "It is just a wrapper around the C L<glob(3)> function with flags "
8688 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8692 #: ../src/guestfs-actions.pod:2182 ../src/guestfs-actions.pod:5972 ../src/guestfs-actions.pod:5989
8693 msgid "(Added in 1.0.50)"
8697 #: ../src/guestfs-actions.pod:2184
8698 msgid "guestfs_grep"
8702 #: ../src/guestfs-actions.pod:2186
8706 " guestfs_grep (guestfs_h *g,\n"
8707 " const char *regex,\n"
8708 " const char *path);\n"
8713 #: ../src/guestfs-actions.pod:2191 ../fish/guestfish-actions.pod:1477
8714 msgid "This calls the external C<grep> program and returns the matching lines."
8718 #: ../src/guestfs-actions.pod:2203
8719 msgid "guestfs_grepi"
8723 #: ../src/guestfs-actions.pod:2205
8727 " guestfs_grepi (guestfs_h *g,\n"
8728 " const char *regex,\n"
8729 " const char *path);\n"
8734 #: ../src/guestfs-actions.pod:2210 ../fish/guestfish-actions.pod:1487
8735 msgid "This calls the external C<grep -i> program and returns the matching lines."
8739 #: ../src/guestfs-actions.pod:2222
8740 msgid "guestfs_grub_install"
8744 #: ../src/guestfs-actions.pod:2224
8748 " guestfs_grub_install (guestfs_h *g,\n"
8749 " const char *root,\n"
8750 " const char *device);\n"
8755 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1497
8757 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8758 "the root directory being C<root>."
8762 #: ../src/guestfs-actions.pod:2232 ../fish/guestfish-actions.pod:1500
8764 "Note: If grub-install reports the error \"No suitable drive was found in the "
8765 "generated device map.\" it may be that you need to create a "
8766 "C</boot/grub/device.map> file first that contains the mapping between grub "
8767 "device names and Linux device names. It is usually sufficient to create a "
8772 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1507
8780 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1509
8781 msgid "replacing C</dev/vda> with the name of the installation device."
8785 #: ../src/guestfs-actions.pod:2245
8786 msgid "(Added in 1.0.17)"
8790 #: ../src/guestfs-actions.pod:2247
8791 msgid "guestfs_head"
8795 #: ../src/guestfs-actions.pod:2249
8799 " guestfs_head (guestfs_h *g,\n"
8800 " const char *path);\n"
8805 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1515
8807 "This command returns up to the first 10 lines of a file as a list of "
8812 #: ../src/guestfs-actions.pod:2265
8813 msgid "guestfs_head_n"
8817 #: ../src/guestfs-actions.pod:2267
8821 " guestfs_head_n (guestfs_h *g,\n"
8823 " const char *path);\n"
8828 #: ../src/guestfs-actions.pod:2272 ../fish/guestfish-actions.pod:1525
8830 "If the parameter C<nrlines> is a positive number, this returns the first "
8831 "C<nrlines> lines of the file C<path>."
8835 #: ../src/guestfs-actions.pod:2275 ../fish/guestfish-actions.pod:1528
8837 "If the parameter C<nrlines> is a negative number, this returns lines from "
8838 "the file C<path>, excluding the last C<nrlines> lines."
8842 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:6269 ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:4182
8843 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8847 #: ../src/guestfs-actions.pod:2289
8848 msgid "guestfs_hexdump"
8852 #: ../src/guestfs-actions.pod:2291
8856 " guestfs_hexdump (guestfs_h *g,\n"
8857 " const char *path);\n"
8862 #: ../src/guestfs-actions.pod:2295 ../fish/guestfish-actions.pod:1540
8864 "This runs C<hexdump -C> on the given C<path>. The result is the "
8865 "human-readable, canonical hex dump of the file."
8869 #: ../src/guestfs-actions.pod:2304 ../src/guestfs-actions.pod:6053 ../src/guestfs-actions.pod:6108
8870 msgid "(Added in 1.0.22)"
8874 #: ../src/guestfs-actions.pod:2306
8875 msgid "guestfs_initrd_cat"
8879 #: ../src/guestfs-actions.pod:2308
8883 " guestfs_initrd_cat (guestfs_h *g,\n"
8884 " const char *initrdpath,\n"
8885 " const char *filename,\n"
8886 " size_t *size_r);\n"
8891 #: ../src/guestfs-actions.pod:2314 ../fish/guestfish-actions.pod:1550
8893 "This command unpacks the file C<filename> from the initrd file called "
8894 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8899 #: ../src/guestfs-actions.pod:2318 ../fish/guestfish-actions.pod:1554
8901 "For example, in guestfish you could use the following command to examine the "
8902 "boot script (usually called C</init>) contained in a Linux initrd or "
8907 #: ../src/guestfs-actions.pod:2322 ../fish/guestfish-actions.pod:1558
8910 " initrd-cat /boot/initrd-<version>.img init\n"
8915 #: ../src/guestfs-actions.pod:2324
8916 msgid "See also C<guestfs_initrd_list>."
8920 #: ../src/guestfs-actions.pod:2335
8921 msgid "guestfs_initrd_list"
8925 #: ../src/guestfs-actions.pod:2337
8929 " guestfs_initrd_list (guestfs_h *g,\n"
8930 " const char *path);\n"
8935 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1569
8936 msgid "This command lists out files contained in an initrd."
8940 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1571
8942 "The files are listed without any initial C</> character. The files are "
8943 "listed in the order they appear (not necessarily alphabetical). Directory "
8944 "names are listed as separate items."
8948 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1575
8950 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8951 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8956 #: ../src/guestfs-actions.pod:2357
8957 msgid "guestfs_inotify_add_watch"
8961 #: ../src/guestfs-actions.pod:2359
8965 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8966 " const char *path,\n"
8972 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1583
8973 msgid "Watch C<path> for the events listed in C<mask>."
8977 #: ../src/guestfs-actions.pod:2366 ../fish/guestfish-actions.pod:1585
8979 "Note that if C<path> is a directory then events within that directory are "
8980 "watched, but this does I<not> happen recursively (in subdirectories)."
8984 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1589
8986 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8987 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8991 #: ../src/guestfs-actions.pod:2378
8992 msgid "guestfs_inotify_close"
8996 #: ../src/guestfs-actions.pod:2380
9000 " guestfs_inotify_close (guestfs_h *g);\n"
9005 #: ../src/guestfs-actions.pod:2383 ../fish/guestfish-actions.pod:1597
9007 "This closes the inotify handle which was previously opened by inotify_init. "
9008 "It removes all watches, throws away any pending events, and deallocates all "
9013 #: ../src/guestfs-actions.pod:2391
9014 msgid "guestfs_inotify_files"
9018 #: ../src/guestfs-actions.pod:2393
9022 " guestfs_inotify_files (guestfs_h *g);\n"
9027 #: ../src/guestfs-actions.pod:2396
9029 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
9030 "returns a list of pathnames of objects that were touched. The returned "
9031 "pathnames are sorted and deduplicated."
9035 #: ../src/guestfs-actions.pod:2406
9036 msgid "guestfs_inotify_init"
9040 #: ../src/guestfs-actions.pod:2408
9044 " guestfs_inotify_init (guestfs_h *g,\n"
9045 " int maxevents);\n"
9050 #: ../src/guestfs-actions.pod:2412 ../fish/guestfish-actions.pod:1613
9052 "This command creates a new inotify handle. The inotify subsystem can be "
9053 "used to notify events which happen to objects in the guest filesystem."
9057 #: ../src/guestfs-actions.pod:2416
9059 "C<maxevents> is the maximum number of events which will be queued up between "
9060 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
9061 "passed as C<0>, then the kernel (or previously set) default is used. For "
9062 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
9063 "throws away events, but records the fact that it threw them away by setting "
9064 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
9065 "C<guestfs_inotify_read>)."
9069 #: ../src/guestfs-actions.pod:2426
9071 "Before any events are generated, you have to add some watches to the "
9072 "internal watch list. See: C<guestfs_inotify_add_watch>, "
9073 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
9077 #: ../src/guestfs-actions.pod:2432
9079 "Queued up events should be read periodically by calling "
9080 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
9081 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
9082 "often enough then you risk the internal queue overflowing."
9086 #: ../src/guestfs-actions.pod:2439
9088 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
9089 "This also removes any watches automatically."
9093 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1644
9095 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9096 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9097 "that there is one global inotify handle per libguestfs instance."
9101 #: ../src/guestfs-actions.pod:2452
9102 msgid "guestfs_inotify_read"
9106 #: ../src/guestfs-actions.pod:2454
9109 " struct guestfs_inotify_event_list *\n"
9110 " guestfs_inotify_read (guestfs_h *g);\n"
9115 #: ../src/guestfs-actions.pod:2457 ../fish/guestfish-actions.pod:1653
9117 "Return the complete queue of events that have happened since the previous "
9122 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1656
9123 msgid "If no events have happened, this returns an empty list."
9127 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1658
9129 "I<Note>: In order to make sure that all events have been read, you must call "
9130 "this function repeatedly until it returns an empty list. The reason is that "
9131 "the call will read events up to the maximum appliance-to-host message size "
9132 "and leave remaining events in the queue."
9136 #: ../src/guestfs-actions.pod:2468
9138 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
9139 "there was an error. I<The caller must call "
9140 "C<guestfs_free_inotify_event_list> after use>."
9144 #: ../src/guestfs-actions.pod:2474
9145 msgid "guestfs_inotify_rm_watch"
9149 #: ../src/guestfs-actions.pod:2476
9153 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
9159 #: ../src/guestfs-actions.pod:2480
9161 "Remove a previously defined inotify watch. See "
9162 "C<guestfs_inotify_add_watch>."
9166 #: ../src/guestfs-actions.pod:2487
9167 msgid "guestfs_inspect_get_arch"
9171 #: ../src/guestfs-actions.pod:2489
9175 " guestfs_inspect_get_arch (guestfs_h *g,\n"
9176 " const char *root);\n"
9181 #: ../src/guestfs-actions.pod:2493 ../src/guestfs-actions.pod:2516 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2623 ../src/guestfs-actions.pod:2645 ../src/guestfs-actions.pod:2672 ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2726 ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:2786 ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2872 ../src/guestfs-actions.pod:2895
9183 "This function should only be called with a root device string as returned by "
9184 "C<guestfs_inspect_os>."
9188 #: ../src/guestfs-actions.pod:2496
9190 "This returns the architecture of the inspected operating system. The "
9191 "possible return values are listed under C<guestfs_file_architecture>."
9195 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1682
9197 "If the architecture could not be determined, then the string C<unknown> is "
9202 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2584 ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2660 ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2773 ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2859 ../src/guestfs-actions.pod:2882 ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3029 ../fish/guestfish-actions.pod:1685 ../fish/guestfish-actions.pod:1759 ../fish/guestfish-actions.pod:1792 ../fish/guestfish-actions.pod:1813 ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:1897 ../fish/guestfish-actions.pod:1914 ../fish/guestfish-actions.pod:1927 ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1978 ../fish/guestfish-actions.pod:2077 ../fish/guestfish-actions.pod:2111
9203 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9207 #: ../src/guestfs-actions.pod:2510
9208 msgid "guestfs_inspect_get_distro"
9212 #: ../src/guestfs-actions.pod:2512
9216 " guestfs_inspect_get_distro (guestfs_h *g,\n"
9217 " const char *root);\n"
9222 #: ../src/guestfs-actions.pod:2519 ../fish/guestfish-actions.pod:1694
9223 msgid "This returns the distro (distribution) of the inspected operating system."
9227 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1697
9228 msgid "Currently defined distros are:"
9232 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1701
9233 msgid "\"archlinux\""
9237 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1703
9242 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1705
9247 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1707
9252 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1709
9257 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1711
9262 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1713
9267 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1715
9272 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1717
9273 msgid "\"linuxmint\""
9277 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1719
9282 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1721
9283 msgid "\"mandriva\""
9287 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1723
9292 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1725
9297 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1727
9302 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1729
9307 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1731
9312 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1733
9313 msgid "\"redhat-based\""
9317 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1735
9318 msgid "Some Red Hat-derived distro."
9322 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1737
9327 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1739
9328 msgid "Red Hat Enterprise Linux and some derivatives."
9332 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1741
9337 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1743
9342 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2850 ../fish/guestfish-actions.pod:1745 ../fish/guestfish-actions.pod:1953
9347 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1747
9348 msgid "The distro could not be determined."
9352 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:2842 ../fish/guestfish-actions.pod:1749 ../fish/guestfish-actions.pod:1945
9357 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1751
9359 "Windows does not have distributions. This string is returned if the OS type "
9364 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2856 ../fish/guestfish-actions.pod:1756 ../fish/guestfish-actions.pod:1959
9366 "Future versions of libguestfs may return other strings here. The caller "
9367 "should be prepared to handle any string."
9371 #: ../src/guestfs-actions.pod:2591
9372 msgid "guestfs_inspect_get_filesystems"
9376 #: ../src/guestfs-actions.pod:2593
9380 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
9381 " const char *root);\n"
9386 #: ../src/guestfs-actions.pod:2600 ../fish/guestfish-actions.pod:1768
9388 "This returns a list of all the filesystems that we think are associated with "
9389 "this operating system. This includes the root filesystem, other ordinary "
9390 "filesystems, and non-mounted devices like swap partitions."
9394 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1773
9396 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9397 "to be shared between operating systems."
9401 #: ../src/guestfs-actions.pod:2608
9403 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9404 "C<guestfs_inspect_get_mountpoints>."
9408 #: ../src/guestfs-actions.pod:2617
9409 msgid "guestfs_inspect_get_hostname"
9413 #: ../src/guestfs-actions.pod:2619
9417 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
9418 " const char *root);\n"
9423 #: ../src/guestfs-actions.pod:2626 ../fish/guestfish-actions.pod:1786
9425 "This function returns the hostname of the operating system as found by "
9426 "inspection of the guest's configuration files."
9430 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:1789
9432 "If the hostname could not be determined, then the string C<unknown> is "
9437 #: ../src/guestfs-actions.pod:2637
9438 msgid "(Added in 1.7.9)"
9442 #: ../src/guestfs-actions.pod:2639
9443 msgid "guestfs_inspect_get_major_version"
9447 #: ../src/guestfs-actions.pod:2641
9451 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
9452 " const char *root);\n"
9457 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:1801
9458 msgid "This returns the major version number of the inspected operating system."
9462 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1804
9464 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9465 "popular public names used by the operating system. Notably the operating "
9466 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9467 "1). You can find out the real versions corresponding to releases of Windows "
9468 "by consulting Wikipedia or MSDN."
9472 #: ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2678 ../fish/guestfish-actions.pod:1811 ../fish/guestfish-actions.pod:1825
9473 msgid "If the version could not be determined, then C<0> is returned."
9477 #: ../src/guestfs-actions.pod:2666
9478 msgid "guestfs_inspect_get_minor_version"
9482 #: ../src/guestfs-actions.pod:2668
9486 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9487 " const char *root);\n"
9492 #: ../src/guestfs-actions.pod:2675 ../fish/guestfish-actions.pod:1822
9493 msgid "This returns the minor version number of the inspected operating system."
9497 #: ../src/guestfs-actions.pod:2680
9499 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9500 "C<guestfs_inspect_get_major_version>."
9504 #: ../src/guestfs-actions.pod:2687
9505 msgid "guestfs_inspect_get_mountpoints"
9509 #: ../src/guestfs-actions.pod:2689
9513 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9514 " const char *root);\n"
9519 #: ../src/guestfs-actions.pod:2696 ../fish/guestfish-actions.pod:1837
9521 "This returns a hash of where we think the filesystems associated with this "
9522 "operating system should be mounted. Callers should note that this is at "
9523 "best an educated guess made by reading configuration files such as "
9528 #: ../src/guestfs-actions.pod:2701 ../fish/guestfish-actions.pod:1842
9530 "Each element in the returned hashtable has a key which is the path of the "
9531 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9532 "mounted there (eg. C</dev/sda1>)."
9536 #: ../src/guestfs-actions.pod:2706 ../fish/guestfish-actions.pod:1847
9537 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9541 #: ../src/guestfs-actions.pod:2709
9543 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9544 "C<guestfs_inspect_get_filesystems>."
9548 #: ../src/guestfs-actions.pod:2712 ../src/guestfs-actions.pod:3358 ../src/guestfs-actions.pod:4554 ../src/guestfs-actions.pod:6410
9550 "This function returns a NULL-terminated array of strings, or NULL if there "
9551 "was an error. The array of strings will always have length C<2n+1>, where "
9552 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9553 "caller must free the strings and the array after use>."
9557 #: ../src/guestfs-actions.pod:2720
9558 msgid "guestfs_inspect_get_package_format"
9562 #: ../src/guestfs-actions.pod:2722
9566 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9567 " const char *root);\n"
9572 #: ../src/guestfs-actions.pod:2729
9574 "This function and C<guestfs_inspect_get_package_management> return the "
9575 "package format and package management tool used by the inspected operating "
9576 "system. For example for Fedora these functions would return C<rpm> (package "
9577 "format) and C<yum> (package management)."
9581 #: ../src/guestfs-actions.pod:2735 ../fish/guestfish-actions.pod:1866
9583 "This returns the string C<unknown> if we could not determine the package "
9584 "format I<or> if the operating system does not have a real packaging system "
9589 #: ../src/guestfs-actions.pod:2739 ../fish/guestfish-actions.pod:1870
9591 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9592 "Future versions of libguestfs may return other strings."
9596 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2778
9597 msgid "(Added in 1.7.5)"
9601 #: ../src/guestfs-actions.pod:2749
9602 msgid "guestfs_inspect_get_package_management"
9606 #: ../src/guestfs-actions.pod:2751
9610 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9611 " const char *root);\n"
9616 #: ../src/guestfs-actions.pod:2758
9618 "C<guestfs_inspect_get_package_format> and this function return the package "
9619 "format and package management tool used by the inspected operating system. "
9620 "For example for Fedora these functions would return C<rpm> (package format) "
9621 "and C<yum> (package management)."
9625 #: ../src/guestfs-actions.pod:2764 ../fish/guestfish-actions.pod:1888
9627 "This returns the string C<unknown> if we could not determine the package "
9628 "management tool I<or> if the operating system does not have a real packaging "
9629 "system (eg. Windows)."
9633 #: ../src/guestfs-actions.pod:2768 ../fish/guestfish-actions.pod:1892
9635 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9636 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9637 "libguestfs may return other strings."
9641 #: ../src/guestfs-actions.pod:2780
9642 msgid "guestfs_inspect_get_product_name"
9646 #: ../src/guestfs-actions.pod:2782
9650 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9651 " const char *root);\n"
9656 #: ../src/guestfs-actions.pod:2789 ../fish/guestfish-actions.pod:1906
9658 "This returns the product name of the inspected operating system. The "
9659 "product name is generally some freeform string which can be displayed to the "
9660 "user, but should not be parsed by programs."
9664 #: ../src/guestfs-actions.pod:2794 ../fish/guestfish-actions.pod:1911
9666 "If the product name could not be determined, then the string C<unknown> is "
9671 #: ../src/guestfs-actions.pod:2804
9672 msgid "guestfs_inspect_get_roots"
9676 #: ../src/guestfs-actions.pod:2806
9680 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9685 #: ../src/guestfs-actions.pod:2809
9687 "This function is a convenient way to get the list of root devices, as "
9688 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9689 "the whole inspection process."
9693 #: ../src/guestfs-actions.pod:2813
9695 "This returns an empty list if either no root devices were found or the "
9696 "caller has not called C<guestfs_inspect_os>."
9700 #: ../src/guestfs-actions.pod:2822
9701 msgid "(Added in 1.7.3)"
9705 #: ../src/guestfs-actions.pod:2824
9706 msgid "guestfs_inspect_get_type"
9710 #: ../src/guestfs-actions.pod:2826
9714 " guestfs_inspect_get_type (guestfs_h *g,\n"
9715 " const char *root);\n"
9720 #: ../src/guestfs-actions.pod:2833 ../fish/guestfish-actions.pod:1936
9722 "This returns the type of the inspected operating system. Currently defined "
9727 #: ../src/guestfs-actions.pod:2838 ../fish/guestfish-actions.pod:1941
9732 #: ../src/guestfs-actions.pod:2840 ../fish/guestfish-actions.pod:1943
9733 msgid "Any Linux-based operating system."
9737 #: ../src/guestfs-actions.pod:2844 ../fish/guestfish-actions.pod:1947
9738 msgid "Any Microsoft Windows operating system."
9742 #: ../src/guestfs-actions.pod:2846 ../fish/guestfish-actions.pod:1949
9747 #: ../src/guestfs-actions.pod:2848 ../fish/guestfish-actions.pod:1951
9752 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1955
9753 msgid "The operating system type could not be determined."
9757 #: ../src/guestfs-actions.pod:2866
9758 msgid "guestfs_inspect_get_windows_systemroot"
9762 #: ../src/guestfs-actions.pod:2868
9766 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9767 " const char *root);\n"
9772 #: ../src/guestfs-actions.pod:2875 ../fish/guestfish-actions.pod:1971
9774 "This returns the Windows systemroot of the inspected guest. The systemroot "
9775 "is a directory path such as C</WINDOWS>."
9779 #: ../src/guestfs-actions.pod:2878 ../fish/guestfish-actions.pod:1974
9781 "This call assumes that the guest is Windows and that the systemroot could be "
9782 "determined by inspection. If this is not the case then an error is "
9787 #: ../src/guestfs-actions.pod:2887
9788 msgid "(Added in 1.5.25)"
9792 #: ../src/guestfs-actions.pod:2889
9793 msgid "guestfs_inspect_list_applications"
9797 #: ../src/guestfs-actions.pod:2891
9800 " struct guestfs_application_list *\n"
9801 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9802 " const char *root);\n"
9807 #: ../src/guestfs-actions.pod:2898 ../fish/guestfish-actions.pod:1987
9808 msgid "Return the list of applications installed in the operating system."
9812 #: ../src/guestfs-actions.pod:2900
9814 "I<Note:> This call works differently from other parts of the inspection "
9815 "API. You have to call C<guestfs_inspect_os>, then "
9816 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9817 "this. Listing applications is a significantly more difficult operation "
9818 "which requires access to the full filesystem. Also note that unlike the "
9819 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9820 "the libguestfs handle, this call actually reads parts of the mounted "
9821 "filesystems during the call."
9825 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:1999
9827 "This returns an empty list if the inspection code was not able to determine "
9828 "the list of applications."
9832 #: ../src/guestfs-actions.pod:2913 ../fish/guestfish-actions.pod:2002
9833 msgid "The application structure contains the following fields:"
9837 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:2006
9842 #: ../src/guestfs-actions.pod:2919 ../fish/guestfish-actions.pod:2008
9844 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9845 "guests, this is the package name."
9849 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2011
9850 msgid "C<app_display_name>"
9854 #: ../src/guestfs-actions.pod:2924 ../fish/guestfish-actions.pod:2013
9856 "The display name of the application, sometimes localized to the install "
9857 "language of the guest operating system."
9861 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2016
9863 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9864 "to display something can use C<app_name> instead."
9868 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2019
9869 msgid "C<app_epoch>"
9873 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2021
9875 "For package managers which use epochs, this contains the epoch of the "
9876 "package (an integer). If unavailable, this is returned as C<0>."
9880 #: ../src/guestfs-actions.pod:2935 ../fish/guestfish-actions.pod:2024
9881 msgid "C<app_version>"
9885 #: ../src/guestfs-actions.pod:2937 ../fish/guestfish-actions.pod:2026
9887 "The version string of the application or package. If unavailable this is "
9888 "returned as an empty string C<\"\">."
9892 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2029
9893 msgid "C<app_release>"
9897 #: ../src/guestfs-actions.pod:2942 ../fish/guestfish-actions.pod:2031
9899 "The release string of the application or package, for package managers that "
9900 "use this. If unavailable this is returned as an empty string C<\"\">."
9904 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2035
9905 msgid "C<app_install_path>"
9909 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2037
9911 "The installation path of the application (on operating systems such as "
9912 "Windows which use installation paths). This path is in the format used by "
9913 "the guest operating system, it is not a libguestfs path."
9917 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2042
9918 msgid "If unavailable this is returned as an empty string C<\"\">."
9922 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2044
9923 msgid "C<app_trans_path>"
9927 #: ../src/guestfs-actions.pod:2957 ../fish/guestfish-actions.pod:2046
9929 "The install path translated into a libguestfs path. If unavailable this is "
9930 "returned as an empty string C<\"\">."
9934 #: ../src/guestfs-actions.pod:2960 ../fish/guestfish-actions.pod:2049
9935 msgid "C<app_publisher>"
9939 #: ../src/guestfs-actions.pod:2962 ../fish/guestfish-actions.pod:2051
9941 "The name of the publisher of the application, for package managers that use "
9942 "this. If unavailable this is returned as an empty string C<\"\">."
9946 #: ../src/guestfs-actions.pod:2966 ../fish/guestfish-actions.pod:2055
9951 #: ../src/guestfs-actions.pod:2968 ../fish/guestfish-actions.pod:2057
9953 "The URL (eg. upstream URL) of the application. If unavailable this is "
9954 "returned as an empty string C<\"\">."
9958 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2060
9959 msgid "C<app_source_package>"
9963 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2062
9965 "For packaging systems which support this, the name of the source package. "
9966 "If unavailable this is returned as an empty string C<\"\">."
9970 #: ../src/guestfs-actions.pod:2976 ../fish/guestfish-actions.pod:2065
9971 msgid "C<app_summary>"
9975 #: ../src/guestfs-actions.pod:2978 ../fish/guestfish-actions.pod:2067
9977 "A short (usually one line) description of the application or package. If "
9978 "unavailable this is returned as an empty string C<\"\">."
9982 #: ../src/guestfs-actions.pod:2981 ../fish/guestfish-actions.pod:2070
9983 msgid "C<app_description>"
9987 #: ../src/guestfs-actions.pod:2983 ../fish/guestfish-actions.pod:2072
9989 "A longer description of the application or package. If unavailable this is "
9990 "returned as an empty string C<\"\">."
9994 #: ../src/guestfs-actions.pod:2990
9996 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9997 "there was an error. I<The caller must call C<guestfs_free_application_list> "
10002 #: ../src/guestfs-actions.pod:2994
10003 msgid "(Added in 1.7.8)"
10007 #: ../src/guestfs-actions.pod:2996
10008 msgid "guestfs_inspect_os"
10012 #: ../src/guestfs-actions.pod:2998
10016 " guestfs_inspect_os (guestfs_h *g);\n"
10021 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2083
10023 "This function uses other libguestfs functions and certain heuristics to "
10024 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10025 "for operating systems."
10029 #: ../src/guestfs-actions.pod:3005 ../fish/guestfish-actions.pod:2087
10030 msgid "The list returned is empty if no operating systems were found."
10034 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2089
10036 "If one operating system was found, then this returns a list with a single "
10037 "element, which is the name of the root filesystem of this operating system. "
10038 "It is also possible for this function to return a list containing more than "
10039 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10040 "element being the root filesystem of one of the operating systems."
10044 #: ../src/guestfs-actions.pod:3014
10046 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
10047 "functions in order to query further information about each operating system, "
10048 "such as the name and version."
10052 #: ../src/guestfs-actions.pod:3019
10054 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
10055 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
10056 "the contents. This should be called with no disks currently mounted. The "
10057 "function may also use Augeas, so any existing Augeas handle will be closed."
10061 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2107
10063 "This function cannot decrypt encrypted disks. The caller must do that first "
10064 "(supplying the necessary keys) if the disk is encrypted."
10068 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3316 ../src/guestfs-actions.pod:3378
10069 msgid "See also C<guestfs_list_filesystems>."
10073 #: ../src/guestfs-actions.pod:3039
10074 msgid "guestfs_is_blockdev"
10078 #: ../src/guestfs-actions.pod:3041
10082 " guestfs_is_blockdev (guestfs_h *g,\n"
10083 " const char *path);\n"
10088 #: ../src/guestfs-actions.pod:3045 ../fish/guestfish-actions.pod:2119
10090 "This returns C<true> if and only if there is a block device with the given "
10095 #: ../src/guestfs-actions.pod:3048 ../src/guestfs-actions.pod:3077 ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3122 ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3209
10096 msgid "See also C<guestfs_stat>."
10100 #: ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3126 ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3213
10101 msgid "(Added in 1.5.10)"
10105 #: ../src/guestfs-actions.pod:3054
10106 msgid "guestfs_is_busy"
10110 #: ../src/guestfs-actions.pod:3056
10114 " guestfs_is_busy (guestfs_h *g);\n"
10119 #: ../src/guestfs-actions.pod:3059 ../fish/guestfish-actions.pod:2128
10121 "This returns true iff this handle is busy processing a command (in the "
10126 #: ../src/guestfs-actions.pod:3068
10127 msgid "guestfs_is_chardev"
10131 #: ../src/guestfs-actions.pod:3070
10135 " guestfs_is_chardev (guestfs_h *g,\n"
10136 " const char *path);\n"
10141 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2137
10143 "This returns C<true> if and only if there is a character device with the "
10144 "given C<path> name."
10148 #: ../src/guestfs-actions.pod:3083
10149 msgid "guestfs_is_config"
10153 #: ../src/guestfs-actions.pod:3085
10157 " guestfs_is_config (guestfs_h *g);\n"
10162 #: ../src/guestfs-actions.pod:3088 ../fish/guestfish-actions.pod:2146
10164 "This returns true iff this handle is being configured (in the C<CONFIG> "
10169 #: ../src/guestfs-actions.pod:3097
10170 msgid "guestfs_is_dir"
10174 #: ../src/guestfs-actions.pod:3099
10178 " guestfs_is_dir (guestfs_h *g,\n"
10179 " const char *path);\n"
10184 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2155
10186 "This returns C<true> if and only if there is a directory with the given "
10187 "C<path> name. Note that it returns false for other objects like files."
10191 #: ../src/guestfs-actions.pod:3113
10192 msgid "guestfs_is_fifo"
10196 #: ../src/guestfs-actions.pod:3115
10200 " guestfs_is_fifo (guestfs_h *g,\n"
10201 " const char *path);\n"
10206 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2165
10208 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10209 "given C<path> name."
10213 #: ../src/guestfs-actions.pod:3128
10214 msgid "guestfs_is_file"
10218 #: ../src/guestfs-actions.pod:3130
10222 " guestfs_is_file (guestfs_h *g,\n"
10223 " const char *path);\n"
10228 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2174
10230 "This returns C<true> if and only if there is a regular file with the given "
10231 "C<path> name. Note that it returns false for other objects like "
10236 #: ../src/guestfs-actions.pod:3144
10237 msgid "guestfs_is_launching"
10241 #: ../src/guestfs-actions.pod:3146
10245 " guestfs_is_launching (guestfs_h *g);\n"
10250 #: ../src/guestfs-actions.pod:3149 ../fish/guestfish-actions.pod:2184
10252 "This returns true iff this handle is launching the subprocess (in the "
10253 "C<LAUNCHING> state)."
10257 #: ../src/guestfs-actions.pod:3158
10258 msgid "guestfs_is_lv"
10262 #: ../src/guestfs-actions.pod:3160
10266 " guestfs_is_lv (guestfs_h *g,\n"
10267 " const char *device);\n"
10272 #: ../src/guestfs-actions.pod:3164 ../fish/guestfish-actions.pod:2193
10274 "This command tests whether C<device> is a logical volume, and returns true "
10275 "iff this is the case."
10279 #: ../src/guestfs-actions.pod:3171
10280 msgid "guestfs_is_ready"
10284 #: ../src/guestfs-actions.pod:3173
10288 " guestfs_is_ready (guestfs_h *g);\n"
10293 #: ../src/guestfs-actions.pod:3176 ../fish/guestfish-actions.pod:2200
10295 "This returns true iff this handle is ready to accept commands (in the "
10300 #: ../src/guestfs-actions.pod:3185
10301 msgid "guestfs_is_socket"
10305 #: ../src/guestfs-actions.pod:3187
10309 " guestfs_is_socket (guestfs_h *g,\n"
10310 " const char *path);\n"
10315 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2209
10317 "This returns C<true> if and only if there is a Unix domain socket with the "
10318 "given C<path> name."
10322 #: ../src/guestfs-actions.pod:3200
10323 msgid "guestfs_is_symlink"
10327 #: ../src/guestfs-actions.pod:3202
10331 " guestfs_is_symlink (guestfs_h *g,\n"
10332 " const char *path);\n"
10337 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2218
10339 "This returns C<true> if and only if there is a symbolic link with the given "
10344 #: ../src/guestfs-actions.pod:3215
10345 msgid "guestfs_kill_subprocess"
10349 #: ../src/guestfs-actions.pod:3217
10353 " guestfs_kill_subprocess (guestfs_h *g);\n"
10358 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2227
10359 msgid "This kills the qemu subprocess. You should never need to call this."
10363 #: ../src/guestfs-actions.pod:3226
10364 msgid "guestfs_launch"
10368 #: ../src/guestfs-actions.pod:3228
10372 " guestfs_launch (guestfs_h *g);\n"
10377 #: ../src/guestfs-actions.pod:3231 ../fish/guestfish-actions.pod:2235
10379 "Internally libguestfs is implemented by running a virtual machine using "
10384 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2238
10386 "You should call this after configuring the handle (eg. adding drives) but "
10387 "before performing any actions."
10391 #: ../src/guestfs-actions.pod:3241
10392 msgid "guestfs_lchown"
10396 #: ../src/guestfs-actions.pod:3243
10400 " guestfs_lchown (guestfs_h *g,\n"
10403 " const char *path);\n"
10408 #: ../src/guestfs-actions.pod:3249
10410 "Change the file owner to C<owner> and group to C<group>. This is like "
10411 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
10412 "changed, not the target."
10416 #: ../src/guestfs-actions.pod:3261
10417 msgid "guestfs_lgetxattr"
10421 #: ../src/guestfs-actions.pod:3263
10425 " guestfs_lgetxattr (guestfs_h *g,\n"
10426 " const char *path,\n"
10427 " const char *name,\n"
10428 " size_t *size_r);\n"
10433 #: ../src/guestfs-actions.pod:3269 ../fish/guestfish-actions.pod:2257
10435 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10436 "is a symlink, then this call returns an extended attribute from the symlink."
10440 #: ../src/guestfs-actions.pod:3283
10441 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
10445 #: ../src/guestfs-actions.pod:3291
10446 msgid "guestfs_lgetxattrs"
10450 #: ../src/guestfs-actions.pod:3293
10453 " struct guestfs_xattr_list *\n"
10454 " guestfs_lgetxattrs (guestfs_h *g,\n"
10455 " const char *path);\n"
10460 #: ../src/guestfs-actions.pod:3297
10462 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
10463 "then it returns the extended attributes of the link itself."
10467 #: ../src/guestfs-actions.pod:3307
10468 msgid "guestfs_list_devices"
10472 #: ../src/guestfs-actions.pod:3309
10476 " guestfs_list_devices (guestfs_h *g);\n"
10481 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2285
10482 msgid "List all the block devices."
10486 #: ../src/guestfs-actions.pod:3314 ../fish/guestfish-actions.pod:2287
10487 msgid "The full block device names are returned, eg. C</dev/sda>."
10491 #: ../src/guestfs-actions.pod:3324
10492 msgid "guestfs_list_filesystems"
10496 #: ../src/guestfs-actions.pod:3326
10500 " guestfs_list_filesystems (guestfs_h *g);\n"
10505 #: ../src/guestfs-actions.pod:3329 ../fish/guestfish-actions.pod:2295
10507 "This inspection command looks for filesystems on partitions, block devices "
10508 "and logical volumes, returning a list of devices containing filesystems and "
10513 #: ../src/guestfs-actions.pod:3333 ../fish/guestfish-actions.pod:2299
10515 "The return value is a hash, where the keys are the devices containing "
10516 "filesystems, and the values are the filesystem types. For example:"
10520 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2303
10523 " \"/dev/sda1\" => \"ntfs\"\n"
10524 " \"/dev/sda2\" => \"ext2\"\n"
10525 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10526 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10531 #: ../src/guestfs-actions.pod:3342 ../fish/guestfish-actions.pod:2308
10533 "The value can have the special value \"unknown\", meaning the content of the "
10534 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10538 #: ../src/guestfs-actions.pod:3346
10540 "This command runs other libguestfs commands, which might include "
10541 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10542 "soon after launch and only when nothing is mounted."
10546 #: ../src/guestfs-actions.pod:3350
10548 "Not all of the filesystems returned will be mountable. In particular, swap "
10549 "partitions are returned in the list. Also this command does not check that "
10550 "each filesystem found is valid and mountable, and some filesystems might be "
10551 "mountable but require special options. Filesystems may not all belong to a "
10552 "single logical operating system (use C<guestfs_inspect_os> to look for "
10557 #: ../src/guestfs-actions.pod:3364 ../src/guestfs-actions.pod:4955
10558 msgid "(Added in 1.5.15)"
10562 #: ../src/guestfs-actions.pod:3366
10563 msgid "guestfs_list_partitions"
10567 #: ../src/guestfs-actions.pod:3368
10571 " guestfs_list_partitions (guestfs_h *g);\n"
10576 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2328
10577 msgid "List all the partitions detected on all block devices."
10581 #: ../src/guestfs-actions.pod:3373 ../fish/guestfish-actions.pod:2330
10582 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10586 #: ../src/guestfs-actions.pod:3375
10588 "This does not return logical volumes. For that you will need to call "
10593 #: ../src/guestfs-actions.pod:3386
10598 #: ../src/guestfs-actions.pod:3388
10602 " guestfs_ll (guestfs_h *g,\n"
10603 " const char *directory);\n"
10608 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2341
10610 "List the files in C<directory> (relative to the root directory, there is no "
10611 "cwd) in the format of 'ls -la'."
10615 #: ../src/guestfs-actions.pod:3395 ../fish/guestfish-actions.pod:2344
10617 "This command is mostly useful for interactive sessions. It is I<not> "
10618 "intended that you try to parse the output string."
10622 #: ../src/guestfs-actions.pod:3403
10627 #: ../src/guestfs-actions.pod:3405
10631 " guestfs_ln (guestfs_h *g,\n"
10632 " const char *target,\n"
10633 " const char *linkname);\n"
10638 #: ../src/guestfs-actions.pod:3410 ../fish/guestfish-actions.pod:2351
10639 msgid "This command creates a hard link using the C<ln> command."
10643 #: ../src/guestfs-actions.pod:3416
10644 msgid "guestfs_ln_f"
10648 #: ../src/guestfs-actions.pod:3418
10652 " guestfs_ln_f (guestfs_h *g,\n"
10653 " const char *target,\n"
10654 " const char *linkname);\n"
10659 #: ../src/guestfs-actions.pod:3423 ../fish/guestfish-actions.pod:2357
10661 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10662 "option removes the link (C<linkname>) if it exists already."
10666 #: ../src/guestfs-actions.pod:3430
10667 msgid "guestfs_ln_s"
10671 #: ../src/guestfs-actions.pod:3432
10675 " guestfs_ln_s (guestfs_h *g,\n"
10676 " const char *target,\n"
10677 " const char *linkname);\n"
10682 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2364
10683 msgid "This command creates a symbolic link using the C<ln -s> command."
10687 #: ../src/guestfs-actions.pod:3443
10688 msgid "guestfs_ln_sf"
10692 #: ../src/guestfs-actions.pod:3445
10696 " guestfs_ln_sf (guestfs_h *g,\n"
10697 " const char *target,\n"
10698 " const char *linkname);\n"
10703 #: ../src/guestfs-actions.pod:3450 ../fish/guestfish-actions.pod:2370
10705 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10706 "option removes the link (C<linkname>) if it exists already."
10710 #: ../src/guestfs-actions.pod:3457
10711 msgid "guestfs_lremovexattr"
10715 #: ../src/guestfs-actions.pod:3459
10719 " guestfs_lremovexattr (guestfs_h *g,\n"
10720 " const char *xattr,\n"
10721 " const char *path);\n"
10726 #: ../src/guestfs-actions.pod:3464
10728 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10729 "link, then it removes an extended attribute of the link itself."
10733 #: ../src/guestfs-actions.pod:3472
10738 #: ../src/guestfs-actions.pod:3474
10742 " guestfs_ls (guestfs_h *g,\n"
10743 " const char *directory);\n"
10748 #: ../src/guestfs-actions.pod:3478 ../fish/guestfish-actions.pod:2385
10750 "List the files in C<directory> (relative to the root directory, there is no "
10751 "cwd). The '.' and '..' entries are not returned, but hidden files are "
10756 #: ../src/guestfs-actions.pod:3482
10758 "This command is mostly useful for interactive sessions. Programs should "
10759 "probably use C<guestfs_readdir> instead."
10763 #: ../src/guestfs-actions.pod:3491
10764 msgid "guestfs_lsetxattr"
10768 #: ../src/guestfs-actions.pod:3493
10772 " guestfs_lsetxattr (guestfs_h *g,\n"
10773 " const char *xattr,\n"
10774 " const char *val,\n"
10776 " const char *path);\n"
10781 #: ../src/guestfs-actions.pod:3500
10783 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10784 "then it sets an extended attribute of the link itself."
10788 #: ../src/guestfs-actions.pod:3508
10789 msgid "guestfs_lstat"
10793 #: ../src/guestfs-actions.pod:3510
10796 " struct guestfs_stat *\n"
10797 " guestfs_lstat (guestfs_h *g,\n"
10798 " const char *path);\n"
10803 #: ../src/guestfs-actions.pod:3514 ../src/guestfs-actions.pod:6009 ../fish/guestfish-actions.pod:2404 ../fish/guestfish-actions.pod:4017
10804 msgid "Returns file information for the given C<path>."
10808 #: ../src/guestfs-actions.pod:3516
10810 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10811 "link, then the link is stat-ed, not the file it refers to."
10815 #: ../src/guestfs-actions.pod:3520 ../fish/guestfish-actions.pod:2410
10816 msgid "This is the same as the C<lstat(2)> system call."
10820 #: ../src/guestfs-actions.pod:3522 ../src/guestfs-actions.pod:6013
10822 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10823 "error. I<The caller must call C<guestfs_free_stat> after use>."
10827 #: ../src/guestfs-actions.pod:3526 ../src/guestfs-actions.pod:6017 ../src/guestfs-actions.pod:6035 ../src/guestfs-actions.pod:6416
10828 msgid "(Added in 0.9.2)"
10832 #: ../src/guestfs-actions.pod:3528
10833 msgid "guestfs_lstatlist"
10837 #: ../src/guestfs-actions.pod:3530
10840 " struct guestfs_stat_list *\n"
10841 " guestfs_lstatlist (guestfs_h *g,\n"
10842 " const char *path,\n"
10843 " char *const *names);\n"
10848 #: ../src/guestfs-actions.pod:3535
10850 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10851 "files, where all files are in the directory C<path>. C<names> is the list "
10852 "of files from this directory."
10856 #: ../src/guestfs-actions.pod:3539 ../fish/guestfish-actions.pod:2420
10858 "On return you get a list of stat structs, with a one-to-one correspondence "
10859 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10860 "then the C<ino> field of that structure is set to C<-1>."
10864 #: ../src/guestfs-actions.pod:3544
10866 "This call is intended for programs that want to efficiently list a directory "
10867 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10868 "for a similarly efficient call for getting extended attributes. Very long "
10869 "directory listings might cause the protocol message size to be exceeded, "
10870 "causing this call to fail. The caller must split up such requests into "
10871 "smaller groups of names."
10875 #: ../src/guestfs-actions.pod:3552
10877 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10878 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10882 #: ../src/guestfs-actions.pod:3558
10883 msgid "guestfs_luks_add_key"
10887 #: ../src/guestfs-actions.pod:3560
10891 " guestfs_luks_add_key (guestfs_h *g,\n"
10892 " const char *device,\n"
10893 " const char *key,\n"
10894 " const char *newkey,\n"
10900 #: ../src/guestfs-actions.pod:3567 ../fish/guestfish-actions.pod:2437
10902 "This command adds a new key on LUKS device C<device>. C<key> is any "
10903 "existing key, and is used to access the device. C<newkey> is the new key to "
10904 "add. C<keyslot> is the key slot that will be replaced."
10908 #: ../src/guestfs-actions.pod:3572
10910 "Note that if C<keyslot> already contains a key, then this command will "
10911 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10915 #: ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3618 ../src/guestfs-actions.pod:3641 ../src/guestfs-actions.pod:3661 ../src/guestfs-actions.pod:3693 ../src/guestfs-actions.pod:3712
10917 "This function takes a key or passphrase parameter which could contain "
10918 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10923 #: ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:3622 ../src/guestfs-actions.pod:3645 ../src/guestfs-actions.pod:3665
10924 msgid "(Added in 1.5.2)"
10928 #: ../src/guestfs-actions.pod:3584
10929 msgid "guestfs_luks_close"
10933 #: ../src/guestfs-actions.pod:3586
10937 " guestfs_luks_close (guestfs_h *g,\n"
10938 " const char *device);\n"
10943 #: ../src/guestfs-actions.pod:3590
10945 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10946 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10947 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10948 "underlying block device."
10952 #: ../src/guestfs-actions.pod:3598 ../src/guestfs-actions.pod:3697 ../src/guestfs-actions.pod:3716 ../src/guestfs-actions.pod:3766 ../src/guestfs-actions.pod:3814
10953 msgid "(Added in 1.5.1)"
10957 #: ../src/guestfs-actions.pod:3600
10958 msgid "guestfs_luks_format"
10962 #: ../src/guestfs-actions.pod:3602
10966 " guestfs_luks_format (guestfs_h *g,\n"
10967 " const char *device,\n"
10968 " const char *key,\n"
10974 #: ../src/guestfs-actions.pod:3608 ../fish/guestfish-actions.pod:2463
10976 "This command erases existing data on C<device> and formats the device as a "
10977 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10978 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10982 #: ../src/guestfs-actions.pod:3615 ../src/guestfs-actions.pod:3638 ../src/guestfs-actions.pod:3778 ../src/guestfs-actions.pod:4706 ../src/guestfs-actions.pod:5469 ../src/guestfs-actions.pod:5844 ../src/guestfs-actions.pod:5867 ../src/guestfs-actions.pod:5893 ../src/guestfs-actions.pod:7053 ../fish/guestfish-actions.pod:2471 ../fish/guestfish-actions.pod:2484 ../fish/guestfish-actions.pod:2568 ../fish/guestfish-actions.pod:3129 ../fish/guestfish-actions.pod:3636 ../fish/guestfish-actions.pod:3916 ../fish/guestfish-actions.pod:3932 ../fish/guestfish-actions.pod:3947 ../fish/guestfish-actions.pod:4662
10984 "B<This command is dangerous. Without careful use you can easily destroy all "
10989 #: ../src/guestfs-actions.pod:3624
10990 msgid "guestfs_luks_format_cipher"
10994 #: ../src/guestfs-actions.pod:3626
10998 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10999 " const char *device,\n"
11000 " const char *key,\n"
11002 " const char *cipher);\n"
11007 #: ../src/guestfs-actions.pod:3633
11009 "This command is the same as C<guestfs_luks_format> but it also allows you to "
11010 "set the C<cipher> used."
11014 #: ../src/guestfs-actions.pod:3647
11015 msgid "guestfs_luks_kill_slot"
11019 #: ../src/guestfs-actions.pod:3649
11023 " guestfs_luks_kill_slot (guestfs_h *g,\n"
11024 " const char *device,\n"
11025 " const char *key,\n"
11031 #: ../src/guestfs-actions.pod:3655 ../fish/guestfish-actions.pod:2491
11033 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11034 "device C<device>. C<key> must be one of the I<other> keys."
11038 #: ../src/guestfs-actions.pod:3667
11039 msgid "guestfs_luks_open"
11043 #: ../src/guestfs-actions.pod:3669
11047 " guestfs_luks_open (guestfs_h *g,\n"
11048 " const char *device,\n"
11049 " const char *key,\n"
11050 " const char *mapname);\n"
11055 #: ../src/guestfs-actions.pod:3675 ../fish/guestfish-actions.pod:2502
11057 "This command opens a block device which has been encrypted according to the "
11058 "Linux Unified Key Setup (LUKS) standard."
11062 #: ../src/guestfs-actions.pod:3678 ../fish/guestfish-actions.pod:2505
11063 msgid "C<device> is the encrypted block device or partition."
11067 #: ../src/guestfs-actions.pod:3680 ../fish/guestfish-actions.pod:2507
11069 "The caller must supply one of the keys associated with the LUKS block "
11070 "device, in the C<key> parameter."
11074 #: ../src/guestfs-actions.pod:3683 ../fish/guestfish-actions.pod:2510
11076 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11077 "writes to this block device are decrypted from and encrypted to the "
11078 "underlying C<device> respectively."
11082 #: ../src/guestfs-actions.pod:3687
11084 "If this block device contains LVM volume groups, then calling "
11085 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
11090 #: ../src/guestfs-actions.pod:3699
11091 msgid "guestfs_luks_open_ro"
11095 #: ../src/guestfs-actions.pod:3701
11099 " guestfs_luks_open_ro (guestfs_h *g,\n"
11100 " const char *device,\n"
11101 " const char *key,\n"
11102 " const char *mapname);\n"
11107 #: ../src/guestfs-actions.pod:3707
11109 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
11114 #: ../src/guestfs-actions.pod:3718
11115 msgid "guestfs_lvcreate"
11119 #: ../src/guestfs-actions.pod:3720
11123 " guestfs_lvcreate (guestfs_h *g,\n"
11124 " const char *logvol,\n"
11125 " const char *volgroup,\n"
11131 #: ../src/guestfs-actions.pod:3726 ../fish/guestfish-actions.pod:2535
11133 "This creates an LVM logical volume called C<logvol> on the volume group "
11134 "C<volgroup>, with C<size> megabytes."
11138 #: ../src/guestfs-actions.pod:3733
11139 msgid "guestfs_lvm_canonical_lv_name"
11143 #: ../src/guestfs-actions.pod:3735
11147 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
11148 " const char *lvname);\n"
11153 #: ../src/guestfs-actions.pod:3739 ../fish/guestfish-actions.pod:2542
11155 "This converts alternative naming schemes for LVs that you might find to the "
11156 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11161 #: ../src/guestfs-actions.pod:3743 ../fish/guestfish-actions.pod:2546
11163 "This command returns an error if the C<lvname> parameter does not refer to a "
11168 #: ../src/guestfs-actions.pod:3746
11169 msgid "See also C<guestfs_is_lv>."
11173 #: ../src/guestfs-actions.pod:3751
11174 msgid "(Added in 1.5.24)"
11178 #: ../src/guestfs-actions.pod:3753
11179 msgid "guestfs_lvm_clear_filter"
11183 #: ../src/guestfs-actions.pod:3755
11187 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
11192 #: ../src/guestfs-actions.pod:3758
11194 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
11195 "see every block device."
11199 #: ../src/guestfs-actions.pod:3761 ../src/guestfs-actions.pod:3803 ../fish/guestfish-actions.pod:2558 ../fish/guestfish-actions.pod:2589
11200 msgid "This command also clears the LVM cache and performs a volume group scan."
11204 #: ../src/guestfs-actions.pod:3768
11205 msgid "guestfs_lvm_remove_all"
11209 #: ../src/guestfs-actions.pod:3770
11213 " guestfs_lvm_remove_all (guestfs_h *g);\n"
11218 #: ../src/guestfs-actions.pod:3773 ../fish/guestfish-actions.pod:2565
11220 "This command removes all LVM logical volumes, volume groups and physical "
11225 #: ../src/guestfs-actions.pod:3783
11226 msgid "guestfs_lvm_set_filter"
11230 #: ../src/guestfs-actions.pod:3785
11234 " guestfs_lvm_set_filter (guestfs_h *g,\n"
11235 " char *const *devices);\n"
11240 #: ../src/guestfs-actions.pod:3789 ../fish/guestfish-actions.pod:2575
11242 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11243 "block devices in the list C<devices>, and will ignore all other attached "
11248 #: ../src/guestfs-actions.pod:3793 ../fish/guestfish-actions.pod:2579
11250 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11251 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11252 "there are two types of duplication possible: either cloned PVs/VGs which "
11253 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11254 "same name. In normal operation you cannot create this situation, but you "
11255 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11256 "inside the LVM metadata."
11260 #: ../src/guestfs-actions.pod:3806 ../fish/guestfish-actions.pod:2592
11261 msgid "You can filter whole block devices or individual partitions."
11265 #: ../src/guestfs-actions.pod:3808 ../fish/guestfish-actions.pod:2594
11267 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11268 "filesystem), even if you are not filtering out that VG."
11272 #: ../src/guestfs-actions.pod:3816
11273 msgid "guestfs_lvremove"
11277 #: ../src/guestfs-actions.pod:3818
11281 " guestfs_lvremove (guestfs_h *g,\n"
11282 " const char *device);\n"
11287 #: ../src/guestfs-actions.pod:3822 ../fish/guestfish-actions.pod:2602
11289 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11290 "LV, such as C</dev/VG/LV>."
11294 #: ../src/guestfs-actions.pod:3825 ../fish/guestfish-actions.pod:2605
11296 "You can also remove all LVs in a volume group by specifying the VG name, "
11301 #: ../src/guestfs-actions.pod:3830 ../src/guestfs-actions.pod:5052 ../src/guestfs-actions.pod:6792
11302 msgid "(Added in 1.0.13)"
11306 #: ../src/guestfs-actions.pod:3832
11307 msgid "guestfs_lvrename"
11311 #: ../src/guestfs-actions.pod:3834
11315 " guestfs_lvrename (guestfs_h *g,\n"
11316 " const char *logvol,\n"
11317 " const char *newlogvol);\n"
11322 #: ../src/guestfs-actions.pod:3839 ../fish/guestfish-actions.pod:2612
11323 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11327 #: ../src/guestfs-actions.pod:3843 ../src/guestfs-actions.pod:6805
11328 msgid "(Added in 1.0.83)"
11332 #: ../src/guestfs-actions.pod:3845
11333 msgid "guestfs_lvresize"
11337 #: ../src/guestfs-actions.pod:3847
11341 " guestfs_lvresize (guestfs_h *g,\n"
11342 " const char *device,\n"
11348 #: ../src/guestfs-actions.pod:3852 ../fish/guestfish-actions.pod:2618
11350 "This resizes (expands or shrinks) an existing LVM logical volume to "
11351 "C<mbytes>. When reducing, data in the reduced part is lost."
11355 #: ../src/guestfs-actions.pod:3860
11356 msgid "guestfs_lvresize_free"
11360 #: ../src/guestfs-actions.pod:3862
11364 " guestfs_lvresize_free (guestfs_h *g,\n"
11365 " const char *lv,\n"
11371 #: ../src/guestfs-actions.pod:3867 ../fish/guestfish-actions.pod:2626
11373 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11374 "remaining free space in the volume group. Commonly you would call this with "
11375 "pc = 100 which expands the logical volume as much as possible, using all "
11376 "remaining free space in the volume group."
11380 #: ../src/guestfs-actions.pod:3875
11381 msgid "(Added in 1.3.3)"
11385 #: ../src/guestfs-actions.pod:3877
11386 msgid "guestfs_lvs"
11390 #: ../src/guestfs-actions.pod:3879
11394 " guestfs_lvs (guestfs_h *g);\n"
11399 #: ../src/guestfs-actions.pod:3882 ../fish/guestfish-actions.pod:2636
11401 "List all the logical volumes detected. This is the equivalent of the "
11402 "L<lvs(8)> command."
11406 #: ../src/guestfs-actions.pod:3885 ../fish/guestfish-actions.pod:2639
11408 "This returns a list of the logical volume device names "
11409 "(eg. C</dev/VolGroup00/LogVol00>)."
11413 #: ../src/guestfs-actions.pod:3888
11414 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
11418 #: ../src/guestfs-actions.pod:3896
11419 msgid "guestfs_lvs_full"
11423 #: ../src/guestfs-actions.pod:3898
11426 " struct guestfs_lvm_lv_list *\n"
11427 " guestfs_lvs_full (guestfs_h *g);\n"
11432 #: ../src/guestfs-actions.pod:3901 ../fish/guestfish-actions.pod:2648
11434 "List all the logical volumes detected. This is the equivalent of the "
11435 "L<lvs(8)> command. The \"full\" version includes all fields."
11439 #: ../src/guestfs-actions.pod:3904
11441 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
11442 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
11447 #: ../src/guestfs-actions.pod:3910
11448 msgid "guestfs_lvuuid"
11452 #: ../src/guestfs-actions.pod:3912
11456 " guestfs_lvuuid (guestfs_h *g,\n"
11457 " const char *device);\n"
11462 #: ../src/guestfs-actions.pod:3916 ../fish/guestfish-actions.pod:2655
11463 msgid "This command returns the UUID of the LVM LV C<device>."
11467 #: ../src/guestfs-actions.pod:3923
11468 msgid "guestfs_lxattrlist"
11472 #: ../src/guestfs-actions.pod:3925
11475 " struct guestfs_xattr_list *\n"
11476 " guestfs_lxattrlist (guestfs_h *g,\n"
11477 " const char *path,\n"
11478 " char *const *names);\n"
11483 #: ../src/guestfs-actions.pod:3930 ../fish/guestfish-actions.pod:2661
11485 "This call allows you to get the extended attributes of multiple files, where "
11486 "all files are in the directory C<path>. C<names> is the list of files from "
11491 #: ../src/guestfs-actions.pod:3934 ../fish/guestfish-actions.pod:2665
11493 "On return you get a flat list of xattr structs which must be interpreted "
11494 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11495 "C<attrval> in this struct is zero-length to indicate there was an error "
11496 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11497 "number (the number of following attributes for this file, which could be "
11498 "C<\"0\">). Then after the first xattr struct are the zero or more "
11499 "attributes for the first named file. This repeats for the second and "
11500 "subsequent files."
11504 #: ../src/guestfs-actions.pod:3944
11506 "This call is intended for programs that want to efficiently list a directory "
11507 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11508 "a similarly efficient call for getting standard stats. Very long directory "
11509 "listings might cause the protocol message size to be exceeded, causing this "
11510 "call to fail. The caller must split up such requests into smaller groups of "
11515 #: ../src/guestfs-actions.pod:3958
11516 msgid "guestfs_mkdir"
11520 #: ../src/guestfs-actions.pod:3960
11524 " guestfs_mkdir (guestfs_h *g,\n"
11525 " const char *path);\n"
11530 #: ../src/guestfs-actions.pod:3964 ../fish/guestfish-actions.pod:2687
11531 msgid "Create a directory named C<path>."
11535 #: ../src/guestfs-actions.pod:3970
11536 msgid "guestfs_mkdir_mode"
11540 #: ../src/guestfs-actions.pod:3972
11544 " guestfs_mkdir_mode (guestfs_h *g,\n"
11545 " const char *path,\n"
11551 #: ../src/guestfs-actions.pod:3977 ../fish/guestfish-actions.pod:2693
11553 "This command creates a directory, setting the initial permissions of the "
11554 "directory to C<mode>."
11558 #: ../src/guestfs-actions.pod:3980 ../fish/guestfish-actions.pod:2696
11560 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11561 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11566 #: ../src/guestfs-actions.pod:3984
11567 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11571 #: ../src/guestfs-actions.pod:3990
11572 msgid "guestfs_mkdir_p"
11576 #: ../src/guestfs-actions.pod:3992
11580 " guestfs_mkdir_p (guestfs_h *g,\n"
11581 " const char *path);\n"
11586 #: ../src/guestfs-actions.pod:3996 ../fish/guestfish-actions.pod:2706
11588 "Create a directory named C<path>, creating any parent directories as "
11589 "necessary. This is like the C<mkdir -p> shell command."
11593 #: ../src/guestfs-actions.pod:4003
11594 msgid "guestfs_mkdtemp"
11598 #: ../src/guestfs-actions.pod:4005
11602 " guestfs_mkdtemp (guestfs_h *g,\n"
11603 " const char *template);\n"
11608 #: ../src/guestfs-actions.pod:4009 ../fish/guestfish-actions.pod:2713
11610 "This command creates a temporary directory. The C<template> parameter "
11611 "should be a full pathname for the temporary directory name with the final "
11612 "six characters being \"XXXXXX\"."
11616 #: ../src/guestfs-actions.pod:4014 ../fish/guestfish-actions.pod:2718
11618 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11619 "being suitable for Windows filesystems."
11623 #: ../src/guestfs-actions.pod:4017 ../fish/guestfish-actions.pod:2721
11624 msgid "The name of the temporary directory that was created is returned."
11628 #: ../src/guestfs-actions.pod:4020 ../fish/guestfish-actions.pod:2724
11629 msgid "The temporary directory is created with mode 0700 and is owned by root."
11633 #: ../src/guestfs-actions.pod:4023 ../fish/guestfish-actions.pod:2727
11635 "The caller is responsible for deleting the temporary directory and its "
11636 "contents after use."
11640 #: ../src/guestfs-actions.pod:4026 ../fish/guestfish-actions.pod:2730
11641 msgid "See also: L<mkdtemp(3)>"
11645 #: ../src/guestfs-actions.pod:4033
11646 msgid "guestfs_mke2fs_J"
11650 #: ../src/guestfs-actions.pod:4035
11654 " guestfs_mke2fs_J (guestfs_h *g,\n"
11655 " const char *fstype,\n"
11656 " int blocksize,\n"
11657 " const char *device,\n"
11658 " const char *journal);\n"
11663 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:2736
11665 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11666 "C<journal>. It is equivalent to the command:"
11670 #: ../src/guestfs-actions.pod:4046 ../fish/guestfish-actions.pod:2740
11673 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11678 #: ../src/guestfs-actions.pod:4048
11679 msgid "See also C<guestfs_mke2journal>."
11683 #: ../src/guestfs-actions.pod:4052 ../src/guestfs-actions.pod:4070 ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4104 ../src/guestfs-actions.pod:4118 ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:4191 ../src/guestfs-actions.pod:4442
11684 msgid "(Added in 1.0.68)"
11688 #: ../src/guestfs-actions.pod:4054
11689 msgid "guestfs_mke2fs_JL"
11693 #: ../src/guestfs-actions.pod:4056
11697 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11698 " const char *fstype,\n"
11699 " int blocksize,\n"
11700 " const char *device,\n"
11701 " const char *label);\n"
11706 #: ../src/guestfs-actions.pod:4063 ../fish/guestfish-actions.pod:2748
11708 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11709 "the journal labeled C<label>."
11713 #: ../src/guestfs-actions.pod:4066
11714 msgid "See also C<guestfs_mke2journal_L>."
11718 #: ../src/guestfs-actions.pod:4072
11719 msgid "guestfs_mke2fs_JU"
11723 #: ../src/guestfs-actions.pod:4074
11727 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11728 " const char *fstype,\n"
11729 " int blocksize,\n"
11730 " const char *device,\n"
11731 " const char *uuid);\n"
11736 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:2757
11738 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11739 "the journal with UUID C<uuid>."
11743 #: ../src/guestfs-actions.pod:4084
11744 msgid "See also C<guestfs_mke2journal_U>."
11748 #: ../src/guestfs-actions.pod:4090
11749 msgid "guestfs_mke2journal"
11753 #: ../src/guestfs-actions.pod:4092
11757 " guestfs_mke2journal (guestfs_h *g,\n"
11758 " int blocksize,\n"
11759 " const char *device);\n"
11764 #: ../src/guestfs-actions.pod:4097 ../fish/guestfish-actions.pod:2766
11766 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11771 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:2769
11774 " mke2fs -O journal_dev -b blocksize device\n"
11779 #: ../src/guestfs-actions.pod:4106
11780 msgid "guestfs_mke2journal_L"
11784 #: ../src/guestfs-actions.pod:4108
11788 " guestfs_mke2journal_L (guestfs_h *g,\n"
11789 " int blocksize,\n"
11790 " const char *label,\n"
11791 " const char *device);\n"
11796 #: ../src/guestfs-actions.pod:4114 ../fish/guestfish-actions.pod:2775
11797 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11801 #: ../src/guestfs-actions.pod:4120
11802 msgid "guestfs_mke2journal_U"
11806 #: ../src/guestfs-actions.pod:4122
11810 " guestfs_mke2journal_U (guestfs_h *g,\n"
11811 " int blocksize,\n"
11812 " const char *uuid,\n"
11813 " const char *device);\n"
11818 #: ../src/guestfs-actions.pod:4128 ../fish/guestfish-actions.pod:2781
11819 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11823 #: ../src/guestfs-actions.pod:4134
11824 msgid "guestfs_mkfifo"
11828 #: ../src/guestfs-actions.pod:4136
11832 " guestfs_mkfifo (guestfs_h *g,\n"
11834 " const char *path);\n"
11839 #: ../src/guestfs-actions.pod:4141
11841 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11842 "is just a convenient wrapper around C<guestfs_mknod>."
11846 #: ../src/guestfs-actions.pod:4151
11847 msgid "guestfs_mkfs"
11851 #: ../src/guestfs-actions.pod:4153
11855 " guestfs_mkfs (guestfs_h *g,\n"
11856 " const char *fstype,\n"
11857 " const char *device);\n"
11862 #: ../src/guestfs-actions.pod:4158 ../fish/guestfish-actions.pod:2797
11864 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11865 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11869 #: ../src/guestfs-actions.pod:4166
11870 msgid "guestfs_mkfs_b"
11874 #: ../src/guestfs-actions.pod:4168
11878 " guestfs_mkfs_b (guestfs_h *g,\n"
11879 " const char *fstype,\n"
11880 " int blocksize,\n"
11881 " const char *device);\n"
11886 #: ../src/guestfs-actions.pod:4174
11888 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11889 "block size of the resulting filesystem. Supported block sizes depend on the "
11890 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11894 #: ../src/guestfs-actions.pod:4179 ../src/guestfs-actions.pod:4221 ../fish/guestfish-actions.pod:2810 ../fish/guestfish-actions.pod:2837
11896 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11901 #: ../src/guestfs-actions.pod:4184 ../fish/guestfish-actions.pod:2813
11903 "This function is deprecated. In new code, use the C<mkfs_opts> call "
11908 #: ../src/guestfs-actions.pod:4193
11909 msgid "guestfs_mkfs_opts"
11913 #: ../src/guestfs-actions.pod:4195
11917 " guestfs_mkfs_opts (guestfs_h *g,\n"
11918 " const char *fstype,\n"
11919 " const char *device,\n"
11925 #: ../src/guestfs-actions.pod:4206
11928 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11933 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:2824
11935 "This function creates a filesystem on C<device>. The filesystem type is "
11936 "C<fstype>, for example C<ext3>."
11940 #: ../src/guestfs-actions.pod:4215 ../fish/guestfish-actions.pod:2831
11941 msgid "C<blocksize>"
11945 #: ../src/guestfs-actions.pod:4217 ../fish/guestfish-actions.pod:2833
11947 "The filesystem block size. Supported block sizes depend on the filesystem "
11948 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11953 #: ../src/guestfs-actions.pod:4228
11954 msgid "(Added in 1.7.19)"
11958 #: ../src/guestfs-actions.pod:4230
11959 msgid "guestfs_mkfs_opts_va"
11963 #: ../src/guestfs-actions.pod:4232
11967 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11968 " const char *fstype,\n"
11969 " const char *device,\n"
11970 " va_list args);\n"
11975 #: ../src/guestfs-actions.pod:4238
11976 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11980 #: ../src/guestfs-actions.pod:4242
11981 msgid "guestfs_mkfs_opts_argv"
11985 #: ../src/guestfs-actions.pod:4244
11989 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11990 " const char *fstype,\n"
11991 " const char *device,\n"
11992 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11997 #: ../src/guestfs-actions.pod:4250
11998 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
12002 #: ../src/guestfs-actions.pod:4254
12003 msgid "guestfs_mkmountpoint"
12007 #: ../src/guestfs-actions.pod:4256
12011 " guestfs_mkmountpoint (guestfs_h *g,\n"
12012 " const char *exemptpath);\n"
12017 #: ../src/guestfs-actions.pod:4260
12019 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
12020 "that can be used to create extra mountpoints before mounting the first "
12025 #: ../src/guestfs-actions.pod:4264 ../fish/guestfish-actions.pod:2852
12027 "These calls are I<only> necessary in some very limited circumstances, mainly "
12028 "the case where you want to mount a mix of unrelated and/or read-only "
12029 "filesystems together."
12033 #: ../src/guestfs-actions.pod:4268 ../fish/guestfish-actions.pod:2856
12035 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12036 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12037 "inside that. You can unpack this as follows in guestfish:"
12041 #: ../src/guestfs-actions.pod:4273 ../fish/guestfish-actions.pod:2861
12044 " add-ro Fedora-11-i686-Live.iso\n"
12046 " mkmountpoint /cd\n"
12047 " mkmountpoint /sqsh\n"
12048 " mkmountpoint /ext3fs\n"
12049 " mount /dev/sda /cd\n"
12050 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12051 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12056 #: ../src/guestfs-actions.pod:4282 ../fish/guestfish-actions.pod:2870
12057 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12061 #: ../src/guestfs-actions.pod:4284
12063 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
12064 "may get unexpected errors if you try to mix these calls. It is safest to "
12065 "manually unmount filesystems and remove mountpoints after use."
12069 #: ../src/guestfs-actions.pod:4288
12071 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
12072 "first, so for this to work for manual mountpoints, you must ensure that the "
12073 "innermost mountpoints have the longest pathnames, as in the example code "
12078 #: ../src/guestfs-actions.pod:4293 ../fish/guestfish-actions.pod:2881
12079 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12083 #: ../src/guestfs-actions.pod:4295
12085 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
12086 "means that C<guestfs_umount_all> is called when the handle is closed which "
12087 "can also trigger these issues."
12091 #: ../src/guestfs-actions.pod:4301 ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:5453
12092 msgid "(Added in 1.0.62)"
12096 #: ../src/guestfs-actions.pod:4303
12097 msgid "guestfs_mknod"
12101 #: ../src/guestfs-actions.pod:4305
12105 " guestfs_mknod (guestfs_h *g,\n"
12109 " const char *path);\n"
12114 #: ../src/guestfs-actions.pod:4312 ../fish/guestfish-actions.pod:2891
12116 "This call creates block or character special devices, or named pipes "
12121 #: ../src/guestfs-actions.pod:4315 ../fish/guestfish-actions.pod:2894
12123 "The C<mode> parameter should be the mode, using the standard constants. "
12124 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12125 "used when creating block and character special devices."
12129 #: ../src/guestfs-actions.pod:4320
12131 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12132 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12133 "regular file). These constants are available in the standard Linux header "
12134 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
12135 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
12136 "the appropriate constant for you."
12140 #: ../src/guestfs-actions.pod:4334
12141 msgid "guestfs_mknod_b"
12145 #: ../src/guestfs-actions.pod:4336
12149 " guestfs_mknod_b (guestfs_h *g,\n"
12153 " const char *path);\n"
12158 #: ../src/guestfs-actions.pod:4343
12160 "This call creates a block device node called C<path> with mode C<mode> and "
12161 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12162 "wrapper around C<guestfs_mknod>."
12166 #: ../src/guestfs-actions.pod:4353
12167 msgid "guestfs_mknod_c"
12171 #: ../src/guestfs-actions.pod:4355
12175 " guestfs_mknod_c (guestfs_h *g,\n"
12179 " const char *path);\n"
12184 #: ../src/guestfs-actions.pod:4362
12186 "This call creates a char device node called C<path> with mode C<mode> and "
12187 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12188 "wrapper around C<guestfs_mknod>."
12192 #: ../src/guestfs-actions.pod:4372
12193 msgid "guestfs_mkswap"
12197 #: ../src/guestfs-actions.pod:4374
12201 " guestfs_mkswap (guestfs_h *g,\n"
12202 " const char *device);\n"
12207 #: ../src/guestfs-actions.pod:4378 ../fish/guestfish-actions.pod:2933
12208 msgid "Create a swap partition on C<device>."
12212 #: ../src/guestfs-actions.pod:4384
12213 msgid "guestfs_mkswap_L"
12217 #: ../src/guestfs-actions.pod:4386
12221 " guestfs_mkswap_L (guestfs_h *g,\n"
12222 " const char *label,\n"
12223 " const char *device);\n"
12228 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:2939
12229 msgid "Create a swap partition on C<device> with label C<label>."
12233 #: ../src/guestfs-actions.pod:4393 ../fish/guestfish-actions.pod:2941
12235 "Note that you cannot attach a swap label to a block device "
12236 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12237 "the kernel or swap tools."
12241 #: ../src/guestfs-actions.pod:4401
12242 msgid "guestfs_mkswap_U"
12246 #: ../src/guestfs-actions.pod:4403
12250 " guestfs_mkswap_U (guestfs_h *g,\n"
12251 " const char *uuid,\n"
12252 " const char *device);\n"
12257 #: ../src/guestfs-actions.pod:4408 ../fish/guestfish-actions.pod:2949
12258 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12262 #: ../src/guestfs-actions.pod:4414
12263 msgid "guestfs_mkswap_file"
12267 #: ../src/guestfs-actions.pod:4416
12271 " guestfs_mkswap_file (guestfs_h *g,\n"
12272 " const char *path);\n"
12277 #: ../src/guestfs-actions.pod:4420 ../fish/guestfish-actions.pod:2955
12278 msgid "Create a swap file."
12282 #: ../src/guestfs-actions.pod:4422
12284 "This command just writes a swap file signature to an existing file. To "
12285 "create the file itself, use something like C<guestfs_fallocate>."
12289 #: ../src/guestfs-actions.pod:4429
12290 msgid "guestfs_modprobe"
12294 #: ../src/guestfs-actions.pod:4431
12298 " guestfs_modprobe (guestfs_h *g,\n"
12299 " const char *modulename);\n"
12304 #: ../src/guestfs-actions.pod:4435 ../fish/guestfish-actions.pod:2964
12305 msgid "This loads a kernel module in the appliance."
12309 #: ../src/guestfs-actions.pod:4437 ../fish/guestfish-actions.pod:2966
12311 "The kernel module must have been whitelisted when libguestfs was built (see "
12312 "C<appliance/kmod.whitelist.in> in the source)."
12316 #: ../src/guestfs-actions.pod:4444
12317 msgid "guestfs_mount"
12321 #: ../src/guestfs-actions.pod:4446
12325 " guestfs_mount (guestfs_h *g,\n"
12326 " const char *device,\n"
12327 " const char *mountpoint);\n"
12332 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:2973
12334 "Mount a guest disk at a position in the filesystem. Block devices are named "
12335 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12336 "those block devices contain partitions, they will have the usual names "
12337 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12341 #: ../src/guestfs-actions.pod:4457 ../fish/guestfish-actions.pod:2979
12343 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12344 "mounted on C</> before others can be mounted. Other filesystems can only be "
12345 "mounted on directories which already exist."
12349 #: ../src/guestfs-actions.pod:4462 ../fish/guestfish-actions.pod:2984
12351 "The mounted filesystem is writable, if we have sufficient permissions on the "
12352 "underlying device."
12356 #: ../src/guestfs-actions.pod:4465
12358 "B<Important note:> When you use this call, the filesystem options C<sync> "
12359 "and C<noatime> are set implicitly. This was originally done because we "
12360 "thought it would improve reliability, but it turns out that I<-o sync> has a "
12361 "very large negative performance impact and negligible effect on "
12362 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
12363 "in any code that needs performance, and instead use C<guestfs_mount_options> "
12364 "(use an empty string for the first parameter if you don't want any options)."
12368 #: ../src/guestfs-actions.pod:4479
12369 msgid "guestfs_mount_loop"
12373 #: ../src/guestfs-actions.pod:4481
12377 " guestfs_mount_loop (guestfs_h *g,\n"
12378 " const char *file,\n"
12379 " const char *mountpoint);\n"
12384 #: ../src/guestfs-actions.pod:4486 ../fish/guestfish-actions.pod:3001
12386 "This command lets you mount C<file> (a filesystem image in a file) on a "
12387 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12392 #: ../src/guestfs-actions.pod:4494
12393 msgid "guestfs_mount_options"
12397 #: ../src/guestfs-actions.pod:4496
12401 " guestfs_mount_options (guestfs_h *g,\n"
12402 " const char *options,\n"
12403 " const char *device,\n"
12404 " const char *mountpoint);\n"
12409 #: ../src/guestfs-actions.pod:4502
12411 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12412 "the mount options as for the L<mount(8)> I<-o> flag."
12416 #: ../src/guestfs-actions.pod:4506 ../fish/guestfish-actions.pod:3013
12418 "If the C<options> parameter is an empty string, then no options are passed "
12419 "(all options default to whatever the filesystem uses)."
12423 #: ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4526 ../src/guestfs-actions.pod:4543
12424 msgid "(Added in 1.0.10)"
12428 #: ../src/guestfs-actions.pod:4514
12429 msgid "guestfs_mount_ro"
12433 #: ../src/guestfs-actions.pod:4516
12437 " guestfs_mount_ro (guestfs_h *g,\n"
12438 " const char *device,\n"
12439 " const char *mountpoint);\n"
12444 #: ../src/guestfs-actions.pod:4521
12446 "This is the same as the C<guestfs_mount> command, but it mounts the "
12447 "filesystem with the read-only (I<-o ro>) flag."
12451 #: ../src/guestfs-actions.pod:4528
12452 msgid "guestfs_mount_vfs"
12456 #: ../src/guestfs-actions.pod:4530
12460 " guestfs_mount_vfs (guestfs_h *g,\n"
12461 " const char *options,\n"
12462 " const char *vfstype,\n"
12463 " const char *device,\n"
12464 " const char *mountpoint);\n"
12469 #: ../src/guestfs-actions.pod:4537
12471 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12472 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
12477 #: ../src/guestfs-actions.pod:4545
12478 msgid "guestfs_mountpoints"
12482 #: ../src/guestfs-actions.pod:4547
12486 " guestfs_mountpoints (guestfs_h *g);\n"
12491 #: ../src/guestfs-actions.pod:4550
12493 "This call is similar to C<guestfs_mounts>. That call returns a list of "
12494 "devices. This one returns a hash table (map) of device name to directory "
12495 "where the device is mounted."
12499 #: ../src/guestfs-actions.pod:4562
12500 msgid "guestfs_mounts"
12504 #: ../src/guestfs-actions.pod:4564
12508 " guestfs_mounts (guestfs_h *g);\n"
12513 #: ../src/guestfs-actions.pod:4567 ../fish/guestfish-actions.pod:3044
12515 "This returns the list of currently mounted filesystems. It returns the list "
12516 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12520 #: ../src/guestfs-actions.pod:4570 ../fish/guestfish-actions.pod:3047
12521 msgid "Some internal mounts are not shown."
12525 #: ../src/guestfs-actions.pod:4572
12526 msgid "See also: C<guestfs_mountpoints>"
12530 #: ../src/guestfs-actions.pod:4580
12535 #: ../src/guestfs-actions.pod:4582
12539 " guestfs_mv (guestfs_h *g,\n"
12540 " const char *src,\n"
12541 " const char *dest);\n"
12546 #: ../src/guestfs-actions.pod:4587 ../fish/guestfish-actions.pod:3055
12548 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12549 "destination filename or destination directory."
12553 #: ../src/guestfs-actions.pod:4594
12554 msgid "guestfs_ntfs_3g_probe"
12558 #: ../src/guestfs-actions.pod:4596
12562 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
12564 " const char *device);\n"
12569 #: ../src/guestfs-actions.pod:4601 ../fish/guestfish-actions.pod:3062
12571 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12572 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12573 "read-write, and some cannot be mounted at all)."
12577 #: ../src/guestfs-actions.pod:4605 ../fish/guestfish-actions.pod:3066
12579 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12580 "can be mounted read-write. Set it to false if you want to test if the "
12581 "volume can be mounted read-only."
12585 #: ../src/guestfs-actions.pod:4609 ../fish/guestfish-actions.pod:3070
12587 "The return value is an integer which C<0> if the operation would succeed, or "
12588 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12592 #: ../src/guestfs-actions.pod:4615
12593 msgid "(Added in 1.0.43)"
12597 #: ../src/guestfs-actions.pod:4617
12598 msgid "guestfs_ntfsresize"
12602 #: ../src/guestfs-actions.pod:4619
12606 " guestfs_ntfsresize (guestfs_h *g,\n"
12607 " const char *device);\n"
12612 #: ../src/guestfs-actions.pod:4623 ../fish/guestfish-actions.pod:3078
12614 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12615 "size of the underlying device. See also L<ntfsresize(8)>."
12619 #: ../src/guestfs-actions.pod:4631
12620 msgid "guestfs_ntfsresize_size"
12624 #: ../src/guestfs-actions.pod:4633
12628 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12629 " const char *device,\n"
12630 " int64_t size);\n"
12635 #: ../src/guestfs-actions.pod:4638
12637 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12638 "to specify the new size (in bytes) explicitly."
12642 #: ../src/guestfs-actions.pod:4643 ../src/guestfs-actions.pod:5079 ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5401 ../src/guestfs-actions.pod:6940
12643 msgid "(Added in 1.3.14)"
12647 #: ../src/guestfs-actions.pod:4645
12648 msgid "guestfs_part_add"
12652 #: ../src/guestfs-actions.pod:4647
12656 " guestfs_part_add (guestfs_h *g,\n"
12657 " const char *device,\n"
12658 " const char *prlogex,\n"
12659 " int64_t startsect,\n"
12660 " int64_t endsect);\n"
12665 #: ../src/guestfs-actions.pod:4654
12667 "This command adds a partition to C<device>. If there is no partition table "
12668 "on the device, call C<guestfs_part_init> first."
12672 #: ../src/guestfs-actions.pod:4657 ../fish/guestfish-actions.pod:3096
12674 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12675 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12676 "C<logical>) and C<e> (or C<extended>) partition types."
12680 #: ../src/guestfs-actions.pod:4662 ../fish/guestfish-actions.pod:3101
12682 "C<startsect> and C<endsect> are the start and end of the partition in "
12683 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12684 "from the end of the disk (C<-1> is the last sector)."
12688 #: ../src/guestfs-actions.pod:4666
12690 "Creating a partition which covers the whole disk is not so easy. Use "
12691 "C<guestfs_part_disk> to do that."
12695 #: ../src/guestfs-actions.pod:4671 ../src/guestfs-actions.pod:4709 ../src/guestfs-actions.pod:4762 ../src/guestfs-actions.pod:4840 ../src/guestfs-actions.pod:4878 ../src/guestfs-actions.pod:4897 ../src/guestfs-actions.pod:4937
12696 msgid "(Added in 1.0.78)"
12700 #: ../src/guestfs-actions.pod:4673
12701 msgid "guestfs_part_del"
12705 #: ../src/guestfs-actions.pod:4675
12709 " guestfs_part_del (guestfs_h *g,\n"
12710 " const char *device,\n"
12716 #: ../src/guestfs-actions.pod:4680 ../fish/guestfish-actions.pod:3112
12717 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12721 #: ../src/guestfs-actions.pod:4682 ../fish/guestfish-actions.pod:3114
12723 "Note that in the case of MBR partitioning, deleting an extended partition "
12724 "also deletes any logical partitions it contains."
12728 #: ../src/guestfs-actions.pod:4690
12729 msgid "guestfs_part_disk"
12733 #: ../src/guestfs-actions.pod:4692
12737 " guestfs_part_disk (guestfs_h *g,\n"
12738 " const char *device,\n"
12739 " const char *parttype);\n"
12744 #: ../src/guestfs-actions.pod:4697
12746 "This command is simply a combination of C<guestfs_part_init> followed by "
12747 "C<guestfs_part_add> to create a single primary partition covering the whole "
12752 #: ../src/guestfs-actions.pod:4701
12754 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12755 "possible values are described in C<guestfs_part_init>."
12759 #: ../src/guestfs-actions.pod:4711
12760 msgid "guestfs_part_get_bootable"
12764 #: ../src/guestfs-actions.pod:4713
12768 " guestfs_part_get_bootable (guestfs_h *g,\n"
12769 " const char *device,\n"
12775 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3136
12777 "This command returns true if the partition C<partnum> on C<device> has the "
12778 "bootable flag set."
12782 #: ../src/guestfs-actions.pod:4721
12783 msgid "See also C<guestfs_part_set_bootable>."
12787 #: ../src/guestfs-actions.pod:4727
12788 msgid "guestfs_part_get_mbr_id"
12792 #: ../src/guestfs-actions.pod:4729
12796 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12797 " const char *device,\n"
12803 #: ../src/guestfs-actions.pod:4734 ../fish/guestfish-actions.pod:3145
12805 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12806 "partition C<partnum>."
12810 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4913
12812 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12813 "undefined results for other partition table types (see "
12814 "C<guestfs_part_get_parttype>)."
12818 #: ../src/guestfs-actions.pod:4745
12819 msgid "guestfs_part_get_parttype"
12823 #: ../src/guestfs-actions.pod:4747
12827 " guestfs_part_get_parttype (guestfs_h *g,\n"
12828 " const char *device);\n"
12833 #: ../src/guestfs-actions.pod:4751 ../fish/guestfish-actions.pod:3156
12835 "This command examines the partition table on C<device> and returns the "
12836 "partition table type (format) being used."
12840 #: ../src/guestfs-actions.pod:4754
12842 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12843 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12844 "possible, although unusual. See C<guestfs_part_init> for a full list."
12848 #: ../src/guestfs-actions.pod:4764
12849 msgid "guestfs_part_init"
12853 #: ../src/guestfs-actions.pod:4766
12857 " guestfs_part_init (guestfs_h *g,\n"
12858 " const char *device,\n"
12859 " const char *parttype);\n"
12864 #: ../src/guestfs-actions.pod:4771 ../fish/guestfish-actions.pod:3168
12866 "This creates an empty partition table on C<device> of one of the partition "
12867 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12868 "(for large disks)."
12872 #: ../src/guestfs-actions.pod:4775
12874 "Initially there are no partitions. Following this, you should call "
12875 "C<guestfs_part_add> for each partition required."
12879 #: ../src/guestfs-actions.pod:4778 ../fish/guestfish-actions.pod:3175
12880 msgid "Possible values for C<parttype> are:"
12884 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3179
12885 msgid "B<efi> | B<gpt>"
12889 #: ../src/guestfs-actions.pod:4784 ../fish/guestfish-actions.pod:3181
12890 msgid "Intel EFI / GPT partition table."
12894 #: ../src/guestfs-actions.pod:4786 ../fish/guestfish-actions.pod:3183
12896 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12897 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12898 "the C<mbr> format."
12902 #: ../src/guestfs-actions.pod:4790 ../fish/guestfish-actions.pod:3187
12903 msgid "B<mbr> | B<msdos>"
12907 #: ../src/guestfs-actions.pod:4792 ../fish/guestfish-actions.pod:3189
12909 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12910 "Windows. This partition type will B<only> work for device sizes up to 2 "
12911 "TB. For large disks we recommend using C<gpt>."
12915 #: ../src/guestfs-actions.pod:4799 ../fish/guestfish-actions.pod:3196
12916 msgid "Other partition table types that may work but are not supported include:"
12920 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3201
12925 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3203
12926 msgid "AIX disk labels."
12930 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3205
12931 msgid "B<amiga> | B<rdb>"
12935 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3207
12936 msgid "Amiga \"Rigid Disk Block\" format."
12940 #: ../src/guestfs-actions.pod:4812 ../fish/guestfish-actions.pod:3209
12945 #: ../src/guestfs-actions.pod:4814 ../fish/guestfish-actions.pod:3211
12946 msgid "BSD disk labels."
12950 #: ../src/guestfs-actions.pod:4816 ../fish/guestfish-actions.pod:3213
12955 #: ../src/guestfs-actions.pod:4818 ../fish/guestfish-actions.pod:3215
12956 msgid "DASD, used on IBM mainframes."
12960 #: ../src/guestfs-actions.pod:4820 ../fish/guestfish-actions.pod:3217
12965 #: ../src/guestfs-actions.pod:4822 ../fish/guestfish-actions.pod:3219
12966 msgid "MIPS/SGI volumes."
12970 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3221
12975 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3223
12976 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12980 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3225
12985 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3227
12986 msgid "NEC PC-98 format, common in Japan apparently."
12990 #: ../src/guestfs-actions.pod:4832 ../fish/guestfish-actions.pod:3229
12995 #: ../src/guestfs-actions.pod:4834 ../fish/guestfish-actions.pod:3231
12996 msgid "Sun disk labels."
13000 #: ../src/guestfs-actions.pod:4842
13001 msgid "guestfs_part_list"
13005 #: ../src/guestfs-actions.pod:4844
13008 " struct guestfs_partition_list *\n"
13009 " guestfs_part_list (guestfs_h *g,\n"
13010 " const char *device);\n"
13015 #: ../src/guestfs-actions.pod:4848 ../fish/guestfish-actions.pod:3239
13017 "This command parses the partition table on C<device> and returns the list of "
13018 "partitions found."
13022 #: ../src/guestfs-actions.pod:4851 ../fish/guestfish-actions.pod:3242
13023 msgid "The fields in the returned structure are:"
13027 #: ../src/guestfs-actions.pod:4855 ../fish/guestfish-actions.pod:3246
13028 msgid "B<part_num>"
13032 #: ../src/guestfs-actions.pod:4857 ../fish/guestfish-actions.pod:3248
13033 msgid "Partition number, counting from 1."
13037 #: ../src/guestfs-actions.pod:4859 ../fish/guestfish-actions.pod:3250
13038 msgid "B<part_start>"
13042 #: ../src/guestfs-actions.pod:4861
13044 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13045 "the device's sector size, see C<guestfs_blockdev_getss>."
13049 #: ../src/guestfs-actions.pod:4864 ../fish/guestfish-actions.pod:3255
13050 msgid "B<part_end>"
13054 #: ../src/guestfs-actions.pod:4866 ../fish/guestfish-actions.pod:3257
13055 msgid "End of the partition in bytes."
13059 #: ../src/guestfs-actions.pod:4868 ../fish/guestfish-actions.pod:3259
13060 msgid "B<part_size>"
13064 #: ../src/guestfs-actions.pod:4870 ../fish/guestfish-actions.pod:3261
13065 msgid "Size of the partition in bytes."
13069 #: ../src/guestfs-actions.pod:4874
13071 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
13072 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
13077 #: ../src/guestfs-actions.pod:4880
13078 msgid "guestfs_part_set_bootable"
13082 #: ../src/guestfs-actions.pod:4882
13086 " guestfs_part_set_bootable (guestfs_h *g,\n"
13087 " const char *device,\n"
13089 " int bootable);\n"
13094 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3269
13096 "This sets the bootable flag on partition numbered C<partnum> on device "
13097 "C<device>. Note that partitions are numbered from 1."
13101 #: ../src/guestfs-actions.pod:4891 ../fish/guestfish-actions.pod:3272
13103 "The bootable flag is used by some operating systems (notably Windows) to "
13104 "determine which partition to boot from. It is by no means universally "
13109 #: ../src/guestfs-actions.pod:4899
13110 msgid "guestfs_part_set_mbr_id"
13114 #: ../src/guestfs-actions.pod:4901
13118 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
13119 " const char *device,\n"
13126 #: ../src/guestfs-actions.pod:4907 ../fish/guestfish-actions.pod:3280
13128 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13129 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13130 "documentation are in fact hexadecimal numbers, but usually documented "
13131 "without any leading \"0x\" which might be confusing."
13135 #: ../src/guestfs-actions.pod:4921
13136 msgid "guestfs_part_set_name"
13140 #: ../src/guestfs-actions.pod:4923
13144 " guestfs_part_set_name (guestfs_h *g,\n"
13145 " const char *device,\n"
13147 " const char *name);\n"
13152 #: ../src/guestfs-actions.pod:4929 ../fish/guestfish-actions.pod:3294
13154 "This sets the partition name on partition numbered C<partnum> on device "
13155 "C<device>. Note that partitions are numbered from 1."
13159 #: ../src/guestfs-actions.pod:4932 ../fish/guestfish-actions.pod:3297
13161 "The partition name can only be set on certain types of partition table. "
13162 "This works on C<gpt> but not on C<mbr> partitions."
13166 #: ../src/guestfs-actions.pod:4939
13167 msgid "guestfs_part_to_dev"
13171 #: ../src/guestfs-actions.pod:4941
13175 " guestfs_part_to_dev (guestfs_h *g,\n"
13176 " const char *partition);\n"
13181 #: ../src/guestfs-actions.pod:4945 ../fish/guestfish-actions.pod:3304
13183 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13184 "partition number, returning the device name (eg. \"/dev/sdb\")."
13188 #: ../src/guestfs-actions.pod:4949
13190 "The named partition must exist, for example as a string returned from "
13191 "C<guestfs_list_partitions>."
13195 #: ../src/guestfs-actions.pod:4957
13196 msgid "guestfs_ping_daemon"
13200 #: ../src/guestfs-actions.pod:4959
13204 " guestfs_ping_daemon (guestfs_h *g);\n"
13209 #: ../src/guestfs-actions.pod:4962 ../fish/guestfish-actions.pod:3315
13211 "This is a test probe into the guestfs daemon running inside the qemu "
13212 "subprocess. Calling this function checks that the daemon responds to the "
13213 "ping message, without affecting the daemon or attached block device(s) in "
13218 #: ../src/guestfs-actions.pod:4971
13219 msgid "guestfs_pread"
13223 #: ../src/guestfs-actions.pod:4973
13227 " guestfs_pread (guestfs_h *g,\n"
13228 " const char *path,\n"
13230 " int64_t offset,\n"
13231 " size_t *size_r);\n"
13236 #: ../src/guestfs-actions.pod:4980 ../fish/guestfish-actions.pod:3324
13238 "This command lets you read part of a file. It reads C<count> bytes of the "
13239 "file, starting at C<offset>, from file C<path>."
13243 #: ../src/guestfs-actions.pod:4983 ../src/guestfs-actions.pod:5009 ../fish/guestfish-actions.pod:3327 ../fish/guestfish-actions.pod:3342
13245 "This may read fewer bytes than requested. For further details see the "
13246 "L<pread(2)> system call."
13250 #: ../src/guestfs-actions.pod:4986
13251 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
13255 #: ../src/guestfs-actions.pod:4997
13256 msgid "guestfs_pread_device"
13260 #: ../src/guestfs-actions.pod:4999
13264 " guestfs_pread_device (guestfs_h *g,\n"
13265 " const char *device,\n"
13267 " int64_t offset,\n"
13268 " size_t *size_r);\n"
13273 #: ../src/guestfs-actions.pod:5006 ../fish/guestfish-actions.pod:3339
13275 "This command lets you read part of a file. It reads C<count> bytes of "
13276 "C<device>, starting at C<offset>."
13280 #: ../src/guestfs-actions.pod:5012
13281 msgid "See also C<guestfs_pread>."
13285 #: ../src/guestfs-actions.pod:5021
13286 msgid "(Added in 1.5.21)"
13290 #: ../src/guestfs-actions.pod:5023
13291 msgid "guestfs_pvcreate"
13295 #: ../src/guestfs-actions.pod:5025
13299 " guestfs_pvcreate (guestfs_h *g,\n"
13300 " const char *device);\n"
13305 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3354
13307 "This creates an LVM physical volume on the named C<device>, where C<device> "
13308 "should usually be a partition name such as C</dev/sda1>."
13312 #: ../src/guestfs-actions.pod:5037
13313 msgid "guestfs_pvremove"
13317 #: ../src/guestfs-actions.pod:5039
13321 " guestfs_pvremove (guestfs_h *g,\n"
13322 " const char *device);\n"
13327 #: ../src/guestfs-actions.pod:5043 ../fish/guestfish-actions.pod:3362
13329 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13334 #: ../src/guestfs-actions.pod:5046 ../fish/guestfish-actions.pod:3365
13336 "The implementation uses the C<pvremove> command which refuses to wipe "
13337 "physical volumes that contain any volume groups, so you have to remove those "
13342 #: ../src/guestfs-actions.pod:5054
13343 msgid "guestfs_pvresize"
13347 #: ../src/guestfs-actions.pod:5056
13351 " guestfs_pvresize (guestfs_h *g,\n"
13352 " const char *device);\n"
13357 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3373
13359 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13360 "the new size of the underlying device."
13364 #: ../src/guestfs-actions.pod:5067
13365 msgid "guestfs_pvresize_size"
13369 #: ../src/guestfs-actions.pod:5069
13373 " guestfs_pvresize_size (guestfs_h *g,\n"
13374 " const char *device,\n"
13375 " int64_t size);\n"
13380 #: ../src/guestfs-actions.pod:5074
13382 "This command is the same as C<guestfs_pvresize> except that it allows you to "
13383 "specify the new size (in bytes) explicitly."
13387 #: ../src/guestfs-actions.pod:5081
13388 msgid "guestfs_pvs"
13392 #: ../src/guestfs-actions.pod:5083
13396 " guestfs_pvs (guestfs_h *g);\n"
13401 #: ../src/guestfs-actions.pod:5086 ../fish/guestfish-actions.pod:3387
13403 "List all the physical volumes detected. This is the equivalent of the "
13404 "L<pvs(8)> command."
13408 #: ../src/guestfs-actions.pod:5089 ../fish/guestfish-actions.pod:3390
13410 "This returns a list of just the device names that contain PVs "
13411 "(eg. C</dev/sda2>)."
13415 #: ../src/guestfs-actions.pod:5092
13416 msgid "See also C<guestfs_pvs_full>."
13420 #: ../src/guestfs-actions.pod:5100
13421 msgid "guestfs_pvs_full"
13425 #: ../src/guestfs-actions.pod:5102
13428 " struct guestfs_lvm_pv_list *\n"
13429 " guestfs_pvs_full (guestfs_h *g);\n"
13434 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3399
13436 "List all the physical volumes detected. This is the equivalent of the "
13437 "L<pvs(8)> command. The \"full\" version includes all fields."
13441 #: ../src/guestfs-actions.pod:5108
13443 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
13444 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
13449 #: ../src/guestfs-actions.pod:5114
13450 msgid "guestfs_pvuuid"
13454 #: ../src/guestfs-actions.pod:5116
13458 " guestfs_pvuuid (guestfs_h *g,\n"
13459 " const char *device);\n"
13464 #: ../src/guestfs-actions.pod:5120 ../fish/guestfish-actions.pod:3406
13465 msgid "This command returns the UUID of the LVM PV C<device>."
13469 #: ../src/guestfs-actions.pod:5127
13470 msgid "guestfs_pwrite"
13474 #: ../src/guestfs-actions.pod:5129
13478 " guestfs_pwrite (guestfs_h *g,\n"
13479 " const char *path,\n"
13480 " const char *content,\n"
13481 " size_t content_size,\n"
13482 " int64_t offset);\n"
13487 #: ../src/guestfs-actions.pod:5136 ../fish/guestfish-actions.pod:3412
13489 "This command writes to part of a file. It writes the data buffer C<content> "
13490 "to the file C<path> starting at offset C<offset>."
13494 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:3415
13496 "This command implements the L<pwrite(2)> system call, and like that system "
13497 "call it may not write the full data requested. The return value is the "
13498 "number of bytes that were actually written to the file. This could even be "
13499 "0, although short writes are unlikely for regular files in ordinary "
13504 #: ../src/guestfs-actions.pod:5145
13505 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
13509 #: ../src/guestfs-actions.pod:5154
13510 msgid "guestfs_pwrite_device"
13514 #: ../src/guestfs-actions.pod:5156
13518 " guestfs_pwrite_device (guestfs_h *g,\n"
13519 " const char *device,\n"
13520 " const char *content,\n"
13521 " size_t content_size,\n"
13522 " int64_t offset);\n"
13527 #: ../src/guestfs-actions.pod:5163 ../fish/guestfish-actions.pod:3430
13529 "This command writes to part of a device. It writes the data buffer "
13530 "C<content> to C<device> starting at offset C<offset>."
13534 #: ../src/guestfs-actions.pod:5166 ../fish/guestfish-actions.pod:3433
13536 "This command implements the L<pwrite(2)> system call, and like that system "
13537 "call it may not write the full data requested (although short writes to disk "
13538 "devices and partitions are probably impossible with standard Linux kernels)."
13542 #: ../src/guestfs-actions.pod:5171
13543 msgid "See also C<guestfs_pwrite>."
13547 #: ../src/guestfs-actions.pod:5178
13548 msgid "(Added in 1.5.20)"
13552 #: ../src/guestfs-actions.pod:5180
13553 msgid "guestfs_read_file"
13557 #: ../src/guestfs-actions.pod:5182
13561 " guestfs_read_file (guestfs_h *g,\n"
13562 " const char *path,\n"
13563 " size_t *size_r);\n"
13568 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:3447
13569 msgid "This calls returns the contents of the file C<path> as a buffer."
13573 #: ../src/guestfs-actions.pod:5190
13575 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
13576 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
13577 "function is limited in the total size of file that can be handled."
13581 #: ../src/guestfs-actions.pod:5202
13582 msgid "(Added in 1.0.63)"
13586 #: ../src/guestfs-actions.pod:5204
13587 msgid "guestfs_read_lines"
13591 #: ../src/guestfs-actions.pod:5206
13595 " guestfs_read_lines (guestfs_h *g,\n"
13596 " const char *path);\n"
13601 #: ../src/guestfs-actions.pod:5212 ../fish/guestfish-actions.pod:3464
13603 "The file contents are returned as a list of lines. Trailing C<LF> and "
13604 "C<CRLF> character sequences are I<not> returned."
13608 #: ../src/guestfs-actions.pod:5215
13610 "Note that this function cannot correctly handle binary files (specifically, "
13611 "files containing C<\\0> character which is treated as end of line). For "
13612 "those you need to use the C<guestfs_read_file> function which has a more "
13613 "complex interface."
13617 #: ../src/guestfs-actions.pod:5226
13618 msgid "guestfs_readdir"
13622 #: ../src/guestfs-actions.pod:5228
13625 " struct guestfs_dirent_list *\n"
13626 " guestfs_readdir (guestfs_h *g,\n"
13627 " const char *dir);\n"
13632 #: ../src/guestfs-actions.pod:5232 ../fish/guestfish-actions.pod:3476
13633 msgid "This returns the list of directory entries in directory C<dir>."
13637 #: ../src/guestfs-actions.pod:5234 ../fish/guestfish-actions.pod:3478
13639 "All entries in the directory are returned, including C<.> and C<..>. The "
13640 "entries are I<not> sorted, but returned in the same order as the underlying "
13645 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:3482
13647 "Also this call returns basic file type information about each file. The "
13648 "C<ftyp> field will contain one of the following characters:"
13652 #: ../src/guestfs-actions.pod:5243 ../fish/guestfish-actions.pod:3487
13657 #: ../src/guestfs-actions.pod:5245 ../fish/guestfish-actions.pod:3489
13658 msgid "Block special"
13662 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:3491
13667 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:3493
13668 msgid "Char special"
13672 #: ../src/guestfs-actions.pod:5251 ../fish/guestfish-actions.pod:3495
13677 #: ../src/guestfs-actions.pod:5253 ../fish/guestfish-actions.pod:3497
13682 #: ../src/guestfs-actions.pod:5255 ../fish/guestfish-actions.pod:3499
13687 #: ../src/guestfs-actions.pod:5257 ../fish/guestfish-actions.pod:3501
13688 msgid "FIFO (named pipe)"
13692 #: ../src/guestfs-actions.pod:5259 ../fish/guestfish-actions.pod:3503
13697 #: ../src/guestfs-actions.pod:5261 ../fish/guestfish-actions.pod:3505
13698 msgid "Symbolic link"
13702 #: ../src/guestfs-actions.pod:5263 ../fish/guestfish-actions.pod:3507
13707 #: ../src/guestfs-actions.pod:5265 ../fish/guestfish-actions.pod:3509
13708 msgid "Regular file"
13712 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3511
13717 #: ../src/guestfs-actions.pod:5269 ../fish/guestfish-actions.pod:3513
13722 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:3515
13727 #: ../src/guestfs-actions.pod:5273 ../fish/guestfish-actions.pod:3517
13728 msgid "Unknown file type"
13732 #: ../src/guestfs-actions.pod:5275 ../fish/guestfish-actions.pod:3519
13737 #: ../src/guestfs-actions.pod:5277 ../fish/guestfish-actions.pod:3521
13738 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13742 #: ../src/guestfs-actions.pod:5282
13744 "This function is primarily intended for use by programs. To get a simple "
13745 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13746 "consumption, use C<guestfs_ll>."
13750 #: ../src/guestfs-actions.pod:5286
13752 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13753 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
13758 #: ../src/guestfs-actions.pod:5292
13759 msgid "guestfs_readlink"
13763 #: ../src/guestfs-actions.pod:5294
13767 " guestfs_readlink (guestfs_h *g,\n"
13768 " const char *path);\n"
13773 #: ../src/guestfs-actions.pod:5298 ../fish/guestfish-actions.pod:3534
13774 msgid "This command reads the target of a symbolic link."
13778 #: ../src/guestfs-actions.pod:5305
13779 msgid "guestfs_readlinklist"
13783 #: ../src/guestfs-actions.pod:5307
13787 " guestfs_readlinklist (guestfs_h *g,\n"
13788 " const char *path,\n"
13789 " char *const *names);\n"
13794 #: ../src/guestfs-actions.pod:5312 ../fish/guestfish-actions.pod:3540
13796 "This call allows you to do a C<readlink> operation on multiple files, where "
13797 "all files are in the directory C<path>. C<names> is the list of files from "
13802 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3544
13804 "On return you get a list of strings, with a one-to-one correspondence to the "
13805 "C<names> list. Each string is the value of the symbolic link."
13809 #: ../src/guestfs-actions.pod:5320 ../fish/guestfish-actions.pod:3548
13811 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13812 "result string is the empty string C<\"\">. However the whole operation is "
13813 "completed even if there were C<readlink(2)> errors, and so you can call this "
13814 "function with names where you don't know if they are symbolic links already "
13815 "(albeit slightly less efficient)."
13819 #: ../src/guestfs-actions.pod:5327 ../fish/guestfish-actions.pod:3555
13821 "This call is intended for programs that want to efficiently list a directory "
13822 "contents without making many round-trips. Very long directory listings "
13823 "might cause the protocol message size to be exceeded, causing this call to "
13824 "fail. The caller must split up such requests into smaller groups of names."
13828 #: ../src/guestfs-actions.pod:5340
13829 msgid "guestfs_realpath"
13833 #: ../src/guestfs-actions.pod:5342
13837 " guestfs_realpath (guestfs_h *g,\n"
13838 " const char *path);\n"
13843 #: ../src/guestfs-actions.pod:5346 ../fish/guestfish-actions.pod:3566
13845 "Return the canonicalized absolute pathname of C<path>. The returned path "
13846 "has no C<.>, C<..> or symbolic link path elements."
13850 #: ../src/guestfs-actions.pod:5354
13851 msgid "guestfs_removexattr"
13855 #: ../src/guestfs-actions.pod:5356
13859 " guestfs_removexattr (guestfs_h *g,\n"
13860 " const char *xattr,\n"
13861 " const char *path);\n"
13866 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3573
13867 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13871 #: ../src/guestfs-actions.pod:5364
13872 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13876 #: ../src/guestfs-actions.pod:5370
13877 msgid "guestfs_resize2fs"
13881 #: ../src/guestfs-actions.pod:5372
13885 " guestfs_resize2fs (guestfs_h *g,\n"
13886 " const char *device);\n"
13891 #: ../src/guestfs-actions.pod:5376 ../fish/guestfish-actions.pod:3582
13893 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13894 "underlying device."
13898 #: ../src/guestfs-actions.pod:5379
13900 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13901 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13902 "sometimes gives an error about this and sometimes not. In any case, it is "
13903 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13907 #: ../src/guestfs-actions.pod:5389
13908 msgid "guestfs_resize2fs_size"
13912 #: ../src/guestfs-actions.pod:5391
13916 " guestfs_resize2fs_size (guestfs_h *g,\n"
13917 " const char *device,\n"
13918 " int64_t size);\n"
13923 #: ../src/guestfs-actions.pod:5396
13925 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13926 "to specify the new size (in bytes) explicitly."
13930 #: ../src/guestfs-actions.pod:5403
13935 #: ../src/guestfs-actions.pod:5405
13939 " guestfs_rm (guestfs_h *g,\n"
13940 " const char *path);\n"
13945 #: ../src/guestfs-actions.pod:5409 ../fish/guestfish-actions.pod:3602
13946 msgid "Remove the single file C<path>."
13950 #: ../src/guestfs-actions.pod:5415
13951 msgid "guestfs_rm_rf"
13955 #: ../src/guestfs-actions.pod:5417
13959 " guestfs_rm_rf (guestfs_h *g,\n"
13960 " const char *path);\n"
13965 #: ../src/guestfs-actions.pod:5421 ../fish/guestfish-actions.pod:3608
13967 "Remove the file or directory C<path>, recursively removing the contents if "
13968 "its a directory. This is like the C<rm -rf> shell command."
13972 #: ../src/guestfs-actions.pod:5429
13973 msgid "guestfs_rmdir"
13977 #: ../src/guestfs-actions.pod:5431
13981 " guestfs_rmdir (guestfs_h *g,\n"
13982 " const char *path);\n"
13987 #: ../src/guestfs-actions.pod:5435 ../fish/guestfish-actions.pod:3616
13988 msgid "Remove the single directory C<path>."
13992 #: ../src/guestfs-actions.pod:5441
13993 msgid "guestfs_rmmountpoint"
13997 #: ../src/guestfs-actions.pod:5443
14001 " guestfs_rmmountpoint (guestfs_h *g,\n"
14002 " const char *exemptpath);\n"
14007 #: ../src/guestfs-actions.pod:5447
14009 "This calls removes a mountpoint that was previously created with "
14010 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
14014 #: ../src/guestfs-actions.pod:5455
14015 msgid "guestfs_scrub_device"
14019 #: ../src/guestfs-actions.pod:5457
14023 " guestfs_scrub_device (guestfs_h *g,\n"
14024 " const char *device);\n"
14029 #: ../src/guestfs-actions.pod:5461 ../fish/guestfish-actions.pod:3630
14031 "This command writes patterns over C<device> to make data retrieval more "
14036 #: ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5485 ../src/guestfs-actions.pod:5504 ../fish/guestfish-actions.pod:3633 ../fish/guestfish-actions.pod:3648 ../fish/guestfish-actions.pod:3661
14038 "It is an interface to the L<scrub(1)> program. See that manual page for "
14043 #: ../src/guestfs-actions.pod:5472 ../src/guestfs-actions.pod:5490 ../src/guestfs-actions.pod:5509
14044 msgid "(Added in 1.0.52)"
14048 #: ../src/guestfs-actions.pod:5474
14049 msgid "guestfs_scrub_file"
14053 #: ../src/guestfs-actions.pod:5476
14057 " guestfs_scrub_file (guestfs_h *g,\n"
14058 " const char *file);\n"
14063 #: ../src/guestfs-actions.pod:5480 ../fish/guestfish-actions.pod:3643
14065 "This command writes patterns over a file to make data retrieval more "
14070 #: ../src/guestfs-actions.pod:5483 ../fish/guestfish-actions.pod:3646
14071 msgid "The file is I<removed> after scrubbing."
14075 #: ../src/guestfs-actions.pod:5492
14076 msgid "guestfs_scrub_freespace"
14080 #: ../src/guestfs-actions.pod:5494
14084 " guestfs_scrub_freespace (guestfs_h *g,\n"
14085 " const char *dir);\n"
14090 #: ../src/guestfs-actions.pod:5498
14092 "This command creates the directory C<dir> and then fills it with files until "
14093 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
14094 "and deletes them. The intention is to scrub any free space on the partition "
14095 "containing C<dir>."
14099 #: ../src/guestfs-actions.pod:5511
14100 msgid "guestfs_set_append"
14104 #: ../src/guestfs-actions.pod:5513
14108 " guestfs_set_append (guestfs_h *g,\n"
14109 " const char *append);\n"
14114 #: ../src/guestfs-actions.pod:5517 ../fish/guestfish-actions.pod:3670
14116 "This function is used to add additional options to the guest kernel command "
14121 #: ../src/guestfs-actions.pod:5520 ../fish/guestfish-actions.pod:3673
14123 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14124 "environment variable."
14128 #: ../src/guestfs-actions.pod:5523 ../fish/guestfish-actions.pod:3676
14130 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14131 "(libguestfs always adds a few of its own)."
14135 #: ../src/guestfs-actions.pod:5530
14136 msgid "guestfs_set_autosync"
14140 #: ../src/guestfs-actions.pod:5532
14144 " guestfs_set_autosync (guestfs_h *g,\n"
14145 " int autosync);\n"
14150 #: ../src/guestfs-actions.pod:5536
14152 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14153 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
14154 "the handle is closed (also if the program exits without closing handles)."
14158 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:3690
14160 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14161 "disabled by default)."
14165 #: ../src/guestfs-actions.pod:5548
14166 msgid "guestfs_set_direct"
14170 #: ../src/guestfs-actions.pod:5550
14174 " guestfs_set_direct (guestfs_h *g,\n"
14180 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:3699
14182 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14183 "passed directly through to the appliance once it is launched."
14187 #: ../src/guestfs-actions.pod:5558
14189 "One consequence of this is that log messages aren't caught by the library "
14190 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
14195 #: ../src/guestfs-actions.pod:5562 ../fish/guestfish-actions.pod:3707
14196 msgid "You probably don't want to use this unless you know what you are doing."
14200 #: ../src/guestfs-actions.pod:5565 ../fish/guestfish-actions.pod:3710
14201 msgid "The default is disabled."
14205 #: ../src/guestfs-actions.pod:5571
14206 msgid "guestfs_set_e2label"
14210 #: ../src/guestfs-actions.pod:5573
14214 " guestfs_set_e2label (guestfs_h *g,\n"
14215 " const char *device,\n"
14216 " const char *label);\n"
14221 #: ../src/guestfs-actions.pod:5578 ../fish/guestfish-actions.pod:3716
14223 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14224 "C<label>. Filesystem labels are limited to 16 characters."
14228 #: ../src/guestfs-actions.pod:5582
14230 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
14231 "the existing label on a filesystem."
14235 #: ../src/guestfs-actions.pod:5589
14236 msgid "guestfs_set_e2uuid"
14240 #: ../src/guestfs-actions.pod:5591
14244 " guestfs_set_e2uuid (guestfs_h *g,\n"
14245 " const char *device,\n"
14246 " const char *uuid);\n"
14251 #: ../src/guestfs-actions.pod:5596 ../fish/guestfish-actions.pod:3727
14253 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14254 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14255 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14259 #: ../src/guestfs-actions.pod:5601
14261 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
14262 "the existing UUID of a filesystem."
14266 #: ../src/guestfs-actions.pod:5608
14267 msgid "guestfs_set_memsize"
14271 #: ../src/guestfs-actions.pod:5610
14275 " guestfs_set_memsize (guestfs_h *g,\n"
14281 #: ../src/guestfs-actions.pod:5614
14283 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14284 "This only has any effect if called before C<guestfs_launch>."
14288 #: ../src/guestfs-actions.pod:5618 ../fish/guestfish-actions.pod:3745
14290 "You can also change this by setting the environment variable "
14291 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14295 #: ../src/guestfs-actions.pod:5629
14296 msgid "guestfs_set_network"
14300 #: ../src/guestfs-actions.pod:5631
14304 " guestfs_set_network (guestfs_h *g,\n"
14310 #: ../src/guestfs-actions.pod:5635 ../fish/guestfish-actions.pod:3758
14312 "If C<network> is true, then the network is enabled in the libguestfs "
14313 "appliance. The default is false."
14317 #: ../src/guestfs-actions.pod:5638 ../fish/guestfish-actions.pod:3761
14319 "This affects whether commands are able to access the network (see "
14320 "L<guestfs(3)/RUNNING COMMANDS>)."
14324 #: ../src/guestfs-actions.pod:5641
14326 "You must call this before calling C<guestfs_launch>, otherwise it has no "
14331 #: ../src/guestfs-actions.pod:5648
14332 msgid "guestfs_set_path"
14336 #: ../src/guestfs-actions.pod:5650
14340 " guestfs_set_path (guestfs_h *g,\n"
14341 " const char *searchpath);\n"
14346 #: ../src/guestfs-actions.pod:5654 ../fish/guestfish-actions.pod:3773
14347 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14351 #: ../src/guestfs-actions.pod:5656 ../fish/guestfish-actions.pod:3775
14353 "The default is C<$libdir/guestfs> unless overridden by setting "
14354 "C<LIBGUESTFS_PATH> environment variable."
14358 #: ../src/guestfs-actions.pod:5659 ../fish/guestfish-actions.pod:3778
14359 msgid "Setting C<path> to C<NULL> restores the default path."
14363 #: ../src/guestfs-actions.pod:5665
14364 msgid "guestfs_set_qemu"
14368 #: ../src/guestfs-actions.pod:5667
14372 " guestfs_set_qemu (guestfs_h *g,\n"
14373 " const char *qemu);\n"
14378 #: ../src/guestfs-actions.pod:5671 ../fish/guestfish-actions.pod:3786
14379 msgid "Set the qemu binary that we will use."
14383 #: ../src/guestfs-actions.pod:5673 ../fish/guestfish-actions.pod:3788
14384 msgid "The default is chosen when the library was compiled by the configure script."
14388 #: ../src/guestfs-actions.pod:5676 ../fish/guestfish-actions.pod:3791
14390 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14395 #: ../src/guestfs-actions.pod:5679 ../fish/guestfish-actions.pod:3794
14396 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14400 #: ../src/guestfs-actions.pod:5681 ../fish/guestfish-actions.pod:3796
14402 "Note that you should call this function as early as possible after creating "
14403 "the handle. This is because some pre-launch operations depend on testing "
14404 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14405 "don't retest features, and so you might see inconsistent results. Using the "
14406 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14407 "the qemu binary at the same time as the handle is created."
14411 #: ../src/guestfs-actions.pod:5693
14412 msgid "guestfs_set_recovery_proc"
14416 #: ../src/guestfs-actions.pod:5695
14420 " guestfs_set_recovery_proc (guestfs_h *g,\n"
14421 " int recoveryproc);\n"
14426 #: ../src/guestfs-actions.pod:5699
14428 "If this is called with the parameter C<false> then C<guestfs_launch> does "
14429 "not create a recovery process. The purpose of the recovery process is to "
14430 "stop runaway qemu processes in the case where the main program aborts "
14435 #: ../src/guestfs-actions.pod:5704
14437 "This only has any effect if called before C<guestfs_launch>, and the default "
14442 #: ../src/guestfs-actions.pod:5707 ../fish/guestfish-actions.pod:3818
14444 "About the only time when you would want to disable this is if the main "
14445 "process will fork itself into the background (\"daemonize\" itself). In "
14446 "this case the recovery process thinks that the main program has disappeared "
14447 "and so kills qemu, which is not very helpful."
14451 #: ../src/guestfs-actions.pod:5717
14452 msgid "guestfs_set_selinux"
14456 #: ../src/guestfs-actions.pod:5719
14460 " guestfs_set_selinux (guestfs_h *g,\n"
14466 #: ../src/guestfs-actions.pod:5723 ../fish/guestfish-actions.pod:3830
14468 "This sets the selinux flag that is passed to the appliance at boot time. "
14469 "The default is C<selinux=0> (disabled)."
14473 #: ../src/guestfs-actions.pod:5726 ../fish/guestfish-actions.pod:3833
14475 "Note that if SELinux is enabled, it is always in Permissive mode "
14476 "(C<enforcing=0>)."
14480 #: ../src/guestfs-actions.pod:5736
14481 msgid "guestfs_set_trace"
14485 #: ../src/guestfs-actions.pod:5738
14489 " guestfs_set_trace (guestfs_h *g,\n"
14495 #: ../src/guestfs-actions.pod:5742 ../fish/guestfish-actions.pod:3845
14497 "If the command trace flag is set to 1, then commands are printed on stderr "
14498 "before they are executed in a format which is very similar to the one used "
14499 "by guestfish. In other words, you can run a program with this enabled, and "
14500 "you will get out a script which you can feed to guestfish to perform the "
14501 "same set of actions."
14505 #: ../src/guestfs-actions.pod:5749 ../fish/guestfish-actions.pod:3852
14507 "If you want to trace C API calls into libguestfs (and other libraries) then "
14508 "possibly a better way is to use the external ltrace(1) command."
14512 #: ../src/guestfs-actions.pod:5753 ../fish/guestfish-actions.pod:3856
14514 "Command traces are disabled unless the environment variable "
14515 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14519 #: ../src/guestfs-actions.pod:5760
14520 msgid "guestfs_set_verbose"
14524 #: ../src/guestfs-actions.pod:5762
14528 " guestfs_set_verbose (guestfs_h *g,\n"
14534 #: ../src/guestfs-actions.pod:5766 ../fish/guestfish-actions.pod:3865
14535 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
14539 #: ../src/guestfs-actions.pod:5768 ../fish/guestfish-actions.pod:3867
14541 "Verbose messages are disabled unless the environment variable "
14542 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14546 #: ../src/guestfs-actions.pod:5775
14547 msgid "guestfs_setcon"
14551 #: ../src/guestfs-actions.pod:5777
14555 " guestfs_setcon (guestfs_h *g,\n"
14556 " const char *context);\n"
14561 #: ../src/guestfs-actions.pod:5781 ../fish/guestfish-actions.pod:3874
14563 "This sets the SELinux security context of the daemon to the string "
14568 #: ../src/guestfs-actions.pod:5784 ../fish/guestfish-actions.pod:3877
14569 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14573 #: ../src/guestfs-actions.pod:5790
14574 msgid "guestfs_setxattr"
14578 #: ../src/guestfs-actions.pod:5792
14582 " guestfs_setxattr (guestfs_h *g,\n"
14583 " const char *xattr,\n"
14584 " const char *val,\n"
14586 " const char *path);\n"
14591 #: ../src/guestfs-actions.pod:5799 ../fish/guestfish-actions.pod:3883
14593 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14594 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14598 #: ../src/guestfs-actions.pod:5803
14599 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14603 #: ../src/guestfs-actions.pod:5809
14604 msgid "guestfs_sfdisk"
14608 #: ../src/guestfs-actions.pod:5811
14612 " guestfs_sfdisk (guestfs_h *g,\n"
14613 " const char *device,\n"
14617 " char *const *lines);\n"
14622 #: ../src/guestfs-actions.pod:5819 ../fish/guestfish-actions.pod:3893
14624 "This is a direct interface to the L<sfdisk(8)> program for creating "
14625 "partitions on block devices."
14629 #: ../src/guestfs-actions.pod:5822 ../fish/guestfish-actions.pod:3896
14630 msgid "C<device> should be a block device, for example C</dev/sda>."
14634 #: ../src/guestfs-actions.pod:5824 ../fish/guestfish-actions.pod:3898
14636 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14637 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14638 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14639 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14640 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14641 "the kernel) cannot work out the right geometry and you will need to tell it."
14645 #: ../src/guestfs-actions.pod:5832 ../fish/guestfish-actions.pod:3906
14647 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14648 "refer to the L<sfdisk(8)> manpage."
14652 #: ../src/guestfs-actions.pod:5835 ../fish/guestfish-actions.pod:3909
14654 "To create a single partition occupying the whole disk, you would pass "
14655 "C<lines> as a single element list, when the single element being the string "
14660 #: ../src/guestfs-actions.pod:5839
14661 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14665 #: ../src/guestfs-actions.pod:5849
14666 msgid "guestfs_sfdiskM"
14670 #: ../src/guestfs-actions.pod:5851
14674 " guestfs_sfdiskM (guestfs_h *g,\n"
14675 " const char *device,\n"
14676 " char *const *lines);\n"
14681 #: ../src/guestfs-actions.pod:5856
14683 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14684 "partition sizes are specified in megabytes only (rounded to the nearest "
14685 "cylinder) and you don't need to specify the cyls, heads and sectors "
14686 "parameters which were rarely if ever used anyway."
14690 #: ../src/guestfs-actions.pod:5862
14692 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14693 "C<guestfs_part_disk>"
14697 #: ../src/guestfs-actions.pod:5872
14698 msgid "guestfs_sfdisk_N"
14702 #: ../src/guestfs-actions.pod:5874
14706 " guestfs_sfdisk_N (guestfs_h *g,\n"
14707 " const char *device,\n"
14712 " const char *line);\n"
14717 #: ../src/guestfs-actions.pod:5883 ../fish/guestfish-actions.pod:3939
14719 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14720 "(note: C<n> counts from 1)."
14724 #: ../src/guestfs-actions.pod:5886
14726 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14727 "for the cyls/heads/sectors parameters."
14731 #: ../src/guestfs-actions.pod:5889
14732 msgid "See also: C<guestfs_part_add>"
14736 #: ../src/guestfs-actions.pod:5898
14737 msgid "guestfs_sfdisk_disk_geometry"
14741 #: ../src/guestfs-actions.pod:5900
14745 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14746 " const char *device);\n"
14751 #: ../src/guestfs-actions.pod:5904
14753 "This displays the disk geometry of C<device> read from the partition table. "
14754 "Especially in the case where the underlying block device has been resized, "
14755 "this can be different from the kernel's idea of the geometry (see "
14756 "C<guestfs_sfdisk_kernel_geometry>)."
14760 #: ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:5925 ../fish/guestfish-actions.pod:3959 ../fish/guestfish-actions.pod:3968
14761 msgid "The result is in human-readable format, and not designed to be parsed."
14765 #: ../src/guestfs-actions.pod:5917
14766 msgid "guestfs_sfdisk_kernel_geometry"
14770 #: ../src/guestfs-actions.pod:5919
14774 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14775 " const char *device);\n"
14780 #: ../src/guestfs-actions.pod:5923 ../fish/guestfish-actions.pod:3966
14781 msgid "This displays the kernel's idea of the geometry of C<device>."
14785 #: ../src/guestfs-actions.pod:5933
14786 msgid "guestfs_sfdisk_l"
14790 #: ../src/guestfs-actions.pod:5935
14794 " guestfs_sfdisk_l (guestfs_h *g,\n"
14795 " const char *device);\n"
14800 #: ../src/guestfs-actions.pod:5939 ../fish/guestfish-actions.pod:3975
14802 "This displays the partition table on C<device>, in the human-readable output "
14803 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14807 #: ../src/guestfs-actions.pod:5943
14808 msgid "See also: C<guestfs_part_list>"
14812 #: ../src/guestfs-actions.pod:5950
14817 #: ../src/guestfs-actions.pod:5952
14821 " guestfs_sh (guestfs_h *g,\n"
14822 " const char *command);\n"
14827 #: ../src/guestfs-actions.pod:5956 ../fish/guestfish-actions.pod:3985
14829 "This call runs a command from the guest filesystem via the guest's "
14834 #: ../src/guestfs-actions.pod:5959
14835 msgid "This is like C<guestfs_command>, but passes the command to:"
14839 #: ../src/guestfs-actions.pod:5961 ../fish/guestfish-actions.pod:3990
14842 " /bin/sh -c \"command\"\n"
14847 #: ../src/guestfs-actions.pod:5963 ../fish/guestfish-actions.pod:3992
14849 "Depending on the guest's shell, this usually results in wildcards being "
14850 "expanded, shell expressions being interpolated and so on."
14854 #: ../src/guestfs-actions.pod:5967
14855 msgid "All the provisos about C<guestfs_command> apply to this call."
14859 #: ../src/guestfs-actions.pod:5974
14860 msgid "guestfs_sh_lines"
14864 #: ../src/guestfs-actions.pod:5976
14868 " guestfs_sh_lines (guestfs_h *g,\n"
14869 " const char *command);\n"
14874 #: ../src/guestfs-actions.pod:5980
14876 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14881 #: ../src/guestfs-actions.pod:5983
14882 msgid "See also: C<guestfs_command_lines>"
14886 #: ../src/guestfs-actions.pod:5991
14887 msgid "guestfs_sleep"
14891 #: ../src/guestfs-actions.pod:5993
14895 " guestfs_sleep (guestfs_h *g,\n"
14901 #: ../src/guestfs-actions.pod:5997 ../fish/guestfish-actions.pod:4011
14902 msgid "Sleep for C<secs> seconds."
14906 #: ../src/guestfs-actions.pod:6001
14907 msgid "(Added in 1.0.41)"
14911 #: ../src/guestfs-actions.pod:6003 ../src/guestfs-structs.pod:109
14912 msgid "guestfs_stat"
14916 #: ../src/guestfs-actions.pod:6005
14919 " struct guestfs_stat *\n"
14920 " guestfs_stat (guestfs_h *g,\n"
14921 " const char *path);\n"
14926 #: ../src/guestfs-actions.pod:6011 ../fish/guestfish-actions.pod:4019
14927 msgid "This is the same as the C<stat(2)> system call."
14931 #: ../src/guestfs-actions.pod:6019 ../src/guestfs-structs.pod:135
14932 msgid "guestfs_statvfs"
14936 #: ../src/guestfs-actions.pod:6021
14939 " struct guestfs_statvfs *\n"
14940 " guestfs_statvfs (guestfs_h *g,\n"
14941 " const char *path);\n"
14946 #: ../src/guestfs-actions.pod:6025 ../fish/guestfish-actions.pod:4025
14948 "Returns file system statistics for any mounted file system. C<path> should "
14949 "be a file or directory in the mounted file system (typically it is the mount "
14950 "point itself, but it doesn't need to be)."
14954 #: ../src/guestfs-actions.pod:6029 ../fish/guestfish-actions.pod:4029
14955 msgid "This is the same as the C<statvfs(2)> system call."
14959 #: ../src/guestfs-actions.pod:6031
14961 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14962 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14966 #: ../src/guestfs-actions.pod:6037
14967 msgid "guestfs_strings"
14971 #: ../src/guestfs-actions.pod:6039
14975 " guestfs_strings (guestfs_h *g,\n"
14976 " const char *path);\n"
14981 #: ../src/guestfs-actions.pod:6043 ../fish/guestfish-actions.pod:4035
14983 "This runs the L<strings(1)> command on a file and returns the list of "
14984 "printable strings found."
14988 #: ../src/guestfs-actions.pod:6055
14989 msgid "guestfs_strings_e"
14993 #: ../src/guestfs-actions.pod:6057
14997 " guestfs_strings_e (guestfs_h *g,\n"
14998 " const char *encoding,\n"
14999 " const char *path);\n"
15004 #: ../src/guestfs-actions.pod:6062
15006 "This is like the C<guestfs_strings> command, but allows you to specify the "
15007 "encoding of strings that are looked for in the source file C<path>."
15011 #: ../src/guestfs-actions.pod:6066 ../fish/guestfish-actions.pod:4049
15012 msgid "Allowed encodings are:"
15016 #: ../src/guestfs-actions.pod:6070 ../fish/guestfish-actions.pod:4053
15021 #: ../src/guestfs-actions.pod:6072
15023 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15024 "ISO-8859-X (this is what C<guestfs_strings> uses)."
15028 #: ../src/guestfs-actions.pod:6075 ../fish/guestfish-actions.pod:4058
15033 #: ../src/guestfs-actions.pod:6077 ../fish/guestfish-actions.pod:4060
15034 msgid "Single 8-bit-byte characters."
15038 #: ../src/guestfs-actions.pod:6079 ../fish/guestfish-actions.pod:4062
15043 #: ../src/guestfs-actions.pod:6081 ../fish/guestfish-actions.pod:4064
15044 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15048 #: ../src/guestfs-actions.pod:6084 ../fish/guestfish-actions.pod:4067
15049 msgid "l (lower case letter L)"
15053 #: ../src/guestfs-actions.pod:6086 ../fish/guestfish-actions.pod:4069
15055 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15056 "examining binaries in Windows guests."
15060 #: ../src/guestfs-actions.pod:6089 ../fish/guestfish-actions.pod:4072
15065 #: ../src/guestfs-actions.pod:6091 ../fish/guestfish-actions.pod:4074
15066 msgid "32-bit big endian such as UCS-4BE."
15070 #: ../src/guestfs-actions.pod:6093 ../fish/guestfish-actions.pod:4076
15075 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4078
15076 msgid "32-bit little endian such as UCS-4LE."
15080 #: ../src/guestfs-actions.pod:6099 ../fish/guestfish-actions.pod:4082
15081 msgid "The returned strings are transcoded to UTF-8."
15085 #: ../src/guestfs-actions.pod:6110
15086 msgid "guestfs_swapoff_device"
15090 #: ../src/guestfs-actions.pod:6112
15094 " guestfs_swapoff_device (guestfs_h *g,\n"
15095 " const char *device);\n"
15100 #: ../src/guestfs-actions.pod:6116
15102 "This command disables the libguestfs appliance swap device or partition "
15103 "named C<device>. See C<guestfs_swapon_device>."
15107 #: ../src/guestfs-actions.pod:6124
15108 msgid "guestfs_swapoff_file"
15112 #: ../src/guestfs-actions.pod:6126
15116 " guestfs_swapoff_file (guestfs_h *g,\n"
15117 " const char *file);\n"
15122 #: ../src/guestfs-actions.pod:6130 ../fish/guestfish-actions.pod:4099
15123 msgid "This command disables the libguestfs appliance swap on file."
15127 #: ../src/guestfs-actions.pod:6136
15128 msgid "guestfs_swapoff_label"
15132 #: ../src/guestfs-actions.pod:6138
15136 " guestfs_swapoff_label (guestfs_h *g,\n"
15137 " const char *label);\n"
15142 #: ../src/guestfs-actions.pod:6142 ../fish/guestfish-actions.pod:4105
15144 "This command disables the libguestfs appliance swap on labeled swap "
15149 #: ../src/guestfs-actions.pod:6149
15150 msgid "guestfs_swapoff_uuid"
15154 #: ../src/guestfs-actions.pod:6151
15158 " guestfs_swapoff_uuid (guestfs_h *g,\n"
15159 " const char *uuid);\n"
15164 #: ../src/guestfs-actions.pod:6155 ../fish/guestfish-actions.pod:4112
15166 "This command disables the libguestfs appliance swap partition with the given "
15171 #: ../src/guestfs-actions.pod:6162
15172 msgid "guestfs_swapon_device"
15176 #: ../src/guestfs-actions.pod:6164
15180 " guestfs_swapon_device (guestfs_h *g,\n"
15181 " const char *device);\n"
15186 #: ../src/guestfs-actions.pod:6168
15188 "This command enables the libguestfs appliance to use the swap device or "
15189 "partition named C<device>. The increased memory is made available for all "
15190 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
15194 #: ../src/guestfs-actions.pod:6173 ../fish/guestfish-actions.pod:4124
15196 "Note that you should not swap to existing guest swap partitions unless you "
15197 "know what you are doing. They may contain hibernation information, or other "
15198 "information that the guest doesn't want you to trash. You also risk leaking "
15199 "information about the host to the guest this way. Instead, attach a new "
15200 "host device to the guest and swap on that."
15204 #: ../src/guestfs-actions.pod:6184
15205 msgid "guestfs_swapon_file"
15209 #: ../src/guestfs-actions.pod:6186
15213 " guestfs_swapon_file (guestfs_h *g,\n"
15214 " const char *file);\n"
15219 #: ../src/guestfs-actions.pod:6190
15221 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
15226 #: ../src/guestfs-actions.pod:6197
15227 msgid "guestfs_swapon_label"
15231 #: ../src/guestfs-actions.pod:6199
15235 " guestfs_swapon_label (guestfs_h *g,\n"
15236 " const char *label);\n"
15241 #: ../src/guestfs-actions.pod:6203
15243 "This command enables swap to a labeled swap partition. See "
15244 "C<guestfs_swapon_device> for other notes."
15248 #: ../src/guestfs-actions.pod:6210
15249 msgid "guestfs_swapon_uuid"
15253 #: ../src/guestfs-actions.pod:6212
15257 " guestfs_swapon_uuid (guestfs_h *g,\n"
15258 " const char *uuid);\n"
15263 #: ../src/guestfs-actions.pod:6216
15265 "This command enables swap to a swap partition with the given UUID. See "
15266 "C<guestfs_swapon_device> for other notes."
15270 #: ../src/guestfs-actions.pod:6223
15271 msgid "guestfs_sync"
15275 #: ../src/guestfs-actions.pod:6225
15279 " guestfs_sync (guestfs_h *g);\n"
15284 #: ../src/guestfs-actions.pod:6228 ../fish/guestfish-actions.pod:4156
15286 "This syncs the disk, so that any writes are flushed through to the "
15287 "underlying disk image."
15291 #: ../src/guestfs-actions.pod:6231 ../fish/guestfish-actions.pod:4159
15293 "You should always call this if you have modified a disk image, before "
15294 "closing the handle."
15298 #: ../src/guestfs-actions.pod:6238
15299 msgid "guestfs_tail"
15303 #: ../src/guestfs-actions.pod:6240
15307 " guestfs_tail (guestfs_h *g,\n"
15308 " const char *path);\n"
15313 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4166
15314 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15318 #: ../src/guestfs-actions.pod:6256
15319 msgid "guestfs_tail_n"
15323 #: ../src/guestfs-actions.pod:6258
15327 " guestfs_tail_n (guestfs_h *g,\n"
15329 " const char *path);\n"
15334 #: ../src/guestfs-actions.pod:6263 ../fish/guestfish-actions.pod:4176
15336 "If the parameter C<nrlines> is a positive number, this returns the last "
15337 "C<nrlines> lines of the file C<path>."
15341 #: ../src/guestfs-actions.pod:6266 ../fish/guestfish-actions.pod:4179
15343 "If the parameter C<nrlines> is a negative number, this returns lines from "
15344 "the file C<path>, starting with the C<-nrlines>th line."
15348 #: ../src/guestfs-actions.pod:6280
15349 msgid "guestfs_tar_in"
15353 #: ../src/guestfs-actions.pod:6282
15357 " guestfs_tar_in (guestfs_h *g,\n"
15358 " const char *tarfile,\n"
15359 " const char *directory);\n"
15364 #: ../src/guestfs-actions.pod:6287 ../fish/guestfish-actions.pod:4191
15366 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15367 "tar file) into C<directory>."
15371 #: ../src/guestfs-actions.pod:6290
15372 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
15376 #: ../src/guestfs-actions.pod:6295 ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6328 ../src/guestfs-actions.pod:6344
15377 msgid "(Added in 1.0.3)"
15381 #: ../src/guestfs-actions.pod:6297
15382 msgid "guestfs_tar_out"
15386 #: ../src/guestfs-actions.pod:6299
15390 " guestfs_tar_out (guestfs_h *g,\n"
15391 " const char *directory,\n"
15392 " const char *tarfile);\n"
15397 #: ../src/guestfs-actions.pod:6304 ../fish/guestfish-actions.pod:4203
15399 "This command packs the contents of C<directory> and downloads it to local "
15404 #: ../src/guestfs-actions.pod:6307
15406 "To download a compressed tarball, use C<guestfs_tgz_out> or "
15407 "C<guestfs_txz_out>."
15411 #: ../src/guestfs-actions.pod:6314
15412 msgid "guestfs_tgz_in"
15416 #: ../src/guestfs-actions.pod:6316
15420 " guestfs_tgz_in (guestfs_h *g,\n"
15421 " const char *tarball,\n"
15422 " const char *directory);\n"
15427 #: ../src/guestfs-actions.pod:6321 ../fish/guestfish-actions.pod:4215
15429 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15430 "tar file) into C<directory>."
15434 #: ../src/guestfs-actions.pod:6324
15435 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
15439 #: ../src/guestfs-actions.pod:6330
15440 msgid "guestfs_tgz_out"
15444 #: ../src/guestfs-actions.pod:6332
15448 " guestfs_tgz_out (guestfs_h *g,\n"
15449 " const char *directory,\n"
15450 " const char *tarball);\n"
15455 #: ../src/guestfs-actions.pod:6337 ../fish/guestfish-actions.pod:4226
15457 "This command packs the contents of C<directory> and downloads it to local "
15462 #: ../src/guestfs-actions.pod:6340
15463 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
15467 #: ../src/guestfs-actions.pod:6346
15468 msgid "guestfs_touch"
15472 #: ../src/guestfs-actions.pod:6348
15476 " guestfs_touch (guestfs_h *g,\n"
15477 " const char *path);\n"
15482 #: ../src/guestfs-actions.pod:6352 ../fish/guestfish-actions.pod:4237
15484 "Touch acts like the L<touch(1)> command. It can be used to update the "
15485 "timestamps on a file, or, if the file does not exist, to create a new "
15486 "zero-length file."
15490 #: ../src/guestfs-actions.pod:6356 ../fish/guestfish-actions.pod:4241
15492 "This command only works on regular files, and will fail on other file types "
15493 "such as directories, symbolic links, block special etc."
15497 #: ../src/guestfs-actions.pod:6363
15498 msgid "guestfs_truncate"
15502 #: ../src/guestfs-actions.pod:6365
15506 " guestfs_truncate (guestfs_h *g,\n"
15507 " const char *path);\n"
15512 #: ../src/guestfs-actions.pod:6369 ../fish/guestfish-actions.pod:4248
15514 "This command truncates C<path> to a zero-length file. The file must exist "
15519 #: ../src/guestfs-actions.pod:6376
15520 msgid "guestfs_truncate_size"
15524 #: ../src/guestfs-actions.pod:6378
15528 " guestfs_truncate_size (guestfs_h *g,\n"
15529 " const char *path,\n"
15530 " int64_t size);\n"
15535 #: ../src/guestfs-actions.pod:6383 ../fish/guestfish-actions.pod:4255
15537 "This command truncates C<path> to size C<size> bytes. The file must exist "
15542 #: ../src/guestfs-actions.pod:6386
15544 "If the current file size is less than C<size> then the file is extended to "
15545 "the required size with zero bytes. This creates a sparse file (ie. disk "
15546 "blocks are not allocated for the file until you write to it). To create a "
15547 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
15551 #: ../src/guestfs-actions.pod:6396
15552 msgid "guestfs_tune2fs_l"
15556 #: ../src/guestfs-actions.pod:6398
15560 " guestfs_tune2fs_l (guestfs_h *g,\n"
15561 " const char *device);\n"
15566 #: ../src/guestfs-actions.pod:6402 ../fish/guestfish-actions.pod:4268
15568 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15573 #: ../src/guestfs-actions.pod:6405 ../fish/guestfish-actions.pod:4271
15575 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15576 "for more details. The list of fields returned isn't clearly defined, and "
15577 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15578 "and the filesystem itself."
15582 #: ../src/guestfs-actions.pod:6418
15583 msgid "guestfs_txz_in"
15587 #: ../src/guestfs-actions.pod:6420
15591 " guestfs_txz_in (guestfs_h *g,\n"
15592 " const char *tarball,\n"
15593 " const char *directory);\n"
15598 #: ../src/guestfs-actions.pod:6425 ../fish/guestfish-actions.pod:4280
15600 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15601 "tar file) into C<directory>."
15605 #: ../src/guestfs-actions.pod:6432
15606 msgid "guestfs_txz_out"
15610 #: ../src/guestfs-actions.pod:6434
15614 " guestfs_txz_out (guestfs_h *g,\n"
15615 " const char *directory,\n"
15616 " const char *tarball);\n"
15621 #: ../src/guestfs-actions.pod:6439 ../fish/guestfish-actions.pod:4289
15623 "This command packs the contents of C<directory> and downloads it to local "
15624 "file C<tarball> (as an xz compressed tar archive)."
15628 #: ../src/guestfs-actions.pod:6446
15629 msgid "guestfs_umask"
15633 #: ../src/guestfs-actions.pod:6448
15637 " guestfs_umask (guestfs_h *g,\n"
15643 #: ../src/guestfs-actions.pod:6452 ../fish/guestfish-actions.pod:4298
15645 "This function sets the mask used for creating new files and device nodes to "
15650 #: ../src/guestfs-actions.pod:6455 ../fish/guestfish-actions.pod:4301
15652 "Typical umask values would be C<022> which creates new files with "
15653 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15654 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15658 #: ../src/guestfs-actions.pod:6460 ../fish/guestfish-actions.pod:4306
15660 "The default umask is C<022>. This is important because it means that "
15661 "directories and device nodes will be created with C<0644> or C<0755> mode "
15662 "even if you specify C<0777>."
15666 #: ../src/guestfs-actions.pod:6464
15668 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15669 "C<guestfs_mkdir>."
15673 #: ../src/guestfs-actions.pod:6467 ../fish/guestfish-actions.pod:4313
15674 msgid "This call returns the previous umask."
15678 #: ../src/guestfs-actions.pod:6473
15679 msgid "guestfs_umount"
15683 #: ../src/guestfs-actions.pod:6475
15687 " guestfs_umount (guestfs_h *g,\n"
15688 " const char *pathordevice);\n"
15693 #: ../src/guestfs-actions.pod:6479 ../fish/guestfish-actions.pod:4321
15695 "This unmounts the given filesystem. The filesystem may be specified either "
15696 "by its mountpoint (path) or the device which contains the filesystem."
15700 #: ../src/guestfs-actions.pod:6487
15701 msgid "guestfs_umount_all"
15705 #: ../src/guestfs-actions.pod:6489
15709 " guestfs_umount_all (guestfs_h *g);\n"
15714 #: ../src/guestfs-actions.pod:6492 ../fish/guestfish-actions.pod:4331
15715 msgid "This unmounts all mounted filesystems."
15719 #: ../src/guestfs-actions.pod:6494 ../fish/guestfish-actions.pod:4333
15720 msgid "Some internal mounts are not unmounted by this call."
15724 #: ../src/guestfs-actions.pod:6500
15725 msgid "guestfs_upload"
15729 #: ../src/guestfs-actions.pod:6502
15733 " guestfs_upload (guestfs_h *g,\n"
15734 " const char *filename,\n"
15735 " const char *remotefilename);\n"
15740 #: ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6531 ../fish/guestfish-actions.pod:4339 ../fish/guestfish-actions.pod:4352
15741 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15745 #: ../src/guestfs-actions.pod:6512
15746 msgid "See also C<guestfs_download>."
15750 #: ../src/guestfs-actions.pod:6523
15751 msgid "guestfs_upload_offset"
15755 #: ../src/guestfs-actions.pod:6525
15759 " guestfs_upload_offset (guestfs_h *g,\n"
15760 " const char *filename,\n"
15761 " const char *remotefilename,\n"
15762 " int64_t offset);\n"
15767 #: ../src/guestfs-actions.pod:6534 ../fish/guestfish-actions.pod:4355
15769 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15770 "The intention is to overwrite parts of existing files or devices, although "
15771 "if a non-existant file is specified then it is created with a \"hole\" "
15772 "before C<offset>. The size of the data written is implicit in the size of "
15773 "the source C<filename>."
15777 #: ../src/guestfs-actions.pod:6541
15779 "Note that there is no limit on the amount of data that can be uploaded with "
15780 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15781 "full amount unless an error occurs."
15785 #: ../src/guestfs-actions.pod:6546
15786 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15790 #: ../src/guestfs-actions.pod:6557
15791 msgid "guestfs_utimens"
15795 #: ../src/guestfs-actions.pod:6559
15799 " guestfs_utimens (guestfs_h *g,\n"
15800 " const char *path,\n"
15801 " int64_t atsecs,\n"
15802 " int64_t atnsecs,\n"
15803 " int64_t mtsecs,\n"
15804 " int64_t mtnsecs);\n"
15809 #: ../src/guestfs-actions.pod:6567 ../fish/guestfish-actions.pod:4375
15810 msgid "This command sets the timestamps of a file with nanosecond precision."
15814 #: ../src/guestfs-actions.pod:6570 ../fish/guestfish-actions.pod:4378
15816 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15821 #: ../src/guestfs-actions.pod:6573 ../fish/guestfish-actions.pod:4381
15823 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15824 "nanoseconds from the epoch."
15828 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4384
15830 "If the C<*nsecs> field contains the special value C<-1> then the "
15831 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15832 "ignored in this case)."
15836 #: ../src/guestfs-actions.pod:6580 ../fish/guestfish-actions.pod:4388
15838 "If the C<*nsecs> field contains the special value C<-2> then the "
15839 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15844 #: ../src/guestfs-actions.pod:6588 ../src/guestfs-structs.pod:175
15845 msgid "guestfs_version"
15849 #: ../src/guestfs-actions.pod:6590
15852 " struct guestfs_version *\n"
15853 " guestfs_version (guestfs_h *g);\n"
15858 #: ../src/guestfs-actions.pod:6593 ../fish/guestfish-actions.pod:4396
15859 msgid "Return the libguestfs version number that the program is linked against."
15863 #: ../src/guestfs-actions.pod:6596 ../fish/guestfish-actions.pod:4399
15865 "Note that because of dynamic linking this is not necessarily the version of "
15866 "libguestfs that you compiled against. You can compile the program, and then "
15867 "at runtime dynamically link against a completely different C<libguestfs.so> "
15872 #: ../src/guestfs-actions.pod:6601 ../fish/guestfish-actions.pod:4404
15874 "This call was added in version C<1.0.58>. In previous versions of "
15875 "libguestfs there was no way to get the version number. From C code you can "
15876 "use dynamic linker functions to find out if this symbol exists (if it "
15877 "doesn't, then it's an earlier version)."
15881 #: ../src/guestfs-actions.pod:6607 ../fish/guestfish-actions.pod:4410
15883 "The call returns a structure with four elements. The first three (C<major>, "
15884 "C<minor> and C<release>) are numbers and correspond to the usual version "
15885 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15886 "but may be used for distro-specific information."
15890 #: ../src/guestfs-actions.pod:6613 ../fish/guestfish-actions.pod:4416
15891 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
15895 #: ../src/guestfs-actions.pod:6616 ../fish/guestfish-actions.pod:4419
15896 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15900 #: ../src/guestfs-actions.pod:6618
15902 "I<Note:> Don't use this call to test for availability of features. In "
15903 "enterprise distributions we backport features from later versions into "
15904 "earlier versions, making this an unreliable way to test for features. Use "
15905 "C<guestfs_available> instead."
15909 #: ../src/guestfs-actions.pod:6624
15911 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15912 "error. I<The caller must call C<guestfs_free_version> after use>."
15916 #: ../src/guestfs-actions.pod:6628
15917 msgid "(Added in 1.0.58)"
15921 #: ../src/guestfs-actions.pod:6630
15922 msgid "guestfs_vfs_label"
15926 #: ../src/guestfs-actions.pod:6632
15930 " guestfs_vfs_label (guestfs_h *g,\n"
15931 " const char *device);\n"
15936 #: ../src/guestfs-actions.pod:6636 ../fish/guestfish-actions.pod:4431
15937 msgid "This returns the filesystem label of the filesystem on C<device>."
15941 #: ../src/guestfs-actions.pod:6639 ../fish/guestfish-actions.pod:4434
15942 msgid "If the filesystem is unlabeled, this returns the empty string."
15946 #: ../src/guestfs-actions.pod:6641
15947 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15951 #: ../src/guestfs-actions.pod:6646 ../src/guestfs-actions.pod:6683
15952 msgid "(Added in 1.3.18)"
15956 #: ../src/guestfs-actions.pod:6648
15957 msgid "guestfs_vfs_type"
15961 #: ../src/guestfs-actions.pod:6650
15965 " guestfs_vfs_type (guestfs_h *g,\n"
15966 " const char *device);\n"
15971 #: ../src/guestfs-actions.pod:6654 ../fish/guestfish-actions.pod:4442
15973 "This command gets the filesystem type corresponding to the filesystem on "
15978 #: ../src/guestfs-actions.pod:6657 ../fish/guestfish-actions.pod:4445
15980 "For most filesystems, the result is the name of the Linux VFS module which "
15981 "would be used to mount this filesystem if you mounted it without specifying "
15982 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15986 #: ../src/guestfs-actions.pod:6667
15987 msgid "guestfs_vfs_uuid"
15991 #: ../src/guestfs-actions.pod:6669
15995 " guestfs_vfs_uuid (guestfs_h *g,\n"
15996 " const char *device);\n"
16001 #: ../src/guestfs-actions.pod:6673 ../fish/guestfish-actions.pod:4454
16002 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16006 #: ../src/guestfs-actions.pod:6676 ../fish/guestfish-actions.pod:4457
16007 msgid "If the filesystem does not have a UUID, this returns the empty string."
16011 #: ../src/guestfs-actions.pod:6678
16012 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
16016 #: ../src/guestfs-actions.pod:6685
16017 msgid "guestfs_vg_activate"
16021 #: ../src/guestfs-actions.pod:6687
16025 " guestfs_vg_activate (guestfs_h *g,\n"
16027 " char *const *volgroups);\n"
16032 #: ../src/guestfs-actions.pod:6692 ../fish/guestfish-actions.pod:4465
16034 "This command activates or (if C<activate> is false) deactivates all logical "
16035 "volumes in the listed volume groups C<volgroups>. If activated, then they "
16036 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
16037 "deactivated, then those devices disappear."
16041 #: ../src/guestfs-actions.pod:6698 ../fish/guestfish-actions.pod:4471
16042 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16046 #: ../src/guestfs-actions.pod:6700 ../fish/guestfish-actions.pod:4473
16048 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16049 "activated or deactivated."
16053 #: ../src/guestfs-actions.pod:6707
16054 msgid "guestfs_vg_activate_all"
16058 #: ../src/guestfs-actions.pod:6709
16062 " guestfs_vg_activate_all (guestfs_h *g,\n"
16063 " int activate);\n"
16068 #: ../src/guestfs-actions.pod:6713 ../fish/guestfish-actions.pod:4480
16070 "This command activates or (if C<activate> is false) deactivates all logical "
16071 "volumes in all volume groups. If activated, then they are made known to the "
16072 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
16073 "those devices disappear."
16077 #: ../src/guestfs-actions.pod:6719 ../fish/guestfish-actions.pod:4486
16078 msgid "This command is the same as running C<vgchange -a y|n>"
16082 #: ../src/guestfs-actions.pod:6725
16083 msgid "guestfs_vgcreate"
16087 #: ../src/guestfs-actions.pod:6727
16091 " guestfs_vgcreate (guestfs_h *g,\n"
16092 " const char *volgroup,\n"
16093 " char *const *physvols);\n"
16098 #: ../src/guestfs-actions.pod:6732 ../fish/guestfish-actions.pod:4492
16100 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16101 "of physical volumes C<physvols>."
16105 #: ../src/guestfs-actions.pod:6739
16106 msgid "guestfs_vglvuuids"
16110 #: ../src/guestfs-actions.pod:6741
16114 " guestfs_vglvuuids (guestfs_h *g,\n"
16115 " const char *vgname);\n"
16120 #: ../src/guestfs-actions.pod:6745 ../fish/guestfish-actions.pod:4499
16122 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16123 "volumes created in this volume group."
16127 #: ../src/guestfs-actions.pod:6748
16129 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
16130 "associate logical volumes and volume groups."
16134 #: ../src/guestfs-actions.pod:6751
16135 msgid "See also C<guestfs_vgpvuuids>."
16139 #: ../src/guestfs-actions.pod:6759
16140 msgid "guestfs_vgpvuuids"
16144 #: ../src/guestfs-actions.pod:6761
16148 " guestfs_vgpvuuids (guestfs_h *g,\n"
16149 " const char *vgname);\n"
16154 #: ../src/guestfs-actions.pod:6765 ../fish/guestfish-actions.pod:4511
16156 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16157 "volumes that this volume group resides on."
16161 #: ../src/guestfs-actions.pod:6768
16163 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
16164 "associate physical volumes and volume groups."
16168 #: ../src/guestfs-actions.pod:6771
16169 msgid "See also C<guestfs_vglvuuids>."
16173 #: ../src/guestfs-actions.pod:6779
16174 msgid "guestfs_vgremove"
16178 #: ../src/guestfs-actions.pod:6781
16182 " guestfs_vgremove (guestfs_h *g,\n"
16183 " const char *vgname);\n"
16188 #: ../src/guestfs-actions.pod:6785 ../fish/guestfish-actions.pod:4523
16189 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16193 #: ../src/guestfs-actions.pod:6787 ../fish/guestfish-actions.pod:4525
16194 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16198 #: ../src/guestfs-actions.pod:6794
16199 msgid "guestfs_vgrename"
16203 #: ../src/guestfs-actions.pod:6796
16207 " guestfs_vgrename (guestfs_h *g,\n"
16208 " const char *volgroup,\n"
16209 " const char *newvolgroup);\n"
16214 #: ../src/guestfs-actions.pod:6801 ../fish/guestfish-actions.pod:4532
16215 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16219 #: ../src/guestfs-actions.pod:6807
16220 msgid "guestfs_vgs"
16224 #: ../src/guestfs-actions.pod:6809
16228 " guestfs_vgs (guestfs_h *g);\n"
16233 #: ../src/guestfs-actions.pod:6812 ../fish/guestfish-actions.pod:4538
16235 "List all the volumes groups detected. This is the equivalent of the "
16236 "L<vgs(8)> command."
16240 #: ../src/guestfs-actions.pod:6815 ../fish/guestfish-actions.pod:4541
16242 "This returns a list of just the volume group names that were detected "
16243 "(eg. C<VolGroup00>)."
16247 #: ../src/guestfs-actions.pod:6818
16248 msgid "See also C<guestfs_vgs_full>."
16252 #: ../src/guestfs-actions.pod:6826
16253 msgid "guestfs_vgs_full"
16257 #: ../src/guestfs-actions.pod:6828
16260 " struct guestfs_lvm_vg_list *\n"
16261 " guestfs_vgs_full (guestfs_h *g);\n"
16266 #: ../src/guestfs-actions.pod:6831 ../fish/guestfish-actions.pod:4550
16268 "List all the volumes groups detected. This is the equivalent of the "
16269 "L<vgs(8)> command. The \"full\" version includes all fields."
16273 #: ../src/guestfs-actions.pod:6834
16275 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
16276 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
16281 #: ../src/guestfs-actions.pod:6840
16282 msgid "guestfs_vgscan"
16286 #: ../src/guestfs-actions.pod:6842
16290 " guestfs_vgscan (guestfs_h *g);\n"
16295 #: ../src/guestfs-actions.pod:6845 ../fish/guestfish-actions.pod:4557
16297 "This rescans all block devices and rebuilds the list of LVM physical "
16298 "volumes, volume groups and logical volumes."
16302 #: ../src/guestfs-actions.pod:6852
16303 msgid "guestfs_vguuid"
16307 #: ../src/guestfs-actions.pod:6854
16311 " guestfs_vguuid (guestfs_h *g,\n"
16312 " const char *vgname);\n"
16317 #: ../src/guestfs-actions.pod:6858 ../fish/guestfish-actions.pod:4564
16318 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16322 #: ../src/guestfs-actions.pod:6865
16323 msgid "guestfs_wait_ready"
16327 #: ../src/guestfs-actions.pod:6867
16331 " guestfs_wait_ready (guestfs_h *g);\n"
16336 #: ../src/guestfs-actions.pod:6870
16337 msgid "This function is a no op."
16341 #: ../src/guestfs-actions.pod:6872
16343 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
16344 "calling C<guestfs_launch> to wait for the launch to complete. However this "
16345 "is no longer necessary because C<guestfs_launch> now does the waiting."
16349 #: ../src/guestfs-actions.pod:6877
16351 "If you see any calls to this function in code then you can just remove them, "
16352 "unless you want to retain compatibility with older versions of the API."
16356 #: ../src/guestfs-actions.pod:6885
16357 msgid "guestfs_wc_c"
16361 #: ../src/guestfs-actions.pod:6887
16365 " guestfs_wc_c (guestfs_h *g,\n"
16366 " const char *path);\n"
16371 #: ../src/guestfs-actions.pod:6891 ../fish/guestfish-actions.pod:4570
16373 "This command counts the characters in a file, using the C<wc -c> external "
16378 #: ../src/guestfs-actions.pod:6898
16379 msgid "guestfs_wc_l"
16383 #: ../src/guestfs-actions.pod:6900
16387 " guestfs_wc_l (guestfs_h *g,\n"
16388 " const char *path);\n"
16393 #: ../src/guestfs-actions.pod:6904 ../fish/guestfish-actions.pod:4577
16395 "This command counts the lines in a file, using the C<wc -l> external "
16400 #: ../src/guestfs-actions.pod:6911
16401 msgid "guestfs_wc_w"
16405 #: ../src/guestfs-actions.pod:6913
16409 " guestfs_wc_w (guestfs_h *g,\n"
16410 " const char *path);\n"
16415 #: ../src/guestfs-actions.pod:6917 ../fish/guestfish-actions.pod:4584
16417 "This command counts the words in a file, using the C<wc -w> external "
16422 #: ../src/guestfs-actions.pod:6924
16423 msgid "guestfs_write"
16427 #: ../src/guestfs-actions.pod:6926
16431 " guestfs_write (guestfs_h *g,\n"
16432 " const char *path,\n"
16433 " const char *content,\n"
16434 " size_t content_size);\n"
16439 #: ../src/guestfs-actions.pod:6932 ../fish/guestfish-actions.pod:4591
16441 "This call creates a file called C<path>. The content of the file is the "
16442 "string C<content> (which can contain any 8 bit data)."
16446 #: ../src/guestfs-actions.pod:6942
16447 msgid "guestfs_write_file"
16451 #: ../src/guestfs-actions.pod:6944
16455 " guestfs_write_file (guestfs_h *g,\n"
16456 " const char *path,\n"
16457 " const char *content,\n"
16463 #: ../src/guestfs-actions.pod:6950 ../fish/guestfish-actions.pod:4601
16465 "This call creates a file called C<path>. The contents of the file is the "
16466 "string C<content> (which can contain any 8 bit data), with length C<size>."
16470 #: ../src/guestfs-actions.pod:6954 ../fish/guestfish-actions.pod:4605
16472 "As a special case, if C<size> is C<0> then the length is calculated using "
16473 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16477 #: ../src/guestfs-actions.pod:6958 ../fish/guestfish-actions.pod:4609
16479 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16480 "I<not> work, even if the length is specified."
16484 #: ../src/guestfs-actions.pod:6966 ../fish/guestfish-actions.pod:4615
16485 msgid "This function is deprecated. In new code, use the C<write> call instead."
16489 #: ../src/guestfs-actions.pod:6975
16490 msgid "guestfs_zegrep"
16494 #: ../src/guestfs-actions.pod:6977
16498 " guestfs_zegrep (guestfs_h *g,\n"
16499 " const char *regex,\n"
16500 " const char *path);\n"
16505 #: ../src/guestfs-actions.pod:6982 ../fish/guestfish-actions.pod:4626
16506 msgid "This calls the external C<zegrep> program and returns the matching lines."
16510 #: ../src/guestfs-actions.pod:6994
16511 msgid "guestfs_zegrepi"
16515 #: ../src/guestfs-actions.pod:6996
16519 " guestfs_zegrepi (guestfs_h *g,\n"
16520 " const char *regex,\n"
16521 " const char *path);\n"
16526 #: ../src/guestfs-actions.pod:7001 ../fish/guestfish-actions.pod:4636
16527 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16531 #: ../src/guestfs-actions.pod:7013
16532 msgid "guestfs_zero"
16536 #: ../src/guestfs-actions.pod:7015
16540 " guestfs_zero (guestfs_h *g,\n"
16541 " const char *device);\n"
16546 #: ../src/guestfs-actions.pod:7019 ../fish/guestfish-actions.pod:4646
16547 msgid "This command writes zeroes over the first few blocks of C<device>."
16551 #: ../src/guestfs-actions.pod:7021 ../fish/guestfish-actions.pod:4648
16553 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16554 "securely wipe the device). It should be sufficient to remove any partition "
16555 "tables, filesystem superblocks and so on."
16559 #: ../src/guestfs-actions.pod:7025
16560 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
16564 #: ../src/guestfs-actions.pod:7036
16565 msgid "guestfs_zero_device"
16569 #: ../src/guestfs-actions.pod:7038
16573 " guestfs_zero_device (guestfs_h *g,\n"
16574 " const char *device);\n"
16579 #: ../src/guestfs-actions.pod:7042
16581 "This command writes zeroes over the entire C<device>. Compare with "
16582 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16586 #: ../src/guestfs-actions.pod:7056
16587 msgid "(Added in 1.3.1)"
16591 #: ../src/guestfs-actions.pod:7058
16592 msgid "guestfs_zerofree"
16596 #: ../src/guestfs-actions.pod:7060
16600 " guestfs_zerofree (guestfs_h *g,\n"
16601 " const char *device);\n"
16606 #: ../src/guestfs-actions.pod:7064 ../fish/guestfish-actions.pod:4669
16608 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16609 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16610 "possible to compress the filesystem more effectively."
16614 #: ../src/guestfs-actions.pod:7069 ../fish/guestfish-actions.pod:4674
16615 msgid "You should B<not> run this program if the filesystem is mounted."
16619 #: ../src/guestfs-actions.pod:7072 ../fish/guestfish-actions.pod:4677
16621 "It is possible that using this program can damage the filesystem or data on "
16626 #: ../src/guestfs-actions.pod:7079
16627 msgid "guestfs_zfgrep"
16631 #: ../src/guestfs-actions.pod:7081
16635 " guestfs_zfgrep (guestfs_h *g,\n"
16636 " const char *pattern,\n"
16637 " const char *path);\n"
16642 #: ../src/guestfs-actions.pod:7086 ../fish/guestfish-actions.pod:4684
16643 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16647 #: ../src/guestfs-actions.pod:7098
16648 msgid "guestfs_zfgrepi"
16652 #: ../src/guestfs-actions.pod:7100
16656 " guestfs_zfgrepi (guestfs_h *g,\n"
16657 " const char *pattern,\n"
16658 " const char *path);\n"
16663 #: ../src/guestfs-actions.pod:7105 ../fish/guestfish-actions.pod:4694
16664 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16668 #: ../src/guestfs-actions.pod:7117
16669 msgid "guestfs_zfile"
16673 #: ../src/guestfs-actions.pod:7119
16677 " guestfs_zfile (guestfs_h *g,\n"
16678 " const char *meth,\n"
16679 " const char *path);\n"
16684 #: ../src/guestfs-actions.pod:7124 ../fish/guestfish-actions.pod:4704
16685 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16689 #: ../src/guestfs-actions.pod:7127 ../fish/guestfish-actions.pod:4707
16690 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16694 #: ../src/guestfs-actions.pod:7129
16696 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16701 #: ../src/guestfs-actions.pod:7135 ../fish/guestfish-actions.pod:4712
16702 msgid "This function is deprecated. In new code, use the C<file> call instead."
16706 #: ../src/guestfs-actions.pod:7144
16707 msgid "guestfs_zgrep"
16711 #: ../src/guestfs-actions.pod:7146
16715 " guestfs_zgrep (guestfs_h *g,\n"
16716 " const char *regex,\n"
16717 " const char *path);\n"
16722 #: ../src/guestfs-actions.pod:7151 ../fish/guestfish-actions.pod:4723
16723 msgid "This calls the external C<zgrep> program and returns the matching lines."
16727 #: ../src/guestfs-actions.pod:7163
16728 msgid "guestfs_zgrepi"
16732 #: ../src/guestfs-actions.pod:7165
16736 " guestfs_zgrepi (guestfs_h *g,\n"
16737 " const char *regex,\n"
16738 " const char *path);\n"
16743 #: ../src/guestfs-actions.pod:7170 ../fish/guestfish-actions.pod:4733
16744 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16748 #: ../src/guestfs-availability.pod:3
16753 #: ../src/guestfs-availability.pod:5
16755 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
16756 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
16757 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
16758 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
16759 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
16763 #: ../src/guestfs-availability.pod:21
16768 #: ../src/guestfs-availability.pod:23
16770 "The following functions: L</guestfs_inotify_add_watch> "
16771 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
16772 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16776 #: ../src/guestfs-availability.pod:31
16777 msgid "B<linuxfsuuid>"
16781 #: ../src/guestfs-availability.pod:33
16783 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
16784 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16788 #: ../src/guestfs-availability.pod:40
16789 msgid "B<linuxmodules>"
16793 #: ../src/guestfs-availability.pod:42
16794 msgid "The following functions: L</guestfs_modprobe>"
16798 #: ../src/guestfs-availability.pod:45
16799 msgid "B<linuxxattrs>"
16803 #: ../src/guestfs-availability.pod:47
16805 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
16806 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
16807 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
16808 "L</guestfs_setxattr>"
16812 #: ../src/guestfs-availability.pod:58
16817 #: ../src/guestfs-availability.pod:60
16819 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
16820 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
16821 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16825 #: ../src/guestfs-availability.pod:69
16830 #: ../src/guestfs-availability.pod:71
16832 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
16833 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
16834 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
16835 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
16836 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
16837 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
16838 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
16839 "L</guestfs_vgs_full>"
16843 #: ../src/guestfs-availability.pod:94
16848 #: ../src/guestfs-availability.pod:96
16850 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
16851 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
16855 #: ../src/guestfs-availability.pod:102
16860 #: ../src/guestfs-availability.pod:104
16861 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16865 #: ../src/guestfs-availability.pod:107
16866 msgid "B<ntfsprogs>"
16870 #: ../src/guestfs-availability.pod:109
16871 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16875 #: ../src/guestfs-availability.pod:113
16876 msgid "B<realpath>"
16880 #: ../src/guestfs-availability.pod:115
16881 msgid "The following functions: L</guestfs_realpath>"
16885 #: ../src/guestfs-availability.pod:118
16890 #: ../src/guestfs-availability.pod:120
16892 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
16893 "L</guestfs_scrub_freespace>"
16897 #: ../src/guestfs-availability.pod:125
16902 #: ../src/guestfs-availability.pod:127
16903 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16907 #: ../src/guestfs-availability.pod:131
16912 #: ../src/guestfs-availability.pod:133
16913 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16917 #: ../src/guestfs-availability.pod:137
16918 msgid "B<zerofree>"
16922 #: ../src/guestfs-availability.pod:139
16923 msgid "The following functions: L</guestfs_zerofree>"
16927 #: ../src/guestfs-structs.pod:1
16928 msgid "guestfs_int_bool"
16932 #: ../src/guestfs-structs.pod:3
16935 " struct guestfs_int_bool {\n"
16943 #: ../src/guestfs-structs.pod:8
16946 " struct guestfs_int_bool_list {\n"
16947 " uint32_t len; /* Number of elements in list. */\n"
16948 " struct guestfs_int_bool *val; /* Elements. */\n"
16954 #: ../src/guestfs-structs.pod:13
16957 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16958 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16963 #: ../src/guestfs-structs.pod:16
16964 msgid "guestfs_lvm_pv"
16968 #: ../src/guestfs-structs.pod:18
16971 " struct guestfs_lvm_pv {\n"
16972 " char *pv_name;\n"
16973 " /* The next field is NOT nul-terminated, be careful when printing it: "
16975 " char pv_uuid[32];\n"
16977 " uint64_t pv_size;\n"
16978 " uint64_t dev_size;\n"
16979 " uint64_t pv_free;\n"
16980 " uint64_t pv_used;\n"
16981 " char *pv_attr;\n"
16982 " int64_t pv_pe_count;\n"
16983 " int64_t pv_pe_alloc_count;\n"
16984 " char *pv_tags;\n"
16985 " uint64_t pe_start;\n"
16986 " int64_t pv_mda_count;\n"
16987 " uint64_t pv_mda_free;\n"
16993 #: ../src/guestfs-structs.pod:36
16996 " struct guestfs_lvm_pv_list {\n"
16997 " uint32_t len; /* Number of elements in list. */\n"
16998 " struct guestfs_lvm_pv *val; /* Elements. */\n"
17004 #: ../src/guestfs-structs.pod:41
17007 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
17008 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
17013 #: ../src/guestfs-structs.pod:44
17014 msgid "guestfs_lvm_vg"
17018 #: ../src/guestfs-structs.pod:46
17021 " struct guestfs_lvm_vg {\n"
17022 " char *vg_name;\n"
17023 " /* The next field is NOT nul-terminated, be careful when printing it: "
17025 " char vg_uuid[32];\n"
17027 " char *vg_attr;\n"
17028 " uint64_t vg_size;\n"
17029 " uint64_t vg_free;\n"
17030 " char *vg_sysid;\n"
17031 " uint64_t vg_extent_size;\n"
17032 " int64_t vg_extent_count;\n"
17033 " int64_t vg_free_count;\n"
17034 " int64_t max_lv;\n"
17035 " int64_t max_pv;\n"
17036 " int64_t pv_count;\n"
17037 " int64_t lv_count;\n"
17038 " int64_t snap_count;\n"
17039 " int64_t vg_seqno;\n"
17040 " char *vg_tags;\n"
17041 " int64_t vg_mda_count;\n"
17042 " uint64_t vg_mda_free;\n"
17048 #: ../src/guestfs-structs.pod:69
17051 " struct guestfs_lvm_vg_list {\n"
17052 " uint32_t len; /* Number of elements in list. */\n"
17053 " struct guestfs_lvm_vg *val; /* Elements. */\n"
17059 #: ../src/guestfs-structs.pod:74
17062 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
17063 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
17068 #: ../src/guestfs-structs.pod:77
17069 msgid "guestfs_lvm_lv"
17073 #: ../src/guestfs-structs.pod:79
17076 " struct guestfs_lvm_lv {\n"
17077 " char *lv_name;\n"
17078 " /* The next field is NOT nul-terminated, be careful when printing it: "
17080 " char lv_uuid[32];\n"
17081 " char *lv_attr;\n"
17082 " int64_t lv_major;\n"
17083 " int64_t lv_minor;\n"
17084 " int64_t lv_kernel_major;\n"
17085 " int64_t lv_kernel_minor;\n"
17086 " uint64_t lv_size;\n"
17087 " int64_t seg_count;\n"
17089 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
17090 " float snap_percent;\n"
17091 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
17092 " float copy_percent;\n"
17093 " char *move_pv;\n"
17094 " char *lv_tags;\n"
17095 " char *mirror_log;\n"
17096 " char *modules;\n"
17102 #: ../src/guestfs-structs.pod:101
17105 " struct guestfs_lvm_lv_list {\n"
17106 " uint32_t len; /* Number of elements in list. */\n"
17107 " struct guestfs_lvm_lv *val; /* Elements. */\n"
17113 #: ../src/guestfs-structs.pod:106
17116 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
17117 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
17122 #: ../src/guestfs-structs.pod:111
17125 " struct guestfs_stat {\n"
17129 " int64_t nlink;\n"
17134 " int64_t blksize;\n"
17135 " int64_t blocks;\n"
17136 " int64_t atime;\n"
17137 " int64_t mtime;\n"
17138 " int64_t ctime;\n"
17144 #: ../src/guestfs-structs.pod:127
17147 " struct guestfs_stat_list {\n"
17148 " uint32_t len; /* Number of elements in list. */\n"
17149 " struct guestfs_stat *val; /* Elements. */\n"
17155 #: ../src/guestfs-structs.pod:132
17158 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
17159 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
17164 #: ../src/guestfs-structs.pod:137
17167 " struct guestfs_statvfs {\n"
17168 " int64_t bsize;\n"
17169 " int64_t frsize;\n"
17170 " int64_t blocks;\n"
17171 " int64_t bfree;\n"
17172 " int64_t bavail;\n"
17173 " int64_t files;\n"
17174 " int64_t ffree;\n"
17175 " int64_t favail;\n"
17178 " int64_t namemax;\n"
17184 #: ../src/guestfs-structs.pod:151
17187 " struct guestfs_statvfs_list {\n"
17188 " uint32_t len; /* Number of elements in list. */\n"
17189 " struct guestfs_statvfs *val; /* Elements. */\n"
17195 #: ../src/guestfs-structs.pod:156
17198 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
17199 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
17204 #: ../src/guestfs-structs.pod:159
17205 msgid "guestfs_dirent"
17209 #: ../src/guestfs-structs.pod:161
17212 " struct guestfs_dirent {\n"
17221 #: ../src/guestfs-structs.pod:167
17224 " struct guestfs_dirent_list {\n"
17225 " uint32_t len; /* Number of elements in list. */\n"
17226 " struct guestfs_dirent *val; /* Elements. */\n"
17232 #: ../src/guestfs-structs.pod:172
17235 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
17236 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
17241 #: ../src/guestfs-structs.pod:177
17244 " struct guestfs_version {\n"
17245 " int64_t major;\n"
17246 " int64_t minor;\n"
17247 " int64_t release;\n"
17254 #: ../src/guestfs-structs.pod:184
17257 " struct guestfs_version_list {\n"
17258 " uint32_t len; /* Number of elements in list. */\n"
17259 " struct guestfs_version *val; /* Elements. */\n"
17265 #: ../src/guestfs-structs.pod:189
17268 " void guestfs_free_version (struct guestfs_free_version *);\n"
17269 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
17274 #: ../src/guestfs-structs.pod:192
17275 msgid "guestfs_xattr"
17279 #: ../src/guestfs-structs.pod:194
17282 " struct guestfs_xattr {\n"
17283 " char *attrname;\n"
17284 " /* The next two fields describe a byte array. */\n"
17285 " uint32_t attrval_len;\n"
17286 " char *attrval;\n"
17292 #: ../src/guestfs-structs.pod:201
17295 " struct guestfs_xattr_list {\n"
17296 " uint32_t len; /* Number of elements in list. */\n"
17297 " struct guestfs_xattr *val; /* Elements. */\n"
17303 #: ../src/guestfs-structs.pod:206
17306 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
17307 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
17312 #: ../src/guestfs-structs.pod:209
17313 msgid "guestfs_inotify_event"
17317 #: ../src/guestfs-structs.pod:211
17320 " struct guestfs_inotify_event {\n"
17321 " int64_t in_wd;\n"
17322 " uint32_t in_mask;\n"
17323 " uint32_t in_cookie;\n"
17324 " char *in_name;\n"
17330 #: ../src/guestfs-structs.pod:218
17333 " struct guestfs_inotify_event_list {\n"
17334 " uint32_t len; /* Number of elements in list. */\n"
17335 " struct guestfs_inotify_event *val; /* Elements. */\n"
17341 #: ../src/guestfs-structs.pod:223
17344 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
17345 " void guestfs_free_inotify_event_list (struct "
17346 "guestfs_free_inotify_event_list *);\n"
17351 #: ../src/guestfs-structs.pod:226
17352 msgid "guestfs_partition"
17356 #: ../src/guestfs-structs.pod:228
17359 " struct guestfs_partition {\n"
17360 " int32_t part_num;\n"
17361 " uint64_t part_start;\n"
17362 " uint64_t part_end;\n"
17363 " uint64_t part_size;\n"
17369 #: ../src/guestfs-structs.pod:235
17372 " struct guestfs_partition_list {\n"
17373 " uint32_t len; /* Number of elements in list. */\n"
17374 " struct guestfs_partition *val; /* Elements. */\n"
17380 #: ../src/guestfs-structs.pod:240
17383 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
17384 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
17389 #: ../src/guestfs-structs.pod:243
17390 msgid "guestfs_application"
17394 #: ../src/guestfs-structs.pod:245
17397 " struct guestfs_application {\n"
17398 " char *app_name;\n"
17399 " char *app_display_name;\n"
17400 " int32_t app_epoch;\n"
17401 " char *app_version;\n"
17402 " char *app_release;\n"
17403 " char *app_install_path;\n"
17404 " char *app_trans_path;\n"
17405 " char *app_publisher;\n"
17406 " char *app_url;\n"
17407 " char *app_source_package;\n"
17408 " char *app_summary;\n"
17409 " char *app_description;\n"
17415 #: ../src/guestfs-structs.pod:260
17418 " struct guestfs_application_list {\n"
17419 " uint32_t len; /* Number of elements in list. */\n"
17420 " struct guestfs_application *val; /* Elements. */\n"
17426 #: ../src/guestfs-structs.pod:265
17429 " void guestfs_free_application (struct guestfs_free_application *);\n"
17430 " void guestfs_free_application_list (struct guestfs_free_application_list "
17436 #: ../fish/guestfish.pod:5
17437 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17441 #: ../fish/guestfish.pod:9
17444 " guestfish [--options] [commands]\n"
17449 #: ../fish/guestfish.pod:11
17457 #: ../fish/guestfish.pod:13
17460 " guestfish [--ro|--rw] -a disk.img\n"
17465 #: ../fish/guestfish.pod:15
17468 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17473 #: ../fish/guestfish.pod:17
17476 " guestfish -d libvirt-domain\n"
17481 #: ../fish/guestfish.pod:19
17484 " guestfish [--ro|--rw] -a disk.img -i\n"
17489 #: ../fish/guestfish.pod:21
17492 " guestfish -d libvirt-domain -i\n"
17497 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
17502 #: ../fish/guestfish.pod:25
17504 "Using guestfish in read/write mode on live virtual machines can be "
17505 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17506 "option to use guestfish safely if the disk image or virtual machine might be "
17511 #: ../fish/guestfish.pod:32
17513 "Guestfish is a shell and command-line tool for examining and modifying "
17514 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17515 "functionality of the guestfs API, see L<guestfs(3)>."
17519 #: ../fish/guestfish.pod:36
17521 "Guestfish gives you structured access to the libguestfs API, from shell "
17522 "scripts or the command line or interactively. If you want to rescue a "
17523 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17528 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:897 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58 ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:50
17533 #: ../fish/guestfish.pod:43
17534 msgid "As an interactive shell"
17538 #: ../fish/guestfish.pod:45
17546 #: ../fish/guestfish.pod:47
17549 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17550 " editing virtual machine filesystems.\n"
17555 #: ../fish/guestfish.pod:50
17558 " Type: 'help' for a list of commands\n"
17559 " 'man' to read the manual\n"
17560 " 'quit' to quit the shell\n"
17565 #: ../fish/guestfish.pod:54
17568 " ><fs> add-ro disk.img\n"
17570 " ><fs> list-filesystems\n"
17571 " /dev/sda1: ext4\n"
17572 " /dev/vg_guest/lv_root: ext4\n"
17573 " /dev/vg_guest/lv_swap: swap\n"
17574 " ><fs> mount /dev/vg_guest/lv_root /\n"
17575 " ><fs> cat /etc/fstab\n"
17577 " # Created by anaconda\n"
17584 #: ../fish/guestfish.pod:67
17585 msgid "From shell scripts"
17589 #: ../fish/guestfish.pod:69
17590 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17594 #: ../fish/guestfish.pod:71
17597 " guestfish <<_EOF_\n"
17600 " mount /dev/vg_guest/lv_root /\n"
17601 " write /etc/motd \"Welcome, new users\"\n"
17607 #: ../fish/guestfish.pod:78
17608 msgid "List the LVM logical volumes in a disk image:"
17612 #: ../fish/guestfish.pod:80
17615 " guestfish -a disk.img --ro <<_EOF_\n"
17623 #: ../fish/guestfish.pod:85
17624 msgid "List all the filesystems in a disk image:"
17628 #: ../fish/guestfish.pod:87
17631 " guestfish -a disk.img --ro <<_EOF_\n"
17633 " list-filesystems\n"
17639 #: ../fish/guestfish.pod:92
17640 msgid "On one command line"
17644 #: ../fish/guestfish.pod:94
17645 msgid "Update C</etc/resolv.conf> in a guest:"
17649 #: ../fish/guestfish.pod:96
17653 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17654 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17659 #: ../fish/guestfish.pod:100
17660 msgid "Edit C</boot/grub/grub.conf> interactively:"
17664 #: ../fish/guestfish.pod:102
17667 " guestfish --rw --add disk.img \\\n"
17668 " --mount /dev/vg_guest/lv_root \\\n"
17669 " --mount /dev/sda1:/boot \\\n"
17670 " edit /boot/grub/grub.conf\n"
17675 #: ../fish/guestfish.pod:107
17676 msgid "Mount disks automatically"
17680 #: ../fish/guestfish.pod:109
17682 "Use the I<-i> option to automatically mount the disks from a virtual "
17687 #: ../fish/guestfish.pod:112
17690 " guestfish --ro -a disk.img -i cat /etc/group\n"
17695 #: ../fish/guestfish.pod:114
17698 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17703 #: ../fish/guestfish.pod:116
17704 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17708 #: ../fish/guestfish.pod:118
17711 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17716 #: ../fish/guestfish.pod:120
17717 msgid "As a script interpreter"
17721 #: ../fish/guestfish.pod:122
17722 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17726 #: ../fish/guestfish.pod:124
17729 " #!/usr/bin/guestfish -f\n"
17730 " sparse test1.img 100M\n"
17732 " part-disk /dev/sda mbr\n"
17733 " mkfs ext2 /dev/sda1\n"
17738 #: ../fish/guestfish.pod:130
17739 msgid "Start with a prepared disk"
17743 #: ../fish/guestfish.pod:132
17745 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17746 "single ext2-formatted partition:"
17750 #: ../fish/guestfish.pod:135
17753 " guestfish -N fs\n"
17758 #: ../fish/guestfish.pod:137
17759 msgid "To list what is available do:"
17763 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:888
17766 " guestfish -N help | less\n"
17771 #: ../fish/guestfish.pod:141
17772 msgid "Remote control"
17776 #: ../fish/guestfish.pod:143
17779 " eval \"`guestfish --listen`\"\n"
17780 " guestfish --remote add-ro disk.img\n"
17781 " guestfish --remote run\n"
17782 " guestfish --remote lvs\n"
17787 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72 ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254 ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
17792 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131 ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104 ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61 ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:62
17797 #: ../fish/guestfish.pod:154
17798 msgid "Displays general help on options."
17802 #: ../fish/guestfish.pod:156
17807 #: ../fish/guestfish.pod:158
17808 msgid "B<--cmd-help>"
17812 #: ../fish/guestfish.pod:160
17813 msgid "Lists all available guestfish commands."
17817 #: ../fish/guestfish.pod:162
17822 #: ../fish/guestfish.pod:164
17823 msgid "B<--cmd-help cmd>"
17827 #: ../fish/guestfish.pod:166
17828 msgid "Displays detailed help on a single command C<cmd>."
17832 #: ../fish/guestfish.pod:168
17833 msgid "B<-a image>"
17837 #: ../fish/guestfish.pod:170
17838 msgid "B<--add image>"
17842 #: ../fish/guestfish.pod:172
17843 msgid "Add a block device or virtual machine image to the shell."
17847 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
17849 "The format of the disk image is auto-detected. To override this and force a "
17850 "particular format use the I<--format=..> option."
17854 #: ../fish/guestfish.pod:177
17856 "Using this flag is mostly equivalent to using the C<add> command, with "
17857 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17858 "the I<--format:...> flag was given."
17862 #: ../fish/guestfish.pod:181
17867 #: ../fish/guestfish.pod:183
17868 msgid "B<--connect URI>"
17872 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
17874 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17875 "URI to use. The default is to use the default libvirt connection."
17879 #: ../fish/guestfish.pod:189
17884 #: ../fish/guestfish.pod:191
17886 "If using the I<--listen> option and a csh-like shell, use this option. See "
17887 "section L</REMOTE CONTROL AND CSH> below."
17891 #: ../fish/guestfish.pod:194
17892 msgid "B<-d libvirt-domain>"
17896 #: ../fish/guestfish.pod:196
17897 msgid "B<--domain libvirt-domain>"
17901 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
17903 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17904 "used, then any libvirt domain can be used. However in write mode, only "
17905 "libvirt domains which are shut down can be named here."
17909 #: ../fish/guestfish.pod:202
17911 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17912 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17913 "if the I<--format:...> flag was given."
17917 #: ../fish/guestfish.pod:206
17922 #: ../fish/guestfish.pod:208
17923 msgid "B<--no-dest-paths>"
17927 #: ../fish/guestfish.pod:210
17929 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17930 "to hit the tab key to complete paths on the guest filesystem, but this "
17931 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17932 "allow this feature to be disabled."
17936 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
17937 msgid "B<--echo-keys>"
17941 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
17943 "When prompting for keys and passphrases, guestfish normally turns echoing "
17944 "off so you cannot see what you are typing. If you are not worried about "
17945 "Tempest attacks and there is no one else in the room you can specify this "
17946 "flag to see what you are typing."
17950 #: ../fish/guestfish.pod:222
17955 #: ../fish/guestfish.pod:224
17956 msgid "B<--file file>"
17960 #: ../fish/guestfish.pod:226
17961 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17965 #: ../fish/guestfish.pod:229
17968 " #!/usr/bin/guestfish -f\n"
17973 #: ../fish/guestfish.pod:231
17974 msgid "B<--format=raw|qcow2|..>"
17978 #: ../fish/guestfish.pod:233
17979 msgid "B<--format>"
17983 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
17985 "The default for the I<-a> option is to auto-detect the format of the disk "
17986 "image. Using this forces the disk format for I<-a> options which follow on "
17987 "the command line. Using I<--format> with no argument switches back to "
17988 "auto-detection for subsequent I<-a> options."
17992 #: ../fish/guestfish.pod:242
17995 " guestfish --format=raw -a disk.img\n"
18000 #: ../fish/guestfish.pod:244
18001 msgid "forces raw format (no auto-detection) for C<disk.img>."
18005 #: ../fish/guestfish.pod:246
18008 " guestfish --format=raw -a disk.img --format -a another.img\n"
18013 #: ../fish/guestfish.pod:248
18015 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
18016 "auto-detection for C<another.img>."
18020 #: ../fish/guestfish.pod:251
18022 "If you have untrusted raw-format guest disk images, you should use this "
18023 "option to specify the disk format. This avoids a possible security problem "
18024 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
18028 #: ../fish/guestfish.pod:256
18033 #: ../fish/guestfish.pod:258
18034 msgid "B<--inspector>"
18038 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
18040 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
18041 "system and mount filesystems as they would be mounted on the real virtual "
18046 #: ../fish/guestfish.pod:264
18047 msgid "Typical usage is either:"
18051 #: ../fish/guestfish.pod:266
18054 " guestfish -d myguest -i\n"
18059 #: ../fish/guestfish.pod:268
18060 msgid "(for an inactive libvirt domain called I<myguest>), or:"
18064 #: ../fish/guestfish.pod:270
18067 " guestfish --ro -d myguest -i\n"
18072 #: ../fish/guestfish.pod:272
18073 msgid "(for active domains, readonly), or specify the block device directly:"
18077 #: ../fish/guestfish.pod:274
18080 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
18085 #: ../fish/guestfish.pod:276
18087 "Note that the command line syntax changed slightly over older versions of "
18088 "guestfish. You can still use the old syntax:"
18092 #: ../fish/guestfish.pod:279
18095 " guestfish [--ro] -i disk.img\n"
18100 #: ../fish/guestfish.pod:281
18103 " guestfish [--ro] -i libvirt-domain\n"
18108 #: ../fish/guestfish.pod:283
18110 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
18111 "then using other commands to mount the filesystems that were found."
18115 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
18116 msgid "B<--keys-from-stdin>"
18120 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
18122 "Read key or passphrase parameters from stdin. The default is to try to read "
18123 "passphrases from the user by opening C</dev/tty>."
18127 #: ../fish/guestfish.pod:292
18128 msgid "B<--listen>"
18132 #: ../fish/guestfish.pod:294
18134 "Fork into the background and listen for remote commands. See section "
18135 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18139 #: ../fish/guestfish.pod:297
18140 msgid "B<-m dev[:mountpoint]>"
18144 #: ../fish/guestfish.pod:299
18145 msgid "B<--mount dev[:mountpoint]>"
18149 #: ../fish/guestfish.pod:301
18150 msgid "Mount the named partition or logical volume on the given mountpoint."
18154 #: ../fish/guestfish.pod:303
18155 msgid "If the mountpoint is omitted, it defaults to C</>."
18159 #: ../fish/guestfish.pod:305
18160 msgid "You have to mount something on C</> before most commands will work."
18164 #: ../fish/guestfish.pod:307
18166 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18171 #: ../fish/guestfish.pod:310
18173 "If you don't know what filesystems a disk image contains, you can either run "
18174 "guestfish without this option, then list the partitions, filesystems and LVs "
18175 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18176 "commands), or you can use the L<virt-filesystems(1)> program."
18180 #: ../fish/guestfish.pod:316
18182 "Using this flag is mostly equivalent to using the C<mount-options> command "
18183 "or the C<mount-ro> command if the I<--ro> flag was given."
18187 #: ../fish/guestfish.pod:319
18192 #: ../fish/guestfish.pod:321
18193 msgid "B<--no-sync>"
18197 #: ../fish/guestfish.pod:323
18199 "Disable autosync. This is enabled by default. See the discussion of "
18200 "autosync in the L<guestfs(3)> manpage."
18204 #: ../fish/guestfish.pod:326
18209 #: ../fish/guestfish.pod:328
18210 msgid "B<--new type>"
18214 #: ../fish/guestfish.pod:330
18219 #: ../fish/guestfish.pod:332
18221 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18222 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18223 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18228 #: ../fish/guestfish.pod:337
18229 msgid "B<--progress-bars>"
18233 #: ../fish/guestfish.pod:339
18234 msgid "Enable progress bars, even when guestfish is used non-interactively."
18238 #: ../fish/guestfish.pod:341
18240 "Progress bars are enabled by default when guestfish is used as an "
18241 "interactive shell."
18245 #: ../fish/guestfish.pod:344
18246 msgid "B<--no-progress-bars>"
18250 #: ../fish/guestfish.pod:346
18251 msgid "Disable progress bars."
18255 #: ../fish/guestfish.pod:348
18256 msgid "B<--remote[=pid]>"
18260 #: ../fish/guestfish.pod:350
18262 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18263 "CONTROL GUESTFISH OVER A SOCKET> below."
18267 #: ../fish/guestfish.pod:353
18272 #: ../fish/guestfish.pod:355
18277 #: ../fish/guestfish.pod:357
18279 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18280 "mounts are done read-only."
18284 #: ../fish/guestfish.pod:360
18286 "The option must always be used if the disk image or virtual machine might be "
18287 "running, and is generally recommended in cases where you don't need write "
18288 "access to the disk."
18292 #: ../fish/guestfish.pod:364
18294 "Note that prepared disk images created with I<-N> are not affected by this "
18295 "option. Also commands like C<add> are not affected - you have to specify "
18296 "the C<readonly:true> option explicitly if you need it."
18300 #: ../fish/guestfish.pod:368
18301 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18305 #: ../fish/guestfish.pod:370 ../fuse/guestmount.pod:208
18306 msgid "B<--selinux>"
18310 #: ../fish/guestfish.pod:372
18311 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18315 #: ../fish/guestfish.pod:374
18320 #: ../fish/guestfish.pod:376
18321 msgid "B<--verbose>"
18325 #: ../fish/guestfish.pod:378
18327 "Enable very verbose messages. This is particularly useful if you find a "
18332 #: ../fish/guestfish.pod:381
18337 #: ../fish/guestfish.pod:383 ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270 ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
18338 msgid "B<--version>"
18342 #: ../fish/guestfish.pod:385
18343 msgid "Display the guestfish / libguestfs version number and exit."
18347 #: ../fish/guestfish.pod:387
18352 #: ../fish/guestfish.pod:389
18357 #: ../fish/guestfish.pod:391
18359 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
18364 #: ../fish/guestfish.pod:394
18369 #: ../fish/guestfish.pod:396
18370 msgid "Echo each command before executing it."
18374 #: ../fish/guestfish.pod:400
18375 msgid "COMMANDS ON COMMAND LINE"
18379 #: ../fish/guestfish.pod:402
18380 msgid "Any additional (non-option) arguments are treated as commands to execute."
18384 #: ../fish/guestfish.pod:405
18386 "Commands to execute should be separated by a colon (C<:>), where the colon "
18387 "is a separate parameter. Thus:"
18391 #: ../fish/guestfish.pod:408
18394 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18399 #: ../fish/guestfish.pod:410
18401 "If there are no additional arguments, then we enter a shell, either an "
18402 "interactive shell with a prompt (if the input is a terminal) or a "
18403 "non-interactive shell."
18407 #: ../fish/guestfish.pod:414
18409 "In either command line mode or non-interactive shell, the first command that "
18410 "gives an error causes the whole shell to exit. In interactive mode (with a "
18411 "prompt) if a command fails, you can continue to enter commands."
18415 #: ../fish/guestfish.pod:419
18416 msgid "USING launch (OR run)"
18420 #: ../fish/guestfish.pod:421
18422 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18423 "then launch it, then mount any disks you need, and finally issue "
18424 "actions/commands. So the general order of the day is:"
18428 #: ../fish/guestfish.pod:429
18429 msgid "add or -a/--add"
18433 #: ../fish/guestfish.pod:433
18434 msgid "launch (aka run)"
18438 #: ../fish/guestfish.pod:437
18439 msgid "mount or -m/--mount"
18443 #: ../fish/guestfish.pod:441
18444 msgid "any other commands"
18448 #: ../fish/guestfish.pod:445
18450 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18451 "guest before mounting or performing any other commands."
18455 #: ../fish/guestfish.pod:448
18457 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18458 "I<--new> options were given then C<run> is done automatically, simply "
18459 "because guestfish can't perform the action you asked for without doing this."
18463 #: ../fish/guestfish.pod:453
18464 msgid "OPENING DISKS FOR READ AND WRITE"
18468 #: ../fish/guestfish.pod:455
18470 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
18471 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
18472 "open disk images read-only or for writing."
18476 #: ../fish/guestfish.pod:459
18478 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
18479 "disk images supplied on the command line for write. To open a disk image "
18480 "read-only you have to do I<-a image --ro>."
18484 #: ../fish/guestfish.pod:463
18486 "This matters: If you accidentally open a live VM disk image writable then "
18487 "you will cause irreversible disk corruption."
18491 #: ../fish/guestfish.pod:466
18493 "By libguestfs 1.10 we intend to change the default the other way. Disk "
18494 "images will be opened read-only. You will have to either specify "
18495 "I<guestfish --rw> or change a configuration file in order to get write "
18496 "access for disk images specified by those other command line options."
18500 #: ../fish/guestfish.pod:471
18502 "This version of guestfish has a I<--rw> option which does nothing (it is "
18503 "already the default). However it is highly recommended that you use this "
18504 "option to indicate that guestfish needs write access, and to prepare your "
18505 "scripts for the day when this option will be required for write access."
18509 #: ../fish/guestfish.pod:477
18511 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18512 "other libguestfs program apart from guestfish and guestmount."
18516 #: ../fish/guestfish.pod:480
18521 #: ../fish/guestfish.pod:482
18523 "You can quote ordinary parameters using either single or double quotes. For "
18528 #: ../fish/guestfish.pod:485
18531 " add \"file with a space.img\"\n"
18536 #: ../fish/guestfish.pod:487
18539 " rm '/file name'\n"
18544 #: ../fish/guestfish.pod:489
18552 #: ../fish/guestfish.pod:491
18554 "A few commands require a list of strings to be passed. For these, use a "
18555 "whitespace-separated list, enclosed in quotes. Strings containing "
18556 "whitespace to be passed through must be enclosed in single quotes. A "
18557 "literal single quote must be escaped with a backslash."
18561 #: ../fish/guestfish.pod:496
18564 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18565 " command \"/bin/echo 'foo bar'\"\n"
18566 " command \"/bin/echo \\'foo\\'\"\n"
18571 #: ../fish/guestfish.pod:500
18572 msgid "OPTIONAL ARGUMENTS"
18576 #: ../fish/guestfish.pod:502
18578 "Some commands take optional arguments. These arguments appear in this "
18579 "documentation as C<[argname:..]>. You can use them as in these examples:"
18583 #: ../fish/guestfish.pod:506
18586 " add-drive-opts filename\n"
18591 #: ../fish/guestfish.pod:508
18594 " add-drive-opts filename readonly:true\n"
18599 #: ../fish/guestfish.pod:510
18602 " add-drive-opts filename format:qcow2 readonly:false\n"
18607 #: ../fish/guestfish.pod:512
18609 "Each optional argument can appear at most once. All optional arguments must "
18610 "appear after the required ones."
18614 #: ../fish/guestfish.pod:515
18619 #: ../fish/guestfish.pod:517
18620 msgid "This section applies to all commands which can take integers as parameters."
18624 #: ../fish/guestfish.pod:520
18625 msgid "SIZE SUFFIX"
18629 #: ../fish/guestfish.pod:522
18631 "When the command takes a parameter measured in bytes, you can use one of the "
18632 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18636 #: ../fish/guestfish.pod:528
18637 msgid "B<k> or B<K> or B<KiB>"
18641 #: ../fish/guestfish.pod:530
18642 msgid "The size in kilobytes (multiplied by 1024)."
18646 #: ../fish/guestfish.pod:532
18651 #: ../fish/guestfish.pod:534
18652 msgid "The size in SI 1000 byte units."
18656 #: ../fish/guestfish.pod:536
18657 msgid "B<M> or B<MiB>"
18661 #: ../fish/guestfish.pod:538
18662 msgid "The size in megabytes (multiplied by 1048576)."
18666 #: ../fish/guestfish.pod:540
18671 #: ../fish/guestfish.pod:542
18672 msgid "The size in SI 1000000 byte units."
18676 #: ../fish/guestfish.pod:544
18677 msgid "B<G> or B<GiB>"
18681 #: ../fish/guestfish.pod:546
18682 msgid "The size in gigabytes (multiplied by 2**30)."
18686 #: ../fish/guestfish.pod:548
18691 #: ../fish/guestfish.pod:550
18692 msgid "The size in SI 10**9 byte units."
18696 #: ../fish/guestfish.pod:552
18697 msgid "B<T> or B<TiB>"
18701 #: ../fish/guestfish.pod:554
18702 msgid "The size in terabytes (multiplied by 2**40)."
18706 #: ../fish/guestfish.pod:556
18711 #: ../fish/guestfish.pod:558
18712 msgid "The size in SI 10**12 byte units."
18716 #: ../fish/guestfish.pod:560
18717 msgid "B<P> or B<PiB>"
18721 #: ../fish/guestfish.pod:562
18722 msgid "The size in petabytes (multiplied by 2**50)."
18726 #: ../fish/guestfish.pod:564
18731 #: ../fish/guestfish.pod:566
18732 msgid "The size in SI 10**15 byte units."
18736 #: ../fish/guestfish.pod:568
18737 msgid "B<E> or B<EiB>"
18741 #: ../fish/guestfish.pod:570
18742 msgid "The size in exabytes (multiplied by 2**60)."
18746 #: ../fish/guestfish.pod:572
18751 #: ../fish/guestfish.pod:574
18752 msgid "The size in SI 10**18 byte units."
18756 #: ../fish/guestfish.pod:576
18757 msgid "B<Z> or B<ZiB>"
18761 #: ../fish/guestfish.pod:578
18762 msgid "The size in zettabytes (multiplied by 2**70)."
18766 #: ../fish/guestfish.pod:580
18771 #: ../fish/guestfish.pod:582
18772 msgid "The size in SI 10**21 byte units."
18776 #: ../fish/guestfish.pod:584
18777 msgid "B<Y> or B<YiB>"
18781 #: ../fish/guestfish.pod:586
18782 msgid "The size in yottabytes (multiplied by 2**80)."
18786 #: ../fish/guestfish.pod:588
18791 #: ../fish/guestfish.pod:590
18792 msgid "The size in SI 10**24 byte units."
18796 #: ../fish/guestfish.pod:596
18799 " truncate-size /file 1G\n"
18804 #: ../fish/guestfish.pod:598
18805 msgid "would truncate the file to 1 gigabyte."
18809 #: ../fish/guestfish.pod:600
18811 "Be careful because a few commands take sizes in kilobytes or megabytes "
18812 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18813 "Adding a suffix will probably not do what you expect."
18817 #: ../fish/guestfish.pod:604
18818 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18822 #: ../fish/guestfish.pod:606
18824 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18825 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18829 #: ../fish/guestfish.pod:609
18832 " 1234 decimal number 1234\n"
18833 " 02322 octal number, equivalent to decimal 1234\n"
18834 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18839 #: ../fish/guestfish.pod:613
18841 "When using the C<chmod> command, you almost always want to specify an octal "
18842 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18843 "L<chmod(1)> program):"
18847 #: ../fish/guestfish.pod:617
18850 " chmod 0777 /public # OK\n"
18851 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18856 #: ../fish/guestfish.pod:620
18858 "Commands that return numbers usually print them in decimal, but some "
18859 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18860 "octal, preceeded by C<0>)."
18864 #: ../fish/guestfish.pod:624
18865 msgid "WILDCARDS AND GLOBBING"
18869 #: ../fish/guestfish.pod:626
18871 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18872 "(globbing) by default. So for example the following will not do what you "
18877 #: ../fish/guestfish.pod:630
18885 #: ../fish/guestfish.pod:632
18887 "Assuming you don't have a directory called literally C</home/*> then the "
18888 "above command will return an error."
18892 #: ../fish/guestfish.pod:635
18893 msgid "To perform wildcard expansion, use the C<glob> command."
18897 #: ../fish/guestfish.pod:637
18900 " glob rm-rf /home/*\n"
18905 #: ../fish/guestfish.pod:639
18907 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18908 "many times), equivalent to:"
18912 #: ../fish/guestfish.pod:642
18915 " rm-rf /home/jim\n"
18916 " rm-rf /home/joe\n"
18917 " rm-rf /home/mary\n"
18922 #: ../fish/guestfish.pod:646
18923 msgid "C<glob> only works on simple guest paths and not on device names."
18927 #: ../fish/guestfish.pod:648
18929 "If you have several parameters, each containing a wildcard, then glob will "
18930 "perform a Cartesian product."
18934 #: ../fish/guestfish.pod:651
18939 #: ../fish/guestfish.pod:653
18941 "Any line which starts with a I<#> character is treated as a comment and "
18942 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18943 "a command. For example:"
18947 #: ../fish/guestfish.pod:657
18950 " # this is a comment\n"
18951 " # this is a comment\n"
18952 " foo # NOT a comment\n"
18957 #: ../fish/guestfish.pod:661
18958 msgid "Blank lines are also ignored."
18962 #: ../fish/guestfish.pod:663
18963 msgid "RUNNING COMMANDS LOCALLY"
18967 #: ../fish/guestfish.pod:665
18969 "Any line which starts with a I<!> character is treated as a command sent to "
18970 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18974 #: ../fish/guestfish.pod:669
18978 " tgz-out /remote local/remote-data.tar.gz\n"
18983 #: ../fish/guestfish.pod:672
18985 "will create a directory C<local> on the host, and then export the contents "
18986 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18987 "(See C<tgz-out>)."
18991 #: ../fish/guestfish.pod:676
18993 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18994 "effect, due to the way that subprocesses work in Unix."
18998 #: ../fish/guestfish.pod:679
19003 #: ../fish/guestfish.pod:681
19005 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19006 "command (a guestfish command) to the second command (any host command). For "
19011 #: ../fish/guestfish.pod:685
19014 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19019 #: ../fish/guestfish.pod:687
19021 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19022 "program). The above command would list all accounts in the guest filesystem "
19023 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19027 #: ../fish/guestfish.pod:692
19030 " hexdump /bin/ls | head\n"
19031 " list-devices | tail -1\n"
19032 " tgz-out / - | tar ztf -\n"
19037 #: ../fish/guestfish.pod:696
19039 "The space before the pipe symbol is required, any space after the pipe "
19040 "symbol is optional. Everything after the pipe symbol is just passed "
19041 "straight to the host shell, so it can contain redirections, globs and "
19042 "anything else that makes sense on the host side."
19046 #: ../fish/guestfish.pod:701
19048 "To use a literal argument which begins with a pipe symbol, you have to quote "
19053 #: ../fish/guestfish.pod:704
19061 #: ../fish/guestfish.pod:706
19062 msgid "HOME DIRECTORIES"
19066 #: ../fish/guestfish.pod:708
19068 "If a parameter starts with the character C<~> then the tilde may be expanded "
19069 "as a home directory path (either C<~> for the current user's home directory, "
19070 "or C<~user> for another user)."
19074 #: ../fish/guestfish.pod:712
19076 "Note that home directory expansion happens for users known I<on the host>, "
19077 "not in the guest filesystem."
19081 #: ../fish/guestfish.pod:715
19083 "To use a literal argument which begins with a tilde, you have to quote it, "
19088 #: ../fish/guestfish.pod:718
19096 #: ../fish/guestfish.pod:722
19098 "Libguestfs has some support for Linux guests encrypted according to the "
19099 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19100 "disk encryption systems used by modern Linux guests. Currently only "
19101 "LVM-on-LUKS is supported."
19105 #: ../fish/guestfish.pod:727
19106 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19110 #: ../fish/guestfish.pod:729
19113 " ><fs> vfs-type /dev/sda2\n"
19119 #: ../fish/guestfish.pod:732
19121 "Then open those devices using L</luks-open>. This creates a device-mapper "
19122 "device called C</dev/mapper/luksdev>."
19126 #: ../fish/guestfish.pod:735
19129 " ><fs> luks-open /dev/sda2 luksdev\n"
19130 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19135 #: ../fish/guestfish.pod:738
19137 "Finally you have to tell LVM to scan for volume groups on the newly created "
19142 #: ../fish/guestfish.pod:741
19146 " vg-activate-all true\n"
19151 #: ../fish/guestfish.pod:744
19152 msgid "The logical volume(s) can now be mounted in the usual way."
19156 #: ../fish/guestfish.pod:746
19158 "Before closing a LUKS device you must unmount any logical volumes on it and "
19159 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19160 "one. Then you can close the mapper device:"
19164 #: ../fish/guestfish.pod:750
19167 " vg-activate false /dev/VG\n"
19168 " luks-close /dev/mapper/luksdev\n"
19173 #: ../fish/guestfish.pod:753
19174 msgid "WINDOWS PATHS"
19178 #: ../fish/guestfish.pod:755
19180 "If a path is prefixed with C<win:> then you can use Windows-style paths "
19181 "(with some limitations). The following commands are equivalent:"
19185 #: ../fish/guestfish.pod:758
19188 " file /WINDOWS/system32/config/system.LOG\n"
19193 #: ../fish/guestfish.pod:760
19196 " file win:/windows/system32/config/system.log\n"
19201 #: ../fish/guestfish.pod:762
19204 " file win:\\windows\\system32\\config\\system.log\n"
19209 #: ../fish/guestfish.pod:764
19212 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
19217 #: ../fish/guestfish.pod:766
19219 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
19220 "handles case insensitivity like Windows would. This only works in argument "
19221 "positions that expect a path."
19225 #: ../fish/guestfish.pod:770
19226 msgid "UPLOADING AND DOWNLOADING FILES"
19230 #: ../fish/guestfish.pod:772
19232 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19233 "others which upload from or download to a local file, you can use the "
19234 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19238 #: ../fish/guestfish.pod:776
19246 #: ../fish/guestfish.pod:778
19247 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19251 #: ../fish/guestfish.pod:781
19254 " tar-out /etc - | tar tf -\n"
19259 #: ../fish/guestfish.pod:783
19261 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19262 "command (see L</PIPES>)."
19266 #: ../fish/guestfish.pod:786
19268 "When using C<-> to read from stdin, the input is read up to the end of "
19269 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19270 "some arbitrary end marker:"
19274 #: ../fish/guestfish.pod:790
19277 " upload -<<END /foo\n"
19286 #: ../fish/guestfish.pod:796
19288 "Any string of characters can be used instead of C<END>. The end marker must "
19289 "appear on a line of its own, without any preceeding or following characters "
19290 "(not even spaces)."
19294 #: ../fish/guestfish.pod:800
19296 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19297 "upload local files (so-called \"FileIn\" parameters in the generator)."
19301 #: ../fish/guestfish.pod:803
19302 msgid "EXIT ON ERROR BEHAVIOUR"
19306 #: ../fish/guestfish.pod:805
19308 "By default, guestfish will ignore any errors when in interactive mode "
19309 "(ie. taking commands from a human over a tty), and will exit on the first "
19310 "error in non-interactive mode (scripts, commands given on the command line)."
19314 #: ../fish/guestfish.pod:810
19316 "If you prefix a command with a I<-> character, then that command will not "
19317 "cause guestfish to exit, even if that (one) command returns an error."
19321 #: ../fish/guestfish.pod:814
19322 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19326 #: ../fish/guestfish.pod:816
19328 "Guestfish can be remote-controlled over a socket. This is useful "
19329 "particularly in shell scripts where you want to make several different "
19330 "changes to a filesystem, but you don't want the overhead of starting up a "
19331 "guestfish process each time."
19335 #: ../fish/guestfish.pod:821
19336 msgid "Start a guestfish server process using:"
19340 #: ../fish/guestfish.pod:823
19343 " eval \"`guestfish --listen`\"\n"
19348 #: ../fish/guestfish.pod:825
19349 msgid "and then send it commands by doing:"
19353 #: ../fish/guestfish.pod:827
19356 " guestfish --remote cmd [...]\n"
19361 #: ../fish/guestfish.pod:829
19362 msgid "To cause the server to exit, send it the exit command:"
19366 #: ../fish/guestfish.pod:831
19369 " guestfish --remote exit\n"
19374 #: ../fish/guestfish.pod:833
19376 "Note that the server will normally exit if there is an error in a command. "
19377 "You can change this in the usual way. See section L</EXIT ON ERROR "
19382 #: ../fish/guestfish.pod:837
19383 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19387 #: ../fish/guestfish.pod:839
19389 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19390 "is how the I<--remote> option knows where to send the commands. You can "
19391 "have several guestfish listener processes running using:"
19395 #: ../fish/guestfish.pod:843
19398 " eval \"`guestfish --listen`\"\n"
19399 " pid1=$GUESTFISH_PID\n"
19400 " eval \"`guestfish --listen`\"\n"
19401 " pid2=$GUESTFISH_PID\n"
19403 " guestfish --remote=$pid1 cmd\n"
19404 " guestfish --remote=$pid2 cmd\n"
19409 #: ../fish/guestfish.pod:851
19410 msgid "REMOTE CONTROL AND CSH"
19414 #: ../fish/guestfish.pod:853
19416 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19421 #: ../fish/guestfish.pod:856
19424 " eval \"`guestfish --listen --csh`\"\n"
19429 #: ../fish/guestfish.pod:858
19430 msgid "REMOTE CONTROL DETAILS"
19434 #: ../fish/guestfish.pod:860
19436 "Remote control happens over a Unix domain socket called "
19437 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19438 "of the process, and C<$PID> is the process ID of the server."
19442 #: ../fish/guestfish.pod:864
19443 msgid "Guestfish client and server versions must match exactly."
19447 #: ../fish/guestfish.pod:866
19448 msgid "PREPARED DISK IMAGES"
19452 #: ../fish/guestfish.pod:868
19454 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19455 "preformatted disk images that guestfish can make for you to save typing. "
19456 "This is particularly useful for testing purposes. This option is used "
19457 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19458 "can be mixed with I<-a>)."
19462 #: ../fish/guestfish.pod:874
19464 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19465 "the second and so on. Existing files in the current directory are "
19470 #: ../fish/guestfish.pod:878
19472 "The type briefly describes how the disk should be sized, partitioned, how "
19473 "filesystem(s) should be created, and how content should be added. "
19474 "Optionally the type can be followed by extra parameters, separated by C<:> "
19475 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19476 "sparsely-allocated disk, containing a single partition, with the partition "
19477 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19478 "on a 1GB disk instead."
19482 #: ../fish/guestfish.pod:886
19483 msgid "To list the available types and any extra parameters they take, run:"
19487 #: ../fish/guestfish.pod:890
19489 "Note that the prepared filesystem is not mounted. You would usually have to "
19490 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19494 #: ../fish/guestfish.pod:894
19496 "If any I<-N> or I<--new> options are given, the guest is automatically "
19501 #: ../fish/guestfish.pod:899
19502 msgid "Create a 100MB disk with an ext4-formatted partition:"
19506 #: ../fish/guestfish.pod:901
19509 " guestfish -N fs:ext4\n"
19514 #: ../fish/guestfish.pod:903
19515 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19519 #: ../fish/guestfish.pod:905
19522 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19527 #: ../fish/guestfish.pod:907
19528 msgid "Create a blank 200MB disk:"
19532 #: ../fish/guestfish.pod:909
19535 " guestfish -N disk:200M\n"
19540 #: ../fish/guestfish.pod:911
19541 msgid "PROGRESS BARS"
19545 #: ../fish/guestfish.pod:913
19547 "Some (not all) long-running commands send progress notification messages as "
19548 "they are running. Guestfish turns these messages into progress bars."
19552 #: ../fish/guestfish.pod:917
19554 "When a command that supports progress bars takes longer than two seconds to "
19555 "run, and if progress bars are enabled, then you will see one appearing below "
19560 #: ../fish/guestfish.pod:921
19563 " ><fs> copy-size /large-file /another-file 2048M\n"
19564 " / 10% [#####-----------------------------------------] 00:30\n"
19569 #: ../fish/guestfish.pod:924
19571 "The spinner on the left hand side moves round once for every progress "
19572 "notification received from the backend. This is a (reasonably) golden "
19573 "assurance that the command is \"doing something\" even if the progress bar "
19574 "is not moving, because the command is able to send the progress "
19575 "notifications. When the bar reaches 100% and the command finishes, the "
19576 "spinner disappears."
19580 #: ../fish/guestfish.pod:931
19582 "Progress bars are enabled by default when guestfish is used interactively. "
19583 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19584 "and you can disable them completely using I<--no-progress-bars>."
19588 #: ../fish/guestfish.pod:936
19589 msgid "GUESTFISH COMMANDS"
19593 #: ../fish/guestfish.pod:938
19595 "The commands in this section are guestfish convenience commands, in other "
19596 "words, they are not part of the L<guestfs(3)> API."
19600 #: ../fish/guestfish.pod:941
19605 #: ../fish/guestfish.pod:943
19614 #: ../fish/guestfish.pod:946
19615 msgid "Without any parameter, this provides general help."
19619 #: ../fish/guestfish.pod:948
19620 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19624 #: ../fish/guestfish.pod:950
19625 msgid "quit | exit"
19629 #: ../fish/guestfish.pod:952
19630 msgid "This exits guestfish. You can also use C<^D> key."
19634 #: ../fish/guestfish.pod:954
19635 msgid "@FISH_COMMANDS@"
19639 #: ../fish/guestfish.pod:956
19644 #: ../fish/guestfish.pod:960 ../test-tool/libguestfs-test-tool.pod:83
19649 #: ../fish/guestfish.pod:962
19651 "guestfish returns 0 if the commands completed without error, or 1 if there "
19656 #: ../fish/guestfish.pod:969
19661 #: ../fish/guestfish.pod:971
19663 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19668 #: ../fish/guestfish.pod:974
19669 msgid "GUESTFISH_PID"
19673 #: ../fish/guestfish.pod:976
19675 "Used with the I<--remote> option to specify the remote guestfish process to "
19676 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19680 #: ../fish/guestfish.pod:980
19685 #: ../fish/guestfish.pod:982
19687 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19688 "not specified, the external L<hexedit(1)> program is used."
19692 #: ../fish/guestfish.pod:986
19697 #: ../fish/guestfish.pod:988
19699 "If compiled with GNU readline support, various files in the home directory "
19700 "can be used. See L</FILES>."
19704 #: ../fish/guestfish.pod:997
19706 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19707 "effect as using the B<-v> option."
19711 #: ../fish/guestfish.pod:1009
19713 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19714 "the discussion of paths in L<guestfs(3)>."
19718 #: ../fish/guestfish.pod:1020
19719 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19723 #: ../fish/guestfish.pod:1022
19728 #: ../fish/guestfish.pod:1024
19730 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19735 #: ../fish/guestfish.pod:1039 ../test-tool/libguestfs-test-tool.pod:88
19740 #: ../fish/guestfish.pod:1043
19741 msgid "$HOME/.guestfish"
19745 #: ../fish/guestfish.pod:1045
19747 "If compiled with GNU readline support, then the command history is saved in "
19752 #: ../fish/guestfish.pod:1048
19753 msgid "$HOME/.inputrc"
19757 #: ../fish/guestfish.pod:1050
19758 msgid "/etc/inputrc"
19762 #: ../fish/guestfish.pod:1052
19764 "If compiled with GNU readline support, then these files can be used to "
19765 "configure readline. For further information, please see "
19766 "L<readline(3)/INITIALIZATION FILE>."
19770 #: ../fish/guestfish.pod:1056
19771 msgid "To write rules which only apply to guestfish, use:"
19775 #: ../fish/guestfish.pod:1058
19785 #: ../fish/guestfish.pod:1062
19787 "Variables that you can set in inputrc that change the behaviour of guestfish "
19788 "in useful ways include:"
19792 #: ../fish/guestfish.pod:1067
19793 msgid "completion-ignore-case (default: on)"
19797 #: ../fish/guestfish.pod:1069
19799 "By default, guestfish will ignore case when tab-completing paths on the "
19804 #: ../fish/guestfish.pod:1072
19807 " set completion-ignore-case off\n"
19812 #: ../fish/guestfish.pod:1074
19813 msgid "to make guestfish case sensitive."
19817 #: ../fish/guestfish.pod:1078
19822 #: ../fish/guestfish.pod:1080
19823 msgid "test2.img (etc)"
19827 #: ../fish/guestfish.pod:1082
19829 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19830 "will be created in the file C<test1.img> in the current directory. The "
19831 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19832 "the same name will be overwritten."
19836 #: ../fish/guestfish.pod:1091
19838 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
19839 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
19840 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
19841 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
19842 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
19843 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
19847 #: ../fish/guestfish.pod:1121 ../test-tool/libguestfs-test-tool.pod:124 ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:372 ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309 ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
19849 "This program is free software; you can redistribute it and/or modify it "
19850 "under the terms of the GNU General Public License as published by the Free "
19851 "Software Foundation; either version 2 of the License, or (at your option) "
19852 "any later version."
19856 #: ../fish/guestfish.pod:1126 ../test-tool/libguestfs-test-tool.pod:129 ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:377 ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517 ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
19858 "This program is distributed in the hope that it will be useful, but WITHOUT "
19859 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19860 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19865 #: ../fish/guestfish.pod:1131 ../test-tool/libguestfs-test-tool.pod:134 ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:382 ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522 ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
19867 "You should have received a copy of the GNU General Public License along with "
19868 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19869 "Ave, Cambridge, MA 02139, USA."
19873 #: ../fish/guestfish-actions.pod:1
19878 #: ../fish/guestfish-actions.pod:3
19881 " add-cdrom filename\n"
19886 #: ../fish/guestfish-actions.pod:15
19888 "This call checks for the existence of C<filename>. This stops you from "
19889 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19890 "and C<http:> URLs. To specify those, use the general L</config> call "
19895 #: ../fish/guestfish-actions.pod:22
19897 "If you just want to add an ISO file (often you use this as an efficient way "
19898 "to transfer large files into the guest), then you should probably use "
19899 "L</add-drive-ro> instead."
19903 #: ../fish/guestfish-actions.pod:35
19908 #: ../fish/guestfish-actions.pod:37
19913 #: ../fish/guestfish-actions.pod:39
19916 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19921 #: ../fish/guestfish-actions.pod:41
19923 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19924 "It works by connecting to libvirt, requesting the domain and domain XML from "
19925 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19929 #: ../fish/guestfish-actions.pod:64
19931 "The other optional parameters are passed directly through to "
19932 "L</add-drive-opts>."
19936 #: ../fish/guestfish-actions.pod:67 ../fish/guestfish-actions.pod:131 ../fish/guestfish-actions.pod:2842
19938 "This command has one or more optional arguments. See L</OPTIONAL "
19943 #: ../fish/guestfish-actions.pod:69
19948 #: ../fish/guestfish-actions.pod:71
19951 " add-drive filename\n"
19956 #: ../fish/guestfish-actions.pod:73
19958 "This function is the equivalent of calling L</add-drive-opts> with no "
19959 "optional parameters, so the disk is added writable, with the format being "
19960 "detected automatically."
19964 #: ../fish/guestfish-actions.pod:77
19966 "Automatic detection of the format opens you up to a potential security hole "
19967 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19968 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19969 "you should think about replacing calls to this function with calls to "
19970 "L</add-drive-opts>, and specifying the format."
19974 #: ../fish/guestfish-actions.pod:84
19975 msgid "add-drive-opts"
19979 #: ../fish/guestfish-actions.pod:86
19984 #: ../fish/guestfish-actions.pod:88
19987 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19992 #: ../fish/guestfish-actions.pod:115
19994 "This forces the image format. If you omit this (or use L</add-drive> or "
19995 "L</add-drive-ro>) then the format is automatically detected. Possible "
19996 "formats include C<raw> and C<qcow2>."
20000 #: ../fish/guestfish-actions.pod:126
20002 "This rarely-used option lets you emulate the behaviour of the deprecated "
20003 "L</add-drive-with-if> call (q.v.)"
20007 #: ../fish/guestfish-actions.pod:133
20008 msgid "add-drive-ro"
20012 #: ../fish/guestfish-actions.pod:135
20017 #: ../fish/guestfish-actions.pod:137
20020 " add-drive-ro filename\n"
20025 #: ../fish/guestfish-actions.pod:139
20027 "This function is the equivalent of calling L</add-drive-opts> with the "
20028 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
20029 "is added read-only, with the format being detected automatically."
20033 #: ../fish/guestfish-actions.pod:144
20034 msgid "add-drive-ro-with-if"
20038 #: ../fish/guestfish-actions.pod:146
20041 " add-drive-ro-with-if filename iface\n"
20046 #: ../fish/guestfish-actions.pod:148
20048 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
20049 "interface emulation to use at run time."
20053 #: ../fish/guestfish-actions.pod:158
20054 msgid "add-drive-with-if"
20058 #: ../fish/guestfish-actions.pod:160
20061 " add-drive-with-if filename iface\n"
20066 #: ../fish/guestfish-actions.pod:162
20068 "This is the same as L</add-drive> but it allows you to specify the QEMU "
20069 "interface emulation to use at run time."
20073 #: ../fish/guestfish-actions.pod:172
20078 #: ../fish/guestfish-actions.pod:174
20081 " aug-clear augpath\n"
20086 #: ../fish/guestfish-actions.pod:179
20091 #: ../fish/guestfish-actions.pod:181
20099 #: ../fish/guestfish-actions.pod:183
20101 "Close the current Augeas handle and free up any resources used by it. After "
20102 "calling this, you have to call L</aug-init> again before you can use any "
20103 "other Augeas functions."
20107 #: ../fish/guestfish-actions.pod:188
20108 msgid "aug-defnode"
20112 #: ../fish/guestfish-actions.pod:190
20115 " aug-defnode name expr val\n"
20120 #: ../fish/guestfish-actions.pod:195
20122 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
20123 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
20124 "containing that single node."
20128 #: ../fish/guestfish-actions.pod:203
20133 #: ../fish/guestfish-actions.pod:205
20136 " aug-defvar name expr\n"
20141 #: ../fish/guestfish-actions.pod:214
20146 #: ../fish/guestfish-actions.pod:216
20149 " aug-get augpath\n"
20154 #: ../fish/guestfish-actions.pod:221
20159 #: ../fish/guestfish-actions.pod:223
20162 " aug-init root flags\n"
20167 #: ../fish/guestfish-actions.pod:229
20168 msgid "You must call this before using any other L</aug-*> commands."
20172 #: ../fish/guestfish-actions.pod:264
20173 msgid "Do not load the tree in L</aug-init>."
20177 #: ../fish/guestfish-actions.pod:268
20178 msgid "To close the handle, you can call L</aug-close>."
20182 #: ../fish/guestfish-actions.pod:272
20187 #: ../fish/guestfish-actions.pod:274
20190 " aug-insert augpath label true|false\n"
20195 #: ../fish/guestfish-actions.pod:284
20200 #: ../fish/guestfish-actions.pod:286
20208 #: ../fish/guestfish-actions.pod:293
20213 #: ../fish/guestfish-actions.pod:295
20216 " aug-ls augpath\n"
20221 #: ../fish/guestfish-actions.pod:297
20223 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
20224 "resulting nodes into alphabetical order."
20228 #: ../fish/guestfish-actions.pod:300
20233 #: ../fish/guestfish-actions.pod:302
20236 " aug-match augpath\n"
20241 #: ../fish/guestfish-actions.pod:308
20246 #: ../fish/guestfish-actions.pod:310
20249 " aug-mv src dest\n"
20254 #: ../fish/guestfish-actions.pod:315
20259 #: ../fish/guestfish-actions.pod:317
20262 " aug-rm augpath\n"
20267 #: ../fish/guestfish-actions.pod:323
20272 #: ../fish/guestfish-actions.pod:325
20280 #: ../fish/guestfish-actions.pod:329
20282 "The flags which were passed to L</aug-init> affect exactly how files are "
20287 #: ../fish/guestfish-actions.pod:332
20292 #: ../fish/guestfish-actions.pod:334
20295 " aug-set augpath val\n"
20300 #: ../fish/guestfish-actions.pod:338
20302 "In the Augeas API, it is possible to clear a node by setting the value to "
20303 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
20304 "this call. Instead you must use the L</aug-clear> call."
20308 #: ../fish/guestfish-actions.pod:343
20313 #: ../fish/guestfish-actions.pod:345
20316 " available 'groups ...'\n"
20321 #: ../fish/guestfish-actions.pod:351
20323 "The libguestfs groups, and the functions that those groups correspond to, "
20324 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
20325 "runtime by calling L</available-all-groups>."
20329 #: ../fish/guestfish-actions.pod:375
20330 msgid "You must call L</launch> before calling this function."
20334 #: ../fish/guestfish-actions.pod:397
20336 "This call was added in version C<1.0.80>. In previous versions of "
20337 "libguestfs all you could do would be to speculatively execute a command to "
20338 "find out if the daemon implemented it. See also L</version>."
20342 #: ../fish/guestfish-actions.pod:404
20343 msgid "available-all-groups"
20347 #: ../fish/guestfish-actions.pod:406
20350 " available-all-groups\n"
20355 #: ../fish/guestfish-actions.pod:408
20357 "This command returns a list of all optional groups that this daemon knows "
20358 "about. Note this returns both supported and unsupported groups. To find "
20359 "out which ones the daemon can actually support you have to call "
20360 "L</available> on each member of the returned list."
20364 #: ../fish/guestfish-actions.pod:414
20365 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
20369 #: ../fish/guestfish-actions.pod:416
20374 #: ../fish/guestfish-actions.pod:418
20377 " base64-in (base64file|-) filename\n"
20382 #: ../fish/guestfish-actions.pod:423 ../fish/guestfish-actions.pod:432 ../fish/guestfish-actions.pod:656 ../fish/guestfish-actions.pod:825 ../fish/guestfish-actions.pod:844 ../fish/guestfish-actions.pod:1221 ../fish/guestfish-actions.pod:4197 ../fish/guestfish-actions.pod:4209 ../fish/guestfish-actions.pod:4220 ../fish/guestfish-actions.pod:4231 ../fish/guestfish-actions.pod:4283 ../fish/guestfish-actions.pod:4292 ../fish/guestfish-actions.pod:4346 ../fish/guestfish-actions.pod:4369
20383 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
20387 #: ../fish/guestfish-actions.pod:425
20392 #: ../fish/guestfish-actions.pod:427
20395 " base64-out filename (base64file|-)\n"
20400 #: ../fish/guestfish-actions.pod:434
20401 msgid "blockdev-flushbufs"
20405 #: ../fish/guestfish-actions.pod:436
20408 " blockdev-flushbufs device\n"
20413 #: ../fish/guestfish-actions.pod:443
20414 msgid "blockdev-getbsz"
20418 #: ../fish/guestfish-actions.pod:445
20421 " blockdev-getbsz device\n"
20426 #: ../fish/guestfish-actions.pod:454
20427 msgid "blockdev-getro"
20431 #: ../fish/guestfish-actions.pod:456
20434 " blockdev-getro device\n"
20439 #: ../fish/guestfish-actions.pod:463
20440 msgid "blockdev-getsize64"
20444 #: ../fish/guestfish-actions.pod:465
20447 " blockdev-getsize64 device\n"
20452 #: ../fish/guestfish-actions.pod:469
20453 msgid "See also L</blockdev-getsz>."
20457 #: ../fish/guestfish-actions.pod:473
20458 msgid "blockdev-getss"
20462 #: ../fish/guestfish-actions.pod:475
20465 " blockdev-getss device\n"
20470 #: ../fish/guestfish-actions.pod:480
20471 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
20475 #: ../fish/guestfish-actions.pod:485
20476 msgid "blockdev-getsz"
20480 #: ../fish/guestfish-actions.pod:487
20483 " blockdev-getsz device\n"
20488 #: ../fish/guestfish-actions.pod:492
20490 "See also L</blockdev-getss> for the real sector size of the device, and "
20491 "L</blockdev-getsize64> for the more useful I<size in bytes>."
20495 #: ../fish/guestfish-actions.pod:498
20496 msgid "blockdev-rereadpt"
20500 #: ../fish/guestfish-actions.pod:500
20503 " blockdev-rereadpt device\n"
20508 #: ../fish/guestfish-actions.pod:506
20509 msgid "blockdev-setbsz"
20513 #: ../fish/guestfish-actions.pod:508
20516 " blockdev-setbsz device blocksize\n"
20521 #: ../fish/guestfish-actions.pod:517
20522 msgid "blockdev-setro"
20526 #: ../fish/guestfish-actions.pod:519
20529 " blockdev-setro device\n"
20534 #: ../fish/guestfish-actions.pod:525
20535 msgid "blockdev-setrw"
20539 #: ../fish/guestfish-actions.pod:527
20542 " blockdev-setrw device\n"
20547 #: ../fish/guestfish-actions.pod:533
20548 msgid "case-sensitive-path"
20552 #: ../fish/guestfish-actions.pod:535
20555 " case-sensitive-path path\n"
20560 #: ../fish/guestfish-actions.pod:559
20562 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
20563 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
20564 "how the directories were originally created under Windows)."
20568 #: ../fish/guestfish-actions.pod:567
20569 msgid "See also L</realpath>."
20573 #: ../fish/guestfish-actions.pod:569
20578 #: ../fish/guestfish-actions.pod:571
20586 #: ../fish/guestfish-actions.pod:575
20588 "Note that this function cannot correctly handle binary files (specifically, "
20589 "files containing C<\\0> character which is treated as end of string). For "
20590 "those you need to use the L</read-file> or L</download> functions which have "
20591 "a more complex interface."
20595 #: ../fish/guestfish-actions.pod:583
20600 #: ../fish/guestfish-actions.pod:585
20603 " checksum csumtype path\n"
20608 #: ../fish/guestfish-actions.pod:628
20609 msgid "To get the checksum for a device, use L</checksum-device>."
20613 #: ../fish/guestfish-actions.pod:630
20614 msgid "To get the checksums for many files, use L</checksums-out>."
20618 #: ../fish/guestfish-actions.pod:632
20619 msgid "checksum-device"
20623 #: ../fish/guestfish-actions.pod:634
20626 " checksum-device csumtype device\n"
20631 #: ../fish/guestfish-actions.pod:636
20633 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20634 "device named C<device>. For the types of checksums supported see the "
20635 "L</checksum> command."
20639 #: ../fish/guestfish-actions.pod:640
20640 msgid "checksums-out"
20644 #: ../fish/guestfish-actions.pod:642
20647 " checksums-out csumtype directory (sumsfile|-)\n"
20652 #: ../fish/guestfish-actions.pod:658
20657 #: ../fish/guestfish-actions.pod:660
20660 " chmod mode path\n"
20665 #: ../fish/guestfish-actions.pod:671
20670 #: ../fish/guestfish-actions.pod:673
20673 " chown owner group path\n"
20678 #: ../fish/guestfish-actions.pod:681
20683 #: ../fish/guestfish-actions.pod:683
20686 " command 'arguments ...'\n"
20691 #: ../fish/guestfish-actions.pod:690
20693 "The single parameter is an argv-style list of arguments. The first element "
20694 "is the name of the program to run. Subsequent elements are parameters. The "
20695 "list must be non-empty (ie. must contain a program name). Note that the "
20696 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20700 #: ../fish/guestfish-actions.pod:718
20701 msgid "command-lines"
20705 #: ../fish/guestfish-actions.pod:720
20708 " command-lines 'arguments ...'\n"
20713 #: ../fish/guestfish-actions.pod:722
20714 msgid "This is the same as L</command>, but splits the result into a list of lines."
20718 #: ../fish/guestfish-actions.pod:725
20719 msgid "See also: L</sh-lines>"
20723 #: ../fish/guestfish-actions.pod:730
20728 #: ../fish/guestfish-actions.pod:732
20731 " config qemuparam qemuvalue\n"
20736 #: ../fish/guestfish-actions.pod:743
20741 #: ../fish/guestfish-actions.pod:745
20744 " copy-size src dest size\n"
20749 #: ../fish/guestfish-actions.pod:753
20754 #: ../fish/guestfish-actions.pod:755
20762 #: ../fish/guestfish-actions.pod:760
20767 #: ../fish/guestfish-actions.pod:762
20775 #: ../fish/guestfish-actions.pod:767
20780 #: ../fish/guestfish-actions.pod:769
20788 #: ../fish/guestfish-actions.pod:776
20790 "If the destination is a device, it must be as large or larger than the "
20791 "source file or device, otherwise the copy will fail. This command cannot do "
20792 "partial copies (see L</copy-size>)."
20796 #: ../fish/guestfish-actions.pod:780
20801 #: ../fish/guestfish-actions.pod:782
20809 #: ../fish/guestfish-actions.pod:786 ../fish/guestfish-actions.pod:797
20811 "This command is mostly useful for interactive sessions. It is I<not> "
20812 "intended that you try to parse the output string. Use L</statvfs> from "
20817 #: ../fish/guestfish-actions.pod:790
20822 #: ../fish/guestfish-actions.pod:792
20830 #: ../fish/guestfish-actions.pod:801
20835 #: ../fish/guestfish-actions.pod:803
20843 #: ../fish/guestfish-actions.pod:809
20845 "Another way to get the same information is to enable verbose messages with "
20846 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20847 "before running the program."
20851 #: ../fish/guestfish-actions.pod:814
20856 #: ../fish/guestfish-actions.pod:816
20859 " download remotefilename (filename|-)\n"
20864 #: ../fish/guestfish-actions.pod:823
20865 msgid "See also L</upload>, L</cat>."
20869 #: ../fish/guestfish-actions.pod:827
20870 msgid "download-offset"
20874 #: ../fish/guestfish-actions.pod:829
20877 " download-offset remotefilename (filename|-) offset size\n"
20882 #: ../fish/guestfish-actions.pod:837
20884 "Note that there is no limit on the amount of data that can be downloaded "
20885 "with this call, unlike with L</pread>, and this call always reads the full "
20886 "amount unless an error occurs."
20890 #: ../fish/guestfish-actions.pod:842
20891 msgid "See also L</download>, L</pread>."
20895 #: ../fish/guestfish-actions.pod:846
20896 msgid "drop-caches"
20900 #: ../fish/guestfish-actions.pod:848
20903 " drop-caches whattodrop\n"
20908 #: ../fish/guestfish-actions.pod:860
20913 #: ../fish/guestfish-actions.pod:862
20921 #: ../fish/guestfish-actions.pod:874
20926 #: ../fish/guestfish-actions.pod:876
20929 " e2fsck-f device\n"
20934 #: ../fish/guestfish-actions.pod:882
20936 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20937 "should use L</fsck>."
20941 #: ../fish/guestfish-actions.pod:885
20942 msgid "echo-daemon"
20946 #: ../fish/guestfish-actions.pod:887
20949 " echo-daemon 'words ...'\n"
20954 #: ../fish/guestfish-actions.pod:894
20955 msgid "See also L</ping-daemon>."
20959 #: ../fish/guestfish-actions.pod:896
20964 #: ../fish/guestfish-actions.pod:898
20967 " egrep regex path\n"
20972 #: ../fish/guestfish-actions.pod:906
20977 #: ../fish/guestfish-actions.pod:908
20980 " egrepi regex path\n"
20985 #: ../fish/guestfish-actions.pod:916
20990 #: ../fish/guestfish-actions.pod:918
20993 " equal file1 file2\n"
20998 #: ../fish/guestfish-actions.pod:925
21003 #: ../fish/guestfish-actions.pod:927
21011 #: ../fish/guestfish-actions.pod:932
21012 msgid "See also L</is-file>, L</is-dir>, L</stat>."
21016 #: ../fish/guestfish-actions.pod:934
21021 #: ../fish/guestfish-actions.pod:936
21024 " fallocate path len\n"
21029 #: ../fish/guestfish-actions.pod:953
21030 msgid "fallocate64"
21034 #: ../fish/guestfish-actions.pod:955
21037 " fallocate64 path len\n"
21042 #: ../fish/guestfish-actions.pod:961
21044 "Note that this call allocates disk blocks for the file. To create a sparse "
21045 "file use L</truncate-size> instead."
21049 #: ../fish/guestfish-actions.pod:964
21051 "The deprecated call L</fallocate> does the same, but owing to an oversight "
21052 "it only allowed 30 bit lengths to be specified, effectively limiting the "
21053 "maximum size of files created through that call to 1GB."
21057 #: ../fish/guestfish-actions.pod:973
21062 #: ../fish/guestfish-actions.pod:975
21065 " fgrep pattern path\n"
21070 #: ../fish/guestfish-actions.pod:983
21075 #: ../fish/guestfish-actions.pod:985
21078 " fgrepi pattern path\n"
21083 #: ../fish/guestfish-actions.pod:993
21088 #: ../fish/guestfish-actions.pod:995
21096 #: ../fish/guestfish-actions.pod:1007
21098 "This command can also be used on C</dev/> devices (and partitions, LV "
21099 "names). You can for example use this to determine if a device contains a "
21100 "filesystem, although it's usually better to use L</vfs-type>."
21104 #: ../fish/guestfish-actions.pod:1017
21105 msgid "file-architecture"
21109 #: ../fish/guestfish-actions.pod:1019
21112 " file-architecture filename\n"
21117 #: ../fish/guestfish-actions.pod:1122
21122 #: ../fish/guestfish-actions.pod:1124
21130 #: ../fish/guestfish-actions.pod:1128
21132 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
21133 "L</is-file> etc. To get the size of block devices, use "
21134 "L</blockdev-getsize64>."
21138 #: ../fish/guestfish-actions.pod:1132
21143 #: ../fish/guestfish-actions.pod:1134
21146 " fill c len path\n"
21151 #: ../fish/guestfish-actions.pod:1140
21153 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
21154 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
21155 "L</fill-pattern>."
21159 #: ../fish/guestfish-actions.pod:1145
21160 msgid "fill-pattern"
21164 #: ../fish/guestfish-actions.pod:1147
21167 " fill-pattern pattern len path\n"
21172 #: ../fish/guestfish-actions.pod:1149
21174 "This function is like L</fill> except that it creates a new file of length "
21175 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
21176 "is truncated if necessary to ensure the length of the file is exactly C<len> "
21181 #: ../fish/guestfish-actions.pod:1154
21186 #: ../fish/guestfish-actions.pod:1156
21189 " find directory\n"
21194 #: ../fish/guestfish-actions.pod:1170
21195 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
21199 #: ../fish/guestfish-actions.pod:1183
21200 msgid "See also L</find0>."
21204 #: ../fish/guestfish-actions.pod:1188
21209 #: ../fish/guestfish-actions.pod:1190
21212 " find0 directory (files|-)\n"
21217 #: ../fish/guestfish-actions.pod:1196
21218 msgid "This command works the same way as L</find> with the following exceptions:"
21222 #: ../fish/guestfish-actions.pod:1223
21223 msgid "findfs-label"
21227 #: ../fish/guestfish-actions.pod:1225
21230 " findfs-label label\n"
21235 #: ../fish/guestfish-actions.pod:1231
21236 msgid "To find the label of a filesystem, use L</vfs-label>."
21240 #: ../fish/guestfish-actions.pod:1233
21241 msgid "findfs-uuid"
21245 #: ../fish/guestfish-actions.pod:1235
21248 " findfs-uuid uuid\n"
21253 #: ../fish/guestfish-actions.pod:1241
21254 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
21258 #: ../fish/guestfish-actions.pod:1243
21263 #: ../fish/guestfish-actions.pod:1245
21266 " fsck fstype device\n"
21271 #: ../fish/guestfish-actions.pod:1275
21276 #: ../fish/guestfish-actions.pod:1277
21284 #: ../fish/guestfish-actions.pod:1284
21285 msgid "get-autosync"
21289 #: ../fish/guestfish-actions.pod:1286
21297 #: ../fish/guestfish-actions.pod:1290
21302 #: ../fish/guestfish-actions.pod:1292
21310 #: ../fish/guestfish-actions.pod:1296
21311 msgid "get-e2label"
21315 #: ../fish/guestfish-actions.pod:1298
21318 " get-e2label device\n"
21323 #: ../fish/guestfish-actions.pod:1310
21328 #: ../fish/guestfish-actions.pod:1312
21331 " get-e2uuid device\n"
21336 #: ../fish/guestfish-actions.pod:1324
21337 msgid "get-memsize"
21341 #: ../fish/guestfish-actions.pod:1326
21349 #: ../fish/guestfish-actions.pod:1331
21351 "If L</set-memsize> was not called on this handle, and if "
21352 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
21353 "value for memsize."
21357 #: ../fish/guestfish-actions.pod:1338
21358 msgid "get-network"
21362 #: ../fish/guestfish-actions.pod:1340
21370 #: ../fish/guestfish-actions.pod:1344
21375 #: ../fish/guestfish-actions.pod:1346
21383 #: ../fish/guestfish-actions.pod:1353
21388 #: ../fish/guestfish-actions.pod:1355
21393 #: ../fish/guestfish-actions.pod:1357
21401 #: ../fish/guestfish-actions.pod:1364
21406 #: ../fish/guestfish-actions.pod:1366
21414 #: ../fish/guestfish-actions.pod:1373
21415 msgid "get-recovery-proc"
21419 #: ../fish/guestfish-actions.pod:1375
21422 " get-recovery-proc\n"
21427 #: ../fish/guestfish-actions.pod:1379
21428 msgid "get-selinux"
21432 #: ../fish/guestfish-actions.pod:1381
21440 #: ../fish/guestfish-actions.pod:1383
21442 "This returns the current setting of the selinux flag which is passed to the "
21443 "appliance at boot time. See L</set-selinux>."
21447 #: ../fish/guestfish-actions.pod:1389
21452 #: ../fish/guestfish-actions.pod:1391
21460 #: ../fish/guestfish-actions.pod:1398
21465 #: ../fish/guestfish-actions.pod:1400
21473 #: ../fish/guestfish-actions.pod:1404
21478 #: ../fish/guestfish-actions.pod:1406
21486 #: ../fish/guestfish-actions.pod:1408
21488 "Return the current umask. By default the umask is C<022> unless it has been "
21489 "set by calling L</umask>."
21493 #: ../fish/guestfish-actions.pod:1411
21494 msgid "get-verbose"
21498 #: ../fish/guestfish-actions.pod:1413
21506 #: ../fish/guestfish-actions.pod:1417
21511 #: ../fish/guestfish-actions.pod:1419
21519 #: ../fish/guestfish-actions.pod:1423
21520 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
21524 #: ../fish/guestfish-actions.pod:1426
21529 #: ../fish/guestfish-actions.pod:1428
21532 " getxattr path name\n"
21537 #: ../fish/guestfish-actions.pod:1430
21539 "Get a single extended attribute from file C<path> named C<name>. This call "
21540 "follows symlinks. If you want to lookup an extended attribute for the "
21541 "symlink itself, use L</lgetxattr>."
21545 #: ../fish/guestfish-actions.pod:1434 ../fish/guestfish-actions.pod:2261
21547 "Normally it is better to get all extended attributes from a file in one go "
21548 "by calling L</getxattrs>. However some Linux filesystem implementations are "
21549 "buggy and do not provide a way to list out attributes. For these "
21550 "filesystems (notably ntfs-3g) you have to know the names of the extended "
21551 "attributes you want in advance and call this function."
21555 #: ../fish/guestfish-actions.pod:1444
21556 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
21560 #: ../fish/guestfish-actions.pod:1446
21565 #: ../fish/guestfish-actions.pod:1448
21568 " getxattrs path\n"
21573 #: ../fish/guestfish-actions.pod:1456
21574 msgid "See also: L</lgetxattrs>, L<attr(5)>."
21578 #: ../fish/guestfish-actions.pod:1458
21579 msgid "glob-expand"
21583 #: ../fish/guestfish-actions.pod:1460
21586 " glob-expand pattern\n"
21591 #: ../fish/guestfish-actions.pod:1473
21596 #: ../fish/guestfish-actions.pod:1475
21599 " grep regex path\n"
21604 #: ../fish/guestfish-actions.pod:1483
21609 #: ../fish/guestfish-actions.pod:1485
21612 " grepi regex path\n"
21617 #: ../fish/guestfish-actions.pod:1493
21618 msgid "grub-install"
21622 #: ../fish/guestfish-actions.pod:1495
21625 " grub-install root device\n"
21630 #: ../fish/guestfish-actions.pod:1511
21635 #: ../fish/guestfish-actions.pod:1513
21643 #: ../fish/guestfish-actions.pod:1521
21648 #: ../fish/guestfish-actions.pod:1523
21651 " head-n nrlines path\n"
21656 #: ../fish/guestfish-actions.pod:1536
21661 #: ../fish/guestfish-actions.pod:1538
21669 #: ../fish/guestfish-actions.pod:1546
21674 #: ../fish/guestfish-actions.pod:1548
21677 " initrd-cat initrdpath filename\n"
21682 #: ../fish/guestfish-actions.pod:1560
21683 msgid "See also L</initrd-list>."
21687 #: ../fish/guestfish-actions.pod:1565
21688 msgid "initrd-list"
21692 #: ../fish/guestfish-actions.pod:1567
21695 " initrd-list path\n"
21700 #: ../fish/guestfish-actions.pod:1579
21701 msgid "inotify-add-watch"
21705 #: ../fish/guestfish-actions.pod:1581
21708 " inotify-add-watch path mask\n"
21713 #: ../fish/guestfish-actions.pod:1593
21714 msgid "inotify-close"
21718 #: ../fish/guestfish-actions.pod:1595
21726 #: ../fish/guestfish-actions.pod:1601
21727 msgid "inotify-files"
21731 #: ../fish/guestfish-actions.pod:1603
21739 #: ../fish/guestfish-actions.pod:1605
21741 "This function is a helpful wrapper around L</inotify-read> which just "
21742 "returns a list of pathnames of objects that were touched. The returned "
21743 "pathnames are sorted and deduplicated."
21747 #: ../fish/guestfish-actions.pod:1609
21748 msgid "inotify-init"
21752 #: ../fish/guestfish-actions.pod:1611
21755 " inotify-init maxevents\n"
21760 #: ../fish/guestfish-actions.pod:1617
21762 "C<maxevents> is the maximum number of events which will be queued up between "
21763 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21764 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21765 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21766 "but records the fact that it threw them away by setting a flag "
21767 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21771 #: ../fish/guestfish-actions.pod:1627
21773 "Before any events are generated, you have to add some watches to the "
21774 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21775 "L</inotify-watch-all>."
21779 #: ../fish/guestfish-actions.pod:1633
21781 "Queued up events should be read periodically by calling L</inotify-read> (or "
21782 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21783 "If you don't read the events out often enough then you risk the internal "
21784 "queue overflowing."
21788 #: ../fish/guestfish-actions.pod:1640
21790 "The handle should be closed after use by calling L</inotify-close>. This "
21791 "also removes any watches automatically."
21795 #: ../fish/guestfish-actions.pod:1649
21796 msgid "inotify-read"
21800 #: ../fish/guestfish-actions.pod:1651
21808 #: ../fish/guestfish-actions.pod:1664
21809 msgid "inotify-rm-watch"
21813 #: ../fish/guestfish-actions.pod:1666
21816 " inotify-rm-watch wd\n"
21821 #: ../fish/guestfish-actions.pod:1668
21822 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21826 #: ../fish/guestfish-actions.pod:1671
21827 msgid "inspect-get-arch"
21831 #: ../fish/guestfish-actions.pod:1673
21834 " inspect-get-arch root\n"
21839 #: ../fish/guestfish-actions.pod:1675 ../fish/guestfish-actions.pod:1691 ../fish/guestfish-actions.pod:1765 ../fish/guestfish-actions.pod:1783 ../fish/guestfish-actions.pod:1798 ../fish/guestfish-actions.pod:1819 ../fish/guestfish-actions.pod:1834 ../fish/guestfish-actions.pod:1857 ../fish/guestfish-actions.pod:1879 ../fish/guestfish-actions.pod:1903 ../fish/guestfish-actions.pod:1933 ../fish/guestfish-actions.pod:1968 ../fish/guestfish-actions.pod:1984
21841 "This function should only be called with a root device string as returned by "
21846 #: ../fish/guestfish-actions.pod:1678
21848 "This returns the architecture of the inspected operating system. The "
21849 "possible return values are listed under L</file-architecture>."
21853 #: ../fish/guestfish-actions.pod:1687
21854 msgid "inspect-get-distro"
21858 #: ../fish/guestfish-actions.pod:1689
21861 " inspect-get-distro root\n"
21866 #: ../fish/guestfish-actions.pod:1761
21867 msgid "inspect-get-filesystems"
21871 #: ../fish/guestfish-actions.pod:1763
21874 " inspect-get-filesystems root\n"
21879 #: ../fish/guestfish-actions.pod:1776
21881 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
21882 "L</inspect-get-mountpoints>."
21886 #: ../fish/guestfish-actions.pod:1779
21887 msgid "inspect-get-hostname"
21891 #: ../fish/guestfish-actions.pod:1781
21894 " inspect-get-hostname root\n"
21899 #: ../fish/guestfish-actions.pod:1794
21900 msgid "inspect-get-major-version"
21904 #: ../fish/guestfish-actions.pod:1796
21907 " inspect-get-major-version root\n"
21912 #: ../fish/guestfish-actions.pod:1815
21913 msgid "inspect-get-minor-version"
21917 #: ../fish/guestfish-actions.pod:1817
21920 " inspect-get-minor-version root\n"
21925 #: ../fish/guestfish-actions.pod:1827
21927 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
21928 "L</inspect-get-major-version>."
21932 #: ../fish/guestfish-actions.pod:1830
21933 msgid "inspect-get-mountpoints"
21937 #: ../fish/guestfish-actions.pod:1832
21940 " inspect-get-mountpoints root\n"
21945 #: ../fish/guestfish-actions.pod:1850
21947 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
21948 "L</inspect-get-filesystems>."
21952 #: ../fish/guestfish-actions.pod:1853
21953 msgid "inspect-get-package-format"
21957 #: ../fish/guestfish-actions.pod:1855
21960 " inspect-get-package-format root\n"
21965 #: ../fish/guestfish-actions.pod:1860
21967 "This function and L</inspect-get-package-management> return the package "
21968 "format and package management tool used by the inspected operating system. "
21969 "For example for Fedora these functions would return C<rpm> (package format) "
21970 "and C<yum> (package management)."
21974 #: ../fish/guestfish-actions.pod:1875
21975 msgid "inspect-get-package-management"
21979 #: ../fish/guestfish-actions.pod:1877
21982 " inspect-get-package-management root\n"
21987 #: ../fish/guestfish-actions.pod:1882
21989 "L</inspect-get-package-format> and this function return the package format "
21990 "and package management tool used by the inspected operating system. For "
21991 "example for Fedora these functions would return C<rpm> (package format) and "
21992 "C<yum> (package management)."
21996 #: ../fish/guestfish-actions.pod:1899
21997 msgid "inspect-get-product-name"
22001 #: ../fish/guestfish-actions.pod:1901
22004 " inspect-get-product-name root\n"
22009 #: ../fish/guestfish-actions.pod:1916
22010 msgid "inspect-get-roots"
22014 #: ../fish/guestfish-actions.pod:1918
22017 " inspect-get-roots\n"
22022 #: ../fish/guestfish-actions.pod:1920
22024 "This function is a convenient way to get the list of root devices, as "
22025 "returned from a previous call to L</inspect-os>, but without redoing the "
22026 "whole inspection process."
22030 #: ../fish/guestfish-actions.pod:1924
22032 "This returns an empty list if either no root devices were found or the "
22033 "caller has not called L</inspect-os>."
22037 #: ../fish/guestfish-actions.pod:1929
22038 msgid "inspect-get-type"
22042 #: ../fish/guestfish-actions.pod:1931
22045 " inspect-get-type root\n"
22050 #: ../fish/guestfish-actions.pod:1964
22051 msgid "inspect-get-windows-systemroot"
22055 #: ../fish/guestfish-actions.pod:1966
22058 " inspect-get-windows-systemroot root\n"
22063 #: ../fish/guestfish-actions.pod:1980
22064 msgid "inspect-list-applications"
22068 #: ../fish/guestfish-actions.pod:1982
22071 " inspect-list-applications root\n"
22076 #: ../fish/guestfish-actions.pod:1989
22078 "I<Note:> This call works differently from other parts of the inspection "
22079 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
22080 "then mount up the disks, before calling this. Listing applications is a "
22081 "significantly more difficult operation which requires access to the full "
22082 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
22083 "are just returning data cached in the libguestfs handle, this call actually "
22084 "reads parts of the mounted filesystems during the call."
22088 #: ../fish/guestfish-actions.pod:2079
22093 #: ../fish/guestfish-actions.pod:2081
22101 #: ../fish/guestfish-actions.pod:2096
22103 "You can pass the root string(s) returned to other L</inspect-get-*> "
22104 "functions in order to query further information about each operating system, "
22105 "such as the name and version."
22109 #: ../fish/guestfish-actions.pod:2101
22111 "This function uses other libguestfs features such as L</mount-ro> and "
22112 "L</umount-all> in order to mount and unmount filesystems and look at the "
22113 "contents. This should be called with no disks currently mounted. The "
22114 "function may also use Augeas, so any existing Augeas handle will be closed."
22118 #: ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2289 ../fish/guestfish-actions.pod:2335
22119 msgid "See also L</list-filesystems>."
22123 #: ../fish/guestfish-actions.pod:2115
22124 msgid "is-blockdev"
22128 #: ../fish/guestfish-actions.pod:2117
22131 " is-blockdev path\n"
22136 #: ../fish/guestfish-actions.pod:2122 ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2159 ../fish/guestfish-actions.pod:2168 ../fish/guestfish-actions.pod:2178 ../fish/guestfish-actions.pod:2212 ../fish/guestfish-actions.pod:2221
22137 msgid "See also L</stat>."
22141 #: ../fish/guestfish-actions.pod:2124
22146 #: ../fish/guestfish-actions.pod:2126
22154 #: ../fish/guestfish-actions.pod:2133
22159 #: ../fish/guestfish-actions.pod:2135
22162 " is-chardev path\n"
22167 #: ../fish/guestfish-actions.pod:2142
22172 #: ../fish/guestfish-actions.pod:2144
22180 #: ../fish/guestfish-actions.pod:2151
22185 #: ../fish/guestfish-actions.pod:2153
22193 #: ../fish/guestfish-actions.pod:2161
22198 #: ../fish/guestfish-actions.pod:2163
22206 #: ../fish/guestfish-actions.pod:2170
22211 #: ../fish/guestfish-actions.pod:2172
22219 #: ../fish/guestfish-actions.pod:2180
22220 msgid "is-launching"
22224 #: ../fish/guestfish-actions.pod:2182
22232 #: ../fish/guestfish-actions.pod:2189
22237 #: ../fish/guestfish-actions.pod:2191
22245 #: ../fish/guestfish-actions.pod:2196
22250 #: ../fish/guestfish-actions.pod:2198
22258 #: ../fish/guestfish-actions.pod:2205
22263 #: ../fish/guestfish-actions.pod:2207
22266 " is-socket path\n"
22271 #: ../fish/guestfish-actions.pod:2214
22276 #: ../fish/guestfish-actions.pod:2216
22279 " is-symlink path\n"
22284 #: ../fish/guestfish-actions.pod:2223
22285 msgid "kill-subprocess"
22289 #: ../fish/guestfish-actions.pod:2225
22292 " kill-subprocess\n"
22297 #: ../fish/guestfish-actions.pod:2229
22302 #: ../fish/guestfish-actions.pod:2231
22307 #: ../fish/guestfish-actions.pod:2233
22315 #: ../fish/guestfish-actions.pod:2241
22320 #: ../fish/guestfish-actions.pod:2243
22323 " lchown owner group path\n"
22328 #: ../fish/guestfish-actions.pod:2245
22330 "Change the file owner to C<owner> and group to C<group>. This is like "
22331 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
22336 #: ../fish/guestfish-actions.pod:2253
22341 #: ../fish/guestfish-actions.pod:2255
22344 " lgetxattr path name\n"
22349 #: ../fish/guestfish-actions.pod:2271
22350 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
22354 #: ../fish/guestfish-actions.pod:2273
22359 #: ../fish/guestfish-actions.pod:2275
22362 " lgetxattrs path\n"
22367 #: ../fish/guestfish-actions.pod:2277
22369 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
22370 "it returns the extended attributes of the link itself."
22374 #: ../fish/guestfish-actions.pod:2281
22375 msgid "list-devices"
22379 #: ../fish/guestfish-actions.pod:2283
22387 #: ../fish/guestfish-actions.pod:2291
22388 msgid "list-filesystems"
22392 #: ../fish/guestfish-actions.pod:2293
22395 " list-filesystems\n"
22400 #: ../fish/guestfish-actions.pod:2312
22402 "This command runs other libguestfs commands, which might include L</mount> "
22403 "and L</umount>, and therefore you should use this soon after launch and only "
22404 "when nothing is mounted."
22408 #: ../fish/guestfish-actions.pod:2316
22410 "Not all of the filesystems returned will be mountable. In particular, swap "
22411 "partitions are returned in the list. Also this command does not check that "
22412 "each filesystem found is valid and mountable, and some filesystems might be "
22413 "mountable but require special options. Filesystems may not all belong to a "
22414 "single logical operating system (use L</inspect-os> to look for OSes)."
22418 #: ../fish/guestfish-actions.pod:2324
22419 msgid "list-partitions"
22423 #: ../fish/guestfish-actions.pod:2326
22426 " list-partitions\n"
22431 #: ../fish/guestfish-actions.pod:2332
22433 "This does not return logical volumes. For that you will need to call "
22438 #: ../fish/guestfish-actions.pod:2337
22443 #: ../fish/guestfish-actions.pod:2339
22451 #: ../fish/guestfish-actions.pod:2347
22456 #: ../fish/guestfish-actions.pod:2349
22459 " ln target linkname\n"
22464 #: ../fish/guestfish-actions.pod:2353
22469 #: ../fish/guestfish-actions.pod:2355
22472 " ln-f target linkname\n"
22477 #: ../fish/guestfish-actions.pod:2360
22482 #: ../fish/guestfish-actions.pod:2362
22485 " ln-s target linkname\n"
22490 #: ../fish/guestfish-actions.pod:2366
22495 #: ../fish/guestfish-actions.pod:2368
22498 " ln-sf target linkname\n"
22503 #: ../fish/guestfish-actions.pod:2373
22504 msgid "lremovexattr"
22508 #: ../fish/guestfish-actions.pod:2375
22511 " lremovexattr xattr path\n"
22516 #: ../fish/guestfish-actions.pod:2377
22518 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
22519 "it removes an extended attribute of the link itself."
22523 #: ../fish/guestfish-actions.pod:2381
22528 #: ../fish/guestfish-actions.pod:2383
22536 #: ../fish/guestfish-actions.pod:2389
22538 "This command is mostly useful for interactive sessions. Programs should "
22539 "probably use L</readdir> instead."
22543 #: ../fish/guestfish-actions.pod:2392
22548 #: ../fish/guestfish-actions.pod:2394
22551 " lsetxattr xattr val vallen path\n"
22556 #: ../fish/guestfish-actions.pod:2396
22558 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
22559 "sets an extended attribute of the link itself."
22563 #: ../fish/guestfish-actions.pod:2400
22568 #: ../fish/guestfish-actions.pod:2402
22576 #: ../fish/guestfish-actions.pod:2406
22578 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
22579 "the link is stat-ed, not the file it refers to."
22583 #: ../fish/guestfish-actions.pod:2412
22588 #: ../fish/guestfish-actions.pod:2414
22591 " lstatlist path 'names ...'\n"
22596 #: ../fish/guestfish-actions.pod:2416
22598 "This call allows you to perform the L</lstat> operation on multiple files, "
22599 "where all files are in the directory C<path>. C<names> is the list of files "
22600 "from this directory."
22604 #: ../fish/guestfish-actions.pod:2425
22606 "This call is intended for programs that want to efficiently list a directory "
22607 "contents without making many round-trips. See also L</lxattrlist> for a "
22608 "similarly efficient call for getting extended attributes. Very long "
22609 "directory listings might cause the protocol message size to be exceeded, "
22610 "causing this call to fail. The caller must split up such requests into "
22611 "smaller groups of names."
22615 #: ../fish/guestfish-actions.pod:2433
22616 msgid "luks-add-key"
22620 #: ../fish/guestfish-actions.pod:2435
22623 " luks-add-key device keyslot\n"
22628 #: ../fish/guestfish-actions.pod:2442
22630 "Note that if C<keyslot> already contains a key, then this command will "
22631 "fail. You have to use L</luks-kill-slot> first to remove that key."
22635 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2468 ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2495 ../fish/guestfish-actions.pod:2518 ../fish/guestfish-actions.pod:2528
22637 "This command has one or more key or passphrase parameters. Guestfish will "
22638 "prompt for these separately."
22642 #: ../fish/guestfish-actions.pod:2449
22647 #: ../fish/guestfish-actions.pod:2451
22650 " luks-close device\n"
22655 #: ../fish/guestfish-actions.pod:2453
22657 "This closes a LUKS device that was created earlier by L</luks-open> or "
22658 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
22659 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
22660 "underlying block device."
22664 #: ../fish/guestfish-actions.pod:2459
22665 msgid "luks-format"
22669 #: ../fish/guestfish-actions.pod:2461
22672 " luks-format device keyslot\n"
22677 #: ../fish/guestfish-actions.pod:2474
22678 msgid "luks-format-cipher"
22682 #: ../fish/guestfish-actions.pod:2476
22685 " luks-format-cipher device keyslot cipher\n"
22690 #: ../fish/guestfish-actions.pod:2478
22692 "This command is the same as L</luks-format> but it also allows you to set "
22693 "the C<cipher> used."
22697 #: ../fish/guestfish-actions.pod:2487
22698 msgid "luks-kill-slot"
22702 #: ../fish/guestfish-actions.pod:2489
22705 " luks-kill-slot device keyslot\n"
22710 #: ../fish/guestfish-actions.pod:2498
22715 #: ../fish/guestfish-actions.pod:2500
22718 " luks-open device mapname\n"
22723 #: ../fish/guestfish-actions.pod:2514
22725 "If this block device contains LVM volume groups, then calling L</vgscan> "
22726 "followed by L</vg-activate-all> will make them visible."
22730 #: ../fish/guestfish-actions.pod:2521
22731 msgid "luks-open-ro"
22735 #: ../fish/guestfish-actions.pod:2523
22738 " luks-open-ro device mapname\n"
22743 #: ../fish/guestfish-actions.pod:2525
22745 "This is the same as L</luks-open> except that a read-only mapping is "
22750 #: ../fish/guestfish-actions.pod:2531
22755 #: ../fish/guestfish-actions.pod:2533
22758 " lvcreate logvol volgroup mbytes\n"
22763 #: ../fish/guestfish-actions.pod:2538
22764 msgid "lvm-canonical-lv-name"
22768 #: ../fish/guestfish-actions.pod:2540
22771 " lvm-canonical-lv-name lvname\n"
22776 #: ../fish/guestfish-actions.pod:2549
22777 msgid "See also L</is-lv>."
22781 #: ../fish/guestfish-actions.pod:2551
22782 msgid "lvm-clear-filter"
22786 #: ../fish/guestfish-actions.pod:2553
22789 " lvm-clear-filter\n"
22794 #: ../fish/guestfish-actions.pod:2555
22796 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22801 #: ../fish/guestfish-actions.pod:2561
22802 msgid "lvm-remove-all"
22806 #: ../fish/guestfish-actions.pod:2563
22809 " lvm-remove-all\n"
22814 #: ../fish/guestfish-actions.pod:2571
22815 msgid "lvm-set-filter"
22819 #: ../fish/guestfish-actions.pod:2573
22822 " lvm-set-filter 'devices ...'\n"
22827 #: ../fish/guestfish-actions.pod:2598
22832 #: ../fish/guestfish-actions.pod:2600
22835 " lvremove device\n"
22840 #: ../fish/guestfish-actions.pod:2608
22845 #: ../fish/guestfish-actions.pod:2610
22848 " lvrename logvol newlogvol\n"
22853 #: ../fish/guestfish-actions.pod:2614
22858 #: ../fish/guestfish-actions.pod:2616
22861 " lvresize device mbytes\n"
22866 #: ../fish/guestfish-actions.pod:2622
22867 msgid "lvresize-free"
22871 #: ../fish/guestfish-actions.pod:2624
22874 " lvresize-free lv percent\n"
22879 #: ../fish/guestfish-actions.pod:2632
22884 #: ../fish/guestfish-actions.pod:2634
22892 #: ../fish/guestfish-actions.pod:2642
22893 msgid "See also L</lvs-full>, L</list-filesystems>."
22897 #: ../fish/guestfish-actions.pod:2644
22902 #: ../fish/guestfish-actions.pod:2646
22910 #: ../fish/guestfish-actions.pod:2651
22915 #: ../fish/guestfish-actions.pod:2653
22923 #: ../fish/guestfish-actions.pod:2657
22928 #: ../fish/guestfish-actions.pod:2659
22931 " lxattrlist path 'names ...'\n"
22936 #: ../fish/guestfish-actions.pod:2675
22938 "This call is intended for programs that want to efficiently list a directory "
22939 "contents without making many round-trips. See also L</lstatlist> for a "
22940 "similarly efficient call for getting standard stats. Very long directory "
22941 "listings might cause the protocol message size to be exceeded, causing this "
22942 "call to fail. The caller must split up such requests into smaller groups of "
22947 #: ../fish/guestfish-actions.pod:2683
22952 #: ../fish/guestfish-actions.pod:2685
22960 #: ../fish/guestfish-actions.pod:2689
22965 #: ../fish/guestfish-actions.pod:2691
22968 " mkdir-mode path mode\n"
22973 #: ../fish/guestfish-actions.pod:2700
22974 msgid "See also L</mkdir>, L</umask>"
22978 #: ../fish/guestfish-actions.pod:2702
22983 #: ../fish/guestfish-actions.pod:2704
22991 #: ../fish/guestfish-actions.pod:2709
22996 #: ../fish/guestfish-actions.pod:2711
22999 " mkdtemp template\n"
23004 #: ../fish/guestfish-actions.pod:2732
23009 #: ../fish/guestfish-actions.pod:2734
23012 " mke2fs-J fstype blocksize device journal\n"
23017 #: ../fish/guestfish-actions.pod:2742
23018 msgid "See also L</mke2journal>."
23022 #: ../fish/guestfish-actions.pod:2744
23027 #: ../fish/guestfish-actions.pod:2746
23030 " mke2fs-JL fstype blocksize device label\n"
23035 #: ../fish/guestfish-actions.pod:2751
23036 msgid "See also L</mke2journal-L>."
23040 #: ../fish/guestfish-actions.pod:2753
23045 #: ../fish/guestfish-actions.pod:2755
23048 " mke2fs-JU fstype blocksize device uuid\n"
23053 #: ../fish/guestfish-actions.pod:2760
23054 msgid "See also L</mke2journal-U>."
23058 #: ../fish/guestfish-actions.pod:2762
23059 msgid "mke2journal"
23063 #: ../fish/guestfish-actions.pod:2764
23066 " mke2journal blocksize device\n"
23071 #: ../fish/guestfish-actions.pod:2771
23072 msgid "mke2journal-L"
23076 #: ../fish/guestfish-actions.pod:2773
23079 " mke2journal-L blocksize label device\n"
23084 #: ../fish/guestfish-actions.pod:2777
23085 msgid "mke2journal-U"
23089 #: ../fish/guestfish-actions.pod:2779
23092 " mke2journal-U blocksize uuid device\n"
23097 #: ../fish/guestfish-actions.pod:2783
23102 #: ../fish/guestfish-actions.pod:2785
23105 " mkfifo mode path\n"
23110 #: ../fish/guestfish-actions.pod:2787
23112 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
23113 "is just a convenient wrapper around L</mknod>."
23117 #: ../fish/guestfish-actions.pod:2793
23122 #: ../fish/guestfish-actions.pod:2795
23125 " mkfs fstype device\n"
23130 #: ../fish/guestfish-actions.pod:2801
23135 #: ../fish/guestfish-actions.pod:2803
23138 " mkfs-b fstype blocksize device\n"
23143 #: ../fish/guestfish-actions.pod:2805
23145 "This call is similar to L</mkfs>, but it allows you to control the block "
23146 "size of the resulting filesystem. Supported block sizes depend on the "
23147 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
23151 #: ../fish/guestfish-actions.pod:2820
23156 #: ../fish/guestfish-actions.pod:2822
23159 " mkfs-opts fstype device [blocksize:..]\n"
23164 #: ../fish/guestfish-actions.pod:2844
23165 msgid "mkmountpoint"
23169 #: ../fish/guestfish-actions.pod:2846
23172 " mkmountpoint exemptpath\n"
23177 #: ../fish/guestfish-actions.pod:2848
23179 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
23180 "to create extra mountpoints before mounting the first filesystem."
23184 #: ../fish/guestfish-actions.pod:2872
23186 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
23187 "unexpected errors if you try to mix these calls. It is safest to manually "
23188 "unmount filesystems and remove mountpoints after use."
23192 #: ../fish/guestfish-actions.pod:2876
23194 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
23195 "for this to work for manual mountpoints, you must ensure that the innermost "
23196 "mountpoints have the longest pathnames, as in the example code above."
23200 #: ../fish/guestfish-actions.pod:2883
23202 "Autosync [see L</set-autosync>, this is set by default on handles] means "
23203 "that L</umount-all> is called when the handle is closed which can also "
23204 "trigger these issues."
23208 #: ../fish/guestfish-actions.pod:2887
23213 #: ../fish/guestfish-actions.pod:2889
23216 " mknod mode devmajor devminor path\n"
23221 #: ../fish/guestfish-actions.pod:2899
23223 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
23224 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
23225 "regular file). These constants are available in the standard Linux header "
23226 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
23227 "wrappers around this command which bitwise OR in the appropriate constant "
23232 #: ../fish/guestfish-actions.pod:2909
23237 #: ../fish/guestfish-actions.pod:2911
23240 " mknod-b mode devmajor devminor path\n"
23245 #: ../fish/guestfish-actions.pod:2913
23247 "This call creates a block device node called C<path> with mode C<mode> and "
23248 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23249 "wrapper around L</mknod>."
23253 #: ../fish/guestfish-actions.pod:2919
23258 #: ../fish/guestfish-actions.pod:2921
23261 " mknod-c mode devmajor devminor path\n"
23266 #: ../fish/guestfish-actions.pod:2923
23268 "This call creates a char device node called C<path> with mode C<mode> and "
23269 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23270 "wrapper around L</mknod>."
23274 #: ../fish/guestfish-actions.pod:2929
23279 #: ../fish/guestfish-actions.pod:2931
23287 #: ../fish/guestfish-actions.pod:2935
23292 #: ../fish/guestfish-actions.pod:2937
23295 " mkswap-L label device\n"
23300 #: ../fish/guestfish-actions.pod:2945
23305 #: ../fish/guestfish-actions.pod:2947
23308 " mkswap-U uuid device\n"
23313 #: ../fish/guestfish-actions.pod:2951
23314 msgid "mkswap-file"
23318 #: ../fish/guestfish-actions.pod:2953
23321 " mkswap-file path\n"
23326 #: ../fish/guestfish-actions.pod:2957
23328 "This command just writes a swap file signature to an existing file. To "
23329 "create the file itself, use something like L</fallocate>."
23333 #: ../fish/guestfish-actions.pod:2960
23338 #: ../fish/guestfish-actions.pod:2962
23341 " modprobe modulename\n"
23346 #: ../fish/guestfish-actions.pod:2969
23351 #: ../fish/guestfish-actions.pod:2971
23354 " mount device mountpoint\n"
23359 #: ../fish/guestfish-actions.pod:2987
23361 "B<Important note:> When you use this call, the filesystem options C<sync> "
23362 "and C<noatime> are set implicitly. This was originally done because we "
23363 "thought it would improve reliability, but it turns out that I<-o sync> has a "
23364 "very large negative performance impact and negligible effect on "
23365 "reliability. Therefore we recommend that you avoid using L</mount> in any "
23366 "code that needs performance, and instead use L</mount-options> (use an empty "
23367 "string for the first parameter if you don't want any options)."
23371 #: ../fish/guestfish-actions.pod:2997
23376 #: ../fish/guestfish-actions.pod:2999
23379 " mount-loop file mountpoint\n"
23384 #: ../fish/guestfish-actions.pod:3005
23385 msgid "mount-options"
23389 #: ../fish/guestfish-actions.pod:3007
23392 " mount-options options device mountpoint\n"
23397 #: ../fish/guestfish-actions.pod:3009
23399 "This is the same as the L</mount> command, but it allows you to set the "
23400 "mount options as for the L<mount(8)> I<-o> flag."
23404 #: ../fish/guestfish-actions.pod:3017
23409 #: ../fish/guestfish-actions.pod:3019
23412 " mount-ro device mountpoint\n"
23417 #: ../fish/guestfish-actions.pod:3021
23419 "This is the same as the L</mount> command, but it mounts the filesystem with "
23420 "the read-only (I<-o ro>) flag."
23424 #: ../fish/guestfish-actions.pod:3024
23429 #: ../fish/guestfish-actions.pod:3026
23432 " mount-vfs options vfstype device mountpoint\n"
23437 #: ../fish/guestfish-actions.pod:3028
23439 "This is the same as the L</mount> command, but it allows you to set both the "
23440 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
23444 #: ../fish/guestfish-actions.pod:3032
23445 msgid "mountpoints"
23449 #: ../fish/guestfish-actions.pod:3034
23457 #: ../fish/guestfish-actions.pod:3036
23459 "This call is similar to L</mounts>. That call returns a list of devices. "
23460 "This one returns a hash table (map) of device name to directory where the "
23461 "device is mounted."
23465 #: ../fish/guestfish-actions.pod:3040
23470 #: ../fish/guestfish-actions.pod:3042
23478 #: ../fish/guestfish-actions.pod:3049
23479 msgid "See also: L</mountpoints>"
23483 #: ../fish/guestfish-actions.pod:3051
23488 #: ../fish/guestfish-actions.pod:3053
23496 #: ../fish/guestfish-actions.pod:3058
23497 msgid "ntfs-3g-probe"
23501 #: ../fish/guestfish-actions.pod:3060
23504 " ntfs-3g-probe true|false device\n"
23509 #: ../fish/guestfish-actions.pod:3074
23514 #: ../fish/guestfish-actions.pod:3076
23517 " ntfsresize device\n"
23522 #: ../fish/guestfish-actions.pod:3082
23523 msgid "ntfsresize-size"
23527 #: ../fish/guestfish-actions.pod:3084
23530 " ntfsresize-size device size\n"
23535 #: ../fish/guestfish-actions.pod:3086
23537 "This command is the same as L</ntfsresize> except that it allows you to "
23538 "specify the new size (in bytes) explicitly."
23542 #: ../fish/guestfish-actions.pod:3089
23547 #: ../fish/guestfish-actions.pod:3091
23550 " part-add device prlogex startsect endsect\n"
23555 #: ../fish/guestfish-actions.pod:3093
23557 "This command adds a partition to C<device>. If there is no partition table "
23558 "on the device, call L</part-init> first."
23562 #: ../fish/guestfish-actions.pod:3105
23564 "Creating a partition which covers the whole disk is not so easy. Use "
23565 "L</part-disk> to do that."
23569 #: ../fish/guestfish-actions.pod:3108
23574 #: ../fish/guestfish-actions.pod:3110
23577 " part-del device partnum\n"
23582 #: ../fish/guestfish-actions.pod:3118
23587 #: ../fish/guestfish-actions.pod:3120
23590 " part-disk device parttype\n"
23595 #: ../fish/guestfish-actions.pod:3122
23597 "This command is simply a combination of L</part-init> followed by "
23598 "L</part-add> to create a single primary partition covering the whole disk."
23602 #: ../fish/guestfish-actions.pod:3126
23604 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
23605 "possible values are described in L</part-init>."
23609 #: ../fish/guestfish-actions.pod:3132
23610 msgid "part-get-bootable"
23614 #: ../fish/guestfish-actions.pod:3134
23617 " part-get-bootable device partnum\n"
23622 #: ../fish/guestfish-actions.pod:3139
23623 msgid "See also L</part-set-bootable>."
23627 #: ../fish/guestfish-actions.pod:3141
23628 msgid "part-get-mbr-id"
23632 #: ../fish/guestfish-actions.pod:3143
23635 " part-get-mbr-id device partnum\n"
23640 #: ../fish/guestfish-actions.pod:3148 ../fish/guestfish-actions.pod:3286
23642 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
23643 "undefined results for other partition table types (see "
23644 "L</part-get-parttype>)."
23648 #: ../fish/guestfish-actions.pod:3152
23649 msgid "part-get-parttype"
23653 #: ../fish/guestfish-actions.pod:3154
23656 " part-get-parttype device\n"
23661 #: ../fish/guestfish-actions.pod:3159
23663 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
23664 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
23665 "possible, although unusual. See L</part-init> for a full list."
23669 #: ../fish/guestfish-actions.pod:3164
23674 #: ../fish/guestfish-actions.pod:3166
23677 " part-init device parttype\n"
23682 #: ../fish/guestfish-actions.pod:3172
23684 "Initially there are no partitions. Following this, you should call "
23685 "L</part-add> for each partition required."
23689 #: ../fish/guestfish-actions.pod:3235
23694 #: ../fish/guestfish-actions.pod:3237
23697 " part-list device\n"
23702 #: ../fish/guestfish-actions.pod:3252
23704 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23705 "the device's sector size, see L</blockdev-getss>."
23709 #: ../fish/guestfish-actions.pod:3265
23710 msgid "part-set-bootable"
23714 #: ../fish/guestfish-actions.pod:3267
23717 " part-set-bootable device partnum true|false\n"
23722 #: ../fish/guestfish-actions.pod:3276
23723 msgid "part-set-mbr-id"
23727 #: ../fish/guestfish-actions.pod:3278
23730 " part-set-mbr-id device partnum idbyte\n"
23735 #: ../fish/guestfish-actions.pod:3290
23736 msgid "part-set-name"
23740 #: ../fish/guestfish-actions.pod:3292
23743 " part-set-name device partnum name\n"
23748 #: ../fish/guestfish-actions.pod:3300
23749 msgid "part-to-dev"
23753 #: ../fish/guestfish-actions.pod:3302
23756 " part-to-dev partition\n"
23761 #: ../fish/guestfish-actions.pod:3308
23763 "The named partition must exist, for example as a string returned from "
23764 "L</list-partitions>."
23768 #: ../fish/guestfish-actions.pod:3311
23769 msgid "ping-daemon"
23773 #: ../fish/guestfish-actions.pod:3313
23781 #: ../fish/guestfish-actions.pod:3320
23786 #: ../fish/guestfish-actions.pod:3322
23789 " pread path count offset\n"
23794 #: ../fish/guestfish-actions.pod:3330
23795 msgid "See also L</pwrite>, L</pread-device>."
23799 #: ../fish/guestfish-actions.pod:3335
23800 msgid "pread-device"
23804 #: ../fish/guestfish-actions.pod:3337
23807 " pread-device device count offset\n"
23812 #: ../fish/guestfish-actions.pod:3345
23813 msgid "See also L</pread>."
23817 #: ../fish/guestfish-actions.pod:3350
23822 #: ../fish/guestfish-actions.pod:3352
23825 " pvcreate device\n"
23830 #: ../fish/guestfish-actions.pod:3358
23835 #: ../fish/guestfish-actions.pod:3360
23838 " pvremove device\n"
23843 #: ../fish/guestfish-actions.pod:3369
23848 #: ../fish/guestfish-actions.pod:3371
23851 " pvresize device\n"
23856 #: ../fish/guestfish-actions.pod:3376
23857 msgid "pvresize-size"
23861 #: ../fish/guestfish-actions.pod:3378
23864 " pvresize-size device size\n"
23869 #: ../fish/guestfish-actions.pod:3380
23871 "This command is the same as L</pvresize> except that it allows you to "
23872 "specify the new size (in bytes) explicitly."
23876 #: ../fish/guestfish-actions.pod:3383
23881 #: ../fish/guestfish-actions.pod:3385
23889 #: ../fish/guestfish-actions.pod:3393
23890 msgid "See also L</pvs-full>."
23894 #: ../fish/guestfish-actions.pod:3395
23899 #: ../fish/guestfish-actions.pod:3397
23907 #: ../fish/guestfish-actions.pod:3402
23912 #: ../fish/guestfish-actions.pod:3404
23920 #: ../fish/guestfish-actions.pod:3408
23925 #: ../fish/guestfish-actions.pod:3410
23928 " pwrite path content offset\n"
23933 #: ../fish/guestfish-actions.pod:3421
23934 msgid "See also L</pread>, L</pwrite-device>."
23938 #: ../fish/guestfish-actions.pod:3426
23939 msgid "pwrite-device"
23943 #: ../fish/guestfish-actions.pod:3428
23946 " pwrite-device device content offset\n"
23951 #: ../fish/guestfish-actions.pod:3438
23952 msgid "See also L</pwrite>."
23956 #: ../fish/guestfish-actions.pod:3443
23961 #: ../fish/guestfish-actions.pod:3445
23964 " read-file path\n"
23969 #: ../fish/guestfish-actions.pod:3450
23971 "Unlike L</cat>, this function can correctly handle files that contain "
23972 "embedded ASCII NUL characters. However unlike L</download>, this function "
23973 "is limited in the total size of file that can be handled."
23977 #: ../fish/guestfish-actions.pod:3458
23982 #: ../fish/guestfish-actions.pod:3460
23985 " read-lines path\n"
23990 #: ../fish/guestfish-actions.pod:3467
23992 "Note that this function cannot correctly handle binary files (specifically, "
23993 "files containing C<\\0> character which is treated as end of line). For "
23994 "those you need to use the L</read-file> function which has a more complex "
23999 #: ../fish/guestfish-actions.pod:3472
24004 #: ../fish/guestfish-actions.pod:3474
24012 #: ../fish/guestfish-actions.pod:3526
24014 "This function is primarily intended for use by programs. To get a simple "
24015 "list of names, use L</ls>. To get a printable directory for human "
24016 "consumption, use L</ll>."
24020 #: ../fish/guestfish-actions.pod:3530
24025 #: ../fish/guestfish-actions.pod:3532
24033 #: ../fish/guestfish-actions.pod:3536
24034 msgid "readlinklist"
24038 #: ../fish/guestfish-actions.pod:3538
24041 " readlinklist path 'names ...'\n"
24046 #: ../fish/guestfish-actions.pod:3562
24051 #: ../fish/guestfish-actions.pod:3564
24059 #: ../fish/guestfish-actions.pod:3569
24060 msgid "removexattr"
24064 #: ../fish/guestfish-actions.pod:3571
24067 " removexattr xattr path\n"
24072 #: ../fish/guestfish-actions.pod:3576
24073 msgid "See also: L</lremovexattr>, L<attr(5)>."
24077 #: ../fish/guestfish-actions.pod:3578
24082 #: ../fish/guestfish-actions.pod:3580
24085 " resize2fs device\n"
24090 #: ../fish/guestfish-actions.pod:3585
24092 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
24093 "before calling this command. For unknown reasons C<resize2fs> sometimes "
24094 "gives an error about this and sometimes not. In any case, it is always safe "
24095 "to call L</e2fsck-f> before calling this function."
24099 #: ../fish/guestfish-actions.pod:3591
24100 msgid "resize2fs-size"
24104 #: ../fish/guestfish-actions.pod:3593
24107 " resize2fs-size device size\n"
24112 #: ../fish/guestfish-actions.pod:3595
24114 "This command is the same as L</resize2fs> except that it allows you to "
24115 "specify the new size (in bytes) explicitly."
24119 #: ../fish/guestfish-actions.pod:3598
24124 #: ../fish/guestfish-actions.pod:3600
24132 #: ../fish/guestfish-actions.pod:3604
24137 #: ../fish/guestfish-actions.pod:3606
24145 #: ../fish/guestfish-actions.pod:3612
24150 #: ../fish/guestfish-actions.pod:3614
24158 #: ../fish/guestfish-actions.pod:3618
24159 msgid "rmmountpoint"
24163 #: ../fish/guestfish-actions.pod:3620
24166 " rmmountpoint exemptpath\n"
24171 #: ../fish/guestfish-actions.pod:3622
24173 "This calls removes a mountpoint that was previously created with "
24174 "L</mkmountpoint>. See L</mkmountpoint> for full details."
24178 #: ../fish/guestfish-actions.pod:3626
24179 msgid "scrub-device"
24183 #: ../fish/guestfish-actions.pod:3628
24186 " scrub-device device\n"
24191 #: ../fish/guestfish-actions.pod:3639
24196 #: ../fish/guestfish-actions.pod:3641
24199 " scrub-file file\n"
24204 #: ../fish/guestfish-actions.pod:3651
24205 msgid "scrub-freespace"
24209 #: ../fish/guestfish-actions.pod:3653
24212 " scrub-freespace dir\n"
24217 #: ../fish/guestfish-actions.pod:3655
24219 "This command creates the directory C<dir> and then fills it with files until "
24220 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
24221 "deletes them. The intention is to scrub any free space on the partition "
24222 "containing C<dir>."
24226 #: ../fish/guestfish-actions.pod:3664
24231 #: ../fish/guestfish-actions.pod:3666
24236 #: ../fish/guestfish-actions.pod:3668
24239 " set-append append\n"
24244 #: ../fish/guestfish-actions.pod:3679
24245 msgid "set-autosync"
24249 #: ../fish/guestfish-actions.pod:3681
24254 #: ../fish/guestfish-actions.pod:3683
24257 " set-autosync true|false\n"
24262 #: ../fish/guestfish-actions.pod:3685
24264 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
24265 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
24266 "closed (also if the program exits without closing handles)."
24270 #: ../fish/guestfish-actions.pod:3693
24275 #: ../fish/guestfish-actions.pod:3695
24280 #: ../fish/guestfish-actions.pod:3697
24283 " set-direct true|false\n"
24288 #: ../fish/guestfish-actions.pod:3703
24290 "One consequence of this is that log messages aren't caught by the library "
24291 "and handled by L</set-log-message-callback>, but go straight to stdout."
24295 #: ../fish/guestfish-actions.pod:3712
24296 msgid "set-e2label"
24300 #: ../fish/guestfish-actions.pod:3714
24303 " set-e2label device label\n"
24308 #: ../fish/guestfish-actions.pod:3720
24310 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
24311 "label on a filesystem."
24315 #: ../fish/guestfish-actions.pod:3723
24320 #: ../fish/guestfish-actions.pod:3725
24323 " set-e2uuid device uuid\n"
24328 #: ../fish/guestfish-actions.pod:3732
24330 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
24331 "UUID of a filesystem."
24335 #: ../fish/guestfish-actions.pod:3735
24336 msgid "set-memsize"
24340 #: ../fish/guestfish-actions.pod:3737
24345 #: ../fish/guestfish-actions.pod:3739
24348 " set-memsize memsize\n"
24353 #: ../fish/guestfish-actions.pod:3741
24355 "This sets the memory size in megabytes allocated to the qemu subprocess. "
24356 "This only has any effect if called before L</launch>."
24360 #: ../fish/guestfish-actions.pod:3752
24361 msgid "set-network"
24365 #: ../fish/guestfish-actions.pod:3754
24370 #: ../fish/guestfish-actions.pod:3756
24373 " set-network true|false\n"
24378 #: ../fish/guestfish-actions.pod:3764
24379 msgid "You must call this before calling L</launch>, otherwise it has no effect."
24383 #: ../fish/guestfish-actions.pod:3767
24388 #: ../fish/guestfish-actions.pod:3769
24393 #: ../fish/guestfish-actions.pod:3771
24396 " set-path searchpath\n"
24401 #: ../fish/guestfish-actions.pod:3780
24406 #: ../fish/guestfish-actions.pod:3782
24411 #: ../fish/guestfish-actions.pod:3784
24419 #: ../fish/guestfish-actions.pod:3804
24420 msgid "set-recovery-proc"
24424 #: ../fish/guestfish-actions.pod:3806
24425 msgid "recovery-proc"
24429 #: ../fish/guestfish-actions.pod:3808
24432 " set-recovery-proc true|false\n"
24437 #: ../fish/guestfish-actions.pod:3810
24439 "If this is called with the parameter C<false> then L</launch> does not "
24440 "create a recovery process. The purpose of the recovery process is to stop "
24441 "runaway qemu processes in the case where the main program aborts abruptly."
24445 #: ../fish/guestfish-actions.pod:3815
24447 "This only has any effect if called before L</launch>, and the default is "
24452 #: ../fish/guestfish-actions.pod:3824
24453 msgid "set-selinux"
24457 #: ../fish/guestfish-actions.pod:3826
24462 #: ../fish/guestfish-actions.pod:3828
24465 " set-selinux true|false\n"
24470 #: ../fish/guestfish-actions.pod:3839
24475 #: ../fish/guestfish-actions.pod:3841
24480 #: ../fish/guestfish-actions.pod:3843
24483 " set-trace true|false\n"
24488 #: ../fish/guestfish-actions.pod:3859
24489 msgid "set-verbose"
24493 #: ../fish/guestfish-actions.pod:3861
24498 #: ../fish/guestfish-actions.pod:3863
24501 " set-verbose true|false\n"
24506 #: ../fish/guestfish-actions.pod:3870
24511 #: ../fish/guestfish-actions.pod:3872
24514 " setcon context\n"
24519 #: ../fish/guestfish-actions.pod:3879
24524 #: ../fish/guestfish-actions.pod:3881
24527 " setxattr xattr val vallen path\n"
24532 #: ../fish/guestfish-actions.pod:3887
24533 msgid "See also: L</lsetxattr>, L<attr(5)>."
24537 #: ../fish/guestfish-actions.pod:3889
24542 #: ../fish/guestfish-actions.pod:3891
24545 " sfdisk device cyls heads sectors 'lines ...'\n"
24550 #: ../fish/guestfish-actions.pod:3913
24551 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
24555 #: ../fish/guestfish-actions.pod:3919
24560 #: ../fish/guestfish-actions.pod:3921
24563 " sfdiskM device 'lines ...'\n"
24568 #: ../fish/guestfish-actions.pod:3923
24570 "This is a simplified interface to the L</sfdisk> command, where partition "
24571 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
24572 "you don't need to specify the cyls, heads and sectors parameters which were "
24573 "rarely if ever used anyway."
24577 #: ../fish/guestfish-actions.pod:3929
24578 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
24582 #: ../fish/guestfish-actions.pod:3935
24587 #: ../fish/guestfish-actions.pod:3937
24590 " sfdisk-N device partnum cyls heads sectors line\n"
24595 #: ../fish/guestfish-actions.pod:3942
24597 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
24598 "cyls/heads/sectors parameters."
24602 #: ../fish/guestfish-actions.pod:3945
24603 msgid "See also: L</part-add>"
24607 #: ../fish/guestfish-actions.pod:3950
24608 msgid "sfdisk-disk-geometry"
24612 #: ../fish/guestfish-actions.pod:3952
24615 " sfdisk-disk-geometry device\n"
24620 #: ../fish/guestfish-actions.pod:3954
24622 "This displays the disk geometry of C<device> read from the partition table. "
24623 "Especially in the case where the underlying block device has been resized, "
24624 "this can be different from the kernel's idea of the geometry (see "
24625 "L</sfdisk-kernel-geometry>)."
24629 #: ../fish/guestfish-actions.pod:3962
24630 msgid "sfdisk-kernel-geometry"
24634 #: ../fish/guestfish-actions.pod:3964
24637 " sfdisk-kernel-geometry device\n"
24642 #: ../fish/guestfish-actions.pod:3971
24647 #: ../fish/guestfish-actions.pod:3973
24650 " sfdisk-l device\n"
24655 #: ../fish/guestfish-actions.pod:3979
24656 msgid "See also: L</part-list>"
24660 #: ../fish/guestfish-actions.pod:3981
24665 #: ../fish/guestfish-actions.pod:3983
24673 #: ../fish/guestfish-actions.pod:3988
24674 msgid "This is like L</command>, but passes the command to:"
24678 #: ../fish/guestfish-actions.pod:3996
24679 msgid "All the provisos about L</command> apply to this call."
24683 #: ../fish/guestfish-actions.pod:3998
24688 #: ../fish/guestfish-actions.pod:4000
24691 " sh-lines command\n"
24696 #: ../fish/guestfish-actions.pod:4002
24697 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24701 #: ../fish/guestfish-actions.pod:4005
24702 msgid "See also: L</command-lines>"
24706 #: ../fish/guestfish-actions.pod:4007
24711 #: ../fish/guestfish-actions.pod:4009
24719 #: ../fish/guestfish-actions.pod:4013
24724 #: ../fish/guestfish-actions.pod:4015
24732 #: ../fish/guestfish-actions.pod:4021
24737 #: ../fish/guestfish-actions.pod:4023
24745 #: ../fish/guestfish-actions.pod:4031
24750 #: ../fish/guestfish-actions.pod:4033
24758 #: ../fish/guestfish-actions.pod:4041
24763 #: ../fish/guestfish-actions.pod:4043
24766 " strings-e encoding path\n"
24771 #: ../fish/guestfish-actions.pod:4045
24773 "This is like the L</strings> command, but allows you to specify the encoding "
24774 "of strings that are looked for in the source file C<path>."
24778 #: ../fish/guestfish-actions.pod:4055
24780 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24781 "ISO-8859-X (this is what L</strings> uses)."
24785 #: ../fish/guestfish-actions.pod:4087
24786 msgid "swapoff-device"
24790 #: ../fish/guestfish-actions.pod:4089
24793 " swapoff-device device\n"
24798 #: ../fish/guestfish-actions.pod:4091
24800 "This command disables the libguestfs appliance swap device or partition "
24801 "named C<device>. See L</swapon-device>."
24805 #: ../fish/guestfish-actions.pod:4095
24806 msgid "swapoff-file"
24810 #: ../fish/guestfish-actions.pod:4097
24813 " swapoff-file file\n"
24818 #: ../fish/guestfish-actions.pod:4101
24819 msgid "swapoff-label"
24823 #: ../fish/guestfish-actions.pod:4103
24826 " swapoff-label label\n"
24831 #: ../fish/guestfish-actions.pod:4108
24832 msgid "swapoff-uuid"
24836 #: ../fish/guestfish-actions.pod:4110
24839 " swapoff-uuid uuid\n"
24844 #: ../fish/guestfish-actions.pod:4115
24845 msgid "swapon-device"
24849 #: ../fish/guestfish-actions.pod:4117
24852 " swapon-device device\n"
24857 #: ../fish/guestfish-actions.pod:4119
24859 "This command enables the libguestfs appliance to use the swap device or "
24860 "partition named C<device>. The increased memory is made available for all "
24861 "commands, for example those run using L</command> or L</sh>."
24865 #: ../fish/guestfish-actions.pod:4131
24866 msgid "swapon-file"
24870 #: ../fish/guestfish-actions.pod:4133
24873 " swapon-file file\n"
24878 #: ../fish/guestfish-actions.pod:4135
24879 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
24883 #: ../fish/guestfish-actions.pod:4138
24884 msgid "swapon-label"
24888 #: ../fish/guestfish-actions.pod:4140
24891 " swapon-label label\n"
24896 #: ../fish/guestfish-actions.pod:4142
24898 "This command enables swap to a labeled swap partition. See "
24899 "L</swapon-device> for other notes."
24903 #: ../fish/guestfish-actions.pod:4145
24904 msgid "swapon-uuid"
24908 #: ../fish/guestfish-actions.pod:4147
24911 " swapon-uuid uuid\n"
24916 #: ../fish/guestfish-actions.pod:4149
24918 "This command enables swap to a swap partition with the given UUID. See "
24919 "L</swapon-device> for other notes."
24923 #: ../fish/guestfish-actions.pod:4152
24928 #: ../fish/guestfish-actions.pod:4154
24936 #: ../fish/guestfish-actions.pod:4162
24941 #: ../fish/guestfish-actions.pod:4164
24949 #: ../fish/guestfish-actions.pod:4172
24954 #: ../fish/guestfish-actions.pod:4174
24957 " tail-n nrlines path\n"
24962 #: ../fish/guestfish-actions.pod:4187
24967 #: ../fish/guestfish-actions.pod:4189
24970 " tar-in (tarfile|-) directory\n"
24975 #: ../fish/guestfish-actions.pod:4194
24976 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24980 #: ../fish/guestfish-actions.pod:4199
24985 #: ../fish/guestfish-actions.pod:4201
24988 " tar-out directory (tarfile|-)\n"
24993 #: ../fish/guestfish-actions.pod:4206
24994 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24998 #: ../fish/guestfish-actions.pod:4211
25003 #: ../fish/guestfish-actions.pod:4213
25006 " tgz-in (tarball|-) directory\n"
25011 #: ../fish/guestfish-actions.pod:4218
25012 msgid "To upload an uncompressed tarball, use L</tar-in>."
25016 #: ../fish/guestfish-actions.pod:4222
25021 #: ../fish/guestfish-actions.pod:4224
25024 " tgz-out directory (tarball|-)\n"
25029 #: ../fish/guestfish-actions.pod:4229
25030 msgid "To download an uncompressed tarball, use L</tar-out>."
25034 #: ../fish/guestfish-actions.pod:4233
25039 #: ../fish/guestfish-actions.pod:4235
25047 #: ../fish/guestfish-actions.pod:4244
25052 #: ../fish/guestfish-actions.pod:4246
25060 #: ../fish/guestfish-actions.pod:4251
25061 msgid "truncate-size"
25065 #: ../fish/guestfish-actions.pod:4253
25068 " truncate-size path size\n"
25073 #: ../fish/guestfish-actions.pod:4258
25075 "If the current file size is less than C<size> then the file is extended to "
25076 "the required size with zero bytes. This creates a sparse file (ie. disk "
25077 "blocks are not allocated for the file until you write to it). To create a "
25078 "non-sparse file of zeroes, use L</fallocate64> instead."
25082 #: ../fish/guestfish-actions.pod:4264
25087 #: ../fish/guestfish-actions.pod:4266
25090 " tune2fs-l device\n"
25095 #: ../fish/guestfish-actions.pod:4276
25100 #: ../fish/guestfish-actions.pod:4278
25103 " txz-in (tarball|-) directory\n"
25108 #: ../fish/guestfish-actions.pod:4285
25113 #: ../fish/guestfish-actions.pod:4287
25116 " txz-out directory (tarball|-)\n"
25121 #: ../fish/guestfish-actions.pod:4294
25126 #: ../fish/guestfish-actions.pod:4296
25134 #: ../fish/guestfish-actions.pod:4310
25135 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
25139 #: ../fish/guestfish-actions.pod:4315
25144 #: ../fish/guestfish-actions.pod:4317
25149 #: ../fish/guestfish-actions.pod:4319
25152 " umount pathordevice\n"
25157 #: ../fish/guestfish-actions.pod:4325
25162 #: ../fish/guestfish-actions.pod:4327
25163 msgid "unmount-all"
25167 #: ../fish/guestfish-actions.pod:4329
25175 #: ../fish/guestfish-actions.pod:4335
25180 #: ../fish/guestfish-actions.pod:4337
25183 " upload (filename|-) remotefilename\n"
25188 #: ../fish/guestfish-actions.pod:4344
25189 msgid "See also L</download>."
25193 #: ../fish/guestfish-actions.pod:4348
25194 msgid "upload-offset"
25198 #: ../fish/guestfish-actions.pod:4350
25201 " upload-offset (filename|-) remotefilename offset\n"
25206 #: ../fish/guestfish-actions.pod:4362
25208 "Note that there is no limit on the amount of data that can be uploaded with "
25209 "this call, unlike with L</pwrite>, and this call always writes the full "
25210 "amount unless an error occurs."
25214 #: ../fish/guestfish-actions.pod:4367
25215 msgid "See also L</upload>, L</pwrite>."
25219 #: ../fish/guestfish-actions.pod:4371
25224 #: ../fish/guestfish-actions.pod:4373
25227 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
25232 #: ../fish/guestfish-actions.pod:4392
25237 #: ../fish/guestfish-actions.pod:4394
25245 #: ../fish/guestfish-actions.pod:4421
25247 "I<Note:> Don't use this call to test for availability of features. In "
25248 "enterprise distributions we backport features from later versions into "
25249 "earlier versions, making this an unreliable way to test for features. Use "
25250 "L</available> instead."
25254 #: ../fish/guestfish-actions.pod:4427
25259 #: ../fish/guestfish-actions.pod:4429
25262 " vfs-label device\n"
25267 #: ../fish/guestfish-actions.pod:4436
25268 msgid "To find a filesystem from the label, use L</findfs-label>."
25272 #: ../fish/guestfish-actions.pod:4438
25277 #: ../fish/guestfish-actions.pod:4440
25280 " vfs-type device\n"
25285 #: ../fish/guestfish-actions.pod:4450
25290 #: ../fish/guestfish-actions.pod:4452
25293 " vfs-uuid device\n"
25298 #: ../fish/guestfish-actions.pod:4459
25299 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
25303 #: ../fish/guestfish-actions.pod:4461
25304 msgid "vg-activate"
25308 #: ../fish/guestfish-actions.pod:4463
25311 " vg-activate true|false 'volgroups ...'\n"
25316 #: ../fish/guestfish-actions.pod:4476
25317 msgid "vg-activate-all"
25321 #: ../fish/guestfish-actions.pod:4478
25324 " vg-activate-all true|false\n"
25329 #: ../fish/guestfish-actions.pod:4488
25334 #: ../fish/guestfish-actions.pod:4490
25337 " vgcreate volgroup 'physvols ...'\n"
25342 #: ../fish/guestfish-actions.pod:4495
25347 #: ../fish/guestfish-actions.pod:4497
25350 " vglvuuids vgname\n"
25355 #: ../fish/guestfish-actions.pod:4502
25357 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
25358 "logical volumes and volume groups."
25362 #: ../fish/guestfish-actions.pod:4505
25363 msgid "See also L</vgpvuuids>."
25367 #: ../fish/guestfish-actions.pod:4507
25372 #: ../fish/guestfish-actions.pod:4509
25375 " vgpvuuids vgname\n"
25380 #: ../fish/guestfish-actions.pod:4514
25382 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
25383 "physical volumes and volume groups."
25387 #: ../fish/guestfish-actions.pod:4517
25388 msgid "See also L</vglvuuids>."
25392 #: ../fish/guestfish-actions.pod:4519
25397 #: ../fish/guestfish-actions.pod:4521
25400 " vgremove vgname\n"
25405 #: ../fish/guestfish-actions.pod:4528
25410 #: ../fish/guestfish-actions.pod:4530
25413 " vgrename volgroup newvolgroup\n"
25418 #: ../fish/guestfish-actions.pod:4534
25423 #: ../fish/guestfish-actions.pod:4536
25431 #: ../fish/guestfish-actions.pod:4544
25432 msgid "See also L</vgs-full>."
25436 #: ../fish/guestfish-actions.pod:4546
25441 #: ../fish/guestfish-actions.pod:4548
25449 #: ../fish/guestfish-actions.pod:4553
25454 #: ../fish/guestfish-actions.pod:4555
25462 #: ../fish/guestfish-actions.pod:4560
25467 #: ../fish/guestfish-actions.pod:4562
25475 #: ../fish/guestfish-actions.pod:4566
25480 #: ../fish/guestfish-actions.pod:4568
25488 #: ../fish/guestfish-actions.pod:4573
25493 #: ../fish/guestfish-actions.pod:4575
25501 #: ../fish/guestfish-actions.pod:4580
25506 #: ../fish/guestfish-actions.pod:4582
25514 #: ../fish/guestfish-actions.pod:4587
25519 #: ../fish/guestfish-actions.pod:4589
25522 " write path content\n"
25527 #: ../fish/guestfish-actions.pod:4597
25532 #: ../fish/guestfish-actions.pod:4599
25535 " write-file path content size\n"
25540 #: ../fish/guestfish-actions.pod:4622
25545 #: ../fish/guestfish-actions.pod:4624
25548 " zegrep regex path\n"
25553 #: ../fish/guestfish-actions.pod:4632
25558 #: ../fish/guestfish-actions.pod:4634
25561 " zegrepi regex path\n"
25566 #: ../fish/guestfish-actions.pod:4642
25571 #: ../fish/guestfish-actions.pod:4644
25579 #: ../fish/guestfish-actions.pod:4652
25580 msgid "See also: L</zero-device>, L</scrub-device>."
25584 #: ../fish/guestfish-actions.pod:4654
25585 msgid "zero-device"
25589 #: ../fish/guestfish-actions.pod:4656
25592 " zero-device device\n"
25597 #: ../fish/guestfish-actions.pod:4658
25599 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
25600 "which just zeroes the first few blocks of a device."
25604 #: ../fish/guestfish-actions.pod:4665
25609 #: ../fish/guestfish-actions.pod:4667
25612 " zerofree device\n"
25617 #: ../fish/guestfish-actions.pod:4680
25622 #: ../fish/guestfish-actions.pod:4682
25625 " zfgrep pattern path\n"
25630 #: ../fish/guestfish-actions.pod:4690
25635 #: ../fish/guestfish-actions.pod:4692
25638 " zfgrepi pattern path\n"
25643 #: ../fish/guestfish-actions.pod:4700
25648 #: ../fish/guestfish-actions.pod:4702
25651 " zfile meth path\n"
25656 #: ../fish/guestfish-actions.pod:4709
25657 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
25661 #: ../fish/guestfish-actions.pod:4719
25666 #: ../fish/guestfish-actions.pod:4721
25669 " zgrep regex path\n"
25674 #: ../fish/guestfish-actions.pod:4729
25679 #: ../fish/guestfish-actions.pod:4731
25682 " zgrepi regex path\n"
25687 #: ../fish/guestfish-commands.pod:1
25692 #: ../fish/guestfish-commands.pod:3
25697 #: ../fish/guestfish-commands.pod:5
25700 " alloc filename size\n"
25705 #: ../fish/guestfish-commands.pod:7
25707 "This creates an empty (zeroed) file of the given size, and then adds so it "
25708 "can be further examined."
25712 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25713 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25717 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25718 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25722 #: ../fish/guestfish-commands.pod:14
25724 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25725 "image, see L</PREPARED DISK IMAGES>."
25729 #: ../fish/guestfish-commands.pod:17
25734 #: ../fish/guestfish-commands.pod:19
25737 " copy-in local [local ...] /remotedir\n"
25742 #: ../fish/guestfish-commands.pod:21
25744 "C<copy-in> copies local files or directories recursively into the disk "
25745 "image, placing them in the directory called C</remotedir> (which must "
25746 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25747 "other commands as necessary."
25751 #: ../fish/guestfish-commands.pod:26
25753 "Multiple local files and directories can be specified, but the last "
25754 "parameter must always be a remote directory. Wildcards cannot be used."
25758 #: ../fish/guestfish-commands.pod:30
25763 #: ../fish/guestfish-commands.pod:32
25766 " copy-out remote [remote ...] localdir\n"
25771 #: ../fish/guestfish-commands.pod:34
25773 "C<copy-out> copies remote files or directories recursively out of the disk "
25774 "image, placing them on the host disk in a local directory called C<localdir> "
25775 "(which must exist). This guestfish meta-command turns into a sequence of "
25776 "L</download>, L</tar-out> and other commands as necessary."
25780 #: ../fish/guestfish-commands.pod:40
25782 "Multiple remote files and directories can be specified, but the last "
25783 "parameter must always be a local directory. To download to the current "
25784 "directory, use C<.> as in:"
25788 #: ../fish/guestfish-commands.pod:44
25791 " copy-out /home .\n"
25796 #: ../fish/guestfish-commands.pod:46
25798 "Wildcards cannot be used in the ordinary command, but you can use them with "
25799 "the help of L</glob> like this:"
25803 #: ../fish/guestfish-commands.pod:49
25806 " glob copy-out /home/* .\n"
25811 #: ../fish/guestfish-commands.pod:51
25816 #: ../fish/guestfish-commands.pod:53
25819 " echo [params ...]\n"
25824 #: ../fish/guestfish-commands.pod:55
25825 msgid "This echos the parameters to the terminal."
25829 #: ../fish/guestfish-commands.pod:57
25834 #: ../fish/guestfish-commands.pod:59
25839 #: ../fish/guestfish-commands.pod:61
25844 #: ../fish/guestfish-commands.pod:63
25852 #: ../fish/guestfish-commands.pod:65
25854 "This is used to edit a file. It downloads the file, edits it locally using "
25855 "your editor, then uploads the result."
25859 #: ../fish/guestfish-commands.pod:68
25861 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25862 "or C<emacs> you will get those corresponding editors."
25866 #: ../fish/guestfish-commands.pod:72
25871 #: ../fish/guestfish-commands.pod:74
25874 " glob command args...\n"
25879 #: ../fish/guestfish-commands.pod:76
25881 "Expand wildcards in any paths in the args list, and run C<command> "
25882 "repeatedly on each matching path."
25886 #: ../fish/guestfish-commands.pod:79
25887 msgid "See L</WILDCARDS AND GLOBBING>."
25891 #: ../fish/guestfish-commands.pod:81
25896 #: ../fish/guestfish-commands.pod:83
25899 " hexedit <filename|device>\n"
25900 " hexedit <filename|device> <max>\n"
25901 " hexedit <filename|device> <start> <max>\n"
25906 #: ../fish/guestfish-commands.pod:87
25908 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25913 #: ../fish/guestfish-commands.pod:90
25915 "This command works by downloading potentially the whole file or device, "
25916 "editing it locally, then uploading it. If the file or device is large, you "
25917 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25918 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25919 "usual modifiers allowed such as C<1M> (1 megabyte)."
25923 #: ../fish/guestfish-commands.pod:97
25924 msgid "For example to edit the first few sectors of a disk you might do:"
25928 #: ../fish/guestfish-commands.pod:100
25931 " hexedit /dev/sda 1M\n"
25936 #: ../fish/guestfish-commands.pod:102
25938 "which would allow you to edit anywhere within the first megabyte of the "
25943 #: ../fish/guestfish-commands.pod:105
25944 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25948 #: ../fish/guestfish-commands.pod:107
25951 " hexedit /dev/sda1 0x400 0x400\n"
25956 #: ../fish/guestfish-commands.pod:109
25957 msgid "(assuming the superblock is in the standard location)."
25961 #: ../fish/guestfish-commands.pod:111
25963 "This command requires the external L<hexedit(1)> program. You can specify "
25964 "another program to use by setting the C<HEXEDITOR> environment variable."
25968 #: ../fish/guestfish-commands.pod:115
25969 msgid "See also L</hexdump>."
25973 #: ../fish/guestfish-commands.pod:117
25978 #: ../fish/guestfish-commands.pod:119
25986 #: ../fish/guestfish-commands.pod:121
25987 msgid "Change the local directory, ie. the current directory of guestfish itself."
25991 #: ../fish/guestfish-commands.pod:124
25992 msgid "Note that C<!cd> won't do what you might expect."
25996 #: ../fish/guestfish-commands.pod:126
26001 #: ../fish/guestfish-commands.pod:128
26006 #: ../fish/guestfish-commands.pod:130
26014 #: ../fish/guestfish-commands.pod:132
26015 msgid "Opens the manual page for guestfish."
26019 #: ../fish/guestfish-commands.pod:134
26024 #: ../fish/guestfish-commands.pod:136
26029 #: ../fish/guestfish-commands.pod:138
26037 #: ../fish/guestfish-commands.pod:140
26045 #: ../fish/guestfish-commands.pod:142
26046 msgid "This is used to view a file."
26050 #: ../fish/guestfish-commands.pod:144
26052 "The default viewer is C<$PAGER>. However if you use the alternate command "
26053 "C<less> you will get the C<less> command specifically."
26057 #: ../fish/guestfish-commands.pod:147
26062 #: ../fish/guestfish-commands.pod:149
26070 #: ../fish/guestfish-commands.pod:151
26072 "Close and reopen the libguestfs handle. It is not necessary to use this "
26073 "normally, because the handle is closed properly when guestfish exits. "
26074 "However this is occasionally useful for testing."
26078 #: ../fish/guestfish-commands.pod:155
26083 #: ../fish/guestfish-commands.pod:157
26086 " sparse filename size\n"
26091 #: ../fish/guestfish-commands.pod:159
26093 "This creates an empty sparse file of the given size, and then adds so it can "
26094 "be further examined."
26098 #: ../fish/guestfish-commands.pod:162
26100 "In all respects it works the same as the L</alloc> command, except that the "
26101 "image file is allocated sparsely, which means that disk blocks are not "
26102 "assigned to the file until they are needed. Sparse disk files only use "
26103 "space when written to, but they are slower and there is a danger you could "
26104 "run out of real disk space during a write operation."
26108 #: ../fish/guestfish-commands.pod:172
26113 #: ../fish/guestfish-commands.pod:174
26121 #: ../fish/guestfish-commands.pod:176
26123 "This command returns a list of the optional groups known to the daemon, and "
26124 "indicates which ones are supported by this build of the libguestfs "
26129 #: ../fish/guestfish-commands.pod:180
26130 msgid "See also L<guestfs(3)/AVAILABILITY>."
26134 #: ../fish/guestfish-commands.pod:182
26139 #: ../fish/guestfish-commands.pod:184
26142 " time command args...\n"
26147 #: ../fish/guestfish-commands.pod:186
26149 "Run the command as usual, but print the elapsed time afterwards. This can "
26150 "be useful for benchmarking operations."
26154 #: ../test-tool/libguestfs-test-tool.pod:5
26155 msgid "libguestfs-test-tool - End user tests for libguestfs"
26159 #: ../test-tool/libguestfs-test-tool.pod:9
26162 " libguestfs-test-tool [--options]\n"
26167 #: ../test-tool/libguestfs-test-tool.pod:13
26169 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
26170 "and developers, to allow them to check basic libguestfs functionality is "
26171 "working. This is needed because libguestfs occasionally breaks for reasons "
26172 "beyond our control: usually because of changes in the underlying qemu or "
26173 "kernel packages, or the host environment."
26177 #: ../test-tool/libguestfs-test-tool.pod:20
26178 msgid "If you suspect a problem in libguestfs, then just run:"
26182 #: ../test-tool/libguestfs-test-tool.pod:22
26185 " libguestfs-test-tool\n"
26190 #: ../test-tool/libguestfs-test-tool.pod:24
26191 msgid "It will print lots of diagnostic messages."
26195 #: ../test-tool/libguestfs-test-tool.pod:26
26196 msgid "If it runs to completion successfully, you will see this near the end:"
26200 #: ../test-tool/libguestfs-test-tool.pod:28
26203 " ===== TEST FINISHED OK =====\n"
26208 #: ../test-tool/libguestfs-test-tool.pod:30
26209 msgid "and the test tool will exit with code 0."
26213 #: ../test-tool/libguestfs-test-tool.pod:32
26215 "If it fails (and/or exits with non-zero error code), please paste the "
26216 "B<complete, unedited> output of the test tool into a bug report. More "
26217 "information about reporting bugs can be found on the "
26218 "L<http://libguestfs.org/> website."
26222 #: ../test-tool/libguestfs-test-tool.pod:41
26227 #: ../test-tool/libguestfs-test-tool.pod:43
26228 msgid "Display short usage information and exit."
26232 #: ../test-tool/libguestfs-test-tool.pod:45
26233 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
26237 #: ../test-tool/libguestfs-test-tool.pod:47
26239 "Pass an alternate name for the helper program. libguestfs-test-tool will "
26240 "normally look in the C<$libexec> directory that was configured when the tool "
26245 #: ../test-tool/libguestfs-test-tool.pod:51
26246 msgid "I<--qemu qemu_binary>"
26250 #: ../test-tool/libguestfs-test-tool.pod:53
26252 "If you have downloaded another qemu binary, point this option at the full "
26253 "path of the binary to try it."
26257 #: ../test-tool/libguestfs-test-tool.pod:56
26258 msgid "I<--qemudir qemu_source_dir>"
26262 #: ../test-tool/libguestfs-test-tool.pod:58
26264 "If you have compiled qemu from source, point this option at the source "
26265 "directory to try it."
26269 #: ../test-tool/libguestfs-test-tool.pod:61
26270 msgid "I<--timeout N>"
26274 #: ../test-tool/libguestfs-test-tool.pod:63
26276 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
26277 "does not usually need to be adjusted unless your machine is very slow."
26281 #: ../test-tool/libguestfs-test-tool.pod:69
26282 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
26286 #: ../test-tool/libguestfs-test-tool.pod:71
26288 "If you have compiled another version of qemu from source and would like to "
26289 "try that, then you can use the I<--qemudir> option to point to the qemu "
26290 "source directory."
26294 #: ../test-tool/libguestfs-test-tool.pod:75
26296 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
26297 "option to point to the binary."
26301 #: ../test-tool/libguestfs-test-tool.pod:78
26303 "When using an alternate qemu with libguestfs, usually you would need to "
26304 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
26305 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
26306 "when you use either of the I<--qemudir> or I<--qemu> options."
26310 #: ../test-tool/libguestfs-test-tool.pod:85
26312 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
26313 "I<1> if there was an error."
26317 #: ../test-tool/libguestfs-test-tool.pod:92
26318 msgid "/usr/libexec/libguestfs-test-tool-helper"
26322 #: ../test-tool/libguestfs-test-tool.pod:94
26324 "This helper program is run inside the appliance and provides additional "
26329 #: ../test-tool/libguestfs-test-tool.pod:97
26330 msgid "/usr/bin/mkisofs"
26334 #: ../test-tool/libguestfs-test-tool.pod:99
26336 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
26337 "which is used as part of the tests."
26341 #: ../test-tool/libguestfs-test-tool.pod:106
26343 "For the full list of environment variables which may affect libguestfs, "
26344 "please see the L<guestfs(3)> manual page."
26348 #: ../test-tool/libguestfs-test-tool.pod:111
26349 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
26353 #: ../test-tool/libguestfs-test-tool.pod:121
26354 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
26358 #: ../fuse/guestmount.pod:5
26359 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
26363 #: ../fuse/guestmount.pod:9
26366 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
26371 #: ../fuse/guestmount.pod:11
26374 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
26379 #: ../fuse/guestmount.pod:13
26382 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
26387 #: ../fuse/guestmount.pod:17
26389 "You must I<not> use C<guestmount> in read-write mode on live virtual "
26390 "machines. If you do this, you risk disk corruption in the VM."
26394 #: ../fuse/guestmount.pod:22
26396 "The guestmount program can be used to mount virtual machine filesystems and "
26397 "other disk images on the host. It uses libguestfs for access to the guest "
26398 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
26399 "a mountable device."
26403 #: ../fuse/guestmount.pod:27
26405 "Along with other options, you have to give at least one device (I<-a> "
26406 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
26407 "option) or use the I<-i> inspection option. How this works is better "
26408 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
26413 #: ../fuse/guestmount.pod:33
26415 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
26416 "by you, and the filesystem will not be visible to any other users unless you "
26417 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
26418 "the filesystem, use the C<fusermount -u> command."
26422 #: ../fuse/guestmount.pod:41
26424 "For a typical Windows guest which has its main filesystem on the first "
26429 #: ../fuse/guestmount.pod:44
26432 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
26437 #: ../fuse/guestmount.pod:46
26439 "For a typical Linux guest which has a /boot filesystem on the first "
26440 "partition, and the root filesystem on a logical volume:"
26444 #: ../fuse/guestmount.pod:49
26447 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
26452 #: ../fuse/guestmount.pod:51
26453 msgid "To get libguestfs to detect guest mountpoints for you:"
26457 #: ../fuse/guestmount.pod:53
26460 " guestmount -a guest.img -i --ro /mnt\n"
26465 #: ../fuse/guestmount.pod:55
26466 msgid "For a libvirt guest called \"Guest\" you could do:"
26470 #: ../fuse/guestmount.pod:57
26473 " guestmount -d Guest -i --ro /mnt\n"
26478 #: ../fuse/guestmount.pod:59
26480 "If you don't know what filesystems are contained in a guest or disk image, "
26481 "use L<virt-filesystems(1)> first:"
26485 #: ../fuse/guestmount.pod:62
26488 " virt-filesystems MyGuest\n"
26493 #: ../fuse/guestmount.pod:64
26495 "If you want to trace the libguestfs calls but without excessive debugging "
26496 "information, we recommend:"
26500 #: ../fuse/guestmount.pod:67
26503 " guestmount [...] --trace /mnt\n"
26508 #: ../fuse/guestmount.pod:69
26509 msgid "If you want to debug the program, we recommend:"
26513 #: ../fuse/guestmount.pod:71
26516 " guestmount [...] --trace --verbose /mnt\n"
26521 #: ../fuse/guestmount.pod:77
26522 msgid "B<-a image> | B<--add image>"
26526 #: ../fuse/guestmount.pod:79
26527 msgid "Add a block device or virtual machine image."
26531 #: ../fuse/guestmount.pod:84
26532 msgid "B<-c URI> | B<--connect URI>"
26536 #: ../fuse/guestmount.pod:90
26537 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
26541 #: ../fuse/guestmount.pod:96
26542 msgid "B<--dir-cache-timeout N>"
26546 #: ../fuse/guestmount.pod:98
26548 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
26549 "seconds. The readdir cache [actually, there are several semi-independent "
26550 "caches] is populated after a readdir(2) call with the stat and extended "
26551 "attributes of the files in the directory, in anticipation that they will be "
26552 "requested soon after."
26556 #: ../fuse/guestmount.pod:104
26558 "There is also a different attribute cache implemented by FUSE (see the FUSE "
26559 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
26560 "requests, only cache existing ones."
26564 #: ../fuse/guestmount.pod:115
26565 msgid "B<--format=raw|qcow2|..> | B<--format>"
26569 #: ../fuse/guestmount.pod:122
26571 "If you have untrusted raw-format guest disk images, you should use this "
26572 "option to specify the disk format. This avoids a possible security problem "
26573 "with malicious guests (CVE-2010-3851). See also "
26574 "L<guestfs(3)/guestfs_add_drive_opts>."
26578 #: ../fuse/guestmount.pod:127
26579 msgid "B<--fuse-help>"
26583 #: ../fuse/guestmount.pod:129
26584 msgid "Display help on special FUSE options (see I<-o> below)."
26588 #: ../fuse/guestmount.pod:133
26589 msgid "Display brief help and exit."
26593 #: ../fuse/guestmount.pod:135
26594 msgid "B<-i> | B<--inspector>"
26598 #: ../fuse/guestmount.pod:146
26599 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
26603 #: ../fuse/guestmount.pod:148
26605 "Mount the named partition or logical volume on the given mountpoint B<in the "
26606 "guest> (this has nothing to do with mountpoints in the host)."
26610 #: ../fuse/guestmount.pod:151
26612 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
26613 "something on C</>."
26617 #: ../fuse/guestmount.pod:154
26618 msgid "B<-n> | B<--no-sync>"
26622 #: ../fuse/guestmount.pod:156
26624 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
26625 "unmounted. If you specify this option, then we don't attempt to sync the "
26626 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
26630 #: ../fuse/guestmount.pod:161
26631 msgid "B<-o option> | B<--option option>"
26635 #: ../fuse/guestmount.pod:163
26636 msgid "Pass extra options to FUSE."
26640 #: ../fuse/guestmount.pod:165
26642 "To get a list of all the extra options supported by FUSE, use the command "
26643 "below. Note that only the FUSE I<-o> options can be passed, and only some "
26644 "of them are a good idea."
26648 #: ../fuse/guestmount.pod:169
26651 " guestmount --fuse-help\n"
26656 #: ../fuse/guestmount.pod:171
26657 msgid "Some potentially useful FUSE options:"
26661 #: ../fuse/guestmount.pod:175
26662 msgid "B<-o allow_other>"
26666 #: ../fuse/guestmount.pod:177
26667 msgid "Allow other users to see the filesystem."
26671 #: ../fuse/guestmount.pod:179
26672 msgid "B<-o attr_timeout=N>"
26676 #: ../fuse/guestmount.pod:181
26677 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
26681 #: ../fuse/guestmount.pod:183
26682 msgid "B<-o kernel_cache>"
26686 #: ../fuse/guestmount.pod:185
26688 "Allow the kernel to cache files (reduces the number of reads that have to go "
26689 "through the L<guestfs(3)> API). This is generally a good idea if you can "
26690 "afford the extra memory usage."
26694 #: ../fuse/guestmount.pod:189
26695 msgid "B<-o uid=N> B<-o gid=N>"
26699 #: ../fuse/guestmount.pod:191
26701 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
26702 "the chosen values."
26706 #: ../fuse/guestmount.pod:196
26707 msgid "B<-r> | B<--ro>"
26711 #: ../fuse/guestmount.pod:198
26713 "Add devices and mount everything read-only. Also disallow writes and make "
26714 "the disk appear read-only to FUSE."
26718 #: ../fuse/guestmount.pod:201
26720 "This is highly recommended if you are not going to edit the guest disk. If "
26721 "the guest is running and this option is I<not> supplied, then there is a "
26722 "strong risk of disk corruption in the guest. We try to prevent this from "
26723 "happening, but it is not always possible."
26727 #: ../fuse/guestmount.pod:206
26728 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26732 #: ../fuse/guestmount.pod:210
26733 msgid "Enable SELinux support for the guest."
26737 #: ../fuse/guestmount.pod:212
26738 msgid "B<-v> | B<--verbose>"
26742 #: ../fuse/guestmount.pod:214
26743 msgid "Enable verbose messages from underlying libguestfs."
26747 #: ../fuse/guestmount.pod:216
26748 msgid "B<-V> | B<--version>"
26752 #: ../fuse/guestmount.pod:218
26753 msgid "Display the program version and exit."
26757 #: ../fuse/guestmount.pod:220
26758 msgid "B<-w> | B<--rw>"
26762 #: ../fuse/guestmount.pod:222
26764 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26765 "FOR READ AND WRITE>."
26769 #: ../fuse/guestmount.pod:225
26770 msgid "B<-x> | B<--trace>"
26774 #: ../fuse/guestmount.pod:227
26775 msgid "Trace libguestfs calls and entry into each FUSE function."
26779 #: ../fuse/guestmount.pod:229
26780 msgid "This also stops the daemon from forking into the background."
26784 #: ../fuse/guestmount.pod:235
26786 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26787 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
26788 "L<http://fuse.sf.net/>."
26792 #: ../tools/virt-edit.pl:34
26793 msgid "virt-edit - Edit a file in a virtual machine"
26797 #: ../tools/virt-edit.pl:38
26800 " virt-edit [--options] domname file\n"
26805 #: ../tools/virt-edit.pl:40
26808 " virt-edit [--options] disk.img [disk.img ...] file\n"
26813 #: ../tools/virt-edit.pl:42
26816 " virt-edit [domname|disk.img] file -e 'expr'\n"
26821 #: ../tools/virt-edit.pl:46
26823 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26824 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26825 "doing this, but doesn't catch all cases."
26829 #: ../tools/virt-edit.pl:52
26831 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26832 "the named virtual machine (or disk image)."
26836 #: ../tools/virt-edit.pl:55
26838 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26839 "you should look at the L<guestfish(1)> tool."
26843 #: ../tools/virt-edit.pl:60
26844 msgid "Edit the named files interactively:"
26848 #: ../tools/virt-edit.pl:62
26851 " virt-edit mydomain /boot/grub/grub.conf\n"
26856 #: ../tools/virt-edit.pl:64
26859 " virt-edit mydomain /etc/passwd\n"
26864 #: ../tools/virt-edit.pl:66
26866 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26867 "below). To change the init default level to 5:"
26871 #: ../tools/virt-edit.pl:70
26874 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26879 #: ../tools/virt-edit.pl:82 ../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
26880 msgid "Display brief help."
26884 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114 ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71 ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:72
26885 msgid "Display version number and exit."
26889 #: ../tools/virt-edit.pl:96
26890 msgid "B<--backup extension> | B<-b extension>"
26894 #: ../tools/virt-edit.pl:98
26896 "Create a backup of the original file I<in the guest disk image>. The backup "
26897 "has the original filename with C<extension> added."
26901 #: ../tools/virt-edit.pl:101
26903 "Usually the first character of C<extension> would be a dot C<.> so you would "
26908 #: ../tools/virt-edit.pl:104
26911 " virt-edit -b .orig [etc]\n"
26916 #: ../tools/virt-edit.pl:106
26917 msgid "By default, no backup file is made."
26921 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128 ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127 ../tools/virt-list-partitions.pl:78
26922 msgid "B<--connect URI> | B<-c URI>"
26926 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130 ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129 ../tools/virt-list-partitions.pl:80
26928 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26929 "to the default libvirt hypervisor."
26933 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133 ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132 ../tools/virt-list-partitions.pl:83
26935 "If you specify guest block devices directly, then libvirt is not used at "
26940 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140 ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89 ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
26941 msgid "B<--format> raw"
26945 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142 ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141 ../tools/virt-list-partitions.pl:92
26947 "Specify the format of disk images given on the command line. If this is "
26948 "omitted then the format is autodetected from the content of the disk image."
26952 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146 ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145 ../tools/virt-list-partitions.pl:96
26954 "If disk images are requested from libvirt, then this program asks libvirt "
26955 "for this information. In this case, the value of the format parameter is "
26960 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150 ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540 ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149 ../tools/virt-list-partitions.pl:100
26962 "If working with untrusted raw-format guest disk images, you should ensure "
26963 "the format is always specified."
26967 #: ../tools/virt-edit.pl:141
26968 msgid "B<--expr EXPR> | B<-e EXPR>"
26972 #: ../tools/virt-edit.pl:143
26974 "Instead of launching the external editor, non-interactively apply the Perl "
26975 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26980 #: ../tools/virt-edit.pl:147
26982 "Be careful to properly quote the expression to prevent it from being altered "
26987 #: ../tools/virt-edit.pl:268
26988 msgid "NON-INTERACTIVE EDITING"
26992 #: ../tools/virt-edit.pl:270
26994 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26995 "administrator can interactively edit the file."
26999 #: ../tools/virt-edit.pl:273
27001 "There are two ways also to use C<virt-edit> from scripts in order to make "
27002 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
27003 "like this, it's less error-prone to write scripts directly using the "
27004 "libguestfs API and Augeas for configuration file editing.)"
27008 #: ../tools/virt-edit.pl:279
27010 "The first method is to temporarily set C<$EDITOR> to any script or program "
27011 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
27012 "update C<tmpfile> in place however it likes."
27016 #: ../tools/virt-edit.pl:283
27018 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
27019 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
27020 "instances of C<foo> with C<bar> in a file:"
27024 #: ../tools/virt-edit.pl:287
27027 " virt-edit domname filename -e 's/foo/bar/'\n"
27032 #: ../tools/virt-edit.pl:289
27034 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
27035 "For example to delete root's password you could do:"
27039 #: ../tools/virt-edit.pl:292
27042 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
27047 #: ../tools/virt-edit.pl:294
27049 "What really happens is that the snippet is evaluated as a Perl expression "
27050 "for each line of the file. The line, including the final C<\\n>, is passed "
27051 "in C<$_> and the expression should update C<$_> or leave it unchanged."
27055 #: ../tools/virt-edit.pl:299
27057 "To delete a line, set C<$_> to the empty string. For example, to delete the "
27058 "C<apache> user account from the password file you can do:"
27062 #: ../tools/virt-edit.pl:302
27065 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
27070 #: ../tools/virt-edit.pl:304
27072 "To insert a line, prepend or append it to C<$_>. However appending lines to "
27073 "the end of the file is rather difficult this way since there is no concept "
27074 "of \"last line of the file\" - your expression just doesn't get called "
27075 "again. You might want to use the first method (setting C<$EDITOR>) if you "
27080 #: ../tools/virt-edit.pl:310
27082 "The variable C<$lineno> contains the current line number. As is "
27083 "traditional, the first line in the file is number C<1>."
27087 #: ../tools/virt-edit.pl:313
27089 "The return value from the expression is ignored, but the expression may call "
27090 "C<die> in order to abort the whole program, leaving the original file "
27095 #: ../tools/virt-edit.pl:317
27097 "Remember when matching the end of a line that C<$_> may contain the final "
27098 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
27099 "newline then neither of these. Thus to match or substitute some text at the "
27100 "end of a line, use this regular expression:"
27104 #: ../tools/virt-edit.pl:322
27107 " /some text(\\r?\\n)?$/\n"
27112 #: ../tools/virt-edit.pl:324
27114 "Alternately, use the perl C<chomp> function, being careful not to chomp "
27115 "C<$_> itself (since that would remove all newlines from the file):"
27119 #: ../tools/virt-edit.pl:328
27122 " my $m = $_; chomp $m; $m =~ /some text$/\n"
27127 #: ../tools/virt-edit.pl:334
27132 #: ../tools/virt-edit.pl:336
27134 "If set, this string is used as the editor. It may contain arguments, "
27135 "eg. C<\"emacs -nw\">"
27139 #: ../tools/virt-edit.pl:339
27140 msgid "If not set, C<vi> is used."
27144 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559 ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:250
27145 msgid "SHELL QUOTING"
27149 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567 ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184 ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:252
27151 "Libvirt guest names can contain arbitrary characters, some of which have "
27152 "meaning to the shell such as C<#> and space. You may need to quote or "
27153 "escape these characters on the command line. See the shell manual page "
27154 "L<sh(1)> for details."
27158 #: ../tools/virt-edit.pl:352
27160 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
27161 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27162 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
27166 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:598 ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:269
27171 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:600 ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:271
27172 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
27176 #: ../tools/virt-edit.pl:370 ../tools/virt-list-partitions.pl:275
27177 msgid "Copyright (C) 2009-2010 Red Hat Inc."
27181 #: ../tools/virt-win-reg.pl:37
27183 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
27188 #: ../tools/virt-win-reg.pl:41
27191 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
27196 #: ../tools/virt-win-reg.pl:43
27199 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
27204 #: ../tools/virt-win-reg.pl:45
27207 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
27212 #: ../tools/virt-win-reg.pl:47
27215 " virt-win-reg --merge domname [input.reg ...]\n"
27220 #: ../tools/virt-win-reg.pl:49
27223 " virt-win-reg [--options] disk.img ... # instead of domname\n"
27228 #: ../tools/virt-win-reg.pl:53
27230 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
27231 "virtual machines. If you do this, you I<will> get irreversible disk "
27232 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
27233 "but doesn't catch all cases."
27237 #: ../tools/virt-win-reg.pl:58
27239 "Modifying the Windows Registry is an inherently risky operation. The format "
27240 "is deliberately obscure and undocumented, and Registry changes can leave the "
27241 "system unbootable. Therefore when using the C<--merge> option, make sure "
27242 "you have a reliable backup first."
27246 #: ../tools/virt-win-reg.pl:65
27248 "This program can export and merge Windows Registry entries from a Windows "
27253 #: ../tools/virt-win-reg.pl:68
27255 "The first parameter is the libvirt guest name or the raw disk image of a "
27260 #: ../tools/virt-win-reg.pl:71
27262 "If C<--merge> is I<not> specified, then the chosen registry key is "
27263 "displayed/exported (recursively). For example:"
27267 #: ../tools/virt-win-reg.pl:74
27270 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
27275 #: ../tools/virt-win-reg.pl:76
27276 msgid "You can also display single values from within registry keys, for example:"
27280 #: ../tools/virt-win-reg.pl:79
27283 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
27284 " $ virt-win-reg Windows7 $cvkey ProductName\n"
27285 " Windows 7 Enterprise\n"
27290 #: ../tools/virt-win-reg.pl:83
27292 "With C<--merge>, you can merge a textual regedit file into the Windows "
27297 #: ../tools/virt-win-reg.pl:86
27300 " $ virt-win-reg --merge Windows7 changes.reg\n"
27305 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
27310 #: ../tools/virt-win-reg.pl:90
27312 "This program is only meant for simple access to the registry. If you want "
27313 "to do complicated things with the registry, we suggest you download the "
27314 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
27315 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
27316 "L<hivexregedit(1)>."
27320 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
27325 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
27326 msgid "Enable debugging messages."
27330 #: ../tools/virt-win-reg.pl:157
27335 #: ../tools/virt-win-reg.pl:159
27337 "In merge mode, this merges a textual regedit file into the Windows Registry "
27338 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
27339 "displays or exports Registry entries instead."
27343 #: ../tools/virt-win-reg.pl:163
27345 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
27346 "result in disk corruption. However exporting (without this flag) is always "
27351 #: ../tools/virt-win-reg.pl:171
27352 msgid "B<--encoding> UTF-16LE|ASCII"
27356 #: ../tools/virt-win-reg.pl:173
27358 "When merging (only), you may need to specify the encoding for strings to be "
27359 "used in the hive file. This is explained in detail in "
27360 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
27364 #: ../tools/virt-win-reg.pl:177
27366 "The default is to use UTF-16LE, which should work with recent versions of "
27371 #: ../tools/virt-win-reg.pl:402
27372 msgid "SUPPORTED SYSTEMS"
27376 #: ../tools/virt-win-reg.pl:404
27378 "The program currently supports Windows NT-derived guests starting with "
27379 "Windows XP through to at least Windows 7."
27383 #: ../tools/virt-win-reg.pl:407
27385 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
27386 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
27387 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
27391 #: ../tools/virt-win-reg.pl:411
27393 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
27398 #: ../tools/virt-win-reg.pl:414
27400 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
27405 #: ../tools/virt-win-reg.pl:417
27410 #: ../tools/virt-win-reg.pl:419
27412 "C<virt-win-reg> expects that regedit files have already been reencoded in "
27413 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
27414 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
27415 "with Windows-style line endings, you may need to reencode the whole file "
27416 "before or after processing."
27420 #: ../tools/virt-win-reg.pl:425
27422 "To reencode a file from Windows format to Linux (before processing it with "
27423 "the C<--merge> option), you would do something like this:"
27427 #: ../tools/virt-win-reg.pl:428
27430 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
27435 #: ../tools/virt-win-reg.pl:430
27437 "To go in the opposite direction, after exporting and before sending the file "
27438 "to a Windows user, do something like this:"
27442 #: ../tools/virt-win-reg.pl:433
27445 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
27450 #: ../tools/virt-win-reg.pl:435
27451 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
27455 #: ../tools/virt-win-reg.pl:437
27457 "If you are unsure about the current encoding, use the L<file(1)> command. "
27458 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
27459 "Windows-style (CRLF) line endings, like this:"
27463 #: ../tools/virt-win-reg.pl:441
27466 " $ file software.reg\n"
27467 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
27468 " with CRLF line terminators\n"
27473 #: ../tools/virt-win-reg.pl:445
27474 msgid "This file would need conversion before you could C<--merge> it."
27478 #: ../tools/virt-win-reg.pl:447
27479 msgid "CurrentControlSet etc."
27483 #: ../tools/virt-win-reg.pl:449
27485 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
27486 "Registry at the level of the hive file, and therefore you cannot modify "
27491 #: ../tools/virt-win-reg.pl:453
27493 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
27494 "circumstances it might refer to another control set. The way to find out is "
27495 "to look at the C<HKLM\\SYSTEM\\Select> key:"
27499 #: ../tools/virt-win-reg.pl:457
27502 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
27503 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
27504 " \"Current\"=dword:00000001\n"
27505 " \"Default\"=dword:00000001\n"
27506 " \"Failed\"=dword:00000000\n"
27507 " \"LastKnownGood\"=dword:00000002\n"
27512 #: ../tools/virt-win-reg.pl:464
27513 msgid "\"Current\" is the one which Windows will choose when it boots."
27517 #: ../tools/virt-win-reg.pl:466
27518 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
27522 #: ../tools/virt-win-reg.pl:469
27523 msgid "WINDOWS TIPS"
27527 #: ../tools/virt-win-reg.pl:471
27529 "Note that some of these tips modify the guest disk image. The guest I<must> "
27530 "be shut off, else you will get disk corruption."
27534 #: ../tools/virt-win-reg.pl:474
27535 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
27539 #: ../tools/virt-win-reg.pl:476
27541 "Prepare a DOS batch script, VBScript or executable. Upload this using "
27542 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
27543 "is uploaded into C<C:\\>:"
27547 #: ../tools/virt-win-reg.pl:480
27550 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
27555 #: ../tools/virt-win-reg.pl:482
27556 msgid "Prepare a regedit file containing the registry change:"
27560 #: ../tools/virt-win-reg.pl:484
27563 " cat > test.reg <<'EOF'\n"
27564 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
27565 " \"Test\"=\"c:\\\\test.bat\"\n"
27571 #: ../tools/virt-win-reg.pl:489
27573 "In this example we use the key C<RunOnce> which means that the script will "
27574 "run precisely once when the first user logs in. If you want it to run every "
27575 "time a user logs in, replace C<RunOnce> with C<Run>."
27579 #: ../tools/virt-win-reg.pl:493
27580 msgid "Now update the registry:"
27584 #: ../tools/virt-win-reg.pl:495
27587 " virt-win-reg --merge WindowsGuest test.reg\n"
27592 #: ../tools/virt-win-reg.pl:497
27593 msgid "INSTALLING A SERVICE"
27597 #: ../tools/virt-win-reg.pl:499
27599 "This section assumes you are familiar with Windows services, and you either "
27600 "have a program which handles the Windows Service Control Protocol directly "
27601 "or you want to run any program using a service wrapper like SrvAny or the "
27606 #: ../tools/virt-win-reg.pl:504
27608 "First upload the program and optionally the service wrapper. In this case "
27609 "the test program is called C<test.exe> and we are using the RHSrvAny "
27614 #: ../tools/virt-win-reg.pl:508
27617 " guestfish -i -d WindowsGuest <<EOF\n"
27618 " upload rhsrvany.exe /rhsrvany.exe\n"
27619 " upload test.exe /test.exe\n"
27625 #: ../tools/virt-win-reg.pl:513
27627 "Prepare a regedit file containing the registry changes. In this example, "
27628 "the first registry change is needed for the service itself or the service "
27629 "wrapper (if used). The second registry change is only needed because I am "
27630 "using the RHSrvAny service wrapper."
27634 #: ../tools/virt-win-reg.pl:518
27637 " cat > service.reg <<'EOF'\n"
27638 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
27639 " \"Type\"=dword:00000010\n"
27640 " \"Start\"=dword:00000002\n"
27641 " \"ErrorControl\"=dword:00000001\n"
27642 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
27643 " \"DisplayName\"=\"RHSrvAny\"\n"
27644 " \"ObjectName\"=\"NetworkService\"\n"
27649 #: ../tools/virt-win-reg.pl:527
27652 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
27653 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
27654 " \"PWD\"=\"c:\\\\Temp\"\n"
27660 #: ../tools/virt-win-reg.pl:538
27662 "For use of C<ControlSet001> see the section above in this manual page. You "
27663 "may need to adjust this according to the control set that is in use by the "
27668 #: ../tools/virt-win-reg.pl:544
27670 "C<\"ObjectName\"> controls the privileges that the service will have. An "
27671 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
27672 "privileged account."
27676 #: ../tools/virt-win-reg.pl:550
27678 "For the meaning of the magic numbers, see this Microsoft KB article: "
27679 "L<http://support.microsoft.com/kb/103000>."
27683 #: ../tools/virt-win-reg.pl:555
27684 msgid "Update the registry:"
27688 #: ../tools/virt-win-reg.pl:557
27691 " virt-win-reg --merge WindowsGuest service.reg\n"
27696 #: ../tools/virt-win-reg.pl:561
27698 "Be careful when passing parameters containing C<\\> (backslash) in the "
27699 "shell. Usually you will have to use 'single quotes' or double backslashes "
27700 "(but not both) to protect them from the shell."
27704 #: ../tools/virt-win-reg.pl:565
27705 msgid "Paths and value names are case-insensitive."
27709 #: ../tools/virt-win-reg.pl:574
27711 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
27712 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
27713 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
27714 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27718 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
27720 "When reporting bugs, please enable debugging and capture the I<complete> "
27725 #: ../tools/virt-win-reg.pl:592
27728 " export LIBGUESTFS_DEBUG=1\n"
27729 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
27734 #: ../tools/virt-win-reg.pl:595
27736 "Attach /tmp/virt-win-reg.log to a new bug report at "
27737 "L<https://bugzilla.redhat.com/>"
27741 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510 ../tools/virt-make-fs.pl:565
27742 msgid "Copyright (C) 2010 Red Hat Inc."
27746 #: ../tools/virt-resize.pl:42
27747 msgid "virt-resize - Resize a virtual machine disk"
27751 #: ../tools/virt-resize.pl:46
27754 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27755 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27756 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27761 #: ../tools/virt-resize.pl:52
27763 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27764 "larger or smaller overall, and resizing or deleting any partitions contained "
27769 #: ../tools/virt-resize.pl:56
27771 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27772 "not> be used on live virtual machines - for consistent results, shut the "
27773 "virtual machine down before resizing it."
27777 #: ../tools/virt-resize.pl:60
27779 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
27780 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
27784 #: ../tools/virt-resize.pl:66
27786 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27787 "fill the extra 5GB of space."
27791 #: ../tools/virt-resize.pl:69
27794 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27795 " virt-filesystems --long --h --all -a olddisk\n"
27796 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27797 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27802 #: ../tools/virt-resize.pl:74
27804 "As above, but make the /boot partition 200MB bigger, while giving the "
27805 "remaining space to /dev/sda2:"
27809 #: ../tools/virt-resize.pl:77
27812 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27817 #: ../tools/virt-resize.pl:79
27818 msgid "As above, but the output format will be uncompressed qcow2:"
27822 #: ../tools/virt-resize.pl:81
27825 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27826 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27831 #: ../tools/virt-resize.pl:84
27832 msgid "DETAILED USAGE"
27836 #: ../tools/virt-resize.pl:86
27837 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27841 #: ../tools/virt-resize.pl:90
27842 msgid "1. Shut down the virtual machine"
27846 #: ../tools/virt-resize.pl:92
27847 msgid "2. Locate input disk image"
27851 #: ../tools/virt-resize.pl:94
27853 "Locate the input disk image (ie. the file or device on the host containing "
27854 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27855 "dumpxml> like this to find the disk image name:"
27859 #: ../tools/virt-resize.pl:98
27862 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27863 " Found 1 nodes:\n"
27865 " <source dev=\"/dev/vg/lv_guest\" />\n"
27870 #: ../tools/virt-resize.pl:103
27871 msgid "3. Look at current sizing"
27875 #: ../tools/virt-resize.pl:105
27876 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
27880 #: ../tools/virt-resize.pl:108
27883 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
27884 " Name Type Size Parent\n"
27885 " /dev/sda1 partition 101M /dev/sda\n"
27886 " /dev/sda2 partition 7.9G /dev/sda\n"
27887 " /dev/sda device 8.0G -\n"
27892 #: ../tools/virt-resize.pl:114
27894 "(This example is a virtual machine with an 8 GB disk which we would like to "
27895 "expand up to 10 GB)."
27899 #: ../tools/virt-resize.pl:117
27900 msgid "4. Create output disk"
27904 #: ../tools/virt-resize.pl:119
27906 "Virt-resize cannot do in-place disk modifications. You have to have space "
27907 "to store the resized output disk."
27911 #: ../tools/virt-resize.pl:122
27912 msgid "To store the resized disk image in a file, create a file of a suitable size:"
27916 #: ../tools/virt-resize.pl:125
27919 " # rm -f outdisk\n"
27920 " # truncate -s 10G outdisk\n"
27925 #: ../tools/virt-resize.pl:128
27926 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27930 #: ../tools/virt-resize.pl:130
27933 " # lvcreate -L 10G -n lv_name vg_name\n"
27938 #: ../tools/virt-resize.pl:132
27939 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27943 #: ../tools/virt-resize.pl:134
27946 " # virsh pool-list\n"
27947 " # virsh vol-create-as poolname newvol 10G\n"
27952 #: ../tools/virt-resize.pl:137
27957 #: ../tools/virt-resize.pl:139
27959 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27960 "file) and the output disk. The output disk is the one created in the "
27965 #: ../tools/virt-resize.pl:143
27968 " # virt-resize indisk outdisk\n"
27973 #: ../tools/virt-resize.pl:145
27975 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27976 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27977 "larger, then an extra, empty partition is created at the end of the disk "
27978 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27983 #: ../tools/virt-resize.pl:151
27985 "More realistically you'd want to expand existing partitions in the disk "
27986 "image by passing extra options (for the full list see the L</OPTIONS> "
27991 #: ../tools/virt-resize.pl:155
27993 "L</--expand> is the most useful option. It expands the named partition "
27994 "within the disk to fill any extra space:"
27998 #: ../tools/virt-resize.pl:158
28001 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
28006 #: ../tools/virt-resize.pl:160
28008 "(In this case, an extra partition is I<not> created at the end of the disk, "
28009 "because there will be no unused space)."
28013 #: ../tools/virt-resize.pl:163
28015 "L</--resize> is the other commonly used option. The following would "
28016 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
28017 "rest of the available space:"
28021 #: ../tools/virt-resize.pl:167
28024 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
28025 " indisk outdisk\n"
28030 #: ../tools/virt-resize.pl:170
28032 "If the expanded partition in the image contains a filesystem or LVM PV, then "
28033 "if virt-resize knows how, it will resize the contents, the equivalent of "
28034 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or "
28035 "L<ntfsresize(8)>. However virt-resize does not know how to resize some "
28036 "filesystems, so you would have to online resize them after booting the "
28041 #: ../tools/virt-resize.pl:177
28042 msgid "Other options are covered below."
28046 #: ../tools/virt-resize.pl:179
28051 #: ../tools/virt-resize.pl:181
28052 msgid "Thoroughly test the new disk image I<before> discarding the old one."
28056 #: ../tools/virt-resize.pl:183
28057 msgid "If you are using libvirt, edit the XML to point at the new disk:"
28061 #: ../tools/virt-resize.pl:185
28064 " # virsh edit guestname\n"
28069 #: ../tools/virt-resize.pl:187
28071 "Change E<lt>source ...E<gt>, see "
28072 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
28076 #: ../tools/virt-resize.pl:190
28077 msgid "Then start up the domain with the new, resized disk:"
28081 #: ../tools/virt-resize.pl:192
28084 " # virsh start guestname\n"
28089 #: ../tools/virt-resize.pl:194
28091 "and check that it still works. See also the L</NOTES> section below for "
28092 "additional information."
28096 #: ../tools/virt-resize.pl:197
28097 msgid "7. Resize LVs etc inside the guest"
28101 #: ../tools/virt-resize.pl:199
28102 msgid "(This can also be done offline using L<guestfish(1)>)"
28106 #: ../tools/virt-resize.pl:201
28108 "Once the guest has booted you should see the new space available, at least "
28109 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
28110 "may need to resize LVs inside PVs, and also resize filesystem types that "
28111 "virt-resize does not know how to expand."
28115 #: ../tools/virt-resize.pl:208
28116 msgid "SHRINKING A VIRTUAL MACHINE DISK"
28120 #: ../tools/virt-resize.pl:210
28122 "Shrinking is somewhat more complex than expanding, and only an overview is "
28127 #: ../tools/virt-resize.pl:213
28129 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
28130 "filesystems). The user has to shrink content before passing the disk image "
28131 "to virt-resize, and virt-resize will check that the content has been shrunk "
28136 #: ../tools/virt-resize.pl:218
28137 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
28141 #: ../tools/virt-resize.pl:220
28143 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
28144 "steps 3 and 4 above to allocate a new disk image."
28148 #: ../tools/virt-resize.pl:223
28149 msgid "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
28153 #: ../tools/virt-resize.pl:226
28154 msgid "IGNORING OR DELETING PARTITIONS"
28158 #: ../tools/virt-resize.pl:228
28160 "virt-resize also gives a convenient way to ignore or delete partitions when "
28161 "copying from the input disk to the output disk. Ignoring a partition speeds "
28162 "up the copy where you don't care about the existing contents of a "
28163 "partition. Deleting a partition removes it completely, but note that it "
28164 "also renumbers any partitions after the one which is deleted, which can "
28165 "leave some guests unbootable."
28169 #: ../tools/virt-resize.pl:235
28170 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
28174 #: ../tools/virt-resize.pl:237
28176 "If the input disk is in qcow2 format, then you may prefer that the output is "
28177 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
28178 "the fly. The output format is simply determined by the format of the empty "
28179 "output container that you provide. Thus to create qcow2 output, use:"
28183 #: ../tools/virt-resize.pl:243
28186 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
28191 #: ../tools/virt-resize.pl:245
28192 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
28196 #: ../tools/virt-resize.pl:247
28197 msgid "Similarly, to get non-sparse raw output use:"
28201 #: ../tools/virt-resize.pl:249
28204 " fallocate -l size outdisk\n"
28209 #: ../tools/virt-resize.pl:251
28211 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
28212 "if=/dev/zero of=outdisk bs=1M count=..>)"
28216 #: ../tools/virt-resize.pl:264
28217 msgid "Display help."
28221 #: ../tools/virt-resize.pl:278
28222 msgid "B<--resize part=size>"
28226 #: ../tools/virt-resize.pl:280
28228 "Resize the named partition (expanding or shrinking it) so that it has the "
28233 #: ../tools/virt-resize.pl:283
28235 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
28236 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
28237 "Exabytes; or as a percentage of the current size; or as a relative number or "
28238 "percentage. For example:"
28242 #: ../tools/virt-resize.pl:288
28245 " --resize /dev/sda2=10G\n"
28250 #: ../tools/virt-resize.pl:290
28253 " --resize /dev/sda4=90%\n"
28258 #: ../tools/virt-resize.pl:292
28261 " --resize /dev/sda2=+1G\n"
28266 #: ../tools/virt-resize.pl:294
28269 " --resize /dev/sda2=-200M\n"
28274 #: ../tools/virt-resize.pl:296
28277 " --resize /dev/sda1=+128K\n"
28282 #: ../tools/virt-resize.pl:298
28285 " --resize /dev/sda1=+10%\n"
28290 #: ../tools/virt-resize.pl:300
28293 " --resize /dev/sda1=-10%\n"
28298 #: ../tools/virt-resize.pl:302
28300 "You can increase the size of any partition. Virt-resize will expand the "
28301 "direct content of the partition if it knows how (see C<--expand> below)."
28305 #: ../tools/virt-resize.pl:306
28307 "You can only I<decrease> the size of partitions that contain filesystems or "
28308 "PVs which have already been shrunk. Virt-resize will check this has been "
28309 "done before proceeding, or else will print an error (see also "
28310 "C<--resize-force>)."
28314 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403 ../tools/virt-resize.pl:420
28315 msgid "You can give this option multiple times."
28319 #: ../tools/virt-resize.pl:317
28320 msgid "B<--resize-force part=size>"
28324 #: ../tools/virt-resize.pl:319
28326 "This is the same as C<--resize> except that it will let you decrease the "
28327 "size of any partition. Generally this means you will lose any data which "
28328 "was at the end of the partition you shrink, but you may not care about that "
28329 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
28330 "as a swap partition)."
28334 #: ../tools/virt-resize.pl:325
28335 msgid "See also the C<--ignore> option."
28339 #: ../tools/virt-resize.pl:331
28340 msgid "B<--expand part>"
28344 #: ../tools/virt-resize.pl:333
28346 "Expand the named partition so it uses up all extra space (space left over "
28347 "after any other resize changes that you request have been done)."
28351 #: ../tools/virt-resize.pl:336
28353 "If virt-resize knows how, it will expand the direct content of the "
28354 "partition. For example, if the partition is an LVM PV, it will expand the "
28355 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
28356 "content it doesn't know about alone."
28360 #: ../tools/virt-resize.pl:341
28361 msgid "Currently virt-resize can resize:"
28365 #: ../tools/virt-resize.pl:347
28367 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
28372 #: ../tools/virt-resize.pl:352
28374 "NTFS filesystems contained directly in a partition, if libguestfs was "
28375 "compiled with support for NTFS."
28379 #: ../tools/virt-resize.pl:355
28381 "The filesystem must have been shut down consistently last time it was used. "
28382 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
28383 "consistency check, so at the first boot after resizing Windows will check "
28388 #: ../tools/virt-resize.pl:362
28390 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
28391 "inside the PV, but see the C<--LV-expand> option. The user could also "
28392 "resize LVs as desired after boot."
28396 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
28397 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
28401 #: ../tools/virt-resize.pl:374
28402 msgid "B<--shrink part>"
28406 #: ../tools/virt-resize.pl:376
28408 "Shrink the named partition until the overall disk image fits in the "
28409 "destination. The named partition B<must> contain a filesystem or PV which "
28410 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
28411 "online tools). Virt-resize will check this and give an error if it has not "
28416 #: ../tools/virt-resize.pl:382
28418 "The amount by which the overall disk must be shrunk (after carrying out all "
28419 "other operations requested by the user) is called the \"deficit\". For "
28420 "example, a straight copy (assume no other operations) from a 5GB disk image "
28421 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
28422 "would give an error unless the user specified a partition to shrink and that "
28423 "partition had more than a gigabyte of free space."
28427 #: ../tools/virt-resize.pl:396
28428 msgid "B<--ignore part>"
28432 #: ../tools/virt-resize.pl:398
28434 "Ignore the named partition. Effectively this means the partition is "
28435 "allocated on the destination disk, but the content is not copied across from "
28436 "the source disk. The content of the partition will be blank (all zero "
28441 #: ../tools/virt-resize.pl:409
28442 msgid "B<--delete part>"
28446 #: ../tools/virt-resize.pl:411
28448 "Delete the named partition. It would be more accurate to describe this as "
28449 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
28450 "the original disk image is left intact."
28454 #: ../tools/virt-resize.pl:415
28456 "Note that when you delete a partition, then anything contained in the "
28457 "partition is also deleted. Furthermore, this causes any partitions that "
28458 "come after to be I<renumbered>, which can easily make your guest unbootable."
28462 #: ../tools/virt-resize.pl:426
28463 msgid "B<--LV-expand logvol>"
28467 #: ../tools/virt-resize.pl:428
28469 "This takes the logical volume and, as a final step, expands it to fill all "
28470 "the space available in its volume group. A typical usage, assuming a Linux "
28471 "guest with a single PV C</dev/sda2> and a root device called "
28472 "C</dev/vg_guest/lv_root> would be:"
28476 #: ../tools/virt-resize.pl:433
28479 " virt-resize indisk outdisk \\\n"
28480 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
28485 #: ../tools/virt-resize.pl:436
28487 "This would first expand the partition (and PV), and then expand the root "
28488 "device to fill the extra space in the PV."
28492 #: ../tools/virt-resize.pl:439
28494 "The contents of the LV are also resized if virt-resize knows how to do "
28495 "that. You can stop virt-resize from trying to expand the content by using "
28496 "the option C<--no-expand-content>."
28500 #: ../tools/virt-resize.pl:443
28501 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
28505 #: ../tools/virt-resize.pl:446
28507 "You can give this option multiple times, I<but> it doesn't make sense to do "
28508 "this unless the logical volumes you specify are all in different volume "
28513 #: ../tools/virt-resize.pl:454
28514 msgid "B<--no-copy-boot-loader>"
28518 #: ../tools/virt-resize.pl:456
28520 "By default, virt-resize copies over some sectors at the start of the disk "
28521 "(up to the beginning of the first partition). Commonly these sectors "
28522 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28523 "in order for the guest to boot correctly."
28527 #: ../tools/virt-resize.pl:461
28529 "If you specify this flag, then this initial copy is not done. You may need "
28530 "to reinstall the boot loader in this case."
28534 #: ../tools/virt-resize.pl:469
28535 msgid "B<--no-extra-partition>"
28539 #: ../tools/virt-resize.pl:471
28541 "By default, virt-resize creates an extra partition if there is any extra, "
28542 "unused space after all resizing has happened. Use this option to prevent "
28543 "the extra partition from being created. If you do this then the extra space "
28544 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28545 "tool in the guest."
28549 #: ../tools/virt-resize.pl:477
28551 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28556 #: ../tools/virt-resize.pl:484
28557 msgid "B<--no-expand-content>"
28561 #: ../tools/virt-resize.pl:486
28563 "By default, virt-resize will try to expand the direct contents of "
28564 "partitions, if it knows how (see C<--expand> option above)."
28568 #: ../tools/virt-resize.pl:489
28570 "If you give the C<--no-expand-content> option then virt-resize will not "
28575 #: ../tools/virt-resize.pl:496
28576 msgid "B<-d> | B<--debug>"
28580 #: ../tools/virt-resize.pl:504
28581 msgid "B<-n> | B<--dryrun>"
28585 #: ../tools/virt-resize.pl:506
28586 msgid "Print a summary of what would be done, but don't do anything."
28590 #: ../tools/virt-resize.pl:512
28591 msgid "B<-q> | B<--quiet>"
28595 #: ../tools/virt-resize.pl:514
28596 msgid "Don't print the summary."
28600 #: ../tools/virt-resize.pl:522
28602 "Specify the format of the input disk image. If this flag is not given then "
28603 "it is auto-detected from the image itself."
28607 #: ../tools/virt-resize.pl:528
28609 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28610 "AND NON-SPARSE RAW FORMATS>."
28614 #: ../tools/virt-resize.pl:535
28615 msgid "B<--output-format> raw"
28619 #: ../tools/virt-resize.pl:537
28621 "Specify the format of the output disk image. If this flag is not given then "
28622 "it is auto-detected from the image itself."
28626 #: ../tools/virt-resize.pl:543
28628 "Note that you still need to create the output disk with the right format. "
28629 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28633 #: ../tools/virt-resize.pl:1419
28638 #: ../tools/virt-resize.pl:1421
28639 msgid "\"Partition 1 does not end on cylinder boundary.\""
28643 #: ../tools/virt-resize.pl:1423
28645 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28646 "means the partitions will not be aligned to the ancient CHS geometry. "
28647 "However CHS geometry is meaningless for disks manufactured since the early "
28648 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28649 "cylinders is not required by any modern operating system."
28653 #: ../tools/virt-resize.pl:1430
28654 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28658 #: ../tools/virt-resize.pl:1432
28660 "In Windows Vista and later versions, Microsoft switched to using a separate "
28661 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28662 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28663 "the boot partition. Doing so seems to break the guest completely. However "
28664 "expanding the second partition (ie. C: drive) should work."
28668 #: ../tools/virt-resize.pl:1439
28670 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28671 "NTFS partitions have been expanded. This is just a safety check and (unless "
28672 "it find errors) is nothing to worry about."
28676 #: ../tools/virt-resize.pl:1443
28677 msgid "GUEST BOOT STUCK AT \"GRUB\""
28681 #: ../tools/virt-resize.pl:1445
28683 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28684 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28685 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28686 "although we think is to do with partition alignment."
28690 #: ../tools/virt-resize.pl:1450
28693 " guestfish -i -a newdisk\n"
28694 " ><fs> cat /boot/grub/device.map\n"
28695 " # check the contents of this file are sensible or\n"
28696 " # edit the file if necessary\n"
28697 " ><fs> grub-install / /dev/vda\n"
28703 #: ../tools/virt-resize.pl:1457
28705 "For more flexible guest reconfiguration, including if you need to specify "
28706 "other parameters to grub-install, use L<virt-rescue(1)>."
28710 #: ../tools/virt-resize.pl:1460
28711 msgid "ALTERNATIVE TOOLS"
28715 #: ../tools/virt-resize.pl:1462
28717 "There are several proprietary tools for resizing partitions. We won't "
28718 "mention any here."
28722 #: ../tools/virt-resize.pl:1465
28724 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28725 "operations on disk images. They can resize and move partitions, but I don't "
28726 "think they can do anything with the contents, and they certainly don't "
28731 #: ../tools/virt-resize.pl:1470
28733 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28734 "but at a much lower level. You will probably end up hand-calculating sector "
28735 "offsets, which is something that virt-resize was designed to avoid. If you "
28736 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28741 #: ../tools/virt-resize.pl:1485
28743 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
28744 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
28745 "L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
28746 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
28747 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28751 #: ../tools/virt-list-filesystems.pl:32
28752 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28756 #: ../tools/virt-list-filesystems.pl:36
28759 " virt-list-filesystems [--options] domname\n"
28764 #: ../tools/virt-list-filesystems.pl:38
28767 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28772 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
28774 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
28779 #: ../tools/virt-list-filesystems.pl:45
28781 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28782 "are contained in a virtual machine or disk image."
28786 #: ../tools/virt-list-filesystems.pl:49
28788 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28789 "functionality. For more complex cases you should look at the "
28790 "L<guestfish(1)> tool."
28794 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
28795 msgid "B<-l> | B<--long>"
28799 #: ../tools/virt-list-filesystems.pl:108
28801 "With this option, C<virt-list-filesystems> displays the type of each "
28802 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28806 #: ../tools/virt-list-filesystems.pl:115
28807 msgid "B<-a> | B<--all>"
28811 #: ../tools/virt-list-filesystems.pl:117
28813 "Normally we only show mountable filesystems. If this option is given then "
28814 "swap devices are shown too."
28818 #: ../tools/virt-list-filesystems.pl:191
28820 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
28821 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
28822 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28826 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
28827 msgid "Copyright (C) 2009 Red Hat Inc."
28831 #: ../tools/virt-tar.pl:33
28832 msgid "virt-tar - Extract or upload files to a virtual machine"
28836 #: ../tools/virt-tar.pl:37
28839 " virt-tar [--options] -x domname directory tarball\n"
28844 #: ../tools/virt-tar.pl:39
28847 " virt-tar [--options] -u domname tarball directory\n"
28852 #: ../tools/virt-tar.pl:41
28855 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28860 #: ../tools/virt-tar.pl:43
28863 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28868 #: ../tools/virt-tar.pl:47
28870 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
28871 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
28875 #: ../tools/virt-tar.pl:52
28876 msgid "Download C</home> from the VM into a local tarball:"
28880 #: ../tools/virt-tar.pl:54
28883 " virt-tar -x domname /home home.tar\n"
28888 #: ../tools/virt-tar.pl:56
28891 " virt-tar -zx domname /home home.tar.gz\n"
28896 #: ../tools/virt-tar.pl:58
28897 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28901 #: ../tools/virt-tar.pl:60
28904 " virt-tar -u domname uploadstuff.tar /tmp\n"
28909 #: ../tools/virt-tar.pl:62
28912 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28917 #: ../tools/virt-tar.pl:66
28919 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28920 "virtual machines. If you do this, you risk disk corruption in the VM. "
28921 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28925 #: ../tools/virt-tar.pl:71
28927 "You can use C<-x> (extract) on live virtual machines, but you might get "
28928 "inconsistent results or errors if there is filesystem activity inside the "
28929 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28930 "work, but the only way to guarantee consistent results is if the virtual "
28931 "machine is shut down."
28935 #: ../tools/virt-tar.pl:79
28937 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28938 "parts of a guest filesystem. There are many possibilities: making backups, "
28939 "uploading data files, snooping on guest activity, fixing or customizing "
28944 #: ../tools/virt-tar.pl:84
28946 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28947 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28948 "should look at the L<guestfish(1)> tool."
28952 #: ../tools/virt-tar.pl:88
28954 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28955 "its contents (recursively) from the virtual machine into a local tarball. "
28956 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28957 "virtual machine. You cannot use these two options together."
28961 #: ../tools/virt-tar.pl:94
28963 "In addition, you may need to use the C<-z> (gZip) option to enable "
28964 "compression. When uploading, you have to specify C<-z> if the upload file "
28965 "is compressed because virt-tar won't detect this on its own."
28969 #: ../tools/virt-tar.pl:98
28971 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28972 "example it cannot do PKZip files or bzip2 compression. If you want that "
28973 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28974 "the L<libguestfs(3)> API)."
28978 #: ../tools/virt-tar.pl:156
28979 msgid "B<-x> | B<--extract> | B<--download>"
28983 #: ../tools/virt-tar.pl:158
28984 msgid "B<-u> | B<--upload>"
28988 #: ../tools/virt-tar.pl:160
28990 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28995 #: ../tools/virt-tar.pl:163
28997 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28998 "Please read the L</WARNING> section above before using this option."
29002 #: ../tools/virt-tar.pl:167
29003 msgid "You must specify exactly one of these options."
29007 #: ../tools/virt-tar.pl:173
29008 msgid "B<-z> | B<--gzip>"
29012 #: ../tools/virt-tar.pl:175
29013 msgid "Specify that the input or output tarball is gzip-compressed."
29017 #: ../tools/virt-tar.pl:288
29019 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
29020 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
29021 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
29022 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29026 #: ../tools/virt-make-fs.pl:37
29027 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
29031 #: ../tools/virt-make-fs.pl:41
29034 " virt-make-fs [--options] input.tar output.img\n"
29039 #: ../tools/virt-make-fs.pl:43
29042 " virt-make-fs [--options] input.tar.gz output.img\n"
29047 #: ../tools/virt-make-fs.pl:45
29050 " virt-make-fs [--options] directory output.img\n"
29055 #: ../tools/virt-make-fs.pl:49
29057 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
29058 "archive or some files in a directory. It is similar to tools like "
29059 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
29060 "it can create common filesystem types like ext2/3 or NTFS, which can be "
29061 "useful if you want to attach these filesystems to existing virtual machines "
29062 "(eg. to import large amounts of read-only data to a VM)."
29066 #: ../tools/virt-make-fs.pl:57
29067 msgid "Basic usage is:"
29071 #: ../tools/virt-make-fs.pl:59
29074 " virt-make-fs input output\n"
29079 #: ../tools/virt-make-fs.pl:61
29081 "where C<input> is either a directory containing files that you want to add, "
29082 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
29083 "C<output> is a disk image. The input type is detected automatically. The "
29084 "output disk image defaults to a raw ext2 image unless you specify extra "
29085 "flags (see L</OPTIONS> below)."
29089 #: ../tools/virt-make-fs.pl:67
29090 msgid "EXTRA SPACE"
29094 #: ../tools/virt-make-fs.pl:69
29096 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
29097 "the files that it contains, but might have extra space. Depending on how "
29098 "you are going to use the output, you might think this extra space is wasted "
29099 "and want to minimize it, or you might want to leave space so that more files "
29100 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
29101 "but you can use the C<--size> flag to leave space in the filesystem if you "
29106 #: ../tools/virt-make-fs.pl:77
29108 "An alternative way to leave extra space but not make the output image any "
29109 "bigger is to use an alternative disk image format (instead of the default "
29110 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
29111 "image format (check your hypervisor supports this before using it). This "
29112 "allows you to choose a large C<--size> but the extra space won't actually be "
29113 "allocated in the image until you try to store something in it."
29117 #: ../tools/virt-make-fs.pl:85
29119 "Don't forget that you can also use local commands including L<resize2fs(8)> "
29120 "and L<virt-resize(1)> to resize existing filesystems, or rerun "
29121 "virt-make-resize to build another image from scratch."
29125 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
29130 #: ../tools/virt-make-fs.pl:91
29133 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
29138 #: ../tools/virt-make-fs.pl:93
29139 msgid "FILESYSTEM TYPE"
29143 #: ../tools/virt-make-fs.pl:95
29145 "The default filesystem type is C<ext2>. Just about any filesystem type that "
29146 "libguestfs supports can be used (but I<not> read-only formats like "
29147 "ISO9660). Here are some of the more common choices:"
29151 #: ../tools/virt-make-fs.pl:101
29156 #: ../tools/virt-make-fs.pl:103
29158 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
29159 "you are not going to use the filesystem in a way that requires the journal, "
29160 "then this is just wasted overhead."
29164 #: ../tools/virt-make-fs.pl:107
29165 msgid "I<ntfs> or I<vfat>"
29169 #: ../tools/virt-make-fs.pl:109
29170 msgid "Useful if exporting data to a Windows guest."
29174 #: ../tools/virt-make-fs.pl:111
29176 "I<Note for vfat>: The tar archive or local directory must only contain files "
29177 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
29178 "program running within libguestfs is unable to change the ownership of "
29179 "non-root files, since vfat itself does not support this."
29183 #: ../tools/virt-make-fs.pl:116
29188 #: ../tools/virt-make-fs.pl:118
29190 "Lower overhead than C<ext2>, but certain limitations on filename length and "
29191 "total filesystem size."
29195 #: ../tools/virt-make-fs.pl:125
29198 " virt-make-fs --type=minix input minixfs.img\n"
29203 #: ../tools/virt-make-fs.pl:127
29204 msgid "TO PARTITION OR NOT TO PARTITION"
29208 #: ../tools/virt-make-fs.pl:129
29209 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29213 #: ../tools/virt-make-fs.pl:131
29215 "Adding a partition can make the disk image more compatible with certain "
29216 "virtualized operating systems which don't expect to see a filesystem "
29217 "directly located on a block device (Linux doesn't care and will happily "
29218 "handle both types)."
29222 #: ../tools/virt-make-fs.pl:136
29224 "On the other hand, if you have a partition table then the output image is no "
29225 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29226 "directly on a partitioned disk image. (However libguestfs tools such as "
29227 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29231 #: ../tools/virt-make-fs.pl:144
29232 msgid "Add an MBR partition:"
29236 #: ../tools/virt-make-fs.pl:146
29239 " virt-make-fs --partition -- input disk.img\n"
29244 #: ../tools/virt-make-fs.pl:148
29246 "If the output disk image could be terabyte-sized or larger, it's better to "
29247 "use an EFI/GPT-compatible partition table:"
29251 #: ../tools/virt-make-fs.pl:151
29254 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29259 #: ../tools/virt-make-fs.pl:179
29260 msgid "Enable debugging information."
29264 #: ../tools/virt-make-fs.pl:185
29265 msgid "B<--size=E<lt>NE<gt>>"
29269 #: ../tools/virt-make-fs.pl:187
29270 msgid "B<--size=+E<lt>NE<gt>>"
29274 #: ../tools/virt-make-fs.pl:189
29275 msgid "B<-s E<lt>NE<gt>>"
29279 #: ../tools/virt-make-fs.pl:191
29280 msgid "B<-s +E<lt>NE<gt>>"
29284 #: ../tools/virt-make-fs.pl:193
29285 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
29289 #: ../tools/virt-make-fs.pl:196
29291 "If this option is I<not> given, then the output image will be just large "
29292 "enough to contain all the files, with not much wasted space."
29296 #: ../tools/virt-make-fs.pl:199
29298 "To choose a fixed size output disk, specify an absolute number followed by "
29299 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29300 "Petabytes or Exabytes. This must be large enough to contain all the input "
29301 "files, else you will get an error."
29305 #: ../tools/virt-make-fs.pl:204
29307 "To leave extra space, specify C<+> (plus sign) and a number followed by "
29308 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29309 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29310 "the input files, and (approximately) an extra 200 MB free space."
29314 #: ../tools/virt-make-fs.pl:210
29316 "Note that virt-make-fs estimates free space, and therefore will not produce "
29317 "filesystems containing precisely the free space requested. (It is much more "
29318 "expensive and time-consuming to produce a filesystem which has precisely the "
29319 "desired free space)."
29323 #: ../tools/virt-make-fs.pl:219
29324 msgid "B<--format=E<lt>fmtE<gt>>"
29328 #: ../tools/virt-make-fs.pl:221
29329 msgid "B<-F E<lt>fmtE<gt>>"
29333 #: ../tools/virt-make-fs.pl:223
29334 msgid "Choose the output disk image format."
29338 #: ../tools/virt-make-fs.pl:225
29339 msgid "The default is C<raw> (raw disk image)."
29343 #: ../tools/virt-make-fs.pl:227
29345 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29346 "that would really make sense here is C<qcow2>."
29350 #: ../tools/virt-make-fs.pl:234
29351 msgid "B<--type=E<lt>fsE<gt>>"
29355 #: ../tools/virt-make-fs.pl:236
29356 msgid "B<-t E<lt>fsE<gt>>"
29360 #: ../tools/virt-make-fs.pl:238
29361 msgid "Choose the output filesystem type."
29365 #: ../tools/virt-make-fs.pl:240
29366 msgid "The default is C<ext2>."
29370 #: ../tools/virt-make-fs.pl:242
29371 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
29375 #: ../tools/virt-make-fs.pl:249
29376 msgid "B<--partition>"
29380 #: ../tools/virt-make-fs.pl:251
29381 msgid "B<--partition=E<lt>parttypeE<gt>>"
29385 #: ../tools/virt-make-fs.pl:253
29387 "If specified, this flag adds an MBR partition table to the output disk "
29392 #: ../tools/virt-make-fs.pl:256
29394 "You can change the partition table type, eg. C<--partition=gpt> for large "
29399 #: ../tools/virt-make-fs.pl:259
29401 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29402 "might consider the next parameter to be the partition type. For example:"
29406 #: ../tools/virt-make-fs.pl:263
29409 " virt-make-fs --partition input.tar ...\n"
29414 #: ../tools/virt-make-fs.pl:265
29416 "would cause virt-make-fs to think you wanted to use a partition type of "
29417 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29418 "dash) between options and the input file argument:"
29422 #: ../tools/virt-make-fs.pl:269
29425 " virt-make-fs --partition -- input.tar ...\n"
29430 #: ../tools/virt-make-fs.pl:536
29432 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
29433 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
29434 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29438 #: ../tools/virt-make-fs.pl:553
29441 " export LIBGUESTFS_DEBUG=1\n"
29442 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29447 #: ../tools/virt-make-fs.pl:556
29449 "Attach /tmp/virt-make-fs.log to a new bug report at "
29450 "L<https://bugzilla.redhat.com/>"
29454 #: ../tools/virt-list-partitions.pl:32
29455 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
29459 #: ../tools/virt-list-partitions.pl:36
29462 " virt-list-partitions [--options] domname\n"
29467 #: ../tools/virt-list-partitions.pl:38
29470 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29475 #: ../tools/virt-list-partitions.pl:45
29477 "C<virt-list-partitions> is a command line tool to list the partitions that "
29478 "are contained in a virtual machine or disk image. It is mainly useful as a "
29479 "first step to using L<virt-resize(1)>."
29483 #: ../tools/virt-list-partitions.pl:50
29485 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29486 "functionality. For more complex cases you should look at the "
29487 "L<guestfish(1)> tool."
29491 #: ../tools/virt-list-partitions.pl:107
29492 msgid "B<-h> | B<--human-readable>"
29496 #: ../tools/virt-list-partitions.pl:109
29497 msgid "Show sizes in human-readable form (eg. \"1G\")."
29501 #: ../tools/virt-list-partitions.pl:117
29503 "With this option, C<virt-list-partitions> displays the type and size of each "
29504 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29508 #: ../tools/virt-list-partitions.pl:124
29509 msgid "B<-t> | B<--total>"
29513 #: ../tools/virt-list-partitions.pl:126
29514 msgid "Display the total size of each block device (as a separate row or rows)."
29518 #: ../tools/virt-list-partitions.pl:259
29520 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
29521 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
29522 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."