1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2010-12-19 15:38+0000\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
21 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
22 #: ../tools/virt-edit.pl:30 ../tools/virt-win-reg.pl:33
23 #: ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28
24 #: ../tools/virt-tar.pl:29 ../tools/virt-make-fs.pl:33
25 #: ../tools/virt-list-partitions.pl:28
30 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
31 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
32 #: ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35
33 #: ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30
34 #: ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35
35 #: ../tools/virt-list-partitions.pl:30
40 #: ../src/guestfs.pod:5
41 msgid "guestfs - Library for accessing and modifying virtual machine images"
45 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
46 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
47 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39
48 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
49 #: ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39
50 #: ../tools/virt-list-partitions.pl:34
55 #: ../src/guestfs.pod:9
58 " #include <guestfs.h>\n"
63 #: ../src/guestfs.pod:11
66 " guestfs_h *g = guestfs_create ();\n"
67 " guestfs_add_drive (g, \"guest.img\");\n"
68 " guestfs_launch (g);\n"
69 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
70 " guestfs_touch (g, \"/hello\");\n"
71 " guestfs_umount (g, \"/\");\n"
72 " guestfs_close (g);\n"
77 #: ../src/guestfs.pod:19
80 " cc prog.c -o prog -lguestfs\n"
82 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
87 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30
88 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
89 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63
90 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
91 #: ../tools/virt-tar.pl:72 ../tools/virt-make-fs.pl:47
92 #: ../tools/virt-list-partitions.pl:40
97 #: ../src/guestfs.pod:25
99 "Libguestfs is a library for accessing and modifying guest disk images. "
100 "Amongst the things this is good for: making batch configuration changes to "
101 "guests, getting disk used/free statistics (see also: virt-df), migrating "
102 "between virtualization systems (see also: virt-p2v), performing partial "
103 "backups, performing partial guest clones, cloning guests and changing "
104 "registry/UUID/hostname info, and much else besides."
108 #: ../src/guestfs.pod:33
110 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
111 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
112 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
117 #: ../src/guestfs.pod:38
119 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
120 "what filesystem is in each LV, etc.). It can also run commands in the "
121 "context of the guest. Also you can access filesystems over FUSE."
125 #: ../src/guestfs.pod:43
127 "Libguestfs is a library that can be linked with C and C++ management "
128 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
129 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
134 #: ../src/guestfs.pod:48
136 "You don't need to be root to use libguestfs, although obviously you do need "
137 "enough permissions to access the disk images."
141 #: ../src/guestfs.pod:51
143 "Libguestfs is a large API because it can do many things. For a gentle "
144 "introduction, please read the L</API OVERVIEW> section next."
148 #: ../src/guestfs.pod:54
150 "There are also some example programs in the L<guestfs-examples(3)> manual "
155 #: ../src/guestfs.pod:57
160 #: ../src/guestfs.pod:59
162 "This section provides a gentler overview of the libguestfs API. We also try "
163 "to group API calls together, where that may not be obvious from reading "
164 "about the individual calls in the main section of this manual."
168 #: ../src/guestfs.pod:64
173 #: ../src/guestfs.pod:66
175 "Before you can use libguestfs calls, you have to create a handle. Then you "
176 "must add at least one disk image to the handle, followed by launching the "
177 "handle, then performing whatever operations you want, and finally closing "
178 "the handle. By convention we use the single letter C<g> for the name of the "
179 "handle variable, although of course you can use any name you want."
183 #: ../src/guestfs.pod:73
184 msgid "The general structure of all libguestfs-using programs looks like this:"
188 #: ../src/guestfs.pod:76
191 " guestfs_h *g = guestfs_create ();\n"
196 #: ../src/guestfs.pod:78
199 " /* Call guestfs_add_drive additional times if there are\n"
200 " * multiple disk images.\n"
202 " guestfs_add_drive (g, \"guest.img\");\n"
207 #: ../src/guestfs.pod:83
210 " /* Most manipulation calls won't work until you've launched\n"
211 " * the handle 'g'. You have to do this _after_ adding drives\n"
212 " * and _before_ other commands.\n"
214 " guestfs_launch (g);\n"
219 #: ../src/guestfs.pod:89
222 " /* Now you can examine what partitions, LVs etc are available.\n"
224 " char **partitions = guestfs_list_partitions (g);\n"
225 " char **logvols = guestfs_lvs (g);\n"
230 #: ../src/guestfs.pod:94
233 " /* To access a filesystem in the image, you must mount it.\n"
235 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
240 #: ../src/guestfs.pod:98
243 " /* Now you can perform filesystem actions on the guest\n"
246 " guestfs_touch (g, \"/hello\");\n"
251 #: ../src/guestfs.pod:103
254 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
255 " * it is done automatically when you close the handle. See\n"
256 " * discussion of autosync in this page.\n"
258 " guestfs_sync (g);\n"
263 #: ../src/guestfs.pod:109
266 " /* Close the handle 'g'. */\n"
267 " guestfs_close (g);\n"
272 #: ../src/guestfs.pod:112
274 "The code above doesn't include any error checking. In real code you should "
275 "check return values carefully for errors. In general all functions that "
276 "return integers return C<-1> on error, and all functions that return "
277 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
278 "how to handle errors, and consult the documentation for each function call "
279 "below to see precisely how they return error indications. See L<guestfs-"
280 "examples(3)> for fully worked examples."
284 #: ../src/guestfs.pod:121
289 #: ../src/guestfs.pod:123
291 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
292 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
293 "actual block device, or simply an empty file of zeroes that you have created "
294 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
299 #: ../src/guestfs.pod:129
301 "The call you should use in modern code for adding drives is L</"
302 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
303 "specifying that the format is raw, do:"
307 #: ../src/guestfs.pod:133
310 " guestfs_add_drive_opts (g, filename,\n"
311 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
317 #: ../src/guestfs.pod:137
318 msgid "You can add a disk read-only using:"
322 #: ../src/guestfs.pod:139
325 " guestfs_add_drive_opts (g, filename,\n"
326 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
327 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
333 #: ../src/guestfs.pod:144
335 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
336 "libguestfs won't modify the file."
340 #: ../src/guestfs.pod:147
342 "Be extremely cautious if the disk image is in use, eg. if it is being used "
343 "by a virtual machine. Adding it read-write will almost certainly cause disk "
344 "corruption, but adding it read-only is safe."
348 #: ../src/guestfs.pod:151
350 "You must add at least one disk image, and you may add multiple disk images. "
351 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
352 "first one you added), C</dev/sdb> (for the second one you added), etc."
356 #: ../src/guestfs.pod:156
358 "Once L</guestfs_launch> has been called you cannot add any more images. You "
359 "can call L</guestfs_list_devices> to get a list of the device names, in the "
360 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
364 #: ../src/guestfs.pod:161
369 #: ../src/guestfs.pod:163
371 "Before you can read or write files, create directories and so on in a disk "
372 "image that contains filesystems, you have to mount those filesystems using "
373 "L</guestfs_mount>. If you already know that a disk image contains (for "
374 "example) one partition with a filesystem on that partition, then you can "
379 #: ../src/guestfs.pod:169
382 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
387 #: ../src/guestfs.pod:171
389 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
390 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
391 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
395 #: ../src/guestfs.pod:175
397 "If you are given a disk image and you don't know what it contains then you "
398 "have to find out. Libguestfs can do that too: use L</"
399 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
400 "LVs, and either try mounting each to see what is mountable, or else examine "
401 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
402 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
403 "you might find it easier to look at higher level programs built on top of "
404 "libguestfs, in particular L<virt-inspector(1)>."
408 #: ../src/guestfs.pod:185
410 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
411 "several other variations of the C<guestfs_mount_*> call."
415 #: ../src/guestfs.pod:188
416 msgid "FILESYSTEM ACCESS AND MODIFICATION"
420 #: ../src/guestfs.pod:190
422 "The majority of the libguestfs API consists of fairly low-level calls for "
423 "accessing and modifying the files, directories, symlinks etc on mounted "
424 "filesystems. There are over a hundred such calls which you can find listed "
425 "in detail below in this man page, and we don't even pretend to cover them "
426 "all in this overview."
430 #: ../src/guestfs.pod:196
432 "Specify filenames as full paths, starting with C<\"/\"> and including the "
437 #: ../src/guestfs.pod:199
439 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
440 "the file called C<\"etc/passwd\"> then you could do:"
444 #: ../src/guestfs.pod:202
447 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
452 #: ../src/guestfs.pod:204
454 "This would return C<data> as a newly allocated buffer containing the full "
455 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
456 "or C<NULL> if there was an error."
460 #: ../src/guestfs.pod:208
462 "As another example, to create a top-level directory on that filesystem "
463 "called C<\"var\"> you would do:"
467 #: ../src/guestfs.pod:211
470 " guestfs_mkdir (g, \"/var\");\n"
475 #: ../src/guestfs.pod:213
476 msgid "To create a symlink you could do:"
480 #: ../src/guestfs.pod:215
483 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
484 " \"/etc/rc3.d/S30portmap\");\n"
489 #: ../src/guestfs.pod:218
491 "Libguestfs will reject attempts to use relative paths and there is no "
492 "concept of a current working directory."
496 #: ../src/guestfs.pod:221
498 "Libguestfs can return errors in many situations: for example if the "
499 "filesystem isn't writable, or if a file or directory that you requested "
500 "doesn't exist. If you are using the C API (documented here) you have to "
501 "check for those error conditions after each call. (Other language bindings "
502 "turn these errors into exceptions)."
506 #: ../src/guestfs.pod:227
508 "File writes are affected by the per-handle umask, set by calling L</"
509 "guestfs_umask> and defaulting to 022. See L</UMASK>."
513 #: ../src/guestfs.pod:230
518 #: ../src/guestfs.pod:232
520 "Libguestfs contains API calls to read, create and modify partition tables on "
525 #: ../src/guestfs.pod:235
527 "In the common case where you want to create a single partition covering the "
528 "whole disk, you should use the L</guestfs_part_disk> call:"
532 #: ../src/guestfs.pod:239
535 " const char *parttype = \"mbr\";\n"
536 " if (disk_is_larger_than_2TB)\n"
537 " parttype = \"gpt\";\n"
538 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
543 #: ../src/guestfs.pod:244
545 "Obviously this effectively wipes anything that was on that disk image before."
549 #: ../src/guestfs.pod:247
554 #: ../src/guestfs.pod:249
556 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
557 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
558 "you familiarize yourself with the concepts of physical volumes, volume "
559 "groups and logical volumes."
563 #: ../src/guestfs.pod:254
565 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
566 "tldp.org/HOWTO/LVM-HOWTO/>."
570 #: ../src/guestfs.pod:257
575 #: ../src/guestfs.pod:259
577 "Use L</guestfs_cat> to download small, text only files. This call is "
578 "limited to files which are less than 2 MB and which cannot contain any ASCII "
579 "NUL (C<\\0>) characters. However it has a very simple to use API."
583 #: ../src/guestfs.pod:264
585 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
586 "bit data, since it returns a (pointer, size) pair. However it is still "
587 "limited to \"small\" files, less than 2 MB."
591 #: ../src/guestfs.pod:268
593 "L</guestfs_download> can be used to download any file, with no limits on "
594 "content or size (even files larger than 4 GB)."
598 #: ../src/guestfs.pod:271
600 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
604 #: ../src/guestfs.pod:274
609 #: ../src/guestfs.pod:276
611 "It's often the case that you want to write a file or files to the disk image."
615 #: ../src/guestfs.pod:279
617 "To write a small file with fixed content, use L</guestfs_write>. To create "
618 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
619 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
620 "of other functions for creating test files, for example L</guestfs_fill> and "
621 "L</guestfs_fill_pattern>."
625 #: ../src/guestfs.pod:285
627 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
628 "file content or size (even files larger than 4 GB)."
632 #: ../src/guestfs.pod:288
634 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
638 #: ../src/guestfs.pod:290
640 "However the fastest way to upload I<large numbers of arbitrary files> is to "
641 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
642 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
643 "in a predictable way (eg. adding it last after all other drives) then you "
644 "can get the device name from L</guestfs_list_devices> and mount it directly "
645 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
646 "portable between kernel versions, and they don't support labels or UUIDs. "
647 "If you want to pre-build an image or you need to mount it using a label or "
648 "UUID, use an ISO image instead."
652 #: ../src/guestfs.pod:301
657 #: ../src/guestfs.pod:303
659 "There are various different commands for copying between files and devices "
660 "and in and out of the guest filesystem. These are summarised in the table "
665 #: ../src/guestfs.pod:309
666 msgid "B<file> to B<file>"
670 #: ../src/guestfs.pod:311
672 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
673 "directories recursively."
677 #: ../src/guestfs.pod:314
678 msgid "B<file or device> to B<file or device>"
682 #: ../src/guestfs.pod:316
684 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
685 "devices in the guest."
689 #: ../src/guestfs.pod:319
690 msgid "Example: duplicate the contents of an LV:"
694 #: ../src/guestfs.pod:321
697 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
702 #: ../src/guestfs.pod:323
704 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
705 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
706 "guestfs_copy_size>."
710 #: ../src/guestfs.pod:327
711 msgid "B<file on the host> to B<file or device>"
715 #: ../src/guestfs.pod:329
716 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
720 #: ../src/guestfs.pod:331
721 msgid "B<file or device> to B<file on the host>"
725 #: ../src/guestfs.pod:333
726 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
730 #: ../src/guestfs.pod:337
731 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
735 #: ../src/guestfs.pod:339
737 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
738 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
739 "appears you can only upload and download to files. However many Un*x-like "
740 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
741 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
742 "and arbitrary file descriptor N."
746 #: ../src/guestfs.pod:347
747 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
751 #: ../src/guestfs.pod:350
754 " guestfs_download (filename, \"/dev/stdout\");\n"
759 #: ../src/guestfs.pod:352
760 msgid "and you can write tar output to a pipe C<fd> by doing:"
764 #: ../src/guestfs.pod:354
768 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
769 " guestfs_tar_out (\"/\", devfd);\n"
774 #: ../src/guestfs.pod:358
775 msgid "LISTING FILES"
779 #: ../src/guestfs.pod:360
781 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
782 "L<guestfish(1)>-equivalent command C<ll>)."
786 #: ../src/guestfs.pod:363
788 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
789 "programs, as a flat list of strings."
793 #: ../src/guestfs.pod:366
795 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
796 "directory, plus additional information about each one. It is more "
797 "equivalent to using the L<readdir(3)> call on a local filesystem."
801 #: ../src/guestfs.pod:370
803 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
807 #: ../src/guestfs.pod:373
808 msgid "RUNNING COMMANDS"
812 #: ../src/guestfs.pod:375
814 "Although libguestfs is primarily an API for manipulating files inside guest "
815 "images, we also provide some limited facilities for running commands inside "
820 #: ../src/guestfs.pod:379
821 msgid "There are many limitations to this:"
825 #: ../src/guestfs.pod:383 ../src/guestfs.pod:388 ../src/guestfs.pod:393
826 #: ../src/guestfs.pod:397 ../src/guestfs.pod:402 ../src/guestfs.pod:406
827 #: ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:1006
828 #: ../src/guestfs.pod:1010 ../src/guestfs.pod:1014 ../src/guestfs.pod:1019
829 #: ../src/guestfs.pod:1027 ../src/guestfs.pod:1046 ../src/guestfs.pod:1054
830 #: ../src/guestfs.pod:1076 ../src/guestfs.pod:1080 ../src/guestfs.pod:1084
831 #: ../src/guestfs.pod:1088 ../src/guestfs.pod:1092 ../src/guestfs.pod:1096
832 #: ../src/guestfs.pod:1578 ../src/guestfs.pod:1583 ../src/guestfs.pod:1587
833 #: ../src/guestfs.pod:1697 ../src/guestfs.pod:1702 ../src/guestfs.pod:1706
834 #: ../src/guestfs.pod:2058 ../src/guestfs.pod:2064 ../src/guestfs.pod:2069
835 #: ../src/guestfs.pod:2075 ../src/guestfs.pod:2187 ../src/guestfs.pod:2191
836 #: ../src/guestfs.pod:2195 ../src/guestfs.pod:2199
837 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
838 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:579
839 #: ../src/guestfs-actions.pod:586 ../src/guestfs-actions.pod:593
840 #: ../src/guestfs-actions.pod:1589 ../src/guestfs-actions.pod:1593
841 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:1601
842 #: ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1613
843 #: ../src/guestfs-actions.pod:1617 ../src/guestfs-actions.pod:1627
844 #: ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1635
845 #: ../src/guestfs-actions.pod:1773 ../src/guestfs-actions.pod:1777
846 #: ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1787
847 #: ../src/guestfs-actions.pod:1848 ../src/guestfs-actions.pod:1852
848 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish.pod:427
849 #: ../fish/guestfish.pod:431 ../fish/guestfish.pod:435
850 #: ../fish/guestfish.pod:439 ../fish/guestfish-actions.pod:13
851 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375
852 #: ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390
853 #: ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067
854 #: ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075
855 #: ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087
856 #: ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095
857 #: ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109
858 #: ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203
859 #: ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212
860 #: ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259
861 #: ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268
862 #: ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542
863 #: ../tools/virt-win-reg.pl:548 ../tools/virt-resize.pl:345
864 #: ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
869 #: ../src/guestfs.pod:385
871 "The kernel version that the command runs under will be different from what "
876 #: ../src/guestfs.pod:390
878 "If the command needs to communicate with daemons, then most likely they "
883 #: ../src/guestfs.pod:395
884 msgid "The command will be running in limited memory."
888 #: ../src/guestfs.pod:399
890 "The network may not be available unless you enable it (see L</"
891 "guestfs_set_network>)."
895 #: ../src/guestfs.pod:404
896 msgid "Only supports Linux guests (not Windows, BSD, etc)."
900 #: ../src/guestfs.pod:408
902 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
906 #: ../src/guestfs.pod:413
908 "For SELinux guests, you may need to enable SELinux and load policy first. "
909 "See L</SELINUX> in this manpage."
913 #: ../src/guestfs.pod:418
915 "I<Security:> It is not safe to run commands from untrusted, possibly "
916 "malicious guests. These commands may attempt to exploit your program by "
917 "sending unexpected output. They could also try to exploit the Linux kernel "
918 "or qemu provided by the libguestfs appliance. They could use the network "
919 "provided by the libguestfs appliance to bypass ordinary network partitions "
920 "and firewalls. They could use the elevated privileges or different SELinux "
921 "context of your program to their advantage."
925 #: ../src/guestfs.pod:427
927 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
928 "(a script which runs when the guest next boots normally), and to have this "
929 "script run the commands you want in the normal context of the running guest, "
930 "network security and so on. For information about other security issues, "
935 #: ../src/guestfs.pod:435
937 "The two main API calls to run commands are L</guestfs_command> and L</"
938 "guestfs_sh> (there are also variations)."
942 #: ../src/guestfs.pod:438
944 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
945 "shell globs, redirections, etc will work."
949 #: ../src/guestfs.pod:441
950 msgid "CONFIGURATION FILES"
954 #: ../src/guestfs.pod:443
956 "To read and write configuration files in Linux guest filesystems, we "
957 "strongly recommend using Augeas. For example, Augeas understands how to "
958 "read and write, say, a Linux shadow password file or X.org configuration "
959 "file, and so avoids you having to write that code."
963 #: ../src/guestfs.pod:448
965 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
966 "document Augeas itself here because there is excellent documentation on the "
967 "L<http://augeas.net/> website."
971 #: ../src/guestfs.pod:452
973 "If you don't want to use Augeas (you fool!) then try calling L</"
974 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
979 #: ../src/guestfs.pod:456
984 #: ../src/guestfs.pod:458
986 "We support SELinux guests. To ensure that labeling happens correctly in "
987 "SELinux guests, you need to enable SELinux and load the guest's policy:"
991 #: ../src/guestfs.pod:464 ../src/guestfs.pod:1199 ../src/guestfs.pod:1330
996 #: ../src/guestfs.pod:466
997 msgid "Before launching, do:"
1001 #: ../src/guestfs.pod:468
1004 " guestfs_set_selinux (g, 1);\n"
1009 #: ../src/guestfs.pod:470 ../src/guestfs.pod:1203 ../src/guestfs.pod:1334
1014 #: ../src/guestfs.pod:472
1016 "After mounting the guest's filesystem(s), load the policy. This is best "
1017 "done by running the L<load_policy(8)> command in the guest itself:"
1021 #: ../src/guestfs.pod:476
1024 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
1029 #: ../src/guestfs.pod:478
1031 "(Older versions of C<load_policy> require you to specify the name of the "
1036 #: ../src/guestfs.pod:481 ../src/guestfs.pod:1340
1041 #: ../src/guestfs.pod:483
1043 "Optionally, set the security context for the API. The correct security "
1044 "context to use can only be known by inspecting the guest. As an example:"
1048 #: ../src/guestfs.pod:487
1051 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1056 #: ../src/guestfs.pod:491
1057 msgid "This will work for running commands and editing existing files."
1061 #: ../src/guestfs.pod:493
1063 "When new files are created, you may need to label them explicitly, for "
1064 "example by running the external command C<restorecon pathname>."
1068 #: ../src/guestfs.pod:497
1073 #: ../src/guestfs.pod:499
1075 "Certain calls are affected by the current file mode creation mask (the "
1076 "\"umask\"). In particular ones which create files or directories, such as "
1077 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1078 "either the default mode that the file is created with or modifies the mode "
1083 #: ../src/guestfs.pod:505
1085 "The default umask is C<022>, so files are created with modes such as C<0644> "
1086 "and directories with C<0755>."
1090 #: ../src/guestfs.pod:508
1092 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1093 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1094 "guestfs_chmod> after creating each file or directory."
1098 #: ../src/guestfs.pod:512
1099 msgid "For more information about umask, see L<umask(2)>."
1103 #: ../src/guestfs.pod:514 ../fish/guestfish.pod:720
1104 msgid "ENCRYPTED DISKS"
1108 #: ../src/guestfs.pod:516
1110 "Libguestfs allows you to access Linux guests which have been encrypted using "
1111 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1112 "standard. This includes nearly all whole disk encryption systems used by "
1113 "modern Linux guests."
1117 #: ../src/guestfs.pod:522
1119 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1120 "returns the string C<crypto_LUKS>)."
1124 #: ../src/guestfs.pod:525
1126 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1127 "will require the passphrase!"
1131 #: ../src/guestfs.pod:528
1133 "Opening a LUKS device creates a new device mapper device called C</dev/"
1134 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1135 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1136 "from and encrypted to the underlying block device respectively."
1140 #: ../src/guestfs.pod:534
1142 "LVM volume groups on the device can be made visible by calling L</"
1143 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1144 "(s) can now be mounted in the usual way."
1148 #: ../src/guestfs.pod:538
1150 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1151 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1152 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1153 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1154 "underlying encrypted block device)."
1158 #: ../src/guestfs.pod:545
1163 #: ../src/guestfs.pod:547
1165 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1166 "contains operating systems. (These APIs used to be in a separate Perl-only "
1167 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1168 "frequently used part of this library has been rewritten in C and moved into "
1173 #: ../src/guestfs.pod:553
1175 "Add all disks belonging to the unknown virtual machine and call L</"
1176 "guestfs_launch> in the usual way."
1180 #: ../src/guestfs.pod:556
1182 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1183 "and certain heuristics, and returns a list of operating systems that were "
1184 "found. An empty list means none were found. A single element is the root "
1185 "filesystem of the operating system. For dual- or multi-boot guests, "
1186 "multiple roots can be returned, each one corresponding to a separate "
1187 "operating system. (Multi-boot virtual machines are extremely rare in the "
1188 "world of virtualization, but since this scenario can happen, we have built "
1189 "libguestfs to deal with it.)"
1193 #: ../src/guestfs.pod:565
1195 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1196 "to get additional details about that operating system. For example, call L</"
1197 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1198 "Windows and Linux-based operating systems respectively."
1202 #: ../src/guestfs.pod:571
1204 "Un*x-like and Linux-based operating systems usually consist of several "
1205 "filesystems which are mounted at boot time (for example, a separate boot "
1206 "partition mounted on C</boot>). The inspection rules are able to detect how "
1207 "filesystems correspond to mount points. Call "
1208 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1209 "hash table like this example:"
1213 #: ../src/guestfs.pod:578
1216 " /boot => /dev/sda1\n"
1217 " / => /dev/vg_guest/lv_root\n"
1218 " /usr => /dev/vg_guest/lv_usr\n"
1223 #: ../src/guestfs.pod:582
1225 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1226 "filesystems as suggested."
1230 #: ../src/guestfs.pod:585
1232 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1233 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1237 #: ../src/guestfs.pod:589
1239 "Inspection currently only works for some common operating systems. "
1240 "Contributors are welcome to send patches for other operating systems that we "
1241 "currently cannot detect."
1245 #: ../src/guestfs.pod:593
1247 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1248 "for more details. The L</guestfs_inspect_os> function just ignores any "
1249 "encrypted devices."
1253 #: ../src/guestfs.pod:597
1255 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1256 "inspection and caches the results in the guest handle. Subsequent calls to "
1257 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1258 "read the disks. If you change the content of the guest disks, you can redo "
1259 "inspection by calling L</guestfs_inspect_os> again. (L</"
1260 "guestfs_inspect_list_applications> works a little differently from the other "
1261 "calls and does read the disks. See documentation for that function for "
1266 #: ../src/guestfs.pod:606
1267 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1271 #: ../src/guestfs.pod:608
1273 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1274 "ntfs-3g.org/> driver."
1278 #: ../src/guestfs.pod:611
1279 msgid "DRIVE LETTERS AND PATHS"
1283 #: ../src/guestfs.pod:613
1285 "DOS and Windows still use drive letters, and the filesystems are always "
1286 "treated as case insensitive by Windows itself, and therefore you might find "
1287 "a Windows configuration file referring to a path like C<c:\\windows"
1288 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1289 "might be referred to as C</WINDOWS/System32>."
1293 #: ../src/guestfs.pod:619
1295 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1296 "libguestfs to read the appropriate Windows Registry and configuration files, "
1297 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1302 #: ../src/guestfs.pod:624
1304 "Replacing backslash characters with forward slash characters is also outside "
1305 "the scope of libguestfs, but something that you can easily do."
1309 #: ../src/guestfs.pod:627
1311 "Where we can help is in resolving the case insensitivity of paths. For "
1312 "this, call L</guestfs_case_sensitive_path>."
1316 #: ../src/guestfs.pod:630
1317 msgid "ACCESSING THE WINDOWS REGISTRY"
1321 #: ../src/guestfs.pod:632
1323 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1324 "files, through the library C<hivex> which is part of the libguestfs project "
1325 "although ships as a separate tarball. You have to locate and download the "
1326 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1327 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1328 "reg(1)> for more help on this issue."
1332 #: ../src/guestfs.pod:640
1333 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1337 #: ../src/guestfs.pod:642
1339 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1340 "provide something which looks like a Linux symlink. The way it tries to do "
1341 "the rewriting is described here:"
1345 #: ../src/guestfs.pod:646
1347 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
1352 #: ../src/guestfs.pod:648
1354 "The essential problem is that ntfs-3g simply does not have enough "
1355 "information to do a correct job. NTFS links can contain drive letters and "
1356 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1357 "It is almost certainly the case that libguestfs callers should ignore what "
1358 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1362 #: ../src/guestfs.pod:655
1364 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
1365 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1366 "attribute, and read the raw reparse data from that (you can find the format "
1367 "documented in various places around the web)."
1371 #: ../src/guestfs.pod:660
1372 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1376 #: ../src/guestfs.pod:662
1378 "There are other useful extended attributes that can be read from ntfs-3g "
1379 "filesystems (using L</guestfs_getxattr>). See:"
1383 #: ../src/guestfs.pod:665
1385 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1389 #: ../src/guestfs.pod:667
1390 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1394 #: ../src/guestfs.pod:669
1396 "Although we don't want to discourage you from using the C API, we will "
1397 "mention here that the same API is also available in other languages."
1401 #: ../src/guestfs.pod:672
1403 "The API is broadly identical in all supported languages. This means that "
1404 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1405 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1406 "words, a straightforward, predictable isomorphism between each language."
1410 #: ../src/guestfs.pod:678
1412 "Error messages are automatically transformed into exceptions if the language "
1417 #: ../src/guestfs.pod:681
1419 "We don't try to \"object orientify\" parts of the API in OO languages, "
1420 "although contributors are welcome to write higher level APIs above what we "
1421 "provide in their favourite languages if they wish."
1425 #: ../src/guestfs.pod:687
1430 #: ../src/guestfs.pod:689
1432 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1433 "identical to the C API. C++ classes and exceptions are not used."
1437 #: ../src/guestfs.pod:693
1442 #: ../src/guestfs.pod:695
1444 "The C# bindings are highly experimental. Please read the warnings at the "
1445 "top of C<csharp/Libguestfs.cs>."
1449 #: ../src/guestfs.pod:698
1454 #: ../src/guestfs.pod:700
1456 "This is the only language binding that is working but incomplete. Only "
1457 "calls which return simple integers have been bound in Haskell, and we are "
1458 "looking for help to complete this binding."
1462 #: ../src/guestfs.pod:704
1467 #: ../src/guestfs.pod:706
1469 "Full documentation is contained in the Javadoc which is distributed with "
1474 #: ../src/guestfs.pod:709
1479 #: ../src/guestfs.pod:711
1480 msgid "For documentation see L<guestfs-ocaml(3)>."
1484 #: ../src/guestfs.pod:713
1489 #: ../src/guestfs.pod:715
1490 msgid "For documentation see L<Sys::Guestfs(3)>."
1494 #: ../src/guestfs.pod:717
1499 #: ../src/guestfs.pod:719
1501 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1502 "the php-libguestfs package for your distribution."
1506 #: ../src/guestfs.pod:722
1507 msgid "The PHP binding only works correctly on 64 bit machines."
1511 #: ../src/guestfs.pod:724
1516 #: ../src/guestfs.pod:726
1517 msgid "For documentation see L<guestfs-python(3)>."
1521 #: ../src/guestfs.pod:728
1526 #: ../src/guestfs.pod:730
1527 msgid "For documentation see L<guestfs-ruby(3)>."
1531 #: ../src/guestfs.pod:732
1532 msgid "B<shell scripts>"
1536 #: ../src/guestfs.pod:734
1537 msgid "For documentation see L<guestfish(1)>."
1541 #: ../src/guestfs.pod:738
1542 msgid "LIBGUESTFS GOTCHAS"
1546 #: ../src/guestfs.pod:740
1548 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1549 "system [...] that works in the way it is documented but is counterintuitive "
1550 "and almost invites mistakes.\""
1554 #: ../src/guestfs.pod:744
1556 "Since we developed libguestfs and the associated tools, there are several "
1557 "things we would have designed differently, but are now stuck with for "
1558 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1559 "release, you can expect these to change. Beware of them."
1563 #: ../src/guestfs.pod:752
1564 msgid "Autosync / forgetting to sync."
1568 #: ../src/guestfs.pod:754
1570 "When modifying a filesystem from C or another language, you B<must> unmount "
1571 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1572 "libguestfs handle. You can also call:"
1576 #: ../src/guestfs.pod:758
1579 " guestfs_set_autosync (g, 1);\n"
1584 #: ../src/guestfs.pod:760
1586 "to have the unmount/sync done automatically for you when the handle 'g' is "
1587 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1591 #: ../src/guestfs.pod:764
1593 "If you forget to do this, then it is entirely possible that your changes "
1594 "won't be written out, or will be partially written, or (very rarely) that "
1595 "you'll get disk corruption."
1599 #: ../src/guestfs.pod:768
1601 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1602 "guestfish scripts that forget to sync will work just fine, which can make "
1603 "this very puzzling if you are trying to debug a problem."
1607 #: ../src/guestfs.pod:772
1609 "Update: Autosync is enabled by default for all API users starting from "
1610 "libguestfs 1.5.24."
1614 #: ../src/guestfs.pod:775
1615 msgid "Mount option C<-o sync> should not be the default."
1619 #: ../src/guestfs.pod:777
1621 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1622 "However C<-o sync> does not add any reliability benefit, but does have a "
1623 "very large performance impact."
1627 #: ../src/guestfs.pod:781
1629 "The work around is to use L</guestfs_mount_options> and set the mount "
1630 "options that you actually want to use."
1634 #: ../src/guestfs.pod:784
1635 msgid "Read-only should be the default."
1639 #: ../src/guestfs.pod:786
1641 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1642 "specify I<--rw> if you want to make changes to the image."
1646 #: ../src/guestfs.pod:789
1647 msgid "This would reduce the potential to corrupt live VM images."
1651 #: ../src/guestfs.pod:791
1653 "Note that many filesystems change the disk when you just mount and unmount, "
1654 "even if you didn't perform any writes. You need to use L</"
1655 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1659 #: ../src/guestfs.pod:795
1660 msgid "guestfish command line is hard to use."
1664 #: ../src/guestfs.pod:797
1666 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1667 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1668 "exist, so it fails. In earlier versions of guestfish the error message was "
1669 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1670 "we should have used C<guestfish -c command> to run commands."
1674 #: ../src/guestfs.pod:804
1675 msgid "guestfish megabyte modifiers don't work right on all commands"
1679 #: ../src/guestfs.pod:806
1681 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1682 "other modifiers). What guestfish actually does is to multiply the number "
1683 "part by the modifier part and pass the result to the C API. However this "
1684 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1685 "expecting some other unit (eg. megabytes)."
1689 #: ../src/guestfs.pod:813
1690 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1694 #: ../src/guestfs.pod:815
1697 " lvcreate LV VG 100M\n"
1702 #: ../src/guestfs.pod:817
1704 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1705 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1706 "megabytes * megabytes) logical volume. The error message you get from this "
1707 "is also a little obscure."
1711 #: ../src/guestfs.pod:822
1713 "This could be fixed in the generator by specially marking parameters and "
1714 "return values which take bytes or other units."
1718 #: ../src/guestfs.pod:825
1719 msgid "Ambiguity between devices and paths"
1723 #: ../src/guestfs.pod:827
1725 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1726 "sdb2>) and a similar pathname. A file might just happen to be called "
1727 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1731 #: ../src/guestfs.pod:832
1733 "In the current API we usually resolve this ambiguity by having two separate "
1734 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1735 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1736 "detecting if the path supplied begins with C</dev/>."
1740 #: ../src/guestfs.pod:838
1742 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1743 "make paths/devices into structured names. One way to do this would be to "
1744 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1745 "aspect of grub. Another way would be to use a structured type, equivalent "
1746 "to this OCaml type:"
1750 #: ../src/guestfs.pod:844
1753 " type path = Path of string | Device of int | Partition of int * int\n"
1758 #: ../src/guestfs.pod:846
1759 msgid "which would allow you to pass arguments like:"
1763 #: ../src/guestfs.pod:848
1766 " Path \"/foo/bar\"\n"
1767 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1768 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1769 " Path \"/dev/sdb2\" (* not a device *)\n"
1774 #: ../src/guestfs.pod:853
1776 "As you can see there are still problems to resolve even with this "
1777 "representation. Also consider how it might work in guestfish."
1781 #: ../src/guestfs.pod:858
1782 msgid "PROTOCOL LIMITS"
1786 #: ../src/guestfs.pod:860
1788 "Internally libguestfs uses a message-based protocol to pass API calls and "
1789 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1790 "plenty more detail about this). The maximum message size used by the "
1791 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1792 "aware of this limit. The API calls which may be affected are individually "
1793 "documented, with a link back to this section of the documentation."
1797 #: ../src/guestfs.pod:868
1799 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1800 "a simple string. Because this string is at some point internally encoded as "
1801 "a message, the maximum size that it can return is slightly under 4 MB. If "
1802 "the requested file is larger than this then you will get an error."
1806 #: ../src/guestfs.pod:874
1808 "In order to transfer large files into and out of the guest filesystem, you "
1809 "need to use particular calls that support this. The sections L</UPLOADING> "
1810 "and L</DOWNLOADING> document how to do this."
1814 #: ../src/guestfs.pod:878
1816 "You might also consider mounting the disk image using our FUSE filesystem "
1817 "support (L<guestmount(1)>)."
1821 #: ../src/guestfs.pod:881
1822 msgid "KEYS AND PASSPHRASES"
1826 #: ../src/guestfs.pod:883
1828 "Certain libguestfs calls take a parameter that contains sensitive key "
1829 "material, passed in as a C string."
1833 #: ../src/guestfs.pod:886
1835 "In the future we would hope to change the libguestfs implementation so that "
1836 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1837 "swap. However this is I<not> done at the moment, because of the complexity "
1838 "of such an implementation."
1842 #: ../src/guestfs.pod:891
1844 "Therefore you should be aware that any key parameter you pass to libguestfs "
1845 "might end up being written out to the swap partition. If this is a concern, "
1846 "scrub the swap partition or don't use libguestfs on encrypted devices."
1850 #: ../src/guestfs.pod:896
1851 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1855 #: ../src/guestfs.pod:898
1857 "All high-level libguestfs actions are synchronous. If you want to use "
1858 "libguestfs asynchronously then you must create a thread."
1862 #: ../src/guestfs.pod:901
1864 "Only use the handle from a single thread. Either use the handle exclusively "
1865 "from one thread, or provide your own mutex so that two threads cannot issue "
1866 "calls on the same handle at the same time."
1870 #: ../src/guestfs.pod:905
1872 "See the graphical program guestfs-browser for one possible architecture for "
1873 "multithreaded programs using libvirt and libguestfs."
1877 #: ../src/guestfs.pod:908
1882 #: ../src/guestfs.pod:910
1884 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1889 #: ../src/guestfs.pod:913
1891 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1892 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1896 #: ../src/guestfs.pod:916
1898 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1899 "to change the directories that libguestfs will search in. The value is a "
1900 "colon-separated list of paths. The current directory is I<not> searched "
1901 "unless the path contains an empty element or C<.>. For example "
1902 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1903 "then C</usr/lib/guestfs>."
1907 #: ../src/guestfs.pod:923
1908 msgid "QEMU WRAPPERS"
1912 #: ../src/guestfs.pod:925
1914 "If you want to compile your own qemu, run qemu from a non-standard location, "
1915 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1920 #: ../src/guestfs.pod:929
1922 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1923 "last command in the shell script (so that qemu replaces the shell and "
1924 "becomes the direct child of the libguestfs-using program). If you don't do "
1925 "this, then the qemu process won't be cleaned up correctly."
1929 #: ../src/guestfs.pod:934
1931 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1936 #: ../src/guestfs.pod:937
1940 " qemudir=/home/rjones/d/qemu\n"
1941 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1946 #: ../src/guestfs.pod:941
1948 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1949 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1954 #: ../src/guestfs.pod:945
1957 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1962 #: ../src/guestfs.pod:947
1964 "Note that libguestfs also calls qemu with the -help and -version options in "
1965 "order to determine features."
1969 #: ../src/guestfs.pod:950
1970 msgid "ABI GUARANTEE"
1974 #: ../src/guestfs.pod:952
1976 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1977 "actions as outlined in this section. Although we will deprecate some "
1978 "actions, for example if they get replaced by newer calls, we will keep the "
1979 "old actions forever. This allows you the developer to program in confidence "
1980 "against the libguestfs API."
1984 #: ../src/guestfs.pod:958
1985 msgid "BLOCK DEVICE NAMING"
1989 #: ../src/guestfs.pod:960
1991 "In the kernel there is now quite a profusion of schemata for naming block "
1992 "devices (in this context, by I<block device> I mean a physical or virtual "
1993 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1994 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1995 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1996 "for the old IDE driver (particularly for SATA devices) those devices also "
1997 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1998 "paravirtualized drivers. This has created several different naming systems, "
1999 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2003 #: ../src/guestfs.pod:972
2005 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2006 "Linux kernel to access block devices. We can run a variety of appliances "
2007 "based on a variety of Linux kernels."
2011 #: ../src/guestfs.pod:976
2013 "This causes a problem for libguestfs because many API calls use device or "
2014 "partition names. Working scripts and the recipe (example) scripts that we "
2015 "make available over the internet could fail if the naming scheme changes."
2019 #: ../src/guestfs.pod:981
2021 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2022 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2023 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2024 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2028 #: ../src/guestfs.pod:987
2030 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2031 "L</guestfs_list_partitions> and similar calls return the true names of the "
2032 "devices and partitions as known to the appliance."
2036 #: ../src/guestfs.pod:992
2037 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2041 #: ../src/guestfs.pod:994
2043 "Usually this translation is transparent. However in some (very rare) cases "
2044 "you may need to know the exact algorithm. Such cases include where you use "
2045 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2046 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2050 #: ../src/guestfs.pod:1000
2052 "The algorithm is applied only to I<parameters> which are known to be either "
2053 "device or partition names. Return values from functions such as L</"
2054 "guestfs_list_devices> are never changed."
2058 #: ../src/guestfs.pod:1008
2059 msgid "Is the string a parameter which is a device or partition name?"
2063 #: ../src/guestfs.pod:1012
2064 msgid "Does the string begin with C</dev/sd>?"
2068 #: ../src/guestfs.pod:1016
2070 "Does the named device exist? If so, we use that device. However if I<not> "
2071 "then we continue with this algorithm."
2075 #: ../src/guestfs.pod:1021
2076 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2080 #: ../src/guestfs.pod:1023
2081 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2085 #: ../src/guestfs.pod:1025
2086 msgid "If that named device exists, use it. If not, continue."
2090 #: ../src/guestfs.pod:1029
2091 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2095 #: ../src/guestfs.pod:1031
2096 msgid "If that named device exists, use it. If not, return an error."
2100 #: ../src/guestfs.pod:1035
2101 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2105 #: ../src/guestfs.pod:1037
2107 "Although the standard naming scheme and automatic translation is useful for "
2108 "simple programs and guestfish scripts, for larger programs it is best not to "
2109 "rely on this mechanism."
2113 #: ../src/guestfs.pod:1041
2115 "Where possible for maximum future portability programs using libguestfs "
2116 "should use these future-proof techniques:"
2120 #: ../src/guestfs.pod:1048
2122 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2123 "device names, and then use those names directly."
2127 #: ../src/guestfs.pod:1051
2129 "Since those device names exist by definition, they will never be translated."
2133 #: ../src/guestfs.pod:1056
2135 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2136 "filesystem labels."
2140 #: ../src/guestfs.pod:1061
2145 #: ../src/guestfs.pod:1063
2147 "This section discusses security implications of using libguestfs, "
2148 "particularly with untrusted or malicious guests or disk images."
2152 #: ../src/guestfs.pod:1066
2153 msgid "GENERAL SECURITY CONSIDERATIONS"
2157 #: ../src/guestfs.pod:1068
2159 "Be careful with any files or data that you download from a guest (by "
2160 "\"download\" we mean not just the L</guestfs_download> command but any "
2161 "command that reads files, filenames, directories or anything else from a "
2162 "disk image). An attacker could manipulate the data to fool your program "
2163 "into doing the wrong thing. Consider cases such as:"
2167 #: ../src/guestfs.pod:1078
2168 msgid "the data (file etc) not being present"
2172 #: ../src/guestfs.pod:1082
2173 msgid "being present but empty"
2177 #: ../src/guestfs.pod:1086
2178 msgid "being much larger than normal"
2182 #: ../src/guestfs.pod:1090
2183 msgid "containing arbitrary 8 bit data"
2187 #: ../src/guestfs.pod:1094
2188 msgid "being in an unexpected character encoding"
2192 #: ../src/guestfs.pod:1098
2193 msgid "containing homoglyphs."
2197 #: ../src/guestfs.pod:1102
2198 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2202 #: ../src/guestfs.pod:1104
2204 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2205 "(VFS) module can sometimes be escalated into exploits by deliberately "
2206 "creating a malicious, malformed filesystem. These exploits are very severe "
2207 "for two reasons. Firstly there are very many filesystem drivers in the "
2208 "kernel, and many of them are infrequently used and not much developer "
2209 "attention has been paid to the code. Linux userspace helps potential "
2210 "crackers by detecting the filesystem type and automatically choosing the "
2211 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2212 "the administrator. Secondly, a kernel-level exploit is like a local root "
2213 "exploit (worse in some ways), giving immediate and total access to the "
2214 "system right down to the hardware level."
2218 #: ../src/guestfs.pod:1117
2220 "That explains why you should never mount a filesystem from an untrusted "
2221 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2222 "inside a qemu virtual machine, usually running as a non-root user. The "
2223 "attacker would need to write a filesystem which first exploited the kernel, "
2224 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2225 "the libguestfs protocol, and finally to be as serious as the host kernel "
2226 "exploit it would need to escalate its privileges to root. This multi-step "
2227 "escalation, performed by a static piece of data, is thought to be extremely "
2228 "hard to do, although we never say 'never' about security issues."
2232 #: ../src/guestfs.pod:1128
2234 "In any case callers can reduce the attack surface by forcing the filesystem "
2235 "type when mounting (use L</guestfs_mount_vfs>)."
2239 #: ../src/guestfs.pod:1131
2240 msgid "PROTOCOL SECURITY"
2244 #: ../src/guestfs.pod:1133
2246 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2247 "defined upper message size. However a program that uses libguestfs must "
2248 "also take care - for example you can write a program that downloads a binary "
2249 "from a disk image and executes it locally, and no amount of protocol "
2250 "security will save you from the consequences."
2254 #: ../src/guestfs.pod:1139
2255 msgid "INSPECTION SECURITY"
2259 #: ../src/guestfs.pod:1141
2261 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2262 "directly from the guest, and these could contain any 8 bit data. Callers "
2263 "should be careful to escape these before printing them to a structured file "
2264 "(for example, use HTML escaping if creating a web page)."
2268 #: ../src/guestfs.pod:1147
2270 "Guest configuration may be altered in unusual ways by the administrator of "
2271 "the virtual machine, and may not reflect reality (particularly for untrusted "
2272 "or actively malicious guests). For example we parse the hostname from "
2273 "configuration files like C</etc/sysconfig/network> that we find in the "
2274 "guest, but the guest administrator can easily manipulate these files to "
2275 "provide the wrong hostname."
2279 #: ../src/guestfs.pod:1155
2281 "The inspection API parses guest configuration using two external libraries: "
2282 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2283 "designed to be robust in the face of malicious data, although denial of "
2284 "service attacks are still possible, for example with oversized configuration "
2289 #: ../src/guestfs.pod:1161
2290 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2294 #: ../src/guestfs.pod:1163
2296 "Be very cautious about running commands from the guest. By running a "
2297 "command in the guest, you are giving CPU time to a binary that you do not "
2298 "control, under the same user account as the library, albeit wrapped in qemu "
2299 "virtualization. More information and alternatives can be found in the "
2300 "section L</RUNNING COMMANDS>."
2304 #: ../src/guestfs.pod:1169
2305 msgid "CVE-2010-3851"
2309 #: ../src/guestfs.pod:1171
2310 msgid "https://bugzilla.redhat.com/642934"
2314 #: ../src/guestfs.pod:1173
2316 "This security bug concerns the automatic disk format detection that qemu "
2317 "does on disk images."
2321 #: ../src/guestfs.pod:1176
2323 "A raw disk image is just the raw bytes, there is no header. Other disk "
2324 "images like qcow2 contain a special header. Qemu deals with this by looking "
2325 "for one of the known headers, and if none is found then assuming the disk "
2326 "image must be raw."
2330 #: ../src/guestfs.pod:1181
2332 "This allows a guest which has been given a raw disk image to write some "
2333 "other header. At next boot (or when the disk image is accessed by "
2334 "libguestfs) qemu would do autodetection and think the disk image format was, "
2335 "say, qcow2 based on the header written by the guest."
2339 #: ../src/guestfs.pod:1186
2341 "This in itself would not be a problem, but qcow2 offers many features, one "
2342 "of which is to allow a disk image to refer to another image (called the "
2343 "\"backing disk\"). It does this by placing the path to the backing disk "
2344 "into the qcow2 header. This path is not validated and could point to any "
2345 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2346 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2347 "control of the attacker."
2351 #: ../src/guestfs.pod:1194
2353 "In libguestfs this is rather hard to exploit except under two circumstances:"
2357 #: ../src/guestfs.pod:1201
2358 msgid "You have enabled the network or have opened the disk in write mode."
2362 #: ../src/guestfs.pod:1205
2364 "You are also running untrusted code from the guest (see L</RUNNING "
2369 #: ../src/guestfs.pod:1210
2371 "The way to avoid this is to specify the expected disk format when adding "
2372 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2373 "should always do this if the disk is raw format, and it's a good idea for "
2378 #: ../src/guestfs.pod:1215
2380 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2381 "format is fetched from libvirt and passed through."
2385 #: ../src/guestfs.pod:1218
2387 "For libguestfs tools, use the I<--format> command line parameter as "
2392 #: ../src/guestfs.pod:1221
2393 msgid "CONNECTION MANAGEMENT"
2397 #: ../src/guestfs.pod:1223
2402 #: ../src/guestfs.pod:1225
2404 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2405 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2406 "handle and release all resources used."
2410 #: ../src/guestfs.pod:1229
2412 "For information on using multiple handles and threads, see the section L</"
2413 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2417 #: ../src/guestfs.pod:1232
2418 msgid "guestfs_create"
2422 #: ../src/guestfs.pod:1234
2425 " guestfs_h *guestfs_create (void);\n"
2430 #: ../src/guestfs.pod:1236
2431 msgid "Create a connection handle."
2435 #: ../src/guestfs.pod:1238
2437 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2438 "on the handle at least once."
2442 #: ../src/guestfs.pod:1241
2444 "This function returns a non-NULL pointer to a handle on success or NULL on "
2449 #: ../src/guestfs.pod:1244
2450 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2454 #: ../src/guestfs.pod:1246
2456 "You may also want to configure error handling for the handle. See L</ERROR "
2457 "HANDLING> section below."
2461 #: ../src/guestfs.pod:1249
2462 msgid "guestfs_close"
2466 #: ../src/guestfs.pod:1251
2469 " void guestfs_close (guestfs_h *g);\n"
2474 #: ../src/guestfs.pod:1253
2475 msgid "This closes the connection handle and frees up all resources used."
2479 #: ../src/guestfs.pod:1255
2480 msgid "ERROR HANDLING"
2484 #: ../src/guestfs.pod:1257
2486 "API functions can return errors. For example, almost all functions that "
2487 "return C<int> will return C<-1> to indicate an error."
2491 #: ../src/guestfs.pod:1260
2493 "Additional information is available for errors: an error message string and "
2494 "optionally an error number (errno) if the thing that failed was a system "
2499 #: ../src/guestfs.pod:1264
2501 "You can get at the additional information about the last error on the handle "
2502 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2503 "up an error handler with L</guestfs_set_error_handler>."
2507 #: ../src/guestfs.pod:1269
2509 "When the handle is created, a default error handler is installed which "
2510 "prints the error message string to C<stderr>. For small short-running "
2511 "command line programs it is sufficient to do:"
2515 #: ../src/guestfs.pod:1273
2518 " if (guestfs_launch (g) == -1)\n"
2519 " exit (EXIT_FAILURE);\n"
2524 #: ../src/guestfs.pod:1276
2526 "since the default error handler will ensure that an error message has been "
2527 "printed to C<stderr> before the program exits."
2531 #: ../src/guestfs.pod:1279
2533 "For other programs the caller will almost certainly want to install an "
2534 "alternate error handler or do error handling in-line like this:"
2538 #: ../src/guestfs.pod:1282
2541 " g = guestfs_create ();\n"
2546 #: ../src/guestfs.pod:1284
2549 " /* This disables the default behaviour of printing errors\n"
2551 " guestfs_set_error_handler (g, NULL, NULL);\n"
2556 #: ../src/guestfs.pod:1288
2559 " if (guestfs_launch (g) == -1) {\n"
2560 " /* Examine the error message and print it etc. */\n"
2561 " char *msg = guestfs_last_error (g);\n"
2562 " int errnum = guestfs_last_errno (g);\n"
2563 " fprintf (stderr, \"%s\\n\", msg);\n"
2570 #: ../src/guestfs.pod:1296
2572 "Out of memory errors are handled differently. The default action is to call "
2573 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2574 "guestfs_set_out_of_memory_handler>."
2578 #: ../src/guestfs.pod:1300
2580 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2581 "because there is no handle if this happens there is no way to get additional "
2582 "error information. However L</guestfs_create> is supposed to be a "
2583 "lightweight operation which can only fail because of insufficient memory (it "
2584 "returns NULL in this case)."
2588 #: ../src/guestfs.pod:1306
2589 msgid "guestfs_last_error"
2593 #: ../src/guestfs.pod:1308
2596 " const char *guestfs_last_error (guestfs_h *g);\n"
2601 #: ../src/guestfs.pod:1310
2603 "This returns the last error message that happened on C<g>. If there has not "
2604 "been an error since the handle was created, then this returns C<NULL>."
2608 #: ../src/guestfs.pod:1314
2610 "The lifetime of the returned string is until the next error occurs, or L</"
2611 "guestfs_close> is called."
2615 #: ../src/guestfs.pod:1317
2616 msgid "guestfs_last_errno"
2620 #: ../src/guestfs.pod:1319
2623 " int guestfs_last_errno (guestfs_h *g);\n"
2628 #: ../src/guestfs.pod:1321
2629 msgid "This returns the last error number (errno) that happened on C<g>."
2633 #: ../src/guestfs.pod:1323
2634 msgid "If successful, an errno integer not equal to zero is returned."
2638 #: ../src/guestfs.pod:1325
2640 "If no error, this returns 0. This call can return 0 in three situations:"
2644 #: ../src/guestfs.pod:1332
2645 msgid "There has not been any error on the handle."
2649 #: ../src/guestfs.pod:1336
2651 "There has been an error but the errno was meaningless. This corresponds to "
2652 "the case where the error did not come from a failed system call, but for "
2653 "some other reason."
2657 #: ../src/guestfs.pod:1342
2659 "There was an error from a failed system call, but for some reason the errno "
2660 "was not captured and returned. This usually indicates a bug in libguestfs."
2664 #: ../src/guestfs.pod:1348
2666 "Libguestfs tries to convert the errno from inside the applicance into a "
2667 "corresponding errno for the caller (not entirely trivial: the appliance "
2668 "might be running a completely different operating system from the library "
2669 "and error numbers are not standardized across Un*xen). If this could not be "
2670 "done, then the error is translated to C<EINVAL>. In practice this should "
2671 "only happen in very rare circumstances."
2675 #: ../src/guestfs.pod:1356
2676 msgid "guestfs_set_error_handler"
2680 #: ../src/guestfs.pod:1358
2683 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2685 " const char *msg);\n"
2686 " void guestfs_set_error_handler (guestfs_h *g,\n"
2687 " guestfs_error_handler_cb cb,\n"
2693 #: ../src/guestfs.pod:1365
2695 "The callback C<cb> will be called if there is an error. The parameters "
2696 "passed to the callback are an opaque data pointer and the error message "
2701 #: ../src/guestfs.pod:1369
2703 "C<errno> is not passed to the callback. To get that the callback must call "
2704 "L</guestfs_last_errno>."
2708 #: ../src/guestfs.pod:1372
2710 "Note that the message string C<msg> is freed as soon as the callback "
2711 "function returns, so if you want to stash it somewhere you must make your "
2716 #: ../src/guestfs.pod:1376
2717 msgid "The default handler prints messages on C<stderr>."
2721 #: ../src/guestfs.pod:1378
2722 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2726 #: ../src/guestfs.pod:1380
2727 msgid "guestfs_get_error_handler"
2731 #: ../src/guestfs.pod:1382
2734 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2735 " void **opaque_rtn);\n"
2740 #: ../src/guestfs.pod:1385
2741 msgid "Returns the current error handler callback."
2745 #: ../src/guestfs.pod:1387
2746 msgid "guestfs_set_out_of_memory_handler"
2750 #: ../src/guestfs.pod:1389
2753 " typedef void (*guestfs_abort_cb) (void);\n"
2754 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2755 " guestfs_abort_cb);\n"
2760 #: ../src/guestfs.pod:1393
2762 "The callback C<cb> will be called if there is an out of memory situation. "
2763 "I<Note this callback must not return>."
2767 #: ../src/guestfs.pod:1396
2768 msgid "The default is to call L<abort(3)>."
2772 #: ../src/guestfs.pod:1398
2774 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2778 #: ../src/guestfs.pod:1401
2779 msgid "guestfs_get_out_of_memory_handler"
2783 #: ../src/guestfs.pod:1403
2786 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2791 #: ../src/guestfs.pod:1405
2792 msgid "This returns the current out of memory handler."
2796 #: ../src/guestfs.pod:1407
2801 #: ../src/guestfs.pod:1409 ../fish/guestfish.pod:958
2806 #: ../src/guestfs.pod:1411
2811 #: ../src/guestfs.pod:1413
2816 #: ../src/guestfs.pod:1415
2817 msgid "AVAILABILITY"
2821 #: ../src/guestfs.pod:1417
2822 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2826 #: ../src/guestfs.pod:1419
2828 "Using L</guestfs_available> you can test availability of the following "
2829 "groups of functions. This test queries the appliance to see if the "
2830 "appliance you are currently using supports the functionality."
2834 #: ../src/guestfs.pod:1424
2835 msgid "@AVAILABILITY@"
2839 #: ../src/guestfs.pod:1426
2840 msgid "GUESTFISH supported COMMAND"
2844 #: ../src/guestfs.pod:1428
2846 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2847 "prints out the available groups and whether they are supported by this build "
2848 "of libguestfs. Note however that you have to do C<run> first."
2852 #: ../src/guestfs.pod:1433
2853 msgid "SINGLE CALLS AT COMPILE TIME"
2857 #: ../src/guestfs.pod:1435
2859 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2860 "function, such as:"
2864 #: ../src/guestfs.pod:1438
2867 " #define LIBGUESTFS_HAVE_DD 1\n"
2872 #: ../src/guestfs.pod:1440
2873 msgid "if L</guestfs_dd> is available."
2877 #: ../src/guestfs.pod:1442
2879 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2880 "function is available at compile time, we recommended using build tools such "
2881 "as autoconf or cmake. For example in autotools you could use:"
2885 #: ../src/guestfs.pod:1447
2888 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2889 " AC_CHECK_FUNCS([guestfs_dd])\n"
2894 #: ../src/guestfs.pod:1450
2896 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2901 #: ../src/guestfs.pod:1453
2902 msgid "SINGLE CALLS AT RUN TIME"
2906 #: ../src/guestfs.pod:1455
2908 "Testing at compile time doesn't guarantee that a function really exists in "
2909 "the library. The reason is that you might be dynamically linked against a "
2910 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2911 "This situation unfortunately results in a segmentation fault, which is a "
2912 "shortcoming of the C dynamic linking system itself."
2916 #: ../src/guestfs.pod:1462
2918 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2919 "in this example program (note that you still need the compile time check as "
2924 #: ../src/guestfs.pod:1466
2927 " #include <stdio.h>\n"
2928 " #include <stdlib.h>\n"
2929 " #include <unistd.h>\n"
2930 " #include <dlfcn.h>\n"
2931 " #include <guestfs.h>\n"
2936 #: ../src/guestfs.pod:1472
2941 " #ifdef LIBGUESTFS_HAVE_DD\n"
2943 " int has_function;\n"
2948 #: ../src/guestfs.pod:1478
2951 " /* Test if the function guestfs_dd is really available. */\n"
2952 " dl = dlopen (NULL, RTLD_LAZY);\n"
2954 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2955 " exit (EXIT_FAILURE);\n"
2957 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2963 #: ../src/guestfs.pod:1487
2966 " if (!has_function)\n"
2967 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2969 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2970 " /* Now it's safe to call\n"
2971 " guestfs_dd (g, \"foo\", \"bar\");\n"
2975 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2982 #: ../src/guestfs.pod:1500
2984 "You may think the above is an awful lot of hassle, and it is. There are "
2985 "other ways outside of the C linking system to ensure that this kind of "
2986 "incompatibility never arises, such as using package versioning:"
2990 #: ../src/guestfs.pod:1505
2993 " Requires: libguestfs >= 1.0.80\n"
2998 #: ../src/guestfs.pod:1507
2999 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3003 #: ../src/guestfs.pod:1509
3005 "A recent feature of the API is the introduction of calls which take optional "
3006 "arguments. In C these are declared 3 ways. The main way is as a call which "
3007 "takes variable arguments (ie. C<...>), as in this example:"
3011 #: ../src/guestfs.pod:1514
3014 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3019 #: ../src/guestfs.pod:1516
3021 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3022 "call with no optional arguments specified:"
3026 #: ../src/guestfs.pod:1519
3029 " guestfs_add_drive_opts (g, filename, -1);\n"
3034 #: ../src/guestfs.pod:1521
3035 msgid "With a single optional argument:"
3039 #: ../src/guestfs.pod:1523
3042 " guestfs_add_drive_opts (g, filename,\n"
3043 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3049 #: ../src/guestfs.pod:1527
3054 #: ../src/guestfs.pod:1529
3057 " guestfs_add_drive_opts (g, filename,\n"
3058 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3059 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3065 #: ../src/guestfs.pod:1534
3067 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3072 #: ../src/guestfs.pod:1537
3073 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3077 #: ../src/guestfs.pod:1539
3079 "The second variant has the same name with the suffix C<_va>, which works the "
3080 "same way but takes a C<va_list>. See the C manual for details. For the "
3081 "example function, this is declared:"
3085 #: ../src/guestfs.pod:1543
3088 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3094 #: ../src/guestfs.pod:1546
3095 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3099 #: ../src/guestfs.pod:1548
3101 "The third variant is useful where you need to construct these calls. You "
3102 "pass in a structure where you fill in the optional fields. The structure "
3103 "has a bitmask as the first element which you must set to indicate which "
3104 "fields you have filled in. For our example function the structure and call "
3109 #: ../src/guestfs.pod:1554
3112 " struct guestfs_add_drive_opts_argv {\n"
3113 " uint64_t bitmask;\n"
3115 " const char *format;\n"
3118 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3119 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3124 #: ../src/guestfs.pod:1563
3125 msgid "You could call it like this:"
3129 #: ../src/guestfs.pod:1565
3132 " struct guestfs_add_drive_opts_argv optargs = {\n"
3133 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3134 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3136 " .format = \"qcow2\"\n"
3142 #: ../src/guestfs.pod:1572
3145 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3150 #: ../src/guestfs.pod:1574 ../src/guestfs-actions.pod:11
3151 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:9
3152 #: ../fish/guestfish-actions.pod:1255 ../tools/virt-win-reg.pl:532
3157 #: ../src/guestfs.pod:1580
3158 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3162 #: ../src/guestfs.pod:1585
3163 msgid "You do not need to fill in all fields of the structure."
3167 #: ../src/guestfs.pod:1589
3169 "There must be a one-to-one correspondence between fields of the structure "
3170 "that are filled in, and bits set in the bitmask."
3174 #: ../src/guestfs.pod:1594
3175 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3179 #: ../src/guestfs.pod:1596
3181 "In other languages, optional arguments are expressed in the way that is "
3182 "natural for that language. We refer you to the language-specific "
3183 "documentation for more details on that."
3187 #: ../src/guestfs.pod:1600
3188 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3192 #: ../src/guestfs.pod:1602
3193 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3197 #: ../src/guestfs.pod:1604
3199 "The child process generates events in some situations. Current events "
3200 "include: receiving a log message, the child process exits."
3204 #: ../src/guestfs.pod:1607
3206 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3211 #: ../src/guestfs.pod:1610
3213 "Only I<one callback of each type> can be registered for each handle. "
3214 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3215 "that type. Cancel all callbacks of this type by calling this function with "
3216 "C<cb> set to C<NULL>."
3220 #: ../src/guestfs.pod:1615
3221 msgid "guestfs_set_log_message_callback"
3225 #: ../src/guestfs.pod:1617
3228 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3229 " char *buf, int len);\n"
3230 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3231 " guestfs_log_message_cb cb,\n"
3237 #: ../src/guestfs.pod:1623
3239 "The callback function C<cb> will be called whenever qemu or the guest writes "
3240 "anything to the console."
3244 #: ../src/guestfs.pod:1626
3245 msgid "Use this function to capture kernel messages and similar."
3249 #: ../src/guestfs.pod:1628
3251 "Normally there is no log message handler, and log messages are just "
3256 #: ../src/guestfs.pod:1631
3257 msgid "guestfs_set_subprocess_quit_callback"
3261 #: ../src/guestfs.pod:1633
3264 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3265 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3266 " guestfs_subprocess_quit_cb cb,\n"
3272 #: ../src/guestfs.pod:1638
3274 "The callback function C<cb> will be called when the child process quits, "
3275 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3276 "corresponds to a transition from any state to the CONFIG state)."
3280 #: ../src/guestfs.pod:1643
3281 msgid "guestfs_set_launch_done_callback"
3285 #: ../src/guestfs.pod:1645
3288 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3289 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3290 " guestfs_launch_done_cb cb,\n"
3296 #: ../src/guestfs.pod:1650
3298 "The callback function C<cb> will be called when the child process becomes "
3299 "ready first time after it has been launched. (This corresponds to a "
3300 "transition from LAUNCHING to the READY state)."
3304 #: ../src/guestfs.pod:1654
3305 msgid "guestfs_set_close_callback"
3309 #: ../src/guestfs.pod:1656
3312 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3313 " void guestfs_set_close_callback (guestfs_h *g,\n"
3314 " guestfs_close_cb cb,\n"
3320 #: ../src/guestfs.pod:1661
3322 "The callback function C<cb> will be called while the handle is being closed "
3323 "(synchronously from L</guestfs_close>)."
3327 #: ../src/guestfs.pod:1664
3329 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3330 "handles that are open when the program exits. This means that this callback "
3331 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3332 "problems in higher-level languages (eg. if your HLL interpreter has already "
3333 "been cleaned up by the time this is called, and if your callback then jumps "
3334 "into some HLL function)."
3338 #: ../src/guestfs.pod:1672
3339 msgid "guestfs_set_progress_callback"
3343 #: ../src/guestfs.pod:1674
3346 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3347 " int proc_nr, int serial,\n"
3348 " uint64_t position, uint64_t total);\n"
3349 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3350 " guestfs_progress_cb cb,\n"
3356 #: ../src/guestfs.pod:1681
3358 "Some long-running operations can generate progress messages. If this "
3359 "callback is registered, then it will be called each time a progress message "
3360 "is generated (usually two seconds after the operation started, and three "
3361 "times per second thereafter until it completes, although the frequency may "
3362 "change in future versions)."
3366 #: ../src/guestfs.pod:1687
3368 "The callback receives two numbers: C<position> and C<total>. The units of "
3369 "C<total> are not defined, although for some operations C<total> may relate "
3370 "in some way to the amount of data to be transferred (eg. in bytes or "
3371 "megabytes), and C<position> may be the portion which has been transferred."
3375 #: ../src/guestfs.pod:1693
3376 msgid "The only defined and stable parts of the API are:"
3380 #: ../src/guestfs.pod:1699
3382 "The callback can display to the user some type of progress bar or indicator "
3383 "which shows the ratio of C<position>:C<total>."
3387 #: ../src/guestfs.pod:1704
3388 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3392 #: ../src/guestfs.pod:1708
3394 "If any progress notification is sent during a call, then a final progress "
3395 "notification is always sent when C<position> = C<total>."
3399 #: ../src/guestfs.pod:1711
3401 "This is to simplify caller code, so callers can easily set the progress "
3402 "indicator to \"100%\" at the end of the operation, without requiring special "
3403 "code to detect this case."
3407 #: ../src/guestfs.pod:1717
3409 "The callback also receives the procedure number and serial number of the "
3410 "call. These are only useful for debugging protocol issues, and the callback "
3411 "can normally ignore them. The callback may want to print these numbers in "
3412 "error messages or debugging messages."
3416 #: ../src/guestfs.pod:1722
3417 msgid "PRIVATE DATA AREA"
3421 #: ../src/guestfs.pod:1724
3423 "You can attach named pieces of private data to the libguestfs handle, and "
3424 "fetch them by name for the lifetime of the handle. This is called the "
3425 "private data area and is only available from the C API."
3429 #: ../src/guestfs.pod:1728
3430 msgid "To attach a named piece of data, use the following call:"
3434 #: ../src/guestfs.pod:1730
3437 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3442 #: ../src/guestfs.pod:1732
3444 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3445 "pointer (which can be C<NULL>). Any previous item with the same name is "
3450 #: ../src/guestfs.pod:1736
3452 "You can use any C<key> you want, but names beginning with an underscore "
3453 "character are reserved for internal libguestfs purposes (for implementing "
3454 "language bindings). It is recommended to prefix the name with some unique "
3455 "string to avoid collisions with other users."
3459 #: ../src/guestfs.pod:1741
3460 msgid "To retrieve the pointer, use:"
3464 #: ../src/guestfs.pod:1743
3467 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3472 #: ../src/guestfs.pod:1745
3474 "This function returns C<NULL> if either no data is found associated with "
3475 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3480 #: ../src/guestfs.pod:1749
3482 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3483 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3484 "all. In particular, libguestfs does I<not> try to free the data when the "
3485 "handle is closed. If the data must be freed, then the caller must either "
3486 "free it before calling L</guestfs_close> or must set up a close callback to "
3487 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3488 "can be registered for a handle)."
3492 #: ../src/guestfs.pod:1757
3494 "The private data area is implemented using a hash table, and should be "
3495 "reasonably efficient for moderate numbers of keys."
3499 #: ../src/guestfs.pod:1760 ../src/guestfs.pod:1765
3504 #: ../src/guestfs.pod:1762
3506 "<!-- old anchor for the next section --> <a name="
3507 "\"state_machine_and_low_level_event_api\"/>"
3511 #: ../src/guestfs.pod:1767
3512 msgid "ARCHITECTURE"
3516 #: ../src/guestfs.pod:1769
3518 "Internally, libguestfs is implemented by running an appliance (a special "
3519 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3520 "process of the main program."
3524 #: ../src/guestfs.pod:1773
3527 " ___________________\n"
3529 " | main program |\n"
3531 " | | child process / appliance\n"
3532 " | | __________________________\n"
3534 " +-------------------+ RPC | +-----------------+ |\n"
3535 " | libguestfs <--------------------> guestfsd | |\n"
3536 " | | | +-----------------+ |\n"
3537 " \\___________________/ | | Linux kernel | |\n"
3538 " | +--^--------------+ |\n"
3539 " \\_________|________________/\n"
3545 " \\______________/\n"
3550 #: ../src/guestfs.pod:1793
3552 "The library, linked to the main program, creates the child process and hence "
3553 "the appliance in the L</guestfs_launch> function."
3557 #: ../src/guestfs.pod:1796
3559 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3560 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3561 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3562 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3563 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3564 "attached to the qemu process which translates device access by the "
3565 "appliance's Linux kernel into accesses to the image."
3569 #: ../src/guestfs.pod:1805
3571 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3572 "Although the disk image you are attached to might also be used by some "
3573 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3574 "care if both libguestfs's qemu process and your virtual machine are trying "
3575 "to update the disk image at the same time, since these usually results in "
3576 "massive disk corruption)."
3580 #: ../src/guestfs.pod:1812
3581 msgid "STATE MACHINE"
3585 #: ../src/guestfs.pod:1814
3586 msgid "libguestfs uses a state machine to model the child process:"
3590 #: ../src/guestfs.pod:1816
3602 " / | \\ \\ guestfs_launch\n"
3603 " / | _\\__V______\n"
3605 " / | | LAUNCHING |\n"
3606 " / | \\___________/\n"
3608 " / | guestfs_launch\n"
3610 " ______ / __|____V\n"
3611 " / \\ ------> / \\\n"
3612 " | BUSY | | READY |\n"
3613 " \\______/ <------ \\________/\n"
3618 #: ../src/guestfs.pod:1838
3620 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3621 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3622 "(3) alternating between READY and BUSY as commands are issued to, and "
3623 "carried out by, the child process."
3627 #: ../src/guestfs.pod:1843
3629 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3630 "asynchronously at any time (eg. due to some internal error), and that causes "
3631 "the state to transition back to CONFIG."
3635 #: ../src/guestfs.pod:1847
3637 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3638 "issued when in the CONFIG state."
3642 #: ../src/guestfs.pod:1850
3644 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3645 "L</guestfs_launch> blocks until the child process is READY to accept "
3646 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3647 "moves the state from CONFIG to LAUNCHING while it is running."
3651 #: ../src/guestfs.pod:1856
3653 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3654 "state. These API calls block waiting for the command to be carried out (ie. "
3655 "the state to transition to BUSY and then back to READY). There are no non-"
3656 "blocking versions, and no way to issue more than one command per handle at "
3661 #: ../src/guestfs.pod:1862
3663 "Finally, the child process sends asynchronous messages back to the main "
3664 "program, such as kernel log messages. You can register a callback to "
3665 "receive these messages."
3669 #: ../src/guestfs.pod:1866
3674 #: ../src/guestfs.pod:1868
3675 msgid "COMMUNICATION PROTOCOL"
3679 #: ../src/guestfs.pod:1870
3681 "Don't rely on using this protocol directly. This section documents how it "
3682 "currently works, but it may change at any time."
3686 #: ../src/guestfs.pod:1873
3688 "The protocol used to talk between the library and the daemon running inside "
3689 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3690 "1014, RFC 1832, RFC 4506)."
3694 #: ../src/guestfs.pod:1877
3696 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3697 "this file is automatically generated)."
3701 #: ../src/guestfs.pod:1880
3703 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3704 "and C<FileOut> parameters, which are handled with very simple request/reply "
3705 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3706 "parameters, which use the same request and reply messages, but they may also "
3707 "be followed by files sent using a chunked encoding."
3711 #: ../src/guestfs.pod:1887
3712 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3716 #: ../src/guestfs.pod:1889
3717 msgid "For ordinary functions, the request message is:"
3721 #: ../src/guestfs.pod:1891
3724 " total length (header + arguments,\n"
3725 " but not including the length word itself)\n"
3726 " struct guestfs_message_header (encoded as XDR)\n"
3727 " struct guestfs_<foo>_args (encoded as XDR)\n"
3732 #: ../src/guestfs.pod:1896
3734 "The total length field allows the daemon to allocate a fixed size buffer "
3735 "into which it slurps the rest of the message. As a result, the total length "
3736 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3737 "effective size of any request is limited to somewhere under this size."
3741 #: ../src/guestfs.pod:1902
3743 "Note also that many functions don't take any arguments, in which case the "
3744 "C<guestfs_I<foo>_args> is completely omitted."
3748 #: ../src/guestfs.pod:1905
3750 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3751 "receiver knows what type of args structure to expect, or none at all."
3755 #: ../src/guestfs.pod:1909
3757 "For functions that take optional arguments, the optional arguments are "
3758 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3759 "arguments. A bitmask in the header indicates which optional arguments are "
3760 "meaningful. The bitmask is also checked to see if it contains bits set "
3761 "which the daemon does not know about (eg. if more optional arguments were "
3762 "added in a later version of the library), and this causes the call to be "
3767 #: ../src/guestfs.pod:1917
3768 msgid "The reply message for ordinary functions is:"
3772 #: ../src/guestfs.pod:1919
3775 " total length (header + ret,\n"
3776 " but not including the length word itself)\n"
3777 " struct guestfs_message_header (encoded as XDR)\n"
3778 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3783 #: ../src/guestfs.pod:1924
3785 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3786 "functions that return no formal return values."
3790 #: ../src/guestfs.pod:1927
3792 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3796 #: ../src/guestfs.pod:1930
3798 "In the case of an error, a flag is set in the header, and the reply message "
3799 "is slightly changed:"
3803 #: ../src/guestfs.pod:1933
3806 " total length (header + error,\n"
3807 " but not including the length word itself)\n"
3808 " struct guestfs_message_header (encoded as XDR)\n"
3809 " struct guestfs_message_error (encoded as XDR)\n"
3814 #: ../src/guestfs.pod:1938
3816 "The C<guestfs_message_error> structure contains the error message as a "
3821 #: ../src/guestfs.pod:1941
3822 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3826 #: ../src/guestfs.pod:1943
3828 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3829 "The normal request message is sent (see above). However this is followed by "
3830 "a sequence of file chunks."
3834 #: ../src/guestfs.pod:1947
3837 " total length (header + arguments,\n"
3838 " but not including the length word itself,\n"
3839 " and not including the chunks)\n"
3840 " struct guestfs_message_header (encoded as XDR)\n"
3841 " struct guestfs_<foo>_args (encoded as XDR)\n"
3842 " sequence of chunks for FileIn param #0\n"
3843 " sequence of chunks for FileIn param #1 etc.\n"
3848 #: ../src/guestfs.pod:1955
3849 msgid "The \"sequence of chunks\" is:"
3853 #: ../src/guestfs.pod:1957
3856 " length of chunk (not including length word itself)\n"
3857 " struct guestfs_chunk (encoded as XDR)\n"
3858 " length of chunk\n"
3859 " struct guestfs_chunk (encoded as XDR)\n"
3861 " length of chunk\n"
3862 " struct guestfs_chunk (with data.data_len == 0)\n"
3867 #: ../src/guestfs.pod:1965
3869 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3870 "is set in the final chunk to indicate either successful completion or early "
3875 #: ../src/guestfs.pod:1969
3877 "At time of writing there are no functions that have more than one FileIn "
3878 "parameter. However this is (theoretically) supported, by sending the "
3879 "sequence of chunks for each FileIn parameter one after another (from left to "
3884 #: ../src/guestfs.pod:1974
3886 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3887 "transfer. The library does this by sending a chunk with a special flag set "
3888 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3889 "RPC, does I<not> send any reply, and goes back to reading the next request."
3893 #: ../src/guestfs.pod:1980
3895 "The daemon may also cancel. It does this by writing a special word "
3896 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3897 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3898 "cancel chunk). The special word is chosen so that even if cancellation "
3899 "happens right at the end of the transfer (after the library has finished "
3900 "writing and has started listening for the reply), the \"spurious\" cancel "
3901 "flag will not be confused with the reply message."
3905 #: ../src/guestfs.pod:1989
3907 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3908 "limit), and also files where the size is not known in advance (eg. from "
3909 "pipes or sockets). However the chunks are rather small "
3910 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3911 "to keep much in memory."
3915 #: ../src/guestfs.pod:1995
3916 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3920 #: ../src/guestfs.pod:1997
3922 "The protocol for FileOut parameters is exactly the same as for FileIn "
3923 "parameters, but with the roles of daemon and library reversed."
3927 #: ../src/guestfs.pod:2000
3930 " total length (header + ret,\n"
3931 " but not including the length word itself,\n"
3932 " and not including the chunks)\n"
3933 " struct guestfs_message_header (encoded as XDR)\n"
3934 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3935 " sequence of chunks for FileOut param #0\n"
3936 " sequence of chunks for FileOut param #1 etc.\n"
3941 #: ../src/guestfs.pod:2008
3942 msgid "INITIAL MESSAGE"
3946 #: ../src/guestfs.pod:2010
3948 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3949 "which indicates that the guest and daemon is alive. This is what L</"
3950 "guestfs_launch> waits for."
3954 #: ../src/guestfs.pod:2014
3955 msgid "PROGRESS NOTIFICATION MESSAGES"
3959 #: ../src/guestfs.pod:2016
3961 "The daemon may send progress notification messages at any time. These are "
3962 "distinguished by the normal length word being replaced by "
3963 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3967 #: ../src/guestfs.pod:2020
3969 "The library turns them into progress callbacks (see "
3970 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3971 "discards them if not."
3975 #: ../src/guestfs.pod:2024
3977 "The daemon self-limits the frequency of progress messages it sends (see "
3978 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3983 #: ../src/guestfs.pod:2028
3984 msgid "LIBGUESTFS VERSION NUMBERS"
3988 #: ../src/guestfs.pod:2030
3990 "Since April 2010, libguestfs has started to make separate development and "
3991 "stable releases, along with corresponding branches in our git repository. "
3992 "These separate releases can be identified by version number:"
3996 #: ../src/guestfs.pod:2035
3999 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
4000 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
4006 " | `-------- sub-version\n"
4008 " `------ always '1' because we don't change the ABI\n"
4013 #: ../src/guestfs.pod:2046
4014 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
4018 #: ../src/guestfs.pod:2048
4020 "As time passes we cherry pick fixes from the development branch and backport "
4021 "those into the stable branch, the effect being that the stable branch should "
4022 "get more stable and less buggy over time. So the stable releases are ideal "
4023 "for people who don't need new features but would just like the software to "
4028 #: ../src/guestfs.pod:2054
4029 msgid "Our criteria for backporting changes are:"
4033 #: ../src/guestfs.pod:2060
4035 "Documentation changes which don't affect any code are backported unless the "
4036 "documentation refers to a future feature which is not in stable."
4040 #: ../src/guestfs.pod:2066
4042 "Bug fixes which are not controversial, fix obvious problems, and have been "
4043 "well tested are backported."
4047 #: ../src/guestfs.pod:2071
4049 "Simple rearrangements of code which shouldn't affect how it works get "
4050 "backported. This is so that the code in the two branches doesn't get too "
4051 "far out of step, allowing us to backport future fixes more easily."
4055 #: ../src/guestfs.pod:2077
4057 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4058 "exceptional case: the new feature is required in order to implement an "
4059 "important bug fix."
4063 #: ../src/guestfs.pod:2083
4065 "A new stable branch starts when we think the new features in development are "
4066 "substantial and compelling enough over the current stable branch to warrant "
4067 "it. When that happens we create new stable and development versions 1.N.0 "
4068 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4069 "stable at this point, but by backporting fixes from development, that branch "
4070 "will stabilize over time."
4074 #: ../src/guestfs.pod:2091 ../fish/guestfish.pod:965
4075 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
4076 msgid "ENVIRONMENT VARIABLES"
4080 #: ../src/guestfs.pod:2095 ../fish/guestfish.pod:991
4081 msgid "LIBGUESTFS_APPEND"
4085 #: ../src/guestfs.pod:2097 ../fish/guestfish.pod:993
4086 msgid "Pass additional options to the guest kernel."
4090 #: ../src/guestfs.pod:2099 ../fish/guestfish.pod:995
4091 msgid "LIBGUESTFS_DEBUG"
4095 #: ../src/guestfs.pod:2101
4097 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
4098 "effect as calling C<guestfs_set_verbose (g, 1)>."
4102 #: ../src/guestfs.pod:2104 ../fish/guestfish.pod:1000
4103 msgid "LIBGUESTFS_MEMSIZE"
4107 #: ../src/guestfs.pod:2106 ../fish/guestfish.pod:1002
4109 "Set the memory allocated to the qemu process, in megabytes. For example:"
4113 #: ../src/guestfs.pod:2109 ../fish/guestfish.pod:1005
4116 " LIBGUESTFS_MEMSIZE=700\n"
4121 #: ../src/guestfs.pod:2111 ../fish/guestfish.pod:1007
4122 msgid "LIBGUESTFS_PATH"
4126 #: ../src/guestfs.pod:2113
4128 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4129 "the discussion of paths in section PATH above."
4133 #: ../src/guestfs.pod:2116 ../fish/guestfish.pod:1012
4134 msgid "LIBGUESTFS_QEMU"
4138 #: ../src/guestfs.pod:2118 ../fish/guestfish.pod:1014
4140 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4141 "which was found at compile time by the configure script is used."
4145 #: ../src/guestfs.pod:2122
4146 msgid "See also L</QEMU WRAPPERS> above."
4150 #: ../src/guestfs.pod:2124 ../fish/guestfish.pod:1018
4151 msgid "LIBGUESTFS_TRACE"
4155 #: ../src/guestfs.pod:2126
4157 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4158 "effect as calling C<guestfs_set_trace (g, 1)>."
4162 #: ../src/guestfs.pod:2129 ../fish/guestfish.pod:1027
4167 #: ../src/guestfs.pod:2131 ../fish/guestfish.pod:1029
4168 msgid "Location of temporary directory, defaults to C</tmp>."
4172 #: ../src/guestfs.pod:2133 ../fish/guestfish.pod:1031
4174 "If libguestfs was compiled to use the supermin appliance then the real "
4175 "appliance is cached in this directory, shared between all handles belonging "
4176 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4177 "use in case C</tmp> is not large enough."
4181 #: ../src/guestfs.pod:2141 ../fish/guestfish.pod:1089
4182 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4183 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572
4184 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
4185 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534
4186 #: ../tools/virt-list-partitions.pl:257
4191 #: ../src/guestfs.pod:2143
4193 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
4194 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
4195 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
4196 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
4197 ">, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
4198 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
4202 #: ../src/guestfs.pod:2166
4204 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4205 "(8)>, L<disktype(1)>."
4209 #: ../src/guestfs.pod:2173 ../tools/virt-win-reg.pl:587
4210 #: ../tools/virt-make-fs.pl:548
4215 #: ../src/guestfs.pod:2175
4216 msgid "To get a list of bugs against libguestfs use this link:"
4220 #: ../src/guestfs.pod:2177
4222 "L<https://bugzilla.redhat.com/buglist.cgi?"
4223 "component=libguestfs&product=Virtualization+Tools>"
4227 #: ../src/guestfs.pod:2179
4228 msgid "To report a new bug against libguestfs use this link:"
4232 #: ../src/guestfs.pod:2181
4234 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4235 "component=libguestfs&product=Virtualization+Tools>"
4239 #: ../src/guestfs.pod:2183
4240 msgid "When reporting a bug, please check:"
4244 #: ../src/guestfs.pod:2189
4245 msgid "That the bug hasn't been reported already."
4249 #: ../src/guestfs.pod:2193
4250 msgid "That you are testing a recent version."
4254 #: ../src/guestfs.pod:2197
4255 msgid "Describe the bug accurately, and give a way to reproduce it."
4259 #: ../src/guestfs.pod:2201
4261 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4266 #: ../src/guestfs.pod:2206 ../fish/guestfish.pod:1108
4267 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4272 #: ../src/guestfs.pod:2208 ../fish/guestfish.pod:1110
4273 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4274 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4278 #: ../src/guestfs.pod:2210 ../fish/guestfish.pod:1112
4279 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4280 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:602
4281 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
4282 #: ../tools/virt-tar.pl:296 ../tools/virt-make-fs.pl:563
4283 #: ../tools/virt-list-partitions.pl:273
4288 #: ../src/guestfs.pod:2212 ../fish/guestfish.pod:1114
4289 #: ../fuse/guestmount.pod:250
4290 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4294 #: ../src/guestfs.pod:2215
4296 "This library is free software; you can redistribute it and/or modify it "
4297 "under the terms of the GNU Lesser General Public License as published by the "
4298 "Free Software Foundation; either version 2 of the License, or (at your "
4299 "option) any later version."
4303 #: ../src/guestfs.pod:2220
4305 "This library is distributed in the hope that it will be useful, but WITHOUT "
4306 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4307 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4312 #: ../src/guestfs.pod:2225
4314 "You should have received a copy of the GNU Lesser General Public License "
4315 "along with this library; if not, write to the Free Software Foundation, "
4316 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4320 #: ../src/guestfs-actions.pod:1
4321 msgid "guestfs_add_cdrom"
4325 #: ../src/guestfs-actions.pod:3
4329 " guestfs_add_cdrom (guestfs_h *g,\n"
4330 " const char *filename);\n"
4335 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4336 msgid "This function adds a virtual CD-ROM disk image to the guest."
4340 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4341 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4345 #: ../src/guestfs-actions.pod:17
4347 "This call checks for the existence of C<filename>. This stops you from "
4348 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4349 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4354 #: ../src/guestfs-actions.pod:24
4356 "If you just want to add an ISO file (often you use this as an efficient way "
4357 "to transfer large files into the guest), then you should probably use "
4358 "C<guestfs_add_drive_ro> instead."
4362 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:128
4363 #: ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:226
4364 #: ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261
4365 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:295
4366 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4367 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:489
4368 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4369 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:635
4370 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:664
4371 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
4372 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
4373 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:990
4374 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1092
4375 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1129
4376 #: ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1163
4377 #: ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264
4378 #: ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1326
4379 #: ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1466
4380 #: ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706
4381 #: ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:2243
4382 #: ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2448
4383 #: ../src/guestfs-actions.pod:2483 ../src/guestfs-actions.pod:3222
4384 #: ../src/guestfs-actions.pod:3237 ../src/guestfs-actions.pod:3257
4385 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3424
4386 #: ../src/guestfs-actions.pod:3437 ../src/guestfs-actions.pod:3451
4387 #: ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3502
4388 #: ../src/guestfs-actions.pod:3574 ../src/guestfs-actions.pod:3594
4389 #: ../src/guestfs-actions.pod:3611 ../src/guestfs-actions.pod:3634
4390 #: ../src/guestfs-actions.pod:3657 ../src/guestfs-actions.pod:3689
4391 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:3727
4392 #: ../src/guestfs-actions.pod:3762 ../src/guestfs-actions.pod:3774
4393 #: ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:3826
4394 #: ../src/guestfs-actions.pod:3839 ../src/guestfs-actions.pod:3854
4395 #: ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3964
4396 #: ../src/guestfs-actions.pod:3984 ../src/guestfs-actions.pod:3997
4397 #: ../src/guestfs-actions.pod:4048 ../src/guestfs-actions.pod:4066
4398 #: ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4100
4399 #: ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4128
4400 #: ../src/guestfs-actions.pod:4145 ../src/guestfs-actions.pod:4160
4401 #: ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4224
4402 #: ../src/guestfs-actions.pod:4295 ../src/guestfs-actions.pod:4326
4403 #: ../src/guestfs-actions.pod:4345 ../src/guestfs-actions.pod:4364
4404 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4393
4405 #: ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4421
4406 #: ../src/guestfs-actions.pod:4436 ../src/guestfs-actions.pod:4471
4407 #: ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4506
4408 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4537
4409 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4623
4410 #: ../src/guestfs-actions.pod:4637 ../src/guestfs-actions.pod:4665
4411 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4700
4412 #: ../src/guestfs-actions.pod:4834 ../src/guestfs-actions.pod:4891
4413 #: ../src/guestfs-actions.pod:4913 ../src/guestfs-actions.pod:4931
4414 #: ../src/guestfs-actions.pod:4963 ../src/guestfs-actions.pod:5029
4415 #: ../src/guestfs-actions.pod:5046 ../src/guestfs-actions.pod:5059
4416 #: ../src/guestfs-actions.pod:5073 ../src/guestfs-actions.pod:5362
4417 #: ../src/guestfs-actions.pod:5381 ../src/guestfs-actions.pod:5395
4418 #: ../src/guestfs-actions.pod:5407 ../src/guestfs-actions.pod:5421
4419 #: ../src/guestfs-actions.pod:5433 ../src/guestfs-actions.pod:5447
4420 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5484
4421 #: ../src/guestfs-actions.pod:5503 ../src/guestfs-actions.pod:5522
4422 #: ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5563
4423 #: ../src/guestfs-actions.pod:5581 ../src/guestfs-actions.pod:5600
4424 #: ../src/guestfs-actions.pod:5621 ../src/guestfs-actions.pod:5640
4425 #: ../src/guestfs-actions.pod:5657 ../src/guestfs-actions.pod:5685
4426 #: ../src/guestfs-actions.pod:5709 ../src/guestfs-actions.pod:5728
4427 #: ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:5767
4428 #: ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:5801
4429 #: ../src/guestfs-actions.pod:5838 ../src/guestfs-actions.pod:5861
4430 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:5995
4431 #: ../src/guestfs-actions.pod:6116 ../src/guestfs-actions.pod:6128
4432 #: ../src/guestfs-actions.pod:6141 ../src/guestfs-actions.pod:6154
4433 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6189
4434 #: ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6215
4435 #: ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6289
4436 #: ../src/guestfs-actions.pod:6306 ../src/guestfs-actions.pod:6322
4437 #: ../src/guestfs-actions.pod:6338 ../src/guestfs-actions.pod:6355
4438 #: ../src/guestfs-actions.pod:6368 ../src/guestfs-actions.pod:6388
4439 #: ../src/guestfs-actions.pod:6424 ../src/guestfs-actions.pod:6438
4440 #: ../src/guestfs-actions.pod:6479 ../src/guestfs-actions.pod:6492
4441 #: ../src/guestfs-actions.pod:6510 ../src/guestfs-actions.pod:6544
4442 #: ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:6699
4443 #: ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6731
4444 #: ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:6799
4445 #: ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6877
4446 #: ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6957
4447 #: ../src/guestfs-actions.pod:7023 ../src/guestfs-actions.pod:7042
4448 #: ../src/guestfs-actions.pod:7071
4449 msgid "This function returns 0 on success or -1 on error."
4453 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:242
4454 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:28
4455 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4457 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4462 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:245
4463 #: ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:1437
4464 #: ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1944
4465 #: ../src/guestfs-actions.pod:4185 ../src/guestfs-actions.pod:6965
4466 #: ../src/guestfs-actions.pod:7134 ../fish/guestfish-actions.pod:31
4467 #: ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170
4468 #: ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308
4469 #: ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:2818
4470 #: ../fish/guestfish-actions.pod:4620 ../fish/guestfish-actions.pod:4717
4472 "Deprecated functions will not be removed from the API, but the fact that "
4473 "they are deprecated indicates that there are problems with correct use of "
4478 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:130
4479 #: ../src/guestfs-actions.pod:1094 ../src/guestfs-actions.pod:1895
4480 #: ../src/guestfs-actions.pod:1993 ../src/guestfs-actions.pod:2096
4481 #: ../src/guestfs-actions.pod:3224 ../src/guestfs-actions.pod:3239
4482 #: ../src/guestfs-actions.pod:4473 ../src/guestfs-actions.pod:5542
4483 #: ../src/guestfs-actions.pod:5659 ../src/guestfs-actions.pod:5769
4484 #: ../src/guestfs-actions.pod:6232 ../src/guestfs-actions.pod:6357
4485 #: ../src/guestfs-actions.pod:6879
4486 msgid "(Added in 0.3)"
4490 #: ../src/guestfs-actions.pod:41
4491 msgid "guestfs_add_domain"
4495 #: ../src/guestfs-actions.pod:43
4499 " guestfs_add_domain (guestfs_h *g,\n"
4500 " const char *dom,\n"
4506 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:139
4507 #: ../src/guestfs-actions.pod:4199
4509 "You may supply a list of optional arguments to this call. Use zero or more "
4510 "of the following pairs of parameters, and terminate the list with C<-1> on "
4511 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4515 #: ../src/guestfs-actions.pod:53
4518 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4519 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4520 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4525 #: ../src/guestfs-actions.pod:57
4527 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4528 "It works by connecting to libvirt, requesting the domain and domain XML from "
4529 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4534 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4536 "The number of disks added is returned. This operation is atomic: if an "
4537 "error is returned, then no disks are added."
4541 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4543 "This function does some minimal checks to make sure the libvirt domain is "
4544 "not running (unless C<readonly> is true). In a future version we will try "
4545 "to acquire the libvirt lock on each disk."
4549 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4551 "Disks must be accessible locally. This often means that adding disks from a "
4552 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4553 "unless those disks are accessible via the same device path locally too."
4557 #: ../src/guestfs-actions.pod:74
4559 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4560 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4561 "libvirt URI (or one set through an environment variable, see the libvirt "
4562 "documentation for full details). If you are using the C API directly then "
4563 "it is more flexible to create the libvirt connection object yourself, get "
4564 "the domain object, and call C<guestfs_add_libvirt_dom>."
4568 #: ../src/guestfs-actions.pod:82
4570 "The other optional parameters are passed directly through to "
4571 "C<guestfs_add_drive_opts>."
4575 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:338
4576 #: ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:681
4577 #: ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730
4578 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:1309
4579 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1866
4580 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2005
4581 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2083
4582 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2662
4583 #: ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:4609
4584 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:5143
4585 #: ../src/guestfs-actions.pod:5169 ../src/guestfs-actions.pod:6465
4586 #: ../src/guestfs-actions.pod:6890 ../src/guestfs-actions.pod:6903
4587 #: ../src/guestfs-actions.pod:6916
4588 msgid "On error this function returns -1."
4592 #: ../src/guestfs-actions.pod:87
4593 msgid "(Added in 1.7.4)"
4597 #: ../src/guestfs-actions.pod:89
4598 msgid "guestfs_add_domain_va"
4602 #: ../src/guestfs-actions.pod:91
4606 " guestfs_add_domain_va (guestfs_h *g,\n"
4607 " const char *dom,\n"
4613 #: ../src/guestfs-actions.pod:96
4614 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4618 #: ../src/guestfs-actions.pod:98 ../src/guestfs-actions.pod:109
4619 #: ../src/guestfs-actions.pod:202 ../src/guestfs-actions.pod:213
4620 #: ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4248
4621 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4625 #: ../src/guestfs-actions.pod:100
4626 msgid "guestfs_add_domain_argv"
4630 #: ../src/guestfs-actions.pod:102
4634 " guestfs_add_domain_argv (guestfs_h *g,\n"
4635 " const char *dom,\n"
4636 " const struct guestfs_add_domain_argv *optargs);\n"
4641 #: ../src/guestfs-actions.pod:107
4642 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4646 #: ../src/guestfs-actions.pod:111
4647 msgid "guestfs_add_drive"
4651 #: ../src/guestfs-actions.pod:113
4655 " guestfs_add_drive (guestfs_h *g,\n"
4656 " const char *filename);\n"
4661 #: ../src/guestfs-actions.pod:117
4663 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4664 "optional parameters, so the disk is added writable, with the format being "
4665 "detected automatically."
4669 #: ../src/guestfs-actions.pod:121
4671 "Automatic detection of the format opens you up to a potential security hole "
4672 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4673 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4674 "you should think about replacing calls to this function with calls to "
4675 "C<guestfs_add_drive_opts>, and specifying the format."
4679 #: ../src/guestfs-actions.pod:132
4680 msgid "guestfs_add_drive_opts"
4684 #: ../src/guestfs-actions.pod:134
4688 " guestfs_add_drive_opts (guestfs_h *g,\n"
4689 " const char *filename,\n"
4695 #: ../src/guestfs-actions.pod:144
4698 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4699 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4700 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4705 #: ../src/guestfs-actions.pod:148 ../fish/guestfish-actions.pod:92
4707 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4708 "The first time you call this function, the disk appears as C</dev/sda>, the "
4709 "second time as C</dev/sdb>, and so on."
4713 #: ../src/guestfs-actions.pod:153 ../fish/guestfish-actions.pod:97
4715 "You don't necessarily need to be root when using libguestfs. However you "
4716 "obviously do need sufficient permissions to access the filename for whatever "
4717 "operations you want to perform (ie. read access if you just want to read the "
4718 "image or write access if you want to modify the image)."
4722 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:103
4723 msgid "This call checks that C<filename> exists."
4727 #: ../src/guestfs-actions.pod:161 ../src/guestfs-actions.pod:4209
4728 #: ../fish/guestfish-actions.pod:105 ../fish/guestfish-actions.pod:2829
4729 msgid "The optional arguments are:"
4733 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
4738 #: ../src/guestfs-actions.pod:167 ../fish/guestfish-actions.pod:111
4740 "If true then the image is treated as read-only. Writes are still allowed, "
4741 "but they are stored in a temporary snapshot overlay which is discarded at "
4742 "the end. The disk that you add is not modified."
4746 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:115
4751 #: ../src/guestfs-actions.pod:173
4753 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4754 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4755 "Possible formats include C<raw> and C<qcow2>."
4759 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:121
4761 "Automatic detection of the format opens you up to a potential security hole "
4762 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4763 "RHBZ#642934. Specifying the format closes this security hole."
4767 #: ../src/guestfs-actions.pod:182 ../fish/guestfish-actions.pod:126
4772 #: ../src/guestfs-actions.pod:184
4774 "This rarely-used option lets you emulate the behaviour of the deprecated "
4775 "C<guestfs_add_drive_with_if> call (q.v.)"
4779 #: ../src/guestfs-actions.pod:191
4780 msgid "(Added in 1.5.23)"
4784 #: ../src/guestfs-actions.pod:193
4785 msgid "guestfs_add_drive_opts_va"
4789 #: ../src/guestfs-actions.pod:195
4793 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4794 " const char *filename,\n"
4800 #: ../src/guestfs-actions.pod:200
4801 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4805 #: ../src/guestfs-actions.pod:204
4806 msgid "guestfs_add_drive_opts_argv"
4810 #: ../src/guestfs-actions.pod:206
4814 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4815 " const char *filename,\n"
4816 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4821 #: ../src/guestfs-actions.pod:211
4822 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4826 #: ../src/guestfs-actions.pod:215
4827 msgid "guestfs_add_drive_ro"
4831 #: ../src/guestfs-actions.pod:217
4835 " guestfs_add_drive_ro (guestfs_h *g,\n"
4836 " const char *filename);\n"
4841 #: ../src/guestfs-actions.pod:221
4843 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4844 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4845 "disk is added read-only, with the format being detected automatically."
4849 #: ../src/guestfs-actions.pod:228
4850 msgid "(Added in 1.0.38)"
4854 #: ../src/guestfs-actions.pod:230
4855 msgid "guestfs_add_drive_ro_with_if"
4859 #: ../src/guestfs-actions.pod:232
4863 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4864 " const char *filename,\n"
4865 " const char *iface);\n"
4870 #: ../src/guestfs-actions.pod:237
4872 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4873 "QEMU interface emulation to use at run time."
4877 #: ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
4878 #: ../src/guestfs-actions.pod:2333
4879 msgid "(Added in 1.0.84)"
4883 #: ../src/guestfs-actions.pod:251
4884 msgid "guestfs_add_drive_with_if"
4888 #: ../src/guestfs-actions.pod:253
4892 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4893 " const char *filename,\n"
4894 " const char *iface);\n"
4899 #: ../src/guestfs-actions.pod:258
4901 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4902 "QEMU interface emulation to use at run time."
4906 #: ../src/guestfs-actions.pod:272
4907 msgid "guestfs_aug_clear"
4911 #: ../src/guestfs-actions.pod:274
4915 " guestfs_aug_clear (guestfs_h *g,\n"
4916 " const char *augpath);\n"
4921 #: ../src/guestfs-actions.pod:278 ../fish/guestfish-actions.pod:178
4923 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4924 "L<augtool(1)> C<clear> command."
4928 #: ../src/guestfs-actions.pod:283 ../src/guestfs-actions.pod:2085
4929 msgid "(Added in 1.3.4)"
4933 #: ../src/guestfs-actions.pod:285
4934 msgid "guestfs_aug_close"
4938 #: ../src/guestfs-actions.pod:287
4942 " guestfs_aug_close (guestfs_h *g);\n"
4947 #: ../src/guestfs-actions.pod:290
4949 "Close the current Augeas handle and free up any resources used by it. After "
4950 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4951 "any other Augeas functions."
4955 #: ../src/guestfs-actions.pod:297 ../src/guestfs-actions.pod:322
4956 #: ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:354
4957 #: ../src/guestfs-actions.pod:412 ../src/guestfs-actions.pod:432
4958 #: ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:477
4959 #: ../src/guestfs-actions.pod:491 ../src/guestfs-actions.pod:505
4960 #: ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:537
4961 #: ../src/guestfs-actions.pod:5220
4962 msgid "(Added in 0.7)"
4966 #: ../src/guestfs-actions.pod:299
4967 msgid "guestfs_aug_defnode"
4971 #: ../src/guestfs-actions.pod:301
4974 " struct guestfs_int_bool *\n"
4975 " guestfs_aug_defnode (guestfs_h *g,\n"
4976 " const char *name,\n"
4977 " const char *expr,\n"
4978 " const char *val);\n"
4983 #: ../src/guestfs-actions.pod:307 ../fish/guestfish-actions.pod:194
4985 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4989 #: ../src/guestfs-actions.pod:310
4991 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4992 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4993 "containing that single node."
4997 #: ../src/guestfs-actions.pod:314 ../fish/guestfish-actions.pod:201
4999 "On success this returns a pair containing the number of nodes in the "
5000 "nodeset, and a boolean flag if a node was created."
5004 #: ../src/guestfs-actions.pod:318
5006 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
5007 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
5011 #: ../src/guestfs-actions.pod:324
5012 msgid "guestfs_aug_defvar"
5016 #: ../src/guestfs-actions.pod:326
5020 " guestfs_aug_defvar (guestfs_h *g,\n"
5021 " const char *name,\n"
5022 " const char *expr);\n"
5027 #: ../src/guestfs-actions.pod:331 ../fish/guestfish-actions.pod:209
5029 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5030 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5034 #: ../src/guestfs-actions.pod:335 ../fish/guestfish-actions.pod:213
5036 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5037 "evaluates to something which is not a nodeset."
5041 #: ../src/guestfs-actions.pod:342
5042 msgid "guestfs_aug_get"
5046 #: ../src/guestfs-actions.pod:344
5050 " guestfs_aug_get (guestfs_h *g,\n"
5051 " const char *augpath);\n"
5056 #: ../src/guestfs-actions.pod:348 ../fish/guestfish-actions.pod:220
5058 "Look up the value associated with C<path>. If C<path> matches exactly one "
5059 "node, the C<value> is returned."
5063 #: ../src/guestfs-actions.pod:351 ../src/guestfs-actions.pod:851
5064 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:929
5065 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1048
5066 #: ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1195
5067 #: ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1343
5068 #: ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1646
5069 #: ../src/guestfs-actions.pod:1809 ../src/guestfs-actions.pod:1826
5070 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1938
5071 #: ../src/guestfs-actions.pod:2108 ../src/guestfs-actions.pod:2298
5072 #: ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2586
5073 #: ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2744
5074 #: ../src/guestfs-actions.pod:2775 ../src/guestfs-actions.pod:2799
5075 #: ../src/guestfs-actions.pod:2861 ../src/guestfs-actions.pod:2884
5076 #: ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3746
5077 #: ../src/guestfs-actions.pod:3916 ../src/guestfs-actions.pod:4026
5078 #: ../src/guestfs-actions.pod:4755 ../src/guestfs-actions.pod:4948
5079 #: ../src/guestfs-actions.pod:5118 ../src/guestfs-actions.pod:5296
5080 #: ../src/guestfs-actions.pod:5345 ../src/guestfs-actions.pod:5908
5081 #: ../src/guestfs-actions.pod:5924 ../src/guestfs-actions.pod:5941
5082 #: ../src/guestfs-actions.pod:5965 ../src/guestfs-actions.pod:6639
5083 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6676
5084 #: ../src/guestfs-actions.pod:6856 ../src/guestfs-actions.pod:7128
5086 "This function returns a string, or NULL on error. I<The caller must free "
5087 "the returned string after use>."
5091 #: ../src/guestfs-actions.pod:356
5092 msgid "guestfs_aug_init"
5096 #: ../src/guestfs-actions.pod:358
5100 " guestfs_aug_init (guestfs_h *g,\n"
5101 " const char *root,\n"
5107 #: ../src/guestfs-actions.pod:363 ../fish/guestfish-actions.pod:227
5109 "Create a new Augeas handle for editing configuration files. If there was "
5110 "any previous Augeas handle associated with this guestfs session, then it is "
5115 #: ../src/guestfs-actions.pod:367
5116 msgid "You must call this before using any other C<guestfs_aug_*> commands."
5120 #: ../src/guestfs-actions.pod:370 ../fish/guestfish-actions.pod:234
5122 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5126 #: ../src/guestfs-actions.pod:373 ../fish/guestfish-actions.pod:237
5128 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5129 "logical I<or> of the following integers:"
5133 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
5134 msgid "C<AUG_SAVE_BACKUP> = 1"
5138 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
5139 msgid "Keep the original file with a C<.augsave> extension."
5143 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
5144 msgid "C<AUG_SAVE_NEWFILE> = 2"
5148 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:249
5150 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5151 "original. Overrides C<AUG_SAVE_BACKUP>."
5155 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
5156 msgid "C<AUG_TYPE_CHECK> = 4"
5160 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
5161 msgid "Typecheck lenses (can be expensive)."
5165 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
5166 msgid "C<AUG_NO_STDINC> = 8"
5170 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
5171 msgid "Do not use standard load path for modules."
5175 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
5176 msgid "C<AUG_SAVE_NOOP> = 16"
5180 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
5181 msgid "Make save a no-op, just record what would have been changed."
5185 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:264
5186 msgid "C<AUG_NO_LOAD> = 32"
5190 #: ../src/guestfs-actions.pod:402
5191 msgid "Do not load the tree in C<guestfs_aug_init>."
5195 #: ../src/guestfs-actions.pod:406
5196 msgid "To close the handle, you can call C<guestfs_aug_close>."
5200 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:272
5201 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5205 #: ../src/guestfs-actions.pod:414
5206 msgid "guestfs_aug_insert"
5210 #: ../src/guestfs-actions.pod:416
5214 " guestfs_aug_insert (guestfs_h *g,\n"
5215 " const char *augpath,\n"
5216 " const char *label,\n"
5222 #: ../src/guestfs-actions.pod:422 ../fish/guestfish-actions.pod:278
5224 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5225 "or after C<path> (depending on the boolean flag C<before>)."
5229 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:282
5231 "C<path> must match exactly one existing node in the tree, and C<label> must "
5232 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5236 #: ../src/guestfs-actions.pod:434
5237 msgid "guestfs_aug_load"
5241 #: ../src/guestfs-actions.pod:436
5245 " guestfs_aug_load (guestfs_h *g);\n"
5250 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
5251 msgid "Load files into the tree."
5255 #: ../src/guestfs-actions.pod:441 ../fish/guestfish-actions.pod:292
5256 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5260 #: ../src/guestfs-actions.pod:448
5261 msgid "guestfs_aug_ls"
5265 #: ../src/guestfs-actions.pod:450
5269 " guestfs_aug_ls (guestfs_h *g,\n"
5270 " const char *augpath);\n"
5275 #: ../src/guestfs-actions.pod:454
5277 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5278 "sorting the resulting nodes into alphabetical order."
5282 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:473
5283 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:1067
5284 #: ../src/guestfs-actions.pod:1358 ../src/guestfs-actions.pod:1377
5285 #: ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1499
5286 #: ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:2178
5287 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2213
5288 #: ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2280
5289 #: ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2400
5290 #: ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2818
5291 #: ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:3316
5292 #: ../src/guestfs-actions.pod:3378 ../src/guestfs-actions.pod:3483
5293 #: ../src/guestfs-actions.pod:3888 ../src/guestfs-actions.pod:4570
5294 #: ../src/guestfs-actions.pod:5090 ../src/guestfs-actions.pod:5216
5295 #: ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5981
5296 #: ../src/guestfs-actions.pod:6042 ../src/guestfs-actions.pod:6097
5297 #: ../src/guestfs-actions.pod:6243 ../src/guestfs-actions.pod:6267
5298 #: ../src/guestfs-actions.pod:6749 ../src/guestfs-actions.pod:6769
5299 #: ../src/guestfs-actions.pod:6816 ../src/guestfs-actions.pod:6981
5300 #: ../src/guestfs-actions.pod:7000 ../src/guestfs-actions.pod:7085
5301 #: ../src/guestfs-actions.pod:7104 ../src/guestfs-actions.pod:7150
5302 #: ../src/guestfs-actions.pod:7169
5304 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5305 ">), or NULL if there was an error. I<The caller must free the strings and "
5306 "the array after use>."
5310 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:992
5311 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:1415
5312 #: ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3142
5313 #: ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:3779
5314 #: ../src/guestfs-actions.pod:3966 ../src/guestfs-actions.pod:3999
5315 #: ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4574
5316 #: ../src/guestfs-actions.pod:5031 ../src/guestfs-actions.pod:5409
5317 #: ../src/guestfs-actions.pod:5423 ../src/guestfs-actions.pod:5435
5318 #: ../src/guestfs-actions.pod:5843 ../src/guestfs-actions.pod:6481
5319 #: ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6733
5320 #: ../src/guestfs-actions.pod:6936 ../src/guestfs-actions.pod:6969
5321 msgid "(Added in 0.8)"
5325 #: ../src/guestfs-actions.pod:463
5326 msgid "guestfs_aug_match"
5330 #: ../src/guestfs-actions.pod:465
5334 " guestfs_aug_match (guestfs_h *g,\n"
5335 " const char *augpath);\n"
5340 #: ../src/guestfs-actions.pod:469 ../fish/guestfish-actions.pod:306
5342 "Returns a list of paths which match the path expression C<path>. The "
5343 "returned paths are sufficiently qualified so that they match exactly one "
5344 "node in the current tree."
5348 #: ../src/guestfs-actions.pod:479
5349 msgid "guestfs_aug_mv"
5353 #: ../src/guestfs-actions.pod:481
5357 " guestfs_aug_mv (guestfs_h *g,\n"
5358 " const char *src,\n"
5359 " const char *dest);\n"
5364 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:314
5366 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5367 "C<dest> is overwritten if it exists."
5371 #: ../src/guestfs-actions.pod:493
5372 msgid "guestfs_aug_rm"
5376 #: ../src/guestfs-actions.pod:495
5380 " guestfs_aug_rm (guestfs_h *g,\n"
5381 " const char *augpath);\n"
5386 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5387 msgid "Remove C<path> and all of its children."
5391 #: ../src/guestfs-actions.pod:501 ../fish/guestfish-actions.pod:323
5392 msgid "On success this returns the number of entries which were removed."
5396 #: ../src/guestfs-actions.pod:507
5397 msgid "guestfs_aug_save"
5401 #: ../src/guestfs-actions.pod:509
5405 " guestfs_aug_save (guestfs_h *g);\n"
5410 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:329
5411 msgid "This writes all pending changes to disk."
5415 #: ../src/guestfs-actions.pod:514
5417 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5422 #: ../src/guestfs-actions.pod:521
5423 msgid "guestfs_aug_set"
5427 #: ../src/guestfs-actions.pod:523
5431 " guestfs_aug_set (guestfs_h *g,\n"
5432 " const char *augpath,\n"
5433 " const char *val);\n"
5438 #: ../src/guestfs-actions.pod:528 ../fish/guestfish-actions.pod:338
5439 msgid "Set the value associated with C<path> to C<val>."
5443 #: ../src/guestfs-actions.pod:530
5445 "In the Augeas API, it is possible to clear a node by setting the value to "
5446 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5447 "this call. Instead you must use the C<guestfs_aug_clear> call."
5451 #: ../src/guestfs-actions.pod:539
5452 msgid "guestfs_available"
5456 #: ../src/guestfs-actions.pod:541
5460 " guestfs_available (guestfs_h *g,\n"
5461 " char *const *groups);\n"
5466 #: ../src/guestfs-actions.pod:545 ../fish/guestfish-actions.pod:349
5468 "This command is used to check the availability of some groups of "
5469 "functionality in the appliance, which not all builds of the libguestfs "
5470 "appliance will be able to provide."
5474 #: ../src/guestfs-actions.pod:549
5476 "The libguestfs groups, and the functions that those groups correspond to, "
5477 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5478 "runtime by calling C<guestfs_available_all_groups>."
5482 #: ../src/guestfs-actions.pod:554 ../fish/guestfish-actions.pod:358
5484 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5485 "\"]> would check for the availability of the Linux inotify functions and "
5486 "Augeas (configuration file editing) functions."
5490 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5491 msgid "The command returns no error if I<all> requested groups are available."
5495 #: ../src/guestfs-actions.pod:561 ../fish/guestfish-actions.pod:365
5497 "It fails with an error if one or more of the requested groups is unavailable "
5502 #: ../src/guestfs-actions.pod:564 ../fish/guestfish-actions.pod:368
5504 "If an unknown group name is included in the list of groups then an error is "
5509 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:371
5514 #: ../src/guestfs-actions.pod:573
5515 msgid "You must call C<guestfs_launch> before calling this function."
5519 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:379
5521 "The reason is because we don't know what groups are supported by the "
5522 "appliance/daemon until it is running and can be queried."
5526 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:385
5528 "If a group of functions is available, this does not necessarily mean that "
5529 "they will work. You still have to check for errors when calling individual "
5530 "API functions even if they are available."
5534 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:392
5536 "It is usually the job of distro packagers to build complete functionality "
5537 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5538 "with all requirements satisfied, will support everything."
5542 #: ../src/guestfs-actions.pod:595
5544 "This call was added in version C<1.0.80>. In previous versions of "
5545 "libguestfs all you could do would be to speculatively execute a command to "
5546 "find out if the daemon implemented it. See also C<guestfs_version>."
5550 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1165
5551 msgid "(Added in 1.0.80)"
5555 #: ../src/guestfs-actions.pod:606
5556 msgid "guestfs_available_all_groups"
5560 #: ../src/guestfs-actions.pod:608
5564 " guestfs_available_all_groups (guestfs_h *g);\n"
5569 #: ../src/guestfs-actions.pod:611
5571 "This command returns a list of all optional groups that this daemon knows "
5572 "about. Note this returns both supported and unsupported groups. To find "
5573 "out which ones the daemon can actually support you have to call "
5574 "C<guestfs_available> on each member of the returned list."
5578 #: ../src/guestfs-actions.pod:617
5579 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5583 #: ../src/guestfs-actions.pod:623
5584 msgid "(Added in 1.3.15)"
5588 #: ../src/guestfs-actions.pod:625
5589 msgid "guestfs_base64_in"
5593 #: ../src/guestfs-actions.pod:627
5597 " guestfs_base64_in (guestfs_h *g,\n"
5598 " const char *base64file,\n"
5599 " const char *filename);\n"
5604 #: ../src/guestfs-actions.pod:632 ../fish/guestfish-actions.pod:422
5606 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5610 #: ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:651
5611 msgid "(Added in 1.3.5)"
5615 #: ../src/guestfs-actions.pod:639
5616 msgid "guestfs_base64_out"
5620 #: ../src/guestfs-actions.pod:641
5624 " guestfs_base64_out (guestfs_h *g,\n"
5625 " const char *filename,\n"
5626 " const char *base64file);\n"
5631 #: ../src/guestfs-actions.pod:646 ../fish/guestfish-actions.pod:431
5633 "This command downloads the contents of C<filename>, writing it out to local "
5634 "file C<base64file> encoded as base64."
5638 #: ../src/guestfs-actions.pod:653
5639 msgid "guestfs_blockdev_flushbufs"
5643 #: ../src/guestfs-actions.pod:655
5647 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5648 " const char *device);\n"
5653 #: ../src/guestfs-actions.pod:659 ../fish/guestfish-actions.pod:440
5655 "This tells the kernel to flush internal buffers associated with C<device>."
5659 #: ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:679
5660 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:710
5661 #: ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747
5662 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
5663 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
5664 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5665 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5666 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5667 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5668 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5669 msgid "This uses the L<blockdev(8)> command."
5673 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:683
5674 #: ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:714
5675 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:751
5676 #: ../src/guestfs-actions.pod:765 ../src/guestfs-actions.pod:783
5677 #: ../src/guestfs-actions.pod:797 ../src/guestfs-actions.pod:811
5678 msgid "(Added in 0.9.3)"
5682 #: ../src/guestfs-actions.pod:668
5683 msgid "guestfs_blockdev_getbsz"
5687 #: ../src/guestfs-actions.pod:670
5691 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5692 " const char *device);\n"
5697 #: ../src/guestfs-actions.pod:674 ../fish/guestfish-actions.pod:449
5698 msgid "This returns the block size of a device."
5702 #: ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:776
5703 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5705 "(Note this is different from both I<size in blocks> and I<filesystem block "
5710 #: ../src/guestfs-actions.pod:685
5711 msgid "guestfs_blockdev_getro"
5715 #: ../src/guestfs-actions.pod:687
5719 " guestfs_blockdev_getro (guestfs_h *g,\n"
5720 " const char *device);\n"
5725 #: ../src/guestfs-actions.pod:691 ../fish/guestfish-actions.pod:460
5727 "Returns a boolean indicating if the block device is read-only (true if read-"
5728 "only, false if not)."
5732 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:1398
5733 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1893
5734 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1976
5735 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2046
5736 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2094
5737 #: ../src/guestfs-actions.pod:3050 ../src/guestfs-actions.pod:3064
5738 #: ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3093
5739 #: ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3124
5740 #: ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3154
5741 #: ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3181
5742 #: ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211
5743 #: ../src/guestfs-actions.pod:4719
5744 msgid "This function returns a C truth value on success or -1 on error."
5748 #: ../src/guestfs-actions.pod:700
5749 msgid "guestfs_blockdev_getsize64"
5753 #: ../src/guestfs-actions.pod:702
5757 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5758 " const char *device);\n"
5763 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:469
5764 msgid "This returns the size of the device in bytes."
5768 #: ../src/guestfs-actions.pod:708
5769 msgid "See also C<guestfs_blockdev_getsz>."
5773 #: ../src/guestfs-actions.pod:716
5774 msgid "guestfs_blockdev_getss"
5778 #: ../src/guestfs-actions.pod:718
5782 " guestfs_blockdev_getss (guestfs_h *g,\n"
5783 " const char *device);\n"
5788 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:479
5790 "This returns the size of sectors on a block device. Usually 512, but can be "
5791 "larger for modern devices."
5795 #: ../src/guestfs-actions.pod:725
5797 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5802 #: ../src/guestfs-actions.pod:734
5803 msgid "guestfs_blockdev_getsz"
5807 #: ../src/guestfs-actions.pod:736
5811 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5812 " const char *device);\n"
5817 #: ../src/guestfs-actions.pod:740 ../fish/guestfish-actions.pod:491
5819 "This returns the size of the device in units of 512-byte sectors (even if "
5820 "the sectorsize isn't 512 bytes ... weird)."
5824 #: ../src/guestfs-actions.pod:743
5826 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5827 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5831 #: ../src/guestfs-actions.pod:753
5832 msgid "guestfs_blockdev_rereadpt"
5836 #: ../src/guestfs-actions.pod:755
5840 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5841 " const char *device);\n"
5846 #: ../src/guestfs-actions.pod:759 ../fish/guestfish-actions.pod:504
5847 msgid "Reread the partition table on C<device>."
5851 #: ../src/guestfs-actions.pod:767
5852 msgid "guestfs_blockdev_setbsz"
5856 #: ../src/guestfs-actions.pod:769
5860 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5861 " const char *device,\n"
5862 " int blocksize);\n"
5867 #: ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:512
5868 msgid "This sets the block size of a device."
5872 #: ../src/guestfs-actions.pod:785
5873 msgid "guestfs_blockdev_setro"
5877 #: ../src/guestfs-actions.pod:787
5881 " guestfs_blockdev_setro (guestfs_h *g,\n"
5882 " const char *device);\n"
5887 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:523
5888 msgid "Sets the block device named C<device> to read-only."
5892 #: ../src/guestfs-actions.pod:799
5893 msgid "guestfs_blockdev_setrw"
5897 #: ../src/guestfs-actions.pod:801
5901 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5902 " const char *device);\n"
5907 #: ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:531
5908 msgid "Sets the block device named C<device> to read-write."
5912 #: ../src/guestfs-actions.pod:813
5913 msgid "guestfs_case_sensitive_path"
5917 #: ../src/guestfs-actions.pod:815
5921 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5922 " const char *path);\n"
5927 #: ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:539
5929 "This can be used to resolve case insensitive paths on a filesystem which is "
5930 "case sensitive. The use case is to resolve paths which you have read from "
5931 "Windows configuration files or the Windows Registry, to the true path."
5935 #: ../src/guestfs-actions.pod:824 ../fish/guestfish-actions.pod:544
5937 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5938 "(and probably others), which is that although the underlying filesystem is "
5939 "case-insensitive, the driver exports the filesystem to Linux as case-"
5944 #: ../src/guestfs-actions.pod:829 ../fish/guestfish-actions.pod:549
5946 "One consequence of this is that special directories such as C<c:\\windows> "
5947 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5948 "precise details of how they were created. In Windows itself this would not "
5953 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:555
5955 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5960 #: ../src/guestfs-actions.pod:838 ../fish/guestfish-actions.pod:558
5962 "This function resolves the true case of each element in the path and returns "
5963 "the case-sensitive path."
5967 #: ../src/guestfs-actions.pod:841
5969 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5970 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5971 "how the directories were originally created under Windows)."
5975 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:566
5976 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5980 #: ../src/guestfs-actions.pod:849
5981 msgid "See also C<guestfs_realpath>."
5985 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:6661
5986 msgid "(Added in 1.0.75)"
5990 #: ../src/guestfs-actions.pod:856
5995 #: ../src/guestfs-actions.pod:858
5999 " guestfs_cat (guestfs_h *g,\n"
6000 " const char *path);\n"
6005 #: ../src/guestfs-actions.pod:862 ../src/guestfs-actions.pod:5206
6006 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3464
6007 msgid "Return the contents of the file named C<path>."
6011 #: ../src/guestfs-actions.pod:864
6013 "Note that this function cannot correctly handle binary files (specifically, "
6014 "files containing C<\\0> character which is treated as end of string). For "
6015 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
6016 "functions which have a more complex interface."
6020 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1051
6021 #: ../src/guestfs-actions.pod:1071 ../src/guestfs-actions.pod:1362
6022 #: ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1484
6023 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1752
6024 #: ../src/guestfs-actions.pod:2198 ../src/guestfs-actions.pod:2217
6025 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2284
6026 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2330
6027 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5014
6028 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5171
6029 #: ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:6046
6030 #: ../src/guestfs-actions.pod:6101 ../src/guestfs-actions.pod:6247
6031 #: ../src/guestfs-actions.pod:6271 ../src/guestfs-actions.pod:6933
6032 #: ../src/guestfs-actions.pod:6959 ../src/guestfs-actions.pod:6985
6033 #: ../src/guestfs-actions.pod:7004 ../src/guestfs-actions.pod:7089
6034 #: ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7154
6035 #: ../src/guestfs-actions.pod:7173 ../fish/guestfish-actions.pod:582
6036 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
6037 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
6038 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
6039 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1482
6040 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:1520
6041 #: ../fish/guestfish-actions.pod:1535 ../fish/guestfish-actions.pod:1545
6042 #: ../fish/guestfish-actions.pod:1564 ../fish/guestfish-actions.pod:3334
6043 #: ../fish/guestfish-actions.pod:3349 ../fish/guestfish-actions.pod:3425
6044 #: ../fish/guestfish-actions.pod:3442 ../fish/guestfish-actions.pod:3457
6045 #: ../fish/guestfish-actions.pod:4040 ../fish/guestfish-actions.pod:4086
6046 #: ../fish/guestfish-actions.pod:4171 ../fish/guestfish-actions.pod:4186
6047 #: ../fish/guestfish-actions.pod:4596 ../fish/guestfish-actions.pod:4614
6048 #: ../fish/guestfish-actions.pod:4631 ../fish/guestfish-actions.pod:4641
6049 #: ../fish/guestfish-actions.pod:4689 ../fish/guestfish-actions.pod:4699
6050 #: ../fish/guestfish-actions.pod:4728 ../fish/guestfish-actions.pod:4738
6052 "Because of the message protocol, there is a transfer limit of somewhere "
6053 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6057 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:3320
6058 #: ../src/guestfs-actions.pod:3382 ../src/guestfs-actions.pod:3399
6059 #: ../src/guestfs-actions.pod:3487 ../src/guestfs-actions.pod:3892
6060 #: ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:5094
6061 #: ../src/guestfs-actions.pod:5108 ../src/guestfs-actions.pod:6820
6062 #: ../src/guestfs-actions.pod:6834
6063 msgid "(Added in 0.4)"
6067 #: ../src/guestfs-actions.pod:877
6068 msgid "guestfs_checksum"
6072 #: ../src/guestfs-actions.pod:879
6076 " guestfs_checksum (guestfs_h *g,\n"
6077 " const char *csumtype,\n"
6078 " const char *path);\n"
6083 #: ../src/guestfs-actions.pod:884 ../fish/guestfish-actions.pod:589
6085 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6089 #: ../src/guestfs-actions.pod:887 ../fish/guestfish-actions.pod:592
6091 "The type of checksum to compute is given by the C<csumtype> parameter which "
6092 "must have one of the following values:"
6096 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
6101 #: ../src/guestfs-actions.pod:894 ../fish/guestfish-actions.pod:599
6103 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6108 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
6113 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
6114 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6118 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
6123 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
6124 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6128 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
6133 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
6134 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6138 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
6143 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
6144 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6148 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
6153 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
6154 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6158 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
6163 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:624
6164 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6168 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:628
6169 msgid "The checksum is returned as a printable string."
6173 #: ../src/guestfs-actions.pod:925
6174 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6178 #: ../src/guestfs-actions.pod:927
6179 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6183 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:1240
6184 #: ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:3066
6185 #: ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3156
6186 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:6517
6187 msgid "(Added in 1.0.2)"
6191 #: ../src/guestfs-actions.pod:934
6192 msgid "guestfs_checksum_device"
6196 #: ../src/guestfs-actions.pod:936
6200 " guestfs_checksum_device (guestfs_h *g,\n"
6201 " const char *csumtype,\n"
6202 " const char *device);\n"
6207 #: ../src/guestfs-actions.pod:941
6209 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6210 "device named C<device>. For the types of checksums supported see the "
6211 "C<guestfs_checksum> command."
6215 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:4625
6216 #: ../src/guestfs-actions.pod:4684 ../src/guestfs-actions.pod:4721
6217 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4915
6218 #: ../src/guestfs-actions.pod:6426 ../src/guestfs-actions.pod:6440
6219 #: ../src/guestfs-actions.pod:6846
6220 msgid "(Added in 1.3.2)"
6224 #: ../src/guestfs-actions.pod:950
6225 msgid "guestfs_checksums_out"
6229 #: ../src/guestfs-actions.pod:952
6233 " guestfs_checksums_out (guestfs_h *g,\n"
6234 " const char *csumtype,\n"
6235 " const char *directory,\n"
6236 " const char *sumsfile);\n"
6241 #: ../src/guestfs-actions.pod:958 ../fish/guestfish-actions.pod:646
6243 "This command computes the checksums of all regular files in C<directory> and "
6244 "then emits a list of those checksums to the local output file C<sumsfile>."
6248 #: ../src/guestfs-actions.pod:962 ../fish/guestfish-actions.pod:650
6250 "This can be used for verifying the integrity of a virtual machine. However "
6251 "to be properly secure you should pay attention to the output of the checksum "
6252 "command (it uses the ones from GNU coreutils). In particular when the "
6253 "filename is not printable, coreutils uses a special backslash syntax. For "
6254 "more information, see the GNU coreutils info file."
6258 #: ../src/guestfs-actions.pod:972
6259 msgid "(Added in 1.3.7)"
6263 #: ../src/guestfs-actions.pod:974
6264 msgid "guestfs_chmod"
6268 #: ../src/guestfs-actions.pod:976
6272 " guestfs_chmod (guestfs_h *g,\n"
6274 " const char *path);\n"
6279 #: ../src/guestfs-actions.pod:981 ../fish/guestfish-actions.pod:664
6281 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6286 #: ../src/guestfs-actions.pod:984 ../fish/guestfish-actions.pod:667
6288 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6289 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6294 #: ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:4143
6295 #: ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4343
6296 #: ../src/guestfs-actions.pod:4362 ../fish/guestfish-actions.pod:671
6297 #: ../fish/guestfish-actions.pod:2793 ../fish/guestfish-actions.pod:2909
6298 #: ../fish/guestfish-actions.pod:2919 ../fish/guestfish-actions.pod:2929
6299 msgid "The mode actually set is affected by the umask."
6303 #: ../src/guestfs-actions.pod:994
6304 msgid "guestfs_chown"
6308 #: ../src/guestfs-actions.pod:996
6312 " guestfs_chown (guestfs_h *g,\n"
6315 " const char *path);\n"
6320 #: ../src/guestfs-actions.pod:1002 ../fish/guestfish-actions.pod:677
6321 msgid "Change the file owner to C<owner> and group to C<group>."
6325 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:3253
6326 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2251
6328 "Only numeric uid and gid are supported. If you want to use names, you will "
6329 "need to locate and parse the password file yourself (Augeas support makes "
6330 "this relatively easy)."
6334 #: ../src/guestfs-actions.pod:1012
6335 msgid "guestfs_command"
6339 #: ../src/guestfs-actions.pod:1014
6343 " guestfs_command (guestfs_h *g,\n"
6344 " char *const *arguments);\n"
6349 #: ../src/guestfs-actions.pod:1018 ../fish/guestfish-actions.pod:687
6351 "This call runs a command from the guest filesystem. The filesystem must be "
6352 "mounted, and must contain a compatible operating system (ie. something "
6353 "Linux, with the same or compatible processor architecture)."
6357 #: ../src/guestfs-actions.pod:1023
6359 "The single parameter is an argv-style list of arguments. The first element "
6360 "is the name of the program to run. Subsequent elements are parameters. The "
6361 "list must be non-empty (ie. must contain a program name). Note that the "
6362 "command runs directly, and is I<not> invoked via the shell (see "
6367 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:699
6368 msgid "The return value is anything printed to I<stdout> by the command."
6372 #: ../src/guestfs-actions.pod:1033 ../fish/guestfish-actions.pod:702
6374 "If the command returns a non-zero exit status, then this function returns an "
6375 "error message. The error message string is the content of I<stderr> from "
6380 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:706
6382 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6383 "bin>. If you require a program from another location, you should provide "
6384 "the full path in the first parameter."
6388 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:711
6390 "Shared libraries and data files required by the program must be available on "
6391 "filesystems which are mounted in the correct places. It is the caller's "
6392 "responsibility to ensure all filesystems that are needed are mounted at the "
6397 #: ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1074
6398 #: ../src/guestfs-actions.pod:1537
6399 msgid "(Added in 0.9.1)"
6403 #: ../src/guestfs-actions.pod:1056
6404 msgid "guestfs_command_lines"
6408 #: ../src/guestfs-actions.pod:1058
6412 " guestfs_command_lines (guestfs_h *g,\n"
6413 " char *const *arguments);\n"
6418 #: ../src/guestfs-actions.pod:1062
6420 "This is the same as C<guestfs_command>, but splits the result into a list of "
6425 #: ../src/guestfs-actions.pod:1065
6426 msgid "See also: C<guestfs_sh_lines>"
6430 #: ../src/guestfs-actions.pod:1076
6431 msgid "guestfs_config"
6435 #: ../src/guestfs-actions.pod:1078
6439 " guestfs_config (guestfs_h *g,\n"
6440 " const char *qemuparam,\n"
6441 " const char *qemuvalue);\n"
6446 #: ../src/guestfs-actions.pod:1083 ../fish/guestfish-actions.pod:736
6448 "This can be used to add arbitrary qemu command line parameters of the form "
6449 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6450 "setting some parameters which would interfere with parameters that we use."
6454 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6455 msgid "The first character of C<param> string must be a C<-> (dash)."
6459 #: ../src/guestfs-actions.pod:1090 ../fish/guestfish-actions.pod:743
6460 msgid "C<value> can be NULL."
6464 #: ../src/guestfs-actions.pod:1096
6465 msgid "guestfs_copy_size"
6469 #: ../src/guestfs-actions.pod:1098
6473 " guestfs_copy_size (guestfs_h *g,\n"
6474 " const char *src,\n"
6475 " const char *dest,\n"
6481 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:749
6483 "This command copies exactly C<size> bytes from one source device or file "
6484 "C<src> to another destination device or file C<dest>."
6488 #: ../src/guestfs-actions.pod:1107 ../fish/guestfish-actions.pod:752
6490 "Note this will fail if the source is too short or if the destination is not "
6495 #: ../src/guestfs-actions.pod:1112 ../src/guestfs-actions.pod:1235
6496 #: ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1686
6497 #: ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:6512
6498 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:7025
6499 #: ../src/guestfs-actions.pod:7044
6501 "This long-running command can generate progress notification messages so "
6502 "that the caller can display a progress bar or indicator. To receive these "
6503 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6504 "guestfs_set_progress_callback>."
6508 #: ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:3919
6509 #: ../src/guestfs-actions.pod:5121 ../src/guestfs-actions.pod:6753
6510 #: ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6859
6511 msgid "(Added in 1.0.87)"
6515 #: ../src/guestfs-actions.pod:1119
6520 #: ../src/guestfs-actions.pod:1121
6524 " guestfs_cp (guestfs_h *g,\n"
6525 " const char *src,\n"
6526 " const char *dest);\n"
6531 #: ../src/guestfs-actions.pod:1126 ../fish/guestfish-actions.pod:759
6533 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6534 "destination filename or destination directory."
6538 #: ../src/guestfs-actions.pod:1131 ../src/guestfs-actions.pod:1145
6539 #: ../src/guestfs-actions.pod:1217 ../src/guestfs-actions.pod:1291
6540 #: ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:4588
6541 #: ../src/guestfs-actions.pod:4965
6542 msgid "(Added in 1.0.18)"
6546 #: ../src/guestfs-actions.pod:1133
6547 msgid "guestfs_cp_a"
6551 #: ../src/guestfs-actions.pod:1135
6555 " guestfs_cp_a (guestfs_h *g,\n"
6556 " const char *src,\n"
6557 " const char *dest);\n"
6562 #: ../src/guestfs-actions.pod:1140 ../fish/guestfish-actions.pod:766
6564 "This copies a file or directory from C<src> to C<dest> recursively using the "
6569 #: ../src/guestfs-actions.pod:1147
6574 #: ../src/guestfs-actions.pod:1149
6578 " guestfs_dd (guestfs_h *g,\n"
6579 " const char *src,\n"
6580 " const char *dest);\n"
6585 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:773
6587 "This command copies from one source device or file C<src> to another "
6588 "destination device or file C<dest>. Normally you would use this to copy to "
6589 "or from a device or partition, for example to duplicate a filesystem."
6593 #: ../src/guestfs-actions.pod:1159
6595 "If the destination is a device, it must be as large or larger than the "
6596 "source file or device, otherwise the copy will fail. This command cannot do "
6597 "partial copies (see C<guestfs_copy_size>)."
6601 #: ../src/guestfs-actions.pod:1167
6606 #: ../src/guestfs-actions.pod:1169
6610 " guestfs_df (guestfs_h *g);\n"
6615 #: ../src/guestfs-actions.pod:1172 ../fish/guestfish-actions.pod:786
6616 msgid "This command runs the C<df> command to report disk space used."
6620 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1191
6622 "This command is mostly useful for interactive sessions. It is I<not> "
6623 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
6628 #: ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1198
6629 #: ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2263
6630 #: ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2355
6631 #: ../src/guestfs-actions.pod:4029 ../src/guestfs-actions.pod:4488
6632 #: ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6274
6633 #: ../src/guestfs-actions.pod:6892 ../src/guestfs-actions.pod:6905
6634 #: ../src/guestfs-actions.pod:6918
6635 msgid "(Added in 1.0.54)"
6639 #: ../src/guestfs-actions.pod:1183
6640 msgid "guestfs_df_h"
6644 #: ../src/guestfs-actions.pod:1185
6648 " guestfs_df_h (guestfs_h *g);\n"
6653 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:796
6655 "This command runs the C<df -h> command to report disk space used in human-"
6660 #: ../src/guestfs-actions.pod:1200
6661 msgid "guestfs_dmesg"
6665 #: ../src/guestfs-actions.pod:1202
6669 " guestfs_dmesg (guestfs_h *g);\n"
6674 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:807
6676 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6677 "This is sometimes useful for extended debugging of problems."
6681 #: ../src/guestfs-actions.pod:1209
6683 "Another way to get the same information is to enable verbose messages with "
6684 "C<guestfs_set_verbose> or by setting the environment variable "
6685 "C<LIBGUESTFS_DEBUG=1> before running the program."
6689 #: ../src/guestfs-actions.pod:1219
6690 msgid "guestfs_download"
6694 #: ../src/guestfs-actions.pod:1221
6698 " guestfs_download (guestfs_h *g,\n"
6699 " const char *remotefilename,\n"
6700 " const char *filename);\n"
6705 #: ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1251
6706 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6708 "Download file C<remotefilename> and save it as C<filename> on the local "
6713 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:6506
6714 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4344
6715 msgid "C<filename> can also be a named pipe."
6719 #: ../src/guestfs-actions.pod:1231
6720 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6724 #: ../src/guestfs-actions.pod:1242
6725 msgid "guestfs_download_offset"
6729 #: ../src/guestfs-actions.pod:1244
6733 " guestfs_download_offset (guestfs_h *g,\n"
6734 " const char *remotefilename,\n"
6735 " const char *filename,\n"
6736 " int64_t offset,\n"
6742 #: ../src/guestfs-actions.pod:1254 ../fish/guestfish-actions.pod:836
6744 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6745 "region must be within the file or device)."
6749 #: ../src/guestfs-actions.pod:1257
6751 "Note that there is no limit on the amount of data that can be downloaded "
6752 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6753 "full amount unless an error occurs."
6757 #: ../src/guestfs-actions.pod:1262
6758 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6762 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:6551
6763 msgid "(Added in 1.5.17)"
6767 #: ../src/guestfs-actions.pod:1273
6768 msgid "guestfs_drop_caches"
6772 #: ../src/guestfs-actions.pod:1275
6776 " guestfs_drop_caches (guestfs_h *g,\n"
6777 " int whattodrop);\n"
6782 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:852
6784 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6785 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6786 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6790 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
6791 msgid "Setting C<whattodrop> to 3 should drop everything."
6795 #: ../src/guestfs-actions.pod:1286 ../fish/guestfish-actions.pod:859
6797 "This automatically calls L<sync(2)> before the operation, so that the "
6798 "maximum guest memory is freed."
6802 #: ../src/guestfs-actions.pod:1293
6807 #: ../src/guestfs-actions.pod:1295
6811 " guestfs_du (guestfs_h *g,\n"
6812 " const char *path);\n"
6817 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:866
6819 "This command runs the C<du -s> command to estimate file space usage for "
6824 #: ../src/guestfs-actions.pod:1302 ../fish/guestfish-actions.pod:869
6826 "C<path> can be a file or a directory. If C<path> is a directory then the "
6827 "estimate includes the contents of the directory and all subdirectories "
6832 #: ../src/guestfs-actions.pod:1306 ../fish/guestfish-actions.pod:873
6834 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6838 #: ../src/guestfs-actions.pod:1313
6839 msgid "guestfs_e2fsck_f"
6843 #: ../src/guestfs-actions.pod:1315
6847 " guestfs_e2fsck_f (guestfs_h *g,\n"
6848 " const char *device);\n"
6853 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:880
6855 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6856 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6861 #: ../src/guestfs-actions.pod:1323
6863 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6864 "Normally you should use C<guestfs_fsck>."
6868 #: ../src/guestfs-actions.pod:1328
6869 msgid "(Added in 1.0.29)"
6873 #: ../src/guestfs-actions.pod:1330
6874 msgid "guestfs_echo_daemon"
6878 #: ../src/guestfs-actions.pod:1332
6882 " guestfs_echo_daemon (guestfs_h *g,\n"
6883 " char *const *words);\n"
6888 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:891
6890 "This command concatenates the list of C<words> passed with single spaces "
6891 "between them and returns the resulting string."
6895 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:894
6896 msgid "You can use this command to test the connection through to the daemon."
6900 #: ../src/guestfs-actions.pod:1341
6901 msgid "See also C<guestfs_ping_daemon>."
6905 #: ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:2073
6906 #: ../src/guestfs-actions.pod:5754
6907 msgid "(Added in 1.0.69)"
6911 #: ../src/guestfs-actions.pod:1348
6912 msgid "guestfs_egrep"
6916 #: ../src/guestfs-actions.pod:1350
6920 " guestfs_egrep (guestfs_h *g,\n"
6921 " const char *regex,\n"
6922 " const char *path);\n"
6927 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:902
6929 "This calls the external C<egrep> program and returns the matching lines."
6933 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1384
6934 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1487
6935 #: ../src/guestfs-actions.pod:1506 ../src/guestfs-actions.pod:2201
6936 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2376
6937 #: ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2404
6938 #: ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2472
6939 #: ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:3412
6940 #: ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:3439
6941 #: ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:4423
6942 #: ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5348
6943 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6130
6944 #: ../src/guestfs-actions.pod:6143 ../src/guestfs-actions.pod:6156
6945 #: ../src/guestfs-actions.pod:6178 ../src/guestfs-actions.pod:6191
6946 #: ../src/guestfs-actions.pod:6204 ../src/guestfs-actions.pod:6217
6947 #: ../src/guestfs-actions.pod:6988 ../src/guestfs-actions.pod:7007
6948 #: ../src/guestfs-actions.pod:7092 ../src/guestfs-actions.pod:7111
6949 #: ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7176
6950 msgid "(Added in 1.0.66)"
6954 #: ../src/guestfs-actions.pod:1367
6955 msgid "guestfs_egrepi"
6959 #: ../src/guestfs-actions.pod:1369
6963 " guestfs_egrepi (guestfs_h *g,\n"
6964 " const char *regex,\n"
6965 " const char *path);\n"
6970 #: ../src/guestfs-actions.pod:1374 ../fish/guestfish-actions.pod:912
6972 "This calls the external C<egrep -i> program and returns the matching lines."
6976 #: ../src/guestfs-actions.pod:1386
6977 msgid "guestfs_equal"
6981 #: ../src/guestfs-actions.pod:1388
6985 " guestfs_equal (guestfs_h *g,\n"
6986 " const char *file1,\n"
6987 " const char *file2);\n"
6992 #: ../src/guestfs-actions.pod:1393 ../fish/guestfish-actions.pod:922
6994 "This compares the two files C<file1> and C<file2> and returns true if their "
6995 "content is exactly equal, or false otherwise."
6999 #: ../src/guestfs-actions.pod:1396 ../fish/guestfish-actions.pod:925
7000 msgid "The external L<cmp(1)> program is used for the comparison."
7004 #: ../src/guestfs-actions.pod:1402
7005 msgid "guestfs_exists"
7009 #: ../src/guestfs-actions.pod:1404
7013 " guestfs_exists (guestfs_h *g,\n"
7014 " const char *path);\n"
7019 #: ../src/guestfs-actions.pod:1408 ../fish/guestfish-actions.pod:931
7021 "This returns C<true> if and only if there is a file, directory (or anything) "
7022 "with the given C<path> name."
7026 #: ../src/guestfs-actions.pod:1411
7027 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
7031 #: ../src/guestfs-actions.pod:1417
7032 msgid "guestfs_fallocate"
7036 #: ../src/guestfs-actions.pod:1419
7040 " guestfs_fallocate (guestfs_h *g,\n"
7041 " const char *path,\n"
7047 #: ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1450
7048 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
7050 "This command preallocates a file (containing zero bytes) named C<path> of "
7051 "size C<len> bytes. If the file exists already, it is overwritten."
7055 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:944
7057 "Do not confuse this with the guestfish-specific C<alloc> command which "
7058 "allocates a file in the host and attaches it as a device."
7062 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:948
7064 "This function is deprecated. In new code, use the C<fallocate64> call "
7069 #: ../src/guestfs-actions.pod:1443
7070 msgid "guestfs_fallocate64"
7074 #: ../src/guestfs-actions.pod:1445
7078 " guestfs_fallocate64 (guestfs_h *g,\n"
7079 " const char *path,\n"
7085 #: ../src/guestfs-actions.pod:1454
7087 "Note that this call allocates disk blocks for the file. To create a sparse "
7088 "file use C<guestfs_truncate_size> instead."
7092 #: ../src/guestfs-actions.pod:1457
7094 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
7095 "oversight it only allowed 30 bit lengths to be specified, effectively "
7096 "limiting the maximum size of files created through that call to 1GB."
7100 #: ../src/guestfs-actions.pod:1462 ../fish/guestfish-actions.pod:971
7102 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7103 "commands which create a file in the host and attach it as a device."
7107 #: ../src/guestfs-actions.pod:1468
7108 msgid "(Added in 1.3.17)"
7112 #: ../src/guestfs-actions.pod:1470
7113 msgid "guestfs_fgrep"
7117 #: ../src/guestfs-actions.pod:1472
7121 " guestfs_fgrep (guestfs_h *g,\n"
7122 " const char *pattern,\n"
7123 " const char *path);\n"
7128 #: ../src/guestfs-actions.pod:1477 ../fish/guestfish-actions.pod:979
7130 "This calls the external C<fgrep> program and returns the matching lines."
7134 #: ../src/guestfs-actions.pod:1489
7135 msgid "guestfs_fgrepi"
7139 #: ../src/guestfs-actions.pod:1491
7143 " guestfs_fgrepi (guestfs_h *g,\n"
7144 " const char *pattern,\n"
7145 " const char *path);\n"
7150 #: ../src/guestfs-actions.pod:1496 ../fish/guestfish-actions.pod:989
7152 "This calls the external C<fgrep -i> program and returns the matching lines."
7156 #: ../src/guestfs-actions.pod:1508
7157 msgid "guestfs_file"
7161 #: ../src/guestfs-actions.pod:1510
7165 " guestfs_file (guestfs_h *g,\n"
7166 " const char *path);\n"
7171 #: ../src/guestfs-actions.pod:1514 ../fish/guestfish-actions.pod:999
7173 "This call uses the standard L<file(1)> command to determine the type or "
7174 "contents of the file."
7178 #: ../src/guestfs-actions.pod:1517 ../fish/guestfish-actions.pod:1002
7180 "This call will also transparently look inside various types of compressed "
7185 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1005
7187 "The exact command which runs is C<file -zb path>. Note in particular that "
7188 "the filename is not prepended to the output (the C<-b> option)."
7192 #: ../src/guestfs-actions.pod:1524
7194 "This command can also be used on C</dev/> devices (and partitions, LV "
7195 "names). You can for example use this to determine if a device contains a "
7196 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7200 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1014
7202 "If the C<path> does not begin with C</dev/> then this command only works for "
7203 "the content of regular files. For other file types (directory, symbolic "
7204 "link etc) it will just return the string C<directory> etc."
7208 #: ../src/guestfs-actions.pod:1539
7209 msgid "guestfs_file_architecture"
7213 #: ../src/guestfs-actions.pod:1541
7217 " guestfs_file_architecture (guestfs_h *g,\n"
7218 " const char *filename);\n"
7223 #: ../src/guestfs-actions.pod:1545 ../fish/guestfish-actions.pod:1023
7225 "This detects the architecture of the binary C<filename>, and returns it if "
7230 #: ../src/guestfs-actions.pod:1548 ../fish/guestfish-actions.pod:1026
7231 msgid "Currently defined architectures are:"
7235 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
7240 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1032
7242 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7243 "irrespective of the precise processor requirements of the binary."
7247 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
7252 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
7253 msgid "64 bit x86-64."
7257 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
7262 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
7263 msgid "32 bit SPARC."
7267 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
7272 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
7273 msgid "64 bit SPARC V9 and above."
7277 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
7282 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
7283 msgid "Intel Itanium."
7287 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
7292 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
7293 msgid "32 bit Power PC."
7297 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
7302 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1057
7303 msgid "64 bit Power PC."
7307 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
7308 msgid "Libguestfs may return other architecture strings in future."
7312 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1063
7313 msgid "The function works on at least the following types of files:"
7317 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1069
7318 msgid "many types of Un*x and Linux binary"
7322 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish-actions.pod:1073
7323 msgid "many types of Un*x and Linux shared library"
7327 #: ../src/guestfs-actions.pod:1599 ../fish/guestfish-actions.pod:1077
7328 msgid "Windows Win32 and Win64 binaries"
7332 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
7333 msgid "Windows Win32 and Win64 DLLs"
7337 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
7338 msgid "Win32 binaries and DLLs return C<i386>."
7342 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1085
7343 msgid "Win64 binaries and DLLs return C<x86_64>."
7347 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1089
7348 msgid "Linux kernel modules"
7352 #: ../src/guestfs-actions.pod:1615 ../fish/guestfish-actions.pod:1093
7353 msgid "Linux new-style initrd images"
7357 #: ../src/guestfs-actions.pod:1619 ../fish/guestfish-actions.pod:1097
7358 msgid "some non-x86 Linux vmlinuz kernels"
7362 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1101
7363 msgid "What it can't do currently:"
7367 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1107
7368 msgid "static libraries (libfoo.a)"
7372 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1111
7373 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7377 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
7378 msgid "x86 Linux vmlinuz kernels"
7382 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1117
7384 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7385 "compressed code, and are horribly hard to unpack. If you want to find the "
7386 "architecture of a kernel, use the architecture of the associated initrd or "
7387 "kernel module(s) instead."
7391 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1812
7392 #: ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:2508
7393 #: ../src/guestfs-actions.pod:2589 ../src/guestfs-actions.pod:2615
7394 #: ../src/guestfs-actions.pod:2664 ../src/guestfs-actions.pod:2685
7395 #: ../src/guestfs-actions.pod:2718 ../src/guestfs-actions.pod:2802
7396 #: ../src/guestfs-actions.pod:2864 ../src/guestfs-actions.pod:3037
7397 #: ../src/guestfs-actions.pod:3169
7398 msgid "(Added in 1.5.3)"
7402 #: ../src/guestfs-actions.pod:1651
7403 msgid "guestfs_filesize"
7407 #: ../src/guestfs-actions.pod:1653
7411 " guestfs_filesize (guestfs_h *g,\n"
7412 " const char *file);\n"
7417 #: ../src/guestfs-actions.pod:1657 ../fish/guestfish-actions.pod:1128
7418 msgid "This command returns the size of C<file> in bytes."
7422 #: ../src/guestfs-actions.pod:1659
7424 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7425 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7426 "devices, use C<guestfs_blockdev_getsize64>."
7430 #: ../src/guestfs-actions.pod:1665
7431 msgid "(Added in 1.0.82)"
7435 #: ../src/guestfs-actions.pod:1667
7436 msgid "guestfs_fill"
7440 #: ../src/guestfs-actions.pod:1669
7444 " guestfs_fill (guestfs_h *g,\n"
7447 " const char *path);\n"
7452 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1138
7454 "This command creates a new file called C<path>. The initial content of the "
7455 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7460 #: ../src/guestfs-actions.pod:1679
7462 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7463 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7464 "bytes use C<guestfs_fill_pattern>."
7468 #: ../src/guestfs-actions.pod:1691
7469 msgid "(Added in 1.0.79)"
7473 #: ../src/guestfs-actions.pod:1693
7474 msgid "guestfs_fill_pattern"
7478 #: ../src/guestfs-actions.pod:1695
7482 " guestfs_fill_pattern (guestfs_h *g,\n"
7483 " const char *pattern,\n"
7485 " const char *path);\n"
7490 #: ../src/guestfs-actions.pod:1701
7492 "This function is like C<guestfs_fill> except that it creates a new file of "
7493 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7494 "pattern is truncated if necessary to ensure the length of the file is "
7495 "exactly C<len> bytes."
7499 #: ../src/guestfs-actions.pod:1713
7500 msgid "(Added in 1.3.12)"
7504 #: ../src/guestfs-actions.pod:1715
7505 msgid "guestfs_find"
7509 #: ../src/guestfs-actions.pod:1717
7513 " guestfs_find (guestfs_h *g,\n"
7514 " const char *directory);\n"
7519 #: ../src/guestfs-actions.pod:1721 ../fish/guestfish-actions.pod:1160
7521 "This command lists out all files and directories, recursively, starting at "
7522 "C<directory>. It is essentially equivalent to running the shell command "
7523 "C<find directory -print> but some post-processing happens on the output, "
7528 #: ../src/guestfs-actions.pod:1726 ../fish/guestfish-actions.pod:1165
7530 "This returns a list of strings I<without any prefix>. Thus if the directory "
7535 #: ../src/guestfs-actions.pod:1729 ../fish/guestfish-actions.pod:1168
7545 #: ../src/guestfs-actions.pod:1733
7547 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7551 #: ../src/guestfs-actions.pod:1736 ../fish/guestfish-actions.pod:1175
7562 #: ../src/guestfs-actions.pod:1741 ../fish/guestfish-actions.pod:1180
7563 msgid "If C<directory> is not a directory, then this command returns an error."
7567 #: ../src/guestfs-actions.pod:1744 ../fish/guestfish-actions.pod:1183
7568 msgid "The returned list is sorted."
7572 #: ../src/guestfs-actions.pod:1746
7573 msgid "See also C<guestfs_find0>."
7577 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:3856
7578 #: ../src/guestfs-actions.pod:5383
7579 msgid "(Added in 1.0.27)"
7583 #: ../src/guestfs-actions.pod:1757
7584 msgid "guestfs_find0"
7588 #: ../src/guestfs-actions.pod:1759
7592 " guestfs_find0 (guestfs_h *g,\n"
7593 " const char *directory,\n"
7594 " const char *files);\n"
7599 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1194
7601 "This command lists out all files and directories, recursively, starting at "
7602 "C<directory>, placing the resulting list in the external file called "
7607 #: ../src/guestfs-actions.pod:1768
7609 "This command works the same way as C<guestfs_find> with the following "
7614 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1205
7615 msgid "The resulting list is written to an external file."
7619 #: ../src/guestfs-actions.pod:1779 ../fish/guestfish-actions.pod:1209
7621 "Items (filenames) in the result are separated by C<\\0> characters. See "
7622 "L<find(1)> option I<-print0>."
7626 #: ../src/guestfs-actions.pod:1784 ../fish/guestfish-actions.pod:1214
7627 msgid "This command is not limited in the number of names that it can return."
7631 #: ../src/guestfs-actions.pod:1789 ../fish/guestfish-actions.pod:1219
7632 msgid "The result list is not sorted."
7636 #: ../src/guestfs-actions.pod:1795
7637 msgid "(Added in 1.0.74)"
7641 #: ../src/guestfs-actions.pod:1797
7642 msgid "guestfs_findfs_label"
7646 #: ../src/guestfs-actions.pod:1799
7650 " guestfs_findfs_label (guestfs_h *g,\n"
7651 " const char *label);\n"
7656 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1229
7658 "This command searches the filesystems and returns the one which has the "
7659 "given label. An error is returned if no such filesystem can be found."
7663 #: ../src/guestfs-actions.pod:1807
7664 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7668 #: ../src/guestfs-actions.pod:1814
7669 msgid "guestfs_findfs_uuid"
7673 #: ../src/guestfs-actions.pod:1816
7677 " guestfs_findfs_uuid (guestfs_h *g,\n"
7678 " const char *uuid);\n"
7683 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
7685 "This command searches the filesystems and returns the one which has the "
7686 "given UUID. An error is returned if no such filesystem can be found."
7690 #: ../src/guestfs-actions.pod:1824
7691 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7695 #: ../src/guestfs-actions.pod:1831
7696 msgid "guestfs_fsck"
7700 #: ../src/guestfs-actions.pod:1833
7704 " guestfs_fsck (guestfs_h *g,\n"
7705 " const char *fstype,\n"
7706 " const char *device);\n"
7711 #: ../src/guestfs-actions.pod:1838 ../fish/guestfish-actions.pod:1249
7713 "This runs the filesystem checker (fsck) on C<device> which should have "
7714 "filesystem type C<fstype>."
7718 #: ../src/guestfs-actions.pod:1841 ../fish/guestfish-actions.pod:1252
7720 "The returned integer is the status. See L<fsck(8)> for the list of status "
7721 "codes from C<fsck>."
7725 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:1261
7726 msgid "Multiple status codes can be summed together."
7730 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1265
7732 "A non-zero return code can mean \"success\", for example if errors have been "
7733 "corrected on the filesystem."
7737 #: ../src/guestfs-actions.pod:1859 ../fish/guestfish-actions.pod:1270
7738 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7742 #: ../src/guestfs-actions.pod:1864 ../fish/guestfish-actions.pod:1275
7744 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7748 #: ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:7030
7749 msgid "(Added in 1.0.16)"
7753 #: ../src/guestfs-actions.pod:1870
7754 msgid "guestfs_get_append"
7758 #: ../src/guestfs-actions.pod:1872
7762 " guestfs_get_append (guestfs_h *g);\n"
7767 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1281
7769 "Return the additional kernel options which are added to the guest kernel "
7774 #: ../src/guestfs-actions.pod:1878 ../fish/guestfish-actions.pod:1284
7775 msgid "If C<NULL> then no options are added."
7779 #: ../src/guestfs-actions.pod:1880
7781 "This function returns a string which may be NULL. There is no way to return "
7782 "an error from this function. The string is owned by the guest handle and "
7783 "must I<not> be freed."
7787 #: ../src/guestfs-actions.pod:1884 ../src/guestfs-actions.pod:5061
7788 #: ../src/guestfs-actions.pod:5524 ../src/guestfs-actions.pod:5892
7789 #: ../src/guestfs-actions.pod:5911 ../src/guestfs-actions.pod:5927
7790 #: ../src/guestfs-actions.pod:5944 ../src/guestfs-actions.pod:6701
7791 #: ../src/guestfs-actions.pod:6719 ../src/guestfs-actions.pod:7073
7792 msgid "(Added in 1.0.26)"
7796 #: ../src/guestfs-actions.pod:1886
7797 msgid "guestfs_get_autosync"
7801 #: ../src/guestfs-actions.pod:1888
7805 " guestfs_get_autosync (guestfs_h *g);\n"
7810 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1290
7811 msgid "Get the autosync flag."
7815 #: ../src/guestfs-actions.pod:1897
7816 msgid "guestfs_get_direct"
7820 #: ../src/guestfs-actions.pod:1899
7824 " guestfs_get_direct (guestfs_h *g);\n"
7829 #: ../src/guestfs-actions.pod:1902 ../fish/guestfish-actions.pod:1296
7830 msgid "Return the direct appliance mode flag."
7834 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:5565
7835 msgid "(Added in 1.0.72)"
7839 #: ../src/guestfs-actions.pod:1908
7840 msgid "guestfs_get_e2label"
7844 #: ../src/guestfs-actions.pod:1910
7848 " guestfs_get_e2label (guestfs_h *g,\n"
7849 " const char *device);\n"
7854 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1302
7856 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7860 #: ../src/guestfs-actions.pod:1920 ../fish/guestfish-actions.pod:1305
7862 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7866 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1948
7867 #: ../src/guestfs-actions.pod:5583 ../src/guestfs-actions.pod:5602
7868 msgid "(Added in 1.0.15)"
7872 #: ../src/guestfs-actions.pod:1929
7873 msgid "guestfs_get_e2uuid"
7877 #: ../src/guestfs-actions.pod:1931
7881 " guestfs_get_e2uuid (guestfs_h *g,\n"
7882 " const char *device);\n"
7887 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1316
7889 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7893 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1319
7895 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7899 #: ../src/guestfs-actions.pod:1950
7900 msgid "guestfs_get_memsize"
7904 #: ../src/guestfs-actions.pod:1952
7908 " guestfs_get_memsize (guestfs_h *g);\n"
7913 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1330
7915 "This gets the memory size in megabytes allocated to the qemu subprocess."
7919 #: ../src/guestfs-actions.pod:1958
7921 "If C<guestfs_set_memsize> was not called on this handle, and if "
7922 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7923 "value for memsize."
7927 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:2043
7928 #: ../src/guestfs-actions.pod:5618 ../src/guestfs-actions.pod:5725
7929 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7930 #: ../fish/guestfish-actions.pod:3751 ../fish/guestfish-actions.pod:3838
7932 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7936 #: ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:4147
7937 #: ../src/guestfs-actions.pod:4328 ../src/guestfs-actions.pod:4347
7938 #: ../src/guestfs-actions.pod:4366 ../src/guestfs-actions.pod:4378
7939 #: ../src/guestfs-actions.pod:4395 ../src/guestfs-actions.pod:4408
7940 #: ../src/guestfs-actions.pod:5286 ../src/guestfs-actions.pod:5623
7941 #: ../src/guestfs-actions.pod:5866 ../src/guestfs-actions.pod:6467
7942 msgid "(Added in 1.0.55)"
7946 #: ../src/guestfs-actions.pod:1969
7947 msgid "guestfs_get_network"
7951 #: ../src/guestfs-actions.pod:1971
7955 " guestfs_get_network (guestfs_h *g);\n"
7960 #: ../src/guestfs-actions.pod:1974 ../fish/guestfish-actions.pod:1344
7961 msgid "This returns the enable network flag."
7965 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:5642
7966 msgid "(Added in 1.5.4)"
7970 #: ../src/guestfs-actions.pod:1980
7971 msgid "guestfs_get_path"
7975 #: ../src/guestfs-actions.pod:1982
7979 " guestfs_get_path (guestfs_h *g);\n"
7984 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
7985 msgid "Return the current search path."
7989 #: ../src/guestfs-actions.pod:1987 ../fish/guestfish-actions.pod:1352
7991 "This is always non-NULL. If it wasn't set already, then this will return "
7996 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:2019
7998 "This function returns a string, or NULL on error. The string is owned by "
7999 "the guest handle and must I<not> be freed."
8003 #: ../src/guestfs-actions.pod:1995
8004 msgid "guestfs_get_pid"
8008 #: ../src/guestfs-actions.pod:1997
8012 " guestfs_get_pid (guestfs_h *g);\n"
8017 #: ../src/guestfs-actions.pod:2000 ../fish/guestfish-actions.pod:1361
8019 "Return the process ID of the qemu subprocess. If there is no qemu "
8020 "subprocess, then this will return an error."
8024 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1364
8025 msgid "This is an internal call used for debugging and testing."
8029 #: ../src/guestfs-actions.pod:2007
8030 msgid "(Added in 1.0.56)"
8034 #: ../src/guestfs-actions.pod:2009
8035 msgid "guestfs_get_qemu"
8039 #: ../src/guestfs-actions.pod:2011
8043 " guestfs_get_qemu (guestfs_h *g);\n"
8048 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
8049 msgid "Return the current qemu binary."
8053 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
8055 "This is always non-NULL. If it wasn't set already, then this will return "
8056 "the default qemu binary name."
8060 #: ../src/guestfs-actions.pod:2022 ../src/guestfs-actions.pod:5687
8061 msgid "(Added in 1.0.6)"
8065 #: ../src/guestfs-actions.pod:2024
8066 msgid "guestfs_get_recovery_proc"
8070 #: ../src/guestfs-actions.pod:2026
8074 " guestfs_get_recovery_proc (guestfs_h *g);\n"
8079 #: ../src/guestfs-actions.pod:2029 ../fish/guestfish-actions.pod:1379
8080 msgid "Return the recovery process enabled flag."
8084 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:3259
8085 #: ../src/guestfs-actions.pod:3554 ../src/guestfs-actions.pod:3954
8086 #: ../src/guestfs-actions.pod:3986 ../src/guestfs-actions.pod:4991
8087 #: ../src/guestfs-actions.pod:5334 ../src/guestfs-actions.pod:5711
8088 #: ../src/guestfs-actions.pod:6370 ../src/guestfs-actions.pod:6390
8089 #: ../src/guestfs-actions.pod:6582
8090 msgid "(Added in 1.0.77)"
8094 #: ../src/guestfs-actions.pod:2035
8095 msgid "guestfs_get_selinux"
8099 #: ../src/guestfs-actions.pod:2037
8103 " guestfs_get_selinux (guestfs_h *g);\n"
8108 #: ../src/guestfs-actions.pod:2040
8110 "This returns the current setting of the selinux flag which is passed to the "
8111 "appliance at boot time. See C<guestfs_set_selinux>."
8115 #: ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2111
8116 #: ../src/guestfs-actions.pod:5730 ../src/guestfs-actions.pod:5784
8117 msgid "(Added in 1.0.67)"
8121 #: ../src/guestfs-actions.pod:2050
8122 msgid "guestfs_get_state"
8126 #: ../src/guestfs-actions.pod:2052
8130 " guestfs_get_state (guestfs_h *g);\n"
8135 #: ../src/guestfs-actions.pod:2055 ../fish/guestfish-actions.pod:1395
8137 "This returns the current state as an opaque integer. This is only useful "
8138 "for printing debug and internal error messages."
8142 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:3062
8143 #: ../src/guestfs-actions.pod:3091 ../src/guestfs-actions.pod:3152
8144 #: ../src/guestfs-actions.pod:3179 ../fish/guestfish-actions.pod:1398
8145 #: ../fish/guestfish-actions.pod:2133 ../fish/guestfish-actions.pod:2151
8146 #: ../fish/guestfish-actions.pod:2189 ../fish/guestfish-actions.pod:2205
8147 msgid "For more information on states, see L<guestfs(3)>."
8151 #: ../src/guestfs-actions.pod:2064
8152 msgid "guestfs_get_trace"
8156 #: ../src/guestfs-actions.pod:2066
8160 " guestfs_get_trace (guestfs_h *g);\n"
8165 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1404
8166 msgid "Return the command trace flag."
8170 #: ../src/guestfs-actions.pod:2075
8171 msgid "guestfs_get_umask"
8175 #: ../src/guestfs-actions.pod:2077
8179 " guestfs_get_umask (guestfs_h *g);\n"
8184 #: ../src/guestfs-actions.pod:2080
8186 "Return the current umask. By default the umask is C<022> unless it has been "
8187 "set by calling C<guestfs_umask>."
8191 #: ../src/guestfs-actions.pod:2087
8192 msgid "guestfs_get_verbose"
8196 #: ../src/guestfs-actions.pod:2089
8200 " guestfs_get_verbose (guestfs_h *g);\n"
8205 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
8206 msgid "This returns the verbose messages flag."
8210 #: ../src/guestfs-actions.pod:2098
8211 msgid "guestfs_getcon"
8215 #: ../src/guestfs-actions.pod:2100
8219 " guestfs_getcon (guestfs_h *g);\n"
8224 #: ../src/guestfs-actions.pod:2103 ../fish/guestfish-actions.pod:1423
8225 msgid "This gets the SELinux security context of the daemon."
8229 #: ../src/guestfs-actions.pod:2105
8231 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8235 #: ../src/guestfs-actions.pod:2113
8236 msgid "guestfs_getxattr"
8240 #: ../src/guestfs-actions.pod:2115
8244 " guestfs_getxattr (guestfs_h *g,\n"
8245 " const char *path,\n"
8246 " const char *name,\n"
8247 " size_t *size_r);\n"
8252 #: ../src/guestfs-actions.pod:2121
8254 "Get a single extended attribute from file C<path> named C<name>. This call "
8255 "follows symlinks. If you want to lookup an extended attribute for the "
8256 "symlink itself, use C<guestfs_lgetxattr>."
8260 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3273
8262 "Normally it is better to get all extended attributes from a file in one go "
8263 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
8264 "implementations are buggy and do not provide a way to list out attributes. "
8265 "For these filesystems (notably ntfs-3g) you have to know the names of the "
8266 "extended attributes you want in advance and call this function."
8270 #: ../src/guestfs-actions.pod:2132 ../src/guestfs-actions.pod:3280
8271 #: ../fish/guestfish-actions.pod:1443 ../fish/guestfish-actions.pod:2270
8273 "Extended attribute values are blobs of binary data. If there is no extended "
8274 "attribute named C<name>, this returns an error."
8278 #: ../src/guestfs-actions.pod:2135
8279 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
8283 #: ../src/guestfs-actions.pod:2137 ../src/guestfs-actions.pod:2326
8284 #: ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:4984
8285 #: ../src/guestfs-actions.pod:5010 ../src/guestfs-actions.pod:5191
8287 "This function returns a buffer, or NULL on error. The size of the returned "
8288 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8293 #: ../src/guestfs-actions.pod:2141
8294 msgid "guestfs_getxattrs"
8298 #: ../src/guestfs-actions.pod:2143
8301 " struct guestfs_xattr_list *\n"
8302 " guestfs_getxattrs (guestfs_h *g,\n"
8303 " const char *path);\n"
8308 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1452
8310 "This call lists the extended attributes of the file or directory C<path>."
8314 #: ../src/guestfs-actions.pod:2150 ../fish/guestfish-actions.pod:1455
8316 "At the system call level, this is a combination of the L<listxattr(2)> and "
8317 "L<getxattr(2)> calls."
8321 #: ../src/guestfs-actions.pod:2153
8322 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8326 #: ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:3299
8327 #: ../src/guestfs-actions.pod:3950
8329 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8330 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8334 #: ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3303
8335 #: ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:3504
8336 #: ../src/guestfs-actions.pod:5364 ../src/guestfs-actions.pod:5803
8337 #: ../src/guestfs-actions.pod:7138
8338 msgid "(Added in 1.0.59)"
8342 #: ../src/guestfs-actions.pod:2161
8343 msgid "guestfs_glob_expand"
8347 #: ../src/guestfs-actions.pod:2163
8351 " guestfs_glob_expand (guestfs_h *g,\n"
8352 " const char *pattern);\n"
8357 #: ../src/guestfs-actions.pod:2167 ../fish/guestfish-actions.pod:1464
8359 "This command searches for all the pathnames matching C<pattern> according to "
8360 "the wildcard expansion rules used by the shell."
8364 #: ../src/guestfs-actions.pod:2171 ../fish/guestfish-actions.pod:1468
8366 "If no paths match, then this returns an empty list (note: not an error)."
8370 #: ../src/guestfs-actions.pod:2174 ../fish/guestfish-actions.pod:1471
8372 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8373 "GLOB_BRACE>. See that manual page for more details."
8377 #: ../src/guestfs-actions.pod:2182 ../src/guestfs-actions.pod:5968
8378 #: ../src/guestfs-actions.pod:5985
8379 msgid "(Added in 1.0.50)"
8383 #: ../src/guestfs-actions.pod:2184
8384 msgid "guestfs_grep"
8388 #: ../src/guestfs-actions.pod:2186
8392 " guestfs_grep (guestfs_h *g,\n"
8393 " const char *regex,\n"
8394 " const char *path);\n"
8399 #: ../src/guestfs-actions.pod:2191 ../fish/guestfish-actions.pod:1479
8400 msgid "This calls the external C<grep> program and returns the matching lines."
8404 #: ../src/guestfs-actions.pod:2203
8405 msgid "guestfs_grepi"
8409 #: ../src/guestfs-actions.pod:2205
8413 " guestfs_grepi (guestfs_h *g,\n"
8414 " const char *regex,\n"
8415 " const char *path);\n"
8420 #: ../src/guestfs-actions.pod:2210 ../fish/guestfish-actions.pod:1489
8422 "This calls the external C<grep -i> program and returns the matching lines."
8426 #: ../src/guestfs-actions.pod:2222
8427 msgid "guestfs_grub_install"
8431 #: ../src/guestfs-actions.pod:2224
8435 " guestfs_grub_install (guestfs_h *g,\n"
8436 " const char *root,\n"
8437 " const char *device);\n"
8442 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1499
8444 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8445 "the root directory being C<root>."
8449 #: ../src/guestfs-actions.pod:2232 ../fish/guestfish-actions.pod:1502
8451 "Note: If grub-install reports the error \"No suitable drive was found in the "
8452 "generated device map.\" it may be that you need to create a C</boot/grub/"
8453 "device.map> file first that contains the mapping between grub device names "
8454 "and Linux device names. It is usually sufficient to create a file "
8459 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1509
8467 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1511
8468 msgid "replacing C</dev/vda> with the name of the installation device."
8472 #: ../src/guestfs-actions.pod:2245
8473 msgid "(Added in 1.0.17)"
8477 #: ../src/guestfs-actions.pod:2247
8478 msgid "guestfs_head"
8482 #: ../src/guestfs-actions.pod:2249
8486 " guestfs_head (guestfs_h *g,\n"
8487 " const char *path);\n"
8492 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1517
8494 "This command returns up to the first 10 lines of a file as a list of strings."
8498 #: ../src/guestfs-actions.pod:2265
8499 msgid "guestfs_head_n"
8503 #: ../src/guestfs-actions.pod:2267
8507 " guestfs_head_n (guestfs_h *g,\n"
8509 " const char *path);\n"
8514 #: ../src/guestfs-actions.pod:2272 ../fish/guestfish-actions.pod:1527
8516 "If the parameter C<nrlines> is a positive number, this returns the first "
8517 "C<nrlines> lines of the file C<path>."
8521 #: ../src/guestfs-actions.pod:2275 ../fish/guestfish-actions.pod:1530
8523 "If the parameter C<nrlines> is a negative number, this returns lines from "
8524 "the file C<path>, excluding the last C<nrlines> lines."
8528 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:6265
8529 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:4184
8530 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8534 #: ../src/guestfs-actions.pod:2289
8535 msgid "guestfs_hexdump"
8539 #: ../src/guestfs-actions.pod:2291
8543 " guestfs_hexdump (guestfs_h *g,\n"
8544 " const char *path);\n"
8549 #: ../src/guestfs-actions.pod:2295 ../fish/guestfish-actions.pod:1542
8551 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8552 "readable, canonical hex dump of the file."
8556 #: ../src/guestfs-actions.pod:2304 ../src/guestfs-actions.pod:6049
8557 #: ../src/guestfs-actions.pod:6104
8558 msgid "(Added in 1.0.22)"
8562 #: ../src/guestfs-actions.pod:2306
8563 msgid "guestfs_initrd_cat"
8567 #: ../src/guestfs-actions.pod:2308
8571 " guestfs_initrd_cat (guestfs_h *g,\n"
8572 " const char *initrdpath,\n"
8573 " const char *filename,\n"
8574 " size_t *size_r);\n"
8579 #: ../src/guestfs-actions.pod:2314 ../fish/guestfish-actions.pod:1552
8581 "This command unpacks the file C<filename> from the initrd file called "
8582 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8587 #: ../src/guestfs-actions.pod:2318 ../fish/guestfish-actions.pod:1556
8589 "For example, in guestfish you could use the following command to examine the "
8590 "boot script (usually called C</init>) contained in a Linux initrd or "
8595 #: ../src/guestfs-actions.pod:2322 ../fish/guestfish-actions.pod:1560
8598 " initrd-cat /boot/initrd-<version>.img init\n"
8603 #: ../src/guestfs-actions.pod:2324
8604 msgid "See also C<guestfs_initrd_list>."
8608 #: ../src/guestfs-actions.pod:2335
8609 msgid "guestfs_initrd_list"
8613 #: ../src/guestfs-actions.pod:2337
8617 " guestfs_initrd_list (guestfs_h *g,\n"
8618 " const char *path);\n"
8623 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1571
8624 msgid "This command lists out files contained in an initrd."
8628 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1573
8630 "The files are listed without any initial C</> character. The files are "
8631 "listed in the order they appear (not necessarily alphabetical). Directory "
8632 "names are listed as separate items."
8636 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1577
8638 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8639 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8644 #: ../src/guestfs-actions.pod:2357
8645 msgid "guestfs_inotify_add_watch"
8649 #: ../src/guestfs-actions.pod:2359
8653 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8654 " const char *path,\n"
8660 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1585
8661 msgid "Watch C<path> for the events listed in C<mask>."
8665 #: ../src/guestfs-actions.pod:2366 ../fish/guestfish-actions.pod:1587
8667 "Note that if C<path> is a directory then events within that directory are "
8668 "watched, but this does I<not> happen recursively (in subdirectories)."
8672 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1591
8674 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8675 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8679 #: ../src/guestfs-actions.pod:2378
8680 msgid "guestfs_inotify_close"
8684 #: ../src/guestfs-actions.pod:2380
8688 " guestfs_inotify_close (guestfs_h *g);\n"
8693 #: ../src/guestfs-actions.pod:2383 ../fish/guestfish-actions.pod:1599
8695 "This closes the inotify handle which was previously opened by inotify_init. "
8696 "It removes all watches, throws away any pending events, and deallocates all "
8701 #: ../src/guestfs-actions.pod:2391
8702 msgid "guestfs_inotify_files"
8706 #: ../src/guestfs-actions.pod:2393
8710 " guestfs_inotify_files (guestfs_h *g);\n"
8715 #: ../src/guestfs-actions.pod:2396
8717 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8718 "returns a list of pathnames of objects that were touched. The returned "
8719 "pathnames are sorted and deduplicated."
8723 #: ../src/guestfs-actions.pod:2406
8724 msgid "guestfs_inotify_init"
8728 #: ../src/guestfs-actions.pod:2408
8732 " guestfs_inotify_init (guestfs_h *g,\n"
8733 " int maxevents);\n"
8738 #: ../src/guestfs-actions.pod:2412 ../fish/guestfish-actions.pod:1615
8740 "This command creates a new inotify handle. The inotify subsystem can be "
8741 "used to notify events which happen to objects in the guest filesystem."
8745 #: ../src/guestfs-actions.pod:2416
8747 "C<maxevents> is the maximum number of events which will be queued up between "
8748 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8749 "passed as C<0>, then the kernel (or previously set) default is used. For "
8750 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8751 "throws away events, but records the fact that it threw them away by setting "
8752 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8753 "C<guestfs_inotify_read>)."
8757 #: ../src/guestfs-actions.pod:2426
8759 "Before any events are generated, you have to add some watches to the "
8760 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8761 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8765 #: ../src/guestfs-actions.pod:2432
8767 "Queued up events should be read periodically by calling "
8768 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8769 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8770 "often enough then you risk the internal queue overflowing."
8774 #: ../src/guestfs-actions.pod:2439
8776 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8777 "This also removes any watches automatically."
8781 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1646
8783 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8784 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8785 "that there is one global inotify handle per libguestfs instance."
8789 #: ../src/guestfs-actions.pod:2452
8790 msgid "guestfs_inotify_read"
8794 #: ../src/guestfs-actions.pod:2454
8797 " struct guestfs_inotify_event_list *\n"
8798 " guestfs_inotify_read (guestfs_h *g);\n"
8803 #: ../src/guestfs-actions.pod:2457 ../fish/guestfish-actions.pod:1655
8805 "Return the complete queue of events that have happened since the previous "
8810 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1658
8811 msgid "If no events have happened, this returns an empty list."
8815 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1660
8817 "I<Note>: In order to make sure that all events have been read, you must call "
8818 "this function repeatedly until it returns an empty list. The reason is that "
8819 "the call will read events up to the maximum appliance-to-host message size "
8820 "and leave remaining events in the queue."
8824 #: ../src/guestfs-actions.pod:2468
8826 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8827 "there was an error. I<The caller must call "
8828 "C<guestfs_free_inotify_event_list> after use>."
8832 #: ../src/guestfs-actions.pod:2474
8833 msgid "guestfs_inotify_rm_watch"
8837 #: ../src/guestfs-actions.pod:2476
8841 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8847 #: ../src/guestfs-actions.pod:2480
8849 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8853 #: ../src/guestfs-actions.pod:2487
8854 msgid "guestfs_inspect_get_arch"
8858 #: ../src/guestfs-actions.pod:2489
8862 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8863 " const char *root);\n"
8868 #: ../src/guestfs-actions.pod:2493 ../src/guestfs-actions.pod:2516
8869 #: ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2623
8870 #: ../src/guestfs-actions.pod:2645 ../src/guestfs-actions.pod:2672
8871 #: ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2726
8872 #: ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:2786
8873 #: ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2872
8874 #: ../src/guestfs-actions.pod:2895
8876 "This function should only be called with a root device string as returned by "
8877 "C<guestfs_inspect_os>."
8881 #: ../src/guestfs-actions.pod:2496
8883 "This returns the architecture of the inspected operating system. The "
8884 "possible return values are listed under C<guestfs_file_architecture>."
8888 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1684
8890 "If the architecture could not be determined, then the string C<unknown> is "
8895 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2584
8896 #: ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2660
8897 #: ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2773
8898 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:2816
8899 #: ../src/guestfs-actions.pod:2859 ../src/guestfs-actions.pod:2882
8900 #: ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3029
8901 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1761
8902 #: ../fish/guestfish-actions.pod:1794 ../fish/guestfish-actions.pod:1815
8903 #: ../fish/guestfish-actions.pod:1875 ../fish/guestfish-actions.pod:1899
8904 #: ../fish/guestfish-actions.pod:1916 ../fish/guestfish-actions.pod:1929
8905 #: ../fish/guestfish-actions.pod:1964 ../fish/guestfish-actions.pod:1980
8906 #: ../fish/guestfish-actions.pod:2079 ../fish/guestfish-actions.pod:2113
8907 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8911 #: ../src/guestfs-actions.pod:2510
8912 msgid "guestfs_inspect_get_distro"
8916 #: ../src/guestfs-actions.pod:2512
8920 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8921 " const char *root);\n"
8926 #: ../src/guestfs-actions.pod:2519 ../fish/guestfish-actions.pod:1696
8928 "This returns the distro (distribution) of the inspected operating system."
8932 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1699
8933 msgid "Currently defined distros are:"
8937 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1703
8938 msgid "\"archlinux\""
8942 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1705
8947 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1707
8952 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1709
8957 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1711
8962 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1713
8967 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1715
8972 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1717
8977 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1719
8978 msgid "\"linuxmint\""
8982 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1721
8987 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1723
8988 msgid "\"mandriva\""
8992 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1725
8997 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1727
9002 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1729
9007 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1731
9012 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1733
9017 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1735
9018 msgid "\"redhat-based\""
9022 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1737
9023 msgid "Some Red Hat-derived distro."
9027 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1739
9032 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1741
9033 msgid "Red Hat Enterprise Linux and some derivatives."
9037 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1743
9042 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1745
9047 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2850
9048 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1955
9053 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1749
9054 msgid "The distro could not be determined."
9058 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:2842
9059 #: ../fish/guestfish-actions.pod:1751 ../fish/guestfish-actions.pod:1947
9064 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1753
9066 "Windows does not have distributions. This string is returned if the OS type "
9071 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2856
9072 #: ../fish/guestfish-actions.pod:1758 ../fish/guestfish-actions.pod:1961
9074 "Future versions of libguestfs may return other strings here. The caller "
9075 "should be prepared to handle any string."
9079 #: ../src/guestfs-actions.pod:2591
9080 msgid "guestfs_inspect_get_filesystems"
9084 #: ../src/guestfs-actions.pod:2593
9088 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
9089 " const char *root);\n"
9094 #: ../src/guestfs-actions.pod:2600 ../fish/guestfish-actions.pod:1770
9096 "This returns a list of all the filesystems that we think are associated with "
9097 "this operating system. This includes the root filesystem, other ordinary "
9098 "filesystems, and non-mounted devices like swap partitions."
9102 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1775
9104 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9105 "to be shared between operating systems."
9109 #: ../src/guestfs-actions.pod:2608
9111 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9112 "C<guestfs_inspect_get_mountpoints>."
9116 #: ../src/guestfs-actions.pod:2617
9117 msgid "guestfs_inspect_get_hostname"
9121 #: ../src/guestfs-actions.pod:2619
9125 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
9126 " const char *root);\n"
9131 #: ../src/guestfs-actions.pod:2626 ../fish/guestfish-actions.pod:1788
9133 "This function returns the hostname of the operating system as found by "
9134 "inspection of the guest's configuration files."
9138 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:1791
9140 "If the hostname could not be determined, then the string C<unknown> is "
9145 #: ../src/guestfs-actions.pod:2637
9146 msgid "(Added in 1.7.9)"
9150 #: ../src/guestfs-actions.pod:2639
9151 msgid "guestfs_inspect_get_major_version"
9155 #: ../src/guestfs-actions.pod:2641
9159 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
9160 " const char *root);\n"
9165 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:1803
9167 "This returns the major version number of the inspected operating system."
9171 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1806
9173 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9174 "popular public names used by the operating system. Notably the operating "
9175 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9176 "1). You can find out the real versions corresponding to releases of Windows "
9177 "by consulting Wikipedia or MSDN."
9181 #: ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2678
9182 #: ../fish/guestfish-actions.pod:1813 ../fish/guestfish-actions.pod:1827
9183 msgid "If the version could not be determined, then C<0> is returned."
9187 #: ../src/guestfs-actions.pod:2666
9188 msgid "guestfs_inspect_get_minor_version"
9192 #: ../src/guestfs-actions.pod:2668
9196 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9197 " const char *root);\n"
9202 #: ../src/guestfs-actions.pod:2675 ../fish/guestfish-actions.pod:1824
9204 "This returns the minor version number of the inspected operating system."
9208 #: ../src/guestfs-actions.pod:2680
9210 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9211 "C<guestfs_inspect_get_major_version>."
9215 #: ../src/guestfs-actions.pod:2687
9216 msgid "guestfs_inspect_get_mountpoints"
9220 #: ../src/guestfs-actions.pod:2689
9224 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9225 " const char *root);\n"
9230 #: ../src/guestfs-actions.pod:2696 ../fish/guestfish-actions.pod:1839
9232 "This returns a hash of where we think the filesystems associated with this "
9233 "operating system should be mounted. Callers should note that this is at "
9234 "best an educated guess made by reading configuration files such as C</etc/"
9239 #: ../src/guestfs-actions.pod:2701 ../fish/guestfish-actions.pod:1844
9241 "Each element in the returned hashtable has a key which is the path of the "
9242 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9243 "mounted there (eg. C</dev/sda1>)."
9247 #: ../src/guestfs-actions.pod:2706 ../fish/guestfish-actions.pod:1849
9249 "Non-mounted devices such as swap devices are I<not> returned in this list."
9253 #: ../src/guestfs-actions.pod:2709
9255 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9256 "C<guestfs_inspect_get_filesystems>."
9260 #: ../src/guestfs-actions.pod:2712 ../src/guestfs-actions.pod:3356
9261 #: ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:6406
9263 "This function returns a NULL-terminated array of strings, or NULL if there "
9264 "was an error. The array of strings will always have length C<2n+1>, where "
9265 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9266 "caller must free the strings and the array after use>."
9270 #: ../src/guestfs-actions.pod:2720
9271 msgid "guestfs_inspect_get_package_format"
9275 #: ../src/guestfs-actions.pod:2722
9279 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9280 " const char *root);\n"
9285 #: ../src/guestfs-actions.pod:2729
9287 "This function and C<guestfs_inspect_get_package_management> return the "
9288 "package format and package management tool used by the inspected operating "
9289 "system. For example for Fedora these functions would return C<rpm> (package "
9290 "format) and C<yum> (package management)."
9294 #: ../src/guestfs-actions.pod:2735 ../fish/guestfish-actions.pod:1868
9296 "This returns the string C<unknown> if we could not determine the package "
9297 "format I<or> if the operating system does not have a real packaging system "
9302 #: ../src/guestfs-actions.pod:2739 ../fish/guestfish-actions.pod:1872
9304 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9305 "Future versions of libguestfs may return other strings."
9309 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2778
9310 msgid "(Added in 1.7.5)"
9314 #: ../src/guestfs-actions.pod:2749
9315 msgid "guestfs_inspect_get_package_management"
9319 #: ../src/guestfs-actions.pod:2751
9323 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9324 " const char *root);\n"
9329 #: ../src/guestfs-actions.pod:2758
9331 "C<guestfs_inspect_get_package_format> and this function return the package "
9332 "format and package management tool used by the inspected operating system. "
9333 "For example for Fedora these functions would return C<rpm> (package format) "
9334 "and C<yum> (package management)."
9338 #: ../src/guestfs-actions.pod:2764 ../fish/guestfish-actions.pod:1890
9340 "This returns the string C<unknown> if we could not determine the package "
9341 "management tool I<or> if the operating system does not have a real packaging "
9342 "system (eg. Windows)."
9346 #: ../src/guestfs-actions.pod:2768 ../fish/guestfish-actions.pod:1894
9348 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9349 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9350 "libguestfs may return other strings."
9354 #: ../src/guestfs-actions.pod:2780
9355 msgid "guestfs_inspect_get_product_name"
9359 #: ../src/guestfs-actions.pod:2782
9363 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9364 " const char *root);\n"
9369 #: ../src/guestfs-actions.pod:2789 ../fish/guestfish-actions.pod:1908
9371 "This returns the product name of the inspected operating system. The "
9372 "product name is generally some freeform string which can be displayed to the "
9373 "user, but should not be parsed by programs."
9377 #: ../src/guestfs-actions.pod:2794 ../fish/guestfish-actions.pod:1913
9379 "If the product name could not be determined, then the string C<unknown> is "
9384 #: ../src/guestfs-actions.pod:2804
9385 msgid "guestfs_inspect_get_roots"
9389 #: ../src/guestfs-actions.pod:2806
9393 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9398 #: ../src/guestfs-actions.pod:2809
9400 "This function is a convenient way to get the list of root devices, as "
9401 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9402 "the whole inspection process."
9406 #: ../src/guestfs-actions.pod:2813
9408 "This returns an empty list if either no root devices were found or the "
9409 "caller has not called C<guestfs_inspect_os>."
9413 #: ../src/guestfs-actions.pod:2822
9414 msgid "(Added in 1.7.3)"
9418 #: ../src/guestfs-actions.pod:2824
9419 msgid "guestfs_inspect_get_type"
9423 #: ../src/guestfs-actions.pod:2826
9427 " guestfs_inspect_get_type (guestfs_h *g,\n"
9428 " const char *root);\n"
9433 #: ../src/guestfs-actions.pod:2833 ../fish/guestfish-actions.pod:1938
9435 "This returns the type of the inspected operating system. Currently defined "
9440 #: ../src/guestfs-actions.pod:2838 ../fish/guestfish-actions.pod:1943
9445 #: ../src/guestfs-actions.pod:2840 ../fish/guestfish-actions.pod:1945
9446 msgid "Any Linux-based operating system."
9450 #: ../src/guestfs-actions.pod:2844 ../fish/guestfish-actions.pod:1949
9451 msgid "Any Microsoft Windows operating system."
9455 #: ../src/guestfs-actions.pod:2846 ../fish/guestfish-actions.pod:1951
9460 #: ../src/guestfs-actions.pod:2848 ../fish/guestfish-actions.pod:1953
9465 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1957
9466 msgid "The operating system type could not be determined."
9470 #: ../src/guestfs-actions.pod:2866
9471 msgid "guestfs_inspect_get_windows_systemroot"
9475 #: ../src/guestfs-actions.pod:2868
9479 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9480 " const char *root);\n"
9485 #: ../src/guestfs-actions.pod:2875 ../fish/guestfish-actions.pod:1973
9487 "This returns the Windows systemroot of the inspected guest. The systemroot "
9488 "is a directory path such as C</WINDOWS>."
9492 #: ../src/guestfs-actions.pod:2878 ../fish/guestfish-actions.pod:1976
9494 "This call assumes that the guest is Windows and that the systemroot could be "
9495 "determined by inspection. If this is not the case then an error is returned."
9499 #: ../src/guestfs-actions.pod:2887
9500 msgid "(Added in 1.5.25)"
9504 #: ../src/guestfs-actions.pod:2889
9505 msgid "guestfs_inspect_list_applications"
9509 #: ../src/guestfs-actions.pod:2891
9512 " struct guestfs_application_list *\n"
9513 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9514 " const char *root);\n"
9519 #: ../src/guestfs-actions.pod:2898 ../fish/guestfish-actions.pod:1989
9520 msgid "Return the list of applications installed in the operating system."
9524 #: ../src/guestfs-actions.pod:2900
9526 "I<Note:> This call works differently from other parts of the inspection "
9527 "API. You have to call C<guestfs_inspect_os>, then "
9528 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9529 "this. Listing applications is a significantly more difficult operation "
9530 "which requires access to the full filesystem. Also note that unlike the "
9531 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9532 "the libguestfs handle, this call actually reads parts of the mounted "
9533 "filesystems during the call."
9537 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:2001
9539 "This returns an empty list if the inspection code was not able to determine "
9540 "the list of applications."
9544 #: ../src/guestfs-actions.pod:2913 ../fish/guestfish-actions.pod:2004
9545 msgid "The application structure contains the following fields:"
9549 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:2008
9554 #: ../src/guestfs-actions.pod:2919 ../fish/guestfish-actions.pod:2010
9556 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9557 "guests, this is the package name."
9561 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2013
9562 msgid "C<app_display_name>"
9566 #: ../src/guestfs-actions.pod:2924 ../fish/guestfish-actions.pod:2015
9568 "The display name of the application, sometimes localized to the install "
9569 "language of the guest operating system."
9573 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2018
9575 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9576 "to display something can use C<app_name> instead."
9580 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2021
9581 msgid "C<app_epoch>"
9585 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2023
9587 "For package managers which use epochs, this contains the epoch of the "
9588 "package (an integer). If unavailable, this is returned as C<0>."
9592 #: ../src/guestfs-actions.pod:2935 ../fish/guestfish-actions.pod:2026
9593 msgid "C<app_version>"
9597 #: ../src/guestfs-actions.pod:2937 ../fish/guestfish-actions.pod:2028
9599 "The version string of the application or package. If unavailable this is "
9600 "returned as an empty string C<\"\">."
9604 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2031
9605 msgid "C<app_release>"
9609 #: ../src/guestfs-actions.pod:2942 ../fish/guestfish-actions.pod:2033
9611 "The release string of the application or package, for package managers that "
9612 "use this. If unavailable this is returned as an empty string C<\"\">."
9616 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2037
9617 msgid "C<app_install_path>"
9621 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2039
9623 "The installation path of the application (on operating systems such as "
9624 "Windows which use installation paths). This path is in the format used by "
9625 "the guest operating system, it is not a libguestfs path."
9629 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2044
9630 msgid "If unavailable this is returned as an empty string C<\"\">."
9634 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2046
9635 msgid "C<app_trans_path>"
9639 #: ../src/guestfs-actions.pod:2957 ../fish/guestfish-actions.pod:2048
9641 "The install path translated into a libguestfs path. If unavailable this is "
9642 "returned as an empty string C<\"\">."
9646 #: ../src/guestfs-actions.pod:2960 ../fish/guestfish-actions.pod:2051
9647 msgid "C<app_publisher>"
9651 #: ../src/guestfs-actions.pod:2962 ../fish/guestfish-actions.pod:2053
9653 "The name of the publisher of the application, for package managers that use "
9654 "this. If unavailable this is returned as an empty string C<\"\">."
9658 #: ../src/guestfs-actions.pod:2966 ../fish/guestfish-actions.pod:2057
9663 #: ../src/guestfs-actions.pod:2968 ../fish/guestfish-actions.pod:2059
9665 "The URL (eg. upstream URL) of the application. If unavailable this is "
9666 "returned as an empty string C<\"\">."
9670 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2062
9671 msgid "C<app_source_package>"
9675 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2064
9677 "For packaging systems which support this, the name of the source package. "
9678 "If unavailable this is returned as an empty string C<\"\">."
9682 #: ../src/guestfs-actions.pod:2976 ../fish/guestfish-actions.pod:2067
9683 msgid "C<app_summary>"
9687 #: ../src/guestfs-actions.pod:2978 ../fish/guestfish-actions.pod:2069
9689 "A short (usually one line) description of the application or package. If "
9690 "unavailable this is returned as an empty string C<\"\">."
9694 #: ../src/guestfs-actions.pod:2981 ../fish/guestfish-actions.pod:2072
9695 msgid "C<app_description>"
9699 #: ../src/guestfs-actions.pod:2983 ../fish/guestfish-actions.pod:2074
9701 "A longer description of the application or package. If unavailable this is "
9702 "returned as an empty string C<\"\">."
9706 #: ../src/guestfs-actions.pod:2990
9708 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9709 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9714 #: ../src/guestfs-actions.pod:2994
9715 msgid "(Added in 1.7.8)"
9719 #: ../src/guestfs-actions.pod:2996
9720 msgid "guestfs_inspect_os"
9724 #: ../src/guestfs-actions.pod:2998
9728 " guestfs_inspect_os (guestfs_h *g);\n"
9733 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2085
9735 "This function uses other libguestfs functions and certain heuristics to "
9736 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9737 "for operating systems."
9741 #: ../src/guestfs-actions.pod:3005 ../fish/guestfish-actions.pod:2089
9742 msgid "The list returned is empty if no operating systems were found."
9746 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2091
9748 "If one operating system was found, then this returns a list with a single "
9749 "element, which is the name of the root filesystem of this operating system. "
9750 "It is also possible for this function to return a list containing more than "
9751 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9752 "element being the root filesystem of one of the operating systems."
9756 #: ../src/guestfs-actions.pod:3014
9758 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9759 "functions in order to query further information about each operating system, "
9760 "such as the name and version."
9764 #: ../src/guestfs-actions.pod:3019
9766 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9767 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9768 "the contents. This should be called with no disks currently mounted. The "
9769 "function may also use Augeas, so any existing Augeas handle will be closed."
9773 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2109
9775 "This function cannot decrypt encrypted disks. The caller must do that first "
9776 "(supplying the necessary keys) if the disk is encrypted."
9780 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3314
9781 #: ../src/guestfs-actions.pod:3376
9782 msgid "See also C<guestfs_list_filesystems>."
9786 #: ../src/guestfs-actions.pod:3039
9787 msgid "guestfs_is_blockdev"
9791 #: ../src/guestfs-actions.pod:3041
9795 " guestfs_is_blockdev (guestfs_h *g,\n"
9796 " const char *path);\n"
9801 #: ../src/guestfs-actions.pod:3045 ../fish/guestfish-actions.pod:2121
9803 "This returns C<true> if and only if there is a block device with the given "
9808 #: ../src/guestfs-actions.pod:3048 ../src/guestfs-actions.pod:3077
9809 #: ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3122
9810 #: ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3194
9811 #: ../src/guestfs-actions.pod:3209
9812 msgid "See also C<guestfs_stat>."
9816 #: ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3081
9817 #: ../src/guestfs-actions.pod:3126 ../src/guestfs-actions.pod:3198
9818 #: ../src/guestfs-actions.pod:3213
9819 msgid "(Added in 1.5.10)"
9823 #: ../src/guestfs-actions.pod:3054
9824 msgid "guestfs_is_busy"
9828 #: ../src/guestfs-actions.pod:3056
9832 " guestfs_is_busy (guestfs_h *g);\n"
9837 #: ../src/guestfs-actions.pod:3059 ../fish/guestfish-actions.pod:2130
9839 "This returns true iff this handle is busy processing a command (in the "
9844 #: ../src/guestfs-actions.pod:3068
9845 msgid "guestfs_is_chardev"
9849 #: ../src/guestfs-actions.pod:3070
9853 " guestfs_is_chardev (guestfs_h *g,\n"
9854 " const char *path);\n"
9859 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2139
9861 "This returns C<true> if and only if there is a character device with the "
9862 "given C<path> name."
9866 #: ../src/guestfs-actions.pod:3083
9867 msgid "guestfs_is_config"
9871 #: ../src/guestfs-actions.pod:3085
9875 " guestfs_is_config (guestfs_h *g);\n"
9880 #: ../src/guestfs-actions.pod:3088 ../fish/guestfish-actions.pod:2148
9882 "This returns true iff this handle is being configured (in the C<CONFIG> "
9887 #: ../src/guestfs-actions.pod:3097
9888 msgid "guestfs_is_dir"
9892 #: ../src/guestfs-actions.pod:3099
9896 " guestfs_is_dir (guestfs_h *g,\n"
9897 " const char *path);\n"
9902 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2157
9904 "This returns C<true> if and only if there is a directory with the given "
9905 "C<path> name. Note that it returns false for other objects like files."
9909 #: ../src/guestfs-actions.pod:3113
9910 msgid "guestfs_is_fifo"
9914 #: ../src/guestfs-actions.pod:3115
9918 " guestfs_is_fifo (guestfs_h *g,\n"
9919 " const char *path);\n"
9924 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2167
9926 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9927 "given C<path> name."
9931 #: ../src/guestfs-actions.pod:3128
9932 msgid "guestfs_is_file"
9936 #: ../src/guestfs-actions.pod:3130
9940 " guestfs_is_file (guestfs_h *g,\n"
9941 " const char *path);\n"
9946 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2176
9948 "This returns C<true> if and only if there is a regular file with the given "
9949 "C<path> name. Note that it returns false for other objects like directories."
9953 #: ../src/guestfs-actions.pod:3144
9954 msgid "guestfs_is_launching"
9958 #: ../src/guestfs-actions.pod:3146
9962 " guestfs_is_launching (guestfs_h *g);\n"
9967 #: ../src/guestfs-actions.pod:3149 ../fish/guestfish-actions.pod:2186
9969 "This returns true iff this handle is launching the subprocess (in the "
9970 "C<LAUNCHING> state)."
9974 #: ../src/guestfs-actions.pod:3158
9975 msgid "guestfs_is_lv"
9979 #: ../src/guestfs-actions.pod:3160
9983 " guestfs_is_lv (guestfs_h *g,\n"
9984 " const char *device);\n"
9989 #: ../src/guestfs-actions.pod:3164 ../fish/guestfish-actions.pod:2195
9991 "This command tests whether C<device> is a logical volume, and returns true "
9992 "iff this is the case."
9996 #: ../src/guestfs-actions.pod:3171
9997 msgid "guestfs_is_ready"
10001 #: ../src/guestfs-actions.pod:3173
10005 " guestfs_is_ready (guestfs_h *g);\n"
10010 #: ../src/guestfs-actions.pod:3176 ../fish/guestfish-actions.pod:2202
10012 "This returns true iff this handle is ready to accept commands (in the "
10017 #: ../src/guestfs-actions.pod:3185
10018 msgid "guestfs_is_socket"
10022 #: ../src/guestfs-actions.pod:3187
10026 " guestfs_is_socket (guestfs_h *g,\n"
10027 " const char *path);\n"
10032 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2211
10034 "This returns C<true> if and only if there is a Unix domain socket with the "
10035 "given C<path> name."
10039 #: ../src/guestfs-actions.pod:3200
10040 msgid "guestfs_is_symlink"
10044 #: ../src/guestfs-actions.pod:3202
10048 " guestfs_is_symlink (guestfs_h *g,\n"
10049 " const char *path);\n"
10054 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2220
10056 "This returns C<true> if and only if there is a symbolic link with the given "
10061 #: ../src/guestfs-actions.pod:3215
10062 msgid "guestfs_kill_subprocess"
10066 #: ../src/guestfs-actions.pod:3217
10070 " guestfs_kill_subprocess (guestfs_h *g);\n"
10075 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2229
10076 msgid "This kills the qemu subprocess. You should never need to call this."
10080 #: ../src/guestfs-actions.pod:3226
10081 msgid "guestfs_launch"
10085 #: ../src/guestfs-actions.pod:3228
10089 " guestfs_launch (guestfs_h *g);\n"
10094 #: ../src/guestfs-actions.pod:3231 ../fish/guestfish-actions.pod:2237
10096 "Internally libguestfs is implemented by running a virtual machine using "
10101 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2240
10103 "You should call this after configuring the handle (eg. adding drives) but "
10104 "before performing any actions."
10108 #: ../src/guestfs-actions.pod:3241
10109 msgid "guestfs_lchown"
10113 #: ../src/guestfs-actions.pod:3243
10117 " guestfs_lchown (guestfs_h *g,\n"
10120 " const char *path);\n"
10125 #: ../src/guestfs-actions.pod:3249
10127 "Change the file owner to C<owner> and group to C<group>. This is like "
10128 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
10129 "changed, not the target."
10133 #: ../src/guestfs-actions.pod:3261
10134 msgid "guestfs_lgetxattr"
10138 #: ../src/guestfs-actions.pod:3263
10142 " guestfs_lgetxattr (guestfs_h *g,\n"
10143 " const char *path,\n"
10144 " const char *name,\n"
10145 " size_t *size_r);\n"
10150 #: ../src/guestfs-actions.pod:3269 ../fish/guestfish-actions.pod:2259
10152 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10153 "is a symlink, then this call returns an extended attribute from the symlink."
10157 #: ../src/guestfs-actions.pod:3283
10158 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
10162 #: ../src/guestfs-actions.pod:3289
10163 msgid "guestfs_lgetxattrs"
10167 #: ../src/guestfs-actions.pod:3291
10170 " struct guestfs_xattr_list *\n"
10171 " guestfs_lgetxattrs (guestfs_h *g,\n"
10172 " const char *path);\n"
10177 #: ../src/guestfs-actions.pod:3295
10179 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
10180 "then it returns the extended attributes of the link itself."
10184 #: ../src/guestfs-actions.pod:3305
10185 msgid "guestfs_list_devices"
10189 #: ../src/guestfs-actions.pod:3307
10193 " guestfs_list_devices (guestfs_h *g);\n"
10198 #: ../src/guestfs-actions.pod:3310 ../fish/guestfish-actions.pod:2287
10199 msgid "List all the block devices."
10203 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2289
10204 msgid "The full block device names are returned, eg. C</dev/sda>."
10208 #: ../src/guestfs-actions.pod:3322
10209 msgid "guestfs_list_filesystems"
10213 #: ../src/guestfs-actions.pod:3324
10217 " guestfs_list_filesystems (guestfs_h *g);\n"
10222 #: ../src/guestfs-actions.pod:3327 ../fish/guestfish-actions.pod:2297
10224 "This inspection command looks for filesystems on partitions, block devices "
10225 "and logical volumes, returning a list of devices containing filesystems and "
10230 #: ../src/guestfs-actions.pod:3331 ../fish/guestfish-actions.pod:2301
10232 "The return value is a hash, where the keys are the devices containing "
10233 "filesystems, and the values are the filesystem types. For example:"
10237 #: ../src/guestfs-actions.pod:3335 ../fish/guestfish-actions.pod:2305
10240 " \"/dev/sda1\" => \"ntfs\"\n"
10241 " \"/dev/sda2\" => \"ext2\"\n"
10242 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10243 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10248 #: ../src/guestfs-actions.pod:3340 ../fish/guestfish-actions.pod:2310
10250 "The value can have the special value \"unknown\", meaning the content of the "
10251 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10255 #: ../src/guestfs-actions.pod:3344
10257 "This command runs other libguestfs commands, which might include "
10258 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10259 "soon after launch and only when nothing is mounted."
10263 #: ../src/guestfs-actions.pod:3348
10265 "Not all of the filesystems returned will be mountable. In particular, swap "
10266 "partitions are returned in the list. Also this command does not check that "
10267 "each filesystem found is valid and mountable, and some filesystems might be "
10268 "mountable but require special options. Filesystems may not all belong to a "
10269 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10273 #: ../src/guestfs-actions.pod:3362 ../src/guestfs-actions.pod:4951
10274 msgid "(Added in 1.5.15)"
10278 #: ../src/guestfs-actions.pod:3364
10279 msgid "guestfs_list_partitions"
10283 #: ../src/guestfs-actions.pod:3366
10287 " guestfs_list_partitions (guestfs_h *g);\n"
10292 #: ../src/guestfs-actions.pod:3369 ../fish/guestfish-actions.pod:2330
10293 msgid "List all the partitions detected on all block devices."
10297 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2332
10298 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10302 #: ../src/guestfs-actions.pod:3373
10304 "This does not return logical volumes. For that you will need to call "
10309 #: ../src/guestfs-actions.pod:3384
10314 #: ../src/guestfs-actions.pod:3386
10318 " guestfs_ll (guestfs_h *g,\n"
10319 " const char *directory);\n"
10324 #: ../src/guestfs-actions.pod:3390 ../fish/guestfish-actions.pod:2343
10326 "List the files in C<directory> (relative to the root directory, there is no "
10327 "cwd) in the format of 'ls -la'."
10331 #: ../src/guestfs-actions.pod:3393 ../fish/guestfish-actions.pod:2346
10333 "This command is mostly useful for interactive sessions. It is I<not> "
10334 "intended that you try to parse the output string."
10338 #: ../src/guestfs-actions.pod:3401
10343 #: ../src/guestfs-actions.pod:3403
10347 " guestfs_ln (guestfs_h *g,\n"
10348 " const char *target,\n"
10349 " const char *linkname);\n"
10354 #: ../src/guestfs-actions.pod:3408 ../fish/guestfish-actions.pod:2353
10355 msgid "This command creates a hard link using the C<ln> command."
10359 #: ../src/guestfs-actions.pod:3414
10360 msgid "guestfs_ln_f"
10364 #: ../src/guestfs-actions.pod:3416
10368 " guestfs_ln_f (guestfs_h *g,\n"
10369 " const char *target,\n"
10370 " const char *linkname);\n"
10375 #: ../src/guestfs-actions.pod:3421 ../fish/guestfish-actions.pod:2359
10377 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10378 "option removes the link (C<linkname>) if it exists already."
10382 #: ../src/guestfs-actions.pod:3428
10383 msgid "guestfs_ln_s"
10387 #: ../src/guestfs-actions.pod:3430
10391 " guestfs_ln_s (guestfs_h *g,\n"
10392 " const char *target,\n"
10393 " const char *linkname);\n"
10398 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2366
10399 msgid "This command creates a symbolic link using the C<ln -s> command."
10403 #: ../src/guestfs-actions.pod:3441
10404 msgid "guestfs_ln_sf"
10408 #: ../src/guestfs-actions.pod:3443
10412 " guestfs_ln_sf (guestfs_h *g,\n"
10413 " const char *target,\n"
10414 " const char *linkname);\n"
10419 #: ../src/guestfs-actions.pod:3448 ../fish/guestfish-actions.pod:2372
10421 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10422 "option removes the link (C<linkname>) if it exists already."
10426 #: ../src/guestfs-actions.pod:3455
10427 msgid "guestfs_lremovexattr"
10431 #: ../src/guestfs-actions.pod:3457
10435 " guestfs_lremovexattr (guestfs_h *g,\n"
10436 " const char *xattr,\n"
10437 " const char *path);\n"
10442 #: ../src/guestfs-actions.pod:3462
10444 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10445 "link, then it removes an extended attribute of the link itself."
10449 #: ../src/guestfs-actions.pod:3470
10454 #: ../src/guestfs-actions.pod:3472
10458 " guestfs_ls (guestfs_h *g,\n"
10459 " const char *directory);\n"
10464 #: ../src/guestfs-actions.pod:3476 ../fish/guestfish-actions.pod:2387
10466 "List the files in C<directory> (relative to the root directory, there is no "
10467 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10471 #: ../src/guestfs-actions.pod:3480
10473 "This command is mostly useful for interactive sessions. Programs should "
10474 "probably use C<guestfs_readdir> instead."
10478 #: ../src/guestfs-actions.pod:3489
10479 msgid "guestfs_lsetxattr"
10483 #: ../src/guestfs-actions.pod:3491
10487 " guestfs_lsetxattr (guestfs_h *g,\n"
10488 " const char *xattr,\n"
10489 " const char *val,\n"
10491 " const char *path);\n"
10496 #: ../src/guestfs-actions.pod:3498
10498 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10499 "then it sets an extended attribute of the link itself."
10503 #: ../src/guestfs-actions.pod:3506
10504 msgid "guestfs_lstat"
10508 #: ../src/guestfs-actions.pod:3508
10511 " struct guestfs_stat *\n"
10512 " guestfs_lstat (guestfs_h *g,\n"
10513 " const char *path);\n"
10518 #: ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:6005
10519 #: ../fish/guestfish-actions.pod:2406 ../fish/guestfish-actions.pod:4019
10520 msgid "Returns file information for the given C<path>."
10524 #: ../src/guestfs-actions.pod:3514
10526 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10527 "link, then the link is stat-ed, not the file it refers to."
10531 #: ../src/guestfs-actions.pod:3518 ../fish/guestfish-actions.pod:2412
10532 msgid "This is the same as the C<lstat(2)> system call."
10536 #: ../src/guestfs-actions.pod:3520 ../src/guestfs-actions.pod:6009
10538 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10539 "error. I<The caller must call C<guestfs_free_stat> after use>."
10543 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:6013
10544 #: ../src/guestfs-actions.pod:6031 ../src/guestfs-actions.pod:6412
10545 msgid "(Added in 0.9.2)"
10549 #: ../src/guestfs-actions.pod:3526
10550 msgid "guestfs_lstatlist"
10554 #: ../src/guestfs-actions.pod:3528
10557 " struct guestfs_stat_list *\n"
10558 " guestfs_lstatlist (guestfs_h *g,\n"
10559 " const char *path,\n"
10560 " char *const *names);\n"
10565 #: ../src/guestfs-actions.pod:3533
10567 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10568 "files, where all files are in the directory C<path>. C<names> is the list "
10569 "of files from this directory."
10573 #: ../src/guestfs-actions.pod:3537 ../fish/guestfish-actions.pod:2422
10575 "On return you get a list of stat structs, with a one-to-one correspondence "
10576 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10577 "then the C<ino> field of that structure is set to C<-1>."
10581 #: ../src/guestfs-actions.pod:3542
10583 "This call is intended for programs that want to efficiently list a directory "
10584 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10585 "for a similarly efficient call for getting extended attributes. Very long "
10586 "directory listings might cause the protocol message size to be exceeded, "
10587 "causing this call to fail. The caller must split up such requests into "
10588 "smaller groups of names."
10592 #: ../src/guestfs-actions.pod:3550
10594 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10595 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10599 #: ../src/guestfs-actions.pod:3556
10600 msgid "guestfs_luks_add_key"
10604 #: ../src/guestfs-actions.pod:3558
10608 " guestfs_luks_add_key (guestfs_h *g,\n"
10609 " const char *device,\n"
10610 " const char *key,\n"
10611 " const char *newkey,\n"
10617 #: ../src/guestfs-actions.pod:3565 ../fish/guestfish-actions.pod:2439
10619 "This command adds a new key on LUKS device C<device>. C<key> is any "
10620 "existing key, and is used to access the device. C<newkey> is the new key to "
10621 "add. C<keyslot> is the key slot that will be replaced."
10625 #: ../src/guestfs-actions.pod:3570
10627 "Note that if C<keyslot> already contains a key, then this command will "
10628 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10632 #: ../src/guestfs-actions.pod:3576 ../src/guestfs-actions.pod:3616
10633 #: ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3659
10634 #: ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3710
10636 "This function takes a key or passphrase parameter which could contain "
10637 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10642 #: ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:3620
10643 #: ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3663
10644 msgid "(Added in 1.5.2)"
10648 #: ../src/guestfs-actions.pod:3582
10649 msgid "guestfs_luks_close"
10653 #: ../src/guestfs-actions.pod:3584
10657 " guestfs_luks_close (guestfs_h *g,\n"
10658 " const char *device);\n"
10663 #: ../src/guestfs-actions.pod:3588
10665 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10666 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10667 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10668 "underlying block device."
10672 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3695
10673 #: ../src/guestfs-actions.pod:3714 ../src/guestfs-actions.pod:3764
10674 #: ../src/guestfs-actions.pod:3812
10675 msgid "(Added in 1.5.1)"
10679 #: ../src/guestfs-actions.pod:3598
10680 msgid "guestfs_luks_format"
10684 #: ../src/guestfs-actions.pod:3600
10688 " guestfs_luks_format (guestfs_h *g,\n"
10689 " const char *device,\n"
10690 " const char *key,\n"
10696 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2465
10698 "This command erases existing data on C<device> and formats the device as a "
10699 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10700 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10704 #: ../src/guestfs-actions.pod:3613 ../src/guestfs-actions.pod:3636
10705 #: ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:4702
10706 #: ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:5840
10707 #: ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5889
10708 #: ../src/guestfs-actions.pod:7049 ../fish/guestfish-actions.pod:2473
10709 #: ../fish/guestfish-actions.pod:2486 ../fish/guestfish-actions.pod:2570
10710 #: ../fish/guestfish-actions.pod:3131 ../fish/guestfish-actions.pod:3638
10711 #: ../fish/guestfish-actions.pod:3918 ../fish/guestfish-actions.pod:3934
10712 #: ../fish/guestfish-actions.pod:3949 ../fish/guestfish-actions.pod:4664
10714 "B<This command is dangerous. Without careful use you can easily destroy all "
10719 #: ../src/guestfs-actions.pod:3622
10720 msgid "guestfs_luks_format_cipher"
10724 #: ../src/guestfs-actions.pod:3624
10728 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10729 " const char *device,\n"
10730 " const char *key,\n"
10732 " const char *cipher);\n"
10737 #: ../src/guestfs-actions.pod:3631
10739 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10740 "set the C<cipher> used."
10744 #: ../src/guestfs-actions.pod:3645
10745 msgid "guestfs_luks_kill_slot"
10749 #: ../src/guestfs-actions.pod:3647
10753 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10754 " const char *device,\n"
10755 " const char *key,\n"
10761 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2493
10763 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10764 "device C<device>. C<key> must be one of the I<other> keys."
10768 #: ../src/guestfs-actions.pod:3665
10769 msgid "guestfs_luks_open"
10773 #: ../src/guestfs-actions.pod:3667
10777 " guestfs_luks_open (guestfs_h *g,\n"
10778 " const char *device,\n"
10779 " const char *key,\n"
10780 " const char *mapname);\n"
10785 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2504
10787 "This command opens a block device which has been encrypted according to the "
10788 "Linux Unified Key Setup (LUKS) standard."
10792 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2507
10793 msgid "C<device> is the encrypted block device or partition."
10797 #: ../src/guestfs-actions.pod:3678 ../fish/guestfish-actions.pod:2509
10799 "The caller must supply one of the keys associated with the LUKS block "
10800 "device, in the C<key> parameter."
10804 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2512
10806 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10807 "writes to this block device are decrypted from and encrypted to the "
10808 "underlying C<device> respectively."
10812 #: ../src/guestfs-actions.pod:3685
10814 "If this block device contains LVM volume groups, then calling "
10815 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10820 #: ../src/guestfs-actions.pod:3697
10821 msgid "guestfs_luks_open_ro"
10825 #: ../src/guestfs-actions.pod:3699
10829 " guestfs_luks_open_ro (guestfs_h *g,\n"
10830 " const char *device,\n"
10831 " const char *key,\n"
10832 " const char *mapname);\n"
10837 #: ../src/guestfs-actions.pod:3705
10839 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10844 #: ../src/guestfs-actions.pod:3716
10845 msgid "guestfs_lvcreate"
10849 #: ../src/guestfs-actions.pod:3718
10853 " guestfs_lvcreate (guestfs_h *g,\n"
10854 " const char *logvol,\n"
10855 " const char *volgroup,\n"
10861 #: ../src/guestfs-actions.pod:3724 ../fish/guestfish-actions.pod:2537
10863 "This creates an LVM logical volume called C<logvol> on the volume group "
10864 "C<volgroup>, with C<size> megabytes."
10868 #: ../src/guestfs-actions.pod:3731
10869 msgid "guestfs_lvm_canonical_lv_name"
10873 #: ../src/guestfs-actions.pod:3733
10877 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10878 " const char *lvname);\n"
10883 #: ../src/guestfs-actions.pod:3737 ../fish/guestfish-actions.pod:2544
10885 "This converts alternative naming schemes for LVs that you might find to the "
10886 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10891 #: ../src/guestfs-actions.pod:3741 ../fish/guestfish-actions.pod:2548
10893 "This command returns an error if the C<lvname> parameter does not refer to a "
10898 #: ../src/guestfs-actions.pod:3744
10899 msgid "See also C<guestfs_is_lv>."
10903 #: ../src/guestfs-actions.pod:3749
10904 msgid "(Added in 1.5.24)"
10908 #: ../src/guestfs-actions.pod:3751
10909 msgid "guestfs_lvm_clear_filter"
10913 #: ../src/guestfs-actions.pod:3753
10917 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10922 #: ../src/guestfs-actions.pod:3756
10924 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10925 "see every block device."
10929 #: ../src/guestfs-actions.pod:3759 ../src/guestfs-actions.pod:3801
10930 #: ../fish/guestfish-actions.pod:2560 ../fish/guestfish-actions.pod:2591
10932 "This command also clears the LVM cache and performs a volume group scan."
10936 #: ../src/guestfs-actions.pod:3766
10937 msgid "guestfs_lvm_remove_all"
10941 #: ../src/guestfs-actions.pod:3768
10945 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10950 #: ../src/guestfs-actions.pod:3771 ../fish/guestfish-actions.pod:2567
10952 "This command removes all LVM logical volumes, volume groups and physical "
10957 #: ../src/guestfs-actions.pod:3781
10958 msgid "guestfs_lvm_set_filter"
10962 #: ../src/guestfs-actions.pod:3783
10966 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10967 " char *const *devices);\n"
10972 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2577
10974 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10975 "block devices in the list C<devices>, and will ignore all other attached "
10980 #: ../src/guestfs-actions.pod:3791 ../fish/guestfish-actions.pod:2581
10982 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10983 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10984 "there are two types of duplication possible: either cloned PVs/VGs which "
10985 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10986 "same name. In normal operation you cannot create this situation, but you "
10987 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10988 "inside the LVM metadata."
10992 #: ../src/guestfs-actions.pod:3804 ../fish/guestfish-actions.pod:2594
10993 msgid "You can filter whole block devices or individual partitions."
10997 #: ../src/guestfs-actions.pod:3806 ../fish/guestfish-actions.pod:2596
10999 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11000 "filesystem), even if you are not filtering out that VG."
11004 #: ../src/guestfs-actions.pod:3814
11005 msgid "guestfs_lvremove"
11009 #: ../src/guestfs-actions.pod:3816
11013 " guestfs_lvremove (guestfs_h *g,\n"
11014 " const char *device);\n"
11019 #: ../src/guestfs-actions.pod:3820 ../fish/guestfish-actions.pod:2604
11021 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11022 "LV, such as C</dev/VG/LV>."
11026 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2607
11028 "You can also remove all LVs in a volume group by specifying the VG name, C</"
11033 #: ../src/guestfs-actions.pod:3828 ../src/guestfs-actions.pod:5048
11034 #: ../src/guestfs-actions.pod:6788
11035 msgid "(Added in 1.0.13)"
11039 #: ../src/guestfs-actions.pod:3830
11040 msgid "guestfs_lvrename"
11044 #: ../src/guestfs-actions.pod:3832
11048 " guestfs_lvrename (guestfs_h *g,\n"
11049 " const char *logvol,\n"
11050 " const char *newlogvol);\n"
11055 #: ../src/guestfs-actions.pod:3837 ../fish/guestfish-actions.pod:2614
11056 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11060 #: ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:6801
11061 msgid "(Added in 1.0.83)"
11065 #: ../src/guestfs-actions.pod:3843
11066 msgid "guestfs_lvresize"
11070 #: ../src/guestfs-actions.pod:3845
11074 " guestfs_lvresize (guestfs_h *g,\n"
11075 " const char *device,\n"
11081 #: ../src/guestfs-actions.pod:3850 ../fish/guestfish-actions.pod:2620
11083 "This resizes (expands or shrinks) an existing LVM logical volume to "
11084 "C<mbytes>. When reducing, data in the reduced part is lost."
11088 #: ../src/guestfs-actions.pod:3858
11089 msgid "guestfs_lvresize_free"
11093 #: ../src/guestfs-actions.pod:3860
11097 " guestfs_lvresize_free (guestfs_h *g,\n"
11098 " const char *lv,\n"
11104 #: ../src/guestfs-actions.pod:3865 ../fish/guestfish-actions.pod:2628
11106 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11107 "remaining free space in the volume group. Commonly you would call this with "
11108 "pc = 100 which expands the logical volume as much as possible, using all "
11109 "remaining free space in the volume group."
11113 #: ../src/guestfs-actions.pod:3873
11114 msgid "(Added in 1.3.3)"
11118 #: ../src/guestfs-actions.pod:3875
11119 msgid "guestfs_lvs"
11123 #: ../src/guestfs-actions.pod:3877
11127 " guestfs_lvs (guestfs_h *g);\n"
11132 #: ../src/guestfs-actions.pod:3880 ../fish/guestfish-actions.pod:2638
11134 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11139 #: ../src/guestfs-actions.pod:3883 ../fish/guestfish-actions.pod:2641
11141 "This returns a list of the logical volume device names (eg. C</dev/"
11142 "VolGroup00/LogVol00>)."
11146 #: ../src/guestfs-actions.pod:3886
11147 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
11151 #: ../src/guestfs-actions.pod:3894
11152 msgid "guestfs_lvs_full"
11156 #: ../src/guestfs-actions.pod:3896
11159 " struct guestfs_lvm_lv_list *\n"
11160 " guestfs_lvs_full (guestfs_h *g);\n"
11165 #: ../src/guestfs-actions.pod:3899 ../fish/guestfish-actions.pod:2650
11167 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11168 "(8)> command. The \"full\" version includes all fields."
11172 #: ../src/guestfs-actions.pod:3902
11174 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
11175 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
11179 #: ../src/guestfs-actions.pod:3908
11180 msgid "guestfs_lvuuid"
11184 #: ../src/guestfs-actions.pod:3910
11188 " guestfs_lvuuid (guestfs_h *g,\n"
11189 " const char *device);\n"
11194 #: ../src/guestfs-actions.pod:3914 ../fish/guestfish-actions.pod:2657
11195 msgid "This command returns the UUID of the LVM LV C<device>."
11199 #: ../src/guestfs-actions.pod:3921
11200 msgid "guestfs_lxattrlist"
11204 #: ../src/guestfs-actions.pod:3923
11207 " struct guestfs_xattr_list *\n"
11208 " guestfs_lxattrlist (guestfs_h *g,\n"
11209 " const char *path,\n"
11210 " char *const *names);\n"
11215 #: ../src/guestfs-actions.pod:3928 ../fish/guestfish-actions.pod:2663
11217 "This call allows you to get the extended attributes of multiple files, where "
11218 "all files are in the directory C<path>. C<names> is the list of files from "
11223 #: ../src/guestfs-actions.pod:3932 ../fish/guestfish-actions.pod:2667
11225 "On return you get a flat list of xattr structs which must be interpreted "
11226 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11227 "C<attrval> in this struct is zero-length to indicate there was an error "
11228 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11229 "number (the number of following attributes for this file, which could be C<"
11230 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11231 "for the first named file. This repeats for the second and subsequent files."
11235 #: ../src/guestfs-actions.pod:3942
11237 "This call is intended for programs that want to efficiently list a directory "
11238 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11239 "a similarly efficient call for getting standard stats. Very long directory "
11240 "listings might cause the protocol message size to be exceeded, causing this "
11241 "call to fail. The caller must split up such requests into smaller groups of "
11246 #: ../src/guestfs-actions.pod:3956
11247 msgid "guestfs_mkdir"
11251 #: ../src/guestfs-actions.pod:3958
11255 " guestfs_mkdir (guestfs_h *g,\n"
11256 " const char *path);\n"
11261 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2689
11262 msgid "Create a directory named C<path>."
11266 #: ../src/guestfs-actions.pod:3968
11267 msgid "guestfs_mkdir_mode"
11271 #: ../src/guestfs-actions.pod:3970
11275 " guestfs_mkdir_mode (guestfs_h *g,\n"
11276 " const char *path,\n"
11282 #: ../src/guestfs-actions.pod:3975 ../fish/guestfish-actions.pod:2695
11284 "This command creates a directory, setting the initial permissions of the "
11285 "directory to C<mode>."
11289 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:2698
11291 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11292 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11297 #: ../src/guestfs-actions.pod:3982
11298 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11302 #: ../src/guestfs-actions.pod:3988
11303 msgid "guestfs_mkdir_p"
11307 #: ../src/guestfs-actions.pod:3990
11311 " guestfs_mkdir_p (guestfs_h *g,\n"
11312 " const char *path);\n"
11317 #: ../src/guestfs-actions.pod:3994 ../fish/guestfish-actions.pod:2708
11319 "Create a directory named C<path>, creating any parent directories as "
11320 "necessary. This is like the C<mkdir -p> shell command."
11324 #: ../src/guestfs-actions.pod:4001
11325 msgid "guestfs_mkdtemp"
11329 #: ../src/guestfs-actions.pod:4003
11333 " guestfs_mkdtemp (guestfs_h *g,\n"
11334 " const char *template);\n"
11339 #: ../src/guestfs-actions.pod:4007 ../fish/guestfish-actions.pod:2715
11341 "This command creates a temporary directory. The C<template> parameter "
11342 "should be a full pathname for the temporary directory name with the final "
11343 "six characters being \"XXXXXX\"."
11347 #: ../src/guestfs-actions.pod:4012 ../fish/guestfish-actions.pod:2720
11349 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11350 "being suitable for Windows filesystems."
11354 #: ../src/guestfs-actions.pod:4015 ../fish/guestfish-actions.pod:2723
11355 msgid "The name of the temporary directory that was created is returned."
11359 #: ../src/guestfs-actions.pod:4018 ../fish/guestfish-actions.pod:2726
11360 msgid "The temporary directory is created with mode 0700 and is owned by root."
11364 #: ../src/guestfs-actions.pod:4021 ../fish/guestfish-actions.pod:2729
11366 "The caller is responsible for deleting the temporary directory and its "
11367 "contents after use."
11371 #: ../src/guestfs-actions.pod:4024 ../fish/guestfish-actions.pod:2732
11372 msgid "See also: L<mkdtemp(3)>"
11376 #: ../src/guestfs-actions.pod:4031
11377 msgid "guestfs_mke2fs_J"
11381 #: ../src/guestfs-actions.pod:4033
11385 " guestfs_mke2fs_J (guestfs_h *g,\n"
11386 " const char *fstype,\n"
11387 " int blocksize,\n"
11388 " const char *device,\n"
11389 " const char *journal);\n"
11394 #: ../src/guestfs-actions.pod:4040 ../fish/guestfish-actions.pod:2738
11396 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11397 "C<journal>. It is equivalent to the command:"
11401 #: ../src/guestfs-actions.pod:4044 ../fish/guestfish-actions.pod:2742
11404 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11409 #: ../src/guestfs-actions.pod:4046
11410 msgid "See also C<guestfs_mke2journal>."
11414 #: ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:4068
11415 #: ../src/guestfs-actions.pod:4086 ../src/guestfs-actions.pod:4102
11416 #: ../src/guestfs-actions.pod:4116 ../src/guestfs-actions.pod:4130
11417 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4438
11418 msgid "(Added in 1.0.68)"
11422 #: ../src/guestfs-actions.pod:4052
11423 msgid "guestfs_mke2fs_JL"
11427 #: ../src/guestfs-actions.pod:4054
11431 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11432 " const char *fstype,\n"
11433 " int blocksize,\n"
11434 " const char *device,\n"
11435 " const char *label);\n"
11440 #: ../src/guestfs-actions.pod:4061 ../fish/guestfish-actions.pod:2750
11442 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11443 "the journal labeled C<label>."
11447 #: ../src/guestfs-actions.pod:4064
11448 msgid "See also C<guestfs_mke2journal_L>."
11452 #: ../src/guestfs-actions.pod:4070
11453 msgid "guestfs_mke2fs_JU"
11457 #: ../src/guestfs-actions.pod:4072
11461 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11462 " const char *fstype,\n"
11463 " int blocksize,\n"
11464 " const char *device,\n"
11465 " const char *uuid);\n"
11470 #: ../src/guestfs-actions.pod:4079 ../fish/guestfish-actions.pod:2759
11472 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11473 "the journal with UUID C<uuid>."
11477 #: ../src/guestfs-actions.pod:4082
11478 msgid "See also C<guestfs_mke2journal_U>."
11482 #: ../src/guestfs-actions.pod:4088
11483 msgid "guestfs_mke2journal"
11487 #: ../src/guestfs-actions.pod:4090
11491 " guestfs_mke2journal (guestfs_h *g,\n"
11492 " int blocksize,\n"
11493 " const char *device);\n"
11498 #: ../src/guestfs-actions.pod:4095 ../fish/guestfish-actions.pod:2768
11500 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11505 #: ../src/guestfs-actions.pod:4098 ../fish/guestfish-actions.pod:2771
11508 " mke2fs -O journal_dev -b blocksize device\n"
11513 #: ../src/guestfs-actions.pod:4104
11514 msgid "guestfs_mke2journal_L"
11518 #: ../src/guestfs-actions.pod:4106
11522 " guestfs_mke2journal_L (guestfs_h *g,\n"
11523 " int blocksize,\n"
11524 " const char *label,\n"
11525 " const char *device);\n"
11530 #: ../src/guestfs-actions.pod:4112 ../fish/guestfish-actions.pod:2777
11531 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11535 #: ../src/guestfs-actions.pod:4118
11536 msgid "guestfs_mke2journal_U"
11540 #: ../src/guestfs-actions.pod:4120
11544 " guestfs_mke2journal_U (guestfs_h *g,\n"
11545 " int blocksize,\n"
11546 " const char *uuid,\n"
11547 " const char *device);\n"
11552 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2783
11553 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11557 #: ../src/guestfs-actions.pod:4132
11558 msgid "guestfs_mkfifo"
11562 #: ../src/guestfs-actions.pod:4134
11566 " guestfs_mkfifo (guestfs_h *g,\n"
11568 " const char *path);\n"
11573 #: ../src/guestfs-actions.pod:4139
11575 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11576 "is just a convenient wrapper around C<guestfs_mknod>."
11580 #: ../src/guestfs-actions.pod:4149
11581 msgid "guestfs_mkfs"
11585 #: ../src/guestfs-actions.pod:4151
11589 " guestfs_mkfs (guestfs_h *g,\n"
11590 " const char *fstype,\n"
11591 " const char *device);\n"
11596 #: ../src/guestfs-actions.pod:4156 ../fish/guestfish-actions.pod:2799
11598 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11599 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11603 #: ../src/guestfs-actions.pod:4164
11604 msgid "guestfs_mkfs_b"
11608 #: ../src/guestfs-actions.pod:4166
11612 " guestfs_mkfs_b (guestfs_h *g,\n"
11613 " const char *fstype,\n"
11614 " int blocksize,\n"
11615 " const char *device);\n"
11620 #: ../src/guestfs-actions.pod:4172
11622 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11623 "block size of the resulting filesystem. Supported block sizes depend on the "
11624 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11628 #: ../src/guestfs-actions.pod:4177 ../src/guestfs-actions.pod:4219
11629 #: ../fish/guestfish-actions.pod:2812 ../fish/guestfish-actions.pod:2839
11631 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11636 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:2815
11638 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
11642 #: ../src/guestfs-actions.pod:4191
11643 msgid "guestfs_mkfs_opts"
11647 #: ../src/guestfs-actions.pod:4193
11651 " guestfs_mkfs_opts (guestfs_h *g,\n"
11652 " const char *fstype,\n"
11653 " const char *device,\n"
11659 #: ../src/guestfs-actions.pod:4204
11662 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11667 #: ../src/guestfs-actions.pod:4206 ../fish/guestfish-actions.pod:2826
11669 "This function creates a filesystem on C<device>. The filesystem type is "
11670 "C<fstype>, for example C<ext3>."
11674 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:2833
11675 msgid "C<blocksize>"
11679 #: ../src/guestfs-actions.pod:4215 ../fish/guestfish-actions.pod:2835
11681 "The filesystem block size. Supported block sizes depend on the filesystem "
11682 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11687 #: ../src/guestfs-actions.pod:4226
11688 msgid "guestfs_mkfs_opts_va"
11692 #: ../src/guestfs-actions.pod:4228
11696 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11697 " const char *fstype,\n"
11698 " const char *device,\n"
11699 " va_list args);\n"
11704 #: ../src/guestfs-actions.pod:4234
11705 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11709 #: ../src/guestfs-actions.pod:4238
11710 msgid "guestfs_mkfs_opts_argv"
11714 #: ../src/guestfs-actions.pod:4240
11718 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11719 " const char *fstype,\n"
11720 " const char *device,\n"
11721 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11726 #: ../src/guestfs-actions.pod:4246
11727 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
11731 #: ../src/guestfs-actions.pod:4250
11732 msgid "guestfs_mkmountpoint"
11736 #: ../src/guestfs-actions.pod:4252
11740 " guestfs_mkmountpoint (guestfs_h *g,\n"
11741 " const char *exemptpath);\n"
11746 #: ../src/guestfs-actions.pod:4256
11748 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11749 "that can be used to create extra mountpoints before mounting the first "
11754 #: ../src/guestfs-actions.pod:4260 ../fish/guestfish-actions.pod:2854
11756 "These calls are I<only> necessary in some very limited circumstances, mainly "
11757 "the case where you want to mount a mix of unrelated and/or read-only "
11758 "filesystems together."
11762 #: ../src/guestfs-actions.pod:4264 ../fish/guestfish-actions.pod:2858
11764 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11765 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11766 "inside that. You can unpack this as follows in guestfish:"
11770 #: ../src/guestfs-actions.pod:4269 ../fish/guestfish-actions.pod:2863
11773 " add-ro Fedora-11-i686-Live.iso\n"
11775 " mkmountpoint /cd\n"
11776 " mkmountpoint /sqsh\n"
11777 " mkmountpoint /ext3fs\n"
11778 " mount /dev/sda /cd\n"
11779 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11780 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11785 #: ../src/guestfs-actions.pod:4278 ../fish/guestfish-actions.pod:2872
11786 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11790 #: ../src/guestfs-actions.pod:4280
11792 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11793 "may get unexpected errors if you try to mix these calls. It is safest to "
11794 "manually unmount filesystems and remove mountpoints after use."
11798 #: ../src/guestfs-actions.pod:4284
11800 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11801 "first, so for this to work for manual mountpoints, you must ensure that the "
11802 "innermost mountpoints have the longest pathnames, as in the example code "
11807 #: ../src/guestfs-actions.pod:4289 ../fish/guestfish-actions.pod:2883
11809 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11813 #: ../src/guestfs-actions.pod:4291
11815 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11816 "means that C<guestfs_umount_all> is called when the handle is closed which "
11817 "can also trigger these issues."
11821 #: ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4556
11822 #: ../src/guestfs-actions.pod:5449
11823 msgid "(Added in 1.0.62)"
11827 #: ../src/guestfs-actions.pod:4299
11828 msgid "guestfs_mknod"
11832 #: ../src/guestfs-actions.pod:4301
11836 " guestfs_mknod (guestfs_h *g,\n"
11840 " const char *path);\n"
11845 #: ../src/guestfs-actions.pod:4308 ../fish/guestfish-actions.pod:2893
11847 "This call creates block or character special devices, or named pipes (FIFOs)."
11851 #: ../src/guestfs-actions.pod:4311 ../fish/guestfish-actions.pod:2896
11853 "The C<mode> parameter should be the mode, using the standard constants. "
11854 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11855 "used when creating block and character special devices."
11859 #: ../src/guestfs-actions.pod:4316
11861 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11862 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11863 "regular file). These constants are available in the standard Linux header "
11864 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11865 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11866 "the appropriate constant for you."
11870 #: ../src/guestfs-actions.pod:4330
11871 msgid "guestfs_mknod_b"
11875 #: ../src/guestfs-actions.pod:4332
11879 " guestfs_mknod_b (guestfs_h *g,\n"
11883 " const char *path);\n"
11888 #: ../src/guestfs-actions.pod:4339
11890 "This call creates a block device node called C<path> with mode C<mode> and "
11891 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11892 "wrapper around C<guestfs_mknod>."
11896 #: ../src/guestfs-actions.pod:4349
11897 msgid "guestfs_mknod_c"
11901 #: ../src/guestfs-actions.pod:4351
11905 " guestfs_mknod_c (guestfs_h *g,\n"
11909 " const char *path);\n"
11914 #: ../src/guestfs-actions.pod:4358
11916 "This call creates a char device node called C<path> with mode C<mode> and "
11917 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11918 "wrapper around C<guestfs_mknod>."
11922 #: ../src/guestfs-actions.pod:4368
11923 msgid "guestfs_mkswap"
11927 #: ../src/guestfs-actions.pod:4370
11931 " guestfs_mkswap (guestfs_h *g,\n"
11932 " const char *device);\n"
11937 #: ../src/guestfs-actions.pod:4374 ../fish/guestfish-actions.pod:2935
11938 msgid "Create a swap partition on C<device>."
11942 #: ../src/guestfs-actions.pod:4380
11943 msgid "guestfs_mkswap_L"
11947 #: ../src/guestfs-actions.pod:4382
11951 " guestfs_mkswap_L (guestfs_h *g,\n"
11952 " const char *label,\n"
11953 " const char *device);\n"
11958 #: ../src/guestfs-actions.pod:4387 ../fish/guestfish-actions.pod:2941
11959 msgid "Create a swap partition on C<device> with label C<label>."
11963 #: ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:2943
11965 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11966 "sda>), just to a partition. This appears to be a limitation of the kernel "
11971 #: ../src/guestfs-actions.pod:4397
11972 msgid "guestfs_mkswap_U"
11976 #: ../src/guestfs-actions.pod:4399
11980 " guestfs_mkswap_U (guestfs_h *g,\n"
11981 " const char *uuid,\n"
11982 " const char *device);\n"
11987 #: ../src/guestfs-actions.pod:4404 ../fish/guestfish-actions.pod:2951
11988 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11992 #: ../src/guestfs-actions.pod:4410
11993 msgid "guestfs_mkswap_file"
11997 #: ../src/guestfs-actions.pod:4412
12001 " guestfs_mkswap_file (guestfs_h *g,\n"
12002 " const char *path);\n"
12007 #: ../src/guestfs-actions.pod:4416 ../fish/guestfish-actions.pod:2957
12008 msgid "Create a swap file."
12012 #: ../src/guestfs-actions.pod:4418
12014 "This command just writes a swap file signature to an existing file. To "
12015 "create the file itself, use something like C<guestfs_fallocate>."
12019 #: ../src/guestfs-actions.pod:4425
12020 msgid "guestfs_modprobe"
12024 #: ../src/guestfs-actions.pod:4427
12028 " guestfs_modprobe (guestfs_h *g,\n"
12029 " const char *modulename);\n"
12034 #: ../src/guestfs-actions.pod:4431 ../fish/guestfish-actions.pod:2966
12035 msgid "This loads a kernel module in the appliance."
12039 #: ../src/guestfs-actions.pod:4433 ../fish/guestfish-actions.pod:2968
12041 "The kernel module must have been whitelisted when libguestfs was built (see "
12042 "C<appliance/kmod.whitelist.in> in the source)."
12046 #: ../src/guestfs-actions.pod:4440
12047 msgid "guestfs_mount"
12051 #: ../src/guestfs-actions.pod:4442
12055 " guestfs_mount (guestfs_h *g,\n"
12056 " const char *device,\n"
12057 " const char *mountpoint);\n"
12062 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:2975
12064 "Mount a guest disk at a position in the filesystem. Block devices are named "
12065 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12066 "those block devices contain partitions, they will have the usual names (eg. "
12067 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12071 #: ../src/guestfs-actions.pod:4453 ../fish/guestfish-actions.pod:2981
12073 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12074 "mounted on C</> before others can be mounted. Other filesystems can only be "
12075 "mounted on directories which already exist."
12079 #: ../src/guestfs-actions.pod:4458 ../fish/guestfish-actions.pod:2986
12081 "The mounted filesystem is writable, if we have sufficient permissions on the "
12082 "underlying device."
12086 #: ../src/guestfs-actions.pod:4461
12088 "B<Important note:> When you use this call, the filesystem options C<sync> "
12089 "and C<noatime> are set implicitly. This was originally done because we "
12090 "thought it would improve reliability, but it turns out that I<-o sync> has a "
12091 "very large negative performance impact and negligible effect on "
12092 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
12093 "in any code that needs performance, and instead use C<guestfs_mount_options> "
12094 "(use an empty string for the first parameter if you don't want any options)."
12098 #: ../src/guestfs-actions.pod:4475
12099 msgid "guestfs_mount_loop"
12103 #: ../src/guestfs-actions.pod:4477
12107 " guestfs_mount_loop (guestfs_h *g,\n"
12108 " const char *file,\n"
12109 " const char *mountpoint);\n"
12114 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3003
12116 "This command lets you mount C<file> (a filesystem image in a file) on a "
12117 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12122 #: ../src/guestfs-actions.pod:4490
12123 msgid "guestfs_mount_options"
12127 #: ../src/guestfs-actions.pod:4492
12131 " guestfs_mount_options (guestfs_h *g,\n"
12132 " const char *options,\n"
12133 " const char *device,\n"
12134 " const char *mountpoint);\n"
12139 #: ../src/guestfs-actions.pod:4498
12141 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12142 "the mount options as for the L<mount(8)> I<-o> flag."
12146 #: ../src/guestfs-actions.pod:4502 ../fish/guestfish-actions.pod:3015
12148 "If the C<options> parameter is an empty string, then no options are passed "
12149 "(all options default to whatever the filesystem uses)."
12153 #: ../src/guestfs-actions.pod:4508 ../src/guestfs-actions.pod:4522
12154 #: ../src/guestfs-actions.pod:4539
12155 msgid "(Added in 1.0.10)"
12159 #: ../src/guestfs-actions.pod:4510
12160 msgid "guestfs_mount_ro"
12164 #: ../src/guestfs-actions.pod:4512
12168 " guestfs_mount_ro (guestfs_h *g,\n"
12169 " const char *device,\n"
12170 " const char *mountpoint);\n"
12175 #: ../src/guestfs-actions.pod:4517
12177 "This is the same as the C<guestfs_mount> command, but it mounts the "
12178 "filesystem with the read-only (I<-o ro>) flag."
12182 #: ../src/guestfs-actions.pod:4524
12183 msgid "guestfs_mount_vfs"
12187 #: ../src/guestfs-actions.pod:4526
12191 " guestfs_mount_vfs (guestfs_h *g,\n"
12192 " const char *options,\n"
12193 " const char *vfstype,\n"
12194 " const char *device,\n"
12195 " const char *mountpoint);\n"
12200 #: ../src/guestfs-actions.pod:4533
12202 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12203 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
12208 #: ../src/guestfs-actions.pod:4541
12209 msgid "guestfs_mountpoints"
12213 #: ../src/guestfs-actions.pod:4543
12217 " guestfs_mountpoints (guestfs_h *g);\n"
12222 #: ../src/guestfs-actions.pod:4546
12224 "This call is similar to C<guestfs_mounts>. That call returns a list of "
12225 "devices. This one returns a hash table (map) of device name to directory "
12226 "where the device is mounted."
12230 #: ../src/guestfs-actions.pod:4558
12231 msgid "guestfs_mounts"
12235 #: ../src/guestfs-actions.pod:4560
12239 " guestfs_mounts (guestfs_h *g);\n"
12244 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3046
12246 "This returns the list of currently mounted filesystems. It returns the list "
12247 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12251 #: ../src/guestfs-actions.pod:4566 ../fish/guestfish-actions.pod:3049
12252 msgid "Some internal mounts are not shown."
12256 #: ../src/guestfs-actions.pod:4568
12257 msgid "See also: C<guestfs_mountpoints>"
12261 #: ../src/guestfs-actions.pod:4576
12266 #: ../src/guestfs-actions.pod:4578
12270 " guestfs_mv (guestfs_h *g,\n"
12271 " const char *src,\n"
12272 " const char *dest);\n"
12277 #: ../src/guestfs-actions.pod:4583 ../fish/guestfish-actions.pod:3057
12279 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12280 "destination filename or destination directory."
12284 #: ../src/guestfs-actions.pod:4590
12285 msgid "guestfs_ntfs_3g_probe"
12289 #: ../src/guestfs-actions.pod:4592
12293 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
12295 " const char *device);\n"
12300 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3064
12302 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12303 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12304 "write, and some cannot be mounted at all)."
12308 #: ../src/guestfs-actions.pod:4601 ../fish/guestfish-actions.pod:3068
12310 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12311 "can be mounted read-write. Set it to false if you want to test if the "
12312 "volume can be mounted read-only."
12316 #: ../src/guestfs-actions.pod:4605 ../fish/guestfish-actions.pod:3072
12318 "The return value is an integer which C<0> if the operation would succeed, or "
12319 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12323 #: ../src/guestfs-actions.pod:4611
12324 msgid "(Added in 1.0.43)"
12328 #: ../src/guestfs-actions.pod:4613
12329 msgid "guestfs_ntfsresize"
12333 #: ../src/guestfs-actions.pod:4615
12337 " guestfs_ntfsresize (guestfs_h *g,\n"
12338 " const char *device);\n"
12343 #: ../src/guestfs-actions.pod:4619 ../fish/guestfish-actions.pod:3080
12345 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12346 "size of the underlying device. See also L<ntfsresize(8)>."
12350 #: ../src/guestfs-actions.pod:4627
12351 msgid "guestfs_ntfsresize_size"
12355 #: ../src/guestfs-actions.pod:4629
12359 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12360 " const char *device,\n"
12361 " int64_t size);\n"
12366 #: ../src/guestfs-actions.pod:4634
12368 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12369 "to specify the new size (in bytes) explicitly."
12373 #: ../src/guestfs-actions.pod:4639 ../src/guestfs-actions.pod:5075
12374 #: ../src/guestfs-actions.pod:5148 ../src/guestfs-actions.pod:5397
12375 msgid "(Added in 1.3.14)"
12379 #: ../src/guestfs-actions.pod:4641
12380 msgid "guestfs_part_add"
12384 #: ../src/guestfs-actions.pod:4643
12388 " guestfs_part_add (guestfs_h *g,\n"
12389 " const char *device,\n"
12390 " const char *prlogex,\n"
12391 " int64_t startsect,\n"
12392 " int64_t endsect);\n"
12397 #: ../src/guestfs-actions.pod:4650
12399 "This command adds a partition to C<device>. If there is no partition table "
12400 "on the device, call C<guestfs_part_init> first."
12404 #: ../src/guestfs-actions.pod:4653 ../fish/guestfish-actions.pod:3098
12406 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12407 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12408 "C<logical>) and C<e> (or C<extended>) partition types."
12412 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3103
12414 "C<startsect> and C<endsect> are the start and end of the partition in "
12415 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12416 "from the end of the disk (C<-1> is the last sector)."
12420 #: ../src/guestfs-actions.pod:4662
12422 "Creating a partition which covers the whole disk is not so easy. Use "
12423 "C<guestfs_part_disk> to do that."
12427 #: ../src/guestfs-actions.pod:4667 ../src/guestfs-actions.pod:4705
12428 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4836
12429 #: ../src/guestfs-actions.pod:4874 ../src/guestfs-actions.pod:4893
12430 #: ../src/guestfs-actions.pod:4933
12431 msgid "(Added in 1.0.78)"
12435 #: ../src/guestfs-actions.pod:4669
12436 msgid "guestfs_part_del"
12440 #: ../src/guestfs-actions.pod:4671
12444 " guestfs_part_del (guestfs_h *g,\n"
12445 " const char *device,\n"
12451 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3114
12452 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12456 #: ../src/guestfs-actions.pod:4678 ../fish/guestfish-actions.pod:3116
12458 "Note that in the case of MBR partitioning, deleting an extended partition "
12459 "also deletes any logical partitions it contains."
12463 #: ../src/guestfs-actions.pod:4686
12464 msgid "guestfs_part_disk"
12468 #: ../src/guestfs-actions.pod:4688
12472 " guestfs_part_disk (guestfs_h *g,\n"
12473 " const char *device,\n"
12474 " const char *parttype);\n"
12479 #: ../src/guestfs-actions.pod:4693
12481 "This command is simply a combination of C<guestfs_part_init> followed by "
12482 "C<guestfs_part_add> to create a single primary partition covering the whole "
12487 #: ../src/guestfs-actions.pod:4697
12489 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12490 "possible values are described in C<guestfs_part_init>."
12494 #: ../src/guestfs-actions.pod:4707
12495 msgid "guestfs_part_get_bootable"
12499 #: ../src/guestfs-actions.pod:4709
12503 " guestfs_part_get_bootable (guestfs_h *g,\n"
12504 " const char *device,\n"
12510 #: ../src/guestfs-actions.pod:4714 ../fish/guestfish-actions.pod:3138
12512 "This command returns true if the partition C<partnum> on C<device> has the "
12513 "bootable flag set."
12517 #: ../src/guestfs-actions.pod:4717
12518 msgid "See also C<guestfs_part_set_bootable>."
12522 #: ../src/guestfs-actions.pod:4723
12523 msgid "guestfs_part_get_mbr_id"
12527 #: ../src/guestfs-actions.pod:4725
12531 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12532 " const char *device,\n"
12538 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3147
12540 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12541 "partition C<partnum>."
12545 #: ../src/guestfs-actions.pod:4733 ../src/guestfs-actions.pod:4909
12547 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12548 "undefined results for other partition table types (see "
12549 "C<guestfs_part_get_parttype>)."
12553 #: ../src/guestfs-actions.pod:4741
12554 msgid "guestfs_part_get_parttype"
12558 #: ../src/guestfs-actions.pod:4743
12562 " guestfs_part_get_parttype (guestfs_h *g,\n"
12563 " const char *device);\n"
12568 #: ../src/guestfs-actions.pod:4747 ../fish/guestfish-actions.pod:3158
12570 "This command examines the partition table on C<device> and returns the "
12571 "partition table type (format) being used."
12575 #: ../src/guestfs-actions.pod:4750
12577 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12578 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12579 "possible, although unusual. See C<guestfs_part_init> for a full list."
12583 #: ../src/guestfs-actions.pod:4760
12584 msgid "guestfs_part_init"
12588 #: ../src/guestfs-actions.pod:4762
12592 " guestfs_part_init (guestfs_h *g,\n"
12593 " const char *device,\n"
12594 " const char *parttype);\n"
12599 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3170
12601 "This creates an empty partition table on C<device> of one of the partition "
12602 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12603 "(for large disks)."
12607 #: ../src/guestfs-actions.pod:4771
12609 "Initially there are no partitions. Following this, you should call "
12610 "C<guestfs_part_add> for each partition required."
12614 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3177
12615 msgid "Possible values for C<parttype> are:"
12619 #: ../src/guestfs-actions.pod:4778 ../fish/guestfish-actions.pod:3181
12620 msgid "B<efi> | B<gpt>"
12624 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3183
12625 msgid "Intel EFI / GPT partition table."
12629 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3185
12631 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12632 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12633 "the C<mbr> format."
12637 #: ../src/guestfs-actions.pod:4786 ../fish/guestfish-actions.pod:3189
12638 msgid "B<mbr> | B<msdos>"
12642 #: ../src/guestfs-actions.pod:4788 ../fish/guestfish-actions.pod:3191
12644 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12645 "Windows. This partition type will B<only> work for device sizes up to 2 "
12646 "TB. For large disks we recommend using C<gpt>."
12650 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3198
12652 "Other partition table types that may work but are not supported include:"
12656 #: ../src/guestfs-actions.pod:4800 ../fish/guestfish-actions.pod:3203
12661 #: ../src/guestfs-actions.pod:4802 ../fish/guestfish-actions.pod:3205
12662 msgid "AIX disk labels."
12666 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3207
12667 msgid "B<amiga> | B<rdb>"
12671 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3209
12672 msgid "Amiga \"Rigid Disk Block\" format."
12676 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3211
12681 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3213
12682 msgid "BSD disk labels."
12686 #: ../src/guestfs-actions.pod:4812 ../fish/guestfish-actions.pod:3215
12691 #: ../src/guestfs-actions.pod:4814 ../fish/guestfish-actions.pod:3217
12692 msgid "DASD, used on IBM mainframes."
12696 #: ../src/guestfs-actions.pod:4816 ../fish/guestfish-actions.pod:3219
12701 #: ../src/guestfs-actions.pod:4818 ../fish/guestfish-actions.pod:3221
12702 msgid "MIPS/SGI volumes."
12706 #: ../src/guestfs-actions.pod:4820 ../fish/guestfish-actions.pod:3223
12711 #: ../src/guestfs-actions.pod:4822 ../fish/guestfish-actions.pod:3225
12712 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12716 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3227
12721 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3229
12722 msgid "NEC PC-98 format, common in Japan apparently."
12726 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3231
12731 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3233
12732 msgid "Sun disk labels."
12736 #: ../src/guestfs-actions.pod:4838
12737 msgid "guestfs_part_list"
12741 #: ../src/guestfs-actions.pod:4840
12744 " struct guestfs_partition_list *\n"
12745 " guestfs_part_list (guestfs_h *g,\n"
12746 " const char *device);\n"
12751 #: ../src/guestfs-actions.pod:4844 ../fish/guestfish-actions.pod:3241
12753 "This command parses the partition table on C<device> and returns the list of "
12754 "partitions found."
12758 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3244
12759 msgid "The fields in the returned structure are:"
12763 #: ../src/guestfs-actions.pod:4851 ../fish/guestfish-actions.pod:3248
12764 msgid "B<part_num>"
12768 #: ../src/guestfs-actions.pod:4853 ../fish/guestfish-actions.pod:3250
12769 msgid "Partition number, counting from 1."
12773 #: ../src/guestfs-actions.pod:4855 ../fish/guestfish-actions.pod:3252
12774 msgid "B<part_start>"
12778 #: ../src/guestfs-actions.pod:4857
12780 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12781 "the device's sector size, see C<guestfs_blockdev_getss>."
12785 #: ../src/guestfs-actions.pod:4860 ../fish/guestfish-actions.pod:3257
12786 msgid "B<part_end>"
12790 #: ../src/guestfs-actions.pod:4862 ../fish/guestfish-actions.pod:3259
12791 msgid "End of the partition in bytes."
12795 #: ../src/guestfs-actions.pod:4864 ../fish/guestfish-actions.pod:3261
12796 msgid "B<part_size>"
12800 #: ../src/guestfs-actions.pod:4866 ../fish/guestfish-actions.pod:3263
12801 msgid "Size of the partition in bytes."
12805 #: ../src/guestfs-actions.pod:4870
12807 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12808 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12813 #: ../src/guestfs-actions.pod:4876
12814 msgid "guestfs_part_set_bootable"
12818 #: ../src/guestfs-actions.pod:4878
12822 " guestfs_part_set_bootable (guestfs_h *g,\n"
12823 " const char *device,\n"
12825 " int bootable);\n"
12830 #: ../src/guestfs-actions.pod:4884 ../fish/guestfish-actions.pod:3271
12832 "This sets the bootable flag on partition numbered C<partnum> on device "
12833 "C<device>. Note that partitions are numbered from 1."
12837 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3274
12839 "The bootable flag is used by some operating systems (notably Windows) to "
12840 "determine which partition to boot from. It is by no means universally "
12845 #: ../src/guestfs-actions.pod:4895
12846 msgid "guestfs_part_set_mbr_id"
12850 #: ../src/guestfs-actions.pod:4897
12854 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12855 " const char *device,\n"
12862 #: ../src/guestfs-actions.pod:4903 ../fish/guestfish-actions.pod:3282
12864 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12865 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12866 "documentation are in fact hexadecimal numbers, but usually documented "
12867 "without any leading \"0x\" which might be confusing."
12871 #: ../src/guestfs-actions.pod:4917
12872 msgid "guestfs_part_set_name"
12876 #: ../src/guestfs-actions.pod:4919
12880 " guestfs_part_set_name (guestfs_h *g,\n"
12881 " const char *device,\n"
12883 " const char *name);\n"
12888 #: ../src/guestfs-actions.pod:4925 ../fish/guestfish-actions.pod:3296
12890 "This sets the partition name on partition numbered C<partnum> on device "
12891 "C<device>. Note that partitions are numbered from 1."
12895 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3299
12897 "The partition name can only be set on certain types of partition table. "
12898 "This works on C<gpt> but not on C<mbr> partitions."
12902 #: ../src/guestfs-actions.pod:4935
12903 msgid "guestfs_part_to_dev"
12907 #: ../src/guestfs-actions.pod:4937
12911 " guestfs_part_to_dev (guestfs_h *g,\n"
12912 " const char *partition);\n"
12917 #: ../src/guestfs-actions.pod:4941 ../fish/guestfish-actions.pod:3306
12919 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12920 "partition number, returning the device name (eg. \"/dev/sdb\")."
12924 #: ../src/guestfs-actions.pod:4945
12926 "The named partition must exist, for example as a string returned from "
12927 "C<guestfs_list_partitions>."
12931 #: ../src/guestfs-actions.pod:4953
12932 msgid "guestfs_ping_daemon"
12936 #: ../src/guestfs-actions.pod:4955
12940 " guestfs_ping_daemon (guestfs_h *g);\n"
12945 #: ../src/guestfs-actions.pod:4958 ../fish/guestfish-actions.pod:3317
12947 "This is a test probe into the guestfs daemon running inside the qemu "
12948 "subprocess. Calling this function checks that the daemon responds to the "
12949 "ping message, without affecting the daemon or attached block device(s) in "
12954 #: ../src/guestfs-actions.pod:4967
12955 msgid "guestfs_pread"
12959 #: ../src/guestfs-actions.pod:4969
12963 " guestfs_pread (guestfs_h *g,\n"
12964 " const char *path,\n"
12966 " int64_t offset,\n"
12967 " size_t *size_r);\n"
12972 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3326
12974 "This command lets you read part of a file. It reads C<count> bytes of the "
12975 "file, starting at C<offset>, from file C<path>."
12979 #: ../src/guestfs-actions.pod:4979 ../src/guestfs-actions.pod:5005
12980 #: ../fish/guestfish-actions.pod:3329 ../fish/guestfish-actions.pod:3344
12982 "This may read fewer bytes than requested. For further details see the "
12983 "L<pread(2)> system call."
12987 #: ../src/guestfs-actions.pod:4982
12988 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12992 #: ../src/guestfs-actions.pod:4993
12993 msgid "guestfs_pread_device"
12997 #: ../src/guestfs-actions.pod:4995
13001 " guestfs_pread_device (guestfs_h *g,\n"
13002 " const char *device,\n"
13004 " int64_t offset,\n"
13005 " size_t *size_r);\n"
13010 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3341
13012 "This command lets you read part of a file. It reads C<count> bytes of "
13013 "C<device>, starting at C<offset>."
13017 #: ../src/guestfs-actions.pod:5008
13018 msgid "See also C<guestfs_pread>."
13022 #: ../src/guestfs-actions.pod:5017
13023 msgid "(Added in 1.5.21)"
13027 #: ../src/guestfs-actions.pod:5019
13028 msgid "guestfs_pvcreate"
13032 #: ../src/guestfs-actions.pod:5021
13036 " guestfs_pvcreate (guestfs_h *g,\n"
13037 " const char *device);\n"
13042 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3356
13044 "This creates an LVM physical volume on the named C<device>, where C<device> "
13045 "should usually be a partition name such as C</dev/sda1>."
13049 #: ../src/guestfs-actions.pod:5033
13050 msgid "guestfs_pvremove"
13054 #: ../src/guestfs-actions.pod:5035
13058 " guestfs_pvremove (guestfs_h *g,\n"
13059 " const char *device);\n"
13064 #: ../src/guestfs-actions.pod:5039 ../fish/guestfish-actions.pod:3364
13066 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13071 #: ../src/guestfs-actions.pod:5042 ../fish/guestfish-actions.pod:3367
13073 "The implementation uses the C<pvremove> command which refuses to wipe "
13074 "physical volumes that contain any volume groups, so you have to remove those "
13079 #: ../src/guestfs-actions.pod:5050
13080 msgid "guestfs_pvresize"
13084 #: ../src/guestfs-actions.pod:5052
13088 " guestfs_pvresize (guestfs_h *g,\n"
13089 " const char *device);\n"
13094 #: ../src/guestfs-actions.pod:5056 ../fish/guestfish-actions.pod:3375
13096 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13097 "the new size of the underlying device."
13101 #: ../src/guestfs-actions.pod:5063
13102 msgid "guestfs_pvresize_size"
13106 #: ../src/guestfs-actions.pod:5065
13110 " guestfs_pvresize_size (guestfs_h *g,\n"
13111 " const char *device,\n"
13112 " int64_t size);\n"
13117 #: ../src/guestfs-actions.pod:5070
13119 "This command is the same as C<guestfs_pvresize> except that it allows you to "
13120 "specify the new size (in bytes) explicitly."
13124 #: ../src/guestfs-actions.pod:5077
13125 msgid "guestfs_pvs"
13129 #: ../src/guestfs-actions.pod:5079
13133 " guestfs_pvs (guestfs_h *g);\n"
13138 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3389
13140 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13145 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3392
13147 "This returns a list of just the device names that contain PVs (eg. C</dev/"
13152 #: ../src/guestfs-actions.pod:5088
13153 msgid "See also C<guestfs_pvs_full>."
13157 #: ../src/guestfs-actions.pod:5096
13158 msgid "guestfs_pvs_full"
13162 #: ../src/guestfs-actions.pod:5098
13165 " struct guestfs_lvm_pv_list *\n"
13166 " guestfs_pvs_full (guestfs_h *g);\n"
13171 #: ../src/guestfs-actions.pod:5101 ../fish/guestfish-actions.pod:3401
13173 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13174 "(8)> command. The \"full\" version includes all fields."
13178 #: ../src/guestfs-actions.pod:5104
13180 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
13181 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
13185 #: ../src/guestfs-actions.pod:5110
13186 msgid "guestfs_pvuuid"
13190 #: ../src/guestfs-actions.pod:5112
13194 " guestfs_pvuuid (guestfs_h *g,\n"
13195 " const char *device);\n"
13200 #: ../src/guestfs-actions.pod:5116 ../fish/guestfish-actions.pod:3408
13201 msgid "This command returns the UUID of the LVM PV C<device>."
13205 #: ../src/guestfs-actions.pod:5123
13206 msgid "guestfs_pwrite"
13210 #: ../src/guestfs-actions.pod:5125
13214 " guestfs_pwrite (guestfs_h *g,\n"
13215 " const char *path,\n"
13216 " const char *content,\n"
13217 " size_t content_size,\n"
13218 " int64_t offset);\n"
13223 #: ../src/guestfs-actions.pod:5132 ../fish/guestfish-actions.pod:3414
13225 "This command writes to part of a file. It writes the data buffer C<content> "
13226 "to the file C<path> starting at offset C<offset>."
13230 #: ../src/guestfs-actions.pod:5135 ../fish/guestfish-actions.pod:3417
13232 "This command implements the L<pwrite(2)> system call, and like that system "
13233 "call it may not write the full data requested. The return value is the "
13234 "number of bytes that were actually written to the file. This could even be "
13235 "0, although short writes are unlikely for regular files in ordinary "
13240 #: ../src/guestfs-actions.pod:5141
13241 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
13245 #: ../src/guestfs-actions.pod:5150
13246 msgid "guestfs_pwrite_device"
13250 #: ../src/guestfs-actions.pod:5152
13254 " guestfs_pwrite_device (guestfs_h *g,\n"
13255 " const char *device,\n"
13256 " const char *content,\n"
13257 " size_t content_size,\n"
13258 " int64_t offset);\n"
13263 #: ../src/guestfs-actions.pod:5159 ../fish/guestfish-actions.pod:3432
13265 "This command writes to part of a device. It writes the data buffer "
13266 "C<content> to C<device> starting at offset C<offset>."
13270 #: ../src/guestfs-actions.pod:5162 ../fish/guestfish-actions.pod:3435
13272 "This command implements the L<pwrite(2)> system call, and like that system "
13273 "call it may not write the full data requested (although short writes to disk "
13274 "devices and partitions are probably impossible with standard Linux kernels)."
13278 #: ../src/guestfs-actions.pod:5167
13279 msgid "See also C<guestfs_pwrite>."
13283 #: ../src/guestfs-actions.pod:5174
13284 msgid "(Added in 1.5.20)"
13288 #: ../src/guestfs-actions.pod:5176
13289 msgid "guestfs_read_file"
13293 #: ../src/guestfs-actions.pod:5178
13297 " guestfs_read_file (guestfs_h *g,\n"
13298 " const char *path,\n"
13299 " size_t *size_r);\n"
13304 #: ../src/guestfs-actions.pod:5183 ../fish/guestfish-actions.pod:3449
13305 msgid "This calls returns the contents of the file C<path> as a buffer."
13309 #: ../src/guestfs-actions.pod:5186
13311 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
13312 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
13313 "function is limited in the total size of file that can be handled."
13317 #: ../src/guestfs-actions.pod:5198
13318 msgid "(Added in 1.0.63)"
13322 #: ../src/guestfs-actions.pod:5200
13323 msgid "guestfs_read_lines"
13327 #: ../src/guestfs-actions.pod:5202
13331 " guestfs_read_lines (guestfs_h *g,\n"
13332 " const char *path);\n"
13337 #: ../src/guestfs-actions.pod:5208 ../fish/guestfish-actions.pod:3466
13339 "The file contents are returned as a list of lines. Trailing C<LF> and "
13340 "C<CRLF> character sequences are I<not> returned."
13344 #: ../src/guestfs-actions.pod:5211
13346 "Note that this function cannot correctly handle binary files (specifically, "
13347 "files containing C<\\0> character which is treated as end of line). For "
13348 "those you need to use the C<guestfs_read_file> function which has a more "
13349 "complex interface."
13353 #: ../src/guestfs-actions.pod:5222
13354 msgid "guestfs_readdir"
13358 #: ../src/guestfs-actions.pod:5224
13361 " struct guestfs_dirent_list *\n"
13362 " guestfs_readdir (guestfs_h *g,\n"
13363 " const char *dir);\n"
13368 #: ../src/guestfs-actions.pod:5228 ../fish/guestfish-actions.pod:3478
13369 msgid "This returns the list of directory entries in directory C<dir>."
13373 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:3480
13375 "All entries in the directory are returned, including C<.> and C<..>. The "
13376 "entries are I<not> sorted, but returned in the same order as the underlying "
13381 #: ../src/guestfs-actions.pod:5234 ../fish/guestfish-actions.pod:3484
13383 "Also this call returns basic file type information about each file. The "
13384 "C<ftyp> field will contain one of the following characters:"
13388 #: ../src/guestfs-actions.pod:5239 ../fish/guestfish-actions.pod:3489
13393 #: ../src/guestfs-actions.pod:5241 ../fish/guestfish-actions.pod:3491
13394 msgid "Block special"
13398 #: ../src/guestfs-actions.pod:5243 ../fish/guestfish-actions.pod:3493
13403 #: ../src/guestfs-actions.pod:5245 ../fish/guestfish-actions.pod:3495
13404 msgid "Char special"
13408 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:3497
13413 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:3499
13418 #: ../src/guestfs-actions.pod:5251 ../fish/guestfish-actions.pod:3501
13423 #: ../src/guestfs-actions.pod:5253 ../fish/guestfish-actions.pod:3503
13424 msgid "FIFO (named pipe)"
13428 #: ../src/guestfs-actions.pod:5255 ../fish/guestfish-actions.pod:3505
13433 #: ../src/guestfs-actions.pod:5257 ../fish/guestfish-actions.pod:3507
13434 msgid "Symbolic link"
13438 #: ../src/guestfs-actions.pod:5259 ../fish/guestfish-actions.pod:3509
13443 #: ../src/guestfs-actions.pod:5261 ../fish/guestfish-actions.pod:3511
13444 msgid "Regular file"
13448 #: ../src/guestfs-actions.pod:5263 ../fish/guestfish-actions.pod:3513
13453 #: ../src/guestfs-actions.pod:5265 ../fish/guestfish-actions.pod:3515
13458 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3517
13463 #: ../src/guestfs-actions.pod:5269 ../fish/guestfish-actions.pod:3519
13464 msgid "Unknown file type"
13468 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:3521
13473 #: ../src/guestfs-actions.pod:5273 ../fish/guestfish-actions.pod:3523
13475 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13479 #: ../src/guestfs-actions.pod:5278
13481 "This function is primarily intended for use by programs. To get a simple "
13482 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13483 "consumption, use C<guestfs_ll>."
13487 #: ../src/guestfs-actions.pod:5282
13489 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13490 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13494 #: ../src/guestfs-actions.pod:5288
13495 msgid "guestfs_readlink"
13499 #: ../src/guestfs-actions.pod:5290
13503 " guestfs_readlink (guestfs_h *g,\n"
13504 " const char *path);\n"
13509 #: ../src/guestfs-actions.pod:5294 ../fish/guestfish-actions.pod:3536
13510 msgid "This command reads the target of a symbolic link."
13514 #: ../src/guestfs-actions.pod:5301
13515 msgid "guestfs_readlinklist"
13519 #: ../src/guestfs-actions.pod:5303
13523 " guestfs_readlinklist (guestfs_h *g,\n"
13524 " const char *path,\n"
13525 " char *const *names);\n"
13530 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:3542
13532 "This call allows you to do a C<readlink> operation on multiple files, where "
13533 "all files are in the directory C<path>. C<names> is the list of files from "
13538 #: ../src/guestfs-actions.pod:5312 ../fish/guestfish-actions.pod:3546
13540 "On return you get a list of strings, with a one-to-one correspondence to the "
13541 "C<names> list. Each string is the value of the symbolic link."
13545 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3550
13547 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13548 "result string is the empty string C<\"\">. However the whole operation is "
13549 "completed even if there were C<readlink(2)> errors, and so you can call this "
13550 "function with names where you don't know if they are symbolic links already "
13551 "(albeit slightly less efficient)."
13555 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:3557
13557 "This call is intended for programs that want to efficiently list a directory "
13558 "contents without making many round-trips. Very long directory listings "
13559 "might cause the protocol message size to be exceeded, causing this call to "
13560 "fail. The caller must split up such requests into smaller groups of names."
13564 #: ../src/guestfs-actions.pod:5336
13565 msgid "guestfs_realpath"
13569 #: ../src/guestfs-actions.pod:5338
13573 " guestfs_realpath (guestfs_h *g,\n"
13574 " const char *path);\n"
13579 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3568
13581 "Return the canonicalized absolute pathname of C<path>. The returned path "
13582 "has no C<.>, C<..> or symbolic link path elements."
13586 #: ../src/guestfs-actions.pod:5350
13587 msgid "guestfs_removexattr"
13591 #: ../src/guestfs-actions.pod:5352
13595 " guestfs_removexattr (guestfs_h *g,\n"
13596 " const char *xattr,\n"
13597 " const char *path);\n"
13602 #: ../src/guestfs-actions.pod:5357 ../fish/guestfish-actions.pod:3575
13604 "This call removes the extended attribute named C<xattr> of the file C<path>."
13608 #: ../src/guestfs-actions.pod:5360
13609 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13613 #: ../src/guestfs-actions.pod:5366
13614 msgid "guestfs_resize2fs"
13618 #: ../src/guestfs-actions.pod:5368
13622 " guestfs_resize2fs (guestfs_h *g,\n"
13623 " const char *device);\n"
13628 #: ../src/guestfs-actions.pod:5372 ../fish/guestfish-actions.pod:3584
13630 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13631 "underlying device."
13635 #: ../src/guestfs-actions.pod:5375
13637 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13638 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13639 "sometimes gives an error about this and sometimes not. In any case, it is "
13640 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13644 #: ../src/guestfs-actions.pod:5385
13645 msgid "guestfs_resize2fs_size"
13649 #: ../src/guestfs-actions.pod:5387
13653 " guestfs_resize2fs_size (guestfs_h *g,\n"
13654 " const char *device,\n"
13655 " int64_t size);\n"
13660 #: ../src/guestfs-actions.pod:5392
13662 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13663 "to specify the new size (in bytes) explicitly."
13667 #: ../src/guestfs-actions.pod:5399
13672 #: ../src/guestfs-actions.pod:5401
13676 " guestfs_rm (guestfs_h *g,\n"
13677 " const char *path);\n"
13682 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:3604
13683 msgid "Remove the single file C<path>."
13687 #: ../src/guestfs-actions.pod:5411
13688 msgid "guestfs_rm_rf"
13692 #: ../src/guestfs-actions.pod:5413
13696 " guestfs_rm_rf (guestfs_h *g,\n"
13697 " const char *path);\n"
13702 #: ../src/guestfs-actions.pod:5417 ../fish/guestfish-actions.pod:3610
13704 "Remove the file or directory C<path>, recursively removing the contents if "
13705 "its a directory. This is like the C<rm -rf> shell command."
13709 #: ../src/guestfs-actions.pod:5425
13710 msgid "guestfs_rmdir"
13714 #: ../src/guestfs-actions.pod:5427
13718 " guestfs_rmdir (guestfs_h *g,\n"
13719 " const char *path);\n"
13724 #: ../src/guestfs-actions.pod:5431 ../fish/guestfish-actions.pod:3618
13725 msgid "Remove the single directory C<path>."
13729 #: ../src/guestfs-actions.pod:5437
13730 msgid "guestfs_rmmountpoint"
13734 #: ../src/guestfs-actions.pod:5439
13738 " guestfs_rmmountpoint (guestfs_h *g,\n"
13739 " const char *exemptpath);\n"
13744 #: ../src/guestfs-actions.pod:5443
13746 "This calls removes a mountpoint that was previously created with "
13747 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13751 #: ../src/guestfs-actions.pod:5451
13752 msgid "guestfs_scrub_device"
13756 #: ../src/guestfs-actions.pod:5453
13760 " guestfs_scrub_device (guestfs_h *g,\n"
13761 " const char *device);\n"
13766 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3632
13768 "This command writes patterns over C<device> to make data retrieval more "
13773 #: ../src/guestfs-actions.pod:5460 ../src/guestfs-actions.pod:5481
13774 #: ../src/guestfs-actions.pod:5500 ../fish/guestfish-actions.pod:3635
13775 #: ../fish/guestfish-actions.pod:3650 ../fish/guestfish-actions.pod:3663
13777 "It is an interface to the L<scrub(1)> program. See that manual page for "
13782 #: ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5486
13783 #: ../src/guestfs-actions.pod:5505
13784 msgid "(Added in 1.0.52)"
13788 #: ../src/guestfs-actions.pod:5470
13789 msgid "guestfs_scrub_file"
13793 #: ../src/guestfs-actions.pod:5472
13797 " guestfs_scrub_file (guestfs_h *g,\n"
13798 " const char *file);\n"
13803 #: ../src/guestfs-actions.pod:5476 ../fish/guestfish-actions.pod:3645
13805 "This command writes patterns over a file to make data retrieval more "
13810 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:3648
13811 msgid "The file is I<removed> after scrubbing."
13815 #: ../src/guestfs-actions.pod:5488
13816 msgid "guestfs_scrub_freespace"
13820 #: ../src/guestfs-actions.pod:5490
13824 " guestfs_scrub_freespace (guestfs_h *g,\n"
13825 " const char *dir);\n"
13830 #: ../src/guestfs-actions.pod:5494
13832 "This command creates the directory C<dir> and then fills it with files until "
13833 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13834 "and deletes them. The intention is to scrub any free space on the partition "
13835 "containing C<dir>."
13839 #: ../src/guestfs-actions.pod:5507
13840 msgid "guestfs_set_append"
13844 #: ../src/guestfs-actions.pod:5509
13848 " guestfs_set_append (guestfs_h *g,\n"
13849 " const char *append);\n"
13854 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3672
13856 "This function is used to add additional options to the guest kernel command "
13861 #: ../src/guestfs-actions.pod:5516 ../fish/guestfish-actions.pod:3675
13863 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13864 "environment variable."
13868 #: ../src/guestfs-actions.pod:5519 ../fish/guestfish-actions.pod:3678
13870 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13871 "(libguestfs always adds a few of its own)."
13875 #: ../src/guestfs-actions.pod:5526
13876 msgid "guestfs_set_autosync"
13880 #: ../src/guestfs-actions.pod:5528
13884 " guestfs_set_autosync (guestfs_h *g,\n"
13885 " int autosync);\n"
13890 #: ../src/guestfs-actions.pod:5532
13892 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13893 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13894 "the handle is closed (also if the program exits without closing handles)."
13898 #: ../src/guestfs-actions.pod:5537 ../fish/guestfish-actions.pod:3692
13900 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13901 "disabled by default)."
13905 #: ../src/guestfs-actions.pod:5544
13906 msgid "guestfs_set_direct"
13910 #: ../src/guestfs-actions.pod:5546
13914 " guestfs_set_direct (guestfs_h *g,\n"
13920 #: ../src/guestfs-actions.pod:5550 ../fish/guestfish-actions.pod:3701
13922 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13923 "passed directly through to the appliance once it is launched."
13927 #: ../src/guestfs-actions.pod:5554
13929 "One consequence of this is that log messages aren't caught by the library "
13930 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13935 #: ../src/guestfs-actions.pod:5558 ../fish/guestfish-actions.pod:3709
13936 msgid "You probably don't want to use this unless you know what you are doing."
13940 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:3712
13941 msgid "The default is disabled."
13945 #: ../src/guestfs-actions.pod:5567
13946 msgid "guestfs_set_e2label"
13950 #: ../src/guestfs-actions.pod:5569
13954 " guestfs_set_e2label (guestfs_h *g,\n"
13955 " const char *device,\n"
13956 " const char *label);\n"
13961 #: ../src/guestfs-actions.pod:5574 ../fish/guestfish-actions.pod:3718
13963 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13964 "C<label>. Filesystem labels are limited to 16 characters."
13968 #: ../src/guestfs-actions.pod:5578
13970 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13971 "the existing label on a filesystem."
13975 #: ../src/guestfs-actions.pod:5585
13976 msgid "guestfs_set_e2uuid"
13980 #: ../src/guestfs-actions.pod:5587
13984 " guestfs_set_e2uuid (guestfs_h *g,\n"
13985 " const char *device,\n"
13986 " const char *uuid);\n"
13991 #: ../src/guestfs-actions.pod:5592 ../fish/guestfish-actions.pod:3729
13993 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13994 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13995 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13999 #: ../src/guestfs-actions.pod:5597
14001 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
14002 "the existing UUID of a filesystem."
14006 #: ../src/guestfs-actions.pod:5604
14007 msgid "guestfs_set_memsize"
14011 #: ../src/guestfs-actions.pod:5606
14015 " guestfs_set_memsize (guestfs_h *g,\n"
14021 #: ../src/guestfs-actions.pod:5610
14023 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14024 "This only has any effect if called before C<guestfs_launch>."
14028 #: ../src/guestfs-actions.pod:5614 ../fish/guestfish-actions.pod:3747
14030 "You can also change this by setting the environment variable "
14031 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14035 #: ../src/guestfs-actions.pod:5625
14036 msgid "guestfs_set_network"
14040 #: ../src/guestfs-actions.pod:5627
14044 " guestfs_set_network (guestfs_h *g,\n"
14050 #: ../src/guestfs-actions.pod:5631 ../fish/guestfish-actions.pod:3760
14052 "If C<network> is true, then the network is enabled in the libguestfs "
14053 "appliance. The default is false."
14057 #: ../src/guestfs-actions.pod:5634 ../fish/guestfish-actions.pod:3763
14059 "This affects whether commands are able to access the network (see L<guestfs"
14060 "(3)/RUNNING COMMANDS>)."
14064 #: ../src/guestfs-actions.pod:5637
14066 "You must call this before calling C<guestfs_launch>, otherwise it has no "
14071 #: ../src/guestfs-actions.pod:5644
14072 msgid "guestfs_set_path"
14076 #: ../src/guestfs-actions.pod:5646
14080 " guestfs_set_path (guestfs_h *g,\n"
14081 " const char *searchpath);\n"
14086 #: ../src/guestfs-actions.pod:5650 ../fish/guestfish-actions.pod:3775
14087 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14091 #: ../src/guestfs-actions.pod:5652 ../fish/guestfish-actions.pod:3777
14093 "The default is C<$libdir/guestfs> unless overridden by setting "
14094 "C<LIBGUESTFS_PATH> environment variable."
14098 #: ../src/guestfs-actions.pod:5655 ../fish/guestfish-actions.pod:3780
14099 msgid "Setting C<path> to C<NULL> restores the default path."
14103 #: ../src/guestfs-actions.pod:5661
14104 msgid "guestfs_set_qemu"
14108 #: ../src/guestfs-actions.pod:5663
14112 " guestfs_set_qemu (guestfs_h *g,\n"
14113 " const char *qemu);\n"
14118 #: ../src/guestfs-actions.pod:5667 ../fish/guestfish-actions.pod:3788
14119 msgid "Set the qemu binary that we will use."
14123 #: ../src/guestfs-actions.pod:5669 ../fish/guestfish-actions.pod:3790
14125 "The default is chosen when the library was compiled by the configure script."
14129 #: ../src/guestfs-actions.pod:5672 ../fish/guestfish-actions.pod:3793
14131 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14136 #: ../src/guestfs-actions.pod:5675 ../fish/guestfish-actions.pod:3796
14137 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14141 #: ../src/guestfs-actions.pod:5677 ../fish/guestfish-actions.pod:3798
14143 "Note that you should call this function as early as possible after creating "
14144 "the handle. This is because some pre-launch operations depend on testing "
14145 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14146 "don't retest features, and so you might see inconsistent results. Using the "
14147 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14148 "the qemu binary at the same time as the handle is created."
14152 #: ../src/guestfs-actions.pod:5689
14153 msgid "guestfs_set_recovery_proc"
14157 #: ../src/guestfs-actions.pod:5691
14161 " guestfs_set_recovery_proc (guestfs_h *g,\n"
14162 " int recoveryproc);\n"
14167 #: ../src/guestfs-actions.pod:5695
14169 "If this is called with the parameter C<false> then C<guestfs_launch> does "
14170 "not create a recovery process. The purpose of the recovery process is to "
14171 "stop runaway qemu processes in the case where the main program aborts "
14176 #: ../src/guestfs-actions.pod:5700
14178 "This only has any effect if called before C<guestfs_launch>, and the default "
14183 #: ../src/guestfs-actions.pod:5703 ../fish/guestfish-actions.pod:3820
14185 "About the only time when you would want to disable this is if the main "
14186 "process will fork itself into the background (\"daemonize\" itself). In "
14187 "this case the recovery process thinks that the main program has disappeared "
14188 "and so kills qemu, which is not very helpful."
14192 #: ../src/guestfs-actions.pod:5713
14193 msgid "guestfs_set_selinux"
14197 #: ../src/guestfs-actions.pod:5715
14201 " guestfs_set_selinux (guestfs_h *g,\n"
14207 #: ../src/guestfs-actions.pod:5719 ../fish/guestfish-actions.pod:3832
14209 "This sets the selinux flag that is passed to the appliance at boot time. "
14210 "The default is C<selinux=0> (disabled)."
14214 #: ../src/guestfs-actions.pod:5722 ../fish/guestfish-actions.pod:3835
14216 "Note that if SELinux is enabled, it is always in Permissive mode "
14217 "(C<enforcing=0>)."
14221 #: ../src/guestfs-actions.pod:5732
14222 msgid "guestfs_set_trace"
14226 #: ../src/guestfs-actions.pod:5734
14230 " guestfs_set_trace (guestfs_h *g,\n"
14236 #: ../src/guestfs-actions.pod:5738 ../fish/guestfish-actions.pod:3847
14238 "If the command trace flag is set to 1, then commands are printed on stderr "
14239 "before they are executed in a format which is very similar to the one used "
14240 "by guestfish. In other words, you can run a program with this enabled, and "
14241 "you will get out a script which you can feed to guestfish to perform the "
14242 "same set of actions."
14246 #: ../src/guestfs-actions.pod:5745 ../fish/guestfish-actions.pod:3854
14248 "If you want to trace C API calls into libguestfs (and other libraries) then "
14249 "possibly a better way is to use the external ltrace(1) command."
14253 #: ../src/guestfs-actions.pod:5749 ../fish/guestfish-actions.pod:3858
14255 "Command traces are disabled unless the environment variable "
14256 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14260 #: ../src/guestfs-actions.pod:5756
14261 msgid "guestfs_set_verbose"
14265 #: ../src/guestfs-actions.pod:5758
14269 " guestfs_set_verbose (guestfs_h *g,\n"
14275 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3867
14276 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
14280 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3869
14282 "Verbose messages are disabled unless the environment variable "
14283 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14287 #: ../src/guestfs-actions.pod:5771
14288 msgid "guestfs_setcon"
14292 #: ../src/guestfs-actions.pod:5773
14296 " guestfs_setcon (guestfs_h *g,\n"
14297 " const char *context);\n"
14302 #: ../src/guestfs-actions.pod:5777 ../fish/guestfish-actions.pod:3876
14304 "This sets the SELinux security context of the daemon to the string "
14309 #: ../src/guestfs-actions.pod:5780 ../fish/guestfish-actions.pod:3879
14310 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14314 #: ../src/guestfs-actions.pod:5786
14315 msgid "guestfs_setxattr"
14319 #: ../src/guestfs-actions.pod:5788
14323 " guestfs_setxattr (guestfs_h *g,\n"
14324 " const char *xattr,\n"
14325 " const char *val,\n"
14327 " const char *path);\n"
14332 #: ../src/guestfs-actions.pod:5795 ../fish/guestfish-actions.pod:3885
14334 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14335 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14339 #: ../src/guestfs-actions.pod:5799
14340 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14344 #: ../src/guestfs-actions.pod:5805
14345 msgid "guestfs_sfdisk"
14349 #: ../src/guestfs-actions.pod:5807
14353 " guestfs_sfdisk (guestfs_h *g,\n"
14354 " const char *device,\n"
14358 " char *const *lines);\n"
14363 #: ../src/guestfs-actions.pod:5815 ../fish/guestfish-actions.pod:3895
14365 "This is a direct interface to the L<sfdisk(8)> program for creating "
14366 "partitions on block devices."
14370 #: ../src/guestfs-actions.pod:5818 ../fish/guestfish-actions.pod:3898
14371 msgid "C<device> should be a block device, for example C</dev/sda>."
14375 #: ../src/guestfs-actions.pod:5820 ../fish/guestfish-actions.pod:3900
14377 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14378 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14379 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14380 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14381 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14382 "the kernel) cannot work out the right geometry and you will need to tell it."
14386 #: ../src/guestfs-actions.pod:5828 ../fish/guestfish-actions.pod:3908
14388 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14389 "refer to the L<sfdisk(8)> manpage."
14393 #: ../src/guestfs-actions.pod:5831 ../fish/guestfish-actions.pod:3911
14395 "To create a single partition occupying the whole disk, you would pass "
14396 "C<lines> as a single element list, when the single element being the string "
14401 #: ../src/guestfs-actions.pod:5835
14403 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14407 #: ../src/guestfs-actions.pod:5845
14408 msgid "guestfs_sfdiskM"
14412 #: ../src/guestfs-actions.pod:5847
14416 " guestfs_sfdiskM (guestfs_h *g,\n"
14417 " const char *device,\n"
14418 " char *const *lines);\n"
14423 #: ../src/guestfs-actions.pod:5852
14425 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14426 "partition sizes are specified in megabytes only (rounded to the nearest "
14427 "cylinder) and you don't need to specify the cyls, heads and sectors "
14428 "parameters which were rarely if ever used anyway."
14432 #: ../src/guestfs-actions.pod:5858
14434 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14435 "C<guestfs_part_disk>"
14439 #: ../src/guestfs-actions.pod:5868
14440 msgid "guestfs_sfdisk_N"
14444 #: ../src/guestfs-actions.pod:5870
14448 " guestfs_sfdisk_N (guestfs_h *g,\n"
14449 " const char *device,\n"
14454 " const char *line);\n"
14459 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3941
14461 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14462 "(note: C<n> counts from 1)."
14466 #: ../src/guestfs-actions.pod:5882
14468 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14469 "for the cyls/heads/sectors parameters."
14473 #: ../src/guestfs-actions.pod:5885
14474 msgid "See also: C<guestfs_part_add>"
14478 #: ../src/guestfs-actions.pod:5894
14479 msgid "guestfs_sfdisk_disk_geometry"
14483 #: ../src/guestfs-actions.pod:5896
14487 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14488 " const char *device);\n"
14493 #: ../src/guestfs-actions.pod:5900
14495 "This displays the disk geometry of C<device> read from the partition table. "
14496 "Especially in the case where the underlying block device has been resized, "
14497 "this can be different from the kernel's idea of the geometry (see "
14498 "C<guestfs_sfdisk_kernel_geometry>)."
14502 #: ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:5921
14503 #: ../fish/guestfish-actions.pod:3961 ../fish/guestfish-actions.pod:3970
14504 msgid "The result is in human-readable format, and not designed to be parsed."
14508 #: ../src/guestfs-actions.pod:5913
14509 msgid "guestfs_sfdisk_kernel_geometry"
14513 #: ../src/guestfs-actions.pod:5915
14517 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14518 " const char *device);\n"
14523 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:3968
14524 msgid "This displays the kernel's idea of the geometry of C<device>."
14528 #: ../src/guestfs-actions.pod:5929
14529 msgid "guestfs_sfdisk_l"
14533 #: ../src/guestfs-actions.pod:5931
14537 " guestfs_sfdisk_l (guestfs_h *g,\n"
14538 " const char *device);\n"
14543 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:3977
14545 "This displays the partition table on C<device>, in the human-readable output "
14546 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14550 #: ../src/guestfs-actions.pod:5939
14551 msgid "See also: C<guestfs_part_list>"
14555 #: ../src/guestfs-actions.pod:5946
14560 #: ../src/guestfs-actions.pod:5948
14564 " guestfs_sh (guestfs_h *g,\n"
14565 " const char *command);\n"
14570 #: ../src/guestfs-actions.pod:5952 ../fish/guestfish-actions.pod:3987
14572 "This call runs a command from the guest filesystem via the guest's C</bin/"
14577 #: ../src/guestfs-actions.pod:5955
14578 msgid "This is like C<guestfs_command>, but passes the command to:"
14582 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:3992
14585 " /bin/sh -c \"command\"\n"
14590 #: ../src/guestfs-actions.pod:5959 ../fish/guestfish-actions.pod:3994
14592 "Depending on the guest's shell, this usually results in wildcards being "
14593 "expanded, shell expressions being interpolated and so on."
14597 #: ../src/guestfs-actions.pod:5963
14598 msgid "All the provisos about C<guestfs_command> apply to this call."
14602 #: ../src/guestfs-actions.pod:5970
14603 msgid "guestfs_sh_lines"
14607 #: ../src/guestfs-actions.pod:5972
14611 " guestfs_sh_lines (guestfs_h *g,\n"
14612 " const char *command);\n"
14617 #: ../src/guestfs-actions.pod:5976
14619 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14624 #: ../src/guestfs-actions.pod:5979
14625 msgid "See also: C<guestfs_command_lines>"
14629 #: ../src/guestfs-actions.pod:5987
14630 msgid "guestfs_sleep"
14634 #: ../src/guestfs-actions.pod:5989
14638 " guestfs_sleep (guestfs_h *g,\n"
14644 #: ../src/guestfs-actions.pod:5993 ../fish/guestfish-actions.pod:4013
14645 msgid "Sleep for C<secs> seconds."
14649 #: ../src/guestfs-actions.pod:5997
14650 msgid "(Added in 1.0.41)"
14654 #: ../src/guestfs-actions.pod:5999 ../src/guestfs-structs.pod:109
14655 msgid "guestfs_stat"
14659 #: ../src/guestfs-actions.pod:6001
14662 " struct guestfs_stat *\n"
14663 " guestfs_stat (guestfs_h *g,\n"
14664 " const char *path);\n"
14669 #: ../src/guestfs-actions.pod:6007 ../fish/guestfish-actions.pod:4021
14670 msgid "This is the same as the C<stat(2)> system call."
14674 #: ../src/guestfs-actions.pod:6015 ../src/guestfs-structs.pod:135
14675 msgid "guestfs_statvfs"
14679 #: ../src/guestfs-actions.pod:6017
14682 " struct guestfs_statvfs *\n"
14683 " guestfs_statvfs (guestfs_h *g,\n"
14684 " const char *path);\n"
14689 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:4027
14691 "Returns file system statistics for any mounted file system. C<path> should "
14692 "be a file or directory in the mounted file system (typically it is the mount "
14693 "point itself, but it doesn't need to be)."
14697 #: ../src/guestfs-actions.pod:6025 ../fish/guestfish-actions.pod:4031
14698 msgid "This is the same as the C<statvfs(2)> system call."
14702 #: ../src/guestfs-actions.pod:6027
14704 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14705 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14709 #: ../src/guestfs-actions.pod:6033
14710 msgid "guestfs_strings"
14714 #: ../src/guestfs-actions.pod:6035
14718 " guestfs_strings (guestfs_h *g,\n"
14719 " const char *path);\n"
14724 #: ../src/guestfs-actions.pod:6039 ../fish/guestfish-actions.pod:4037
14726 "This runs the L<strings(1)> command on a file and returns the list of "
14727 "printable strings found."
14731 #: ../src/guestfs-actions.pod:6051
14732 msgid "guestfs_strings_e"
14736 #: ../src/guestfs-actions.pod:6053
14740 " guestfs_strings_e (guestfs_h *g,\n"
14741 " const char *encoding,\n"
14742 " const char *path);\n"
14747 #: ../src/guestfs-actions.pod:6058
14749 "This is like the C<guestfs_strings> command, but allows you to specify the "
14750 "encoding of strings that are looked for in the source file C<path>."
14754 #: ../src/guestfs-actions.pod:6062 ../fish/guestfish-actions.pod:4051
14755 msgid "Allowed encodings are:"
14759 #: ../src/guestfs-actions.pod:6066 ../fish/guestfish-actions.pod:4055
14764 #: ../src/guestfs-actions.pod:6068
14766 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14767 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14771 #: ../src/guestfs-actions.pod:6071 ../fish/guestfish-actions.pod:4060
14776 #: ../src/guestfs-actions.pod:6073 ../fish/guestfish-actions.pod:4062
14777 msgid "Single 8-bit-byte characters."
14781 #: ../src/guestfs-actions.pod:6075 ../fish/guestfish-actions.pod:4064
14786 #: ../src/guestfs-actions.pod:6077 ../fish/guestfish-actions.pod:4066
14787 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14791 #: ../src/guestfs-actions.pod:6080 ../fish/guestfish-actions.pod:4069
14792 msgid "l (lower case letter L)"
14796 #: ../src/guestfs-actions.pod:6082 ../fish/guestfish-actions.pod:4071
14798 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14799 "examining binaries in Windows guests."
14803 #: ../src/guestfs-actions.pod:6085 ../fish/guestfish-actions.pod:4074
14808 #: ../src/guestfs-actions.pod:6087 ../fish/guestfish-actions.pod:4076
14809 msgid "32-bit big endian such as UCS-4BE."
14813 #: ../src/guestfs-actions.pod:6089 ../fish/guestfish-actions.pod:4078
14818 #: ../src/guestfs-actions.pod:6091 ../fish/guestfish-actions.pod:4080
14819 msgid "32-bit little endian such as UCS-4LE."
14823 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4084
14824 msgid "The returned strings are transcoded to UTF-8."
14828 #: ../src/guestfs-actions.pod:6106
14829 msgid "guestfs_swapoff_device"
14833 #: ../src/guestfs-actions.pod:6108
14837 " guestfs_swapoff_device (guestfs_h *g,\n"
14838 " const char *device);\n"
14843 #: ../src/guestfs-actions.pod:6112
14845 "This command disables the libguestfs appliance swap device or partition "
14846 "named C<device>. See C<guestfs_swapon_device>."
14850 #: ../src/guestfs-actions.pod:6120
14851 msgid "guestfs_swapoff_file"
14855 #: ../src/guestfs-actions.pod:6122
14859 " guestfs_swapoff_file (guestfs_h *g,\n"
14860 " const char *file);\n"
14865 #: ../src/guestfs-actions.pod:6126 ../fish/guestfish-actions.pod:4101
14866 msgid "This command disables the libguestfs appliance swap on file."
14870 #: ../src/guestfs-actions.pod:6132
14871 msgid "guestfs_swapoff_label"
14875 #: ../src/guestfs-actions.pod:6134
14879 " guestfs_swapoff_label (guestfs_h *g,\n"
14880 " const char *label);\n"
14885 #: ../src/guestfs-actions.pod:6138 ../fish/guestfish-actions.pod:4107
14887 "This command disables the libguestfs appliance swap on labeled swap "
14892 #: ../src/guestfs-actions.pod:6145
14893 msgid "guestfs_swapoff_uuid"
14897 #: ../src/guestfs-actions.pod:6147
14901 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14902 " const char *uuid);\n"
14907 #: ../src/guestfs-actions.pod:6151 ../fish/guestfish-actions.pod:4114
14909 "This command disables the libguestfs appliance swap partition with the given "
14914 #: ../src/guestfs-actions.pod:6158
14915 msgid "guestfs_swapon_device"
14919 #: ../src/guestfs-actions.pod:6160
14923 " guestfs_swapon_device (guestfs_h *g,\n"
14924 " const char *device);\n"
14929 #: ../src/guestfs-actions.pod:6164
14931 "This command enables the libguestfs appliance to use the swap device or "
14932 "partition named C<device>. The increased memory is made available for all "
14933 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14937 #: ../src/guestfs-actions.pod:6169 ../fish/guestfish-actions.pod:4126
14939 "Note that you should not swap to existing guest swap partitions unless you "
14940 "know what you are doing. They may contain hibernation information, or other "
14941 "information that the guest doesn't want you to trash. You also risk leaking "
14942 "information about the host to the guest this way. Instead, attach a new "
14943 "host device to the guest and swap on that."
14947 #: ../src/guestfs-actions.pod:6180
14948 msgid "guestfs_swapon_file"
14952 #: ../src/guestfs-actions.pod:6182
14956 " guestfs_swapon_file (guestfs_h *g,\n"
14957 " const char *file);\n"
14962 #: ../src/guestfs-actions.pod:6186
14964 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14969 #: ../src/guestfs-actions.pod:6193
14970 msgid "guestfs_swapon_label"
14974 #: ../src/guestfs-actions.pod:6195
14978 " guestfs_swapon_label (guestfs_h *g,\n"
14979 " const char *label);\n"
14984 #: ../src/guestfs-actions.pod:6199
14986 "This command enables swap to a labeled swap partition. See "
14987 "C<guestfs_swapon_device> for other notes."
14991 #: ../src/guestfs-actions.pod:6206
14992 msgid "guestfs_swapon_uuid"
14996 #: ../src/guestfs-actions.pod:6208
15000 " guestfs_swapon_uuid (guestfs_h *g,\n"
15001 " const char *uuid);\n"
15006 #: ../src/guestfs-actions.pod:6212
15008 "This command enables swap to a swap partition with the given UUID. See "
15009 "C<guestfs_swapon_device> for other notes."
15013 #: ../src/guestfs-actions.pod:6219
15014 msgid "guestfs_sync"
15018 #: ../src/guestfs-actions.pod:6221
15022 " guestfs_sync (guestfs_h *g);\n"
15027 #: ../src/guestfs-actions.pod:6224 ../fish/guestfish-actions.pod:4158
15029 "This syncs the disk, so that any writes are flushed through to the "
15030 "underlying disk image."
15034 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4161
15036 "You should always call this if you have modified a disk image, before "
15037 "closing the handle."
15041 #: ../src/guestfs-actions.pod:6234
15042 msgid "guestfs_tail"
15046 #: ../src/guestfs-actions.pod:6236
15050 " guestfs_tail (guestfs_h *g,\n"
15051 " const char *path);\n"
15056 #: ../src/guestfs-actions.pod:6240 ../fish/guestfish-actions.pod:4168
15058 "This command returns up to the last 10 lines of a file as a list of strings."
15062 #: ../src/guestfs-actions.pod:6252
15063 msgid "guestfs_tail_n"
15067 #: ../src/guestfs-actions.pod:6254
15071 " guestfs_tail_n (guestfs_h *g,\n"
15073 " const char *path);\n"
15078 #: ../src/guestfs-actions.pod:6259 ../fish/guestfish-actions.pod:4178
15080 "If the parameter C<nrlines> is a positive number, this returns the last "
15081 "C<nrlines> lines of the file C<path>."
15085 #: ../src/guestfs-actions.pod:6262 ../fish/guestfish-actions.pod:4181
15087 "If the parameter C<nrlines> is a negative number, this returns lines from "
15088 "the file C<path>, starting with the C<-nrlines>th line."
15092 #: ../src/guestfs-actions.pod:6276
15093 msgid "guestfs_tar_in"
15097 #: ../src/guestfs-actions.pod:6278
15101 " guestfs_tar_in (guestfs_h *g,\n"
15102 " const char *tarfile,\n"
15103 " const char *directory);\n"
15108 #: ../src/guestfs-actions.pod:6283 ../fish/guestfish-actions.pod:4193
15110 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15111 "tar file) into C<directory>."
15115 #: ../src/guestfs-actions.pod:6286
15117 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
15121 #: ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6308
15122 #: ../src/guestfs-actions.pod:6324 ../src/guestfs-actions.pod:6340
15123 msgid "(Added in 1.0.3)"
15127 #: ../src/guestfs-actions.pod:6293
15128 msgid "guestfs_tar_out"
15132 #: ../src/guestfs-actions.pod:6295
15136 " guestfs_tar_out (guestfs_h *g,\n"
15137 " const char *directory,\n"
15138 " const char *tarfile);\n"
15143 #: ../src/guestfs-actions.pod:6300 ../fish/guestfish-actions.pod:4205
15145 "This command packs the contents of C<directory> and downloads it to local "
15150 #: ../src/guestfs-actions.pod:6303
15152 "To download a compressed tarball, use C<guestfs_tgz_out> or "
15153 "C<guestfs_txz_out>."
15157 #: ../src/guestfs-actions.pod:6310
15158 msgid "guestfs_tgz_in"
15162 #: ../src/guestfs-actions.pod:6312
15166 " guestfs_tgz_in (guestfs_h *g,\n"
15167 " const char *tarball,\n"
15168 " const char *directory);\n"
15173 #: ../src/guestfs-actions.pod:6317 ../fish/guestfish-actions.pod:4217
15175 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15176 "tar file) into C<directory>."
15180 #: ../src/guestfs-actions.pod:6320
15181 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
15185 #: ../src/guestfs-actions.pod:6326
15186 msgid "guestfs_tgz_out"
15190 #: ../src/guestfs-actions.pod:6328
15194 " guestfs_tgz_out (guestfs_h *g,\n"
15195 " const char *directory,\n"
15196 " const char *tarball);\n"
15201 #: ../src/guestfs-actions.pod:6333 ../fish/guestfish-actions.pod:4228
15203 "This command packs the contents of C<directory> and downloads it to local "
15208 #: ../src/guestfs-actions.pod:6336
15209 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
15213 #: ../src/guestfs-actions.pod:6342
15214 msgid "guestfs_touch"
15218 #: ../src/guestfs-actions.pod:6344
15222 " guestfs_touch (guestfs_h *g,\n"
15223 " const char *path);\n"
15228 #: ../src/guestfs-actions.pod:6348 ../fish/guestfish-actions.pod:4239
15230 "Touch acts like the L<touch(1)> command. It can be used to update the "
15231 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15236 #: ../src/guestfs-actions.pod:6352 ../fish/guestfish-actions.pod:4243
15238 "This command only works on regular files, and will fail on other file types "
15239 "such as directories, symbolic links, block special etc."
15243 #: ../src/guestfs-actions.pod:6359
15244 msgid "guestfs_truncate"
15248 #: ../src/guestfs-actions.pod:6361
15252 " guestfs_truncate (guestfs_h *g,\n"
15253 " const char *path);\n"
15258 #: ../src/guestfs-actions.pod:6365 ../fish/guestfish-actions.pod:4250
15260 "This command truncates C<path> to a zero-length file. The file must exist "
15265 #: ../src/guestfs-actions.pod:6372
15266 msgid "guestfs_truncate_size"
15270 #: ../src/guestfs-actions.pod:6374
15274 " guestfs_truncate_size (guestfs_h *g,\n"
15275 " const char *path,\n"
15276 " int64_t size);\n"
15281 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4257
15283 "This command truncates C<path> to size C<size> bytes. The file must exist "
15288 #: ../src/guestfs-actions.pod:6382
15290 "If the current file size is less than C<size> then the file is extended to "
15291 "the required size with zero bytes. This creates a sparse file (ie. disk "
15292 "blocks are not allocated for the file until you write to it). To create a "
15293 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
15297 #: ../src/guestfs-actions.pod:6392
15298 msgid "guestfs_tune2fs_l"
15302 #: ../src/guestfs-actions.pod:6394
15306 " guestfs_tune2fs_l (guestfs_h *g,\n"
15307 " const char *device);\n"
15312 #: ../src/guestfs-actions.pod:6398 ../fish/guestfish-actions.pod:4270
15314 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15319 #: ../src/guestfs-actions.pod:6401 ../fish/guestfish-actions.pod:4273
15321 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15322 "for more details. The list of fields returned isn't clearly defined, and "
15323 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15324 "and the filesystem itself."
15328 #: ../src/guestfs-actions.pod:6414
15329 msgid "guestfs_txz_in"
15333 #: ../src/guestfs-actions.pod:6416
15337 " guestfs_txz_in (guestfs_h *g,\n"
15338 " const char *tarball,\n"
15339 " const char *directory);\n"
15344 #: ../src/guestfs-actions.pod:6421 ../fish/guestfish-actions.pod:4282
15346 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15347 "tar file) into C<directory>."
15351 #: ../src/guestfs-actions.pod:6428
15352 msgid "guestfs_txz_out"
15356 #: ../src/guestfs-actions.pod:6430
15360 " guestfs_txz_out (guestfs_h *g,\n"
15361 " const char *directory,\n"
15362 " const char *tarball);\n"
15367 #: ../src/guestfs-actions.pod:6435 ../fish/guestfish-actions.pod:4291
15369 "This command packs the contents of C<directory> and downloads it to local "
15370 "file C<tarball> (as an xz compressed tar archive)."
15374 #: ../src/guestfs-actions.pod:6442
15375 msgid "guestfs_umask"
15379 #: ../src/guestfs-actions.pod:6444
15383 " guestfs_umask (guestfs_h *g,\n"
15389 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4300
15391 "This function sets the mask used for creating new files and device nodes to "
15396 #: ../src/guestfs-actions.pod:6451 ../fish/guestfish-actions.pod:4303
15398 "Typical umask values would be C<022> which creates new files with "
15399 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15400 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15404 #: ../src/guestfs-actions.pod:6456 ../fish/guestfish-actions.pod:4308
15406 "The default umask is C<022>. This is important because it means that "
15407 "directories and device nodes will be created with C<0644> or C<0755> mode "
15408 "even if you specify C<0777>."
15412 #: ../src/guestfs-actions.pod:6460
15414 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15415 "C<guestfs_mkdir>."
15419 #: ../src/guestfs-actions.pod:6463 ../fish/guestfish-actions.pod:4315
15420 msgid "This call returns the previous umask."
15424 #: ../src/guestfs-actions.pod:6469
15425 msgid "guestfs_umount"
15429 #: ../src/guestfs-actions.pod:6471
15433 " guestfs_umount (guestfs_h *g,\n"
15434 " const char *pathordevice);\n"
15439 #: ../src/guestfs-actions.pod:6475 ../fish/guestfish-actions.pod:4323
15441 "This unmounts the given filesystem. The filesystem may be specified either "
15442 "by its mountpoint (path) or the device which contains the filesystem."
15446 #: ../src/guestfs-actions.pod:6483
15447 msgid "guestfs_umount_all"
15451 #: ../src/guestfs-actions.pod:6485
15455 " guestfs_umount_all (guestfs_h *g);\n"
15460 #: ../src/guestfs-actions.pod:6488 ../fish/guestfish-actions.pod:4333
15461 msgid "This unmounts all mounted filesystems."
15465 #: ../src/guestfs-actions.pod:6490 ../fish/guestfish-actions.pod:4335
15466 msgid "Some internal mounts are not unmounted by this call."
15470 #: ../src/guestfs-actions.pod:6496
15471 msgid "guestfs_upload"
15475 #: ../src/guestfs-actions.pod:6498
15479 " guestfs_upload (guestfs_h *g,\n"
15480 " const char *filename,\n"
15481 " const char *remotefilename);\n"
15486 #: ../src/guestfs-actions.pod:6503 ../src/guestfs-actions.pod:6527
15487 #: ../fish/guestfish-actions.pod:4341 ../fish/guestfish-actions.pod:4354
15488 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15492 #: ../src/guestfs-actions.pod:6508
15493 msgid "See also C<guestfs_download>."
15497 #: ../src/guestfs-actions.pod:6519
15498 msgid "guestfs_upload_offset"
15502 #: ../src/guestfs-actions.pod:6521
15506 " guestfs_upload_offset (guestfs_h *g,\n"
15507 " const char *filename,\n"
15508 " const char *remotefilename,\n"
15509 " int64_t offset);\n"
15514 #: ../src/guestfs-actions.pod:6530 ../fish/guestfish-actions.pod:4357
15516 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15517 "The intention is to overwrite parts of existing files or devices, although "
15518 "if a non-existant file is specified then it is created with a \"hole\" "
15519 "before C<offset>. The size of the data written is implicit in the size of "
15520 "the source C<filename>."
15524 #: ../src/guestfs-actions.pod:6537
15526 "Note that there is no limit on the amount of data that can be uploaded with "
15527 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15528 "full amount unless an error occurs."
15532 #: ../src/guestfs-actions.pod:6542
15533 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15537 #: ../src/guestfs-actions.pod:6553
15538 msgid "guestfs_utimens"
15542 #: ../src/guestfs-actions.pod:6555
15546 " guestfs_utimens (guestfs_h *g,\n"
15547 " const char *path,\n"
15548 " int64_t atsecs,\n"
15549 " int64_t atnsecs,\n"
15550 " int64_t mtsecs,\n"
15551 " int64_t mtnsecs);\n"
15556 #: ../src/guestfs-actions.pod:6563 ../fish/guestfish-actions.pod:4377
15557 msgid "This command sets the timestamps of a file with nanosecond precision."
15561 #: ../src/guestfs-actions.pod:6566 ../fish/guestfish-actions.pod:4380
15563 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15568 #: ../src/guestfs-actions.pod:6569 ../fish/guestfish-actions.pod:4383
15570 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15571 "nanoseconds from the epoch."
15575 #: ../src/guestfs-actions.pod:6572 ../fish/guestfish-actions.pod:4386
15577 "If the C<*nsecs> field contains the special value C<-1> then the "
15578 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15579 "ignored in this case)."
15583 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4390
15585 "If the C<*nsecs> field contains the special value C<-2> then the "
15586 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15591 #: ../src/guestfs-actions.pod:6584 ../src/guestfs-structs.pod:175
15592 msgid "guestfs_version"
15596 #: ../src/guestfs-actions.pod:6586
15599 " struct guestfs_version *\n"
15600 " guestfs_version (guestfs_h *g);\n"
15605 #: ../src/guestfs-actions.pod:6589 ../fish/guestfish-actions.pod:4398
15607 "Return the libguestfs version number that the program is linked against."
15611 #: ../src/guestfs-actions.pod:6592 ../fish/guestfish-actions.pod:4401
15613 "Note that because of dynamic linking this is not necessarily the version of "
15614 "libguestfs that you compiled against. You can compile the program, and then "
15615 "at runtime dynamically link against a completely different C<libguestfs.so> "
15620 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4406
15622 "This call was added in version C<1.0.58>. In previous versions of "
15623 "libguestfs there was no way to get the version number. From C code you can "
15624 "use dynamic linker functions to find out if this symbol exists (if it "
15625 "doesn't, then it's an earlier version)."
15629 #: ../src/guestfs-actions.pod:6603 ../fish/guestfish-actions.pod:4412
15631 "The call returns a structure with four elements. The first three (C<major>, "
15632 "C<minor> and C<release>) are numbers and correspond to the usual version "
15633 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15634 "but may be used for distro-specific information."
15638 #: ../src/guestfs-actions.pod:6609 ../fish/guestfish-actions.pod:4418
15640 "To construct the original version string: C<$major.$minor.$release$extra>"
15644 #: ../src/guestfs-actions.pod:6612 ../fish/guestfish-actions.pod:4421
15645 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15649 #: ../src/guestfs-actions.pod:6614
15651 "I<Note:> Don't use this call to test for availability of features. In "
15652 "enterprise distributions we backport features from later versions into "
15653 "earlier versions, making this an unreliable way to test for features. Use "
15654 "C<guestfs_available> instead."
15658 #: ../src/guestfs-actions.pod:6620
15660 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15661 "error. I<The caller must call C<guestfs_free_version> after use>."
15665 #: ../src/guestfs-actions.pod:6624
15666 msgid "(Added in 1.0.58)"
15670 #: ../src/guestfs-actions.pod:6626
15671 msgid "guestfs_vfs_label"
15675 #: ../src/guestfs-actions.pod:6628
15679 " guestfs_vfs_label (guestfs_h *g,\n"
15680 " const char *device);\n"
15685 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4433
15686 msgid "This returns the filesystem label of the filesystem on C<device>."
15690 #: ../src/guestfs-actions.pod:6635 ../fish/guestfish-actions.pod:4436
15691 msgid "If the filesystem is unlabeled, this returns the empty string."
15695 #: ../src/guestfs-actions.pod:6637
15696 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15700 #: ../src/guestfs-actions.pod:6642 ../src/guestfs-actions.pod:6679
15701 msgid "(Added in 1.3.18)"
15705 #: ../src/guestfs-actions.pod:6644
15706 msgid "guestfs_vfs_type"
15710 #: ../src/guestfs-actions.pod:6646
15714 " guestfs_vfs_type (guestfs_h *g,\n"
15715 " const char *device);\n"
15720 #: ../src/guestfs-actions.pod:6650 ../fish/guestfish-actions.pod:4444
15722 "This command gets the filesystem type corresponding to the filesystem on "
15727 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4447
15729 "For most filesystems, the result is the name of the Linux VFS module which "
15730 "would be used to mount this filesystem if you mounted it without specifying "
15731 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15735 #: ../src/guestfs-actions.pod:6663
15736 msgid "guestfs_vfs_uuid"
15740 #: ../src/guestfs-actions.pod:6665
15744 " guestfs_vfs_uuid (guestfs_h *g,\n"
15745 " const char *device);\n"
15750 #: ../src/guestfs-actions.pod:6669 ../fish/guestfish-actions.pod:4456
15751 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15755 #: ../src/guestfs-actions.pod:6672 ../fish/guestfish-actions.pod:4459
15756 msgid "If the filesystem does not have a UUID, this returns the empty string."
15760 #: ../src/guestfs-actions.pod:6674
15761 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15765 #: ../src/guestfs-actions.pod:6681
15766 msgid "guestfs_vg_activate"
15770 #: ../src/guestfs-actions.pod:6683
15774 " guestfs_vg_activate (guestfs_h *g,\n"
15776 " char *const *volgroups);\n"
15781 #: ../src/guestfs-actions.pod:6688 ../fish/guestfish-actions.pod:4467
15783 "This command activates or (if C<activate> is false) deactivates all logical "
15784 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15785 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15786 "deactivated, then those devices disappear."
15790 #: ../src/guestfs-actions.pod:6694 ../fish/guestfish-actions.pod:4473
15791 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15795 #: ../src/guestfs-actions.pod:6696 ../fish/guestfish-actions.pod:4475
15797 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15798 "activated or deactivated."
15802 #: ../src/guestfs-actions.pod:6703
15803 msgid "guestfs_vg_activate_all"
15807 #: ../src/guestfs-actions.pod:6705
15811 " guestfs_vg_activate_all (guestfs_h *g,\n"
15812 " int activate);\n"
15817 #: ../src/guestfs-actions.pod:6709 ../fish/guestfish-actions.pod:4482
15819 "This command activates or (if C<activate> is false) deactivates all logical "
15820 "volumes in all volume groups. If activated, then they are made known to the "
15821 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15822 "those devices disappear."
15826 #: ../src/guestfs-actions.pod:6715 ../fish/guestfish-actions.pod:4488
15827 msgid "This command is the same as running C<vgchange -a y|n>"
15831 #: ../src/guestfs-actions.pod:6721
15832 msgid "guestfs_vgcreate"
15836 #: ../src/guestfs-actions.pod:6723
15840 " guestfs_vgcreate (guestfs_h *g,\n"
15841 " const char *volgroup,\n"
15842 " char *const *physvols);\n"
15847 #: ../src/guestfs-actions.pod:6728 ../fish/guestfish-actions.pod:4494
15849 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15850 "of physical volumes C<physvols>."
15854 #: ../src/guestfs-actions.pod:6735
15855 msgid "guestfs_vglvuuids"
15859 #: ../src/guestfs-actions.pod:6737
15863 " guestfs_vglvuuids (guestfs_h *g,\n"
15864 " const char *vgname);\n"
15869 #: ../src/guestfs-actions.pod:6741 ../fish/guestfish-actions.pod:4501
15871 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15872 "volumes created in this volume group."
15876 #: ../src/guestfs-actions.pod:6744
15878 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15879 "associate logical volumes and volume groups."
15883 #: ../src/guestfs-actions.pod:6747
15884 msgid "See also C<guestfs_vgpvuuids>."
15888 #: ../src/guestfs-actions.pod:6755
15889 msgid "guestfs_vgpvuuids"
15893 #: ../src/guestfs-actions.pod:6757
15897 " guestfs_vgpvuuids (guestfs_h *g,\n"
15898 " const char *vgname);\n"
15903 #: ../src/guestfs-actions.pod:6761 ../fish/guestfish-actions.pod:4513
15905 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15906 "volumes that this volume group resides on."
15910 #: ../src/guestfs-actions.pod:6764
15912 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15913 "associate physical volumes and volume groups."
15917 #: ../src/guestfs-actions.pod:6767
15918 msgid "See also C<guestfs_vglvuuids>."
15922 #: ../src/guestfs-actions.pod:6775
15923 msgid "guestfs_vgremove"
15927 #: ../src/guestfs-actions.pod:6777
15931 " guestfs_vgremove (guestfs_h *g,\n"
15932 " const char *vgname);\n"
15937 #: ../src/guestfs-actions.pod:6781 ../fish/guestfish-actions.pod:4525
15938 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15942 #: ../src/guestfs-actions.pod:6783 ../fish/guestfish-actions.pod:4527
15944 "This also forcibly removes all logical volumes in the volume group (if any)."
15948 #: ../src/guestfs-actions.pod:6790
15949 msgid "guestfs_vgrename"
15953 #: ../src/guestfs-actions.pod:6792
15957 " guestfs_vgrename (guestfs_h *g,\n"
15958 " const char *volgroup,\n"
15959 " const char *newvolgroup);\n"
15964 #: ../src/guestfs-actions.pod:6797 ../fish/guestfish-actions.pod:4534
15965 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15969 #: ../src/guestfs-actions.pod:6803
15970 msgid "guestfs_vgs"
15974 #: ../src/guestfs-actions.pod:6805
15978 " guestfs_vgs (guestfs_h *g);\n"
15983 #: ../src/guestfs-actions.pod:6808 ../fish/guestfish-actions.pod:4540
15985 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15990 #: ../src/guestfs-actions.pod:6811 ../fish/guestfish-actions.pod:4543
15992 "This returns a list of just the volume group names that were detected (eg. "
15997 #: ../src/guestfs-actions.pod:6814
15998 msgid "See also C<guestfs_vgs_full>."
16002 #: ../src/guestfs-actions.pod:6822
16003 msgid "guestfs_vgs_full"
16007 #: ../src/guestfs-actions.pod:6824
16010 " struct guestfs_lvm_vg_list *\n"
16011 " guestfs_vgs_full (guestfs_h *g);\n"
16016 #: ../src/guestfs-actions.pod:6827 ../fish/guestfish-actions.pod:4552
16018 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
16019 "> command. The \"full\" version includes all fields."
16023 #: ../src/guestfs-actions.pod:6830
16025 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
16026 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
16030 #: ../src/guestfs-actions.pod:6836
16031 msgid "guestfs_vgscan"
16035 #: ../src/guestfs-actions.pod:6838
16039 " guestfs_vgscan (guestfs_h *g);\n"
16044 #: ../src/guestfs-actions.pod:6841 ../fish/guestfish-actions.pod:4559
16046 "This rescans all block devices and rebuilds the list of LVM physical "
16047 "volumes, volume groups and logical volumes."
16051 #: ../src/guestfs-actions.pod:6848
16052 msgid "guestfs_vguuid"
16056 #: ../src/guestfs-actions.pod:6850
16060 " guestfs_vguuid (guestfs_h *g,\n"
16061 " const char *vgname);\n"
16066 #: ../src/guestfs-actions.pod:6854 ../fish/guestfish-actions.pod:4566
16067 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16071 #: ../src/guestfs-actions.pod:6861
16072 msgid "guestfs_wait_ready"
16076 #: ../src/guestfs-actions.pod:6863
16080 " guestfs_wait_ready (guestfs_h *g);\n"
16085 #: ../src/guestfs-actions.pod:6866
16086 msgid "This function is a no op."
16090 #: ../src/guestfs-actions.pod:6868
16092 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
16093 "calling C<guestfs_launch> to wait for the launch to complete. However this "
16094 "is no longer necessary because C<guestfs_launch> now does the waiting."
16098 #: ../src/guestfs-actions.pod:6873
16100 "If you see any calls to this function in code then you can just remove them, "
16101 "unless you want to retain compatibility with older versions of the API."
16105 #: ../src/guestfs-actions.pod:6881
16106 msgid "guestfs_wc_c"
16110 #: ../src/guestfs-actions.pod:6883
16114 " guestfs_wc_c (guestfs_h *g,\n"
16115 " const char *path);\n"
16120 #: ../src/guestfs-actions.pod:6887 ../fish/guestfish-actions.pod:4572
16122 "This command counts the characters in a file, using the C<wc -c> external "
16127 #: ../src/guestfs-actions.pod:6894
16128 msgid "guestfs_wc_l"
16132 #: ../src/guestfs-actions.pod:6896
16136 " guestfs_wc_l (guestfs_h *g,\n"
16137 " const char *path);\n"
16142 #: ../src/guestfs-actions.pod:6900 ../fish/guestfish-actions.pod:4579
16144 "This command counts the lines in a file, using the C<wc -l> external command."
16148 #: ../src/guestfs-actions.pod:6907
16149 msgid "guestfs_wc_w"
16153 #: ../src/guestfs-actions.pod:6909
16157 " guestfs_wc_w (guestfs_h *g,\n"
16158 " const char *path);\n"
16163 #: ../src/guestfs-actions.pod:6913 ../fish/guestfish-actions.pod:4586
16165 "This command counts the words in a file, using the C<wc -w> external command."
16169 #: ../src/guestfs-actions.pod:6920
16170 msgid "guestfs_write"
16174 #: ../src/guestfs-actions.pod:6922
16178 " guestfs_write (guestfs_h *g,\n"
16179 " const char *path,\n"
16180 " const char *content,\n"
16181 " size_t content_size);\n"
16186 #: ../src/guestfs-actions.pod:6928 ../fish/guestfish-actions.pod:4593
16188 "This call creates a file called C<path>. The content of the file is the "
16189 "string C<content> (which can contain any 8 bit data)."
16193 #: ../src/guestfs-actions.pod:6938
16194 msgid "guestfs_write_file"
16198 #: ../src/guestfs-actions.pod:6940
16202 " guestfs_write_file (guestfs_h *g,\n"
16203 " const char *path,\n"
16204 " const char *content,\n"
16210 #: ../src/guestfs-actions.pod:6946 ../fish/guestfish-actions.pod:4603
16212 "This call creates a file called C<path>. The contents of the file is the "
16213 "string C<content> (which can contain any 8 bit data), with length C<size>."
16217 #: ../src/guestfs-actions.pod:6950 ../fish/guestfish-actions.pod:4607
16219 "As a special case, if C<size> is C<0> then the length is calculated using "
16220 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16224 #: ../src/guestfs-actions.pod:6954 ../fish/guestfish-actions.pod:4611
16226 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16227 "I<not> work, even if the length is specified."
16231 #: ../src/guestfs-actions.pod:6962 ../fish/guestfish-actions.pod:4617
16233 "This function is deprecated. In new code, use the C<write> call instead."
16237 #: ../src/guestfs-actions.pod:6971
16238 msgid "guestfs_zegrep"
16242 #: ../src/guestfs-actions.pod:6973
16246 " guestfs_zegrep (guestfs_h *g,\n"
16247 " const char *regex,\n"
16248 " const char *path);\n"
16253 #: ../src/guestfs-actions.pod:6978 ../fish/guestfish-actions.pod:4628
16255 "This calls the external C<zegrep> program and returns the matching lines."
16259 #: ../src/guestfs-actions.pod:6990
16260 msgid "guestfs_zegrepi"
16264 #: ../src/guestfs-actions.pod:6992
16268 " guestfs_zegrepi (guestfs_h *g,\n"
16269 " const char *regex,\n"
16270 " const char *path);\n"
16275 #: ../src/guestfs-actions.pod:6997 ../fish/guestfish-actions.pod:4638
16277 "This calls the external C<zegrep -i> program and returns the matching lines."
16281 #: ../src/guestfs-actions.pod:7009
16282 msgid "guestfs_zero"
16286 #: ../src/guestfs-actions.pod:7011
16290 " guestfs_zero (guestfs_h *g,\n"
16291 " const char *device);\n"
16296 #: ../src/guestfs-actions.pod:7015 ../fish/guestfish-actions.pod:4648
16297 msgid "This command writes zeroes over the first few blocks of C<device>."
16301 #: ../src/guestfs-actions.pod:7017 ../fish/guestfish-actions.pod:4650
16303 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16304 "securely wipe the device). It should be sufficient to remove any partition "
16305 "tables, filesystem superblocks and so on."
16309 #: ../src/guestfs-actions.pod:7021
16310 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
16314 #: ../src/guestfs-actions.pod:7032
16315 msgid "guestfs_zero_device"
16319 #: ../src/guestfs-actions.pod:7034
16323 " guestfs_zero_device (guestfs_h *g,\n"
16324 " const char *device);\n"
16329 #: ../src/guestfs-actions.pod:7038
16331 "This command writes zeroes over the entire C<device>. Compare with "
16332 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16336 #: ../src/guestfs-actions.pod:7052
16337 msgid "(Added in 1.3.1)"
16341 #: ../src/guestfs-actions.pod:7054
16342 msgid "guestfs_zerofree"
16346 #: ../src/guestfs-actions.pod:7056
16350 " guestfs_zerofree (guestfs_h *g,\n"
16351 " const char *device);\n"
16356 #: ../src/guestfs-actions.pod:7060 ../fish/guestfish-actions.pod:4671
16358 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16359 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16360 "possible to compress the filesystem more effectively."
16364 #: ../src/guestfs-actions.pod:7065 ../fish/guestfish-actions.pod:4676
16365 msgid "You should B<not> run this program if the filesystem is mounted."
16369 #: ../src/guestfs-actions.pod:7068 ../fish/guestfish-actions.pod:4679
16371 "It is possible that using this program can damage the filesystem or data on "
16376 #: ../src/guestfs-actions.pod:7075
16377 msgid "guestfs_zfgrep"
16381 #: ../src/guestfs-actions.pod:7077
16385 " guestfs_zfgrep (guestfs_h *g,\n"
16386 " const char *pattern,\n"
16387 " const char *path);\n"
16392 #: ../src/guestfs-actions.pod:7082 ../fish/guestfish-actions.pod:4686
16394 "This calls the external C<zfgrep> program and returns the matching lines."
16398 #: ../src/guestfs-actions.pod:7094
16399 msgid "guestfs_zfgrepi"
16403 #: ../src/guestfs-actions.pod:7096
16407 " guestfs_zfgrepi (guestfs_h *g,\n"
16408 " const char *pattern,\n"
16409 " const char *path);\n"
16414 #: ../src/guestfs-actions.pod:7101 ../fish/guestfish-actions.pod:4696
16416 "This calls the external C<zfgrep -i> program and returns the matching lines."
16420 #: ../src/guestfs-actions.pod:7113
16421 msgid "guestfs_zfile"
16425 #: ../src/guestfs-actions.pod:7115
16429 " guestfs_zfile (guestfs_h *g,\n"
16430 " const char *meth,\n"
16431 " const char *path);\n"
16436 #: ../src/guestfs-actions.pod:7120 ../fish/guestfish-actions.pod:4706
16438 "This command runs C<file> after first decompressing C<path> using C<method>."
16442 #: ../src/guestfs-actions.pod:7123 ../fish/guestfish-actions.pod:4709
16443 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16447 #: ../src/guestfs-actions.pod:7125
16449 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16454 #: ../src/guestfs-actions.pod:7131 ../fish/guestfish-actions.pod:4714
16456 "This function is deprecated. In new code, use the C<file> call instead."
16460 #: ../src/guestfs-actions.pod:7140
16461 msgid "guestfs_zgrep"
16465 #: ../src/guestfs-actions.pod:7142
16469 " guestfs_zgrep (guestfs_h *g,\n"
16470 " const char *regex,\n"
16471 " const char *path);\n"
16476 #: ../src/guestfs-actions.pod:7147 ../fish/guestfish-actions.pod:4725
16478 "This calls the external C<zgrep> program and returns the matching lines."
16482 #: ../src/guestfs-actions.pod:7159
16483 msgid "guestfs_zgrepi"
16487 #: ../src/guestfs-actions.pod:7161
16491 " guestfs_zgrepi (guestfs_h *g,\n"
16492 " const char *regex,\n"
16493 " const char *path);\n"
16498 #: ../src/guestfs-actions.pod:7166 ../fish/guestfish-actions.pod:4735
16500 "This calls the external C<zgrep -i> program and returns the matching lines."
16504 #: ../src/guestfs-availability.pod:3
16509 #: ../src/guestfs-availability.pod:5
16511 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16512 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16513 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16514 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16515 "L</guestfs_aug_save> L</guestfs_aug_set>"
16519 #: ../src/guestfs-availability.pod:21
16524 #: ../src/guestfs-availability.pod:23
16526 "The following functions: L</guestfs_inotify_add_watch> L</"
16527 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16528 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16532 #: ../src/guestfs-availability.pod:31
16533 msgid "B<linuxfsuuid>"
16537 #: ../src/guestfs-availability.pod:33
16539 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16540 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16544 #: ../src/guestfs-availability.pod:40
16545 msgid "B<linuxmodules>"
16549 #: ../src/guestfs-availability.pod:42
16550 msgid "The following functions: L</guestfs_modprobe>"
16554 #: ../src/guestfs-availability.pod:45
16555 msgid "B<linuxxattrs>"
16559 #: ../src/guestfs-availability.pod:47
16561 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
16562 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
16563 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
16564 "guestfs_setxattr>"
16568 #: ../src/guestfs-availability.pod:58
16573 #: ../src/guestfs-availability.pod:60
16575 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16576 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16577 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16581 #: ../src/guestfs-availability.pod:69
16586 #: ../src/guestfs-availability.pod:71
16588 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16589 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16590 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16591 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16592 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16593 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16594 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16598 #: ../src/guestfs-availability.pod:94
16603 #: ../src/guestfs-availability.pod:96
16605 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16606 "guestfs_mknod_b> L</guestfs_mknod_c>"
16610 #: ../src/guestfs-availability.pod:102
16615 #: ../src/guestfs-availability.pod:104
16616 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16620 #: ../src/guestfs-availability.pod:107
16621 msgid "B<ntfsprogs>"
16625 #: ../src/guestfs-availability.pod:109
16627 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16631 #: ../src/guestfs-availability.pod:113
16632 msgid "B<realpath>"
16636 #: ../src/guestfs-availability.pod:115
16637 msgid "The following functions: L</guestfs_realpath>"
16641 #: ../src/guestfs-availability.pod:118
16646 #: ../src/guestfs-availability.pod:120
16648 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16649 "guestfs_scrub_freespace>"
16653 #: ../src/guestfs-availability.pod:125
16658 #: ../src/guestfs-availability.pod:127
16659 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16663 #: ../src/guestfs-availability.pod:131
16668 #: ../src/guestfs-availability.pod:133
16669 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16673 #: ../src/guestfs-availability.pod:137
16674 msgid "B<zerofree>"
16678 #: ../src/guestfs-availability.pod:139
16679 msgid "The following functions: L</guestfs_zerofree>"
16683 #: ../src/guestfs-structs.pod:1
16684 msgid "guestfs_int_bool"
16688 #: ../src/guestfs-structs.pod:3
16691 " struct guestfs_int_bool {\n"
16699 #: ../src/guestfs-structs.pod:8
16702 " struct guestfs_int_bool_list {\n"
16703 " uint32_t len; /* Number of elements in list. */\n"
16704 " struct guestfs_int_bool *val; /* Elements. */\n"
16710 #: ../src/guestfs-structs.pod:13
16713 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16714 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16719 #: ../src/guestfs-structs.pod:16
16720 msgid "guestfs_lvm_pv"
16724 #: ../src/guestfs-structs.pod:18
16727 " struct guestfs_lvm_pv {\n"
16728 " char *pv_name;\n"
16729 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16730 " char pv_uuid[32];\n"
16732 " uint64_t pv_size;\n"
16733 " uint64_t dev_size;\n"
16734 " uint64_t pv_free;\n"
16735 " uint64_t pv_used;\n"
16736 " char *pv_attr;\n"
16737 " int64_t pv_pe_count;\n"
16738 " int64_t pv_pe_alloc_count;\n"
16739 " char *pv_tags;\n"
16740 " uint64_t pe_start;\n"
16741 " int64_t pv_mda_count;\n"
16742 " uint64_t pv_mda_free;\n"
16748 #: ../src/guestfs-structs.pod:36
16751 " struct guestfs_lvm_pv_list {\n"
16752 " uint32_t len; /* Number of elements in list. */\n"
16753 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16759 #: ../src/guestfs-structs.pod:41
16762 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16763 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16768 #: ../src/guestfs-structs.pod:44
16769 msgid "guestfs_lvm_vg"
16773 #: ../src/guestfs-structs.pod:46
16776 " struct guestfs_lvm_vg {\n"
16777 " char *vg_name;\n"
16778 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16779 " char vg_uuid[32];\n"
16781 " char *vg_attr;\n"
16782 " uint64_t vg_size;\n"
16783 " uint64_t vg_free;\n"
16784 " char *vg_sysid;\n"
16785 " uint64_t vg_extent_size;\n"
16786 " int64_t vg_extent_count;\n"
16787 " int64_t vg_free_count;\n"
16788 " int64_t max_lv;\n"
16789 " int64_t max_pv;\n"
16790 " int64_t pv_count;\n"
16791 " int64_t lv_count;\n"
16792 " int64_t snap_count;\n"
16793 " int64_t vg_seqno;\n"
16794 " char *vg_tags;\n"
16795 " int64_t vg_mda_count;\n"
16796 " uint64_t vg_mda_free;\n"
16802 #: ../src/guestfs-structs.pod:69
16805 " struct guestfs_lvm_vg_list {\n"
16806 " uint32_t len; /* Number of elements in list. */\n"
16807 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16813 #: ../src/guestfs-structs.pod:74
16816 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16817 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16822 #: ../src/guestfs-structs.pod:77
16823 msgid "guestfs_lvm_lv"
16827 #: ../src/guestfs-structs.pod:79
16830 " struct guestfs_lvm_lv {\n"
16831 " char *lv_name;\n"
16832 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16833 " char lv_uuid[32];\n"
16834 " char *lv_attr;\n"
16835 " int64_t lv_major;\n"
16836 " int64_t lv_minor;\n"
16837 " int64_t lv_kernel_major;\n"
16838 " int64_t lv_kernel_minor;\n"
16839 " uint64_t lv_size;\n"
16840 " int64_t seg_count;\n"
16842 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16843 " float snap_percent;\n"
16844 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16845 " float copy_percent;\n"
16846 " char *move_pv;\n"
16847 " char *lv_tags;\n"
16848 " char *mirror_log;\n"
16849 " char *modules;\n"
16855 #: ../src/guestfs-structs.pod:101
16858 " struct guestfs_lvm_lv_list {\n"
16859 " uint32_t len; /* Number of elements in list. */\n"
16860 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16866 #: ../src/guestfs-structs.pod:106
16869 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16870 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16875 #: ../src/guestfs-structs.pod:111
16878 " struct guestfs_stat {\n"
16882 " int64_t nlink;\n"
16887 " int64_t blksize;\n"
16888 " int64_t blocks;\n"
16889 " int64_t atime;\n"
16890 " int64_t mtime;\n"
16891 " int64_t ctime;\n"
16897 #: ../src/guestfs-structs.pod:127
16900 " struct guestfs_stat_list {\n"
16901 " uint32_t len; /* Number of elements in list. */\n"
16902 " struct guestfs_stat *val; /* Elements. */\n"
16908 #: ../src/guestfs-structs.pod:132
16911 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16912 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16917 #: ../src/guestfs-structs.pod:137
16920 " struct guestfs_statvfs {\n"
16921 " int64_t bsize;\n"
16922 " int64_t frsize;\n"
16923 " int64_t blocks;\n"
16924 " int64_t bfree;\n"
16925 " int64_t bavail;\n"
16926 " int64_t files;\n"
16927 " int64_t ffree;\n"
16928 " int64_t favail;\n"
16931 " int64_t namemax;\n"
16937 #: ../src/guestfs-structs.pod:151
16940 " struct guestfs_statvfs_list {\n"
16941 " uint32_t len; /* Number of elements in list. */\n"
16942 " struct guestfs_statvfs *val; /* Elements. */\n"
16948 #: ../src/guestfs-structs.pod:156
16951 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16952 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16957 #: ../src/guestfs-structs.pod:159
16958 msgid "guestfs_dirent"
16962 #: ../src/guestfs-structs.pod:161
16965 " struct guestfs_dirent {\n"
16974 #: ../src/guestfs-structs.pod:167
16977 " struct guestfs_dirent_list {\n"
16978 " uint32_t len; /* Number of elements in list. */\n"
16979 " struct guestfs_dirent *val; /* Elements. */\n"
16985 #: ../src/guestfs-structs.pod:172
16988 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16989 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16994 #: ../src/guestfs-structs.pod:177
16997 " struct guestfs_version {\n"
16998 " int64_t major;\n"
16999 " int64_t minor;\n"
17000 " int64_t release;\n"
17007 #: ../src/guestfs-structs.pod:184
17010 " struct guestfs_version_list {\n"
17011 " uint32_t len; /* Number of elements in list. */\n"
17012 " struct guestfs_version *val; /* Elements. */\n"
17018 #: ../src/guestfs-structs.pod:189
17021 " void guestfs_free_version (struct guestfs_free_version *);\n"
17022 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
17027 #: ../src/guestfs-structs.pod:192
17028 msgid "guestfs_xattr"
17032 #: ../src/guestfs-structs.pod:194
17035 " struct guestfs_xattr {\n"
17036 " char *attrname;\n"
17037 " /* The next two fields describe a byte array. */\n"
17038 " uint32_t attrval_len;\n"
17039 " char *attrval;\n"
17045 #: ../src/guestfs-structs.pod:201
17048 " struct guestfs_xattr_list {\n"
17049 " uint32_t len; /* Number of elements in list. */\n"
17050 " struct guestfs_xattr *val; /* Elements. */\n"
17056 #: ../src/guestfs-structs.pod:206
17059 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
17060 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
17065 #: ../src/guestfs-structs.pod:209
17066 msgid "guestfs_inotify_event"
17070 #: ../src/guestfs-structs.pod:211
17073 " struct guestfs_inotify_event {\n"
17074 " int64_t in_wd;\n"
17075 " uint32_t in_mask;\n"
17076 " uint32_t in_cookie;\n"
17077 " char *in_name;\n"
17083 #: ../src/guestfs-structs.pod:218
17086 " struct guestfs_inotify_event_list {\n"
17087 " uint32_t len; /* Number of elements in list. */\n"
17088 " struct guestfs_inotify_event *val; /* Elements. */\n"
17094 #: ../src/guestfs-structs.pod:223
17097 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
17098 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
17103 #: ../src/guestfs-structs.pod:226
17104 msgid "guestfs_partition"
17108 #: ../src/guestfs-structs.pod:228
17111 " struct guestfs_partition {\n"
17112 " int32_t part_num;\n"
17113 " uint64_t part_start;\n"
17114 " uint64_t part_end;\n"
17115 " uint64_t part_size;\n"
17121 #: ../src/guestfs-structs.pod:235
17124 " struct guestfs_partition_list {\n"
17125 " uint32_t len; /* Number of elements in list. */\n"
17126 " struct guestfs_partition *val; /* Elements. */\n"
17132 #: ../src/guestfs-structs.pod:240
17135 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
17136 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
17141 #: ../src/guestfs-structs.pod:243
17142 msgid "guestfs_application"
17146 #: ../src/guestfs-structs.pod:245
17149 " struct guestfs_application {\n"
17150 " char *app_name;\n"
17151 " char *app_display_name;\n"
17152 " int32_t app_epoch;\n"
17153 " char *app_version;\n"
17154 " char *app_release;\n"
17155 " char *app_install_path;\n"
17156 " char *app_trans_path;\n"
17157 " char *app_publisher;\n"
17158 " char *app_url;\n"
17159 " char *app_source_package;\n"
17160 " char *app_summary;\n"
17161 " char *app_description;\n"
17167 #: ../src/guestfs-structs.pod:260
17170 " struct guestfs_application_list {\n"
17171 " uint32_t len; /* Number of elements in list. */\n"
17172 " struct guestfs_application *val; /* Elements. */\n"
17178 #: ../src/guestfs-structs.pod:265
17181 " void guestfs_free_application (struct guestfs_free_application *);\n"
17182 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
17187 #: ../fish/guestfish.pod:5
17188 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17192 #: ../fish/guestfish.pod:9
17195 " guestfish [--options] [commands]\n"
17200 #: ../fish/guestfish.pod:11
17208 #: ../fish/guestfish.pod:13
17211 " guestfish [--ro|--rw] -a disk.img\n"
17216 #: ../fish/guestfish.pod:15
17219 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17224 #: ../fish/guestfish.pod:17
17227 " guestfish -d libvirt-domain\n"
17232 #: ../fish/guestfish.pod:19
17235 " guestfish [--ro|--rw] -a disk.img -i\n"
17240 #: ../fish/guestfish.pod:21
17243 " guestfish -d libvirt-domain -i\n"
17248 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
17249 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
17254 #: ../fish/guestfish.pod:25
17256 "Using guestfish in read/write mode on live virtual machines can be "
17257 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17258 "option to use guestfish safely if the disk image or virtual machine might be "
17263 #: ../fish/guestfish.pod:32
17265 "Guestfish is a shell and command-line tool for examining and modifying "
17266 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17267 "functionality of the guestfs API, see L<guestfs(3)>."
17271 #: ../fish/guestfish.pod:36
17273 "Guestfish gives you structured access to the libguestfs API, from shell "
17274 "scripts or the command line or interactively. If you want to rescue a "
17275 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17280 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:897
17281 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
17282 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:45
17287 #: ../fish/guestfish.pod:43
17288 msgid "As an interactive shell"
17292 #: ../fish/guestfish.pod:45
17300 #: ../fish/guestfish.pod:47
17303 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17304 " editing virtual machine filesystems.\n"
17309 #: ../fish/guestfish.pod:50
17312 " Type: 'help' for a list of commands\n"
17313 " 'man' to read the manual\n"
17314 " 'quit' to quit the shell\n"
17319 #: ../fish/guestfish.pod:54
17322 " ><fs> add-ro disk.img\n"
17324 " ><fs> list-filesystems\n"
17325 " /dev/sda1: ext4\n"
17326 " /dev/vg_guest/lv_root: ext4\n"
17327 " /dev/vg_guest/lv_swap: swap\n"
17328 " ><fs> mount /dev/vg_guest/lv_root /\n"
17329 " ><fs> cat /etc/fstab\n"
17331 " # Created by anaconda\n"
17338 #: ../fish/guestfish.pod:67
17339 msgid "From shell scripts"
17343 #: ../fish/guestfish.pod:69
17344 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17348 #: ../fish/guestfish.pod:71
17351 " guestfish <<_EOF_\n"
17354 " mount /dev/vg_guest/lv_root /\n"
17355 " write /etc/motd \"Welcome, new users\"\n"
17361 #: ../fish/guestfish.pod:78
17362 msgid "List the LVM logical volumes in a disk image:"
17366 #: ../fish/guestfish.pod:80
17369 " guestfish -a disk.img --ro <<_EOF_\n"
17377 #: ../fish/guestfish.pod:85
17378 msgid "List all the filesystems in a disk image:"
17382 #: ../fish/guestfish.pod:87
17385 " guestfish -a disk.img --ro <<_EOF_\n"
17387 " list-filesystems\n"
17393 #: ../fish/guestfish.pod:92
17394 msgid "On one command line"
17398 #: ../fish/guestfish.pod:94
17399 msgid "Update C</etc/resolv.conf> in a guest:"
17403 #: ../fish/guestfish.pod:96
17407 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17408 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17413 #: ../fish/guestfish.pod:100
17414 msgid "Edit C</boot/grub/grub.conf> interactively:"
17418 #: ../fish/guestfish.pod:102
17421 " guestfish --rw --add disk.img \\\n"
17422 " --mount /dev/vg_guest/lv_root \\\n"
17423 " --mount /dev/sda1:/boot \\\n"
17424 " edit /boot/grub/grub.conf\n"
17429 #: ../fish/guestfish.pod:107
17430 msgid "Mount disks automatically"
17434 #: ../fish/guestfish.pod:109
17436 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17440 #: ../fish/guestfish.pod:112
17443 " guestfish --ro -a disk.img -i cat /etc/group\n"
17448 #: ../fish/guestfish.pod:114
17451 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17456 #: ../fish/guestfish.pod:116
17457 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17461 #: ../fish/guestfish.pod:118
17464 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17469 #: ../fish/guestfish.pod:120
17470 msgid "As a script interpreter"
17474 #: ../fish/guestfish.pod:122
17475 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17479 #: ../fish/guestfish.pod:124
17482 " #!/usr/bin/guestfish -f\n"
17483 " sparse test1.img 100M\n"
17485 " part-disk /dev/sda mbr\n"
17486 " mkfs ext2 /dev/sda1\n"
17491 #: ../fish/guestfish.pod:130
17492 msgid "Start with a prepared disk"
17496 #: ../fish/guestfish.pod:132
17498 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17499 "single ext2-formatted partition:"
17503 #: ../fish/guestfish.pod:135
17506 " guestfish -N fs\n"
17511 #: ../fish/guestfish.pod:137
17512 msgid "To list what is available do:"
17516 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:888
17519 " guestfish -N help | less\n"
17524 #: ../fish/guestfish.pod:141
17525 msgid "Remote control"
17529 #: ../fish/guestfish.pod:143
17532 " eval \"`guestfish --listen`\"\n"
17533 " guestfish --remote add-ro disk.img\n"
17534 " guestfish --remote run\n"
17535 " guestfish --remote lvs\n"
17540 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17541 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
17542 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
17543 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:98
17544 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
17549 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17550 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
17551 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
17552 #: ../tools/virt-tar.pl:106 ../tools/virt-make-fs.pl:161
17553 #: ../tools/virt-list-partitions.pl:62
17558 #: ../fish/guestfish.pod:154
17559 msgid "Displays general help on options."
17563 #: ../fish/guestfish.pod:156
17568 #: ../fish/guestfish.pod:158
17569 msgid "B<--cmd-help>"
17573 #: ../fish/guestfish.pod:160
17574 msgid "Lists all available guestfish commands."
17578 #: ../fish/guestfish.pod:162
17583 #: ../fish/guestfish.pod:164
17584 msgid "B<--cmd-help cmd>"
17588 #: ../fish/guestfish.pod:166
17589 msgid "Displays detailed help on a single command C<cmd>."
17593 #: ../fish/guestfish.pod:168
17594 msgid "B<-a image>"
17598 #: ../fish/guestfish.pod:170
17599 msgid "B<--add image>"
17603 #: ../fish/guestfish.pod:172
17604 msgid "Add a block device or virtual machine image to the shell."
17608 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
17610 "The format of the disk image is auto-detected. To override this and force a "
17611 "particular format use the I<--format=..> option."
17615 #: ../fish/guestfish.pod:177
17617 "Using this flag is mostly equivalent to using the C<add> command, with "
17618 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17619 "the I<--format:...> flag was given."
17623 #: ../fish/guestfish.pod:181
17628 #: ../fish/guestfish.pod:183
17629 msgid "B<--connect URI>"
17633 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
17635 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17636 "URI to use. The default is to use the default libvirt connection."
17640 #: ../fish/guestfish.pod:189
17645 #: ../fish/guestfish.pod:191
17647 "If using the I<--listen> option and a csh-like shell, use this option. See "
17648 "section L</REMOTE CONTROL AND CSH> below."
17652 #: ../fish/guestfish.pod:194
17653 msgid "B<-d libvirt-domain>"
17657 #: ../fish/guestfish.pod:196
17658 msgid "B<--domain libvirt-domain>"
17662 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
17664 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17665 "used, then any libvirt domain can be used. However in write mode, only "
17666 "libvirt domains which are shut down can be named here."
17670 #: ../fish/guestfish.pod:202
17672 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17673 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17674 "if the I<--format:...> flag was given."
17678 #: ../fish/guestfish.pod:206
17683 #: ../fish/guestfish.pod:208
17684 msgid "B<--no-dest-paths>"
17688 #: ../fish/guestfish.pod:210
17690 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17691 "to hit the tab key to complete paths on the guest filesystem, but this "
17692 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17693 "allow this feature to be disabled."
17697 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
17698 msgid "B<--echo-keys>"
17702 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
17704 "When prompting for keys and passphrases, guestfish normally turns echoing "
17705 "off so you cannot see what you are typing. If you are not worried about "
17706 "Tempest attacks and there is no one else in the room you can specify this "
17707 "flag to see what you are typing."
17711 #: ../fish/guestfish.pod:222
17716 #: ../fish/guestfish.pod:224
17717 msgid "B<--file file>"
17721 #: ../fish/guestfish.pod:226
17722 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17726 #: ../fish/guestfish.pod:229
17729 " #!/usr/bin/guestfish -f\n"
17734 #: ../fish/guestfish.pod:231
17735 msgid "B<--format=raw|qcow2|..>"
17739 #: ../fish/guestfish.pod:233
17740 msgid "B<--format>"
17744 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
17746 "The default for the I<-a> option is to auto-detect the format of the disk "
17747 "image. Using this forces the disk format for I<-a> options which follow on "
17748 "the command line. Using I<--format> with no argument switches back to auto-"
17749 "detection for subsequent I<-a> options."
17753 #: ../fish/guestfish.pod:240 ../fish/guestfish.pod:594
17754 msgid "For example:"
17758 #: ../fish/guestfish.pod:242
17761 " guestfish --format=raw -a disk.img\n"
17766 #: ../fish/guestfish.pod:244
17767 msgid "forces raw format (no auto-detection) for C<disk.img>."
17771 #: ../fish/guestfish.pod:246
17774 " guestfish --format=raw -a disk.img --format -a another.img\n"
17779 #: ../fish/guestfish.pod:248
17781 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17782 "detection for C<another.img>."
17786 #: ../fish/guestfish.pod:251
17788 "If you have untrusted raw-format guest disk images, you should use this "
17789 "option to specify the disk format. This avoids a possible security problem "
17790 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17794 #: ../fish/guestfish.pod:256
17799 #: ../fish/guestfish.pod:258
17800 msgid "B<--inspector>"
17804 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
17806 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17807 "system and mount filesystems as they would be mounted on the real virtual "
17812 #: ../fish/guestfish.pod:264
17813 msgid "Typical usage is either:"
17817 #: ../fish/guestfish.pod:266
17820 " guestfish -d myguest -i\n"
17825 #: ../fish/guestfish.pod:268
17826 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17830 #: ../fish/guestfish.pod:270
17833 " guestfish --ro -d myguest -i\n"
17838 #: ../fish/guestfish.pod:272
17839 msgid "(for active domains, readonly), or specify the block device directly:"
17843 #: ../fish/guestfish.pod:274
17846 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17851 #: ../fish/guestfish.pod:276
17853 "Note that the command line syntax changed slightly over older versions of "
17854 "guestfish. You can still use the old syntax:"
17858 #: ../fish/guestfish.pod:279
17861 " guestfish [--ro] -i disk.img\n"
17866 #: ../fish/guestfish.pod:281
17869 " guestfish [--ro] -i libvirt-domain\n"
17874 #: ../fish/guestfish.pod:283
17876 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17877 "then using other commands to mount the filesystems that were found."
17881 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
17882 msgid "B<--keys-from-stdin>"
17886 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
17888 "Read key or passphrase parameters from stdin. The default is to try to read "
17889 "passphrases from the user by opening C</dev/tty>."
17893 #: ../fish/guestfish.pod:292
17894 msgid "B<--listen>"
17898 #: ../fish/guestfish.pod:294
17900 "Fork into the background and listen for remote commands. See section L</"
17901 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17905 #: ../fish/guestfish.pod:297
17906 msgid "B<-m dev[:mountpoint]>"
17910 #: ../fish/guestfish.pod:299
17911 msgid "B<--mount dev[:mountpoint]>"
17915 #: ../fish/guestfish.pod:301
17916 msgid "Mount the named partition or logical volume on the given mountpoint."
17920 #: ../fish/guestfish.pod:303
17921 msgid "If the mountpoint is omitted, it defaults to C</>."
17925 #: ../fish/guestfish.pod:305
17926 msgid "You have to mount something on C</> before most commands will work."
17930 #: ../fish/guestfish.pod:307
17932 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17937 #: ../fish/guestfish.pod:310
17939 "If you don't know what filesystems a disk image contains, you can either run "
17940 "guestfish without this option, then list the partitions, filesystems and LVs "
17941 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17942 "commands), or you can use the L<virt-filesystems(1)> program."
17946 #: ../fish/guestfish.pod:316
17948 "Using this flag is mostly equivalent to using the C<mount-options> command "
17949 "or the C<mount-ro> command if the I<--ro> flag was given."
17953 #: ../fish/guestfish.pod:319
17958 #: ../fish/guestfish.pod:321
17959 msgid "B<--no-sync>"
17963 #: ../fish/guestfish.pod:323
17965 "Disable autosync. This is enabled by default. See the discussion of "
17966 "autosync in the L<guestfs(3)> manpage."
17970 #: ../fish/guestfish.pod:326
17975 #: ../fish/guestfish.pod:328
17976 msgid "B<--new type>"
17980 #: ../fish/guestfish.pod:330
17985 #: ../fish/guestfish.pod:332
17987 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17988 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17989 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17994 #: ../fish/guestfish.pod:337
17995 msgid "B<--progress-bars>"
17999 #: ../fish/guestfish.pod:339
18000 msgid "Enable progress bars, even when guestfish is used non-interactively."
18004 #: ../fish/guestfish.pod:341
18006 "Progress bars are enabled by default when guestfish is used as an "
18007 "interactive shell."
18011 #: ../fish/guestfish.pod:344
18012 msgid "B<--no-progress-bars>"
18016 #: ../fish/guestfish.pod:346
18017 msgid "Disable progress bars."
18021 #: ../fish/guestfish.pod:348
18022 msgid "B<--remote[=pid]>"
18026 #: ../fish/guestfish.pod:350
18028 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18029 "CONTROL GUESTFISH OVER A SOCKET> below."
18033 #: ../fish/guestfish.pod:353
18038 #: ../fish/guestfish.pod:355
18043 #: ../fish/guestfish.pod:357
18045 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18046 "mounts are done read-only."
18050 #: ../fish/guestfish.pod:360
18052 "The option must always be used if the disk image or virtual machine might be "
18053 "running, and is generally recommended in cases where you don't need write "
18054 "access to the disk."
18058 #: ../fish/guestfish.pod:364
18060 "Note that prepared disk images created with I<-N> are not affected by this "
18061 "option. Also commands like C<add> are not affected - you have to specify "
18062 "the C<readonly:true> option explicitly if you need it."
18066 #: ../fish/guestfish.pod:368
18067 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18071 #: ../fish/guestfish.pod:370 ../fuse/guestmount.pod:208
18072 msgid "B<--selinux>"
18076 #: ../fish/guestfish.pod:372
18077 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18081 #: ../fish/guestfish.pod:374
18086 #: ../fish/guestfish.pod:376
18087 msgid "B<--verbose>"
18091 #: ../fish/guestfish.pod:378
18093 "Enable very verbose messages. This is particularly useful if you find a bug."
18097 #: ../fish/guestfish.pod:381
18102 #: ../fish/guestfish.pod:383 ../tools/virt-edit.pl:88
18103 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
18104 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:114
18105 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
18106 msgid "B<--version>"
18110 #: ../fish/guestfish.pod:385
18111 msgid "Display the guestfish / libguestfs version number and exit."
18115 #: ../fish/guestfish.pod:387
18120 #: ../fish/guestfish.pod:389
18125 #: ../fish/guestfish.pod:391
18127 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
18132 #: ../fish/guestfish.pod:394
18137 #: ../fish/guestfish.pod:396
18138 msgid "Echo each command before executing it."
18142 #: ../fish/guestfish.pod:400
18143 msgid "COMMANDS ON COMMAND LINE"
18147 #: ../fish/guestfish.pod:402
18149 "Any additional (non-option) arguments are treated as commands to execute."
18153 #: ../fish/guestfish.pod:405
18155 "Commands to execute should be separated by a colon (C<:>), where the colon "
18156 "is a separate parameter. Thus:"
18160 #: ../fish/guestfish.pod:408
18163 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18168 #: ../fish/guestfish.pod:410
18170 "If there are no additional arguments, then we enter a shell, either an "
18171 "interactive shell with a prompt (if the input is a terminal) or a non-"
18172 "interactive shell."
18176 #: ../fish/guestfish.pod:414
18178 "In either command line mode or non-interactive shell, the first command that "
18179 "gives an error causes the whole shell to exit. In interactive mode (with a "
18180 "prompt) if a command fails, you can continue to enter commands."
18184 #: ../fish/guestfish.pod:419
18185 msgid "USING launch (OR run)"
18189 #: ../fish/guestfish.pod:421
18191 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18192 "then launch it, then mount any disks you need, and finally issue actions/"
18193 "commands. So the general order of the day is:"
18197 #: ../fish/guestfish.pod:429
18198 msgid "add or -a/--add"
18202 #: ../fish/guestfish.pod:433
18203 msgid "launch (aka run)"
18207 #: ../fish/guestfish.pod:437
18208 msgid "mount or -m/--mount"
18212 #: ../fish/guestfish.pod:441
18213 msgid "any other commands"
18217 #: ../fish/guestfish.pod:445
18219 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18220 "guest before mounting or performing any other commands."
18224 #: ../fish/guestfish.pod:448
18226 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18227 "I<--new> options were given then C<run> is done automatically, simply "
18228 "because guestfish can't perform the action you asked for without doing this."
18232 #: ../fish/guestfish.pod:453
18233 msgid "OPENING DISKS FOR READ AND WRITE"
18237 #: ../fish/guestfish.pod:455
18239 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
18240 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
18241 "open disk images read-only or for writing."
18245 #: ../fish/guestfish.pod:459
18247 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
18248 "disk images supplied on the command line for write. To open a disk image "
18249 "read-only you have to do I<-a image --ro>."
18253 #: ../fish/guestfish.pod:463
18255 "This matters: If you accidentally open a live VM disk image writable then "
18256 "you will cause irreversible disk corruption."
18260 #: ../fish/guestfish.pod:466
18262 "By libguestfs 1.8 we intend to change the default the other way. Disk "
18263 "images will be opened read-only. You will have to either specify "
18264 "I<guestfish --rw> or change a configuration file in order to get write "
18265 "access for disk images specified by those other command line options."
18269 #: ../fish/guestfish.pod:471
18271 "This version of guestfish has a I<--rw> option which does nothing (it is "
18272 "already the default). However it is highly recommended that you use this "
18273 "option to indicate that guestfish needs write access, and to prepare your "
18274 "scripts for the day when this option will be required for write access."
18278 #: ../fish/guestfish.pod:477
18280 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18281 "other libguestfs program apart from guestfish and guestmount."
18285 #: ../fish/guestfish.pod:480
18290 #: ../fish/guestfish.pod:482
18292 "You can quote ordinary parameters using either single or double quotes. For "
18297 #: ../fish/guestfish.pod:485
18300 " add \"file with a space.img\"\n"
18305 #: ../fish/guestfish.pod:487
18308 " rm '/file name'\n"
18313 #: ../fish/guestfish.pod:489
18321 #: ../fish/guestfish.pod:491
18323 "A few commands require a list of strings to be passed. For these, use a "
18324 "whitespace-separated list, enclosed in quotes. Strings containing "
18325 "whitespace to be passed through must be enclosed in single quotes. A "
18326 "literal single quote must be escaped with a backslash."
18330 #: ../fish/guestfish.pod:496
18333 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18334 " command \"/bin/echo 'foo bar'\"\n"
18335 " command \"/bin/echo \\'foo\\'\"\n"
18340 #: ../fish/guestfish.pod:500
18341 msgid "OPTIONAL ARGUMENTS"
18345 #: ../fish/guestfish.pod:502
18347 "Some commands take optional arguments. These arguments appear in this "
18348 "documentation as C<[argname:..]>. You can use them as in these examples:"
18352 #: ../fish/guestfish.pod:506
18355 " add-drive-opts filename\n"
18360 #: ../fish/guestfish.pod:508
18363 " add-drive-opts filename readonly:true\n"
18368 #: ../fish/guestfish.pod:510
18371 " add-drive-opts filename format:qcow2 readonly:false\n"
18376 #: ../fish/guestfish.pod:512
18378 "Each optional argument can appear at most once. All optional arguments must "
18379 "appear after the required ones."
18383 #: ../fish/guestfish.pod:515
18388 #: ../fish/guestfish.pod:517
18390 "This section applies to all commands which can take integers as parameters."
18394 #: ../fish/guestfish.pod:520
18395 msgid "SIZE SUFFIX"
18399 #: ../fish/guestfish.pod:522
18401 "When the command takes a parameter measured in bytes, you can use one of the "
18402 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18406 #: ../fish/guestfish.pod:528
18407 msgid "B<k> or B<K> or B<KiB>"
18411 #: ../fish/guestfish.pod:530
18412 msgid "The size in kilobytes (multiplied by 1024)."
18416 #: ../fish/guestfish.pod:532
18421 #: ../fish/guestfish.pod:534
18422 msgid "The size in SI 1000 byte units."
18426 #: ../fish/guestfish.pod:536
18427 msgid "B<M> or B<MiB>"
18431 #: ../fish/guestfish.pod:538
18432 msgid "The size in megabytes (multiplied by 1048576)."
18436 #: ../fish/guestfish.pod:540
18441 #: ../fish/guestfish.pod:542
18442 msgid "The size in SI 1000000 byte units."
18446 #: ../fish/guestfish.pod:544
18447 msgid "B<G> or B<GiB>"
18451 #: ../fish/guestfish.pod:546
18452 msgid "The size in gigabytes (multiplied by 2**30)."
18456 #: ../fish/guestfish.pod:548
18461 #: ../fish/guestfish.pod:550
18462 msgid "The size in SI 10**9 byte units."
18466 #: ../fish/guestfish.pod:552
18467 msgid "B<T> or B<TiB>"
18471 #: ../fish/guestfish.pod:554
18472 msgid "The size in terabytes (multiplied by 2**40)."
18476 #: ../fish/guestfish.pod:556
18481 #: ../fish/guestfish.pod:558
18482 msgid "The size in SI 10**12 byte units."
18486 #: ../fish/guestfish.pod:560
18487 msgid "B<P> or B<PiB>"
18491 #: ../fish/guestfish.pod:562
18492 msgid "The size in petabytes (multiplied by 2**50)."
18496 #: ../fish/guestfish.pod:564
18501 #: ../fish/guestfish.pod:566
18502 msgid "The size in SI 10**15 byte units."
18506 #: ../fish/guestfish.pod:568
18507 msgid "B<E> or B<EiB>"
18511 #: ../fish/guestfish.pod:570
18512 msgid "The size in exabytes (multiplied by 2**60)."
18516 #: ../fish/guestfish.pod:572
18521 #: ../fish/guestfish.pod:574
18522 msgid "The size in SI 10**18 byte units."
18526 #: ../fish/guestfish.pod:576
18527 msgid "B<Z> or B<ZiB>"
18531 #: ../fish/guestfish.pod:578
18532 msgid "The size in zettabytes (multiplied by 2**70)."
18536 #: ../fish/guestfish.pod:580
18541 #: ../fish/guestfish.pod:582
18542 msgid "The size in SI 10**21 byte units."
18546 #: ../fish/guestfish.pod:584
18547 msgid "B<Y> or B<YiB>"
18551 #: ../fish/guestfish.pod:586
18552 msgid "The size in yottabytes (multiplied by 2**80)."
18556 #: ../fish/guestfish.pod:588
18561 #: ../fish/guestfish.pod:590
18562 msgid "The size in SI 10**24 byte units."
18566 #: ../fish/guestfish.pod:596
18569 " truncate-size /file 1G\n"
18574 #: ../fish/guestfish.pod:598
18575 msgid "would truncate the file to 1 gigabyte."
18579 #: ../fish/guestfish.pod:600
18581 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18582 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18583 "suffix will probably not do what you expect."
18587 #: ../fish/guestfish.pod:604
18588 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18592 #: ../fish/guestfish.pod:606
18594 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18595 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18599 #: ../fish/guestfish.pod:609
18602 " 1234 decimal number 1234\n"
18603 " 02322 octal number, equivalent to decimal 1234\n"
18604 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18609 #: ../fish/guestfish.pod:613
18611 "When using the C<chmod> command, you almost always want to specify an octal "
18612 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18613 "L<chmod(1)> program):"
18617 #: ../fish/guestfish.pod:617
18620 " chmod 0777 /public # OK\n"
18621 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18626 #: ../fish/guestfish.pod:620
18628 "Commands that return numbers usually print them in decimal, but some "
18629 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18630 "octal, preceeded by C<0>)."
18634 #: ../fish/guestfish.pod:624
18635 msgid "WILDCARDS AND GLOBBING"
18639 #: ../fish/guestfish.pod:626
18641 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18642 "(globbing) by default. So for example the following will not do what you "
18647 #: ../fish/guestfish.pod:630
18655 #: ../fish/guestfish.pod:632
18657 "Assuming you don't have a directory called literally C</home/*> then the "
18658 "above command will return an error."
18662 #: ../fish/guestfish.pod:635
18663 msgid "To perform wildcard expansion, use the C<glob> command."
18667 #: ../fish/guestfish.pod:637
18670 " glob rm-rf /home/*\n"
18675 #: ../fish/guestfish.pod:639
18677 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18678 "many times), equivalent to:"
18682 #: ../fish/guestfish.pod:642
18685 " rm-rf /home/jim\n"
18686 " rm-rf /home/joe\n"
18687 " rm-rf /home/mary\n"
18692 #: ../fish/guestfish.pod:646
18693 msgid "C<glob> only works on simple guest paths and not on device names."
18697 #: ../fish/guestfish.pod:648
18699 "If you have several parameters, each containing a wildcard, then glob will "
18700 "perform a Cartesian product."
18704 #: ../fish/guestfish.pod:651
18709 #: ../fish/guestfish.pod:653
18711 "Any line which starts with a I<#> character is treated as a comment and "
18712 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18713 "a command. For example:"
18717 #: ../fish/guestfish.pod:657
18720 " # this is a comment\n"
18721 " # this is a comment\n"
18722 " foo # NOT a comment\n"
18727 #: ../fish/guestfish.pod:661
18728 msgid "Blank lines are also ignored."
18732 #: ../fish/guestfish.pod:663
18733 msgid "RUNNING COMMANDS LOCALLY"
18737 #: ../fish/guestfish.pod:665
18739 "Any line which starts with a I<!> character is treated as a command sent to "
18740 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18744 #: ../fish/guestfish.pod:669
18748 " tgz-out /remote local/remote-data.tar.gz\n"
18753 #: ../fish/guestfish.pod:672
18755 "will create a directory C<local> on the host, and then export the contents "
18756 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18757 "(See C<tgz-out>)."
18761 #: ../fish/guestfish.pod:676
18763 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18764 "effect, due to the way that subprocesses work in Unix."
18768 #: ../fish/guestfish.pod:679
18773 #: ../fish/guestfish.pod:681
18775 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18776 "command (a guestfish command) to the second command (any host command). For "
18781 #: ../fish/guestfish.pod:685
18784 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18789 #: ../fish/guestfish.pod:687
18791 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18792 "program). The above command would list all accounts in the guest filesystem "
18793 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18797 #: ../fish/guestfish.pod:692
18800 " hexdump /bin/ls | head\n"
18801 " list-devices | tail -1\n"
18802 " tgz-out / - | tar ztf -\n"
18807 #: ../fish/guestfish.pod:696
18809 "The space before the pipe symbol is required, any space after the pipe "
18810 "symbol is optional. Everything after the pipe symbol is just passed "
18811 "straight to the host shell, so it can contain redirections, globs and "
18812 "anything else that makes sense on the host side."
18816 #: ../fish/guestfish.pod:701
18818 "To use a literal argument which begins with a pipe symbol, you have to quote "
18823 #: ../fish/guestfish.pod:704
18831 #: ../fish/guestfish.pod:706
18832 msgid "HOME DIRECTORIES"
18836 #: ../fish/guestfish.pod:708
18838 "If a parameter starts with the character C<~> then the tilde may be expanded "
18839 "as a home directory path (either C<~> for the current user's home directory, "
18840 "or C<~user> for another user)."
18844 #: ../fish/guestfish.pod:712
18846 "Note that home directory expansion happens for users known I<on the host>, "
18847 "not in the guest filesystem."
18851 #: ../fish/guestfish.pod:715
18853 "To use a literal argument which begins with a tilde, you have to quote it, "
18858 #: ../fish/guestfish.pod:718
18866 #: ../fish/guestfish.pod:722
18868 "Libguestfs has some support for Linux guests encrypted according to the "
18869 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18870 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18871 "LUKS is supported."
18875 #: ../fish/guestfish.pod:727
18876 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18880 #: ../fish/guestfish.pod:729
18883 " ><fs> vfs-type /dev/sda2\n"
18889 #: ../fish/guestfish.pod:732
18891 "Then open those devices using L</luks-open>. This creates a device-mapper "
18892 "device called C</dev/mapper/luksdev>."
18896 #: ../fish/guestfish.pod:735
18899 " ><fs> luks-open /dev/sda2 luksdev\n"
18900 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18905 #: ../fish/guestfish.pod:738
18907 "Finally you have to tell LVM to scan for volume groups on the newly created "
18912 #: ../fish/guestfish.pod:741
18916 " vg-activate-all true\n"
18921 #: ../fish/guestfish.pod:744
18922 msgid "The logical volume(s) can now be mounted in the usual way."
18926 #: ../fish/guestfish.pod:746
18928 "Before closing a LUKS device you must unmount any logical volumes on it and "
18929 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18930 "one. Then you can close the mapper device:"
18934 #: ../fish/guestfish.pod:750
18937 " vg-activate false /dev/VG\n"
18938 " luks-close /dev/mapper/luksdev\n"
18943 #: ../fish/guestfish.pod:753
18944 msgid "WINDOWS PATHS"
18948 #: ../fish/guestfish.pod:755
18950 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18951 "(with some limitations). The following commands are equivalent:"
18955 #: ../fish/guestfish.pod:758
18958 " file /WINDOWS/system32/config/system.LOG\n"
18963 #: ../fish/guestfish.pod:760
18966 " file win:/windows/system32/config/system.log\n"
18971 #: ../fish/guestfish.pod:762
18974 " file win:\\windows\\system32\\config\\system.log\n"
18979 #: ../fish/guestfish.pod:764
18982 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18987 #: ../fish/guestfish.pod:766
18989 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18990 "handles case insensitivity like Windows would. This only works in argument "
18991 "positions that expect a path."
18995 #: ../fish/guestfish.pod:770
18996 msgid "UPLOADING AND DOWNLOADING FILES"
19000 #: ../fish/guestfish.pod:772
19002 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19003 "others which upload from or download to a local file, you can use the "
19004 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19008 #: ../fish/guestfish.pod:776
19016 #: ../fish/guestfish.pod:778
19018 "reads stdin and creates from that a file C</foo> in the disk image, and:"
19022 #: ../fish/guestfish.pod:781
19025 " tar-out /etc - | tar tf -\n"
19030 #: ../fish/guestfish.pod:783
19032 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19033 "command (see L</PIPES>)."
19037 #: ../fish/guestfish.pod:786
19039 "When using C<-> to read from stdin, the input is read up to the end of "
19040 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19041 "some arbitrary end marker:"
19045 #: ../fish/guestfish.pod:790
19048 " upload -<<END /foo\n"
19057 #: ../fish/guestfish.pod:796
19059 "Any string of characters can be used instead of C<END>. The end marker must "
19060 "appear on a line of its own, without any preceeding or following characters "
19061 "(not even spaces)."
19065 #: ../fish/guestfish.pod:800
19067 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19068 "upload local files (so-called \"FileIn\" parameters in the generator)."
19072 #: ../fish/guestfish.pod:803
19073 msgid "EXIT ON ERROR BEHAVIOUR"
19077 #: ../fish/guestfish.pod:805
19079 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19080 "taking commands from a human over a tty), and will exit on the first error "
19081 "in non-interactive mode (scripts, commands given on the command line)."
19085 #: ../fish/guestfish.pod:810
19087 "If you prefix a command with a I<-> character, then that command will not "
19088 "cause guestfish to exit, even if that (one) command returns an error."
19092 #: ../fish/guestfish.pod:814
19093 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19097 #: ../fish/guestfish.pod:816
19099 "Guestfish can be remote-controlled over a socket. This is useful "
19100 "particularly in shell scripts where you want to make several different "
19101 "changes to a filesystem, but you don't want the overhead of starting up a "
19102 "guestfish process each time."
19106 #: ../fish/guestfish.pod:821
19107 msgid "Start a guestfish server process using:"
19111 #: ../fish/guestfish.pod:823
19114 " eval \"`guestfish --listen`\"\n"
19119 #: ../fish/guestfish.pod:825
19120 msgid "and then send it commands by doing:"
19124 #: ../fish/guestfish.pod:827
19127 " guestfish --remote cmd [...]\n"
19132 #: ../fish/guestfish.pod:829
19133 msgid "To cause the server to exit, send it the exit command:"
19137 #: ../fish/guestfish.pod:831
19140 " guestfish --remote exit\n"
19145 #: ../fish/guestfish.pod:833
19147 "Note that the server will normally exit if there is an error in a command. "
19148 "You can change this in the usual way. See section L</EXIT ON ERROR "
19153 #: ../fish/guestfish.pod:837
19154 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19158 #: ../fish/guestfish.pod:839
19160 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19161 "is how the I<--remote> option knows where to send the commands. You can "
19162 "have several guestfish listener processes running using:"
19166 #: ../fish/guestfish.pod:843
19169 " eval \"`guestfish --listen`\"\n"
19170 " pid1=$GUESTFISH_PID\n"
19171 " eval \"`guestfish --listen`\"\n"
19172 " pid2=$GUESTFISH_PID\n"
19174 " guestfish --remote=$pid1 cmd\n"
19175 " guestfish --remote=$pid2 cmd\n"
19180 #: ../fish/guestfish.pod:851
19181 msgid "REMOTE CONTROL AND CSH"
19185 #: ../fish/guestfish.pod:853
19187 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19192 #: ../fish/guestfish.pod:856
19195 " eval \"`guestfish --listen --csh`\"\n"
19200 #: ../fish/guestfish.pod:858
19201 msgid "REMOTE CONTROL DETAILS"
19205 #: ../fish/guestfish.pod:860
19207 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
19208 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
19209 "and C<$PID> is the process ID of the server."
19213 #: ../fish/guestfish.pod:864
19214 msgid "Guestfish client and server versions must match exactly."
19218 #: ../fish/guestfish.pod:866
19219 msgid "PREPARED DISK IMAGES"
19223 #: ../fish/guestfish.pod:868
19225 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19226 "preformatted disk images that guestfish can make for you to save typing. "
19227 "This is particularly useful for testing purposes. This option is used "
19228 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19229 "can be mixed with I<-a>)."
19233 #: ../fish/guestfish.pod:874
19235 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19236 "the second and so on. Existing files in the current directory are "
19241 #: ../fish/guestfish.pod:878
19243 "The type briefly describes how the disk should be sized, partitioned, how "
19244 "filesystem(s) should be created, and how content should be added. "
19245 "Optionally the type can be followed by extra parameters, separated by C<:> "
19246 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
19247 "allocated disk, containing a single partition, with the partition formatted "
19248 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
19253 #: ../fish/guestfish.pod:886
19254 msgid "To list the available types and any extra parameters they take, run:"
19258 #: ../fish/guestfish.pod:890
19260 "Note that the prepared filesystem is not mounted. You would usually have to "
19261 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19265 #: ../fish/guestfish.pod:894
19267 "If any I<-N> or I<--new> options are given, the guest is automatically "
19272 #: ../fish/guestfish.pod:899
19273 msgid "Create a 100MB disk with an ext4-formatted partition:"
19277 #: ../fish/guestfish.pod:901
19280 " guestfish -N fs:ext4\n"
19285 #: ../fish/guestfish.pod:903
19286 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19290 #: ../fish/guestfish.pod:905
19293 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19298 #: ../fish/guestfish.pod:907
19299 msgid "Create a blank 200MB disk:"
19303 #: ../fish/guestfish.pod:909
19306 " guestfish -N disk:200M\n"
19311 #: ../fish/guestfish.pod:911
19312 msgid "PROGRESS BARS"
19316 #: ../fish/guestfish.pod:913
19318 "Some (not all) long-running commands send progress notification messages as "
19319 "they are running. Guestfish turns these messages into progress bars."
19323 #: ../fish/guestfish.pod:917
19325 "When a command that supports progress bars takes longer than two seconds to "
19326 "run, and if progress bars are enabled, then you will see one appearing below "
19331 #: ../fish/guestfish.pod:921
19334 " ><fs> copy-size /large-file /another-file 2048M\n"
19335 " / 10% [#####-----------------------------------------] 00:30\n"
19340 #: ../fish/guestfish.pod:924
19342 "The spinner on the left hand side moves round once for every progress "
19343 "notification received from the backend. This is a (reasonably) golden "
19344 "assurance that the command is \"doing something\" even if the progress bar "
19345 "is not moving, because the command is able to send the progress "
19346 "notifications. When the bar reaches 100% and the command finishes, the "
19347 "spinner disappears."
19351 #: ../fish/guestfish.pod:931
19353 "Progress bars are enabled by default when guestfish is used interactively. "
19354 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19355 "and you can disable them completely using I<--no-progress-bars>."
19359 #: ../fish/guestfish.pod:936
19360 msgid "GUESTFISH COMMANDS"
19364 #: ../fish/guestfish.pod:938
19366 "The commands in this section are guestfish convenience commands, in other "
19367 "words, they are not part of the L<guestfs(3)> API."
19371 #: ../fish/guestfish.pod:941
19376 #: ../fish/guestfish.pod:943
19385 #: ../fish/guestfish.pod:946
19386 msgid "Without any parameter, this provides general help."
19390 #: ../fish/guestfish.pod:948
19391 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19395 #: ../fish/guestfish.pod:950
19396 msgid "quit | exit"
19400 #: ../fish/guestfish.pod:952
19401 msgid "This exits guestfish. You can also use C<^D> key."
19405 #: ../fish/guestfish.pod:954
19406 msgid "@FISH_COMMANDS@"
19410 #: ../fish/guestfish.pod:956
19415 #: ../fish/guestfish.pod:960 ../test-tool/libguestfs-test-tool.pod:83
19420 #: ../fish/guestfish.pod:962
19422 "guestfish returns 0 if the commands completed without error, or 1 if there "
19427 #: ../fish/guestfish.pod:969
19432 #: ../fish/guestfish.pod:971
19434 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19439 #: ../fish/guestfish.pod:974
19440 msgid "GUESTFISH_PID"
19444 #: ../fish/guestfish.pod:976
19446 "Used with the I<--remote> option to specify the remote guestfish process to "
19447 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19451 #: ../fish/guestfish.pod:980
19456 #: ../fish/guestfish.pod:982
19458 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19459 "not specified, the external L<hexedit(1)> program is used."
19463 #: ../fish/guestfish.pod:986
19468 #: ../fish/guestfish.pod:988
19470 "If compiled with GNU readline support, various files in the home directory "
19471 "can be used. See L</FILES>."
19475 #: ../fish/guestfish.pod:997
19477 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19478 "effect as using the B<-v> option."
19482 #: ../fish/guestfish.pod:1009
19484 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19485 "the discussion of paths in L<guestfs(3)>."
19489 #: ../fish/guestfish.pod:1020
19490 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19494 #: ../fish/guestfish.pod:1022
19499 #: ../fish/guestfish.pod:1024
19501 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19506 #: ../fish/guestfish.pod:1039 ../test-tool/libguestfs-test-tool.pod:88
19511 #: ../fish/guestfish.pod:1043
19512 msgid "$HOME/.guestfish"
19516 #: ../fish/guestfish.pod:1045
19518 "If compiled with GNU readline support, then the command history is saved in "
19523 #: ../fish/guestfish.pod:1048
19524 msgid "$HOME/.inputrc"
19528 #: ../fish/guestfish.pod:1050
19529 msgid "/etc/inputrc"
19533 #: ../fish/guestfish.pod:1052
19535 "If compiled with GNU readline support, then these files can be used to "
19536 "configure readline. For further information, please see L<readline(3)/"
19537 "INITIALIZATION FILE>."
19541 #: ../fish/guestfish.pod:1056
19542 msgid "To write rules which only apply to guestfish, use:"
19546 #: ../fish/guestfish.pod:1058
19556 #: ../fish/guestfish.pod:1062
19558 "Variables that you can set in inputrc that change the behaviour of guestfish "
19559 "in useful ways include:"
19563 #: ../fish/guestfish.pod:1067
19564 msgid "completion-ignore-case (default: on)"
19568 #: ../fish/guestfish.pod:1069
19570 "By default, guestfish will ignore case when tab-completing paths on the "
19575 #: ../fish/guestfish.pod:1072
19578 " set completion-ignore-case off\n"
19583 #: ../fish/guestfish.pod:1074
19584 msgid "to make guestfish case sensitive."
19588 #: ../fish/guestfish.pod:1078
19593 #: ../fish/guestfish.pod:1080
19594 msgid "test2.img (etc)"
19598 #: ../fish/guestfish.pod:1082
19600 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19601 "will be created in the file C<test1.img> in the current directory. The "
19602 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19603 "the same name will be overwritten."
19607 #: ../fish/guestfish.pod:1091
19609 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19610 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
19611 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
19612 ">, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, "
19617 #: ../fish/guestfish.pod:1117 ../test-tool/libguestfs-test-tool.pod:124
19618 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370
19619 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512
19620 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:300
19621 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
19623 "This program is free software; you can redistribute it and/or modify it "
19624 "under the terms of the GNU General Public License as published by the Free "
19625 "Software Foundation; either version 2 of the License, or (at your option) "
19626 "any later version."
19630 #: ../fish/guestfish.pod:1122 ../test-tool/libguestfs-test-tool.pod:129
19631 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375
19632 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517
19633 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:305
19634 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
19636 "This program is distributed in the hope that it will be useful, but WITHOUT "
19637 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19638 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19643 #: ../fish/guestfish.pod:1127 ../test-tool/libguestfs-test-tool.pod:134
19644 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380
19645 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522
19646 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:310
19647 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
19649 "You should have received a copy of the GNU General Public License along with "
19650 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19651 "Ave, Cambridge, MA 02139, USA."
19655 #: ../fish/guestfish-actions.pod:1
19660 #: ../fish/guestfish-actions.pod:3
19663 " add-cdrom filename\n"
19668 #: ../fish/guestfish-actions.pod:15
19670 "This call checks for the existence of C<filename>. This stops you from "
19671 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19672 "and C<http:> URLs. To specify those, use the general L</config> call "
19677 #: ../fish/guestfish-actions.pod:22
19679 "If you just want to add an ISO file (often you use this as an efficient way "
19680 "to transfer large files into the guest), then you should probably use L</add-"
19681 "drive-ro> instead."
19685 #: ../fish/guestfish-actions.pod:35
19690 #: ../fish/guestfish-actions.pod:37
19695 #: ../fish/guestfish-actions.pod:39
19698 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19703 #: ../fish/guestfish-actions.pod:41
19705 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19706 "It works by connecting to libvirt, requesting the domain and domain XML from "
19707 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19711 #: ../fish/guestfish-actions.pod:58
19713 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19714 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19715 "libvirt URI (or one set through an environment variable, see the libvirt "
19716 "documentation for full details). If you are using the C API directly then "
19717 "it is more flexible to create the libvirt connection object yourself, get "
19718 "the domain object, and call L</add-libvirt-dom>."
19722 #: ../fish/guestfish-actions.pod:66
19724 "The other optional parameters are passed directly through to L</add-drive-"
19729 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19730 #: ../fish/guestfish-actions.pod:2844
19732 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19736 #: ../fish/guestfish-actions.pod:71
19741 #: ../fish/guestfish-actions.pod:73
19744 " add-drive filename\n"
19749 #: ../fish/guestfish-actions.pod:75
19751 "This function is the equivalent of calling L</add-drive-opts> with no "
19752 "optional parameters, so the disk is added writable, with the format being "
19753 "detected automatically."
19757 #: ../fish/guestfish-actions.pod:79
19759 "Automatic detection of the format opens you up to a potential security hole "
19760 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19761 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19762 "you should think about replacing calls to this function with calls to L</add-"
19763 "drive-opts>, and specifying the format."
19767 #: ../fish/guestfish-actions.pod:86
19768 msgid "add-drive-opts"
19772 #: ../fish/guestfish-actions.pod:88
19777 #: ../fish/guestfish-actions.pod:90
19780 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19785 #: ../fish/guestfish-actions.pod:117
19787 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19788 "add-drive-ro>) then the format is automatically detected. Possible formats "
19789 "include C<raw> and C<qcow2>."
19793 #: ../fish/guestfish-actions.pod:128
19795 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19796 "add-drive-with-if> call (q.v.)"
19800 #: ../fish/guestfish-actions.pod:135
19801 msgid "add-drive-ro"
19805 #: ../fish/guestfish-actions.pod:137
19810 #: ../fish/guestfish-actions.pod:139
19813 " add-drive-ro filename\n"
19818 #: ../fish/guestfish-actions.pod:141
19820 "This function is the equivalent of calling L</add-drive-opts> with the "
19821 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19822 "is added read-only, with the format being detected automatically."
19826 #: ../fish/guestfish-actions.pod:146
19827 msgid "add-drive-ro-with-if"
19831 #: ../fish/guestfish-actions.pod:148
19834 " add-drive-ro-with-if filename iface\n"
19839 #: ../fish/guestfish-actions.pod:150
19841 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19842 "interface emulation to use at run time."
19846 #: ../fish/guestfish-actions.pod:160
19847 msgid "add-drive-with-if"
19851 #: ../fish/guestfish-actions.pod:162
19854 " add-drive-with-if filename iface\n"
19859 #: ../fish/guestfish-actions.pod:164
19861 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19862 "interface emulation to use at run time."
19866 #: ../fish/guestfish-actions.pod:174
19871 #: ../fish/guestfish-actions.pod:176
19874 " aug-clear augpath\n"
19879 #: ../fish/guestfish-actions.pod:181
19884 #: ../fish/guestfish-actions.pod:183
19892 #: ../fish/guestfish-actions.pod:185
19894 "Close the current Augeas handle and free up any resources used by it. After "
19895 "calling this, you have to call L</aug-init> again before you can use any "
19896 "other Augeas functions."
19900 #: ../fish/guestfish-actions.pod:190
19901 msgid "aug-defnode"
19905 #: ../fish/guestfish-actions.pod:192
19908 " aug-defnode name expr val\n"
19913 #: ../fish/guestfish-actions.pod:197
19915 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19916 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19917 "containing that single node."
19921 #: ../fish/guestfish-actions.pod:205
19926 #: ../fish/guestfish-actions.pod:207
19929 " aug-defvar name expr\n"
19934 #: ../fish/guestfish-actions.pod:216
19939 #: ../fish/guestfish-actions.pod:218
19942 " aug-get augpath\n"
19947 #: ../fish/guestfish-actions.pod:223
19952 #: ../fish/guestfish-actions.pod:225
19955 " aug-init root flags\n"
19960 #: ../fish/guestfish-actions.pod:231
19961 msgid "You must call this before using any other L</aug-*> commands."
19965 #: ../fish/guestfish-actions.pod:266
19966 msgid "Do not load the tree in L</aug-init>."
19970 #: ../fish/guestfish-actions.pod:270
19971 msgid "To close the handle, you can call L</aug-close>."
19975 #: ../fish/guestfish-actions.pod:274
19980 #: ../fish/guestfish-actions.pod:276
19983 " aug-insert augpath label true|false\n"
19988 #: ../fish/guestfish-actions.pod:286
19993 #: ../fish/guestfish-actions.pod:288
20001 #: ../fish/guestfish-actions.pod:295
20006 #: ../fish/guestfish-actions.pod:297
20009 " aug-ls augpath\n"
20014 #: ../fish/guestfish-actions.pod:299
20016 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
20017 "resulting nodes into alphabetical order."
20021 #: ../fish/guestfish-actions.pod:302
20026 #: ../fish/guestfish-actions.pod:304
20029 " aug-match augpath\n"
20034 #: ../fish/guestfish-actions.pod:310
20039 #: ../fish/guestfish-actions.pod:312
20042 " aug-mv src dest\n"
20047 #: ../fish/guestfish-actions.pod:317
20052 #: ../fish/guestfish-actions.pod:319
20055 " aug-rm augpath\n"
20060 #: ../fish/guestfish-actions.pod:325
20065 #: ../fish/guestfish-actions.pod:327
20073 #: ../fish/guestfish-actions.pod:331
20075 "The flags which were passed to L</aug-init> affect exactly how files are "
20080 #: ../fish/guestfish-actions.pod:334
20085 #: ../fish/guestfish-actions.pod:336
20088 " aug-set augpath val\n"
20093 #: ../fish/guestfish-actions.pod:340
20095 "In the Augeas API, it is possible to clear a node by setting the value to "
20096 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
20097 "this call. Instead you must use the L</aug-clear> call."
20101 #: ../fish/guestfish-actions.pod:345
20106 #: ../fish/guestfish-actions.pod:347
20109 " available 'groups ...'\n"
20114 #: ../fish/guestfish-actions.pod:353
20116 "The libguestfs groups, and the functions that those groups correspond to, "
20117 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
20118 "runtime by calling L</available-all-groups>."
20122 #: ../fish/guestfish-actions.pod:377
20123 msgid "You must call L</launch> before calling this function."
20127 #: ../fish/guestfish-actions.pod:399
20129 "This call was added in version C<1.0.80>. In previous versions of "
20130 "libguestfs all you could do would be to speculatively execute a command to "
20131 "find out if the daemon implemented it. See also L</version>."
20135 #: ../fish/guestfish-actions.pod:406
20136 msgid "available-all-groups"
20140 #: ../fish/guestfish-actions.pod:408
20143 " available-all-groups\n"
20148 #: ../fish/guestfish-actions.pod:410
20150 "This command returns a list of all optional groups that this daemon knows "
20151 "about. Note this returns both supported and unsupported groups. To find "
20152 "out which ones the daemon can actually support you have to call L</"
20153 "available> on each member of the returned list."
20157 #: ../fish/guestfish-actions.pod:416
20158 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
20162 #: ../fish/guestfish-actions.pod:418
20167 #: ../fish/guestfish-actions.pod:420
20170 " base64-in (base64file|-) filename\n"
20175 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
20176 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
20177 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
20178 #: ../fish/guestfish-actions.pod:4199 ../fish/guestfish-actions.pod:4211
20179 #: ../fish/guestfish-actions.pod:4222 ../fish/guestfish-actions.pod:4233
20180 #: ../fish/guestfish-actions.pod:4285 ../fish/guestfish-actions.pod:4294
20181 #: ../fish/guestfish-actions.pod:4348 ../fish/guestfish-actions.pod:4371
20182 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
20186 #: ../fish/guestfish-actions.pod:427
20191 #: ../fish/guestfish-actions.pod:429
20194 " base64-out filename (base64file|-)\n"
20199 #: ../fish/guestfish-actions.pod:436
20200 msgid "blockdev-flushbufs"
20204 #: ../fish/guestfish-actions.pod:438
20207 " blockdev-flushbufs device\n"
20212 #: ../fish/guestfish-actions.pod:445
20213 msgid "blockdev-getbsz"
20217 #: ../fish/guestfish-actions.pod:447
20220 " blockdev-getbsz device\n"
20225 #: ../fish/guestfish-actions.pod:456
20226 msgid "blockdev-getro"
20230 #: ../fish/guestfish-actions.pod:458
20233 " blockdev-getro device\n"
20238 #: ../fish/guestfish-actions.pod:465
20239 msgid "blockdev-getsize64"
20243 #: ../fish/guestfish-actions.pod:467
20246 " blockdev-getsize64 device\n"
20251 #: ../fish/guestfish-actions.pod:471
20252 msgid "See also L</blockdev-getsz>."
20256 #: ../fish/guestfish-actions.pod:475
20257 msgid "blockdev-getss"
20261 #: ../fish/guestfish-actions.pod:477
20264 " blockdev-getss device\n"
20269 #: ../fish/guestfish-actions.pod:482
20271 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
20275 #: ../fish/guestfish-actions.pod:487
20276 msgid "blockdev-getsz"
20280 #: ../fish/guestfish-actions.pod:489
20283 " blockdev-getsz device\n"
20288 #: ../fish/guestfish-actions.pod:494
20290 "See also L</blockdev-getss> for the real sector size of the device, and L</"
20291 "blockdev-getsize64> for the more useful I<size in bytes>."
20295 #: ../fish/guestfish-actions.pod:500
20296 msgid "blockdev-rereadpt"
20300 #: ../fish/guestfish-actions.pod:502
20303 " blockdev-rereadpt device\n"
20308 #: ../fish/guestfish-actions.pod:508
20309 msgid "blockdev-setbsz"
20313 #: ../fish/guestfish-actions.pod:510
20316 " blockdev-setbsz device blocksize\n"
20321 #: ../fish/guestfish-actions.pod:519
20322 msgid "blockdev-setro"
20326 #: ../fish/guestfish-actions.pod:521
20329 " blockdev-setro device\n"
20334 #: ../fish/guestfish-actions.pod:527
20335 msgid "blockdev-setrw"
20339 #: ../fish/guestfish-actions.pod:529
20342 " blockdev-setrw device\n"
20347 #: ../fish/guestfish-actions.pod:535
20348 msgid "case-sensitive-path"
20352 #: ../fish/guestfish-actions.pod:537
20355 " case-sensitive-path path\n"
20360 #: ../fish/guestfish-actions.pod:561
20362 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
20363 "WINDOWS/system32\"> (the exact return value would depend on details of how "
20364 "the directories were originally created under Windows)."
20368 #: ../fish/guestfish-actions.pod:569
20369 msgid "See also L</realpath>."
20373 #: ../fish/guestfish-actions.pod:571
20378 #: ../fish/guestfish-actions.pod:573
20386 #: ../fish/guestfish-actions.pod:577
20388 "Note that this function cannot correctly handle binary files (specifically, "
20389 "files containing C<\\0> character which is treated as end of string). For "
20390 "those you need to use the L</read-file> or L</download> functions which have "
20391 "a more complex interface."
20395 #: ../fish/guestfish-actions.pod:585
20400 #: ../fish/guestfish-actions.pod:587
20403 " checksum csumtype path\n"
20408 #: ../fish/guestfish-actions.pod:630
20409 msgid "To get the checksum for a device, use L</checksum-device>."
20413 #: ../fish/guestfish-actions.pod:632
20414 msgid "To get the checksums for many files, use L</checksums-out>."
20418 #: ../fish/guestfish-actions.pod:634
20419 msgid "checksum-device"
20423 #: ../fish/guestfish-actions.pod:636
20426 " checksum-device csumtype device\n"
20431 #: ../fish/guestfish-actions.pod:638
20433 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20434 "device named C<device>. For the types of checksums supported see the L</"
20435 "checksum> command."
20439 #: ../fish/guestfish-actions.pod:642
20440 msgid "checksums-out"
20444 #: ../fish/guestfish-actions.pod:644
20447 " checksums-out csumtype directory (sumsfile|-)\n"
20452 #: ../fish/guestfish-actions.pod:660
20457 #: ../fish/guestfish-actions.pod:662
20460 " chmod mode path\n"
20465 #: ../fish/guestfish-actions.pod:673
20470 #: ../fish/guestfish-actions.pod:675
20473 " chown owner group path\n"
20478 #: ../fish/guestfish-actions.pod:683
20483 #: ../fish/guestfish-actions.pod:685
20486 " command 'arguments ...'\n"
20491 #: ../fish/guestfish-actions.pod:692
20493 "The single parameter is an argv-style list of arguments. The first element "
20494 "is the name of the program to run. Subsequent elements are parameters. The "
20495 "list must be non-empty (ie. must contain a program name). Note that the "
20496 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20500 #: ../fish/guestfish-actions.pod:720
20501 msgid "command-lines"
20505 #: ../fish/guestfish-actions.pod:722
20508 " command-lines 'arguments ...'\n"
20513 #: ../fish/guestfish-actions.pod:724
20515 "This is the same as L</command>, but splits the result into a list of lines."
20519 #: ../fish/guestfish-actions.pod:727
20520 msgid "See also: L</sh-lines>"
20524 #: ../fish/guestfish-actions.pod:732
20529 #: ../fish/guestfish-actions.pod:734
20532 " config qemuparam qemuvalue\n"
20537 #: ../fish/guestfish-actions.pod:745
20542 #: ../fish/guestfish-actions.pod:747
20545 " copy-size src dest size\n"
20550 #: ../fish/guestfish-actions.pod:755
20555 #: ../fish/guestfish-actions.pod:757
20563 #: ../fish/guestfish-actions.pod:762
20568 #: ../fish/guestfish-actions.pod:764
20576 #: ../fish/guestfish-actions.pod:769
20581 #: ../fish/guestfish-actions.pod:771
20589 #: ../fish/guestfish-actions.pod:778
20591 "If the destination is a device, it must be as large or larger than the "
20592 "source file or device, otherwise the copy will fail. This command cannot do "
20593 "partial copies (see L</copy-size>)."
20597 #: ../fish/guestfish-actions.pod:782
20602 #: ../fish/guestfish-actions.pod:784
20610 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
20612 "This command is mostly useful for interactive sessions. It is I<not> "
20613 "intended that you try to parse the output string. Use L</statvfs> from "
20618 #: ../fish/guestfish-actions.pod:792
20623 #: ../fish/guestfish-actions.pod:794
20631 #: ../fish/guestfish-actions.pod:803
20636 #: ../fish/guestfish-actions.pod:805
20644 #: ../fish/guestfish-actions.pod:811
20646 "Another way to get the same information is to enable verbose messages with "
20647 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20648 "before running the program."
20652 #: ../fish/guestfish-actions.pod:816
20657 #: ../fish/guestfish-actions.pod:818
20660 " download remotefilename (filename|-)\n"
20665 #: ../fish/guestfish-actions.pod:825
20666 msgid "See also L</upload>, L</cat>."
20670 #: ../fish/guestfish-actions.pod:829
20671 msgid "download-offset"
20675 #: ../fish/guestfish-actions.pod:831
20678 " download-offset remotefilename (filename|-) offset size\n"
20683 #: ../fish/guestfish-actions.pod:839
20685 "Note that there is no limit on the amount of data that can be downloaded "
20686 "with this call, unlike with L</pread>, and this call always reads the full "
20687 "amount unless an error occurs."
20691 #: ../fish/guestfish-actions.pod:844
20692 msgid "See also L</download>, L</pread>."
20696 #: ../fish/guestfish-actions.pod:848
20697 msgid "drop-caches"
20701 #: ../fish/guestfish-actions.pod:850
20704 " drop-caches whattodrop\n"
20709 #: ../fish/guestfish-actions.pod:862
20714 #: ../fish/guestfish-actions.pod:864
20722 #: ../fish/guestfish-actions.pod:876
20727 #: ../fish/guestfish-actions.pod:878
20730 " e2fsck-f device\n"
20735 #: ../fish/guestfish-actions.pod:884
20737 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20738 "should use L</fsck>."
20742 #: ../fish/guestfish-actions.pod:887
20743 msgid "echo-daemon"
20747 #: ../fish/guestfish-actions.pod:889
20750 " echo-daemon 'words ...'\n"
20755 #: ../fish/guestfish-actions.pod:896
20756 msgid "See also L</ping-daemon>."
20760 #: ../fish/guestfish-actions.pod:898
20765 #: ../fish/guestfish-actions.pod:900
20768 " egrep regex path\n"
20773 #: ../fish/guestfish-actions.pod:908
20778 #: ../fish/guestfish-actions.pod:910
20781 " egrepi regex path\n"
20786 #: ../fish/guestfish-actions.pod:918
20791 #: ../fish/guestfish-actions.pod:920
20794 " equal file1 file2\n"
20799 #: ../fish/guestfish-actions.pod:927
20804 #: ../fish/guestfish-actions.pod:929
20812 #: ../fish/guestfish-actions.pod:934
20813 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20817 #: ../fish/guestfish-actions.pod:936
20822 #: ../fish/guestfish-actions.pod:938
20825 " fallocate path len\n"
20830 #: ../fish/guestfish-actions.pod:955
20831 msgid "fallocate64"
20835 #: ../fish/guestfish-actions.pod:957
20838 " fallocate64 path len\n"
20843 #: ../fish/guestfish-actions.pod:963
20845 "Note that this call allocates disk blocks for the file. To create a sparse "
20846 "file use L</truncate-size> instead."
20850 #: ../fish/guestfish-actions.pod:966
20852 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20853 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20854 "maximum size of files created through that call to 1GB."
20858 #: ../fish/guestfish-actions.pod:975
20863 #: ../fish/guestfish-actions.pod:977
20866 " fgrep pattern path\n"
20871 #: ../fish/guestfish-actions.pod:985
20876 #: ../fish/guestfish-actions.pod:987
20879 " fgrepi pattern path\n"
20884 #: ../fish/guestfish-actions.pod:995
20889 #: ../fish/guestfish-actions.pod:997
20897 #: ../fish/guestfish-actions.pod:1009
20899 "This command can also be used on C</dev/> devices (and partitions, LV "
20900 "names). You can for example use this to determine if a device contains a "
20901 "filesystem, although it's usually better to use L</vfs-type>."
20905 #: ../fish/guestfish-actions.pod:1019
20906 msgid "file-architecture"
20910 #: ../fish/guestfish-actions.pod:1021
20913 " file-architecture filename\n"
20918 #: ../fish/guestfish-actions.pod:1124
20923 #: ../fish/guestfish-actions.pod:1126
20931 #: ../fish/guestfish-actions.pod:1130
20933 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20934 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20938 #: ../fish/guestfish-actions.pod:1134
20943 #: ../fish/guestfish-actions.pod:1136
20946 " fill c len path\n"
20951 #: ../fish/guestfish-actions.pod:1142
20953 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20954 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20955 "L</fill-pattern>."
20959 #: ../fish/guestfish-actions.pod:1147
20960 msgid "fill-pattern"
20964 #: ../fish/guestfish-actions.pod:1149
20967 " fill-pattern pattern len path\n"
20972 #: ../fish/guestfish-actions.pod:1151
20974 "This function is like L</fill> except that it creates a new file of length "
20975 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20976 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20981 #: ../fish/guestfish-actions.pod:1156
20986 #: ../fish/guestfish-actions.pod:1158
20989 " find directory\n"
20994 #: ../fish/guestfish-actions.pod:1172
20995 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20999 #: ../fish/guestfish-actions.pod:1185
21000 msgid "See also L</find0>."
21004 #: ../fish/guestfish-actions.pod:1190
21009 #: ../fish/guestfish-actions.pod:1192
21012 " find0 directory (files|-)\n"
21017 #: ../fish/guestfish-actions.pod:1198
21019 "This command works the same way as L</find> with the following exceptions:"
21023 #: ../fish/guestfish-actions.pod:1225
21024 msgid "findfs-label"
21028 #: ../fish/guestfish-actions.pod:1227
21031 " findfs-label label\n"
21036 #: ../fish/guestfish-actions.pod:1233
21037 msgid "To find the label of a filesystem, use L</vfs-label>."
21041 #: ../fish/guestfish-actions.pod:1235
21042 msgid "findfs-uuid"
21046 #: ../fish/guestfish-actions.pod:1237
21049 " findfs-uuid uuid\n"
21054 #: ../fish/guestfish-actions.pod:1243
21055 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
21059 #: ../fish/guestfish-actions.pod:1245
21064 #: ../fish/guestfish-actions.pod:1247
21067 " fsck fstype device\n"
21072 #: ../fish/guestfish-actions.pod:1277
21077 #: ../fish/guestfish-actions.pod:1279
21085 #: ../fish/guestfish-actions.pod:1286
21086 msgid "get-autosync"
21090 #: ../fish/guestfish-actions.pod:1288
21098 #: ../fish/guestfish-actions.pod:1292
21103 #: ../fish/guestfish-actions.pod:1294
21111 #: ../fish/guestfish-actions.pod:1298
21112 msgid "get-e2label"
21116 #: ../fish/guestfish-actions.pod:1300
21119 " get-e2label device\n"
21124 #: ../fish/guestfish-actions.pod:1312
21129 #: ../fish/guestfish-actions.pod:1314
21132 " get-e2uuid device\n"
21137 #: ../fish/guestfish-actions.pod:1326
21138 msgid "get-memsize"
21142 #: ../fish/guestfish-actions.pod:1328
21150 #: ../fish/guestfish-actions.pod:1333
21152 "If L</set-memsize> was not called on this handle, and if "
21153 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
21154 "value for memsize."
21158 #: ../fish/guestfish-actions.pod:1340
21159 msgid "get-network"
21163 #: ../fish/guestfish-actions.pod:1342
21171 #: ../fish/guestfish-actions.pod:1346
21176 #: ../fish/guestfish-actions.pod:1348
21184 #: ../fish/guestfish-actions.pod:1355
21189 #: ../fish/guestfish-actions.pod:1357
21194 #: ../fish/guestfish-actions.pod:1359
21202 #: ../fish/guestfish-actions.pod:1366
21207 #: ../fish/guestfish-actions.pod:1368
21215 #: ../fish/guestfish-actions.pod:1375
21216 msgid "get-recovery-proc"
21220 #: ../fish/guestfish-actions.pod:1377
21223 " get-recovery-proc\n"
21228 #: ../fish/guestfish-actions.pod:1381
21229 msgid "get-selinux"
21233 #: ../fish/guestfish-actions.pod:1383
21241 #: ../fish/guestfish-actions.pod:1385
21243 "This returns the current setting of the selinux flag which is passed to the "
21244 "appliance at boot time. See L</set-selinux>."
21248 #: ../fish/guestfish-actions.pod:1391
21253 #: ../fish/guestfish-actions.pod:1393
21261 #: ../fish/guestfish-actions.pod:1400
21266 #: ../fish/guestfish-actions.pod:1402
21274 #: ../fish/guestfish-actions.pod:1406
21279 #: ../fish/guestfish-actions.pod:1408
21287 #: ../fish/guestfish-actions.pod:1410
21289 "Return the current umask. By default the umask is C<022> unless it has been "
21290 "set by calling L</umask>."
21294 #: ../fish/guestfish-actions.pod:1413
21295 msgid "get-verbose"
21299 #: ../fish/guestfish-actions.pod:1415
21307 #: ../fish/guestfish-actions.pod:1419
21312 #: ../fish/guestfish-actions.pod:1421
21320 #: ../fish/guestfish-actions.pod:1425
21321 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
21325 #: ../fish/guestfish-actions.pod:1428
21330 #: ../fish/guestfish-actions.pod:1430
21333 " getxattr path name\n"
21338 #: ../fish/guestfish-actions.pod:1432
21340 "Get a single extended attribute from file C<path> named C<name>. This call "
21341 "follows symlinks. If you want to lookup an extended attribute for the "
21342 "symlink itself, use L</lgetxattr>."
21346 #: ../fish/guestfish-actions.pod:1436 ../fish/guestfish-actions.pod:2263
21348 "Normally it is better to get all extended attributes from a file in one go "
21349 "by calling L</getxattrs>. However some Linux filesystem implementations are "
21350 "buggy and do not provide a way to list out attributes. For these "
21351 "filesystems (notably ntfs-3g) you have to know the names of the extended "
21352 "attributes you want in advance and call this function."
21356 #: ../fish/guestfish-actions.pod:1446
21357 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
21361 #: ../fish/guestfish-actions.pod:1448
21366 #: ../fish/guestfish-actions.pod:1450
21369 " getxattrs path\n"
21374 #: ../fish/guestfish-actions.pod:1458
21375 msgid "See also: L</lgetxattrs>, L<attr(5)>."
21379 #: ../fish/guestfish-actions.pod:1460
21380 msgid "glob-expand"
21384 #: ../fish/guestfish-actions.pod:1462
21387 " glob-expand pattern\n"
21392 #: ../fish/guestfish-actions.pod:1475
21397 #: ../fish/guestfish-actions.pod:1477
21400 " grep regex path\n"
21405 #: ../fish/guestfish-actions.pod:1485
21410 #: ../fish/guestfish-actions.pod:1487
21413 " grepi regex path\n"
21418 #: ../fish/guestfish-actions.pod:1495
21419 msgid "grub-install"
21423 #: ../fish/guestfish-actions.pod:1497
21426 " grub-install root device\n"
21431 #: ../fish/guestfish-actions.pod:1513
21436 #: ../fish/guestfish-actions.pod:1515
21444 #: ../fish/guestfish-actions.pod:1523
21449 #: ../fish/guestfish-actions.pod:1525
21452 " head-n nrlines path\n"
21457 #: ../fish/guestfish-actions.pod:1538
21462 #: ../fish/guestfish-actions.pod:1540
21470 #: ../fish/guestfish-actions.pod:1548
21475 #: ../fish/guestfish-actions.pod:1550
21478 " initrd-cat initrdpath filename\n"
21483 #: ../fish/guestfish-actions.pod:1562
21484 msgid "See also L</initrd-list>."
21488 #: ../fish/guestfish-actions.pod:1567
21489 msgid "initrd-list"
21493 #: ../fish/guestfish-actions.pod:1569
21496 " initrd-list path\n"
21501 #: ../fish/guestfish-actions.pod:1581
21502 msgid "inotify-add-watch"
21506 #: ../fish/guestfish-actions.pod:1583
21509 " inotify-add-watch path mask\n"
21514 #: ../fish/guestfish-actions.pod:1595
21515 msgid "inotify-close"
21519 #: ../fish/guestfish-actions.pod:1597
21527 #: ../fish/guestfish-actions.pod:1603
21528 msgid "inotify-files"
21532 #: ../fish/guestfish-actions.pod:1605
21540 #: ../fish/guestfish-actions.pod:1607
21542 "This function is a helpful wrapper around L</inotify-read> which just "
21543 "returns a list of pathnames of objects that were touched. The returned "
21544 "pathnames are sorted and deduplicated."
21548 #: ../fish/guestfish-actions.pod:1611
21549 msgid "inotify-init"
21553 #: ../fish/guestfish-actions.pod:1613
21556 " inotify-init maxevents\n"
21561 #: ../fish/guestfish-actions.pod:1619
21563 "C<maxevents> is the maximum number of events which will be queued up between "
21564 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21565 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21566 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21567 "but records the fact that it threw them away by setting a flag "
21568 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21572 #: ../fish/guestfish-actions.pod:1629
21574 "Before any events are generated, you have to add some watches to the "
21575 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21576 "L</inotify-watch-all>."
21580 #: ../fish/guestfish-actions.pod:1635
21582 "Queued up events should be read periodically by calling L</inotify-read> (or "
21583 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21584 "If you don't read the events out often enough then you risk the internal "
21585 "queue overflowing."
21589 #: ../fish/guestfish-actions.pod:1642
21591 "The handle should be closed after use by calling L</inotify-close>. This "
21592 "also removes any watches automatically."
21596 #: ../fish/guestfish-actions.pod:1651
21597 msgid "inotify-read"
21601 #: ../fish/guestfish-actions.pod:1653
21609 #: ../fish/guestfish-actions.pod:1666
21610 msgid "inotify-rm-watch"
21614 #: ../fish/guestfish-actions.pod:1668
21617 " inotify-rm-watch wd\n"
21622 #: ../fish/guestfish-actions.pod:1670
21623 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21627 #: ../fish/guestfish-actions.pod:1673
21628 msgid "inspect-get-arch"
21632 #: ../fish/guestfish-actions.pod:1675
21635 " inspect-get-arch root\n"
21640 #: ../fish/guestfish-actions.pod:1677 ../fish/guestfish-actions.pod:1693
21641 #: ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1785
21642 #: ../fish/guestfish-actions.pod:1800 ../fish/guestfish-actions.pod:1821
21643 #: ../fish/guestfish-actions.pod:1836 ../fish/guestfish-actions.pod:1859
21644 #: ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:1905
21645 #: ../fish/guestfish-actions.pod:1935 ../fish/guestfish-actions.pod:1970
21646 #: ../fish/guestfish-actions.pod:1986
21648 "This function should only be called with a root device string as returned by "
21653 #: ../fish/guestfish-actions.pod:1680
21655 "This returns the architecture of the inspected operating system. The "
21656 "possible return values are listed under L</file-architecture>."
21660 #: ../fish/guestfish-actions.pod:1689
21661 msgid "inspect-get-distro"
21665 #: ../fish/guestfish-actions.pod:1691
21668 " inspect-get-distro root\n"
21673 #: ../fish/guestfish-actions.pod:1763
21674 msgid "inspect-get-filesystems"
21678 #: ../fish/guestfish-actions.pod:1765
21681 " inspect-get-filesystems root\n"
21686 #: ../fish/guestfish-actions.pod:1778
21688 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21689 "get-mountpoints>."
21693 #: ../fish/guestfish-actions.pod:1781
21694 msgid "inspect-get-hostname"
21698 #: ../fish/guestfish-actions.pod:1783
21701 " inspect-get-hostname root\n"
21706 #: ../fish/guestfish-actions.pod:1796
21707 msgid "inspect-get-major-version"
21711 #: ../fish/guestfish-actions.pod:1798
21714 " inspect-get-major-version root\n"
21719 #: ../fish/guestfish-actions.pod:1817
21720 msgid "inspect-get-minor-version"
21724 #: ../fish/guestfish-actions.pod:1819
21727 " inspect-get-minor-version root\n"
21732 #: ../fish/guestfish-actions.pod:1829
21734 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21735 "get-major-version>."
21739 #: ../fish/guestfish-actions.pod:1832
21740 msgid "inspect-get-mountpoints"
21744 #: ../fish/guestfish-actions.pod:1834
21747 " inspect-get-mountpoints root\n"
21752 #: ../fish/guestfish-actions.pod:1852
21754 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21755 "get-filesystems>."
21759 #: ../fish/guestfish-actions.pod:1855
21760 msgid "inspect-get-package-format"
21764 #: ../fish/guestfish-actions.pod:1857
21767 " inspect-get-package-format root\n"
21772 #: ../fish/guestfish-actions.pod:1862
21774 "This function and L</inspect-get-package-management> return the package "
21775 "format and package management tool used by the inspected operating system. "
21776 "For example for Fedora these functions would return C<rpm> (package format) "
21777 "and C<yum> (package management)."
21781 #: ../fish/guestfish-actions.pod:1877
21782 msgid "inspect-get-package-management"
21786 #: ../fish/guestfish-actions.pod:1879
21789 " inspect-get-package-management root\n"
21794 #: ../fish/guestfish-actions.pod:1884
21796 "L</inspect-get-package-format> and this function return the package format "
21797 "and package management tool used by the inspected operating system. For "
21798 "example for Fedora these functions would return C<rpm> (package format) and "
21799 "C<yum> (package management)."
21803 #: ../fish/guestfish-actions.pod:1901
21804 msgid "inspect-get-product-name"
21808 #: ../fish/guestfish-actions.pod:1903
21811 " inspect-get-product-name root\n"
21816 #: ../fish/guestfish-actions.pod:1918
21817 msgid "inspect-get-roots"
21821 #: ../fish/guestfish-actions.pod:1920
21824 " inspect-get-roots\n"
21829 #: ../fish/guestfish-actions.pod:1922
21831 "This function is a convenient way to get the list of root devices, as "
21832 "returned from a previous call to L</inspect-os>, but without redoing the "
21833 "whole inspection process."
21837 #: ../fish/guestfish-actions.pod:1926
21839 "This returns an empty list if either no root devices were found or the "
21840 "caller has not called L</inspect-os>."
21844 #: ../fish/guestfish-actions.pod:1931
21845 msgid "inspect-get-type"
21849 #: ../fish/guestfish-actions.pod:1933
21852 " inspect-get-type root\n"
21857 #: ../fish/guestfish-actions.pod:1966
21858 msgid "inspect-get-windows-systemroot"
21862 #: ../fish/guestfish-actions.pod:1968
21865 " inspect-get-windows-systemroot root\n"
21870 #: ../fish/guestfish-actions.pod:1982
21871 msgid "inspect-list-applications"
21875 #: ../fish/guestfish-actions.pod:1984
21878 " inspect-list-applications root\n"
21883 #: ../fish/guestfish-actions.pod:1991
21885 "I<Note:> This call works differently from other parts of the inspection "
21886 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21887 "then mount up the disks, before calling this. Listing applications is a "
21888 "significantly more difficult operation which requires access to the full "
21889 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21890 "are just returning data cached in the libguestfs handle, this call actually "
21891 "reads parts of the mounted filesystems during the call."
21895 #: ../fish/guestfish-actions.pod:2081
21900 #: ../fish/guestfish-actions.pod:2083
21908 #: ../fish/guestfish-actions.pod:2098
21910 "You can pass the root string(s) returned to other L</inspect-get-*> "
21911 "functions in order to query further information about each operating system, "
21912 "such as the name and version."
21916 #: ../fish/guestfish-actions.pod:2103
21918 "This function uses other libguestfs features such as L</mount-ro> and L</"
21919 "umount-all> in order to mount and unmount filesystems and look at the "
21920 "contents. This should be called with no disks currently mounted. The "
21921 "function may also use Augeas, so any existing Augeas handle will be closed."
21925 #: ../fish/guestfish-actions.pod:2115 ../fish/guestfish-actions.pod:2291
21926 #: ../fish/guestfish-actions.pod:2337
21927 msgid "See also L</list-filesystems>."
21931 #: ../fish/guestfish-actions.pod:2117
21932 msgid "is-blockdev"
21936 #: ../fish/guestfish-actions.pod:2119
21939 " is-blockdev path\n"
21944 #: ../fish/guestfish-actions.pod:2124 ../fish/guestfish-actions.pod:2142
21945 #: ../fish/guestfish-actions.pod:2161 ../fish/guestfish-actions.pod:2170
21946 #: ../fish/guestfish-actions.pod:2180 ../fish/guestfish-actions.pod:2214
21947 #: ../fish/guestfish-actions.pod:2223
21948 msgid "See also L</stat>."
21952 #: ../fish/guestfish-actions.pod:2126
21957 #: ../fish/guestfish-actions.pod:2128
21965 #: ../fish/guestfish-actions.pod:2135
21970 #: ../fish/guestfish-actions.pod:2137
21973 " is-chardev path\n"
21978 #: ../fish/guestfish-actions.pod:2144
21983 #: ../fish/guestfish-actions.pod:2146
21991 #: ../fish/guestfish-actions.pod:2153
21996 #: ../fish/guestfish-actions.pod:2155
22004 #: ../fish/guestfish-actions.pod:2163
22009 #: ../fish/guestfish-actions.pod:2165
22017 #: ../fish/guestfish-actions.pod:2172
22022 #: ../fish/guestfish-actions.pod:2174
22030 #: ../fish/guestfish-actions.pod:2182
22031 msgid "is-launching"
22035 #: ../fish/guestfish-actions.pod:2184
22043 #: ../fish/guestfish-actions.pod:2191
22048 #: ../fish/guestfish-actions.pod:2193
22056 #: ../fish/guestfish-actions.pod:2198
22061 #: ../fish/guestfish-actions.pod:2200
22069 #: ../fish/guestfish-actions.pod:2207
22074 #: ../fish/guestfish-actions.pod:2209
22077 " is-socket path\n"
22082 #: ../fish/guestfish-actions.pod:2216
22087 #: ../fish/guestfish-actions.pod:2218
22090 " is-symlink path\n"
22095 #: ../fish/guestfish-actions.pod:2225
22096 msgid "kill-subprocess"
22100 #: ../fish/guestfish-actions.pod:2227
22103 " kill-subprocess\n"
22108 #: ../fish/guestfish-actions.pod:2231
22113 #: ../fish/guestfish-actions.pod:2233
22118 #: ../fish/guestfish-actions.pod:2235
22126 #: ../fish/guestfish-actions.pod:2243
22131 #: ../fish/guestfish-actions.pod:2245
22134 " lchown owner group path\n"
22139 #: ../fish/guestfish-actions.pod:2247
22141 "Change the file owner to C<owner> and group to C<group>. This is like L</"
22142 "chown> but if C<path> is a symlink then the link itself is changed, not the "
22147 #: ../fish/guestfish-actions.pod:2255
22152 #: ../fish/guestfish-actions.pod:2257
22155 " lgetxattr path name\n"
22160 #: ../fish/guestfish-actions.pod:2273
22161 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
22165 #: ../fish/guestfish-actions.pod:2275
22170 #: ../fish/guestfish-actions.pod:2277
22173 " lgetxattrs path\n"
22178 #: ../fish/guestfish-actions.pod:2279
22180 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
22181 "it returns the extended attributes of the link itself."
22185 #: ../fish/guestfish-actions.pod:2283
22186 msgid "list-devices"
22190 #: ../fish/guestfish-actions.pod:2285
22198 #: ../fish/guestfish-actions.pod:2293
22199 msgid "list-filesystems"
22203 #: ../fish/guestfish-actions.pod:2295
22206 " list-filesystems\n"
22211 #: ../fish/guestfish-actions.pod:2314
22213 "This command runs other libguestfs commands, which might include L</mount> "
22214 "and L</umount>, and therefore you should use this soon after launch and only "
22215 "when nothing is mounted."
22219 #: ../fish/guestfish-actions.pod:2318
22221 "Not all of the filesystems returned will be mountable. In particular, swap "
22222 "partitions are returned in the list. Also this command does not check that "
22223 "each filesystem found is valid and mountable, and some filesystems might be "
22224 "mountable but require special options. Filesystems may not all belong to a "
22225 "single logical operating system (use L</inspect-os> to look for OSes)."
22229 #: ../fish/guestfish-actions.pod:2326
22230 msgid "list-partitions"
22234 #: ../fish/guestfish-actions.pod:2328
22237 " list-partitions\n"
22242 #: ../fish/guestfish-actions.pod:2334
22244 "This does not return logical volumes. For that you will need to call L</"
22249 #: ../fish/guestfish-actions.pod:2339
22254 #: ../fish/guestfish-actions.pod:2341
22262 #: ../fish/guestfish-actions.pod:2349
22267 #: ../fish/guestfish-actions.pod:2351
22270 " ln target linkname\n"
22275 #: ../fish/guestfish-actions.pod:2355
22280 #: ../fish/guestfish-actions.pod:2357
22283 " ln-f target linkname\n"
22288 #: ../fish/guestfish-actions.pod:2362
22293 #: ../fish/guestfish-actions.pod:2364
22296 " ln-s target linkname\n"
22301 #: ../fish/guestfish-actions.pod:2368
22306 #: ../fish/guestfish-actions.pod:2370
22309 " ln-sf target linkname\n"
22314 #: ../fish/guestfish-actions.pod:2375
22315 msgid "lremovexattr"
22319 #: ../fish/guestfish-actions.pod:2377
22322 " lremovexattr xattr path\n"
22327 #: ../fish/guestfish-actions.pod:2379
22329 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
22330 "it removes an extended attribute of the link itself."
22334 #: ../fish/guestfish-actions.pod:2383
22339 #: ../fish/guestfish-actions.pod:2385
22347 #: ../fish/guestfish-actions.pod:2391
22349 "This command is mostly useful for interactive sessions. Programs should "
22350 "probably use L</readdir> instead."
22354 #: ../fish/guestfish-actions.pod:2394
22359 #: ../fish/guestfish-actions.pod:2396
22362 " lsetxattr xattr val vallen path\n"
22367 #: ../fish/guestfish-actions.pod:2398
22369 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
22370 "sets an extended attribute of the link itself."
22374 #: ../fish/guestfish-actions.pod:2402
22379 #: ../fish/guestfish-actions.pod:2404
22387 #: ../fish/guestfish-actions.pod:2408
22389 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
22390 "the link is stat-ed, not the file it refers to."
22394 #: ../fish/guestfish-actions.pod:2414
22399 #: ../fish/guestfish-actions.pod:2416
22402 " lstatlist path 'names ...'\n"
22407 #: ../fish/guestfish-actions.pod:2418
22409 "This call allows you to perform the L</lstat> operation on multiple files, "
22410 "where all files are in the directory C<path>. C<names> is the list of files "
22411 "from this directory."
22415 #: ../fish/guestfish-actions.pod:2427
22417 "This call is intended for programs that want to efficiently list a directory "
22418 "contents without making many round-trips. See also L</lxattrlist> for a "
22419 "similarly efficient call for getting extended attributes. Very long "
22420 "directory listings might cause the protocol message size to be exceeded, "
22421 "causing this call to fail. The caller must split up such requests into "
22422 "smaller groups of names."
22426 #: ../fish/guestfish-actions.pod:2435
22427 msgid "luks-add-key"
22431 #: ../fish/guestfish-actions.pod:2437
22434 " luks-add-key device keyslot\n"
22439 #: ../fish/guestfish-actions.pod:2444
22441 "Note that if C<keyslot> already contains a key, then this command will "
22442 "fail. You have to use L</luks-kill-slot> first to remove that key."
22446 #: ../fish/guestfish-actions.pod:2448 ../fish/guestfish-actions.pod:2470
22447 #: ../fish/guestfish-actions.pod:2483 ../fish/guestfish-actions.pod:2497
22448 #: ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2530
22450 "This command has one or more key or passphrase parameters. Guestfish will "
22451 "prompt for these separately."
22455 #: ../fish/guestfish-actions.pod:2451
22460 #: ../fish/guestfish-actions.pod:2453
22463 " luks-close device\n"
22468 #: ../fish/guestfish-actions.pod:2455
22470 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
22471 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
22472 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
22477 #: ../fish/guestfish-actions.pod:2461
22478 msgid "luks-format"
22482 #: ../fish/guestfish-actions.pod:2463
22485 " luks-format device keyslot\n"
22490 #: ../fish/guestfish-actions.pod:2476
22491 msgid "luks-format-cipher"
22495 #: ../fish/guestfish-actions.pod:2478
22498 " luks-format-cipher device keyslot cipher\n"
22503 #: ../fish/guestfish-actions.pod:2480
22505 "This command is the same as L</luks-format> but it also allows you to set "
22506 "the C<cipher> used."
22510 #: ../fish/guestfish-actions.pod:2489
22511 msgid "luks-kill-slot"
22515 #: ../fish/guestfish-actions.pod:2491
22518 " luks-kill-slot device keyslot\n"
22523 #: ../fish/guestfish-actions.pod:2500
22528 #: ../fish/guestfish-actions.pod:2502
22531 " luks-open device mapname\n"
22536 #: ../fish/guestfish-actions.pod:2516
22538 "If this block device contains LVM volume groups, then calling L</vgscan> "
22539 "followed by L</vg-activate-all> will make them visible."
22543 #: ../fish/guestfish-actions.pod:2523
22544 msgid "luks-open-ro"
22548 #: ../fish/guestfish-actions.pod:2525
22551 " luks-open-ro device mapname\n"
22556 #: ../fish/guestfish-actions.pod:2527
22558 "This is the same as L</luks-open> except that a read-only mapping is created."
22562 #: ../fish/guestfish-actions.pod:2533
22567 #: ../fish/guestfish-actions.pod:2535
22570 " lvcreate logvol volgroup mbytes\n"
22575 #: ../fish/guestfish-actions.pod:2540
22576 msgid "lvm-canonical-lv-name"
22580 #: ../fish/guestfish-actions.pod:2542
22583 " lvm-canonical-lv-name lvname\n"
22588 #: ../fish/guestfish-actions.pod:2551
22589 msgid "See also L</is-lv>."
22593 #: ../fish/guestfish-actions.pod:2553
22594 msgid "lvm-clear-filter"
22598 #: ../fish/guestfish-actions.pod:2555
22601 " lvm-clear-filter\n"
22606 #: ../fish/guestfish-actions.pod:2557
22608 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22613 #: ../fish/guestfish-actions.pod:2563
22614 msgid "lvm-remove-all"
22618 #: ../fish/guestfish-actions.pod:2565
22621 " lvm-remove-all\n"
22626 #: ../fish/guestfish-actions.pod:2573
22627 msgid "lvm-set-filter"
22631 #: ../fish/guestfish-actions.pod:2575
22634 " lvm-set-filter 'devices ...'\n"
22639 #: ../fish/guestfish-actions.pod:2600
22644 #: ../fish/guestfish-actions.pod:2602
22647 " lvremove device\n"
22652 #: ../fish/guestfish-actions.pod:2610
22657 #: ../fish/guestfish-actions.pod:2612
22660 " lvrename logvol newlogvol\n"
22665 #: ../fish/guestfish-actions.pod:2616
22670 #: ../fish/guestfish-actions.pod:2618
22673 " lvresize device mbytes\n"
22678 #: ../fish/guestfish-actions.pod:2624
22679 msgid "lvresize-free"
22683 #: ../fish/guestfish-actions.pod:2626
22686 " lvresize-free lv percent\n"
22691 #: ../fish/guestfish-actions.pod:2634
22696 #: ../fish/guestfish-actions.pod:2636
22704 #: ../fish/guestfish-actions.pod:2644
22705 msgid "See also L</lvs-full>, L</list-filesystems>."
22709 #: ../fish/guestfish-actions.pod:2646
22714 #: ../fish/guestfish-actions.pod:2648
22722 #: ../fish/guestfish-actions.pod:2653
22727 #: ../fish/guestfish-actions.pod:2655
22735 #: ../fish/guestfish-actions.pod:2659
22740 #: ../fish/guestfish-actions.pod:2661
22743 " lxattrlist path 'names ...'\n"
22748 #: ../fish/guestfish-actions.pod:2677
22750 "This call is intended for programs that want to efficiently list a directory "
22751 "contents without making many round-trips. See also L</lstatlist> for a "
22752 "similarly efficient call for getting standard stats. Very long directory "
22753 "listings might cause the protocol message size to be exceeded, causing this "
22754 "call to fail. The caller must split up such requests into smaller groups of "
22759 #: ../fish/guestfish-actions.pod:2685
22764 #: ../fish/guestfish-actions.pod:2687
22772 #: ../fish/guestfish-actions.pod:2691
22777 #: ../fish/guestfish-actions.pod:2693
22780 " mkdir-mode path mode\n"
22785 #: ../fish/guestfish-actions.pod:2702
22786 msgid "See also L</mkdir>, L</umask>"
22790 #: ../fish/guestfish-actions.pod:2704
22795 #: ../fish/guestfish-actions.pod:2706
22803 #: ../fish/guestfish-actions.pod:2711
22808 #: ../fish/guestfish-actions.pod:2713
22811 " mkdtemp template\n"
22816 #: ../fish/guestfish-actions.pod:2734
22821 #: ../fish/guestfish-actions.pod:2736
22824 " mke2fs-J fstype blocksize device journal\n"
22829 #: ../fish/guestfish-actions.pod:2744
22830 msgid "See also L</mke2journal>."
22834 #: ../fish/guestfish-actions.pod:2746
22839 #: ../fish/guestfish-actions.pod:2748
22842 " mke2fs-JL fstype blocksize device label\n"
22847 #: ../fish/guestfish-actions.pod:2753
22848 msgid "See also L</mke2journal-L>."
22852 #: ../fish/guestfish-actions.pod:2755
22857 #: ../fish/guestfish-actions.pod:2757
22860 " mke2fs-JU fstype blocksize device uuid\n"
22865 #: ../fish/guestfish-actions.pod:2762
22866 msgid "See also L</mke2journal-U>."
22870 #: ../fish/guestfish-actions.pod:2764
22871 msgid "mke2journal"
22875 #: ../fish/guestfish-actions.pod:2766
22878 " mke2journal blocksize device\n"
22883 #: ../fish/guestfish-actions.pod:2773
22884 msgid "mke2journal-L"
22888 #: ../fish/guestfish-actions.pod:2775
22891 " mke2journal-L blocksize label device\n"
22896 #: ../fish/guestfish-actions.pod:2779
22897 msgid "mke2journal-U"
22901 #: ../fish/guestfish-actions.pod:2781
22904 " mke2journal-U blocksize uuid device\n"
22909 #: ../fish/guestfish-actions.pod:2785
22914 #: ../fish/guestfish-actions.pod:2787
22917 " mkfifo mode path\n"
22922 #: ../fish/guestfish-actions.pod:2789
22924 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22925 "is just a convenient wrapper around L</mknod>."
22929 #: ../fish/guestfish-actions.pod:2795
22934 #: ../fish/guestfish-actions.pod:2797
22937 " mkfs fstype device\n"
22942 #: ../fish/guestfish-actions.pod:2803
22947 #: ../fish/guestfish-actions.pod:2805
22950 " mkfs-b fstype blocksize device\n"
22955 #: ../fish/guestfish-actions.pod:2807
22957 "This call is similar to L</mkfs>, but it allows you to control the block "
22958 "size of the resulting filesystem. Supported block sizes depend on the "
22959 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22963 #: ../fish/guestfish-actions.pod:2822
22968 #: ../fish/guestfish-actions.pod:2824
22971 " mkfs-opts fstype device [blocksize:..]\n"
22976 #: ../fish/guestfish-actions.pod:2846
22977 msgid "mkmountpoint"
22981 #: ../fish/guestfish-actions.pod:2848
22984 " mkmountpoint exemptpath\n"
22989 #: ../fish/guestfish-actions.pod:2850
22991 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22992 "to create extra mountpoints before mounting the first filesystem."
22996 #: ../fish/guestfish-actions.pod:2874
22998 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22999 "unexpected errors if you try to mix these calls. It is safest to manually "
23000 "unmount filesystems and remove mountpoints after use."
23004 #: ../fish/guestfish-actions.pod:2878
23006 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
23007 "for this to work for manual mountpoints, you must ensure that the innermost "
23008 "mountpoints have the longest pathnames, as in the example code above."
23012 #: ../fish/guestfish-actions.pod:2885
23014 "Autosync [see L</set-autosync>, this is set by default on handles] means "
23015 "that L</umount-all> is called when the handle is closed which can also "
23016 "trigger these issues."
23020 #: ../fish/guestfish-actions.pod:2889
23025 #: ../fish/guestfish-actions.pod:2891
23028 " mknod mode devmajor devminor path\n"
23033 #: ../fish/guestfish-actions.pod:2901
23035 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
23036 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
23037 "regular file). These constants are available in the standard Linux header "
23038 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
23039 "wrappers around this command which bitwise OR in the appropriate constant "
23044 #: ../fish/guestfish-actions.pod:2911
23049 #: ../fish/guestfish-actions.pod:2913
23052 " mknod-b mode devmajor devminor path\n"
23057 #: ../fish/guestfish-actions.pod:2915
23059 "This call creates a block device node called C<path> with mode C<mode> and "
23060 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23061 "wrapper around L</mknod>."
23065 #: ../fish/guestfish-actions.pod:2921
23070 #: ../fish/guestfish-actions.pod:2923
23073 " mknod-c mode devmajor devminor path\n"
23078 #: ../fish/guestfish-actions.pod:2925
23080 "This call creates a char device node called C<path> with mode C<mode> and "
23081 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23082 "wrapper around L</mknod>."
23086 #: ../fish/guestfish-actions.pod:2931
23091 #: ../fish/guestfish-actions.pod:2933
23099 #: ../fish/guestfish-actions.pod:2937
23104 #: ../fish/guestfish-actions.pod:2939
23107 " mkswap-L label device\n"
23112 #: ../fish/guestfish-actions.pod:2947
23117 #: ../fish/guestfish-actions.pod:2949
23120 " mkswap-U uuid device\n"
23125 #: ../fish/guestfish-actions.pod:2953
23126 msgid "mkswap-file"
23130 #: ../fish/guestfish-actions.pod:2955
23133 " mkswap-file path\n"
23138 #: ../fish/guestfish-actions.pod:2959
23140 "This command just writes a swap file signature to an existing file. To "
23141 "create the file itself, use something like L</fallocate>."
23145 #: ../fish/guestfish-actions.pod:2962
23150 #: ../fish/guestfish-actions.pod:2964
23153 " modprobe modulename\n"
23158 #: ../fish/guestfish-actions.pod:2971
23163 #: ../fish/guestfish-actions.pod:2973
23166 " mount device mountpoint\n"
23171 #: ../fish/guestfish-actions.pod:2989
23173 "B<Important note:> When you use this call, the filesystem options C<sync> "
23174 "and C<noatime> are set implicitly. This was originally done because we "
23175 "thought it would improve reliability, but it turns out that I<-o sync> has a "
23176 "very large negative performance impact and negligible effect on "
23177 "reliability. Therefore we recommend that you avoid using L</mount> in any "
23178 "code that needs performance, and instead use L</mount-options> (use an empty "
23179 "string for the first parameter if you don't want any options)."
23183 #: ../fish/guestfish-actions.pod:2999
23188 #: ../fish/guestfish-actions.pod:3001
23191 " mount-loop file mountpoint\n"
23196 #: ../fish/guestfish-actions.pod:3007
23197 msgid "mount-options"
23201 #: ../fish/guestfish-actions.pod:3009
23204 " mount-options options device mountpoint\n"
23209 #: ../fish/guestfish-actions.pod:3011
23211 "This is the same as the L</mount> command, but it allows you to set the "
23212 "mount options as for the L<mount(8)> I<-o> flag."
23216 #: ../fish/guestfish-actions.pod:3019
23221 #: ../fish/guestfish-actions.pod:3021
23224 " mount-ro device mountpoint\n"
23229 #: ../fish/guestfish-actions.pod:3023
23231 "This is the same as the L</mount> command, but it mounts the filesystem with "
23232 "the read-only (I<-o ro>) flag."
23236 #: ../fish/guestfish-actions.pod:3026
23241 #: ../fish/guestfish-actions.pod:3028
23244 " mount-vfs options vfstype device mountpoint\n"
23249 #: ../fish/guestfish-actions.pod:3030
23251 "This is the same as the L</mount> command, but it allows you to set both the "
23252 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
23256 #: ../fish/guestfish-actions.pod:3034
23257 msgid "mountpoints"
23261 #: ../fish/guestfish-actions.pod:3036
23269 #: ../fish/guestfish-actions.pod:3038
23271 "This call is similar to L</mounts>. That call returns a list of devices. "
23272 "This one returns a hash table (map) of device name to directory where the "
23273 "device is mounted."
23277 #: ../fish/guestfish-actions.pod:3042
23282 #: ../fish/guestfish-actions.pod:3044
23290 #: ../fish/guestfish-actions.pod:3051
23291 msgid "See also: L</mountpoints>"
23295 #: ../fish/guestfish-actions.pod:3053
23300 #: ../fish/guestfish-actions.pod:3055
23308 #: ../fish/guestfish-actions.pod:3060
23309 msgid "ntfs-3g-probe"
23313 #: ../fish/guestfish-actions.pod:3062
23316 " ntfs-3g-probe true|false device\n"
23321 #: ../fish/guestfish-actions.pod:3076
23326 #: ../fish/guestfish-actions.pod:3078
23329 " ntfsresize device\n"
23334 #: ../fish/guestfish-actions.pod:3084
23335 msgid "ntfsresize-size"
23339 #: ../fish/guestfish-actions.pod:3086
23342 " ntfsresize-size device size\n"
23347 #: ../fish/guestfish-actions.pod:3088
23349 "This command is the same as L</ntfsresize> except that it allows you to "
23350 "specify the new size (in bytes) explicitly."
23354 #: ../fish/guestfish-actions.pod:3091
23359 #: ../fish/guestfish-actions.pod:3093
23362 " part-add device prlogex startsect endsect\n"
23367 #: ../fish/guestfish-actions.pod:3095
23369 "This command adds a partition to C<device>. If there is no partition table "
23370 "on the device, call L</part-init> first."
23374 #: ../fish/guestfish-actions.pod:3107
23376 "Creating a partition which covers the whole disk is not so easy. Use L</"
23377 "part-disk> to do that."
23381 #: ../fish/guestfish-actions.pod:3110
23386 #: ../fish/guestfish-actions.pod:3112
23389 " part-del device partnum\n"
23394 #: ../fish/guestfish-actions.pod:3120
23399 #: ../fish/guestfish-actions.pod:3122
23402 " part-disk device parttype\n"
23407 #: ../fish/guestfish-actions.pod:3124
23409 "This command is simply a combination of L</part-init> followed by L</part-"
23410 "add> to create a single primary partition covering the whole disk."
23414 #: ../fish/guestfish-actions.pod:3128
23416 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
23417 "possible values are described in L</part-init>."
23421 #: ../fish/guestfish-actions.pod:3134
23422 msgid "part-get-bootable"
23426 #: ../fish/guestfish-actions.pod:3136
23429 " part-get-bootable device partnum\n"
23434 #: ../fish/guestfish-actions.pod:3141
23435 msgid "See also L</part-set-bootable>."
23439 #: ../fish/guestfish-actions.pod:3143
23440 msgid "part-get-mbr-id"
23444 #: ../fish/guestfish-actions.pod:3145
23447 " part-get-mbr-id device partnum\n"
23452 #: ../fish/guestfish-actions.pod:3150 ../fish/guestfish-actions.pod:3288
23454 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
23455 "undefined results for other partition table types (see L</part-get-"
23460 #: ../fish/guestfish-actions.pod:3154
23461 msgid "part-get-parttype"
23465 #: ../fish/guestfish-actions.pod:3156
23468 " part-get-parttype device\n"
23473 #: ../fish/guestfish-actions.pod:3161
23475 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
23476 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
23477 "possible, although unusual. See L</part-init> for a full list."
23481 #: ../fish/guestfish-actions.pod:3166
23486 #: ../fish/guestfish-actions.pod:3168
23489 " part-init device parttype\n"
23494 #: ../fish/guestfish-actions.pod:3174
23496 "Initially there are no partitions. Following this, you should call L</part-"
23497 "add> for each partition required."
23501 #: ../fish/guestfish-actions.pod:3237
23506 #: ../fish/guestfish-actions.pod:3239
23509 " part-list device\n"
23514 #: ../fish/guestfish-actions.pod:3254
23516 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23517 "the device's sector size, see L</blockdev-getss>."
23521 #: ../fish/guestfish-actions.pod:3267
23522 msgid "part-set-bootable"
23526 #: ../fish/guestfish-actions.pod:3269
23529 " part-set-bootable device partnum true|false\n"
23534 #: ../fish/guestfish-actions.pod:3278
23535 msgid "part-set-mbr-id"
23539 #: ../fish/guestfish-actions.pod:3280
23542 " part-set-mbr-id device partnum idbyte\n"
23547 #: ../fish/guestfish-actions.pod:3292
23548 msgid "part-set-name"
23552 #: ../fish/guestfish-actions.pod:3294
23555 " part-set-name device partnum name\n"
23560 #: ../fish/guestfish-actions.pod:3302
23561 msgid "part-to-dev"
23565 #: ../fish/guestfish-actions.pod:3304
23568 " part-to-dev partition\n"
23573 #: ../fish/guestfish-actions.pod:3310
23575 "The named partition must exist, for example as a string returned from L</"
23576 "list-partitions>."
23580 #: ../fish/guestfish-actions.pod:3313
23581 msgid "ping-daemon"
23585 #: ../fish/guestfish-actions.pod:3315
23593 #: ../fish/guestfish-actions.pod:3322
23598 #: ../fish/guestfish-actions.pod:3324
23601 " pread path count offset\n"
23606 #: ../fish/guestfish-actions.pod:3332
23607 msgid "See also L</pwrite>, L</pread-device>."
23611 #: ../fish/guestfish-actions.pod:3337
23612 msgid "pread-device"
23616 #: ../fish/guestfish-actions.pod:3339
23619 " pread-device device count offset\n"
23624 #: ../fish/guestfish-actions.pod:3347
23625 msgid "See also L</pread>."
23629 #: ../fish/guestfish-actions.pod:3352
23634 #: ../fish/guestfish-actions.pod:3354
23637 " pvcreate device\n"
23642 #: ../fish/guestfish-actions.pod:3360
23647 #: ../fish/guestfish-actions.pod:3362
23650 " pvremove device\n"
23655 #: ../fish/guestfish-actions.pod:3371
23660 #: ../fish/guestfish-actions.pod:3373
23663 " pvresize device\n"
23668 #: ../fish/guestfish-actions.pod:3378
23669 msgid "pvresize-size"
23673 #: ../fish/guestfish-actions.pod:3380
23676 " pvresize-size device size\n"
23681 #: ../fish/guestfish-actions.pod:3382
23683 "This command is the same as L</pvresize> except that it allows you to "
23684 "specify the new size (in bytes) explicitly."
23688 #: ../fish/guestfish-actions.pod:3385
23693 #: ../fish/guestfish-actions.pod:3387
23701 #: ../fish/guestfish-actions.pod:3395
23702 msgid "See also L</pvs-full>."
23706 #: ../fish/guestfish-actions.pod:3397
23711 #: ../fish/guestfish-actions.pod:3399
23719 #: ../fish/guestfish-actions.pod:3404
23724 #: ../fish/guestfish-actions.pod:3406
23732 #: ../fish/guestfish-actions.pod:3410
23737 #: ../fish/guestfish-actions.pod:3412
23740 " pwrite path content offset\n"
23745 #: ../fish/guestfish-actions.pod:3423
23746 msgid "See also L</pread>, L</pwrite-device>."
23750 #: ../fish/guestfish-actions.pod:3428
23751 msgid "pwrite-device"
23755 #: ../fish/guestfish-actions.pod:3430
23758 " pwrite-device device content offset\n"
23763 #: ../fish/guestfish-actions.pod:3440
23764 msgid "See also L</pwrite>."
23768 #: ../fish/guestfish-actions.pod:3445
23773 #: ../fish/guestfish-actions.pod:3447
23776 " read-file path\n"
23781 #: ../fish/guestfish-actions.pod:3452
23783 "Unlike L</cat>, this function can correctly handle files that contain "
23784 "embedded ASCII NUL characters. However unlike L</download>, this function "
23785 "is limited in the total size of file that can be handled."
23789 #: ../fish/guestfish-actions.pod:3460
23794 #: ../fish/guestfish-actions.pod:3462
23797 " read-lines path\n"
23802 #: ../fish/guestfish-actions.pod:3469
23804 "Note that this function cannot correctly handle binary files (specifically, "
23805 "files containing C<\\0> character which is treated as end of line). For "
23806 "those you need to use the L</read-file> function which has a more complex "
23811 #: ../fish/guestfish-actions.pod:3474
23816 #: ../fish/guestfish-actions.pod:3476
23824 #: ../fish/guestfish-actions.pod:3528
23826 "This function is primarily intended for use by programs. To get a simple "
23827 "list of names, use L</ls>. To get a printable directory for human "
23828 "consumption, use L</ll>."
23832 #: ../fish/guestfish-actions.pod:3532
23837 #: ../fish/guestfish-actions.pod:3534
23845 #: ../fish/guestfish-actions.pod:3538
23846 msgid "readlinklist"
23850 #: ../fish/guestfish-actions.pod:3540
23853 " readlinklist path 'names ...'\n"
23858 #: ../fish/guestfish-actions.pod:3564
23863 #: ../fish/guestfish-actions.pod:3566
23871 #: ../fish/guestfish-actions.pod:3571
23872 msgid "removexattr"
23876 #: ../fish/guestfish-actions.pod:3573
23879 " removexattr xattr path\n"
23884 #: ../fish/guestfish-actions.pod:3578
23885 msgid "See also: L</lremovexattr>, L<attr(5)>."
23889 #: ../fish/guestfish-actions.pod:3580
23894 #: ../fish/guestfish-actions.pod:3582
23897 " resize2fs device\n"
23902 #: ../fish/guestfish-actions.pod:3587
23904 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23905 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23906 "gives an error about this and sometimes not. In any case, it is always safe "
23907 "to call L</e2fsck-f> before calling this function."
23911 #: ../fish/guestfish-actions.pod:3593
23912 msgid "resize2fs-size"
23916 #: ../fish/guestfish-actions.pod:3595
23919 " resize2fs-size device size\n"
23924 #: ../fish/guestfish-actions.pod:3597
23926 "This command is the same as L</resize2fs> except that it allows you to "
23927 "specify the new size (in bytes) explicitly."
23931 #: ../fish/guestfish-actions.pod:3600
23936 #: ../fish/guestfish-actions.pod:3602
23944 #: ../fish/guestfish-actions.pod:3606
23949 #: ../fish/guestfish-actions.pod:3608
23957 #: ../fish/guestfish-actions.pod:3614
23962 #: ../fish/guestfish-actions.pod:3616
23970 #: ../fish/guestfish-actions.pod:3620
23971 msgid "rmmountpoint"
23975 #: ../fish/guestfish-actions.pod:3622
23978 " rmmountpoint exemptpath\n"
23983 #: ../fish/guestfish-actions.pod:3624
23985 "This calls removes a mountpoint that was previously created with L</"
23986 "mkmountpoint>. See L</mkmountpoint> for full details."
23990 #: ../fish/guestfish-actions.pod:3628
23991 msgid "scrub-device"
23995 #: ../fish/guestfish-actions.pod:3630
23998 " scrub-device device\n"
24003 #: ../fish/guestfish-actions.pod:3641
24008 #: ../fish/guestfish-actions.pod:3643
24011 " scrub-file file\n"
24016 #: ../fish/guestfish-actions.pod:3653
24017 msgid "scrub-freespace"
24021 #: ../fish/guestfish-actions.pod:3655
24024 " scrub-freespace dir\n"
24029 #: ../fish/guestfish-actions.pod:3657
24031 "This command creates the directory C<dir> and then fills it with files until "
24032 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
24033 "deletes them. The intention is to scrub any free space on the partition "
24034 "containing C<dir>."
24038 #: ../fish/guestfish-actions.pod:3666
24043 #: ../fish/guestfish-actions.pod:3668
24048 #: ../fish/guestfish-actions.pod:3670
24051 " set-append append\n"
24056 #: ../fish/guestfish-actions.pod:3681
24057 msgid "set-autosync"
24061 #: ../fish/guestfish-actions.pod:3683
24066 #: ../fish/guestfish-actions.pod:3685
24069 " set-autosync true|false\n"
24074 #: ../fish/guestfish-actions.pod:3687
24076 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
24077 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
24078 "closed (also if the program exits without closing handles)."
24082 #: ../fish/guestfish-actions.pod:3695
24087 #: ../fish/guestfish-actions.pod:3697
24092 #: ../fish/guestfish-actions.pod:3699
24095 " set-direct true|false\n"
24100 #: ../fish/guestfish-actions.pod:3705
24102 "One consequence of this is that log messages aren't caught by the library "
24103 "and handled by L</set-log-message-callback>, but go straight to stdout."
24107 #: ../fish/guestfish-actions.pod:3714
24108 msgid "set-e2label"
24112 #: ../fish/guestfish-actions.pod:3716
24115 " set-e2label device label\n"
24120 #: ../fish/guestfish-actions.pod:3722
24122 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
24123 "label on a filesystem."
24127 #: ../fish/guestfish-actions.pod:3725
24132 #: ../fish/guestfish-actions.pod:3727
24135 " set-e2uuid device uuid\n"
24140 #: ../fish/guestfish-actions.pod:3734
24142 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
24143 "UUID of a filesystem."
24147 #: ../fish/guestfish-actions.pod:3737
24148 msgid "set-memsize"
24152 #: ../fish/guestfish-actions.pod:3739
24157 #: ../fish/guestfish-actions.pod:3741
24160 " set-memsize memsize\n"
24165 #: ../fish/guestfish-actions.pod:3743
24167 "This sets the memory size in megabytes allocated to the qemu subprocess. "
24168 "This only has any effect if called before L</launch>."
24172 #: ../fish/guestfish-actions.pod:3754
24173 msgid "set-network"
24177 #: ../fish/guestfish-actions.pod:3756
24182 #: ../fish/guestfish-actions.pod:3758
24185 " set-network true|false\n"
24190 #: ../fish/guestfish-actions.pod:3766
24192 "You must call this before calling L</launch>, otherwise it has no effect."
24196 #: ../fish/guestfish-actions.pod:3769
24201 #: ../fish/guestfish-actions.pod:3771
24206 #: ../fish/guestfish-actions.pod:3773
24209 " set-path searchpath\n"
24214 #: ../fish/guestfish-actions.pod:3782
24219 #: ../fish/guestfish-actions.pod:3784
24224 #: ../fish/guestfish-actions.pod:3786
24232 #: ../fish/guestfish-actions.pod:3806
24233 msgid "set-recovery-proc"
24237 #: ../fish/guestfish-actions.pod:3808
24238 msgid "recovery-proc"
24242 #: ../fish/guestfish-actions.pod:3810
24245 " set-recovery-proc true|false\n"
24250 #: ../fish/guestfish-actions.pod:3812
24252 "If this is called with the parameter C<false> then L</launch> does not "
24253 "create a recovery process. The purpose of the recovery process is to stop "
24254 "runaway qemu processes in the case where the main program aborts abruptly."
24258 #: ../fish/guestfish-actions.pod:3817
24260 "This only has any effect if called before L</launch>, and the default is "
24265 #: ../fish/guestfish-actions.pod:3826
24266 msgid "set-selinux"
24270 #: ../fish/guestfish-actions.pod:3828
24275 #: ../fish/guestfish-actions.pod:3830
24278 " set-selinux true|false\n"
24283 #: ../fish/guestfish-actions.pod:3841
24288 #: ../fish/guestfish-actions.pod:3843
24293 #: ../fish/guestfish-actions.pod:3845
24296 " set-trace true|false\n"
24301 #: ../fish/guestfish-actions.pod:3861
24302 msgid "set-verbose"
24306 #: ../fish/guestfish-actions.pod:3863
24311 #: ../fish/guestfish-actions.pod:3865
24314 " set-verbose true|false\n"
24319 #: ../fish/guestfish-actions.pod:3872
24324 #: ../fish/guestfish-actions.pod:3874
24327 " setcon context\n"
24332 #: ../fish/guestfish-actions.pod:3881
24337 #: ../fish/guestfish-actions.pod:3883
24340 " setxattr xattr val vallen path\n"
24345 #: ../fish/guestfish-actions.pod:3889
24346 msgid "See also: L</lsetxattr>, L<attr(5)>."
24350 #: ../fish/guestfish-actions.pod:3891
24355 #: ../fish/guestfish-actions.pod:3893
24358 " sfdisk device cyls heads sectors 'lines ...'\n"
24363 #: ../fish/guestfish-actions.pod:3915
24364 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
24368 #: ../fish/guestfish-actions.pod:3921
24373 #: ../fish/guestfish-actions.pod:3923
24376 " sfdiskM device 'lines ...'\n"
24381 #: ../fish/guestfish-actions.pod:3925
24383 "This is a simplified interface to the L</sfdisk> command, where partition "
24384 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
24385 "you don't need to specify the cyls, heads and sectors parameters which were "
24386 "rarely if ever used anyway."
24390 #: ../fish/guestfish-actions.pod:3931
24391 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
24395 #: ../fish/guestfish-actions.pod:3937
24400 #: ../fish/guestfish-actions.pod:3939
24403 " sfdisk-N device partnum cyls heads sectors line\n"
24408 #: ../fish/guestfish-actions.pod:3944
24410 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
24411 "cyls/heads/sectors parameters."
24415 #: ../fish/guestfish-actions.pod:3947
24416 msgid "See also: L</part-add>"
24420 #: ../fish/guestfish-actions.pod:3952
24421 msgid "sfdisk-disk-geometry"
24425 #: ../fish/guestfish-actions.pod:3954
24428 " sfdisk-disk-geometry device\n"
24433 #: ../fish/guestfish-actions.pod:3956
24435 "This displays the disk geometry of C<device> read from the partition table. "
24436 "Especially in the case where the underlying block device has been resized, "
24437 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
24438 "kernel-geometry>)."
24442 #: ../fish/guestfish-actions.pod:3964
24443 msgid "sfdisk-kernel-geometry"
24447 #: ../fish/guestfish-actions.pod:3966
24450 " sfdisk-kernel-geometry device\n"
24455 #: ../fish/guestfish-actions.pod:3973
24460 #: ../fish/guestfish-actions.pod:3975
24463 " sfdisk-l device\n"
24468 #: ../fish/guestfish-actions.pod:3981
24469 msgid "See also: L</part-list>"
24473 #: ../fish/guestfish-actions.pod:3983
24478 #: ../fish/guestfish-actions.pod:3985
24486 #: ../fish/guestfish-actions.pod:3990
24487 msgid "This is like L</command>, but passes the command to:"
24491 #: ../fish/guestfish-actions.pod:3998
24492 msgid "All the provisos about L</command> apply to this call."
24496 #: ../fish/guestfish-actions.pod:4000
24501 #: ../fish/guestfish-actions.pod:4002
24504 " sh-lines command\n"
24509 #: ../fish/guestfish-actions.pod:4004
24510 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24514 #: ../fish/guestfish-actions.pod:4007
24515 msgid "See also: L</command-lines>"
24519 #: ../fish/guestfish-actions.pod:4009
24524 #: ../fish/guestfish-actions.pod:4011
24532 #: ../fish/guestfish-actions.pod:4015
24537 #: ../fish/guestfish-actions.pod:4017
24545 #: ../fish/guestfish-actions.pod:4023
24550 #: ../fish/guestfish-actions.pod:4025
24558 #: ../fish/guestfish-actions.pod:4033
24563 #: ../fish/guestfish-actions.pod:4035
24571 #: ../fish/guestfish-actions.pod:4043
24576 #: ../fish/guestfish-actions.pod:4045
24579 " strings-e encoding path\n"
24584 #: ../fish/guestfish-actions.pod:4047
24586 "This is like the L</strings> command, but allows you to specify the encoding "
24587 "of strings that are looked for in the source file C<path>."
24591 #: ../fish/guestfish-actions.pod:4057
24593 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24594 "ISO-8859-X (this is what L</strings> uses)."
24598 #: ../fish/guestfish-actions.pod:4089
24599 msgid "swapoff-device"
24603 #: ../fish/guestfish-actions.pod:4091
24606 " swapoff-device device\n"
24611 #: ../fish/guestfish-actions.pod:4093
24613 "This command disables the libguestfs appliance swap device or partition "
24614 "named C<device>. See L</swapon-device>."
24618 #: ../fish/guestfish-actions.pod:4097
24619 msgid "swapoff-file"
24623 #: ../fish/guestfish-actions.pod:4099
24626 " swapoff-file file\n"
24631 #: ../fish/guestfish-actions.pod:4103
24632 msgid "swapoff-label"
24636 #: ../fish/guestfish-actions.pod:4105
24639 " swapoff-label label\n"
24644 #: ../fish/guestfish-actions.pod:4110
24645 msgid "swapoff-uuid"
24649 #: ../fish/guestfish-actions.pod:4112
24652 " swapoff-uuid uuid\n"
24657 #: ../fish/guestfish-actions.pod:4117
24658 msgid "swapon-device"
24662 #: ../fish/guestfish-actions.pod:4119
24665 " swapon-device device\n"
24670 #: ../fish/guestfish-actions.pod:4121
24672 "This command enables the libguestfs appliance to use the swap device or "
24673 "partition named C<device>. The increased memory is made available for all "
24674 "commands, for example those run using L</command> or L</sh>."
24678 #: ../fish/guestfish-actions.pod:4133
24679 msgid "swapon-file"
24683 #: ../fish/guestfish-actions.pod:4135
24686 " swapon-file file\n"
24691 #: ../fish/guestfish-actions.pod:4137
24693 "This command enables swap to a file. See L</swapon-device> for other notes."
24697 #: ../fish/guestfish-actions.pod:4140
24698 msgid "swapon-label"
24702 #: ../fish/guestfish-actions.pod:4142
24705 " swapon-label label\n"
24710 #: ../fish/guestfish-actions.pod:4144
24712 "This command enables swap to a labeled swap partition. See L</swapon-"
24713 "device> for other notes."
24717 #: ../fish/guestfish-actions.pod:4147
24718 msgid "swapon-uuid"
24722 #: ../fish/guestfish-actions.pod:4149
24725 " swapon-uuid uuid\n"
24730 #: ../fish/guestfish-actions.pod:4151
24732 "This command enables swap to a swap partition with the given UUID. See L</"
24733 "swapon-device> for other notes."
24737 #: ../fish/guestfish-actions.pod:4154
24742 #: ../fish/guestfish-actions.pod:4156
24750 #: ../fish/guestfish-actions.pod:4164
24755 #: ../fish/guestfish-actions.pod:4166
24763 #: ../fish/guestfish-actions.pod:4174
24768 #: ../fish/guestfish-actions.pod:4176
24771 " tail-n nrlines path\n"
24776 #: ../fish/guestfish-actions.pod:4189
24781 #: ../fish/guestfish-actions.pod:4191
24784 " tar-in (tarfile|-) directory\n"
24789 #: ../fish/guestfish-actions.pod:4196
24790 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24794 #: ../fish/guestfish-actions.pod:4201
24799 #: ../fish/guestfish-actions.pod:4203
24802 " tar-out directory (tarfile|-)\n"
24807 #: ../fish/guestfish-actions.pod:4208
24808 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24812 #: ../fish/guestfish-actions.pod:4213
24817 #: ../fish/guestfish-actions.pod:4215
24820 " tgz-in (tarball|-) directory\n"
24825 #: ../fish/guestfish-actions.pod:4220
24826 msgid "To upload an uncompressed tarball, use L</tar-in>."
24830 #: ../fish/guestfish-actions.pod:4224
24835 #: ../fish/guestfish-actions.pod:4226
24838 " tgz-out directory (tarball|-)\n"
24843 #: ../fish/guestfish-actions.pod:4231
24844 msgid "To download an uncompressed tarball, use L</tar-out>."
24848 #: ../fish/guestfish-actions.pod:4235
24853 #: ../fish/guestfish-actions.pod:4237
24861 #: ../fish/guestfish-actions.pod:4246
24866 #: ../fish/guestfish-actions.pod:4248
24874 #: ../fish/guestfish-actions.pod:4253
24875 msgid "truncate-size"
24879 #: ../fish/guestfish-actions.pod:4255
24882 " truncate-size path size\n"
24887 #: ../fish/guestfish-actions.pod:4260
24889 "If the current file size is less than C<size> then the file is extended to "
24890 "the required size with zero bytes. This creates a sparse file (ie. disk "
24891 "blocks are not allocated for the file until you write to it). To create a "
24892 "non-sparse file of zeroes, use L</fallocate64> instead."
24896 #: ../fish/guestfish-actions.pod:4266
24901 #: ../fish/guestfish-actions.pod:4268
24904 " tune2fs-l device\n"
24909 #: ../fish/guestfish-actions.pod:4278
24914 #: ../fish/guestfish-actions.pod:4280
24917 " txz-in (tarball|-) directory\n"
24922 #: ../fish/guestfish-actions.pod:4287
24927 #: ../fish/guestfish-actions.pod:4289
24930 " txz-out directory (tarball|-)\n"
24935 #: ../fish/guestfish-actions.pod:4296
24940 #: ../fish/guestfish-actions.pod:4298
24948 #: ../fish/guestfish-actions.pod:4312
24949 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24953 #: ../fish/guestfish-actions.pod:4317
24958 #: ../fish/guestfish-actions.pod:4319
24963 #: ../fish/guestfish-actions.pod:4321
24966 " umount pathordevice\n"
24971 #: ../fish/guestfish-actions.pod:4327
24976 #: ../fish/guestfish-actions.pod:4329
24977 msgid "unmount-all"
24981 #: ../fish/guestfish-actions.pod:4331
24989 #: ../fish/guestfish-actions.pod:4337
24994 #: ../fish/guestfish-actions.pod:4339
24997 " upload (filename|-) remotefilename\n"
25002 #: ../fish/guestfish-actions.pod:4346
25003 msgid "See also L</download>."
25007 #: ../fish/guestfish-actions.pod:4350
25008 msgid "upload-offset"
25012 #: ../fish/guestfish-actions.pod:4352
25015 " upload-offset (filename|-) remotefilename offset\n"
25020 #: ../fish/guestfish-actions.pod:4364
25022 "Note that there is no limit on the amount of data that can be uploaded with "
25023 "this call, unlike with L</pwrite>, and this call always writes the full "
25024 "amount unless an error occurs."
25028 #: ../fish/guestfish-actions.pod:4369
25029 msgid "See also L</upload>, L</pwrite>."
25033 #: ../fish/guestfish-actions.pod:4373
25038 #: ../fish/guestfish-actions.pod:4375
25041 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
25046 #: ../fish/guestfish-actions.pod:4394
25051 #: ../fish/guestfish-actions.pod:4396
25059 #: ../fish/guestfish-actions.pod:4423
25061 "I<Note:> Don't use this call to test for availability of features. In "
25062 "enterprise distributions we backport features from later versions into "
25063 "earlier versions, making this an unreliable way to test for features. Use "
25064 "L</available> instead."
25068 #: ../fish/guestfish-actions.pod:4429
25073 #: ../fish/guestfish-actions.pod:4431
25076 " vfs-label device\n"
25081 #: ../fish/guestfish-actions.pod:4438
25082 msgid "To find a filesystem from the label, use L</findfs-label>."
25086 #: ../fish/guestfish-actions.pod:4440
25091 #: ../fish/guestfish-actions.pod:4442
25094 " vfs-type device\n"
25099 #: ../fish/guestfish-actions.pod:4452
25104 #: ../fish/guestfish-actions.pod:4454
25107 " vfs-uuid device\n"
25112 #: ../fish/guestfish-actions.pod:4461
25113 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
25117 #: ../fish/guestfish-actions.pod:4463
25118 msgid "vg-activate"
25122 #: ../fish/guestfish-actions.pod:4465
25125 " vg-activate true|false 'volgroups ...'\n"
25130 #: ../fish/guestfish-actions.pod:4478
25131 msgid "vg-activate-all"
25135 #: ../fish/guestfish-actions.pod:4480
25138 " vg-activate-all true|false\n"
25143 #: ../fish/guestfish-actions.pod:4490
25148 #: ../fish/guestfish-actions.pod:4492
25151 " vgcreate volgroup 'physvols ...'\n"
25156 #: ../fish/guestfish-actions.pod:4497
25161 #: ../fish/guestfish-actions.pod:4499
25164 " vglvuuids vgname\n"
25169 #: ../fish/guestfish-actions.pod:4504
25171 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
25172 "logical volumes and volume groups."
25176 #: ../fish/guestfish-actions.pod:4507
25177 msgid "See also L</vgpvuuids>."
25181 #: ../fish/guestfish-actions.pod:4509
25186 #: ../fish/guestfish-actions.pod:4511
25189 " vgpvuuids vgname\n"
25194 #: ../fish/guestfish-actions.pod:4516
25196 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
25197 "physical volumes and volume groups."
25201 #: ../fish/guestfish-actions.pod:4519
25202 msgid "See also L</vglvuuids>."
25206 #: ../fish/guestfish-actions.pod:4521
25211 #: ../fish/guestfish-actions.pod:4523
25214 " vgremove vgname\n"
25219 #: ../fish/guestfish-actions.pod:4530
25224 #: ../fish/guestfish-actions.pod:4532
25227 " vgrename volgroup newvolgroup\n"
25232 #: ../fish/guestfish-actions.pod:4536
25237 #: ../fish/guestfish-actions.pod:4538
25245 #: ../fish/guestfish-actions.pod:4546
25246 msgid "See also L</vgs-full>."
25250 #: ../fish/guestfish-actions.pod:4548
25255 #: ../fish/guestfish-actions.pod:4550
25263 #: ../fish/guestfish-actions.pod:4555
25268 #: ../fish/guestfish-actions.pod:4557
25276 #: ../fish/guestfish-actions.pod:4562
25281 #: ../fish/guestfish-actions.pod:4564
25289 #: ../fish/guestfish-actions.pod:4568
25294 #: ../fish/guestfish-actions.pod:4570
25302 #: ../fish/guestfish-actions.pod:4575
25307 #: ../fish/guestfish-actions.pod:4577
25315 #: ../fish/guestfish-actions.pod:4582
25320 #: ../fish/guestfish-actions.pod:4584
25328 #: ../fish/guestfish-actions.pod:4589
25333 #: ../fish/guestfish-actions.pod:4591
25336 " write path content\n"
25341 #: ../fish/guestfish-actions.pod:4599
25346 #: ../fish/guestfish-actions.pod:4601
25349 " write-file path content size\n"
25354 #: ../fish/guestfish-actions.pod:4624
25359 #: ../fish/guestfish-actions.pod:4626
25362 " zegrep regex path\n"
25367 #: ../fish/guestfish-actions.pod:4634
25372 #: ../fish/guestfish-actions.pod:4636
25375 " zegrepi regex path\n"
25380 #: ../fish/guestfish-actions.pod:4644
25385 #: ../fish/guestfish-actions.pod:4646
25393 #: ../fish/guestfish-actions.pod:4654
25394 msgid "See also: L</zero-device>, L</scrub-device>."
25398 #: ../fish/guestfish-actions.pod:4656
25399 msgid "zero-device"
25403 #: ../fish/guestfish-actions.pod:4658
25406 " zero-device device\n"
25411 #: ../fish/guestfish-actions.pod:4660
25413 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
25414 "which just zeroes the first few blocks of a device."
25418 #: ../fish/guestfish-actions.pod:4667
25423 #: ../fish/guestfish-actions.pod:4669
25426 " zerofree device\n"
25431 #: ../fish/guestfish-actions.pod:4682
25436 #: ../fish/guestfish-actions.pod:4684
25439 " zfgrep pattern path\n"
25444 #: ../fish/guestfish-actions.pod:4692
25449 #: ../fish/guestfish-actions.pod:4694
25452 " zfgrepi pattern path\n"
25457 #: ../fish/guestfish-actions.pod:4702
25462 #: ../fish/guestfish-actions.pod:4704
25465 " zfile meth path\n"
25470 #: ../fish/guestfish-actions.pod:4711
25472 "Since 1.0.63, use L</file> instead which can now process compressed files."
25476 #: ../fish/guestfish-actions.pod:4721
25481 #: ../fish/guestfish-actions.pod:4723
25484 " zgrep regex path\n"
25489 #: ../fish/guestfish-actions.pod:4731
25494 #: ../fish/guestfish-actions.pod:4733
25497 " zgrepi regex path\n"
25502 #: ../fish/guestfish-commands.pod:1
25507 #: ../fish/guestfish-commands.pod:3
25512 #: ../fish/guestfish-commands.pod:5
25515 " alloc filename size\n"
25520 #: ../fish/guestfish-commands.pod:7
25522 "This creates an empty (zeroed) file of the given size, and then adds so it "
25523 "can be further examined."
25527 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25528 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25532 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25533 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25537 #: ../fish/guestfish-commands.pod:14
25539 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25540 "image, see L</PREPARED DISK IMAGES>."
25544 #: ../fish/guestfish-commands.pod:17
25549 #: ../fish/guestfish-commands.pod:19
25552 " copy-in local [local ...] /remotedir\n"
25557 #: ../fish/guestfish-commands.pod:21
25559 "C<copy-in> copies local files or directories recursively into the disk "
25560 "image, placing them in the directory called C</remotedir> (which must "
25561 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25562 "other commands as necessary."
25566 #: ../fish/guestfish-commands.pod:26
25568 "Multiple local files and directories can be specified, but the last "
25569 "parameter must always be a remote directory. Wildcards cannot be used."
25573 #: ../fish/guestfish-commands.pod:30
25578 #: ../fish/guestfish-commands.pod:32
25581 " copy-out remote [remote ...] localdir\n"
25586 #: ../fish/guestfish-commands.pod:34
25588 "C<copy-out> copies remote files or directories recursively out of the disk "
25589 "image, placing them on the host disk in a local directory called C<localdir> "
25590 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25591 "download>, L</tar-out> and other commands as necessary."
25595 #: ../fish/guestfish-commands.pod:40
25597 "Multiple remote files and directories can be specified, but the last "
25598 "parameter must always be a local directory. To download to the current "
25599 "directory, use C<.> as in:"
25603 #: ../fish/guestfish-commands.pod:44
25606 " copy-out /home .\n"
25611 #: ../fish/guestfish-commands.pod:46
25613 "Wildcards cannot be used in the ordinary command, but you can use them with "
25614 "the help of L</glob> like this:"
25618 #: ../fish/guestfish-commands.pod:49
25621 " glob copy-out /home/* .\n"
25626 #: ../fish/guestfish-commands.pod:51
25631 #: ../fish/guestfish-commands.pod:53
25634 " echo [params ...]\n"
25639 #: ../fish/guestfish-commands.pod:55
25640 msgid "This echos the parameters to the terminal."
25644 #: ../fish/guestfish-commands.pod:57
25649 #: ../fish/guestfish-commands.pod:59
25654 #: ../fish/guestfish-commands.pod:61
25659 #: ../fish/guestfish-commands.pod:63
25667 #: ../fish/guestfish-commands.pod:65
25669 "This is used to edit a file. It downloads the file, edits it locally using "
25670 "your editor, then uploads the result."
25674 #: ../fish/guestfish-commands.pod:68
25676 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25677 "or C<emacs> you will get those corresponding editors."
25681 #: ../fish/guestfish-commands.pod:72
25686 #: ../fish/guestfish-commands.pod:74
25689 " glob command args...\n"
25694 #: ../fish/guestfish-commands.pod:76
25696 "Expand wildcards in any paths in the args list, and run C<command> "
25697 "repeatedly on each matching path."
25701 #: ../fish/guestfish-commands.pod:79
25702 msgid "See L</WILDCARDS AND GLOBBING>."
25706 #: ../fish/guestfish-commands.pod:81
25711 #: ../fish/guestfish-commands.pod:83
25714 " hexedit <filename|device>\n"
25715 " hexedit <filename|device> <max>\n"
25716 " hexedit <filename|device> <start> <max>\n"
25721 #: ../fish/guestfish-commands.pod:87
25723 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25728 #: ../fish/guestfish-commands.pod:90
25730 "This command works by downloading potentially the whole file or device, "
25731 "editing it locally, then uploading it. If the file or device is large, you "
25732 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25733 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25734 "usual modifiers allowed such as C<1M> (1 megabyte)."
25738 #: ../fish/guestfish-commands.pod:97
25739 msgid "For example to edit the first few sectors of a disk you might do:"
25743 #: ../fish/guestfish-commands.pod:100
25746 " hexedit /dev/sda 1M\n"
25751 #: ../fish/guestfish-commands.pod:102
25753 "which would allow you to edit anywhere within the first megabyte of the disk."
25757 #: ../fish/guestfish-commands.pod:105
25758 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25762 #: ../fish/guestfish-commands.pod:107
25765 " hexedit /dev/sda1 0x400 0x400\n"
25770 #: ../fish/guestfish-commands.pod:109
25771 msgid "(assuming the superblock is in the standard location)."
25775 #: ../fish/guestfish-commands.pod:111
25777 "This command requires the external L<hexedit(1)> program. You can specify "
25778 "another program to use by setting the C<HEXEDITOR> environment variable."
25782 #: ../fish/guestfish-commands.pod:115
25783 msgid "See also L</hexdump>."
25787 #: ../fish/guestfish-commands.pod:117
25792 #: ../fish/guestfish-commands.pod:119
25800 #: ../fish/guestfish-commands.pod:121
25802 "Change the local directory, ie. the current directory of guestfish itself."
25806 #: ../fish/guestfish-commands.pod:124
25807 msgid "Note that C<!cd> won't do what you might expect."
25811 #: ../fish/guestfish-commands.pod:126
25816 #: ../fish/guestfish-commands.pod:128
25821 #: ../fish/guestfish-commands.pod:130
25829 #: ../fish/guestfish-commands.pod:132
25830 msgid "Opens the manual page for guestfish."
25834 #: ../fish/guestfish-commands.pod:134
25839 #: ../fish/guestfish-commands.pod:136
25844 #: ../fish/guestfish-commands.pod:138
25852 #: ../fish/guestfish-commands.pod:140
25860 #: ../fish/guestfish-commands.pod:142
25861 msgid "This is used to view a file."
25865 #: ../fish/guestfish-commands.pod:144
25867 "The default viewer is C<$PAGER>. However if you use the alternate command "
25868 "C<less> you will get the C<less> command specifically."
25872 #: ../fish/guestfish-commands.pod:147
25877 #: ../fish/guestfish-commands.pod:149
25885 #: ../fish/guestfish-commands.pod:151
25887 "Close and reopen the libguestfs handle. It is not necessary to use this "
25888 "normally, because the handle is closed properly when guestfish exits. "
25889 "However this is occasionally useful for testing."
25893 #: ../fish/guestfish-commands.pod:155
25898 #: ../fish/guestfish-commands.pod:157
25901 " sparse filename size\n"
25906 #: ../fish/guestfish-commands.pod:159
25908 "This creates an empty sparse file of the given size, and then adds so it can "
25909 "be further examined."
25913 #: ../fish/guestfish-commands.pod:162
25915 "In all respects it works the same as the L</alloc> command, except that the "
25916 "image file is allocated sparsely, which means that disk blocks are not "
25917 "assigned to the file until they are needed. Sparse disk files only use "
25918 "space when written to, but they are slower and there is a danger you could "
25919 "run out of real disk space during a write operation."
25923 #: ../fish/guestfish-commands.pod:172
25928 #: ../fish/guestfish-commands.pod:174
25936 #: ../fish/guestfish-commands.pod:176
25938 "This command returns a list of the optional groups known to the daemon, and "
25939 "indicates which ones are supported by this build of the libguestfs appliance."
25943 #: ../fish/guestfish-commands.pod:180
25944 msgid "See also L<guestfs(3)/AVAILABILITY>."
25948 #: ../fish/guestfish-commands.pod:182
25953 #: ../fish/guestfish-commands.pod:184
25956 " time command args...\n"
25961 #: ../fish/guestfish-commands.pod:186
25963 "Run the command as usual, but print the elapsed time afterwards. This can "
25964 "be useful for benchmarking operations."
25968 #: ../test-tool/libguestfs-test-tool.pod:5
25969 msgid "libguestfs-test-tool - End user tests for libguestfs"
25973 #: ../test-tool/libguestfs-test-tool.pod:9
25976 " libguestfs-test-tool [--options]\n"
25981 #: ../test-tool/libguestfs-test-tool.pod:13
25983 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25984 "and developers, to allow them to check basic libguestfs functionality is "
25985 "working. This is needed because libguestfs occasionally breaks for reasons "
25986 "beyond our control: usually because of changes in the underlying qemu or "
25987 "kernel packages, or the host environment."
25991 #: ../test-tool/libguestfs-test-tool.pod:20
25992 msgid "If you suspect a problem in libguestfs, then just run:"
25996 #: ../test-tool/libguestfs-test-tool.pod:22
25999 " libguestfs-test-tool\n"
26004 #: ../test-tool/libguestfs-test-tool.pod:24
26005 msgid "It will print lots of diagnostic messages."
26009 #: ../test-tool/libguestfs-test-tool.pod:26
26010 msgid "If it runs to completion successfully, you will see this near the end:"
26014 #: ../test-tool/libguestfs-test-tool.pod:28
26017 " ===== TEST FINISHED OK =====\n"
26022 #: ../test-tool/libguestfs-test-tool.pod:30
26023 msgid "and the test tool will exit with code 0."
26027 #: ../test-tool/libguestfs-test-tool.pod:32
26029 "If it fails (and/or exits with non-zero error code), please paste the "
26030 "B<complete, unedited> output of the test tool into a bug report. More "
26031 "information about reporting bugs can be found on the L<http://libguestfs.org/"
26036 #: ../test-tool/libguestfs-test-tool.pod:41
26041 #: ../test-tool/libguestfs-test-tool.pod:43
26042 msgid "Display short usage information and exit."
26046 #: ../test-tool/libguestfs-test-tool.pod:45
26047 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
26051 #: ../test-tool/libguestfs-test-tool.pod:47
26053 "Pass an alternate name for the helper program. libguestfs-test-tool will "
26054 "normally look in the C<$libexec> directory that was configured when the tool "
26059 #: ../test-tool/libguestfs-test-tool.pod:51
26060 msgid "I<--qemu qemu_binary>"
26064 #: ../test-tool/libguestfs-test-tool.pod:53
26066 "If you have downloaded another qemu binary, point this option at the full "
26067 "path of the binary to try it."
26071 #: ../test-tool/libguestfs-test-tool.pod:56
26072 msgid "I<--qemudir qemu_source_dir>"
26076 #: ../test-tool/libguestfs-test-tool.pod:58
26078 "If you have compiled qemu from source, point this option at the source "
26079 "directory to try it."
26083 #: ../test-tool/libguestfs-test-tool.pod:61
26084 msgid "I<--timeout N>"
26088 #: ../test-tool/libguestfs-test-tool.pod:63
26090 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
26091 "does not usually need to be adjusted unless your machine is very slow."
26095 #: ../test-tool/libguestfs-test-tool.pod:69
26096 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
26100 #: ../test-tool/libguestfs-test-tool.pod:71
26102 "If you have compiled another version of qemu from source and would like to "
26103 "try that, then you can use the I<--qemudir> option to point to the qemu "
26104 "source directory."
26108 #: ../test-tool/libguestfs-test-tool.pod:75
26110 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
26111 "option to point to the binary."
26115 #: ../test-tool/libguestfs-test-tool.pod:78
26117 "When using an alternate qemu with libguestfs, usually you would need to "
26118 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
26119 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
26120 "use either of the I<--qemudir> or I<--qemu> options."
26124 #: ../test-tool/libguestfs-test-tool.pod:85
26126 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
26127 "I<1> if there was an error."
26131 #: ../test-tool/libguestfs-test-tool.pod:92
26132 msgid "/usr/libexec/libguestfs-test-tool-helper"
26136 #: ../test-tool/libguestfs-test-tool.pod:94
26138 "This helper program is run inside the appliance and provides additional "
26143 #: ../test-tool/libguestfs-test-tool.pod:97
26144 msgid "/usr/bin/mkisofs"
26148 #: ../test-tool/libguestfs-test-tool.pod:99
26150 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
26151 "which is used as part of the tests."
26155 #: ../test-tool/libguestfs-test-tool.pod:106
26157 "For the full list of environment variables which may affect libguestfs, "
26158 "please see the L<guestfs(3)> manual page."
26162 #: ../test-tool/libguestfs-test-tool.pod:111
26163 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
26167 #: ../test-tool/libguestfs-test-tool.pod:121
26168 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
26172 #: ../fuse/guestmount.pod:5
26174 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
26178 #: ../fuse/guestmount.pod:9
26181 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
26186 #: ../fuse/guestmount.pod:11
26189 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
26194 #: ../fuse/guestmount.pod:13
26197 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
26202 #: ../fuse/guestmount.pod:17
26204 "You must I<not> use C<guestmount> in read-write mode on live virtual "
26205 "machines. If you do this, you risk disk corruption in the VM."
26209 #: ../fuse/guestmount.pod:22
26211 "The guestmount program can be used to mount virtual machine filesystems and "
26212 "other disk images on the host. It uses libguestfs for access to the guest "
26213 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
26214 "a mountable device."
26218 #: ../fuse/guestmount.pod:27
26220 "Along with other options, you have to give at least one device (I<-a> "
26221 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
26222 "option) or use the I<-i> inspection option. How this works is better "
26223 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
26228 #: ../fuse/guestmount.pod:33
26230 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
26231 "by you, and the filesystem will not be visible to any other users unless you "
26232 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
26233 "the filesystem, use the C<fusermount -u> command."
26237 #: ../fuse/guestmount.pod:41
26239 "For a typical Windows guest which has its main filesystem on the first "
26244 #: ../fuse/guestmount.pod:44
26247 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
26252 #: ../fuse/guestmount.pod:46
26254 "For a typical Linux guest which has a /boot filesystem on the first "
26255 "partition, and the root filesystem on a logical volume:"
26259 #: ../fuse/guestmount.pod:49
26262 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
26267 #: ../fuse/guestmount.pod:51
26268 msgid "To get libguestfs to detect guest mountpoints for you:"
26272 #: ../fuse/guestmount.pod:53
26275 " guestmount -a guest.img -i --ro /mnt\n"
26280 #: ../fuse/guestmount.pod:55
26281 msgid "For a libvirt guest called \"Guest\" you could do:"
26285 #: ../fuse/guestmount.pod:57
26288 " guestmount -d Guest -i --ro /mnt\n"
26293 #: ../fuse/guestmount.pod:59
26295 "If you don't know what filesystems are contained in a guest or disk image, "
26296 "use L<virt-filesystems(1)> first:"
26300 #: ../fuse/guestmount.pod:62
26303 " virt-filesystems MyGuest\n"
26308 #: ../fuse/guestmount.pod:64
26310 "If you want to trace the libguestfs calls but without excessive debugging "
26311 "information, we recommend:"
26315 #: ../fuse/guestmount.pod:67
26318 " guestmount [...] --trace /mnt\n"
26323 #: ../fuse/guestmount.pod:69
26324 msgid "If you want to debug the program, we recommend:"
26328 #: ../fuse/guestmount.pod:71
26331 " guestmount [...] --trace --verbose /mnt\n"
26336 #: ../fuse/guestmount.pod:77
26337 msgid "B<-a image> | B<--add image>"
26341 #: ../fuse/guestmount.pod:79
26342 msgid "Add a block device or virtual machine image."
26346 #: ../fuse/guestmount.pod:84
26347 msgid "B<-c URI> | B<--connect URI>"
26351 #: ../fuse/guestmount.pod:90
26352 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
26356 #: ../fuse/guestmount.pod:96
26357 msgid "B<--dir-cache-timeout N>"
26361 #: ../fuse/guestmount.pod:98
26363 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
26364 "seconds. The readdir cache [actually, there are several semi-independent "
26365 "caches] is populated after a readdir(2) call with the stat and extended "
26366 "attributes of the files in the directory, in anticipation that they will be "
26367 "requested soon after."
26371 #: ../fuse/guestmount.pod:104
26373 "There is also a different attribute cache implemented by FUSE (see the FUSE "
26374 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
26375 "requests, only cache existing ones."
26379 #: ../fuse/guestmount.pod:115
26380 msgid "B<--format=raw|qcow2|..> | B<--format>"
26384 #: ../fuse/guestmount.pod:122
26386 "If you have untrusted raw-format guest disk images, you should use this "
26387 "option to specify the disk format. This avoids a possible security problem "
26388 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
26389 "guestfs_add_drive_opts>."
26393 #: ../fuse/guestmount.pod:127
26394 msgid "B<--fuse-help>"
26398 #: ../fuse/guestmount.pod:129
26399 msgid "Display help on special FUSE options (see I<-o> below)."
26403 #: ../fuse/guestmount.pod:133
26404 msgid "Display brief help and exit."
26408 #: ../fuse/guestmount.pod:135
26409 msgid "B<-i> | B<--inspector>"
26413 #: ../fuse/guestmount.pod:146
26414 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
26418 #: ../fuse/guestmount.pod:148
26420 "Mount the named partition or logical volume on the given mountpoint B<in the "
26421 "guest> (this has nothing to do with mountpoints in the host)."
26425 #: ../fuse/guestmount.pod:151
26427 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
26428 "something on C</>."
26432 #: ../fuse/guestmount.pod:154
26433 msgid "B<-n> | B<--no-sync>"
26437 #: ../fuse/guestmount.pod:156
26439 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
26440 "unmounted. If you specify this option, then we don't attempt to sync the "
26441 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
26445 #: ../fuse/guestmount.pod:161
26446 msgid "B<-o option> | B<--option option>"
26450 #: ../fuse/guestmount.pod:163
26451 msgid "Pass extra options to FUSE."
26455 #: ../fuse/guestmount.pod:165
26457 "To get a list of all the extra options supported by FUSE, use the command "
26458 "below. Note that only the FUSE I<-o> options can be passed, and only some "
26459 "of them are a good idea."
26463 #: ../fuse/guestmount.pod:169
26466 " guestmount --fuse-help\n"
26471 #: ../fuse/guestmount.pod:171
26472 msgid "Some potentially useful FUSE options:"
26476 #: ../fuse/guestmount.pod:175
26477 msgid "B<-o allow_other>"
26481 #: ../fuse/guestmount.pod:177
26482 msgid "Allow other users to see the filesystem."
26486 #: ../fuse/guestmount.pod:179
26487 msgid "B<-o attr_timeout=N>"
26491 #: ../fuse/guestmount.pod:181
26492 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
26496 #: ../fuse/guestmount.pod:183
26497 msgid "B<-o kernel_cache>"
26501 #: ../fuse/guestmount.pod:185
26503 "Allow the kernel to cache files (reduces the number of reads that have to go "
26504 "through the L<guestfs(3)> API). This is generally a good idea if you can "
26505 "afford the extra memory usage."
26509 #: ../fuse/guestmount.pod:189
26510 msgid "B<-o uid=N> B<-o gid=N>"
26514 #: ../fuse/guestmount.pod:191
26516 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
26517 "the chosen values."
26521 #: ../fuse/guestmount.pod:196
26522 msgid "B<-r> | B<--ro>"
26526 #: ../fuse/guestmount.pod:198
26528 "Add devices and mount everything read-only. Also disallow writes and make "
26529 "the disk appear read-only to FUSE."
26533 #: ../fuse/guestmount.pod:201
26535 "This is highly recommended if you are not going to edit the guest disk. If "
26536 "the guest is running and this option is I<not> supplied, then there is a "
26537 "strong risk of disk corruption in the guest. We try to prevent this from "
26538 "happening, but it is not always possible."
26542 #: ../fuse/guestmount.pod:206
26543 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26547 #: ../fuse/guestmount.pod:210
26548 msgid "Enable SELinux support for the guest."
26552 #: ../fuse/guestmount.pod:212
26553 msgid "B<-v> | B<--verbose>"
26557 #: ../fuse/guestmount.pod:214
26558 msgid "Enable verbose messages from underlying libguestfs."
26562 #: ../fuse/guestmount.pod:216
26563 msgid "B<-V> | B<--version>"
26567 #: ../fuse/guestmount.pod:218
26568 msgid "Display the program version and exit."
26572 #: ../fuse/guestmount.pod:220
26573 msgid "B<-w> | B<--rw>"
26577 #: ../fuse/guestmount.pod:222
26579 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26580 "FOR READ AND WRITE>."
26584 #: ../fuse/guestmount.pod:225
26585 msgid "B<-x> | B<--trace>"
26589 #: ../fuse/guestmount.pod:227
26590 msgid "Trace libguestfs calls and entry into each FUSE function."
26594 #: ../fuse/guestmount.pod:229
26595 msgid "This also stops the daemon from forking into the background."
26599 #: ../fuse/guestmount.pod:235
26601 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26602 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26607 #: ../tools/virt-edit.pl:34
26608 msgid "virt-edit - Edit a file in a virtual machine"
26612 #: ../tools/virt-edit.pl:38
26615 " virt-edit [--options] domname file\n"
26620 #: ../tools/virt-edit.pl:40
26623 " virt-edit [--options] disk.img [disk.img ...] file\n"
26628 #: ../tools/virt-edit.pl:42
26631 " virt-edit [domname|disk.img] file -e 'expr'\n"
26636 #: ../tools/virt-edit.pl:46
26638 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26639 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26640 "doing this, but doesn't catch all cases."
26644 #: ../tools/virt-edit.pl:52
26646 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26647 "the named virtual machine (or disk image)."
26651 #: ../tools/virt-edit.pl:55
26653 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26654 "you should look at the L<guestfish(1)> tool."
26658 #: ../tools/virt-edit.pl:60
26659 msgid "Edit the named files interactively:"
26663 #: ../tools/virt-edit.pl:62
26666 " virt-edit mydomain /boot/grub/grub.conf\n"
26671 #: ../tools/virt-edit.pl:64
26674 " virt-edit mydomain /etc/passwd\n"
26679 #: ../tools/virt-edit.pl:66
26681 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26682 "below). To change the init default level to 5:"
26686 #: ../tools/virt-edit.pl:70
26689 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26694 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
26695 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:108
26696 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
26697 msgid "Display brief help."
26701 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
26702 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
26703 #: ../tools/virt-tar.pl:116 ../tools/virt-make-fs.pl:171
26704 #: ../tools/virt-list-partitions.pl:72
26705 msgid "Display version number and exit."
26709 #: ../tools/virt-edit.pl:96
26710 msgid "B<--backup extension> | B<-b extension>"
26714 #: ../tools/virt-edit.pl:98
26716 "Create a backup of the original file I<in the guest disk image>. The backup "
26717 "has the original filename with C<extension> added."
26721 #: ../tools/virt-edit.pl:101
26723 "Usually the first character of C<extension> would be a dot C<.> so you would "
26728 #: ../tools/virt-edit.pl:104
26731 " virt-edit -b .orig [etc]\n"
26736 #: ../tools/virt-edit.pl:106
26737 msgid "By default, no backup file is made."
26741 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
26742 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:122
26743 #: ../tools/virt-list-partitions.pl:78
26744 msgid "B<--connect URI> | B<-c URI>"
26748 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
26749 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:124
26750 #: ../tools/virt-list-partitions.pl:80
26752 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26753 "to the default libvirt hypervisor."
26757 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
26758 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:127
26759 #: ../tools/virt-list-partitions.pl:83
26761 "If you specify guest block devices directly, then libvirt is not used at all."
26765 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
26766 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
26767 #: ../tools/virt-tar.pl:134 ../tools/virt-list-partitions.pl:90
26768 msgid "B<--format> raw"
26772 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
26773 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:136
26774 #: ../tools/virt-list-partitions.pl:92
26776 "Specify the format of disk images given on the command line. If this is "
26777 "omitted then the format is autodetected from the content of the disk image."
26781 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
26782 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:140
26783 #: ../tools/virt-list-partitions.pl:96
26785 "If disk images are requested from libvirt, then this program asks libvirt "
26786 "for this information. In this case, the value of the format parameter is "
26791 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
26792 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
26793 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:144
26794 #: ../tools/virt-list-partitions.pl:100
26796 "If working with untrusted raw-format guest disk images, you should ensure "
26797 "the format is always specified."
26801 #: ../tools/virt-edit.pl:141
26802 msgid "B<--expr EXPR> | B<-e EXPR>"
26806 #: ../tools/virt-edit.pl:143
26808 "Instead of launching the external editor, non-interactively apply the Perl "
26809 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26814 #: ../tools/virt-edit.pl:147
26816 "Be careful to properly quote the expression to prevent it from being altered "
26821 #: ../tools/virt-edit.pl:268
26822 msgid "NON-INTERACTIVE EDITING"
26826 #: ../tools/virt-edit.pl:270
26828 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26829 "administrator can interactively edit the file."
26833 #: ../tools/virt-edit.pl:273
26835 "There are two ways also to use C<virt-edit> from scripts in order to make "
26836 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26837 "like this, it's less error-prone to write scripts directly using the "
26838 "libguestfs API and Augeas for configuration file editing.)"
26842 #: ../tools/virt-edit.pl:279
26844 "The first method is to temporarily set C<$EDITOR> to any script or program "
26845 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26846 "update C<tmpfile> in place however it likes."
26850 #: ../tools/virt-edit.pl:283
26852 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26853 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26854 "instances of C<foo> with C<bar> in a file:"
26858 #: ../tools/virt-edit.pl:287
26861 " virt-edit domname filename -e 's/foo/bar/'\n"
26866 #: ../tools/virt-edit.pl:289
26868 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26869 "For example to delete root's password you could do:"
26873 #: ../tools/virt-edit.pl:292
26876 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26881 #: ../tools/virt-edit.pl:294
26883 "What really happens is that the snippet is evaluated as a Perl expression "
26884 "for each line of the file. The line, including the final C<\\n>, is passed "
26885 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26889 #: ../tools/virt-edit.pl:299
26891 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26892 "C<apache> user account from the password file you can do:"
26896 #: ../tools/virt-edit.pl:302
26899 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26904 #: ../tools/virt-edit.pl:304
26906 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26907 "the end of the file is rather difficult this way since there is no concept "
26908 "of \"last line of the file\" - your expression just doesn't get called "
26909 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26914 #: ../tools/virt-edit.pl:310
26916 "The variable C<$lineno> contains the current line number. As is "
26917 "traditional, the first line in the file is number C<1>."
26921 #: ../tools/virt-edit.pl:313
26923 "The return value from the expression is ignored, but the expression may call "
26924 "C<die> in order to abort the whole program, leaving the original file "
26929 #: ../tools/virt-edit.pl:317
26931 "Remember when matching the end of a line that C<$_> may contain the final C<"
26932 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26933 "newline then neither of these. Thus to match or substitute some text at the "
26934 "end of a line, use this regular expression:"
26938 #: ../tools/virt-edit.pl:322
26941 " /some text(\\r?\\n)?$/\n"
26946 #: ../tools/virt-edit.pl:324
26948 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26949 "$_> itself (since that would remove all newlines from the file):"
26953 #: ../tools/virt-edit.pl:328
26956 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26961 #: ../tools/virt-edit.pl:334
26966 #: ../tools/virt-edit.pl:336
26968 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26973 #: ../tools/virt-edit.pl:339
26974 msgid "If not set, C<vi> is used."
26978 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
26979 #: ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182
26980 #: ../tools/virt-tar.pl:274 ../tools/virt-make-fs.pl:527
26981 #: ../tools/virt-list-partitions.pl:250
26982 msgid "SHELL QUOTING"
26986 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
26987 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
26988 #: ../tools/virt-tar.pl:276 ../tools/virt-make-fs.pl:529
26989 #: ../tools/virt-list-partitions.pl:252
26991 "Libvirt guest names can contain arbitrary characters, some of which have "
26992 "meaning to the shell such as C<#> and space. You may need to quote or "
26993 "escape these characters on the command line. See the shell manual page L<sh"
26994 "(1)> for details."
26998 #: ../tools/virt-edit.pl:352
27000 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
27001 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
27006 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:598
27007 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
27008 #: ../tools/virt-tar.pl:292 ../tools/virt-make-fs.pl:559
27009 #: ../tools/virt-list-partitions.pl:269
27014 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:600
27015 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
27016 #: ../tools/virt-tar.pl:294 ../tools/virt-make-fs.pl:561
27017 #: ../tools/virt-list-partitions.pl:271
27018 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
27022 #: ../tools/virt-edit.pl:368 ../tools/virt-list-partitions.pl:275
27023 msgid "Copyright (C) 2009-2010 Red Hat Inc."
27027 #: ../tools/virt-win-reg.pl:37
27029 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
27033 #: ../tools/virt-win-reg.pl:41
27036 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
27041 #: ../tools/virt-win-reg.pl:43
27044 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
27049 #: ../tools/virt-win-reg.pl:45
27052 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
27057 #: ../tools/virt-win-reg.pl:47
27060 " virt-win-reg --merge domname [input.reg ...]\n"
27065 #: ../tools/virt-win-reg.pl:49
27068 " virt-win-reg [--options] disk.img ... # instead of domname\n"
27073 #: ../tools/virt-win-reg.pl:53
27075 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
27076 "virtual machines. If you do this, you I<will> get irreversible disk "
27077 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
27078 "but doesn't catch all cases."
27082 #: ../tools/virt-win-reg.pl:58
27084 "Modifying the Windows Registry is an inherently risky operation. The format "
27085 "is deliberately obscure and undocumented, and Registry changes can leave the "
27086 "system unbootable. Therefore when using the C<--merge> option, make sure "
27087 "you have a reliable backup first."
27091 #: ../tools/virt-win-reg.pl:65
27093 "This program can export and merge Windows Registry entries from a Windows "
27098 #: ../tools/virt-win-reg.pl:68
27100 "The first parameter is the libvirt guest name or the raw disk image of a "
27105 #: ../tools/virt-win-reg.pl:71
27107 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
27108 "exported (recursively). For example:"
27112 #: ../tools/virt-win-reg.pl:74
27115 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
27120 #: ../tools/virt-win-reg.pl:76
27122 "You can also display single values from within registry keys, for example:"
27126 #: ../tools/virt-win-reg.pl:79
27129 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
27130 " $ virt-win-reg Windows7 $cvkey ProductName\n"
27131 " Windows 7 Enterprise\n"
27136 #: ../tools/virt-win-reg.pl:83
27138 "With C<--merge>, you can merge a textual regedit file into the Windows "
27143 #: ../tools/virt-win-reg.pl:86
27146 " $ virt-win-reg --merge Windows7 changes.reg\n"
27151 #: ../tools/virt-win-reg.pl:88
27156 #: ../tools/virt-win-reg.pl:90
27158 "This program is only meant for simple access to the registry. If you want "
27159 "to do complicated things with the registry, we suggest you download the "
27160 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
27161 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
27162 "L<hivexregedit(1)>."
27166 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
27171 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
27172 msgid "Enable debugging messages."
27176 #: ../tools/virt-win-reg.pl:157
27181 #: ../tools/virt-win-reg.pl:159
27183 "In merge mode, this merges a textual regedit file into the Windows Registry "
27184 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
27185 "displays or exports Registry entries instead."
27189 #: ../tools/virt-win-reg.pl:163
27191 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
27192 "result in disk corruption. However exporting (without this flag) is always "
27197 #: ../tools/virt-win-reg.pl:171
27198 msgid "B<--encoding> UTF-16LE|ASCII"
27202 #: ../tools/virt-win-reg.pl:173
27204 "When merging (only), you may need to specify the encoding for strings to be "
27205 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
27206 "(3)/ENCODING STRINGS>."
27210 #: ../tools/virt-win-reg.pl:177
27212 "The default is to use UTF-16LE, which should work with recent versions of "
27217 #: ../tools/virt-win-reg.pl:402
27218 msgid "SUPPORTED SYSTEMS"
27222 #: ../tools/virt-win-reg.pl:404
27224 "The program currently supports Windows NT-derived guests starting with "
27225 "Windows XP through to at least Windows 7."
27229 #: ../tools/virt-win-reg.pl:407
27231 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
27232 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
27233 "and C<HKEY_USERS\\.DEFAULT>."
27237 #: ../tools/virt-win-reg.pl:411
27239 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
27244 #: ../tools/virt-win-reg.pl:414
27246 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
27251 #: ../tools/virt-win-reg.pl:417
27256 #: ../tools/virt-win-reg.pl:419
27258 "C<virt-win-reg> expects that regedit files have already been reencoded in "
27259 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
27260 "style line endings. Since Windows regedit files are often in UTF-16LE with "
27261 "Windows-style line endings, you may need to reencode the whole file before "
27262 "or after processing."
27266 #: ../tools/virt-win-reg.pl:425
27268 "To reencode a file from Windows format to Linux (before processing it with "
27269 "the C<--merge> option), you would do something like this:"
27273 #: ../tools/virt-win-reg.pl:428
27276 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
27281 #: ../tools/virt-win-reg.pl:430
27283 "To go in the opposite direction, after exporting and before sending the file "
27284 "to a Windows user, do something like this:"
27288 #: ../tools/virt-win-reg.pl:433
27291 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
27296 #: ../tools/virt-win-reg.pl:435
27297 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
27301 #: ../tools/virt-win-reg.pl:437
27303 "If you are unsure about the current encoding, use the L<file(1)> command. "
27304 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
27305 "style (CRLF) line endings, like this:"
27309 #: ../tools/virt-win-reg.pl:441
27312 " $ file software.reg\n"
27313 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
27314 " with CRLF line terminators\n"
27319 #: ../tools/virt-win-reg.pl:445
27320 msgid "This file would need conversion before you could C<--merge> it."
27324 #: ../tools/virt-win-reg.pl:447
27325 msgid "CurrentControlSet etc."
27329 #: ../tools/virt-win-reg.pl:449
27331 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
27332 "Registry at the level of the hive file, and therefore you cannot modify "
27337 #: ../tools/virt-win-reg.pl:453
27339 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
27340 "circumstances it might refer to another control set. The way to find out is "
27341 "to look at the C<HKLM\\SYSTEM\\Select> key:"
27345 #: ../tools/virt-win-reg.pl:457
27348 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
27349 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
27350 " \"Current\"=dword:00000001\n"
27351 " \"Default\"=dword:00000001\n"
27352 " \"Failed\"=dword:00000000\n"
27353 " \"LastKnownGood\"=dword:00000002\n"
27358 #: ../tools/virt-win-reg.pl:464
27359 msgid "\"Current\" is the one which Windows will choose when it boots."
27363 #: ../tools/virt-win-reg.pl:466
27365 "Similarly, other C<Current...> keys in the path may need to be replaced."
27369 #: ../tools/virt-win-reg.pl:469
27370 msgid "WINDOWS TIPS"
27374 #: ../tools/virt-win-reg.pl:471
27376 "Note that some of these tips modify the guest disk image. The guest I<must> "
27377 "be shut off, else you will get disk corruption."
27381 #: ../tools/virt-win-reg.pl:474
27382 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
27386 #: ../tools/virt-win-reg.pl:476
27388 "Prepare a DOS batch script, VBScript or executable. Upload this using "
27389 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
27390 "is uploaded into C<C:\\>:"
27394 #: ../tools/virt-win-reg.pl:480
27397 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
27402 #: ../tools/virt-win-reg.pl:482
27403 msgid "Prepare a regedit file containing the registry change:"
27407 #: ../tools/virt-win-reg.pl:484
27410 " cat > test.reg <<'EOF'\n"
27411 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
27412 " \"Test\"=\"c:\\\\test.bat\"\n"
27418 #: ../tools/virt-win-reg.pl:489
27420 "In this example we use the key C<RunOnce> which means that the script will "
27421 "run precisely once when the first user logs in. If you want it to run every "
27422 "time a user logs in, replace C<RunOnce> with C<Run>."
27426 #: ../tools/virt-win-reg.pl:493
27427 msgid "Now update the registry:"
27431 #: ../tools/virt-win-reg.pl:495
27434 " virt-win-reg --merge WindowsGuest test.reg\n"
27439 #: ../tools/virt-win-reg.pl:497
27440 msgid "INSTALLING A SERVICE"
27444 #: ../tools/virt-win-reg.pl:499
27446 "This section assumes you are familiar with Windows services, and you either "
27447 "have a program which handles the Windows Service Control Protocol directly "
27448 "or you want to run any program using a service wrapper like SrvAny or the "
27453 #: ../tools/virt-win-reg.pl:504
27455 "First upload the program and optionally the service wrapper. In this case "
27456 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
27460 #: ../tools/virt-win-reg.pl:508
27463 " guestfish -i -d WindowsGuest <<EOF\n"
27464 " upload rhsrvany.exe /rhsrvany.exe\n"
27465 " upload test.exe /test.exe\n"
27471 #: ../tools/virt-win-reg.pl:513
27473 "Prepare a regedit file containing the registry changes. In this example, "
27474 "the first registry change is needed for the service itself or the service "
27475 "wrapper (if used). The second registry change is only needed because I am "
27476 "using the RHSrvAny service wrapper."
27480 #: ../tools/virt-win-reg.pl:518
27483 " cat > service.reg <<'EOF'\n"
27484 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
27485 " \"Type\"=dword:00000010\n"
27486 " \"Start\"=dword:00000002\n"
27487 " \"ErrorControl\"=dword:00000001\n"
27488 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
27489 " \"DisplayName\"=\"RHSrvAny\"\n"
27490 " \"ObjectName\"=\"NetworkService\"\n"
27495 #: ../tools/virt-win-reg.pl:527
27498 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
27499 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
27500 " \"PWD\"=\"c:\\\\Temp\"\n"
27506 #: ../tools/virt-win-reg.pl:538
27508 "For use of C<ControlSet001> see the section above in this manual page. You "
27509 "may need to adjust this according to the control set that is in use by the "
27514 #: ../tools/virt-win-reg.pl:544
27516 "C<\"ObjectName\"> controls the privileges that the service will have. An "
27517 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
27518 "privileged account."
27522 #: ../tools/virt-win-reg.pl:550
27524 "For the meaning of the magic numbers, see this Microsoft KB article: "
27525 "L<http://support.microsoft.com/kb/103000>."
27529 #: ../tools/virt-win-reg.pl:555
27530 msgid "Update the registry:"
27534 #: ../tools/virt-win-reg.pl:557
27537 " virt-win-reg --merge WindowsGuest service.reg\n"
27542 #: ../tools/virt-win-reg.pl:561
27544 "Be careful when passing parameters containing C<\\> (backslash) in the "
27545 "shell. Usually you will have to use 'single quotes' or double backslashes "
27546 "(but not both) to protect them from the shell."
27550 #: ../tools/virt-win-reg.pl:565
27551 msgid "Paths and value names are case-insensitive."
27555 #: ../tools/virt-win-reg.pl:574
27557 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
27558 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
27559 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27563 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
27565 "When reporting bugs, please enable debugging and capture the I<complete> "
27570 #: ../tools/virt-win-reg.pl:592
27573 " export LIBGUESTFS_DEBUG=1\n"
27574 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
27579 #: ../tools/virt-win-reg.pl:595
27581 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
27586 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510
27587 #: ../tools/virt-make-fs.pl:565
27588 msgid "Copyright (C) 2010 Red Hat Inc."
27592 #: ../tools/virt-resize.pl:42
27593 msgid "virt-resize - Resize a virtual machine disk"
27597 #: ../tools/virt-resize.pl:46
27600 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27601 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27602 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27607 #: ../tools/virt-resize.pl:52
27609 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27610 "larger or smaller overall, and resizing or deleting any partitions contained "
27615 #: ../tools/virt-resize.pl:56
27617 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27618 "not> be used on live virtual machines - for consistent results, shut the "
27619 "virtual machine down before resizing it."
27623 #: ../tools/virt-resize.pl:60
27625 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
27626 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
27630 #: ../tools/virt-resize.pl:66
27632 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27633 "fill the extra 5GB of space."
27637 #: ../tools/virt-resize.pl:69
27640 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27641 " virt-filesystems --long --h --all -a olddisk\n"
27642 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27643 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27648 #: ../tools/virt-resize.pl:74
27650 "As above, but make the /boot partition 200MB bigger, while giving the "
27651 "remaining space to /dev/sda2:"
27655 #: ../tools/virt-resize.pl:77
27658 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27663 #: ../tools/virt-resize.pl:79
27664 msgid "As above, but the output format will be uncompressed qcow2:"
27668 #: ../tools/virt-resize.pl:81
27671 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27672 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27677 #: ../tools/virt-resize.pl:84
27678 msgid "DETAILED USAGE"
27682 #: ../tools/virt-resize.pl:86
27683 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27687 #: ../tools/virt-resize.pl:90
27688 msgid "1. Shut down the virtual machine"
27692 #: ../tools/virt-resize.pl:92
27693 msgid "2. Locate input disk image"
27697 #: ../tools/virt-resize.pl:94
27699 "Locate the input disk image (ie. the file or device on the host containing "
27700 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27701 "dumpxml> like this to find the disk image name:"
27705 #: ../tools/virt-resize.pl:98
27708 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27709 " Found 1 nodes:\n"
27711 " <source dev=\"/dev/vg/lv_guest\" />\n"
27716 #: ../tools/virt-resize.pl:103
27717 msgid "3. Look at current sizing"
27721 #: ../tools/virt-resize.pl:105
27722 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
27726 #: ../tools/virt-resize.pl:108
27729 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
27730 " Name Type Size Parent\n"
27731 " /dev/sda1 partition 101M /dev/sda\n"
27732 " /dev/sda2 partition 7.9G /dev/sda\n"
27733 " /dev/sda device 8.0G -\n"
27738 #: ../tools/virt-resize.pl:114
27740 "(This example is a virtual machine with an 8 GB disk which we would like to "
27741 "expand up to 10 GB)."
27745 #: ../tools/virt-resize.pl:117
27746 msgid "4. Create output disk"
27750 #: ../tools/virt-resize.pl:119
27752 "Virt-resize cannot do in-place disk modifications. You have to have space "
27753 "to store the resized output disk."
27757 #: ../tools/virt-resize.pl:122
27759 "To store the resized disk image in a file, create a file of a suitable size:"
27763 #: ../tools/virt-resize.pl:125
27766 " # rm -f outdisk\n"
27767 " # truncate -s 10G outdisk\n"
27772 #: ../tools/virt-resize.pl:128
27773 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27777 #: ../tools/virt-resize.pl:130
27780 " # lvcreate -L 10G -n lv_name vg_name\n"
27785 #: ../tools/virt-resize.pl:132
27786 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27790 #: ../tools/virt-resize.pl:134
27793 " # virsh pool-list\n"
27794 " # virsh vol-create-as poolname newvol 10G\n"
27799 #: ../tools/virt-resize.pl:137
27804 #: ../tools/virt-resize.pl:139
27806 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27807 "file) and the output disk. The output disk is the one created in the "
27812 #: ../tools/virt-resize.pl:143
27815 " # virt-resize indisk outdisk\n"
27820 #: ../tools/virt-resize.pl:145
27822 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27823 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27824 "larger, then an extra, empty partition is created at the end of the disk "
27825 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27830 #: ../tools/virt-resize.pl:151
27832 "More realistically you'd want to expand existing partitions in the disk "
27833 "image by passing extra options (for the full list see the L</OPTIONS> "
27838 #: ../tools/virt-resize.pl:155
27840 "L</--expand> is the most useful option. It expands the named partition "
27841 "within the disk to fill any extra space:"
27845 #: ../tools/virt-resize.pl:158
27848 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27853 #: ../tools/virt-resize.pl:160
27855 "(In this case, an extra partition is I<not> created at the end of the disk, "
27856 "because there will be no unused space)."
27860 #: ../tools/virt-resize.pl:163
27862 "L</--resize> is the other commonly used option. The following would "
27863 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27864 "rest of the available space:"
27868 #: ../tools/virt-resize.pl:167
27871 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27872 " indisk outdisk\n"
27877 #: ../tools/virt-resize.pl:170
27879 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27880 "if virt-resize knows how, it will resize the contents, the equivalent of "
27881 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27882 ">. However virt-resize does not know how to resize some filesystems, so you "
27883 "would have to online resize them after booting the guest."
27887 #: ../tools/virt-resize.pl:177
27888 msgid "Other options are covered below."
27892 #: ../tools/virt-resize.pl:179
27897 #: ../tools/virt-resize.pl:181
27898 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27902 #: ../tools/virt-resize.pl:183
27903 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27907 #: ../tools/virt-resize.pl:185
27910 " # virsh edit guestname\n"
27915 #: ../tools/virt-resize.pl:187
27917 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27918 "html#elementsDisks>"
27922 #: ../tools/virt-resize.pl:190
27923 msgid "Then start up the domain with the new, resized disk:"
27927 #: ../tools/virt-resize.pl:192
27930 " # virsh start guestname\n"
27935 #: ../tools/virt-resize.pl:194
27937 "and check that it still works. See also the L</NOTES> section below for "
27938 "additional information."
27942 #: ../tools/virt-resize.pl:197
27943 msgid "7. Resize LVs etc inside the guest"
27947 #: ../tools/virt-resize.pl:199
27948 msgid "(This can also be done offline using L<guestfish(1)>)"
27952 #: ../tools/virt-resize.pl:201
27954 "Once the guest has booted you should see the new space available, at least "
27955 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27956 "may need to resize LVs inside PVs, and also resize filesystem types that "
27957 "virt-resize does not know how to expand."
27961 #: ../tools/virt-resize.pl:208
27962 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27966 #: ../tools/virt-resize.pl:210
27968 "Shrinking is somewhat more complex than expanding, and only an overview is "
27973 #: ../tools/virt-resize.pl:213
27975 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27976 "filesystems). The user has to shrink content before passing the disk image "
27977 "to virt-resize, and virt-resize will check that the content has been shrunk "
27982 #: ../tools/virt-resize.pl:218
27983 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27987 #: ../tools/virt-resize.pl:220
27989 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27990 "steps 3 and 4 above to allocate a new disk image."
27994 #: ../tools/virt-resize.pl:223
27996 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
28000 #: ../tools/virt-resize.pl:226
28001 msgid "IGNORING OR DELETING PARTITIONS"
28005 #: ../tools/virt-resize.pl:228
28007 "virt-resize also gives a convenient way to ignore or delete partitions when "
28008 "copying from the input disk to the output disk. Ignoring a partition speeds "
28009 "up the copy where you don't care about the existing contents of a "
28010 "partition. Deleting a partition removes it completely, but note that it "
28011 "also renumbers any partitions after the one which is deleted, which can "
28012 "leave some guests unbootable."
28016 #: ../tools/virt-resize.pl:235
28017 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
28021 #: ../tools/virt-resize.pl:237
28023 "If the input disk is in qcow2 format, then you may prefer that the output is "
28024 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
28025 "the fly. The output format is simply determined by the format of the empty "
28026 "output container that you provide. Thus to create qcow2 output, use:"
28030 #: ../tools/virt-resize.pl:243
28033 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
28038 #: ../tools/virt-resize.pl:245
28039 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
28043 #: ../tools/virt-resize.pl:247
28044 msgid "Similarly, to get non-sparse raw output use:"
28048 #: ../tools/virt-resize.pl:249
28051 " fallocate -l size outdisk\n"
28056 #: ../tools/virt-resize.pl:251
28058 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
28059 "dev/zero of=outdisk bs=1M count=..>)"
28063 #: ../tools/virt-resize.pl:264
28064 msgid "Display help."
28068 #: ../tools/virt-resize.pl:278
28069 msgid "B<--resize part=size>"
28073 #: ../tools/virt-resize.pl:280
28075 "Resize the named partition (expanding or shrinking it) so that it has the "
28080 #: ../tools/virt-resize.pl:283
28082 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
28083 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
28084 "Exabytes; or as a percentage of the current size; or as a relative number or "
28085 "percentage. For example:"
28089 #: ../tools/virt-resize.pl:288
28092 " --resize /dev/sda2=10G\n"
28097 #: ../tools/virt-resize.pl:290
28100 " --resize /dev/sda4=90%\n"
28105 #: ../tools/virt-resize.pl:292
28108 " --resize /dev/sda2=+1G\n"
28113 #: ../tools/virt-resize.pl:294
28116 " --resize /dev/sda2=-200M\n"
28121 #: ../tools/virt-resize.pl:296
28124 " --resize /dev/sda1=+128K\n"
28129 #: ../tools/virt-resize.pl:298
28132 " --resize /dev/sda1=+10%\n"
28137 #: ../tools/virt-resize.pl:300
28140 " --resize /dev/sda1=-10%\n"
28145 #: ../tools/virt-resize.pl:302
28147 "You can increase the size of any partition. Virt-resize will expand the "
28148 "direct content of the partition if it knows how (see C<--expand> below)."
28152 #: ../tools/virt-resize.pl:306
28154 "You can only I<decrease> the size of partitions that contain filesystems or "
28155 "PVs which have already been shrunk. Virt-resize will check this has been "
28156 "done before proceeding, or else will print an error (see also C<--resize-"
28161 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
28162 #: ../tools/virt-resize.pl:420
28163 msgid "You can give this option multiple times."
28167 #: ../tools/virt-resize.pl:317
28168 msgid "B<--resize-force part=size>"
28172 #: ../tools/virt-resize.pl:319
28174 "This is the same as C<--resize> except that it will let you decrease the "
28175 "size of any partition. Generally this means you will lose any data which "
28176 "was at the end of the partition you shrink, but you may not care about that "
28177 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
28178 "as a swap partition)."
28182 #: ../tools/virt-resize.pl:325
28183 msgid "See also the C<--ignore> option."
28187 #: ../tools/virt-resize.pl:331
28188 msgid "B<--expand part>"
28192 #: ../tools/virt-resize.pl:333
28194 "Expand the named partition so it uses up all extra space (space left over "
28195 "after any other resize changes that you request have been done)."
28199 #: ../tools/virt-resize.pl:336
28201 "If virt-resize knows how, it will expand the direct content of the "
28202 "partition. For example, if the partition is an LVM PV, it will expand the "
28203 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
28204 "content it doesn't know about alone."
28208 #: ../tools/virt-resize.pl:341
28209 msgid "Currently virt-resize can resize:"
28213 #: ../tools/virt-resize.pl:347
28215 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
28220 #: ../tools/virt-resize.pl:352
28222 "NTFS filesystems contained directly in a partition, if libguestfs was "
28223 "compiled with support for NTFS."
28227 #: ../tools/virt-resize.pl:355
28229 "The filesystem must have been shut down consistently last time it was used. "
28230 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
28231 "consistency check, so at the first boot after resizing Windows will check "
28236 #: ../tools/virt-resize.pl:362
28238 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
28239 "inside the PV, but see the C<--LV-expand> option. The user could also "
28240 "resize LVs as desired after boot."
28244 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
28245 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
28249 #: ../tools/virt-resize.pl:374
28250 msgid "B<--shrink part>"
28254 #: ../tools/virt-resize.pl:376
28256 "Shrink the named partition until the overall disk image fits in the "
28257 "destination. The named partition B<must> contain a filesystem or PV which "
28258 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
28259 "online tools). Virt-resize will check this and give an error if it has not "
28264 #: ../tools/virt-resize.pl:382
28266 "The amount by which the overall disk must be shrunk (after carrying out all "
28267 "other operations requested by the user) is called the \"deficit\". For "
28268 "example, a straight copy (assume no other operations) from a 5GB disk image "
28269 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
28270 "would give an error unless the user specified a partition to shrink and that "
28271 "partition had more than a gigabyte of free space."
28275 #: ../tools/virt-resize.pl:396
28276 msgid "B<--ignore part>"
28280 #: ../tools/virt-resize.pl:398
28282 "Ignore the named partition. Effectively this means the partition is "
28283 "allocated on the destination disk, but the content is not copied across from "
28284 "the source disk. The content of the partition will be blank (all zero "
28289 #: ../tools/virt-resize.pl:409
28290 msgid "B<--delete part>"
28294 #: ../tools/virt-resize.pl:411
28296 "Delete the named partition. It would be more accurate to describe this as "
28297 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
28298 "the original disk image is left intact."
28302 #: ../tools/virt-resize.pl:415
28304 "Note that when you delete a partition, then anything contained in the "
28305 "partition is also deleted. Furthermore, this causes any partitions that "
28306 "come after to be I<renumbered>, which can easily make your guest unbootable."
28310 #: ../tools/virt-resize.pl:426
28311 msgid "B<--LV-expand logvol>"
28315 #: ../tools/virt-resize.pl:428
28317 "This takes the logical volume and, as a final step, expands it to fill all "
28318 "the space available in its volume group. A typical usage, assuming a Linux "
28319 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
28320 "lv_root> would be:"
28324 #: ../tools/virt-resize.pl:433
28327 " virt-resize indisk outdisk \\\n"
28328 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
28333 #: ../tools/virt-resize.pl:436
28335 "This would first expand the partition (and PV), and then expand the root "
28336 "device to fill the extra space in the PV."
28340 #: ../tools/virt-resize.pl:439
28342 "The contents of the LV are also resized if virt-resize knows how to do "
28343 "that. You can stop virt-resize from trying to expand the content by using "
28344 "the option C<--no-expand-content>."
28348 #: ../tools/virt-resize.pl:443
28349 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
28353 #: ../tools/virt-resize.pl:446
28355 "You can give this option multiple times, I<but> it doesn't make sense to do "
28356 "this unless the logical volumes you specify are all in different volume "
28361 #: ../tools/virt-resize.pl:454
28362 msgid "B<--no-copy-boot-loader>"
28366 #: ../tools/virt-resize.pl:456
28368 "By default, virt-resize copies over some sectors at the start of the disk "
28369 "(up to the beginning of the first partition). Commonly these sectors "
28370 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28371 "in order for the guest to boot correctly."
28375 #: ../tools/virt-resize.pl:461
28377 "If you specify this flag, then this initial copy is not done. You may need "
28378 "to reinstall the boot loader in this case."
28382 #: ../tools/virt-resize.pl:469
28383 msgid "B<--no-extra-partition>"
28387 #: ../tools/virt-resize.pl:471
28389 "By default, virt-resize creates an extra partition if there is any extra, "
28390 "unused space after all resizing has happened. Use this option to prevent "
28391 "the extra partition from being created. If you do this then the extra space "
28392 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28393 "tool in the guest."
28397 #: ../tools/virt-resize.pl:477
28399 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28404 #: ../tools/virt-resize.pl:484
28405 msgid "B<--no-expand-content>"
28409 #: ../tools/virt-resize.pl:486
28411 "By default, virt-resize will try to expand the direct contents of "
28412 "partitions, if it knows how (see C<--expand> option above)."
28416 #: ../tools/virt-resize.pl:489
28418 "If you give the C<--no-expand-content> option then virt-resize will not "
28423 #: ../tools/virt-resize.pl:496
28424 msgid "B<-d> | B<--debug>"
28428 #: ../tools/virt-resize.pl:504
28429 msgid "B<-n> | B<--dryrun>"
28433 #: ../tools/virt-resize.pl:506
28434 msgid "Print a summary of what would be done, but don't do anything."
28438 #: ../tools/virt-resize.pl:512
28439 msgid "B<-q> | B<--quiet>"
28443 #: ../tools/virt-resize.pl:514
28444 msgid "Don't print the summary."
28448 #: ../tools/virt-resize.pl:522
28450 "Specify the format of the input disk image. If this flag is not given then "
28451 "it is auto-detected from the image itself."
28455 #: ../tools/virt-resize.pl:528
28457 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28458 "AND NON-SPARSE RAW FORMATS>."
28462 #: ../tools/virt-resize.pl:535
28463 msgid "B<--output-format> raw"
28467 #: ../tools/virt-resize.pl:537
28469 "Specify the format of the output disk image. If this flag is not given then "
28470 "it is auto-detected from the image itself."
28474 #: ../tools/virt-resize.pl:543
28476 "Note that you still need to create the output disk with the right format. "
28477 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28481 #: ../tools/virt-resize.pl:1419
28486 #: ../tools/virt-resize.pl:1421
28487 msgid "\"Partition 1 does not end on cylinder boundary.\""
28491 #: ../tools/virt-resize.pl:1423
28493 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28494 "means the partitions will not be aligned to the ancient CHS geometry. "
28495 "However CHS geometry is meaningless for disks manufactured since the early "
28496 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28497 "cylinders is not required by any modern operating system."
28501 #: ../tools/virt-resize.pl:1430
28502 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28506 #: ../tools/virt-resize.pl:1432
28508 "In Windows Vista and later versions, Microsoft switched to using a separate "
28509 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28510 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28511 "the boot partition. Doing so seems to break the guest completely. However "
28512 "expanding the second partition (ie. C: drive) should work."
28516 #: ../tools/virt-resize.pl:1439
28518 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28519 "NTFS partitions have been expanded. This is just a safety check and (unless "
28520 "it find errors) is nothing to worry about."
28524 #: ../tools/virt-resize.pl:1443
28525 msgid "GUEST BOOT STUCK AT \"GRUB\""
28529 #: ../tools/virt-resize.pl:1445
28531 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28532 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28533 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28534 "although we think is to do with partition alignment."
28538 #: ../tools/virt-resize.pl:1450
28541 " guestfish -i -a newdisk\n"
28542 " ><fs> cat /boot/grub/device.map\n"
28543 " # check the contents of this file are sensible or\n"
28544 " # edit the file if necessary\n"
28545 " ><fs> grub-install / /dev/vda\n"
28551 #: ../tools/virt-resize.pl:1457
28553 "For more flexible guest reconfiguration, including if you need to specify "
28554 "other parameters to grub-install, use L<virt-rescue(1)>."
28558 #: ../tools/virt-resize.pl:1460
28559 msgid "ALTERNATIVE TOOLS"
28563 #: ../tools/virt-resize.pl:1462
28565 "There are several proprietary tools for resizing partitions. We won't "
28566 "mention any here."
28570 #: ../tools/virt-resize.pl:1465
28572 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28573 "operations on disk images. They can resize and move partitions, but I don't "
28574 "think they can do anything with the contents, and they certainly don't "
28579 #: ../tools/virt-resize.pl:1470
28581 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28582 "but at a much lower level. You will probably end up hand-calculating sector "
28583 "offsets, which is something that virt-resize was designed to avoid. If you "
28584 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28589 #: ../tools/virt-resize.pl:1485
28591 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
28592 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
28593 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
28594 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
28595 "libguestfs.org/>."
28599 #: ../tools/virt-list-filesystems.pl:32
28601 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28605 #: ../tools/virt-list-filesystems.pl:36
28608 " virt-list-filesystems [--options] domname\n"
28613 #: ../tools/virt-list-filesystems.pl:38
28616 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28621 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
28623 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
28628 #: ../tools/virt-list-filesystems.pl:45
28630 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28631 "are contained in a virtual machine or disk image."
28635 #: ../tools/virt-list-filesystems.pl:49
28637 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28638 "functionality. For more complex cases you should look at the L<guestfish(1)"
28643 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
28644 msgid "B<-l> | B<--long>"
28648 #: ../tools/virt-list-filesystems.pl:108
28650 "With this option, C<virt-list-filesystems> displays the type of each "
28651 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28655 #: ../tools/virt-list-filesystems.pl:115
28656 msgid "B<-a> | B<--all>"
28660 #: ../tools/virt-list-filesystems.pl:117
28662 "Normally we only show mountable filesystems. If this option is given then "
28663 "swap devices are shown too."
28667 #: ../tools/virt-list-filesystems.pl:191
28669 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
28670 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28671 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28675 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:298
28676 msgid "Copyright (C) 2009 Red Hat Inc."
28680 #: ../tools/virt-tar.pl:33
28681 msgid "virt-tar - Extract or upload files to a virtual machine"
28685 #: ../tools/virt-tar.pl:37
28688 " virt-tar [--options] -x domname directory tarball\n"
28693 #: ../tools/virt-tar.pl:39
28696 " virt-tar [--options] -u domname tarball directory\n"
28701 #: ../tools/virt-tar.pl:41
28704 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28709 #: ../tools/virt-tar.pl:43
28712 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28717 #: ../tools/virt-tar.pl:47
28718 msgid "Download C</home> from the VM into a local tarball:"
28722 #: ../tools/virt-tar.pl:49
28725 " virt-tar -x domname /home home.tar\n"
28730 #: ../tools/virt-tar.pl:51
28733 " virt-tar -zx domname /home home.tar.gz\n"
28738 #: ../tools/virt-tar.pl:53
28739 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28743 #: ../tools/virt-tar.pl:55
28746 " virt-tar -u domname uploadstuff.tar /tmp\n"
28751 #: ../tools/virt-tar.pl:57
28754 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28759 #: ../tools/virt-tar.pl:61
28761 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28762 "virtual machines. If you do this, you risk disk corruption in the VM. "
28763 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28767 #: ../tools/virt-tar.pl:66
28769 "You can use C<-x> (extract) on live virtual machines, but you might get "
28770 "inconsistent results or errors if there is filesystem activity inside the "
28771 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28772 "work, but the only way to guarantee consistent results is if the virtual "
28773 "machine is shut down."
28777 #: ../tools/virt-tar.pl:74
28779 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28780 "parts of a guest filesystem. There are many possibilities: making backups, "
28781 "uploading data files, snooping on guest activity, fixing or customizing "
28786 #: ../tools/virt-tar.pl:79
28788 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28789 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28790 "should look at the L<guestfish(1)> tool."
28794 #: ../tools/virt-tar.pl:83
28796 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28797 "its contents (recursively) from the virtual machine into a local tarball. "
28798 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28799 "virtual machine. You cannot use these two options together."
28803 #: ../tools/virt-tar.pl:89
28805 "In addition, you may need to use the C<-z> (gZip) option to enable "
28806 "compression. When uploading, you have to specify C<-z> if the upload file "
28807 "is compressed because virt-tar won't detect this on its own."
28811 #: ../tools/virt-tar.pl:93
28813 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28814 "example it cannot do PKZip files or bzip2 compression. If you want that "
28815 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28816 "the L<libguestfs(3)> API)."
28820 #: ../tools/virt-tar.pl:151
28821 msgid "B<-x> | B<--extract> | B<--download>"
28825 #: ../tools/virt-tar.pl:153
28826 msgid "B<-u> | B<--upload>"
28830 #: ../tools/virt-tar.pl:155
28832 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28837 #: ../tools/virt-tar.pl:158
28839 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28840 "Please read the L</WARNING> section above before using this option."
28844 #: ../tools/virt-tar.pl:162
28845 msgid "You must specify exactly one of these options."
28849 #: ../tools/virt-tar.pl:168
28850 msgid "B<-z> | B<--gzip>"
28854 #: ../tools/virt-tar.pl:170
28855 msgid "Specify that the input or output tarball is gzip-compressed."
28859 #: ../tools/virt-tar.pl:283
28861 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28862 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28867 #: ../tools/virt-make-fs.pl:37
28868 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28872 #: ../tools/virt-make-fs.pl:41
28875 " virt-make-fs [--options] input.tar output.img\n"
28880 #: ../tools/virt-make-fs.pl:43
28883 " virt-make-fs [--options] input.tar.gz output.img\n"
28888 #: ../tools/virt-make-fs.pl:45
28891 " virt-make-fs [--options] directory output.img\n"
28896 #: ../tools/virt-make-fs.pl:49
28898 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28899 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28900 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28901 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28902 "you want to attach these filesystems to existing virtual machines (eg. to "
28903 "import large amounts of read-only data to a VM)."
28907 #: ../tools/virt-make-fs.pl:57
28908 msgid "Basic usage is:"
28912 #: ../tools/virt-make-fs.pl:59
28915 " virt-make-fs input output\n"
28920 #: ../tools/virt-make-fs.pl:61
28922 "where C<input> is either a directory containing files that you want to add, "
28923 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28924 "C<output> is a disk image. The input type is detected automatically. The "
28925 "output disk image defaults to a raw ext2 image unless you specify extra "
28926 "flags (see L</OPTIONS> below)."
28930 #: ../tools/virt-make-fs.pl:67
28931 msgid "EXTRA SPACE"
28935 #: ../tools/virt-make-fs.pl:69
28937 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28938 "the files that it contains, but might have extra space. Depending on how "
28939 "you are going to use the output, you might think this extra space is wasted "
28940 "and want to minimize it, or you might want to leave space so that more files "
28941 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28942 "but you can use the C<--size> flag to leave space in the filesystem if you "
28947 #: ../tools/virt-make-fs.pl:77
28949 "An alternative way to leave extra space but not make the output image any "
28950 "bigger is to use an alternative disk image format (instead of the default "
28951 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28952 "image format (check your hypervisor supports this before using it). This "
28953 "allows you to choose a large C<--size> but the extra space won't actually be "
28954 "allocated in the image until you try to store something in it."
28958 #: ../tools/virt-make-fs.pl:85
28960 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28961 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28962 "resize to build another image from scratch."
28966 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28967 #: ../tools/virt-make-fs.pl:142
28972 #: ../tools/virt-make-fs.pl:91
28975 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28980 #: ../tools/virt-make-fs.pl:93
28981 msgid "FILESYSTEM TYPE"
28985 #: ../tools/virt-make-fs.pl:95
28987 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28988 "libguestfs supports can be used (but I<not> read-only formats like "
28989 "ISO9660). Here are some of the more common choices:"
28993 #: ../tools/virt-make-fs.pl:101
28998 #: ../tools/virt-make-fs.pl:103
29000 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
29001 "you are not going to use the filesystem in a way that requires the journal, "
29002 "then this is just wasted overhead."
29006 #: ../tools/virt-make-fs.pl:107
29007 msgid "I<ntfs> or I<vfat>"
29011 #: ../tools/virt-make-fs.pl:109
29012 msgid "Useful if exporting data to a Windows guest."
29016 #: ../tools/virt-make-fs.pl:111
29018 "I<Note for vfat>: The tar archive or local directory must only contain files "
29019 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
29020 "program running within libguestfs is unable to change the ownership of non-"
29021 "root files, since vfat itself does not support this."
29025 #: ../tools/virt-make-fs.pl:116
29030 #: ../tools/virt-make-fs.pl:118
29032 "Lower overhead than C<ext2>, but certain limitations on filename length and "
29033 "total filesystem size."
29037 #: ../tools/virt-make-fs.pl:125
29040 " virt-make-fs --type=minix input minixfs.img\n"
29045 #: ../tools/virt-make-fs.pl:127
29046 msgid "TO PARTITION OR NOT TO PARTITION"
29050 #: ../tools/virt-make-fs.pl:129
29051 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29055 #: ../tools/virt-make-fs.pl:131
29057 "Adding a partition can make the disk image more compatible with certain "
29058 "virtualized operating systems which don't expect to see a filesystem "
29059 "directly located on a block device (Linux doesn't care and will happily "
29060 "handle both types)."
29064 #: ../tools/virt-make-fs.pl:136
29066 "On the other hand, if you have a partition table then the output image is no "
29067 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29068 "directly on a partitioned disk image. (However libguestfs tools such as "
29069 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29073 #: ../tools/virt-make-fs.pl:144
29074 msgid "Add an MBR partition:"
29078 #: ../tools/virt-make-fs.pl:146
29081 " virt-make-fs --partition -- input disk.img\n"
29086 #: ../tools/virt-make-fs.pl:148
29088 "If the output disk image could be terabyte-sized or larger, it's better to "
29089 "use an EFI/GPT-compatible partition table:"
29093 #: ../tools/virt-make-fs.pl:151
29096 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29101 #: ../tools/virt-make-fs.pl:179
29102 msgid "Enable debugging information."
29106 #: ../tools/virt-make-fs.pl:185
29107 msgid "B<--size=E<lt>NE<gt>>"
29111 #: ../tools/virt-make-fs.pl:187
29112 msgid "B<--size=+E<lt>NE<gt>>"
29116 #: ../tools/virt-make-fs.pl:189
29117 msgid "B<-s E<lt>NE<gt>>"
29121 #: ../tools/virt-make-fs.pl:191
29122 msgid "B<-s +E<lt>NE<gt>>"
29126 #: ../tools/virt-make-fs.pl:193
29128 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
29132 #: ../tools/virt-make-fs.pl:196
29134 "If this option is I<not> given, then the output image will be just large "
29135 "enough to contain all the files, with not much wasted space."
29139 #: ../tools/virt-make-fs.pl:199
29141 "To choose a fixed size output disk, specify an absolute number followed by b/"
29142 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29143 "Petabytes or Exabytes. This must be large enough to contain all the input "
29144 "files, else you will get an error."
29148 #: ../tools/virt-make-fs.pl:204
29150 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
29151 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29152 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29153 "the input files, and (approximately) an extra 200 MB free space."
29157 #: ../tools/virt-make-fs.pl:210
29159 "Note that virt-make-fs estimates free space, and therefore will not produce "
29160 "filesystems containing precisely the free space requested. (It is much more "
29161 "expensive and time-consuming to produce a filesystem which has precisely the "
29162 "desired free space)."
29166 #: ../tools/virt-make-fs.pl:219
29167 msgid "B<--format=E<lt>fmtE<gt>>"
29171 #: ../tools/virt-make-fs.pl:221
29172 msgid "B<-F E<lt>fmtE<gt>>"
29176 #: ../tools/virt-make-fs.pl:223
29177 msgid "Choose the output disk image format."
29181 #: ../tools/virt-make-fs.pl:225
29182 msgid "The default is C<raw> (raw disk image)."
29186 #: ../tools/virt-make-fs.pl:227
29188 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29189 "that would really make sense here is C<qcow2>."
29193 #: ../tools/virt-make-fs.pl:234
29194 msgid "B<--type=E<lt>fsE<gt>>"
29198 #: ../tools/virt-make-fs.pl:236
29199 msgid "B<-t E<lt>fsE<gt>>"
29203 #: ../tools/virt-make-fs.pl:238
29204 msgid "Choose the output filesystem type."
29208 #: ../tools/virt-make-fs.pl:240
29209 msgid "The default is C<ext2>."
29213 #: ../tools/virt-make-fs.pl:242
29215 "Any filesystem which is supported read-write by libguestfs can be used here."
29219 #: ../tools/virt-make-fs.pl:249
29220 msgid "B<--partition>"
29224 #: ../tools/virt-make-fs.pl:251
29225 msgid "B<--partition=E<lt>parttypeE<gt>>"
29229 #: ../tools/virt-make-fs.pl:253
29231 "If specified, this flag adds an MBR partition table to the output disk image."
29235 #: ../tools/virt-make-fs.pl:256
29237 "You can change the partition table type, eg. C<--partition=gpt> for large "
29242 #: ../tools/virt-make-fs.pl:259
29244 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29245 "might consider the next parameter to be the partition type. For example:"
29249 #: ../tools/virt-make-fs.pl:263
29252 " virt-make-fs --partition input.tar ...\n"
29257 #: ../tools/virt-make-fs.pl:265
29259 "would cause virt-make-fs to think you wanted to use a partition type of "
29260 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29261 "dash) between options and the input file argument:"
29265 #: ../tools/virt-make-fs.pl:269
29268 " virt-make-fs --partition -- input.tar ...\n"
29273 #: ../tools/virt-make-fs.pl:536
29275 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
29276 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
29277 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29281 #: ../tools/virt-make-fs.pl:553
29284 " export LIBGUESTFS_DEBUG=1\n"
29285 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29290 #: ../tools/virt-make-fs.pl:556
29292 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
29297 #: ../tools/virt-list-partitions.pl:32
29299 "virt-list-partitions - List partitions in a virtual machine or disk image"
29303 #: ../tools/virt-list-partitions.pl:36
29306 " virt-list-partitions [--options] domname\n"
29311 #: ../tools/virt-list-partitions.pl:38
29314 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29319 #: ../tools/virt-list-partitions.pl:45
29321 "C<virt-list-partitions> is a command line tool to list the partitions that "
29322 "are contained in a virtual machine or disk image. It is mainly useful as a "
29323 "first step to using L<virt-resize(1)>."
29327 #: ../tools/virt-list-partitions.pl:50
29329 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29330 "functionality. For more complex cases you should look at the L<guestfish(1)"
29335 #: ../tools/virt-list-partitions.pl:107
29336 msgid "B<-h> | B<--human-readable>"
29340 #: ../tools/virt-list-partitions.pl:109
29341 msgid "Show sizes in human-readable form (eg. \"1G\")."
29345 #: ../tools/virt-list-partitions.pl:117
29347 "With this option, C<virt-list-partitions> displays the type and size of each "
29348 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29352 #: ../tools/virt-list-partitions.pl:124
29353 msgid "B<-t> | B<--total>"
29357 #: ../tools/virt-list-partitions.pl:126
29359 "Display the total size of each block device (as a separate row or rows)."
29363 #: ../tools/virt-list-partitions.pl:259
29365 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
29366 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
29367 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."