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-10 13:42+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 "LISTING FILES"
735 #: ../src/guestfs.pod:339
737 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
738 "L<guestfish(1)>-equivalent command C<ll>)."
742 #: ../src/guestfs.pod:342
744 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
745 "programs, as a flat list of strings."
749 #: ../src/guestfs.pod:345
751 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
752 "directory, plus additional information about each one. It is more "
753 "equivalent to using the L<readdir(3)> call on a local filesystem."
757 #: ../src/guestfs.pod:349
759 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
763 #: ../src/guestfs.pod:352
764 msgid "RUNNING COMMANDS"
768 #: ../src/guestfs.pod:354
770 "Although libguestfs is primarily an API for manipulating files inside guest "
771 "images, we also provide some limited facilities for running commands inside "
776 #: ../src/guestfs.pod:358
777 msgid "There are many limitations to this:"
781 #: ../src/guestfs.pod:362 ../src/guestfs.pod:367 ../src/guestfs.pod:372
782 #: ../src/guestfs.pod:376 ../src/guestfs.pod:381 ../src/guestfs.pod:385
783 #: ../src/guestfs.pod:390 ../src/guestfs.pod:395 ../src/guestfs.pod:954
784 #: ../src/guestfs.pod:958 ../src/guestfs.pod:962 ../src/guestfs.pod:967
785 #: ../src/guestfs.pod:975 ../src/guestfs.pod:994 ../src/guestfs.pod:1002
786 #: ../src/guestfs.pod:1024 ../src/guestfs.pod:1028 ../src/guestfs.pod:1032
787 #: ../src/guestfs.pod:1036 ../src/guestfs.pod:1040 ../src/guestfs.pod:1044
788 #: ../src/guestfs.pod:1526 ../src/guestfs.pod:1531 ../src/guestfs.pod:1535
789 #: ../src/guestfs.pod:1645 ../src/guestfs.pod:1650 ../src/guestfs.pod:1654
790 #: ../src/guestfs.pod:2006 ../src/guestfs.pod:2012 ../src/guestfs.pod:2017
791 #: ../src/guestfs.pod:2023 ../src/guestfs.pod:2135 ../src/guestfs.pod:2139
792 #: ../src/guestfs.pod:2143 ../src/guestfs.pod:2147
793 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
794 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:579
795 #: ../src/guestfs-actions.pod:586 ../src/guestfs-actions.pod:593
796 #: ../src/guestfs-actions.pod:1589 ../src/guestfs-actions.pod:1593
797 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:1601
798 #: ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1613
799 #: ../src/guestfs-actions.pod:1617 ../src/guestfs-actions.pod:1627
800 #: ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1635
801 #: ../src/guestfs-actions.pod:1773 ../src/guestfs-actions.pod:1777
802 #: ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1787
803 #: ../src/guestfs-actions.pod:1848 ../src/guestfs-actions.pod:1852
804 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish.pod:377
805 #: ../fish/guestfish.pod:381 ../fish/guestfish.pod:385
806 #: ../fish/guestfish.pod:389 ../fish/guestfish-actions.pod:13
807 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375
808 #: ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390
809 #: ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067
810 #: ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075
811 #: ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087
812 #: ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095
813 #: ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109
814 #: ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203
815 #: ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212
816 #: ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259
817 #: ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268
818 #: ../tools/virt-resize.pl:345 ../tools/virt-resize.pl:350
819 #: ../tools/virt-resize.pl:360
824 #: ../src/guestfs.pod:364
826 "The kernel version that the command runs under will be different from what "
831 #: ../src/guestfs.pod:369
833 "If the command needs to communicate with daemons, then most likely they "
838 #: ../src/guestfs.pod:374
839 msgid "The command will be running in limited memory."
843 #: ../src/guestfs.pod:378
845 "The network may not be available unless you enable it (see L</"
846 "guestfs_set_network>)."
850 #: ../src/guestfs.pod:383
851 msgid "Only supports Linux guests (not Windows, BSD, etc)."
855 #: ../src/guestfs.pod:387
857 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
861 #: ../src/guestfs.pod:392
863 "For SELinux guests, you may need to enable SELinux and load policy first. "
864 "See L</SELINUX> in this manpage."
868 #: ../src/guestfs.pod:397
870 "I<Security:> It is not safe to run commands from untrusted, possibly "
871 "malicious guests. These commands may attempt to exploit your program by "
872 "sending unexpected output. They could also try to exploit the Linux kernel "
873 "or qemu provided by the libguestfs appliance. They could use the network "
874 "provided by the libguestfs appliance to bypass ordinary network partitions "
875 "and firewalls. They could use the elevated privileges or different SELinux "
876 "context of your program to their advantage."
880 #: ../src/guestfs.pod:406
882 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
883 "(a script which runs when the guest next boots normally), and to have this "
884 "script run the commands you want in the normal context of the running guest, "
885 "network security and so on. For information about other security issues, "
890 #: ../src/guestfs.pod:414
892 "The two main API calls to run commands are L</guestfs_command> and L</"
893 "guestfs_sh> (there are also variations)."
897 #: ../src/guestfs.pod:417
899 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
900 "shell globs, redirections, etc will work."
904 #: ../src/guestfs.pod:420
905 msgid "CONFIGURATION FILES"
909 #: ../src/guestfs.pod:422
911 "To read and write configuration files in Linux guest filesystems, we "
912 "strongly recommend using Augeas. For example, Augeas understands how to "
913 "read and write, say, a Linux shadow password file or X.org configuration "
914 "file, and so avoids you having to write that code."
918 #: ../src/guestfs.pod:427
920 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
921 "document Augeas itself here because there is excellent documentation on the "
922 "L<http://augeas.net/> website."
926 #: ../src/guestfs.pod:431
928 "If you don't want to use Augeas (you fool!) then try calling L</"
929 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
934 #: ../src/guestfs.pod:435
939 #: ../src/guestfs.pod:437
941 "We support SELinux guests. To ensure that labeling happens correctly in "
942 "SELinux guests, you need to enable SELinux and load the guest's policy:"
946 #: ../src/guestfs.pod:443 ../src/guestfs.pod:1147 ../src/guestfs.pod:1278
951 #: ../src/guestfs.pod:445
952 msgid "Before launching, do:"
956 #: ../src/guestfs.pod:447
959 " guestfs_set_selinux (g, 1);\n"
964 #: ../src/guestfs.pod:449 ../src/guestfs.pod:1151 ../src/guestfs.pod:1282
969 #: ../src/guestfs.pod:451
971 "After mounting the guest's filesystem(s), load the policy. This is best "
972 "done by running the L<load_policy(8)> command in the guest itself:"
976 #: ../src/guestfs.pod:455
979 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
984 #: ../src/guestfs.pod:457
986 "(Older versions of C<load_policy> require you to specify the name of the "
991 #: ../src/guestfs.pod:460 ../src/guestfs.pod:1288
996 #: ../src/guestfs.pod:462
998 "Optionally, set the security context for the API. The correct security "
999 "context to use can only be known by inspecting the guest. As an example:"
1003 #: ../src/guestfs.pod:466
1006 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1011 #: ../src/guestfs.pod:470
1012 msgid "This will work for running commands and editing existing files."
1016 #: ../src/guestfs.pod:472
1018 "When new files are created, you may need to label them explicitly, for "
1019 "example by running the external command C<restorecon pathname>."
1023 #: ../src/guestfs.pod:476
1028 #: ../src/guestfs.pod:478
1030 "Certain calls are affected by the current file mode creation mask (the "
1031 "\"umask\"). In particular ones which create files or directories, such as "
1032 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1033 "either the default mode that the file is created with or modifies the mode "
1038 #: ../src/guestfs.pod:484
1040 "The default umask is C<022>, so files are created with modes such as C<0644> "
1041 "and directories with C<0755>."
1045 #: ../src/guestfs.pod:487
1047 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1048 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1049 "guestfs_chmod> after creating each file or directory."
1053 #: ../src/guestfs.pod:491
1054 msgid "For more information about umask, see L<umask(2)>."
1058 #: ../src/guestfs.pod:493 ../fish/guestfish.pod:670
1059 msgid "ENCRYPTED DISKS"
1063 #: ../src/guestfs.pod:495
1065 "Libguestfs allows you to access Linux guests which have been encrypted using "
1066 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1067 "standard. This includes nearly all whole disk encryption systems used by "
1068 "modern Linux guests."
1072 #: ../src/guestfs.pod:501
1074 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1075 "returns the string C<crypto_LUKS>)."
1079 #: ../src/guestfs.pod:504
1081 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1082 "will require the passphrase!"
1086 #: ../src/guestfs.pod:507
1088 "Opening a LUKS device creates a new device mapper device called C</dev/"
1089 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1090 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1091 "from and encrypted to the underlying block device respectively."
1095 #: ../src/guestfs.pod:513
1097 "LVM volume groups on the device can be made visible by calling L</"
1098 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1099 "(s) can now be mounted in the usual way."
1103 #: ../src/guestfs.pod:517
1105 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1106 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1107 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1108 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1109 "underlying encrypted block device)."
1113 #: ../src/guestfs.pod:524
1118 #: ../src/guestfs.pod:526
1120 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1121 "contains operating systems. (These APIs used to be in a separate Perl-only "
1122 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1123 "frequently used part of this library has been rewritten in C and moved into "
1128 #: ../src/guestfs.pod:532
1130 "Add all disks belonging to the unknown virtual machine and call L</"
1131 "guestfs_launch> in the usual way."
1135 #: ../src/guestfs.pod:535
1137 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1138 "and certain heuristics, and returns a list of operating systems that were "
1139 "found. An empty list means none were found. A single element is the root "
1140 "filesystem of the operating system. For dual- or multi-boot guests, "
1141 "multiple roots can be returned, each one corresponding to a separate "
1142 "operating system. (Multi-boot virtual machines are extremely rare in the "
1143 "world of virtualization, but since this scenario can happen, we have built "
1144 "libguestfs to deal with it.)"
1148 #: ../src/guestfs.pod:544
1150 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1151 "to get additional details about that operating system. For example, call L</"
1152 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1153 "Windows and Linux-based operating systems respectively."
1157 #: ../src/guestfs.pod:550
1159 "Un*x-like and Linux-based operating systems usually consist of several "
1160 "filesystems which are mounted at boot time (for example, a separate boot "
1161 "partition mounted on C</boot>). The inspection rules are able to detect how "
1162 "filesystems correspond to mount points. Call "
1163 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1164 "hash table like this example:"
1168 #: ../src/guestfs.pod:557
1171 " /boot => /dev/sda1\n"
1172 " / => /dev/vg_guest/lv_root\n"
1173 " /usr => /dev/vg_guest/lv_usr\n"
1178 #: ../src/guestfs.pod:561
1180 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1181 "filesystems as suggested."
1185 #: ../src/guestfs.pod:564
1187 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1188 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1192 #: ../src/guestfs.pod:568
1194 "Inspection currently only works for some common operating systems. "
1195 "Contributors are welcome to send patches for other operating systems that we "
1196 "currently cannot detect."
1200 #: ../src/guestfs.pod:572
1202 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1203 "for more details. The L</guestfs_inspect_os> function just ignores any "
1204 "encrypted devices."
1208 #: ../src/guestfs.pod:576
1210 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1211 "inspection and caches the results in the guest handle. Subsequent calls to "
1212 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1213 "read the disks. If you change the content of the guest disks, you can redo "
1214 "inspection by calling L</guestfs_inspect_os> again. (L</"
1215 "guestfs_inspect_list_applications> works a little differently from the other "
1216 "calls and does read the disks. See documentation for that function for "
1221 #: ../src/guestfs.pod:585
1222 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1226 #: ../src/guestfs.pod:587
1228 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1229 "ntfs-3g.org/> driver."
1233 #: ../src/guestfs.pod:590
1235 "DOS and Windows still use drive letters, and the filesystems are always "
1236 "treated as case insensitive by Windows itself, and therefore you might find "
1237 "a Windows configuration file referring to a path like C<c:\\windows"
1238 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1239 "might be referred to as C</WINDOWS/System32>."
1243 #: ../src/guestfs.pod:596
1245 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1246 "libguestfs to read the appropriate Windows Registry and configuration files, "
1247 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1252 #: ../src/guestfs.pod:601
1254 "Replacing backslash characters with forward slash characters is also outside "
1255 "the scope of libguestfs, but something that you can easily do."
1259 #: ../src/guestfs.pod:604
1261 "Where we can help is in resolving the case insensitivity of paths. For "
1262 "this, call L</guestfs_case_sensitive_path>."
1266 #: ../src/guestfs.pod:607
1268 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1269 "files, through the library C<hivex> which is part of the libguestfs project "
1270 "although ships as a separate tarball. You have to locate and download the "
1271 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1272 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1273 "reg(1)> for more help on this issue."
1277 #: ../src/guestfs.pod:615
1278 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1282 #: ../src/guestfs.pod:617
1284 "Although we don't want to discourage you from using the C API, we will "
1285 "mention here that the same API is also available in other languages."
1289 #: ../src/guestfs.pod:620
1291 "The API is broadly identical in all supported languages. This means that "
1292 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1293 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1294 "words, a straightforward, predictable isomorphism between each language."
1298 #: ../src/guestfs.pod:626
1300 "Error messages are automatically transformed into exceptions if the language "
1305 #: ../src/guestfs.pod:629
1307 "We don't try to \"object orientify\" parts of the API in OO languages, "
1308 "although contributors are welcome to write higher level APIs above what we "
1309 "provide in their favourite languages if they wish."
1313 #: ../src/guestfs.pod:635
1318 #: ../src/guestfs.pod:637
1320 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1321 "identical to the C API. C++ classes and exceptions are not used."
1325 #: ../src/guestfs.pod:641
1330 #: ../src/guestfs.pod:643
1332 "The C# bindings are highly experimental. Please read the warnings at the "
1333 "top of C<csharp/Libguestfs.cs>."
1337 #: ../src/guestfs.pod:646
1342 #: ../src/guestfs.pod:648
1344 "This is the only language binding that is working but incomplete. Only "
1345 "calls which return simple integers have been bound in Haskell, and we are "
1346 "looking for help to complete this binding."
1350 #: ../src/guestfs.pod:652
1355 #: ../src/guestfs.pod:654
1357 "Full documentation is contained in the Javadoc which is distributed with "
1362 #: ../src/guestfs.pod:657
1367 #: ../src/guestfs.pod:659
1368 msgid "For documentation see L<guestfs-ocaml(3)>."
1372 #: ../src/guestfs.pod:661
1377 #: ../src/guestfs.pod:663
1378 msgid "For documentation see L<Sys::Guestfs(3)>."
1382 #: ../src/guestfs.pod:665
1387 #: ../src/guestfs.pod:667
1389 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1390 "the php-libguestfs package for your distribution."
1394 #: ../src/guestfs.pod:670
1395 msgid "The PHP binding only works correctly on 64 bit machines."
1399 #: ../src/guestfs.pod:672
1404 #: ../src/guestfs.pod:674
1405 msgid "For documentation see L<guestfs-python(3)>."
1409 #: ../src/guestfs.pod:676
1414 #: ../src/guestfs.pod:678
1415 msgid "For documentation see L<guestfs-ruby(3)>."
1419 #: ../src/guestfs.pod:680
1420 msgid "B<shell scripts>"
1424 #: ../src/guestfs.pod:682
1425 msgid "For documentation see L<guestfish(1)>."
1429 #: ../src/guestfs.pod:686
1430 msgid "LIBGUESTFS GOTCHAS"
1434 #: ../src/guestfs.pod:688
1436 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1437 "system [...] that works in the way it is documented but is counterintuitive "
1438 "and almost invites mistakes.\""
1442 #: ../src/guestfs.pod:692
1444 "Since we developed libguestfs and the associated tools, there are several "
1445 "things we would have designed differently, but are now stuck with for "
1446 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1447 "release, you can expect these to change. Beware of them."
1451 #: ../src/guestfs.pod:700
1452 msgid "Autosync / forgetting to sync."
1456 #: ../src/guestfs.pod:702
1458 "When modifying a filesystem from C or another language, you B<must> unmount "
1459 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1460 "libguestfs handle. You can also call:"
1464 #: ../src/guestfs.pod:706
1467 " guestfs_set_autosync (g, 1);\n"
1472 #: ../src/guestfs.pod:708
1474 "to have the unmount/sync done automatically for you when the handle 'g' is "
1475 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1479 #: ../src/guestfs.pod:712
1481 "If you forget to do this, then it is entirely possible that your changes "
1482 "won't be written out, or will be partially written, or (very rarely) that "
1483 "you'll get disk corruption."
1487 #: ../src/guestfs.pod:716
1489 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1490 "guestfish scripts that forget to sync will work just fine, which can make "
1491 "this very puzzling if you are trying to debug a problem."
1495 #: ../src/guestfs.pod:720
1497 "Update: Autosync is enabled by default for all API users starting from "
1498 "libguestfs 1.5.24."
1502 #: ../src/guestfs.pod:723
1503 msgid "Mount option C<-o sync> should not be the default."
1507 #: ../src/guestfs.pod:725
1509 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1510 "However C<-o sync> does not add any reliability benefit, but does have a "
1511 "very large performance impact."
1515 #: ../src/guestfs.pod:729
1517 "The work around is to use L</guestfs_mount_options> and set the mount "
1518 "options that you actually want to use."
1522 #: ../src/guestfs.pod:732
1523 msgid "Read-only should be the default."
1527 #: ../src/guestfs.pod:734
1529 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1530 "specify I<--rw> if you want to make changes to the image."
1534 #: ../src/guestfs.pod:737
1535 msgid "This would reduce the potential to corrupt live VM images."
1539 #: ../src/guestfs.pod:739
1541 "Note that many filesystems change the disk when you just mount and unmount, "
1542 "even if you didn't perform any writes. You need to use L</"
1543 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1547 #: ../src/guestfs.pod:743
1548 msgid "guestfish command line is hard to use."
1552 #: ../src/guestfs.pod:745
1554 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1555 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1556 "exist, so it fails. In earlier versions of guestfish the error message was "
1557 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1558 "we should have used C<guestfish -c command> to run commands."
1562 #: ../src/guestfs.pod:752
1563 msgid "guestfish megabyte modifiers don't work right on all commands"
1567 #: ../src/guestfs.pod:754
1569 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1570 "other modifiers). What guestfish actually does is to multiply the number "
1571 "part by the modifier part and pass the result to the C API. However this "
1572 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1573 "expecting some other unit (eg. megabytes)."
1577 #: ../src/guestfs.pod:761
1578 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1582 #: ../src/guestfs.pod:763
1585 " lvcreate LV VG 100M\n"
1590 #: ../src/guestfs.pod:765
1592 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1593 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1594 "megabytes * megabytes) logical volume. The error message you get from this "
1595 "is also a little obscure."
1599 #: ../src/guestfs.pod:770
1601 "This could be fixed in the generator by specially marking parameters and "
1602 "return values which take bytes or other units."
1606 #: ../src/guestfs.pod:773
1607 msgid "Ambiguity between devices and paths"
1611 #: ../src/guestfs.pod:775
1613 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1614 "sdb2>) and a similar pathname. A file might just happen to be called "
1615 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1619 #: ../src/guestfs.pod:780
1621 "In the current API we usually resolve this ambiguity by having two separate "
1622 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1623 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1624 "detecting if the path supplied begins with C</dev/>."
1628 #: ../src/guestfs.pod:786
1630 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1631 "make paths/devices into structured names. One way to do this would be to "
1632 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1633 "aspect of grub. Another way would be to use a structured type, equivalent "
1634 "to this OCaml type:"
1638 #: ../src/guestfs.pod:792
1641 " type path = Path of string | Device of int | Partition of int * int\n"
1646 #: ../src/guestfs.pod:794
1647 msgid "which would allow you to pass arguments like:"
1651 #: ../src/guestfs.pod:796
1654 " Path \"/foo/bar\"\n"
1655 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1656 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1657 " Path \"/dev/sdb2\" (* not a device *)\n"
1662 #: ../src/guestfs.pod:801
1664 "As you can see there are still problems to resolve even with this "
1665 "representation. Also consider how it might work in guestfish."
1669 #: ../src/guestfs.pod:806
1670 msgid "PROTOCOL LIMITS"
1674 #: ../src/guestfs.pod:808
1676 "Internally libguestfs uses a message-based protocol to pass API calls and "
1677 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1678 "plenty more detail about this). The maximum message size used by the "
1679 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1680 "aware of this limit. The API calls which may be affected are individually "
1681 "documented, with a link back to this section of the documentation."
1685 #: ../src/guestfs.pod:816
1687 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1688 "a simple string. Because this string is at some point internally encoded as "
1689 "a message, the maximum size that it can return is slightly under 4 MB. If "
1690 "the requested file is larger than this then you will get an error."
1694 #: ../src/guestfs.pod:822
1696 "In order to transfer large files into and out of the guest filesystem, you "
1697 "need to use particular calls that support this. The sections L</UPLOADING> "
1698 "and L</DOWNLOADING> document how to do this."
1702 #: ../src/guestfs.pod:826
1704 "You might also consider mounting the disk image using our FUSE filesystem "
1705 "support (L<guestmount(1)>)."
1709 #: ../src/guestfs.pod:829
1710 msgid "KEYS AND PASSPHRASES"
1714 #: ../src/guestfs.pod:831
1716 "Certain libguestfs calls take a parameter that contains sensitive key "
1717 "material, passed in as a C string."
1721 #: ../src/guestfs.pod:834
1723 "In the future we would hope to change the libguestfs implementation so that "
1724 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1725 "swap. However this is I<not> done at the moment, because of the complexity "
1726 "of such an implementation."
1730 #: ../src/guestfs.pod:839
1732 "Therefore you should be aware that any key parameter you pass to libguestfs "
1733 "might end up being written out to the swap partition. If this is a concern, "
1734 "scrub the swap partition or don't use libguestfs on encrypted devices."
1738 #: ../src/guestfs.pod:844
1739 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1743 #: ../src/guestfs.pod:846
1745 "All high-level libguestfs actions are synchronous. If you want to use "
1746 "libguestfs asynchronously then you must create a thread."
1750 #: ../src/guestfs.pod:849
1752 "Only use the handle from a single thread. Either use the handle exclusively "
1753 "from one thread, or provide your own mutex so that two threads cannot issue "
1754 "calls on the same handle at the same time."
1758 #: ../src/guestfs.pod:853
1760 "See the graphical program guestfs-browser for one possible architecture for "
1761 "multithreaded programs using libvirt and libguestfs."
1765 #: ../src/guestfs.pod:856
1770 #: ../src/guestfs.pod:858
1772 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1777 #: ../src/guestfs.pod:861
1779 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1780 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1784 #: ../src/guestfs.pod:864
1786 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1787 "to change the directories that libguestfs will search in. The value is a "
1788 "colon-separated list of paths. The current directory is I<not> searched "
1789 "unless the path contains an empty element or C<.>. For example "
1790 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1791 "then C</usr/lib/guestfs>."
1795 #: ../src/guestfs.pod:871
1796 msgid "QEMU WRAPPERS"
1800 #: ../src/guestfs.pod:873
1802 "If you want to compile your own qemu, run qemu from a non-standard location, "
1803 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1808 #: ../src/guestfs.pod:877
1810 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1811 "last command in the shell script (so that qemu replaces the shell and "
1812 "becomes the direct child of the libguestfs-using program). If you don't do "
1813 "this, then the qemu process won't be cleaned up correctly."
1817 #: ../src/guestfs.pod:882
1819 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1824 #: ../src/guestfs.pod:885
1828 " qemudir=/home/rjones/d/qemu\n"
1829 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1834 #: ../src/guestfs.pod:889
1836 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1837 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1842 #: ../src/guestfs.pod:893
1845 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1850 #: ../src/guestfs.pod:895
1852 "Note that libguestfs also calls qemu with the -help and -version options in "
1853 "order to determine features."
1857 #: ../src/guestfs.pod:898
1858 msgid "ABI GUARANTEE"
1862 #: ../src/guestfs.pod:900
1864 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1865 "actions as outlined in this section. Although we will deprecate some "
1866 "actions, for example if they get replaced by newer calls, we will keep the "
1867 "old actions forever. This allows you the developer to program in confidence "
1868 "against the libguestfs API."
1872 #: ../src/guestfs.pod:906
1873 msgid "BLOCK DEVICE NAMING"
1877 #: ../src/guestfs.pod:908
1879 "In the kernel there is now quite a profusion of schemata for naming block "
1880 "devices (in this context, by I<block device> I mean a physical or virtual "
1881 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1882 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1883 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1884 "for the old IDE driver (particularly for SATA devices) those devices also "
1885 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1886 "paravirtualized drivers. This has created several different naming systems, "
1887 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1891 #: ../src/guestfs.pod:920
1893 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1894 "Linux kernel to access block devices. We can run a variety of appliances "
1895 "based on a variety of Linux kernels."
1899 #: ../src/guestfs.pod:924
1901 "This causes a problem for libguestfs because many API calls use device or "
1902 "partition names. Working scripts and the recipe (example) scripts that we "
1903 "make available over the internet could fail if the naming scheme changes."
1907 #: ../src/guestfs.pod:929
1909 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1910 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1911 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1912 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1916 #: ../src/guestfs.pod:935
1918 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1919 "L</guestfs_list_partitions> and similar calls return the true names of the "
1920 "devices and partitions as known to the appliance."
1924 #: ../src/guestfs.pod:940
1925 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1929 #: ../src/guestfs.pod:942
1931 "Usually this translation is transparent. However in some (very rare) cases "
1932 "you may need to know the exact algorithm. Such cases include where you use "
1933 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
1934 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
1938 #: ../src/guestfs.pod:948
1940 "The algorithm is applied only to I<parameters> which are known to be either "
1941 "device or partition names. Return values from functions such as L</"
1942 "guestfs_list_devices> are never changed."
1946 #: ../src/guestfs.pod:956
1947 msgid "Is the string a parameter which is a device or partition name?"
1951 #: ../src/guestfs.pod:960
1952 msgid "Does the string begin with C</dev/sd>?"
1956 #: ../src/guestfs.pod:964
1958 "Does the named device exist? If so, we use that device. However if I<not> "
1959 "then we continue with this algorithm."
1963 #: ../src/guestfs.pod:969
1964 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1968 #: ../src/guestfs.pod:971
1969 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1973 #: ../src/guestfs.pod:973
1974 msgid "If that named device exists, use it. If not, continue."
1978 #: ../src/guestfs.pod:977
1979 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1983 #: ../src/guestfs.pod:979
1984 msgid "If that named device exists, use it. If not, return an error."
1988 #: ../src/guestfs.pod:983
1989 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
1993 #: ../src/guestfs.pod:985
1995 "Although the standard naming scheme and automatic translation is useful for "
1996 "simple programs and guestfish scripts, for larger programs it is best not to "
1997 "rely on this mechanism."
2001 #: ../src/guestfs.pod:989
2003 "Where possible for maximum future portability programs using libguestfs "
2004 "should use these future-proof techniques:"
2008 #: ../src/guestfs.pod:996
2010 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2011 "device names, and then use those names directly."
2015 #: ../src/guestfs.pod:999
2017 "Since those device names exist by definition, they will never be translated."
2021 #: ../src/guestfs.pod:1004
2023 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2024 "filesystem labels."
2028 #: ../src/guestfs.pod:1009
2033 #: ../src/guestfs.pod:1011
2035 "This section discusses security implications of using libguestfs, "
2036 "particularly with untrusted or malicious guests or disk images."
2040 #: ../src/guestfs.pod:1014
2041 msgid "GENERAL SECURITY CONSIDERATIONS"
2045 #: ../src/guestfs.pod:1016
2047 "Be careful with any files or data that you download from a guest (by "
2048 "\"download\" we mean not just the L</guestfs_download> command but any "
2049 "command that reads files, filenames, directories or anything else from a "
2050 "disk image). An attacker could manipulate the data to fool your program "
2051 "into doing the wrong thing. Consider cases such as:"
2055 #: ../src/guestfs.pod:1026
2056 msgid "the data (file etc) not being present"
2060 #: ../src/guestfs.pod:1030
2061 msgid "being present but empty"
2065 #: ../src/guestfs.pod:1034
2066 msgid "being much larger than normal"
2070 #: ../src/guestfs.pod:1038
2071 msgid "containing arbitrary 8 bit data"
2075 #: ../src/guestfs.pod:1042
2076 msgid "being in an unexpected character encoding"
2080 #: ../src/guestfs.pod:1046
2081 msgid "containing homoglyphs."
2085 #: ../src/guestfs.pod:1050
2086 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2090 #: ../src/guestfs.pod:1052
2092 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2093 "(VFS) module can sometimes be escalated into exploits by deliberately "
2094 "creating a malicious, malformed filesystem. These exploits are very severe "
2095 "for two reasons. Firstly there are very many filesystem drivers in the "
2096 "kernel, and many of them are infrequently used and not much developer "
2097 "attention has been paid to the code. Linux userspace helps potential "
2098 "crackers by detecting the filesystem type and automatically choosing the "
2099 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2100 "the administrator. Secondly, a kernel-level exploit is like a local root "
2101 "exploit (worse in some ways), giving immediate and total access to the "
2102 "system right down to the hardware level."
2106 #: ../src/guestfs.pod:1065
2108 "That explains why you should never mount a filesystem from an untrusted "
2109 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2110 "inside a qemu virtual machine, usually running as a non-root user. The "
2111 "attacker would need to write a filesystem which first exploited the kernel, "
2112 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2113 "the libguestfs protocol, and finally to be as serious as the host kernel "
2114 "exploit it would need to escalate its privileges to root. This multi-step "
2115 "escalation, performed by a static piece of data, is thought to be extremely "
2116 "hard to do, although we never say 'never' about security issues."
2120 #: ../src/guestfs.pod:1076
2122 "In any case callers can reduce the attack surface by forcing the filesystem "
2123 "type when mounting (use L</guestfs_mount_vfs>)."
2127 #: ../src/guestfs.pod:1079
2128 msgid "PROTOCOL SECURITY"
2132 #: ../src/guestfs.pod:1081
2134 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2135 "defined upper message size. However a program that uses libguestfs must "
2136 "also take care - for example you can write a program that downloads a binary "
2137 "from a disk image and executes it locally, and no amount of protocol "
2138 "security will save you from the consequences."
2142 #: ../src/guestfs.pod:1087
2143 msgid "INSPECTION SECURITY"
2147 #: ../src/guestfs.pod:1089
2149 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2150 "directly from the guest, and these could contain any 8 bit data. Callers "
2151 "should be careful to escape these before printing them to a structured file "
2152 "(for example, use HTML escaping if creating a web page)."
2156 #: ../src/guestfs.pod:1095
2158 "Guest configuration may be altered in unusual ways by the administrator of "
2159 "the virtual machine, and may not reflect reality (particularly for untrusted "
2160 "or actively malicious guests). For example we parse the hostname from "
2161 "configuration files like C</etc/sysconfig/network> that we find in the "
2162 "guest, but the guest administrator can easily manipulate these files to "
2163 "provide the wrong hostname."
2167 #: ../src/guestfs.pod:1103
2169 "The inspection API parses guest configuration using two external libraries: "
2170 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2171 "designed to be robust in the face of malicious data, although denial of "
2172 "service attacks are still possible, for example with oversized configuration "
2177 #: ../src/guestfs.pod:1109
2178 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2182 #: ../src/guestfs.pod:1111
2184 "Be very cautious about running commands from the guest. By running a "
2185 "command in the guest, you are giving CPU time to a binary that you do not "
2186 "control, under the same user account as the library, albeit wrapped in qemu "
2187 "virtualization. More information and alternatives can be found in the "
2188 "section L</RUNNING COMMANDS>."
2192 #: ../src/guestfs.pod:1117
2193 msgid "CVE-2010-3851"
2197 #: ../src/guestfs.pod:1119
2198 msgid "https://bugzilla.redhat.com/642934"
2202 #: ../src/guestfs.pod:1121
2204 "This security bug concerns the automatic disk format detection that qemu "
2205 "does on disk images."
2209 #: ../src/guestfs.pod:1124
2211 "A raw disk image is just the raw bytes, there is no header. Other disk "
2212 "images like qcow2 contain a special header. Qemu deals with this by looking "
2213 "for one of the known headers, and if none is found then assuming the disk "
2214 "image must be raw."
2218 #: ../src/guestfs.pod:1129
2220 "This allows a guest which has been given a raw disk image to write some "
2221 "other header. At next boot (or when the disk image is accessed by "
2222 "libguestfs) qemu would do autodetection and think the disk image format was, "
2223 "say, qcow2 based on the header written by the guest."
2227 #: ../src/guestfs.pod:1134
2229 "This in itself would not be a problem, but qcow2 offers many features, one "
2230 "of which is to allow a disk image to refer to another image (called the "
2231 "\"backing disk\"). It does this by placing the path to the backing disk "
2232 "into the qcow2 header. This path is not validated and could point to any "
2233 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2234 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2235 "control of the attacker."
2239 #: ../src/guestfs.pod:1142
2241 "In libguestfs this is rather hard to exploit except under two circumstances:"
2245 #: ../src/guestfs.pod:1149
2246 msgid "You have enabled the network or have opened the disk in write mode."
2250 #: ../src/guestfs.pod:1153
2252 "You are also running untrusted code from the guest (see L</RUNNING "
2257 #: ../src/guestfs.pod:1158
2259 "The way to avoid this is to specify the expected disk format when adding "
2260 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2261 "should always do this if the disk is raw format, and it's a good idea for "
2266 #: ../src/guestfs.pod:1163
2268 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2269 "format is fetched from libvirt and passed through."
2273 #: ../src/guestfs.pod:1166
2275 "For libguestfs tools, use the I<--format> command line parameter as "
2280 #: ../src/guestfs.pod:1169
2281 msgid "CONNECTION MANAGEMENT"
2285 #: ../src/guestfs.pod:1171
2290 #: ../src/guestfs.pod:1173
2292 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2293 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2294 "handle and release all resources used."
2298 #: ../src/guestfs.pod:1177
2300 "For information on using multiple handles and threads, see the section L</"
2301 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2305 #: ../src/guestfs.pod:1180
2306 msgid "guestfs_create"
2310 #: ../src/guestfs.pod:1182
2313 " guestfs_h *guestfs_create (void);\n"
2318 #: ../src/guestfs.pod:1184
2319 msgid "Create a connection handle."
2323 #: ../src/guestfs.pod:1186
2325 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2326 "on the handle at least once."
2330 #: ../src/guestfs.pod:1189
2332 "This function returns a non-NULL pointer to a handle on success or NULL on "
2337 #: ../src/guestfs.pod:1192
2338 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2342 #: ../src/guestfs.pod:1194
2344 "You may also want to configure error handling for the handle. See L</ERROR "
2345 "HANDLING> section below."
2349 #: ../src/guestfs.pod:1197
2350 msgid "guestfs_close"
2354 #: ../src/guestfs.pod:1199
2357 " void guestfs_close (guestfs_h *g);\n"
2362 #: ../src/guestfs.pod:1201
2363 msgid "This closes the connection handle and frees up all resources used."
2367 #: ../src/guestfs.pod:1203
2368 msgid "ERROR HANDLING"
2372 #: ../src/guestfs.pod:1205
2374 "API functions can return errors. For example, almost all functions that "
2375 "return C<int> will return C<-1> to indicate an error."
2379 #: ../src/guestfs.pod:1208
2381 "Additional information is available for errors: an error message string and "
2382 "optionally an error number (errno) if the thing that failed was a system "
2387 #: ../src/guestfs.pod:1212
2389 "You can get at the additional information about the last error on the handle "
2390 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2391 "up an error handler with L</guestfs_set_error_handler>."
2395 #: ../src/guestfs.pod:1217
2397 "When the handle is created, a default error handler is installed which "
2398 "prints the error message string to C<stderr>. For small short-running "
2399 "command line programs it is sufficient to do:"
2403 #: ../src/guestfs.pod:1221
2406 " if (guestfs_launch (g) == -1)\n"
2407 " exit (EXIT_FAILURE);\n"
2412 #: ../src/guestfs.pod:1224
2414 "since the default error handler will ensure that an error message has been "
2415 "printed to C<stderr> before the program exits."
2419 #: ../src/guestfs.pod:1227
2421 "For other programs the caller will almost certainly want to install an "
2422 "alternate error handler or do error handling in-line like this:"
2426 #: ../src/guestfs.pod:1230
2429 " g = guestfs_create ();\n"
2434 #: ../src/guestfs.pod:1232
2437 " /* This disables the default behaviour of printing errors\n"
2439 " guestfs_set_error_handler (g, NULL, NULL);\n"
2444 #: ../src/guestfs.pod:1236
2447 " if (guestfs_launch (g) == -1) {\n"
2448 " /* Examine the error message and print it etc. */\n"
2449 " char *msg = guestfs_last_error (g);\n"
2450 " int errnum = guestfs_last_errno (g);\n"
2451 " fprintf (stderr, \"%s\\n\", msg);\n"
2458 #: ../src/guestfs.pod:1244
2460 "Out of memory errors are handled differently. The default action is to call "
2461 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2462 "guestfs_set_out_of_memory_handler>."
2466 #: ../src/guestfs.pod:1248
2468 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2469 "because there is no handle if this happens there is no way to get additional "
2470 "error information. However L</guestfs_create> is supposed to be a "
2471 "lightweight operation which can only fail because of insufficient memory (it "
2472 "returns NULL in this case)."
2476 #: ../src/guestfs.pod:1254
2477 msgid "guestfs_last_error"
2481 #: ../src/guestfs.pod:1256
2484 " const char *guestfs_last_error (guestfs_h *g);\n"
2489 #: ../src/guestfs.pod:1258
2491 "This returns the last error message that happened on C<g>. If there has not "
2492 "been an error since the handle was created, then this returns C<NULL>."
2496 #: ../src/guestfs.pod:1262
2498 "The lifetime of the returned string is until the next error occurs, or L</"
2499 "guestfs_close> is called."
2503 #: ../src/guestfs.pod:1265
2504 msgid "guestfs_last_errno"
2508 #: ../src/guestfs.pod:1267
2511 " int guestfs_last_errno (guestfs_h *g);\n"
2516 #: ../src/guestfs.pod:1269
2517 msgid "This returns the last error number (errno) that happened on C<g>."
2521 #: ../src/guestfs.pod:1271
2522 msgid "If successful, an errno integer not equal to zero is returned."
2526 #: ../src/guestfs.pod:1273
2528 "If no error, this returns 0. This call can return 0 in three situations:"
2532 #: ../src/guestfs.pod:1280
2533 msgid "There has not been any error on the handle."
2537 #: ../src/guestfs.pod:1284
2539 "There has been an error but the errno was meaningless. This corresponds to "
2540 "the case where the error did not come from a failed system call, but for "
2541 "some other reason."
2545 #: ../src/guestfs.pod:1290
2547 "There was an error from a failed system call, but for some reason the errno "
2548 "was not captured and returned. This usually indicates a bug in libguestfs."
2552 #: ../src/guestfs.pod:1296
2554 "Libguestfs tries to convert the errno from inside the applicance into a "
2555 "corresponding errno for the caller (not entirely trivial: the appliance "
2556 "might be running a completely different operating system from the library "
2557 "and error numbers are not standardized across Un*xen). If this could not be "
2558 "done, then the error is translated to C<EINVAL>. In practice this should "
2559 "only happen in very rare circumstances."
2563 #: ../src/guestfs.pod:1304
2564 msgid "guestfs_set_error_handler"
2568 #: ../src/guestfs.pod:1306
2571 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2573 " const char *msg);\n"
2574 " void guestfs_set_error_handler (guestfs_h *g,\n"
2575 " guestfs_error_handler_cb cb,\n"
2581 #: ../src/guestfs.pod:1313
2583 "The callback C<cb> will be called if there is an error. The parameters "
2584 "passed to the callback are an opaque data pointer and the error message "
2589 #: ../src/guestfs.pod:1317
2591 "C<errno> is not passed to the callback. To get that the callback must call "
2592 "L</guestfs_last_errno>."
2596 #: ../src/guestfs.pod:1320
2598 "Note that the message string C<msg> is freed as soon as the callback "
2599 "function returns, so if you want to stash it somewhere you must make your "
2604 #: ../src/guestfs.pod:1324
2605 msgid "The default handler prints messages on C<stderr>."
2609 #: ../src/guestfs.pod:1326
2610 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2614 #: ../src/guestfs.pod:1328
2615 msgid "guestfs_get_error_handler"
2619 #: ../src/guestfs.pod:1330
2622 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2623 " void **opaque_rtn);\n"
2628 #: ../src/guestfs.pod:1333
2629 msgid "Returns the current error handler callback."
2633 #: ../src/guestfs.pod:1335
2634 msgid "guestfs_set_out_of_memory_handler"
2638 #: ../src/guestfs.pod:1337
2641 " typedef void (*guestfs_abort_cb) (void);\n"
2642 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2643 " guestfs_abort_cb);\n"
2648 #: ../src/guestfs.pod:1341
2650 "The callback C<cb> will be called if there is an out of memory situation. "
2651 "I<Note this callback must not return>."
2655 #: ../src/guestfs.pod:1344
2656 msgid "The default is to call L<abort(3)>."
2660 #: ../src/guestfs.pod:1346
2662 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2666 #: ../src/guestfs.pod:1349
2667 msgid "guestfs_get_out_of_memory_handler"
2671 #: ../src/guestfs.pod:1351
2674 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2679 #: ../src/guestfs.pod:1353
2680 msgid "This returns the current out of memory handler."
2684 #: ../src/guestfs.pod:1355
2689 #: ../src/guestfs.pod:1357 ../fish/guestfish.pod:908
2694 #: ../src/guestfs.pod:1359
2699 #: ../src/guestfs.pod:1361
2704 #: ../src/guestfs.pod:1363
2705 msgid "AVAILABILITY"
2709 #: ../src/guestfs.pod:1365
2710 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2714 #: ../src/guestfs.pod:1367
2716 "Using L</guestfs_available> you can test availability of the following "
2717 "groups of functions. This test queries the appliance to see if the "
2718 "appliance you are currently using supports the functionality."
2722 #: ../src/guestfs.pod:1372
2723 msgid "@AVAILABILITY@"
2727 #: ../src/guestfs.pod:1374
2728 msgid "GUESTFISH supported COMMAND"
2732 #: ../src/guestfs.pod:1376
2734 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2735 "prints out the available groups and whether they are supported by this build "
2736 "of libguestfs. Note however that you have to do C<run> first."
2740 #: ../src/guestfs.pod:1381
2741 msgid "SINGLE CALLS AT COMPILE TIME"
2745 #: ../src/guestfs.pod:1383
2747 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2748 "function, such as:"
2752 #: ../src/guestfs.pod:1386
2755 " #define LIBGUESTFS_HAVE_DD 1\n"
2760 #: ../src/guestfs.pod:1388
2761 msgid "if L</guestfs_dd> is available."
2765 #: ../src/guestfs.pod:1390
2767 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2768 "function is available at compile time, we recommended using build tools such "
2769 "as autoconf or cmake. For example in autotools you could use:"
2773 #: ../src/guestfs.pod:1395
2776 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2777 " AC_CHECK_FUNCS([guestfs_dd])\n"
2782 #: ../src/guestfs.pod:1398
2784 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2789 #: ../src/guestfs.pod:1401
2790 msgid "SINGLE CALLS AT RUN TIME"
2794 #: ../src/guestfs.pod:1403
2796 "Testing at compile time doesn't guarantee that a function really exists in "
2797 "the library. The reason is that you might be dynamically linked against a "
2798 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2799 "This situation unfortunately results in a segmentation fault, which is a "
2800 "shortcoming of the C dynamic linking system itself."
2804 #: ../src/guestfs.pod:1410
2806 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2807 "in this example program (note that you still need the compile time check as "
2812 #: ../src/guestfs.pod:1414
2815 " #include <stdio.h>\n"
2816 " #include <stdlib.h>\n"
2817 " #include <unistd.h>\n"
2818 " #include <dlfcn.h>\n"
2819 " #include <guestfs.h>\n"
2824 #: ../src/guestfs.pod:1420
2829 " #ifdef LIBGUESTFS_HAVE_DD\n"
2831 " int has_function;\n"
2836 #: ../src/guestfs.pod:1426
2839 " /* Test if the function guestfs_dd is really available. */\n"
2840 " dl = dlopen (NULL, RTLD_LAZY);\n"
2842 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2843 " exit (EXIT_FAILURE);\n"
2845 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2851 #: ../src/guestfs.pod:1435
2854 " if (!has_function)\n"
2855 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2857 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2858 " /* Now it's safe to call\n"
2859 " guestfs_dd (g, \"foo\", \"bar\");\n"
2863 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2870 #: ../src/guestfs.pod:1448
2872 "You may think the above is an awful lot of hassle, and it is. There are "
2873 "other ways outside of the C linking system to ensure that this kind of "
2874 "incompatibility never arises, such as using package versioning:"
2878 #: ../src/guestfs.pod:1453
2881 " Requires: libguestfs >= 1.0.80\n"
2886 #: ../src/guestfs.pod:1455
2887 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2891 #: ../src/guestfs.pod:1457
2893 "A recent feature of the API is the introduction of calls which take optional "
2894 "arguments. In C these are declared 3 ways. The main way is as a call which "
2895 "takes variable arguments (ie. C<...>), as in this example:"
2899 #: ../src/guestfs.pod:1462
2902 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2907 #: ../src/guestfs.pod:1464
2909 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2910 "call with no optional arguments specified:"
2914 #: ../src/guestfs.pod:1467
2917 " guestfs_add_drive_opts (g, filename, -1);\n"
2922 #: ../src/guestfs.pod:1469
2923 msgid "With a single optional argument:"
2927 #: ../src/guestfs.pod:1471
2930 " guestfs_add_drive_opts (g, filename,\n"
2931 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2937 #: ../src/guestfs.pod:1475
2942 #: ../src/guestfs.pod:1477
2945 " guestfs_add_drive_opts (g, filename,\n"
2946 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2947 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2953 #: ../src/guestfs.pod:1482
2955 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2960 #: ../src/guestfs.pod:1485
2961 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2965 #: ../src/guestfs.pod:1487
2967 "The second variant has the same name with the suffix C<_va>, which works the "
2968 "same way but takes a C<va_list>. See the C manual for details. For the "
2969 "example function, this is declared:"
2973 #: ../src/guestfs.pod:1491
2976 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2982 #: ../src/guestfs.pod:1494
2983 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2987 #: ../src/guestfs.pod:1496
2989 "The third variant is useful where you need to construct these calls. You "
2990 "pass in a structure where you fill in the optional fields. The structure "
2991 "has a bitmask as the first element which you must set to indicate which "
2992 "fields you have filled in. For our example function the structure and call "
2997 #: ../src/guestfs.pod:1502
3000 " struct guestfs_add_drive_opts_argv {\n"
3001 " uint64_t bitmask;\n"
3003 " const char *format;\n"
3006 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3007 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3012 #: ../src/guestfs.pod:1511
3013 msgid "You could call it like this:"
3017 #: ../src/guestfs.pod:1513
3020 " struct guestfs_add_drive_opts_argv optargs = {\n"
3021 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3022 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3024 " .format = \"qcow2\"\n"
3030 #: ../src/guestfs.pod:1520
3033 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3038 #: ../src/guestfs.pod:1522 ../src/guestfs-actions.pod:11
3039 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:9
3040 #: ../fish/guestfish-actions.pod:1255
3045 #: ../src/guestfs.pod:1528
3046 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3050 #: ../src/guestfs.pod:1533
3051 msgid "You do not need to fill in all fields of the structure."
3055 #: ../src/guestfs.pod:1537
3057 "There must be a one-to-one correspondence between fields of the structure "
3058 "that are filled in, and bits set in the bitmask."
3062 #: ../src/guestfs.pod:1542
3063 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3067 #: ../src/guestfs.pod:1544
3069 "In other languages, optional arguments are expressed in the way that is "
3070 "natural for that language. We refer you to the language-specific "
3071 "documentation for more details on that."
3075 #: ../src/guestfs.pod:1548
3076 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3080 #: ../src/guestfs.pod:1550
3081 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3085 #: ../src/guestfs.pod:1552
3087 "The child process generates events in some situations. Current events "
3088 "include: receiving a log message, the child process exits."
3092 #: ../src/guestfs.pod:1555
3094 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3099 #: ../src/guestfs.pod:1558
3101 "Only I<one callback of each type> can be registered for each handle. "
3102 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3103 "that type. Cancel all callbacks of this type by calling this function with "
3104 "C<cb> set to C<NULL>."
3108 #: ../src/guestfs.pod:1563
3109 msgid "guestfs_set_log_message_callback"
3113 #: ../src/guestfs.pod:1565
3116 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3117 " char *buf, int len);\n"
3118 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3119 " guestfs_log_message_cb cb,\n"
3125 #: ../src/guestfs.pod:1571
3127 "The callback function C<cb> will be called whenever qemu or the guest writes "
3128 "anything to the console."
3132 #: ../src/guestfs.pod:1574
3133 msgid "Use this function to capture kernel messages and similar."
3137 #: ../src/guestfs.pod:1576
3139 "Normally there is no log message handler, and log messages are just "
3144 #: ../src/guestfs.pod:1579
3145 msgid "guestfs_set_subprocess_quit_callback"
3149 #: ../src/guestfs.pod:1581
3152 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3153 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3154 " guestfs_subprocess_quit_cb cb,\n"
3160 #: ../src/guestfs.pod:1586
3162 "The callback function C<cb> will be called when the child process quits, "
3163 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3164 "corresponds to a transition from any state to the CONFIG state)."
3168 #: ../src/guestfs.pod:1591
3169 msgid "guestfs_set_launch_done_callback"
3173 #: ../src/guestfs.pod:1593
3176 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3177 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3178 " guestfs_launch_done_cb cb,\n"
3184 #: ../src/guestfs.pod:1598
3186 "The callback function C<cb> will be called when the child process becomes "
3187 "ready first time after it has been launched. (This corresponds to a "
3188 "transition from LAUNCHING to the READY state)."
3192 #: ../src/guestfs.pod:1602
3193 msgid "guestfs_set_close_callback"
3197 #: ../src/guestfs.pod:1604
3200 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3201 " void guestfs_set_close_callback (guestfs_h *g,\n"
3202 " guestfs_close_cb cb,\n"
3208 #: ../src/guestfs.pod:1609
3210 "The callback function C<cb> will be called while the handle is being closed "
3211 "(synchronously from L</guestfs_close>)."
3215 #: ../src/guestfs.pod:1612
3217 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3218 "handles that are open when the program exits. This means that this callback "
3219 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3220 "problems in higher-level languages (eg. if your HLL interpreter has already "
3221 "been cleaned up by the time this is called, and if your callback then jumps "
3222 "into some HLL function)."
3226 #: ../src/guestfs.pod:1620
3227 msgid "guestfs_set_progress_callback"
3231 #: ../src/guestfs.pod:1622
3234 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3235 " int proc_nr, int serial,\n"
3236 " uint64_t position, uint64_t total);\n"
3237 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3238 " guestfs_progress_cb cb,\n"
3244 #: ../src/guestfs.pod:1629
3246 "Some long-running operations can generate progress messages. If this "
3247 "callback is registered, then it will be called each time a progress message "
3248 "is generated (usually two seconds after the operation started, and three "
3249 "times per second thereafter until it completes, although the frequency may "
3250 "change in future versions)."
3254 #: ../src/guestfs.pod:1635
3256 "The callback receives two numbers: C<position> and C<total>. The units of "
3257 "C<total> are not defined, although for some operations C<total> may relate "
3258 "in some way to the amount of data to be transferred (eg. in bytes or "
3259 "megabytes), and C<position> may be the portion which has been transferred."
3263 #: ../src/guestfs.pod:1641
3264 msgid "The only defined and stable parts of the API are:"
3268 #: ../src/guestfs.pod:1647
3270 "The callback can display to the user some type of progress bar or indicator "
3271 "which shows the ratio of C<position>:C<total>."
3275 #: ../src/guestfs.pod:1652
3276 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3280 #: ../src/guestfs.pod:1656
3282 "If any progress notification is sent during a call, then a final progress "
3283 "notification is always sent when C<position> = C<total>."
3287 #: ../src/guestfs.pod:1659
3289 "This is to simplify caller code, so callers can easily set the progress "
3290 "indicator to \"100%\" at the end of the operation, without requiring special "
3291 "code to detect this case."
3295 #: ../src/guestfs.pod:1665
3297 "The callback also receives the procedure number and serial number of the "
3298 "call. These are only useful for debugging protocol issues, and the callback "
3299 "can normally ignore them. The callback may want to print these numbers in "
3300 "error messages or debugging messages."
3304 #: ../src/guestfs.pod:1670
3305 msgid "PRIVATE DATA AREA"
3309 #: ../src/guestfs.pod:1672
3311 "You can attach named pieces of private data to the libguestfs handle, and "
3312 "fetch them by name for the lifetime of the handle. This is called the "
3313 "private data area and is only available from the C API."
3317 #: ../src/guestfs.pod:1676
3318 msgid "To attach a named piece of data, use the following call:"
3322 #: ../src/guestfs.pod:1678
3325 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3330 #: ../src/guestfs.pod:1680
3332 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3333 "pointer (which can be C<NULL>). Any previous item with the same name is "
3338 #: ../src/guestfs.pod:1684
3340 "You can use any C<key> you want, but names beginning with an underscore "
3341 "character are reserved for internal libguestfs purposes (for implementing "
3342 "language bindings). It is recommended to prefix the name with some unique "
3343 "string to avoid collisions with other users."
3347 #: ../src/guestfs.pod:1689
3348 msgid "To retrieve the pointer, use:"
3352 #: ../src/guestfs.pod:1691
3355 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3360 #: ../src/guestfs.pod:1693
3362 "This function returns C<NULL> if either no data is found associated with "
3363 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3368 #: ../src/guestfs.pod:1697
3370 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3371 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3372 "all. In particular, libguestfs does I<not> try to free the data when the "
3373 "handle is closed. If the data must be freed, then the caller must either "
3374 "free it before calling L</guestfs_close> or must set up a close callback to "
3375 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3376 "can be registered for a handle)."
3380 #: ../src/guestfs.pod:1705
3382 "The private data area is implemented using a hash table, and should be "
3383 "reasonably efficient for moderate numbers of keys."
3387 #: ../src/guestfs.pod:1708 ../src/guestfs.pod:1713
3392 #: ../src/guestfs.pod:1710
3394 "<!-- old anchor for the next section --> <a name="
3395 "\"state_machine_and_low_level_event_api\"/>"
3399 #: ../src/guestfs.pod:1715
3400 msgid "ARCHITECTURE"
3404 #: ../src/guestfs.pod:1717
3406 "Internally, libguestfs is implemented by running an appliance (a special "
3407 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3408 "process of the main program."
3412 #: ../src/guestfs.pod:1721
3415 " ___________________\n"
3417 " | main program |\n"
3419 " | | child process / appliance\n"
3420 " | | __________________________\n"
3422 " +-------------------+ RPC | +-----------------+ |\n"
3423 " | libguestfs <--------------------> guestfsd | |\n"
3424 " | | | +-----------------+ |\n"
3425 " \\___________________/ | | Linux kernel | |\n"
3426 " | +--^--------------+ |\n"
3427 " \\_________|________________/\n"
3433 " \\______________/\n"
3438 #: ../src/guestfs.pod:1741
3440 "The library, linked to the main program, creates the child process and hence "
3441 "the appliance in the L</guestfs_launch> function."
3445 #: ../src/guestfs.pod:1744
3447 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3448 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3449 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3450 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3451 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3452 "attached to the qemu process which translates device access by the "
3453 "appliance's Linux kernel into accesses to the image."
3457 #: ../src/guestfs.pod:1753
3459 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3460 "Although the disk image you are attached to might also be used by some "
3461 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3462 "care if both libguestfs's qemu process and your virtual machine are trying "
3463 "to update the disk image at the same time, since these usually results in "
3464 "massive disk corruption)."
3468 #: ../src/guestfs.pod:1760
3469 msgid "STATE MACHINE"
3473 #: ../src/guestfs.pod:1762
3474 msgid "libguestfs uses a state machine to model the child process:"
3478 #: ../src/guestfs.pod:1764
3490 " / | \\ \\ guestfs_launch\n"
3491 " / | _\\__V______\n"
3493 " / | | LAUNCHING |\n"
3494 " / | \\___________/\n"
3496 " / | guestfs_launch\n"
3498 " ______ / __|____V\n"
3499 " / \\ ------> / \\\n"
3500 " | BUSY | | READY |\n"
3501 " \\______/ <------ \\________/\n"
3506 #: ../src/guestfs.pod:1786
3508 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3509 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3510 "(3) alternating between READY and BUSY as commands are issued to, and "
3511 "carried out by, the child process."
3515 #: ../src/guestfs.pod:1791
3517 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3518 "asynchronously at any time (eg. due to some internal error), and that causes "
3519 "the state to transition back to CONFIG."
3523 #: ../src/guestfs.pod:1795
3525 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3526 "issued when in the CONFIG state."
3530 #: ../src/guestfs.pod:1798
3532 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3533 "L</guestfs_launch> blocks until the child process is READY to accept "
3534 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3535 "moves the state from CONFIG to LAUNCHING while it is running."
3539 #: ../src/guestfs.pod:1804
3541 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3542 "state. These API calls block waiting for the command to be carried out (ie. "
3543 "the state to transition to BUSY and then back to READY). There are no non-"
3544 "blocking versions, and no way to issue more than one command per handle at "
3549 #: ../src/guestfs.pod:1810
3551 "Finally, the child process sends asynchronous messages back to the main "
3552 "program, such as kernel log messages. You can register a callback to "
3553 "receive these messages."
3557 #: ../src/guestfs.pod:1814
3562 #: ../src/guestfs.pod:1816
3563 msgid "COMMUNICATION PROTOCOL"
3567 #: ../src/guestfs.pod:1818
3569 "Don't rely on using this protocol directly. This section documents how it "
3570 "currently works, but it may change at any time."
3574 #: ../src/guestfs.pod:1821
3576 "The protocol used to talk between the library and the daemon running inside "
3577 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3578 "1014, RFC 1832, RFC 4506)."
3582 #: ../src/guestfs.pod:1825
3584 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3585 "this file is automatically generated)."
3589 #: ../src/guestfs.pod:1828
3591 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3592 "and C<FileOut> parameters, which are handled with very simple request/reply "
3593 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3594 "parameters, which use the same request and reply messages, but they may also "
3595 "be followed by files sent using a chunked encoding."
3599 #: ../src/guestfs.pod:1835
3600 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3604 #: ../src/guestfs.pod:1837
3605 msgid "For ordinary functions, the request message is:"
3609 #: ../src/guestfs.pod:1839
3612 " total length (header + arguments,\n"
3613 " but not including the length word itself)\n"
3614 " struct guestfs_message_header (encoded as XDR)\n"
3615 " struct guestfs_<foo>_args (encoded as XDR)\n"
3620 #: ../src/guestfs.pod:1844
3622 "The total length field allows the daemon to allocate a fixed size buffer "
3623 "into which it slurps the rest of the message. As a result, the total length "
3624 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3625 "effective size of any request is limited to somewhere under this size."
3629 #: ../src/guestfs.pod:1850
3631 "Note also that many functions don't take any arguments, in which case the "
3632 "C<guestfs_I<foo>_args> is completely omitted."
3636 #: ../src/guestfs.pod:1853
3638 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3639 "receiver knows what type of args structure to expect, or none at all."
3643 #: ../src/guestfs.pod:1857
3645 "For functions that take optional arguments, the optional arguments are "
3646 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3647 "arguments. A bitmask in the header indicates which optional arguments are "
3648 "meaningful. The bitmask is also checked to see if it contains bits set "
3649 "which the daemon does not know about (eg. if more optional arguments were "
3650 "added in a later version of the library), and this causes the call to be "
3655 #: ../src/guestfs.pod:1865
3656 msgid "The reply message for ordinary functions is:"
3660 #: ../src/guestfs.pod:1867
3663 " total length (header + ret,\n"
3664 " but not including the length word itself)\n"
3665 " struct guestfs_message_header (encoded as XDR)\n"
3666 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3671 #: ../src/guestfs.pod:1872
3673 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3674 "functions that return no formal return values."
3678 #: ../src/guestfs.pod:1875
3680 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3684 #: ../src/guestfs.pod:1878
3686 "In the case of an error, a flag is set in the header, and the reply message "
3687 "is slightly changed:"
3691 #: ../src/guestfs.pod:1881
3694 " total length (header + error,\n"
3695 " but not including the length word itself)\n"
3696 " struct guestfs_message_header (encoded as XDR)\n"
3697 " struct guestfs_message_error (encoded as XDR)\n"
3702 #: ../src/guestfs.pod:1886
3704 "The C<guestfs_message_error> structure contains the error message as a "
3709 #: ../src/guestfs.pod:1889
3710 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3714 #: ../src/guestfs.pod:1891
3716 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3717 "The normal request message is sent (see above). However this is followed by "
3718 "a sequence of file chunks."
3722 #: ../src/guestfs.pod:1895
3725 " total length (header + arguments,\n"
3726 " but not including the length word itself,\n"
3727 " and not including the chunks)\n"
3728 " struct guestfs_message_header (encoded as XDR)\n"
3729 " struct guestfs_<foo>_args (encoded as XDR)\n"
3730 " sequence of chunks for FileIn param #0\n"
3731 " sequence of chunks for FileIn param #1 etc.\n"
3736 #: ../src/guestfs.pod:1903
3737 msgid "The \"sequence of chunks\" is:"
3741 #: ../src/guestfs.pod:1905
3744 " length of chunk (not including length word itself)\n"
3745 " struct guestfs_chunk (encoded as XDR)\n"
3746 " length of chunk\n"
3747 " struct guestfs_chunk (encoded as XDR)\n"
3749 " length of chunk\n"
3750 " struct guestfs_chunk (with data.data_len == 0)\n"
3755 #: ../src/guestfs.pod:1913
3757 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3758 "is set in the final chunk to indicate either successful completion or early "
3763 #: ../src/guestfs.pod:1917
3765 "At time of writing there are no functions that have more than one FileIn "
3766 "parameter. However this is (theoretically) supported, by sending the "
3767 "sequence of chunks for each FileIn parameter one after another (from left to "
3772 #: ../src/guestfs.pod:1922
3774 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3775 "transfer. The library does this by sending a chunk with a special flag set "
3776 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3777 "RPC, does I<not> send any reply, and goes back to reading the next request."
3781 #: ../src/guestfs.pod:1928
3783 "The daemon may also cancel. It does this by writing a special word "
3784 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3785 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3786 "cancel chunk). The special word is chosen so that even if cancellation "
3787 "happens right at the end of the transfer (after the library has finished "
3788 "writing and has started listening for the reply), the \"spurious\" cancel "
3789 "flag will not be confused with the reply message."
3793 #: ../src/guestfs.pod:1937
3795 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3796 "limit), and also files where the size is not known in advance (eg. from "
3797 "pipes or sockets). However the chunks are rather small "
3798 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3799 "to keep much in memory."
3803 #: ../src/guestfs.pod:1943
3804 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3808 #: ../src/guestfs.pod:1945
3810 "The protocol for FileOut parameters is exactly the same as for FileIn "
3811 "parameters, but with the roles of daemon and library reversed."
3815 #: ../src/guestfs.pod:1948
3818 " total length (header + ret,\n"
3819 " but not including the length word itself,\n"
3820 " and not including the chunks)\n"
3821 " struct guestfs_message_header (encoded as XDR)\n"
3822 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3823 " sequence of chunks for FileOut param #0\n"
3824 " sequence of chunks for FileOut param #1 etc.\n"
3829 #: ../src/guestfs.pod:1956
3830 msgid "INITIAL MESSAGE"
3834 #: ../src/guestfs.pod:1958
3836 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3837 "which indicates that the guest and daemon is alive. This is what L</"
3838 "guestfs_launch> waits for."
3842 #: ../src/guestfs.pod:1962
3843 msgid "PROGRESS NOTIFICATION MESSAGES"
3847 #: ../src/guestfs.pod:1964
3849 "The daemon may send progress notification messages at any time. These are "
3850 "distinguished by the normal length word being replaced by "
3851 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3855 #: ../src/guestfs.pod:1968
3857 "The library turns them into progress callbacks (see "
3858 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3859 "discards them if not."
3863 #: ../src/guestfs.pod:1972
3865 "The daemon self-limits the frequency of progress messages it sends (see "
3866 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3871 #: ../src/guestfs.pod:1976
3872 msgid "LIBGUESTFS VERSION NUMBERS"
3876 #: ../src/guestfs.pod:1978
3878 "Since April 2010, libguestfs has started to make separate development and "
3879 "stable releases, along with corresponding branches in our git repository. "
3880 "These separate releases can be identified by version number:"
3884 #: ../src/guestfs.pod:1983
3887 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3888 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3894 " | `-------- sub-version\n"
3896 " `------ always '1' because we don't change the ABI\n"
3901 #: ../src/guestfs.pod:1994
3902 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3906 #: ../src/guestfs.pod:1996
3908 "As time passes we cherry pick fixes from the development branch and backport "
3909 "those into the stable branch, the effect being that the stable branch should "
3910 "get more stable and less buggy over time. So the stable releases are ideal "
3911 "for people who don't need new features but would just like the software to "
3916 #: ../src/guestfs.pod:2002
3917 msgid "Our criteria for backporting changes are:"
3921 #: ../src/guestfs.pod:2008
3923 "Documentation changes which don't affect any code are backported unless the "
3924 "documentation refers to a future feature which is not in stable."
3928 #: ../src/guestfs.pod:2014
3930 "Bug fixes which are not controversial, fix obvious problems, and have been "
3931 "well tested are backported."
3935 #: ../src/guestfs.pod:2019
3937 "Simple rearrangements of code which shouldn't affect how it works get "
3938 "backported. This is so that the code in the two branches doesn't get too "
3939 "far out of step, allowing us to backport future fixes more easily."
3943 #: ../src/guestfs.pod:2025
3945 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3946 "exceptional case: the new feature is required in order to implement an "
3947 "important bug fix."
3951 #: ../src/guestfs.pod:2031
3953 "A new stable branch starts when we think the new features in development are "
3954 "substantial and compelling enough over the current stable branch to warrant "
3955 "it. When that happens we create new stable and development versions 1.N.0 "
3956 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3957 "stable at this point, but by backporting fixes from development, that branch "
3958 "will stabilize over time."
3962 #: ../src/guestfs.pod:2039 ../fish/guestfish.pod:915
3963 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3964 msgid "ENVIRONMENT VARIABLES"
3968 #: ../src/guestfs.pod:2043 ../fish/guestfish.pod:941
3969 msgid "LIBGUESTFS_APPEND"
3973 #: ../src/guestfs.pod:2045 ../fish/guestfish.pod:943
3974 msgid "Pass additional options to the guest kernel."
3978 #: ../src/guestfs.pod:2047 ../fish/guestfish.pod:945
3979 msgid "LIBGUESTFS_DEBUG"
3983 #: ../src/guestfs.pod:2049
3985 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3986 "effect as calling C<guestfs_set_verbose (g, 1)>."
3990 #: ../src/guestfs.pod:2052 ../fish/guestfish.pod:950
3991 msgid "LIBGUESTFS_MEMSIZE"
3995 #: ../src/guestfs.pod:2054 ../fish/guestfish.pod:952
3997 "Set the memory allocated to the qemu process, in megabytes. For example:"
4001 #: ../src/guestfs.pod:2057 ../fish/guestfish.pod:955
4004 " LIBGUESTFS_MEMSIZE=700\n"
4009 #: ../src/guestfs.pod:2059 ../fish/guestfish.pod:957
4010 msgid "LIBGUESTFS_PATH"
4014 #: ../src/guestfs.pod:2061
4016 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4017 "the discussion of paths in section PATH above."
4021 #: ../src/guestfs.pod:2064 ../fish/guestfish.pod:962
4022 msgid "LIBGUESTFS_QEMU"
4026 #: ../src/guestfs.pod:2066 ../fish/guestfish.pod:964
4028 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4029 "which was found at compile time by the configure script is used."
4033 #: ../src/guestfs.pod:2070
4034 msgid "See also L</QEMU WRAPPERS> above."
4038 #: ../src/guestfs.pod:2072 ../fish/guestfish.pod:968
4039 msgid "LIBGUESTFS_TRACE"
4043 #: ../src/guestfs.pod:2074
4045 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4046 "effect as calling C<guestfs_set_trace (g, 1)>."
4050 #: ../src/guestfs.pod:2077 ../fish/guestfish.pod:977
4055 #: ../src/guestfs.pod:2079 ../fish/guestfish.pod:979
4056 msgid "Location of temporary directory, defaults to C</tmp>."
4060 #: ../src/guestfs.pod:2081 ../fish/guestfish.pod:981
4062 "If libguestfs was compiled to use the supermin appliance then the real "
4063 "appliance is cached in this directory, shared between all handles belonging "
4064 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4065 "use in case C</tmp> is not large enough."
4069 #: ../src/guestfs.pod:2089 ../fish/guestfish.pod:1039
4070 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4071 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484
4072 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
4073 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534
4074 #: ../tools/virt-list-partitions.pl:257
4079 #: ../src/guestfs.pod:2091
4081 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
4082 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
4083 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
4084 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
4085 ">, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
4086 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
4090 #: ../src/guestfs.pod:2114
4092 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4093 "(8)>, L<disktype(1)>."
4097 #: ../src/guestfs.pod:2121 ../tools/virt-win-reg.pl:499
4098 #: ../tools/virt-make-fs.pl:548
4103 #: ../src/guestfs.pod:2123
4104 msgid "To get a list of bugs against libguestfs use this link:"
4108 #: ../src/guestfs.pod:2125
4110 "L<https://bugzilla.redhat.com/buglist.cgi?"
4111 "component=libguestfs&product=Virtualization+Tools>"
4115 #: ../src/guestfs.pod:2127
4116 msgid "To report a new bug against libguestfs use this link:"
4120 #: ../src/guestfs.pod:2129
4122 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4123 "component=libguestfs&product=Virtualization+Tools>"
4127 #: ../src/guestfs.pod:2131
4128 msgid "When reporting a bug, please check:"
4132 #: ../src/guestfs.pod:2137
4133 msgid "That the bug hasn't been reported already."
4137 #: ../src/guestfs.pod:2141
4138 msgid "That you are testing a recent version."
4142 #: ../src/guestfs.pod:2145
4143 msgid "Describe the bug accurately, and give a way to reproduce it."
4147 #: ../src/guestfs.pod:2149
4149 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4154 #: ../src/guestfs.pod:2154 ../fish/guestfish.pod:1058
4155 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4160 #: ../src/guestfs.pod:2156 ../fish/guestfish.pod:1060
4161 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4162 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4166 #: ../src/guestfs.pod:2158 ../fish/guestfish.pod:1062
4167 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4168 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514
4169 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
4170 #: ../tools/virt-tar.pl:296 ../tools/virt-make-fs.pl:563
4171 #: ../tools/virt-list-partitions.pl:273
4176 #: ../src/guestfs.pod:2160 ../fish/guestfish.pod:1064
4177 #: ../fuse/guestmount.pod:250
4178 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4182 #: ../src/guestfs.pod:2163
4184 "This library is free software; you can redistribute it and/or modify it "
4185 "under the terms of the GNU Lesser General Public License as published by the "
4186 "Free Software Foundation; either version 2 of the License, or (at your "
4187 "option) any later version."
4191 #: ../src/guestfs.pod:2168
4193 "This library is distributed in the hope that it will be useful, but WITHOUT "
4194 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4195 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4200 #: ../src/guestfs.pod:2173
4202 "You should have received a copy of the GNU Lesser General Public License "
4203 "along with this library; if not, write to the Free Software Foundation, "
4204 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4208 #: ../src/guestfs-actions.pod:1
4209 msgid "guestfs_add_cdrom"
4213 #: ../src/guestfs-actions.pod:3
4217 " guestfs_add_cdrom (guestfs_h *g,\n"
4218 " const char *filename);\n"
4223 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4224 msgid "This function adds a virtual CD-ROM disk image to the guest."
4228 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4229 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4233 #: ../src/guestfs-actions.pod:17
4235 "This call checks for the existence of C<filename>. This stops you from "
4236 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4237 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4242 #: ../src/guestfs-actions.pod:24
4244 "If you just want to add an ISO file (often you use this as an efficient way "
4245 "to transfer large files into the guest), then you should probably use "
4246 "C<guestfs_add_drive_ro> instead."
4250 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:128
4251 #: ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:226
4252 #: ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261
4253 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:295
4254 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4255 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:489
4256 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4257 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:635
4258 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:664
4259 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
4260 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
4261 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:990
4262 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1092
4263 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1129
4264 #: ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1163
4265 #: ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264
4266 #: ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1326
4267 #: ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1466
4268 #: ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706
4269 #: ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:2215
4270 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2420
4271 #: ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3194
4272 #: ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3229
4273 #: ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3368
4274 #: ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3395
4275 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3446
4276 #: ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3538
4277 #: ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3578
4278 #: ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3633
4279 #: ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:3671
4280 #: ../src/guestfs-actions.pod:3706 ../src/guestfs-actions.pod:3718
4281 #: ../src/guestfs-actions.pod:3754 ../src/guestfs-actions.pod:3770
4282 #: ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3798
4283 #: ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:3908
4284 #: ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:3941
4285 #: ../src/guestfs-actions.pod:3992 ../src/guestfs-actions.pod:4010
4286 #: ../src/guestfs-actions.pod:4028 ../src/guestfs-actions.pod:4044
4287 #: ../src/guestfs-actions.pod:4058 ../src/guestfs-actions.pod:4072
4288 #: ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4104
4289 #: ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:4168
4290 #: ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4270
4291 #: ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:4308
4292 #: ../src/guestfs-actions.pod:4320 ../src/guestfs-actions.pod:4337
4293 #: ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4365
4294 #: ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4415
4295 #: ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:4450
4296 #: ../src/guestfs-actions.pod:4464 ../src/guestfs-actions.pod:4481
4297 #: ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4567
4298 #: ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4609
4299 #: ../src/guestfs-actions.pod:4626 ../src/guestfs-actions.pod:4644
4300 #: ../src/guestfs-actions.pod:4778 ../src/guestfs-actions.pod:4835
4301 #: ../src/guestfs-actions.pod:4857 ../src/guestfs-actions.pod:4875
4302 #: ../src/guestfs-actions.pod:4907 ../src/guestfs-actions.pod:4973
4303 #: ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5003
4304 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5306
4305 #: ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5339
4306 #: ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5365
4307 #: ../src/guestfs-actions.pod:5377 ../src/guestfs-actions.pod:5391
4308 #: ../src/guestfs-actions.pod:5407 ../src/guestfs-actions.pod:5428
4309 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5466
4310 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5507
4311 #: ../src/guestfs-actions.pod:5525 ../src/guestfs-actions.pod:5544
4312 #: ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5584
4313 #: ../src/guestfs-actions.pod:5601 ../src/guestfs-actions.pod:5629
4314 #: ../src/guestfs-actions.pod:5653 ../src/guestfs-actions.pod:5672
4315 #: ../src/guestfs-actions.pod:5696 ../src/guestfs-actions.pod:5711
4316 #: ../src/guestfs-actions.pod:5726 ../src/guestfs-actions.pod:5745
4317 #: ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:5805
4318 #: ../src/guestfs-actions.pod:5831 ../src/guestfs-actions.pod:5939
4319 #: ../src/guestfs-actions.pod:6060 ../src/guestfs-actions.pod:6072
4320 #: ../src/guestfs-actions.pod:6085 ../src/guestfs-actions.pod:6098
4321 #: ../src/guestfs-actions.pod:6120 ../src/guestfs-actions.pod:6133
4322 #: ../src/guestfs-actions.pod:6146 ../src/guestfs-actions.pod:6159
4323 #: ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6233
4324 #: ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6266
4325 #: ../src/guestfs-actions.pod:6282 ../src/guestfs-actions.pod:6299
4326 #: ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6332
4327 #: ../src/guestfs-actions.pod:6368 ../src/guestfs-actions.pod:6382
4328 #: ../src/guestfs-actions.pod:6423 ../src/guestfs-actions.pod:6436
4329 #: ../src/guestfs-actions.pod:6454 ../src/guestfs-actions.pod:6488
4330 #: ../src/guestfs-actions.pod:6524 ../src/guestfs-actions.pod:6643
4331 #: ../src/guestfs-actions.pod:6661 ../src/guestfs-actions.pod:6675
4332 #: ../src/guestfs-actions.pod:6730 ../src/guestfs-actions.pod:6743
4333 #: ../src/guestfs-actions.pod:6788 ../src/guestfs-actions.pod:6821
4334 #: ../src/guestfs-actions.pod:6875 ../src/guestfs-actions.pod:6901
4335 #: ../src/guestfs-actions.pod:6967 ../src/guestfs-actions.pod:6986
4336 #: ../src/guestfs-actions.pod:7015
4337 msgid "This function returns 0 on success or -1 on error."
4341 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:242
4342 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:28
4343 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4345 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4350 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:245
4351 #: ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:1437
4352 #: ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1944
4353 #: ../src/guestfs-actions.pod:4129 ../src/guestfs-actions.pod:6909
4354 #: ../src/guestfs-actions.pod:7078 ../fish/guestfish-actions.pod:31
4355 #: ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170
4356 #: ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308
4357 #: ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:2778
4358 #: ../fish/guestfish-actions.pod:4580 ../fish/guestfish-actions.pod:4677
4360 "Deprecated functions will not be removed from the API, but the fact that "
4361 "they are deprecated indicates that there are problems with correct use of "
4366 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:130
4367 #: ../src/guestfs-actions.pod:1094 ../src/guestfs-actions.pod:1895
4368 #: ../src/guestfs-actions.pod:1993 ../src/guestfs-actions.pod:2096
4369 #: ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211
4370 #: ../src/guestfs-actions.pod:4417 ../src/guestfs-actions.pod:5486
4371 #: ../src/guestfs-actions.pod:5603 ../src/guestfs-actions.pod:5713
4372 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6301
4373 #: ../src/guestfs-actions.pod:6823
4374 msgid "(Added in 0.3)"
4378 #: ../src/guestfs-actions.pod:41
4379 msgid "guestfs_add_domain"
4383 #: ../src/guestfs-actions.pod:43
4387 " guestfs_add_domain (guestfs_h *g,\n"
4388 " const char *dom,\n"
4394 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:139
4395 #: ../src/guestfs-actions.pod:4143
4397 "You may supply a list of optional arguments to this call. Use zero or more "
4398 "of the following pairs of parameters, and terminate the list with C<-1> on "
4399 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4403 #: ../src/guestfs-actions.pod:53
4406 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4407 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4408 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4413 #: ../src/guestfs-actions.pod:57
4415 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4416 "It works by connecting to libvirt, requesting the domain and domain XML from "
4417 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4422 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4424 "The number of disks added is returned. This operation is atomic: if an "
4425 "error is returned, then no disks are added."
4429 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4431 "This function does some minimal checks to make sure the libvirt domain is "
4432 "not running (unless C<readonly> is true). In a future version we will try "
4433 "to acquire the libvirt lock on each disk."
4437 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4439 "Disks must be accessible locally. This often means that adding disks from a "
4440 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4441 "unless those disks are accessible via the same device path locally too."
4445 #: ../src/guestfs-actions.pod:74
4447 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4448 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4449 "libvirt URI (or one set through an environment variable, see the libvirt "
4450 "documentation for full details). If you are using the C API directly then "
4451 "it is more flexible to create the libvirt connection object yourself, get "
4452 "the domain object, and call C<guestfs_add_libvirt_dom>."
4456 #: ../src/guestfs-actions.pod:82
4458 "The other optional parameters are passed directly through to "
4459 "C<guestfs_add_drive_opts>."
4463 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:338
4464 #: ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:681
4465 #: ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730
4466 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:1309
4467 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1866
4468 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2005
4469 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2083
4470 #: ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2634
4471 #: ../src/guestfs-actions.pod:2655 ../src/guestfs-actions.pod:4553
4472 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:5087
4473 #: ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6409
4474 #: ../src/guestfs-actions.pod:6834 ../src/guestfs-actions.pod:6847
4475 #: ../src/guestfs-actions.pod:6860
4476 msgid "On error this function returns -1."
4480 #: ../src/guestfs-actions.pod:87
4481 msgid "(Added in 1.7.4)"
4485 #: ../src/guestfs-actions.pod:89
4486 msgid "guestfs_add_domain_va"
4490 #: ../src/guestfs-actions.pod:91
4494 " guestfs_add_domain_va (guestfs_h *g,\n"
4495 " const char *dom,\n"
4501 #: ../src/guestfs-actions.pod:96
4502 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4506 #: ../src/guestfs-actions.pod:98 ../src/guestfs-actions.pod:109
4507 #: ../src/guestfs-actions.pod:202 ../src/guestfs-actions.pod:213
4508 #: ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4192
4509 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4513 #: ../src/guestfs-actions.pod:100
4514 msgid "guestfs_add_domain_argv"
4518 #: ../src/guestfs-actions.pod:102
4522 " guestfs_add_domain_argv (guestfs_h *g,\n"
4523 " const char *dom,\n"
4524 " const struct guestfs_add_domain_argv *optargs);\n"
4529 #: ../src/guestfs-actions.pod:107
4530 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4534 #: ../src/guestfs-actions.pod:111
4535 msgid "guestfs_add_drive"
4539 #: ../src/guestfs-actions.pod:113
4543 " guestfs_add_drive (guestfs_h *g,\n"
4544 " const char *filename);\n"
4549 #: ../src/guestfs-actions.pod:117
4551 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4552 "optional parameters, so the disk is added writable, with the format being "
4553 "detected automatically."
4557 #: ../src/guestfs-actions.pod:121
4559 "Automatic detection of the format opens you up to a potential security hole "
4560 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4561 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4562 "you should think about replacing calls to this function with calls to "
4563 "C<guestfs_add_drive_opts>, and specifying the format."
4567 #: ../src/guestfs-actions.pod:132
4568 msgid "guestfs_add_drive_opts"
4572 #: ../src/guestfs-actions.pod:134
4576 " guestfs_add_drive_opts (guestfs_h *g,\n"
4577 " const char *filename,\n"
4583 #: ../src/guestfs-actions.pod:144
4586 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4587 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4588 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4593 #: ../src/guestfs-actions.pod:148 ../fish/guestfish-actions.pod:92
4595 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4596 "The first time you call this function, the disk appears as C</dev/sda>, the "
4597 "second time as C</dev/sdb>, and so on."
4601 #: ../src/guestfs-actions.pod:153 ../fish/guestfish-actions.pod:97
4603 "You don't necessarily need to be root when using libguestfs. However you "
4604 "obviously do need sufficient permissions to access the filename for whatever "
4605 "operations you want to perform (ie. read access if you just want to read the "
4606 "image or write access if you want to modify the image)."
4610 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:103
4611 msgid "This call checks that C<filename> exists."
4615 #: ../src/guestfs-actions.pod:161 ../src/guestfs-actions.pod:4153
4616 #: ../fish/guestfish-actions.pod:105 ../fish/guestfish-actions.pod:2789
4617 msgid "The optional arguments are:"
4621 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
4626 #: ../src/guestfs-actions.pod:167 ../fish/guestfish-actions.pod:111
4628 "If true then the image is treated as read-only. Writes are still allowed, "
4629 "but they are stored in a temporary snapshot overlay which is discarded at "
4630 "the end. The disk that you add is not modified."
4634 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:115
4639 #: ../src/guestfs-actions.pod:173
4641 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4642 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4643 "Possible formats include C<raw> and C<qcow2>."
4647 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:121
4649 "Automatic detection of the format opens you up to a potential security hole "
4650 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4651 "RHBZ#642934. Specifying the format closes this security hole."
4655 #: ../src/guestfs-actions.pod:182 ../fish/guestfish-actions.pod:126
4660 #: ../src/guestfs-actions.pod:184
4662 "This rarely-used option lets you emulate the behaviour of the deprecated "
4663 "C<guestfs_add_drive_with_if> call (q.v.)"
4667 #: ../src/guestfs-actions.pod:191
4668 msgid "(Added in 1.5.23)"
4672 #: ../src/guestfs-actions.pod:193
4673 msgid "guestfs_add_drive_opts_va"
4677 #: ../src/guestfs-actions.pod:195
4681 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4682 " const char *filename,\n"
4688 #: ../src/guestfs-actions.pod:200
4689 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4693 #: ../src/guestfs-actions.pod:204
4694 msgid "guestfs_add_drive_opts_argv"
4698 #: ../src/guestfs-actions.pod:206
4702 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4703 " const char *filename,\n"
4704 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4709 #: ../src/guestfs-actions.pod:211
4710 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4714 #: ../src/guestfs-actions.pod:215
4715 msgid "guestfs_add_drive_ro"
4719 #: ../src/guestfs-actions.pod:217
4723 " guestfs_add_drive_ro (guestfs_h *g,\n"
4724 " const char *filename);\n"
4729 #: ../src/guestfs-actions.pod:221
4731 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4732 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4733 "disk is added read-only, with the format being detected automatically."
4737 #: ../src/guestfs-actions.pod:228
4738 msgid "(Added in 1.0.38)"
4742 #: ../src/guestfs-actions.pod:230
4743 msgid "guestfs_add_drive_ro_with_if"
4747 #: ../src/guestfs-actions.pod:232
4751 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4752 " const char *filename,\n"
4753 " const char *iface);\n"
4758 #: ../src/guestfs-actions.pod:237
4760 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4761 "QEMU interface emulation to use at run time."
4765 #: ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
4766 #: ../src/guestfs-actions.pod:2305
4767 msgid "(Added in 1.0.84)"
4771 #: ../src/guestfs-actions.pod:251
4772 msgid "guestfs_add_drive_with_if"
4776 #: ../src/guestfs-actions.pod:253
4780 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4781 " const char *filename,\n"
4782 " const char *iface);\n"
4787 #: ../src/guestfs-actions.pod:258
4789 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4790 "QEMU interface emulation to use at run time."
4794 #: ../src/guestfs-actions.pod:272
4795 msgid "guestfs_aug_clear"
4799 #: ../src/guestfs-actions.pod:274
4803 " guestfs_aug_clear (guestfs_h *g,\n"
4804 " const char *augpath);\n"
4809 #: ../src/guestfs-actions.pod:278 ../fish/guestfish-actions.pod:178
4811 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4812 "L<augtool(1)> C<clear> command."
4816 #: ../src/guestfs-actions.pod:283 ../src/guestfs-actions.pod:2085
4817 msgid "(Added in 1.3.4)"
4821 #: ../src/guestfs-actions.pod:285
4822 msgid "guestfs_aug_close"
4826 #: ../src/guestfs-actions.pod:287
4830 " guestfs_aug_close (guestfs_h *g);\n"
4835 #: ../src/guestfs-actions.pod:290
4837 "Close the current Augeas handle and free up any resources used by it. After "
4838 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4839 "any other Augeas functions."
4843 #: ../src/guestfs-actions.pod:297 ../src/guestfs-actions.pod:322
4844 #: ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:354
4845 #: ../src/guestfs-actions.pod:412 ../src/guestfs-actions.pod:432
4846 #: ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:477
4847 #: ../src/guestfs-actions.pod:491 ../src/guestfs-actions.pod:505
4848 #: ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:537
4849 #: ../src/guestfs-actions.pod:5164
4850 msgid "(Added in 0.7)"
4854 #: ../src/guestfs-actions.pod:299
4855 msgid "guestfs_aug_defnode"
4859 #: ../src/guestfs-actions.pod:301
4862 " struct guestfs_int_bool *\n"
4863 " guestfs_aug_defnode (guestfs_h *g,\n"
4864 " const char *name,\n"
4865 " const char *expr,\n"
4866 " const char *val);\n"
4871 #: ../src/guestfs-actions.pod:307 ../fish/guestfish-actions.pod:194
4873 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4877 #: ../src/guestfs-actions.pod:310
4879 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4880 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4881 "containing that single node."
4885 #: ../src/guestfs-actions.pod:314 ../fish/guestfish-actions.pod:201
4887 "On success this returns a pair containing the number of nodes in the "
4888 "nodeset, and a boolean flag if a node was created."
4892 #: ../src/guestfs-actions.pod:318
4894 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4895 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4899 #: ../src/guestfs-actions.pod:324
4900 msgid "guestfs_aug_defvar"
4904 #: ../src/guestfs-actions.pod:326
4908 " guestfs_aug_defvar (guestfs_h *g,\n"
4909 " const char *name,\n"
4910 " const char *expr);\n"
4915 #: ../src/guestfs-actions.pod:331 ../fish/guestfish-actions.pod:209
4917 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4918 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4922 #: ../src/guestfs-actions.pod:335 ../fish/guestfish-actions.pod:213
4924 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4925 "evaluates to something which is not a nodeset."
4929 #: ../src/guestfs-actions.pod:342
4930 msgid "guestfs_aug_get"
4934 #: ../src/guestfs-actions.pod:344
4938 " guestfs_aug_get (guestfs_h *g,\n"
4939 " const char *augpath);\n"
4944 #: ../src/guestfs-actions.pod:348 ../fish/guestfish-actions.pod:220
4946 "Look up the value associated with C<path>. If C<path> matches exactly one "
4947 "node, the C<value> is returned."
4951 #: ../src/guestfs-actions.pod:351 ../src/guestfs-actions.pod:851
4952 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:929
4953 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1048
4954 #: ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1195
4955 #: ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1343
4956 #: ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1646
4957 #: ../src/guestfs-actions.pod:1809 ../src/guestfs-actions.pod:1826
4958 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1938
4959 #: ../src/guestfs-actions.pod:2108 ../src/guestfs-actions.pod:2270
4960 #: ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2558
4961 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2716
4962 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2771
4963 #: ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2856
4964 #: ../src/guestfs-actions.pod:3340 ../src/guestfs-actions.pod:3690
4965 #: ../src/guestfs-actions.pod:3860 ../src/guestfs-actions.pod:3970
4966 #: ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4892
4967 #: ../src/guestfs-actions.pod:5062 ../src/guestfs-actions.pod:5240
4968 #: ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5852
4969 #: ../src/guestfs-actions.pod:5868 ../src/guestfs-actions.pod:5885
4970 #: ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:6583
4971 #: ../src/guestfs-actions.pod:6602 ../src/guestfs-actions.pod:6620
4972 #: ../src/guestfs-actions.pod:6800 ../src/guestfs-actions.pod:7072
4974 "This function returns a string, or NULL on error. I<The caller must free "
4975 "the returned string after use>."
4979 #: ../src/guestfs-actions.pod:356
4980 msgid "guestfs_aug_init"
4984 #: ../src/guestfs-actions.pod:358
4988 " guestfs_aug_init (guestfs_h *g,\n"
4989 " const char *root,\n"
4995 #: ../src/guestfs-actions.pod:363 ../fish/guestfish-actions.pod:227
4997 "Create a new Augeas handle for editing configuration files. If there was "
4998 "any previous Augeas handle associated with this guestfs session, then it is "
5003 #: ../src/guestfs-actions.pod:367
5004 msgid "You must call this before using any other C<guestfs_aug_*> commands."
5008 #: ../src/guestfs-actions.pod:370 ../fish/guestfish-actions.pod:234
5010 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5014 #: ../src/guestfs-actions.pod:373 ../fish/guestfish-actions.pod:237
5016 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5017 "logical I<or> of the following integers:"
5021 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
5022 msgid "C<AUG_SAVE_BACKUP> = 1"
5026 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
5027 msgid "Keep the original file with a C<.augsave> extension."
5031 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
5032 msgid "C<AUG_SAVE_NEWFILE> = 2"
5036 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:249
5038 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5039 "original. Overrides C<AUG_SAVE_BACKUP>."
5043 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
5044 msgid "C<AUG_TYPE_CHECK> = 4"
5048 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
5049 msgid "Typecheck lenses (can be expensive)."
5053 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
5054 msgid "C<AUG_NO_STDINC> = 8"
5058 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
5059 msgid "Do not use standard load path for modules."
5063 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
5064 msgid "C<AUG_SAVE_NOOP> = 16"
5068 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
5069 msgid "Make save a no-op, just record what would have been changed."
5073 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:264
5074 msgid "C<AUG_NO_LOAD> = 32"
5078 #: ../src/guestfs-actions.pod:402
5079 msgid "Do not load the tree in C<guestfs_aug_init>."
5083 #: ../src/guestfs-actions.pod:406
5084 msgid "To close the handle, you can call C<guestfs_aug_close>."
5088 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:272
5089 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5093 #: ../src/guestfs-actions.pod:414
5094 msgid "guestfs_aug_insert"
5098 #: ../src/guestfs-actions.pod:416
5102 " guestfs_aug_insert (guestfs_h *g,\n"
5103 " const char *augpath,\n"
5104 " const char *label,\n"
5110 #: ../src/guestfs-actions.pod:422 ../fish/guestfish-actions.pod:278
5112 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5113 "or after C<path> (depending on the boolean flag C<before>)."
5117 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:282
5119 "C<path> must match exactly one existing node in the tree, and C<label> must "
5120 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5124 #: ../src/guestfs-actions.pod:434
5125 msgid "guestfs_aug_load"
5129 #: ../src/guestfs-actions.pod:436
5133 " guestfs_aug_load (guestfs_h *g);\n"
5138 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
5139 msgid "Load files into the tree."
5143 #: ../src/guestfs-actions.pod:441 ../fish/guestfish-actions.pod:292
5144 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5148 #: ../src/guestfs-actions.pod:448
5149 msgid "guestfs_aug_ls"
5153 #: ../src/guestfs-actions.pod:450
5157 " guestfs_aug_ls (guestfs_h *g,\n"
5158 " const char *augpath);\n"
5163 #: ../src/guestfs-actions.pod:454
5165 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5166 "sorting the resulting nodes into alphabetical order."
5170 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:473
5171 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:1067
5172 #: ../src/guestfs-actions.pod:1358 ../src/guestfs-actions.pod:1377
5173 #: ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1499
5174 #: ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:2150
5175 #: ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2185
5176 #: ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:2252
5177 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2372
5178 #: ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:2790
5179 #: ../src/guestfs-actions.pod:3005 ../src/guestfs-actions.pod:3260
5180 #: ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3427
5181 #: ../src/guestfs-actions.pod:3832 ../src/guestfs-actions.pod:4514
5182 #: ../src/guestfs-actions.pod:5034 ../src/guestfs-actions.pod:5160
5183 #: ../src/guestfs-actions.pod:5274 ../src/guestfs-actions.pod:5925
5184 #: ../src/guestfs-actions.pod:5986 ../src/guestfs-actions.pod:6041
5185 #: ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6211
5186 #: ../src/guestfs-actions.pod:6693 ../src/guestfs-actions.pod:6713
5187 #: ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:6925
5188 #: ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:7029
5189 #: ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7094
5190 #: ../src/guestfs-actions.pod:7113
5192 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5193 ">), or NULL if there was an error. I<The caller must free the strings and "
5194 "the array after use>."
5198 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:992
5199 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:1415
5200 #: ../src/guestfs-actions.pod:3083 ../src/guestfs-actions.pod:3114
5201 #: ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3723
5202 #: ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3943
5203 #: ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4518
5204 #: ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5353
5205 #: ../src/guestfs-actions.pod:5367 ../src/guestfs-actions.pod:5379
5206 #: ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:6425
5207 #: ../src/guestfs-actions.pod:6438 ../src/guestfs-actions.pod:6677
5208 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6913
5209 msgid "(Added in 0.8)"
5213 #: ../src/guestfs-actions.pod:463
5214 msgid "guestfs_aug_match"
5218 #: ../src/guestfs-actions.pod:465
5222 " guestfs_aug_match (guestfs_h *g,\n"
5223 " const char *augpath);\n"
5228 #: ../src/guestfs-actions.pod:469 ../fish/guestfish-actions.pod:306
5230 "Returns a list of paths which match the path expression C<path>. The "
5231 "returned paths are sufficiently qualified so that they match exactly one "
5232 "node in the current tree."
5236 #: ../src/guestfs-actions.pod:479
5237 msgid "guestfs_aug_mv"
5241 #: ../src/guestfs-actions.pod:481
5245 " guestfs_aug_mv (guestfs_h *g,\n"
5246 " const char *src,\n"
5247 " const char *dest);\n"
5252 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:314
5254 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5255 "C<dest> is overwritten if it exists."
5259 #: ../src/guestfs-actions.pod:493
5260 msgid "guestfs_aug_rm"
5264 #: ../src/guestfs-actions.pod:495
5268 " guestfs_aug_rm (guestfs_h *g,\n"
5269 " const char *augpath);\n"
5274 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5275 msgid "Remove C<path> and all of its children."
5279 #: ../src/guestfs-actions.pod:501 ../fish/guestfish-actions.pod:323
5280 msgid "On success this returns the number of entries which were removed."
5284 #: ../src/guestfs-actions.pod:507
5285 msgid "guestfs_aug_save"
5289 #: ../src/guestfs-actions.pod:509
5293 " guestfs_aug_save (guestfs_h *g);\n"
5298 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:329
5299 msgid "This writes all pending changes to disk."
5303 #: ../src/guestfs-actions.pod:514
5305 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5310 #: ../src/guestfs-actions.pod:521
5311 msgid "guestfs_aug_set"
5315 #: ../src/guestfs-actions.pod:523
5319 " guestfs_aug_set (guestfs_h *g,\n"
5320 " const char *augpath,\n"
5321 " const char *val);\n"
5326 #: ../src/guestfs-actions.pod:528 ../fish/guestfish-actions.pod:338
5327 msgid "Set the value associated with C<path> to C<val>."
5331 #: ../src/guestfs-actions.pod:530
5333 "In the Augeas API, it is possible to clear a node by setting the value to "
5334 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5335 "this call. Instead you must use the C<guestfs_aug_clear> call."
5339 #: ../src/guestfs-actions.pod:539
5340 msgid "guestfs_available"
5344 #: ../src/guestfs-actions.pod:541
5348 " guestfs_available (guestfs_h *g,\n"
5349 " char *const *groups);\n"
5354 #: ../src/guestfs-actions.pod:545 ../fish/guestfish-actions.pod:349
5356 "This command is used to check the availability of some groups of "
5357 "functionality in the appliance, which not all builds of the libguestfs "
5358 "appliance will be able to provide."
5362 #: ../src/guestfs-actions.pod:549
5364 "The libguestfs groups, and the functions that those groups correspond to, "
5365 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5366 "runtime by calling C<guestfs_available_all_groups>."
5370 #: ../src/guestfs-actions.pod:554 ../fish/guestfish-actions.pod:358
5372 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5373 "\"]> would check for the availability of the Linux inotify functions and "
5374 "Augeas (configuration file editing) functions."
5378 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5379 msgid "The command returns no error if I<all> requested groups are available."
5383 #: ../src/guestfs-actions.pod:561 ../fish/guestfish-actions.pod:365
5385 "It fails with an error if one or more of the requested groups is unavailable "
5390 #: ../src/guestfs-actions.pod:564 ../fish/guestfish-actions.pod:368
5392 "If an unknown group name is included in the list of groups then an error is "
5397 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:371
5402 #: ../src/guestfs-actions.pod:573
5403 msgid "You must call C<guestfs_launch> before calling this function."
5407 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:379
5409 "The reason is because we don't know what groups are supported by the "
5410 "appliance/daemon until it is running and can be queried."
5414 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:385
5416 "If a group of functions is available, this does not necessarily mean that "
5417 "they will work. You still have to check for errors when calling individual "
5418 "API functions even if they are available."
5422 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:392
5424 "It is usually the job of distro packagers to build complete functionality "
5425 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5426 "with all requirements satisfied, will support everything."
5430 #: ../src/guestfs-actions.pod:595
5432 "This call was added in version C<1.0.80>. In previous versions of "
5433 "libguestfs all you could do would be to speculatively execute a command to "
5434 "find out if the daemon implemented it. See also C<guestfs_version>."
5438 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1165
5439 msgid "(Added in 1.0.80)"
5443 #: ../src/guestfs-actions.pod:606
5444 msgid "guestfs_available_all_groups"
5448 #: ../src/guestfs-actions.pod:608
5452 " guestfs_available_all_groups (guestfs_h *g);\n"
5457 #: ../src/guestfs-actions.pod:611
5459 "This command returns a list of all optional groups that this daemon knows "
5460 "about. Note this returns both supported and unsupported groups. To find "
5461 "out which ones the daemon can actually support you have to call "
5462 "C<guestfs_available> on each member of the returned list."
5466 #: ../src/guestfs-actions.pod:617
5467 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5471 #: ../src/guestfs-actions.pod:623
5472 msgid "(Added in 1.3.15)"
5476 #: ../src/guestfs-actions.pod:625
5477 msgid "guestfs_base64_in"
5481 #: ../src/guestfs-actions.pod:627
5485 " guestfs_base64_in (guestfs_h *g,\n"
5486 " const char *base64file,\n"
5487 " const char *filename);\n"
5492 #: ../src/guestfs-actions.pod:632 ../fish/guestfish-actions.pod:422
5494 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5498 #: ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:651
5499 msgid "(Added in 1.3.5)"
5503 #: ../src/guestfs-actions.pod:639
5504 msgid "guestfs_base64_out"
5508 #: ../src/guestfs-actions.pod:641
5512 " guestfs_base64_out (guestfs_h *g,\n"
5513 " const char *filename,\n"
5514 " const char *base64file);\n"
5519 #: ../src/guestfs-actions.pod:646 ../fish/guestfish-actions.pod:431
5521 "This command downloads the contents of C<filename>, writing it out to local "
5522 "file C<base64file> encoded as base64."
5526 #: ../src/guestfs-actions.pod:653
5527 msgid "guestfs_blockdev_flushbufs"
5531 #: ../src/guestfs-actions.pod:655
5535 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5536 " const char *device);\n"
5541 #: ../src/guestfs-actions.pod:659 ../fish/guestfish-actions.pod:440
5543 "This tells the kernel to flush internal buffers associated with C<device>."
5547 #: ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:679
5548 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:710
5549 #: ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747
5550 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
5551 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
5552 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5553 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5554 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5555 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5556 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5557 msgid "This uses the L<blockdev(8)> command."
5561 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:683
5562 #: ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:714
5563 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:751
5564 #: ../src/guestfs-actions.pod:765 ../src/guestfs-actions.pod:783
5565 #: ../src/guestfs-actions.pod:797 ../src/guestfs-actions.pod:811
5566 msgid "(Added in 0.9.3)"
5570 #: ../src/guestfs-actions.pod:668
5571 msgid "guestfs_blockdev_getbsz"
5575 #: ../src/guestfs-actions.pod:670
5579 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5580 " const char *device);\n"
5585 #: ../src/guestfs-actions.pod:674 ../fish/guestfish-actions.pod:449
5586 msgid "This returns the block size of a device."
5590 #: ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:776
5591 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5593 "(Note this is different from both I<size in blocks> and I<filesystem block "
5598 #: ../src/guestfs-actions.pod:685
5599 msgid "guestfs_blockdev_getro"
5603 #: ../src/guestfs-actions.pod:687
5607 " guestfs_blockdev_getro (guestfs_h *g,\n"
5608 " const char *device);\n"
5613 #: ../src/guestfs-actions.pod:691 ../fish/guestfish-actions.pod:460
5615 "Returns a boolean indicating if the block device is read-only (true if read-"
5616 "only, false if not)."
5620 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:1398
5621 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1893
5622 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1976
5623 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2046
5624 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2094
5625 #: ../src/guestfs-actions.pod:3022 ../src/guestfs-actions.pod:3036
5626 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3065
5627 #: ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3096
5628 #: ../src/guestfs-actions.pod:3112 ../src/guestfs-actions.pod:3126
5629 #: ../src/guestfs-actions.pod:3139 ../src/guestfs-actions.pod:3153
5630 #: ../src/guestfs-actions.pod:3168 ../src/guestfs-actions.pod:3183
5631 #: ../src/guestfs-actions.pod:4663
5632 msgid "This function returns a C truth value on success or -1 on error."
5636 #: ../src/guestfs-actions.pod:700
5637 msgid "guestfs_blockdev_getsize64"
5641 #: ../src/guestfs-actions.pod:702
5645 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5646 " const char *device);\n"
5651 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:469
5652 msgid "This returns the size of the device in bytes."
5656 #: ../src/guestfs-actions.pod:708
5657 msgid "See also C<guestfs_blockdev_getsz>."
5661 #: ../src/guestfs-actions.pod:716
5662 msgid "guestfs_blockdev_getss"
5666 #: ../src/guestfs-actions.pod:718
5670 " guestfs_blockdev_getss (guestfs_h *g,\n"
5671 " const char *device);\n"
5676 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:479
5678 "This returns the size of sectors on a block device. Usually 512, but can be "
5679 "larger for modern devices."
5683 #: ../src/guestfs-actions.pod:725
5685 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5690 #: ../src/guestfs-actions.pod:734
5691 msgid "guestfs_blockdev_getsz"
5695 #: ../src/guestfs-actions.pod:736
5699 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5700 " const char *device);\n"
5705 #: ../src/guestfs-actions.pod:740 ../fish/guestfish-actions.pod:491
5707 "This returns the size of the device in units of 512-byte sectors (even if "
5708 "the sectorsize isn't 512 bytes ... weird)."
5712 #: ../src/guestfs-actions.pod:743
5714 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5715 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5719 #: ../src/guestfs-actions.pod:753
5720 msgid "guestfs_blockdev_rereadpt"
5724 #: ../src/guestfs-actions.pod:755
5728 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5729 " const char *device);\n"
5734 #: ../src/guestfs-actions.pod:759 ../fish/guestfish-actions.pod:504
5735 msgid "Reread the partition table on C<device>."
5739 #: ../src/guestfs-actions.pod:767
5740 msgid "guestfs_blockdev_setbsz"
5744 #: ../src/guestfs-actions.pod:769
5748 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5749 " const char *device,\n"
5750 " int blocksize);\n"
5755 #: ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:512
5756 msgid "This sets the block size of a device."
5760 #: ../src/guestfs-actions.pod:785
5761 msgid "guestfs_blockdev_setro"
5765 #: ../src/guestfs-actions.pod:787
5769 " guestfs_blockdev_setro (guestfs_h *g,\n"
5770 " const char *device);\n"
5775 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:523
5776 msgid "Sets the block device named C<device> to read-only."
5780 #: ../src/guestfs-actions.pod:799
5781 msgid "guestfs_blockdev_setrw"
5785 #: ../src/guestfs-actions.pod:801
5789 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5790 " const char *device);\n"
5795 #: ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:531
5796 msgid "Sets the block device named C<device> to read-write."
5800 #: ../src/guestfs-actions.pod:813
5801 msgid "guestfs_case_sensitive_path"
5805 #: ../src/guestfs-actions.pod:815
5809 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5810 " const char *path);\n"
5815 #: ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:539
5817 "This can be used to resolve case insensitive paths on a filesystem which is "
5818 "case sensitive. The use case is to resolve paths which you have read from "
5819 "Windows configuration files or the Windows Registry, to the true path."
5823 #: ../src/guestfs-actions.pod:824 ../fish/guestfish-actions.pod:544
5825 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5826 "(and probably others), which is that although the underlying filesystem is "
5827 "case-insensitive, the driver exports the filesystem to Linux as case-"
5832 #: ../src/guestfs-actions.pod:829 ../fish/guestfish-actions.pod:549
5834 "One consequence of this is that special directories such as C<c:\\windows> "
5835 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5836 "precise details of how they were created. In Windows itself this would not "
5841 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:555
5843 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5848 #: ../src/guestfs-actions.pod:838 ../fish/guestfish-actions.pod:558
5850 "This function resolves the true case of each element in the path and returns "
5851 "the case-sensitive path."
5855 #: ../src/guestfs-actions.pod:841
5857 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5858 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5859 "how the directories were originally created under Windows)."
5863 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:566
5864 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5868 #: ../src/guestfs-actions.pod:849
5869 msgid "See also C<guestfs_realpath>."
5873 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:6605
5874 msgid "(Added in 1.0.75)"
5878 #: ../src/guestfs-actions.pod:856
5883 #: ../src/guestfs-actions.pod:858
5887 " guestfs_cat (guestfs_h *g,\n"
5888 " const char *path);\n"
5893 #: ../src/guestfs-actions.pod:862 ../src/guestfs-actions.pod:5150
5894 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3424
5895 msgid "Return the contents of the file named C<path>."
5899 #: ../src/guestfs-actions.pod:864
5901 "Note that this function cannot correctly handle binary files (specifically, "
5902 "files containing C<\\0> character which is treated as end of string). For "
5903 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5904 "functions which have a more complex interface."
5908 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1051
5909 #: ../src/guestfs-actions.pod:1071 ../src/guestfs-actions.pod:1362
5910 #: ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1484
5911 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1752
5912 #: ../src/guestfs-actions.pod:2170 ../src/guestfs-actions.pod:2189
5913 #: ../src/guestfs-actions.pod:2232 ../src/guestfs-actions.pod:2256
5914 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2302
5915 #: ../src/guestfs-actions.pod:4932 ../src/guestfs-actions.pod:4958
5916 #: ../src/guestfs-actions.pod:5089 ../src/guestfs-actions.pod:5115
5917 #: ../src/guestfs-actions.pod:5139 ../src/guestfs-actions.pod:5990
5918 #: ../src/guestfs-actions.pod:6045 ../src/guestfs-actions.pod:6191
5919 #: ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:6877
5920 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-actions.pod:6929
5921 #: ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:7033
5922 #: ../src/guestfs-actions.pod:7052 ../src/guestfs-actions.pod:7098
5923 #: ../src/guestfs-actions.pod:7117 ../fish/guestfish-actions.pod:582
5924 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5925 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5926 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5927 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462
5928 #: ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500
5929 #: ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525
5930 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3294
5931 #: ../fish/guestfish-actions.pod:3309 ../fish/guestfish-actions.pod:3385
5932 #: ../fish/guestfish-actions.pod:3402 ../fish/guestfish-actions.pod:3417
5933 #: ../fish/guestfish-actions.pod:4000 ../fish/guestfish-actions.pod:4046
5934 #: ../fish/guestfish-actions.pod:4131 ../fish/guestfish-actions.pod:4146
5935 #: ../fish/guestfish-actions.pod:4556 ../fish/guestfish-actions.pod:4574
5936 #: ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4601
5937 #: ../fish/guestfish-actions.pod:4649 ../fish/guestfish-actions.pod:4659
5938 #: ../fish/guestfish-actions.pod:4688 ../fish/guestfish-actions.pod:4698
5940 "Because of the message protocol, there is a transfer limit of somewhere "
5941 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5945 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:3264
5946 #: ../src/guestfs-actions.pod:3326 ../src/guestfs-actions.pod:3343
5947 #: ../src/guestfs-actions.pod:3431 ../src/guestfs-actions.pod:3836
5948 #: ../src/guestfs-actions.pod:3850 ../src/guestfs-actions.pod:5038
5949 #: ../src/guestfs-actions.pod:5052 ../src/guestfs-actions.pod:6764
5950 #: ../src/guestfs-actions.pod:6778
5951 msgid "(Added in 0.4)"
5955 #: ../src/guestfs-actions.pod:877
5956 msgid "guestfs_checksum"
5960 #: ../src/guestfs-actions.pod:879
5964 " guestfs_checksum (guestfs_h *g,\n"
5965 " const char *csumtype,\n"
5966 " const char *path);\n"
5971 #: ../src/guestfs-actions.pod:884 ../fish/guestfish-actions.pod:589
5973 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5977 #: ../src/guestfs-actions.pod:887 ../fish/guestfish-actions.pod:592
5979 "The type of checksum to compute is given by the C<csumtype> parameter which "
5980 "must have one of the following values:"
5984 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
5989 #: ../src/guestfs-actions.pod:894 ../fish/guestfish-actions.pod:599
5991 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5996 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
6001 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
6002 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6006 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
6011 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
6012 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6016 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
6021 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
6022 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6026 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
6031 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
6032 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6036 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
6041 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
6042 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6046 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
6051 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:624
6052 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6056 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:628
6057 msgid "The checksum is returned as a printable string."
6061 #: ../src/guestfs-actions.pod:925
6062 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6066 #: ../src/guestfs-actions.pod:927
6067 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6071 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:1240
6072 #: ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:3038
6073 #: ../src/guestfs-actions.pod:3067 ../src/guestfs-actions.pod:3128
6074 #: ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:6461
6075 msgid "(Added in 1.0.2)"
6079 #: ../src/guestfs-actions.pod:934
6080 msgid "guestfs_checksum_device"
6084 #: ../src/guestfs-actions.pod:936
6088 " guestfs_checksum_device (guestfs_h *g,\n"
6089 " const char *csumtype,\n"
6090 " const char *device);\n"
6095 #: ../src/guestfs-actions.pod:941
6097 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6098 "device named C<device>. For the types of checksums supported see the "
6099 "C<guestfs_checksum> command."
6103 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:4569
6104 #: ../src/guestfs-actions.pod:4628 ../src/guestfs-actions.pod:4665
6105 #: ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4859
6106 #: ../src/guestfs-actions.pod:6370 ../src/guestfs-actions.pod:6384
6107 #: ../src/guestfs-actions.pod:6790
6108 msgid "(Added in 1.3.2)"
6112 #: ../src/guestfs-actions.pod:950
6113 msgid "guestfs_checksums_out"
6117 #: ../src/guestfs-actions.pod:952
6121 " guestfs_checksums_out (guestfs_h *g,\n"
6122 " const char *csumtype,\n"
6123 " const char *directory,\n"
6124 " const char *sumsfile);\n"
6129 #: ../src/guestfs-actions.pod:958 ../fish/guestfish-actions.pod:646
6131 "This command computes the checksums of all regular files in C<directory> and "
6132 "then emits a list of those checksums to the local output file C<sumsfile>."
6136 #: ../src/guestfs-actions.pod:962 ../fish/guestfish-actions.pod:650
6138 "This can be used for verifying the integrity of a virtual machine. However "
6139 "to be properly secure you should pay attention to the output of the checksum "
6140 "command (it uses the ones from GNU coreutils). In particular when the "
6141 "filename is not printable, coreutils uses a special backslash syntax. For "
6142 "more information, see the GNU coreutils info file."
6146 #: ../src/guestfs-actions.pod:972
6147 msgid "(Added in 1.3.7)"
6151 #: ../src/guestfs-actions.pod:974
6152 msgid "guestfs_chmod"
6156 #: ../src/guestfs-actions.pod:976
6160 " guestfs_chmod (guestfs_h *g,\n"
6162 " const char *path);\n"
6167 #: ../src/guestfs-actions.pod:981 ../fish/guestfish-actions.pod:664
6169 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6174 #: ../src/guestfs-actions.pod:984 ../fish/guestfish-actions.pod:667
6176 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6177 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6182 #: ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:4087
6183 #: ../src/guestfs-actions.pod:4268 ../src/guestfs-actions.pod:4287
6184 #: ../src/guestfs-actions.pod:4306 ../fish/guestfish-actions.pod:671
6185 #: ../fish/guestfish-actions.pod:2753 ../fish/guestfish-actions.pod:2869
6186 #: ../fish/guestfish-actions.pod:2879 ../fish/guestfish-actions.pod:2889
6187 msgid "The mode actually set is affected by the umask."
6191 #: ../src/guestfs-actions.pod:994
6192 msgid "guestfs_chown"
6196 #: ../src/guestfs-actions.pod:996
6200 " guestfs_chown (guestfs_h *g,\n"
6203 " const char *path);\n"
6208 #: ../src/guestfs-actions.pod:1002 ../fish/guestfish-actions.pod:677
6209 msgid "Change the file owner to C<owner> and group to C<group>."
6213 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:3225
6214 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2231
6216 "Only numeric uid and gid are supported. If you want to use names, you will "
6217 "need to locate and parse the password file yourself (Augeas support makes "
6218 "this relatively easy)."
6222 #: ../src/guestfs-actions.pod:1012
6223 msgid "guestfs_command"
6227 #: ../src/guestfs-actions.pod:1014
6231 " guestfs_command (guestfs_h *g,\n"
6232 " char *const *arguments);\n"
6237 #: ../src/guestfs-actions.pod:1018 ../fish/guestfish-actions.pod:687
6239 "This call runs a command from the guest filesystem. The filesystem must be "
6240 "mounted, and must contain a compatible operating system (ie. something "
6241 "Linux, with the same or compatible processor architecture)."
6245 #: ../src/guestfs-actions.pod:1023
6247 "The single parameter is an argv-style list of arguments. The first element "
6248 "is the name of the program to run. Subsequent elements are parameters. The "
6249 "list must be non-empty (ie. must contain a program name). Note that the "
6250 "command runs directly, and is I<not> invoked via the shell (see "
6255 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:699
6256 msgid "The return value is anything printed to I<stdout> by the command."
6260 #: ../src/guestfs-actions.pod:1033 ../fish/guestfish-actions.pod:702
6262 "If the command returns a non-zero exit status, then this function returns an "
6263 "error message. The error message string is the content of I<stderr> from "
6268 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:706
6270 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6271 "bin>. If you require a program from another location, you should provide "
6272 "the full path in the first parameter."
6276 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:711
6278 "Shared libraries and data files required by the program must be available on "
6279 "filesystems which are mounted in the correct places. It is the caller's "
6280 "responsibility to ensure all filesystems that are needed are mounted at the "
6285 #: ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1074
6286 #: ../src/guestfs-actions.pod:1537
6287 msgid "(Added in 0.9.1)"
6291 #: ../src/guestfs-actions.pod:1056
6292 msgid "guestfs_command_lines"
6296 #: ../src/guestfs-actions.pod:1058
6300 " guestfs_command_lines (guestfs_h *g,\n"
6301 " char *const *arguments);\n"
6306 #: ../src/guestfs-actions.pod:1062
6308 "This is the same as C<guestfs_command>, but splits the result into a list of "
6313 #: ../src/guestfs-actions.pod:1065
6314 msgid "See also: C<guestfs_sh_lines>"
6318 #: ../src/guestfs-actions.pod:1076
6319 msgid "guestfs_config"
6323 #: ../src/guestfs-actions.pod:1078
6327 " guestfs_config (guestfs_h *g,\n"
6328 " const char *qemuparam,\n"
6329 " const char *qemuvalue);\n"
6334 #: ../src/guestfs-actions.pod:1083 ../fish/guestfish-actions.pod:736
6336 "This can be used to add arbitrary qemu command line parameters of the form "
6337 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6338 "setting some parameters which would interfere with parameters that we use."
6342 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6343 msgid "The first character of C<param> string must be a C<-> (dash)."
6347 #: ../src/guestfs-actions.pod:1090 ../fish/guestfish-actions.pod:743
6348 msgid "C<value> can be NULL."
6352 #: ../src/guestfs-actions.pod:1096
6353 msgid "guestfs_copy_size"
6357 #: ../src/guestfs-actions.pod:1098
6361 " guestfs_copy_size (guestfs_h *g,\n"
6362 " const char *src,\n"
6363 " const char *dest,\n"
6369 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:749
6371 "This command copies exactly C<size> bytes from one source device or file "
6372 "C<src> to another destination device or file C<dest>."
6376 #: ../src/guestfs-actions.pod:1107 ../fish/guestfish-actions.pod:752
6378 "Note this will fail if the source is too short or if the destination is not "
6383 #: ../src/guestfs-actions.pod:1112 ../src/guestfs-actions.pod:1235
6384 #: ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1686
6385 #: ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:6456
6386 #: ../src/guestfs-actions.pod:6490 ../src/guestfs-actions.pod:6969
6387 #: ../src/guestfs-actions.pod:6988
6389 "This long-running command can generate progress notification messages so "
6390 "that the caller can display a progress bar or indicator. To receive these "
6391 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6392 "guestfs_set_progress_callback>."
6396 #: ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:3863
6397 #: ../src/guestfs-actions.pod:5065 ../src/guestfs-actions.pod:6697
6398 #: ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6803
6399 msgid "(Added in 1.0.87)"
6403 #: ../src/guestfs-actions.pod:1119
6408 #: ../src/guestfs-actions.pod:1121
6412 " guestfs_cp (guestfs_h *g,\n"
6413 " const char *src,\n"
6414 " const char *dest);\n"
6419 #: ../src/guestfs-actions.pod:1126 ../fish/guestfish-actions.pod:759
6421 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6422 "destination filename or destination directory."
6426 #: ../src/guestfs-actions.pod:1131 ../src/guestfs-actions.pod:1145
6427 #: ../src/guestfs-actions.pod:1217 ../src/guestfs-actions.pod:1291
6428 #: ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:4532
6429 #: ../src/guestfs-actions.pod:4909
6430 msgid "(Added in 1.0.18)"
6434 #: ../src/guestfs-actions.pod:1133
6435 msgid "guestfs_cp_a"
6439 #: ../src/guestfs-actions.pod:1135
6443 " guestfs_cp_a (guestfs_h *g,\n"
6444 " const char *src,\n"
6445 " const char *dest);\n"
6450 #: ../src/guestfs-actions.pod:1140 ../fish/guestfish-actions.pod:766
6452 "This copies a file or directory from C<src> to C<dest> recursively using the "
6457 #: ../src/guestfs-actions.pod:1147
6462 #: ../src/guestfs-actions.pod:1149
6466 " guestfs_dd (guestfs_h *g,\n"
6467 " const char *src,\n"
6468 " const char *dest);\n"
6473 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:773
6475 "This command copies from one source device or file C<src> to another "
6476 "destination device or file C<dest>. Normally you would use this to copy to "
6477 "or from a device or partition, for example to duplicate a filesystem."
6481 #: ../src/guestfs-actions.pod:1159
6483 "If the destination is a device, it must be as large or larger than the "
6484 "source file or device, otherwise the copy will fail. This command cannot do "
6485 "partial copies (see C<guestfs_copy_size>)."
6489 #: ../src/guestfs-actions.pod:1167
6494 #: ../src/guestfs-actions.pod:1169
6498 " guestfs_df (guestfs_h *g);\n"
6503 #: ../src/guestfs-actions.pod:1172 ../fish/guestfish-actions.pod:786
6504 msgid "This command runs the C<df> command to report disk space used."
6508 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1191
6509 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6511 "This command is mostly useful for interactive sessions. It is I<not> "
6512 "intended that you try to parse the output string. Use C<statvfs> from "
6517 #: ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1198
6518 #: ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2235
6519 #: ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2327
6520 #: ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4432
6521 #: ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6218
6522 #: ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:6849
6523 #: ../src/guestfs-actions.pod:6862
6524 msgid "(Added in 1.0.54)"
6528 #: ../src/guestfs-actions.pod:1183
6529 msgid "guestfs_df_h"
6533 #: ../src/guestfs-actions.pod:1185
6537 " guestfs_df_h (guestfs_h *g);\n"
6542 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:796
6544 "This command runs the C<df -h> command to report disk space used in human-"
6549 #: ../src/guestfs-actions.pod:1200
6550 msgid "guestfs_dmesg"
6554 #: ../src/guestfs-actions.pod:1202
6558 " guestfs_dmesg (guestfs_h *g);\n"
6563 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:807
6565 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6566 "This is sometimes useful for extended debugging of problems."
6570 #: ../src/guestfs-actions.pod:1209
6572 "Another way to get the same information is to enable verbose messages with "
6573 "C<guestfs_set_verbose> or by setting the environment variable "
6574 "C<LIBGUESTFS_DEBUG=1> before running the program."
6578 #: ../src/guestfs-actions.pod:1219
6579 msgid "guestfs_download"
6583 #: ../src/guestfs-actions.pod:1221
6587 " guestfs_download (guestfs_h *g,\n"
6588 " const char *remotefilename,\n"
6589 " const char *filename);\n"
6594 #: ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1251
6595 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6597 "Download file C<remotefilename> and save it as C<filename> on the local "
6602 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:6450
6603 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4304
6604 msgid "C<filename> can also be a named pipe."
6608 #: ../src/guestfs-actions.pod:1231
6609 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6613 #: ../src/guestfs-actions.pod:1242
6614 msgid "guestfs_download_offset"
6618 #: ../src/guestfs-actions.pod:1244
6622 " guestfs_download_offset (guestfs_h *g,\n"
6623 " const char *remotefilename,\n"
6624 " const char *filename,\n"
6625 " int64_t offset,\n"
6631 #: ../src/guestfs-actions.pod:1254 ../fish/guestfish-actions.pod:836
6633 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6634 "region must be within the file or device)."
6638 #: ../src/guestfs-actions.pod:1257
6640 "Note that there is no limit on the amount of data that can be downloaded "
6641 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6642 "full amount unless an error occurs."
6646 #: ../src/guestfs-actions.pod:1262
6647 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6651 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:6495
6652 msgid "(Added in 1.5.17)"
6656 #: ../src/guestfs-actions.pod:1273
6657 msgid "guestfs_drop_caches"
6661 #: ../src/guestfs-actions.pod:1275
6665 " guestfs_drop_caches (guestfs_h *g,\n"
6666 " int whattodrop);\n"
6671 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:852
6673 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6674 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6675 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6679 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
6680 msgid "Setting C<whattodrop> to 3 should drop everything."
6684 #: ../src/guestfs-actions.pod:1286 ../fish/guestfish-actions.pod:859
6686 "This automatically calls L<sync(2)> before the operation, so that the "
6687 "maximum guest memory is freed."
6691 #: ../src/guestfs-actions.pod:1293
6696 #: ../src/guestfs-actions.pod:1295
6700 " guestfs_du (guestfs_h *g,\n"
6701 " const char *path);\n"
6706 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:866
6708 "This command runs the C<du -s> command to estimate file space usage for "
6713 #: ../src/guestfs-actions.pod:1302 ../fish/guestfish-actions.pod:869
6715 "C<path> can be a file or a directory. If C<path> is a directory then the "
6716 "estimate includes the contents of the directory and all subdirectories "
6721 #: ../src/guestfs-actions.pod:1306 ../fish/guestfish-actions.pod:873
6723 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6727 #: ../src/guestfs-actions.pod:1313
6728 msgid "guestfs_e2fsck_f"
6732 #: ../src/guestfs-actions.pod:1315
6736 " guestfs_e2fsck_f (guestfs_h *g,\n"
6737 " const char *device);\n"
6742 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:880
6744 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6745 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6750 #: ../src/guestfs-actions.pod:1323
6752 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6753 "Normally you should use C<guestfs_fsck>."
6757 #: ../src/guestfs-actions.pod:1328
6758 msgid "(Added in 1.0.29)"
6762 #: ../src/guestfs-actions.pod:1330
6763 msgid "guestfs_echo_daemon"
6767 #: ../src/guestfs-actions.pod:1332
6771 " guestfs_echo_daemon (guestfs_h *g,\n"
6772 " char *const *words);\n"
6777 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:891
6779 "This command concatenates the list of C<words> passed with single spaces "
6780 "between them and returns the resulting string."
6784 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:894
6785 msgid "You can use this command to test the connection through to the daemon."
6789 #: ../src/guestfs-actions.pod:1341
6790 msgid "See also C<guestfs_ping_daemon>."
6794 #: ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:2073
6795 #: ../src/guestfs-actions.pod:5698
6796 msgid "(Added in 1.0.69)"
6800 #: ../src/guestfs-actions.pod:1348
6801 msgid "guestfs_egrep"
6805 #: ../src/guestfs-actions.pod:1350
6809 " guestfs_egrep (guestfs_h *g,\n"
6810 " const char *regex,\n"
6811 " const char *path);\n"
6816 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:902
6818 "This calls the external C<egrep> program and returns the matching lines."
6822 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1384
6823 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1487
6824 #: ../src/guestfs-actions.pod:1506 ../src/guestfs-actions.pod:2173
6825 #: ../src/guestfs-actions.pod:2192 ../src/guestfs-actions.pod:2348
6826 #: ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:2376
6827 #: ../src/guestfs-actions.pod:2422 ../src/guestfs-actions.pod:2444
6828 #: ../src/guestfs-actions.pod:2457 ../src/guestfs-actions.pod:3356
6829 #: ../src/guestfs-actions.pod:3370 ../src/guestfs-actions.pod:3383
6830 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:4367
6831 #: ../src/guestfs-actions.pod:5243 ../src/guestfs-actions.pod:5292
6832 #: ../src/guestfs-actions.pod:6062 ../src/guestfs-actions.pod:6074
6833 #: ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6100
6834 #: ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6135
6835 #: ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6161
6836 #: ../src/guestfs-actions.pod:6932 ../src/guestfs-actions.pod:6951
6837 #: ../src/guestfs-actions.pod:7036 ../src/guestfs-actions.pod:7055
6838 #: ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7120
6839 msgid "(Added in 1.0.66)"
6843 #: ../src/guestfs-actions.pod:1367
6844 msgid "guestfs_egrepi"
6848 #: ../src/guestfs-actions.pod:1369
6852 " guestfs_egrepi (guestfs_h *g,\n"
6853 " const char *regex,\n"
6854 " const char *path);\n"
6859 #: ../src/guestfs-actions.pod:1374 ../fish/guestfish-actions.pod:912
6861 "This calls the external C<egrep -i> program and returns the matching lines."
6865 #: ../src/guestfs-actions.pod:1386
6866 msgid "guestfs_equal"
6870 #: ../src/guestfs-actions.pod:1388
6874 " guestfs_equal (guestfs_h *g,\n"
6875 " const char *file1,\n"
6876 " const char *file2);\n"
6881 #: ../src/guestfs-actions.pod:1393 ../fish/guestfish-actions.pod:922
6883 "This compares the two files C<file1> and C<file2> and returns true if their "
6884 "content is exactly equal, or false otherwise."
6888 #: ../src/guestfs-actions.pod:1396 ../fish/guestfish-actions.pod:925
6889 msgid "The external L<cmp(1)> program is used for the comparison."
6893 #: ../src/guestfs-actions.pod:1402
6894 msgid "guestfs_exists"
6898 #: ../src/guestfs-actions.pod:1404
6902 " guestfs_exists (guestfs_h *g,\n"
6903 " const char *path);\n"
6908 #: ../src/guestfs-actions.pod:1408 ../fish/guestfish-actions.pod:931
6910 "This returns C<true> if and only if there is a file, directory (or anything) "
6911 "with the given C<path> name."
6915 #: ../src/guestfs-actions.pod:1411
6916 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6920 #: ../src/guestfs-actions.pod:1417
6921 msgid "guestfs_fallocate"
6925 #: ../src/guestfs-actions.pod:1419
6929 " guestfs_fallocate (guestfs_h *g,\n"
6930 " const char *path,\n"
6936 #: ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1450
6937 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6939 "This command preallocates a file (containing zero bytes) named C<path> of "
6940 "size C<len> bytes. If the file exists already, it is overwritten."
6944 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:944
6946 "Do not confuse this with the guestfish-specific C<alloc> command which "
6947 "allocates a file in the host and attaches it as a device."
6951 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:948
6953 "This function is deprecated. In new code, use the C<fallocate64> call "
6958 #: ../src/guestfs-actions.pod:1443
6959 msgid "guestfs_fallocate64"
6963 #: ../src/guestfs-actions.pod:1445
6967 " guestfs_fallocate64 (guestfs_h *g,\n"
6968 " const char *path,\n"
6974 #: ../src/guestfs-actions.pod:1454
6976 "Note that this call allocates disk blocks for the file. To create a sparse "
6977 "file use C<guestfs_truncate_size> instead."
6981 #: ../src/guestfs-actions.pod:1457
6983 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6984 "oversight it only allowed 30 bit lengths to be specified, effectively "
6985 "limiting the maximum size of files created through that call to 1GB."
6989 #: ../src/guestfs-actions.pod:1462 ../fish/guestfish-actions.pod:971
6991 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6992 "commands which create a file in the host and attach it as a device."
6996 #: ../src/guestfs-actions.pod:1468
6997 msgid "(Added in 1.3.17)"
7001 #: ../src/guestfs-actions.pod:1470
7002 msgid "guestfs_fgrep"
7006 #: ../src/guestfs-actions.pod:1472
7010 " guestfs_fgrep (guestfs_h *g,\n"
7011 " const char *pattern,\n"
7012 " const char *path);\n"
7017 #: ../src/guestfs-actions.pod:1477 ../fish/guestfish-actions.pod:979
7019 "This calls the external C<fgrep> program and returns the matching lines."
7023 #: ../src/guestfs-actions.pod:1489
7024 msgid "guestfs_fgrepi"
7028 #: ../src/guestfs-actions.pod:1491
7032 " guestfs_fgrepi (guestfs_h *g,\n"
7033 " const char *pattern,\n"
7034 " const char *path);\n"
7039 #: ../src/guestfs-actions.pod:1496 ../fish/guestfish-actions.pod:989
7041 "This calls the external C<fgrep -i> program and returns the matching lines."
7045 #: ../src/guestfs-actions.pod:1508
7046 msgid "guestfs_file"
7050 #: ../src/guestfs-actions.pod:1510
7054 " guestfs_file (guestfs_h *g,\n"
7055 " const char *path);\n"
7060 #: ../src/guestfs-actions.pod:1514 ../fish/guestfish-actions.pod:999
7062 "This call uses the standard L<file(1)> command to determine the type or "
7063 "contents of the file."
7067 #: ../src/guestfs-actions.pod:1517 ../fish/guestfish-actions.pod:1002
7069 "This call will also transparently look inside various types of compressed "
7074 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1005
7076 "The exact command which runs is C<file -zb path>. Note in particular that "
7077 "the filename is not prepended to the output (the C<-b> option)."
7081 #: ../src/guestfs-actions.pod:1524
7083 "This command can also be used on C</dev/> devices (and partitions, LV "
7084 "names). You can for example use this to determine if a device contains a "
7085 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7089 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1014
7091 "If the C<path> does not begin with C</dev/> then this command only works for "
7092 "the content of regular files. For other file types (directory, symbolic "
7093 "link etc) it will just return the string C<directory> etc."
7097 #: ../src/guestfs-actions.pod:1539
7098 msgid "guestfs_file_architecture"
7102 #: ../src/guestfs-actions.pod:1541
7106 " guestfs_file_architecture (guestfs_h *g,\n"
7107 " const char *filename);\n"
7112 #: ../src/guestfs-actions.pod:1545 ../fish/guestfish-actions.pod:1023
7114 "This detects the architecture of the binary C<filename>, and returns it if "
7119 #: ../src/guestfs-actions.pod:1548 ../fish/guestfish-actions.pod:1026
7120 msgid "Currently defined architectures are:"
7124 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
7129 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1032
7131 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7132 "irrespective of the precise processor requirements of the binary."
7136 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
7141 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
7142 msgid "64 bit x86-64."
7146 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
7151 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
7152 msgid "32 bit SPARC."
7156 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
7161 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
7162 msgid "64 bit SPARC V9 and above."
7166 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
7171 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
7172 msgid "Intel Itanium."
7176 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
7181 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
7182 msgid "32 bit Power PC."
7186 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
7191 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1057
7192 msgid "64 bit Power PC."
7196 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
7197 msgid "Libguestfs may return other architecture strings in future."
7201 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1063
7202 msgid "The function works on at least the following types of files:"
7206 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1069
7207 msgid "many types of Un*x and Linux binary"
7211 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish-actions.pod:1073
7212 msgid "many types of Un*x and Linux shared library"
7216 #: ../src/guestfs-actions.pod:1599 ../fish/guestfish-actions.pod:1077
7217 msgid "Windows Win32 and Win64 binaries"
7221 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
7222 msgid "Windows Win32 and Win64 DLLs"
7226 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
7227 msgid "Win32 binaries and DLLs return C<i386>."
7231 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1085
7232 msgid "Win64 binaries and DLLs return C<x86_64>."
7236 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1089
7237 msgid "Linux kernel modules"
7241 #: ../src/guestfs-actions.pod:1615 ../fish/guestfish-actions.pod:1093
7242 msgid "Linux new-style initrd images"
7246 #: ../src/guestfs-actions.pod:1619 ../fish/guestfish-actions.pod:1097
7247 msgid "some non-x86 Linux vmlinuz kernels"
7251 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1101
7252 msgid "What it can't do currently:"
7256 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1107
7257 msgid "static libraries (libfoo.a)"
7261 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1111
7262 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7266 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
7267 msgid "x86 Linux vmlinuz kernels"
7271 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1117
7273 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7274 "compressed code, and are horribly hard to unpack. If you want to find the "
7275 "architecture of a kernel, use the architecture of the associated initrd or "
7276 "kernel module(s) instead."
7280 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1812
7281 #: ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:2480
7282 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2587
7283 #: ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2657
7284 #: ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2774
7285 #: ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:3009
7286 #: ../src/guestfs-actions.pod:3141
7287 msgid "(Added in 1.5.3)"
7291 #: ../src/guestfs-actions.pod:1651
7292 msgid "guestfs_filesize"
7296 #: ../src/guestfs-actions.pod:1653
7300 " guestfs_filesize (guestfs_h *g,\n"
7301 " const char *file);\n"
7306 #: ../src/guestfs-actions.pod:1657 ../fish/guestfish-actions.pod:1128
7307 msgid "This command returns the size of C<file> in bytes."
7311 #: ../src/guestfs-actions.pod:1659
7313 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7314 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7315 "devices, use C<guestfs_blockdev_getsize64>."
7319 #: ../src/guestfs-actions.pod:1665
7320 msgid "(Added in 1.0.82)"
7324 #: ../src/guestfs-actions.pod:1667
7325 msgid "guestfs_fill"
7329 #: ../src/guestfs-actions.pod:1669
7333 " guestfs_fill (guestfs_h *g,\n"
7336 " const char *path);\n"
7341 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1138
7343 "This command creates a new file called C<path>. The initial content of the "
7344 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7349 #: ../src/guestfs-actions.pod:1679
7351 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7352 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7353 "bytes use C<guestfs_fill_pattern>."
7357 #: ../src/guestfs-actions.pod:1691
7358 msgid "(Added in 1.0.79)"
7362 #: ../src/guestfs-actions.pod:1693
7363 msgid "guestfs_fill_pattern"
7367 #: ../src/guestfs-actions.pod:1695
7371 " guestfs_fill_pattern (guestfs_h *g,\n"
7372 " const char *pattern,\n"
7374 " const char *path);\n"
7379 #: ../src/guestfs-actions.pod:1701
7381 "This function is like C<guestfs_fill> except that it creates a new file of "
7382 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7383 "pattern is truncated if necessary to ensure the length of the file is "
7384 "exactly C<len> bytes."
7388 #: ../src/guestfs-actions.pod:1713
7389 msgid "(Added in 1.3.12)"
7393 #: ../src/guestfs-actions.pod:1715
7394 msgid "guestfs_find"
7398 #: ../src/guestfs-actions.pod:1717
7402 " guestfs_find (guestfs_h *g,\n"
7403 " const char *directory);\n"
7408 #: ../src/guestfs-actions.pod:1721 ../fish/guestfish-actions.pod:1160
7410 "This command lists out all files and directories, recursively, starting at "
7411 "C<directory>. It is essentially equivalent to running the shell command "
7412 "C<find directory -print> but some post-processing happens on the output, "
7417 #: ../src/guestfs-actions.pod:1726 ../fish/guestfish-actions.pod:1165
7419 "This returns a list of strings I<without any prefix>. Thus if the directory "
7424 #: ../src/guestfs-actions.pod:1729 ../fish/guestfish-actions.pod:1168
7434 #: ../src/guestfs-actions.pod:1733
7436 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7440 #: ../src/guestfs-actions.pod:1736 ../fish/guestfish-actions.pod:1175
7451 #: ../src/guestfs-actions.pod:1741 ../fish/guestfish-actions.pod:1180
7452 msgid "If C<directory> is not a directory, then this command returns an error."
7456 #: ../src/guestfs-actions.pod:1744 ../fish/guestfish-actions.pod:1183
7457 msgid "The returned list is sorted."
7461 #: ../src/guestfs-actions.pod:1746
7462 msgid "See also C<guestfs_find0>."
7466 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:3800
7467 #: ../src/guestfs-actions.pod:5327
7468 msgid "(Added in 1.0.27)"
7472 #: ../src/guestfs-actions.pod:1757
7473 msgid "guestfs_find0"
7477 #: ../src/guestfs-actions.pod:1759
7481 " guestfs_find0 (guestfs_h *g,\n"
7482 " const char *directory,\n"
7483 " const char *files);\n"
7488 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1194
7490 "This command lists out all files and directories, recursively, starting at "
7491 "C<directory>, placing the resulting list in the external file called "
7496 #: ../src/guestfs-actions.pod:1768
7498 "This command works the same way as C<guestfs_find> with the following "
7503 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1205
7504 msgid "The resulting list is written to an external file."
7508 #: ../src/guestfs-actions.pod:1779 ../fish/guestfish-actions.pod:1209
7510 "Items (filenames) in the result are separated by C<\\0> characters. See "
7511 "L<find(1)> option I<-print0>."
7515 #: ../src/guestfs-actions.pod:1784 ../fish/guestfish-actions.pod:1214
7516 msgid "This command is not limited in the number of names that it can return."
7520 #: ../src/guestfs-actions.pod:1789 ../fish/guestfish-actions.pod:1219
7521 msgid "The result list is not sorted."
7525 #: ../src/guestfs-actions.pod:1795
7526 msgid "(Added in 1.0.74)"
7530 #: ../src/guestfs-actions.pod:1797
7531 msgid "guestfs_findfs_label"
7535 #: ../src/guestfs-actions.pod:1799
7539 " guestfs_findfs_label (guestfs_h *g,\n"
7540 " const char *label);\n"
7545 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1229
7547 "This command searches the filesystems and returns the one which has the "
7548 "given label. An error is returned if no such filesystem can be found."
7552 #: ../src/guestfs-actions.pod:1807
7553 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7557 #: ../src/guestfs-actions.pod:1814
7558 msgid "guestfs_findfs_uuid"
7562 #: ../src/guestfs-actions.pod:1816
7566 " guestfs_findfs_uuid (guestfs_h *g,\n"
7567 " const char *uuid);\n"
7572 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
7574 "This command searches the filesystems and returns the one which has the "
7575 "given UUID. An error is returned if no such filesystem can be found."
7579 #: ../src/guestfs-actions.pod:1824
7580 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7584 #: ../src/guestfs-actions.pod:1831
7585 msgid "guestfs_fsck"
7589 #: ../src/guestfs-actions.pod:1833
7593 " guestfs_fsck (guestfs_h *g,\n"
7594 " const char *fstype,\n"
7595 " const char *device);\n"
7600 #: ../src/guestfs-actions.pod:1838 ../fish/guestfish-actions.pod:1249
7602 "This runs the filesystem checker (fsck) on C<device> which should have "
7603 "filesystem type C<fstype>."
7607 #: ../src/guestfs-actions.pod:1841 ../fish/guestfish-actions.pod:1252
7609 "The returned integer is the status. See L<fsck(8)> for the list of status "
7610 "codes from C<fsck>."
7614 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:1261
7615 msgid "Multiple status codes can be summed together."
7619 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1265
7621 "A non-zero return code can mean \"success\", for example if errors have been "
7622 "corrected on the filesystem."
7626 #: ../src/guestfs-actions.pod:1859 ../fish/guestfish-actions.pod:1270
7627 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7631 #: ../src/guestfs-actions.pod:1864 ../fish/guestfish-actions.pod:1275
7633 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7637 #: ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:6974
7638 msgid "(Added in 1.0.16)"
7642 #: ../src/guestfs-actions.pod:1870
7643 msgid "guestfs_get_append"
7647 #: ../src/guestfs-actions.pod:1872
7651 " guestfs_get_append (guestfs_h *g);\n"
7656 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1281
7658 "Return the additional kernel options which are added to the guest kernel "
7663 #: ../src/guestfs-actions.pod:1878 ../fish/guestfish-actions.pod:1284
7664 msgid "If C<NULL> then no options are added."
7668 #: ../src/guestfs-actions.pod:1880
7670 "This function returns a string which may be NULL. There is no way to return "
7671 "an error from this function. The string is owned by the guest handle and "
7672 "must I<not> be freed."
7676 #: ../src/guestfs-actions.pod:1884 ../src/guestfs-actions.pod:5005
7677 #: ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5836
7678 #: ../src/guestfs-actions.pod:5855 ../src/guestfs-actions.pod:5871
7679 #: ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:6645
7680 #: ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:7017
7681 msgid "(Added in 1.0.26)"
7685 #: ../src/guestfs-actions.pod:1886
7686 msgid "guestfs_get_autosync"
7690 #: ../src/guestfs-actions.pod:1888
7694 " guestfs_get_autosync (guestfs_h *g);\n"
7699 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1290
7700 msgid "Get the autosync flag."
7704 #: ../src/guestfs-actions.pod:1897
7705 msgid "guestfs_get_direct"
7709 #: ../src/guestfs-actions.pod:1899
7713 " guestfs_get_direct (guestfs_h *g);\n"
7718 #: ../src/guestfs-actions.pod:1902 ../fish/guestfish-actions.pod:1296
7719 msgid "Return the direct appliance mode flag."
7723 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:5509
7724 msgid "(Added in 1.0.72)"
7728 #: ../src/guestfs-actions.pod:1908
7729 msgid "guestfs_get_e2label"
7733 #: ../src/guestfs-actions.pod:1910
7737 " guestfs_get_e2label (guestfs_h *g,\n"
7738 " const char *device);\n"
7743 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1302
7745 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7749 #: ../src/guestfs-actions.pod:1920 ../fish/guestfish-actions.pod:1305
7751 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7755 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1948
7756 #: ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546
7757 msgid "(Added in 1.0.15)"
7761 #: ../src/guestfs-actions.pod:1929
7762 msgid "guestfs_get_e2uuid"
7766 #: ../src/guestfs-actions.pod:1931
7770 " guestfs_get_e2uuid (guestfs_h *g,\n"
7771 " const char *device);\n"
7776 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1316
7778 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7782 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1319
7784 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7788 #: ../src/guestfs-actions.pod:1950
7789 msgid "guestfs_get_memsize"
7793 #: ../src/guestfs-actions.pod:1952
7797 " guestfs_get_memsize (guestfs_h *g);\n"
7802 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1330
7804 "This gets the memory size in megabytes allocated to the qemu subprocess."
7808 #: ../src/guestfs-actions.pod:1958
7810 "If C<guestfs_set_memsize> was not called on this handle, and if "
7811 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7812 "value for memsize."
7816 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:2043
7817 #: ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5669
7818 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7819 #: ../fish/guestfish-actions.pod:3711 ../fish/guestfish-actions.pod:3798
7821 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7825 #: ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:4091
7826 #: ../src/guestfs-actions.pod:4272 ../src/guestfs-actions.pod:4291
7827 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4322
7828 #: ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:4352
7829 #: ../src/guestfs-actions.pod:5230 ../src/guestfs-actions.pod:5567
7830 #: ../src/guestfs-actions.pod:5810 ../src/guestfs-actions.pod:6411
7831 msgid "(Added in 1.0.55)"
7835 #: ../src/guestfs-actions.pod:1969
7836 msgid "guestfs_get_network"
7840 #: ../src/guestfs-actions.pod:1971
7844 " guestfs_get_network (guestfs_h *g);\n"
7849 #: ../src/guestfs-actions.pod:1974 ../fish/guestfish-actions.pod:1344
7850 msgid "This returns the enable network flag."
7854 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:5586
7855 msgid "(Added in 1.5.4)"
7859 #: ../src/guestfs-actions.pod:1980
7860 msgid "guestfs_get_path"
7864 #: ../src/guestfs-actions.pod:1982
7868 " guestfs_get_path (guestfs_h *g);\n"
7873 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
7874 msgid "Return the current search path."
7878 #: ../src/guestfs-actions.pod:1987 ../fish/guestfish-actions.pod:1352
7880 "This is always non-NULL. If it wasn't set already, then this will return "
7885 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:2019
7887 "This function returns a string, or NULL on error. The string is owned by "
7888 "the guest handle and must I<not> be freed."
7892 #: ../src/guestfs-actions.pod:1995
7893 msgid "guestfs_get_pid"
7897 #: ../src/guestfs-actions.pod:1997
7901 " guestfs_get_pid (guestfs_h *g);\n"
7906 #: ../src/guestfs-actions.pod:2000 ../fish/guestfish-actions.pod:1361
7908 "Return the process ID of the qemu subprocess. If there is no qemu "
7909 "subprocess, then this will return an error."
7913 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1364
7914 msgid "This is an internal call used for debugging and testing."
7918 #: ../src/guestfs-actions.pod:2007
7919 msgid "(Added in 1.0.56)"
7923 #: ../src/guestfs-actions.pod:2009
7924 msgid "guestfs_get_qemu"
7928 #: ../src/guestfs-actions.pod:2011
7932 " guestfs_get_qemu (guestfs_h *g);\n"
7937 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
7938 msgid "Return the current qemu binary."
7942 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
7944 "This is always non-NULL. If it wasn't set already, then this will return "
7945 "the default qemu binary name."
7949 #: ../src/guestfs-actions.pod:2022 ../src/guestfs-actions.pod:5631
7950 msgid "(Added in 1.0.6)"
7954 #: ../src/guestfs-actions.pod:2024
7955 msgid "guestfs_get_recovery_proc"
7959 #: ../src/guestfs-actions.pod:2026
7963 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7968 #: ../src/guestfs-actions.pod:2029 ../fish/guestfish-actions.pod:1379
7969 msgid "Return the recovery process enabled flag."
7973 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:3231
7974 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3898
7975 #: ../src/guestfs-actions.pod:3930 ../src/guestfs-actions.pod:4935
7976 #: ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5655
7977 #: ../src/guestfs-actions.pod:6314 ../src/guestfs-actions.pod:6334
7978 #: ../src/guestfs-actions.pod:6526
7979 msgid "(Added in 1.0.77)"
7983 #: ../src/guestfs-actions.pod:2035
7984 msgid "guestfs_get_selinux"
7988 #: ../src/guestfs-actions.pod:2037
7992 " guestfs_get_selinux (guestfs_h *g);\n"
7997 #: ../src/guestfs-actions.pod:2040
7999 "This returns the current setting of the selinux flag which is passed to the "
8000 "appliance at boot time. See C<guestfs_set_selinux>."
8004 #: ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2111
8005 #: ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:5728
8006 msgid "(Added in 1.0.67)"
8010 #: ../src/guestfs-actions.pod:2050
8011 msgid "guestfs_get_state"
8015 #: ../src/guestfs-actions.pod:2052
8019 " guestfs_get_state (guestfs_h *g);\n"
8024 #: ../src/guestfs-actions.pod:2055 ../fish/guestfish-actions.pod:1395
8026 "This returns the current state as an opaque integer. This is only useful "
8027 "for printing debug and internal error messages."
8031 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:3034
8032 #: ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3124
8033 #: ../src/guestfs-actions.pod:3151 ../fish/guestfish-actions.pod:1398
8034 #: ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2131
8035 #: ../fish/guestfish-actions.pod:2169 ../fish/guestfish-actions.pod:2185
8036 msgid "For more information on states, see L<guestfs(3)>."
8040 #: ../src/guestfs-actions.pod:2064
8041 msgid "guestfs_get_trace"
8045 #: ../src/guestfs-actions.pod:2066
8049 " guestfs_get_trace (guestfs_h *g);\n"
8054 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1404
8055 msgid "Return the command trace flag."
8059 #: ../src/guestfs-actions.pod:2075
8060 msgid "guestfs_get_umask"
8064 #: ../src/guestfs-actions.pod:2077
8068 " guestfs_get_umask (guestfs_h *g);\n"
8073 #: ../src/guestfs-actions.pod:2080
8075 "Return the current umask. By default the umask is C<022> unless it has been "
8076 "set by calling C<guestfs_umask>."
8080 #: ../src/guestfs-actions.pod:2087
8081 msgid "guestfs_get_verbose"
8085 #: ../src/guestfs-actions.pod:2089
8089 " guestfs_get_verbose (guestfs_h *g);\n"
8094 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
8095 msgid "This returns the verbose messages flag."
8099 #: ../src/guestfs-actions.pod:2098
8100 msgid "guestfs_getcon"
8104 #: ../src/guestfs-actions.pod:2100
8108 " guestfs_getcon (guestfs_h *g);\n"
8113 #: ../src/guestfs-actions.pod:2103 ../fish/guestfish-actions.pod:1423
8114 msgid "This gets the SELinux security context of the daemon."
8118 #: ../src/guestfs-actions.pod:2105
8120 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8124 #: ../src/guestfs-actions.pod:2113
8125 msgid "guestfs_getxattrs"
8129 #: ../src/guestfs-actions.pod:2115
8132 " struct guestfs_xattr_list *\n"
8133 " guestfs_getxattrs (guestfs_h *g,\n"
8134 " const char *path);\n"
8139 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1432
8141 "This call lists the extended attributes of the file or directory C<path>."
8145 #: ../src/guestfs-actions.pod:2122 ../fish/guestfish-actions.pod:1435
8147 "At the system call level, this is a combination of the L<listxattr(2)> and "
8148 "L<getxattr(2)> calls."
8152 #: ../src/guestfs-actions.pod:2125
8153 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8157 #: ../src/guestfs-actions.pod:2127 ../src/guestfs-actions.pod:3243
8158 #: ../src/guestfs-actions.pod:3894
8160 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8161 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8165 #: ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:3247
8166 #: ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3448
8167 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5747
8168 #: ../src/guestfs-actions.pod:7082
8169 msgid "(Added in 1.0.59)"
8173 #: ../src/guestfs-actions.pod:2133
8174 msgid "guestfs_glob_expand"
8178 #: ../src/guestfs-actions.pod:2135
8182 " guestfs_glob_expand (guestfs_h *g,\n"
8183 " const char *pattern);\n"
8188 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1444
8190 "This command searches for all the pathnames matching C<pattern> according to "
8191 "the wildcard expansion rules used by the shell."
8195 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1448
8197 "If no paths match, then this returns an empty list (note: not an error)."
8201 #: ../src/guestfs-actions.pod:2146 ../fish/guestfish-actions.pod:1451
8203 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8204 "GLOB_BRACE>. See that manual page for more details."
8208 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:5912
8209 #: ../src/guestfs-actions.pod:5929
8210 msgid "(Added in 1.0.50)"
8214 #: ../src/guestfs-actions.pod:2156
8215 msgid "guestfs_grep"
8219 #: ../src/guestfs-actions.pod:2158
8223 " guestfs_grep (guestfs_h *g,\n"
8224 " const char *regex,\n"
8225 " const char *path);\n"
8230 #: ../src/guestfs-actions.pod:2163 ../fish/guestfish-actions.pod:1459
8231 msgid "This calls the external C<grep> program and returns the matching lines."
8235 #: ../src/guestfs-actions.pod:2175
8236 msgid "guestfs_grepi"
8240 #: ../src/guestfs-actions.pod:2177
8244 " guestfs_grepi (guestfs_h *g,\n"
8245 " const char *regex,\n"
8246 " const char *path);\n"
8251 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1469
8253 "This calls the external C<grep -i> program and returns the matching lines."
8257 #: ../src/guestfs-actions.pod:2194
8258 msgid "guestfs_grub_install"
8262 #: ../src/guestfs-actions.pod:2196
8266 " guestfs_grub_install (guestfs_h *g,\n"
8267 " const char *root,\n"
8268 " const char *device);\n"
8273 #: ../src/guestfs-actions.pod:2201 ../fish/guestfish-actions.pod:1479
8275 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8276 "the root directory being C<root>."
8280 #: ../src/guestfs-actions.pod:2204 ../fish/guestfish-actions.pod:1482
8282 "Note: If grub-install reports the error \"No suitable drive was found in the "
8283 "generated device map.\" it may be that you need to create a C</boot/grub/"
8284 "device.map> file first that contains the mapping between grub device names "
8285 "and Linux device names. It is usually sufficient to create a file "
8290 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1489
8298 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1491
8299 msgid "replacing C</dev/vda> with the name of the installation device."
8303 #: ../src/guestfs-actions.pod:2217
8304 msgid "(Added in 1.0.17)"
8308 #: ../src/guestfs-actions.pod:2219
8309 msgid "guestfs_head"
8313 #: ../src/guestfs-actions.pod:2221
8317 " guestfs_head (guestfs_h *g,\n"
8318 " const char *path);\n"
8323 #: ../src/guestfs-actions.pod:2225 ../fish/guestfish-actions.pod:1497
8325 "This command returns up to the first 10 lines of a file as a list of strings."
8329 #: ../src/guestfs-actions.pod:2237
8330 msgid "guestfs_head_n"
8334 #: ../src/guestfs-actions.pod:2239
8338 " guestfs_head_n (guestfs_h *g,\n"
8340 " const char *path);\n"
8345 #: ../src/guestfs-actions.pod:2244 ../fish/guestfish-actions.pod:1507
8347 "If the parameter C<nrlines> is a positive number, this returns the first "
8348 "C<nrlines> lines of the file C<path>."
8352 #: ../src/guestfs-actions.pod:2247 ../fish/guestfish-actions.pod:1510
8354 "If the parameter C<nrlines> is a negative number, this returns lines from "
8355 "the file C<path>, excluding the last C<nrlines> lines."
8359 #: ../src/guestfs-actions.pod:2250 ../src/guestfs-actions.pod:6209
8360 #: ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:4144
8361 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8365 #: ../src/guestfs-actions.pod:2261
8366 msgid "guestfs_hexdump"
8370 #: ../src/guestfs-actions.pod:2263
8374 " guestfs_hexdump (guestfs_h *g,\n"
8375 " const char *path);\n"
8380 #: ../src/guestfs-actions.pod:2267 ../fish/guestfish-actions.pod:1522
8382 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8383 "readable, canonical hex dump of the file."
8387 #: ../src/guestfs-actions.pod:2276 ../src/guestfs-actions.pod:5993
8388 #: ../src/guestfs-actions.pod:6048
8389 msgid "(Added in 1.0.22)"
8393 #: ../src/guestfs-actions.pod:2278
8394 msgid "guestfs_initrd_cat"
8398 #: ../src/guestfs-actions.pod:2280
8402 " guestfs_initrd_cat (guestfs_h *g,\n"
8403 " const char *initrdpath,\n"
8404 " const char *filename,\n"
8405 " size_t *size_r);\n"
8410 #: ../src/guestfs-actions.pod:2286 ../fish/guestfish-actions.pod:1532
8412 "This command unpacks the file C<filename> from the initrd file called "
8413 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8418 #: ../src/guestfs-actions.pod:2290 ../fish/guestfish-actions.pod:1536
8420 "For example, in guestfish you could use the following command to examine the "
8421 "boot script (usually called C</init>) contained in a Linux initrd or "
8426 #: ../src/guestfs-actions.pod:2294 ../fish/guestfish-actions.pod:1540
8429 " initrd-cat /boot/initrd-<version>.img init\n"
8434 #: ../src/guestfs-actions.pod:2296
8435 msgid "See also C<guestfs_initrd_list>."
8439 #: ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:4928
8440 #: ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:5135
8442 "This function returns a buffer, or NULL on error. The size of the returned "
8443 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8448 #: ../src/guestfs-actions.pod:2307
8449 msgid "guestfs_initrd_list"
8453 #: ../src/guestfs-actions.pod:2309
8457 " guestfs_initrd_list (guestfs_h *g,\n"
8458 " const char *path);\n"
8463 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1551
8464 msgid "This command lists out files contained in an initrd."
8468 #: ../src/guestfs-actions.pod:2315 ../fish/guestfish-actions.pod:1553
8470 "The files are listed without any initial C</> character. The files are "
8471 "listed in the order they appear (not necessarily alphabetical). Directory "
8472 "names are listed as separate items."
8476 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1557
8478 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8479 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8484 #: ../src/guestfs-actions.pod:2329
8485 msgid "guestfs_inotify_add_watch"
8489 #: ../src/guestfs-actions.pod:2331
8493 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8494 " const char *path,\n"
8500 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1565
8501 msgid "Watch C<path> for the events listed in C<mask>."
8505 #: ../src/guestfs-actions.pod:2338 ../fish/guestfish-actions.pod:1567
8507 "Note that if C<path> is a directory then events within that directory are "
8508 "watched, but this does I<not> happen recursively (in subdirectories)."
8512 #: ../src/guestfs-actions.pod:2342 ../fish/guestfish-actions.pod:1571
8514 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8515 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8519 #: ../src/guestfs-actions.pod:2350
8520 msgid "guestfs_inotify_close"
8524 #: ../src/guestfs-actions.pod:2352
8528 " guestfs_inotify_close (guestfs_h *g);\n"
8533 #: ../src/guestfs-actions.pod:2355 ../fish/guestfish-actions.pod:1579
8535 "This closes the inotify handle which was previously opened by inotify_init. "
8536 "It removes all watches, throws away any pending events, and deallocates all "
8541 #: ../src/guestfs-actions.pod:2363
8542 msgid "guestfs_inotify_files"
8546 #: ../src/guestfs-actions.pod:2365
8550 " guestfs_inotify_files (guestfs_h *g);\n"
8555 #: ../src/guestfs-actions.pod:2368
8557 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8558 "returns a list of pathnames of objects that were touched. The returned "
8559 "pathnames are sorted and deduplicated."
8563 #: ../src/guestfs-actions.pod:2378
8564 msgid "guestfs_inotify_init"
8568 #: ../src/guestfs-actions.pod:2380
8572 " guestfs_inotify_init (guestfs_h *g,\n"
8573 " int maxevents);\n"
8578 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1595
8580 "This command creates a new inotify handle. The inotify subsystem can be "
8581 "used to notify events which happen to objects in the guest filesystem."
8585 #: ../src/guestfs-actions.pod:2388
8587 "C<maxevents> is the maximum number of events which will be queued up between "
8588 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8589 "passed as C<0>, then the kernel (or previously set) default is used. For "
8590 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8591 "throws away events, but records the fact that it threw them away by setting "
8592 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8593 "C<guestfs_inotify_read>)."
8597 #: ../src/guestfs-actions.pod:2398
8599 "Before any events are generated, you have to add some watches to the "
8600 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8601 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8605 #: ../src/guestfs-actions.pod:2404
8607 "Queued up events should be read periodically by calling "
8608 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8609 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8610 "often enough then you risk the internal queue overflowing."
8614 #: ../src/guestfs-actions.pod:2411
8616 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8617 "This also removes any watches automatically."
8621 #: ../src/guestfs-actions.pod:2415 ../fish/guestfish-actions.pod:1626
8623 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8624 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8625 "that there is one global inotify handle per libguestfs instance."
8629 #: ../src/guestfs-actions.pod:2424
8630 msgid "guestfs_inotify_read"
8634 #: ../src/guestfs-actions.pod:2426
8637 " struct guestfs_inotify_event_list *\n"
8638 " guestfs_inotify_read (guestfs_h *g);\n"
8643 #: ../src/guestfs-actions.pod:2429 ../fish/guestfish-actions.pod:1635
8645 "Return the complete queue of events that have happened since the previous "
8650 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1638
8651 msgid "If no events have happened, this returns an empty list."
8655 #: ../src/guestfs-actions.pod:2434 ../fish/guestfish-actions.pod:1640
8657 "I<Note>: In order to make sure that all events have been read, you must call "
8658 "this function repeatedly until it returns an empty list. The reason is that "
8659 "the call will read events up to the maximum appliance-to-host message size "
8660 "and leave remaining events in the queue."
8664 #: ../src/guestfs-actions.pod:2440
8666 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8667 "there was an error. I<The caller must call "
8668 "C<guestfs_free_inotify_event_list> after use>."
8672 #: ../src/guestfs-actions.pod:2446
8673 msgid "guestfs_inotify_rm_watch"
8677 #: ../src/guestfs-actions.pod:2448
8681 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8687 #: ../src/guestfs-actions.pod:2452
8689 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8693 #: ../src/guestfs-actions.pod:2459
8694 msgid "guestfs_inspect_get_arch"
8698 #: ../src/guestfs-actions.pod:2461
8702 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8703 " const char *root);\n"
8708 #: ../src/guestfs-actions.pod:2465 ../src/guestfs-actions.pod:2488
8709 #: ../src/guestfs-actions.pod:2569 ../src/guestfs-actions.pod:2595
8710 #: ../src/guestfs-actions.pod:2617 ../src/guestfs-actions.pod:2644
8711 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:2698
8712 #: ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:2758
8713 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2844
8714 #: ../src/guestfs-actions.pod:2867
8716 "This function should only be called with a root device string as returned by "
8717 "C<guestfs_inspect_os>."
8721 #: ../src/guestfs-actions.pod:2468
8723 "This returns the architecture of the inspected operating system. The "
8724 "possible return values are listed under C<guestfs_file_architecture>."
8728 #: ../src/guestfs-actions.pod:2472 ../fish/guestfish-actions.pod:1664
8730 "If the architecture could not be determined, then the string C<unknown> is "
8735 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2556
8736 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2632
8737 #: ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2745
8738 #: ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2788
8739 #: ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2854
8740 #: ../src/guestfs-actions.pod:2960 ../src/guestfs-actions.pod:3001
8741 #: ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1741
8742 #: ../fish/guestfish-actions.pod:1774 ../fish/guestfish-actions.pod:1795
8743 #: ../fish/guestfish-actions.pod:1855 ../fish/guestfish-actions.pod:1879
8744 #: ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1909
8745 #: ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1960
8746 #: ../fish/guestfish-actions.pod:2059 ../fish/guestfish-actions.pod:2093
8747 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8751 #: ../src/guestfs-actions.pod:2482
8752 msgid "guestfs_inspect_get_distro"
8756 #: ../src/guestfs-actions.pod:2484
8760 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8761 " const char *root);\n"
8766 #: ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1676
8768 "This returns the distro (distribution) of the inspected operating system."
8772 #: ../src/guestfs-actions.pod:2494 ../fish/guestfish-actions.pod:1679
8773 msgid "Currently defined distros are:"
8777 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1683
8778 msgid "\"archlinux\""
8782 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1685
8787 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1687
8792 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1689
8797 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1691
8802 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1693
8807 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1695
8812 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1697
8817 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1699
8818 msgid "\"linuxmint\""
8822 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1701
8827 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1703
8828 msgid "\"mandriva\""
8832 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1705
8837 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1707
8842 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1709
8847 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1711
8852 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1713
8857 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1715
8858 msgid "\"redhat-based\""
8862 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1717
8863 msgid "Some Red Hat-derived distro."
8867 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1719
8872 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1721
8873 msgid "Red Hat Enterprise Linux and some derivatives."
8877 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1723
8882 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1725
8887 #: ../src/guestfs-actions.pod:2542 ../src/guestfs-actions.pod:2822
8888 #: ../fish/guestfish-actions.pod:1727 ../fish/guestfish-actions.pod:1935
8893 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1729
8894 msgid "The distro could not be determined."
8898 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2814
8899 #: ../fish/guestfish-actions.pod:1731 ../fish/guestfish-actions.pod:1927
8904 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1733
8906 "Windows does not have distributions. This string is returned if the OS type "
8911 #: ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2828
8912 #: ../fish/guestfish-actions.pod:1738 ../fish/guestfish-actions.pod:1941
8914 "Future versions of libguestfs may return other strings here. The caller "
8915 "should be prepared to handle any string."
8919 #: ../src/guestfs-actions.pod:2563
8920 msgid "guestfs_inspect_get_filesystems"
8924 #: ../src/guestfs-actions.pod:2565
8928 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8929 " const char *root);\n"
8934 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1750
8936 "This returns a list of all the filesystems that we think are associated with "
8937 "this operating system. This includes the root filesystem, other ordinary "
8938 "filesystems, and non-mounted devices like swap partitions."
8942 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1755
8944 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8945 "to be shared between operating systems."
8949 #: ../src/guestfs-actions.pod:2580
8951 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8952 "C<guestfs_inspect_get_mountpoints>."
8956 #: ../src/guestfs-actions.pod:2589
8957 msgid "guestfs_inspect_get_hostname"
8961 #: ../src/guestfs-actions.pod:2591
8965 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
8966 " const char *root);\n"
8971 #: ../src/guestfs-actions.pod:2598 ../fish/guestfish-actions.pod:1768
8973 "This function returns the hostname of the operating system as found by "
8974 "inspection of the guest's configuration files."
8978 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1771
8980 "If the hostname could not be determined, then the string C<unknown> is "
8985 #: ../src/guestfs-actions.pod:2609
8986 msgid "(Added in 1.7.9)"
8990 #: ../src/guestfs-actions.pod:2611
8991 msgid "guestfs_inspect_get_major_version"
8995 #: ../src/guestfs-actions.pod:2613
8999 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
9000 " const char *root);\n"
9005 #: ../src/guestfs-actions.pod:2620 ../fish/guestfish-actions.pod:1783
9007 "This returns the major version number of the inspected operating system."
9011 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1786
9013 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9014 "popular public names used by the operating system. Notably the operating "
9015 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9016 "1). You can find out the real versions corresponding to releases of Windows "
9017 "by consulting Wikipedia or MSDN."
9021 #: ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2650
9022 #: ../fish/guestfish-actions.pod:1793 ../fish/guestfish-actions.pod:1807
9023 msgid "If the version could not be determined, then C<0> is returned."
9027 #: ../src/guestfs-actions.pod:2638
9028 msgid "guestfs_inspect_get_minor_version"
9032 #: ../src/guestfs-actions.pod:2640
9036 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9037 " const char *root);\n"
9042 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:1804
9044 "This returns the minor version number of the inspected operating system."
9048 #: ../src/guestfs-actions.pod:2652
9050 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9051 "C<guestfs_inspect_get_major_version>."
9055 #: ../src/guestfs-actions.pod:2659
9056 msgid "guestfs_inspect_get_mountpoints"
9060 #: ../src/guestfs-actions.pod:2661
9064 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9065 " const char *root);\n"
9070 #: ../src/guestfs-actions.pod:2668 ../fish/guestfish-actions.pod:1819
9072 "This returns a hash of where we think the filesystems associated with this "
9073 "operating system should be mounted. Callers should note that this is at "
9074 "best an educated guess made by reading configuration files such as C</etc/"
9079 #: ../src/guestfs-actions.pod:2673 ../fish/guestfish-actions.pod:1824
9081 "Each element in the returned hashtable has a key which is the path of the "
9082 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9083 "mounted there (eg. C</dev/sda1>)."
9087 #: ../src/guestfs-actions.pod:2678 ../fish/guestfish-actions.pod:1829
9089 "Non-mounted devices such as swap devices are I<not> returned in this list."
9093 #: ../src/guestfs-actions.pod:2681
9095 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9096 "C<guestfs_inspect_get_filesystems>."
9100 #: ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:3300
9101 #: ../src/guestfs-actions.pod:4494 ../src/guestfs-actions.pod:6350
9103 "This function returns a NULL-terminated array of strings, or NULL if there "
9104 "was an error. The array of strings will always have length C<2n+1>, where "
9105 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9106 "caller must free the strings and the array after use>."
9110 #: ../src/guestfs-actions.pod:2692
9111 msgid "guestfs_inspect_get_package_format"
9115 #: ../src/guestfs-actions.pod:2694
9119 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9120 " const char *root);\n"
9125 #: ../src/guestfs-actions.pod:2701
9127 "This function and C<guestfs_inspect_get_package_management> return the "
9128 "package format and package management tool used by the inspected operating "
9129 "system. For example for Fedora these functions would return C<rpm> (package "
9130 "format) and C<yum> (package management)."
9134 #: ../src/guestfs-actions.pod:2707 ../fish/guestfish-actions.pod:1848
9136 "This returns the string C<unknown> if we could not determine the package "
9137 "format I<or> if the operating system does not have a real packaging system "
9142 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:1852
9144 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9145 "Future versions of libguestfs may return other strings."
9149 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2750
9150 msgid "(Added in 1.7.5)"
9154 #: ../src/guestfs-actions.pod:2721
9155 msgid "guestfs_inspect_get_package_management"
9159 #: ../src/guestfs-actions.pod:2723
9163 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9164 " const char *root);\n"
9169 #: ../src/guestfs-actions.pod:2730
9171 "C<guestfs_inspect_get_package_format> and this function return the package "
9172 "format and package management tool used by the inspected operating system. "
9173 "For example for Fedora these functions would return C<rpm> (package format) "
9174 "and C<yum> (package management)."
9178 #: ../src/guestfs-actions.pod:2736 ../fish/guestfish-actions.pod:1870
9180 "This returns the string C<unknown> if we could not determine the package "
9181 "management tool I<or> if the operating system does not have a real packaging "
9182 "system (eg. Windows)."
9186 #: ../src/guestfs-actions.pod:2740 ../fish/guestfish-actions.pod:1874
9188 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9189 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9190 "libguestfs may return other strings."
9194 #: ../src/guestfs-actions.pod:2752
9195 msgid "guestfs_inspect_get_product_name"
9199 #: ../src/guestfs-actions.pod:2754
9203 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9204 " const char *root);\n"
9209 #: ../src/guestfs-actions.pod:2761 ../fish/guestfish-actions.pod:1888
9211 "This returns the product name of the inspected operating system. The "
9212 "product name is generally some freeform string which can be displayed to the "
9213 "user, but should not be parsed by programs."
9217 #: ../src/guestfs-actions.pod:2766 ../fish/guestfish-actions.pod:1893
9219 "If the product name could not be determined, then the string C<unknown> is "
9224 #: ../src/guestfs-actions.pod:2776
9225 msgid "guestfs_inspect_get_roots"
9229 #: ../src/guestfs-actions.pod:2778
9233 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9238 #: ../src/guestfs-actions.pod:2781
9240 "This function is a convenient way to get the list of root devices, as "
9241 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9242 "the whole inspection process."
9246 #: ../src/guestfs-actions.pod:2785
9248 "This returns an empty list if either no root devices were found or the "
9249 "caller has not called C<guestfs_inspect_os>."
9253 #: ../src/guestfs-actions.pod:2794
9254 msgid "(Added in 1.7.3)"
9258 #: ../src/guestfs-actions.pod:2796
9259 msgid "guestfs_inspect_get_type"
9263 #: ../src/guestfs-actions.pod:2798
9267 " guestfs_inspect_get_type (guestfs_h *g,\n"
9268 " const char *root);\n"
9273 #: ../src/guestfs-actions.pod:2805 ../fish/guestfish-actions.pod:1918
9275 "This returns the type of the inspected operating system. Currently defined "
9280 #: ../src/guestfs-actions.pod:2810 ../fish/guestfish-actions.pod:1923
9285 #: ../src/guestfs-actions.pod:2812 ../fish/guestfish-actions.pod:1925
9286 msgid "Any Linux-based operating system."
9290 #: ../src/guestfs-actions.pod:2816 ../fish/guestfish-actions.pod:1929
9291 msgid "Any Microsoft Windows operating system."
9295 #: ../src/guestfs-actions.pod:2818 ../fish/guestfish-actions.pod:1931
9300 #: ../src/guestfs-actions.pod:2820 ../fish/guestfish-actions.pod:1933
9305 #: ../src/guestfs-actions.pod:2824 ../fish/guestfish-actions.pod:1937
9306 msgid "The operating system type could not be determined."
9310 #: ../src/guestfs-actions.pod:2838
9311 msgid "guestfs_inspect_get_windows_systemroot"
9315 #: ../src/guestfs-actions.pod:2840
9319 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9320 " const char *root);\n"
9325 #: ../src/guestfs-actions.pod:2847 ../fish/guestfish-actions.pod:1953
9327 "This returns the Windows systemroot of the inspected guest. The systemroot "
9328 "is a directory path such as C</WINDOWS>."
9332 #: ../src/guestfs-actions.pod:2850 ../fish/guestfish-actions.pod:1956
9334 "This call assumes that the guest is Windows and that the systemroot could be "
9335 "determined by inspection. If this is not the case then an error is returned."
9339 #: ../src/guestfs-actions.pod:2859
9340 msgid "(Added in 1.5.25)"
9344 #: ../src/guestfs-actions.pod:2861
9345 msgid "guestfs_inspect_list_applications"
9349 #: ../src/guestfs-actions.pod:2863
9352 " struct guestfs_application_list *\n"
9353 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9354 " const char *root);\n"
9359 #: ../src/guestfs-actions.pod:2870 ../fish/guestfish-actions.pod:1969
9360 msgid "Return the list of applications installed in the operating system."
9364 #: ../src/guestfs-actions.pod:2872
9366 "I<Note:> This call works differently from other parts of the inspection "
9367 "API. You have to call C<guestfs_inspect_os>, then "
9368 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9369 "this. Listing applications is a significantly more difficult operation "
9370 "which requires access to the full filesystem. Also note that unlike the "
9371 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9372 "the libguestfs handle, this call actually reads parts of the mounted "
9373 "filesystems during the call."
9377 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:1981
9379 "This returns an empty list if the inspection code was not able to determine "
9380 "the list of applications."
9384 #: ../src/guestfs-actions.pod:2885 ../fish/guestfish-actions.pod:1984
9385 msgid "The application structure contains the following fields:"
9389 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:1988
9394 #: ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:1990
9396 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9397 "guests, this is the package name."
9401 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:1993
9402 msgid "C<app_display_name>"
9406 #: ../src/guestfs-actions.pod:2896 ../fish/guestfish-actions.pod:1995
9408 "The display name of the application, sometimes localized to the install "
9409 "language of the guest operating system."
9413 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:1998
9415 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9416 "to display something can use C<app_name> instead."
9420 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2001
9421 msgid "C<app_epoch>"
9425 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2003
9427 "For package managers which use epochs, this contains the epoch of the "
9428 "package (an integer). If unavailable, this is returned as C<0>."
9432 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2006
9433 msgid "C<app_version>"
9437 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2008
9439 "The version string of the application or package. If unavailable this is "
9440 "returned as an empty string C<\"\">."
9444 #: ../src/guestfs-actions.pod:2912 ../fish/guestfish-actions.pod:2011
9445 msgid "C<app_release>"
9449 #: ../src/guestfs-actions.pod:2914 ../fish/guestfish-actions.pod:2013
9451 "The release string of the application or package, for package managers that "
9452 "use this. If unavailable this is returned as an empty string C<\"\">."
9456 #: ../src/guestfs-actions.pod:2918 ../fish/guestfish-actions.pod:2017
9457 msgid "C<app_install_path>"
9461 #: ../src/guestfs-actions.pod:2920 ../fish/guestfish-actions.pod:2019
9463 "The installation path of the application (on operating systems such as "
9464 "Windows which use installation paths). This path is in the format used by "
9465 "the guest operating system, it is not a libguestfs path."
9469 #: ../src/guestfs-actions.pod:2925 ../fish/guestfish-actions.pod:2024
9470 msgid "If unavailable this is returned as an empty string C<\"\">."
9474 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2026
9475 msgid "C<app_trans_path>"
9479 #: ../src/guestfs-actions.pod:2929 ../fish/guestfish-actions.pod:2028
9481 "The install path translated into a libguestfs path. If unavailable this is "
9482 "returned as an empty string C<\"\">."
9486 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2031
9487 msgid "C<app_publisher>"
9491 #: ../src/guestfs-actions.pod:2934 ../fish/guestfish-actions.pod:2033
9493 "The name of the publisher of the application, for package managers that use "
9494 "this. If unavailable this is returned as an empty string C<\"\">."
9498 #: ../src/guestfs-actions.pod:2938 ../fish/guestfish-actions.pod:2037
9503 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2039
9505 "The URL (eg. upstream URL) of the application. If unavailable this is "
9506 "returned as an empty string C<\"\">."
9510 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2042
9511 msgid "C<app_source_package>"
9515 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2044
9517 "For packaging systems which support this, the name of the source package. "
9518 "If unavailable this is returned as an empty string C<\"\">."
9522 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2047
9523 msgid "C<app_summary>"
9527 #: ../src/guestfs-actions.pod:2950 ../fish/guestfish-actions.pod:2049
9529 "A short (usually one line) description of the application or package. If "
9530 "unavailable this is returned as an empty string C<\"\">."
9534 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2052
9535 msgid "C<app_description>"
9539 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2054
9541 "A longer description of the application or package. If unavailable this is "
9542 "returned as an empty string C<\"\">."
9546 #: ../src/guestfs-actions.pod:2962
9548 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9549 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9554 #: ../src/guestfs-actions.pod:2966
9555 msgid "(Added in 1.7.8)"
9559 #: ../src/guestfs-actions.pod:2968
9560 msgid "guestfs_inspect_os"
9564 #: ../src/guestfs-actions.pod:2970
9568 " guestfs_inspect_os (guestfs_h *g);\n"
9573 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2065
9575 "This function uses other libguestfs functions and certain heuristics to "
9576 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9577 "for operating systems."
9581 #: ../src/guestfs-actions.pod:2977 ../fish/guestfish-actions.pod:2069
9582 msgid "The list returned is empty if no operating systems were found."
9586 #: ../src/guestfs-actions.pod:2979 ../fish/guestfish-actions.pod:2071
9588 "If one operating system was found, then this returns a list with a single "
9589 "element, which is the name of the root filesystem of this operating system. "
9590 "It is also possible for this function to return a list containing more than "
9591 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9592 "element being the root filesystem of one of the operating systems."
9596 #: ../src/guestfs-actions.pod:2986
9598 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9599 "functions in order to query further information about each operating system, "
9600 "such as the name and version."
9604 #: ../src/guestfs-actions.pod:2991
9606 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9607 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9608 "the contents. This should be called with no disks currently mounted. The "
9609 "function may also use Augeas, so any existing Augeas handle will be closed."
9613 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2089
9615 "This function cannot decrypt encrypted disks. The caller must do that first "
9616 "(supplying the necessary keys) if the disk is encrypted."
9620 #: ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3258
9621 #: ../src/guestfs-actions.pod:3320
9622 msgid "See also C<guestfs_list_filesystems>."
9626 #: ../src/guestfs-actions.pod:3011
9627 msgid "guestfs_is_blockdev"
9631 #: ../src/guestfs-actions.pod:3013
9635 " guestfs_is_blockdev (guestfs_h *g,\n"
9636 " const char *path);\n"
9641 #: ../src/guestfs-actions.pod:3017 ../fish/guestfish-actions.pod:2101
9643 "This returns C<true> if and only if there is a block device with the given "
9648 #: ../src/guestfs-actions.pod:3020 ../src/guestfs-actions.pod:3049
9649 #: ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3094
9650 #: ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3166
9651 #: ../src/guestfs-actions.pod:3181
9652 msgid "See also C<guestfs_stat>."
9656 #: ../src/guestfs-actions.pod:3024 ../src/guestfs-actions.pod:3053
9657 #: ../src/guestfs-actions.pod:3098 ../src/guestfs-actions.pod:3170
9658 #: ../src/guestfs-actions.pod:3185
9659 msgid "(Added in 1.5.10)"
9663 #: ../src/guestfs-actions.pod:3026
9664 msgid "guestfs_is_busy"
9668 #: ../src/guestfs-actions.pod:3028
9672 " guestfs_is_busy (guestfs_h *g);\n"
9677 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2110
9679 "This returns true iff this handle is busy processing a command (in the "
9684 #: ../src/guestfs-actions.pod:3040
9685 msgid "guestfs_is_chardev"
9689 #: ../src/guestfs-actions.pod:3042
9693 " guestfs_is_chardev (guestfs_h *g,\n"
9694 " const char *path);\n"
9699 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2119
9701 "This returns C<true> if and only if there is a character device with the "
9702 "given C<path> name."
9706 #: ../src/guestfs-actions.pod:3055
9707 msgid "guestfs_is_config"
9711 #: ../src/guestfs-actions.pod:3057
9715 " guestfs_is_config (guestfs_h *g);\n"
9720 #: ../src/guestfs-actions.pod:3060 ../fish/guestfish-actions.pod:2128
9722 "This returns true iff this handle is being configured (in the C<CONFIG> "
9727 #: ../src/guestfs-actions.pod:3069
9728 msgid "guestfs_is_dir"
9732 #: ../src/guestfs-actions.pod:3071
9736 " guestfs_is_dir (guestfs_h *g,\n"
9737 " const char *path);\n"
9742 #: ../src/guestfs-actions.pod:3075 ../fish/guestfish-actions.pod:2137
9744 "This returns C<true> if and only if there is a directory with the given "
9745 "C<path> name. Note that it returns false for other objects like files."
9749 #: ../src/guestfs-actions.pod:3085
9750 msgid "guestfs_is_fifo"
9754 #: ../src/guestfs-actions.pod:3087
9758 " guestfs_is_fifo (guestfs_h *g,\n"
9759 " const char *path);\n"
9764 #: ../src/guestfs-actions.pod:3091 ../fish/guestfish-actions.pod:2147
9766 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9767 "given C<path> name."
9771 #: ../src/guestfs-actions.pod:3100
9772 msgid "guestfs_is_file"
9776 #: ../src/guestfs-actions.pod:3102
9780 " guestfs_is_file (guestfs_h *g,\n"
9781 " const char *path);\n"
9786 #: ../src/guestfs-actions.pod:3106 ../fish/guestfish-actions.pod:2156
9788 "This returns C<true> if and only if there is a regular file with the given "
9789 "C<path> name. Note that it returns false for other objects like directories."
9793 #: ../src/guestfs-actions.pod:3116
9794 msgid "guestfs_is_launching"
9798 #: ../src/guestfs-actions.pod:3118
9802 " guestfs_is_launching (guestfs_h *g);\n"
9807 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2166
9809 "This returns true iff this handle is launching the subprocess (in the "
9810 "C<LAUNCHING> state)."
9814 #: ../src/guestfs-actions.pod:3130
9815 msgid "guestfs_is_lv"
9819 #: ../src/guestfs-actions.pod:3132
9823 " guestfs_is_lv (guestfs_h *g,\n"
9824 " const char *device);\n"
9829 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2175
9831 "This command tests whether C<device> is a logical volume, and returns true "
9832 "iff this is the case."
9836 #: ../src/guestfs-actions.pod:3143
9837 msgid "guestfs_is_ready"
9841 #: ../src/guestfs-actions.pod:3145
9845 " guestfs_is_ready (guestfs_h *g);\n"
9850 #: ../src/guestfs-actions.pod:3148 ../fish/guestfish-actions.pod:2182
9852 "This returns true iff this handle is ready to accept commands (in the "
9857 #: ../src/guestfs-actions.pod:3157
9858 msgid "guestfs_is_socket"
9862 #: ../src/guestfs-actions.pod:3159
9866 " guestfs_is_socket (guestfs_h *g,\n"
9867 " const char *path);\n"
9872 #: ../src/guestfs-actions.pod:3163 ../fish/guestfish-actions.pod:2191
9874 "This returns C<true> if and only if there is a Unix domain socket with the "
9875 "given C<path> name."
9879 #: ../src/guestfs-actions.pod:3172
9880 msgid "guestfs_is_symlink"
9884 #: ../src/guestfs-actions.pod:3174
9888 " guestfs_is_symlink (guestfs_h *g,\n"
9889 " const char *path);\n"
9894 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2200
9896 "This returns C<true> if and only if there is a symbolic link with the given "
9901 #: ../src/guestfs-actions.pod:3187
9902 msgid "guestfs_kill_subprocess"
9906 #: ../src/guestfs-actions.pod:3189
9910 " guestfs_kill_subprocess (guestfs_h *g);\n"
9915 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2209
9916 msgid "This kills the qemu subprocess. You should never need to call this."
9920 #: ../src/guestfs-actions.pod:3198
9921 msgid "guestfs_launch"
9925 #: ../src/guestfs-actions.pod:3200
9929 " guestfs_launch (guestfs_h *g);\n"
9934 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2217
9936 "Internally libguestfs is implemented by running a virtual machine using "
9941 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2220
9943 "You should call this after configuring the handle (eg. adding drives) but "
9944 "before performing any actions."
9948 #: ../src/guestfs-actions.pod:3213
9949 msgid "guestfs_lchown"
9953 #: ../src/guestfs-actions.pod:3215
9957 " guestfs_lchown (guestfs_h *g,\n"
9960 " const char *path);\n"
9965 #: ../src/guestfs-actions.pod:3221
9967 "Change the file owner to C<owner> and group to C<group>. This is like "
9968 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9969 "changed, not the target."
9973 #: ../src/guestfs-actions.pod:3233
9974 msgid "guestfs_lgetxattrs"
9978 #: ../src/guestfs-actions.pod:3235
9981 " struct guestfs_xattr_list *\n"
9982 " guestfs_lgetxattrs (guestfs_h *g,\n"
9983 " const char *path);\n"
9988 #: ../src/guestfs-actions.pod:3239
9990 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9991 "then it returns the extended attributes of the link itself."
9995 #: ../src/guestfs-actions.pod:3249
9996 msgid "guestfs_list_devices"
10000 #: ../src/guestfs-actions.pod:3251
10004 " guestfs_list_devices (guestfs_h *g);\n"
10009 #: ../src/guestfs-actions.pod:3254 ../fish/guestfish-actions.pod:2247
10010 msgid "List all the block devices."
10014 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2249
10015 msgid "The full block device names are returned, eg. C</dev/sda>."
10019 #: ../src/guestfs-actions.pod:3266
10020 msgid "guestfs_list_filesystems"
10024 #: ../src/guestfs-actions.pod:3268
10028 " guestfs_list_filesystems (guestfs_h *g);\n"
10033 #: ../src/guestfs-actions.pod:3271 ../fish/guestfish-actions.pod:2257
10035 "This inspection command looks for filesystems on partitions, block devices "
10036 "and logical volumes, returning a list of devices containing filesystems and "
10041 #: ../src/guestfs-actions.pod:3275 ../fish/guestfish-actions.pod:2261
10043 "The return value is a hash, where the keys are the devices containing "
10044 "filesystems, and the values are the filesystem types. For example:"
10048 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2265
10051 " \"/dev/sda1\" => \"ntfs\"\n"
10052 " \"/dev/sda2\" => \"ext2\"\n"
10053 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10054 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10059 #: ../src/guestfs-actions.pod:3284 ../fish/guestfish-actions.pod:2270
10061 "The value can have the special value \"unknown\", meaning the content of the "
10062 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10066 #: ../src/guestfs-actions.pod:3288
10068 "This command runs other libguestfs commands, which might include "
10069 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10070 "soon after launch and only when nothing is mounted."
10074 #: ../src/guestfs-actions.pod:3292
10076 "Not all of the filesystems returned will be mountable. In particular, swap "
10077 "partitions are returned in the list. Also this command does not check that "
10078 "each filesystem found is valid and mountable, and some filesystems might be "
10079 "mountable but require special options. Filesystems may not all belong to a "
10080 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10084 #: ../src/guestfs-actions.pod:3306 ../src/guestfs-actions.pod:4895
10085 msgid "(Added in 1.5.15)"
10089 #: ../src/guestfs-actions.pod:3308
10090 msgid "guestfs_list_partitions"
10094 #: ../src/guestfs-actions.pod:3310
10098 " guestfs_list_partitions (guestfs_h *g);\n"
10103 #: ../src/guestfs-actions.pod:3313 ../fish/guestfish-actions.pod:2290
10104 msgid "List all the partitions detected on all block devices."
10108 #: ../src/guestfs-actions.pod:3315 ../fish/guestfish-actions.pod:2292
10109 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10113 #: ../src/guestfs-actions.pod:3317
10115 "This does not return logical volumes. For that you will need to call "
10120 #: ../src/guestfs-actions.pod:3328
10125 #: ../src/guestfs-actions.pod:3330
10129 " guestfs_ll (guestfs_h *g,\n"
10130 " const char *directory);\n"
10135 #: ../src/guestfs-actions.pod:3334 ../fish/guestfish-actions.pod:2303
10137 "List the files in C<directory> (relative to the root directory, there is no "
10138 "cwd) in the format of 'ls -la'."
10142 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2306
10144 "This command is mostly useful for interactive sessions. It is I<not> "
10145 "intended that you try to parse the output string."
10149 #: ../src/guestfs-actions.pod:3345
10154 #: ../src/guestfs-actions.pod:3347
10158 " guestfs_ln (guestfs_h *g,\n"
10159 " const char *target,\n"
10160 " const char *linkname);\n"
10165 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2313
10166 msgid "This command creates a hard link using the C<ln> command."
10170 #: ../src/guestfs-actions.pod:3358
10171 msgid "guestfs_ln_f"
10175 #: ../src/guestfs-actions.pod:3360
10179 " guestfs_ln_f (guestfs_h *g,\n"
10180 " const char *target,\n"
10181 " const char *linkname);\n"
10186 #: ../src/guestfs-actions.pod:3365 ../fish/guestfish-actions.pod:2319
10188 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10189 "option removes the link (C<linkname>) if it exists already."
10193 #: ../src/guestfs-actions.pod:3372
10194 msgid "guestfs_ln_s"
10198 #: ../src/guestfs-actions.pod:3374
10202 " guestfs_ln_s (guestfs_h *g,\n"
10203 " const char *target,\n"
10204 " const char *linkname);\n"
10209 #: ../src/guestfs-actions.pod:3379 ../fish/guestfish-actions.pod:2326
10210 msgid "This command creates a symbolic link using the C<ln -s> command."
10214 #: ../src/guestfs-actions.pod:3385
10215 msgid "guestfs_ln_sf"
10219 #: ../src/guestfs-actions.pod:3387
10223 " guestfs_ln_sf (guestfs_h *g,\n"
10224 " const char *target,\n"
10225 " const char *linkname);\n"
10230 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2332
10232 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10233 "option removes the link (C<linkname>) if it exists already."
10237 #: ../src/guestfs-actions.pod:3399
10238 msgid "guestfs_lremovexattr"
10242 #: ../src/guestfs-actions.pod:3401
10246 " guestfs_lremovexattr (guestfs_h *g,\n"
10247 " const char *xattr,\n"
10248 " const char *path);\n"
10253 #: ../src/guestfs-actions.pod:3406
10255 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10256 "link, then it removes an extended attribute of the link itself."
10260 #: ../src/guestfs-actions.pod:3414
10265 #: ../src/guestfs-actions.pod:3416
10269 " guestfs_ls (guestfs_h *g,\n"
10270 " const char *directory);\n"
10275 #: ../src/guestfs-actions.pod:3420 ../fish/guestfish-actions.pod:2347
10277 "List the files in C<directory> (relative to the root directory, there is no "
10278 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10282 #: ../src/guestfs-actions.pod:3424
10284 "This command is mostly useful for interactive sessions. Programs should "
10285 "probably use C<guestfs_readdir> instead."
10289 #: ../src/guestfs-actions.pod:3433
10290 msgid "guestfs_lsetxattr"
10294 #: ../src/guestfs-actions.pod:3435
10298 " guestfs_lsetxattr (guestfs_h *g,\n"
10299 " const char *xattr,\n"
10300 " const char *val,\n"
10302 " const char *path);\n"
10307 #: ../src/guestfs-actions.pod:3442
10309 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10310 "then it sets an extended attribute of the link itself."
10314 #: ../src/guestfs-actions.pod:3450
10315 msgid "guestfs_lstat"
10319 #: ../src/guestfs-actions.pod:3452
10322 " struct guestfs_stat *\n"
10323 " guestfs_lstat (guestfs_h *g,\n"
10324 " const char *path);\n"
10329 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:5949
10330 #: ../fish/guestfish-actions.pod:2366 ../fish/guestfish-actions.pod:3979
10331 msgid "Returns file information for the given C<path>."
10335 #: ../src/guestfs-actions.pod:3458
10337 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10338 "link, then the link is stat-ed, not the file it refers to."
10342 #: ../src/guestfs-actions.pod:3462 ../fish/guestfish-actions.pod:2372
10343 msgid "This is the same as the C<lstat(2)> system call."
10347 #: ../src/guestfs-actions.pod:3464 ../src/guestfs-actions.pod:5953
10349 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10350 "error. I<The caller must call C<guestfs_free_stat> after use>."
10354 #: ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:5957
10355 #: ../src/guestfs-actions.pod:5975 ../src/guestfs-actions.pod:6356
10356 msgid "(Added in 0.9.2)"
10360 #: ../src/guestfs-actions.pod:3470
10361 msgid "guestfs_lstatlist"
10365 #: ../src/guestfs-actions.pod:3472
10368 " struct guestfs_stat_list *\n"
10369 " guestfs_lstatlist (guestfs_h *g,\n"
10370 " const char *path,\n"
10371 " char *const *names);\n"
10376 #: ../src/guestfs-actions.pod:3477
10378 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10379 "files, where all files are in the directory C<path>. C<names> is the list "
10380 "of files from this directory."
10384 #: ../src/guestfs-actions.pod:3481 ../fish/guestfish-actions.pod:2382
10386 "On return you get a list of stat structs, with a one-to-one correspondence "
10387 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10388 "then the C<ino> field of that structure is set to C<-1>."
10392 #: ../src/guestfs-actions.pod:3486
10394 "This call is intended for programs that want to efficiently list a directory "
10395 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10396 "for a similarly efficient call for getting extended attributes. Very long "
10397 "directory listings might cause the protocol message size to be exceeded, "
10398 "causing this call to fail. The caller must split up such requests into "
10399 "smaller groups of names."
10403 #: ../src/guestfs-actions.pod:3494
10405 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10406 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10410 #: ../src/guestfs-actions.pod:3500
10411 msgid "guestfs_luks_add_key"
10415 #: ../src/guestfs-actions.pod:3502
10419 " guestfs_luks_add_key (guestfs_h *g,\n"
10420 " const char *device,\n"
10421 " const char *key,\n"
10422 " const char *newkey,\n"
10428 #: ../src/guestfs-actions.pod:3509 ../fish/guestfish-actions.pod:2399
10430 "This command adds a new key on LUKS device C<device>. C<key> is any "
10431 "existing key, and is used to access the device. C<newkey> is the new key to "
10432 "add. C<keyslot> is the key slot that will be replaced."
10436 #: ../src/guestfs-actions.pod:3514
10438 "Note that if C<keyslot> already contains a key, then this command will "
10439 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10443 #: ../src/guestfs-actions.pod:3520 ../src/guestfs-actions.pod:3560
10444 #: ../src/guestfs-actions.pod:3583 ../src/guestfs-actions.pod:3603
10445 #: ../src/guestfs-actions.pod:3635 ../src/guestfs-actions.pod:3654
10447 "This function takes a key or passphrase parameter which could contain "
10448 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10453 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3564
10454 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3607
10455 msgid "(Added in 1.5.2)"
10459 #: ../src/guestfs-actions.pod:3526
10460 msgid "guestfs_luks_close"
10464 #: ../src/guestfs-actions.pod:3528
10468 " guestfs_luks_close (guestfs_h *g,\n"
10469 " const char *device);\n"
10474 #: ../src/guestfs-actions.pod:3532
10476 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10477 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10478 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10479 "underlying block device."
10483 #: ../src/guestfs-actions.pod:3540 ../src/guestfs-actions.pod:3639
10484 #: ../src/guestfs-actions.pod:3658 ../src/guestfs-actions.pod:3708
10485 #: ../src/guestfs-actions.pod:3756
10486 msgid "(Added in 1.5.1)"
10490 #: ../src/guestfs-actions.pod:3542
10491 msgid "guestfs_luks_format"
10495 #: ../src/guestfs-actions.pod:3544
10499 " guestfs_luks_format (guestfs_h *g,\n"
10500 " const char *device,\n"
10501 " const char *key,\n"
10507 #: ../src/guestfs-actions.pod:3550 ../fish/guestfish-actions.pod:2425
10509 "This command erases existing data on C<device> and formats the device as a "
10510 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10511 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10515 #: ../src/guestfs-actions.pod:3557 ../src/guestfs-actions.pod:3580
10516 #: ../src/guestfs-actions.pod:3720 ../src/guestfs-actions.pod:4646
10517 #: ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5784
10518 #: ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:5833
10519 #: ../src/guestfs-actions.pod:6993 ../fish/guestfish-actions.pod:2433
10520 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2530
10521 #: ../fish/guestfish-actions.pod:3091 ../fish/guestfish-actions.pod:3598
10522 #: ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3894
10523 #: ../fish/guestfish-actions.pod:3909 ../fish/guestfish-actions.pod:4624
10525 "B<This command is dangerous. Without careful use you can easily destroy all "
10530 #: ../src/guestfs-actions.pod:3566
10531 msgid "guestfs_luks_format_cipher"
10535 #: ../src/guestfs-actions.pod:3568
10539 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10540 " const char *device,\n"
10541 " const char *key,\n"
10543 " const char *cipher);\n"
10548 #: ../src/guestfs-actions.pod:3575
10550 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10551 "set the C<cipher> used."
10555 #: ../src/guestfs-actions.pod:3589
10556 msgid "guestfs_luks_kill_slot"
10560 #: ../src/guestfs-actions.pod:3591
10564 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10565 " const char *device,\n"
10566 " const char *key,\n"
10572 #: ../src/guestfs-actions.pod:3597 ../fish/guestfish-actions.pod:2453
10574 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10575 "device C<device>. C<key> must be one of the I<other> keys."
10579 #: ../src/guestfs-actions.pod:3609
10580 msgid "guestfs_luks_open"
10584 #: ../src/guestfs-actions.pod:3611
10588 " guestfs_luks_open (guestfs_h *g,\n"
10589 " const char *device,\n"
10590 " const char *key,\n"
10591 " const char *mapname);\n"
10596 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2464
10598 "This command opens a block device which has been encrypted according to the "
10599 "Linux Unified Key Setup (LUKS) standard."
10603 #: ../src/guestfs-actions.pod:3620 ../fish/guestfish-actions.pod:2467
10604 msgid "C<device> is the encrypted block device or partition."
10608 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2469
10610 "The caller must supply one of the keys associated with the LUKS block "
10611 "device, in the C<key> parameter."
10615 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2472
10617 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10618 "writes to this block device are decrypted from and encrypted to the "
10619 "underlying C<device> respectively."
10623 #: ../src/guestfs-actions.pod:3629
10625 "If this block device contains LVM volume groups, then calling "
10626 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10631 #: ../src/guestfs-actions.pod:3641
10632 msgid "guestfs_luks_open_ro"
10636 #: ../src/guestfs-actions.pod:3643
10640 " guestfs_luks_open_ro (guestfs_h *g,\n"
10641 " const char *device,\n"
10642 " const char *key,\n"
10643 " const char *mapname);\n"
10648 #: ../src/guestfs-actions.pod:3649
10650 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10655 #: ../src/guestfs-actions.pod:3660
10656 msgid "guestfs_lvcreate"
10660 #: ../src/guestfs-actions.pod:3662
10664 " guestfs_lvcreate (guestfs_h *g,\n"
10665 " const char *logvol,\n"
10666 " const char *volgroup,\n"
10672 #: ../src/guestfs-actions.pod:3668 ../fish/guestfish-actions.pod:2497
10674 "This creates an LVM logical volume called C<logvol> on the volume group "
10675 "C<volgroup>, with C<size> megabytes."
10679 #: ../src/guestfs-actions.pod:3675
10680 msgid "guestfs_lvm_canonical_lv_name"
10684 #: ../src/guestfs-actions.pod:3677
10688 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10689 " const char *lvname);\n"
10694 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2504
10696 "This converts alternative naming schemes for LVs that you might find to the "
10697 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10702 #: ../src/guestfs-actions.pod:3685 ../fish/guestfish-actions.pod:2508
10704 "This command returns an error if the C<lvname> parameter does not refer to a "
10709 #: ../src/guestfs-actions.pod:3688
10710 msgid "See also C<guestfs_is_lv>."
10714 #: ../src/guestfs-actions.pod:3693
10715 msgid "(Added in 1.5.24)"
10719 #: ../src/guestfs-actions.pod:3695
10720 msgid "guestfs_lvm_clear_filter"
10724 #: ../src/guestfs-actions.pod:3697
10728 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10733 #: ../src/guestfs-actions.pod:3700
10735 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10736 "see every block device."
10740 #: ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:3745
10741 #: ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2551
10743 "This command also clears the LVM cache and performs a volume group scan."
10747 #: ../src/guestfs-actions.pod:3710
10748 msgid "guestfs_lvm_remove_all"
10752 #: ../src/guestfs-actions.pod:3712
10756 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10761 #: ../src/guestfs-actions.pod:3715 ../fish/guestfish-actions.pod:2527
10763 "This command removes all LVM logical volumes, volume groups and physical "
10768 #: ../src/guestfs-actions.pod:3725
10769 msgid "guestfs_lvm_set_filter"
10773 #: ../src/guestfs-actions.pod:3727
10777 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10778 " char *const *devices);\n"
10783 #: ../src/guestfs-actions.pod:3731 ../fish/guestfish-actions.pod:2537
10785 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10786 "block devices in the list C<devices>, and will ignore all other attached "
10791 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2541
10793 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10794 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10795 "there are two types of duplication possible: either cloned PVs/VGs which "
10796 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10797 "same name. In normal operation you cannot create this situation, but you "
10798 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10799 "inside the LVM metadata."
10803 #: ../src/guestfs-actions.pod:3748 ../fish/guestfish-actions.pod:2554
10804 msgid "You can filter whole block devices or individual partitions."
10808 #: ../src/guestfs-actions.pod:3750 ../fish/guestfish-actions.pod:2556
10810 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10811 "filesystem), even if you are not filtering out that VG."
10815 #: ../src/guestfs-actions.pod:3758
10816 msgid "guestfs_lvremove"
10820 #: ../src/guestfs-actions.pod:3760
10824 " guestfs_lvremove (guestfs_h *g,\n"
10825 " const char *device);\n"
10830 #: ../src/guestfs-actions.pod:3764 ../fish/guestfish-actions.pod:2564
10832 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10833 "LV, such as C</dev/VG/LV>."
10837 #: ../src/guestfs-actions.pod:3767 ../fish/guestfish-actions.pod:2567
10839 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10844 #: ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:4992
10845 #: ../src/guestfs-actions.pod:6732
10846 msgid "(Added in 1.0.13)"
10850 #: ../src/guestfs-actions.pod:3774
10851 msgid "guestfs_lvrename"
10855 #: ../src/guestfs-actions.pod:3776
10859 " guestfs_lvrename (guestfs_h *g,\n"
10860 " const char *logvol,\n"
10861 " const char *newlogvol);\n"
10866 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2574
10867 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10871 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:6745
10872 msgid "(Added in 1.0.83)"
10876 #: ../src/guestfs-actions.pod:3787
10877 msgid "guestfs_lvresize"
10881 #: ../src/guestfs-actions.pod:3789
10885 " guestfs_lvresize (guestfs_h *g,\n"
10886 " const char *device,\n"
10892 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2580
10894 "This resizes (expands or shrinks) an existing LVM logical volume to "
10895 "C<mbytes>. When reducing, data in the reduced part is lost."
10899 #: ../src/guestfs-actions.pod:3802
10900 msgid "guestfs_lvresize_free"
10904 #: ../src/guestfs-actions.pod:3804
10908 " guestfs_lvresize_free (guestfs_h *g,\n"
10909 " const char *lv,\n"
10915 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2588
10917 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10918 "remaining free space in the volume group. Commonly you would call this with "
10919 "pc = 100 which expands the logical volume as much as possible, using all "
10920 "remaining free space in the volume group."
10924 #: ../src/guestfs-actions.pod:3817
10925 msgid "(Added in 1.3.3)"
10929 #: ../src/guestfs-actions.pod:3819
10930 msgid "guestfs_lvs"
10934 #: ../src/guestfs-actions.pod:3821
10938 " guestfs_lvs (guestfs_h *g);\n"
10943 #: ../src/guestfs-actions.pod:3824 ../fish/guestfish-actions.pod:2598
10945 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10950 #: ../src/guestfs-actions.pod:3827 ../fish/guestfish-actions.pod:2601
10952 "This returns a list of the logical volume device names (eg. C</dev/"
10953 "VolGroup00/LogVol00>)."
10957 #: ../src/guestfs-actions.pod:3830
10958 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10962 #: ../src/guestfs-actions.pod:3838
10963 msgid "guestfs_lvs_full"
10967 #: ../src/guestfs-actions.pod:3840
10970 " struct guestfs_lvm_lv_list *\n"
10971 " guestfs_lvs_full (guestfs_h *g);\n"
10976 #: ../src/guestfs-actions.pod:3843 ../fish/guestfish-actions.pod:2610
10978 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10979 "(8)> command. The \"full\" version includes all fields."
10983 #: ../src/guestfs-actions.pod:3846
10985 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10986 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
10990 #: ../src/guestfs-actions.pod:3852
10991 msgid "guestfs_lvuuid"
10995 #: ../src/guestfs-actions.pod:3854
10999 " guestfs_lvuuid (guestfs_h *g,\n"
11000 " const char *device);\n"
11005 #: ../src/guestfs-actions.pod:3858 ../fish/guestfish-actions.pod:2617
11006 msgid "This command returns the UUID of the LVM LV C<device>."
11010 #: ../src/guestfs-actions.pod:3865
11011 msgid "guestfs_lxattrlist"
11015 #: ../src/guestfs-actions.pod:3867
11018 " struct guestfs_xattr_list *\n"
11019 " guestfs_lxattrlist (guestfs_h *g,\n"
11020 " const char *path,\n"
11021 " char *const *names);\n"
11026 #: ../src/guestfs-actions.pod:3872 ../fish/guestfish-actions.pod:2623
11028 "This call allows you to get the extended attributes of multiple files, where "
11029 "all files are in the directory C<path>. C<names> is the list of files from "
11034 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2627
11036 "On return you get a flat list of xattr structs which must be interpreted "
11037 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11038 "C<attrval> in this struct is zero-length to indicate there was an error "
11039 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11040 "number (the number of following attributes for this file, which could be C<"
11041 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11042 "for the first named file. This repeats for the second and subsequent files."
11046 #: ../src/guestfs-actions.pod:3886
11048 "This call is intended for programs that want to efficiently list a directory "
11049 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11050 "a similarly efficient call for getting standard stats. Very long directory "
11051 "listings might cause the protocol message size to be exceeded, causing this "
11052 "call to fail. The caller must split up such requests into smaller groups of "
11057 #: ../src/guestfs-actions.pod:3900
11058 msgid "guestfs_mkdir"
11062 #: ../src/guestfs-actions.pod:3902
11066 " guestfs_mkdir (guestfs_h *g,\n"
11067 " const char *path);\n"
11072 #: ../src/guestfs-actions.pod:3906 ../fish/guestfish-actions.pod:2649
11073 msgid "Create a directory named C<path>."
11077 #: ../src/guestfs-actions.pod:3912
11078 msgid "guestfs_mkdir_mode"
11082 #: ../src/guestfs-actions.pod:3914
11086 " guestfs_mkdir_mode (guestfs_h *g,\n"
11087 " const char *path,\n"
11093 #: ../src/guestfs-actions.pod:3919 ../fish/guestfish-actions.pod:2655
11095 "This command creates a directory, setting the initial permissions of the "
11096 "directory to C<mode>."
11100 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:2658
11102 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11103 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11108 #: ../src/guestfs-actions.pod:3926
11109 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11113 #: ../src/guestfs-actions.pod:3932
11114 msgid "guestfs_mkdir_p"
11118 #: ../src/guestfs-actions.pod:3934
11122 " guestfs_mkdir_p (guestfs_h *g,\n"
11123 " const char *path);\n"
11128 #: ../src/guestfs-actions.pod:3938 ../fish/guestfish-actions.pod:2668
11130 "Create a directory named C<path>, creating any parent directories as "
11131 "necessary. This is like the C<mkdir -p> shell command."
11135 #: ../src/guestfs-actions.pod:3945
11136 msgid "guestfs_mkdtemp"
11140 #: ../src/guestfs-actions.pod:3947
11144 " guestfs_mkdtemp (guestfs_h *g,\n"
11145 " const char *template);\n"
11150 #: ../src/guestfs-actions.pod:3951 ../fish/guestfish-actions.pod:2675
11152 "This command creates a temporary directory. The C<template> parameter "
11153 "should be a full pathname for the temporary directory name with the final "
11154 "six characters being \"XXXXXX\"."
11158 #: ../src/guestfs-actions.pod:3956 ../fish/guestfish-actions.pod:2680
11160 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11161 "being suitable for Windows filesystems."
11165 #: ../src/guestfs-actions.pod:3959 ../fish/guestfish-actions.pod:2683
11166 msgid "The name of the temporary directory that was created is returned."
11170 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2686
11171 msgid "The temporary directory is created with mode 0700 and is owned by root."
11175 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:2689
11177 "The caller is responsible for deleting the temporary directory and its "
11178 "contents after use."
11182 #: ../src/guestfs-actions.pod:3968 ../fish/guestfish-actions.pod:2692
11183 msgid "See also: L<mkdtemp(3)>"
11187 #: ../src/guestfs-actions.pod:3975
11188 msgid "guestfs_mke2fs_J"
11192 #: ../src/guestfs-actions.pod:3977
11196 " guestfs_mke2fs_J (guestfs_h *g,\n"
11197 " const char *fstype,\n"
11198 " int blocksize,\n"
11199 " const char *device,\n"
11200 " const char *journal);\n"
11205 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:2698
11207 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11208 "C<journal>. It is equivalent to the command:"
11212 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:2702
11215 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11220 #: ../src/guestfs-actions.pod:3990
11221 msgid "See also C<guestfs_mke2journal>."
11225 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4012
11226 #: ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4046
11227 #: ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4074
11228 #: ../src/guestfs-actions.pod:4133 ../src/guestfs-actions.pod:4382
11229 msgid "(Added in 1.0.68)"
11233 #: ../src/guestfs-actions.pod:3996
11234 msgid "guestfs_mke2fs_JL"
11238 #: ../src/guestfs-actions.pod:3998
11242 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11243 " const char *fstype,\n"
11244 " int blocksize,\n"
11245 " const char *device,\n"
11246 " const char *label);\n"
11251 #: ../src/guestfs-actions.pod:4005 ../fish/guestfish-actions.pod:2710
11253 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11254 "the journal labeled C<label>."
11258 #: ../src/guestfs-actions.pod:4008
11259 msgid "See also C<guestfs_mke2journal_L>."
11263 #: ../src/guestfs-actions.pod:4014
11264 msgid "guestfs_mke2fs_JU"
11268 #: ../src/guestfs-actions.pod:4016
11272 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11273 " const char *fstype,\n"
11274 " int blocksize,\n"
11275 " const char *device,\n"
11276 " const char *uuid);\n"
11281 #: ../src/guestfs-actions.pod:4023 ../fish/guestfish-actions.pod:2719
11283 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11284 "the journal with UUID C<uuid>."
11288 #: ../src/guestfs-actions.pod:4026
11289 msgid "See also C<guestfs_mke2journal_U>."
11293 #: ../src/guestfs-actions.pod:4032
11294 msgid "guestfs_mke2journal"
11298 #: ../src/guestfs-actions.pod:4034
11302 " guestfs_mke2journal (guestfs_h *g,\n"
11303 " int blocksize,\n"
11304 " const char *device);\n"
11309 #: ../src/guestfs-actions.pod:4039 ../fish/guestfish-actions.pod:2728
11311 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11316 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:2731
11319 " mke2fs -O journal_dev -b blocksize device\n"
11324 #: ../src/guestfs-actions.pod:4048
11325 msgid "guestfs_mke2journal_L"
11329 #: ../src/guestfs-actions.pod:4050
11333 " guestfs_mke2journal_L (guestfs_h *g,\n"
11334 " int blocksize,\n"
11335 " const char *label,\n"
11336 " const char *device);\n"
11341 #: ../src/guestfs-actions.pod:4056 ../fish/guestfish-actions.pod:2737
11342 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11346 #: ../src/guestfs-actions.pod:4062
11347 msgid "guestfs_mke2journal_U"
11351 #: ../src/guestfs-actions.pod:4064
11355 " guestfs_mke2journal_U (guestfs_h *g,\n"
11356 " int blocksize,\n"
11357 " const char *uuid,\n"
11358 " const char *device);\n"
11363 #: ../src/guestfs-actions.pod:4070 ../fish/guestfish-actions.pod:2743
11364 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11368 #: ../src/guestfs-actions.pod:4076
11369 msgid "guestfs_mkfifo"
11373 #: ../src/guestfs-actions.pod:4078
11377 " guestfs_mkfifo (guestfs_h *g,\n"
11379 " const char *path);\n"
11384 #: ../src/guestfs-actions.pod:4083
11386 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11387 "is just a convenient wrapper around C<guestfs_mknod>."
11391 #: ../src/guestfs-actions.pod:4093
11392 msgid "guestfs_mkfs"
11396 #: ../src/guestfs-actions.pod:4095
11400 " guestfs_mkfs (guestfs_h *g,\n"
11401 " const char *fstype,\n"
11402 " const char *device);\n"
11407 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:2759
11409 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11410 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11414 #: ../src/guestfs-actions.pod:4108
11415 msgid "guestfs_mkfs_b"
11419 #: ../src/guestfs-actions.pod:4110
11423 " guestfs_mkfs_b (guestfs_h *g,\n"
11424 " const char *fstype,\n"
11425 " int blocksize,\n"
11426 " const char *device);\n"
11431 #: ../src/guestfs-actions.pod:4116
11433 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11434 "block size of the resulting filesystem. Supported block sizes depend on the "
11435 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11439 #: ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4163
11440 #: ../fish/guestfish-actions.pod:2772 ../fish/guestfish-actions.pod:2799
11442 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11447 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2775
11449 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
11453 #: ../src/guestfs-actions.pod:4135
11454 msgid "guestfs_mkfs_opts"
11458 #: ../src/guestfs-actions.pod:4137
11462 " guestfs_mkfs_opts (guestfs_h *g,\n"
11463 " const char *fstype,\n"
11464 " const char *device,\n"
11470 #: ../src/guestfs-actions.pod:4148
11473 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11478 #: ../src/guestfs-actions.pod:4150 ../fish/guestfish-actions.pod:2786
11480 "This function creates a filesystem on C<device>. The filesystem type is "
11481 "C<fstype>, for example C<ext3>."
11485 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:2793
11486 msgid "C<blocksize>"
11490 #: ../src/guestfs-actions.pod:4159 ../fish/guestfish-actions.pod:2795
11492 "The filesystem block size. Supported block sizes depend on the filesystem "
11493 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11498 #: ../src/guestfs-actions.pod:4170
11499 msgid "guestfs_mkfs_opts_va"
11503 #: ../src/guestfs-actions.pod:4172
11507 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11508 " const char *fstype,\n"
11509 " const char *device,\n"
11510 " va_list args);\n"
11515 #: ../src/guestfs-actions.pod:4178
11516 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11520 #: ../src/guestfs-actions.pod:4182
11521 msgid "guestfs_mkfs_opts_argv"
11525 #: ../src/guestfs-actions.pod:4184
11529 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11530 " const char *fstype,\n"
11531 " const char *device,\n"
11532 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11537 #: ../src/guestfs-actions.pod:4190
11538 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
11542 #: ../src/guestfs-actions.pod:4194
11543 msgid "guestfs_mkmountpoint"
11547 #: ../src/guestfs-actions.pod:4196
11551 " guestfs_mkmountpoint (guestfs_h *g,\n"
11552 " const char *exemptpath);\n"
11557 #: ../src/guestfs-actions.pod:4200
11559 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11560 "that can be used to create extra mountpoints before mounting the first "
11565 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:2814
11567 "These calls are I<only> necessary in some very limited circumstances, mainly "
11568 "the case where you want to mount a mix of unrelated and/or read-only "
11569 "filesystems together."
11573 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:2818
11575 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11576 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11577 "inside that. You can unpack this as follows in guestfish:"
11581 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:2823
11584 " add-ro Fedora-11-i686-Live.iso\n"
11586 " mkmountpoint /cd\n"
11587 " mkmountpoint /sqsh\n"
11588 " mkmountpoint /ext3fs\n"
11589 " mount /dev/sda /cd\n"
11590 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11591 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11596 #: ../src/guestfs-actions.pod:4222 ../fish/guestfish-actions.pod:2832
11597 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11601 #: ../src/guestfs-actions.pod:4224
11603 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11604 "may get unexpected errors if you try to mix these calls. It is safest to "
11605 "manually unmount filesystems and remove mountpoints after use."
11609 #: ../src/guestfs-actions.pod:4228
11611 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11612 "first, so for this to work for manual mountpoints, you must ensure that the "
11613 "innermost mountpoints have the longest pathnames, as in the example code "
11618 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:2843
11620 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11624 #: ../src/guestfs-actions.pod:4235
11626 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11627 "means that C<guestfs_umount_all> is called when the handle is closed which "
11628 "can also trigger these issues."
11632 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4500
11633 #: ../src/guestfs-actions.pod:5393
11634 msgid "(Added in 1.0.62)"
11638 #: ../src/guestfs-actions.pod:4243
11639 msgid "guestfs_mknod"
11643 #: ../src/guestfs-actions.pod:4245
11647 " guestfs_mknod (guestfs_h *g,\n"
11651 " const char *path);\n"
11656 #: ../src/guestfs-actions.pod:4252 ../fish/guestfish-actions.pod:2853
11658 "This call creates block or character special devices, or named pipes (FIFOs)."
11662 #: ../src/guestfs-actions.pod:4255 ../fish/guestfish-actions.pod:2856
11664 "The C<mode> parameter should be the mode, using the standard constants. "
11665 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11666 "used when creating block and character special devices."
11670 #: ../src/guestfs-actions.pod:4260
11672 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11673 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11674 "regular file). These constants are available in the standard Linux header "
11675 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11676 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11677 "the appropriate constant for you."
11681 #: ../src/guestfs-actions.pod:4274
11682 msgid "guestfs_mknod_b"
11686 #: ../src/guestfs-actions.pod:4276
11690 " guestfs_mknod_b (guestfs_h *g,\n"
11694 " const char *path);\n"
11699 #: ../src/guestfs-actions.pod:4283
11701 "This call creates a block device node called C<path> with mode C<mode> and "
11702 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11703 "wrapper around C<guestfs_mknod>."
11707 #: ../src/guestfs-actions.pod:4293
11708 msgid "guestfs_mknod_c"
11712 #: ../src/guestfs-actions.pod:4295
11716 " guestfs_mknod_c (guestfs_h *g,\n"
11720 " const char *path);\n"
11725 #: ../src/guestfs-actions.pod:4302
11727 "This call creates a char device node called C<path> with mode C<mode> and "
11728 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11729 "wrapper around C<guestfs_mknod>."
11733 #: ../src/guestfs-actions.pod:4312
11734 msgid "guestfs_mkswap"
11738 #: ../src/guestfs-actions.pod:4314
11742 " guestfs_mkswap (guestfs_h *g,\n"
11743 " const char *device);\n"
11748 #: ../src/guestfs-actions.pod:4318 ../fish/guestfish-actions.pod:2895
11749 msgid "Create a swap partition on C<device>."
11753 #: ../src/guestfs-actions.pod:4324
11754 msgid "guestfs_mkswap_L"
11758 #: ../src/guestfs-actions.pod:4326
11762 " guestfs_mkswap_L (guestfs_h *g,\n"
11763 " const char *label,\n"
11764 " const char *device);\n"
11769 #: ../src/guestfs-actions.pod:4331 ../fish/guestfish-actions.pod:2901
11770 msgid "Create a swap partition on C<device> with label C<label>."
11774 #: ../src/guestfs-actions.pod:4333 ../fish/guestfish-actions.pod:2903
11776 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11777 "sda>), just to a partition. This appears to be a limitation of the kernel "
11782 #: ../src/guestfs-actions.pod:4341
11783 msgid "guestfs_mkswap_U"
11787 #: ../src/guestfs-actions.pod:4343
11791 " guestfs_mkswap_U (guestfs_h *g,\n"
11792 " const char *uuid,\n"
11793 " const char *device);\n"
11798 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2911
11799 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11803 #: ../src/guestfs-actions.pod:4354
11804 msgid "guestfs_mkswap_file"
11808 #: ../src/guestfs-actions.pod:4356
11812 " guestfs_mkswap_file (guestfs_h *g,\n"
11813 " const char *path);\n"
11818 #: ../src/guestfs-actions.pod:4360 ../fish/guestfish-actions.pod:2917
11819 msgid "Create a swap file."
11823 #: ../src/guestfs-actions.pod:4362
11825 "This command just writes a swap file signature to an existing file. To "
11826 "create the file itself, use something like C<guestfs_fallocate>."
11830 #: ../src/guestfs-actions.pod:4369
11831 msgid "guestfs_modprobe"
11835 #: ../src/guestfs-actions.pod:4371
11839 " guestfs_modprobe (guestfs_h *g,\n"
11840 " const char *modulename);\n"
11845 #: ../src/guestfs-actions.pod:4375 ../fish/guestfish-actions.pod:2926
11846 msgid "This loads a kernel module in the appliance."
11850 #: ../src/guestfs-actions.pod:4377 ../fish/guestfish-actions.pod:2928
11852 "The kernel module must have been whitelisted when libguestfs was built (see "
11853 "C<appliance/kmod.whitelist.in> in the source)."
11857 #: ../src/guestfs-actions.pod:4384
11858 msgid "guestfs_mount"
11862 #: ../src/guestfs-actions.pod:4386
11866 " guestfs_mount (guestfs_h *g,\n"
11867 " const char *device,\n"
11868 " const char *mountpoint);\n"
11873 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:2935
11875 "Mount a guest disk at a position in the filesystem. Block devices are named "
11876 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11877 "those block devices contain partitions, they will have the usual names (eg. "
11878 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11882 #: ../src/guestfs-actions.pod:4397 ../fish/guestfish-actions.pod:2941
11884 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11885 "mounted on C</> before others can be mounted. Other filesystems can only be "
11886 "mounted on directories which already exist."
11890 #: ../src/guestfs-actions.pod:4402 ../fish/guestfish-actions.pod:2946
11892 "The mounted filesystem is writable, if we have sufficient permissions on the "
11893 "underlying device."
11897 #: ../src/guestfs-actions.pod:4405
11899 "B<Important note:> When you use this call, the filesystem options C<sync> "
11900 "and C<noatime> are set implicitly. This was originally done because we "
11901 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11902 "very large negative performance impact and negligible effect on "
11903 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11904 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11905 "(use an empty string for the first parameter if you don't want any options)."
11909 #: ../src/guestfs-actions.pod:4419
11910 msgid "guestfs_mount_loop"
11914 #: ../src/guestfs-actions.pod:4421
11918 " guestfs_mount_loop (guestfs_h *g,\n"
11919 " const char *file,\n"
11920 " const char *mountpoint);\n"
11925 #: ../src/guestfs-actions.pod:4426 ../fish/guestfish-actions.pod:2963
11927 "This command lets you mount C<file> (a filesystem image in a file) on a "
11928 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11933 #: ../src/guestfs-actions.pod:4434
11934 msgid "guestfs_mount_options"
11938 #: ../src/guestfs-actions.pod:4436
11942 " guestfs_mount_options (guestfs_h *g,\n"
11943 " const char *options,\n"
11944 " const char *device,\n"
11945 " const char *mountpoint);\n"
11950 #: ../src/guestfs-actions.pod:4442
11952 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11953 "the mount options as for the L<mount(8)> I<-o> flag."
11957 #: ../src/guestfs-actions.pod:4446 ../fish/guestfish-actions.pod:2975
11959 "If the C<options> parameter is an empty string, then no options are passed "
11960 "(all options default to whatever the filesystem uses)."
11964 #: ../src/guestfs-actions.pod:4452 ../src/guestfs-actions.pod:4466
11965 #: ../src/guestfs-actions.pod:4483
11966 msgid "(Added in 1.0.10)"
11970 #: ../src/guestfs-actions.pod:4454
11971 msgid "guestfs_mount_ro"
11975 #: ../src/guestfs-actions.pod:4456
11979 " guestfs_mount_ro (guestfs_h *g,\n"
11980 " const char *device,\n"
11981 " const char *mountpoint);\n"
11986 #: ../src/guestfs-actions.pod:4461
11988 "This is the same as the C<guestfs_mount> command, but it mounts the "
11989 "filesystem with the read-only (I<-o ro>) flag."
11993 #: ../src/guestfs-actions.pod:4468
11994 msgid "guestfs_mount_vfs"
11998 #: ../src/guestfs-actions.pod:4470
12002 " guestfs_mount_vfs (guestfs_h *g,\n"
12003 " const char *options,\n"
12004 " const char *vfstype,\n"
12005 " const char *device,\n"
12006 " const char *mountpoint);\n"
12011 #: ../src/guestfs-actions.pod:4477
12013 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12014 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
12019 #: ../src/guestfs-actions.pod:4485
12020 msgid "guestfs_mountpoints"
12024 #: ../src/guestfs-actions.pod:4487
12028 " guestfs_mountpoints (guestfs_h *g);\n"
12033 #: ../src/guestfs-actions.pod:4490
12035 "This call is similar to C<guestfs_mounts>. That call returns a list of "
12036 "devices. This one returns a hash table (map) of device name to directory "
12037 "where the device is mounted."
12041 #: ../src/guestfs-actions.pod:4502
12042 msgid "guestfs_mounts"
12046 #: ../src/guestfs-actions.pod:4504
12050 " guestfs_mounts (guestfs_h *g);\n"
12055 #: ../src/guestfs-actions.pod:4507 ../fish/guestfish-actions.pod:3006
12057 "This returns the list of currently mounted filesystems. It returns the list "
12058 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12062 #: ../src/guestfs-actions.pod:4510 ../fish/guestfish-actions.pod:3009
12063 msgid "Some internal mounts are not shown."
12067 #: ../src/guestfs-actions.pod:4512
12068 msgid "See also: C<guestfs_mountpoints>"
12072 #: ../src/guestfs-actions.pod:4520
12077 #: ../src/guestfs-actions.pod:4522
12081 " guestfs_mv (guestfs_h *g,\n"
12082 " const char *src,\n"
12083 " const char *dest);\n"
12088 #: ../src/guestfs-actions.pod:4527 ../fish/guestfish-actions.pod:3017
12090 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12091 "destination filename or destination directory."
12095 #: ../src/guestfs-actions.pod:4534
12096 msgid "guestfs_ntfs_3g_probe"
12100 #: ../src/guestfs-actions.pod:4536
12104 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
12106 " const char *device);\n"
12111 #: ../src/guestfs-actions.pod:4541 ../fish/guestfish-actions.pod:3024
12113 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12114 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12115 "write, and some cannot be mounted at all)."
12119 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3028
12121 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12122 "can be mounted read-write. Set it to false if you want to test if the "
12123 "volume can be mounted read-only."
12127 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3032
12129 "The return value is an integer which C<0> if the operation would succeed, or "
12130 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12134 #: ../src/guestfs-actions.pod:4555
12135 msgid "(Added in 1.0.43)"
12139 #: ../src/guestfs-actions.pod:4557
12140 msgid "guestfs_ntfsresize"
12144 #: ../src/guestfs-actions.pod:4559
12148 " guestfs_ntfsresize (guestfs_h *g,\n"
12149 " const char *device);\n"
12154 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3040
12156 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12157 "size of the underlying device. See also L<ntfsresize(8)>."
12161 #: ../src/guestfs-actions.pod:4571
12162 msgid "guestfs_ntfsresize_size"
12166 #: ../src/guestfs-actions.pod:4573
12170 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12171 " const char *device,\n"
12172 " int64_t size);\n"
12177 #: ../src/guestfs-actions.pod:4578
12179 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12180 "to specify the new size (in bytes) explicitly."
12184 #: ../src/guestfs-actions.pod:4583 ../src/guestfs-actions.pod:5019
12185 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5341
12186 msgid "(Added in 1.3.14)"
12190 #: ../src/guestfs-actions.pod:4585
12191 msgid "guestfs_part_add"
12195 #: ../src/guestfs-actions.pod:4587
12199 " guestfs_part_add (guestfs_h *g,\n"
12200 " const char *device,\n"
12201 " const char *prlogex,\n"
12202 " int64_t startsect,\n"
12203 " int64_t endsect);\n"
12208 #: ../src/guestfs-actions.pod:4594
12210 "This command adds a partition to C<device>. If there is no partition table "
12211 "on the device, call C<guestfs_part_init> first."
12215 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3058
12217 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12218 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12219 "C<logical>) and C<e> (or C<extended>) partition types."
12223 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3063
12225 "C<startsect> and C<endsect> are the start and end of the partition in "
12226 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12227 "from the end of the disk (C<-1> is the last sector)."
12231 #: ../src/guestfs-actions.pod:4606
12233 "Creating a partition which covers the whole disk is not so easy. Use "
12234 "C<guestfs_part_disk> to do that."
12238 #: ../src/guestfs-actions.pod:4611 ../src/guestfs-actions.pod:4649
12239 #: ../src/guestfs-actions.pod:4702 ../src/guestfs-actions.pod:4780
12240 #: ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4837
12241 #: ../src/guestfs-actions.pod:4877
12242 msgid "(Added in 1.0.78)"
12246 #: ../src/guestfs-actions.pod:4613
12247 msgid "guestfs_part_del"
12251 #: ../src/guestfs-actions.pod:4615
12255 " guestfs_part_del (guestfs_h *g,\n"
12256 " const char *device,\n"
12262 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3074
12263 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12267 #: ../src/guestfs-actions.pod:4622 ../fish/guestfish-actions.pod:3076
12269 "Note that in the case of MBR partitioning, deleting an extended partition "
12270 "also deletes any logical partitions it contains."
12274 #: ../src/guestfs-actions.pod:4630
12275 msgid "guestfs_part_disk"
12279 #: ../src/guestfs-actions.pod:4632
12283 " guestfs_part_disk (guestfs_h *g,\n"
12284 " const char *device,\n"
12285 " const char *parttype);\n"
12290 #: ../src/guestfs-actions.pod:4637
12292 "This command is simply a combination of C<guestfs_part_init> followed by "
12293 "C<guestfs_part_add> to create a single primary partition covering the whole "
12298 #: ../src/guestfs-actions.pod:4641
12300 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12301 "possible values are described in C<guestfs_part_init>."
12305 #: ../src/guestfs-actions.pod:4651
12306 msgid "guestfs_part_get_bootable"
12310 #: ../src/guestfs-actions.pod:4653
12314 " guestfs_part_get_bootable (guestfs_h *g,\n"
12315 " const char *device,\n"
12321 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3098
12323 "This command returns true if the partition C<partnum> on C<device> has the "
12324 "bootable flag set."
12328 #: ../src/guestfs-actions.pod:4661
12329 msgid "See also C<guestfs_part_set_bootable>."
12333 #: ../src/guestfs-actions.pod:4667
12334 msgid "guestfs_part_get_mbr_id"
12338 #: ../src/guestfs-actions.pod:4669
12342 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12343 " const char *device,\n"
12349 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3107
12351 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12352 "partition C<partnum>."
12356 #: ../src/guestfs-actions.pod:4677 ../src/guestfs-actions.pod:4853
12358 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12359 "undefined results for other partition table types (see "
12360 "C<guestfs_part_get_parttype>)."
12364 #: ../src/guestfs-actions.pod:4685
12365 msgid "guestfs_part_get_parttype"
12369 #: ../src/guestfs-actions.pod:4687
12373 " guestfs_part_get_parttype (guestfs_h *g,\n"
12374 " const char *device);\n"
12379 #: ../src/guestfs-actions.pod:4691 ../fish/guestfish-actions.pod:3118
12381 "This command examines the partition table on C<device> and returns the "
12382 "partition table type (format) being used."
12386 #: ../src/guestfs-actions.pod:4694
12388 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12389 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12390 "possible, although unusual. See C<guestfs_part_init> for a full list."
12394 #: ../src/guestfs-actions.pod:4704
12395 msgid "guestfs_part_init"
12399 #: ../src/guestfs-actions.pod:4706
12403 " guestfs_part_init (guestfs_h *g,\n"
12404 " const char *device,\n"
12405 " const char *parttype);\n"
12410 #: ../src/guestfs-actions.pod:4711 ../fish/guestfish-actions.pod:3130
12412 "This creates an empty partition table on C<device> of one of the partition "
12413 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12414 "(for large disks)."
12418 #: ../src/guestfs-actions.pod:4715
12420 "Initially there are no partitions. Following this, you should call "
12421 "C<guestfs_part_add> for each partition required."
12425 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3137
12426 msgid "Possible values for C<parttype> are:"
12430 #: ../src/guestfs-actions.pod:4722 ../fish/guestfish-actions.pod:3141
12431 msgid "B<efi> | B<gpt>"
12435 #: ../src/guestfs-actions.pod:4724 ../fish/guestfish-actions.pod:3143
12436 msgid "Intel EFI / GPT partition table."
12440 #: ../src/guestfs-actions.pod:4726 ../fish/guestfish-actions.pod:3145
12442 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12443 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12444 "the C<mbr> format."
12448 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3149
12449 msgid "B<mbr> | B<msdos>"
12453 #: ../src/guestfs-actions.pod:4732 ../fish/guestfish-actions.pod:3151
12455 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12456 "Windows. This partition type will B<only> work for device sizes up to 2 "
12457 "TB. For large disks we recommend using C<gpt>."
12461 #: ../src/guestfs-actions.pod:4739 ../fish/guestfish-actions.pod:3158
12463 "Other partition table types that may work but are not supported include:"
12467 #: ../src/guestfs-actions.pod:4744 ../fish/guestfish-actions.pod:3163
12472 #: ../src/guestfs-actions.pod:4746 ../fish/guestfish-actions.pod:3165
12473 msgid "AIX disk labels."
12477 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3167
12478 msgid "B<amiga> | B<rdb>"
12482 #: ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3169
12483 msgid "Amiga \"Rigid Disk Block\" format."
12487 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3171
12492 #: ../src/guestfs-actions.pod:4754 ../fish/guestfish-actions.pod:3173
12493 msgid "BSD disk labels."
12497 #: ../src/guestfs-actions.pod:4756 ../fish/guestfish-actions.pod:3175
12502 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3177
12503 msgid "DASD, used on IBM mainframes."
12507 #: ../src/guestfs-actions.pod:4760 ../fish/guestfish-actions.pod:3179
12512 #: ../src/guestfs-actions.pod:4762 ../fish/guestfish-actions.pod:3181
12513 msgid "MIPS/SGI volumes."
12517 #: ../src/guestfs-actions.pod:4764 ../fish/guestfish-actions.pod:3183
12522 #: ../src/guestfs-actions.pod:4766 ../fish/guestfish-actions.pod:3185
12523 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12527 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3187
12532 #: ../src/guestfs-actions.pod:4770 ../fish/guestfish-actions.pod:3189
12533 msgid "NEC PC-98 format, common in Japan apparently."
12537 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3191
12542 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3193
12543 msgid "Sun disk labels."
12547 #: ../src/guestfs-actions.pod:4782
12548 msgid "guestfs_part_list"
12552 #: ../src/guestfs-actions.pod:4784
12555 " struct guestfs_partition_list *\n"
12556 " guestfs_part_list (guestfs_h *g,\n"
12557 " const char *device);\n"
12562 #: ../src/guestfs-actions.pod:4788 ../fish/guestfish-actions.pod:3201
12564 "This command parses the partition table on C<device> and returns the list of "
12565 "partitions found."
12569 #: ../src/guestfs-actions.pod:4791 ../fish/guestfish-actions.pod:3204
12570 msgid "The fields in the returned structure are:"
12574 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3208
12575 msgid "B<part_num>"
12579 #: ../src/guestfs-actions.pod:4797 ../fish/guestfish-actions.pod:3210
12580 msgid "Partition number, counting from 1."
12584 #: ../src/guestfs-actions.pod:4799 ../fish/guestfish-actions.pod:3212
12585 msgid "B<part_start>"
12589 #: ../src/guestfs-actions.pod:4801
12591 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12592 "the device's sector size, see C<guestfs_blockdev_getss>."
12596 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3217
12597 msgid "B<part_end>"
12601 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3219
12602 msgid "End of the partition in bytes."
12606 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3221
12607 msgid "B<part_size>"
12611 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3223
12612 msgid "Size of the partition in bytes."
12616 #: ../src/guestfs-actions.pod:4814
12618 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12619 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12624 #: ../src/guestfs-actions.pod:4820
12625 msgid "guestfs_part_set_bootable"
12629 #: ../src/guestfs-actions.pod:4822
12633 " guestfs_part_set_bootable (guestfs_h *g,\n"
12634 " const char *device,\n"
12636 " int bootable);\n"
12641 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3231
12643 "This sets the bootable flag on partition numbered C<partnum> on device "
12644 "C<device>. Note that partitions are numbered from 1."
12648 #: ../src/guestfs-actions.pod:4831 ../fish/guestfish-actions.pod:3234
12650 "The bootable flag is used by some operating systems (notably Windows) to "
12651 "determine which partition to boot from. It is by no means universally "
12656 #: ../src/guestfs-actions.pod:4839
12657 msgid "guestfs_part_set_mbr_id"
12661 #: ../src/guestfs-actions.pod:4841
12665 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12666 " const char *device,\n"
12673 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3242
12675 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12676 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12677 "documentation are in fact hexadecimal numbers, but usually documented "
12678 "without any leading \"0x\" which might be confusing."
12682 #: ../src/guestfs-actions.pod:4861
12683 msgid "guestfs_part_set_name"
12687 #: ../src/guestfs-actions.pod:4863
12691 " guestfs_part_set_name (guestfs_h *g,\n"
12692 " const char *device,\n"
12694 " const char *name);\n"
12699 #: ../src/guestfs-actions.pod:4869 ../fish/guestfish-actions.pod:3256
12701 "This sets the partition name on partition numbered C<partnum> on device "
12702 "C<device>. Note that partitions are numbered from 1."
12706 #: ../src/guestfs-actions.pod:4872 ../fish/guestfish-actions.pod:3259
12708 "The partition name can only be set on certain types of partition table. "
12709 "This works on C<gpt> but not on C<mbr> partitions."
12713 #: ../src/guestfs-actions.pod:4879
12714 msgid "guestfs_part_to_dev"
12718 #: ../src/guestfs-actions.pod:4881
12722 " guestfs_part_to_dev (guestfs_h *g,\n"
12723 " const char *partition);\n"
12728 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3266
12730 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12731 "partition number, returning the device name (eg. \"/dev/sdb\")."
12735 #: ../src/guestfs-actions.pod:4889
12737 "The named partition must exist, for example as a string returned from "
12738 "C<guestfs_list_partitions>."
12742 #: ../src/guestfs-actions.pod:4897
12743 msgid "guestfs_ping_daemon"
12747 #: ../src/guestfs-actions.pod:4899
12751 " guestfs_ping_daemon (guestfs_h *g);\n"
12756 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3277
12758 "This is a test probe into the guestfs daemon running inside the qemu "
12759 "subprocess. Calling this function checks that the daemon responds to the "
12760 "ping message, without affecting the daemon or attached block device(s) in "
12765 #: ../src/guestfs-actions.pod:4911
12766 msgid "guestfs_pread"
12770 #: ../src/guestfs-actions.pod:4913
12774 " guestfs_pread (guestfs_h *g,\n"
12775 " const char *path,\n"
12777 " int64_t offset,\n"
12778 " size_t *size_r);\n"
12783 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3286
12785 "This command lets you read part of a file. It reads C<count> bytes of the "
12786 "file, starting at C<offset>, from file C<path>."
12790 #: ../src/guestfs-actions.pod:4923 ../src/guestfs-actions.pod:4949
12791 #: ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3304
12793 "This may read fewer bytes than requested. For further details see the "
12794 "L<pread(2)> system call."
12798 #: ../src/guestfs-actions.pod:4926
12799 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12803 #: ../src/guestfs-actions.pod:4937
12804 msgid "guestfs_pread_device"
12808 #: ../src/guestfs-actions.pod:4939
12812 " guestfs_pread_device (guestfs_h *g,\n"
12813 " const char *device,\n"
12815 " int64_t offset,\n"
12816 " size_t *size_r);\n"
12821 #: ../src/guestfs-actions.pod:4946 ../fish/guestfish-actions.pod:3301
12823 "This command lets you read part of a file. It reads C<count> bytes of "
12824 "C<device>, starting at C<offset>."
12828 #: ../src/guestfs-actions.pod:4952
12829 msgid "See also C<guestfs_pread>."
12833 #: ../src/guestfs-actions.pod:4961
12834 msgid "(Added in 1.5.21)"
12838 #: ../src/guestfs-actions.pod:4963
12839 msgid "guestfs_pvcreate"
12843 #: ../src/guestfs-actions.pod:4965
12847 " guestfs_pvcreate (guestfs_h *g,\n"
12848 " const char *device);\n"
12853 #: ../src/guestfs-actions.pod:4969 ../fish/guestfish-actions.pod:3316
12855 "This creates an LVM physical volume on the named C<device>, where C<device> "
12856 "should usually be a partition name such as C</dev/sda1>."
12860 #: ../src/guestfs-actions.pod:4977
12861 msgid "guestfs_pvremove"
12865 #: ../src/guestfs-actions.pod:4979
12869 " guestfs_pvremove (guestfs_h *g,\n"
12870 " const char *device);\n"
12875 #: ../src/guestfs-actions.pod:4983 ../fish/guestfish-actions.pod:3324
12877 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12882 #: ../src/guestfs-actions.pod:4986 ../fish/guestfish-actions.pod:3327
12884 "The implementation uses the C<pvremove> command which refuses to wipe "
12885 "physical volumes that contain any volume groups, so you have to remove those "
12890 #: ../src/guestfs-actions.pod:4994
12891 msgid "guestfs_pvresize"
12895 #: ../src/guestfs-actions.pod:4996
12899 " guestfs_pvresize (guestfs_h *g,\n"
12900 " const char *device);\n"
12905 #: ../src/guestfs-actions.pod:5000 ../fish/guestfish-actions.pod:3335
12907 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12908 "the new size of the underlying device."
12912 #: ../src/guestfs-actions.pod:5007
12913 msgid "guestfs_pvresize_size"
12917 #: ../src/guestfs-actions.pod:5009
12921 " guestfs_pvresize_size (guestfs_h *g,\n"
12922 " const char *device,\n"
12923 " int64_t size);\n"
12928 #: ../src/guestfs-actions.pod:5014
12930 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12931 "specify the new size (in bytes) explicitly."
12935 #: ../src/guestfs-actions.pod:5021
12936 msgid "guestfs_pvs"
12940 #: ../src/guestfs-actions.pod:5023
12944 " guestfs_pvs (guestfs_h *g);\n"
12949 #: ../src/guestfs-actions.pod:5026 ../fish/guestfish-actions.pod:3349
12951 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12956 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3352
12958 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12963 #: ../src/guestfs-actions.pod:5032
12964 msgid "See also C<guestfs_pvs_full>."
12968 #: ../src/guestfs-actions.pod:5040
12969 msgid "guestfs_pvs_full"
12973 #: ../src/guestfs-actions.pod:5042
12976 " struct guestfs_lvm_pv_list *\n"
12977 " guestfs_pvs_full (guestfs_h *g);\n"
12982 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3361
12984 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12985 "(8)> command. The \"full\" version includes all fields."
12989 #: ../src/guestfs-actions.pod:5048
12991 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12992 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
12996 #: ../src/guestfs-actions.pod:5054
12997 msgid "guestfs_pvuuid"
13001 #: ../src/guestfs-actions.pod:5056
13005 " guestfs_pvuuid (guestfs_h *g,\n"
13006 " const char *device);\n"
13011 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3368
13012 msgid "This command returns the UUID of the LVM PV C<device>."
13016 #: ../src/guestfs-actions.pod:5067
13017 msgid "guestfs_pwrite"
13021 #: ../src/guestfs-actions.pod:5069
13025 " guestfs_pwrite (guestfs_h *g,\n"
13026 " const char *path,\n"
13027 " const char *content,\n"
13028 " size_t content_size,\n"
13029 " int64_t offset);\n"
13034 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3374
13036 "This command writes to part of a file. It writes the data buffer C<content> "
13037 "to the file C<path> starting at offset C<offset>."
13041 #: ../src/guestfs-actions.pod:5079 ../fish/guestfish-actions.pod:3377
13043 "This command implements the L<pwrite(2)> system call, and like that system "
13044 "call it may not write the full data requested. The return value is the "
13045 "number of bytes that were actually written to the file. This could even be "
13046 "0, although short writes are unlikely for regular files in ordinary "
13051 #: ../src/guestfs-actions.pod:5085
13052 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
13056 #: ../src/guestfs-actions.pod:5094
13057 msgid "guestfs_pwrite_device"
13061 #: ../src/guestfs-actions.pod:5096
13065 " guestfs_pwrite_device (guestfs_h *g,\n"
13066 " const char *device,\n"
13067 " const char *content,\n"
13068 " size_t content_size,\n"
13069 " int64_t offset);\n"
13074 #: ../src/guestfs-actions.pod:5103 ../fish/guestfish-actions.pod:3392
13076 "This command writes to part of a device. It writes the data buffer "
13077 "C<content> to C<device> starting at offset C<offset>."
13081 #: ../src/guestfs-actions.pod:5106 ../fish/guestfish-actions.pod:3395
13083 "This command implements the L<pwrite(2)> system call, and like that system "
13084 "call it may not write the full data requested (although short writes to disk "
13085 "devices and partitions are probably impossible with standard Linux kernels)."
13089 #: ../src/guestfs-actions.pod:5111
13090 msgid "See also C<guestfs_pwrite>."
13094 #: ../src/guestfs-actions.pod:5118
13095 msgid "(Added in 1.5.20)"
13099 #: ../src/guestfs-actions.pod:5120
13100 msgid "guestfs_read_file"
13104 #: ../src/guestfs-actions.pod:5122
13108 " guestfs_read_file (guestfs_h *g,\n"
13109 " const char *path,\n"
13110 " size_t *size_r);\n"
13115 #: ../src/guestfs-actions.pod:5127 ../fish/guestfish-actions.pod:3409
13116 msgid "This calls returns the contents of the file C<path> as a buffer."
13120 #: ../src/guestfs-actions.pod:5130
13122 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
13123 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
13124 "function is limited in the total size of file that can be handled."
13128 #: ../src/guestfs-actions.pod:5142
13129 msgid "(Added in 1.0.63)"
13133 #: ../src/guestfs-actions.pod:5144
13134 msgid "guestfs_read_lines"
13138 #: ../src/guestfs-actions.pod:5146
13142 " guestfs_read_lines (guestfs_h *g,\n"
13143 " const char *path);\n"
13148 #: ../src/guestfs-actions.pod:5152 ../fish/guestfish-actions.pod:3426
13150 "The file contents are returned as a list of lines. Trailing C<LF> and "
13151 "C<CRLF> character sequences are I<not> returned."
13155 #: ../src/guestfs-actions.pod:5155
13157 "Note that this function cannot correctly handle binary files (specifically, "
13158 "files containing C<\\0> character which is treated as end of line). For "
13159 "those you need to use the C<guestfs_read_file> function which has a more "
13160 "complex interface."
13164 #: ../src/guestfs-actions.pod:5166
13165 msgid "guestfs_readdir"
13169 #: ../src/guestfs-actions.pod:5168
13172 " struct guestfs_dirent_list *\n"
13173 " guestfs_readdir (guestfs_h *g,\n"
13174 " const char *dir);\n"
13179 #: ../src/guestfs-actions.pod:5172 ../fish/guestfish-actions.pod:3438
13180 msgid "This returns the list of directory entries in directory C<dir>."
13184 #: ../src/guestfs-actions.pod:5174 ../fish/guestfish-actions.pod:3440
13186 "All entries in the directory are returned, including C<.> and C<..>. The "
13187 "entries are I<not> sorted, but returned in the same order as the underlying "
13192 #: ../src/guestfs-actions.pod:5178 ../fish/guestfish-actions.pod:3444
13194 "Also this call returns basic file type information about each file. The "
13195 "C<ftyp> field will contain one of the following characters:"
13199 #: ../src/guestfs-actions.pod:5183 ../fish/guestfish-actions.pod:3449
13204 #: ../src/guestfs-actions.pod:5185 ../fish/guestfish-actions.pod:3451
13205 msgid "Block special"
13209 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:3453
13214 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:3455
13215 msgid "Char special"
13219 #: ../src/guestfs-actions.pod:5191 ../fish/guestfish-actions.pod:3457
13224 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:3459
13229 #: ../src/guestfs-actions.pod:5195 ../fish/guestfish-actions.pod:3461
13234 #: ../src/guestfs-actions.pod:5197 ../fish/guestfish-actions.pod:3463
13235 msgid "FIFO (named pipe)"
13239 #: ../src/guestfs-actions.pod:5199 ../fish/guestfish-actions.pod:3465
13244 #: ../src/guestfs-actions.pod:5201 ../fish/guestfish-actions.pod:3467
13245 msgid "Symbolic link"
13249 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:3469
13254 #: ../src/guestfs-actions.pod:5205 ../fish/guestfish-actions.pod:3471
13255 msgid "Regular file"
13259 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:3473
13264 #: ../src/guestfs-actions.pod:5209 ../fish/guestfish-actions.pod:3475
13269 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:3477
13274 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:3479
13275 msgid "Unknown file type"
13279 #: ../src/guestfs-actions.pod:5215 ../fish/guestfish-actions.pod:3481
13284 #: ../src/guestfs-actions.pod:5217 ../fish/guestfish-actions.pod:3483
13286 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13290 #: ../src/guestfs-actions.pod:5222
13292 "This function is primarily intended for use by programs. To get a simple "
13293 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13294 "consumption, use C<guestfs_ll>."
13298 #: ../src/guestfs-actions.pod:5226
13300 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13301 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13305 #: ../src/guestfs-actions.pod:5232
13306 msgid "guestfs_readlink"
13310 #: ../src/guestfs-actions.pod:5234
13314 " guestfs_readlink (guestfs_h *g,\n"
13315 " const char *path);\n"
13320 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:3496
13321 msgid "This command reads the target of a symbolic link."
13325 #: ../src/guestfs-actions.pod:5245
13326 msgid "guestfs_readlinklist"
13330 #: ../src/guestfs-actions.pod:5247
13334 " guestfs_readlinklist (guestfs_h *g,\n"
13335 " const char *path,\n"
13336 " char *const *names);\n"
13341 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:3502
13343 "This call allows you to do a C<readlink> operation on multiple files, where "
13344 "all files are in the directory C<path>. C<names> is the list of files from "
13349 #: ../src/guestfs-actions.pod:5256 ../fish/guestfish-actions.pod:3506
13351 "On return you get a list of strings, with a one-to-one correspondence to the "
13352 "C<names> list. Each string is the value of the symbolic link."
13356 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:3510
13358 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13359 "result string is the empty string C<\"\">. However the whole operation is "
13360 "completed even if there were C<readlink(2)> errors, and so you can call this "
13361 "function with names where you don't know if they are symbolic links already "
13362 "(albeit slightly less efficient)."
13366 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3517
13368 "This call is intended for programs that want to efficiently list a directory "
13369 "contents without making many round-trips. Very long directory listings "
13370 "might cause the protocol message size to be exceeded, causing this call to "
13371 "fail. The caller must split up such requests into smaller groups of names."
13375 #: ../src/guestfs-actions.pod:5280
13376 msgid "guestfs_realpath"
13380 #: ../src/guestfs-actions.pod:5282
13384 " guestfs_realpath (guestfs_h *g,\n"
13385 " const char *path);\n"
13390 #: ../src/guestfs-actions.pod:5286 ../fish/guestfish-actions.pod:3528
13392 "Return the canonicalized absolute pathname of C<path>. The returned path "
13393 "has no C<.>, C<..> or symbolic link path elements."
13397 #: ../src/guestfs-actions.pod:5294
13398 msgid "guestfs_removexattr"
13402 #: ../src/guestfs-actions.pod:5296
13406 " guestfs_removexattr (guestfs_h *g,\n"
13407 " const char *xattr,\n"
13408 " const char *path);\n"
13413 #: ../src/guestfs-actions.pod:5301 ../fish/guestfish-actions.pod:3535
13415 "This call removes the extended attribute named C<xattr> of the file C<path>."
13419 #: ../src/guestfs-actions.pod:5304
13420 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13424 #: ../src/guestfs-actions.pod:5310
13425 msgid "guestfs_resize2fs"
13429 #: ../src/guestfs-actions.pod:5312
13433 " guestfs_resize2fs (guestfs_h *g,\n"
13434 " const char *device);\n"
13439 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3544
13441 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13442 "underlying device."
13446 #: ../src/guestfs-actions.pod:5319
13448 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13449 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13450 "sometimes gives an error about this and sometimes not. In any case, it is "
13451 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13455 #: ../src/guestfs-actions.pod:5329
13456 msgid "guestfs_resize2fs_size"
13460 #: ../src/guestfs-actions.pod:5331
13464 " guestfs_resize2fs_size (guestfs_h *g,\n"
13465 " const char *device,\n"
13466 " int64_t size);\n"
13471 #: ../src/guestfs-actions.pod:5336
13473 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13474 "to specify the new size (in bytes) explicitly."
13478 #: ../src/guestfs-actions.pod:5343
13483 #: ../src/guestfs-actions.pod:5345
13487 " guestfs_rm (guestfs_h *g,\n"
13488 " const char *path);\n"
13493 #: ../src/guestfs-actions.pod:5349 ../fish/guestfish-actions.pod:3564
13494 msgid "Remove the single file C<path>."
13498 #: ../src/guestfs-actions.pod:5355
13499 msgid "guestfs_rm_rf"
13503 #: ../src/guestfs-actions.pod:5357
13507 " guestfs_rm_rf (guestfs_h *g,\n"
13508 " const char *path);\n"
13513 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3570
13515 "Remove the file or directory C<path>, recursively removing the contents if "
13516 "its a directory. This is like the C<rm -rf> shell command."
13520 #: ../src/guestfs-actions.pod:5369
13521 msgid "guestfs_rmdir"
13525 #: ../src/guestfs-actions.pod:5371
13529 " guestfs_rmdir (guestfs_h *g,\n"
13530 " const char *path);\n"
13535 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:3578
13536 msgid "Remove the single directory C<path>."
13540 #: ../src/guestfs-actions.pod:5381
13541 msgid "guestfs_rmmountpoint"
13545 #: ../src/guestfs-actions.pod:5383
13549 " guestfs_rmmountpoint (guestfs_h *g,\n"
13550 " const char *exemptpath);\n"
13555 #: ../src/guestfs-actions.pod:5387
13557 "This calls removes a mountpoint that was previously created with "
13558 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13562 #: ../src/guestfs-actions.pod:5395
13563 msgid "guestfs_scrub_device"
13567 #: ../src/guestfs-actions.pod:5397
13571 " guestfs_scrub_device (guestfs_h *g,\n"
13572 " const char *device);\n"
13577 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3592
13579 "This command writes patterns over C<device> to make data retrieval more "
13584 #: ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5425
13585 #: ../src/guestfs-actions.pod:5444 ../fish/guestfish-actions.pod:3595
13586 #: ../fish/guestfish-actions.pod:3610 ../fish/guestfish-actions.pod:3623
13588 "It is an interface to the L<scrub(1)> program. See that manual page for "
13593 #: ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5430
13594 #: ../src/guestfs-actions.pod:5449
13595 msgid "(Added in 1.0.52)"
13599 #: ../src/guestfs-actions.pod:5414
13600 msgid "guestfs_scrub_file"
13604 #: ../src/guestfs-actions.pod:5416
13608 " guestfs_scrub_file (guestfs_h *g,\n"
13609 " const char *file);\n"
13614 #: ../src/guestfs-actions.pod:5420 ../fish/guestfish-actions.pod:3605
13616 "This command writes patterns over a file to make data retrieval more "
13621 #: ../src/guestfs-actions.pod:5423 ../fish/guestfish-actions.pod:3608
13622 msgid "The file is I<removed> after scrubbing."
13626 #: ../src/guestfs-actions.pod:5432
13627 msgid "guestfs_scrub_freespace"
13631 #: ../src/guestfs-actions.pod:5434
13635 " guestfs_scrub_freespace (guestfs_h *g,\n"
13636 " const char *dir);\n"
13641 #: ../src/guestfs-actions.pod:5438
13643 "This command creates the directory C<dir> and then fills it with files until "
13644 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13645 "and deletes them. The intention is to scrub any free space on the partition "
13646 "containing C<dir>."
13650 #: ../src/guestfs-actions.pod:5451
13651 msgid "guestfs_set_append"
13655 #: ../src/guestfs-actions.pod:5453
13659 " guestfs_set_append (guestfs_h *g,\n"
13660 " const char *append);\n"
13665 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3632
13667 "This function is used to add additional options to the guest kernel command "
13672 #: ../src/guestfs-actions.pod:5460 ../fish/guestfish-actions.pod:3635
13674 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13675 "environment variable."
13679 #: ../src/guestfs-actions.pod:5463 ../fish/guestfish-actions.pod:3638
13681 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13682 "(libguestfs always adds a few of its own)."
13686 #: ../src/guestfs-actions.pod:5470
13687 msgid "guestfs_set_autosync"
13691 #: ../src/guestfs-actions.pod:5472
13695 " guestfs_set_autosync (guestfs_h *g,\n"
13696 " int autosync);\n"
13701 #: ../src/guestfs-actions.pod:5476
13703 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13704 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13705 "the handle is closed (also if the program exits without closing handles)."
13709 #: ../src/guestfs-actions.pod:5481 ../fish/guestfish-actions.pod:3652
13711 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13712 "disabled by default)."
13716 #: ../src/guestfs-actions.pod:5488
13717 msgid "guestfs_set_direct"
13721 #: ../src/guestfs-actions.pod:5490
13725 " guestfs_set_direct (guestfs_h *g,\n"
13731 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3661
13733 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13734 "passed directly through to the appliance once it is launched."
13738 #: ../src/guestfs-actions.pod:5498
13740 "One consequence of this is that log messages aren't caught by the library "
13741 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13746 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:3669
13747 msgid "You probably don't want to use this unless you know what you are doing."
13751 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:3672
13752 msgid "The default is disabled."
13756 #: ../src/guestfs-actions.pod:5511
13757 msgid "guestfs_set_e2label"
13761 #: ../src/guestfs-actions.pod:5513
13765 " guestfs_set_e2label (guestfs_h *g,\n"
13766 " const char *device,\n"
13767 " const char *label);\n"
13772 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:3678
13774 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13775 "C<label>. Filesystem labels are limited to 16 characters."
13779 #: ../src/guestfs-actions.pod:5522
13781 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13782 "the existing label on a filesystem."
13786 #: ../src/guestfs-actions.pod:5529
13787 msgid "guestfs_set_e2uuid"
13791 #: ../src/guestfs-actions.pod:5531
13795 " guestfs_set_e2uuid (guestfs_h *g,\n"
13796 " const char *device,\n"
13797 " const char *uuid);\n"
13802 #: ../src/guestfs-actions.pod:5536 ../fish/guestfish-actions.pod:3689
13804 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13805 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13806 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13810 #: ../src/guestfs-actions.pod:5541
13812 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13813 "the existing UUID of a filesystem."
13817 #: ../src/guestfs-actions.pod:5548
13818 msgid "guestfs_set_memsize"
13822 #: ../src/guestfs-actions.pod:5550
13826 " guestfs_set_memsize (guestfs_h *g,\n"
13832 #: ../src/guestfs-actions.pod:5554
13834 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13835 "This only has any effect if called before C<guestfs_launch>."
13839 #: ../src/guestfs-actions.pod:5558 ../fish/guestfish-actions.pod:3707
13841 "You can also change this by setting the environment variable "
13842 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13846 #: ../src/guestfs-actions.pod:5569
13847 msgid "guestfs_set_network"
13851 #: ../src/guestfs-actions.pod:5571
13855 " guestfs_set_network (guestfs_h *g,\n"
13861 #: ../src/guestfs-actions.pod:5575 ../fish/guestfish-actions.pod:3720
13863 "If C<network> is true, then the network is enabled in the libguestfs "
13864 "appliance. The default is false."
13868 #: ../src/guestfs-actions.pod:5578 ../fish/guestfish-actions.pod:3723
13870 "This affects whether commands are able to access the network (see L<guestfs"
13871 "(3)/RUNNING COMMANDS>)."
13875 #: ../src/guestfs-actions.pod:5581
13877 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13882 #: ../src/guestfs-actions.pod:5588
13883 msgid "guestfs_set_path"
13887 #: ../src/guestfs-actions.pod:5590
13891 " guestfs_set_path (guestfs_h *g,\n"
13892 " const char *searchpath);\n"
13897 #: ../src/guestfs-actions.pod:5594 ../fish/guestfish-actions.pod:3735
13898 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13902 #: ../src/guestfs-actions.pod:5596 ../fish/guestfish-actions.pod:3737
13904 "The default is C<$libdir/guestfs> unless overridden by setting "
13905 "C<LIBGUESTFS_PATH> environment variable."
13909 #: ../src/guestfs-actions.pod:5599 ../fish/guestfish-actions.pod:3740
13910 msgid "Setting C<path> to C<NULL> restores the default path."
13914 #: ../src/guestfs-actions.pod:5605
13915 msgid "guestfs_set_qemu"
13919 #: ../src/guestfs-actions.pod:5607
13923 " guestfs_set_qemu (guestfs_h *g,\n"
13924 " const char *qemu);\n"
13929 #: ../src/guestfs-actions.pod:5611 ../fish/guestfish-actions.pod:3748
13930 msgid "Set the qemu binary that we will use."
13934 #: ../src/guestfs-actions.pod:5613 ../fish/guestfish-actions.pod:3750
13936 "The default is chosen when the library was compiled by the configure script."
13940 #: ../src/guestfs-actions.pod:5616 ../fish/guestfish-actions.pod:3753
13942 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13947 #: ../src/guestfs-actions.pod:5619 ../fish/guestfish-actions.pod:3756
13948 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13952 #: ../src/guestfs-actions.pod:5621 ../fish/guestfish-actions.pod:3758
13954 "Note that you should call this function as early as possible after creating "
13955 "the handle. This is because some pre-launch operations depend on testing "
13956 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13957 "don't retest features, and so you might see inconsistent results. Using the "
13958 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13959 "the qemu binary at the same time as the handle is created."
13963 #: ../src/guestfs-actions.pod:5633
13964 msgid "guestfs_set_recovery_proc"
13968 #: ../src/guestfs-actions.pod:5635
13972 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13973 " int recoveryproc);\n"
13978 #: ../src/guestfs-actions.pod:5639
13980 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13981 "not create a recovery process. The purpose of the recovery process is to "
13982 "stop runaway qemu processes in the case where the main program aborts "
13987 #: ../src/guestfs-actions.pod:5644
13989 "This only has any effect if called before C<guestfs_launch>, and the default "
13994 #: ../src/guestfs-actions.pod:5647 ../fish/guestfish-actions.pod:3780
13996 "About the only time when you would want to disable this is if the main "
13997 "process will fork itself into the background (\"daemonize\" itself). In "
13998 "this case the recovery process thinks that the main program has disappeared "
13999 "and so kills qemu, which is not very helpful."
14003 #: ../src/guestfs-actions.pod:5657
14004 msgid "guestfs_set_selinux"
14008 #: ../src/guestfs-actions.pod:5659
14012 " guestfs_set_selinux (guestfs_h *g,\n"
14018 #: ../src/guestfs-actions.pod:5663 ../fish/guestfish-actions.pod:3792
14020 "This sets the selinux flag that is passed to the appliance at boot time. "
14021 "The default is C<selinux=0> (disabled)."
14025 #: ../src/guestfs-actions.pod:5666 ../fish/guestfish-actions.pod:3795
14027 "Note that if SELinux is enabled, it is always in Permissive mode "
14028 "(C<enforcing=0>)."
14032 #: ../src/guestfs-actions.pod:5676
14033 msgid "guestfs_set_trace"
14037 #: ../src/guestfs-actions.pod:5678
14041 " guestfs_set_trace (guestfs_h *g,\n"
14047 #: ../src/guestfs-actions.pod:5682 ../fish/guestfish-actions.pod:3807
14049 "If the command trace flag is set to 1, then commands are printed on stderr "
14050 "before they are executed in a format which is very similar to the one used "
14051 "by guestfish. In other words, you can run a program with this enabled, and "
14052 "you will get out a script which you can feed to guestfish to perform the "
14053 "same set of actions."
14057 #: ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:3814
14059 "If you want to trace C API calls into libguestfs (and other libraries) then "
14060 "possibly a better way is to use the external ltrace(1) command."
14064 #: ../src/guestfs-actions.pod:5693 ../fish/guestfish-actions.pod:3818
14066 "Command traces are disabled unless the environment variable "
14067 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14071 #: ../src/guestfs-actions.pod:5700
14072 msgid "guestfs_set_verbose"
14076 #: ../src/guestfs-actions.pod:5702
14080 " guestfs_set_verbose (guestfs_h *g,\n"
14086 #: ../src/guestfs-actions.pod:5706 ../fish/guestfish-actions.pod:3827
14087 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
14091 #: ../src/guestfs-actions.pod:5708 ../fish/guestfish-actions.pod:3829
14093 "Verbose messages are disabled unless the environment variable "
14094 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14098 #: ../src/guestfs-actions.pod:5715
14099 msgid "guestfs_setcon"
14103 #: ../src/guestfs-actions.pod:5717
14107 " guestfs_setcon (guestfs_h *g,\n"
14108 " const char *context);\n"
14113 #: ../src/guestfs-actions.pod:5721 ../fish/guestfish-actions.pod:3836
14115 "This sets the SELinux security context of the daemon to the string "
14120 #: ../src/guestfs-actions.pod:5724 ../fish/guestfish-actions.pod:3839
14121 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14125 #: ../src/guestfs-actions.pod:5730
14126 msgid "guestfs_setxattr"
14130 #: ../src/guestfs-actions.pod:5732
14134 " guestfs_setxattr (guestfs_h *g,\n"
14135 " const char *xattr,\n"
14136 " const char *val,\n"
14138 " const char *path);\n"
14143 #: ../src/guestfs-actions.pod:5739 ../fish/guestfish-actions.pod:3845
14145 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14146 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14150 #: ../src/guestfs-actions.pod:5743
14151 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14155 #: ../src/guestfs-actions.pod:5749
14156 msgid "guestfs_sfdisk"
14160 #: ../src/guestfs-actions.pod:5751
14164 " guestfs_sfdisk (guestfs_h *g,\n"
14165 " const char *device,\n"
14169 " char *const *lines);\n"
14174 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:3855
14176 "This is a direct interface to the L<sfdisk(8)> program for creating "
14177 "partitions on block devices."
14181 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3858
14182 msgid "C<device> should be a block device, for example C</dev/sda>."
14186 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3860
14188 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14189 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14190 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14191 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14192 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14193 "the kernel) cannot work out the right geometry and you will need to tell it."
14197 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:3868
14199 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14200 "refer to the L<sfdisk(8)> manpage."
14204 #: ../src/guestfs-actions.pod:5775 ../fish/guestfish-actions.pod:3871
14206 "To create a single partition occupying the whole disk, you would pass "
14207 "C<lines> as a single element list, when the single element being the string "
14212 #: ../src/guestfs-actions.pod:5779
14214 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14218 #: ../src/guestfs-actions.pod:5789
14219 msgid "guestfs_sfdiskM"
14223 #: ../src/guestfs-actions.pod:5791
14227 " guestfs_sfdiskM (guestfs_h *g,\n"
14228 " const char *device,\n"
14229 " char *const *lines);\n"
14234 #: ../src/guestfs-actions.pod:5796
14236 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14237 "partition sizes are specified in megabytes only (rounded to the nearest "
14238 "cylinder) and you don't need to specify the cyls, heads and sectors "
14239 "parameters which were rarely if ever used anyway."
14243 #: ../src/guestfs-actions.pod:5802
14245 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14246 "C<guestfs_part_disk>"
14250 #: ../src/guestfs-actions.pod:5812
14251 msgid "guestfs_sfdisk_N"
14255 #: ../src/guestfs-actions.pod:5814
14259 " guestfs_sfdisk_N (guestfs_h *g,\n"
14260 " const char *device,\n"
14265 " const char *line);\n"
14270 #: ../src/guestfs-actions.pod:5823 ../fish/guestfish-actions.pod:3901
14272 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14273 "(note: C<n> counts from 1)."
14277 #: ../src/guestfs-actions.pod:5826
14279 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14280 "for the cyls/heads/sectors parameters."
14284 #: ../src/guestfs-actions.pod:5829
14285 msgid "See also: C<guestfs_part_add>"
14289 #: ../src/guestfs-actions.pod:5838
14290 msgid "guestfs_sfdisk_disk_geometry"
14294 #: ../src/guestfs-actions.pod:5840
14298 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14299 " const char *device);\n"
14304 #: ../src/guestfs-actions.pod:5844
14306 "This displays the disk geometry of C<device> read from the partition table. "
14307 "Especially in the case where the underlying block device has been resized, "
14308 "this can be different from the kernel's idea of the geometry (see "
14309 "C<guestfs_sfdisk_kernel_geometry>)."
14313 #: ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:5865
14314 #: ../fish/guestfish-actions.pod:3921 ../fish/guestfish-actions.pod:3930
14315 msgid "The result is in human-readable format, and not designed to be parsed."
14319 #: ../src/guestfs-actions.pod:5857
14320 msgid "guestfs_sfdisk_kernel_geometry"
14324 #: ../src/guestfs-actions.pod:5859
14328 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14329 " const char *device);\n"
14334 #: ../src/guestfs-actions.pod:5863 ../fish/guestfish-actions.pod:3928
14335 msgid "This displays the kernel's idea of the geometry of C<device>."
14339 #: ../src/guestfs-actions.pod:5873
14340 msgid "guestfs_sfdisk_l"
14344 #: ../src/guestfs-actions.pod:5875
14348 " guestfs_sfdisk_l (guestfs_h *g,\n"
14349 " const char *device);\n"
14354 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3937
14356 "This displays the partition table on C<device>, in the human-readable output "
14357 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14361 #: ../src/guestfs-actions.pod:5883
14362 msgid "See also: C<guestfs_part_list>"
14366 #: ../src/guestfs-actions.pod:5890
14371 #: ../src/guestfs-actions.pod:5892
14375 " guestfs_sh (guestfs_h *g,\n"
14376 " const char *command);\n"
14381 #: ../src/guestfs-actions.pod:5896 ../fish/guestfish-actions.pod:3947
14383 "This call runs a command from the guest filesystem via the guest's C</bin/"
14388 #: ../src/guestfs-actions.pod:5899
14389 msgid "This is like C<guestfs_command>, but passes the command to:"
14393 #: ../src/guestfs-actions.pod:5901 ../fish/guestfish-actions.pod:3952
14396 " /bin/sh -c \"command\"\n"
14401 #: ../src/guestfs-actions.pod:5903 ../fish/guestfish-actions.pod:3954
14403 "Depending on the guest's shell, this usually results in wildcards being "
14404 "expanded, shell expressions being interpolated and so on."
14408 #: ../src/guestfs-actions.pod:5907
14409 msgid "All the provisos about C<guestfs_command> apply to this call."
14413 #: ../src/guestfs-actions.pod:5914
14414 msgid "guestfs_sh_lines"
14418 #: ../src/guestfs-actions.pod:5916
14422 " guestfs_sh_lines (guestfs_h *g,\n"
14423 " const char *command);\n"
14428 #: ../src/guestfs-actions.pod:5920
14430 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14435 #: ../src/guestfs-actions.pod:5923
14436 msgid "See also: C<guestfs_command_lines>"
14440 #: ../src/guestfs-actions.pod:5931
14441 msgid "guestfs_sleep"
14445 #: ../src/guestfs-actions.pod:5933
14449 " guestfs_sleep (guestfs_h *g,\n"
14455 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3973
14456 msgid "Sleep for C<secs> seconds."
14460 #: ../src/guestfs-actions.pod:5941
14461 msgid "(Added in 1.0.41)"
14465 #: ../src/guestfs-actions.pod:5943 ../src/guestfs-structs.pod:109
14466 msgid "guestfs_stat"
14470 #: ../src/guestfs-actions.pod:5945
14473 " struct guestfs_stat *\n"
14474 " guestfs_stat (guestfs_h *g,\n"
14475 " const char *path);\n"
14480 #: ../src/guestfs-actions.pod:5951 ../fish/guestfish-actions.pod:3981
14481 msgid "This is the same as the C<stat(2)> system call."
14485 #: ../src/guestfs-actions.pod:5959 ../src/guestfs-structs.pod:135
14486 msgid "guestfs_statvfs"
14490 #: ../src/guestfs-actions.pod:5961
14493 " struct guestfs_statvfs *\n"
14494 " guestfs_statvfs (guestfs_h *g,\n"
14495 " const char *path);\n"
14500 #: ../src/guestfs-actions.pod:5965 ../fish/guestfish-actions.pod:3987
14502 "Returns file system statistics for any mounted file system. C<path> should "
14503 "be a file or directory in the mounted file system (typically it is the mount "
14504 "point itself, but it doesn't need to be)."
14508 #: ../src/guestfs-actions.pod:5969 ../fish/guestfish-actions.pod:3991
14509 msgid "This is the same as the C<statvfs(2)> system call."
14513 #: ../src/guestfs-actions.pod:5971
14515 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14516 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14520 #: ../src/guestfs-actions.pod:5977
14521 msgid "guestfs_strings"
14525 #: ../src/guestfs-actions.pod:5979
14529 " guestfs_strings (guestfs_h *g,\n"
14530 " const char *path);\n"
14535 #: ../src/guestfs-actions.pod:5983 ../fish/guestfish-actions.pod:3997
14537 "This runs the L<strings(1)> command on a file and returns the list of "
14538 "printable strings found."
14542 #: ../src/guestfs-actions.pod:5995
14543 msgid "guestfs_strings_e"
14547 #: ../src/guestfs-actions.pod:5997
14551 " guestfs_strings_e (guestfs_h *g,\n"
14552 " const char *encoding,\n"
14553 " const char *path);\n"
14558 #: ../src/guestfs-actions.pod:6002
14560 "This is like the C<guestfs_strings> command, but allows you to specify the "
14561 "encoding of strings that are looked for in the source file C<path>."
14565 #: ../src/guestfs-actions.pod:6006 ../fish/guestfish-actions.pod:4011
14566 msgid "Allowed encodings are:"
14570 #: ../src/guestfs-actions.pod:6010 ../fish/guestfish-actions.pod:4015
14575 #: ../src/guestfs-actions.pod:6012
14577 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14578 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14582 #: ../src/guestfs-actions.pod:6015 ../fish/guestfish-actions.pod:4020
14587 #: ../src/guestfs-actions.pod:6017 ../fish/guestfish-actions.pod:4022
14588 msgid "Single 8-bit-byte characters."
14592 #: ../src/guestfs-actions.pod:6019 ../fish/guestfish-actions.pod:4024
14597 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:4026
14598 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14602 #: ../src/guestfs-actions.pod:6024 ../fish/guestfish-actions.pod:4029
14603 msgid "l (lower case letter L)"
14607 #: ../src/guestfs-actions.pod:6026 ../fish/guestfish-actions.pod:4031
14609 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14610 "examining binaries in Windows guests."
14614 #: ../src/guestfs-actions.pod:6029 ../fish/guestfish-actions.pod:4034
14619 #: ../src/guestfs-actions.pod:6031 ../fish/guestfish-actions.pod:4036
14620 msgid "32-bit big endian such as UCS-4BE."
14624 #: ../src/guestfs-actions.pod:6033 ../fish/guestfish-actions.pod:4038
14629 #: ../src/guestfs-actions.pod:6035 ../fish/guestfish-actions.pod:4040
14630 msgid "32-bit little endian such as UCS-4LE."
14634 #: ../src/guestfs-actions.pod:6039 ../fish/guestfish-actions.pod:4044
14635 msgid "The returned strings are transcoded to UTF-8."
14639 #: ../src/guestfs-actions.pod:6050
14640 msgid "guestfs_swapoff_device"
14644 #: ../src/guestfs-actions.pod:6052
14648 " guestfs_swapoff_device (guestfs_h *g,\n"
14649 " const char *device);\n"
14654 #: ../src/guestfs-actions.pod:6056
14656 "This command disables the libguestfs appliance swap device or partition "
14657 "named C<device>. See C<guestfs_swapon_device>."
14661 #: ../src/guestfs-actions.pod:6064
14662 msgid "guestfs_swapoff_file"
14666 #: ../src/guestfs-actions.pod:6066
14670 " guestfs_swapoff_file (guestfs_h *g,\n"
14671 " const char *file);\n"
14676 #: ../src/guestfs-actions.pod:6070 ../fish/guestfish-actions.pod:4061
14677 msgid "This command disables the libguestfs appliance swap on file."
14681 #: ../src/guestfs-actions.pod:6076
14682 msgid "guestfs_swapoff_label"
14686 #: ../src/guestfs-actions.pod:6078
14690 " guestfs_swapoff_label (guestfs_h *g,\n"
14691 " const char *label);\n"
14696 #: ../src/guestfs-actions.pod:6082 ../fish/guestfish-actions.pod:4067
14698 "This command disables the libguestfs appliance swap on labeled swap "
14703 #: ../src/guestfs-actions.pod:6089
14704 msgid "guestfs_swapoff_uuid"
14708 #: ../src/guestfs-actions.pod:6091
14712 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14713 " const char *uuid);\n"
14718 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4074
14720 "This command disables the libguestfs appliance swap partition with the given "
14725 #: ../src/guestfs-actions.pod:6102
14726 msgid "guestfs_swapon_device"
14730 #: ../src/guestfs-actions.pod:6104
14734 " guestfs_swapon_device (guestfs_h *g,\n"
14735 " const char *device);\n"
14740 #: ../src/guestfs-actions.pod:6108
14742 "This command enables the libguestfs appliance to use the swap device or "
14743 "partition named C<device>. The increased memory is made available for all "
14744 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14748 #: ../src/guestfs-actions.pod:6113 ../fish/guestfish-actions.pod:4086
14750 "Note that you should not swap to existing guest swap partitions unless you "
14751 "know what you are doing. They may contain hibernation information, or other "
14752 "information that the guest doesn't want you to trash. You also risk leaking "
14753 "information about the host to the guest this way. Instead, attach a new "
14754 "host device to the guest and swap on that."
14758 #: ../src/guestfs-actions.pod:6124
14759 msgid "guestfs_swapon_file"
14763 #: ../src/guestfs-actions.pod:6126
14767 " guestfs_swapon_file (guestfs_h *g,\n"
14768 " const char *file);\n"
14773 #: ../src/guestfs-actions.pod:6130
14775 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14780 #: ../src/guestfs-actions.pod:6137
14781 msgid "guestfs_swapon_label"
14785 #: ../src/guestfs-actions.pod:6139
14789 " guestfs_swapon_label (guestfs_h *g,\n"
14790 " const char *label);\n"
14795 #: ../src/guestfs-actions.pod:6143
14797 "This command enables swap to a labeled swap partition. See "
14798 "C<guestfs_swapon_device> for other notes."
14802 #: ../src/guestfs-actions.pod:6150
14803 msgid "guestfs_swapon_uuid"
14807 #: ../src/guestfs-actions.pod:6152
14811 " guestfs_swapon_uuid (guestfs_h *g,\n"
14812 " const char *uuid);\n"
14817 #: ../src/guestfs-actions.pod:6156
14819 "This command enables swap to a swap partition with the given UUID. See "
14820 "C<guestfs_swapon_device> for other notes."
14824 #: ../src/guestfs-actions.pod:6163
14825 msgid "guestfs_sync"
14829 #: ../src/guestfs-actions.pod:6165
14833 " guestfs_sync (guestfs_h *g);\n"
14838 #: ../src/guestfs-actions.pod:6168 ../fish/guestfish-actions.pod:4118
14840 "This syncs the disk, so that any writes are flushed through to the "
14841 "underlying disk image."
14845 #: ../src/guestfs-actions.pod:6171 ../fish/guestfish-actions.pod:4121
14847 "You should always call this if you have modified a disk image, before "
14848 "closing the handle."
14852 #: ../src/guestfs-actions.pod:6178
14853 msgid "guestfs_tail"
14857 #: ../src/guestfs-actions.pod:6180
14861 " guestfs_tail (guestfs_h *g,\n"
14862 " const char *path);\n"
14867 #: ../src/guestfs-actions.pod:6184 ../fish/guestfish-actions.pod:4128
14869 "This command returns up to the last 10 lines of a file as a list of strings."
14873 #: ../src/guestfs-actions.pod:6196
14874 msgid "guestfs_tail_n"
14878 #: ../src/guestfs-actions.pod:6198
14882 " guestfs_tail_n (guestfs_h *g,\n"
14884 " const char *path);\n"
14889 #: ../src/guestfs-actions.pod:6203 ../fish/guestfish-actions.pod:4138
14891 "If the parameter C<nrlines> is a positive number, this returns the last "
14892 "C<nrlines> lines of the file C<path>."
14896 #: ../src/guestfs-actions.pod:6206 ../fish/guestfish-actions.pod:4141
14898 "If the parameter C<nrlines> is a negative number, this returns lines from "
14899 "the file C<path>, starting with the C<-nrlines>th line."
14903 #: ../src/guestfs-actions.pod:6220
14904 msgid "guestfs_tar_in"
14908 #: ../src/guestfs-actions.pod:6222
14912 " guestfs_tar_in (guestfs_h *g,\n"
14913 " const char *tarfile,\n"
14914 " const char *directory);\n"
14919 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4153
14921 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14922 "tar file) into C<directory>."
14926 #: ../src/guestfs-actions.pod:6230
14928 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14932 #: ../src/guestfs-actions.pod:6235 ../src/guestfs-actions.pod:6252
14933 #: ../src/guestfs-actions.pod:6268 ../src/guestfs-actions.pod:6284
14934 msgid "(Added in 1.0.3)"
14938 #: ../src/guestfs-actions.pod:6237
14939 msgid "guestfs_tar_out"
14943 #: ../src/guestfs-actions.pod:6239
14947 " guestfs_tar_out (guestfs_h *g,\n"
14948 " const char *directory,\n"
14949 " const char *tarfile);\n"
14954 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4165
14956 "This command packs the contents of C<directory> and downloads it to local "
14961 #: ../src/guestfs-actions.pod:6247
14963 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14964 "C<guestfs_txz_out>."
14968 #: ../src/guestfs-actions.pod:6254
14969 msgid "guestfs_tgz_in"
14973 #: ../src/guestfs-actions.pod:6256
14977 " guestfs_tgz_in (guestfs_h *g,\n"
14978 " const char *tarball,\n"
14979 " const char *directory);\n"
14984 #: ../src/guestfs-actions.pod:6261 ../fish/guestfish-actions.pod:4177
14986 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14987 "tar file) into C<directory>."
14991 #: ../src/guestfs-actions.pod:6264
14992 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14996 #: ../src/guestfs-actions.pod:6270
14997 msgid "guestfs_tgz_out"
15001 #: ../src/guestfs-actions.pod:6272
15005 " guestfs_tgz_out (guestfs_h *g,\n"
15006 " const char *directory,\n"
15007 " const char *tarball);\n"
15012 #: ../src/guestfs-actions.pod:6277 ../fish/guestfish-actions.pod:4188
15014 "This command packs the contents of C<directory> and downloads it to local "
15019 #: ../src/guestfs-actions.pod:6280
15020 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
15024 #: ../src/guestfs-actions.pod:6286
15025 msgid "guestfs_touch"
15029 #: ../src/guestfs-actions.pod:6288
15033 " guestfs_touch (guestfs_h *g,\n"
15034 " const char *path);\n"
15039 #: ../src/guestfs-actions.pod:6292 ../fish/guestfish-actions.pod:4199
15041 "Touch acts like the L<touch(1)> command. It can be used to update the "
15042 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15047 #: ../src/guestfs-actions.pod:6296 ../fish/guestfish-actions.pod:4203
15049 "This command only works on regular files, and will fail on other file types "
15050 "such as directories, symbolic links, block special etc."
15054 #: ../src/guestfs-actions.pod:6303
15055 msgid "guestfs_truncate"
15059 #: ../src/guestfs-actions.pod:6305
15063 " guestfs_truncate (guestfs_h *g,\n"
15064 " const char *path);\n"
15069 #: ../src/guestfs-actions.pod:6309 ../fish/guestfish-actions.pod:4210
15071 "This command truncates C<path> to a zero-length file. The file must exist "
15076 #: ../src/guestfs-actions.pod:6316
15077 msgid "guestfs_truncate_size"
15081 #: ../src/guestfs-actions.pod:6318
15085 " guestfs_truncate_size (guestfs_h *g,\n"
15086 " const char *path,\n"
15087 " int64_t size);\n"
15092 #: ../src/guestfs-actions.pod:6323 ../fish/guestfish-actions.pod:4217
15094 "This command truncates C<path> to size C<size> bytes. The file must exist "
15099 #: ../src/guestfs-actions.pod:6326
15101 "If the current file size is less than C<size> then the file is extended to "
15102 "the required size with zero bytes. This creates a sparse file (ie. disk "
15103 "blocks are not allocated for the file until you write to it). To create a "
15104 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
15108 #: ../src/guestfs-actions.pod:6336
15109 msgid "guestfs_tune2fs_l"
15113 #: ../src/guestfs-actions.pod:6338
15117 " guestfs_tune2fs_l (guestfs_h *g,\n"
15118 " const char *device);\n"
15123 #: ../src/guestfs-actions.pod:6342 ../fish/guestfish-actions.pod:4230
15125 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15130 #: ../src/guestfs-actions.pod:6345 ../fish/guestfish-actions.pod:4233
15132 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15133 "for more details. The list of fields returned isn't clearly defined, and "
15134 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15135 "and the filesystem itself."
15139 #: ../src/guestfs-actions.pod:6358
15140 msgid "guestfs_txz_in"
15144 #: ../src/guestfs-actions.pod:6360
15148 " guestfs_txz_in (guestfs_h *g,\n"
15149 " const char *tarball,\n"
15150 " const char *directory);\n"
15155 #: ../src/guestfs-actions.pod:6365 ../fish/guestfish-actions.pod:4242
15157 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15158 "tar file) into C<directory>."
15162 #: ../src/guestfs-actions.pod:6372
15163 msgid "guestfs_txz_out"
15167 #: ../src/guestfs-actions.pod:6374
15171 " guestfs_txz_out (guestfs_h *g,\n"
15172 " const char *directory,\n"
15173 " const char *tarball);\n"
15178 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4251
15180 "This command packs the contents of C<directory> and downloads it to local "
15181 "file C<tarball> (as an xz compressed tar archive)."
15185 #: ../src/guestfs-actions.pod:6386
15186 msgid "guestfs_umask"
15190 #: ../src/guestfs-actions.pod:6388
15194 " guestfs_umask (guestfs_h *g,\n"
15200 #: ../src/guestfs-actions.pod:6392 ../fish/guestfish-actions.pod:4260
15202 "This function sets the mask used for creating new files and device nodes to "
15207 #: ../src/guestfs-actions.pod:6395 ../fish/guestfish-actions.pod:4263
15209 "Typical umask values would be C<022> which creates new files with "
15210 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15211 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15215 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4268
15217 "The default umask is C<022>. This is important because it means that "
15218 "directories and device nodes will be created with C<0644> or C<0755> mode "
15219 "even if you specify C<0777>."
15223 #: ../src/guestfs-actions.pod:6404
15225 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15226 "C<guestfs_mkdir>."
15230 #: ../src/guestfs-actions.pod:6407 ../fish/guestfish-actions.pod:4275
15231 msgid "This call returns the previous umask."
15235 #: ../src/guestfs-actions.pod:6413
15236 msgid "guestfs_umount"
15240 #: ../src/guestfs-actions.pod:6415
15244 " guestfs_umount (guestfs_h *g,\n"
15245 " const char *pathordevice);\n"
15250 #: ../src/guestfs-actions.pod:6419 ../fish/guestfish-actions.pod:4283
15252 "This unmounts the given filesystem. The filesystem may be specified either "
15253 "by its mountpoint (path) or the device which contains the filesystem."
15257 #: ../src/guestfs-actions.pod:6427
15258 msgid "guestfs_umount_all"
15262 #: ../src/guestfs-actions.pod:6429
15266 " guestfs_umount_all (guestfs_h *g);\n"
15271 #: ../src/guestfs-actions.pod:6432 ../fish/guestfish-actions.pod:4293
15272 msgid "This unmounts all mounted filesystems."
15276 #: ../src/guestfs-actions.pod:6434 ../fish/guestfish-actions.pod:4295
15277 msgid "Some internal mounts are not unmounted by this call."
15281 #: ../src/guestfs-actions.pod:6440
15282 msgid "guestfs_upload"
15286 #: ../src/guestfs-actions.pod:6442
15290 " guestfs_upload (guestfs_h *g,\n"
15291 " const char *filename,\n"
15292 " const char *remotefilename);\n"
15297 #: ../src/guestfs-actions.pod:6447 ../src/guestfs-actions.pod:6471
15298 #: ../fish/guestfish-actions.pod:4301 ../fish/guestfish-actions.pod:4314
15299 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15303 #: ../src/guestfs-actions.pod:6452
15304 msgid "See also C<guestfs_download>."
15308 #: ../src/guestfs-actions.pod:6463
15309 msgid "guestfs_upload_offset"
15313 #: ../src/guestfs-actions.pod:6465
15317 " guestfs_upload_offset (guestfs_h *g,\n"
15318 " const char *filename,\n"
15319 " const char *remotefilename,\n"
15320 " int64_t offset);\n"
15325 #: ../src/guestfs-actions.pod:6474 ../fish/guestfish-actions.pod:4317
15327 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15328 "The intention is to overwrite parts of existing files or devices, although "
15329 "if a non-existant file is specified then it is created with a \"hole\" "
15330 "before C<offset>. The size of the data written is implicit in the size of "
15331 "the source C<filename>."
15335 #: ../src/guestfs-actions.pod:6481
15337 "Note that there is no limit on the amount of data that can be uploaded with "
15338 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15339 "full amount unless an error occurs."
15343 #: ../src/guestfs-actions.pod:6486
15344 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15348 #: ../src/guestfs-actions.pod:6497
15349 msgid "guestfs_utimens"
15353 #: ../src/guestfs-actions.pod:6499
15357 " guestfs_utimens (guestfs_h *g,\n"
15358 " const char *path,\n"
15359 " int64_t atsecs,\n"
15360 " int64_t atnsecs,\n"
15361 " int64_t mtsecs,\n"
15362 " int64_t mtnsecs);\n"
15367 #: ../src/guestfs-actions.pod:6507 ../fish/guestfish-actions.pod:4337
15368 msgid "This command sets the timestamps of a file with nanosecond precision."
15372 #: ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:4340
15374 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15379 #: ../src/guestfs-actions.pod:6513 ../fish/guestfish-actions.pod:4343
15381 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15382 "nanoseconds from the epoch."
15386 #: ../src/guestfs-actions.pod:6516 ../fish/guestfish-actions.pod:4346
15388 "If the C<*nsecs> field contains the special value C<-1> then the "
15389 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15390 "ignored in this case)."
15394 #: ../src/guestfs-actions.pod:6520 ../fish/guestfish-actions.pod:4350
15396 "If the C<*nsecs> field contains the special value C<-2> then the "
15397 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15402 #: ../src/guestfs-actions.pod:6528 ../src/guestfs-structs.pod:175
15403 msgid "guestfs_version"
15407 #: ../src/guestfs-actions.pod:6530
15410 " struct guestfs_version *\n"
15411 " guestfs_version (guestfs_h *g);\n"
15416 #: ../src/guestfs-actions.pod:6533 ../fish/guestfish-actions.pod:4358
15418 "Return the libguestfs version number that the program is linked against."
15422 #: ../src/guestfs-actions.pod:6536 ../fish/guestfish-actions.pod:4361
15424 "Note that because of dynamic linking this is not necessarily the version of "
15425 "libguestfs that you compiled against. You can compile the program, and then "
15426 "at runtime dynamically link against a completely different C<libguestfs.so> "
15431 #: ../src/guestfs-actions.pod:6541 ../fish/guestfish-actions.pod:4366
15433 "This call was added in version C<1.0.58>. In previous versions of "
15434 "libguestfs there was no way to get the version number. From C code you can "
15435 "use dynamic linker functions to find out if this symbol exists (if it "
15436 "doesn't, then it's an earlier version)."
15440 #: ../src/guestfs-actions.pod:6547 ../fish/guestfish-actions.pod:4372
15442 "The call returns a structure with four elements. The first three (C<major>, "
15443 "C<minor> and C<release>) are numbers and correspond to the usual version "
15444 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15445 "but may be used for distro-specific information."
15449 #: ../src/guestfs-actions.pod:6553 ../fish/guestfish-actions.pod:4378
15451 "To construct the original version string: C<$major.$minor.$release$extra>"
15455 #: ../src/guestfs-actions.pod:6556 ../fish/guestfish-actions.pod:4381
15456 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15460 #: ../src/guestfs-actions.pod:6558
15462 "I<Note:> Don't use this call to test for availability of features. In "
15463 "enterprise distributions we backport features from later versions into "
15464 "earlier versions, making this an unreliable way to test for features. Use "
15465 "C<guestfs_available> instead."
15469 #: ../src/guestfs-actions.pod:6564
15471 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15472 "error. I<The caller must call C<guestfs_free_version> after use>."
15476 #: ../src/guestfs-actions.pod:6568
15477 msgid "(Added in 1.0.58)"
15481 #: ../src/guestfs-actions.pod:6570
15482 msgid "guestfs_vfs_label"
15486 #: ../src/guestfs-actions.pod:6572
15490 " guestfs_vfs_label (guestfs_h *g,\n"
15491 " const char *device);\n"
15496 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4393
15497 msgid "This returns the filesystem label of the filesystem on C<device>."
15501 #: ../src/guestfs-actions.pod:6579 ../fish/guestfish-actions.pod:4396
15502 msgid "If the filesystem is unlabeled, this returns the empty string."
15506 #: ../src/guestfs-actions.pod:6581
15507 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15511 #: ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6623
15512 msgid "(Added in 1.3.18)"
15516 #: ../src/guestfs-actions.pod:6588
15517 msgid "guestfs_vfs_type"
15521 #: ../src/guestfs-actions.pod:6590
15525 " guestfs_vfs_type (guestfs_h *g,\n"
15526 " const char *device);\n"
15531 #: ../src/guestfs-actions.pod:6594 ../fish/guestfish-actions.pod:4404
15533 "This command gets the filesystem type corresponding to the filesystem on "
15538 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4407
15540 "For most filesystems, the result is the name of the Linux VFS module which "
15541 "would be used to mount this filesystem if you mounted it without specifying "
15542 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15546 #: ../src/guestfs-actions.pod:6607
15547 msgid "guestfs_vfs_uuid"
15551 #: ../src/guestfs-actions.pod:6609
15555 " guestfs_vfs_uuid (guestfs_h *g,\n"
15556 " const char *device);\n"
15561 #: ../src/guestfs-actions.pod:6613 ../fish/guestfish-actions.pod:4416
15562 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15566 #: ../src/guestfs-actions.pod:6616 ../fish/guestfish-actions.pod:4419
15567 msgid "If the filesystem does not have a UUID, this returns the empty string."
15571 #: ../src/guestfs-actions.pod:6618
15572 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15576 #: ../src/guestfs-actions.pod:6625
15577 msgid "guestfs_vg_activate"
15581 #: ../src/guestfs-actions.pod:6627
15585 " guestfs_vg_activate (guestfs_h *g,\n"
15587 " char *const *volgroups);\n"
15592 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4427
15594 "This command activates or (if C<activate> is false) deactivates all logical "
15595 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15596 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15597 "deactivated, then those devices disappear."
15601 #: ../src/guestfs-actions.pod:6638 ../fish/guestfish-actions.pod:4433
15602 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15606 #: ../src/guestfs-actions.pod:6640 ../fish/guestfish-actions.pod:4435
15608 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15609 "activated or deactivated."
15613 #: ../src/guestfs-actions.pod:6647
15614 msgid "guestfs_vg_activate_all"
15618 #: ../src/guestfs-actions.pod:6649
15622 " guestfs_vg_activate_all (guestfs_h *g,\n"
15623 " int activate);\n"
15628 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4442
15630 "This command activates or (if C<activate> is false) deactivates all logical "
15631 "volumes in all volume groups. If activated, then they are made known to the "
15632 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15633 "those devices disappear."
15637 #: ../src/guestfs-actions.pod:6659 ../fish/guestfish-actions.pod:4448
15638 msgid "This command is the same as running C<vgchange -a y|n>"
15642 #: ../src/guestfs-actions.pod:6665
15643 msgid "guestfs_vgcreate"
15647 #: ../src/guestfs-actions.pod:6667
15651 " guestfs_vgcreate (guestfs_h *g,\n"
15652 " const char *volgroup,\n"
15653 " char *const *physvols);\n"
15658 #: ../src/guestfs-actions.pod:6672 ../fish/guestfish-actions.pod:4454
15660 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15661 "of physical volumes C<physvols>."
15665 #: ../src/guestfs-actions.pod:6679
15666 msgid "guestfs_vglvuuids"
15670 #: ../src/guestfs-actions.pod:6681
15674 " guestfs_vglvuuids (guestfs_h *g,\n"
15675 " const char *vgname);\n"
15680 #: ../src/guestfs-actions.pod:6685 ../fish/guestfish-actions.pod:4461
15682 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15683 "volumes created in this volume group."
15687 #: ../src/guestfs-actions.pod:6688
15689 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15690 "associate logical volumes and volume groups."
15694 #: ../src/guestfs-actions.pod:6691
15695 msgid "See also C<guestfs_vgpvuuids>."
15699 #: ../src/guestfs-actions.pod:6699
15700 msgid "guestfs_vgpvuuids"
15704 #: ../src/guestfs-actions.pod:6701
15708 " guestfs_vgpvuuids (guestfs_h *g,\n"
15709 " const char *vgname);\n"
15714 #: ../src/guestfs-actions.pod:6705 ../fish/guestfish-actions.pod:4473
15716 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15717 "volumes that this volume group resides on."
15721 #: ../src/guestfs-actions.pod:6708
15723 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15724 "associate physical volumes and volume groups."
15728 #: ../src/guestfs-actions.pod:6711
15729 msgid "See also C<guestfs_vglvuuids>."
15733 #: ../src/guestfs-actions.pod:6719
15734 msgid "guestfs_vgremove"
15738 #: ../src/guestfs-actions.pod:6721
15742 " guestfs_vgremove (guestfs_h *g,\n"
15743 " const char *vgname);\n"
15748 #: ../src/guestfs-actions.pod:6725 ../fish/guestfish-actions.pod:4485
15749 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15753 #: ../src/guestfs-actions.pod:6727 ../fish/guestfish-actions.pod:4487
15755 "This also forcibly removes all logical volumes in the volume group (if any)."
15759 #: ../src/guestfs-actions.pod:6734
15760 msgid "guestfs_vgrename"
15764 #: ../src/guestfs-actions.pod:6736
15768 " guestfs_vgrename (guestfs_h *g,\n"
15769 " const char *volgroup,\n"
15770 " const char *newvolgroup);\n"
15775 #: ../src/guestfs-actions.pod:6741 ../fish/guestfish-actions.pod:4494
15776 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15780 #: ../src/guestfs-actions.pod:6747
15781 msgid "guestfs_vgs"
15785 #: ../src/guestfs-actions.pod:6749
15789 " guestfs_vgs (guestfs_h *g);\n"
15794 #: ../src/guestfs-actions.pod:6752 ../fish/guestfish-actions.pod:4500
15796 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15801 #: ../src/guestfs-actions.pod:6755 ../fish/guestfish-actions.pod:4503
15803 "This returns a list of just the volume group names that were detected (eg. "
15808 #: ../src/guestfs-actions.pod:6758
15809 msgid "See also C<guestfs_vgs_full>."
15813 #: ../src/guestfs-actions.pod:6766
15814 msgid "guestfs_vgs_full"
15818 #: ../src/guestfs-actions.pod:6768
15821 " struct guestfs_lvm_vg_list *\n"
15822 " guestfs_vgs_full (guestfs_h *g);\n"
15827 #: ../src/guestfs-actions.pod:6771 ../fish/guestfish-actions.pod:4512
15829 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15830 "> command. The \"full\" version includes all fields."
15834 #: ../src/guestfs-actions.pod:6774
15836 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15837 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15841 #: ../src/guestfs-actions.pod:6780
15842 msgid "guestfs_vgscan"
15846 #: ../src/guestfs-actions.pod:6782
15850 " guestfs_vgscan (guestfs_h *g);\n"
15855 #: ../src/guestfs-actions.pod:6785 ../fish/guestfish-actions.pod:4519
15857 "This rescans all block devices and rebuilds the list of LVM physical "
15858 "volumes, volume groups and logical volumes."
15862 #: ../src/guestfs-actions.pod:6792
15863 msgid "guestfs_vguuid"
15867 #: ../src/guestfs-actions.pod:6794
15871 " guestfs_vguuid (guestfs_h *g,\n"
15872 " const char *vgname);\n"
15877 #: ../src/guestfs-actions.pod:6798 ../fish/guestfish-actions.pod:4526
15878 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15882 #: ../src/guestfs-actions.pod:6805
15883 msgid "guestfs_wait_ready"
15887 #: ../src/guestfs-actions.pod:6807
15891 " guestfs_wait_ready (guestfs_h *g);\n"
15896 #: ../src/guestfs-actions.pod:6810
15897 msgid "This function is a no op."
15901 #: ../src/guestfs-actions.pod:6812
15903 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15904 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15905 "is no longer necessary because C<guestfs_launch> now does the waiting."
15909 #: ../src/guestfs-actions.pod:6817
15911 "If you see any calls to this function in code then you can just remove them, "
15912 "unless you want to retain compatibility with older versions of the API."
15916 #: ../src/guestfs-actions.pod:6825
15917 msgid "guestfs_wc_c"
15921 #: ../src/guestfs-actions.pod:6827
15925 " guestfs_wc_c (guestfs_h *g,\n"
15926 " const char *path);\n"
15931 #: ../src/guestfs-actions.pod:6831 ../fish/guestfish-actions.pod:4532
15933 "This command counts the characters in a file, using the C<wc -c> external "
15938 #: ../src/guestfs-actions.pod:6838
15939 msgid "guestfs_wc_l"
15943 #: ../src/guestfs-actions.pod:6840
15947 " guestfs_wc_l (guestfs_h *g,\n"
15948 " const char *path);\n"
15953 #: ../src/guestfs-actions.pod:6844 ../fish/guestfish-actions.pod:4539
15955 "This command counts the lines in a file, using the C<wc -l> external command."
15959 #: ../src/guestfs-actions.pod:6851
15960 msgid "guestfs_wc_w"
15964 #: ../src/guestfs-actions.pod:6853
15968 " guestfs_wc_w (guestfs_h *g,\n"
15969 " const char *path);\n"
15974 #: ../src/guestfs-actions.pod:6857 ../fish/guestfish-actions.pod:4546
15976 "This command counts the words in a file, using the C<wc -w> external command."
15980 #: ../src/guestfs-actions.pod:6864
15981 msgid "guestfs_write"
15985 #: ../src/guestfs-actions.pod:6866
15989 " guestfs_write (guestfs_h *g,\n"
15990 " const char *path,\n"
15991 " const char *content,\n"
15992 " size_t content_size);\n"
15997 #: ../src/guestfs-actions.pod:6872 ../fish/guestfish-actions.pod:4553
15999 "This call creates a file called C<path>. The content of the file is the "
16000 "string C<content> (which can contain any 8 bit data)."
16004 #: ../src/guestfs-actions.pod:6882
16005 msgid "guestfs_write_file"
16009 #: ../src/guestfs-actions.pod:6884
16013 " guestfs_write_file (guestfs_h *g,\n"
16014 " const char *path,\n"
16015 " const char *content,\n"
16021 #: ../src/guestfs-actions.pod:6890 ../fish/guestfish-actions.pod:4563
16023 "This call creates a file called C<path>. The contents of the file is the "
16024 "string C<content> (which can contain any 8 bit data), with length C<size>."
16028 #: ../src/guestfs-actions.pod:6894 ../fish/guestfish-actions.pod:4567
16030 "As a special case, if C<size> is C<0> then the length is calculated using "
16031 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16035 #: ../src/guestfs-actions.pod:6898 ../fish/guestfish-actions.pod:4571
16037 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16038 "I<not> work, even if the length is specified."
16042 #: ../src/guestfs-actions.pod:6906 ../fish/guestfish-actions.pod:4577
16044 "This function is deprecated. In new code, use the C<write> call instead."
16048 #: ../src/guestfs-actions.pod:6915
16049 msgid "guestfs_zegrep"
16053 #: ../src/guestfs-actions.pod:6917
16057 " guestfs_zegrep (guestfs_h *g,\n"
16058 " const char *regex,\n"
16059 " const char *path);\n"
16064 #: ../src/guestfs-actions.pod:6922 ../fish/guestfish-actions.pod:4588
16066 "This calls the external C<zegrep> program and returns the matching lines."
16070 #: ../src/guestfs-actions.pod:6934
16071 msgid "guestfs_zegrepi"
16075 #: ../src/guestfs-actions.pod:6936
16079 " guestfs_zegrepi (guestfs_h *g,\n"
16080 " const char *regex,\n"
16081 " const char *path);\n"
16086 #: ../src/guestfs-actions.pod:6941 ../fish/guestfish-actions.pod:4598
16088 "This calls the external C<zegrep -i> program and returns the matching lines."
16092 #: ../src/guestfs-actions.pod:6953
16093 msgid "guestfs_zero"
16097 #: ../src/guestfs-actions.pod:6955
16101 " guestfs_zero (guestfs_h *g,\n"
16102 " const char *device);\n"
16107 #: ../src/guestfs-actions.pod:6959 ../fish/guestfish-actions.pod:4608
16108 msgid "This command writes zeroes over the first few blocks of C<device>."
16112 #: ../src/guestfs-actions.pod:6961 ../fish/guestfish-actions.pod:4610
16114 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16115 "securely wipe the device). It should be sufficient to remove any partition "
16116 "tables, filesystem superblocks and so on."
16120 #: ../src/guestfs-actions.pod:6965
16121 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
16125 #: ../src/guestfs-actions.pod:6976
16126 msgid "guestfs_zero_device"
16130 #: ../src/guestfs-actions.pod:6978
16134 " guestfs_zero_device (guestfs_h *g,\n"
16135 " const char *device);\n"
16140 #: ../src/guestfs-actions.pod:6982
16142 "This command writes zeroes over the entire C<device>. Compare with "
16143 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16147 #: ../src/guestfs-actions.pod:6996
16148 msgid "(Added in 1.3.1)"
16152 #: ../src/guestfs-actions.pod:6998
16153 msgid "guestfs_zerofree"
16157 #: ../src/guestfs-actions.pod:7000
16161 " guestfs_zerofree (guestfs_h *g,\n"
16162 " const char *device);\n"
16167 #: ../src/guestfs-actions.pod:7004 ../fish/guestfish-actions.pod:4631
16169 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16170 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16171 "possible to compress the filesystem more effectively."
16175 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:4636
16176 msgid "You should B<not> run this program if the filesystem is mounted."
16180 #: ../src/guestfs-actions.pod:7012 ../fish/guestfish-actions.pod:4639
16182 "It is possible that using this program can damage the filesystem or data on "
16187 #: ../src/guestfs-actions.pod:7019
16188 msgid "guestfs_zfgrep"
16192 #: ../src/guestfs-actions.pod:7021
16196 " guestfs_zfgrep (guestfs_h *g,\n"
16197 " const char *pattern,\n"
16198 " const char *path);\n"
16203 #: ../src/guestfs-actions.pod:7026 ../fish/guestfish-actions.pod:4646
16205 "This calls the external C<zfgrep> program and returns the matching lines."
16209 #: ../src/guestfs-actions.pod:7038
16210 msgid "guestfs_zfgrepi"
16214 #: ../src/guestfs-actions.pod:7040
16218 " guestfs_zfgrepi (guestfs_h *g,\n"
16219 " const char *pattern,\n"
16220 " const char *path);\n"
16225 #: ../src/guestfs-actions.pod:7045 ../fish/guestfish-actions.pod:4656
16227 "This calls the external C<zfgrep -i> program and returns the matching lines."
16231 #: ../src/guestfs-actions.pod:7057
16232 msgid "guestfs_zfile"
16236 #: ../src/guestfs-actions.pod:7059
16240 " guestfs_zfile (guestfs_h *g,\n"
16241 " const char *meth,\n"
16242 " const char *path);\n"
16247 #: ../src/guestfs-actions.pod:7064 ../fish/guestfish-actions.pod:4666
16249 "This command runs C<file> after first decompressing C<path> using C<method>."
16253 #: ../src/guestfs-actions.pod:7067 ../fish/guestfish-actions.pod:4669
16254 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16258 #: ../src/guestfs-actions.pod:7069
16260 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16265 #: ../src/guestfs-actions.pod:7075 ../fish/guestfish-actions.pod:4674
16267 "This function is deprecated. In new code, use the C<file> call instead."
16271 #: ../src/guestfs-actions.pod:7084
16272 msgid "guestfs_zgrep"
16276 #: ../src/guestfs-actions.pod:7086
16280 " guestfs_zgrep (guestfs_h *g,\n"
16281 " const char *regex,\n"
16282 " const char *path);\n"
16287 #: ../src/guestfs-actions.pod:7091 ../fish/guestfish-actions.pod:4685
16289 "This calls the external C<zgrep> program and returns the matching lines."
16293 #: ../src/guestfs-actions.pod:7103
16294 msgid "guestfs_zgrepi"
16298 #: ../src/guestfs-actions.pod:7105
16302 " guestfs_zgrepi (guestfs_h *g,\n"
16303 " const char *regex,\n"
16304 " const char *path);\n"
16309 #: ../src/guestfs-actions.pod:7110 ../fish/guestfish-actions.pod:4695
16311 "This calls the external C<zgrep -i> program and returns the matching lines."
16315 #: ../src/guestfs-availability.pod:3
16320 #: ../src/guestfs-availability.pod:5
16322 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16323 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16324 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16325 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16326 "L</guestfs_aug_save> L</guestfs_aug_set>"
16330 #: ../src/guestfs-availability.pod:21
16335 #: ../src/guestfs-availability.pod:23
16337 "The following functions: L</guestfs_inotify_add_watch> L</"
16338 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16339 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16343 #: ../src/guestfs-availability.pod:31
16344 msgid "B<linuxfsuuid>"
16348 #: ../src/guestfs-availability.pod:33
16350 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16351 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16355 #: ../src/guestfs-availability.pod:40
16356 msgid "B<linuxmodules>"
16360 #: ../src/guestfs-availability.pod:42
16361 msgid "The following functions: L</guestfs_modprobe>"
16365 #: ../src/guestfs-availability.pod:45
16366 msgid "B<linuxxattrs>"
16370 #: ../src/guestfs-availability.pod:47
16372 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
16373 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
16374 "guestfs_removexattr> L</guestfs_setxattr>"
16378 #: ../src/guestfs-availability.pod:56
16383 #: ../src/guestfs-availability.pod:58
16385 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16386 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16387 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16391 #: ../src/guestfs-availability.pod:67
16396 #: ../src/guestfs-availability.pod:69
16398 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16399 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16400 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16401 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16402 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16403 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16404 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16408 #: ../src/guestfs-availability.pod:92
16413 #: ../src/guestfs-availability.pod:94
16415 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16416 "guestfs_mknod_b> L</guestfs_mknod_c>"
16420 #: ../src/guestfs-availability.pod:100
16425 #: ../src/guestfs-availability.pod:102
16426 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16430 #: ../src/guestfs-availability.pod:105
16431 msgid "B<ntfsprogs>"
16435 #: ../src/guestfs-availability.pod:107
16437 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16441 #: ../src/guestfs-availability.pod:111
16442 msgid "B<realpath>"
16446 #: ../src/guestfs-availability.pod:113
16447 msgid "The following functions: L</guestfs_realpath>"
16451 #: ../src/guestfs-availability.pod:116
16456 #: ../src/guestfs-availability.pod:118
16458 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16459 "guestfs_scrub_freespace>"
16463 #: ../src/guestfs-availability.pod:123
16468 #: ../src/guestfs-availability.pod:125
16469 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16473 #: ../src/guestfs-availability.pod:129
16478 #: ../src/guestfs-availability.pod:131
16479 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16483 #: ../src/guestfs-availability.pod:135
16484 msgid "B<zerofree>"
16488 #: ../src/guestfs-availability.pod:137
16489 msgid "The following functions: L</guestfs_zerofree>"
16493 #: ../src/guestfs-structs.pod:1
16494 msgid "guestfs_int_bool"
16498 #: ../src/guestfs-structs.pod:3
16501 " struct guestfs_int_bool {\n"
16509 #: ../src/guestfs-structs.pod:8
16512 " struct guestfs_int_bool_list {\n"
16513 " uint32_t len; /* Number of elements in list. */\n"
16514 " struct guestfs_int_bool *val; /* Elements. */\n"
16520 #: ../src/guestfs-structs.pod:13
16523 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16524 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16529 #: ../src/guestfs-structs.pod:16
16530 msgid "guestfs_lvm_pv"
16534 #: ../src/guestfs-structs.pod:18
16537 " struct guestfs_lvm_pv {\n"
16538 " char *pv_name;\n"
16539 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16540 " char pv_uuid[32];\n"
16542 " uint64_t pv_size;\n"
16543 " uint64_t dev_size;\n"
16544 " uint64_t pv_free;\n"
16545 " uint64_t pv_used;\n"
16546 " char *pv_attr;\n"
16547 " int64_t pv_pe_count;\n"
16548 " int64_t pv_pe_alloc_count;\n"
16549 " char *pv_tags;\n"
16550 " uint64_t pe_start;\n"
16551 " int64_t pv_mda_count;\n"
16552 " uint64_t pv_mda_free;\n"
16558 #: ../src/guestfs-structs.pod:36
16561 " struct guestfs_lvm_pv_list {\n"
16562 " uint32_t len; /* Number of elements in list. */\n"
16563 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16569 #: ../src/guestfs-structs.pod:41
16572 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16573 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16578 #: ../src/guestfs-structs.pod:44
16579 msgid "guestfs_lvm_vg"
16583 #: ../src/guestfs-structs.pod:46
16586 " struct guestfs_lvm_vg {\n"
16587 " char *vg_name;\n"
16588 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16589 " char vg_uuid[32];\n"
16591 " char *vg_attr;\n"
16592 " uint64_t vg_size;\n"
16593 " uint64_t vg_free;\n"
16594 " char *vg_sysid;\n"
16595 " uint64_t vg_extent_size;\n"
16596 " int64_t vg_extent_count;\n"
16597 " int64_t vg_free_count;\n"
16598 " int64_t max_lv;\n"
16599 " int64_t max_pv;\n"
16600 " int64_t pv_count;\n"
16601 " int64_t lv_count;\n"
16602 " int64_t snap_count;\n"
16603 " int64_t vg_seqno;\n"
16604 " char *vg_tags;\n"
16605 " int64_t vg_mda_count;\n"
16606 " uint64_t vg_mda_free;\n"
16612 #: ../src/guestfs-structs.pod:69
16615 " struct guestfs_lvm_vg_list {\n"
16616 " uint32_t len; /* Number of elements in list. */\n"
16617 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16623 #: ../src/guestfs-structs.pod:74
16626 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16627 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16632 #: ../src/guestfs-structs.pod:77
16633 msgid "guestfs_lvm_lv"
16637 #: ../src/guestfs-structs.pod:79
16640 " struct guestfs_lvm_lv {\n"
16641 " char *lv_name;\n"
16642 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16643 " char lv_uuid[32];\n"
16644 " char *lv_attr;\n"
16645 " int64_t lv_major;\n"
16646 " int64_t lv_minor;\n"
16647 " int64_t lv_kernel_major;\n"
16648 " int64_t lv_kernel_minor;\n"
16649 " uint64_t lv_size;\n"
16650 " int64_t seg_count;\n"
16652 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16653 " float snap_percent;\n"
16654 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16655 " float copy_percent;\n"
16656 " char *move_pv;\n"
16657 " char *lv_tags;\n"
16658 " char *mirror_log;\n"
16659 " char *modules;\n"
16665 #: ../src/guestfs-structs.pod:101
16668 " struct guestfs_lvm_lv_list {\n"
16669 " uint32_t len; /* Number of elements in list. */\n"
16670 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16676 #: ../src/guestfs-structs.pod:106
16679 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16680 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16685 #: ../src/guestfs-structs.pod:111
16688 " struct guestfs_stat {\n"
16692 " int64_t nlink;\n"
16697 " int64_t blksize;\n"
16698 " int64_t blocks;\n"
16699 " int64_t atime;\n"
16700 " int64_t mtime;\n"
16701 " int64_t ctime;\n"
16707 #: ../src/guestfs-structs.pod:127
16710 " struct guestfs_stat_list {\n"
16711 " uint32_t len; /* Number of elements in list. */\n"
16712 " struct guestfs_stat *val; /* Elements. */\n"
16718 #: ../src/guestfs-structs.pod:132
16721 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16722 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16727 #: ../src/guestfs-structs.pod:137
16730 " struct guestfs_statvfs {\n"
16731 " int64_t bsize;\n"
16732 " int64_t frsize;\n"
16733 " int64_t blocks;\n"
16734 " int64_t bfree;\n"
16735 " int64_t bavail;\n"
16736 " int64_t files;\n"
16737 " int64_t ffree;\n"
16738 " int64_t favail;\n"
16741 " int64_t namemax;\n"
16747 #: ../src/guestfs-structs.pod:151
16750 " struct guestfs_statvfs_list {\n"
16751 " uint32_t len; /* Number of elements in list. */\n"
16752 " struct guestfs_statvfs *val; /* Elements. */\n"
16758 #: ../src/guestfs-structs.pod:156
16761 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16762 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16767 #: ../src/guestfs-structs.pod:159
16768 msgid "guestfs_dirent"
16772 #: ../src/guestfs-structs.pod:161
16775 " struct guestfs_dirent {\n"
16784 #: ../src/guestfs-structs.pod:167
16787 " struct guestfs_dirent_list {\n"
16788 " uint32_t len; /* Number of elements in list. */\n"
16789 " struct guestfs_dirent *val; /* Elements. */\n"
16795 #: ../src/guestfs-structs.pod:172
16798 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16799 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16804 #: ../src/guestfs-structs.pod:177
16807 " struct guestfs_version {\n"
16808 " int64_t major;\n"
16809 " int64_t minor;\n"
16810 " int64_t release;\n"
16817 #: ../src/guestfs-structs.pod:184
16820 " struct guestfs_version_list {\n"
16821 " uint32_t len; /* Number of elements in list. */\n"
16822 " struct guestfs_version *val; /* Elements. */\n"
16828 #: ../src/guestfs-structs.pod:189
16831 " void guestfs_free_version (struct guestfs_free_version *);\n"
16832 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16837 #: ../src/guestfs-structs.pod:192
16838 msgid "guestfs_xattr"
16842 #: ../src/guestfs-structs.pod:194
16845 " struct guestfs_xattr {\n"
16846 " char *attrname;\n"
16847 " /* The next two fields describe a byte array. */\n"
16848 " uint32_t attrval_len;\n"
16849 " char *attrval;\n"
16855 #: ../src/guestfs-structs.pod:201
16858 " struct guestfs_xattr_list {\n"
16859 " uint32_t len; /* Number of elements in list. */\n"
16860 " struct guestfs_xattr *val; /* Elements. */\n"
16866 #: ../src/guestfs-structs.pod:206
16869 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16870 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16875 #: ../src/guestfs-structs.pod:209
16876 msgid "guestfs_inotify_event"
16880 #: ../src/guestfs-structs.pod:211
16883 " struct guestfs_inotify_event {\n"
16884 " int64_t in_wd;\n"
16885 " uint32_t in_mask;\n"
16886 " uint32_t in_cookie;\n"
16887 " char *in_name;\n"
16893 #: ../src/guestfs-structs.pod:218
16896 " struct guestfs_inotify_event_list {\n"
16897 " uint32_t len; /* Number of elements in list. */\n"
16898 " struct guestfs_inotify_event *val; /* Elements. */\n"
16904 #: ../src/guestfs-structs.pod:223
16907 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16908 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
16913 #: ../src/guestfs-structs.pod:226
16914 msgid "guestfs_partition"
16918 #: ../src/guestfs-structs.pod:228
16921 " struct guestfs_partition {\n"
16922 " int32_t part_num;\n"
16923 " uint64_t part_start;\n"
16924 " uint64_t part_end;\n"
16925 " uint64_t part_size;\n"
16931 #: ../src/guestfs-structs.pod:235
16934 " struct guestfs_partition_list {\n"
16935 " uint32_t len; /* Number of elements in list. */\n"
16936 " struct guestfs_partition *val; /* Elements. */\n"
16942 #: ../src/guestfs-structs.pod:240
16945 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16946 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16951 #: ../src/guestfs-structs.pod:243
16952 msgid "guestfs_application"
16956 #: ../src/guestfs-structs.pod:245
16959 " struct guestfs_application {\n"
16960 " char *app_name;\n"
16961 " char *app_display_name;\n"
16962 " int32_t app_epoch;\n"
16963 " char *app_version;\n"
16964 " char *app_release;\n"
16965 " char *app_install_path;\n"
16966 " char *app_trans_path;\n"
16967 " char *app_publisher;\n"
16968 " char *app_url;\n"
16969 " char *app_source_package;\n"
16970 " char *app_summary;\n"
16971 " char *app_description;\n"
16977 #: ../src/guestfs-structs.pod:260
16980 " struct guestfs_application_list {\n"
16981 " uint32_t len; /* Number of elements in list. */\n"
16982 " struct guestfs_application *val; /* Elements. */\n"
16988 #: ../src/guestfs-structs.pod:265
16991 " void guestfs_free_application (struct guestfs_free_application *);\n"
16992 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
16997 #: ../fish/guestfish.pod:5
16998 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17002 #: ../fish/guestfish.pod:9
17005 " guestfish [--options] [commands]\n"
17010 #: ../fish/guestfish.pod:11
17018 #: ../fish/guestfish.pod:13
17021 " guestfish [--ro|--rw] -a disk.img\n"
17026 #: ../fish/guestfish.pod:15
17029 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17034 #: ../fish/guestfish.pod:17
17037 " guestfish -d libvirt-domain\n"
17042 #: ../fish/guestfish.pod:19
17045 " guestfish [--ro|--rw] -a disk.img -i\n"
17050 #: ../fish/guestfish.pod:21
17053 " guestfish -d libvirt-domain -i\n"
17058 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
17059 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
17064 #: ../fish/guestfish.pod:25
17066 "Using guestfish in read/write mode on live virtual machines can be "
17067 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17068 "option to use guestfish safely if the disk image or virtual machine might be "
17073 #: ../fish/guestfish.pod:32
17075 "Guestfish is a shell and command-line tool for examining and modifying "
17076 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17077 "functionality of the guestfs API, see L<guestfs(3)>."
17081 #: ../fish/guestfish.pod:36
17083 "Guestfish gives you structured access to the libguestfs API, from shell "
17084 "scripts or the command line or interactively. If you want to rescue a "
17085 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17090 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:847
17091 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
17092 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:45
17097 #: ../fish/guestfish.pod:43
17098 msgid "As an interactive shell"
17102 #: ../fish/guestfish.pod:45
17110 #: ../fish/guestfish.pod:47
17113 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17114 " editing virtual machine filesystems.\n"
17119 #: ../fish/guestfish.pod:50
17122 " Type: 'help' for a list of commands\n"
17123 " 'man' to read the manual\n"
17124 " 'quit' to quit the shell\n"
17129 #: ../fish/guestfish.pod:54
17132 " ><fs> add-ro disk.img\n"
17134 " ><fs> list-filesystems\n"
17135 " /dev/sda1: ext4\n"
17136 " /dev/vg_guest/lv_root: ext4\n"
17137 " /dev/vg_guest/lv_swap: swap\n"
17138 " ><fs> mount /dev/vg_guest/lv_root /\n"
17139 " ><fs> cat /etc/fstab\n"
17141 " # Created by anaconda\n"
17148 #: ../fish/guestfish.pod:67
17149 msgid "From shell scripts"
17153 #: ../fish/guestfish.pod:69
17154 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17158 #: ../fish/guestfish.pod:71
17161 " guestfish <<_EOF_\n"
17164 " mount /dev/vg_guest/lv_root /\n"
17165 " write /etc/motd \"Welcome, new users\"\n"
17171 #: ../fish/guestfish.pod:78
17172 msgid "List the LVM logical volumes in a disk image:"
17176 #: ../fish/guestfish.pod:80
17179 " guestfish -a disk.img --ro <<_EOF_\n"
17187 #: ../fish/guestfish.pod:85
17188 msgid "List all the filesystems in a disk image:"
17192 #: ../fish/guestfish.pod:87
17195 " guestfish -a disk.img --ro <<_EOF_\n"
17197 " list-filesystems\n"
17203 #: ../fish/guestfish.pod:92
17204 msgid "On one command line"
17208 #: ../fish/guestfish.pod:94
17209 msgid "Update C</etc/resolv.conf> in a guest:"
17213 #: ../fish/guestfish.pod:96
17217 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17218 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17223 #: ../fish/guestfish.pod:100
17224 msgid "Edit C</boot/grub/grub.conf> interactively:"
17228 #: ../fish/guestfish.pod:102
17231 " guestfish --rw --add disk.img \\\n"
17232 " --mount /dev/vg_guest/lv_root \\\n"
17233 " --mount /dev/sda1:/boot \\\n"
17234 " edit /boot/grub/grub.conf\n"
17239 #: ../fish/guestfish.pod:107
17240 msgid "Mount disks automatically"
17244 #: ../fish/guestfish.pod:109
17246 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17250 #: ../fish/guestfish.pod:112
17253 " guestfish --ro -a disk.img -i cat /etc/group\n"
17258 #: ../fish/guestfish.pod:114
17261 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17266 #: ../fish/guestfish.pod:116
17267 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17271 #: ../fish/guestfish.pod:118
17274 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17279 #: ../fish/guestfish.pod:120
17280 msgid "As a script interpreter"
17284 #: ../fish/guestfish.pod:122
17285 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17289 #: ../fish/guestfish.pod:124
17292 " #!/usr/bin/guestfish -f\n"
17293 " sparse test1.img 100M\n"
17295 " part-disk /dev/sda mbr\n"
17296 " mkfs ext2 /dev/sda1\n"
17301 #: ../fish/guestfish.pod:130
17302 msgid "Start with a prepared disk"
17306 #: ../fish/guestfish.pod:132
17308 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17309 "single ext2-formatted partition:"
17313 #: ../fish/guestfish.pod:135
17316 " guestfish -N fs\n"
17321 #: ../fish/guestfish.pod:137
17322 msgid "To list what is available do:"
17326 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:838
17329 " guestfish -N help | less\n"
17334 #: ../fish/guestfish.pod:141
17335 msgid "Remote control"
17339 #: ../fish/guestfish.pod:143
17342 " eval \"`guestfish --listen`\"\n"
17343 " guestfish --remote add-ro disk.img\n"
17344 " guestfish --remote run\n"
17345 " guestfish --remote lvs\n"
17350 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17351 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
17352 #: ../tools/virt-win-reg.pl:171 ../tools/virt-resize.pl:254
17353 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:98
17354 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
17359 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17360 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179
17361 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
17362 #: ../tools/virt-tar.pl:106 ../tools/virt-make-fs.pl:161
17363 #: ../tools/virt-list-partitions.pl:62
17368 #: ../fish/guestfish.pod:154
17369 msgid "Displays general help on options."
17373 #: ../fish/guestfish.pod:156
17374 msgid "B<-h> | B<--cmd-help>"
17378 #: ../fish/guestfish.pod:158
17379 msgid "Lists all available guestfish commands."
17383 #: ../fish/guestfish.pod:160
17384 msgid "B<-h cmd> | B<--cmd-help cmd>"
17388 #: ../fish/guestfish.pod:162
17389 msgid "Displays detailed help on a single command C<cmd>."
17393 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
17394 msgid "B<-a image> | B<--add image>"
17398 #: ../fish/guestfish.pod:166
17399 msgid "Add a block device or virtual machine image to the shell."
17403 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
17405 "The format of the disk image is auto-detected. To override this and force a "
17406 "particular format use the I<--format=..> option."
17410 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
17411 msgid "B<-c URI> | B<--connect URI>"
17415 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
17417 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17418 "URI to use. The default is to use the default libvirt connection."
17422 #: ../fish/guestfish.pod:177
17427 #: ../fish/guestfish.pod:179
17429 "If using the I<--listen> option and a csh-like shell, use this option. See "
17430 "section L</REMOTE CONTROL AND CSH> below."
17434 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
17435 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
17439 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
17441 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17442 "used, then any libvirt domain can be used. However in write mode, only "
17443 "libvirt domains which are shut down can be named here."
17447 #: ../fish/guestfish.pod:188
17448 msgid "B<-D> | B<--no-dest-paths>"
17452 #: ../fish/guestfish.pod:190
17454 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17455 "to hit the tab key to complete paths on the guest filesystem, but this "
17456 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17457 "allow this feature to be disabled."
17461 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
17462 msgid "B<--echo-keys>"
17466 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
17468 "When prompting for keys and passphrases, guestfish normally turns echoing "
17469 "off so you cannot see what you are typing. If you are not worried about "
17470 "Tempest attacks and there is no one else in the room you can specify this "
17471 "flag to see what you are typing."
17475 #: ../fish/guestfish.pod:202
17476 msgid "B<-f file> | B<--file file>"
17480 #: ../fish/guestfish.pod:204
17481 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17485 #: ../fish/guestfish.pod:207
17488 " #!/usr/bin/guestfish -f\n"
17493 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
17494 msgid "B<--format=raw|qcow2|..> | B<--format>"
17498 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17500 "The default for the I<-a> option is to auto-detect the format of the disk "
17501 "image. Using this forces the disk format for I<-a> options which follow on "
17502 "the command line. Using I<--format> with no argument switches back to auto-"
17503 "detection for subsequent I<-a> options."
17507 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:544
17508 msgid "For example:"
17512 #: ../fish/guestfish.pod:218
17515 " guestfish --format=raw -a disk.img\n"
17520 #: ../fish/guestfish.pod:220
17521 msgid "forces raw format (no auto-detection) for C<disk.img>."
17525 #: ../fish/guestfish.pod:222
17528 " guestfish --format=raw -a disk.img --format -a another.img\n"
17533 #: ../fish/guestfish.pod:224
17535 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17536 "detection for C<another.img>."
17540 #: ../fish/guestfish.pod:227
17542 "If you have untrusted raw-format guest disk images, you should use this "
17543 "option to specify the disk format. This avoids a possible security problem "
17544 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17548 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17549 msgid "B<-i> | B<--inspector>"
17553 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17555 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17556 "system and mount filesystems as they would be mounted on the real virtual "
17561 #: ../fish/guestfish.pod:238
17562 msgid "Typical usage is either:"
17566 #: ../fish/guestfish.pod:240
17569 " guestfish -d myguest -i\n"
17574 #: ../fish/guestfish.pod:242
17575 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17579 #: ../fish/guestfish.pod:244
17582 " guestfish --ro -d myguest -i\n"
17587 #: ../fish/guestfish.pod:246
17588 msgid "(for active domains, readonly), or specify the block device directly:"
17592 #: ../fish/guestfish.pod:248
17595 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17600 #: ../fish/guestfish.pod:250
17602 "Note that the command line syntax changed slightly over older versions of "
17603 "guestfish. You can still use the old syntax:"
17607 #: ../fish/guestfish.pod:253
17610 " guestfish [--ro] -i disk.img\n"
17615 #: ../fish/guestfish.pod:255
17618 " guestfish [--ro] -i libvirt-domain\n"
17623 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17624 msgid "B<--keys-from-stdin>"
17628 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17630 "Read key or passphrase parameters from stdin. The default is to try to read "
17631 "passphrases from the user by opening C</dev/tty>."
17635 #: ../fish/guestfish.pod:262
17636 msgid "B<--listen>"
17640 #: ../fish/guestfish.pod:264
17642 "Fork into the background and listen for remote commands. See section L</"
17643 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17647 #: ../fish/guestfish.pod:267
17648 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17652 #: ../fish/guestfish.pod:269
17653 msgid "Mount the named partition or logical volume on the given mountpoint."
17657 #: ../fish/guestfish.pod:271
17658 msgid "If the mountpoint is omitted, it defaults to C</>."
17662 #: ../fish/guestfish.pod:273
17663 msgid "You have to mount something on C</> before most commands will work."
17667 #: ../fish/guestfish.pod:275
17669 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17674 #: ../fish/guestfish.pod:278
17676 "If you don't know what filesystems a disk image contains, you can either run "
17677 "guestfish without this option, then list the partitions, filesystems and LVs "
17678 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17679 "commands), or you can use the L<virt-filesystems(1)> program."
17683 #: ../fish/guestfish.pod:284 ../fuse/guestmount.pod:154
17684 msgid "B<-n> | B<--no-sync>"
17688 #: ../fish/guestfish.pod:286
17690 "Disable autosync. This is enabled by default. See the discussion of "
17691 "autosync in the L<guestfs(3)> manpage."
17695 #: ../fish/guestfish.pod:289
17696 msgid "B<-N type> | B<--new type> | B<-N help>"
17700 #: ../fish/guestfish.pod:291
17702 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17703 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17704 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17709 #: ../fish/guestfish.pod:296
17710 msgid "B<--progress-bars>"
17714 #: ../fish/guestfish.pod:298
17715 msgid "Enable progress bars, even when guestfish is used non-interactively."
17719 #: ../fish/guestfish.pod:300
17721 "Progress bars are enabled by default when guestfish is used as an "
17722 "interactive shell."
17726 #: ../fish/guestfish.pod:303
17727 msgid "B<--no-progress-bars>"
17731 #: ../fish/guestfish.pod:305
17732 msgid "Disable progress bars."
17736 #: ../fish/guestfish.pod:307
17737 msgid "B<--remote[=pid]>"
17741 #: ../fish/guestfish.pod:309
17743 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17744 "CONTROL GUESTFISH OVER A SOCKET> below."
17748 #: ../fish/guestfish.pod:312 ../fuse/guestmount.pod:196
17749 msgid "B<-r> | B<--ro>"
17753 #: ../fish/guestfish.pod:314
17755 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17756 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17760 #: ../fish/guestfish.pod:317
17762 "The option must always be used if the disk image or virtual machine might be "
17763 "running, and is generally recommended in cases where you don't need write "
17764 "access to the disk."
17768 #: ../fish/guestfish.pod:321
17770 "Note that prepared disk images created with I<-N> are not affected by the "
17775 #: ../fish/guestfish.pod:324
17776 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17780 #: ../fish/guestfish.pod:326 ../fuse/guestmount.pod:208
17781 msgid "B<--selinux>"
17785 #: ../fish/guestfish.pod:328
17786 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17790 #: ../fish/guestfish.pod:330 ../fuse/guestmount.pod:212
17791 msgid "B<-v> | B<--verbose>"
17795 #: ../fish/guestfish.pod:332
17797 "Enable very verbose messages. This is particularly useful if you find a bug."
17801 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:216
17802 msgid "B<-V> | B<--version>"
17806 #: ../fish/guestfish.pod:337
17807 msgid "Display the guestfish / libguestfs version number and exit."
17811 #: ../fish/guestfish.pod:339 ../fuse/guestmount.pod:220
17812 msgid "B<-w> | B<--rw>"
17816 #: ../fish/guestfish.pod:341
17818 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17823 #: ../fish/guestfish.pod:344
17828 #: ../fish/guestfish.pod:346
17829 msgid "Echo each command before executing it."
17833 #: ../fish/guestfish.pod:350
17834 msgid "COMMANDS ON COMMAND LINE"
17838 #: ../fish/guestfish.pod:352
17840 "Any additional (non-option) arguments are treated as commands to execute."
17844 #: ../fish/guestfish.pod:355
17846 "Commands to execute should be separated by a colon (C<:>), where the colon "
17847 "is a separate parameter. Thus:"
17851 #: ../fish/guestfish.pod:358
17854 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17859 #: ../fish/guestfish.pod:360
17861 "If there are no additional arguments, then we enter a shell, either an "
17862 "interactive shell with a prompt (if the input is a terminal) or a non-"
17863 "interactive shell."
17867 #: ../fish/guestfish.pod:364
17869 "In either command line mode or non-interactive shell, the first command that "
17870 "gives an error causes the whole shell to exit. In interactive mode (with a "
17871 "prompt) if a command fails, you can continue to enter commands."
17875 #: ../fish/guestfish.pod:369
17876 msgid "USING launch (OR run)"
17880 #: ../fish/guestfish.pod:371
17882 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17883 "then launch it, then mount any disks you need, and finally issue actions/"
17884 "commands. So the general order of the day is:"
17888 #: ../fish/guestfish.pod:379
17889 msgid "add or -a/--add"
17893 #: ../fish/guestfish.pod:383
17894 msgid "launch (aka run)"
17898 #: ../fish/guestfish.pod:387
17899 msgid "mount or -m/--mount"
17903 #: ../fish/guestfish.pod:391
17904 msgid "any other commands"
17908 #: ../fish/guestfish.pod:395
17910 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17911 "guest before mounting or performing any other commands."
17915 #: ../fish/guestfish.pod:398
17917 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17918 "I<--new> options were given then C<run> is done automatically, simply "
17919 "because guestfish can't perform the action you asked for without doing this."
17923 #: ../fish/guestfish.pod:403
17924 msgid "OPENING DISKS FOR READ AND WRITE"
17928 #: ../fish/guestfish.pod:405
17930 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17931 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17932 "open disk images read-only or for writing."
17936 #: ../fish/guestfish.pod:409
17938 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17939 "disk images supplied on the command line for write. To open a disk image "
17940 "read-only you have to do I<-a image --ro>."
17944 #: ../fish/guestfish.pod:413
17946 "This matters: If you accidentally open a live VM disk image writable then "
17947 "you will cause irreversible disk corruption."
17951 #: ../fish/guestfish.pod:416
17953 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17954 "images will be opened read-only. You will have to either specify "
17955 "I<guestfish --rw> or change a configuration file in order to get write "
17956 "access for disk images specified by those other command line options."
17960 #: ../fish/guestfish.pod:421
17962 "This version of guestfish has a I<--rw> option which does nothing (it is "
17963 "already the default). However it is highly recommended that you use this "
17964 "option to indicate that guestfish needs write access, and to prepare your "
17965 "scripts for the day when this option will be required for write access."
17969 #: ../fish/guestfish.pod:427
17971 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17972 "other libguestfs program apart from guestfish and guestmount."
17976 #: ../fish/guestfish.pod:430
17981 #: ../fish/guestfish.pod:432
17983 "You can quote ordinary parameters using either single or double quotes. For "
17988 #: ../fish/guestfish.pod:435
17991 " add \"file with a space.img\"\n"
17996 #: ../fish/guestfish.pod:437
17999 " rm '/file name'\n"
18004 #: ../fish/guestfish.pod:439
18012 #: ../fish/guestfish.pod:441
18014 "A few commands require a list of strings to be passed. For these, use a "
18015 "whitespace-separated list, enclosed in quotes. Strings containing "
18016 "whitespace to be passed through must be enclosed in single quotes. A "
18017 "literal single quote must be escaped with a backslash."
18021 #: ../fish/guestfish.pod:446
18024 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18025 " command \"/bin/echo 'foo bar'\"\n"
18026 " command \"/bin/echo \\'foo\\'\"\n"
18031 #: ../fish/guestfish.pod:450
18032 msgid "OPTIONAL ARGUMENTS"
18036 #: ../fish/guestfish.pod:452
18038 "Some commands take optional arguments. These arguments appear in this "
18039 "documentation as C<[argname:..]>. You can use them as in these examples:"
18043 #: ../fish/guestfish.pod:456
18046 " add-drive-opts filename\n"
18051 #: ../fish/guestfish.pod:458
18054 " add-drive-opts filename readonly:true\n"
18059 #: ../fish/guestfish.pod:460
18062 " add-drive-opts filename format:qcow2 readonly:false\n"
18067 #: ../fish/guestfish.pod:462
18069 "Each optional argument can appear at most once. All optional arguments must "
18070 "appear after the required ones."
18074 #: ../fish/guestfish.pod:465
18079 #: ../fish/guestfish.pod:467
18081 "This section applies to all commands which can take integers as parameters."
18085 #: ../fish/guestfish.pod:470
18086 msgid "SIZE SUFFIX"
18090 #: ../fish/guestfish.pod:472
18092 "When the command takes a parameter measured in bytes, you can use one of the "
18093 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18097 #: ../fish/guestfish.pod:478
18098 msgid "B<k> or B<K> or B<KiB>"
18102 #: ../fish/guestfish.pod:480
18103 msgid "The size in kilobytes (multiplied by 1024)."
18107 #: ../fish/guestfish.pod:482
18112 #: ../fish/guestfish.pod:484
18113 msgid "The size in SI 1000 byte units."
18117 #: ../fish/guestfish.pod:486
18118 msgid "B<M> or B<MiB>"
18122 #: ../fish/guestfish.pod:488
18123 msgid "The size in megabytes (multiplied by 1048576)."
18127 #: ../fish/guestfish.pod:490
18132 #: ../fish/guestfish.pod:492
18133 msgid "The size in SI 1000000 byte units."
18137 #: ../fish/guestfish.pod:494
18138 msgid "B<G> or B<GiB>"
18142 #: ../fish/guestfish.pod:496
18143 msgid "The size in gigabytes (multiplied by 2**30)."
18147 #: ../fish/guestfish.pod:498
18152 #: ../fish/guestfish.pod:500
18153 msgid "The size in SI 10**9 byte units."
18157 #: ../fish/guestfish.pod:502
18158 msgid "B<T> or B<TiB>"
18162 #: ../fish/guestfish.pod:504
18163 msgid "The size in terabytes (multiplied by 2**40)."
18167 #: ../fish/guestfish.pod:506
18172 #: ../fish/guestfish.pod:508
18173 msgid "The size in SI 10**12 byte units."
18177 #: ../fish/guestfish.pod:510
18178 msgid "B<P> or B<PiB>"
18182 #: ../fish/guestfish.pod:512
18183 msgid "The size in petabytes (multiplied by 2**50)."
18187 #: ../fish/guestfish.pod:514
18192 #: ../fish/guestfish.pod:516
18193 msgid "The size in SI 10**15 byte units."
18197 #: ../fish/guestfish.pod:518
18198 msgid "B<E> or B<EiB>"
18202 #: ../fish/guestfish.pod:520
18203 msgid "The size in exabytes (multiplied by 2**60)."
18207 #: ../fish/guestfish.pod:522
18212 #: ../fish/guestfish.pod:524
18213 msgid "The size in SI 10**18 byte units."
18217 #: ../fish/guestfish.pod:526
18218 msgid "B<Z> or B<ZiB>"
18222 #: ../fish/guestfish.pod:528
18223 msgid "The size in zettabytes (multiplied by 2**70)."
18227 #: ../fish/guestfish.pod:530
18232 #: ../fish/guestfish.pod:532
18233 msgid "The size in SI 10**21 byte units."
18237 #: ../fish/guestfish.pod:534
18238 msgid "B<Y> or B<YiB>"
18242 #: ../fish/guestfish.pod:536
18243 msgid "The size in yottabytes (multiplied by 2**80)."
18247 #: ../fish/guestfish.pod:538
18252 #: ../fish/guestfish.pod:540
18253 msgid "The size in SI 10**24 byte units."
18257 #: ../fish/guestfish.pod:546
18260 " truncate-size /file 1G\n"
18265 #: ../fish/guestfish.pod:548
18266 msgid "would truncate the file to 1 gigabyte."
18270 #: ../fish/guestfish.pod:550
18272 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18273 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18274 "suffix will probably not do what you expect."
18278 #: ../fish/guestfish.pod:554
18279 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18283 #: ../fish/guestfish.pod:556
18285 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18286 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18290 #: ../fish/guestfish.pod:559
18293 " 1234 decimal number 1234\n"
18294 " 02322 octal number, equivalent to decimal 1234\n"
18295 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18300 #: ../fish/guestfish.pod:563
18302 "When using the C<chmod> command, you almost always want to specify an octal "
18303 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18304 "L<chmod(1)> program):"
18308 #: ../fish/guestfish.pod:567
18311 " chmod 0777 /public # OK\n"
18312 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18317 #: ../fish/guestfish.pod:570
18319 "Commands that return numbers usually print them in decimal, but some "
18320 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18321 "octal, preceeded by C<0>)."
18325 #: ../fish/guestfish.pod:574
18326 msgid "WILDCARDS AND GLOBBING"
18330 #: ../fish/guestfish.pod:576
18332 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18333 "(globbing) by default. So for example the following will not do what you "
18338 #: ../fish/guestfish.pod:580
18346 #: ../fish/guestfish.pod:582
18348 "Assuming you don't have a directory called literally C</home/*> then the "
18349 "above command will return an error."
18353 #: ../fish/guestfish.pod:585
18354 msgid "To perform wildcard expansion, use the C<glob> command."
18358 #: ../fish/guestfish.pod:587
18361 " glob rm-rf /home/*\n"
18366 #: ../fish/guestfish.pod:589
18368 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18369 "many times), equivalent to:"
18373 #: ../fish/guestfish.pod:592
18376 " rm-rf /home/jim\n"
18377 " rm-rf /home/joe\n"
18378 " rm-rf /home/mary\n"
18383 #: ../fish/guestfish.pod:596
18384 msgid "C<glob> only works on simple guest paths and not on device names."
18388 #: ../fish/guestfish.pod:598
18390 "If you have several parameters, each containing a wildcard, then glob will "
18391 "perform a Cartesian product."
18395 #: ../fish/guestfish.pod:601
18400 #: ../fish/guestfish.pod:603
18402 "Any line which starts with a I<#> character is treated as a comment and "
18403 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18404 "a command. For example:"
18408 #: ../fish/guestfish.pod:607
18411 " # this is a comment\n"
18412 " # this is a comment\n"
18413 " foo # NOT a comment\n"
18418 #: ../fish/guestfish.pod:611
18419 msgid "Blank lines are also ignored."
18423 #: ../fish/guestfish.pod:613
18424 msgid "RUNNING COMMANDS LOCALLY"
18428 #: ../fish/guestfish.pod:615
18430 "Any line which starts with a I<!> character is treated as a command sent to "
18431 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18435 #: ../fish/guestfish.pod:619
18439 " tgz-out /remote local/remote-data.tar.gz\n"
18444 #: ../fish/guestfish.pod:622
18446 "will create a directory C<local> on the host, and then export the contents "
18447 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18448 "(See C<tgz-out>)."
18452 #: ../fish/guestfish.pod:626
18454 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18455 "effect, due to the way that subprocesses work in Unix."
18459 #: ../fish/guestfish.pod:629
18464 #: ../fish/guestfish.pod:631
18466 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18467 "command (a guestfish command) to the second command (any host command). For "
18472 #: ../fish/guestfish.pod:635
18475 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18480 #: ../fish/guestfish.pod:637
18482 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18483 "program). The above command would list all accounts in the guest filesystem "
18484 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18488 #: ../fish/guestfish.pod:642
18491 " hexdump /bin/ls | head\n"
18492 " list-devices | tail -1\n"
18493 " tgz-out / - | tar ztf -\n"
18498 #: ../fish/guestfish.pod:646
18500 "The space before the pipe symbol is required, any space after the pipe "
18501 "symbol is optional. Everything after the pipe symbol is just passed "
18502 "straight to the host shell, so it can contain redirections, globs and "
18503 "anything else that makes sense on the host side."
18507 #: ../fish/guestfish.pod:651
18509 "To use a literal argument which begins with a pipe symbol, you have to quote "
18514 #: ../fish/guestfish.pod:654
18522 #: ../fish/guestfish.pod:656
18523 msgid "HOME DIRECTORIES"
18527 #: ../fish/guestfish.pod:658
18529 "If a parameter starts with the character C<~> then the tilde may be expanded "
18530 "as a home directory path (either C<~> for the current user's home directory, "
18531 "or C<~user> for another user)."
18535 #: ../fish/guestfish.pod:662
18537 "Note that home directory expansion happens for users known I<on the host>, "
18538 "not in the guest filesystem."
18542 #: ../fish/guestfish.pod:665
18544 "To use a literal argument which begins with a tilde, you have to quote it, "
18549 #: ../fish/guestfish.pod:668
18557 #: ../fish/guestfish.pod:672
18559 "Libguestfs has some support for Linux guests encrypted according to the "
18560 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18561 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18562 "LUKS is supported."
18566 #: ../fish/guestfish.pod:677
18567 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18571 #: ../fish/guestfish.pod:679
18574 " ><fs> vfs-type /dev/sda2\n"
18580 #: ../fish/guestfish.pod:682
18582 "Then open those devices using L</luks-open>. This creates a device-mapper "
18583 "device called C</dev/mapper/luksdev>."
18587 #: ../fish/guestfish.pod:685
18590 " ><fs> luks-open /dev/sda2 luksdev\n"
18591 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18596 #: ../fish/guestfish.pod:688
18598 "Finally you have to tell LVM to scan for volume groups on the newly created "
18603 #: ../fish/guestfish.pod:691
18607 " vg-activate-all true\n"
18612 #: ../fish/guestfish.pod:694
18613 msgid "The logical volume(s) can now be mounted in the usual way."
18617 #: ../fish/guestfish.pod:696
18619 "Before closing a LUKS device you must unmount any logical volumes on it and "
18620 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18621 "one. Then you can close the mapper device:"
18625 #: ../fish/guestfish.pod:700
18628 " vg-activate false /dev/VG\n"
18629 " luks-close /dev/mapper/luksdev\n"
18634 #: ../fish/guestfish.pod:703
18635 msgid "WINDOWS PATHS"
18639 #: ../fish/guestfish.pod:705
18641 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18642 "(with some limitations). The following commands are equivalent:"
18646 #: ../fish/guestfish.pod:708
18649 " file /WINDOWS/system32/config/system.LOG\n"
18654 #: ../fish/guestfish.pod:710
18657 " file win:/windows/system32/config/system.log\n"
18662 #: ../fish/guestfish.pod:712
18665 " file win:\\windows\\system32\\config\\system.log\n"
18670 #: ../fish/guestfish.pod:714
18673 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18678 #: ../fish/guestfish.pod:716
18680 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18681 "handles case insensitivity like Windows would. This only works in argument "
18682 "positions that expect a path."
18686 #: ../fish/guestfish.pod:720
18687 msgid "UPLOADING AND DOWNLOADING FILES"
18691 #: ../fish/guestfish.pod:722
18693 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18694 "others which upload from or download to a local file, you can use the "
18695 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18699 #: ../fish/guestfish.pod:726
18707 #: ../fish/guestfish.pod:728
18709 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18713 #: ../fish/guestfish.pod:731
18716 " tar-out /etc - | tar tf -\n"
18721 #: ../fish/guestfish.pod:733
18723 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18724 "command (see L</PIPES>)."
18728 #: ../fish/guestfish.pod:736
18730 "When using C<-> to read from stdin, the input is read up to the end of "
18731 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18732 "some arbitrary end marker:"
18736 #: ../fish/guestfish.pod:740
18739 " upload -<<END /foo\n"
18748 #: ../fish/guestfish.pod:746
18750 "Any string of characters can be used instead of C<END>. The end marker must "
18751 "appear on a line of its own, without any preceeding or following characters "
18752 "(not even spaces)."
18756 #: ../fish/guestfish.pod:750
18758 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18759 "upload local files (so-called \"FileIn\" parameters in the generator)."
18763 #: ../fish/guestfish.pod:753
18764 msgid "EXIT ON ERROR BEHAVIOUR"
18768 #: ../fish/guestfish.pod:755
18770 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18771 "taking commands from a human over a tty), and will exit on the first error "
18772 "in non-interactive mode (scripts, commands given on the command line)."
18776 #: ../fish/guestfish.pod:760
18778 "If you prefix a command with a I<-> character, then that command will not "
18779 "cause guestfish to exit, even if that (one) command returns an error."
18783 #: ../fish/guestfish.pod:764
18784 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18788 #: ../fish/guestfish.pod:766
18790 "Guestfish can be remote-controlled over a socket. This is useful "
18791 "particularly in shell scripts where you want to make several different "
18792 "changes to a filesystem, but you don't want the overhead of starting up a "
18793 "guestfish process each time."
18797 #: ../fish/guestfish.pod:771
18798 msgid "Start a guestfish server process using:"
18802 #: ../fish/guestfish.pod:773
18805 " eval \"`guestfish --listen`\"\n"
18810 #: ../fish/guestfish.pod:775
18811 msgid "and then send it commands by doing:"
18815 #: ../fish/guestfish.pod:777
18818 " guestfish --remote cmd [...]\n"
18823 #: ../fish/guestfish.pod:779
18824 msgid "To cause the server to exit, send it the exit command:"
18828 #: ../fish/guestfish.pod:781
18831 " guestfish --remote exit\n"
18836 #: ../fish/guestfish.pod:783
18838 "Note that the server will normally exit if there is an error in a command. "
18839 "You can change this in the usual way. See section L</EXIT ON ERROR "
18844 #: ../fish/guestfish.pod:787
18845 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18849 #: ../fish/guestfish.pod:789
18851 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18852 "is how the I<--remote> option knows where to send the commands. You can "
18853 "have several guestfish listener processes running using:"
18857 #: ../fish/guestfish.pod:793
18860 " eval \"`guestfish --listen`\"\n"
18861 " pid1=$GUESTFISH_PID\n"
18862 " eval \"`guestfish --listen`\"\n"
18863 " pid2=$GUESTFISH_PID\n"
18865 " guestfish --remote=$pid1 cmd\n"
18866 " guestfish --remote=$pid2 cmd\n"
18871 #: ../fish/guestfish.pod:801
18872 msgid "REMOTE CONTROL AND CSH"
18876 #: ../fish/guestfish.pod:803
18878 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18883 #: ../fish/guestfish.pod:806
18886 " eval \"`guestfish --listen --csh`\"\n"
18891 #: ../fish/guestfish.pod:808
18892 msgid "REMOTE CONTROL DETAILS"
18896 #: ../fish/guestfish.pod:810
18898 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18899 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18900 "and C<$PID> is the process ID of the server."
18904 #: ../fish/guestfish.pod:814
18905 msgid "Guestfish client and server versions must match exactly."
18909 #: ../fish/guestfish.pod:816
18910 msgid "PREPARED DISK IMAGES"
18914 #: ../fish/guestfish.pod:818
18916 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18917 "preformatted disk images that guestfish can make for you to save typing. "
18918 "This is particularly useful for testing purposes. This option is used "
18919 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18920 "can be mixed with I<-a>)."
18924 #: ../fish/guestfish.pod:824
18926 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18927 "the second and so on. Existing files in the current directory are "
18932 #: ../fish/guestfish.pod:828
18934 "The type briefly describes how the disk should be sized, partitioned, how "
18935 "filesystem(s) should be created, and how content should be added. "
18936 "Optionally the type can be followed by extra parameters, separated by C<:> "
18937 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18938 "allocated disk, containing a single partition, with the partition formatted "
18939 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18944 #: ../fish/guestfish.pod:836
18945 msgid "To list the available types and any extra parameters they take, run:"
18949 #: ../fish/guestfish.pod:840
18951 "Note that the prepared filesystem is not mounted. You would usually have to "
18952 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18956 #: ../fish/guestfish.pod:844
18958 "If any I<-N> or I<--new> options are given, the guest is automatically "
18963 #: ../fish/guestfish.pod:849
18964 msgid "Create a 100MB disk with an ext4-formatted partition:"
18968 #: ../fish/guestfish.pod:851
18971 " guestfish -N fs:ext4\n"
18976 #: ../fish/guestfish.pod:853
18977 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18981 #: ../fish/guestfish.pod:855
18984 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18989 #: ../fish/guestfish.pod:857
18990 msgid "Create a blank 200MB disk:"
18994 #: ../fish/guestfish.pod:859
18997 " guestfish -N disk:200M\n"
19002 #: ../fish/guestfish.pod:861
19003 msgid "PROGRESS BARS"
19007 #: ../fish/guestfish.pod:863
19009 "Some (not all) long-running commands send progress notification messages as "
19010 "they are running. Guestfish turns these messages into progress bars."
19014 #: ../fish/guestfish.pod:867
19016 "When a command that supports progress bars takes longer than two seconds to "
19017 "run, and if progress bars are enabled, then you will see one appearing below "
19022 #: ../fish/guestfish.pod:871
19025 " ><fs> copy-size /large-file /another-file 2048M\n"
19026 " / 10% [#####-----------------------------------------] 00:30\n"
19031 #: ../fish/guestfish.pod:874
19033 "The spinner on the left hand side moves round once for every progress "
19034 "notification received from the backend. This is a (reasonably) golden "
19035 "assurance that the command is \"doing something\" even if the progress bar "
19036 "is not moving, because the command is able to send the progress "
19037 "notifications. When the bar reaches 100% and the command finishes, the "
19038 "spinner disappears."
19042 #: ../fish/guestfish.pod:881
19044 "Progress bars are enabled by default when guestfish is used interactively. "
19045 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19046 "and you can disable them completely using I<--no-progress-bars>."
19050 #: ../fish/guestfish.pod:886
19051 msgid "GUESTFISH COMMANDS"
19055 #: ../fish/guestfish.pod:888
19057 "The commands in this section are guestfish convenience commands, in other "
19058 "words, they are not part of the L<guestfs(3)> API."
19062 #: ../fish/guestfish.pod:891
19067 #: ../fish/guestfish.pod:893
19076 #: ../fish/guestfish.pod:896
19077 msgid "Without any parameter, this provides general help."
19081 #: ../fish/guestfish.pod:898
19082 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19086 #: ../fish/guestfish.pod:900
19087 msgid "quit | exit"
19091 #: ../fish/guestfish.pod:902
19092 msgid "This exits guestfish. You can also use C<^D> key."
19096 #: ../fish/guestfish.pod:904
19097 msgid "@FISH_COMMANDS@"
19101 #: ../fish/guestfish.pod:906
19106 #: ../fish/guestfish.pod:910 ../test-tool/libguestfs-test-tool.pod:83
19111 #: ../fish/guestfish.pod:912
19113 "guestfish returns 0 if the commands completed without error, or 1 if there "
19118 #: ../fish/guestfish.pod:919
19123 #: ../fish/guestfish.pod:921
19125 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19130 #: ../fish/guestfish.pod:924
19131 msgid "GUESTFISH_PID"
19135 #: ../fish/guestfish.pod:926
19137 "Used with the I<--remote> option to specify the remote guestfish process to "
19138 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19142 #: ../fish/guestfish.pod:930
19147 #: ../fish/guestfish.pod:932
19149 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19150 "not specified, the external L<hexedit(1)> program is used."
19154 #: ../fish/guestfish.pod:936
19159 #: ../fish/guestfish.pod:938
19161 "If compiled with GNU readline support, various files in the home directory "
19162 "can be used. See L</FILES>."
19166 #: ../fish/guestfish.pod:947
19168 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19169 "effect as using the B<-v> option."
19173 #: ../fish/guestfish.pod:959
19175 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19176 "the discussion of paths in L<guestfs(3)>."
19180 #: ../fish/guestfish.pod:970
19181 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19185 #: ../fish/guestfish.pod:972
19190 #: ../fish/guestfish.pod:974
19192 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19197 #: ../fish/guestfish.pod:989 ../test-tool/libguestfs-test-tool.pod:88
19202 #: ../fish/guestfish.pod:993
19203 msgid "$HOME/.guestfish"
19207 #: ../fish/guestfish.pod:995
19209 "If compiled with GNU readline support, then the command history is saved in "
19214 #: ../fish/guestfish.pod:998
19215 msgid "$HOME/.inputrc"
19219 #: ../fish/guestfish.pod:1000
19220 msgid "/etc/inputrc"
19224 #: ../fish/guestfish.pod:1002
19226 "If compiled with GNU readline support, then these files can be used to "
19227 "configure readline. For further information, please see L<readline(3)/"
19228 "INITIALIZATION FILE>."
19232 #: ../fish/guestfish.pod:1006
19233 msgid "To write rules which only apply to guestfish, use:"
19237 #: ../fish/guestfish.pod:1008
19247 #: ../fish/guestfish.pod:1012
19249 "Variables that you can set in inputrc that change the behaviour of guestfish "
19250 "in useful ways include:"
19254 #: ../fish/guestfish.pod:1017
19255 msgid "completion-ignore-case (default: on)"
19259 #: ../fish/guestfish.pod:1019
19261 "By default, guestfish will ignore case when tab-completing paths on the "
19266 #: ../fish/guestfish.pod:1022
19269 " set completion-ignore-case off\n"
19274 #: ../fish/guestfish.pod:1024
19275 msgid "to make guestfish case sensitive."
19279 #: ../fish/guestfish.pod:1028
19284 #: ../fish/guestfish.pod:1030
19285 msgid "test2.img (etc)"
19289 #: ../fish/guestfish.pod:1032
19291 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19292 "will be created in the file C<test1.img> in the current directory. The "
19293 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19294 "the same name will be overwritten."
19298 #: ../fish/guestfish.pod:1041
19300 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19301 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
19302 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
19303 ">, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, "
19308 #: ../fish/guestfish.pod:1067 ../test-tool/libguestfs-test-tool.pod:124
19309 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370
19310 #: ../tools/virt-win-reg.pl:518 ../tools/virt-resize.pl:1512
19311 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:300
19312 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
19314 "This program is free software; you can redistribute it and/or modify it "
19315 "under the terms of the GNU General Public License as published by the Free "
19316 "Software Foundation; either version 2 of the License, or (at your option) "
19317 "any later version."
19321 #: ../fish/guestfish.pod:1072 ../test-tool/libguestfs-test-tool.pod:129
19322 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375
19323 #: ../tools/virt-win-reg.pl:523 ../tools/virt-resize.pl:1517
19324 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:305
19325 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
19327 "This program is distributed in the hope that it will be useful, but WITHOUT "
19328 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19329 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19334 #: ../fish/guestfish.pod:1077 ../test-tool/libguestfs-test-tool.pod:134
19335 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380
19336 #: ../tools/virt-win-reg.pl:528 ../tools/virt-resize.pl:1522
19337 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:310
19338 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
19340 "You should have received a copy of the GNU General Public License along with "
19341 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19342 "Ave, Cambridge, MA 02139, USA."
19346 #: ../fish/guestfish-actions.pod:1
19351 #: ../fish/guestfish-actions.pod:3
19354 " add-cdrom filename\n"
19359 #: ../fish/guestfish-actions.pod:15
19361 "This call checks for the existence of C<filename>. This stops you from "
19362 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19363 "and C<http:> URLs. To specify those, use the general L</config> call "
19368 #: ../fish/guestfish-actions.pod:22
19370 "If you just want to add an ISO file (often you use this as an efficient way "
19371 "to transfer large files into the guest), then you should probably use L</add-"
19372 "drive-ro> instead."
19376 #: ../fish/guestfish-actions.pod:35
19381 #: ../fish/guestfish-actions.pod:37
19386 #: ../fish/guestfish-actions.pod:39
19389 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19394 #: ../fish/guestfish-actions.pod:41
19396 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19397 "It works by connecting to libvirt, requesting the domain and domain XML from "
19398 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19402 #: ../fish/guestfish-actions.pod:58
19404 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19405 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19406 "libvirt URI (or one set through an environment variable, see the libvirt "
19407 "documentation for full details). If you are using the C API directly then "
19408 "it is more flexible to create the libvirt connection object yourself, get "
19409 "the domain object, and call L</add-libvirt-dom>."
19413 #: ../fish/guestfish-actions.pod:66
19415 "The other optional parameters are passed directly through to L</add-drive-"
19420 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19421 #: ../fish/guestfish-actions.pod:2804
19423 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19427 #: ../fish/guestfish-actions.pod:71
19432 #: ../fish/guestfish-actions.pod:73
19435 " add-drive filename\n"
19440 #: ../fish/guestfish-actions.pod:75
19442 "This function is the equivalent of calling L</add-drive-opts> with no "
19443 "optional parameters, so the disk is added writable, with the format being "
19444 "detected automatically."
19448 #: ../fish/guestfish-actions.pod:79
19450 "Automatic detection of the format opens you up to a potential security hole "
19451 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19452 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19453 "you should think about replacing calls to this function with calls to L</add-"
19454 "drive-opts>, and specifying the format."
19458 #: ../fish/guestfish-actions.pod:86
19459 msgid "add-drive-opts"
19463 #: ../fish/guestfish-actions.pod:88
19468 #: ../fish/guestfish-actions.pod:90
19471 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19476 #: ../fish/guestfish-actions.pod:117
19478 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19479 "add-drive-ro>) then the format is automatically detected. Possible formats "
19480 "include C<raw> and C<qcow2>."
19484 #: ../fish/guestfish-actions.pod:128
19486 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19487 "add-drive-with-if> call (q.v.)"
19491 #: ../fish/guestfish-actions.pod:135
19492 msgid "add-drive-ro"
19496 #: ../fish/guestfish-actions.pod:137
19501 #: ../fish/guestfish-actions.pod:139
19504 " add-drive-ro filename\n"
19509 #: ../fish/guestfish-actions.pod:141
19511 "This function is the equivalent of calling L</add-drive-opts> with the "
19512 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19513 "is added read-only, with the format being detected automatically."
19517 #: ../fish/guestfish-actions.pod:146
19518 msgid "add-drive-ro-with-if"
19522 #: ../fish/guestfish-actions.pod:148
19525 " add-drive-ro-with-if filename iface\n"
19530 #: ../fish/guestfish-actions.pod:150
19532 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19533 "interface emulation to use at run time."
19537 #: ../fish/guestfish-actions.pod:160
19538 msgid "add-drive-with-if"
19542 #: ../fish/guestfish-actions.pod:162
19545 " add-drive-with-if filename iface\n"
19550 #: ../fish/guestfish-actions.pod:164
19552 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19553 "interface emulation to use at run time."
19557 #: ../fish/guestfish-actions.pod:174
19562 #: ../fish/guestfish-actions.pod:176
19565 " aug-clear augpath\n"
19570 #: ../fish/guestfish-actions.pod:181
19575 #: ../fish/guestfish-actions.pod:183
19583 #: ../fish/guestfish-actions.pod:185
19585 "Close the current Augeas handle and free up any resources used by it. After "
19586 "calling this, you have to call L</aug-init> again before you can use any "
19587 "other Augeas functions."
19591 #: ../fish/guestfish-actions.pod:190
19592 msgid "aug-defnode"
19596 #: ../fish/guestfish-actions.pod:192
19599 " aug-defnode name expr val\n"
19604 #: ../fish/guestfish-actions.pod:197
19606 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19607 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19608 "containing that single node."
19612 #: ../fish/guestfish-actions.pod:205
19617 #: ../fish/guestfish-actions.pod:207
19620 " aug-defvar name expr\n"
19625 #: ../fish/guestfish-actions.pod:216
19630 #: ../fish/guestfish-actions.pod:218
19633 " aug-get augpath\n"
19638 #: ../fish/guestfish-actions.pod:223
19643 #: ../fish/guestfish-actions.pod:225
19646 " aug-init root flags\n"
19651 #: ../fish/guestfish-actions.pod:231
19652 msgid "You must call this before using any other L</aug-*> commands."
19656 #: ../fish/guestfish-actions.pod:266
19657 msgid "Do not load the tree in L</aug-init>."
19661 #: ../fish/guestfish-actions.pod:270
19662 msgid "To close the handle, you can call L</aug-close>."
19666 #: ../fish/guestfish-actions.pod:274
19671 #: ../fish/guestfish-actions.pod:276
19674 " aug-insert augpath label true|false\n"
19679 #: ../fish/guestfish-actions.pod:286
19684 #: ../fish/guestfish-actions.pod:288
19692 #: ../fish/guestfish-actions.pod:295
19697 #: ../fish/guestfish-actions.pod:297
19700 " aug-ls augpath\n"
19705 #: ../fish/guestfish-actions.pod:299
19707 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19708 "resulting nodes into alphabetical order."
19712 #: ../fish/guestfish-actions.pod:302
19717 #: ../fish/guestfish-actions.pod:304
19720 " aug-match augpath\n"
19725 #: ../fish/guestfish-actions.pod:310
19730 #: ../fish/guestfish-actions.pod:312
19733 " aug-mv src dest\n"
19738 #: ../fish/guestfish-actions.pod:317
19743 #: ../fish/guestfish-actions.pod:319
19746 " aug-rm augpath\n"
19751 #: ../fish/guestfish-actions.pod:325
19756 #: ../fish/guestfish-actions.pod:327
19764 #: ../fish/guestfish-actions.pod:331
19766 "The flags which were passed to L</aug-init> affect exactly how files are "
19771 #: ../fish/guestfish-actions.pod:334
19776 #: ../fish/guestfish-actions.pod:336
19779 " aug-set augpath val\n"
19784 #: ../fish/guestfish-actions.pod:340
19786 "In the Augeas API, it is possible to clear a node by setting the value to "
19787 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19788 "this call. Instead you must use the L</aug-clear> call."
19792 #: ../fish/guestfish-actions.pod:345
19797 #: ../fish/guestfish-actions.pod:347
19800 " available 'groups ...'\n"
19805 #: ../fish/guestfish-actions.pod:353
19807 "The libguestfs groups, and the functions that those groups correspond to, "
19808 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19809 "runtime by calling L</available-all-groups>."
19813 #: ../fish/guestfish-actions.pod:377
19814 msgid "You must call L</launch> before calling this function."
19818 #: ../fish/guestfish-actions.pod:399
19820 "This call was added in version C<1.0.80>. In previous versions of "
19821 "libguestfs all you could do would be to speculatively execute a command to "
19822 "find out if the daemon implemented it. See also L</version>."
19826 #: ../fish/guestfish-actions.pod:406
19827 msgid "available-all-groups"
19831 #: ../fish/guestfish-actions.pod:408
19834 " available-all-groups\n"
19839 #: ../fish/guestfish-actions.pod:410
19841 "This command returns a list of all optional groups that this daemon knows "
19842 "about. Note this returns both supported and unsupported groups. To find "
19843 "out which ones the daemon can actually support you have to call L</"
19844 "available> on each member of the returned list."
19848 #: ../fish/guestfish-actions.pod:416
19849 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19853 #: ../fish/guestfish-actions.pod:418
19858 #: ../fish/guestfish-actions.pod:420
19861 " base64-in (base64file|-) filename\n"
19866 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
19867 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
19868 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
19869 #: ../fish/guestfish-actions.pod:4159 ../fish/guestfish-actions.pod:4171
19870 #: ../fish/guestfish-actions.pod:4182 ../fish/guestfish-actions.pod:4193
19871 #: ../fish/guestfish-actions.pod:4245 ../fish/guestfish-actions.pod:4254
19872 #: ../fish/guestfish-actions.pod:4308 ../fish/guestfish-actions.pod:4331
19873 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19877 #: ../fish/guestfish-actions.pod:427
19882 #: ../fish/guestfish-actions.pod:429
19885 " base64-out filename (base64file|-)\n"
19890 #: ../fish/guestfish-actions.pod:436
19891 msgid "blockdev-flushbufs"
19895 #: ../fish/guestfish-actions.pod:438
19898 " blockdev-flushbufs device\n"
19903 #: ../fish/guestfish-actions.pod:445
19904 msgid "blockdev-getbsz"
19908 #: ../fish/guestfish-actions.pod:447
19911 " blockdev-getbsz device\n"
19916 #: ../fish/guestfish-actions.pod:456
19917 msgid "blockdev-getro"
19921 #: ../fish/guestfish-actions.pod:458
19924 " blockdev-getro device\n"
19929 #: ../fish/guestfish-actions.pod:465
19930 msgid "blockdev-getsize64"
19934 #: ../fish/guestfish-actions.pod:467
19937 " blockdev-getsize64 device\n"
19942 #: ../fish/guestfish-actions.pod:471
19943 msgid "See also L</blockdev-getsz>."
19947 #: ../fish/guestfish-actions.pod:475
19948 msgid "blockdev-getss"
19952 #: ../fish/guestfish-actions.pod:477
19955 " blockdev-getss device\n"
19960 #: ../fish/guestfish-actions.pod:482
19962 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19966 #: ../fish/guestfish-actions.pod:487
19967 msgid "blockdev-getsz"
19971 #: ../fish/guestfish-actions.pod:489
19974 " blockdev-getsz device\n"
19979 #: ../fish/guestfish-actions.pod:494
19981 "See also L</blockdev-getss> for the real sector size of the device, and L</"
19982 "blockdev-getsize64> for the more useful I<size in bytes>."
19986 #: ../fish/guestfish-actions.pod:500
19987 msgid "blockdev-rereadpt"
19991 #: ../fish/guestfish-actions.pod:502
19994 " blockdev-rereadpt device\n"
19999 #: ../fish/guestfish-actions.pod:508
20000 msgid "blockdev-setbsz"
20004 #: ../fish/guestfish-actions.pod:510
20007 " blockdev-setbsz device blocksize\n"
20012 #: ../fish/guestfish-actions.pod:519
20013 msgid "blockdev-setro"
20017 #: ../fish/guestfish-actions.pod:521
20020 " blockdev-setro device\n"
20025 #: ../fish/guestfish-actions.pod:527
20026 msgid "blockdev-setrw"
20030 #: ../fish/guestfish-actions.pod:529
20033 " blockdev-setrw device\n"
20038 #: ../fish/guestfish-actions.pod:535
20039 msgid "case-sensitive-path"
20043 #: ../fish/guestfish-actions.pod:537
20046 " case-sensitive-path path\n"
20051 #: ../fish/guestfish-actions.pod:561
20053 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
20054 "WINDOWS/system32\"> (the exact return value would depend on details of how "
20055 "the directories were originally created under Windows)."
20059 #: ../fish/guestfish-actions.pod:569
20060 msgid "See also L</realpath>."
20064 #: ../fish/guestfish-actions.pod:571
20069 #: ../fish/guestfish-actions.pod:573
20077 #: ../fish/guestfish-actions.pod:577
20079 "Note that this function cannot correctly handle binary files (specifically, "
20080 "files containing C<\\0> character which is treated as end of string). For "
20081 "those you need to use the L</read-file> or L</download> functions which have "
20082 "a more complex interface."
20086 #: ../fish/guestfish-actions.pod:585
20091 #: ../fish/guestfish-actions.pod:587
20094 " checksum csumtype path\n"
20099 #: ../fish/guestfish-actions.pod:630
20100 msgid "To get the checksum for a device, use L</checksum-device>."
20104 #: ../fish/guestfish-actions.pod:632
20105 msgid "To get the checksums for many files, use L</checksums-out>."
20109 #: ../fish/guestfish-actions.pod:634
20110 msgid "checksum-device"
20114 #: ../fish/guestfish-actions.pod:636
20117 " checksum-device csumtype device\n"
20122 #: ../fish/guestfish-actions.pod:638
20124 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20125 "device named C<device>. For the types of checksums supported see the L</"
20126 "checksum> command."
20130 #: ../fish/guestfish-actions.pod:642
20131 msgid "checksums-out"
20135 #: ../fish/guestfish-actions.pod:644
20138 " checksums-out csumtype directory (sumsfile|-)\n"
20143 #: ../fish/guestfish-actions.pod:660
20148 #: ../fish/guestfish-actions.pod:662
20151 " chmod mode path\n"
20156 #: ../fish/guestfish-actions.pod:673
20161 #: ../fish/guestfish-actions.pod:675
20164 " chown owner group path\n"
20169 #: ../fish/guestfish-actions.pod:683
20174 #: ../fish/guestfish-actions.pod:685
20177 " command 'arguments ...'\n"
20182 #: ../fish/guestfish-actions.pod:692
20184 "The single parameter is an argv-style list of arguments. The first element "
20185 "is the name of the program to run. Subsequent elements are parameters. The "
20186 "list must be non-empty (ie. must contain a program name). Note that the "
20187 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20191 #: ../fish/guestfish-actions.pod:720
20192 msgid "command-lines"
20196 #: ../fish/guestfish-actions.pod:722
20199 " command-lines 'arguments ...'\n"
20204 #: ../fish/guestfish-actions.pod:724
20206 "This is the same as L</command>, but splits the result into a list of lines."
20210 #: ../fish/guestfish-actions.pod:727
20211 msgid "See also: L</sh-lines>"
20215 #: ../fish/guestfish-actions.pod:732
20220 #: ../fish/guestfish-actions.pod:734
20223 " config qemuparam qemuvalue\n"
20228 #: ../fish/guestfish-actions.pod:745
20233 #: ../fish/guestfish-actions.pod:747
20236 " copy-size src dest size\n"
20241 #: ../fish/guestfish-actions.pod:755
20246 #: ../fish/guestfish-actions.pod:757
20254 #: ../fish/guestfish-actions.pod:762
20259 #: ../fish/guestfish-actions.pod:764
20267 #: ../fish/guestfish-actions.pod:769
20272 #: ../fish/guestfish-actions.pod:771
20280 #: ../fish/guestfish-actions.pod:778
20282 "If the destination is a device, it must be as large or larger than the "
20283 "source file or device, otherwise the copy will fail. This command cannot do "
20284 "partial copies (see L</copy-size>)."
20288 #: ../fish/guestfish-actions.pod:782
20293 #: ../fish/guestfish-actions.pod:784
20301 #: ../fish/guestfish-actions.pod:792
20306 #: ../fish/guestfish-actions.pod:794
20314 #: ../fish/guestfish-actions.pod:803
20319 #: ../fish/guestfish-actions.pod:805
20327 #: ../fish/guestfish-actions.pod:811
20329 "Another way to get the same information is to enable verbose messages with "
20330 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20331 "before running the program."
20335 #: ../fish/guestfish-actions.pod:816
20340 #: ../fish/guestfish-actions.pod:818
20343 " download remotefilename (filename|-)\n"
20348 #: ../fish/guestfish-actions.pod:825
20349 msgid "See also L</upload>, L</cat>."
20353 #: ../fish/guestfish-actions.pod:829
20354 msgid "download-offset"
20358 #: ../fish/guestfish-actions.pod:831
20361 " download-offset remotefilename (filename|-) offset size\n"
20366 #: ../fish/guestfish-actions.pod:839
20368 "Note that there is no limit on the amount of data that can be downloaded "
20369 "with this call, unlike with L</pread>, and this call always reads the full "
20370 "amount unless an error occurs."
20374 #: ../fish/guestfish-actions.pod:844
20375 msgid "See also L</download>, L</pread>."
20379 #: ../fish/guestfish-actions.pod:848
20380 msgid "drop-caches"
20384 #: ../fish/guestfish-actions.pod:850
20387 " drop-caches whattodrop\n"
20392 #: ../fish/guestfish-actions.pod:862
20397 #: ../fish/guestfish-actions.pod:864
20405 #: ../fish/guestfish-actions.pod:876
20410 #: ../fish/guestfish-actions.pod:878
20413 " e2fsck-f device\n"
20418 #: ../fish/guestfish-actions.pod:884
20420 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20421 "should use L</fsck>."
20425 #: ../fish/guestfish-actions.pod:887
20426 msgid "echo-daemon"
20430 #: ../fish/guestfish-actions.pod:889
20433 " echo-daemon 'words ...'\n"
20438 #: ../fish/guestfish-actions.pod:896
20439 msgid "See also L</ping-daemon>."
20443 #: ../fish/guestfish-actions.pod:898
20448 #: ../fish/guestfish-actions.pod:900
20451 " egrep regex path\n"
20456 #: ../fish/guestfish-actions.pod:908
20461 #: ../fish/guestfish-actions.pod:910
20464 " egrepi regex path\n"
20469 #: ../fish/guestfish-actions.pod:918
20474 #: ../fish/guestfish-actions.pod:920
20477 " equal file1 file2\n"
20482 #: ../fish/guestfish-actions.pod:927
20487 #: ../fish/guestfish-actions.pod:929
20495 #: ../fish/guestfish-actions.pod:934
20496 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20500 #: ../fish/guestfish-actions.pod:936
20505 #: ../fish/guestfish-actions.pod:938
20508 " fallocate path len\n"
20513 #: ../fish/guestfish-actions.pod:955
20514 msgid "fallocate64"
20518 #: ../fish/guestfish-actions.pod:957
20521 " fallocate64 path len\n"
20526 #: ../fish/guestfish-actions.pod:963
20528 "Note that this call allocates disk blocks for the file. To create a sparse "
20529 "file use L</truncate-size> instead."
20533 #: ../fish/guestfish-actions.pod:966
20535 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20536 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20537 "maximum size of files created through that call to 1GB."
20541 #: ../fish/guestfish-actions.pod:975
20546 #: ../fish/guestfish-actions.pod:977
20549 " fgrep pattern path\n"
20554 #: ../fish/guestfish-actions.pod:985
20559 #: ../fish/guestfish-actions.pod:987
20562 " fgrepi pattern path\n"
20567 #: ../fish/guestfish-actions.pod:995
20572 #: ../fish/guestfish-actions.pod:997
20580 #: ../fish/guestfish-actions.pod:1009
20582 "This command can also be used on C</dev/> devices (and partitions, LV "
20583 "names). You can for example use this to determine if a device contains a "
20584 "filesystem, although it's usually better to use L</vfs-type>."
20588 #: ../fish/guestfish-actions.pod:1019
20589 msgid "file-architecture"
20593 #: ../fish/guestfish-actions.pod:1021
20596 " file-architecture filename\n"
20601 #: ../fish/guestfish-actions.pod:1124
20606 #: ../fish/guestfish-actions.pod:1126
20614 #: ../fish/guestfish-actions.pod:1130
20616 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20617 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20621 #: ../fish/guestfish-actions.pod:1134
20626 #: ../fish/guestfish-actions.pod:1136
20629 " fill c len path\n"
20634 #: ../fish/guestfish-actions.pod:1142
20636 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20637 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20638 "L</fill-pattern>."
20642 #: ../fish/guestfish-actions.pod:1147
20643 msgid "fill-pattern"
20647 #: ../fish/guestfish-actions.pod:1149
20650 " fill-pattern pattern len path\n"
20655 #: ../fish/guestfish-actions.pod:1151
20657 "This function is like L</fill> except that it creates a new file of length "
20658 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20659 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20664 #: ../fish/guestfish-actions.pod:1156
20669 #: ../fish/guestfish-actions.pod:1158
20672 " find directory\n"
20677 #: ../fish/guestfish-actions.pod:1172
20678 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20682 #: ../fish/guestfish-actions.pod:1185
20683 msgid "See also L</find0>."
20687 #: ../fish/guestfish-actions.pod:1190
20692 #: ../fish/guestfish-actions.pod:1192
20695 " find0 directory (files|-)\n"
20700 #: ../fish/guestfish-actions.pod:1198
20702 "This command works the same way as L</find> with the following exceptions:"
20706 #: ../fish/guestfish-actions.pod:1225
20707 msgid "findfs-label"
20711 #: ../fish/guestfish-actions.pod:1227
20714 " findfs-label label\n"
20719 #: ../fish/guestfish-actions.pod:1233
20720 msgid "To find the label of a filesystem, use L</vfs-label>."
20724 #: ../fish/guestfish-actions.pod:1235
20725 msgid "findfs-uuid"
20729 #: ../fish/guestfish-actions.pod:1237
20732 " findfs-uuid uuid\n"
20737 #: ../fish/guestfish-actions.pod:1243
20738 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20742 #: ../fish/guestfish-actions.pod:1245
20747 #: ../fish/guestfish-actions.pod:1247
20750 " fsck fstype device\n"
20755 #: ../fish/guestfish-actions.pod:1277
20760 #: ../fish/guestfish-actions.pod:1279
20768 #: ../fish/guestfish-actions.pod:1286
20769 msgid "get-autosync"
20773 #: ../fish/guestfish-actions.pod:1288
20781 #: ../fish/guestfish-actions.pod:1292
20786 #: ../fish/guestfish-actions.pod:1294
20794 #: ../fish/guestfish-actions.pod:1298
20795 msgid "get-e2label"
20799 #: ../fish/guestfish-actions.pod:1300
20802 " get-e2label device\n"
20807 #: ../fish/guestfish-actions.pod:1312
20812 #: ../fish/guestfish-actions.pod:1314
20815 " get-e2uuid device\n"
20820 #: ../fish/guestfish-actions.pod:1326
20821 msgid "get-memsize"
20825 #: ../fish/guestfish-actions.pod:1328
20833 #: ../fish/guestfish-actions.pod:1333
20835 "If L</set-memsize> was not called on this handle, and if "
20836 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20837 "value for memsize."
20841 #: ../fish/guestfish-actions.pod:1340
20842 msgid "get-network"
20846 #: ../fish/guestfish-actions.pod:1342
20854 #: ../fish/guestfish-actions.pod:1346
20859 #: ../fish/guestfish-actions.pod:1348
20867 #: ../fish/guestfish-actions.pod:1355
20872 #: ../fish/guestfish-actions.pod:1357
20877 #: ../fish/guestfish-actions.pod:1359
20885 #: ../fish/guestfish-actions.pod:1366
20890 #: ../fish/guestfish-actions.pod:1368
20898 #: ../fish/guestfish-actions.pod:1375
20899 msgid "get-recovery-proc"
20903 #: ../fish/guestfish-actions.pod:1377
20906 " get-recovery-proc\n"
20911 #: ../fish/guestfish-actions.pod:1381
20912 msgid "get-selinux"
20916 #: ../fish/guestfish-actions.pod:1383
20924 #: ../fish/guestfish-actions.pod:1385
20926 "This returns the current setting of the selinux flag which is passed to the "
20927 "appliance at boot time. See L</set-selinux>."
20931 #: ../fish/guestfish-actions.pod:1391
20936 #: ../fish/guestfish-actions.pod:1393
20944 #: ../fish/guestfish-actions.pod:1400
20949 #: ../fish/guestfish-actions.pod:1402
20957 #: ../fish/guestfish-actions.pod:1406
20962 #: ../fish/guestfish-actions.pod:1408
20970 #: ../fish/guestfish-actions.pod:1410
20972 "Return the current umask. By default the umask is C<022> unless it has been "
20973 "set by calling L</umask>."
20977 #: ../fish/guestfish-actions.pod:1413
20978 msgid "get-verbose"
20982 #: ../fish/guestfish-actions.pod:1415
20990 #: ../fish/guestfish-actions.pod:1419
20995 #: ../fish/guestfish-actions.pod:1421
21003 #: ../fish/guestfish-actions.pod:1425
21004 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
21008 #: ../fish/guestfish-actions.pod:1428
21013 #: ../fish/guestfish-actions.pod:1430
21016 " getxattrs path\n"
21021 #: ../fish/guestfish-actions.pod:1438
21022 msgid "See also: L</lgetxattrs>, L<attr(5)>."
21026 #: ../fish/guestfish-actions.pod:1440
21027 msgid "glob-expand"
21031 #: ../fish/guestfish-actions.pod:1442
21034 " glob-expand pattern\n"
21039 #: ../fish/guestfish-actions.pod:1455
21044 #: ../fish/guestfish-actions.pod:1457
21047 " grep regex path\n"
21052 #: ../fish/guestfish-actions.pod:1465
21057 #: ../fish/guestfish-actions.pod:1467
21060 " grepi regex path\n"
21065 #: ../fish/guestfish-actions.pod:1475
21066 msgid "grub-install"
21070 #: ../fish/guestfish-actions.pod:1477
21073 " grub-install root device\n"
21078 #: ../fish/guestfish-actions.pod:1493
21083 #: ../fish/guestfish-actions.pod:1495
21091 #: ../fish/guestfish-actions.pod:1503
21096 #: ../fish/guestfish-actions.pod:1505
21099 " head-n nrlines path\n"
21104 #: ../fish/guestfish-actions.pod:1518
21109 #: ../fish/guestfish-actions.pod:1520
21117 #: ../fish/guestfish-actions.pod:1528
21122 #: ../fish/guestfish-actions.pod:1530
21125 " initrd-cat initrdpath filename\n"
21130 #: ../fish/guestfish-actions.pod:1542
21131 msgid "See also L</initrd-list>."
21135 #: ../fish/guestfish-actions.pod:1547
21136 msgid "initrd-list"
21140 #: ../fish/guestfish-actions.pod:1549
21143 " initrd-list path\n"
21148 #: ../fish/guestfish-actions.pod:1561
21149 msgid "inotify-add-watch"
21153 #: ../fish/guestfish-actions.pod:1563
21156 " inotify-add-watch path mask\n"
21161 #: ../fish/guestfish-actions.pod:1575
21162 msgid "inotify-close"
21166 #: ../fish/guestfish-actions.pod:1577
21174 #: ../fish/guestfish-actions.pod:1583
21175 msgid "inotify-files"
21179 #: ../fish/guestfish-actions.pod:1585
21187 #: ../fish/guestfish-actions.pod:1587
21189 "This function is a helpful wrapper around L</inotify-read> which just "
21190 "returns a list of pathnames of objects that were touched. The returned "
21191 "pathnames are sorted and deduplicated."
21195 #: ../fish/guestfish-actions.pod:1591
21196 msgid "inotify-init"
21200 #: ../fish/guestfish-actions.pod:1593
21203 " inotify-init maxevents\n"
21208 #: ../fish/guestfish-actions.pod:1599
21210 "C<maxevents> is the maximum number of events which will be queued up between "
21211 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21212 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21213 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21214 "but records the fact that it threw them away by setting a flag "
21215 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21219 #: ../fish/guestfish-actions.pod:1609
21221 "Before any events are generated, you have to add some watches to the "
21222 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21223 "L</inotify-watch-all>."
21227 #: ../fish/guestfish-actions.pod:1615
21229 "Queued up events should be read periodically by calling L</inotify-read> (or "
21230 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21231 "If you don't read the events out often enough then you risk the internal "
21232 "queue overflowing."
21236 #: ../fish/guestfish-actions.pod:1622
21238 "The handle should be closed after use by calling L</inotify-close>. This "
21239 "also removes any watches automatically."
21243 #: ../fish/guestfish-actions.pod:1631
21244 msgid "inotify-read"
21248 #: ../fish/guestfish-actions.pod:1633
21256 #: ../fish/guestfish-actions.pod:1646
21257 msgid "inotify-rm-watch"
21261 #: ../fish/guestfish-actions.pod:1648
21264 " inotify-rm-watch wd\n"
21269 #: ../fish/guestfish-actions.pod:1650
21270 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21274 #: ../fish/guestfish-actions.pod:1653
21275 msgid "inspect-get-arch"
21279 #: ../fish/guestfish-actions.pod:1655
21282 " inspect-get-arch root\n"
21287 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673
21288 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1765
21289 #: ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1801
21290 #: ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1839
21291 #: ../fish/guestfish-actions.pod:1861 ../fish/guestfish-actions.pod:1885
21292 #: ../fish/guestfish-actions.pod:1915 ../fish/guestfish-actions.pod:1950
21293 #: ../fish/guestfish-actions.pod:1966
21295 "This function should only be called with a root device string as returned by "
21300 #: ../fish/guestfish-actions.pod:1660
21302 "This returns the architecture of the inspected operating system. The "
21303 "possible return values are listed under L</file-architecture>."
21307 #: ../fish/guestfish-actions.pod:1669
21308 msgid "inspect-get-distro"
21312 #: ../fish/guestfish-actions.pod:1671
21315 " inspect-get-distro root\n"
21320 #: ../fish/guestfish-actions.pod:1743
21321 msgid "inspect-get-filesystems"
21325 #: ../fish/guestfish-actions.pod:1745
21328 " inspect-get-filesystems root\n"
21333 #: ../fish/guestfish-actions.pod:1758
21335 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21336 "get-mountpoints>."
21340 #: ../fish/guestfish-actions.pod:1761
21341 msgid "inspect-get-hostname"
21345 #: ../fish/guestfish-actions.pod:1763
21348 " inspect-get-hostname root\n"
21353 #: ../fish/guestfish-actions.pod:1776
21354 msgid "inspect-get-major-version"
21358 #: ../fish/guestfish-actions.pod:1778
21361 " inspect-get-major-version root\n"
21366 #: ../fish/guestfish-actions.pod:1797
21367 msgid "inspect-get-minor-version"
21371 #: ../fish/guestfish-actions.pod:1799
21374 " inspect-get-minor-version root\n"
21379 #: ../fish/guestfish-actions.pod:1809
21381 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21382 "get-major-version>."
21386 #: ../fish/guestfish-actions.pod:1812
21387 msgid "inspect-get-mountpoints"
21391 #: ../fish/guestfish-actions.pod:1814
21394 " inspect-get-mountpoints root\n"
21399 #: ../fish/guestfish-actions.pod:1832
21401 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21402 "get-filesystems>."
21406 #: ../fish/guestfish-actions.pod:1835
21407 msgid "inspect-get-package-format"
21411 #: ../fish/guestfish-actions.pod:1837
21414 " inspect-get-package-format root\n"
21419 #: ../fish/guestfish-actions.pod:1842
21421 "This function and L</inspect-get-package-management> return the package "
21422 "format and package management tool used by the inspected operating system. "
21423 "For example for Fedora these functions would return C<rpm> (package format) "
21424 "and C<yum> (package management)."
21428 #: ../fish/guestfish-actions.pod:1857
21429 msgid "inspect-get-package-management"
21433 #: ../fish/guestfish-actions.pod:1859
21436 " inspect-get-package-management root\n"
21441 #: ../fish/guestfish-actions.pod:1864
21443 "L</inspect-get-package-format> and this function return the package format "
21444 "and package management tool used by the inspected operating system. For "
21445 "example for Fedora these functions would return C<rpm> (package format) and "
21446 "C<yum> (package management)."
21450 #: ../fish/guestfish-actions.pod:1881
21451 msgid "inspect-get-product-name"
21455 #: ../fish/guestfish-actions.pod:1883
21458 " inspect-get-product-name root\n"
21463 #: ../fish/guestfish-actions.pod:1898
21464 msgid "inspect-get-roots"
21468 #: ../fish/guestfish-actions.pod:1900
21471 " inspect-get-roots\n"
21476 #: ../fish/guestfish-actions.pod:1902
21478 "This function is a convenient way to get the list of root devices, as "
21479 "returned from a previous call to L</inspect-os>, but without redoing the "
21480 "whole inspection process."
21484 #: ../fish/guestfish-actions.pod:1906
21486 "This returns an empty list if either no root devices were found or the "
21487 "caller has not called L</inspect-os>."
21491 #: ../fish/guestfish-actions.pod:1911
21492 msgid "inspect-get-type"
21496 #: ../fish/guestfish-actions.pod:1913
21499 " inspect-get-type root\n"
21504 #: ../fish/guestfish-actions.pod:1946
21505 msgid "inspect-get-windows-systemroot"
21509 #: ../fish/guestfish-actions.pod:1948
21512 " inspect-get-windows-systemroot root\n"
21517 #: ../fish/guestfish-actions.pod:1962
21518 msgid "inspect-list-applications"
21522 #: ../fish/guestfish-actions.pod:1964
21525 " inspect-list-applications root\n"
21530 #: ../fish/guestfish-actions.pod:1971
21532 "I<Note:> This call works differently from other parts of the inspection "
21533 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21534 "then mount up the disks, before calling this. Listing applications is a "
21535 "significantly more difficult operation which requires access to the full "
21536 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21537 "are just returning data cached in the libguestfs handle, this call actually "
21538 "reads parts of the mounted filesystems during the call."
21542 #: ../fish/guestfish-actions.pod:2061
21547 #: ../fish/guestfish-actions.pod:2063
21555 #: ../fish/guestfish-actions.pod:2078
21557 "You can pass the root string(s) returned to other L</inspect-get-*> "
21558 "functions in order to query further information about each operating system, "
21559 "such as the name and version."
21563 #: ../fish/guestfish-actions.pod:2083
21565 "This function uses other libguestfs features such as L</mount-ro> and L</"
21566 "umount-all> in order to mount and unmount filesystems and look at the "
21567 "contents. This should be called with no disks currently mounted. The "
21568 "function may also use Augeas, so any existing Augeas handle will be closed."
21572 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2251
21573 #: ../fish/guestfish-actions.pod:2297
21574 msgid "See also L</list-filesystems>."
21578 #: ../fish/guestfish-actions.pod:2097
21579 msgid "is-blockdev"
21583 #: ../fish/guestfish-actions.pod:2099
21586 " is-blockdev path\n"
21591 #: ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2122
21592 #: ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2150
21593 #: ../fish/guestfish-actions.pod:2160 ../fish/guestfish-actions.pod:2194
21594 #: ../fish/guestfish-actions.pod:2203
21595 msgid "See also L</stat>."
21599 #: ../fish/guestfish-actions.pod:2106
21604 #: ../fish/guestfish-actions.pod:2108
21612 #: ../fish/guestfish-actions.pod:2115
21617 #: ../fish/guestfish-actions.pod:2117
21620 " is-chardev path\n"
21625 #: ../fish/guestfish-actions.pod:2124
21630 #: ../fish/guestfish-actions.pod:2126
21638 #: ../fish/guestfish-actions.pod:2133
21643 #: ../fish/guestfish-actions.pod:2135
21651 #: ../fish/guestfish-actions.pod:2143
21656 #: ../fish/guestfish-actions.pod:2145
21664 #: ../fish/guestfish-actions.pod:2152
21669 #: ../fish/guestfish-actions.pod:2154
21677 #: ../fish/guestfish-actions.pod:2162
21678 msgid "is-launching"
21682 #: ../fish/guestfish-actions.pod:2164
21690 #: ../fish/guestfish-actions.pod:2171
21695 #: ../fish/guestfish-actions.pod:2173
21703 #: ../fish/guestfish-actions.pod:2178
21708 #: ../fish/guestfish-actions.pod:2180
21716 #: ../fish/guestfish-actions.pod:2187
21721 #: ../fish/guestfish-actions.pod:2189
21724 " is-socket path\n"
21729 #: ../fish/guestfish-actions.pod:2196
21734 #: ../fish/guestfish-actions.pod:2198
21737 " is-symlink path\n"
21742 #: ../fish/guestfish-actions.pod:2205
21743 msgid "kill-subprocess"
21747 #: ../fish/guestfish-actions.pod:2207
21750 " kill-subprocess\n"
21755 #: ../fish/guestfish-actions.pod:2211
21760 #: ../fish/guestfish-actions.pod:2213
21765 #: ../fish/guestfish-actions.pod:2215
21773 #: ../fish/guestfish-actions.pod:2223
21778 #: ../fish/guestfish-actions.pod:2225
21781 " lchown owner group path\n"
21786 #: ../fish/guestfish-actions.pod:2227
21788 "Change the file owner to C<owner> and group to C<group>. This is like L</"
21789 "chown> but if C<path> is a symlink then the link itself is changed, not the "
21794 #: ../fish/guestfish-actions.pod:2235
21799 #: ../fish/guestfish-actions.pod:2237
21802 " lgetxattrs path\n"
21807 #: ../fish/guestfish-actions.pod:2239
21809 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21810 "it returns the extended attributes of the link itself."
21814 #: ../fish/guestfish-actions.pod:2243
21815 msgid "list-devices"
21819 #: ../fish/guestfish-actions.pod:2245
21827 #: ../fish/guestfish-actions.pod:2253
21828 msgid "list-filesystems"
21832 #: ../fish/guestfish-actions.pod:2255
21835 " list-filesystems\n"
21840 #: ../fish/guestfish-actions.pod:2274
21842 "This command runs other libguestfs commands, which might include L</mount> "
21843 "and L</umount>, and therefore you should use this soon after launch and only "
21844 "when nothing is mounted."
21848 #: ../fish/guestfish-actions.pod:2278
21850 "Not all of the filesystems returned will be mountable. In particular, swap "
21851 "partitions are returned in the list. Also this command does not check that "
21852 "each filesystem found is valid and mountable, and some filesystems might be "
21853 "mountable but require special options. Filesystems may not all belong to a "
21854 "single logical operating system (use L</inspect-os> to look for OSes)."
21858 #: ../fish/guestfish-actions.pod:2286
21859 msgid "list-partitions"
21863 #: ../fish/guestfish-actions.pod:2288
21866 " list-partitions\n"
21871 #: ../fish/guestfish-actions.pod:2294
21873 "This does not return logical volumes. For that you will need to call L</"
21878 #: ../fish/guestfish-actions.pod:2299
21883 #: ../fish/guestfish-actions.pod:2301
21891 #: ../fish/guestfish-actions.pod:2309
21896 #: ../fish/guestfish-actions.pod:2311
21899 " ln target linkname\n"
21904 #: ../fish/guestfish-actions.pod:2315
21909 #: ../fish/guestfish-actions.pod:2317
21912 " ln-f target linkname\n"
21917 #: ../fish/guestfish-actions.pod:2322
21922 #: ../fish/guestfish-actions.pod:2324
21925 " ln-s target linkname\n"
21930 #: ../fish/guestfish-actions.pod:2328
21935 #: ../fish/guestfish-actions.pod:2330
21938 " ln-sf target linkname\n"
21943 #: ../fish/guestfish-actions.pod:2335
21944 msgid "lremovexattr"
21948 #: ../fish/guestfish-actions.pod:2337
21951 " lremovexattr xattr path\n"
21956 #: ../fish/guestfish-actions.pod:2339
21958 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21959 "it removes an extended attribute of the link itself."
21963 #: ../fish/guestfish-actions.pod:2343
21968 #: ../fish/guestfish-actions.pod:2345
21976 #: ../fish/guestfish-actions.pod:2351
21978 "This command is mostly useful for interactive sessions. Programs should "
21979 "probably use L</readdir> instead."
21983 #: ../fish/guestfish-actions.pod:2354
21988 #: ../fish/guestfish-actions.pod:2356
21991 " lsetxattr xattr val vallen path\n"
21996 #: ../fish/guestfish-actions.pod:2358
21998 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
21999 "sets an extended attribute of the link itself."
22003 #: ../fish/guestfish-actions.pod:2362
22008 #: ../fish/guestfish-actions.pod:2364
22016 #: ../fish/guestfish-actions.pod:2368
22018 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
22019 "the link is stat-ed, not the file it refers to."
22023 #: ../fish/guestfish-actions.pod:2374
22028 #: ../fish/guestfish-actions.pod:2376
22031 " lstatlist path 'names ...'\n"
22036 #: ../fish/guestfish-actions.pod:2378
22038 "This call allows you to perform the L</lstat> operation on multiple files, "
22039 "where all files are in the directory C<path>. C<names> is the list of files "
22040 "from this directory."
22044 #: ../fish/guestfish-actions.pod:2387
22046 "This call is intended for programs that want to efficiently list a directory "
22047 "contents without making many round-trips. See also L</lxattrlist> for a "
22048 "similarly efficient call for getting extended attributes. Very long "
22049 "directory listings might cause the protocol message size to be exceeded, "
22050 "causing this call to fail. The caller must split up such requests into "
22051 "smaller groups of names."
22055 #: ../fish/guestfish-actions.pod:2395
22056 msgid "luks-add-key"
22060 #: ../fish/guestfish-actions.pod:2397
22063 " luks-add-key device keyslot\n"
22068 #: ../fish/guestfish-actions.pod:2404
22070 "Note that if C<keyslot> already contains a key, then this command will "
22071 "fail. You have to use L</luks-kill-slot> first to remove that key."
22075 #: ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2430
22076 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2457
22077 #: ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2490
22079 "This command has one or more key or passphrase parameters. Guestfish will "
22080 "prompt for these separately."
22084 #: ../fish/guestfish-actions.pod:2411
22089 #: ../fish/guestfish-actions.pod:2413
22092 " luks-close device\n"
22097 #: ../fish/guestfish-actions.pod:2415
22099 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
22100 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
22101 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
22106 #: ../fish/guestfish-actions.pod:2421
22107 msgid "luks-format"
22111 #: ../fish/guestfish-actions.pod:2423
22114 " luks-format device keyslot\n"
22119 #: ../fish/guestfish-actions.pod:2436
22120 msgid "luks-format-cipher"
22124 #: ../fish/guestfish-actions.pod:2438
22127 " luks-format-cipher device keyslot cipher\n"
22132 #: ../fish/guestfish-actions.pod:2440
22134 "This command is the same as L</luks-format> but it also allows you to set "
22135 "the C<cipher> used."
22139 #: ../fish/guestfish-actions.pod:2449
22140 msgid "luks-kill-slot"
22144 #: ../fish/guestfish-actions.pod:2451
22147 " luks-kill-slot device keyslot\n"
22152 #: ../fish/guestfish-actions.pod:2460
22157 #: ../fish/guestfish-actions.pod:2462
22160 " luks-open device mapname\n"
22165 #: ../fish/guestfish-actions.pod:2476
22167 "If this block device contains LVM volume groups, then calling L</vgscan> "
22168 "followed by L</vg-activate-all> will make them visible."
22172 #: ../fish/guestfish-actions.pod:2483
22173 msgid "luks-open-ro"
22177 #: ../fish/guestfish-actions.pod:2485
22180 " luks-open-ro device mapname\n"
22185 #: ../fish/guestfish-actions.pod:2487
22187 "This is the same as L</luks-open> except that a read-only mapping is created."
22191 #: ../fish/guestfish-actions.pod:2493
22196 #: ../fish/guestfish-actions.pod:2495
22199 " lvcreate logvol volgroup mbytes\n"
22204 #: ../fish/guestfish-actions.pod:2500
22205 msgid "lvm-canonical-lv-name"
22209 #: ../fish/guestfish-actions.pod:2502
22212 " lvm-canonical-lv-name lvname\n"
22217 #: ../fish/guestfish-actions.pod:2511
22218 msgid "See also L</is-lv>."
22222 #: ../fish/guestfish-actions.pod:2513
22223 msgid "lvm-clear-filter"
22227 #: ../fish/guestfish-actions.pod:2515
22230 " lvm-clear-filter\n"
22235 #: ../fish/guestfish-actions.pod:2517
22237 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22242 #: ../fish/guestfish-actions.pod:2523
22243 msgid "lvm-remove-all"
22247 #: ../fish/guestfish-actions.pod:2525
22250 " lvm-remove-all\n"
22255 #: ../fish/guestfish-actions.pod:2533
22256 msgid "lvm-set-filter"
22260 #: ../fish/guestfish-actions.pod:2535
22263 " lvm-set-filter 'devices ...'\n"
22268 #: ../fish/guestfish-actions.pod:2560
22273 #: ../fish/guestfish-actions.pod:2562
22276 " lvremove device\n"
22281 #: ../fish/guestfish-actions.pod:2570
22286 #: ../fish/guestfish-actions.pod:2572
22289 " lvrename logvol newlogvol\n"
22294 #: ../fish/guestfish-actions.pod:2576
22299 #: ../fish/guestfish-actions.pod:2578
22302 " lvresize device mbytes\n"
22307 #: ../fish/guestfish-actions.pod:2584
22308 msgid "lvresize-free"
22312 #: ../fish/guestfish-actions.pod:2586
22315 " lvresize-free lv percent\n"
22320 #: ../fish/guestfish-actions.pod:2594
22325 #: ../fish/guestfish-actions.pod:2596
22333 #: ../fish/guestfish-actions.pod:2604
22334 msgid "See also L</lvs-full>, L</list-filesystems>."
22338 #: ../fish/guestfish-actions.pod:2606
22343 #: ../fish/guestfish-actions.pod:2608
22351 #: ../fish/guestfish-actions.pod:2613
22356 #: ../fish/guestfish-actions.pod:2615
22364 #: ../fish/guestfish-actions.pod:2619
22369 #: ../fish/guestfish-actions.pod:2621
22372 " lxattrlist path 'names ...'\n"
22377 #: ../fish/guestfish-actions.pod:2637
22379 "This call is intended for programs that want to efficiently list a directory "
22380 "contents without making many round-trips. See also L</lstatlist> for a "
22381 "similarly efficient call for getting standard stats. Very long directory "
22382 "listings might cause the protocol message size to be exceeded, causing this "
22383 "call to fail. The caller must split up such requests into smaller groups of "
22388 #: ../fish/guestfish-actions.pod:2645
22393 #: ../fish/guestfish-actions.pod:2647
22401 #: ../fish/guestfish-actions.pod:2651
22406 #: ../fish/guestfish-actions.pod:2653
22409 " mkdir-mode path mode\n"
22414 #: ../fish/guestfish-actions.pod:2662
22415 msgid "See also L</mkdir>, L</umask>"
22419 #: ../fish/guestfish-actions.pod:2664
22424 #: ../fish/guestfish-actions.pod:2666
22432 #: ../fish/guestfish-actions.pod:2671
22437 #: ../fish/guestfish-actions.pod:2673
22440 " mkdtemp template\n"
22445 #: ../fish/guestfish-actions.pod:2694
22450 #: ../fish/guestfish-actions.pod:2696
22453 " mke2fs-J fstype blocksize device journal\n"
22458 #: ../fish/guestfish-actions.pod:2704
22459 msgid "See also L</mke2journal>."
22463 #: ../fish/guestfish-actions.pod:2706
22468 #: ../fish/guestfish-actions.pod:2708
22471 " mke2fs-JL fstype blocksize device label\n"
22476 #: ../fish/guestfish-actions.pod:2713
22477 msgid "See also L</mke2journal-L>."
22481 #: ../fish/guestfish-actions.pod:2715
22486 #: ../fish/guestfish-actions.pod:2717
22489 " mke2fs-JU fstype blocksize device uuid\n"
22494 #: ../fish/guestfish-actions.pod:2722
22495 msgid "See also L</mke2journal-U>."
22499 #: ../fish/guestfish-actions.pod:2724
22500 msgid "mke2journal"
22504 #: ../fish/guestfish-actions.pod:2726
22507 " mke2journal blocksize device\n"
22512 #: ../fish/guestfish-actions.pod:2733
22513 msgid "mke2journal-L"
22517 #: ../fish/guestfish-actions.pod:2735
22520 " mke2journal-L blocksize label device\n"
22525 #: ../fish/guestfish-actions.pod:2739
22526 msgid "mke2journal-U"
22530 #: ../fish/guestfish-actions.pod:2741
22533 " mke2journal-U blocksize uuid device\n"
22538 #: ../fish/guestfish-actions.pod:2745
22543 #: ../fish/guestfish-actions.pod:2747
22546 " mkfifo mode path\n"
22551 #: ../fish/guestfish-actions.pod:2749
22553 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22554 "is just a convenient wrapper around L</mknod>."
22558 #: ../fish/guestfish-actions.pod:2755
22563 #: ../fish/guestfish-actions.pod:2757
22566 " mkfs fstype device\n"
22571 #: ../fish/guestfish-actions.pod:2763
22576 #: ../fish/guestfish-actions.pod:2765
22579 " mkfs-b fstype blocksize device\n"
22584 #: ../fish/guestfish-actions.pod:2767
22586 "This call is similar to L</mkfs>, but it allows you to control the block "
22587 "size of the resulting filesystem. Supported block sizes depend on the "
22588 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22592 #: ../fish/guestfish-actions.pod:2782
22597 #: ../fish/guestfish-actions.pod:2784
22600 " mkfs-opts fstype device [blocksize:..]\n"
22605 #: ../fish/guestfish-actions.pod:2806
22606 msgid "mkmountpoint"
22610 #: ../fish/guestfish-actions.pod:2808
22613 " mkmountpoint exemptpath\n"
22618 #: ../fish/guestfish-actions.pod:2810
22620 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22621 "to create extra mountpoints before mounting the first filesystem."
22625 #: ../fish/guestfish-actions.pod:2834
22627 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22628 "unexpected errors if you try to mix these calls. It is safest to manually "
22629 "unmount filesystems and remove mountpoints after use."
22633 #: ../fish/guestfish-actions.pod:2838
22635 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22636 "for this to work for manual mountpoints, you must ensure that the innermost "
22637 "mountpoints have the longest pathnames, as in the example code above."
22641 #: ../fish/guestfish-actions.pod:2845
22643 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22644 "that L</umount-all> is called when the handle is closed which can also "
22645 "trigger these issues."
22649 #: ../fish/guestfish-actions.pod:2849
22654 #: ../fish/guestfish-actions.pod:2851
22657 " mknod mode devmajor devminor path\n"
22662 #: ../fish/guestfish-actions.pod:2861
22664 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22665 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22666 "regular file). These constants are available in the standard Linux header "
22667 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22668 "wrappers around this command which bitwise OR in the appropriate constant "
22673 #: ../fish/guestfish-actions.pod:2871
22678 #: ../fish/guestfish-actions.pod:2873
22681 " mknod-b mode devmajor devminor path\n"
22686 #: ../fish/guestfish-actions.pod:2875
22688 "This call creates a block device node called C<path> with mode C<mode> and "
22689 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22690 "wrapper around L</mknod>."
22694 #: ../fish/guestfish-actions.pod:2881
22699 #: ../fish/guestfish-actions.pod:2883
22702 " mknod-c mode devmajor devminor path\n"
22707 #: ../fish/guestfish-actions.pod:2885
22709 "This call creates a char device node called C<path> with mode C<mode> and "
22710 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22711 "wrapper around L</mknod>."
22715 #: ../fish/guestfish-actions.pod:2891
22720 #: ../fish/guestfish-actions.pod:2893
22728 #: ../fish/guestfish-actions.pod:2897
22733 #: ../fish/guestfish-actions.pod:2899
22736 " mkswap-L label device\n"
22741 #: ../fish/guestfish-actions.pod:2907
22746 #: ../fish/guestfish-actions.pod:2909
22749 " mkswap-U uuid device\n"
22754 #: ../fish/guestfish-actions.pod:2913
22755 msgid "mkswap-file"
22759 #: ../fish/guestfish-actions.pod:2915
22762 " mkswap-file path\n"
22767 #: ../fish/guestfish-actions.pod:2919
22769 "This command just writes a swap file signature to an existing file. To "
22770 "create the file itself, use something like L</fallocate>."
22774 #: ../fish/guestfish-actions.pod:2922
22779 #: ../fish/guestfish-actions.pod:2924
22782 " modprobe modulename\n"
22787 #: ../fish/guestfish-actions.pod:2931
22792 #: ../fish/guestfish-actions.pod:2933
22795 " mount device mountpoint\n"
22800 #: ../fish/guestfish-actions.pod:2949
22802 "B<Important note:> When you use this call, the filesystem options C<sync> "
22803 "and C<noatime> are set implicitly. This was originally done because we "
22804 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22805 "very large negative performance impact and negligible effect on "
22806 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22807 "code that needs performance, and instead use L</mount-options> (use an empty "
22808 "string for the first parameter if you don't want any options)."
22812 #: ../fish/guestfish-actions.pod:2959
22817 #: ../fish/guestfish-actions.pod:2961
22820 " mount-loop file mountpoint\n"
22825 #: ../fish/guestfish-actions.pod:2967
22826 msgid "mount-options"
22830 #: ../fish/guestfish-actions.pod:2969
22833 " mount-options options device mountpoint\n"
22838 #: ../fish/guestfish-actions.pod:2971
22840 "This is the same as the L</mount> command, but it allows you to set the "
22841 "mount options as for the L<mount(8)> I<-o> flag."
22845 #: ../fish/guestfish-actions.pod:2979
22850 #: ../fish/guestfish-actions.pod:2981
22853 " mount-ro device mountpoint\n"
22858 #: ../fish/guestfish-actions.pod:2983
22860 "This is the same as the L</mount> command, but it mounts the filesystem with "
22861 "the read-only (I<-o ro>) flag."
22865 #: ../fish/guestfish-actions.pod:2986
22870 #: ../fish/guestfish-actions.pod:2988
22873 " mount-vfs options vfstype device mountpoint\n"
22878 #: ../fish/guestfish-actions.pod:2990
22880 "This is the same as the L</mount> command, but it allows you to set both the "
22881 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22885 #: ../fish/guestfish-actions.pod:2994
22886 msgid "mountpoints"
22890 #: ../fish/guestfish-actions.pod:2996
22898 #: ../fish/guestfish-actions.pod:2998
22900 "This call is similar to L</mounts>. That call returns a list of devices. "
22901 "This one returns a hash table (map) of device name to directory where the "
22902 "device is mounted."
22906 #: ../fish/guestfish-actions.pod:3002
22911 #: ../fish/guestfish-actions.pod:3004
22919 #: ../fish/guestfish-actions.pod:3011
22920 msgid "See also: L</mountpoints>"
22924 #: ../fish/guestfish-actions.pod:3013
22929 #: ../fish/guestfish-actions.pod:3015
22937 #: ../fish/guestfish-actions.pod:3020
22938 msgid "ntfs-3g-probe"
22942 #: ../fish/guestfish-actions.pod:3022
22945 " ntfs-3g-probe true|false device\n"
22950 #: ../fish/guestfish-actions.pod:3036
22955 #: ../fish/guestfish-actions.pod:3038
22958 " ntfsresize device\n"
22963 #: ../fish/guestfish-actions.pod:3044
22964 msgid "ntfsresize-size"
22968 #: ../fish/guestfish-actions.pod:3046
22971 " ntfsresize-size device size\n"
22976 #: ../fish/guestfish-actions.pod:3048
22978 "This command is the same as L</ntfsresize> except that it allows you to "
22979 "specify the new size (in bytes) explicitly."
22983 #: ../fish/guestfish-actions.pod:3051
22988 #: ../fish/guestfish-actions.pod:3053
22991 " part-add device prlogex startsect endsect\n"
22996 #: ../fish/guestfish-actions.pod:3055
22998 "This command adds a partition to C<device>. If there is no partition table "
22999 "on the device, call L</part-init> first."
23003 #: ../fish/guestfish-actions.pod:3067
23005 "Creating a partition which covers the whole disk is not so easy. Use L</"
23006 "part-disk> to do that."
23010 #: ../fish/guestfish-actions.pod:3070
23015 #: ../fish/guestfish-actions.pod:3072
23018 " part-del device partnum\n"
23023 #: ../fish/guestfish-actions.pod:3080
23028 #: ../fish/guestfish-actions.pod:3082
23031 " part-disk device parttype\n"
23036 #: ../fish/guestfish-actions.pod:3084
23038 "This command is simply a combination of L</part-init> followed by L</part-"
23039 "add> to create a single primary partition covering the whole disk."
23043 #: ../fish/guestfish-actions.pod:3088
23045 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
23046 "possible values are described in L</part-init>."
23050 #: ../fish/guestfish-actions.pod:3094
23051 msgid "part-get-bootable"
23055 #: ../fish/guestfish-actions.pod:3096
23058 " part-get-bootable device partnum\n"
23063 #: ../fish/guestfish-actions.pod:3101
23064 msgid "See also L</part-set-bootable>."
23068 #: ../fish/guestfish-actions.pod:3103
23069 msgid "part-get-mbr-id"
23073 #: ../fish/guestfish-actions.pod:3105
23076 " part-get-mbr-id device partnum\n"
23081 #: ../fish/guestfish-actions.pod:3110 ../fish/guestfish-actions.pod:3248
23083 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
23084 "undefined results for other partition table types (see L</part-get-"
23089 #: ../fish/guestfish-actions.pod:3114
23090 msgid "part-get-parttype"
23094 #: ../fish/guestfish-actions.pod:3116
23097 " part-get-parttype device\n"
23102 #: ../fish/guestfish-actions.pod:3121
23104 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
23105 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
23106 "possible, although unusual. See L</part-init> for a full list."
23110 #: ../fish/guestfish-actions.pod:3126
23115 #: ../fish/guestfish-actions.pod:3128
23118 " part-init device parttype\n"
23123 #: ../fish/guestfish-actions.pod:3134
23125 "Initially there are no partitions. Following this, you should call L</part-"
23126 "add> for each partition required."
23130 #: ../fish/guestfish-actions.pod:3197
23135 #: ../fish/guestfish-actions.pod:3199
23138 " part-list device\n"
23143 #: ../fish/guestfish-actions.pod:3214
23145 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23146 "the device's sector size, see L</blockdev-getss>."
23150 #: ../fish/guestfish-actions.pod:3227
23151 msgid "part-set-bootable"
23155 #: ../fish/guestfish-actions.pod:3229
23158 " part-set-bootable device partnum true|false\n"
23163 #: ../fish/guestfish-actions.pod:3238
23164 msgid "part-set-mbr-id"
23168 #: ../fish/guestfish-actions.pod:3240
23171 " part-set-mbr-id device partnum idbyte\n"
23176 #: ../fish/guestfish-actions.pod:3252
23177 msgid "part-set-name"
23181 #: ../fish/guestfish-actions.pod:3254
23184 " part-set-name device partnum name\n"
23189 #: ../fish/guestfish-actions.pod:3262
23190 msgid "part-to-dev"
23194 #: ../fish/guestfish-actions.pod:3264
23197 " part-to-dev partition\n"
23202 #: ../fish/guestfish-actions.pod:3270
23204 "The named partition must exist, for example as a string returned from L</"
23205 "list-partitions>."
23209 #: ../fish/guestfish-actions.pod:3273
23210 msgid "ping-daemon"
23214 #: ../fish/guestfish-actions.pod:3275
23222 #: ../fish/guestfish-actions.pod:3282
23227 #: ../fish/guestfish-actions.pod:3284
23230 " pread path count offset\n"
23235 #: ../fish/guestfish-actions.pod:3292
23236 msgid "See also L</pwrite>, L</pread-device>."
23240 #: ../fish/guestfish-actions.pod:3297
23241 msgid "pread-device"
23245 #: ../fish/guestfish-actions.pod:3299
23248 " pread-device device count offset\n"
23253 #: ../fish/guestfish-actions.pod:3307
23254 msgid "See also L</pread>."
23258 #: ../fish/guestfish-actions.pod:3312
23263 #: ../fish/guestfish-actions.pod:3314
23266 " pvcreate device\n"
23271 #: ../fish/guestfish-actions.pod:3320
23276 #: ../fish/guestfish-actions.pod:3322
23279 " pvremove device\n"
23284 #: ../fish/guestfish-actions.pod:3331
23289 #: ../fish/guestfish-actions.pod:3333
23292 " pvresize device\n"
23297 #: ../fish/guestfish-actions.pod:3338
23298 msgid "pvresize-size"
23302 #: ../fish/guestfish-actions.pod:3340
23305 " pvresize-size device size\n"
23310 #: ../fish/guestfish-actions.pod:3342
23312 "This command is the same as L</pvresize> except that it allows you to "
23313 "specify the new size (in bytes) explicitly."
23317 #: ../fish/guestfish-actions.pod:3345
23322 #: ../fish/guestfish-actions.pod:3347
23330 #: ../fish/guestfish-actions.pod:3355
23331 msgid "See also L</pvs-full>."
23335 #: ../fish/guestfish-actions.pod:3357
23340 #: ../fish/guestfish-actions.pod:3359
23348 #: ../fish/guestfish-actions.pod:3364
23353 #: ../fish/guestfish-actions.pod:3366
23361 #: ../fish/guestfish-actions.pod:3370
23366 #: ../fish/guestfish-actions.pod:3372
23369 " pwrite path content offset\n"
23374 #: ../fish/guestfish-actions.pod:3383
23375 msgid "See also L</pread>, L</pwrite-device>."
23379 #: ../fish/guestfish-actions.pod:3388
23380 msgid "pwrite-device"
23384 #: ../fish/guestfish-actions.pod:3390
23387 " pwrite-device device content offset\n"
23392 #: ../fish/guestfish-actions.pod:3400
23393 msgid "See also L</pwrite>."
23397 #: ../fish/guestfish-actions.pod:3405
23402 #: ../fish/guestfish-actions.pod:3407
23405 " read-file path\n"
23410 #: ../fish/guestfish-actions.pod:3412
23412 "Unlike L</cat>, this function can correctly handle files that contain "
23413 "embedded ASCII NUL characters. However unlike L</download>, this function "
23414 "is limited in the total size of file that can be handled."
23418 #: ../fish/guestfish-actions.pod:3420
23423 #: ../fish/guestfish-actions.pod:3422
23426 " read-lines path\n"
23431 #: ../fish/guestfish-actions.pod:3429
23433 "Note that this function cannot correctly handle binary files (specifically, "
23434 "files containing C<\\0> character which is treated as end of line). For "
23435 "those you need to use the L</read-file> function which has a more complex "
23440 #: ../fish/guestfish-actions.pod:3434
23445 #: ../fish/guestfish-actions.pod:3436
23453 #: ../fish/guestfish-actions.pod:3488
23455 "This function is primarily intended for use by programs. To get a simple "
23456 "list of names, use L</ls>. To get a printable directory for human "
23457 "consumption, use L</ll>."
23461 #: ../fish/guestfish-actions.pod:3492
23466 #: ../fish/guestfish-actions.pod:3494
23474 #: ../fish/guestfish-actions.pod:3498
23475 msgid "readlinklist"
23479 #: ../fish/guestfish-actions.pod:3500
23482 " readlinklist path 'names ...'\n"
23487 #: ../fish/guestfish-actions.pod:3524
23492 #: ../fish/guestfish-actions.pod:3526
23500 #: ../fish/guestfish-actions.pod:3531
23501 msgid "removexattr"
23505 #: ../fish/guestfish-actions.pod:3533
23508 " removexattr xattr path\n"
23513 #: ../fish/guestfish-actions.pod:3538
23514 msgid "See also: L</lremovexattr>, L<attr(5)>."
23518 #: ../fish/guestfish-actions.pod:3540
23523 #: ../fish/guestfish-actions.pod:3542
23526 " resize2fs device\n"
23531 #: ../fish/guestfish-actions.pod:3547
23533 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23534 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23535 "gives an error about this and sometimes not. In any case, it is always safe "
23536 "to call L</e2fsck-f> before calling this function."
23540 #: ../fish/guestfish-actions.pod:3553
23541 msgid "resize2fs-size"
23545 #: ../fish/guestfish-actions.pod:3555
23548 " resize2fs-size device size\n"
23553 #: ../fish/guestfish-actions.pod:3557
23555 "This command is the same as L</resize2fs> except that it allows you to "
23556 "specify the new size (in bytes) explicitly."
23560 #: ../fish/guestfish-actions.pod:3560
23565 #: ../fish/guestfish-actions.pod:3562
23573 #: ../fish/guestfish-actions.pod:3566
23578 #: ../fish/guestfish-actions.pod:3568
23586 #: ../fish/guestfish-actions.pod:3574
23591 #: ../fish/guestfish-actions.pod:3576
23599 #: ../fish/guestfish-actions.pod:3580
23600 msgid "rmmountpoint"
23604 #: ../fish/guestfish-actions.pod:3582
23607 " rmmountpoint exemptpath\n"
23612 #: ../fish/guestfish-actions.pod:3584
23614 "This calls removes a mountpoint that was previously created with L</"
23615 "mkmountpoint>. See L</mkmountpoint> for full details."
23619 #: ../fish/guestfish-actions.pod:3588
23620 msgid "scrub-device"
23624 #: ../fish/guestfish-actions.pod:3590
23627 " scrub-device device\n"
23632 #: ../fish/guestfish-actions.pod:3601
23637 #: ../fish/guestfish-actions.pod:3603
23640 " scrub-file file\n"
23645 #: ../fish/guestfish-actions.pod:3613
23646 msgid "scrub-freespace"
23650 #: ../fish/guestfish-actions.pod:3615
23653 " scrub-freespace dir\n"
23658 #: ../fish/guestfish-actions.pod:3617
23660 "This command creates the directory C<dir> and then fills it with files until "
23661 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23662 "deletes them. The intention is to scrub any free space on the partition "
23663 "containing C<dir>."
23667 #: ../fish/guestfish-actions.pod:3626
23672 #: ../fish/guestfish-actions.pod:3628
23677 #: ../fish/guestfish-actions.pod:3630
23680 " set-append append\n"
23685 #: ../fish/guestfish-actions.pod:3641
23686 msgid "set-autosync"
23690 #: ../fish/guestfish-actions.pod:3643
23695 #: ../fish/guestfish-actions.pod:3645
23698 " set-autosync true|false\n"
23703 #: ../fish/guestfish-actions.pod:3647
23705 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23706 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23707 "closed (also if the program exits without closing handles)."
23711 #: ../fish/guestfish-actions.pod:3655
23716 #: ../fish/guestfish-actions.pod:3657
23721 #: ../fish/guestfish-actions.pod:3659
23724 " set-direct true|false\n"
23729 #: ../fish/guestfish-actions.pod:3665
23731 "One consequence of this is that log messages aren't caught by the library "
23732 "and handled by L</set-log-message-callback>, but go straight to stdout."
23736 #: ../fish/guestfish-actions.pod:3674
23737 msgid "set-e2label"
23741 #: ../fish/guestfish-actions.pod:3676
23744 " set-e2label device label\n"
23749 #: ../fish/guestfish-actions.pod:3682
23751 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23752 "label on a filesystem."
23756 #: ../fish/guestfish-actions.pod:3685
23761 #: ../fish/guestfish-actions.pod:3687
23764 " set-e2uuid device uuid\n"
23769 #: ../fish/guestfish-actions.pod:3694
23771 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23772 "UUID of a filesystem."
23776 #: ../fish/guestfish-actions.pod:3697
23777 msgid "set-memsize"
23781 #: ../fish/guestfish-actions.pod:3699
23786 #: ../fish/guestfish-actions.pod:3701
23789 " set-memsize memsize\n"
23794 #: ../fish/guestfish-actions.pod:3703
23796 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23797 "This only has any effect if called before L</launch>."
23801 #: ../fish/guestfish-actions.pod:3714
23802 msgid "set-network"
23806 #: ../fish/guestfish-actions.pod:3716
23811 #: ../fish/guestfish-actions.pod:3718
23814 " set-network true|false\n"
23819 #: ../fish/guestfish-actions.pod:3726
23821 "You must call this before calling L</launch>, otherwise it has no effect."
23825 #: ../fish/guestfish-actions.pod:3729
23830 #: ../fish/guestfish-actions.pod:3731
23835 #: ../fish/guestfish-actions.pod:3733
23838 " set-path searchpath\n"
23843 #: ../fish/guestfish-actions.pod:3742
23848 #: ../fish/guestfish-actions.pod:3744
23853 #: ../fish/guestfish-actions.pod:3746
23861 #: ../fish/guestfish-actions.pod:3766
23862 msgid "set-recovery-proc"
23866 #: ../fish/guestfish-actions.pod:3768
23867 msgid "recovery-proc"
23871 #: ../fish/guestfish-actions.pod:3770
23874 " set-recovery-proc true|false\n"
23879 #: ../fish/guestfish-actions.pod:3772
23881 "If this is called with the parameter C<false> then L</launch> does not "
23882 "create a recovery process. The purpose of the recovery process is to stop "
23883 "runaway qemu processes in the case where the main program aborts abruptly."
23887 #: ../fish/guestfish-actions.pod:3777
23889 "This only has any effect if called before L</launch>, and the default is "
23894 #: ../fish/guestfish-actions.pod:3786
23895 msgid "set-selinux"
23899 #: ../fish/guestfish-actions.pod:3788
23904 #: ../fish/guestfish-actions.pod:3790
23907 " set-selinux true|false\n"
23912 #: ../fish/guestfish-actions.pod:3801
23917 #: ../fish/guestfish-actions.pod:3803
23922 #: ../fish/guestfish-actions.pod:3805
23925 " set-trace true|false\n"
23930 #: ../fish/guestfish-actions.pod:3821
23931 msgid "set-verbose"
23935 #: ../fish/guestfish-actions.pod:3823
23940 #: ../fish/guestfish-actions.pod:3825
23943 " set-verbose true|false\n"
23948 #: ../fish/guestfish-actions.pod:3832
23953 #: ../fish/guestfish-actions.pod:3834
23956 " setcon context\n"
23961 #: ../fish/guestfish-actions.pod:3841
23966 #: ../fish/guestfish-actions.pod:3843
23969 " setxattr xattr val vallen path\n"
23974 #: ../fish/guestfish-actions.pod:3849
23975 msgid "See also: L</lsetxattr>, L<attr(5)>."
23979 #: ../fish/guestfish-actions.pod:3851
23984 #: ../fish/guestfish-actions.pod:3853
23987 " sfdisk device cyls heads sectors 'lines ...'\n"
23992 #: ../fish/guestfish-actions.pod:3875
23993 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23997 #: ../fish/guestfish-actions.pod:3881
24002 #: ../fish/guestfish-actions.pod:3883
24005 " sfdiskM device 'lines ...'\n"
24010 #: ../fish/guestfish-actions.pod:3885
24012 "This is a simplified interface to the L</sfdisk> command, where partition "
24013 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
24014 "you don't need to specify the cyls, heads and sectors parameters which were "
24015 "rarely if ever used anyway."
24019 #: ../fish/guestfish-actions.pod:3891
24020 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
24024 #: ../fish/guestfish-actions.pod:3897
24029 #: ../fish/guestfish-actions.pod:3899
24032 " sfdisk-N device partnum cyls heads sectors line\n"
24037 #: ../fish/guestfish-actions.pod:3904
24039 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
24040 "cyls/heads/sectors parameters."
24044 #: ../fish/guestfish-actions.pod:3907
24045 msgid "See also: L</part-add>"
24049 #: ../fish/guestfish-actions.pod:3912
24050 msgid "sfdisk-disk-geometry"
24054 #: ../fish/guestfish-actions.pod:3914
24057 " sfdisk-disk-geometry device\n"
24062 #: ../fish/guestfish-actions.pod:3916
24064 "This displays the disk geometry of C<device> read from the partition table. "
24065 "Especially in the case where the underlying block device has been resized, "
24066 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
24067 "kernel-geometry>)."
24071 #: ../fish/guestfish-actions.pod:3924
24072 msgid "sfdisk-kernel-geometry"
24076 #: ../fish/guestfish-actions.pod:3926
24079 " sfdisk-kernel-geometry device\n"
24084 #: ../fish/guestfish-actions.pod:3933
24089 #: ../fish/guestfish-actions.pod:3935
24092 " sfdisk-l device\n"
24097 #: ../fish/guestfish-actions.pod:3941
24098 msgid "See also: L</part-list>"
24102 #: ../fish/guestfish-actions.pod:3943
24107 #: ../fish/guestfish-actions.pod:3945
24115 #: ../fish/guestfish-actions.pod:3950
24116 msgid "This is like L</command>, but passes the command to:"
24120 #: ../fish/guestfish-actions.pod:3958
24121 msgid "All the provisos about L</command> apply to this call."
24125 #: ../fish/guestfish-actions.pod:3960
24130 #: ../fish/guestfish-actions.pod:3962
24133 " sh-lines command\n"
24138 #: ../fish/guestfish-actions.pod:3964
24139 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24143 #: ../fish/guestfish-actions.pod:3967
24144 msgid "See also: L</command-lines>"
24148 #: ../fish/guestfish-actions.pod:3969
24153 #: ../fish/guestfish-actions.pod:3971
24161 #: ../fish/guestfish-actions.pod:3975
24166 #: ../fish/guestfish-actions.pod:3977
24174 #: ../fish/guestfish-actions.pod:3983
24179 #: ../fish/guestfish-actions.pod:3985
24187 #: ../fish/guestfish-actions.pod:3993
24192 #: ../fish/guestfish-actions.pod:3995
24200 #: ../fish/guestfish-actions.pod:4003
24205 #: ../fish/guestfish-actions.pod:4005
24208 " strings-e encoding path\n"
24213 #: ../fish/guestfish-actions.pod:4007
24215 "This is like the L</strings> command, but allows you to specify the encoding "
24216 "of strings that are looked for in the source file C<path>."
24220 #: ../fish/guestfish-actions.pod:4017
24222 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24223 "ISO-8859-X (this is what L</strings> uses)."
24227 #: ../fish/guestfish-actions.pod:4049
24228 msgid "swapoff-device"
24232 #: ../fish/guestfish-actions.pod:4051
24235 " swapoff-device device\n"
24240 #: ../fish/guestfish-actions.pod:4053
24242 "This command disables the libguestfs appliance swap device or partition "
24243 "named C<device>. See L</swapon-device>."
24247 #: ../fish/guestfish-actions.pod:4057
24248 msgid "swapoff-file"
24252 #: ../fish/guestfish-actions.pod:4059
24255 " swapoff-file file\n"
24260 #: ../fish/guestfish-actions.pod:4063
24261 msgid "swapoff-label"
24265 #: ../fish/guestfish-actions.pod:4065
24268 " swapoff-label label\n"
24273 #: ../fish/guestfish-actions.pod:4070
24274 msgid "swapoff-uuid"
24278 #: ../fish/guestfish-actions.pod:4072
24281 " swapoff-uuid uuid\n"
24286 #: ../fish/guestfish-actions.pod:4077
24287 msgid "swapon-device"
24291 #: ../fish/guestfish-actions.pod:4079
24294 " swapon-device device\n"
24299 #: ../fish/guestfish-actions.pod:4081
24301 "This command enables the libguestfs appliance to use the swap device or "
24302 "partition named C<device>. The increased memory is made available for all "
24303 "commands, for example those run using L</command> or L</sh>."
24307 #: ../fish/guestfish-actions.pod:4093
24308 msgid "swapon-file"
24312 #: ../fish/guestfish-actions.pod:4095
24315 " swapon-file file\n"
24320 #: ../fish/guestfish-actions.pod:4097
24322 "This command enables swap to a file. See L</swapon-device> for other notes."
24326 #: ../fish/guestfish-actions.pod:4100
24327 msgid "swapon-label"
24331 #: ../fish/guestfish-actions.pod:4102
24334 " swapon-label label\n"
24339 #: ../fish/guestfish-actions.pod:4104
24341 "This command enables swap to a labeled swap partition. See L</swapon-"
24342 "device> for other notes."
24346 #: ../fish/guestfish-actions.pod:4107
24347 msgid "swapon-uuid"
24351 #: ../fish/guestfish-actions.pod:4109
24354 " swapon-uuid uuid\n"
24359 #: ../fish/guestfish-actions.pod:4111
24361 "This command enables swap to a swap partition with the given UUID. See L</"
24362 "swapon-device> for other notes."
24366 #: ../fish/guestfish-actions.pod:4114
24371 #: ../fish/guestfish-actions.pod:4116
24379 #: ../fish/guestfish-actions.pod:4124
24384 #: ../fish/guestfish-actions.pod:4126
24392 #: ../fish/guestfish-actions.pod:4134
24397 #: ../fish/guestfish-actions.pod:4136
24400 " tail-n nrlines path\n"
24405 #: ../fish/guestfish-actions.pod:4149
24410 #: ../fish/guestfish-actions.pod:4151
24413 " tar-in (tarfile|-) directory\n"
24418 #: ../fish/guestfish-actions.pod:4156
24419 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24423 #: ../fish/guestfish-actions.pod:4161
24428 #: ../fish/guestfish-actions.pod:4163
24431 " tar-out directory (tarfile|-)\n"
24436 #: ../fish/guestfish-actions.pod:4168
24437 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24441 #: ../fish/guestfish-actions.pod:4173
24446 #: ../fish/guestfish-actions.pod:4175
24449 " tgz-in (tarball|-) directory\n"
24454 #: ../fish/guestfish-actions.pod:4180
24455 msgid "To upload an uncompressed tarball, use L</tar-in>."
24459 #: ../fish/guestfish-actions.pod:4184
24464 #: ../fish/guestfish-actions.pod:4186
24467 " tgz-out directory (tarball|-)\n"
24472 #: ../fish/guestfish-actions.pod:4191
24473 msgid "To download an uncompressed tarball, use L</tar-out>."
24477 #: ../fish/guestfish-actions.pod:4195
24482 #: ../fish/guestfish-actions.pod:4197
24490 #: ../fish/guestfish-actions.pod:4206
24495 #: ../fish/guestfish-actions.pod:4208
24503 #: ../fish/guestfish-actions.pod:4213
24504 msgid "truncate-size"
24508 #: ../fish/guestfish-actions.pod:4215
24511 " truncate-size path size\n"
24516 #: ../fish/guestfish-actions.pod:4220
24518 "If the current file size is less than C<size> then the file is extended to "
24519 "the required size with zero bytes. This creates a sparse file (ie. disk "
24520 "blocks are not allocated for the file until you write to it). To create a "
24521 "non-sparse file of zeroes, use L</fallocate64> instead."
24525 #: ../fish/guestfish-actions.pod:4226
24530 #: ../fish/guestfish-actions.pod:4228
24533 " tune2fs-l device\n"
24538 #: ../fish/guestfish-actions.pod:4238
24543 #: ../fish/guestfish-actions.pod:4240
24546 " txz-in (tarball|-) directory\n"
24551 #: ../fish/guestfish-actions.pod:4247
24556 #: ../fish/guestfish-actions.pod:4249
24559 " txz-out directory (tarball|-)\n"
24564 #: ../fish/guestfish-actions.pod:4256
24569 #: ../fish/guestfish-actions.pod:4258
24577 #: ../fish/guestfish-actions.pod:4272
24578 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24582 #: ../fish/guestfish-actions.pod:4277
24587 #: ../fish/guestfish-actions.pod:4279
24592 #: ../fish/guestfish-actions.pod:4281
24595 " umount pathordevice\n"
24600 #: ../fish/guestfish-actions.pod:4287
24605 #: ../fish/guestfish-actions.pod:4289
24606 msgid "unmount-all"
24610 #: ../fish/guestfish-actions.pod:4291
24618 #: ../fish/guestfish-actions.pod:4297
24623 #: ../fish/guestfish-actions.pod:4299
24626 " upload (filename|-) remotefilename\n"
24631 #: ../fish/guestfish-actions.pod:4306
24632 msgid "See also L</download>."
24636 #: ../fish/guestfish-actions.pod:4310
24637 msgid "upload-offset"
24641 #: ../fish/guestfish-actions.pod:4312
24644 " upload-offset (filename|-) remotefilename offset\n"
24649 #: ../fish/guestfish-actions.pod:4324
24651 "Note that there is no limit on the amount of data that can be uploaded with "
24652 "this call, unlike with L</pwrite>, and this call always writes the full "
24653 "amount unless an error occurs."
24657 #: ../fish/guestfish-actions.pod:4329
24658 msgid "See also L</upload>, L</pwrite>."
24662 #: ../fish/guestfish-actions.pod:4333
24667 #: ../fish/guestfish-actions.pod:4335
24670 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24675 #: ../fish/guestfish-actions.pod:4354
24680 #: ../fish/guestfish-actions.pod:4356
24688 #: ../fish/guestfish-actions.pod:4383
24690 "I<Note:> Don't use this call to test for availability of features. In "
24691 "enterprise distributions we backport features from later versions into "
24692 "earlier versions, making this an unreliable way to test for features. Use "
24693 "L</available> instead."
24697 #: ../fish/guestfish-actions.pod:4389
24702 #: ../fish/guestfish-actions.pod:4391
24705 " vfs-label device\n"
24710 #: ../fish/guestfish-actions.pod:4398
24711 msgid "To find a filesystem from the label, use L</findfs-label>."
24715 #: ../fish/guestfish-actions.pod:4400
24720 #: ../fish/guestfish-actions.pod:4402
24723 " vfs-type device\n"
24728 #: ../fish/guestfish-actions.pod:4412
24733 #: ../fish/guestfish-actions.pod:4414
24736 " vfs-uuid device\n"
24741 #: ../fish/guestfish-actions.pod:4421
24742 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24746 #: ../fish/guestfish-actions.pod:4423
24747 msgid "vg-activate"
24751 #: ../fish/guestfish-actions.pod:4425
24754 " vg-activate true|false 'volgroups ...'\n"
24759 #: ../fish/guestfish-actions.pod:4438
24760 msgid "vg-activate-all"
24764 #: ../fish/guestfish-actions.pod:4440
24767 " vg-activate-all true|false\n"
24772 #: ../fish/guestfish-actions.pod:4450
24777 #: ../fish/guestfish-actions.pod:4452
24780 " vgcreate volgroup 'physvols ...'\n"
24785 #: ../fish/guestfish-actions.pod:4457
24790 #: ../fish/guestfish-actions.pod:4459
24793 " vglvuuids vgname\n"
24798 #: ../fish/guestfish-actions.pod:4464
24800 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24801 "logical volumes and volume groups."
24805 #: ../fish/guestfish-actions.pod:4467
24806 msgid "See also L</vgpvuuids>."
24810 #: ../fish/guestfish-actions.pod:4469
24815 #: ../fish/guestfish-actions.pod:4471
24818 " vgpvuuids vgname\n"
24823 #: ../fish/guestfish-actions.pod:4476
24825 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24826 "physical volumes and volume groups."
24830 #: ../fish/guestfish-actions.pod:4479
24831 msgid "See also L</vglvuuids>."
24835 #: ../fish/guestfish-actions.pod:4481
24840 #: ../fish/guestfish-actions.pod:4483
24843 " vgremove vgname\n"
24848 #: ../fish/guestfish-actions.pod:4490
24853 #: ../fish/guestfish-actions.pod:4492
24856 " vgrename volgroup newvolgroup\n"
24861 #: ../fish/guestfish-actions.pod:4496
24866 #: ../fish/guestfish-actions.pod:4498
24874 #: ../fish/guestfish-actions.pod:4506
24875 msgid "See also L</vgs-full>."
24879 #: ../fish/guestfish-actions.pod:4508
24884 #: ../fish/guestfish-actions.pod:4510
24892 #: ../fish/guestfish-actions.pod:4515
24897 #: ../fish/guestfish-actions.pod:4517
24905 #: ../fish/guestfish-actions.pod:4522
24910 #: ../fish/guestfish-actions.pod:4524
24918 #: ../fish/guestfish-actions.pod:4528
24923 #: ../fish/guestfish-actions.pod:4530
24931 #: ../fish/guestfish-actions.pod:4535
24936 #: ../fish/guestfish-actions.pod:4537
24944 #: ../fish/guestfish-actions.pod:4542
24949 #: ../fish/guestfish-actions.pod:4544
24957 #: ../fish/guestfish-actions.pod:4549
24962 #: ../fish/guestfish-actions.pod:4551
24965 " write path content\n"
24970 #: ../fish/guestfish-actions.pod:4559
24975 #: ../fish/guestfish-actions.pod:4561
24978 " write-file path content size\n"
24983 #: ../fish/guestfish-actions.pod:4584
24988 #: ../fish/guestfish-actions.pod:4586
24991 " zegrep regex path\n"
24996 #: ../fish/guestfish-actions.pod:4594
25001 #: ../fish/guestfish-actions.pod:4596
25004 " zegrepi regex path\n"
25009 #: ../fish/guestfish-actions.pod:4604
25014 #: ../fish/guestfish-actions.pod:4606
25022 #: ../fish/guestfish-actions.pod:4614
25023 msgid "See also: L</zero-device>, L</scrub-device>."
25027 #: ../fish/guestfish-actions.pod:4616
25028 msgid "zero-device"
25032 #: ../fish/guestfish-actions.pod:4618
25035 " zero-device device\n"
25040 #: ../fish/guestfish-actions.pod:4620
25042 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
25043 "which just zeroes the first few blocks of a device."
25047 #: ../fish/guestfish-actions.pod:4627
25052 #: ../fish/guestfish-actions.pod:4629
25055 " zerofree device\n"
25060 #: ../fish/guestfish-actions.pod:4642
25065 #: ../fish/guestfish-actions.pod:4644
25068 " zfgrep pattern path\n"
25073 #: ../fish/guestfish-actions.pod:4652
25078 #: ../fish/guestfish-actions.pod:4654
25081 " zfgrepi pattern path\n"
25086 #: ../fish/guestfish-actions.pod:4662
25091 #: ../fish/guestfish-actions.pod:4664
25094 " zfile meth path\n"
25099 #: ../fish/guestfish-actions.pod:4671
25101 "Since 1.0.63, use L</file> instead which can now process compressed files."
25105 #: ../fish/guestfish-actions.pod:4681
25110 #: ../fish/guestfish-actions.pod:4683
25113 " zgrep regex path\n"
25118 #: ../fish/guestfish-actions.pod:4691
25123 #: ../fish/guestfish-actions.pod:4693
25126 " zgrepi regex path\n"
25131 #: ../fish/guestfish-commands.pod:1
25136 #: ../fish/guestfish-commands.pod:3
25141 #: ../fish/guestfish-commands.pod:5
25144 " alloc filename size\n"
25149 #: ../fish/guestfish-commands.pod:7
25151 "This creates an empty (zeroed) file of the given size, and then adds so it "
25152 "can be further examined."
25156 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25157 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25161 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25162 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25166 #: ../fish/guestfish-commands.pod:14
25168 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25169 "image, see L</PREPARED DISK IMAGES>."
25173 #: ../fish/guestfish-commands.pod:17
25178 #: ../fish/guestfish-commands.pod:19
25181 " copy-in local [local ...] /remotedir\n"
25186 #: ../fish/guestfish-commands.pod:21
25188 "C<copy-in> copies local files or directories recursively into the disk "
25189 "image, placing them in the directory called C</remotedir> (which must "
25190 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25191 "other commands as necessary."
25195 #: ../fish/guestfish-commands.pod:26
25197 "Multiple local files and directories can be specified, but the last "
25198 "parameter must always be a remote directory. Wildcards cannot be used."
25202 #: ../fish/guestfish-commands.pod:30
25207 #: ../fish/guestfish-commands.pod:32
25210 " copy-out remote [remote ...] localdir\n"
25215 #: ../fish/guestfish-commands.pod:34
25217 "C<copy-out> copies remote files or directories recursively out of the disk "
25218 "image, placing them on the host disk in a local directory called C<localdir> "
25219 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25220 "download>, L</tar-out> and other commands as necessary."
25224 #: ../fish/guestfish-commands.pod:40
25226 "Multiple remote files and directories can be specified, but the last "
25227 "parameter must always be a local directory. To download to the current "
25228 "directory, use C<.> as in:"
25232 #: ../fish/guestfish-commands.pod:44
25235 " copy-out /home .\n"
25240 #: ../fish/guestfish-commands.pod:46
25242 "Wildcards cannot be used in the ordinary command, but you can use them with "
25243 "the help of L</glob> like this:"
25247 #: ../fish/guestfish-commands.pod:49
25250 " glob copy-out /home/* .\n"
25255 #: ../fish/guestfish-commands.pod:51
25260 #: ../fish/guestfish-commands.pod:53
25263 " echo [params ...]\n"
25268 #: ../fish/guestfish-commands.pod:55
25269 msgid "This echos the parameters to the terminal."
25273 #: ../fish/guestfish-commands.pod:57
25278 #: ../fish/guestfish-commands.pod:59
25283 #: ../fish/guestfish-commands.pod:61
25288 #: ../fish/guestfish-commands.pod:63
25296 #: ../fish/guestfish-commands.pod:65
25298 "This is used to edit a file. It downloads the file, edits it locally using "
25299 "your editor, then uploads the result."
25303 #: ../fish/guestfish-commands.pod:68
25305 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25306 "or C<emacs> you will get those corresponding editors."
25310 #: ../fish/guestfish-commands.pod:72
25315 #: ../fish/guestfish-commands.pod:74
25318 " glob command args...\n"
25323 #: ../fish/guestfish-commands.pod:76
25325 "Expand wildcards in any paths in the args list, and run C<command> "
25326 "repeatedly on each matching path."
25330 #: ../fish/guestfish-commands.pod:79
25331 msgid "See L</WILDCARDS AND GLOBBING>."
25335 #: ../fish/guestfish-commands.pod:81
25340 #: ../fish/guestfish-commands.pod:83
25343 " hexedit <filename|device>\n"
25344 " hexedit <filename|device> <max>\n"
25345 " hexedit <filename|device> <start> <max>\n"
25350 #: ../fish/guestfish-commands.pod:87
25352 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25357 #: ../fish/guestfish-commands.pod:90
25359 "This command works by downloading potentially the whole file or device, "
25360 "editing it locally, then uploading it. If the file or device is large, you "
25361 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25362 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25363 "usual modifiers allowed such as C<1M> (1 megabyte)."
25367 #: ../fish/guestfish-commands.pod:97
25368 msgid "For example to edit the first few sectors of a disk you might do:"
25372 #: ../fish/guestfish-commands.pod:100
25375 " hexedit /dev/sda 1M\n"
25380 #: ../fish/guestfish-commands.pod:102
25382 "which would allow you to edit anywhere within the first megabyte of the disk."
25386 #: ../fish/guestfish-commands.pod:105
25387 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25391 #: ../fish/guestfish-commands.pod:107
25394 " hexedit /dev/sda1 0x400 0x400\n"
25399 #: ../fish/guestfish-commands.pod:109
25400 msgid "(assuming the superblock is in the standard location)."
25404 #: ../fish/guestfish-commands.pod:111
25406 "This command requires the external L<hexedit(1)> program. You can specify "
25407 "another program to use by setting the C<HEXEDITOR> environment variable."
25411 #: ../fish/guestfish-commands.pod:115
25412 msgid "See also L</hexdump>."
25416 #: ../fish/guestfish-commands.pod:117
25421 #: ../fish/guestfish-commands.pod:119
25429 #: ../fish/guestfish-commands.pod:121
25431 "Change the local directory, ie. the current directory of guestfish itself."
25435 #: ../fish/guestfish-commands.pod:124
25436 msgid "Note that C<!cd> won't do what you might expect."
25440 #: ../fish/guestfish-commands.pod:126
25445 #: ../fish/guestfish-commands.pod:128
25450 #: ../fish/guestfish-commands.pod:130
25458 #: ../fish/guestfish-commands.pod:132
25459 msgid "Opens the manual page for guestfish."
25463 #: ../fish/guestfish-commands.pod:134
25468 #: ../fish/guestfish-commands.pod:136
25473 #: ../fish/guestfish-commands.pod:138
25481 #: ../fish/guestfish-commands.pod:140
25489 #: ../fish/guestfish-commands.pod:142
25490 msgid "This is used to view a file."
25494 #: ../fish/guestfish-commands.pod:144
25496 "The default viewer is C<$PAGER>. However if you use the alternate command "
25497 "C<less> you will get the C<less> command specifically."
25501 #: ../fish/guestfish-commands.pod:147
25506 #: ../fish/guestfish-commands.pod:149
25514 #: ../fish/guestfish-commands.pod:151
25516 "Close and reopen the libguestfs handle. It is not necessary to use this "
25517 "normally, because the handle is closed properly when guestfish exits. "
25518 "However this is occasionally useful for testing."
25522 #: ../fish/guestfish-commands.pod:155
25527 #: ../fish/guestfish-commands.pod:157
25530 " sparse filename size\n"
25535 #: ../fish/guestfish-commands.pod:159
25537 "This creates an empty sparse file of the given size, and then adds so it can "
25538 "be further examined."
25542 #: ../fish/guestfish-commands.pod:162
25544 "In all respects it works the same as the L</alloc> command, except that the "
25545 "image file is allocated sparsely, which means that disk blocks are not "
25546 "assigned to the file until they are needed. Sparse disk files only use "
25547 "space when written to, but they are slower and there is a danger you could "
25548 "run out of real disk space during a write operation."
25552 #: ../fish/guestfish-commands.pod:172
25557 #: ../fish/guestfish-commands.pod:174
25565 #: ../fish/guestfish-commands.pod:176
25567 "This command returns a list of the optional groups known to the daemon, and "
25568 "indicates which ones are supported by this build of the libguestfs appliance."
25572 #: ../fish/guestfish-commands.pod:180
25573 msgid "See also L<guestfs(3)/AVAILABILITY>."
25577 #: ../fish/guestfish-commands.pod:182
25582 #: ../fish/guestfish-commands.pod:184
25585 " time command args...\n"
25590 #: ../fish/guestfish-commands.pod:186
25592 "Run the command as usual, but print the elapsed time afterwards. This can "
25593 "be useful for benchmarking operations."
25597 #: ../test-tool/libguestfs-test-tool.pod:5
25598 msgid "libguestfs-test-tool - End user tests for libguestfs"
25602 #: ../test-tool/libguestfs-test-tool.pod:9
25605 " libguestfs-test-tool [--options]\n"
25610 #: ../test-tool/libguestfs-test-tool.pod:13
25612 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25613 "and developers, to allow them to check basic libguestfs functionality is "
25614 "working. This is needed because libguestfs occasionally breaks for reasons "
25615 "beyond our control: usually because of changes in the underlying qemu or "
25616 "kernel packages, or the host environment."
25620 #: ../test-tool/libguestfs-test-tool.pod:20
25621 msgid "If you suspect a problem in libguestfs, then just run:"
25625 #: ../test-tool/libguestfs-test-tool.pod:22
25628 " libguestfs-test-tool\n"
25633 #: ../test-tool/libguestfs-test-tool.pod:24
25634 msgid "It will print lots of diagnostic messages."
25638 #: ../test-tool/libguestfs-test-tool.pod:26
25639 msgid "If it runs to completion successfully, you will see this near the end:"
25643 #: ../test-tool/libguestfs-test-tool.pod:28
25646 " ===== TEST FINISHED OK =====\n"
25651 #: ../test-tool/libguestfs-test-tool.pod:30
25652 msgid "and the test tool will exit with code 0."
25656 #: ../test-tool/libguestfs-test-tool.pod:32
25658 "If it fails (and/or exits with non-zero error code), please paste the "
25659 "B<complete, unedited> output of the test tool into a bug report. More "
25660 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25665 #: ../test-tool/libguestfs-test-tool.pod:41
25670 #: ../test-tool/libguestfs-test-tool.pod:43
25671 msgid "Display short usage information and exit."
25675 #: ../test-tool/libguestfs-test-tool.pod:45
25676 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25680 #: ../test-tool/libguestfs-test-tool.pod:47
25682 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25683 "normally look in the C<$libexec> directory that was configured when the tool "
25688 #: ../test-tool/libguestfs-test-tool.pod:51
25689 msgid "I<--qemu qemu_binary>"
25693 #: ../test-tool/libguestfs-test-tool.pod:53
25695 "If you have downloaded another qemu binary, point this option at the full "
25696 "path of the binary to try it."
25700 #: ../test-tool/libguestfs-test-tool.pod:56
25701 msgid "I<--qemudir qemu_source_dir>"
25705 #: ../test-tool/libguestfs-test-tool.pod:58
25707 "If you have compiled qemu from source, point this option at the source "
25708 "directory to try it."
25712 #: ../test-tool/libguestfs-test-tool.pod:61
25713 msgid "I<--timeout N>"
25717 #: ../test-tool/libguestfs-test-tool.pod:63
25719 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25720 "does not usually need to be adjusted unless your machine is very slow."
25724 #: ../test-tool/libguestfs-test-tool.pod:69
25725 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25729 #: ../test-tool/libguestfs-test-tool.pod:71
25731 "If you have compiled another version of qemu from source and would like to "
25732 "try that, then you can use the I<--qemudir> option to point to the qemu "
25733 "source directory."
25737 #: ../test-tool/libguestfs-test-tool.pod:75
25739 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25740 "option to point to the binary."
25744 #: ../test-tool/libguestfs-test-tool.pod:78
25746 "When using an alternate qemu with libguestfs, usually you would need to "
25747 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
25748 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
25749 "use either of the I<--qemudir> or I<--qemu> options."
25753 #: ../test-tool/libguestfs-test-tool.pod:85
25755 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25756 "I<1> if there was an error."
25760 #: ../test-tool/libguestfs-test-tool.pod:92
25761 msgid "/usr/libexec/libguestfs-test-tool-helper"
25765 #: ../test-tool/libguestfs-test-tool.pod:94
25767 "This helper program is run inside the appliance and provides additional "
25772 #: ../test-tool/libguestfs-test-tool.pod:97
25773 msgid "/usr/bin/mkisofs"
25777 #: ../test-tool/libguestfs-test-tool.pod:99
25779 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25780 "which is used as part of the tests."
25784 #: ../test-tool/libguestfs-test-tool.pod:106
25786 "For the full list of environment variables which may affect libguestfs, "
25787 "please see the L<guestfs(3)> manual page."
25791 #: ../test-tool/libguestfs-test-tool.pod:111
25792 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25796 #: ../test-tool/libguestfs-test-tool.pod:121
25797 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25801 #: ../fuse/guestmount.pod:5
25803 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25807 #: ../fuse/guestmount.pod:9
25810 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25815 #: ../fuse/guestmount.pod:11
25818 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25823 #: ../fuse/guestmount.pod:13
25826 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25831 #: ../fuse/guestmount.pod:17
25833 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25834 "machines. If you do this, you risk disk corruption in the VM."
25838 #: ../fuse/guestmount.pod:22
25840 "The guestmount program can be used to mount virtual machine filesystems and "
25841 "other disk images on the host. It uses libguestfs for access to the guest "
25842 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25843 "a mountable device."
25847 #: ../fuse/guestmount.pod:27
25849 "Along with other options, you have to give at least one device (I<-a> "
25850 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25851 "option) or use the I<-i> inspection option. How this works is better "
25852 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25857 #: ../fuse/guestmount.pod:33
25859 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25860 "by you, and the filesystem will not be visible to any other users unless you "
25861 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25862 "the filesystem, use the C<fusermount -u> command."
25866 #: ../fuse/guestmount.pod:41
25868 "For a typical Windows guest which has its main filesystem on the first "
25873 #: ../fuse/guestmount.pod:44
25876 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25881 #: ../fuse/guestmount.pod:46
25883 "For a typical Linux guest which has a /boot filesystem on the first "
25884 "partition, and the root filesystem on a logical volume:"
25888 #: ../fuse/guestmount.pod:49
25891 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25896 #: ../fuse/guestmount.pod:51
25897 msgid "To get libguestfs to detect guest mountpoints for you:"
25901 #: ../fuse/guestmount.pod:53
25904 " guestmount -a guest.img -i --ro /mnt\n"
25909 #: ../fuse/guestmount.pod:55
25910 msgid "For a libvirt guest called \"Guest\" you could do:"
25914 #: ../fuse/guestmount.pod:57
25917 " guestmount -d Guest -i --ro /mnt\n"
25922 #: ../fuse/guestmount.pod:59
25924 "If you don't know what filesystems are contained in a guest or disk image, "
25925 "use L<virt-filesystems(1)> first:"
25929 #: ../fuse/guestmount.pod:62
25932 " virt-filesystems MyGuest\n"
25937 #: ../fuse/guestmount.pod:64
25939 "If you want to trace the libguestfs calls but without excessive debugging "
25940 "information, we recommend:"
25944 #: ../fuse/guestmount.pod:67
25947 " guestmount [...] --trace /mnt\n"
25952 #: ../fuse/guestmount.pod:69
25953 msgid "If you want to debug the program, we recommend:"
25957 #: ../fuse/guestmount.pod:71
25960 " guestmount [...] --trace --verbose /mnt\n"
25965 #: ../fuse/guestmount.pod:79
25966 msgid "Add a block device or virtual machine image."
25970 #: ../fuse/guestmount.pod:96
25971 msgid "B<--dir-cache-timeout N>"
25975 #: ../fuse/guestmount.pod:98
25977 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25978 "seconds. The readdir cache [actually, there are several semi-independent "
25979 "caches] is populated after a readdir(2) call with the stat and extended "
25980 "attributes of the files in the directory, in anticipation that they will be "
25981 "requested soon after."
25985 #: ../fuse/guestmount.pod:104
25987 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25988 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25989 "requests, only cache existing ones."
25993 #: ../fuse/guestmount.pod:122
25995 "If you have untrusted raw-format guest disk images, you should use this "
25996 "option to specify the disk format. This avoids a possible security problem "
25997 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
25998 "guestfs_add_drive_opts>."
26002 #: ../fuse/guestmount.pod:127
26003 msgid "B<--fuse-help>"
26007 #: ../fuse/guestmount.pod:129
26008 msgid "Display help on special FUSE options (see I<-o> below)."
26012 #: ../fuse/guestmount.pod:133
26013 msgid "Display brief help and exit."
26017 #: ../fuse/guestmount.pod:146
26018 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
26022 #: ../fuse/guestmount.pod:148
26024 "Mount the named partition or logical volume on the given mountpoint B<in the "
26025 "guest> (this has nothing to do with mountpoints in the host)."
26029 #: ../fuse/guestmount.pod:151
26031 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
26032 "something on C</>."
26036 #: ../fuse/guestmount.pod:156
26038 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
26039 "unmounted. If you specify this option, then we don't attempt to sync the "
26040 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
26044 #: ../fuse/guestmount.pod:161
26045 msgid "B<-o option> | B<--option option>"
26049 #: ../fuse/guestmount.pod:163
26050 msgid "Pass extra options to FUSE."
26054 #: ../fuse/guestmount.pod:165
26056 "To get a list of all the extra options supported by FUSE, use the command "
26057 "below. Note that only the FUSE I<-o> options can be passed, and only some "
26058 "of them are a good idea."
26062 #: ../fuse/guestmount.pod:169
26065 " guestmount --fuse-help\n"
26070 #: ../fuse/guestmount.pod:171
26071 msgid "Some potentially useful FUSE options:"
26075 #: ../fuse/guestmount.pod:175
26076 msgid "B<-o allow_other>"
26080 #: ../fuse/guestmount.pod:177
26081 msgid "Allow other users to see the filesystem."
26085 #: ../fuse/guestmount.pod:179
26086 msgid "B<-o attr_timeout=N>"
26090 #: ../fuse/guestmount.pod:181
26091 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
26095 #: ../fuse/guestmount.pod:183
26096 msgid "B<-o kernel_cache>"
26100 #: ../fuse/guestmount.pod:185
26102 "Allow the kernel to cache files (reduces the number of reads that have to go "
26103 "through the L<guestfs(3)> API). This is generally a good idea if you can "
26104 "afford the extra memory usage."
26108 #: ../fuse/guestmount.pod:189
26109 msgid "B<-o uid=N> B<-o gid=N>"
26113 #: ../fuse/guestmount.pod:191
26115 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
26116 "the chosen values."
26120 #: ../fuse/guestmount.pod:198
26122 "Add devices and mount everything read-only. Also disallow writes and make "
26123 "the disk appear read-only to FUSE."
26127 #: ../fuse/guestmount.pod:201
26129 "This is highly recommended if you are not going to edit the guest disk. If "
26130 "the guest is running and this option is I<not> supplied, then there is a "
26131 "strong risk of disk corruption in the guest. We try to prevent this from "
26132 "happening, but it is not always possible."
26136 #: ../fuse/guestmount.pod:206
26137 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26141 #: ../fuse/guestmount.pod:210
26142 msgid "Enable SELinux support for the guest."
26146 #: ../fuse/guestmount.pod:214
26147 msgid "Enable verbose messages from underlying libguestfs."
26151 #: ../fuse/guestmount.pod:218
26152 msgid "Display the program version and exit."
26156 #: ../fuse/guestmount.pod:222
26158 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26159 "FOR READ AND WRITE>."
26163 #: ../fuse/guestmount.pod:225
26164 msgid "B<-x> | B<--trace>"
26168 #: ../fuse/guestmount.pod:227
26169 msgid "Trace libguestfs calls."
26173 #: ../fuse/guestmount.pod:229
26174 msgid "This also stops the daemon from forking into the background."
26178 #: ../fuse/guestmount.pod:235
26180 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26181 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26186 #: ../tools/virt-edit.pl:34
26187 msgid "virt-edit - Edit a file in a virtual machine"
26191 #: ../tools/virt-edit.pl:38
26194 " virt-edit [--options] domname file\n"
26199 #: ../tools/virt-edit.pl:40
26202 " virt-edit [--options] disk.img [disk.img ...] file\n"
26207 #: ../tools/virt-edit.pl:42
26210 " virt-edit [domname|disk.img] file -e 'expr'\n"
26215 #: ../tools/virt-edit.pl:46
26217 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26218 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26219 "doing this, but doesn't catch all cases."
26223 #: ../tools/virt-edit.pl:52
26225 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26226 "the named virtual machine (or disk image)."
26230 #: ../tools/virt-edit.pl:55
26232 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26233 "you should look at the L<guestfish(1)> tool."
26237 #: ../tools/virt-edit.pl:60
26238 msgid "Edit the named files interactively:"
26242 #: ../tools/virt-edit.pl:62
26245 " virt-edit mydomain /boot/grub/grub.conf\n"
26250 #: ../tools/virt-edit.pl:64
26253 " virt-edit mydomain /etc/passwd\n"
26258 #: ../tools/virt-edit.pl:66
26260 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26261 "below). To change the init default level to 5:"
26265 #: ../tools/virt-edit.pl:70
26268 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26273 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181
26274 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:108
26275 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
26276 msgid "Display brief help."
26280 #: ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187
26281 #: ../tools/virt-resize.pl:270 ../tools/virt-list-filesystems.pl:69
26282 #: ../tools/virt-tar.pl:114 ../tools/virt-make-fs.pl:169
26283 #: ../tools/virt-list-partitions.pl:70
26284 msgid "B<--version>"
26288 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189
26289 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
26290 #: ../tools/virt-tar.pl:116 ../tools/virt-make-fs.pl:171
26291 #: ../tools/virt-list-partitions.pl:72
26292 msgid "Display version number and exit."
26296 #: ../tools/virt-edit.pl:96
26297 msgid "B<--backup extension> | B<-b extension>"
26301 #: ../tools/virt-edit.pl:98
26303 "Create a backup of the original file I<in the guest disk image>. The backup "
26304 "has the original filename with C<extension> added."
26308 #: ../tools/virt-edit.pl:101
26310 "Usually the first character of C<extension> would be a dot C<.> so you would "
26315 #: ../tools/virt-edit.pl:104
26318 " virt-edit -b .orig [etc]\n"
26323 #: ../tools/virt-edit.pl:106
26324 msgid "By default, no backup file is made."
26328 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203
26329 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:122
26330 #: ../tools/virt-list-partitions.pl:78
26331 msgid "B<--connect URI> | B<-c URI>"
26335 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205
26336 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:124
26337 #: ../tools/virt-list-partitions.pl:80
26339 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26340 "to the default libvirt hypervisor."
26344 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
26345 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:127
26346 #: ../tools/virt-list-partitions.pl:83
26348 "If you specify guest block devices directly, then libvirt is not used at all."
26352 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215
26353 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
26354 #: ../tools/virt-tar.pl:134 ../tools/virt-list-partitions.pl:90
26355 msgid "B<--format> raw"
26359 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217
26360 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:136
26361 #: ../tools/virt-list-partitions.pl:92
26363 "Specify the format of disk images given on the command line. If this is "
26364 "omitted then the format is autodetected from the content of the disk image."
26368 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221
26369 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:140
26370 #: ../tools/virt-list-partitions.pl:96
26372 "If disk images are requested from libvirt, then this program asks libvirt "
26373 "for this information. In this case, the value of the format parameter is "
26378 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225
26379 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
26380 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:144
26381 #: ../tools/virt-list-partitions.pl:100
26383 "If working with untrusted raw-format guest disk images, you should ensure "
26384 "the format is always specified."
26388 #: ../tools/virt-edit.pl:141
26389 msgid "B<--expr EXPR> | B<-e EXPR>"
26393 #: ../tools/virt-edit.pl:143
26395 "Instead of launching the external editor, non-interactively apply the Perl "
26396 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26401 #: ../tools/virt-edit.pl:147
26403 "Be careful to properly quote the expression to prevent it from being altered "
26408 #: ../tools/virt-edit.pl:268
26409 msgid "NON-INTERACTIVE EDITING"
26413 #: ../tools/virt-edit.pl:270
26415 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26416 "administrator can interactively edit the file."
26420 #: ../tools/virt-edit.pl:273
26422 "There are two ways also to use C<virt-edit> from scripts in order to make "
26423 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26424 "like this, it's less error-prone to write scripts directly using the "
26425 "libguestfs API and Augeas for configuration file editing.)"
26429 #: ../tools/virt-edit.pl:279
26431 "The first method is to temporarily set C<$EDITOR> to any script or program "
26432 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26433 "update C<tmpfile> in place however it likes."
26437 #: ../tools/virt-edit.pl:283
26439 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26440 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26441 "instances of C<foo> with C<bar> in a file:"
26445 #: ../tools/virt-edit.pl:287
26448 " virt-edit domname filename -e 's/foo/bar/'\n"
26453 #: ../tools/virt-edit.pl:289
26455 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26456 "For example to delete root's password you could do:"
26460 #: ../tools/virt-edit.pl:292
26463 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26468 #: ../tools/virt-edit.pl:294
26470 "What really happens is that the snippet is evaluated as a Perl expression "
26471 "for each line of the file. The line, including the final C<\\n>, is passed "
26472 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26476 #: ../tools/virt-edit.pl:299
26478 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26479 "C<apache> user account from the password file you can do:"
26483 #: ../tools/virt-edit.pl:302
26486 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26491 #: ../tools/virt-edit.pl:304
26493 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26494 "the end of the file is rather difficult this way since there is no concept "
26495 "of \"last line of the file\" - your expression just doesn't get called "
26496 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26501 #: ../tools/virt-edit.pl:310
26503 "The variable C<$lineno> contains the current line number. As is "
26504 "traditional, the first line in the file is number C<1>."
26508 #: ../tools/virt-edit.pl:313
26510 "The return value from the expression is ignored, but the expression may call "
26511 "C<die> in order to abort the whole program, leaving the original file "
26516 #: ../tools/virt-edit.pl:317
26518 "Remember when matching the end of a line that C<$_> may contain the final C<"
26519 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26520 "newline then neither of these. Thus to match or substitute some text at the "
26521 "end of a line, use this regular expression:"
26525 #: ../tools/virt-edit.pl:322
26528 " /some text(\\r?\\n)?$/\n"
26533 #: ../tools/virt-edit.pl:324
26535 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26536 "$_> itself (since that would remove all newlines from the file):"
26540 #: ../tools/virt-edit.pl:328
26543 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26548 #: ../tools/virt-edit.pl:334
26553 #: ../tools/virt-edit.pl:336
26555 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26560 #: ../tools/virt-edit.pl:339
26561 msgid "If not set, C<vi> is used."
26565 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141
26566 #: ../tools/virt-win-reg.pl:477 ../tools/virt-resize.pl:1476
26567 #: ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:274
26568 #: ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:250
26569 msgid "SHELL QUOTING"
26573 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479
26574 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
26575 #: ../tools/virt-tar.pl:276 ../tools/virt-make-fs.pl:529
26576 #: ../tools/virt-list-partitions.pl:252
26578 "Libvirt guest names can contain arbitrary characters, some of which have "
26579 "meaning to the shell such as C<#> and space. You may need to quote or "
26580 "escape these characters on the command line. See the shell manual page L<sh"
26581 "(1)> for details."
26585 #: ../tools/virt-edit.pl:352
26587 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26588 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26593 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
26594 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
26595 #: ../tools/virt-tar.pl:292 ../tools/virt-make-fs.pl:559
26596 #: ../tools/virt-list-partitions.pl:269
26601 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512
26602 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
26603 #: ../tools/virt-tar.pl:294 ../tools/virt-make-fs.pl:561
26604 #: ../tools/virt-list-partitions.pl:271
26605 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26609 #: ../tools/virt-edit.pl:368 ../tools/virt-list-partitions.pl:275
26610 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26614 #: ../tools/virt-win-reg.pl:37
26616 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26620 #: ../tools/virt-win-reg.pl:41
26623 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26628 #: ../tools/virt-win-reg.pl:43
26631 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26636 #: ../tools/virt-win-reg.pl:45
26639 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26644 #: ../tools/virt-win-reg.pl:47
26647 " virt-win-reg --merge domname [input.reg ...]\n"
26652 #: ../tools/virt-win-reg.pl:49
26655 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26660 #: ../tools/virt-win-reg.pl:53
26662 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26663 "virtual machines. If you do this, you I<will> get irreversible disk "
26664 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26665 "but doesn't catch all cases."
26669 #: ../tools/virt-win-reg.pl:58
26671 "Modifying the Windows Registry is an inherently risky operation. The format "
26672 "is deliberately obscure and undocumented, and Registry changes can leave the "
26673 "system unbootable. Therefore when using the C<--merge> option, make sure "
26674 "you have a reliable backup first."
26678 #: ../tools/virt-win-reg.pl:65
26680 "This program can export and merge Windows Registry entries from a Windows "
26685 #: ../tools/virt-win-reg.pl:68
26687 "The first parameter is the libvirt guest name or the raw disk image of a "
26692 #: ../tools/virt-win-reg.pl:71
26694 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26695 "exported (recursively). For example:"
26699 #: ../tools/virt-win-reg.pl:74
26702 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26707 #: ../tools/virt-win-reg.pl:76
26709 "You can also display single values from within registry keys, for example:"
26713 #: ../tools/virt-win-reg.pl:79
26716 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26717 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26718 " Windows 7 Enterprise\n"
26723 #: ../tools/virt-win-reg.pl:83
26725 "With C<--merge>, you can merge a textual regedit file into the Windows "
26730 #: ../tools/virt-win-reg.pl:86
26733 " $ virt-win-reg --merge Windows7 changes.reg\n"
26738 #: ../tools/virt-win-reg.pl:88
26739 msgid "SUPPORTED SYSTEMS"
26743 #: ../tools/virt-win-reg.pl:90
26745 "The program currently supports Windows NT-derived guests starting with "
26746 "Windows XP through to at least Windows 7."
26750 #: ../tools/virt-win-reg.pl:93
26752 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26753 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26754 "and C<HKEY_USERS\\.DEFAULT>."
26758 #: ../tools/virt-win-reg.pl:97
26760 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26765 #: ../tools/virt-win-reg.pl:100
26767 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26772 #: ../tools/virt-win-reg.pl:103
26777 #: ../tools/virt-win-reg.pl:105
26779 "This program is only meant for simple access to the registry. If you want "
26780 "to do complicated things with the registry, we suggest you download the "
26781 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26782 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26783 "L<hivexregedit(1)>."
26787 #: ../tools/virt-win-reg.pl:111
26792 #: ../tools/virt-win-reg.pl:113
26794 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26795 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26796 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26797 "Windows-style line endings, you may need to reencode the whole file before "
26798 "or after processing."
26802 #: ../tools/virt-win-reg.pl:119
26804 "To reencode a file from Windows format to Linux (before processing it with "
26805 "the C<--merge> option), you would do something like this:"
26809 #: ../tools/virt-win-reg.pl:122
26812 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26817 #: ../tools/virt-win-reg.pl:124
26819 "To go in the opposite direction, after exporting and before sending the file "
26820 "to a Windows user, do something like this:"
26824 #: ../tools/virt-win-reg.pl:127
26827 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26832 #: ../tools/virt-win-reg.pl:129
26833 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26837 #: ../tools/virt-win-reg.pl:131
26839 "If you are unsure about the current encoding, use the L<file(1)> command. "
26840 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26841 "style (CRLF) line endings, like this:"
26845 #: ../tools/virt-win-reg.pl:135
26848 " $ file software.reg\n"
26849 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26850 " with CRLF line terminators\n"
26855 #: ../tools/virt-win-reg.pl:139
26856 msgid "This file would need conversion before you could C<--merge> it."
26860 #: ../tools/virt-win-reg.pl:143
26862 "Be careful when passing parameters containing C<\\> (backslash) in the "
26863 "shell. Usually you will have to use 'single quotes' or double backslashes "
26864 "(but not both) to protect them from the shell."
26868 #: ../tools/virt-win-reg.pl:147
26869 msgid "Paths and value names are case-insensitive."
26873 #: ../tools/virt-win-reg.pl:149
26874 msgid "CurrentControlSet etc."
26878 #: ../tools/virt-win-reg.pl:151
26880 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26881 "Registry at the level of the hive file, and therefore you cannot modify "
26886 #: ../tools/virt-win-reg.pl:155
26888 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26889 "circumstances it might refer to another control set. The way to find out is "
26890 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26894 #: ../tools/virt-win-reg.pl:159
26897 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26898 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26899 " \"Current\"=dword:00000001\n"
26900 " \"Default\"=dword:00000001\n"
26901 " \"Failed\"=dword:00000000\n"
26902 " \"LastKnownGood\"=dword:00000002\n"
26907 #: ../tools/virt-win-reg.pl:166
26908 msgid "\"Current\" is the one which Windows will choose when it boots."
26912 #: ../tools/virt-win-reg.pl:168
26914 "Similarly, other C<Current...> keys in the path may need to be replaced."
26918 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
26923 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:498
26924 msgid "Enable debugging messages."
26928 #: ../tools/virt-win-reg.pl:232
26933 #: ../tools/virt-win-reg.pl:234
26935 "In merge mode, this merges a textual regedit file into the Windows Registry "
26936 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26937 "displays or exports Registry entries instead."
26941 #: ../tools/virt-win-reg.pl:238
26943 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26944 "result in disk corruption. However exporting (without this flag) is always "
26949 #: ../tools/virt-win-reg.pl:246
26950 msgid "B<--encoding> UTF-16LE|ASCII"
26954 #: ../tools/virt-win-reg.pl:248
26956 "When merging (only), you may need to specify the encoding for strings to be "
26957 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26958 "(3)/ENCODING STRINGS>."
26962 #: ../tools/virt-win-reg.pl:252
26964 "The default is to use UTF-16LE, which should work with recent versions of "
26969 #: ../tools/virt-win-reg.pl:486
26971 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26972 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26973 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26977 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
26979 "When reporting bugs, please enable debugging and capture the I<complete> "
26984 #: ../tools/virt-win-reg.pl:504
26987 " export LIBGUESTFS_DEBUG=1\n"
26988 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26993 #: ../tools/virt-win-reg.pl:507
26995 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
27000 #: ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1510
27001 #: ../tools/virt-make-fs.pl:565
27002 msgid "Copyright (C) 2010 Red Hat Inc."
27006 #: ../tools/virt-resize.pl:42
27007 msgid "virt-resize - Resize a virtual machine disk"
27011 #: ../tools/virt-resize.pl:46
27014 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27015 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27016 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27021 #: ../tools/virt-resize.pl:52
27023 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27024 "larger or smaller overall, and resizing or deleting any partitions contained "
27029 #: ../tools/virt-resize.pl:56
27031 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27032 "not> be used on live virtual machines - for consistent results, shut the "
27033 "virtual machine down before resizing it."
27037 #: ../tools/virt-resize.pl:60
27039 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
27040 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
27044 #: ../tools/virt-resize.pl:66
27046 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27047 "fill the extra 5GB of space."
27051 #: ../tools/virt-resize.pl:69
27054 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27055 " virt-filesystems --long --h --all -a olddisk\n"
27056 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27057 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27062 #: ../tools/virt-resize.pl:74
27064 "As above, but make the /boot partition 200MB bigger, while giving the "
27065 "remaining space to /dev/sda2:"
27069 #: ../tools/virt-resize.pl:77
27072 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27077 #: ../tools/virt-resize.pl:79
27078 msgid "As above, but the output format will be uncompressed qcow2:"
27082 #: ../tools/virt-resize.pl:81
27085 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27086 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27091 #: ../tools/virt-resize.pl:84
27092 msgid "DETAILED USAGE"
27096 #: ../tools/virt-resize.pl:86
27097 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27101 #: ../tools/virt-resize.pl:90
27102 msgid "1. Shut down the virtual machine"
27106 #: ../tools/virt-resize.pl:92
27107 msgid "2. Locate input disk image"
27111 #: ../tools/virt-resize.pl:94
27113 "Locate the input disk image (ie. the file or device on the host containing "
27114 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27115 "dumpxml> like this to find the disk image name:"
27119 #: ../tools/virt-resize.pl:98
27122 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27123 " Found 1 nodes:\n"
27125 " <source dev=\"/dev/vg/lv_guest\" />\n"
27130 #: ../tools/virt-resize.pl:103
27131 msgid "3. Look at current sizing"
27135 #: ../tools/virt-resize.pl:105
27136 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
27140 #: ../tools/virt-resize.pl:108
27143 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
27144 " Name Type Size Parent\n"
27145 " /dev/sda1 partition 101M /dev/sda\n"
27146 " /dev/sda2 partition 7.9G /dev/sda\n"
27147 " /dev/sda device 8.0G -\n"
27152 #: ../tools/virt-resize.pl:114
27154 "(This example is a virtual machine with an 8 GB disk which we would like to "
27155 "expand up to 10 GB)."
27159 #: ../tools/virt-resize.pl:117
27160 msgid "4. Create output disk"
27164 #: ../tools/virt-resize.pl:119
27166 "Virt-resize cannot do in-place disk modifications. You have to have space "
27167 "to store the resized output disk."
27171 #: ../tools/virt-resize.pl:122
27173 "To store the resized disk image in a file, create a file of a suitable size:"
27177 #: ../tools/virt-resize.pl:125
27180 " # rm -f outdisk\n"
27181 " # truncate -s 10G outdisk\n"
27186 #: ../tools/virt-resize.pl:128
27187 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27191 #: ../tools/virt-resize.pl:130
27194 " # lvcreate -L 10G -n lv_name vg_name\n"
27199 #: ../tools/virt-resize.pl:132
27200 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27204 #: ../tools/virt-resize.pl:134
27207 " # virsh pool-list\n"
27208 " # virsh vol-create-as poolname newvol 10G\n"
27213 #: ../tools/virt-resize.pl:137
27218 #: ../tools/virt-resize.pl:139
27220 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27221 "file) and the output disk. The output disk is the one created in the "
27226 #: ../tools/virt-resize.pl:143
27229 " # virt-resize indisk outdisk\n"
27234 #: ../tools/virt-resize.pl:145
27236 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27237 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27238 "larger, then an extra, empty partition is created at the end of the disk "
27239 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27244 #: ../tools/virt-resize.pl:151
27246 "More realistically you'd want to expand existing partitions in the disk "
27247 "image by passing extra options (for the full list see the L</OPTIONS> "
27252 #: ../tools/virt-resize.pl:155
27254 "L</--expand> is the most useful option. It expands the named partition "
27255 "within the disk to fill any extra space:"
27259 #: ../tools/virt-resize.pl:158
27262 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27267 #: ../tools/virt-resize.pl:160
27269 "(In this case, an extra partition is I<not> created at the end of the disk, "
27270 "because there will be no unused space)."
27274 #: ../tools/virt-resize.pl:163
27276 "L</--resize> is the other commonly used option. The following would "
27277 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27278 "rest of the available space:"
27282 #: ../tools/virt-resize.pl:167
27285 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27286 " indisk outdisk\n"
27291 #: ../tools/virt-resize.pl:170
27293 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27294 "if virt-resize knows how, it will resize the contents, the equivalent of "
27295 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27296 ">. However virt-resize does not know how to resize some filesystems, so you "
27297 "would have to online resize them after booting the guest."
27301 #: ../tools/virt-resize.pl:177
27302 msgid "Other options are covered below."
27306 #: ../tools/virt-resize.pl:179
27311 #: ../tools/virt-resize.pl:181
27312 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27316 #: ../tools/virt-resize.pl:183
27317 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27321 #: ../tools/virt-resize.pl:185
27324 " # virsh edit guestname\n"
27329 #: ../tools/virt-resize.pl:187
27331 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27332 "html#elementsDisks>"
27336 #: ../tools/virt-resize.pl:190
27337 msgid "Then start up the domain with the new, resized disk:"
27341 #: ../tools/virt-resize.pl:192
27344 " # virsh start guestname\n"
27349 #: ../tools/virt-resize.pl:194
27351 "and check that it still works. See also the L</NOTES> section below for "
27352 "additional information."
27356 #: ../tools/virt-resize.pl:197
27357 msgid "7. Resize LVs etc inside the guest"
27361 #: ../tools/virt-resize.pl:199
27362 msgid "(This can also be done offline using L<guestfish(1)>)"
27366 #: ../tools/virt-resize.pl:201
27368 "Once the guest has booted you should see the new space available, at least "
27369 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27370 "may need to resize LVs inside PVs, and also resize filesystem types that "
27371 "virt-resize does not know how to expand."
27375 #: ../tools/virt-resize.pl:208
27376 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27380 #: ../tools/virt-resize.pl:210
27382 "Shrinking is somewhat more complex than expanding, and only an overview is "
27387 #: ../tools/virt-resize.pl:213
27389 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27390 "filesystems). The user has to shrink content before passing the disk image "
27391 "to virt-resize, and virt-resize will check that the content has been shrunk "
27396 #: ../tools/virt-resize.pl:218
27397 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27401 #: ../tools/virt-resize.pl:220
27403 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27404 "steps 3 and 4 above to allocate a new disk image."
27408 #: ../tools/virt-resize.pl:223
27410 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27414 #: ../tools/virt-resize.pl:226
27415 msgid "IGNORING OR DELETING PARTITIONS"
27419 #: ../tools/virt-resize.pl:228
27421 "virt-resize also gives a convenient way to ignore or delete partitions when "
27422 "copying from the input disk to the output disk. Ignoring a partition speeds "
27423 "up the copy where you don't care about the existing contents of a "
27424 "partition. Deleting a partition removes it completely, but note that it "
27425 "also renumbers any partitions after the one which is deleted, which can "
27426 "leave some guests unbootable."
27430 #: ../tools/virt-resize.pl:235
27431 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27435 #: ../tools/virt-resize.pl:237
27437 "If the input disk is in qcow2 format, then you may prefer that the output is "
27438 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27439 "the fly. The output format is simply determined by the format of the empty "
27440 "output container that you provide. Thus to create qcow2 output, use:"
27444 #: ../tools/virt-resize.pl:243
27447 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27452 #: ../tools/virt-resize.pl:245
27453 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
27457 #: ../tools/virt-resize.pl:247
27458 msgid "Similarly, to get non-sparse raw output use:"
27462 #: ../tools/virt-resize.pl:249
27465 " fallocate -l size outdisk\n"
27470 #: ../tools/virt-resize.pl:251
27472 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
27473 "dev/zero of=outdisk bs=1M count=..>)"
27477 #: ../tools/virt-resize.pl:264
27478 msgid "Display help."
27482 #: ../tools/virt-resize.pl:278
27483 msgid "B<--resize part=size>"
27487 #: ../tools/virt-resize.pl:280
27489 "Resize the named partition (expanding or shrinking it) so that it has the "
27494 #: ../tools/virt-resize.pl:283
27496 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
27497 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
27498 "Exabytes; or as a percentage of the current size; or as a relative number or "
27499 "percentage. For example:"
27503 #: ../tools/virt-resize.pl:288
27506 " --resize /dev/sda2=10G\n"
27511 #: ../tools/virt-resize.pl:290
27514 " --resize /dev/sda4=90%\n"
27519 #: ../tools/virt-resize.pl:292
27522 " --resize /dev/sda2=+1G\n"
27527 #: ../tools/virt-resize.pl:294
27530 " --resize /dev/sda2=-200M\n"
27535 #: ../tools/virt-resize.pl:296
27538 " --resize /dev/sda1=+128K\n"
27543 #: ../tools/virt-resize.pl:298
27546 " --resize /dev/sda1=+10%\n"
27551 #: ../tools/virt-resize.pl:300
27554 " --resize /dev/sda1=-10%\n"
27559 #: ../tools/virt-resize.pl:302
27561 "You can increase the size of any partition. Virt-resize will expand the "
27562 "direct content of the partition if it knows how (see C<--expand> below)."
27566 #: ../tools/virt-resize.pl:306
27568 "You can only I<decrease> the size of partitions that contain filesystems or "
27569 "PVs which have already been shrunk. Virt-resize will check this has been "
27570 "done before proceeding, or else will print an error (see also C<--resize-"
27575 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
27576 #: ../tools/virt-resize.pl:420
27577 msgid "You can give this option multiple times."
27581 #: ../tools/virt-resize.pl:317
27582 msgid "B<--resize-force part=size>"
27586 #: ../tools/virt-resize.pl:319
27588 "This is the same as C<--resize> except that it will let you decrease the "
27589 "size of any partition. Generally this means you will lose any data which "
27590 "was at the end of the partition you shrink, but you may not care about that "
27591 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
27592 "as a swap partition)."
27596 #: ../tools/virt-resize.pl:325
27597 msgid "See also the C<--ignore> option."
27601 #: ../tools/virt-resize.pl:331
27602 msgid "B<--expand part>"
27606 #: ../tools/virt-resize.pl:333
27608 "Expand the named partition so it uses up all extra space (space left over "
27609 "after any other resize changes that you request have been done)."
27613 #: ../tools/virt-resize.pl:336
27615 "If virt-resize knows how, it will expand the direct content of the "
27616 "partition. For example, if the partition is an LVM PV, it will expand the "
27617 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
27618 "content it doesn't know about alone."
27622 #: ../tools/virt-resize.pl:341
27623 msgid "Currently virt-resize can resize:"
27627 #: ../tools/virt-resize.pl:347
27629 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
27634 #: ../tools/virt-resize.pl:352
27636 "NTFS filesystems contained directly in a partition, if libguestfs was "
27637 "compiled with support for NTFS."
27641 #: ../tools/virt-resize.pl:355
27643 "The filesystem must have been shut down consistently last time it was used. "
27644 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
27645 "consistency check, so at the first boot after resizing Windows will check "
27650 #: ../tools/virt-resize.pl:362
27652 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
27653 "inside the PV, but see the C<--LV-expand> option. The user could also "
27654 "resize LVs as desired after boot."
27658 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
27659 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
27663 #: ../tools/virt-resize.pl:374
27664 msgid "B<--shrink part>"
27668 #: ../tools/virt-resize.pl:376
27670 "Shrink the named partition until the overall disk image fits in the "
27671 "destination. The named partition B<must> contain a filesystem or PV which "
27672 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
27673 "online tools). Virt-resize will check this and give an error if it has not "
27678 #: ../tools/virt-resize.pl:382
27680 "The amount by which the overall disk must be shrunk (after carrying out all "
27681 "other operations requested by the user) is called the \"deficit\". For "
27682 "example, a straight copy (assume no other operations) from a 5GB disk image "
27683 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
27684 "would give an error unless the user specified a partition to shrink and that "
27685 "partition had more than a gigabyte of free space."
27689 #: ../tools/virt-resize.pl:396
27690 msgid "B<--ignore part>"
27694 #: ../tools/virt-resize.pl:398
27696 "Ignore the named partition. Effectively this means the partition is "
27697 "allocated on the destination disk, but the content is not copied across from "
27698 "the source disk. The content of the partition will be blank (all zero "
27703 #: ../tools/virt-resize.pl:409
27704 msgid "B<--delete part>"
27708 #: ../tools/virt-resize.pl:411
27710 "Delete the named partition. It would be more accurate to describe this as "
27711 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
27712 "the original disk image is left intact."
27716 #: ../tools/virt-resize.pl:415
27718 "Note that when you delete a partition, then anything contained in the "
27719 "partition is also deleted. Furthermore, this causes any partitions that "
27720 "come after to be I<renumbered>, which can easily make your guest unbootable."
27724 #: ../tools/virt-resize.pl:426
27725 msgid "B<--LV-expand logvol>"
27729 #: ../tools/virt-resize.pl:428
27731 "This takes the logical volume and, as a final step, expands it to fill all "
27732 "the space available in its volume group. A typical usage, assuming a Linux "
27733 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
27734 "lv_root> would be:"
27738 #: ../tools/virt-resize.pl:433
27741 " virt-resize indisk outdisk \\\n"
27742 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
27747 #: ../tools/virt-resize.pl:436
27749 "This would first expand the partition (and PV), and then expand the root "
27750 "device to fill the extra space in the PV."
27754 #: ../tools/virt-resize.pl:439
27756 "The contents of the LV are also resized if virt-resize knows how to do "
27757 "that. You can stop virt-resize from trying to expand the content by using "
27758 "the option C<--no-expand-content>."
27762 #: ../tools/virt-resize.pl:443
27763 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
27767 #: ../tools/virt-resize.pl:446
27769 "You can give this option multiple times, I<but> it doesn't make sense to do "
27770 "this unless the logical volumes you specify are all in different volume "
27775 #: ../tools/virt-resize.pl:454
27776 msgid "B<--no-copy-boot-loader>"
27780 #: ../tools/virt-resize.pl:456
27782 "By default, virt-resize copies over some sectors at the start of the disk "
27783 "(up to the beginning of the first partition). Commonly these sectors "
27784 "contain the Master Boot Record (MBR) and the boot loader, and are required "
27785 "in order for the guest to boot correctly."
27789 #: ../tools/virt-resize.pl:461
27791 "If you specify this flag, then this initial copy is not done. You may need "
27792 "to reinstall the boot loader in this case."
27796 #: ../tools/virt-resize.pl:469
27797 msgid "B<--no-extra-partition>"
27801 #: ../tools/virt-resize.pl:471
27803 "By default, virt-resize creates an extra partition if there is any extra, "
27804 "unused space after all resizing has happened. Use this option to prevent "
27805 "the extra partition from being created. If you do this then the extra space "
27806 "will be inaccessible until you run fdisk, parted, or some other partitioning "
27807 "tool in the guest."
27811 #: ../tools/virt-resize.pl:477
27813 "Note that if the surplus space is smaller than 10 MB, no extra partition "
27818 #: ../tools/virt-resize.pl:484
27819 msgid "B<--no-expand-content>"
27823 #: ../tools/virt-resize.pl:486
27825 "By default, virt-resize will try to expand the direct contents of "
27826 "partitions, if it knows how (see C<--expand> option above)."
27830 #: ../tools/virt-resize.pl:489
27832 "If you give the C<--no-expand-content> option then virt-resize will not "
27837 #: ../tools/virt-resize.pl:496
27838 msgid "B<-d> | B<--debug>"
27842 #: ../tools/virt-resize.pl:504
27843 msgid "B<-n> | B<--dryrun>"
27847 #: ../tools/virt-resize.pl:506
27848 msgid "Print a summary of what would be done, but don't do anything."
27852 #: ../tools/virt-resize.pl:512
27853 msgid "B<-q> | B<--quiet>"
27857 #: ../tools/virt-resize.pl:514
27858 msgid "Don't print the summary."
27862 #: ../tools/virt-resize.pl:522
27864 "Specify the format of the input disk image. If this flag is not given then "
27865 "it is auto-detected from the image itself."
27869 #: ../tools/virt-resize.pl:528
27871 "Note that this option I<does not> affect the output format. See L</QCOW2 "
27872 "AND NON-SPARSE RAW FORMATS>."
27876 #: ../tools/virt-resize.pl:535
27877 msgid "B<--output-format> raw"
27881 #: ../tools/virt-resize.pl:537
27883 "Specify the format of the output disk image. If this flag is not given then "
27884 "it is auto-detected from the image itself."
27888 #: ../tools/virt-resize.pl:543
27890 "Note that you still need to create the output disk with the right format. "
27891 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
27895 #: ../tools/virt-resize.pl:1419
27900 #: ../tools/virt-resize.pl:1421
27901 msgid "\"Partition 1 does not end on cylinder boundary.\""
27905 #: ../tools/virt-resize.pl:1423
27907 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
27908 "means the partitions will not be aligned to the ancient CHS geometry. "
27909 "However CHS geometry is meaningless for disks manufactured since the early "
27910 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
27911 "cylinders is not required by any modern operating system."
27915 #: ../tools/virt-resize.pl:1430
27916 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
27920 #: ../tools/virt-resize.pl:1432
27922 "In Windows Vista and later versions, Microsoft switched to using a separate "
27923 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
27924 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
27925 "the boot partition. Doing so seems to break the guest completely. However "
27926 "expanding the second partition (ie. C: drive) should work."
27930 #: ../tools/virt-resize.pl:1439
27932 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
27933 "NTFS partitions have been expanded. This is just a safety check and (unless "
27934 "it find errors) is nothing to worry about."
27938 #: ../tools/virt-resize.pl:1443
27939 msgid "GUEST BOOT STUCK AT \"GRUB\""
27943 #: ../tools/virt-resize.pl:1445
27945 "If a Linux guest does not boot after resizing, and the boot is stuck after "
27946 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
27947 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
27948 "although we think is to do with partition alignment."
27952 #: ../tools/virt-resize.pl:1450
27955 " guestfish -i -a newdisk\n"
27956 " ><fs> cat /boot/grub/device.map\n"
27957 " # check the contents of this file are sensible or\n"
27958 " # edit the file if necessary\n"
27959 " ><fs> grub-install / /dev/vda\n"
27965 #: ../tools/virt-resize.pl:1457
27967 "For more flexible guest reconfiguration, including if you need to specify "
27968 "other parameters to grub-install, use L<virt-rescue(1)>."
27972 #: ../tools/virt-resize.pl:1460
27973 msgid "ALTERNATIVE TOOLS"
27977 #: ../tools/virt-resize.pl:1462
27979 "There are several proprietary tools for resizing partitions. We won't "
27980 "mention any here."
27984 #: ../tools/virt-resize.pl:1465
27986 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
27987 "operations on disk images. They can resize and move partitions, but I don't "
27988 "think they can do anything with the contents, and they certainly don't "
27993 #: ../tools/virt-resize.pl:1470
27995 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
27996 "but at a much lower level. You will probably end up hand-calculating sector "
27997 "offsets, which is something that virt-resize was designed to avoid. If you "
27998 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28003 #: ../tools/virt-resize.pl:1485
28005 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
28006 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
28007 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
28008 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
28009 "libguestfs.org/>."
28013 #: ../tools/virt-list-filesystems.pl:32
28015 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28019 #: ../tools/virt-list-filesystems.pl:36
28022 " virt-list-filesystems [--options] domname\n"
28027 #: ../tools/virt-list-filesystems.pl:38
28030 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28035 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
28037 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
28042 #: ../tools/virt-list-filesystems.pl:45
28044 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28045 "are contained in a virtual machine or disk image."
28049 #: ../tools/virt-list-filesystems.pl:49
28051 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28052 "functionality. For more complex cases you should look at the L<guestfish(1)"
28057 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
28058 msgid "B<-l> | B<--long>"
28062 #: ../tools/virt-list-filesystems.pl:108
28064 "With this option, C<virt-list-filesystems> displays the type of each "
28065 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28069 #: ../tools/virt-list-filesystems.pl:115
28070 msgid "B<-a> | B<--all>"
28074 #: ../tools/virt-list-filesystems.pl:117
28076 "Normally we only show mountable filesystems. If this option is given then "
28077 "swap devices are shown too."
28081 #: ../tools/virt-list-filesystems.pl:191
28083 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
28084 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28085 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28089 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:298
28090 msgid "Copyright (C) 2009 Red Hat Inc."
28094 #: ../tools/virt-tar.pl:33
28095 msgid "virt-tar - Extract or upload files to a virtual machine"
28099 #: ../tools/virt-tar.pl:37
28102 " virt-tar [--options] -x domname directory tarball\n"
28107 #: ../tools/virt-tar.pl:39
28110 " virt-tar [--options] -u domname tarball directory\n"
28115 #: ../tools/virt-tar.pl:41
28118 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28123 #: ../tools/virt-tar.pl:43
28126 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28131 #: ../tools/virt-tar.pl:47
28132 msgid "Download C</home> from the VM into a local tarball:"
28136 #: ../tools/virt-tar.pl:49
28139 " virt-tar -x domname /home home.tar\n"
28144 #: ../tools/virt-tar.pl:51
28147 " virt-tar -zx domname /home home.tar.gz\n"
28152 #: ../tools/virt-tar.pl:53
28153 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28157 #: ../tools/virt-tar.pl:55
28160 " virt-tar -u domname uploadstuff.tar /tmp\n"
28165 #: ../tools/virt-tar.pl:57
28168 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28173 #: ../tools/virt-tar.pl:61
28175 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28176 "virtual machines. If you do this, you risk disk corruption in the VM. "
28177 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28181 #: ../tools/virt-tar.pl:66
28183 "You can use C<-x> (extract) on live virtual machines, but you might get "
28184 "inconsistent results or errors if there is filesystem activity inside the "
28185 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28186 "work, but the only way to guarantee consistent results is if the virtual "
28187 "machine is shut down."
28191 #: ../tools/virt-tar.pl:74
28193 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28194 "parts of a guest filesystem. There are many possibilities: making backups, "
28195 "uploading data files, snooping on guest activity, fixing or customizing "
28200 #: ../tools/virt-tar.pl:79
28202 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28203 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28204 "should look at the L<guestfish(1)> tool."
28208 #: ../tools/virt-tar.pl:83
28210 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28211 "its contents (recursively) from the virtual machine into a local tarball. "
28212 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28213 "virtual machine. You cannot use these two options together."
28217 #: ../tools/virt-tar.pl:89
28219 "In addition, you may need to use the C<-z> (gZip) option to enable "
28220 "compression. When uploading, you have to specify C<-z> if the upload file "
28221 "is compressed because virt-tar won't detect this on its own."
28225 #: ../tools/virt-tar.pl:93
28227 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28228 "example it cannot do PKZip files or bzip2 compression. If you want that "
28229 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28230 "the L<libguestfs(3)> API)."
28234 #: ../tools/virt-tar.pl:151
28235 msgid "B<-x> | B<--extract> | B<--download>"
28239 #: ../tools/virt-tar.pl:153
28240 msgid "B<-u> | B<--upload>"
28244 #: ../tools/virt-tar.pl:155
28246 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28251 #: ../tools/virt-tar.pl:158
28253 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28254 "Please read the L</WARNING> section above before using this option."
28258 #: ../tools/virt-tar.pl:162
28259 msgid "You must specify exactly one of these options."
28263 #: ../tools/virt-tar.pl:168
28264 msgid "B<-z> | B<--gzip>"
28268 #: ../tools/virt-tar.pl:170
28269 msgid "Specify that the input or output tarball is gzip-compressed."
28273 #: ../tools/virt-tar.pl:283
28275 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28276 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28281 #: ../tools/virt-make-fs.pl:37
28282 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28286 #: ../tools/virt-make-fs.pl:41
28289 " virt-make-fs [--options] input.tar output.img\n"
28294 #: ../tools/virt-make-fs.pl:43
28297 " virt-make-fs [--options] input.tar.gz output.img\n"
28302 #: ../tools/virt-make-fs.pl:45
28305 " virt-make-fs [--options] directory output.img\n"
28310 #: ../tools/virt-make-fs.pl:49
28312 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28313 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28314 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28315 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28316 "you want to attach these filesystems to existing virtual machines (eg. to "
28317 "import large amounts of read-only data to a VM)."
28321 #: ../tools/virt-make-fs.pl:57
28322 msgid "Basic usage is:"
28326 #: ../tools/virt-make-fs.pl:59
28329 " virt-make-fs input output\n"
28334 #: ../tools/virt-make-fs.pl:61
28336 "where C<input> is either a directory containing files that you want to add, "
28337 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28338 "C<output> is a disk image. The input type is detected automatically. The "
28339 "output disk image defaults to a raw ext2 image unless you specify extra "
28340 "flags (see L</OPTIONS> below)."
28344 #: ../tools/virt-make-fs.pl:67
28345 msgid "EXTRA SPACE"
28349 #: ../tools/virt-make-fs.pl:69
28351 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28352 "the files that it contains, but might have extra space. Depending on how "
28353 "you are going to use the output, you might think this extra space is wasted "
28354 "and want to minimize it, or you might want to leave space so that more files "
28355 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28356 "but you can use the C<--size> flag to leave space in the filesystem if you "
28361 #: ../tools/virt-make-fs.pl:77
28363 "An alternative way to leave extra space but not make the output image any "
28364 "bigger is to use an alternative disk image format (instead of the default "
28365 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28366 "image format (check your hypervisor supports this before using it). This "
28367 "allows you to choose a large C<--size> but the extra space won't actually be "
28368 "allocated in the image until you try to store something in it."
28372 #: ../tools/virt-make-fs.pl:85
28374 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28375 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28376 "resize to build another image from scratch."
28380 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28381 #: ../tools/virt-make-fs.pl:142
28386 #: ../tools/virt-make-fs.pl:91
28389 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28394 #: ../tools/virt-make-fs.pl:93
28395 msgid "FILESYSTEM TYPE"
28399 #: ../tools/virt-make-fs.pl:95
28401 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28402 "libguestfs supports can be used (but I<not> read-only formats like "
28403 "ISO9660). Here are some of the more common choices:"
28407 #: ../tools/virt-make-fs.pl:101
28412 #: ../tools/virt-make-fs.pl:103
28414 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
28415 "you are not going to use the filesystem in a way that requires the journal, "
28416 "then this is just wasted overhead."
28420 #: ../tools/virt-make-fs.pl:107
28421 msgid "I<ntfs> or I<vfat>"
28425 #: ../tools/virt-make-fs.pl:109
28426 msgid "Useful if exporting data to a Windows guest."
28430 #: ../tools/virt-make-fs.pl:111
28432 "I<Note for vfat>: The tar archive or local directory must only contain files "
28433 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
28434 "program running within libguestfs is unable to change the ownership of non-"
28435 "root files, since vfat itself does not support this."
28439 #: ../tools/virt-make-fs.pl:116
28444 #: ../tools/virt-make-fs.pl:118
28446 "Lower overhead than C<ext2>, but certain limitations on filename length and "
28447 "total filesystem size."
28451 #: ../tools/virt-make-fs.pl:125
28454 " virt-make-fs --type=minix input minixfs.img\n"
28459 #: ../tools/virt-make-fs.pl:127
28460 msgid "TO PARTITION OR NOT TO PARTITION"
28464 #: ../tools/virt-make-fs.pl:129
28465 msgid "Optionally virt-make-fs can add a partition table to the output disk."
28469 #: ../tools/virt-make-fs.pl:131
28471 "Adding a partition can make the disk image more compatible with certain "
28472 "virtualized operating systems which don't expect to see a filesystem "
28473 "directly located on a block device (Linux doesn't care and will happily "
28474 "handle both types)."
28478 #: ../tools/virt-make-fs.pl:136
28480 "On the other hand, if you have a partition table then the output image is no "
28481 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
28482 "directly on a partitioned disk image. (However libguestfs tools such as "
28483 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
28487 #: ../tools/virt-make-fs.pl:144
28488 msgid "Add an MBR partition:"
28492 #: ../tools/virt-make-fs.pl:146
28495 " virt-make-fs --partition -- input disk.img\n"
28500 #: ../tools/virt-make-fs.pl:148
28502 "If the output disk image could be terabyte-sized or larger, it's better to "
28503 "use an EFI/GPT-compatible partition table:"
28507 #: ../tools/virt-make-fs.pl:151
28510 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
28515 #: ../tools/virt-make-fs.pl:179
28516 msgid "Enable debugging information."
28520 #: ../tools/virt-make-fs.pl:185
28521 msgid "B<--size=E<lt>NE<gt>>"
28525 #: ../tools/virt-make-fs.pl:187
28526 msgid "B<--size=+E<lt>NE<gt>>"
28530 #: ../tools/virt-make-fs.pl:189
28531 msgid "B<-s E<lt>NE<gt>>"
28535 #: ../tools/virt-make-fs.pl:191
28536 msgid "B<-s +E<lt>NE<gt>>"
28540 #: ../tools/virt-make-fs.pl:193
28542 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
28546 #: ../tools/virt-make-fs.pl:196
28548 "If this option is I<not> given, then the output image will be just large "
28549 "enough to contain all the files, with not much wasted space."
28553 #: ../tools/virt-make-fs.pl:199
28555 "To choose a fixed size output disk, specify an absolute number followed by b/"
28556 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28557 "Petabytes or Exabytes. This must be large enough to contain all the input "
28558 "files, else you will get an error."
28562 #: ../tools/virt-make-fs.pl:204
28564 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
28565 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28566 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
28567 "the input files, and (approximately) an extra 200 MB free space."
28571 #: ../tools/virt-make-fs.pl:210
28573 "Note that virt-make-fs estimates free space, and therefore will not produce "
28574 "filesystems containing precisely the free space requested. (It is much more "
28575 "expensive and time-consuming to produce a filesystem which has precisely the "
28576 "desired free space)."
28580 #: ../tools/virt-make-fs.pl:219
28581 msgid "B<--format=E<lt>fmtE<gt>>"
28585 #: ../tools/virt-make-fs.pl:221
28586 msgid "B<-F E<lt>fmtE<gt>>"
28590 #: ../tools/virt-make-fs.pl:223
28591 msgid "Choose the output disk image format."
28595 #: ../tools/virt-make-fs.pl:225
28596 msgid "The default is C<raw> (raw disk image)."
28600 #: ../tools/virt-make-fs.pl:227
28602 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
28603 "that would really make sense here is C<qcow2>."
28607 #: ../tools/virt-make-fs.pl:234
28608 msgid "B<--type=E<lt>fsE<gt>>"
28612 #: ../tools/virt-make-fs.pl:236
28613 msgid "B<-t E<lt>fsE<gt>>"
28617 #: ../tools/virt-make-fs.pl:238
28618 msgid "Choose the output filesystem type."
28622 #: ../tools/virt-make-fs.pl:240
28623 msgid "The default is C<ext2>."
28627 #: ../tools/virt-make-fs.pl:242
28629 "Any filesystem which is supported read-write by libguestfs can be used here."
28633 #: ../tools/virt-make-fs.pl:249
28634 msgid "B<--partition>"
28638 #: ../tools/virt-make-fs.pl:251
28639 msgid "B<--partition=E<lt>parttypeE<gt>>"
28643 #: ../tools/virt-make-fs.pl:253
28645 "If specified, this flag adds an MBR partition table to the output disk image."
28649 #: ../tools/virt-make-fs.pl:256
28651 "You can change the partition table type, eg. C<--partition=gpt> for large "
28656 #: ../tools/virt-make-fs.pl:259
28658 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
28659 "might consider the next parameter to be the partition type. For example:"
28663 #: ../tools/virt-make-fs.pl:263
28666 " virt-make-fs --partition input.tar ...\n"
28671 #: ../tools/virt-make-fs.pl:265
28673 "would cause virt-make-fs to think you wanted to use a partition type of "
28674 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
28675 "dash) between options and the input file argument:"
28679 #: ../tools/virt-make-fs.pl:269
28682 " virt-make-fs --partition -- input.tar ...\n"
28687 #: ../tools/virt-make-fs.pl:536
28689 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
28690 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
28691 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28695 #: ../tools/virt-make-fs.pl:553
28698 " export LIBGUESTFS_DEBUG=1\n"
28699 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
28704 #: ../tools/virt-make-fs.pl:556
28706 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
28711 #: ../tools/virt-list-partitions.pl:32
28713 "virt-list-partitions - List partitions in a virtual machine or disk image"
28717 #: ../tools/virt-list-partitions.pl:36
28720 " virt-list-partitions [--options] domname\n"
28725 #: ../tools/virt-list-partitions.pl:38
28728 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
28733 #: ../tools/virt-list-partitions.pl:45
28735 "C<virt-list-partitions> is a command line tool to list the partitions that "
28736 "are contained in a virtual machine or disk image. It is mainly useful as a "
28737 "first step to using L<virt-resize(1)>."
28741 #: ../tools/virt-list-partitions.pl:50
28743 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
28744 "functionality. For more complex cases you should look at the L<guestfish(1)"
28749 #: ../tools/virt-list-partitions.pl:107
28750 msgid "B<-h> | B<--human-readable>"
28754 #: ../tools/virt-list-partitions.pl:109
28755 msgid "Show sizes in human-readable form (eg. \"1G\")."
28759 #: ../tools/virt-list-partitions.pl:117
28761 "With this option, C<virt-list-partitions> displays the type and size of each "
28762 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
28766 #: ../tools/virt-list-partitions.pl:124
28767 msgid "B<-t> | B<--total>"
28771 #: ../tools/virt-list-partitions.pl:126
28773 "Display the total size of each block device (as a separate row or rows)."
28777 #: ../tools/virt-list-partitions.pl:259
28779 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
28780 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
28781 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."