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-16 23:16+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:985
784 #: ../src/guestfs.pod:989 ../src/guestfs.pod:993 ../src/guestfs.pod:998
785 #: ../src/guestfs.pod:1006 ../src/guestfs.pod:1025 ../src/guestfs.pod:1033
786 #: ../src/guestfs.pod:1055 ../src/guestfs.pod:1059 ../src/guestfs.pod:1063
787 #: ../src/guestfs.pod:1067 ../src/guestfs.pod:1071 ../src/guestfs.pod:1075
788 #: ../src/guestfs.pod:1557 ../src/guestfs.pod:1562 ../src/guestfs.pod:1566
789 #: ../src/guestfs.pod:1676 ../src/guestfs.pod:1681 ../src/guestfs.pod:1685
790 #: ../src/guestfs.pod:2037 ../src/guestfs.pod:2043 ../src/guestfs.pod:2048
791 #: ../src/guestfs.pod:2054 ../src/guestfs.pod:2166 ../src/guestfs.pod:2170
792 #: ../src/guestfs.pod:2174 ../src/guestfs.pod:2178
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:427
805 #: ../fish/guestfish.pod:431 ../fish/guestfish.pod:435
806 #: ../fish/guestfish.pod:439 ../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-win-reg.pl:536 ../tools/virt-win-reg.pl:542
819 #: ../tools/virt-win-reg.pl:548 ../tools/virt-resize.pl:345
820 #: ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
825 #: ../src/guestfs.pod:364
827 "The kernel version that the command runs under will be different from what "
832 #: ../src/guestfs.pod:369
834 "If the command needs to communicate with daemons, then most likely they "
839 #: ../src/guestfs.pod:374
840 msgid "The command will be running in limited memory."
844 #: ../src/guestfs.pod:378
846 "The network may not be available unless you enable it (see L</"
847 "guestfs_set_network>)."
851 #: ../src/guestfs.pod:383
852 msgid "Only supports Linux guests (not Windows, BSD, etc)."
856 #: ../src/guestfs.pod:387
858 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
862 #: ../src/guestfs.pod:392
864 "For SELinux guests, you may need to enable SELinux and load policy first. "
865 "See L</SELINUX> in this manpage."
869 #: ../src/guestfs.pod:397
871 "I<Security:> It is not safe to run commands from untrusted, possibly "
872 "malicious guests. These commands may attempt to exploit your program by "
873 "sending unexpected output. They could also try to exploit the Linux kernel "
874 "or qemu provided by the libguestfs appliance. They could use the network "
875 "provided by the libguestfs appliance to bypass ordinary network partitions "
876 "and firewalls. They could use the elevated privileges or different SELinux "
877 "context of your program to their advantage."
881 #: ../src/guestfs.pod:406
883 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
884 "(a script which runs when the guest next boots normally), and to have this "
885 "script run the commands you want in the normal context of the running guest, "
886 "network security and so on. For information about other security issues, "
891 #: ../src/guestfs.pod:414
893 "The two main API calls to run commands are L</guestfs_command> and L</"
894 "guestfs_sh> (there are also variations)."
898 #: ../src/guestfs.pod:417
900 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
901 "shell globs, redirections, etc will work."
905 #: ../src/guestfs.pod:420
906 msgid "CONFIGURATION FILES"
910 #: ../src/guestfs.pod:422
912 "To read and write configuration files in Linux guest filesystems, we "
913 "strongly recommend using Augeas. For example, Augeas understands how to "
914 "read and write, say, a Linux shadow password file or X.org configuration "
915 "file, and so avoids you having to write that code."
919 #: ../src/guestfs.pod:427
921 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
922 "document Augeas itself here because there is excellent documentation on the "
923 "L<http://augeas.net/> website."
927 #: ../src/guestfs.pod:431
929 "If you don't want to use Augeas (you fool!) then try calling L</"
930 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
935 #: ../src/guestfs.pod:435
940 #: ../src/guestfs.pod:437
942 "We support SELinux guests. To ensure that labeling happens correctly in "
943 "SELinux guests, you need to enable SELinux and load the guest's policy:"
947 #: ../src/guestfs.pod:443 ../src/guestfs.pod:1178 ../src/guestfs.pod:1309
952 #: ../src/guestfs.pod:445
953 msgid "Before launching, do:"
957 #: ../src/guestfs.pod:447
960 " guestfs_set_selinux (g, 1);\n"
965 #: ../src/guestfs.pod:449 ../src/guestfs.pod:1182 ../src/guestfs.pod:1313
970 #: ../src/guestfs.pod:451
972 "After mounting the guest's filesystem(s), load the policy. This is best "
973 "done by running the L<load_policy(8)> command in the guest itself:"
977 #: ../src/guestfs.pod:455
980 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
985 #: ../src/guestfs.pod:457
987 "(Older versions of C<load_policy> require you to specify the name of the "
992 #: ../src/guestfs.pod:460 ../src/guestfs.pod:1319
997 #: ../src/guestfs.pod:462
999 "Optionally, set the security context for the API. The correct security "
1000 "context to use can only be known by inspecting the guest. As an example:"
1004 #: ../src/guestfs.pod:466
1007 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1012 #: ../src/guestfs.pod:470
1013 msgid "This will work for running commands and editing existing files."
1017 #: ../src/guestfs.pod:472
1019 "When new files are created, you may need to label them explicitly, for "
1020 "example by running the external command C<restorecon pathname>."
1024 #: ../src/guestfs.pod:476
1029 #: ../src/guestfs.pod:478
1031 "Certain calls are affected by the current file mode creation mask (the "
1032 "\"umask\"). In particular ones which create files or directories, such as "
1033 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1034 "either the default mode that the file is created with or modifies the mode "
1039 #: ../src/guestfs.pod:484
1041 "The default umask is C<022>, so files are created with modes such as C<0644> "
1042 "and directories with C<0755>."
1046 #: ../src/guestfs.pod:487
1048 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1049 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1050 "guestfs_chmod> after creating each file or directory."
1054 #: ../src/guestfs.pod:491
1055 msgid "For more information about umask, see L<umask(2)>."
1059 #: ../src/guestfs.pod:493 ../fish/guestfish.pod:720
1060 msgid "ENCRYPTED DISKS"
1064 #: ../src/guestfs.pod:495
1066 "Libguestfs allows you to access Linux guests which have been encrypted using "
1067 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1068 "standard. This includes nearly all whole disk encryption systems used by "
1069 "modern Linux guests."
1073 #: ../src/guestfs.pod:501
1075 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1076 "returns the string C<crypto_LUKS>)."
1080 #: ../src/guestfs.pod:504
1082 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1083 "will require the passphrase!"
1087 #: ../src/guestfs.pod:507
1089 "Opening a LUKS device creates a new device mapper device called C</dev/"
1090 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1091 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1092 "from and encrypted to the underlying block device respectively."
1096 #: ../src/guestfs.pod:513
1098 "LVM volume groups on the device can be made visible by calling L</"
1099 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1100 "(s) can now be mounted in the usual way."
1104 #: ../src/guestfs.pod:517
1106 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1107 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1108 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1109 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1110 "underlying encrypted block device)."
1114 #: ../src/guestfs.pod:524
1119 #: ../src/guestfs.pod:526
1121 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1122 "contains operating systems. (These APIs used to be in a separate Perl-only "
1123 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1124 "frequently used part of this library has been rewritten in C and moved into "
1129 #: ../src/guestfs.pod:532
1131 "Add all disks belonging to the unknown virtual machine and call L</"
1132 "guestfs_launch> in the usual way."
1136 #: ../src/guestfs.pod:535
1138 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1139 "and certain heuristics, and returns a list of operating systems that were "
1140 "found. An empty list means none were found. A single element is the root "
1141 "filesystem of the operating system. For dual- or multi-boot guests, "
1142 "multiple roots can be returned, each one corresponding to a separate "
1143 "operating system. (Multi-boot virtual machines are extremely rare in the "
1144 "world of virtualization, but since this scenario can happen, we have built "
1145 "libguestfs to deal with it.)"
1149 #: ../src/guestfs.pod:544
1151 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1152 "to get additional details about that operating system. For example, call L</"
1153 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1154 "Windows and Linux-based operating systems respectively."
1158 #: ../src/guestfs.pod:550
1160 "Un*x-like and Linux-based operating systems usually consist of several "
1161 "filesystems which are mounted at boot time (for example, a separate boot "
1162 "partition mounted on C</boot>). The inspection rules are able to detect how "
1163 "filesystems correspond to mount points. Call "
1164 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1165 "hash table like this example:"
1169 #: ../src/guestfs.pod:557
1172 " /boot => /dev/sda1\n"
1173 " / => /dev/vg_guest/lv_root\n"
1174 " /usr => /dev/vg_guest/lv_usr\n"
1179 #: ../src/guestfs.pod:561
1181 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1182 "filesystems as suggested."
1186 #: ../src/guestfs.pod:564
1188 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1189 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1193 #: ../src/guestfs.pod:568
1195 "Inspection currently only works for some common operating systems. "
1196 "Contributors are welcome to send patches for other operating systems that we "
1197 "currently cannot detect."
1201 #: ../src/guestfs.pod:572
1203 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1204 "for more details. The L</guestfs_inspect_os> function just ignores any "
1205 "encrypted devices."
1209 #: ../src/guestfs.pod:576
1211 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1212 "inspection and caches the results in the guest handle. Subsequent calls to "
1213 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1214 "read the disks. If you change the content of the guest disks, you can redo "
1215 "inspection by calling L</guestfs_inspect_os> again. (L</"
1216 "guestfs_inspect_list_applications> works a little differently from the other "
1217 "calls and does read the disks. See documentation for that function for "
1222 #: ../src/guestfs.pod:585
1223 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1227 #: ../src/guestfs.pod:587
1229 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1230 "ntfs-3g.org/> driver."
1234 #: ../src/guestfs.pod:590
1235 msgid "DRIVE LETTERS AND PATHS"
1239 #: ../src/guestfs.pod:592
1241 "DOS and Windows still use drive letters, and the filesystems are always "
1242 "treated as case insensitive by Windows itself, and therefore you might find "
1243 "a Windows configuration file referring to a path like C<c:\\windows"
1244 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1245 "might be referred to as C</WINDOWS/System32>."
1249 #: ../src/guestfs.pod:598
1251 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1252 "libguestfs to read the appropriate Windows Registry and configuration files, "
1253 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1258 #: ../src/guestfs.pod:603
1260 "Replacing backslash characters with forward slash characters is also outside "
1261 "the scope of libguestfs, but something that you can easily do."
1265 #: ../src/guestfs.pod:606
1267 "Where we can help is in resolving the case insensitivity of paths. For "
1268 "this, call L</guestfs_case_sensitive_path>."
1272 #: ../src/guestfs.pod:609
1273 msgid "ACCESSING THE WINDOWS REGISTRY"
1277 #: ../src/guestfs.pod:611
1279 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1280 "files, through the library C<hivex> which is part of the libguestfs project "
1281 "although ships as a separate tarball. You have to locate and download the "
1282 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1283 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1284 "reg(1)> for more help on this issue."
1288 #: ../src/guestfs.pod:619
1289 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1293 #: ../src/guestfs.pod:621
1295 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1296 "provide something which looks like a Linux symlink. The way it tries to do "
1297 "the rewriting is described here:"
1301 #: ../src/guestfs.pod:625
1303 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
1308 #: ../src/guestfs.pod:627
1310 "The essential problem is that ntfs-3g simply does not have enough "
1311 "information to do a correct job. NTFS links can contain drive letters and "
1312 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1313 "It is almost certainly the case that libguestfs callers should ignore what "
1314 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1318 #: ../src/guestfs.pod:634
1320 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
1321 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1322 "attribute, and read the raw reparse data from that (you can find the format "
1323 "documented in various places around the web)."
1327 #: ../src/guestfs.pod:639
1328 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1332 #: ../src/guestfs.pod:641
1334 "There are other useful extended attributes that can be read from ntfs-3g "
1335 "filesystems (using L</guestfs_getxattr>). See:"
1339 #: ../src/guestfs.pod:644
1341 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1345 #: ../src/guestfs.pod:646
1346 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1350 #: ../src/guestfs.pod:648
1352 "Although we don't want to discourage you from using the C API, we will "
1353 "mention here that the same API is also available in other languages."
1357 #: ../src/guestfs.pod:651
1359 "The API is broadly identical in all supported languages. This means that "
1360 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1361 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1362 "words, a straightforward, predictable isomorphism between each language."
1366 #: ../src/guestfs.pod:657
1368 "Error messages are automatically transformed into exceptions if the language "
1373 #: ../src/guestfs.pod:660
1375 "We don't try to \"object orientify\" parts of the API in OO languages, "
1376 "although contributors are welcome to write higher level APIs above what we "
1377 "provide in their favourite languages if they wish."
1381 #: ../src/guestfs.pod:666
1386 #: ../src/guestfs.pod:668
1388 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1389 "identical to the C API. C++ classes and exceptions are not used."
1393 #: ../src/guestfs.pod:672
1398 #: ../src/guestfs.pod:674
1400 "The C# bindings are highly experimental. Please read the warnings at the "
1401 "top of C<csharp/Libguestfs.cs>."
1405 #: ../src/guestfs.pod:677
1410 #: ../src/guestfs.pod:679
1412 "This is the only language binding that is working but incomplete. Only "
1413 "calls which return simple integers have been bound in Haskell, and we are "
1414 "looking for help to complete this binding."
1418 #: ../src/guestfs.pod:683
1423 #: ../src/guestfs.pod:685
1425 "Full documentation is contained in the Javadoc which is distributed with "
1430 #: ../src/guestfs.pod:688
1435 #: ../src/guestfs.pod:690
1436 msgid "For documentation see L<guestfs-ocaml(3)>."
1440 #: ../src/guestfs.pod:692
1445 #: ../src/guestfs.pod:694
1446 msgid "For documentation see L<Sys::Guestfs(3)>."
1450 #: ../src/guestfs.pod:696
1455 #: ../src/guestfs.pod:698
1457 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1458 "the php-libguestfs package for your distribution."
1462 #: ../src/guestfs.pod:701
1463 msgid "The PHP binding only works correctly on 64 bit machines."
1467 #: ../src/guestfs.pod:703
1472 #: ../src/guestfs.pod:705
1473 msgid "For documentation see L<guestfs-python(3)>."
1477 #: ../src/guestfs.pod:707
1482 #: ../src/guestfs.pod:709
1483 msgid "For documentation see L<guestfs-ruby(3)>."
1487 #: ../src/guestfs.pod:711
1488 msgid "B<shell scripts>"
1492 #: ../src/guestfs.pod:713
1493 msgid "For documentation see L<guestfish(1)>."
1497 #: ../src/guestfs.pod:717
1498 msgid "LIBGUESTFS GOTCHAS"
1502 #: ../src/guestfs.pod:719
1504 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1505 "system [...] that works in the way it is documented but is counterintuitive "
1506 "and almost invites mistakes.\""
1510 #: ../src/guestfs.pod:723
1512 "Since we developed libguestfs and the associated tools, there are several "
1513 "things we would have designed differently, but are now stuck with for "
1514 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1515 "release, you can expect these to change. Beware of them."
1519 #: ../src/guestfs.pod:731
1520 msgid "Autosync / forgetting to sync."
1524 #: ../src/guestfs.pod:733
1526 "When modifying a filesystem from C or another language, you B<must> unmount "
1527 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1528 "libguestfs handle. You can also call:"
1532 #: ../src/guestfs.pod:737
1535 " guestfs_set_autosync (g, 1);\n"
1540 #: ../src/guestfs.pod:739
1542 "to have the unmount/sync done automatically for you when the handle 'g' is "
1543 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1547 #: ../src/guestfs.pod:743
1549 "If you forget to do this, then it is entirely possible that your changes "
1550 "won't be written out, or will be partially written, or (very rarely) that "
1551 "you'll get disk corruption."
1555 #: ../src/guestfs.pod:747
1557 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1558 "guestfish scripts that forget to sync will work just fine, which can make "
1559 "this very puzzling if you are trying to debug a problem."
1563 #: ../src/guestfs.pod:751
1565 "Update: Autosync is enabled by default for all API users starting from "
1566 "libguestfs 1.5.24."
1570 #: ../src/guestfs.pod:754
1571 msgid "Mount option C<-o sync> should not be the default."
1575 #: ../src/guestfs.pod:756
1577 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1578 "However C<-o sync> does not add any reliability benefit, but does have a "
1579 "very large performance impact."
1583 #: ../src/guestfs.pod:760
1585 "The work around is to use L</guestfs_mount_options> and set the mount "
1586 "options that you actually want to use."
1590 #: ../src/guestfs.pod:763
1591 msgid "Read-only should be the default."
1595 #: ../src/guestfs.pod:765
1597 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1598 "specify I<--rw> if you want to make changes to the image."
1602 #: ../src/guestfs.pod:768
1603 msgid "This would reduce the potential to corrupt live VM images."
1607 #: ../src/guestfs.pod:770
1609 "Note that many filesystems change the disk when you just mount and unmount, "
1610 "even if you didn't perform any writes. You need to use L</"
1611 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1615 #: ../src/guestfs.pod:774
1616 msgid "guestfish command line is hard to use."
1620 #: ../src/guestfs.pod:776
1622 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1623 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1624 "exist, so it fails. In earlier versions of guestfish the error message was "
1625 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1626 "we should have used C<guestfish -c command> to run commands."
1630 #: ../src/guestfs.pod:783
1631 msgid "guestfish megabyte modifiers don't work right on all commands"
1635 #: ../src/guestfs.pod:785
1637 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1638 "other modifiers). What guestfish actually does is to multiply the number "
1639 "part by the modifier part and pass the result to the C API. However this "
1640 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1641 "expecting some other unit (eg. megabytes)."
1645 #: ../src/guestfs.pod:792
1646 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1650 #: ../src/guestfs.pod:794
1653 " lvcreate LV VG 100M\n"
1658 #: ../src/guestfs.pod:796
1660 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1661 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1662 "megabytes * megabytes) logical volume. The error message you get from this "
1663 "is also a little obscure."
1667 #: ../src/guestfs.pod:801
1669 "This could be fixed in the generator by specially marking parameters and "
1670 "return values which take bytes or other units."
1674 #: ../src/guestfs.pod:804
1675 msgid "Ambiguity between devices and paths"
1679 #: ../src/guestfs.pod:806
1681 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1682 "sdb2>) and a similar pathname. A file might just happen to be called "
1683 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1687 #: ../src/guestfs.pod:811
1689 "In the current API we usually resolve this ambiguity by having two separate "
1690 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1691 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1692 "detecting if the path supplied begins with C</dev/>."
1696 #: ../src/guestfs.pod:817
1698 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1699 "make paths/devices into structured names. One way to do this would be to "
1700 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1701 "aspect of grub. Another way would be to use a structured type, equivalent "
1702 "to this OCaml type:"
1706 #: ../src/guestfs.pod:823
1709 " type path = Path of string | Device of int | Partition of int * int\n"
1714 #: ../src/guestfs.pod:825
1715 msgid "which would allow you to pass arguments like:"
1719 #: ../src/guestfs.pod:827
1722 " Path \"/foo/bar\"\n"
1723 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1724 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1725 " Path \"/dev/sdb2\" (* not a device *)\n"
1730 #: ../src/guestfs.pod:832
1732 "As you can see there are still problems to resolve even with this "
1733 "representation. Also consider how it might work in guestfish."
1737 #: ../src/guestfs.pod:837
1738 msgid "PROTOCOL LIMITS"
1742 #: ../src/guestfs.pod:839
1744 "Internally libguestfs uses a message-based protocol to pass API calls and "
1745 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1746 "plenty more detail about this). The maximum message size used by the "
1747 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1748 "aware of this limit. The API calls which may be affected are individually "
1749 "documented, with a link back to this section of the documentation."
1753 #: ../src/guestfs.pod:847
1755 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1756 "a simple string. Because this string is at some point internally encoded as "
1757 "a message, the maximum size that it can return is slightly under 4 MB. If "
1758 "the requested file is larger than this then you will get an error."
1762 #: ../src/guestfs.pod:853
1764 "In order to transfer large files into and out of the guest filesystem, you "
1765 "need to use particular calls that support this. The sections L</UPLOADING> "
1766 "and L</DOWNLOADING> document how to do this."
1770 #: ../src/guestfs.pod:857
1772 "You might also consider mounting the disk image using our FUSE filesystem "
1773 "support (L<guestmount(1)>)."
1777 #: ../src/guestfs.pod:860
1778 msgid "KEYS AND PASSPHRASES"
1782 #: ../src/guestfs.pod:862
1784 "Certain libguestfs calls take a parameter that contains sensitive key "
1785 "material, passed in as a C string."
1789 #: ../src/guestfs.pod:865
1791 "In the future we would hope to change the libguestfs implementation so that "
1792 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1793 "swap. However this is I<not> done at the moment, because of the complexity "
1794 "of such an implementation."
1798 #: ../src/guestfs.pod:870
1800 "Therefore you should be aware that any key parameter you pass to libguestfs "
1801 "might end up being written out to the swap partition. If this is a concern, "
1802 "scrub the swap partition or don't use libguestfs on encrypted devices."
1806 #: ../src/guestfs.pod:875
1807 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1811 #: ../src/guestfs.pod:877
1813 "All high-level libguestfs actions are synchronous. If you want to use "
1814 "libguestfs asynchronously then you must create a thread."
1818 #: ../src/guestfs.pod:880
1820 "Only use the handle from a single thread. Either use the handle exclusively "
1821 "from one thread, or provide your own mutex so that two threads cannot issue "
1822 "calls on the same handle at the same time."
1826 #: ../src/guestfs.pod:884
1828 "See the graphical program guestfs-browser for one possible architecture for "
1829 "multithreaded programs using libvirt and libguestfs."
1833 #: ../src/guestfs.pod:887
1838 #: ../src/guestfs.pod:889
1840 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1845 #: ../src/guestfs.pod:892
1847 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1848 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1852 #: ../src/guestfs.pod:895
1854 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1855 "to change the directories that libguestfs will search in. The value is a "
1856 "colon-separated list of paths. The current directory is I<not> searched "
1857 "unless the path contains an empty element or C<.>. For example "
1858 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1859 "then C</usr/lib/guestfs>."
1863 #: ../src/guestfs.pod:902
1864 msgid "QEMU WRAPPERS"
1868 #: ../src/guestfs.pod:904
1870 "If you want to compile your own qemu, run qemu from a non-standard location, "
1871 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1876 #: ../src/guestfs.pod:908
1878 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1879 "last command in the shell script (so that qemu replaces the shell and "
1880 "becomes the direct child of the libguestfs-using program). If you don't do "
1881 "this, then the qemu process won't be cleaned up correctly."
1885 #: ../src/guestfs.pod:913
1887 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1892 #: ../src/guestfs.pod:916
1896 " qemudir=/home/rjones/d/qemu\n"
1897 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1902 #: ../src/guestfs.pod:920
1904 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1905 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1910 #: ../src/guestfs.pod:924
1913 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1918 #: ../src/guestfs.pod:926
1920 "Note that libguestfs also calls qemu with the -help and -version options in "
1921 "order to determine features."
1925 #: ../src/guestfs.pod:929
1926 msgid "ABI GUARANTEE"
1930 #: ../src/guestfs.pod:931
1932 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1933 "actions as outlined in this section. Although we will deprecate some "
1934 "actions, for example if they get replaced by newer calls, we will keep the "
1935 "old actions forever. This allows you the developer to program in confidence "
1936 "against the libguestfs API."
1940 #: ../src/guestfs.pod:937
1941 msgid "BLOCK DEVICE NAMING"
1945 #: ../src/guestfs.pod:939
1947 "In the kernel there is now quite a profusion of schemata for naming block "
1948 "devices (in this context, by I<block device> I mean a physical or virtual "
1949 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1950 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1951 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1952 "for the old IDE driver (particularly for SATA devices) those devices also "
1953 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1954 "paravirtualized drivers. This has created several different naming systems, "
1955 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1959 #: ../src/guestfs.pod:951
1961 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1962 "Linux kernel to access block devices. We can run a variety of appliances "
1963 "based on a variety of Linux kernels."
1967 #: ../src/guestfs.pod:955
1969 "This causes a problem for libguestfs because many API calls use device or "
1970 "partition names. Working scripts and the recipe (example) scripts that we "
1971 "make available over the internet could fail if the naming scheme changes."
1975 #: ../src/guestfs.pod:960
1977 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1978 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1979 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1980 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1984 #: ../src/guestfs.pod:966
1986 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1987 "L</guestfs_list_partitions> and similar calls return the true names of the "
1988 "devices and partitions as known to the appliance."
1992 #: ../src/guestfs.pod:971
1993 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1997 #: ../src/guestfs.pod:973
1999 "Usually this translation is transparent. However in some (very rare) cases "
2000 "you may need to know the exact algorithm. Such cases include where you use "
2001 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2002 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2006 #: ../src/guestfs.pod:979
2008 "The algorithm is applied only to I<parameters> which are known to be either "
2009 "device or partition names. Return values from functions such as L</"
2010 "guestfs_list_devices> are never changed."
2014 #: ../src/guestfs.pod:987
2015 msgid "Is the string a parameter which is a device or partition name?"
2019 #: ../src/guestfs.pod:991
2020 msgid "Does the string begin with C</dev/sd>?"
2024 #: ../src/guestfs.pod:995
2026 "Does the named device exist? If so, we use that device. However if I<not> "
2027 "then we continue with this algorithm."
2031 #: ../src/guestfs.pod:1000
2032 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2036 #: ../src/guestfs.pod:1002
2037 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2041 #: ../src/guestfs.pod:1004
2042 msgid "If that named device exists, use it. If not, continue."
2046 #: ../src/guestfs.pod:1008
2047 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2051 #: ../src/guestfs.pod:1010
2052 msgid "If that named device exists, use it. If not, return an error."
2056 #: ../src/guestfs.pod:1014
2057 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2061 #: ../src/guestfs.pod:1016
2063 "Although the standard naming scheme and automatic translation is useful for "
2064 "simple programs and guestfish scripts, for larger programs it is best not to "
2065 "rely on this mechanism."
2069 #: ../src/guestfs.pod:1020
2071 "Where possible for maximum future portability programs using libguestfs "
2072 "should use these future-proof techniques:"
2076 #: ../src/guestfs.pod:1027
2078 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2079 "device names, and then use those names directly."
2083 #: ../src/guestfs.pod:1030
2085 "Since those device names exist by definition, they will never be translated."
2089 #: ../src/guestfs.pod:1035
2091 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2092 "filesystem labels."
2096 #: ../src/guestfs.pod:1040
2101 #: ../src/guestfs.pod:1042
2103 "This section discusses security implications of using libguestfs, "
2104 "particularly with untrusted or malicious guests or disk images."
2108 #: ../src/guestfs.pod:1045
2109 msgid "GENERAL SECURITY CONSIDERATIONS"
2113 #: ../src/guestfs.pod:1047
2115 "Be careful with any files or data that you download from a guest (by "
2116 "\"download\" we mean not just the L</guestfs_download> command but any "
2117 "command that reads files, filenames, directories or anything else from a "
2118 "disk image). An attacker could manipulate the data to fool your program "
2119 "into doing the wrong thing. Consider cases such as:"
2123 #: ../src/guestfs.pod:1057
2124 msgid "the data (file etc) not being present"
2128 #: ../src/guestfs.pod:1061
2129 msgid "being present but empty"
2133 #: ../src/guestfs.pod:1065
2134 msgid "being much larger than normal"
2138 #: ../src/guestfs.pod:1069
2139 msgid "containing arbitrary 8 bit data"
2143 #: ../src/guestfs.pod:1073
2144 msgid "being in an unexpected character encoding"
2148 #: ../src/guestfs.pod:1077
2149 msgid "containing homoglyphs."
2153 #: ../src/guestfs.pod:1081
2154 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2158 #: ../src/guestfs.pod:1083
2160 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2161 "(VFS) module can sometimes be escalated into exploits by deliberately "
2162 "creating a malicious, malformed filesystem. These exploits are very severe "
2163 "for two reasons. Firstly there are very many filesystem drivers in the "
2164 "kernel, and many of them are infrequently used and not much developer "
2165 "attention has been paid to the code. Linux userspace helps potential "
2166 "crackers by detecting the filesystem type and automatically choosing the "
2167 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2168 "the administrator. Secondly, a kernel-level exploit is like a local root "
2169 "exploit (worse in some ways), giving immediate and total access to the "
2170 "system right down to the hardware level."
2174 #: ../src/guestfs.pod:1096
2176 "That explains why you should never mount a filesystem from an untrusted "
2177 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2178 "inside a qemu virtual machine, usually running as a non-root user. The "
2179 "attacker would need to write a filesystem which first exploited the kernel, "
2180 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2181 "the libguestfs protocol, and finally to be as serious as the host kernel "
2182 "exploit it would need to escalate its privileges to root. This multi-step "
2183 "escalation, performed by a static piece of data, is thought to be extremely "
2184 "hard to do, although we never say 'never' about security issues."
2188 #: ../src/guestfs.pod:1107
2190 "In any case callers can reduce the attack surface by forcing the filesystem "
2191 "type when mounting (use L</guestfs_mount_vfs>)."
2195 #: ../src/guestfs.pod:1110
2196 msgid "PROTOCOL SECURITY"
2200 #: ../src/guestfs.pod:1112
2202 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2203 "defined upper message size. However a program that uses libguestfs must "
2204 "also take care - for example you can write a program that downloads a binary "
2205 "from a disk image and executes it locally, and no amount of protocol "
2206 "security will save you from the consequences."
2210 #: ../src/guestfs.pod:1118
2211 msgid "INSPECTION SECURITY"
2215 #: ../src/guestfs.pod:1120
2217 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2218 "directly from the guest, and these could contain any 8 bit data. Callers "
2219 "should be careful to escape these before printing them to a structured file "
2220 "(for example, use HTML escaping if creating a web page)."
2224 #: ../src/guestfs.pod:1126
2226 "Guest configuration may be altered in unusual ways by the administrator of "
2227 "the virtual machine, and may not reflect reality (particularly for untrusted "
2228 "or actively malicious guests). For example we parse the hostname from "
2229 "configuration files like C</etc/sysconfig/network> that we find in the "
2230 "guest, but the guest administrator can easily manipulate these files to "
2231 "provide the wrong hostname."
2235 #: ../src/guestfs.pod:1134
2237 "The inspection API parses guest configuration using two external libraries: "
2238 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2239 "designed to be robust in the face of malicious data, although denial of "
2240 "service attacks are still possible, for example with oversized configuration "
2245 #: ../src/guestfs.pod:1140
2246 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2250 #: ../src/guestfs.pod:1142
2252 "Be very cautious about running commands from the guest. By running a "
2253 "command in the guest, you are giving CPU time to a binary that you do not "
2254 "control, under the same user account as the library, albeit wrapped in qemu "
2255 "virtualization. More information and alternatives can be found in the "
2256 "section L</RUNNING COMMANDS>."
2260 #: ../src/guestfs.pod:1148
2261 msgid "CVE-2010-3851"
2265 #: ../src/guestfs.pod:1150
2266 msgid "https://bugzilla.redhat.com/642934"
2270 #: ../src/guestfs.pod:1152
2272 "This security bug concerns the automatic disk format detection that qemu "
2273 "does on disk images."
2277 #: ../src/guestfs.pod:1155
2279 "A raw disk image is just the raw bytes, there is no header. Other disk "
2280 "images like qcow2 contain a special header. Qemu deals with this by looking "
2281 "for one of the known headers, and if none is found then assuming the disk "
2282 "image must be raw."
2286 #: ../src/guestfs.pod:1160
2288 "This allows a guest which has been given a raw disk image to write some "
2289 "other header. At next boot (or when the disk image is accessed by "
2290 "libguestfs) qemu would do autodetection and think the disk image format was, "
2291 "say, qcow2 based on the header written by the guest."
2295 #: ../src/guestfs.pod:1165
2297 "This in itself would not be a problem, but qcow2 offers many features, one "
2298 "of which is to allow a disk image to refer to another image (called the "
2299 "\"backing disk\"). It does this by placing the path to the backing disk "
2300 "into the qcow2 header. This path is not validated and could point to any "
2301 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2302 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2303 "control of the attacker."
2307 #: ../src/guestfs.pod:1173
2309 "In libguestfs this is rather hard to exploit except under two circumstances:"
2313 #: ../src/guestfs.pod:1180
2314 msgid "You have enabled the network or have opened the disk in write mode."
2318 #: ../src/guestfs.pod:1184
2320 "You are also running untrusted code from the guest (see L</RUNNING "
2325 #: ../src/guestfs.pod:1189
2327 "The way to avoid this is to specify the expected disk format when adding "
2328 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2329 "should always do this if the disk is raw format, and it's a good idea for "
2334 #: ../src/guestfs.pod:1194
2336 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2337 "format is fetched from libvirt and passed through."
2341 #: ../src/guestfs.pod:1197
2343 "For libguestfs tools, use the I<--format> command line parameter as "
2348 #: ../src/guestfs.pod:1200
2349 msgid "CONNECTION MANAGEMENT"
2353 #: ../src/guestfs.pod:1202
2358 #: ../src/guestfs.pod:1204
2360 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2361 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2362 "handle and release all resources used."
2366 #: ../src/guestfs.pod:1208
2368 "For information on using multiple handles and threads, see the section L</"
2369 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2373 #: ../src/guestfs.pod:1211
2374 msgid "guestfs_create"
2378 #: ../src/guestfs.pod:1213
2381 " guestfs_h *guestfs_create (void);\n"
2386 #: ../src/guestfs.pod:1215
2387 msgid "Create a connection handle."
2391 #: ../src/guestfs.pod:1217
2393 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2394 "on the handle at least once."
2398 #: ../src/guestfs.pod:1220
2400 "This function returns a non-NULL pointer to a handle on success or NULL on "
2405 #: ../src/guestfs.pod:1223
2406 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2410 #: ../src/guestfs.pod:1225
2412 "You may also want to configure error handling for the handle. See L</ERROR "
2413 "HANDLING> section below."
2417 #: ../src/guestfs.pod:1228
2418 msgid "guestfs_close"
2422 #: ../src/guestfs.pod:1230
2425 " void guestfs_close (guestfs_h *g);\n"
2430 #: ../src/guestfs.pod:1232
2431 msgid "This closes the connection handle and frees up all resources used."
2435 #: ../src/guestfs.pod:1234
2436 msgid "ERROR HANDLING"
2440 #: ../src/guestfs.pod:1236
2442 "API functions can return errors. For example, almost all functions that "
2443 "return C<int> will return C<-1> to indicate an error."
2447 #: ../src/guestfs.pod:1239
2449 "Additional information is available for errors: an error message string and "
2450 "optionally an error number (errno) if the thing that failed was a system "
2455 #: ../src/guestfs.pod:1243
2457 "You can get at the additional information about the last error on the handle "
2458 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2459 "up an error handler with L</guestfs_set_error_handler>."
2463 #: ../src/guestfs.pod:1248
2465 "When the handle is created, a default error handler is installed which "
2466 "prints the error message string to C<stderr>. For small short-running "
2467 "command line programs it is sufficient to do:"
2471 #: ../src/guestfs.pod:1252
2474 " if (guestfs_launch (g) == -1)\n"
2475 " exit (EXIT_FAILURE);\n"
2480 #: ../src/guestfs.pod:1255
2482 "since the default error handler will ensure that an error message has been "
2483 "printed to C<stderr> before the program exits."
2487 #: ../src/guestfs.pod:1258
2489 "For other programs the caller will almost certainly want to install an "
2490 "alternate error handler or do error handling in-line like this:"
2494 #: ../src/guestfs.pod:1261
2497 " g = guestfs_create ();\n"
2502 #: ../src/guestfs.pod:1263
2505 " /* This disables the default behaviour of printing errors\n"
2507 " guestfs_set_error_handler (g, NULL, NULL);\n"
2512 #: ../src/guestfs.pod:1267
2515 " if (guestfs_launch (g) == -1) {\n"
2516 " /* Examine the error message and print it etc. */\n"
2517 " char *msg = guestfs_last_error (g);\n"
2518 " int errnum = guestfs_last_errno (g);\n"
2519 " fprintf (stderr, \"%s\\n\", msg);\n"
2526 #: ../src/guestfs.pod:1275
2528 "Out of memory errors are handled differently. The default action is to call "
2529 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2530 "guestfs_set_out_of_memory_handler>."
2534 #: ../src/guestfs.pod:1279
2536 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2537 "because there is no handle if this happens there is no way to get additional "
2538 "error information. However L</guestfs_create> is supposed to be a "
2539 "lightweight operation which can only fail because of insufficient memory (it "
2540 "returns NULL in this case)."
2544 #: ../src/guestfs.pod:1285
2545 msgid "guestfs_last_error"
2549 #: ../src/guestfs.pod:1287
2552 " const char *guestfs_last_error (guestfs_h *g);\n"
2557 #: ../src/guestfs.pod:1289
2559 "This returns the last error message that happened on C<g>. If there has not "
2560 "been an error since the handle was created, then this returns C<NULL>."
2564 #: ../src/guestfs.pod:1293
2566 "The lifetime of the returned string is until the next error occurs, or L</"
2567 "guestfs_close> is called."
2571 #: ../src/guestfs.pod:1296
2572 msgid "guestfs_last_errno"
2576 #: ../src/guestfs.pod:1298
2579 " int guestfs_last_errno (guestfs_h *g);\n"
2584 #: ../src/guestfs.pod:1300
2585 msgid "This returns the last error number (errno) that happened on C<g>."
2589 #: ../src/guestfs.pod:1302
2590 msgid "If successful, an errno integer not equal to zero is returned."
2594 #: ../src/guestfs.pod:1304
2596 "If no error, this returns 0. This call can return 0 in three situations:"
2600 #: ../src/guestfs.pod:1311
2601 msgid "There has not been any error on the handle."
2605 #: ../src/guestfs.pod:1315
2607 "There has been an error but the errno was meaningless. This corresponds to "
2608 "the case where the error did not come from a failed system call, but for "
2609 "some other reason."
2613 #: ../src/guestfs.pod:1321
2615 "There was an error from a failed system call, but for some reason the errno "
2616 "was not captured and returned. This usually indicates a bug in libguestfs."
2620 #: ../src/guestfs.pod:1327
2622 "Libguestfs tries to convert the errno from inside the applicance into a "
2623 "corresponding errno for the caller (not entirely trivial: the appliance "
2624 "might be running a completely different operating system from the library "
2625 "and error numbers are not standardized across Un*xen). If this could not be "
2626 "done, then the error is translated to C<EINVAL>. In practice this should "
2627 "only happen in very rare circumstances."
2631 #: ../src/guestfs.pod:1335
2632 msgid "guestfs_set_error_handler"
2636 #: ../src/guestfs.pod:1337
2639 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2641 " const char *msg);\n"
2642 " void guestfs_set_error_handler (guestfs_h *g,\n"
2643 " guestfs_error_handler_cb cb,\n"
2649 #: ../src/guestfs.pod:1344
2651 "The callback C<cb> will be called if there is an error. The parameters "
2652 "passed to the callback are an opaque data pointer and the error message "
2657 #: ../src/guestfs.pod:1348
2659 "C<errno> is not passed to the callback. To get that the callback must call "
2660 "L</guestfs_last_errno>."
2664 #: ../src/guestfs.pod:1351
2666 "Note that the message string C<msg> is freed as soon as the callback "
2667 "function returns, so if you want to stash it somewhere you must make your "
2672 #: ../src/guestfs.pod:1355
2673 msgid "The default handler prints messages on C<stderr>."
2677 #: ../src/guestfs.pod:1357
2678 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2682 #: ../src/guestfs.pod:1359
2683 msgid "guestfs_get_error_handler"
2687 #: ../src/guestfs.pod:1361
2690 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2691 " void **opaque_rtn);\n"
2696 #: ../src/guestfs.pod:1364
2697 msgid "Returns the current error handler callback."
2701 #: ../src/guestfs.pod:1366
2702 msgid "guestfs_set_out_of_memory_handler"
2706 #: ../src/guestfs.pod:1368
2709 " typedef void (*guestfs_abort_cb) (void);\n"
2710 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2711 " guestfs_abort_cb);\n"
2716 #: ../src/guestfs.pod:1372
2718 "The callback C<cb> will be called if there is an out of memory situation. "
2719 "I<Note this callback must not return>."
2723 #: ../src/guestfs.pod:1375
2724 msgid "The default is to call L<abort(3)>."
2728 #: ../src/guestfs.pod:1377
2730 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2734 #: ../src/guestfs.pod:1380
2735 msgid "guestfs_get_out_of_memory_handler"
2739 #: ../src/guestfs.pod:1382
2742 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2747 #: ../src/guestfs.pod:1384
2748 msgid "This returns the current out of memory handler."
2752 #: ../src/guestfs.pod:1386
2757 #: ../src/guestfs.pod:1388 ../fish/guestfish.pod:958
2762 #: ../src/guestfs.pod:1390
2767 #: ../src/guestfs.pod:1392
2772 #: ../src/guestfs.pod:1394
2773 msgid "AVAILABILITY"
2777 #: ../src/guestfs.pod:1396
2778 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2782 #: ../src/guestfs.pod:1398
2784 "Using L</guestfs_available> you can test availability of the following "
2785 "groups of functions. This test queries the appliance to see if the "
2786 "appliance you are currently using supports the functionality."
2790 #: ../src/guestfs.pod:1403
2791 msgid "@AVAILABILITY@"
2795 #: ../src/guestfs.pod:1405
2796 msgid "GUESTFISH supported COMMAND"
2800 #: ../src/guestfs.pod:1407
2802 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2803 "prints out the available groups and whether they are supported by this build "
2804 "of libguestfs. Note however that you have to do C<run> first."
2808 #: ../src/guestfs.pod:1412
2809 msgid "SINGLE CALLS AT COMPILE TIME"
2813 #: ../src/guestfs.pod:1414
2815 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2816 "function, such as:"
2820 #: ../src/guestfs.pod:1417
2823 " #define LIBGUESTFS_HAVE_DD 1\n"
2828 #: ../src/guestfs.pod:1419
2829 msgid "if L</guestfs_dd> is available."
2833 #: ../src/guestfs.pod:1421
2835 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2836 "function is available at compile time, we recommended using build tools such "
2837 "as autoconf or cmake. For example in autotools you could use:"
2841 #: ../src/guestfs.pod:1426
2844 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2845 " AC_CHECK_FUNCS([guestfs_dd])\n"
2850 #: ../src/guestfs.pod:1429
2852 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2857 #: ../src/guestfs.pod:1432
2858 msgid "SINGLE CALLS AT RUN TIME"
2862 #: ../src/guestfs.pod:1434
2864 "Testing at compile time doesn't guarantee that a function really exists in "
2865 "the library. The reason is that you might be dynamically linked against a "
2866 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2867 "This situation unfortunately results in a segmentation fault, which is a "
2868 "shortcoming of the C dynamic linking system itself."
2872 #: ../src/guestfs.pod:1441
2874 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2875 "in this example program (note that you still need the compile time check as "
2880 #: ../src/guestfs.pod:1445
2883 " #include <stdio.h>\n"
2884 " #include <stdlib.h>\n"
2885 " #include <unistd.h>\n"
2886 " #include <dlfcn.h>\n"
2887 " #include <guestfs.h>\n"
2892 #: ../src/guestfs.pod:1451
2897 " #ifdef LIBGUESTFS_HAVE_DD\n"
2899 " int has_function;\n"
2904 #: ../src/guestfs.pod:1457
2907 " /* Test if the function guestfs_dd is really available. */\n"
2908 " dl = dlopen (NULL, RTLD_LAZY);\n"
2910 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2911 " exit (EXIT_FAILURE);\n"
2913 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2919 #: ../src/guestfs.pod:1466
2922 " if (!has_function)\n"
2923 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2925 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2926 " /* Now it's safe to call\n"
2927 " guestfs_dd (g, \"foo\", \"bar\");\n"
2931 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2938 #: ../src/guestfs.pod:1479
2940 "You may think the above is an awful lot of hassle, and it is. There are "
2941 "other ways outside of the C linking system to ensure that this kind of "
2942 "incompatibility never arises, such as using package versioning:"
2946 #: ../src/guestfs.pod:1484
2949 " Requires: libguestfs >= 1.0.80\n"
2954 #: ../src/guestfs.pod:1486
2955 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2959 #: ../src/guestfs.pod:1488
2961 "A recent feature of the API is the introduction of calls which take optional "
2962 "arguments. In C these are declared 3 ways. The main way is as a call which "
2963 "takes variable arguments (ie. C<...>), as in this example:"
2967 #: ../src/guestfs.pod:1493
2970 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2975 #: ../src/guestfs.pod:1495
2977 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2978 "call with no optional arguments specified:"
2982 #: ../src/guestfs.pod:1498
2985 " guestfs_add_drive_opts (g, filename, -1);\n"
2990 #: ../src/guestfs.pod:1500
2991 msgid "With a single optional argument:"
2995 #: ../src/guestfs.pod:1502
2998 " guestfs_add_drive_opts (g, filename,\n"
2999 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3005 #: ../src/guestfs.pod:1506
3010 #: ../src/guestfs.pod:1508
3013 " guestfs_add_drive_opts (g, filename,\n"
3014 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3015 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3021 #: ../src/guestfs.pod:1513
3023 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3028 #: ../src/guestfs.pod:1516
3029 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3033 #: ../src/guestfs.pod:1518
3035 "The second variant has the same name with the suffix C<_va>, which works the "
3036 "same way but takes a C<va_list>. See the C manual for details. For the "
3037 "example function, this is declared:"
3041 #: ../src/guestfs.pod:1522
3044 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3050 #: ../src/guestfs.pod:1525
3051 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3055 #: ../src/guestfs.pod:1527
3057 "The third variant is useful where you need to construct these calls. You "
3058 "pass in a structure where you fill in the optional fields. The structure "
3059 "has a bitmask as the first element which you must set to indicate which "
3060 "fields you have filled in. For our example function the structure and call "
3065 #: ../src/guestfs.pod:1533
3068 " struct guestfs_add_drive_opts_argv {\n"
3069 " uint64_t bitmask;\n"
3071 " const char *format;\n"
3074 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3075 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3080 #: ../src/guestfs.pod:1542
3081 msgid "You could call it like this:"
3085 #: ../src/guestfs.pod:1544
3088 " struct guestfs_add_drive_opts_argv optargs = {\n"
3089 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3090 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3092 " .format = \"qcow2\"\n"
3098 #: ../src/guestfs.pod:1551
3101 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3106 #: ../src/guestfs.pod:1553 ../src/guestfs-actions.pod:11
3107 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:9
3108 #: ../fish/guestfish-actions.pod:1255 ../tools/virt-win-reg.pl:532
3113 #: ../src/guestfs.pod:1559
3114 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3118 #: ../src/guestfs.pod:1564
3119 msgid "You do not need to fill in all fields of the structure."
3123 #: ../src/guestfs.pod:1568
3125 "There must be a one-to-one correspondence between fields of the structure "
3126 "that are filled in, and bits set in the bitmask."
3130 #: ../src/guestfs.pod:1573
3131 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3135 #: ../src/guestfs.pod:1575
3137 "In other languages, optional arguments are expressed in the way that is "
3138 "natural for that language. We refer you to the language-specific "
3139 "documentation for more details on that."
3143 #: ../src/guestfs.pod:1579
3144 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3148 #: ../src/guestfs.pod:1581
3149 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3153 #: ../src/guestfs.pod:1583
3155 "The child process generates events in some situations. Current events "
3156 "include: receiving a log message, the child process exits."
3160 #: ../src/guestfs.pod:1586
3162 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3167 #: ../src/guestfs.pod:1589
3169 "Only I<one callback of each type> can be registered for each handle. "
3170 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3171 "that type. Cancel all callbacks of this type by calling this function with "
3172 "C<cb> set to C<NULL>."
3176 #: ../src/guestfs.pod:1594
3177 msgid "guestfs_set_log_message_callback"
3181 #: ../src/guestfs.pod:1596
3184 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3185 " char *buf, int len);\n"
3186 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3187 " guestfs_log_message_cb cb,\n"
3193 #: ../src/guestfs.pod:1602
3195 "The callback function C<cb> will be called whenever qemu or the guest writes "
3196 "anything to the console."
3200 #: ../src/guestfs.pod:1605
3201 msgid "Use this function to capture kernel messages and similar."
3205 #: ../src/guestfs.pod:1607
3207 "Normally there is no log message handler, and log messages are just "
3212 #: ../src/guestfs.pod:1610
3213 msgid "guestfs_set_subprocess_quit_callback"
3217 #: ../src/guestfs.pod:1612
3220 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3221 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3222 " guestfs_subprocess_quit_cb cb,\n"
3228 #: ../src/guestfs.pod:1617
3230 "The callback function C<cb> will be called when the child process quits, "
3231 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3232 "corresponds to a transition from any state to the CONFIG state)."
3236 #: ../src/guestfs.pod:1622
3237 msgid "guestfs_set_launch_done_callback"
3241 #: ../src/guestfs.pod:1624
3244 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3245 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3246 " guestfs_launch_done_cb cb,\n"
3252 #: ../src/guestfs.pod:1629
3254 "The callback function C<cb> will be called when the child process becomes "
3255 "ready first time after it has been launched. (This corresponds to a "
3256 "transition from LAUNCHING to the READY state)."
3260 #: ../src/guestfs.pod:1633
3261 msgid "guestfs_set_close_callback"
3265 #: ../src/guestfs.pod:1635
3268 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3269 " void guestfs_set_close_callback (guestfs_h *g,\n"
3270 " guestfs_close_cb cb,\n"
3276 #: ../src/guestfs.pod:1640
3278 "The callback function C<cb> will be called while the handle is being closed "
3279 "(synchronously from L</guestfs_close>)."
3283 #: ../src/guestfs.pod:1643
3285 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3286 "handles that are open when the program exits. This means that this callback "
3287 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3288 "problems in higher-level languages (eg. if your HLL interpreter has already "
3289 "been cleaned up by the time this is called, and if your callback then jumps "
3290 "into some HLL function)."
3294 #: ../src/guestfs.pod:1651
3295 msgid "guestfs_set_progress_callback"
3299 #: ../src/guestfs.pod:1653
3302 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3303 " int proc_nr, int serial,\n"
3304 " uint64_t position, uint64_t total);\n"
3305 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3306 " guestfs_progress_cb cb,\n"
3312 #: ../src/guestfs.pod:1660
3314 "Some long-running operations can generate progress messages. If this "
3315 "callback is registered, then it will be called each time a progress message "
3316 "is generated (usually two seconds after the operation started, and three "
3317 "times per second thereafter until it completes, although the frequency may "
3318 "change in future versions)."
3322 #: ../src/guestfs.pod:1666
3324 "The callback receives two numbers: C<position> and C<total>. The units of "
3325 "C<total> are not defined, although for some operations C<total> may relate "
3326 "in some way to the amount of data to be transferred (eg. in bytes or "
3327 "megabytes), and C<position> may be the portion which has been transferred."
3331 #: ../src/guestfs.pod:1672
3332 msgid "The only defined and stable parts of the API are:"
3336 #: ../src/guestfs.pod:1678
3338 "The callback can display to the user some type of progress bar or indicator "
3339 "which shows the ratio of C<position>:C<total>."
3343 #: ../src/guestfs.pod:1683
3344 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3348 #: ../src/guestfs.pod:1687
3350 "If any progress notification is sent during a call, then a final progress "
3351 "notification is always sent when C<position> = C<total>."
3355 #: ../src/guestfs.pod:1690
3357 "This is to simplify caller code, so callers can easily set the progress "
3358 "indicator to \"100%\" at the end of the operation, without requiring special "
3359 "code to detect this case."
3363 #: ../src/guestfs.pod:1696
3365 "The callback also receives the procedure number and serial number of the "
3366 "call. These are only useful for debugging protocol issues, and the callback "
3367 "can normally ignore them. The callback may want to print these numbers in "
3368 "error messages or debugging messages."
3372 #: ../src/guestfs.pod:1701
3373 msgid "PRIVATE DATA AREA"
3377 #: ../src/guestfs.pod:1703
3379 "You can attach named pieces of private data to the libguestfs handle, and "
3380 "fetch them by name for the lifetime of the handle. This is called the "
3381 "private data area and is only available from the C API."
3385 #: ../src/guestfs.pod:1707
3386 msgid "To attach a named piece of data, use the following call:"
3390 #: ../src/guestfs.pod:1709
3393 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3398 #: ../src/guestfs.pod:1711
3400 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3401 "pointer (which can be C<NULL>). Any previous item with the same name is "
3406 #: ../src/guestfs.pod:1715
3408 "You can use any C<key> you want, but names beginning with an underscore "
3409 "character are reserved for internal libguestfs purposes (for implementing "
3410 "language bindings). It is recommended to prefix the name with some unique "
3411 "string to avoid collisions with other users."
3415 #: ../src/guestfs.pod:1720
3416 msgid "To retrieve the pointer, use:"
3420 #: ../src/guestfs.pod:1722
3423 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3428 #: ../src/guestfs.pod:1724
3430 "This function returns C<NULL> if either no data is found associated with "
3431 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3436 #: ../src/guestfs.pod:1728
3438 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3439 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3440 "all. In particular, libguestfs does I<not> try to free the data when the "
3441 "handle is closed. If the data must be freed, then the caller must either "
3442 "free it before calling L</guestfs_close> or must set up a close callback to "
3443 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3444 "can be registered for a handle)."
3448 #: ../src/guestfs.pod:1736
3450 "The private data area is implemented using a hash table, and should be "
3451 "reasonably efficient for moderate numbers of keys."
3455 #: ../src/guestfs.pod:1739 ../src/guestfs.pod:1744
3460 #: ../src/guestfs.pod:1741
3462 "<!-- old anchor for the next section --> <a name="
3463 "\"state_machine_and_low_level_event_api\"/>"
3467 #: ../src/guestfs.pod:1746
3468 msgid "ARCHITECTURE"
3472 #: ../src/guestfs.pod:1748
3474 "Internally, libguestfs is implemented by running an appliance (a special "
3475 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3476 "process of the main program."
3480 #: ../src/guestfs.pod:1752
3483 " ___________________\n"
3485 " | main program |\n"
3487 " | | child process / appliance\n"
3488 " | | __________________________\n"
3490 " +-------------------+ RPC | +-----------------+ |\n"
3491 " | libguestfs <--------------------> guestfsd | |\n"
3492 " | | | +-----------------+ |\n"
3493 " \\___________________/ | | Linux kernel | |\n"
3494 " | +--^--------------+ |\n"
3495 " \\_________|________________/\n"
3501 " \\______________/\n"
3506 #: ../src/guestfs.pod:1772
3508 "The library, linked to the main program, creates the child process and hence "
3509 "the appliance in the L</guestfs_launch> function."
3513 #: ../src/guestfs.pod:1775
3515 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3516 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3517 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3518 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3519 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3520 "attached to the qemu process which translates device access by the "
3521 "appliance's Linux kernel into accesses to the image."
3525 #: ../src/guestfs.pod:1784
3527 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3528 "Although the disk image you are attached to might also be used by some "
3529 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3530 "care if both libguestfs's qemu process and your virtual machine are trying "
3531 "to update the disk image at the same time, since these usually results in "
3532 "massive disk corruption)."
3536 #: ../src/guestfs.pod:1791
3537 msgid "STATE MACHINE"
3541 #: ../src/guestfs.pod:1793
3542 msgid "libguestfs uses a state machine to model the child process:"
3546 #: ../src/guestfs.pod:1795
3558 " / | \\ \\ guestfs_launch\n"
3559 " / | _\\__V______\n"
3561 " / | | LAUNCHING |\n"
3562 " / | \\___________/\n"
3564 " / | guestfs_launch\n"
3566 " ______ / __|____V\n"
3567 " / \\ ------> / \\\n"
3568 " | BUSY | | READY |\n"
3569 " \\______/ <------ \\________/\n"
3574 #: ../src/guestfs.pod:1817
3576 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3577 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3578 "(3) alternating between READY and BUSY as commands are issued to, and "
3579 "carried out by, the child process."
3583 #: ../src/guestfs.pod:1822
3585 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3586 "asynchronously at any time (eg. due to some internal error), and that causes "
3587 "the state to transition back to CONFIG."
3591 #: ../src/guestfs.pod:1826
3593 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3594 "issued when in the CONFIG state."
3598 #: ../src/guestfs.pod:1829
3600 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3601 "L</guestfs_launch> blocks until the child process is READY to accept "
3602 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3603 "moves the state from CONFIG to LAUNCHING while it is running."
3607 #: ../src/guestfs.pod:1835
3609 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3610 "state. These API calls block waiting for the command to be carried out (ie. "
3611 "the state to transition to BUSY and then back to READY). There are no non-"
3612 "blocking versions, and no way to issue more than one command per handle at "
3617 #: ../src/guestfs.pod:1841
3619 "Finally, the child process sends asynchronous messages back to the main "
3620 "program, such as kernel log messages. You can register a callback to "
3621 "receive these messages."
3625 #: ../src/guestfs.pod:1845
3630 #: ../src/guestfs.pod:1847
3631 msgid "COMMUNICATION PROTOCOL"
3635 #: ../src/guestfs.pod:1849
3637 "Don't rely on using this protocol directly. This section documents how it "
3638 "currently works, but it may change at any time."
3642 #: ../src/guestfs.pod:1852
3644 "The protocol used to talk between the library and the daemon running inside "
3645 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3646 "1014, RFC 1832, RFC 4506)."
3650 #: ../src/guestfs.pod:1856
3652 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3653 "this file is automatically generated)."
3657 #: ../src/guestfs.pod:1859
3659 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3660 "and C<FileOut> parameters, which are handled with very simple request/reply "
3661 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3662 "parameters, which use the same request and reply messages, but they may also "
3663 "be followed by files sent using a chunked encoding."
3667 #: ../src/guestfs.pod:1866
3668 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3672 #: ../src/guestfs.pod:1868
3673 msgid "For ordinary functions, the request message is:"
3677 #: ../src/guestfs.pod:1870
3680 " total length (header + arguments,\n"
3681 " but not including the length word itself)\n"
3682 " struct guestfs_message_header (encoded as XDR)\n"
3683 " struct guestfs_<foo>_args (encoded as XDR)\n"
3688 #: ../src/guestfs.pod:1875
3690 "The total length field allows the daemon to allocate a fixed size buffer "
3691 "into which it slurps the rest of the message. As a result, the total length "
3692 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3693 "effective size of any request is limited to somewhere under this size."
3697 #: ../src/guestfs.pod:1881
3699 "Note also that many functions don't take any arguments, in which case the "
3700 "C<guestfs_I<foo>_args> is completely omitted."
3704 #: ../src/guestfs.pod:1884
3706 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3707 "receiver knows what type of args structure to expect, or none at all."
3711 #: ../src/guestfs.pod:1888
3713 "For functions that take optional arguments, the optional arguments are "
3714 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3715 "arguments. A bitmask in the header indicates which optional arguments are "
3716 "meaningful. The bitmask is also checked to see if it contains bits set "
3717 "which the daemon does not know about (eg. if more optional arguments were "
3718 "added in a later version of the library), and this causes the call to be "
3723 #: ../src/guestfs.pod:1896
3724 msgid "The reply message for ordinary functions is:"
3728 #: ../src/guestfs.pod:1898
3731 " total length (header + ret,\n"
3732 " but not including the length word itself)\n"
3733 " struct guestfs_message_header (encoded as XDR)\n"
3734 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3739 #: ../src/guestfs.pod:1903
3741 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3742 "functions that return no formal return values."
3746 #: ../src/guestfs.pod:1906
3748 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3752 #: ../src/guestfs.pod:1909
3754 "In the case of an error, a flag is set in the header, and the reply message "
3755 "is slightly changed:"
3759 #: ../src/guestfs.pod:1912
3762 " total length (header + error,\n"
3763 " but not including the length word itself)\n"
3764 " struct guestfs_message_header (encoded as XDR)\n"
3765 " struct guestfs_message_error (encoded as XDR)\n"
3770 #: ../src/guestfs.pod:1917
3772 "The C<guestfs_message_error> structure contains the error message as a "
3777 #: ../src/guestfs.pod:1920
3778 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3782 #: ../src/guestfs.pod:1922
3784 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3785 "The normal request message is sent (see above). However this is followed by "
3786 "a sequence of file chunks."
3790 #: ../src/guestfs.pod:1926
3793 " total length (header + arguments,\n"
3794 " but not including the length word itself,\n"
3795 " and not including the chunks)\n"
3796 " struct guestfs_message_header (encoded as XDR)\n"
3797 " struct guestfs_<foo>_args (encoded as XDR)\n"
3798 " sequence of chunks for FileIn param #0\n"
3799 " sequence of chunks for FileIn param #1 etc.\n"
3804 #: ../src/guestfs.pod:1934
3805 msgid "The \"sequence of chunks\" is:"
3809 #: ../src/guestfs.pod:1936
3812 " length of chunk (not including length word itself)\n"
3813 " struct guestfs_chunk (encoded as XDR)\n"
3814 " length of chunk\n"
3815 " struct guestfs_chunk (encoded as XDR)\n"
3817 " length of chunk\n"
3818 " struct guestfs_chunk (with data.data_len == 0)\n"
3823 #: ../src/guestfs.pod:1944
3825 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3826 "is set in the final chunk to indicate either successful completion or early "
3831 #: ../src/guestfs.pod:1948
3833 "At time of writing there are no functions that have more than one FileIn "
3834 "parameter. However this is (theoretically) supported, by sending the "
3835 "sequence of chunks for each FileIn parameter one after another (from left to "
3840 #: ../src/guestfs.pod:1953
3842 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3843 "transfer. The library does this by sending a chunk with a special flag set "
3844 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3845 "RPC, does I<not> send any reply, and goes back to reading the next request."
3849 #: ../src/guestfs.pod:1959
3851 "The daemon may also cancel. It does this by writing a special word "
3852 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3853 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3854 "cancel chunk). The special word is chosen so that even if cancellation "
3855 "happens right at the end of the transfer (after the library has finished "
3856 "writing and has started listening for the reply), the \"spurious\" cancel "
3857 "flag will not be confused with the reply message."
3861 #: ../src/guestfs.pod:1968
3863 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3864 "limit), and also files where the size is not known in advance (eg. from "
3865 "pipes or sockets). However the chunks are rather small "
3866 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3867 "to keep much in memory."
3871 #: ../src/guestfs.pod:1974
3872 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3876 #: ../src/guestfs.pod:1976
3878 "The protocol for FileOut parameters is exactly the same as for FileIn "
3879 "parameters, but with the roles of daemon and library reversed."
3883 #: ../src/guestfs.pod:1979
3886 " total length (header + ret,\n"
3887 " but not including the length word itself,\n"
3888 " and not including the chunks)\n"
3889 " struct guestfs_message_header (encoded as XDR)\n"
3890 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3891 " sequence of chunks for FileOut param #0\n"
3892 " sequence of chunks for FileOut param #1 etc.\n"
3897 #: ../src/guestfs.pod:1987
3898 msgid "INITIAL MESSAGE"
3902 #: ../src/guestfs.pod:1989
3904 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3905 "which indicates that the guest and daemon is alive. This is what L</"
3906 "guestfs_launch> waits for."
3910 #: ../src/guestfs.pod:1993
3911 msgid "PROGRESS NOTIFICATION MESSAGES"
3915 #: ../src/guestfs.pod:1995
3917 "The daemon may send progress notification messages at any time. These are "
3918 "distinguished by the normal length word being replaced by "
3919 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3923 #: ../src/guestfs.pod:1999
3925 "The library turns them into progress callbacks (see "
3926 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3927 "discards them if not."
3931 #: ../src/guestfs.pod:2003
3933 "The daemon self-limits the frequency of progress messages it sends (see "
3934 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3939 #: ../src/guestfs.pod:2007
3940 msgid "LIBGUESTFS VERSION NUMBERS"
3944 #: ../src/guestfs.pod:2009
3946 "Since April 2010, libguestfs has started to make separate development and "
3947 "stable releases, along with corresponding branches in our git repository. "
3948 "These separate releases can be identified by version number:"
3952 #: ../src/guestfs.pod:2014
3955 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3956 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3962 " | `-------- sub-version\n"
3964 " `------ always '1' because we don't change the ABI\n"
3969 #: ../src/guestfs.pod:2025
3970 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3974 #: ../src/guestfs.pod:2027
3976 "As time passes we cherry pick fixes from the development branch and backport "
3977 "those into the stable branch, the effect being that the stable branch should "
3978 "get more stable and less buggy over time. So the stable releases are ideal "
3979 "for people who don't need new features but would just like the software to "
3984 #: ../src/guestfs.pod:2033
3985 msgid "Our criteria for backporting changes are:"
3989 #: ../src/guestfs.pod:2039
3991 "Documentation changes which don't affect any code are backported unless the "
3992 "documentation refers to a future feature which is not in stable."
3996 #: ../src/guestfs.pod:2045
3998 "Bug fixes which are not controversial, fix obvious problems, and have been "
3999 "well tested are backported."
4003 #: ../src/guestfs.pod:2050
4005 "Simple rearrangements of code which shouldn't affect how it works get "
4006 "backported. This is so that the code in the two branches doesn't get too "
4007 "far out of step, allowing us to backport future fixes more easily."
4011 #: ../src/guestfs.pod:2056
4013 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4014 "exceptional case: the new feature is required in order to implement an "
4015 "important bug fix."
4019 #: ../src/guestfs.pod:2062
4021 "A new stable branch starts when we think the new features in development are "
4022 "substantial and compelling enough over the current stable branch to warrant "
4023 "it. When that happens we create new stable and development versions 1.N.0 "
4024 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4025 "stable at this point, but by backporting fixes from development, that branch "
4026 "will stabilize over time."
4030 #: ../src/guestfs.pod:2070 ../fish/guestfish.pod:965
4031 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
4032 msgid "ENVIRONMENT VARIABLES"
4036 #: ../src/guestfs.pod:2074 ../fish/guestfish.pod:991
4037 msgid "LIBGUESTFS_APPEND"
4041 #: ../src/guestfs.pod:2076 ../fish/guestfish.pod:993
4042 msgid "Pass additional options to the guest kernel."
4046 #: ../src/guestfs.pod:2078 ../fish/guestfish.pod:995
4047 msgid "LIBGUESTFS_DEBUG"
4051 #: ../src/guestfs.pod:2080
4053 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
4054 "effect as calling C<guestfs_set_verbose (g, 1)>."
4058 #: ../src/guestfs.pod:2083 ../fish/guestfish.pod:1000
4059 msgid "LIBGUESTFS_MEMSIZE"
4063 #: ../src/guestfs.pod:2085 ../fish/guestfish.pod:1002
4065 "Set the memory allocated to the qemu process, in megabytes. For example:"
4069 #: ../src/guestfs.pod:2088 ../fish/guestfish.pod:1005
4072 " LIBGUESTFS_MEMSIZE=700\n"
4077 #: ../src/guestfs.pod:2090 ../fish/guestfish.pod:1007
4078 msgid "LIBGUESTFS_PATH"
4082 #: ../src/guestfs.pod:2092
4084 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4085 "the discussion of paths in section PATH above."
4089 #: ../src/guestfs.pod:2095 ../fish/guestfish.pod:1012
4090 msgid "LIBGUESTFS_QEMU"
4094 #: ../src/guestfs.pod:2097 ../fish/guestfish.pod:1014
4096 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4097 "which was found at compile time by the configure script is used."
4101 #: ../src/guestfs.pod:2101
4102 msgid "See also L</QEMU WRAPPERS> above."
4106 #: ../src/guestfs.pod:2103 ../fish/guestfish.pod:1018
4107 msgid "LIBGUESTFS_TRACE"
4111 #: ../src/guestfs.pod:2105
4113 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4114 "effect as calling C<guestfs_set_trace (g, 1)>."
4118 #: ../src/guestfs.pod:2108 ../fish/guestfish.pod:1027
4123 #: ../src/guestfs.pod:2110 ../fish/guestfish.pod:1029
4124 msgid "Location of temporary directory, defaults to C</tmp>."
4128 #: ../src/guestfs.pod:2112 ../fish/guestfish.pod:1031
4130 "If libguestfs was compiled to use the supermin appliance then the real "
4131 "appliance is cached in this directory, shared between all handles belonging "
4132 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4133 "use in case C</tmp> is not large enough."
4137 #: ../src/guestfs.pod:2120 ../fish/guestfish.pod:1089
4138 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4139 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572
4140 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
4141 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534
4142 #: ../tools/virt-list-partitions.pl:257
4147 #: ../src/guestfs.pod:2122
4149 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
4150 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
4151 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
4152 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
4153 ">, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
4154 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
4158 #: ../src/guestfs.pod:2145
4160 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4161 "(8)>, L<disktype(1)>."
4165 #: ../src/guestfs.pod:2152 ../tools/virt-win-reg.pl:587
4166 #: ../tools/virt-make-fs.pl:548
4171 #: ../src/guestfs.pod:2154
4172 msgid "To get a list of bugs against libguestfs use this link:"
4176 #: ../src/guestfs.pod:2156
4178 "L<https://bugzilla.redhat.com/buglist.cgi?"
4179 "component=libguestfs&product=Virtualization+Tools>"
4183 #: ../src/guestfs.pod:2158
4184 msgid "To report a new bug against libguestfs use this link:"
4188 #: ../src/guestfs.pod:2160
4190 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4191 "component=libguestfs&product=Virtualization+Tools>"
4195 #: ../src/guestfs.pod:2162
4196 msgid "When reporting a bug, please check:"
4200 #: ../src/guestfs.pod:2168
4201 msgid "That the bug hasn't been reported already."
4205 #: ../src/guestfs.pod:2172
4206 msgid "That you are testing a recent version."
4210 #: ../src/guestfs.pod:2176
4211 msgid "Describe the bug accurately, and give a way to reproduce it."
4215 #: ../src/guestfs.pod:2180
4217 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4222 #: ../src/guestfs.pod:2185 ../fish/guestfish.pod:1108
4223 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4228 #: ../src/guestfs.pod:2187 ../fish/guestfish.pod:1110
4229 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4230 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4234 #: ../src/guestfs.pod:2189 ../fish/guestfish.pod:1112
4235 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4236 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:602
4237 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
4238 #: ../tools/virt-tar.pl:296 ../tools/virt-make-fs.pl:563
4239 #: ../tools/virt-list-partitions.pl:273
4244 #: ../src/guestfs.pod:2191 ../fish/guestfish.pod:1114
4245 #: ../fuse/guestmount.pod:250
4246 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4250 #: ../src/guestfs.pod:2194
4252 "This library is free software; you can redistribute it and/or modify it "
4253 "under the terms of the GNU Lesser General Public License as published by the "
4254 "Free Software Foundation; either version 2 of the License, or (at your "
4255 "option) any later version."
4259 #: ../src/guestfs.pod:2199
4261 "This library is distributed in the hope that it will be useful, but WITHOUT "
4262 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4263 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4268 #: ../src/guestfs.pod:2204
4270 "You should have received a copy of the GNU Lesser General Public License "
4271 "along with this library; if not, write to the Free Software Foundation, "
4272 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4276 #: ../src/guestfs-actions.pod:1
4277 msgid "guestfs_add_cdrom"
4281 #: ../src/guestfs-actions.pod:3
4285 " guestfs_add_cdrom (guestfs_h *g,\n"
4286 " const char *filename);\n"
4291 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4292 msgid "This function adds a virtual CD-ROM disk image to the guest."
4296 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4297 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4301 #: ../src/guestfs-actions.pod:17
4303 "This call checks for the existence of C<filename>. This stops you from "
4304 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4305 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4310 #: ../src/guestfs-actions.pod:24
4312 "If you just want to add an ISO file (often you use this as an efficient way "
4313 "to transfer large files into the guest), then you should probably use "
4314 "C<guestfs_add_drive_ro> instead."
4318 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:128
4319 #: ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:226
4320 #: ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261
4321 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:295
4322 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4323 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:489
4324 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4325 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:635
4326 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:664
4327 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
4328 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
4329 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:990
4330 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1092
4331 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1129
4332 #: ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1163
4333 #: ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264
4334 #: ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1326
4335 #: ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1466
4336 #: ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706
4337 #: ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:2243
4338 #: ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2448
4339 #: ../src/guestfs-actions.pod:2483 ../src/guestfs-actions.pod:3222
4340 #: ../src/guestfs-actions.pod:3237 ../src/guestfs-actions.pod:3257
4341 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3424
4342 #: ../src/guestfs-actions.pod:3437 ../src/guestfs-actions.pod:3451
4343 #: ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3502
4344 #: ../src/guestfs-actions.pod:3574 ../src/guestfs-actions.pod:3594
4345 #: ../src/guestfs-actions.pod:3611 ../src/guestfs-actions.pod:3634
4346 #: ../src/guestfs-actions.pod:3657 ../src/guestfs-actions.pod:3689
4347 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:3727
4348 #: ../src/guestfs-actions.pod:3762 ../src/guestfs-actions.pod:3774
4349 #: ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:3826
4350 #: ../src/guestfs-actions.pod:3839 ../src/guestfs-actions.pod:3854
4351 #: ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:3964
4352 #: ../src/guestfs-actions.pod:3984 ../src/guestfs-actions.pod:3997
4353 #: ../src/guestfs-actions.pod:4048 ../src/guestfs-actions.pod:4066
4354 #: ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:4100
4355 #: ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4128
4356 #: ../src/guestfs-actions.pod:4145 ../src/guestfs-actions.pod:4160
4357 #: ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4224
4358 #: ../src/guestfs-actions.pod:4295 ../src/guestfs-actions.pod:4326
4359 #: ../src/guestfs-actions.pod:4345 ../src/guestfs-actions.pod:4364
4360 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:4393
4361 #: ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4421
4362 #: ../src/guestfs-actions.pod:4436 ../src/guestfs-actions.pod:4471
4363 #: ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4506
4364 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4537
4365 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4623
4366 #: ../src/guestfs-actions.pod:4637 ../src/guestfs-actions.pod:4665
4367 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4700
4368 #: ../src/guestfs-actions.pod:4834 ../src/guestfs-actions.pod:4891
4369 #: ../src/guestfs-actions.pod:4913 ../src/guestfs-actions.pod:4931
4370 #: ../src/guestfs-actions.pod:4963 ../src/guestfs-actions.pod:5029
4371 #: ../src/guestfs-actions.pod:5046 ../src/guestfs-actions.pod:5059
4372 #: ../src/guestfs-actions.pod:5073 ../src/guestfs-actions.pod:5362
4373 #: ../src/guestfs-actions.pod:5381 ../src/guestfs-actions.pod:5395
4374 #: ../src/guestfs-actions.pod:5407 ../src/guestfs-actions.pod:5421
4375 #: ../src/guestfs-actions.pod:5433 ../src/guestfs-actions.pod:5447
4376 #: ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5484
4377 #: ../src/guestfs-actions.pod:5503 ../src/guestfs-actions.pod:5522
4378 #: ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5563
4379 #: ../src/guestfs-actions.pod:5581 ../src/guestfs-actions.pod:5600
4380 #: ../src/guestfs-actions.pod:5621 ../src/guestfs-actions.pod:5640
4381 #: ../src/guestfs-actions.pod:5657 ../src/guestfs-actions.pod:5685
4382 #: ../src/guestfs-actions.pod:5709 ../src/guestfs-actions.pod:5728
4383 #: ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:5767
4384 #: ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:5801
4385 #: ../src/guestfs-actions.pod:5838 ../src/guestfs-actions.pod:5861
4386 #: ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:5995
4387 #: ../src/guestfs-actions.pod:6116 ../src/guestfs-actions.pod:6128
4388 #: ../src/guestfs-actions.pod:6141 ../src/guestfs-actions.pod:6154
4389 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6189
4390 #: ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6215
4391 #: ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6289
4392 #: ../src/guestfs-actions.pod:6306 ../src/guestfs-actions.pod:6322
4393 #: ../src/guestfs-actions.pod:6338 ../src/guestfs-actions.pod:6355
4394 #: ../src/guestfs-actions.pod:6368 ../src/guestfs-actions.pod:6388
4395 #: ../src/guestfs-actions.pod:6424 ../src/guestfs-actions.pod:6438
4396 #: ../src/guestfs-actions.pod:6479 ../src/guestfs-actions.pod:6492
4397 #: ../src/guestfs-actions.pod:6510 ../src/guestfs-actions.pod:6544
4398 #: ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:6699
4399 #: ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6731
4400 #: ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:6799
4401 #: ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6877
4402 #: ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6957
4403 #: ../src/guestfs-actions.pod:7023 ../src/guestfs-actions.pod:7042
4404 #: ../src/guestfs-actions.pod:7071
4405 msgid "This function returns 0 on success or -1 on error."
4409 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:242
4410 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:28
4411 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4413 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4418 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:245
4419 #: ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:1437
4420 #: ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1944
4421 #: ../src/guestfs-actions.pod:4185 ../src/guestfs-actions.pod:6965
4422 #: ../src/guestfs-actions.pod:7134 ../fish/guestfish-actions.pod:31
4423 #: ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170
4424 #: ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308
4425 #: ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:2818
4426 #: ../fish/guestfish-actions.pod:4620 ../fish/guestfish-actions.pod:4717
4428 "Deprecated functions will not be removed from the API, but the fact that "
4429 "they are deprecated indicates that there are problems with correct use of "
4434 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:130
4435 #: ../src/guestfs-actions.pod:1094 ../src/guestfs-actions.pod:1895
4436 #: ../src/guestfs-actions.pod:1993 ../src/guestfs-actions.pod:2096
4437 #: ../src/guestfs-actions.pod:3224 ../src/guestfs-actions.pod:3239
4438 #: ../src/guestfs-actions.pod:4473 ../src/guestfs-actions.pod:5542
4439 #: ../src/guestfs-actions.pod:5659 ../src/guestfs-actions.pod:5769
4440 #: ../src/guestfs-actions.pod:6232 ../src/guestfs-actions.pod:6357
4441 #: ../src/guestfs-actions.pod:6879
4442 msgid "(Added in 0.3)"
4446 #: ../src/guestfs-actions.pod:41
4447 msgid "guestfs_add_domain"
4451 #: ../src/guestfs-actions.pod:43
4455 " guestfs_add_domain (guestfs_h *g,\n"
4456 " const char *dom,\n"
4462 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:139
4463 #: ../src/guestfs-actions.pod:4199
4465 "You may supply a list of optional arguments to this call. Use zero or more "
4466 "of the following pairs of parameters, and terminate the list with C<-1> on "
4467 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4471 #: ../src/guestfs-actions.pod:53
4474 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4475 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4476 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4481 #: ../src/guestfs-actions.pod:57
4483 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4484 "It works by connecting to libvirt, requesting the domain and domain XML from "
4485 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4490 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4492 "The number of disks added is returned. This operation is atomic: if an "
4493 "error is returned, then no disks are added."
4497 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4499 "This function does some minimal checks to make sure the libvirt domain is "
4500 "not running (unless C<readonly> is true). In a future version we will try "
4501 "to acquire the libvirt lock on each disk."
4505 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4507 "Disks must be accessible locally. This often means that adding disks from a "
4508 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4509 "unless those disks are accessible via the same device path locally too."
4513 #: ../src/guestfs-actions.pod:74
4515 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4516 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4517 "libvirt URI (or one set through an environment variable, see the libvirt "
4518 "documentation for full details). If you are using the C API directly then "
4519 "it is more flexible to create the libvirt connection object yourself, get "
4520 "the domain object, and call C<guestfs_add_libvirt_dom>."
4524 #: ../src/guestfs-actions.pod:82
4526 "The other optional parameters are passed directly through to "
4527 "C<guestfs_add_drive_opts>."
4531 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:338
4532 #: ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:681
4533 #: ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730
4534 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:1309
4535 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1866
4536 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2005
4537 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2083
4538 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2662
4539 #: ../src/guestfs-actions.pod:2683 ../src/guestfs-actions.pod:4609
4540 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:5143
4541 #: ../src/guestfs-actions.pod:5169 ../src/guestfs-actions.pod:6465
4542 #: ../src/guestfs-actions.pod:6890 ../src/guestfs-actions.pod:6903
4543 #: ../src/guestfs-actions.pod:6916
4544 msgid "On error this function returns -1."
4548 #: ../src/guestfs-actions.pod:87
4549 msgid "(Added in 1.7.4)"
4553 #: ../src/guestfs-actions.pod:89
4554 msgid "guestfs_add_domain_va"
4558 #: ../src/guestfs-actions.pod:91
4562 " guestfs_add_domain_va (guestfs_h *g,\n"
4563 " const char *dom,\n"
4569 #: ../src/guestfs-actions.pod:96
4570 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4574 #: ../src/guestfs-actions.pod:98 ../src/guestfs-actions.pod:109
4575 #: ../src/guestfs-actions.pod:202 ../src/guestfs-actions.pod:213
4576 #: ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4248
4577 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4581 #: ../src/guestfs-actions.pod:100
4582 msgid "guestfs_add_domain_argv"
4586 #: ../src/guestfs-actions.pod:102
4590 " guestfs_add_domain_argv (guestfs_h *g,\n"
4591 " const char *dom,\n"
4592 " const struct guestfs_add_domain_argv *optargs);\n"
4597 #: ../src/guestfs-actions.pod:107
4598 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4602 #: ../src/guestfs-actions.pod:111
4603 msgid "guestfs_add_drive"
4607 #: ../src/guestfs-actions.pod:113
4611 " guestfs_add_drive (guestfs_h *g,\n"
4612 " const char *filename);\n"
4617 #: ../src/guestfs-actions.pod:117
4619 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4620 "optional parameters, so the disk is added writable, with the format being "
4621 "detected automatically."
4625 #: ../src/guestfs-actions.pod:121
4627 "Automatic detection of the format opens you up to a potential security hole "
4628 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4629 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4630 "you should think about replacing calls to this function with calls to "
4631 "C<guestfs_add_drive_opts>, and specifying the format."
4635 #: ../src/guestfs-actions.pod:132
4636 msgid "guestfs_add_drive_opts"
4640 #: ../src/guestfs-actions.pod:134
4644 " guestfs_add_drive_opts (guestfs_h *g,\n"
4645 " const char *filename,\n"
4651 #: ../src/guestfs-actions.pod:144
4654 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4655 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4656 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4661 #: ../src/guestfs-actions.pod:148 ../fish/guestfish-actions.pod:92
4663 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4664 "The first time you call this function, the disk appears as C</dev/sda>, the "
4665 "second time as C</dev/sdb>, and so on."
4669 #: ../src/guestfs-actions.pod:153 ../fish/guestfish-actions.pod:97
4671 "You don't necessarily need to be root when using libguestfs. However you "
4672 "obviously do need sufficient permissions to access the filename for whatever "
4673 "operations you want to perform (ie. read access if you just want to read the "
4674 "image or write access if you want to modify the image)."
4678 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:103
4679 msgid "This call checks that C<filename> exists."
4683 #: ../src/guestfs-actions.pod:161 ../src/guestfs-actions.pod:4209
4684 #: ../fish/guestfish-actions.pod:105 ../fish/guestfish-actions.pod:2829
4685 msgid "The optional arguments are:"
4689 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
4694 #: ../src/guestfs-actions.pod:167 ../fish/guestfish-actions.pod:111
4696 "If true then the image is treated as read-only. Writes are still allowed, "
4697 "but they are stored in a temporary snapshot overlay which is discarded at "
4698 "the end. The disk that you add is not modified."
4702 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:115
4707 #: ../src/guestfs-actions.pod:173
4709 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4710 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4711 "Possible formats include C<raw> and C<qcow2>."
4715 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:121
4717 "Automatic detection of the format opens you up to a potential security hole "
4718 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4719 "RHBZ#642934. Specifying the format closes this security hole."
4723 #: ../src/guestfs-actions.pod:182 ../fish/guestfish-actions.pod:126
4728 #: ../src/guestfs-actions.pod:184
4730 "This rarely-used option lets you emulate the behaviour of the deprecated "
4731 "C<guestfs_add_drive_with_if> call (q.v.)"
4735 #: ../src/guestfs-actions.pod:191
4736 msgid "(Added in 1.5.23)"
4740 #: ../src/guestfs-actions.pod:193
4741 msgid "guestfs_add_drive_opts_va"
4745 #: ../src/guestfs-actions.pod:195
4749 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4750 " const char *filename,\n"
4756 #: ../src/guestfs-actions.pod:200
4757 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4761 #: ../src/guestfs-actions.pod:204
4762 msgid "guestfs_add_drive_opts_argv"
4766 #: ../src/guestfs-actions.pod:206
4770 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4771 " const char *filename,\n"
4772 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4777 #: ../src/guestfs-actions.pod:211
4778 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4782 #: ../src/guestfs-actions.pod:215
4783 msgid "guestfs_add_drive_ro"
4787 #: ../src/guestfs-actions.pod:217
4791 " guestfs_add_drive_ro (guestfs_h *g,\n"
4792 " const char *filename);\n"
4797 #: ../src/guestfs-actions.pod:221
4799 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4800 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4801 "disk is added read-only, with the format being detected automatically."
4805 #: ../src/guestfs-actions.pod:228
4806 msgid "(Added in 1.0.38)"
4810 #: ../src/guestfs-actions.pod:230
4811 msgid "guestfs_add_drive_ro_with_if"
4815 #: ../src/guestfs-actions.pod:232
4819 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4820 " const char *filename,\n"
4821 " const char *iface);\n"
4826 #: ../src/guestfs-actions.pod:237
4828 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4829 "QEMU interface emulation to use at run time."
4833 #: ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
4834 #: ../src/guestfs-actions.pod:2333
4835 msgid "(Added in 1.0.84)"
4839 #: ../src/guestfs-actions.pod:251
4840 msgid "guestfs_add_drive_with_if"
4844 #: ../src/guestfs-actions.pod:253
4848 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4849 " const char *filename,\n"
4850 " const char *iface);\n"
4855 #: ../src/guestfs-actions.pod:258
4857 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4858 "QEMU interface emulation to use at run time."
4862 #: ../src/guestfs-actions.pod:272
4863 msgid "guestfs_aug_clear"
4867 #: ../src/guestfs-actions.pod:274
4871 " guestfs_aug_clear (guestfs_h *g,\n"
4872 " const char *augpath);\n"
4877 #: ../src/guestfs-actions.pod:278 ../fish/guestfish-actions.pod:178
4879 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4880 "L<augtool(1)> C<clear> command."
4884 #: ../src/guestfs-actions.pod:283 ../src/guestfs-actions.pod:2085
4885 msgid "(Added in 1.3.4)"
4889 #: ../src/guestfs-actions.pod:285
4890 msgid "guestfs_aug_close"
4894 #: ../src/guestfs-actions.pod:287
4898 " guestfs_aug_close (guestfs_h *g);\n"
4903 #: ../src/guestfs-actions.pod:290
4905 "Close the current Augeas handle and free up any resources used by it. After "
4906 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4907 "any other Augeas functions."
4911 #: ../src/guestfs-actions.pod:297 ../src/guestfs-actions.pod:322
4912 #: ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:354
4913 #: ../src/guestfs-actions.pod:412 ../src/guestfs-actions.pod:432
4914 #: ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:477
4915 #: ../src/guestfs-actions.pod:491 ../src/guestfs-actions.pod:505
4916 #: ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:537
4917 #: ../src/guestfs-actions.pod:5220
4918 msgid "(Added in 0.7)"
4922 #: ../src/guestfs-actions.pod:299
4923 msgid "guestfs_aug_defnode"
4927 #: ../src/guestfs-actions.pod:301
4930 " struct guestfs_int_bool *\n"
4931 " guestfs_aug_defnode (guestfs_h *g,\n"
4932 " const char *name,\n"
4933 " const char *expr,\n"
4934 " const char *val);\n"
4939 #: ../src/guestfs-actions.pod:307 ../fish/guestfish-actions.pod:194
4941 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4945 #: ../src/guestfs-actions.pod:310
4947 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4948 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4949 "containing that single node."
4953 #: ../src/guestfs-actions.pod:314 ../fish/guestfish-actions.pod:201
4955 "On success this returns a pair containing the number of nodes in the "
4956 "nodeset, and a boolean flag if a node was created."
4960 #: ../src/guestfs-actions.pod:318
4962 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4963 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4967 #: ../src/guestfs-actions.pod:324
4968 msgid "guestfs_aug_defvar"
4972 #: ../src/guestfs-actions.pod:326
4976 " guestfs_aug_defvar (guestfs_h *g,\n"
4977 " const char *name,\n"
4978 " const char *expr);\n"
4983 #: ../src/guestfs-actions.pod:331 ../fish/guestfish-actions.pod:209
4985 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4986 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4990 #: ../src/guestfs-actions.pod:335 ../fish/guestfish-actions.pod:213
4992 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4993 "evaluates to something which is not a nodeset."
4997 #: ../src/guestfs-actions.pod:342
4998 msgid "guestfs_aug_get"
5002 #: ../src/guestfs-actions.pod:344
5006 " guestfs_aug_get (guestfs_h *g,\n"
5007 " const char *augpath);\n"
5012 #: ../src/guestfs-actions.pod:348 ../fish/guestfish-actions.pod:220
5014 "Look up the value associated with C<path>. If C<path> matches exactly one "
5015 "node, the C<value> is returned."
5019 #: ../src/guestfs-actions.pod:351 ../src/guestfs-actions.pod:851
5020 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:929
5021 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1048
5022 #: ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1195
5023 #: ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1343
5024 #: ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1646
5025 #: ../src/guestfs-actions.pod:1809 ../src/guestfs-actions.pod:1826
5026 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1938
5027 #: ../src/guestfs-actions.pod:2108 ../src/guestfs-actions.pod:2298
5028 #: ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2586
5029 #: ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2744
5030 #: ../src/guestfs-actions.pod:2775 ../src/guestfs-actions.pod:2799
5031 #: ../src/guestfs-actions.pod:2861 ../src/guestfs-actions.pod:2884
5032 #: ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3746
5033 #: ../src/guestfs-actions.pod:3916 ../src/guestfs-actions.pod:4026
5034 #: ../src/guestfs-actions.pod:4755 ../src/guestfs-actions.pod:4948
5035 #: ../src/guestfs-actions.pod:5118 ../src/guestfs-actions.pod:5296
5036 #: ../src/guestfs-actions.pod:5345 ../src/guestfs-actions.pod:5908
5037 #: ../src/guestfs-actions.pod:5924 ../src/guestfs-actions.pod:5941
5038 #: ../src/guestfs-actions.pod:5965 ../src/guestfs-actions.pod:6639
5039 #: ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6676
5040 #: ../src/guestfs-actions.pod:6856 ../src/guestfs-actions.pod:7128
5042 "This function returns a string, or NULL on error. I<The caller must free "
5043 "the returned string after use>."
5047 #: ../src/guestfs-actions.pod:356
5048 msgid "guestfs_aug_init"
5052 #: ../src/guestfs-actions.pod:358
5056 " guestfs_aug_init (guestfs_h *g,\n"
5057 " const char *root,\n"
5063 #: ../src/guestfs-actions.pod:363 ../fish/guestfish-actions.pod:227
5065 "Create a new Augeas handle for editing configuration files. If there was "
5066 "any previous Augeas handle associated with this guestfs session, then it is "
5071 #: ../src/guestfs-actions.pod:367
5072 msgid "You must call this before using any other C<guestfs_aug_*> commands."
5076 #: ../src/guestfs-actions.pod:370 ../fish/guestfish-actions.pod:234
5078 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5082 #: ../src/guestfs-actions.pod:373 ../fish/guestfish-actions.pod:237
5084 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5085 "logical I<or> of the following integers:"
5089 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
5090 msgid "C<AUG_SAVE_BACKUP> = 1"
5094 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
5095 msgid "Keep the original file with a C<.augsave> extension."
5099 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
5100 msgid "C<AUG_SAVE_NEWFILE> = 2"
5104 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:249
5106 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5107 "original. Overrides C<AUG_SAVE_BACKUP>."
5111 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
5112 msgid "C<AUG_TYPE_CHECK> = 4"
5116 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
5117 msgid "Typecheck lenses (can be expensive)."
5121 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
5122 msgid "C<AUG_NO_STDINC> = 8"
5126 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
5127 msgid "Do not use standard load path for modules."
5131 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
5132 msgid "C<AUG_SAVE_NOOP> = 16"
5136 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
5137 msgid "Make save a no-op, just record what would have been changed."
5141 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:264
5142 msgid "C<AUG_NO_LOAD> = 32"
5146 #: ../src/guestfs-actions.pod:402
5147 msgid "Do not load the tree in C<guestfs_aug_init>."
5151 #: ../src/guestfs-actions.pod:406
5152 msgid "To close the handle, you can call C<guestfs_aug_close>."
5156 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:272
5157 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5161 #: ../src/guestfs-actions.pod:414
5162 msgid "guestfs_aug_insert"
5166 #: ../src/guestfs-actions.pod:416
5170 " guestfs_aug_insert (guestfs_h *g,\n"
5171 " const char *augpath,\n"
5172 " const char *label,\n"
5178 #: ../src/guestfs-actions.pod:422 ../fish/guestfish-actions.pod:278
5180 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5181 "or after C<path> (depending on the boolean flag C<before>)."
5185 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:282
5187 "C<path> must match exactly one existing node in the tree, and C<label> must "
5188 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5192 #: ../src/guestfs-actions.pod:434
5193 msgid "guestfs_aug_load"
5197 #: ../src/guestfs-actions.pod:436
5201 " guestfs_aug_load (guestfs_h *g);\n"
5206 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
5207 msgid "Load files into the tree."
5211 #: ../src/guestfs-actions.pod:441 ../fish/guestfish-actions.pod:292
5212 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5216 #: ../src/guestfs-actions.pod:448
5217 msgid "guestfs_aug_ls"
5221 #: ../src/guestfs-actions.pod:450
5225 " guestfs_aug_ls (guestfs_h *g,\n"
5226 " const char *augpath);\n"
5231 #: ../src/guestfs-actions.pod:454
5233 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5234 "sorting the resulting nodes into alphabetical order."
5238 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:473
5239 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:1067
5240 #: ../src/guestfs-actions.pod:1358 ../src/guestfs-actions.pod:1377
5241 #: ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1499
5242 #: ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:2178
5243 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2213
5244 #: ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2280
5245 #: ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2400
5246 #: ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2818
5247 #: ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:3316
5248 #: ../src/guestfs-actions.pod:3378 ../src/guestfs-actions.pod:3483
5249 #: ../src/guestfs-actions.pod:3888 ../src/guestfs-actions.pod:4570
5250 #: ../src/guestfs-actions.pod:5090 ../src/guestfs-actions.pod:5216
5251 #: ../src/guestfs-actions.pod:5330 ../src/guestfs-actions.pod:5981
5252 #: ../src/guestfs-actions.pod:6042 ../src/guestfs-actions.pod:6097
5253 #: ../src/guestfs-actions.pod:6243 ../src/guestfs-actions.pod:6267
5254 #: ../src/guestfs-actions.pod:6749 ../src/guestfs-actions.pod:6769
5255 #: ../src/guestfs-actions.pod:6816 ../src/guestfs-actions.pod:6981
5256 #: ../src/guestfs-actions.pod:7000 ../src/guestfs-actions.pod:7085
5257 #: ../src/guestfs-actions.pod:7104 ../src/guestfs-actions.pod:7150
5258 #: ../src/guestfs-actions.pod:7169
5260 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5261 ">), or NULL if there was an error. I<The caller must free the strings and "
5262 "the array after use>."
5266 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:992
5267 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:1415
5268 #: ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3142
5269 #: ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:3779
5270 #: ../src/guestfs-actions.pod:3966 ../src/guestfs-actions.pod:3999
5271 #: ../src/guestfs-actions.pod:4162 ../src/guestfs-actions.pod:4574
5272 #: ../src/guestfs-actions.pod:5031 ../src/guestfs-actions.pod:5409
5273 #: ../src/guestfs-actions.pod:5423 ../src/guestfs-actions.pod:5435
5274 #: ../src/guestfs-actions.pod:5843 ../src/guestfs-actions.pod:6481
5275 #: ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6733
5276 #: ../src/guestfs-actions.pod:6936 ../src/guestfs-actions.pod:6969
5277 msgid "(Added in 0.8)"
5281 #: ../src/guestfs-actions.pod:463
5282 msgid "guestfs_aug_match"
5286 #: ../src/guestfs-actions.pod:465
5290 " guestfs_aug_match (guestfs_h *g,\n"
5291 " const char *augpath);\n"
5296 #: ../src/guestfs-actions.pod:469 ../fish/guestfish-actions.pod:306
5298 "Returns a list of paths which match the path expression C<path>. The "
5299 "returned paths are sufficiently qualified so that they match exactly one "
5300 "node in the current tree."
5304 #: ../src/guestfs-actions.pod:479
5305 msgid "guestfs_aug_mv"
5309 #: ../src/guestfs-actions.pod:481
5313 " guestfs_aug_mv (guestfs_h *g,\n"
5314 " const char *src,\n"
5315 " const char *dest);\n"
5320 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:314
5322 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5323 "C<dest> is overwritten if it exists."
5327 #: ../src/guestfs-actions.pod:493
5328 msgid "guestfs_aug_rm"
5332 #: ../src/guestfs-actions.pod:495
5336 " guestfs_aug_rm (guestfs_h *g,\n"
5337 " const char *augpath);\n"
5342 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5343 msgid "Remove C<path> and all of its children."
5347 #: ../src/guestfs-actions.pod:501 ../fish/guestfish-actions.pod:323
5348 msgid "On success this returns the number of entries which were removed."
5352 #: ../src/guestfs-actions.pod:507
5353 msgid "guestfs_aug_save"
5357 #: ../src/guestfs-actions.pod:509
5361 " guestfs_aug_save (guestfs_h *g);\n"
5366 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:329
5367 msgid "This writes all pending changes to disk."
5371 #: ../src/guestfs-actions.pod:514
5373 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5378 #: ../src/guestfs-actions.pod:521
5379 msgid "guestfs_aug_set"
5383 #: ../src/guestfs-actions.pod:523
5387 " guestfs_aug_set (guestfs_h *g,\n"
5388 " const char *augpath,\n"
5389 " const char *val);\n"
5394 #: ../src/guestfs-actions.pod:528 ../fish/guestfish-actions.pod:338
5395 msgid "Set the value associated with C<path> to C<val>."
5399 #: ../src/guestfs-actions.pod:530
5401 "In the Augeas API, it is possible to clear a node by setting the value to "
5402 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5403 "this call. Instead you must use the C<guestfs_aug_clear> call."
5407 #: ../src/guestfs-actions.pod:539
5408 msgid "guestfs_available"
5412 #: ../src/guestfs-actions.pod:541
5416 " guestfs_available (guestfs_h *g,\n"
5417 " char *const *groups);\n"
5422 #: ../src/guestfs-actions.pod:545 ../fish/guestfish-actions.pod:349
5424 "This command is used to check the availability of some groups of "
5425 "functionality in the appliance, which not all builds of the libguestfs "
5426 "appliance will be able to provide."
5430 #: ../src/guestfs-actions.pod:549
5432 "The libguestfs groups, and the functions that those groups correspond to, "
5433 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5434 "runtime by calling C<guestfs_available_all_groups>."
5438 #: ../src/guestfs-actions.pod:554 ../fish/guestfish-actions.pod:358
5440 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5441 "\"]> would check for the availability of the Linux inotify functions and "
5442 "Augeas (configuration file editing) functions."
5446 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5447 msgid "The command returns no error if I<all> requested groups are available."
5451 #: ../src/guestfs-actions.pod:561 ../fish/guestfish-actions.pod:365
5453 "It fails with an error if one or more of the requested groups is unavailable "
5458 #: ../src/guestfs-actions.pod:564 ../fish/guestfish-actions.pod:368
5460 "If an unknown group name is included in the list of groups then an error is "
5465 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:371
5470 #: ../src/guestfs-actions.pod:573
5471 msgid "You must call C<guestfs_launch> before calling this function."
5475 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:379
5477 "The reason is because we don't know what groups are supported by the "
5478 "appliance/daemon until it is running and can be queried."
5482 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:385
5484 "If a group of functions is available, this does not necessarily mean that "
5485 "they will work. You still have to check for errors when calling individual "
5486 "API functions even if they are available."
5490 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:392
5492 "It is usually the job of distro packagers to build complete functionality "
5493 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5494 "with all requirements satisfied, will support everything."
5498 #: ../src/guestfs-actions.pod:595
5500 "This call was added in version C<1.0.80>. In previous versions of "
5501 "libguestfs all you could do would be to speculatively execute a command to "
5502 "find out if the daemon implemented it. See also C<guestfs_version>."
5506 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1165
5507 msgid "(Added in 1.0.80)"
5511 #: ../src/guestfs-actions.pod:606
5512 msgid "guestfs_available_all_groups"
5516 #: ../src/guestfs-actions.pod:608
5520 " guestfs_available_all_groups (guestfs_h *g);\n"
5525 #: ../src/guestfs-actions.pod:611
5527 "This command returns a list of all optional groups that this daemon knows "
5528 "about. Note this returns both supported and unsupported groups. To find "
5529 "out which ones the daemon can actually support you have to call "
5530 "C<guestfs_available> on each member of the returned list."
5534 #: ../src/guestfs-actions.pod:617
5535 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5539 #: ../src/guestfs-actions.pod:623
5540 msgid "(Added in 1.3.15)"
5544 #: ../src/guestfs-actions.pod:625
5545 msgid "guestfs_base64_in"
5549 #: ../src/guestfs-actions.pod:627
5553 " guestfs_base64_in (guestfs_h *g,\n"
5554 " const char *base64file,\n"
5555 " const char *filename);\n"
5560 #: ../src/guestfs-actions.pod:632 ../fish/guestfish-actions.pod:422
5562 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5566 #: ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:651
5567 msgid "(Added in 1.3.5)"
5571 #: ../src/guestfs-actions.pod:639
5572 msgid "guestfs_base64_out"
5576 #: ../src/guestfs-actions.pod:641
5580 " guestfs_base64_out (guestfs_h *g,\n"
5581 " const char *filename,\n"
5582 " const char *base64file);\n"
5587 #: ../src/guestfs-actions.pod:646 ../fish/guestfish-actions.pod:431
5589 "This command downloads the contents of C<filename>, writing it out to local "
5590 "file C<base64file> encoded as base64."
5594 #: ../src/guestfs-actions.pod:653
5595 msgid "guestfs_blockdev_flushbufs"
5599 #: ../src/guestfs-actions.pod:655
5603 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5604 " const char *device);\n"
5609 #: ../src/guestfs-actions.pod:659 ../fish/guestfish-actions.pod:440
5611 "This tells the kernel to flush internal buffers associated with C<device>."
5615 #: ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:679
5616 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:710
5617 #: ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747
5618 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
5619 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
5620 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5621 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5622 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5623 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5624 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5625 msgid "This uses the L<blockdev(8)> command."
5629 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:683
5630 #: ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:714
5631 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:751
5632 #: ../src/guestfs-actions.pod:765 ../src/guestfs-actions.pod:783
5633 #: ../src/guestfs-actions.pod:797 ../src/guestfs-actions.pod:811
5634 msgid "(Added in 0.9.3)"
5638 #: ../src/guestfs-actions.pod:668
5639 msgid "guestfs_blockdev_getbsz"
5643 #: ../src/guestfs-actions.pod:670
5647 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5648 " const char *device);\n"
5653 #: ../src/guestfs-actions.pod:674 ../fish/guestfish-actions.pod:449
5654 msgid "This returns the block size of a device."
5658 #: ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:776
5659 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5661 "(Note this is different from both I<size in blocks> and I<filesystem block "
5666 #: ../src/guestfs-actions.pod:685
5667 msgid "guestfs_blockdev_getro"
5671 #: ../src/guestfs-actions.pod:687
5675 " guestfs_blockdev_getro (guestfs_h *g,\n"
5676 " const char *device);\n"
5681 #: ../src/guestfs-actions.pod:691 ../fish/guestfish-actions.pod:460
5683 "Returns a boolean indicating if the block device is read-only (true if read-"
5684 "only, false if not)."
5688 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:1398
5689 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1893
5690 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1976
5691 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2046
5692 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2094
5693 #: ../src/guestfs-actions.pod:3050 ../src/guestfs-actions.pod:3064
5694 #: ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3093
5695 #: ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3124
5696 #: ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3154
5697 #: ../src/guestfs-actions.pod:3167 ../src/guestfs-actions.pod:3181
5698 #: ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211
5699 #: ../src/guestfs-actions.pod:4719
5700 msgid "This function returns a C truth value on success or -1 on error."
5704 #: ../src/guestfs-actions.pod:700
5705 msgid "guestfs_blockdev_getsize64"
5709 #: ../src/guestfs-actions.pod:702
5713 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5714 " const char *device);\n"
5719 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:469
5720 msgid "This returns the size of the device in bytes."
5724 #: ../src/guestfs-actions.pod:708
5725 msgid "See also C<guestfs_blockdev_getsz>."
5729 #: ../src/guestfs-actions.pod:716
5730 msgid "guestfs_blockdev_getss"
5734 #: ../src/guestfs-actions.pod:718
5738 " guestfs_blockdev_getss (guestfs_h *g,\n"
5739 " const char *device);\n"
5744 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:479
5746 "This returns the size of sectors on a block device. Usually 512, but can be "
5747 "larger for modern devices."
5751 #: ../src/guestfs-actions.pod:725
5753 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5758 #: ../src/guestfs-actions.pod:734
5759 msgid "guestfs_blockdev_getsz"
5763 #: ../src/guestfs-actions.pod:736
5767 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5768 " const char *device);\n"
5773 #: ../src/guestfs-actions.pod:740 ../fish/guestfish-actions.pod:491
5775 "This returns the size of the device in units of 512-byte sectors (even if "
5776 "the sectorsize isn't 512 bytes ... weird)."
5780 #: ../src/guestfs-actions.pod:743
5782 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5783 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5787 #: ../src/guestfs-actions.pod:753
5788 msgid "guestfs_blockdev_rereadpt"
5792 #: ../src/guestfs-actions.pod:755
5796 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5797 " const char *device);\n"
5802 #: ../src/guestfs-actions.pod:759 ../fish/guestfish-actions.pod:504
5803 msgid "Reread the partition table on C<device>."
5807 #: ../src/guestfs-actions.pod:767
5808 msgid "guestfs_blockdev_setbsz"
5812 #: ../src/guestfs-actions.pod:769
5816 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5817 " const char *device,\n"
5818 " int blocksize);\n"
5823 #: ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:512
5824 msgid "This sets the block size of a device."
5828 #: ../src/guestfs-actions.pod:785
5829 msgid "guestfs_blockdev_setro"
5833 #: ../src/guestfs-actions.pod:787
5837 " guestfs_blockdev_setro (guestfs_h *g,\n"
5838 " const char *device);\n"
5843 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:523
5844 msgid "Sets the block device named C<device> to read-only."
5848 #: ../src/guestfs-actions.pod:799
5849 msgid "guestfs_blockdev_setrw"
5853 #: ../src/guestfs-actions.pod:801
5857 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5858 " const char *device);\n"
5863 #: ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:531
5864 msgid "Sets the block device named C<device> to read-write."
5868 #: ../src/guestfs-actions.pod:813
5869 msgid "guestfs_case_sensitive_path"
5873 #: ../src/guestfs-actions.pod:815
5877 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5878 " const char *path);\n"
5883 #: ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:539
5885 "This can be used to resolve case insensitive paths on a filesystem which is "
5886 "case sensitive. The use case is to resolve paths which you have read from "
5887 "Windows configuration files or the Windows Registry, to the true path."
5891 #: ../src/guestfs-actions.pod:824 ../fish/guestfish-actions.pod:544
5893 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5894 "(and probably others), which is that although the underlying filesystem is "
5895 "case-insensitive, the driver exports the filesystem to Linux as case-"
5900 #: ../src/guestfs-actions.pod:829 ../fish/guestfish-actions.pod:549
5902 "One consequence of this is that special directories such as C<c:\\windows> "
5903 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5904 "precise details of how they were created. In Windows itself this would not "
5909 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:555
5911 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5916 #: ../src/guestfs-actions.pod:838 ../fish/guestfish-actions.pod:558
5918 "This function resolves the true case of each element in the path and returns "
5919 "the case-sensitive path."
5923 #: ../src/guestfs-actions.pod:841
5925 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5926 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5927 "how the directories were originally created under Windows)."
5931 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:566
5932 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5936 #: ../src/guestfs-actions.pod:849
5937 msgid "See also C<guestfs_realpath>."
5941 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:6661
5942 msgid "(Added in 1.0.75)"
5946 #: ../src/guestfs-actions.pod:856
5951 #: ../src/guestfs-actions.pod:858
5955 " guestfs_cat (guestfs_h *g,\n"
5956 " const char *path);\n"
5961 #: ../src/guestfs-actions.pod:862 ../src/guestfs-actions.pod:5206
5962 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3464
5963 msgid "Return the contents of the file named C<path>."
5967 #: ../src/guestfs-actions.pod:864
5969 "Note that this function cannot correctly handle binary files (specifically, "
5970 "files containing C<\\0> character which is treated as end of string). For "
5971 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5972 "functions which have a more complex interface."
5976 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1051
5977 #: ../src/guestfs-actions.pod:1071 ../src/guestfs-actions.pod:1362
5978 #: ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1484
5979 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1752
5980 #: ../src/guestfs-actions.pod:2198 ../src/guestfs-actions.pod:2217
5981 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2284
5982 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2330
5983 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5014
5984 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5171
5985 #: ../src/guestfs-actions.pod:5195 ../src/guestfs-actions.pod:6046
5986 #: ../src/guestfs-actions.pod:6101 ../src/guestfs-actions.pod:6247
5987 #: ../src/guestfs-actions.pod:6271 ../src/guestfs-actions.pod:6933
5988 #: ../src/guestfs-actions.pod:6959 ../src/guestfs-actions.pod:6985
5989 #: ../src/guestfs-actions.pod:7004 ../src/guestfs-actions.pod:7089
5990 #: ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7154
5991 #: ../src/guestfs-actions.pod:7173 ../fish/guestfish-actions.pod:582
5992 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5993 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5994 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5995 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1482
5996 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:1520
5997 #: ../fish/guestfish-actions.pod:1535 ../fish/guestfish-actions.pod:1545
5998 #: ../fish/guestfish-actions.pod:1564 ../fish/guestfish-actions.pod:3334
5999 #: ../fish/guestfish-actions.pod:3349 ../fish/guestfish-actions.pod:3425
6000 #: ../fish/guestfish-actions.pod:3442 ../fish/guestfish-actions.pod:3457
6001 #: ../fish/guestfish-actions.pod:4040 ../fish/guestfish-actions.pod:4086
6002 #: ../fish/guestfish-actions.pod:4171 ../fish/guestfish-actions.pod:4186
6003 #: ../fish/guestfish-actions.pod:4596 ../fish/guestfish-actions.pod:4614
6004 #: ../fish/guestfish-actions.pod:4631 ../fish/guestfish-actions.pod:4641
6005 #: ../fish/guestfish-actions.pod:4689 ../fish/guestfish-actions.pod:4699
6006 #: ../fish/guestfish-actions.pod:4728 ../fish/guestfish-actions.pod:4738
6008 "Because of the message protocol, there is a transfer limit of somewhere "
6009 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6013 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:3320
6014 #: ../src/guestfs-actions.pod:3382 ../src/guestfs-actions.pod:3399
6015 #: ../src/guestfs-actions.pod:3487 ../src/guestfs-actions.pod:3892
6016 #: ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:5094
6017 #: ../src/guestfs-actions.pod:5108 ../src/guestfs-actions.pod:6820
6018 #: ../src/guestfs-actions.pod:6834
6019 msgid "(Added in 0.4)"
6023 #: ../src/guestfs-actions.pod:877
6024 msgid "guestfs_checksum"
6028 #: ../src/guestfs-actions.pod:879
6032 " guestfs_checksum (guestfs_h *g,\n"
6033 " const char *csumtype,\n"
6034 " const char *path);\n"
6039 #: ../src/guestfs-actions.pod:884 ../fish/guestfish-actions.pod:589
6041 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6045 #: ../src/guestfs-actions.pod:887 ../fish/guestfish-actions.pod:592
6047 "The type of checksum to compute is given by the C<csumtype> parameter which "
6048 "must have one of the following values:"
6052 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
6057 #: ../src/guestfs-actions.pod:894 ../fish/guestfish-actions.pod:599
6059 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6064 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
6069 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
6070 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6074 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
6079 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
6080 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6084 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
6089 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
6090 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6094 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
6099 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
6100 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6104 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
6109 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
6110 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6114 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
6119 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:624
6120 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6124 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:628
6125 msgid "The checksum is returned as a printable string."
6129 #: ../src/guestfs-actions.pod:925
6130 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6134 #: ../src/guestfs-actions.pod:927
6135 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6139 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:1240
6140 #: ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:3066
6141 #: ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3156
6142 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:6517
6143 msgid "(Added in 1.0.2)"
6147 #: ../src/guestfs-actions.pod:934
6148 msgid "guestfs_checksum_device"
6152 #: ../src/guestfs-actions.pod:936
6156 " guestfs_checksum_device (guestfs_h *g,\n"
6157 " const char *csumtype,\n"
6158 " const char *device);\n"
6163 #: ../src/guestfs-actions.pod:941
6165 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6166 "device named C<device>. For the types of checksums supported see the "
6167 "C<guestfs_checksum> command."
6171 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:4625
6172 #: ../src/guestfs-actions.pod:4684 ../src/guestfs-actions.pod:4721
6173 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4915
6174 #: ../src/guestfs-actions.pod:6426 ../src/guestfs-actions.pod:6440
6175 #: ../src/guestfs-actions.pod:6846
6176 msgid "(Added in 1.3.2)"
6180 #: ../src/guestfs-actions.pod:950
6181 msgid "guestfs_checksums_out"
6185 #: ../src/guestfs-actions.pod:952
6189 " guestfs_checksums_out (guestfs_h *g,\n"
6190 " const char *csumtype,\n"
6191 " const char *directory,\n"
6192 " const char *sumsfile);\n"
6197 #: ../src/guestfs-actions.pod:958 ../fish/guestfish-actions.pod:646
6199 "This command computes the checksums of all regular files in C<directory> and "
6200 "then emits a list of those checksums to the local output file C<sumsfile>."
6204 #: ../src/guestfs-actions.pod:962 ../fish/guestfish-actions.pod:650
6206 "This can be used for verifying the integrity of a virtual machine. However "
6207 "to be properly secure you should pay attention to the output of the checksum "
6208 "command (it uses the ones from GNU coreutils). In particular when the "
6209 "filename is not printable, coreutils uses a special backslash syntax. For "
6210 "more information, see the GNU coreutils info file."
6214 #: ../src/guestfs-actions.pod:972
6215 msgid "(Added in 1.3.7)"
6219 #: ../src/guestfs-actions.pod:974
6220 msgid "guestfs_chmod"
6224 #: ../src/guestfs-actions.pod:976
6228 " guestfs_chmod (guestfs_h *g,\n"
6230 " const char *path);\n"
6235 #: ../src/guestfs-actions.pod:981 ../fish/guestfish-actions.pod:664
6237 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6242 #: ../src/guestfs-actions.pod:984 ../fish/guestfish-actions.pod:667
6244 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6245 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6250 #: ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:4143
6251 #: ../src/guestfs-actions.pod:4324 ../src/guestfs-actions.pod:4343
6252 #: ../src/guestfs-actions.pod:4362 ../fish/guestfish-actions.pod:671
6253 #: ../fish/guestfish-actions.pod:2793 ../fish/guestfish-actions.pod:2909
6254 #: ../fish/guestfish-actions.pod:2919 ../fish/guestfish-actions.pod:2929
6255 msgid "The mode actually set is affected by the umask."
6259 #: ../src/guestfs-actions.pod:994
6260 msgid "guestfs_chown"
6264 #: ../src/guestfs-actions.pod:996
6268 " guestfs_chown (guestfs_h *g,\n"
6271 " const char *path);\n"
6276 #: ../src/guestfs-actions.pod:1002 ../fish/guestfish-actions.pod:677
6277 msgid "Change the file owner to C<owner> and group to C<group>."
6281 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:3253
6282 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2251
6284 "Only numeric uid and gid are supported. If you want to use names, you will "
6285 "need to locate and parse the password file yourself (Augeas support makes "
6286 "this relatively easy)."
6290 #: ../src/guestfs-actions.pod:1012
6291 msgid "guestfs_command"
6295 #: ../src/guestfs-actions.pod:1014
6299 " guestfs_command (guestfs_h *g,\n"
6300 " char *const *arguments);\n"
6305 #: ../src/guestfs-actions.pod:1018 ../fish/guestfish-actions.pod:687
6307 "This call runs a command from the guest filesystem. The filesystem must be "
6308 "mounted, and must contain a compatible operating system (ie. something "
6309 "Linux, with the same or compatible processor architecture)."
6313 #: ../src/guestfs-actions.pod:1023
6315 "The single parameter is an argv-style list of arguments. The first element "
6316 "is the name of the program to run. Subsequent elements are parameters. The "
6317 "list must be non-empty (ie. must contain a program name). Note that the "
6318 "command runs directly, and is I<not> invoked via the shell (see "
6323 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:699
6324 msgid "The return value is anything printed to I<stdout> by the command."
6328 #: ../src/guestfs-actions.pod:1033 ../fish/guestfish-actions.pod:702
6330 "If the command returns a non-zero exit status, then this function returns an "
6331 "error message. The error message string is the content of I<stderr> from "
6336 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:706
6338 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6339 "bin>. If you require a program from another location, you should provide "
6340 "the full path in the first parameter."
6344 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:711
6346 "Shared libraries and data files required by the program must be available on "
6347 "filesystems which are mounted in the correct places. It is the caller's "
6348 "responsibility to ensure all filesystems that are needed are mounted at the "
6353 #: ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1074
6354 #: ../src/guestfs-actions.pod:1537
6355 msgid "(Added in 0.9.1)"
6359 #: ../src/guestfs-actions.pod:1056
6360 msgid "guestfs_command_lines"
6364 #: ../src/guestfs-actions.pod:1058
6368 " guestfs_command_lines (guestfs_h *g,\n"
6369 " char *const *arguments);\n"
6374 #: ../src/guestfs-actions.pod:1062
6376 "This is the same as C<guestfs_command>, but splits the result into a list of "
6381 #: ../src/guestfs-actions.pod:1065
6382 msgid "See also: C<guestfs_sh_lines>"
6386 #: ../src/guestfs-actions.pod:1076
6387 msgid "guestfs_config"
6391 #: ../src/guestfs-actions.pod:1078
6395 " guestfs_config (guestfs_h *g,\n"
6396 " const char *qemuparam,\n"
6397 " const char *qemuvalue);\n"
6402 #: ../src/guestfs-actions.pod:1083 ../fish/guestfish-actions.pod:736
6404 "This can be used to add arbitrary qemu command line parameters of the form "
6405 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6406 "setting some parameters which would interfere with parameters that we use."
6410 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6411 msgid "The first character of C<param> string must be a C<-> (dash)."
6415 #: ../src/guestfs-actions.pod:1090 ../fish/guestfish-actions.pod:743
6416 msgid "C<value> can be NULL."
6420 #: ../src/guestfs-actions.pod:1096
6421 msgid "guestfs_copy_size"
6425 #: ../src/guestfs-actions.pod:1098
6429 " guestfs_copy_size (guestfs_h *g,\n"
6430 " const char *src,\n"
6431 " const char *dest,\n"
6437 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:749
6439 "This command copies exactly C<size> bytes from one source device or file "
6440 "C<src> to another destination device or file C<dest>."
6444 #: ../src/guestfs-actions.pod:1107 ../fish/guestfish-actions.pod:752
6446 "Note this will fail if the source is too short or if the destination is not "
6451 #: ../src/guestfs-actions.pod:1112 ../src/guestfs-actions.pod:1235
6452 #: ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1686
6453 #: ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:6512
6454 #: ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:7025
6455 #: ../src/guestfs-actions.pod:7044
6457 "This long-running command can generate progress notification messages so "
6458 "that the caller can display a progress bar or indicator. To receive these "
6459 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6460 "guestfs_set_progress_callback>."
6464 #: ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:3919
6465 #: ../src/guestfs-actions.pod:5121 ../src/guestfs-actions.pod:6753
6466 #: ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6859
6467 msgid "(Added in 1.0.87)"
6471 #: ../src/guestfs-actions.pod:1119
6476 #: ../src/guestfs-actions.pod:1121
6480 " guestfs_cp (guestfs_h *g,\n"
6481 " const char *src,\n"
6482 " const char *dest);\n"
6487 #: ../src/guestfs-actions.pod:1126 ../fish/guestfish-actions.pod:759
6489 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6490 "destination filename or destination directory."
6494 #: ../src/guestfs-actions.pod:1131 ../src/guestfs-actions.pod:1145
6495 #: ../src/guestfs-actions.pod:1217 ../src/guestfs-actions.pod:1291
6496 #: ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:4588
6497 #: ../src/guestfs-actions.pod:4965
6498 msgid "(Added in 1.0.18)"
6502 #: ../src/guestfs-actions.pod:1133
6503 msgid "guestfs_cp_a"
6507 #: ../src/guestfs-actions.pod:1135
6511 " guestfs_cp_a (guestfs_h *g,\n"
6512 " const char *src,\n"
6513 " const char *dest);\n"
6518 #: ../src/guestfs-actions.pod:1140 ../fish/guestfish-actions.pod:766
6520 "This copies a file or directory from C<src> to C<dest> recursively using the "
6525 #: ../src/guestfs-actions.pod:1147
6530 #: ../src/guestfs-actions.pod:1149
6534 " guestfs_dd (guestfs_h *g,\n"
6535 " const char *src,\n"
6536 " const char *dest);\n"
6541 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:773
6543 "This command copies from one source device or file C<src> to another "
6544 "destination device or file C<dest>. Normally you would use this to copy to "
6545 "or from a device or partition, for example to duplicate a filesystem."
6549 #: ../src/guestfs-actions.pod:1159
6551 "If the destination is a device, it must be as large or larger than the "
6552 "source file or device, otherwise the copy will fail. This command cannot do "
6553 "partial copies (see C<guestfs_copy_size>)."
6557 #: ../src/guestfs-actions.pod:1167
6562 #: ../src/guestfs-actions.pod:1169
6566 " guestfs_df (guestfs_h *g);\n"
6571 #: ../src/guestfs-actions.pod:1172 ../fish/guestfish-actions.pod:786
6572 msgid "This command runs the C<df> command to report disk space used."
6576 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1191
6577 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6579 "This command is mostly useful for interactive sessions. It is I<not> "
6580 "intended that you try to parse the output string. Use C<statvfs> from "
6585 #: ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1198
6586 #: ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2263
6587 #: ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2355
6588 #: ../src/guestfs-actions.pod:4029 ../src/guestfs-actions.pod:4488
6589 #: ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6274
6590 #: ../src/guestfs-actions.pod:6892 ../src/guestfs-actions.pod:6905
6591 #: ../src/guestfs-actions.pod:6918
6592 msgid "(Added in 1.0.54)"
6596 #: ../src/guestfs-actions.pod:1183
6597 msgid "guestfs_df_h"
6601 #: ../src/guestfs-actions.pod:1185
6605 " guestfs_df_h (guestfs_h *g);\n"
6610 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:796
6612 "This command runs the C<df -h> command to report disk space used in human-"
6617 #: ../src/guestfs-actions.pod:1200
6618 msgid "guestfs_dmesg"
6622 #: ../src/guestfs-actions.pod:1202
6626 " guestfs_dmesg (guestfs_h *g);\n"
6631 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:807
6633 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6634 "This is sometimes useful for extended debugging of problems."
6638 #: ../src/guestfs-actions.pod:1209
6640 "Another way to get the same information is to enable verbose messages with "
6641 "C<guestfs_set_verbose> or by setting the environment variable "
6642 "C<LIBGUESTFS_DEBUG=1> before running the program."
6646 #: ../src/guestfs-actions.pod:1219
6647 msgid "guestfs_download"
6651 #: ../src/guestfs-actions.pod:1221
6655 " guestfs_download (guestfs_h *g,\n"
6656 " const char *remotefilename,\n"
6657 " const char *filename);\n"
6662 #: ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1251
6663 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6665 "Download file C<remotefilename> and save it as C<filename> on the local "
6670 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:6506
6671 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4344
6672 msgid "C<filename> can also be a named pipe."
6676 #: ../src/guestfs-actions.pod:1231
6677 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6681 #: ../src/guestfs-actions.pod:1242
6682 msgid "guestfs_download_offset"
6686 #: ../src/guestfs-actions.pod:1244
6690 " guestfs_download_offset (guestfs_h *g,\n"
6691 " const char *remotefilename,\n"
6692 " const char *filename,\n"
6693 " int64_t offset,\n"
6699 #: ../src/guestfs-actions.pod:1254 ../fish/guestfish-actions.pod:836
6701 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6702 "region must be within the file or device)."
6706 #: ../src/guestfs-actions.pod:1257
6708 "Note that there is no limit on the amount of data that can be downloaded "
6709 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6710 "full amount unless an error occurs."
6714 #: ../src/guestfs-actions.pod:1262
6715 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6719 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:6551
6720 msgid "(Added in 1.5.17)"
6724 #: ../src/guestfs-actions.pod:1273
6725 msgid "guestfs_drop_caches"
6729 #: ../src/guestfs-actions.pod:1275
6733 " guestfs_drop_caches (guestfs_h *g,\n"
6734 " int whattodrop);\n"
6739 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:852
6741 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6742 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6743 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6747 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
6748 msgid "Setting C<whattodrop> to 3 should drop everything."
6752 #: ../src/guestfs-actions.pod:1286 ../fish/guestfish-actions.pod:859
6754 "This automatically calls L<sync(2)> before the operation, so that the "
6755 "maximum guest memory is freed."
6759 #: ../src/guestfs-actions.pod:1293
6764 #: ../src/guestfs-actions.pod:1295
6768 " guestfs_du (guestfs_h *g,\n"
6769 " const char *path);\n"
6774 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:866
6776 "This command runs the C<du -s> command to estimate file space usage for "
6781 #: ../src/guestfs-actions.pod:1302 ../fish/guestfish-actions.pod:869
6783 "C<path> can be a file or a directory. If C<path> is a directory then the "
6784 "estimate includes the contents of the directory and all subdirectories "
6789 #: ../src/guestfs-actions.pod:1306 ../fish/guestfish-actions.pod:873
6791 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6795 #: ../src/guestfs-actions.pod:1313
6796 msgid "guestfs_e2fsck_f"
6800 #: ../src/guestfs-actions.pod:1315
6804 " guestfs_e2fsck_f (guestfs_h *g,\n"
6805 " const char *device);\n"
6810 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:880
6812 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6813 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6818 #: ../src/guestfs-actions.pod:1323
6820 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6821 "Normally you should use C<guestfs_fsck>."
6825 #: ../src/guestfs-actions.pod:1328
6826 msgid "(Added in 1.0.29)"
6830 #: ../src/guestfs-actions.pod:1330
6831 msgid "guestfs_echo_daemon"
6835 #: ../src/guestfs-actions.pod:1332
6839 " guestfs_echo_daemon (guestfs_h *g,\n"
6840 " char *const *words);\n"
6845 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:891
6847 "This command concatenates the list of C<words> passed with single spaces "
6848 "between them and returns the resulting string."
6852 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:894
6853 msgid "You can use this command to test the connection through to the daemon."
6857 #: ../src/guestfs-actions.pod:1341
6858 msgid "See also C<guestfs_ping_daemon>."
6862 #: ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:2073
6863 #: ../src/guestfs-actions.pod:5754
6864 msgid "(Added in 1.0.69)"
6868 #: ../src/guestfs-actions.pod:1348
6869 msgid "guestfs_egrep"
6873 #: ../src/guestfs-actions.pod:1350
6877 " guestfs_egrep (guestfs_h *g,\n"
6878 " const char *regex,\n"
6879 " const char *path);\n"
6884 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:902
6886 "This calls the external C<egrep> program and returns the matching lines."
6890 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1384
6891 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1487
6892 #: ../src/guestfs-actions.pod:1506 ../src/guestfs-actions.pod:2201
6893 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2376
6894 #: ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2404
6895 #: ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2472
6896 #: ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:3412
6897 #: ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:3439
6898 #: ../src/guestfs-actions.pod:3453 ../src/guestfs-actions.pod:4423
6899 #: ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5348
6900 #: ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6130
6901 #: ../src/guestfs-actions.pod:6143 ../src/guestfs-actions.pod:6156
6902 #: ../src/guestfs-actions.pod:6178 ../src/guestfs-actions.pod:6191
6903 #: ../src/guestfs-actions.pod:6204 ../src/guestfs-actions.pod:6217
6904 #: ../src/guestfs-actions.pod:6988 ../src/guestfs-actions.pod:7007
6905 #: ../src/guestfs-actions.pod:7092 ../src/guestfs-actions.pod:7111
6906 #: ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7176
6907 msgid "(Added in 1.0.66)"
6911 #: ../src/guestfs-actions.pod:1367
6912 msgid "guestfs_egrepi"
6916 #: ../src/guestfs-actions.pod:1369
6920 " guestfs_egrepi (guestfs_h *g,\n"
6921 " const char *regex,\n"
6922 " const char *path);\n"
6927 #: ../src/guestfs-actions.pod:1374 ../fish/guestfish-actions.pod:912
6929 "This calls the external C<egrep -i> program and returns the matching lines."
6933 #: ../src/guestfs-actions.pod:1386
6934 msgid "guestfs_equal"
6938 #: ../src/guestfs-actions.pod:1388
6942 " guestfs_equal (guestfs_h *g,\n"
6943 " const char *file1,\n"
6944 " const char *file2);\n"
6949 #: ../src/guestfs-actions.pod:1393 ../fish/guestfish-actions.pod:922
6951 "This compares the two files C<file1> and C<file2> and returns true if their "
6952 "content is exactly equal, or false otherwise."
6956 #: ../src/guestfs-actions.pod:1396 ../fish/guestfish-actions.pod:925
6957 msgid "The external L<cmp(1)> program is used for the comparison."
6961 #: ../src/guestfs-actions.pod:1402
6962 msgid "guestfs_exists"
6966 #: ../src/guestfs-actions.pod:1404
6970 " guestfs_exists (guestfs_h *g,\n"
6971 " const char *path);\n"
6976 #: ../src/guestfs-actions.pod:1408 ../fish/guestfish-actions.pod:931
6978 "This returns C<true> if and only if there is a file, directory (or anything) "
6979 "with the given C<path> name."
6983 #: ../src/guestfs-actions.pod:1411
6984 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6988 #: ../src/guestfs-actions.pod:1417
6989 msgid "guestfs_fallocate"
6993 #: ../src/guestfs-actions.pod:1419
6997 " guestfs_fallocate (guestfs_h *g,\n"
6998 " const char *path,\n"
7004 #: ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1450
7005 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
7007 "This command preallocates a file (containing zero bytes) named C<path> of "
7008 "size C<len> bytes. If the file exists already, it is overwritten."
7012 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:944
7014 "Do not confuse this with the guestfish-specific C<alloc> command which "
7015 "allocates a file in the host and attaches it as a device."
7019 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:948
7021 "This function is deprecated. In new code, use the C<fallocate64> call "
7026 #: ../src/guestfs-actions.pod:1443
7027 msgid "guestfs_fallocate64"
7031 #: ../src/guestfs-actions.pod:1445
7035 " guestfs_fallocate64 (guestfs_h *g,\n"
7036 " const char *path,\n"
7042 #: ../src/guestfs-actions.pod:1454
7044 "Note that this call allocates disk blocks for the file. To create a sparse "
7045 "file use C<guestfs_truncate_size> instead."
7049 #: ../src/guestfs-actions.pod:1457
7051 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
7052 "oversight it only allowed 30 bit lengths to be specified, effectively "
7053 "limiting the maximum size of files created through that call to 1GB."
7057 #: ../src/guestfs-actions.pod:1462 ../fish/guestfish-actions.pod:971
7059 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7060 "commands which create a file in the host and attach it as a device."
7064 #: ../src/guestfs-actions.pod:1468
7065 msgid "(Added in 1.3.17)"
7069 #: ../src/guestfs-actions.pod:1470
7070 msgid "guestfs_fgrep"
7074 #: ../src/guestfs-actions.pod:1472
7078 " guestfs_fgrep (guestfs_h *g,\n"
7079 " const char *pattern,\n"
7080 " const char *path);\n"
7085 #: ../src/guestfs-actions.pod:1477 ../fish/guestfish-actions.pod:979
7087 "This calls the external C<fgrep> program and returns the matching lines."
7091 #: ../src/guestfs-actions.pod:1489
7092 msgid "guestfs_fgrepi"
7096 #: ../src/guestfs-actions.pod:1491
7100 " guestfs_fgrepi (guestfs_h *g,\n"
7101 " const char *pattern,\n"
7102 " const char *path);\n"
7107 #: ../src/guestfs-actions.pod:1496 ../fish/guestfish-actions.pod:989
7109 "This calls the external C<fgrep -i> program and returns the matching lines."
7113 #: ../src/guestfs-actions.pod:1508
7114 msgid "guestfs_file"
7118 #: ../src/guestfs-actions.pod:1510
7122 " guestfs_file (guestfs_h *g,\n"
7123 " const char *path);\n"
7128 #: ../src/guestfs-actions.pod:1514 ../fish/guestfish-actions.pod:999
7130 "This call uses the standard L<file(1)> command to determine the type or "
7131 "contents of the file."
7135 #: ../src/guestfs-actions.pod:1517 ../fish/guestfish-actions.pod:1002
7137 "This call will also transparently look inside various types of compressed "
7142 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1005
7144 "The exact command which runs is C<file -zb path>. Note in particular that "
7145 "the filename is not prepended to the output (the C<-b> option)."
7149 #: ../src/guestfs-actions.pod:1524
7151 "This command can also be used on C</dev/> devices (and partitions, LV "
7152 "names). You can for example use this to determine if a device contains a "
7153 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7157 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1014
7159 "If the C<path> does not begin with C</dev/> then this command only works for "
7160 "the content of regular files. For other file types (directory, symbolic "
7161 "link etc) it will just return the string C<directory> etc."
7165 #: ../src/guestfs-actions.pod:1539
7166 msgid "guestfs_file_architecture"
7170 #: ../src/guestfs-actions.pod:1541
7174 " guestfs_file_architecture (guestfs_h *g,\n"
7175 " const char *filename);\n"
7180 #: ../src/guestfs-actions.pod:1545 ../fish/guestfish-actions.pod:1023
7182 "This detects the architecture of the binary C<filename>, and returns it if "
7187 #: ../src/guestfs-actions.pod:1548 ../fish/guestfish-actions.pod:1026
7188 msgid "Currently defined architectures are:"
7192 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
7197 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1032
7199 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7200 "irrespective of the precise processor requirements of the binary."
7204 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
7209 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
7210 msgid "64 bit x86-64."
7214 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
7219 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
7220 msgid "32 bit SPARC."
7224 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
7229 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
7230 msgid "64 bit SPARC V9 and above."
7234 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
7239 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
7240 msgid "Intel Itanium."
7244 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
7249 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
7250 msgid "32 bit Power PC."
7254 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
7259 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1057
7260 msgid "64 bit Power PC."
7264 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
7265 msgid "Libguestfs may return other architecture strings in future."
7269 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1063
7270 msgid "The function works on at least the following types of files:"
7274 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1069
7275 msgid "many types of Un*x and Linux binary"
7279 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish-actions.pod:1073
7280 msgid "many types of Un*x and Linux shared library"
7284 #: ../src/guestfs-actions.pod:1599 ../fish/guestfish-actions.pod:1077
7285 msgid "Windows Win32 and Win64 binaries"
7289 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
7290 msgid "Windows Win32 and Win64 DLLs"
7294 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
7295 msgid "Win32 binaries and DLLs return C<i386>."
7299 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1085
7300 msgid "Win64 binaries and DLLs return C<x86_64>."
7304 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1089
7305 msgid "Linux kernel modules"
7309 #: ../src/guestfs-actions.pod:1615 ../fish/guestfish-actions.pod:1093
7310 msgid "Linux new-style initrd images"
7314 #: ../src/guestfs-actions.pod:1619 ../fish/guestfish-actions.pod:1097
7315 msgid "some non-x86 Linux vmlinuz kernels"
7319 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1101
7320 msgid "What it can't do currently:"
7324 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1107
7325 msgid "static libraries (libfoo.a)"
7329 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1111
7330 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7334 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
7335 msgid "x86 Linux vmlinuz kernels"
7339 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1117
7341 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7342 "compressed code, and are horribly hard to unpack. If you want to find the "
7343 "architecture of a kernel, use the architecture of the associated initrd or "
7344 "kernel module(s) instead."
7348 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1812
7349 #: ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:2508
7350 #: ../src/guestfs-actions.pod:2589 ../src/guestfs-actions.pod:2615
7351 #: ../src/guestfs-actions.pod:2664 ../src/guestfs-actions.pod:2685
7352 #: ../src/guestfs-actions.pod:2718 ../src/guestfs-actions.pod:2802
7353 #: ../src/guestfs-actions.pod:2864 ../src/guestfs-actions.pod:3037
7354 #: ../src/guestfs-actions.pod:3169
7355 msgid "(Added in 1.5.3)"
7359 #: ../src/guestfs-actions.pod:1651
7360 msgid "guestfs_filesize"
7364 #: ../src/guestfs-actions.pod:1653
7368 " guestfs_filesize (guestfs_h *g,\n"
7369 " const char *file);\n"
7374 #: ../src/guestfs-actions.pod:1657 ../fish/guestfish-actions.pod:1128
7375 msgid "This command returns the size of C<file> in bytes."
7379 #: ../src/guestfs-actions.pod:1659
7381 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7382 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7383 "devices, use C<guestfs_blockdev_getsize64>."
7387 #: ../src/guestfs-actions.pod:1665
7388 msgid "(Added in 1.0.82)"
7392 #: ../src/guestfs-actions.pod:1667
7393 msgid "guestfs_fill"
7397 #: ../src/guestfs-actions.pod:1669
7401 " guestfs_fill (guestfs_h *g,\n"
7404 " const char *path);\n"
7409 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1138
7411 "This command creates a new file called C<path>. The initial content of the "
7412 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7417 #: ../src/guestfs-actions.pod:1679
7419 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7420 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7421 "bytes use C<guestfs_fill_pattern>."
7425 #: ../src/guestfs-actions.pod:1691
7426 msgid "(Added in 1.0.79)"
7430 #: ../src/guestfs-actions.pod:1693
7431 msgid "guestfs_fill_pattern"
7435 #: ../src/guestfs-actions.pod:1695
7439 " guestfs_fill_pattern (guestfs_h *g,\n"
7440 " const char *pattern,\n"
7442 " const char *path);\n"
7447 #: ../src/guestfs-actions.pod:1701
7449 "This function is like C<guestfs_fill> except that it creates a new file of "
7450 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7451 "pattern is truncated if necessary to ensure the length of the file is "
7452 "exactly C<len> bytes."
7456 #: ../src/guestfs-actions.pod:1713
7457 msgid "(Added in 1.3.12)"
7461 #: ../src/guestfs-actions.pod:1715
7462 msgid "guestfs_find"
7466 #: ../src/guestfs-actions.pod:1717
7470 " guestfs_find (guestfs_h *g,\n"
7471 " const char *directory);\n"
7476 #: ../src/guestfs-actions.pod:1721 ../fish/guestfish-actions.pod:1160
7478 "This command lists out all files and directories, recursively, starting at "
7479 "C<directory>. It is essentially equivalent to running the shell command "
7480 "C<find directory -print> but some post-processing happens on the output, "
7485 #: ../src/guestfs-actions.pod:1726 ../fish/guestfish-actions.pod:1165
7487 "This returns a list of strings I<without any prefix>. Thus if the directory "
7492 #: ../src/guestfs-actions.pod:1729 ../fish/guestfish-actions.pod:1168
7502 #: ../src/guestfs-actions.pod:1733
7504 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7508 #: ../src/guestfs-actions.pod:1736 ../fish/guestfish-actions.pod:1175
7519 #: ../src/guestfs-actions.pod:1741 ../fish/guestfish-actions.pod:1180
7520 msgid "If C<directory> is not a directory, then this command returns an error."
7524 #: ../src/guestfs-actions.pod:1744 ../fish/guestfish-actions.pod:1183
7525 msgid "The returned list is sorted."
7529 #: ../src/guestfs-actions.pod:1746
7530 msgid "See also C<guestfs_find0>."
7534 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:3856
7535 #: ../src/guestfs-actions.pod:5383
7536 msgid "(Added in 1.0.27)"
7540 #: ../src/guestfs-actions.pod:1757
7541 msgid "guestfs_find0"
7545 #: ../src/guestfs-actions.pod:1759
7549 " guestfs_find0 (guestfs_h *g,\n"
7550 " const char *directory,\n"
7551 " const char *files);\n"
7556 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1194
7558 "This command lists out all files and directories, recursively, starting at "
7559 "C<directory>, placing the resulting list in the external file called "
7564 #: ../src/guestfs-actions.pod:1768
7566 "This command works the same way as C<guestfs_find> with the following "
7571 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1205
7572 msgid "The resulting list is written to an external file."
7576 #: ../src/guestfs-actions.pod:1779 ../fish/guestfish-actions.pod:1209
7578 "Items (filenames) in the result are separated by C<\\0> characters. See "
7579 "L<find(1)> option I<-print0>."
7583 #: ../src/guestfs-actions.pod:1784 ../fish/guestfish-actions.pod:1214
7584 msgid "This command is not limited in the number of names that it can return."
7588 #: ../src/guestfs-actions.pod:1789 ../fish/guestfish-actions.pod:1219
7589 msgid "The result list is not sorted."
7593 #: ../src/guestfs-actions.pod:1795
7594 msgid "(Added in 1.0.74)"
7598 #: ../src/guestfs-actions.pod:1797
7599 msgid "guestfs_findfs_label"
7603 #: ../src/guestfs-actions.pod:1799
7607 " guestfs_findfs_label (guestfs_h *g,\n"
7608 " const char *label);\n"
7613 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1229
7615 "This command searches the filesystems and returns the one which has the "
7616 "given label. An error is returned if no such filesystem can be found."
7620 #: ../src/guestfs-actions.pod:1807
7621 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7625 #: ../src/guestfs-actions.pod:1814
7626 msgid "guestfs_findfs_uuid"
7630 #: ../src/guestfs-actions.pod:1816
7634 " guestfs_findfs_uuid (guestfs_h *g,\n"
7635 " const char *uuid);\n"
7640 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
7642 "This command searches the filesystems and returns the one which has the "
7643 "given UUID. An error is returned if no such filesystem can be found."
7647 #: ../src/guestfs-actions.pod:1824
7648 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7652 #: ../src/guestfs-actions.pod:1831
7653 msgid "guestfs_fsck"
7657 #: ../src/guestfs-actions.pod:1833
7661 " guestfs_fsck (guestfs_h *g,\n"
7662 " const char *fstype,\n"
7663 " const char *device);\n"
7668 #: ../src/guestfs-actions.pod:1838 ../fish/guestfish-actions.pod:1249
7670 "This runs the filesystem checker (fsck) on C<device> which should have "
7671 "filesystem type C<fstype>."
7675 #: ../src/guestfs-actions.pod:1841 ../fish/guestfish-actions.pod:1252
7677 "The returned integer is the status. See L<fsck(8)> for the list of status "
7678 "codes from C<fsck>."
7682 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:1261
7683 msgid "Multiple status codes can be summed together."
7687 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1265
7689 "A non-zero return code can mean \"success\", for example if errors have been "
7690 "corrected on the filesystem."
7694 #: ../src/guestfs-actions.pod:1859 ../fish/guestfish-actions.pod:1270
7695 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7699 #: ../src/guestfs-actions.pod:1864 ../fish/guestfish-actions.pod:1275
7701 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7705 #: ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:7030
7706 msgid "(Added in 1.0.16)"
7710 #: ../src/guestfs-actions.pod:1870
7711 msgid "guestfs_get_append"
7715 #: ../src/guestfs-actions.pod:1872
7719 " guestfs_get_append (guestfs_h *g);\n"
7724 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1281
7726 "Return the additional kernel options which are added to the guest kernel "
7731 #: ../src/guestfs-actions.pod:1878 ../fish/guestfish-actions.pod:1284
7732 msgid "If C<NULL> then no options are added."
7736 #: ../src/guestfs-actions.pod:1880
7738 "This function returns a string which may be NULL. There is no way to return "
7739 "an error from this function. The string is owned by the guest handle and "
7740 "must I<not> be freed."
7744 #: ../src/guestfs-actions.pod:1884 ../src/guestfs-actions.pod:5061
7745 #: ../src/guestfs-actions.pod:5524 ../src/guestfs-actions.pod:5892
7746 #: ../src/guestfs-actions.pod:5911 ../src/guestfs-actions.pod:5927
7747 #: ../src/guestfs-actions.pod:5944 ../src/guestfs-actions.pod:6701
7748 #: ../src/guestfs-actions.pod:6719 ../src/guestfs-actions.pod:7073
7749 msgid "(Added in 1.0.26)"
7753 #: ../src/guestfs-actions.pod:1886
7754 msgid "guestfs_get_autosync"
7758 #: ../src/guestfs-actions.pod:1888
7762 " guestfs_get_autosync (guestfs_h *g);\n"
7767 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1290
7768 msgid "Get the autosync flag."
7772 #: ../src/guestfs-actions.pod:1897
7773 msgid "guestfs_get_direct"
7777 #: ../src/guestfs-actions.pod:1899
7781 " guestfs_get_direct (guestfs_h *g);\n"
7786 #: ../src/guestfs-actions.pod:1902 ../fish/guestfish-actions.pod:1296
7787 msgid "Return the direct appliance mode flag."
7791 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:5565
7792 msgid "(Added in 1.0.72)"
7796 #: ../src/guestfs-actions.pod:1908
7797 msgid "guestfs_get_e2label"
7801 #: ../src/guestfs-actions.pod:1910
7805 " guestfs_get_e2label (guestfs_h *g,\n"
7806 " const char *device);\n"
7811 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1302
7813 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7817 #: ../src/guestfs-actions.pod:1920 ../fish/guestfish-actions.pod:1305
7819 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7823 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1948
7824 #: ../src/guestfs-actions.pod:5583 ../src/guestfs-actions.pod:5602
7825 msgid "(Added in 1.0.15)"
7829 #: ../src/guestfs-actions.pod:1929
7830 msgid "guestfs_get_e2uuid"
7834 #: ../src/guestfs-actions.pod:1931
7838 " guestfs_get_e2uuid (guestfs_h *g,\n"
7839 " const char *device);\n"
7844 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1316
7846 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7850 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1319
7852 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7856 #: ../src/guestfs-actions.pod:1950
7857 msgid "guestfs_get_memsize"
7861 #: ../src/guestfs-actions.pod:1952
7865 " guestfs_get_memsize (guestfs_h *g);\n"
7870 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1330
7872 "This gets the memory size in megabytes allocated to the qemu subprocess."
7876 #: ../src/guestfs-actions.pod:1958
7878 "If C<guestfs_set_memsize> was not called on this handle, and if "
7879 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7880 "value for memsize."
7884 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:2043
7885 #: ../src/guestfs-actions.pod:5618 ../src/guestfs-actions.pod:5725
7886 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7887 #: ../fish/guestfish-actions.pod:3751 ../fish/guestfish-actions.pod:3838
7889 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7893 #: ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:4147
7894 #: ../src/guestfs-actions.pod:4328 ../src/guestfs-actions.pod:4347
7895 #: ../src/guestfs-actions.pod:4366 ../src/guestfs-actions.pod:4378
7896 #: ../src/guestfs-actions.pod:4395 ../src/guestfs-actions.pod:4408
7897 #: ../src/guestfs-actions.pod:5286 ../src/guestfs-actions.pod:5623
7898 #: ../src/guestfs-actions.pod:5866 ../src/guestfs-actions.pod:6467
7899 msgid "(Added in 1.0.55)"
7903 #: ../src/guestfs-actions.pod:1969
7904 msgid "guestfs_get_network"
7908 #: ../src/guestfs-actions.pod:1971
7912 " guestfs_get_network (guestfs_h *g);\n"
7917 #: ../src/guestfs-actions.pod:1974 ../fish/guestfish-actions.pod:1344
7918 msgid "This returns the enable network flag."
7922 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:5642
7923 msgid "(Added in 1.5.4)"
7927 #: ../src/guestfs-actions.pod:1980
7928 msgid "guestfs_get_path"
7932 #: ../src/guestfs-actions.pod:1982
7936 " guestfs_get_path (guestfs_h *g);\n"
7941 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
7942 msgid "Return the current search path."
7946 #: ../src/guestfs-actions.pod:1987 ../fish/guestfish-actions.pod:1352
7948 "This is always non-NULL. If it wasn't set already, then this will return "
7953 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:2019
7955 "This function returns a string, or NULL on error. The string is owned by "
7956 "the guest handle and must I<not> be freed."
7960 #: ../src/guestfs-actions.pod:1995
7961 msgid "guestfs_get_pid"
7965 #: ../src/guestfs-actions.pod:1997
7969 " guestfs_get_pid (guestfs_h *g);\n"
7974 #: ../src/guestfs-actions.pod:2000 ../fish/guestfish-actions.pod:1361
7976 "Return the process ID of the qemu subprocess. If there is no qemu "
7977 "subprocess, then this will return an error."
7981 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1364
7982 msgid "This is an internal call used for debugging and testing."
7986 #: ../src/guestfs-actions.pod:2007
7987 msgid "(Added in 1.0.56)"
7991 #: ../src/guestfs-actions.pod:2009
7992 msgid "guestfs_get_qemu"
7996 #: ../src/guestfs-actions.pod:2011
8000 " guestfs_get_qemu (guestfs_h *g);\n"
8005 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
8006 msgid "Return the current qemu binary."
8010 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
8012 "This is always non-NULL. If it wasn't set already, then this will return "
8013 "the default qemu binary name."
8017 #: ../src/guestfs-actions.pod:2022 ../src/guestfs-actions.pod:5687
8018 msgid "(Added in 1.0.6)"
8022 #: ../src/guestfs-actions.pod:2024
8023 msgid "guestfs_get_recovery_proc"
8027 #: ../src/guestfs-actions.pod:2026
8031 " guestfs_get_recovery_proc (guestfs_h *g);\n"
8036 #: ../src/guestfs-actions.pod:2029 ../fish/guestfish-actions.pod:1379
8037 msgid "Return the recovery process enabled flag."
8041 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:3259
8042 #: ../src/guestfs-actions.pod:3554 ../src/guestfs-actions.pod:3954
8043 #: ../src/guestfs-actions.pod:3986 ../src/guestfs-actions.pod:4991
8044 #: ../src/guestfs-actions.pod:5334 ../src/guestfs-actions.pod:5711
8045 #: ../src/guestfs-actions.pod:6370 ../src/guestfs-actions.pod:6390
8046 #: ../src/guestfs-actions.pod:6582
8047 msgid "(Added in 1.0.77)"
8051 #: ../src/guestfs-actions.pod:2035
8052 msgid "guestfs_get_selinux"
8056 #: ../src/guestfs-actions.pod:2037
8060 " guestfs_get_selinux (guestfs_h *g);\n"
8065 #: ../src/guestfs-actions.pod:2040
8067 "This returns the current setting of the selinux flag which is passed to the "
8068 "appliance at boot time. See C<guestfs_set_selinux>."
8072 #: ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2111
8073 #: ../src/guestfs-actions.pod:5730 ../src/guestfs-actions.pod:5784
8074 msgid "(Added in 1.0.67)"
8078 #: ../src/guestfs-actions.pod:2050
8079 msgid "guestfs_get_state"
8083 #: ../src/guestfs-actions.pod:2052
8087 " guestfs_get_state (guestfs_h *g);\n"
8092 #: ../src/guestfs-actions.pod:2055 ../fish/guestfish-actions.pod:1395
8094 "This returns the current state as an opaque integer. This is only useful "
8095 "for printing debug and internal error messages."
8099 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:3062
8100 #: ../src/guestfs-actions.pod:3091 ../src/guestfs-actions.pod:3152
8101 #: ../src/guestfs-actions.pod:3179 ../fish/guestfish-actions.pod:1398
8102 #: ../fish/guestfish-actions.pod:2133 ../fish/guestfish-actions.pod:2151
8103 #: ../fish/guestfish-actions.pod:2189 ../fish/guestfish-actions.pod:2205
8104 msgid "For more information on states, see L<guestfs(3)>."
8108 #: ../src/guestfs-actions.pod:2064
8109 msgid "guestfs_get_trace"
8113 #: ../src/guestfs-actions.pod:2066
8117 " guestfs_get_trace (guestfs_h *g);\n"
8122 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1404
8123 msgid "Return the command trace flag."
8127 #: ../src/guestfs-actions.pod:2075
8128 msgid "guestfs_get_umask"
8132 #: ../src/guestfs-actions.pod:2077
8136 " guestfs_get_umask (guestfs_h *g);\n"
8141 #: ../src/guestfs-actions.pod:2080
8143 "Return the current umask. By default the umask is C<022> unless it has been "
8144 "set by calling C<guestfs_umask>."
8148 #: ../src/guestfs-actions.pod:2087
8149 msgid "guestfs_get_verbose"
8153 #: ../src/guestfs-actions.pod:2089
8157 " guestfs_get_verbose (guestfs_h *g);\n"
8162 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
8163 msgid "This returns the verbose messages flag."
8167 #: ../src/guestfs-actions.pod:2098
8168 msgid "guestfs_getcon"
8172 #: ../src/guestfs-actions.pod:2100
8176 " guestfs_getcon (guestfs_h *g);\n"
8181 #: ../src/guestfs-actions.pod:2103 ../fish/guestfish-actions.pod:1423
8182 msgid "This gets the SELinux security context of the daemon."
8186 #: ../src/guestfs-actions.pod:2105
8188 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8192 #: ../src/guestfs-actions.pod:2113
8193 msgid "guestfs_getxattr"
8197 #: ../src/guestfs-actions.pod:2115
8201 " guestfs_getxattr (guestfs_h *g,\n"
8202 " const char *path,\n"
8203 " const char *name,\n"
8204 " size_t *size_r);\n"
8209 #: ../src/guestfs-actions.pod:2121
8211 "Get a single extended attribute from file C<path> named C<name>. This call "
8212 "follows symlinks. If you want to lookup an extended attribute for the "
8213 "symlink itself, use C<guestfs_lgetxattr>."
8217 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3273
8219 "Normally it is better to get all extended attributes from a file in one go "
8220 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
8221 "implementations are buggy and do not provide a way to list out attributes. "
8222 "For these filesystems (notably ntfs-3g) you have to know the names of the "
8223 "extended attributes you want in advance and call this function."
8227 #: ../src/guestfs-actions.pod:2132 ../src/guestfs-actions.pod:3280
8228 #: ../fish/guestfish-actions.pod:1443 ../fish/guestfish-actions.pod:2270
8230 "Extended attribute values are blobs of binary data. If there is no extended "
8231 "attribute named C<name>, this returns an error."
8235 #: ../src/guestfs-actions.pod:2135
8236 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
8240 #: ../src/guestfs-actions.pod:2137 ../src/guestfs-actions.pod:2326
8241 #: ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:4984
8242 #: ../src/guestfs-actions.pod:5010 ../src/guestfs-actions.pod:5191
8244 "This function returns a buffer, or NULL on error. The size of the returned "
8245 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8250 #: ../src/guestfs-actions.pod:2141
8251 msgid "guestfs_getxattrs"
8255 #: ../src/guestfs-actions.pod:2143
8258 " struct guestfs_xattr_list *\n"
8259 " guestfs_getxattrs (guestfs_h *g,\n"
8260 " const char *path);\n"
8265 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1452
8267 "This call lists the extended attributes of the file or directory C<path>."
8271 #: ../src/guestfs-actions.pod:2150 ../fish/guestfish-actions.pod:1455
8273 "At the system call level, this is a combination of the L<listxattr(2)> and "
8274 "L<getxattr(2)> calls."
8278 #: ../src/guestfs-actions.pod:2153
8279 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8283 #: ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:3299
8284 #: ../src/guestfs-actions.pod:3950
8286 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8287 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8291 #: ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3303
8292 #: ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:3504
8293 #: ../src/guestfs-actions.pod:5364 ../src/guestfs-actions.pod:5803
8294 #: ../src/guestfs-actions.pod:7138
8295 msgid "(Added in 1.0.59)"
8299 #: ../src/guestfs-actions.pod:2161
8300 msgid "guestfs_glob_expand"
8304 #: ../src/guestfs-actions.pod:2163
8308 " guestfs_glob_expand (guestfs_h *g,\n"
8309 " const char *pattern);\n"
8314 #: ../src/guestfs-actions.pod:2167 ../fish/guestfish-actions.pod:1464
8316 "This command searches for all the pathnames matching C<pattern> according to "
8317 "the wildcard expansion rules used by the shell."
8321 #: ../src/guestfs-actions.pod:2171 ../fish/guestfish-actions.pod:1468
8323 "If no paths match, then this returns an empty list (note: not an error)."
8327 #: ../src/guestfs-actions.pod:2174 ../fish/guestfish-actions.pod:1471
8329 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8330 "GLOB_BRACE>. See that manual page for more details."
8334 #: ../src/guestfs-actions.pod:2182 ../src/guestfs-actions.pod:5968
8335 #: ../src/guestfs-actions.pod:5985
8336 msgid "(Added in 1.0.50)"
8340 #: ../src/guestfs-actions.pod:2184
8341 msgid "guestfs_grep"
8345 #: ../src/guestfs-actions.pod:2186
8349 " guestfs_grep (guestfs_h *g,\n"
8350 " const char *regex,\n"
8351 " const char *path);\n"
8356 #: ../src/guestfs-actions.pod:2191 ../fish/guestfish-actions.pod:1479
8357 msgid "This calls the external C<grep> program and returns the matching lines."
8361 #: ../src/guestfs-actions.pod:2203
8362 msgid "guestfs_grepi"
8366 #: ../src/guestfs-actions.pod:2205
8370 " guestfs_grepi (guestfs_h *g,\n"
8371 " const char *regex,\n"
8372 " const char *path);\n"
8377 #: ../src/guestfs-actions.pod:2210 ../fish/guestfish-actions.pod:1489
8379 "This calls the external C<grep -i> program and returns the matching lines."
8383 #: ../src/guestfs-actions.pod:2222
8384 msgid "guestfs_grub_install"
8388 #: ../src/guestfs-actions.pod:2224
8392 " guestfs_grub_install (guestfs_h *g,\n"
8393 " const char *root,\n"
8394 " const char *device);\n"
8399 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1499
8401 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8402 "the root directory being C<root>."
8406 #: ../src/guestfs-actions.pod:2232 ../fish/guestfish-actions.pod:1502
8408 "Note: If grub-install reports the error \"No suitable drive was found in the "
8409 "generated device map.\" it may be that you need to create a C</boot/grub/"
8410 "device.map> file first that contains the mapping between grub device names "
8411 "and Linux device names. It is usually sufficient to create a file "
8416 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1509
8424 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1511
8425 msgid "replacing C</dev/vda> with the name of the installation device."
8429 #: ../src/guestfs-actions.pod:2245
8430 msgid "(Added in 1.0.17)"
8434 #: ../src/guestfs-actions.pod:2247
8435 msgid "guestfs_head"
8439 #: ../src/guestfs-actions.pod:2249
8443 " guestfs_head (guestfs_h *g,\n"
8444 " const char *path);\n"
8449 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1517
8451 "This command returns up to the first 10 lines of a file as a list of strings."
8455 #: ../src/guestfs-actions.pod:2265
8456 msgid "guestfs_head_n"
8460 #: ../src/guestfs-actions.pod:2267
8464 " guestfs_head_n (guestfs_h *g,\n"
8466 " const char *path);\n"
8471 #: ../src/guestfs-actions.pod:2272 ../fish/guestfish-actions.pod:1527
8473 "If the parameter C<nrlines> is a positive number, this returns the first "
8474 "C<nrlines> lines of the file C<path>."
8478 #: ../src/guestfs-actions.pod:2275 ../fish/guestfish-actions.pod:1530
8480 "If the parameter C<nrlines> is a negative number, this returns lines from "
8481 "the file C<path>, excluding the last C<nrlines> lines."
8485 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:6265
8486 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:4184
8487 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8491 #: ../src/guestfs-actions.pod:2289
8492 msgid "guestfs_hexdump"
8496 #: ../src/guestfs-actions.pod:2291
8500 " guestfs_hexdump (guestfs_h *g,\n"
8501 " const char *path);\n"
8506 #: ../src/guestfs-actions.pod:2295 ../fish/guestfish-actions.pod:1542
8508 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8509 "readable, canonical hex dump of the file."
8513 #: ../src/guestfs-actions.pod:2304 ../src/guestfs-actions.pod:6049
8514 #: ../src/guestfs-actions.pod:6104
8515 msgid "(Added in 1.0.22)"
8519 #: ../src/guestfs-actions.pod:2306
8520 msgid "guestfs_initrd_cat"
8524 #: ../src/guestfs-actions.pod:2308
8528 " guestfs_initrd_cat (guestfs_h *g,\n"
8529 " const char *initrdpath,\n"
8530 " const char *filename,\n"
8531 " size_t *size_r);\n"
8536 #: ../src/guestfs-actions.pod:2314 ../fish/guestfish-actions.pod:1552
8538 "This command unpacks the file C<filename> from the initrd file called "
8539 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8544 #: ../src/guestfs-actions.pod:2318 ../fish/guestfish-actions.pod:1556
8546 "For example, in guestfish you could use the following command to examine the "
8547 "boot script (usually called C</init>) contained in a Linux initrd or "
8552 #: ../src/guestfs-actions.pod:2322 ../fish/guestfish-actions.pod:1560
8555 " initrd-cat /boot/initrd-<version>.img init\n"
8560 #: ../src/guestfs-actions.pod:2324
8561 msgid "See also C<guestfs_initrd_list>."
8565 #: ../src/guestfs-actions.pod:2335
8566 msgid "guestfs_initrd_list"
8570 #: ../src/guestfs-actions.pod:2337
8574 " guestfs_initrd_list (guestfs_h *g,\n"
8575 " const char *path);\n"
8580 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1571
8581 msgid "This command lists out files contained in an initrd."
8585 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1573
8587 "The files are listed without any initial C</> character. The files are "
8588 "listed in the order they appear (not necessarily alphabetical). Directory "
8589 "names are listed as separate items."
8593 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1577
8595 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8596 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8601 #: ../src/guestfs-actions.pod:2357
8602 msgid "guestfs_inotify_add_watch"
8606 #: ../src/guestfs-actions.pod:2359
8610 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8611 " const char *path,\n"
8617 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1585
8618 msgid "Watch C<path> for the events listed in C<mask>."
8622 #: ../src/guestfs-actions.pod:2366 ../fish/guestfish-actions.pod:1587
8624 "Note that if C<path> is a directory then events within that directory are "
8625 "watched, but this does I<not> happen recursively (in subdirectories)."
8629 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1591
8631 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8632 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8636 #: ../src/guestfs-actions.pod:2378
8637 msgid "guestfs_inotify_close"
8641 #: ../src/guestfs-actions.pod:2380
8645 " guestfs_inotify_close (guestfs_h *g);\n"
8650 #: ../src/guestfs-actions.pod:2383 ../fish/guestfish-actions.pod:1599
8652 "This closes the inotify handle which was previously opened by inotify_init. "
8653 "It removes all watches, throws away any pending events, and deallocates all "
8658 #: ../src/guestfs-actions.pod:2391
8659 msgid "guestfs_inotify_files"
8663 #: ../src/guestfs-actions.pod:2393
8667 " guestfs_inotify_files (guestfs_h *g);\n"
8672 #: ../src/guestfs-actions.pod:2396
8674 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8675 "returns a list of pathnames of objects that were touched. The returned "
8676 "pathnames are sorted and deduplicated."
8680 #: ../src/guestfs-actions.pod:2406
8681 msgid "guestfs_inotify_init"
8685 #: ../src/guestfs-actions.pod:2408
8689 " guestfs_inotify_init (guestfs_h *g,\n"
8690 " int maxevents);\n"
8695 #: ../src/guestfs-actions.pod:2412 ../fish/guestfish-actions.pod:1615
8697 "This command creates a new inotify handle. The inotify subsystem can be "
8698 "used to notify events which happen to objects in the guest filesystem."
8702 #: ../src/guestfs-actions.pod:2416
8704 "C<maxevents> is the maximum number of events which will be queued up between "
8705 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8706 "passed as C<0>, then the kernel (or previously set) default is used. For "
8707 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8708 "throws away events, but records the fact that it threw them away by setting "
8709 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8710 "C<guestfs_inotify_read>)."
8714 #: ../src/guestfs-actions.pod:2426
8716 "Before any events are generated, you have to add some watches to the "
8717 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8718 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8722 #: ../src/guestfs-actions.pod:2432
8724 "Queued up events should be read periodically by calling "
8725 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8726 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8727 "often enough then you risk the internal queue overflowing."
8731 #: ../src/guestfs-actions.pod:2439
8733 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8734 "This also removes any watches automatically."
8738 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1646
8740 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8741 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8742 "that there is one global inotify handle per libguestfs instance."
8746 #: ../src/guestfs-actions.pod:2452
8747 msgid "guestfs_inotify_read"
8751 #: ../src/guestfs-actions.pod:2454
8754 " struct guestfs_inotify_event_list *\n"
8755 " guestfs_inotify_read (guestfs_h *g);\n"
8760 #: ../src/guestfs-actions.pod:2457 ../fish/guestfish-actions.pod:1655
8762 "Return the complete queue of events that have happened since the previous "
8767 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1658
8768 msgid "If no events have happened, this returns an empty list."
8772 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1660
8774 "I<Note>: In order to make sure that all events have been read, you must call "
8775 "this function repeatedly until it returns an empty list. The reason is that "
8776 "the call will read events up to the maximum appliance-to-host message size "
8777 "and leave remaining events in the queue."
8781 #: ../src/guestfs-actions.pod:2468
8783 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8784 "there was an error. I<The caller must call "
8785 "C<guestfs_free_inotify_event_list> after use>."
8789 #: ../src/guestfs-actions.pod:2474
8790 msgid "guestfs_inotify_rm_watch"
8794 #: ../src/guestfs-actions.pod:2476
8798 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8804 #: ../src/guestfs-actions.pod:2480
8806 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8810 #: ../src/guestfs-actions.pod:2487
8811 msgid "guestfs_inspect_get_arch"
8815 #: ../src/guestfs-actions.pod:2489
8819 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8820 " const char *root);\n"
8825 #: ../src/guestfs-actions.pod:2493 ../src/guestfs-actions.pod:2516
8826 #: ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2623
8827 #: ../src/guestfs-actions.pod:2645 ../src/guestfs-actions.pod:2672
8828 #: ../src/guestfs-actions.pod:2693 ../src/guestfs-actions.pod:2726
8829 #: ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:2786
8830 #: ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2872
8831 #: ../src/guestfs-actions.pod:2895
8833 "This function should only be called with a root device string as returned by "
8834 "C<guestfs_inspect_os>."
8838 #: ../src/guestfs-actions.pod:2496
8840 "This returns the architecture of the inspected operating system. The "
8841 "possible return values are listed under C<guestfs_file_architecture>."
8845 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1684
8847 "If the architecture could not be determined, then the string C<unknown> is "
8852 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2584
8853 #: ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2660
8854 #: ../src/guestfs-actions.pod:2742 ../src/guestfs-actions.pod:2773
8855 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:2816
8856 #: ../src/guestfs-actions.pod:2859 ../src/guestfs-actions.pod:2882
8857 #: ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3029
8858 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:1761
8859 #: ../fish/guestfish-actions.pod:1794 ../fish/guestfish-actions.pod:1815
8860 #: ../fish/guestfish-actions.pod:1875 ../fish/guestfish-actions.pod:1899
8861 #: ../fish/guestfish-actions.pod:1916 ../fish/guestfish-actions.pod:1929
8862 #: ../fish/guestfish-actions.pod:1964 ../fish/guestfish-actions.pod:1980
8863 #: ../fish/guestfish-actions.pod:2079 ../fish/guestfish-actions.pod:2113
8864 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8868 #: ../src/guestfs-actions.pod:2510
8869 msgid "guestfs_inspect_get_distro"
8873 #: ../src/guestfs-actions.pod:2512
8877 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8878 " const char *root);\n"
8883 #: ../src/guestfs-actions.pod:2519 ../fish/guestfish-actions.pod:1696
8885 "This returns the distro (distribution) of the inspected operating system."
8889 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1699
8890 msgid "Currently defined distros are:"
8894 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1703
8895 msgid "\"archlinux\""
8899 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1705
8904 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1707
8909 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1709
8914 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1711
8919 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1713
8924 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1715
8929 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1717
8934 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1719
8935 msgid "\"linuxmint\""
8939 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1721
8944 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1723
8945 msgid "\"mandriva\""
8949 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1725
8954 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1727
8959 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1729
8964 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1731
8969 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1733
8974 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1735
8975 msgid "\"redhat-based\""
8979 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1737
8980 msgid "Some Red Hat-derived distro."
8984 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1739
8989 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1741
8990 msgid "Red Hat Enterprise Linux and some derivatives."
8994 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1743
8999 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1745
9004 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2850
9005 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1955
9010 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1749
9011 msgid "The distro could not be determined."
9015 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:2842
9016 #: ../fish/guestfish-actions.pod:1751 ../fish/guestfish-actions.pod:1947
9021 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1753
9023 "Windows does not have distributions. This string is returned if the OS type "
9028 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2856
9029 #: ../fish/guestfish-actions.pod:1758 ../fish/guestfish-actions.pod:1961
9031 "Future versions of libguestfs may return other strings here. The caller "
9032 "should be prepared to handle any string."
9036 #: ../src/guestfs-actions.pod:2591
9037 msgid "guestfs_inspect_get_filesystems"
9041 #: ../src/guestfs-actions.pod:2593
9045 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
9046 " const char *root);\n"
9051 #: ../src/guestfs-actions.pod:2600 ../fish/guestfish-actions.pod:1770
9053 "This returns a list of all the filesystems that we think are associated with "
9054 "this operating system. This includes the root filesystem, other ordinary "
9055 "filesystems, and non-mounted devices like swap partitions."
9059 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1775
9061 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9062 "to be shared between operating systems."
9066 #: ../src/guestfs-actions.pod:2608
9068 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9069 "C<guestfs_inspect_get_mountpoints>."
9073 #: ../src/guestfs-actions.pod:2617
9074 msgid "guestfs_inspect_get_hostname"
9078 #: ../src/guestfs-actions.pod:2619
9082 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
9083 " const char *root);\n"
9088 #: ../src/guestfs-actions.pod:2626 ../fish/guestfish-actions.pod:1788
9090 "This function returns the hostname of the operating system as found by "
9091 "inspection of the guest's configuration files."
9095 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:1791
9097 "If the hostname could not be determined, then the string C<unknown> is "
9102 #: ../src/guestfs-actions.pod:2637
9103 msgid "(Added in 1.7.9)"
9107 #: ../src/guestfs-actions.pod:2639
9108 msgid "guestfs_inspect_get_major_version"
9112 #: ../src/guestfs-actions.pod:2641
9116 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
9117 " const char *root);\n"
9122 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:1803
9124 "This returns the major version number of the inspected operating system."
9128 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1806
9130 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9131 "popular public names used by the operating system. Notably the operating "
9132 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9133 "1). You can find out the real versions corresponding to releases of Windows "
9134 "by consulting Wikipedia or MSDN."
9138 #: ../src/guestfs-actions.pod:2658 ../src/guestfs-actions.pod:2678
9139 #: ../fish/guestfish-actions.pod:1813 ../fish/guestfish-actions.pod:1827
9140 msgid "If the version could not be determined, then C<0> is returned."
9144 #: ../src/guestfs-actions.pod:2666
9145 msgid "guestfs_inspect_get_minor_version"
9149 #: ../src/guestfs-actions.pod:2668
9153 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9154 " const char *root);\n"
9159 #: ../src/guestfs-actions.pod:2675 ../fish/guestfish-actions.pod:1824
9161 "This returns the minor version number of the inspected operating system."
9165 #: ../src/guestfs-actions.pod:2680
9167 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9168 "C<guestfs_inspect_get_major_version>."
9172 #: ../src/guestfs-actions.pod:2687
9173 msgid "guestfs_inspect_get_mountpoints"
9177 #: ../src/guestfs-actions.pod:2689
9181 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9182 " const char *root);\n"
9187 #: ../src/guestfs-actions.pod:2696 ../fish/guestfish-actions.pod:1839
9189 "This returns a hash of where we think the filesystems associated with this "
9190 "operating system should be mounted. Callers should note that this is at "
9191 "best an educated guess made by reading configuration files such as C</etc/"
9196 #: ../src/guestfs-actions.pod:2701 ../fish/guestfish-actions.pod:1844
9198 "Each element in the returned hashtable has a key which is the path of the "
9199 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9200 "mounted there (eg. C</dev/sda1>)."
9204 #: ../src/guestfs-actions.pod:2706 ../fish/guestfish-actions.pod:1849
9206 "Non-mounted devices such as swap devices are I<not> returned in this list."
9210 #: ../src/guestfs-actions.pod:2709
9212 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9213 "C<guestfs_inspect_get_filesystems>."
9217 #: ../src/guestfs-actions.pod:2712 ../src/guestfs-actions.pod:3356
9218 #: ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:6406
9220 "This function returns a NULL-terminated array of strings, or NULL if there "
9221 "was an error. The array of strings will always have length C<2n+1>, where "
9222 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9223 "caller must free the strings and the array after use>."
9227 #: ../src/guestfs-actions.pod:2720
9228 msgid "guestfs_inspect_get_package_format"
9232 #: ../src/guestfs-actions.pod:2722
9236 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9237 " const char *root);\n"
9242 #: ../src/guestfs-actions.pod:2729
9244 "This function and C<guestfs_inspect_get_package_management> return the "
9245 "package format and package management tool used by the inspected operating "
9246 "system. For example for Fedora these functions would return C<rpm> (package "
9247 "format) and C<yum> (package management)."
9251 #: ../src/guestfs-actions.pod:2735 ../fish/guestfish-actions.pod:1868
9253 "This returns the string C<unknown> if we could not determine the package "
9254 "format I<or> if the operating system does not have a real packaging system "
9259 #: ../src/guestfs-actions.pod:2739 ../fish/guestfish-actions.pod:1872
9261 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9262 "Future versions of libguestfs may return other strings."
9266 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2778
9267 msgid "(Added in 1.7.5)"
9271 #: ../src/guestfs-actions.pod:2749
9272 msgid "guestfs_inspect_get_package_management"
9276 #: ../src/guestfs-actions.pod:2751
9280 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9281 " const char *root);\n"
9286 #: ../src/guestfs-actions.pod:2758
9288 "C<guestfs_inspect_get_package_format> and this function return the package "
9289 "format and package management tool used by the inspected operating system. "
9290 "For example for Fedora these functions would return C<rpm> (package format) "
9291 "and C<yum> (package management)."
9295 #: ../src/guestfs-actions.pod:2764 ../fish/guestfish-actions.pod:1890
9297 "This returns the string C<unknown> if we could not determine the package "
9298 "management tool I<or> if the operating system does not have a real packaging "
9299 "system (eg. Windows)."
9303 #: ../src/guestfs-actions.pod:2768 ../fish/guestfish-actions.pod:1894
9305 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9306 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9307 "libguestfs may return other strings."
9311 #: ../src/guestfs-actions.pod:2780
9312 msgid "guestfs_inspect_get_product_name"
9316 #: ../src/guestfs-actions.pod:2782
9320 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9321 " const char *root);\n"
9326 #: ../src/guestfs-actions.pod:2789 ../fish/guestfish-actions.pod:1908
9328 "This returns the product name of the inspected operating system. The "
9329 "product name is generally some freeform string which can be displayed to the "
9330 "user, but should not be parsed by programs."
9334 #: ../src/guestfs-actions.pod:2794 ../fish/guestfish-actions.pod:1913
9336 "If the product name could not be determined, then the string C<unknown> is "
9341 #: ../src/guestfs-actions.pod:2804
9342 msgid "guestfs_inspect_get_roots"
9346 #: ../src/guestfs-actions.pod:2806
9350 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9355 #: ../src/guestfs-actions.pod:2809
9357 "This function is a convenient way to get the list of root devices, as "
9358 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9359 "the whole inspection process."
9363 #: ../src/guestfs-actions.pod:2813
9365 "This returns an empty list if either no root devices were found or the "
9366 "caller has not called C<guestfs_inspect_os>."
9370 #: ../src/guestfs-actions.pod:2822
9371 msgid "(Added in 1.7.3)"
9375 #: ../src/guestfs-actions.pod:2824
9376 msgid "guestfs_inspect_get_type"
9380 #: ../src/guestfs-actions.pod:2826
9384 " guestfs_inspect_get_type (guestfs_h *g,\n"
9385 " const char *root);\n"
9390 #: ../src/guestfs-actions.pod:2833 ../fish/guestfish-actions.pod:1938
9392 "This returns the type of the inspected operating system. Currently defined "
9397 #: ../src/guestfs-actions.pod:2838 ../fish/guestfish-actions.pod:1943
9402 #: ../src/guestfs-actions.pod:2840 ../fish/guestfish-actions.pod:1945
9403 msgid "Any Linux-based operating system."
9407 #: ../src/guestfs-actions.pod:2844 ../fish/guestfish-actions.pod:1949
9408 msgid "Any Microsoft Windows operating system."
9412 #: ../src/guestfs-actions.pod:2846 ../fish/guestfish-actions.pod:1951
9417 #: ../src/guestfs-actions.pod:2848 ../fish/guestfish-actions.pod:1953
9422 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1957
9423 msgid "The operating system type could not be determined."
9427 #: ../src/guestfs-actions.pod:2866
9428 msgid "guestfs_inspect_get_windows_systemroot"
9432 #: ../src/guestfs-actions.pod:2868
9436 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9437 " const char *root);\n"
9442 #: ../src/guestfs-actions.pod:2875 ../fish/guestfish-actions.pod:1973
9444 "This returns the Windows systemroot of the inspected guest. The systemroot "
9445 "is a directory path such as C</WINDOWS>."
9449 #: ../src/guestfs-actions.pod:2878 ../fish/guestfish-actions.pod:1976
9451 "This call assumes that the guest is Windows and that the systemroot could be "
9452 "determined by inspection. If this is not the case then an error is returned."
9456 #: ../src/guestfs-actions.pod:2887
9457 msgid "(Added in 1.5.25)"
9461 #: ../src/guestfs-actions.pod:2889
9462 msgid "guestfs_inspect_list_applications"
9466 #: ../src/guestfs-actions.pod:2891
9469 " struct guestfs_application_list *\n"
9470 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9471 " const char *root);\n"
9476 #: ../src/guestfs-actions.pod:2898 ../fish/guestfish-actions.pod:1989
9477 msgid "Return the list of applications installed in the operating system."
9481 #: ../src/guestfs-actions.pod:2900
9483 "I<Note:> This call works differently from other parts of the inspection "
9484 "API. You have to call C<guestfs_inspect_os>, then "
9485 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9486 "this. Listing applications is a significantly more difficult operation "
9487 "which requires access to the full filesystem. Also note that unlike the "
9488 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9489 "the libguestfs handle, this call actually reads parts of the mounted "
9490 "filesystems during the call."
9494 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:2001
9496 "This returns an empty list if the inspection code was not able to determine "
9497 "the list of applications."
9501 #: ../src/guestfs-actions.pod:2913 ../fish/guestfish-actions.pod:2004
9502 msgid "The application structure contains the following fields:"
9506 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:2008
9511 #: ../src/guestfs-actions.pod:2919 ../fish/guestfish-actions.pod:2010
9513 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9514 "guests, this is the package name."
9518 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2013
9519 msgid "C<app_display_name>"
9523 #: ../src/guestfs-actions.pod:2924 ../fish/guestfish-actions.pod:2015
9525 "The display name of the application, sometimes localized to the install "
9526 "language of the guest operating system."
9530 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2018
9532 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9533 "to display something can use C<app_name> instead."
9537 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2021
9538 msgid "C<app_epoch>"
9542 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2023
9544 "For package managers which use epochs, this contains the epoch of the "
9545 "package (an integer). If unavailable, this is returned as C<0>."
9549 #: ../src/guestfs-actions.pod:2935 ../fish/guestfish-actions.pod:2026
9550 msgid "C<app_version>"
9554 #: ../src/guestfs-actions.pod:2937 ../fish/guestfish-actions.pod:2028
9556 "The version string of the application or package. If unavailable this is "
9557 "returned as an empty string C<\"\">."
9561 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2031
9562 msgid "C<app_release>"
9566 #: ../src/guestfs-actions.pod:2942 ../fish/guestfish-actions.pod:2033
9568 "The release string of the application or package, for package managers that "
9569 "use this. If unavailable this is returned as an empty string C<\"\">."
9573 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2037
9574 msgid "C<app_install_path>"
9578 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2039
9580 "The installation path of the application (on operating systems such as "
9581 "Windows which use installation paths). This path is in the format used by "
9582 "the guest operating system, it is not a libguestfs path."
9586 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2044
9587 msgid "If unavailable this is returned as an empty string C<\"\">."
9591 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2046
9592 msgid "C<app_trans_path>"
9596 #: ../src/guestfs-actions.pod:2957 ../fish/guestfish-actions.pod:2048
9598 "The install path translated into a libguestfs path. If unavailable this is "
9599 "returned as an empty string C<\"\">."
9603 #: ../src/guestfs-actions.pod:2960 ../fish/guestfish-actions.pod:2051
9604 msgid "C<app_publisher>"
9608 #: ../src/guestfs-actions.pod:2962 ../fish/guestfish-actions.pod:2053
9610 "The name of the publisher of the application, for package managers that use "
9611 "this. If unavailable this is returned as an empty string C<\"\">."
9615 #: ../src/guestfs-actions.pod:2966 ../fish/guestfish-actions.pod:2057
9620 #: ../src/guestfs-actions.pod:2968 ../fish/guestfish-actions.pod:2059
9622 "The URL (eg. upstream URL) of the application. If unavailable this is "
9623 "returned as an empty string C<\"\">."
9627 #: ../src/guestfs-actions.pod:2971 ../fish/guestfish-actions.pod:2062
9628 msgid "C<app_source_package>"
9632 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2064
9634 "For packaging systems which support this, the name of the source package. "
9635 "If unavailable this is returned as an empty string C<\"\">."
9639 #: ../src/guestfs-actions.pod:2976 ../fish/guestfish-actions.pod:2067
9640 msgid "C<app_summary>"
9644 #: ../src/guestfs-actions.pod:2978 ../fish/guestfish-actions.pod:2069
9646 "A short (usually one line) description of the application or package. If "
9647 "unavailable this is returned as an empty string C<\"\">."
9651 #: ../src/guestfs-actions.pod:2981 ../fish/guestfish-actions.pod:2072
9652 msgid "C<app_description>"
9656 #: ../src/guestfs-actions.pod:2983 ../fish/guestfish-actions.pod:2074
9658 "A longer description of the application or package. If unavailable this is "
9659 "returned as an empty string C<\"\">."
9663 #: ../src/guestfs-actions.pod:2990
9665 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9666 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9671 #: ../src/guestfs-actions.pod:2994
9672 msgid "(Added in 1.7.8)"
9676 #: ../src/guestfs-actions.pod:2996
9677 msgid "guestfs_inspect_os"
9681 #: ../src/guestfs-actions.pod:2998
9685 " guestfs_inspect_os (guestfs_h *g);\n"
9690 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2085
9692 "This function uses other libguestfs functions and certain heuristics to "
9693 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9694 "for operating systems."
9698 #: ../src/guestfs-actions.pod:3005 ../fish/guestfish-actions.pod:2089
9699 msgid "The list returned is empty if no operating systems were found."
9703 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2091
9705 "If one operating system was found, then this returns a list with a single "
9706 "element, which is the name of the root filesystem of this operating system. "
9707 "It is also possible for this function to return a list containing more than "
9708 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9709 "element being the root filesystem of one of the operating systems."
9713 #: ../src/guestfs-actions.pod:3014
9715 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9716 "functions in order to query further information about each operating system, "
9717 "such as the name and version."
9721 #: ../src/guestfs-actions.pod:3019
9723 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9724 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9725 "the contents. This should be called with no disks currently mounted. The "
9726 "function may also use Augeas, so any existing Augeas handle will be closed."
9730 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2109
9732 "This function cannot decrypt encrypted disks. The caller must do that first "
9733 "(supplying the necessary keys) if the disk is encrypted."
9737 #: ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:3314
9738 #: ../src/guestfs-actions.pod:3376
9739 msgid "See also C<guestfs_list_filesystems>."
9743 #: ../src/guestfs-actions.pod:3039
9744 msgid "guestfs_is_blockdev"
9748 #: ../src/guestfs-actions.pod:3041
9752 " guestfs_is_blockdev (guestfs_h *g,\n"
9753 " const char *path);\n"
9758 #: ../src/guestfs-actions.pod:3045 ../fish/guestfish-actions.pod:2121
9760 "This returns C<true> if and only if there is a block device with the given "
9765 #: ../src/guestfs-actions.pod:3048 ../src/guestfs-actions.pod:3077
9766 #: ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3122
9767 #: ../src/guestfs-actions.pod:3138 ../src/guestfs-actions.pod:3194
9768 #: ../src/guestfs-actions.pod:3209
9769 msgid "See also C<guestfs_stat>."
9773 #: ../src/guestfs-actions.pod:3052 ../src/guestfs-actions.pod:3081
9774 #: ../src/guestfs-actions.pod:3126 ../src/guestfs-actions.pod:3198
9775 #: ../src/guestfs-actions.pod:3213
9776 msgid "(Added in 1.5.10)"
9780 #: ../src/guestfs-actions.pod:3054
9781 msgid "guestfs_is_busy"
9785 #: ../src/guestfs-actions.pod:3056
9789 " guestfs_is_busy (guestfs_h *g);\n"
9794 #: ../src/guestfs-actions.pod:3059 ../fish/guestfish-actions.pod:2130
9796 "This returns true iff this handle is busy processing a command (in the "
9801 #: ../src/guestfs-actions.pod:3068
9802 msgid "guestfs_is_chardev"
9806 #: ../src/guestfs-actions.pod:3070
9810 " guestfs_is_chardev (guestfs_h *g,\n"
9811 " const char *path);\n"
9816 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2139
9818 "This returns C<true> if and only if there is a character device with the "
9819 "given C<path> name."
9823 #: ../src/guestfs-actions.pod:3083
9824 msgid "guestfs_is_config"
9828 #: ../src/guestfs-actions.pod:3085
9832 " guestfs_is_config (guestfs_h *g);\n"
9837 #: ../src/guestfs-actions.pod:3088 ../fish/guestfish-actions.pod:2148
9839 "This returns true iff this handle is being configured (in the C<CONFIG> "
9844 #: ../src/guestfs-actions.pod:3097
9845 msgid "guestfs_is_dir"
9849 #: ../src/guestfs-actions.pod:3099
9853 " guestfs_is_dir (guestfs_h *g,\n"
9854 " const char *path);\n"
9859 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2157
9861 "This returns C<true> if and only if there is a directory with the given "
9862 "C<path> name. Note that it returns false for other objects like files."
9866 #: ../src/guestfs-actions.pod:3113
9867 msgid "guestfs_is_fifo"
9871 #: ../src/guestfs-actions.pod:3115
9875 " guestfs_is_fifo (guestfs_h *g,\n"
9876 " const char *path);\n"
9881 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2167
9883 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9884 "given C<path> name."
9888 #: ../src/guestfs-actions.pod:3128
9889 msgid "guestfs_is_file"
9893 #: ../src/guestfs-actions.pod:3130
9897 " guestfs_is_file (guestfs_h *g,\n"
9898 " const char *path);\n"
9903 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2176
9905 "This returns C<true> if and only if there is a regular file with the given "
9906 "C<path> name. Note that it returns false for other objects like directories."
9910 #: ../src/guestfs-actions.pod:3144
9911 msgid "guestfs_is_launching"
9915 #: ../src/guestfs-actions.pod:3146
9919 " guestfs_is_launching (guestfs_h *g);\n"
9924 #: ../src/guestfs-actions.pod:3149 ../fish/guestfish-actions.pod:2186
9926 "This returns true iff this handle is launching the subprocess (in the "
9927 "C<LAUNCHING> state)."
9931 #: ../src/guestfs-actions.pod:3158
9932 msgid "guestfs_is_lv"
9936 #: ../src/guestfs-actions.pod:3160
9940 " guestfs_is_lv (guestfs_h *g,\n"
9941 " const char *device);\n"
9946 #: ../src/guestfs-actions.pod:3164 ../fish/guestfish-actions.pod:2195
9948 "This command tests whether C<device> is a logical volume, and returns true "
9949 "iff this is the case."
9953 #: ../src/guestfs-actions.pod:3171
9954 msgid "guestfs_is_ready"
9958 #: ../src/guestfs-actions.pod:3173
9962 " guestfs_is_ready (guestfs_h *g);\n"
9967 #: ../src/guestfs-actions.pod:3176 ../fish/guestfish-actions.pod:2202
9969 "This returns true iff this handle is ready to accept commands (in the "
9974 #: ../src/guestfs-actions.pod:3185
9975 msgid "guestfs_is_socket"
9979 #: ../src/guestfs-actions.pod:3187
9983 " guestfs_is_socket (guestfs_h *g,\n"
9984 " const char *path);\n"
9989 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2211
9991 "This returns C<true> if and only if there is a Unix domain socket with the "
9992 "given C<path> name."
9996 #: ../src/guestfs-actions.pod:3200
9997 msgid "guestfs_is_symlink"
10001 #: ../src/guestfs-actions.pod:3202
10005 " guestfs_is_symlink (guestfs_h *g,\n"
10006 " const char *path);\n"
10011 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2220
10013 "This returns C<true> if and only if there is a symbolic link with the given "
10018 #: ../src/guestfs-actions.pod:3215
10019 msgid "guestfs_kill_subprocess"
10023 #: ../src/guestfs-actions.pod:3217
10027 " guestfs_kill_subprocess (guestfs_h *g);\n"
10032 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2229
10033 msgid "This kills the qemu subprocess. You should never need to call this."
10037 #: ../src/guestfs-actions.pod:3226
10038 msgid "guestfs_launch"
10042 #: ../src/guestfs-actions.pod:3228
10046 " guestfs_launch (guestfs_h *g);\n"
10051 #: ../src/guestfs-actions.pod:3231 ../fish/guestfish-actions.pod:2237
10053 "Internally libguestfs is implemented by running a virtual machine using "
10058 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2240
10060 "You should call this after configuring the handle (eg. adding drives) but "
10061 "before performing any actions."
10065 #: ../src/guestfs-actions.pod:3241
10066 msgid "guestfs_lchown"
10070 #: ../src/guestfs-actions.pod:3243
10074 " guestfs_lchown (guestfs_h *g,\n"
10077 " const char *path);\n"
10082 #: ../src/guestfs-actions.pod:3249
10084 "Change the file owner to C<owner> and group to C<group>. This is like "
10085 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
10086 "changed, not the target."
10090 #: ../src/guestfs-actions.pod:3261
10091 msgid "guestfs_lgetxattr"
10095 #: ../src/guestfs-actions.pod:3263
10099 " guestfs_lgetxattr (guestfs_h *g,\n"
10100 " const char *path,\n"
10101 " const char *name,\n"
10102 " size_t *size_r);\n"
10107 #: ../src/guestfs-actions.pod:3269 ../fish/guestfish-actions.pod:2259
10109 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10110 "is a symlink, then this call returns an extended attribute from the symlink."
10114 #: ../src/guestfs-actions.pod:3283
10115 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
10119 #: ../src/guestfs-actions.pod:3289
10120 msgid "guestfs_lgetxattrs"
10124 #: ../src/guestfs-actions.pod:3291
10127 " struct guestfs_xattr_list *\n"
10128 " guestfs_lgetxattrs (guestfs_h *g,\n"
10129 " const char *path);\n"
10134 #: ../src/guestfs-actions.pod:3295
10136 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
10137 "then it returns the extended attributes of the link itself."
10141 #: ../src/guestfs-actions.pod:3305
10142 msgid "guestfs_list_devices"
10146 #: ../src/guestfs-actions.pod:3307
10150 " guestfs_list_devices (guestfs_h *g);\n"
10155 #: ../src/guestfs-actions.pod:3310 ../fish/guestfish-actions.pod:2287
10156 msgid "List all the block devices."
10160 #: ../src/guestfs-actions.pod:3312 ../fish/guestfish-actions.pod:2289
10161 msgid "The full block device names are returned, eg. C</dev/sda>."
10165 #: ../src/guestfs-actions.pod:3322
10166 msgid "guestfs_list_filesystems"
10170 #: ../src/guestfs-actions.pod:3324
10174 " guestfs_list_filesystems (guestfs_h *g);\n"
10179 #: ../src/guestfs-actions.pod:3327 ../fish/guestfish-actions.pod:2297
10181 "This inspection command looks for filesystems on partitions, block devices "
10182 "and logical volumes, returning a list of devices containing filesystems and "
10187 #: ../src/guestfs-actions.pod:3331 ../fish/guestfish-actions.pod:2301
10189 "The return value is a hash, where the keys are the devices containing "
10190 "filesystems, and the values are the filesystem types. For example:"
10194 #: ../src/guestfs-actions.pod:3335 ../fish/guestfish-actions.pod:2305
10197 " \"/dev/sda1\" => \"ntfs\"\n"
10198 " \"/dev/sda2\" => \"ext2\"\n"
10199 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10200 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10205 #: ../src/guestfs-actions.pod:3340 ../fish/guestfish-actions.pod:2310
10207 "The value can have the special value \"unknown\", meaning the content of the "
10208 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10212 #: ../src/guestfs-actions.pod:3344
10214 "This command runs other libguestfs commands, which might include "
10215 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10216 "soon after launch and only when nothing is mounted."
10220 #: ../src/guestfs-actions.pod:3348
10222 "Not all of the filesystems returned will be mountable. In particular, swap "
10223 "partitions are returned in the list. Also this command does not check that "
10224 "each filesystem found is valid and mountable, and some filesystems might be "
10225 "mountable but require special options. Filesystems may not all belong to a "
10226 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10230 #: ../src/guestfs-actions.pod:3362 ../src/guestfs-actions.pod:4951
10231 msgid "(Added in 1.5.15)"
10235 #: ../src/guestfs-actions.pod:3364
10236 msgid "guestfs_list_partitions"
10240 #: ../src/guestfs-actions.pod:3366
10244 " guestfs_list_partitions (guestfs_h *g);\n"
10249 #: ../src/guestfs-actions.pod:3369 ../fish/guestfish-actions.pod:2330
10250 msgid "List all the partitions detected on all block devices."
10254 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2332
10255 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10259 #: ../src/guestfs-actions.pod:3373
10261 "This does not return logical volumes. For that you will need to call "
10266 #: ../src/guestfs-actions.pod:3384
10271 #: ../src/guestfs-actions.pod:3386
10275 " guestfs_ll (guestfs_h *g,\n"
10276 " const char *directory);\n"
10281 #: ../src/guestfs-actions.pod:3390 ../fish/guestfish-actions.pod:2343
10283 "List the files in C<directory> (relative to the root directory, there is no "
10284 "cwd) in the format of 'ls -la'."
10288 #: ../src/guestfs-actions.pod:3393 ../fish/guestfish-actions.pod:2346
10290 "This command is mostly useful for interactive sessions. It is I<not> "
10291 "intended that you try to parse the output string."
10295 #: ../src/guestfs-actions.pod:3401
10300 #: ../src/guestfs-actions.pod:3403
10304 " guestfs_ln (guestfs_h *g,\n"
10305 " const char *target,\n"
10306 " const char *linkname);\n"
10311 #: ../src/guestfs-actions.pod:3408 ../fish/guestfish-actions.pod:2353
10312 msgid "This command creates a hard link using the C<ln> command."
10316 #: ../src/guestfs-actions.pod:3414
10317 msgid "guestfs_ln_f"
10321 #: ../src/guestfs-actions.pod:3416
10325 " guestfs_ln_f (guestfs_h *g,\n"
10326 " const char *target,\n"
10327 " const char *linkname);\n"
10332 #: ../src/guestfs-actions.pod:3421 ../fish/guestfish-actions.pod:2359
10334 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10335 "option removes the link (C<linkname>) if it exists already."
10339 #: ../src/guestfs-actions.pod:3428
10340 msgid "guestfs_ln_s"
10344 #: ../src/guestfs-actions.pod:3430
10348 " guestfs_ln_s (guestfs_h *g,\n"
10349 " const char *target,\n"
10350 " const char *linkname);\n"
10355 #: ../src/guestfs-actions.pod:3435 ../fish/guestfish-actions.pod:2366
10356 msgid "This command creates a symbolic link using the C<ln -s> command."
10360 #: ../src/guestfs-actions.pod:3441
10361 msgid "guestfs_ln_sf"
10365 #: ../src/guestfs-actions.pod:3443
10369 " guestfs_ln_sf (guestfs_h *g,\n"
10370 " const char *target,\n"
10371 " const char *linkname);\n"
10376 #: ../src/guestfs-actions.pod:3448 ../fish/guestfish-actions.pod:2372
10378 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10379 "option removes the link (C<linkname>) if it exists already."
10383 #: ../src/guestfs-actions.pod:3455
10384 msgid "guestfs_lremovexattr"
10388 #: ../src/guestfs-actions.pod:3457
10392 " guestfs_lremovexattr (guestfs_h *g,\n"
10393 " const char *xattr,\n"
10394 " const char *path);\n"
10399 #: ../src/guestfs-actions.pod:3462
10401 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10402 "link, then it removes an extended attribute of the link itself."
10406 #: ../src/guestfs-actions.pod:3470
10411 #: ../src/guestfs-actions.pod:3472
10415 " guestfs_ls (guestfs_h *g,\n"
10416 " const char *directory);\n"
10421 #: ../src/guestfs-actions.pod:3476 ../fish/guestfish-actions.pod:2387
10423 "List the files in C<directory> (relative to the root directory, there is no "
10424 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10428 #: ../src/guestfs-actions.pod:3480
10430 "This command is mostly useful for interactive sessions. Programs should "
10431 "probably use C<guestfs_readdir> instead."
10435 #: ../src/guestfs-actions.pod:3489
10436 msgid "guestfs_lsetxattr"
10440 #: ../src/guestfs-actions.pod:3491
10444 " guestfs_lsetxattr (guestfs_h *g,\n"
10445 " const char *xattr,\n"
10446 " const char *val,\n"
10448 " const char *path);\n"
10453 #: ../src/guestfs-actions.pod:3498
10455 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10456 "then it sets an extended attribute of the link itself."
10460 #: ../src/guestfs-actions.pod:3506
10461 msgid "guestfs_lstat"
10465 #: ../src/guestfs-actions.pod:3508
10468 " struct guestfs_stat *\n"
10469 " guestfs_lstat (guestfs_h *g,\n"
10470 " const char *path);\n"
10475 #: ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:6005
10476 #: ../fish/guestfish-actions.pod:2406 ../fish/guestfish-actions.pod:4019
10477 msgid "Returns file information for the given C<path>."
10481 #: ../src/guestfs-actions.pod:3514
10483 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10484 "link, then the link is stat-ed, not the file it refers to."
10488 #: ../src/guestfs-actions.pod:3518 ../fish/guestfish-actions.pod:2412
10489 msgid "This is the same as the C<lstat(2)> system call."
10493 #: ../src/guestfs-actions.pod:3520 ../src/guestfs-actions.pod:6009
10495 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10496 "error. I<The caller must call C<guestfs_free_stat> after use>."
10500 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:6013
10501 #: ../src/guestfs-actions.pod:6031 ../src/guestfs-actions.pod:6412
10502 msgid "(Added in 0.9.2)"
10506 #: ../src/guestfs-actions.pod:3526
10507 msgid "guestfs_lstatlist"
10511 #: ../src/guestfs-actions.pod:3528
10514 " struct guestfs_stat_list *\n"
10515 " guestfs_lstatlist (guestfs_h *g,\n"
10516 " const char *path,\n"
10517 " char *const *names);\n"
10522 #: ../src/guestfs-actions.pod:3533
10524 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10525 "files, where all files are in the directory C<path>. C<names> is the list "
10526 "of files from this directory."
10530 #: ../src/guestfs-actions.pod:3537 ../fish/guestfish-actions.pod:2422
10532 "On return you get a list of stat structs, with a one-to-one correspondence "
10533 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10534 "then the C<ino> field of that structure is set to C<-1>."
10538 #: ../src/guestfs-actions.pod:3542
10540 "This call is intended for programs that want to efficiently list a directory "
10541 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10542 "for a similarly efficient call for getting extended attributes. Very long "
10543 "directory listings might cause the protocol message size to be exceeded, "
10544 "causing this call to fail. The caller must split up such requests into "
10545 "smaller groups of names."
10549 #: ../src/guestfs-actions.pod:3550
10551 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10552 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10556 #: ../src/guestfs-actions.pod:3556
10557 msgid "guestfs_luks_add_key"
10561 #: ../src/guestfs-actions.pod:3558
10565 " guestfs_luks_add_key (guestfs_h *g,\n"
10566 " const char *device,\n"
10567 " const char *key,\n"
10568 " const char *newkey,\n"
10574 #: ../src/guestfs-actions.pod:3565 ../fish/guestfish-actions.pod:2439
10576 "This command adds a new key on LUKS device C<device>. C<key> is any "
10577 "existing key, and is used to access the device. C<newkey> is the new key to "
10578 "add. C<keyslot> is the key slot that will be replaced."
10582 #: ../src/guestfs-actions.pod:3570
10584 "Note that if C<keyslot> already contains a key, then this command will "
10585 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10589 #: ../src/guestfs-actions.pod:3576 ../src/guestfs-actions.pod:3616
10590 #: ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3659
10591 #: ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3710
10593 "This function takes a key or passphrase parameter which could contain "
10594 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10599 #: ../src/guestfs-actions.pod:3580 ../src/guestfs-actions.pod:3620
10600 #: ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3663
10601 msgid "(Added in 1.5.2)"
10605 #: ../src/guestfs-actions.pod:3582
10606 msgid "guestfs_luks_close"
10610 #: ../src/guestfs-actions.pod:3584
10614 " guestfs_luks_close (guestfs_h *g,\n"
10615 " const char *device);\n"
10620 #: ../src/guestfs-actions.pod:3588
10622 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10623 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10624 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10625 "underlying block device."
10629 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3695
10630 #: ../src/guestfs-actions.pod:3714 ../src/guestfs-actions.pod:3764
10631 #: ../src/guestfs-actions.pod:3812
10632 msgid "(Added in 1.5.1)"
10636 #: ../src/guestfs-actions.pod:3598
10637 msgid "guestfs_luks_format"
10641 #: ../src/guestfs-actions.pod:3600
10645 " guestfs_luks_format (guestfs_h *g,\n"
10646 " const char *device,\n"
10647 " const char *key,\n"
10653 #: ../src/guestfs-actions.pod:3606 ../fish/guestfish-actions.pod:2465
10655 "This command erases existing data on C<device> and formats the device as a "
10656 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10657 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10661 #: ../src/guestfs-actions.pod:3613 ../src/guestfs-actions.pod:3636
10662 #: ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:4702
10663 #: ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:5840
10664 #: ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5889
10665 #: ../src/guestfs-actions.pod:7049 ../fish/guestfish-actions.pod:2473
10666 #: ../fish/guestfish-actions.pod:2486 ../fish/guestfish-actions.pod:2570
10667 #: ../fish/guestfish-actions.pod:3131 ../fish/guestfish-actions.pod:3638
10668 #: ../fish/guestfish-actions.pod:3918 ../fish/guestfish-actions.pod:3934
10669 #: ../fish/guestfish-actions.pod:3949 ../fish/guestfish-actions.pod:4664
10671 "B<This command is dangerous. Without careful use you can easily destroy all "
10676 #: ../src/guestfs-actions.pod:3622
10677 msgid "guestfs_luks_format_cipher"
10681 #: ../src/guestfs-actions.pod:3624
10685 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10686 " const char *device,\n"
10687 " const char *key,\n"
10689 " const char *cipher);\n"
10694 #: ../src/guestfs-actions.pod:3631
10696 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10697 "set the C<cipher> used."
10701 #: ../src/guestfs-actions.pod:3645
10702 msgid "guestfs_luks_kill_slot"
10706 #: ../src/guestfs-actions.pod:3647
10710 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10711 " const char *device,\n"
10712 " const char *key,\n"
10718 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2493
10720 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10721 "device C<device>. C<key> must be one of the I<other> keys."
10725 #: ../src/guestfs-actions.pod:3665
10726 msgid "guestfs_luks_open"
10730 #: ../src/guestfs-actions.pod:3667
10734 " guestfs_luks_open (guestfs_h *g,\n"
10735 " const char *device,\n"
10736 " const char *key,\n"
10737 " const char *mapname);\n"
10742 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2504
10744 "This command opens a block device which has been encrypted according to the "
10745 "Linux Unified Key Setup (LUKS) standard."
10749 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2507
10750 msgid "C<device> is the encrypted block device or partition."
10754 #: ../src/guestfs-actions.pod:3678 ../fish/guestfish-actions.pod:2509
10756 "The caller must supply one of the keys associated with the LUKS block "
10757 "device, in the C<key> parameter."
10761 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2512
10763 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10764 "writes to this block device are decrypted from and encrypted to the "
10765 "underlying C<device> respectively."
10769 #: ../src/guestfs-actions.pod:3685
10771 "If this block device contains LVM volume groups, then calling "
10772 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10777 #: ../src/guestfs-actions.pod:3697
10778 msgid "guestfs_luks_open_ro"
10782 #: ../src/guestfs-actions.pod:3699
10786 " guestfs_luks_open_ro (guestfs_h *g,\n"
10787 " const char *device,\n"
10788 " const char *key,\n"
10789 " const char *mapname);\n"
10794 #: ../src/guestfs-actions.pod:3705
10796 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10801 #: ../src/guestfs-actions.pod:3716
10802 msgid "guestfs_lvcreate"
10806 #: ../src/guestfs-actions.pod:3718
10810 " guestfs_lvcreate (guestfs_h *g,\n"
10811 " const char *logvol,\n"
10812 " const char *volgroup,\n"
10818 #: ../src/guestfs-actions.pod:3724 ../fish/guestfish-actions.pod:2537
10820 "This creates an LVM logical volume called C<logvol> on the volume group "
10821 "C<volgroup>, with C<size> megabytes."
10825 #: ../src/guestfs-actions.pod:3731
10826 msgid "guestfs_lvm_canonical_lv_name"
10830 #: ../src/guestfs-actions.pod:3733
10834 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10835 " const char *lvname);\n"
10840 #: ../src/guestfs-actions.pod:3737 ../fish/guestfish-actions.pod:2544
10842 "This converts alternative naming schemes for LVs that you might find to the "
10843 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10848 #: ../src/guestfs-actions.pod:3741 ../fish/guestfish-actions.pod:2548
10850 "This command returns an error if the C<lvname> parameter does not refer to a "
10855 #: ../src/guestfs-actions.pod:3744
10856 msgid "See also C<guestfs_is_lv>."
10860 #: ../src/guestfs-actions.pod:3749
10861 msgid "(Added in 1.5.24)"
10865 #: ../src/guestfs-actions.pod:3751
10866 msgid "guestfs_lvm_clear_filter"
10870 #: ../src/guestfs-actions.pod:3753
10874 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10879 #: ../src/guestfs-actions.pod:3756
10881 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10882 "see every block device."
10886 #: ../src/guestfs-actions.pod:3759 ../src/guestfs-actions.pod:3801
10887 #: ../fish/guestfish-actions.pod:2560 ../fish/guestfish-actions.pod:2591
10889 "This command also clears the LVM cache and performs a volume group scan."
10893 #: ../src/guestfs-actions.pod:3766
10894 msgid "guestfs_lvm_remove_all"
10898 #: ../src/guestfs-actions.pod:3768
10902 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10907 #: ../src/guestfs-actions.pod:3771 ../fish/guestfish-actions.pod:2567
10909 "This command removes all LVM logical volumes, volume groups and physical "
10914 #: ../src/guestfs-actions.pod:3781
10915 msgid "guestfs_lvm_set_filter"
10919 #: ../src/guestfs-actions.pod:3783
10923 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10924 " char *const *devices);\n"
10929 #: ../src/guestfs-actions.pod:3787 ../fish/guestfish-actions.pod:2577
10931 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10932 "block devices in the list C<devices>, and will ignore all other attached "
10937 #: ../src/guestfs-actions.pod:3791 ../fish/guestfish-actions.pod:2581
10939 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10940 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10941 "there are two types of duplication possible: either cloned PVs/VGs which "
10942 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10943 "same name. In normal operation you cannot create this situation, but you "
10944 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10945 "inside the LVM metadata."
10949 #: ../src/guestfs-actions.pod:3804 ../fish/guestfish-actions.pod:2594
10950 msgid "You can filter whole block devices or individual partitions."
10954 #: ../src/guestfs-actions.pod:3806 ../fish/guestfish-actions.pod:2596
10956 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10957 "filesystem), even if you are not filtering out that VG."
10961 #: ../src/guestfs-actions.pod:3814
10962 msgid "guestfs_lvremove"
10966 #: ../src/guestfs-actions.pod:3816
10970 " guestfs_lvremove (guestfs_h *g,\n"
10971 " const char *device);\n"
10976 #: ../src/guestfs-actions.pod:3820 ../fish/guestfish-actions.pod:2604
10978 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10979 "LV, such as C</dev/VG/LV>."
10983 #: ../src/guestfs-actions.pod:3823 ../fish/guestfish-actions.pod:2607
10985 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10990 #: ../src/guestfs-actions.pod:3828 ../src/guestfs-actions.pod:5048
10991 #: ../src/guestfs-actions.pod:6788
10992 msgid "(Added in 1.0.13)"
10996 #: ../src/guestfs-actions.pod:3830
10997 msgid "guestfs_lvrename"
11001 #: ../src/guestfs-actions.pod:3832
11005 " guestfs_lvrename (guestfs_h *g,\n"
11006 " const char *logvol,\n"
11007 " const char *newlogvol);\n"
11012 #: ../src/guestfs-actions.pod:3837 ../fish/guestfish-actions.pod:2614
11013 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11017 #: ../src/guestfs-actions.pod:3841 ../src/guestfs-actions.pod:6801
11018 msgid "(Added in 1.0.83)"
11022 #: ../src/guestfs-actions.pod:3843
11023 msgid "guestfs_lvresize"
11027 #: ../src/guestfs-actions.pod:3845
11031 " guestfs_lvresize (guestfs_h *g,\n"
11032 " const char *device,\n"
11038 #: ../src/guestfs-actions.pod:3850 ../fish/guestfish-actions.pod:2620
11040 "This resizes (expands or shrinks) an existing LVM logical volume to "
11041 "C<mbytes>. When reducing, data in the reduced part is lost."
11045 #: ../src/guestfs-actions.pod:3858
11046 msgid "guestfs_lvresize_free"
11050 #: ../src/guestfs-actions.pod:3860
11054 " guestfs_lvresize_free (guestfs_h *g,\n"
11055 " const char *lv,\n"
11061 #: ../src/guestfs-actions.pod:3865 ../fish/guestfish-actions.pod:2628
11063 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11064 "remaining free space in the volume group. Commonly you would call this with "
11065 "pc = 100 which expands the logical volume as much as possible, using all "
11066 "remaining free space in the volume group."
11070 #: ../src/guestfs-actions.pod:3873
11071 msgid "(Added in 1.3.3)"
11075 #: ../src/guestfs-actions.pod:3875
11076 msgid "guestfs_lvs"
11080 #: ../src/guestfs-actions.pod:3877
11084 " guestfs_lvs (guestfs_h *g);\n"
11089 #: ../src/guestfs-actions.pod:3880 ../fish/guestfish-actions.pod:2638
11091 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11096 #: ../src/guestfs-actions.pod:3883 ../fish/guestfish-actions.pod:2641
11098 "This returns a list of the logical volume device names (eg. C</dev/"
11099 "VolGroup00/LogVol00>)."
11103 #: ../src/guestfs-actions.pod:3886
11104 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
11108 #: ../src/guestfs-actions.pod:3894
11109 msgid "guestfs_lvs_full"
11113 #: ../src/guestfs-actions.pod:3896
11116 " struct guestfs_lvm_lv_list *\n"
11117 " guestfs_lvs_full (guestfs_h *g);\n"
11122 #: ../src/guestfs-actions.pod:3899 ../fish/guestfish-actions.pod:2650
11124 "List all the logical volumes detected. This is the equivalent of the L<lvs"
11125 "(8)> command. The \"full\" version includes all fields."
11129 #: ../src/guestfs-actions.pod:3902
11131 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
11132 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
11136 #: ../src/guestfs-actions.pod:3908
11137 msgid "guestfs_lvuuid"
11141 #: ../src/guestfs-actions.pod:3910
11145 " guestfs_lvuuid (guestfs_h *g,\n"
11146 " const char *device);\n"
11151 #: ../src/guestfs-actions.pod:3914 ../fish/guestfish-actions.pod:2657
11152 msgid "This command returns the UUID of the LVM LV C<device>."
11156 #: ../src/guestfs-actions.pod:3921
11157 msgid "guestfs_lxattrlist"
11161 #: ../src/guestfs-actions.pod:3923
11164 " struct guestfs_xattr_list *\n"
11165 " guestfs_lxattrlist (guestfs_h *g,\n"
11166 " const char *path,\n"
11167 " char *const *names);\n"
11172 #: ../src/guestfs-actions.pod:3928 ../fish/guestfish-actions.pod:2663
11174 "This call allows you to get the extended attributes of multiple files, where "
11175 "all files are in the directory C<path>. C<names> is the list of files from "
11180 #: ../src/guestfs-actions.pod:3932 ../fish/guestfish-actions.pod:2667
11182 "On return you get a flat list of xattr structs which must be interpreted "
11183 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11184 "C<attrval> in this struct is zero-length to indicate there was an error "
11185 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11186 "number (the number of following attributes for this file, which could be C<"
11187 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11188 "for the first named file. This repeats for the second and subsequent files."
11192 #: ../src/guestfs-actions.pod:3942
11194 "This call is intended for programs that want to efficiently list a directory "
11195 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11196 "a similarly efficient call for getting standard stats. Very long directory "
11197 "listings might cause the protocol message size to be exceeded, causing this "
11198 "call to fail. The caller must split up such requests into smaller groups of "
11203 #: ../src/guestfs-actions.pod:3956
11204 msgid "guestfs_mkdir"
11208 #: ../src/guestfs-actions.pod:3958
11212 " guestfs_mkdir (guestfs_h *g,\n"
11213 " const char *path);\n"
11218 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2689
11219 msgid "Create a directory named C<path>."
11223 #: ../src/guestfs-actions.pod:3968
11224 msgid "guestfs_mkdir_mode"
11228 #: ../src/guestfs-actions.pod:3970
11232 " guestfs_mkdir_mode (guestfs_h *g,\n"
11233 " const char *path,\n"
11239 #: ../src/guestfs-actions.pod:3975 ../fish/guestfish-actions.pod:2695
11241 "This command creates a directory, setting the initial permissions of the "
11242 "directory to C<mode>."
11246 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:2698
11248 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11249 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11254 #: ../src/guestfs-actions.pod:3982
11255 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11259 #: ../src/guestfs-actions.pod:3988
11260 msgid "guestfs_mkdir_p"
11264 #: ../src/guestfs-actions.pod:3990
11268 " guestfs_mkdir_p (guestfs_h *g,\n"
11269 " const char *path);\n"
11274 #: ../src/guestfs-actions.pod:3994 ../fish/guestfish-actions.pod:2708
11276 "Create a directory named C<path>, creating any parent directories as "
11277 "necessary. This is like the C<mkdir -p> shell command."
11281 #: ../src/guestfs-actions.pod:4001
11282 msgid "guestfs_mkdtemp"
11286 #: ../src/guestfs-actions.pod:4003
11290 " guestfs_mkdtemp (guestfs_h *g,\n"
11291 " const char *template);\n"
11296 #: ../src/guestfs-actions.pod:4007 ../fish/guestfish-actions.pod:2715
11298 "This command creates a temporary directory. The C<template> parameter "
11299 "should be a full pathname for the temporary directory name with the final "
11300 "six characters being \"XXXXXX\"."
11304 #: ../src/guestfs-actions.pod:4012 ../fish/guestfish-actions.pod:2720
11306 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11307 "being suitable for Windows filesystems."
11311 #: ../src/guestfs-actions.pod:4015 ../fish/guestfish-actions.pod:2723
11312 msgid "The name of the temporary directory that was created is returned."
11316 #: ../src/guestfs-actions.pod:4018 ../fish/guestfish-actions.pod:2726
11317 msgid "The temporary directory is created with mode 0700 and is owned by root."
11321 #: ../src/guestfs-actions.pod:4021 ../fish/guestfish-actions.pod:2729
11323 "The caller is responsible for deleting the temporary directory and its "
11324 "contents after use."
11328 #: ../src/guestfs-actions.pod:4024 ../fish/guestfish-actions.pod:2732
11329 msgid "See also: L<mkdtemp(3)>"
11333 #: ../src/guestfs-actions.pod:4031
11334 msgid "guestfs_mke2fs_J"
11338 #: ../src/guestfs-actions.pod:4033
11342 " guestfs_mke2fs_J (guestfs_h *g,\n"
11343 " const char *fstype,\n"
11344 " int blocksize,\n"
11345 " const char *device,\n"
11346 " const char *journal);\n"
11351 #: ../src/guestfs-actions.pod:4040 ../fish/guestfish-actions.pod:2738
11353 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11354 "C<journal>. It is equivalent to the command:"
11358 #: ../src/guestfs-actions.pod:4044 ../fish/guestfish-actions.pod:2742
11361 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11366 #: ../src/guestfs-actions.pod:4046
11367 msgid "See also C<guestfs_mke2journal>."
11371 #: ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:4068
11372 #: ../src/guestfs-actions.pod:4086 ../src/guestfs-actions.pod:4102
11373 #: ../src/guestfs-actions.pod:4116 ../src/guestfs-actions.pod:4130
11374 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4438
11375 msgid "(Added in 1.0.68)"
11379 #: ../src/guestfs-actions.pod:4052
11380 msgid "guestfs_mke2fs_JL"
11384 #: ../src/guestfs-actions.pod:4054
11388 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11389 " const char *fstype,\n"
11390 " int blocksize,\n"
11391 " const char *device,\n"
11392 " const char *label);\n"
11397 #: ../src/guestfs-actions.pod:4061 ../fish/guestfish-actions.pod:2750
11399 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11400 "the journal labeled C<label>."
11404 #: ../src/guestfs-actions.pod:4064
11405 msgid "See also C<guestfs_mke2journal_L>."
11409 #: ../src/guestfs-actions.pod:4070
11410 msgid "guestfs_mke2fs_JU"
11414 #: ../src/guestfs-actions.pod:4072
11418 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11419 " const char *fstype,\n"
11420 " int blocksize,\n"
11421 " const char *device,\n"
11422 " const char *uuid);\n"
11427 #: ../src/guestfs-actions.pod:4079 ../fish/guestfish-actions.pod:2759
11429 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11430 "the journal with UUID C<uuid>."
11434 #: ../src/guestfs-actions.pod:4082
11435 msgid "See also C<guestfs_mke2journal_U>."
11439 #: ../src/guestfs-actions.pod:4088
11440 msgid "guestfs_mke2journal"
11444 #: ../src/guestfs-actions.pod:4090
11448 " guestfs_mke2journal (guestfs_h *g,\n"
11449 " int blocksize,\n"
11450 " const char *device);\n"
11455 #: ../src/guestfs-actions.pod:4095 ../fish/guestfish-actions.pod:2768
11457 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11462 #: ../src/guestfs-actions.pod:4098 ../fish/guestfish-actions.pod:2771
11465 " mke2fs -O journal_dev -b blocksize device\n"
11470 #: ../src/guestfs-actions.pod:4104
11471 msgid "guestfs_mke2journal_L"
11475 #: ../src/guestfs-actions.pod:4106
11479 " guestfs_mke2journal_L (guestfs_h *g,\n"
11480 " int blocksize,\n"
11481 " const char *label,\n"
11482 " const char *device);\n"
11487 #: ../src/guestfs-actions.pod:4112 ../fish/guestfish-actions.pod:2777
11488 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11492 #: ../src/guestfs-actions.pod:4118
11493 msgid "guestfs_mke2journal_U"
11497 #: ../src/guestfs-actions.pod:4120
11501 " guestfs_mke2journal_U (guestfs_h *g,\n"
11502 " int blocksize,\n"
11503 " const char *uuid,\n"
11504 " const char *device);\n"
11509 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2783
11510 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11514 #: ../src/guestfs-actions.pod:4132
11515 msgid "guestfs_mkfifo"
11519 #: ../src/guestfs-actions.pod:4134
11523 " guestfs_mkfifo (guestfs_h *g,\n"
11525 " const char *path);\n"
11530 #: ../src/guestfs-actions.pod:4139
11532 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11533 "is just a convenient wrapper around C<guestfs_mknod>."
11537 #: ../src/guestfs-actions.pod:4149
11538 msgid "guestfs_mkfs"
11542 #: ../src/guestfs-actions.pod:4151
11546 " guestfs_mkfs (guestfs_h *g,\n"
11547 " const char *fstype,\n"
11548 " const char *device);\n"
11553 #: ../src/guestfs-actions.pod:4156 ../fish/guestfish-actions.pod:2799
11555 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11556 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11560 #: ../src/guestfs-actions.pod:4164
11561 msgid "guestfs_mkfs_b"
11565 #: ../src/guestfs-actions.pod:4166
11569 " guestfs_mkfs_b (guestfs_h *g,\n"
11570 " const char *fstype,\n"
11571 " int blocksize,\n"
11572 " const char *device);\n"
11577 #: ../src/guestfs-actions.pod:4172
11579 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11580 "block size of the resulting filesystem. Supported block sizes depend on the "
11581 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11585 #: ../src/guestfs-actions.pod:4177 ../src/guestfs-actions.pod:4219
11586 #: ../fish/guestfish-actions.pod:2812 ../fish/guestfish-actions.pod:2839
11588 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11593 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:2815
11595 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
11599 #: ../src/guestfs-actions.pod:4191
11600 msgid "guestfs_mkfs_opts"
11604 #: ../src/guestfs-actions.pod:4193
11608 " guestfs_mkfs_opts (guestfs_h *g,\n"
11609 " const char *fstype,\n"
11610 " const char *device,\n"
11616 #: ../src/guestfs-actions.pod:4204
11619 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11624 #: ../src/guestfs-actions.pod:4206 ../fish/guestfish-actions.pod:2826
11626 "This function creates a filesystem on C<device>. The filesystem type is "
11627 "C<fstype>, for example C<ext3>."
11631 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:2833
11632 msgid "C<blocksize>"
11636 #: ../src/guestfs-actions.pod:4215 ../fish/guestfish-actions.pod:2835
11638 "The filesystem block size. Supported block sizes depend on the filesystem "
11639 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11644 #: ../src/guestfs-actions.pod:4226
11645 msgid "guestfs_mkfs_opts_va"
11649 #: ../src/guestfs-actions.pod:4228
11653 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11654 " const char *fstype,\n"
11655 " const char *device,\n"
11656 " va_list args);\n"
11661 #: ../src/guestfs-actions.pod:4234
11662 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11666 #: ../src/guestfs-actions.pod:4238
11667 msgid "guestfs_mkfs_opts_argv"
11671 #: ../src/guestfs-actions.pod:4240
11675 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11676 " const char *fstype,\n"
11677 " const char *device,\n"
11678 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11683 #: ../src/guestfs-actions.pod:4246
11684 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
11688 #: ../src/guestfs-actions.pod:4250
11689 msgid "guestfs_mkmountpoint"
11693 #: ../src/guestfs-actions.pod:4252
11697 " guestfs_mkmountpoint (guestfs_h *g,\n"
11698 " const char *exemptpath);\n"
11703 #: ../src/guestfs-actions.pod:4256
11705 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11706 "that can be used to create extra mountpoints before mounting the first "
11711 #: ../src/guestfs-actions.pod:4260 ../fish/guestfish-actions.pod:2854
11713 "These calls are I<only> necessary in some very limited circumstances, mainly "
11714 "the case where you want to mount a mix of unrelated and/or read-only "
11715 "filesystems together."
11719 #: ../src/guestfs-actions.pod:4264 ../fish/guestfish-actions.pod:2858
11721 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11722 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11723 "inside that. You can unpack this as follows in guestfish:"
11727 #: ../src/guestfs-actions.pod:4269 ../fish/guestfish-actions.pod:2863
11730 " add-ro Fedora-11-i686-Live.iso\n"
11732 " mkmountpoint /cd\n"
11733 " mkmountpoint /sqsh\n"
11734 " mkmountpoint /ext3fs\n"
11735 " mount /dev/sda /cd\n"
11736 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11737 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11742 #: ../src/guestfs-actions.pod:4278 ../fish/guestfish-actions.pod:2872
11743 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11747 #: ../src/guestfs-actions.pod:4280
11749 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11750 "may get unexpected errors if you try to mix these calls. It is safest to "
11751 "manually unmount filesystems and remove mountpoints after use."
11755 #: ../src/guestfs-actions.pod:4284
11757 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11758 "first, so for this to work for manual mountpoints, you must ensure that the "
11759 "innermost mountpoints have the longest pathnames, as in the example code "
11764 #: ../src/guestfs-actions.pod:4289 ../fish/guestfish-actions.pod:2883
11766 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11770 #: ../src/guestfs-actions.pod:4291
11772 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11773 "means that C<guestfs_umount_all> is called when the handle is closed which "
11774 "can also trigger these issues."
11778 #: ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4556
11779 #: ../src/guestfs-actions.pod:5449
11780 msgid "(Added in 1.0.62)"
11784 #: ../src/guestfs-actions.pod:4299
11785 msgid "guestfs_mknod"
11789 #: ../src/guestfs-actions.pod:4301
11793 " guestfs_mknod (guestfs_h *g,\n"
11797 " const char *path);\n"
11802 #: ../src/guestfs-actions.pod:4308 ../fish/guestfish-actions.pod:2893
11804 "This call creates block or character special devices, or named pipes (FIFOs)."
11808 #: ../src/guestfs-actions.pod:4311 ../fish/guestfish-actions.pod:2896
11810 "The C<mode> parameter should be the mode, using the standard constants. "
11811 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11812 "used when creating block and character special devices."
11816 #: ../src/guestfs-actions.pod:4316
11818 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11819 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11820 "regular file). These constants are available in the standard Linux header "
11821 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11822 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11823 "the appropriate constant for you."
11827 #: ../src/guestfs-actions.pod:4330
11828 msgid "guestfs_mknod_b"
11832 #: ../src/guestfs-actions.pod:4332
11836 " guestfs_mknod_b (guestfs_h *g,\n"
11840 " const char *path);\n"
11845 #: ../src/guestfs-actions.pod:4339
11847 "This call creates a block device node called C<path> with mode C<mode> and "
11848 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11849 "wrapper around C<guestfs_mknod>."
11853 #: ../src/guestfs-actions.pod:4349
11854 msgid "guestfs_mknod_c"
11858 #: ../src/guestfs-actions.pod:4351
11862 " guestfs_mknod_c (guestfs_h *g,\n"
11866 " const char *path);\n"
11871 #: ../src/guestfs-actions.pod:4358
11873 "This call creates a char device node called C<path> with mode C<mode> and "
11874 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11875 "wrapper around C<guestfs_mknod>."
11879 #: ../src/guestfs-actions.pod:4368
11880 msgid "guestfs_mkswap"
11884 #: ../src/guestfs-actions.pod:4370
11888 " guestfs_mkswap (guestfs_h *g,\n"
11889 " const char *device);\n"
11894 #: ../src/guestfs-actions.pod:4374 ../fish/guestfish-actions.pod:2935
11895 msgid "Create a swap partition on C<device>."
11899 #: ../src/guestfs-actions.pod:4380
11900 msgid "guestfs_mkswap_L"
11904 #: ../src/guestfs-actions.pod:4382
11908 " guestfs_mkswap_L (guestfs_h *g,\n"
11909 " const char *label,\n"
11910 " const char *device);\n"
11915 #: ../src/guestfs-actions.pod:4387 ../fish/guestfish-actions.pod:2941
11916 msgid "Create a swap partition on C<device> with label C<label>."
11920 #: ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:2943
11922 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11923 "sda>), just to a partition. This appears to be a limitation of the kernel "
11928 #: ../src/guestfs-actions.pod:4397
11929 msgid "guestfs_mkswap_U"
11933 #: ../src/guestfs-actions.pod:4399
11937 " guestfs_mkswap_U (guestfs_h *g,\n"
11938 " const char *uuid,\n"
11939 " const char *device);\n"
11944 #: ../src/guestfs-actions.pod:4404 ../fish/guestfish-actions.pod:2951
11945 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11949 #: ../src/guestfs-actions.pod:4410
11950 msgid "guestfs_mkswap_file"
11954 #: ../src/guestfs-actions.pod:4412
11958 " guestfs_mkswap_file (guestfs_h *g,\n"
11959 " const char *path);\n"
11964 #: ../src/guestfs-actions.pod:4416 ../fish/guestfish-actions.pod:2957
11965 msgid "Create a swap file."
11969 #: ../src/guestfs-actions.pod:4418
11971 "This command just writes a swap file signature to an existing file. To "
11972 "create the file itself, use something like C<guestfs_fallocate>."
11976 #: ../src/guestfs-actions.pod:4425
11977 msgid "guestfs_modprobe"
11981 #: ../src/guestfs-actions.pod:4427
11985 " guestfs_modprobe (guestfs_h *g,\n"
11986 " const char *modulename);\n"
11991 #: ../src/guestfs-actions.pod:4431 ../fish/guestfish-actions.pod:2966
11992 msgid "This loads a kernel module in the appliance."
11996 #: ../src/guestfs-actions.pod:4433 ../fish/guestfish-actions.pod:2968
11998 "The kernel module must have been whitelisted when libguestfs was built (see "
11999 "C<appliance/kmod.whitelist.in> in the source)."
12003 #: ../src/guestfs-actions.pod:4440
12004 msgid "guestfs_mount"
12008 #: ../src/guestfs-actions.pod:4442
12012 " guestfs_mount (guestfs_h *g,\n"
12013 " const char *device,\n"
12014 " const char *mountpoint);\n"
12019 #: ../src/guestfs-actions.pod:4447 ../fish/guestfish-actions.pod:2975
12021 "Mount a guest disk at a position in the filesystem. Block devices are named "
12022 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12023 "those block devices contain partitions, they will have the usual names (eg. "
12024 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12028 #: ../src/guestfs-actions.pod:4453 ../fish/guestfish-actions.pod:2981
12030 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12031 "mounted on C</> before others can be mounted. Other filesystems can only be "
12032 "mounted on directories which already exist."
12036 #: ../src/guestfs-actions.pod:4458 ../fish/guestfish-actions.pod:2986
12038 "The mounted filesystem is writable, if we have sufficient permissions on the "
12039 "underlying device."
12043 #: ../src/guestfs-actions.pod:4461
12045 "B<Important note:> When you use this call, the filesystem options C<sync> "
12046 "and C<noatime> are set implicitly. This was originally done because we "
12047 "thought it would improve reliability, but it turns out that I<-o sync> has a "
12048 "very large negative performance impact and negligible effect on "
12049 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
12050 "in any code that needs performance, and instead use C<guestfs_mount_options> "
12051 "(use an empty string for the first parameter if you don't want any options)."
12055 #: ../src/guestfs-actions.pod:4475
12056 msgid "guestfs_mount_loop"
12060 #: ../src/guestfs-actions.pod:4477
12064 " guestfs_mount_loop (guestfs_h *g,\n"
12065 " const char *file,\n"
12066 " const char *mountpoint);\n"
12071 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3003
12073 "This command lets you mount C<file> (a filesystem image in a file) on a "
12074 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12079 #: ../src/guestfs-actions.pod:4490
12080 msgid "guestfs_mount_options"
12084 #: ../src/guestfs-actions.pod:4492
12088 " guestfs_mount_options (guestfs_h *g,\n"
12089 " const char *options,\n"
12090 " const char *device,\n"
12091 " const char *mountpoint);\n"
12096 #: ../src/guestfs-actions.pod:4498
12098 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12099 "the mount options as for the L<mount(8)> I<-o> flag."
12103 #: ../src/guestfs-actions.pod:4502 ../fish/guestfish-actions.pod:3015
12105 "If the C<options> parameter is an empty string, then no options are passed "
12106 "(all options default to whatever the filesystem uses)."
12110 #: ../src/guestfs-actions.pod:4508 ../src/guestfs-actions.pod:4522
12111 #: ../src/guestfs-actions.pod:4539
12112 msgid "(Added in 1.0.10)"
12116 #: ../src/guestfs-actions.pod:4510
12117 msgid "guestfs_mount_ro"
12121 #: ../src/guestfs-actions.pod:4512
12125 " guestfs_mount_ro (guestfs_h *g,\n"
12126 " const char *device,\n"
12127 " const char *mountpoint);\n"
12132 #: ../src/guestfs-actions.pod:4517
12134 "This is the same as the C<guestfs_mount> command, but it mounts the "
12135 "filesystem with the read-only (I<-o ro>) flag."
12139 #: ../src/guestfs-actions.pod:4524
12140 msgid "guestfs_mount_vfs"
12144 #: ../src/guestfs-actions.pod:4526
12148 " guestfs_mount_vfs (guestfs_h *g,\n"
12149 " const char *options,\n"
12150 " const char *vfstype,\n"
12151 " const char *device,\n"
12152 " const char *mountpoint);\n"
12157 #: ../src/guestfs-actions.pod:4533
12159 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12160 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
12165 #: ../src/guestfs-actions.pod:4541
12166 msgid "guestfs_mountpoints"
12170 #: ../src/guestfs-actions.pod:4543
12174 " guestfs_mountpoints (guestfs_h *g);\n"
12179 #: ../src/guestfs-actions.pod:4546
12181 "This call is similar to C<guestfs_mounts>. That call returns a list of "
12182 "devices. This one returns a hash table (map) of device name to directory "
12183 "where the device is mounted."
12187 #: ../src/guestfs-actions.pod:4558
12188 msgid "guestfs_mounts"
12192 #: ../src/guestfs-actions.pod:4560
12196 " guestfs_mounts (guestfs_h *g);\n"
12201 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3046
12203 "This returns the list of currently mounted filesystems. It returns the list "
12204 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12208 #: ../src/guestfs-actions.pod:4566 ../fish/guestfish-actions.pod:3049
12209 msgid "Some internal mounts are not shown."
12213 #: ../src/guestfs-actions.pod:4568
12214 msgid "See also: C<guestfs_mountpoints>"
12218 #: ../src/guestfs-actions.pod:4576
12223 #: ../src/guestfs-actions.pod:4578
12227 " guestfs_mv (guestfs_h *g,\n"
12228 " const char *src,\n"
12229 " const char *dest);\n"
12234 #: ../src/guestfs-actions.pod:4583 ../fish/guestfish-actions.pod:3057
12236 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12237 "destination filename or destination directory."
12241 #: ../src/guestfs-actions.pod:4590
12242 msgid "guestfs_ntfs_3g_probe"
12246 #: ../src/guestfs-actions.pod:4592
12250 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
12252 " const char *device);\n"
12257 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3064
12259 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12260 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12261 "write, and some cannot be mounted at all)."
12265 #: ../src/guestfs-actions.pod:4601 ../fish/guestfish-actions.pod:3068
12267 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12268 "can be mounted read-write. Set it to false if you want to test if the "
12269 "volume can be mounted read-only."
12273 #: ../src/guestfs-actions.pod:4605 ../fish/guestfish-actions.pod:3072
12275 "The return value is an integer which C<0> if the operation would succeed, or "
12276 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12280 #: ../src/guestfs-actions.pod:4611
12281 msgid "(Added in 1.0.43)"
12285 #: ../src/guestfs-actions.pod:4613
12286 msgid "guestfs_ntfsresize"
12290 #: ../src/guestfs-actions.pod:4615
12294 " guestfs_ntfsresize (guestfs_h *g,\n"
12295 " const char *device);\n"
12300 #: ../src/guestfs-actions.pod:4619 ../fish/guestfish-actions.pod:3080
12302 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12303 "size of the underlying device. See also L<ntfsresize(8)>."
12307 #: ../src/guestfs-actions.pod:4627
12308 msgid "guestfs_ntfsresize_size"
12312 #: ../src/guestfs-actions.pod:4629
12316 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12317 " const char *device,\n"
12318 " int64_t size);\n"
12323 #: ../src/guestfs-actions.pod:4634
12325 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12326 "to specify the new size (in bytes) explicitly."
12330 #: ../src/guestfs-actions.pod:4639 ../src/guestfs-actions.pod:5075
12331 #: ../src/guestfs-actions.pod:5148 ../src/guestfs-actions.pod:5397
12332 msgid "(Added in 1.3.14)"
12336 #: ../src/guestfs-actions.pod:4641
12337 msgid "guestfs_part_add"
12341 #: ../src/guestfs-actions.pod:4643
12345 " guestfs_part_add (guestfs_h *g,\n"
12346 " const char *device,\n"
12347 " const char *prlogex,\n"
12348 " int64_t startsect,\n"
12349 " int64_t endsect);\n"
12354 #: ../src/guestfs-actions.pod:4650
12356 "This command adds a partition to C<device>. If there is no partition table "
12357 "on the device, call C<guestfs_part_init> first."
12361 #: ../src/guestfs-actions.pod:4653 ../fish/guestfish-actions.pod:3098
12363 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12364 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12365 "C<logical>) and C<e> (or C<extended>) partition types."
12369 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3103
12371 "C<startsect> and C<endsect> are the start and end of the partition in "
12372 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12373 "from the end of the disk (C<-1> is the last sector)."
12377 #: ../src/guestfs-actions.pod:4662
12379 "Creating a partition which covers the whole disk is not so easy. Use "
12380 "C<guestfs_part_disk> to do that."
12384 #: ../src/guestfs-actions.pod:4667 ../src/guestfs-actions.pod:4705
12385 #: ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4836
12386 #: ../src/guestfs-actions.pod:4874 ../src/guestfs-actions.pod:4893
12387 #: ../src/guestfs-actions.pod:4933
12388 msgid "(Added in 1.0.78)"
12392 #: ../src/guestfs-actions.pod:4669
12393 msgid "guestfs_part_del"
12397 #: ../src/guestfs-actions.pod:4671
12401 " guestfs_part_del (guestfs_h *g,\n"
12402 " const char *device,\n"
12408 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3114
12409 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12413 #: ../src/guestfs-actions.pod:4678 ../fish/guestfish-actions.pod:3116
12415 "Note that in the case of MBR partitioning, deleting an extended partition "
12416 "also deletes any logical partitions it contains."
12420 #: ../src/guestfs-actions.pod:4686
12421 msgid "guestfs_part_disk"
12425 #: ../src/guestfs-actions.pod:4688
12429 " guestfs_part_disk (guestfs_h *g,\n"
12430 " const char *device,\n"
12431 " const char *parttype);\n"
12436 #: ../src/guestfs-actions.pod:4693
12438 "This command is simply a combination of C<guestfs_part_init> followed by "
12439 "C<guestfs_part_add> to create a single primary partition covering the whole "
12444 #: ../src/guestfs-actions.pod:4697
12446 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12447 "possible values are described in C<guestfs_part_init>."
12451 #: ../src/guestfs-actions.pod:4707
12452 msgid "guestfs_part_get_bootable"
12456 #: ../src/guestfs-actions.pod:4709
12460 " guestfs_part_get_bootable (guestfs_h *g,\n"
12461 " const char *device,\n"
12467 #: ../src/guestfs-actions.pod:4714 ../fish/guestfish-actions.pod:3138
12469 "This command returns true if the partition C<partnum> on C<device> has the "
12470 "bootable flag set."
12474 #: ../src/guestfs-actions.pod:4717
12475 msgid "See also C<guestfs_part_set_bootable>."
12479 #: ../src/guestfs-actions.pod:4723
12480 msgid "guestfs_part_get_mbr_id"
12484 #: ../src/guestfs-actions.pod:4725
12488 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12489 " const char *device,\n"
12495 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3147
12497 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12498 "partition C<partnum>."
12502 #: ../src/guestfs-actions.pod:4733 ../src/guestfs-actions.pod:4909
12504 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12505 "undefined results for other partition table types (see "
12506 "C<guestfs_part_get_parttype>)."
12510 #: ../src/guestfs-actions.pod:4741
12511 msgid "guestfs_part_get_parttype"
12515 #: ../src/guestfs-actions.pod:4743
12519 " guestfs_part_get_parttype (guestfs_h *g,\n"
12520 " const char *device);\n"
12525 #: ../src/guestfs-actions.pod:4747 ../fish/guestfish-actions.pod:3158
12527 "This command examines the partition table on C<device> and returns the "
12528 "partition table type (format) being used."
12532 #: ../src/guestfs-actions.pod:4750
12534 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12535 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12536 "possible, although unusual. See C<guestfs_part_init> for a full list."
12540 #: ../src/guestfs-actions.pod:4760
12541 msgid "guestfs_part_init"
12545 #: ../src/guestfs-actions.pod:4762
12549 " guestfs_part_init (guestfs_h *g,\n"
12550 " const char *device,\n"
12551 " const char *parttype);\n"
12556 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3170
12558 "This creates an empty partition table on C<device> of one of the partition "
12559 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12560 "(for large disks)."
12564 #: ../src/guestfs-actions.pod:4771
12566 "Initially there are no partitions. Following this, you should call "
12567 "C<guestfs_part_add> for each partition required."
12571 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3177
12572 msgid "Possible values for C<parttype> are:"
12576 #: ../src/guestfs-actions.pod:4778 ../fish/guestfish-actions.pod:3181
12577 msgid "B<efi> | B<gpt>"
12581 #: ../src/guestfs-actions.pod:4780 ../fish/guestfish-actions.pod:3183
12582 msgid "Intel EFI / GPT partition table."
12586 #: ../src/guestfs-actions.pod:4782 ../fish/guestfish-actions.pod:3185
12588 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12589 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12590 "the C<mbr> format."
12594 #: ../src/guestfs-actions.pod:4786 ../fish/guestfish-actions.pod:3189
12595 msgid "B<mbr> | B<msdos>"
12599 #: ../src/guestfs-actions.pod:4788 ../fish/guestfish-actions.pod:3191
12601 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12602 "Windows. This partition type will B<only> work for device sizes up to 2 "
12603 "TB. For large disks we recommend using C<gpt>."
12607 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3198
12609 "Other partition table types that may work but are not supported include:"
12613 #: ../src/guestfs-actions.pod:4800 ../fish/guestfish-actions.pod:3203
12618 #: ../src/guestfs-actions.pod:4802 ../fish/guestfish-actions.pod:3205
12619 msgid "AIX disk labels."
12623 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3207
12624 msgid "B<amiga> | B<rdb>"
12628 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3209
12629 msgid "Amiga \"Rigid Disk Block\" format."
12633 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3211
12638 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3213
12639 msgid "BSD disk labels."
12643 #: ../src/guestfs-actions.pod:4812 ../fish/guestfish-actions.pod:3215
12648 #: ../src/guestfs-actions.pod:4814 ../fish/guestfish-actions.pod:3217
12649 msgid "DASD, used on IBM mainframes."
12653 #: ../src/guestfs-actions.pod:4816 ../fish/guestfish-actions.pod:3219
12658 #: ../src/guestfs-actions.pod:4818 ../fish/guestfish-actions.pod:3221
12659 msgid "MIPS/SGI volumes."
12663 #: ../src/guestfs-actions.pod:4820 ../fish/guestfish-actions.pod:3223
12668 #: ../src/guestfs-actions.pod:4822 ../fish/guestfish-actions.pod:3225
12669 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12673 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3227
12678 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3229
12679 msgid "NEC PC-98 format, common in Japan apparently."
12683 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3231
12688 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3233
12689 msgid "Sun disk labels."
12693 #: ../src/guestfs-actions.pod:4838
12694 msgid "guestfs_part_list"
12698 #: ../src/guestfs-actions.pod:4840
12701 " struct guestfs_partition_list *\n"
12702 " guestfs_part_list (guestfs_h *g,\n"
12703 " const char *device);\n"
12708 #: ../src/guestfs-actions.pod:4844 ../fish/guestfish-actions.pod:3241
12710 "This command parses the partition table on C<device> and returns the list of "
12711 "partitions found."
12715 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3244
12716 msgid "The fields in the returned structure are:"
12720 #: ../src/guestfs-actions.pod:4851 ../fish/guestfish-actions.pod:3248
12721 msgid "B<part_num>"
12725 #: ../src/guestfs-actions.pod:4853 ../fish/guestfish-actions.pod:3250
12726 msgid "Partition number, counting from 1."
12730 #: ../src/guestfs-actions.pod:4855 ../fish/guestfish-actions.pod:3252
12731 msgid "B<part_start>"
12735 #: ../src/guestfs-actions.pod:4857
12737 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12738 "the device's sector size, see C<guestfs_blockdev_getss>."
12742 #: ../src/guestfs-actions.pod:4860 ../fish/guestfish-actions.pod:3257
12743 msgid "B<part_end>"
12747 #: ../src/guestfs-actions.pod:4862 ../fish/guestfish-actions.pod:3259
12748 msgid "End of the partition in bytes."
12752 #: ../src/guestfs-actions.pod:4864 ../fish/guestfish-actions.pod:3261
12753 msgid "B<part_size>"
12757 #: ../src/guestfs-actions.pod:4866 ../fish/guestfish-actions.pod:3263
12758 msgid "Size of the partition in bytes."
12762 #: ../src/guestfs-actions.pod:4870
12764 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12765 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12770 #: ../src/guestfs-actions.pod:4876
12771 msgid "guestfs_part_set_bootable"
12775 #: ../src/guestfs-actions.pod:4878
12779 " guestfs_part_set_bootable (guestfs_h *g,\n"
12780 " const char *device,\n"
12782 " int bootable);\n"
12787 #: ../src/guestfs-actions.pod:4884 ../fish/guestfish-actions.pod:3271
12789 "This sets the bootable flag on partition numbered C<partnum> on device "
12790 "C<device>. Note that partitions are numbered from 1."
12794 #: ../src/guestfs-actions.pod:4887 ../fish/guestfish-actions.pod:3274
12796 "The bootable flag is used by some operating systems (notably Windows) to "
12797 "determine which partition to boot from. It is by no means universally "
12802 #: ../src/guestfs-actions.pod:4895
12803 msgid "guestfs_part_set_mbr_id"
12807 #: ../src/guestfs-actions.pod:4897
12811 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12812 " const char *device,\n"
12819 #: ../src/guestfs-actions.pod:4903 ../fish/guestfish-actions.pod:3282
12821 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12822 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12823 "documentation are in fact hexadecimal numbers, but usually documented "
12824 "without any leading \"0x\" which might be confusing."
12828 #: ../src/guestfs-actions.pod:4917
12829 msgid "guestfs_part_set_name"
12833 #: ../src/guestfs-actions.pod:4919
12837 " guestfs_part_set_name (guestfs_h *g,\n"
12838 " const char *device,\n"
12840 " const char *name);\n"
12845 #: ../src/guestfs-actions.pod:4925 ../fish/guestfish-actions.pod:3296
12847 "This sets the partition name on partition numbered C<partnum> on device "
12848 "C<device>. Note that partitions are numbered from 1."
12852 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3299
12854 "The partition name can only be set on certain types of partition table. "
12855 "This works on C<gpt> but not on C<mbr> partitions."
12859 #: ../src/guestfs-actions.pod:4935
12860 msgid "guestfs_part_to_dev"
12864 #: ../src/guestfs-actions.pod:4937
12868 " guestfs_part_to_dev (guestfs_h *g,\n"
12869 " const char *partition);\n"
12874 #: ../src/guestfs-actions.pod:4941 ../fish/guestfish-actions.pod:3306
12876 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12877 "partition number, returning the device name (eg. \"/dev/sdb\")."
12881 #: ../src/guestfs-actions.pod:4945
12883 "The named partition must exist, for example as a string returned from "
12884 "C<guestfs_list_partitions>."
12888 #: ../src/guestfs-actions.pod:4953
12889 msgid "guestfs_ping_daemon"
12893 #: ../src/guestfs-actions.pod:4955
12897 " guestfs_ping_daemon (guestfs_h *g);\n"
12902 #: ../src/guestfs-actions.pod:4958 ../fish/guestfish-actions.pod:3317
12904 "This is a test probe into the guestfs daemon running inside the qemu "
12905 "subprocess. Calling this function checks that the daemon responds to the "
12906 "ping message, without affecting the daemon or attached block device(s) in "
12911 #: ../src/guestfs-actions.pod:4967
12912 msgid "guestfs_pread"
12916 #: ../src/guestfs-actions.pod:4969
12920 " guestfs_pread (guestfs_h *g,\n"
12921 " const char *path,\n"
12923 " int64_t offset,\n"
12924 " size_t *size_r);\n"
12929 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3326
12931 "This command lets you read part of a file. It reads C<count> bytes of the "
12932 "file, starting at C<offset>, from file C<path>."
12936 #: ../src/guestfs-actions.pod:4979 ../src/guestfs-actions.pod:5005
12937 #: ../fish/guestfish-actions.pod:3329 ../fish/guestfish-actions.pod:3344
12939 "This may read fewer bytes than requested. For further details see the "
12940 "L<pread(2)> system call."
12944 #: ../src/guestfs-actions.pod:4982
12945 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12949 #: ../src/guestfs-actions.pod:4993
12950 msgid "guestfs_pread_device"
12954 #: ../src/guestfs-actions.pod:4995
12958 " guestfs_pread_device (guestfs_h *g,\n"
12959 " const char *device,\n"
12961 " int64_t offset,\n"
12962 " size_t *size_r);\n"
12967 #: ../src/guestfs-actions.pod:5002 ../fish/guestfish-actions.pod:3341
12969 "This command lets you read part of a file. It reads C<count> bytes of "
12970 "C<device>, starting at C<offset>."
12974 #: ../src/guestfs-actions.pod:5008
12975 msgid "See also C<guestfs_pread>."
12979 #: ../src/guestfs-actions.pod:5017
12980 msgid "(Added in 1.5.21)"
12984 #: ../src/guestfs-actions.pod:5019
12985 msgid "guestfs_pvcreate"
12989 #: ../src/guestfs-actions.pod:5021
12993 " guestfs_pvcreate (guestfs_h *g,\n"
12994 " const char *device);\n"
12999 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3356
13001 "This creates an LVM physical volume on the named C<device>, where C<device> "
13002 "should usually be a partition name such as C</dev/sda1>."
13006 #: ../src/guestfs-actions.pod:5033
13007 msgid "guestfs_pvremove"
13011 #: ../src/guestfs-actions.pod:5035
13015 " guestfs_pvremove (guestfs_h *g,\n"
13016 " const char *device);\n"
13021 #: ../src/guestfs-actions.pod:5039 ../fish/guestfish-actions.pod:3364
13023 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13028 #: ../src/guestfs-actions.pod:5042 ../fish/guestfish-actions.pod:3367
13030 "The implementation uses the C<pvremove> command which refuses to wipe "
13031 "physical volumes that contain any volume groups, so you have to remove those "
13036 #: ../src/guestfs-actions.pod:5050
13037 msgid "guestfs_pvresize"
13041 #: ../src/guestfs-actions.pod:5052
13045 " guestfs_pvresize (guestfs_h *g,\n"
13046 " const char *device);\n"
13051 #: ../src/guestfs-actions.pod:5056 ../fish/guestfish-actions.pod:3375
13053 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13054 "the new size of the underlying device."
13058 #: ../src/guestfs-actions.pod:5063
13059 msgid "guestfs_pvresize_size"
13063 #: ../src/guestfs-actions.pod:5065
13067 " guestfs_pvresize_size (guestfs_h *g,\n"
13068 " const char *device,\n"
13069 " int64_t size);\n"
13074 #: ../src/guestfs-actions.pod:5070
13076 "This command is the same as C<guestfs_pvresize> except that it allows you to "
13077 "specify the new size (in bytes) explicitly."
13081 #: ../src/guestfs-actions.pod:5077
13082 msgid "guestfs_pvs"
13086 #: ../src/guestfs-actions.pod:5079
13090 " guestfs_pvs (guestfs_h *g);\n"
13095 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3389
13097 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13102 #: ../src/guestfs-actions.pod:5085 ../fish/guestfish-actions.pod:3392
13104 "This returns a list of just the device names that contain PVs (eg. C</dev/"
13109 #: ../src/guestfs-actions.pod:5088
13110 msgid "See also C<guestfs_pvs_full>."
13114 #: ../src/guestfs-actions.pod:5096
13115 msgid "guestfs_pvs_full"
13119 #: ../src/guestfs-actions.pod:5098
13122 " struct guestfs_lvm_pv_list *\n"
13123 " guestfs_pvs_full (guestfs_h *g);\n"
13128 #: ../src/guestfs-actions.pod:5101 ../fish/guestfish-actions.pod:3401
13130 "List all the physical volumes detected. This is the equivalent of the L<pvs"
13131 "(8)> command. The \"full\" version includes all fields."
13135 #: ../src/guestfs-actions.pod:5104
13137 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
13138 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
13142 #: ../src/guestfs-actions.pod:5110
13143 msgid "guestfs_pvuuid"
13147 #: ../src/guestfs-actions.pod:5112
13151 " guestfs_pvuuid (guestfs_h *g,\n"
13152 " const char *device);\n"
13157 #: ../src/guestfs-actions.pod:5116 ../fish/guestfish-actions.pod:3408
13158 msgid "This command returns the UUID of the LVM PV C<device>."
13162 #: ../src/guestfs-actions.pod:5123
13163 msgid "guestfs_pwrite"
13167 #: ../src/guestfs-actions.pod:5125
13171 " guestfs_pwrite (guestfs_h *g,\n"
13172 " const char *path,\n"
13173 " const char *content,\n"
13174 " size_t content_size,\n"
13175 " int64_t offset);\n"
13180 #: ../src/guestfs-actions.pod:5132 ../fish/guestfish-actions.pod:3414
13182 "This command writes to part of a file. It writes the data buffer C<content> "
13183 "to the file C<path> starting at offset C<offset>."
13187 #: ../src/guestfs-actions.pod:5135 ../fish/guestfish-actions.pod:3417
13189 "This command implements the L<pwrite(2)> system call, and like that system "
13190 "call it may not write the full data requested. The return value is the "
13191 "number of bytes that were actually written to the file. This could even be "
13192 "0, although short writes are unlikely for regular files in ordinary "
13197 #: ../src/guestfs-actions.pod:5141
13198 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
13202 #: ../src/guestfs-actions.pod:5150
13203 msgid "guestfs_pwrite_device"
13207 #: ../src/guestfs-actions.pod:5152
13211 " guestfs_pwrite_device (guestfs_h *g,\n"
13212 " const char *device,\n"
13213 " const char *content,\n"
13214 " size_t content_size,\n"
13215 " int64_t offset);\n"
13220 #: ../src/guestfs-actions.pod:5159 ../fish/guestfish-actions.pod:3432
13222 "This command writes to part of a device. It writes the data buffer "
13223 "C<content> to C<device> starting at offset C<offset>."
13227 #: ../src/guestfs-actions.pod:5162 ../fish/guestfish-actions.pod:3435
13229 "This command implements the L<pwrite(2)> system call, and like that system "
13230 "call it may not write the full data requested (although short writes to disk "
13231 "devices and partitions are probably impossible with standard Linux kernels)."
13235 #: ../src/guestfs-actions.pod:5167
13236 msgid "See also C<guestfs_pwrite>."
13240 #: ../src/guestfs-actions.pod:5174
13241 msgid "(Added in 1.5.20)"
13245 #: ../src/guestfs-actions.pod:5176
13246 msgid "guestfs_read_file"
13250 #: ../src/guestfs-actions.pod:5178
13254 " guestfs_read_file (guestfs_h *g,\n"
13255 " const char *path,\n"
13256 " size_t *size_r);\n"
13261 #: ../src/guestfs-actions.pod:5183 ../fish/guestfish-actions.pod:3449
13262 msgid "This calls returns the contents of the file C<path> as a buffer."
13266 #: ../src/guestfs-actions.pod:5186
13268 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
13269 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
13270 "function is limited in the total size of file that can be handled."
13274 #: ../src/guestfs-actions.pod:5198
13275 msgid "(Added in 1.0.63)"
13279 #: ../src/guestfs-actions.pod:5200
13280 msgid "guestfs_read_lines"
13284 #: ../src/guestfs-actions.pod:5202
13288 " guestfs_read_lines (guestfs_h *g,\n"
13289 " const char *path);\n"
13294 #: ../src/guestfs-actions.pod:5208 ../fish/guestfish-actions.pod:3466
13296 "The file contents are returned as a list of lines. Trailing C<LF> and "
13297 "C<CRLF> character sequences are I<not> returned."
13301 #: ../src/guestfs-actions.pod:5211
13303 "Note that this function cannot correctly handle binary files (specifically, "
13304 "files containing C<\\0> character which is treated as end of line). For "
13305 "those you need to use the C<guestfs_read_file> function which has a more "
13306 "complex interface."
13310 #: ../src/guestfs-actions.pod:5222
13311 msgid "guestfs_readdir"
13315 #: ../src/guestfs-actions.pod:5224
13318 " struct guestfs_dirent_list *\n"
13319 " guestfs_readdir (guestfs_h *g,\n"
13320 " const char *dir);\n"
13325 #: ../src/guestfs-actions.pod:5228 ../fish/guestfish-actions.pod:3478
13326 msgid "This returns the list of directory entries in directory C<dir>."
13330 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:3480
13332 "All entries in the directory are returned, including C<.> and C<..>. The "
13333 "entries are I<not> sorted, but returned in the same order as the underlying "
13338 #: ../src/guestfs-actions.pod:5234 ../fish/guestfish-actions.pod:3484
13340 "Also this call returns basic file type information about each file. The "
13341 "C<ftyp> field will contain one of the following characters:"
13345 #: ../src/guestfs-actions.pod:5239 ../fish/guestfish-actions.pod:3489
13350 #: ../src/guestfs-actions.pod:5241 ../fish/guestfish-actions.pod:3491
13351 msgid "Block special"
13355 #: ../src/guestfs-actions.pod:5243 ../fish/guestfish-actions.pod:3493
13360 #: ../src/guestfs-actions.pod:5245 ../fish/guestfish-actions.pod:3495
13361 msgid "Char special"
13365 #: ../src/guestfs-actions.pod:5247 ../fish/guestfish-actions.pod:3497
13370 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:3499
13375 #: ../src/guestfs-actions.pod:5251 ../fish/guestfish-actions.pod:3501
13380 #: ../src/guestfs-actions.pod:5253 ../fish/guestfish-actions.pod:3503
13381 msgid "FIFO (named pipe)"
13385 #: ../src/guestfs-actions.pod:5255 ../fish/guestfish-actions.pod:3505
13390 #: ../src/guestfs-actions.pod:5257 ../fish/guestfish-actions.pod:3507
13391 msgid "Symbolic link"
13395 #: ../src/guestfs-actions.pod:5259 ../fish/guestfish-actions.pod:3509
13400 #: ../src/guestfs-actions.pod:5261 ../fish/guestfish-actions.pod:3511
13401 msgid "Regular file"
13405 #: ../src/guestfs-actions.pod:5263 ../fish/guestfish-actions.pod:3513
13410 #: ../src/guestfs-actions.pod:5265 ../fish/guestfish-actions.pod:3515
13415 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3517
13420 #: ../src/guestfs-actions.pod:5269 ../fish/guestfish-actions.pod:3519
13421 msgid "Unknown file type"
13425 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:3521
13430 #: ../src/guestfs-actions.pod:5273 ../fish/guestfish-actions.pod:3523
13432 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13436 #: ../src/guestfs-actions.pod:5278
13438 "This function is primarily intended for use by programs. To get a simple "
13439 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13440 "consumption, use C<guestfs_ll>."
13444 #: ../src/guestfs-actions.pod:5282
13446 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13447 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13451 #: ../src/guestfs-actions.pod:5288
13452 msgid "guestfs_readlink"
13456 #: ../src/guestfs-actions.pod:5290
13460 " guestfs_readlink (guestfs_h *g,\n"
13461 " const char *path);\n"
13466 #: ../src/guestfs-actions.pod:5294 ../fish/guestfish-actions.pod:3536
13467 msgid "This command reads the target of a symbolic link."
13471 #: ../src/guestfs-actions.pod:5301
13472 msgid "guestfs_readlinklist"
13476 #: ../src/guestfs-actions.pod:5303
13480 " guestfs_readlinklist (guestfs_h *g,\n"
13481 " const char *path,\n"
13482 " char *const *names);\n"
13487 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:3542
13489 "This call allows you to do a C<readlink> operation on multiple files, where "
13490 "all files are in the directory C<path>. C<names> is the list of files from "
13495 #: ../src/guestfs-actions.pod:5312 ../fish/guestfish-actions.pod:3546
13497 "On return you get a list of strings, with a one-to-one correspondence to the "
13498 "C<names> list. Each string is the value of the symbolic link."
13502 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3550
13504 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13505 "result string is the empty string C<\"\">. However the whole operation is "
13506 "completed even if there were C<readlink(2)> errors, and so you can call this "
13507 "function with names where you don't know if they are symbolic links already "
13508 "(albeit slightly less efficient)."
13512 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:3557
13514 "This call is intended for programs that want to efficiently list a directory "
13515 "contents without making many round-trips. Very long directory listings "
13516 "might cause the protocol message size to be exceeded, causing this call to "
13517 "fail. The caller must split up such requests into smaller groups of names."
13521 #: ../src/guestfs-actions.pod:5336
13522 msgid "guestfs_realpath"
13526 #: ../src/guestfs-actions.pod:5338
13530 " guestfs_realpath (guestfs_h *g,\n"
13531 " const char *path);\n"
13536 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3568
13538 "Return the canonicalized absolute pathname of C<path>. The returned path "
13539 "has no C<.>, C<..> or symbolic link path elements."
13543 #: ../src/guestfs-actions.pod:5350
13544 msgid "guestfs_removexattr"
13548 #: ../src/guestfs-actions.pod:5352
13552 " guestfs_removexattr (guestfs_h *g,\n"
13553 " const char *xattr,\n"
13554 " const char *path);\n"
13559 #: ../src/guestfs-actions.pod:5357 ../fish/guestfish-actions.pod:3575
13561 "This call removes the extended attribute named C<xattr> of the file C<path>."
13565 #: ../src/guestfs-actions.pod:5360
13566 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13570 #: ../src/guestfs-actions.pod:5366
13571 msgid "guestfs_resize2fs"
13575 #: ../src/guestfs-actions.pod:5368
13579 " guestfs_resize2fs (guestfs_h *g,\n"
13580 " const char *device);\n"
13585 #: ../src/guestfs-actions.pod:5372 ../fish/guestfish-actions.pod:3584
13587 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13588 "underlying device."
13592 #: ../src/guestfs-actions.pod:5375
13594 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13595 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13596 "sometimes gives an error about this and sometimes not. In any case, it is "
13597 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13601 #: ../src/guestfs-actions.pod:5385
13602 msgid "guestfs_resize2fs_size"
13606 #: ../src/guestfs-actions.pod:5387
13610 " guestfs_resize2fs_size (guestfs_h *g,\n"
13611 " const char *device,\n"
13612 " int64_t size);\n"
13617 #: ../src/guestfs-actions.pod:5392
13619 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13620 "to specify the new size (in bytes) explicitly."
13624 #: ../src/guestfs-actions.pod:5399
13629 #: ../src/guestfs-actions.pod:5401
13633 " guestfs_rm (guestfs_h *g,\n"
13634 " const char *path);\n"
13639 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:3604
13640 msgid "Remove the single file C<path>."
13644 #: ../src/guestfs-actions.pod:5411
13645 msgid "guestfs_rm_rf"
13649 #: ../src/guestfs-actions.pod:5413
13653 " guestfs_rm_rf (guestfs_h *g,\n"
13654 " const char *path);\n"
13659 #: ../src/guestfs-actions.pod:5417 ../fish/guestfish-actions.pod:3610
13661 "Remove the file or directory C<path>, recursively removing the contents if "
13662 "its a directory. This is like the C<rm -rf> shell command."
13666 #: ../src/guestfs-actions.pod:5425
13667 msgid "guestfs_rmdir"
13671 #: ../src/guestfs-actions.pod:5427
13675 " guestfs_rmdir (guestfs_h *g,\n"
13676 " const char *path);\n"
13681 #: ../src/guestfs-actions.pod:5431 ../fish/guestfish-actions.pod:3618
13682 msgid "Remove the single directory C<path>."
13686 #: ../src/guestfs-actions.pod:5437
13687 msgid "guestfs_rmmountpoint"
13691 #: ../src/guestfs-actions.pod:5439
13695 " guestfs_rmmountpoint (guestfs_h *g,\n"
13696 " const char *exemptpath);\n"
13701 #: ../src/guestfs-actions.pod:5443
13703 "This calls removes a mountpoint that was previously created with "
13704 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13708 #: ../src/guestfs-actions.pod:5451
13709 msgid "guestfs_scrub_device"
13713 #: ../src/guestfs-actions.pod:5453
13717 " guestfs_scrub_device (guestfs_h *g,\n"
13718 " const char *device);\n"
13723 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3632
13725 "This command writes patterns over C<device> to make data retrieval more "
13730 #: ../src/guestfs-actions.pod:5460 ../src/guestfs-actions.pod:5481
13731 #: ../src/guestfs-actions.pod:5500 ../fish/guestfish-actions.pod:3635
13732 #: ../fish/guestfish-actions.pod:3650 ../fish/guestfish-actions.pod:3663
13734 "It is an interface to the L<scrub(1)> program. See that manual page for "
13739 #: ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5486
13740 #: ../src/guestfs-actions.pod:5505
13741 msgid "(Added in 1.0.52)"
13745 #: ../src/guestfs-actions.pod:5470
13746 msgid "guestfs_scrub_file"
13750 #: ../src/guestfs-actions.pod:5472
13754 " guestfs_scrub_file (guestfs_h *g,\n"
13755 " const char *file);\n"
13760 #: ../src/guestfs-actions.pod:5476 ../fish/guestfish-actions.pod:3645
13762 "This command writes patterns over a file to make data retrieval more "
13767 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:3648
13768 msgid "The file is I<removed> after scrubbing."
13772 #: ../src/guestfs-actions.pod:5488
13773 msgid "guestfs_scrub_freespace"
13777 #: ../src/guestfs-actions.pod:5490
13781 " guestfs_scrub_freespace (guestfs_h *g,\n"
13782 " const char *dir);\n"
13787 #: ../src/guestfs-actions.pod:5494
13789 "This command creates the directory C<dir> and then fills it with files until "
13790 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13791 "and deletes them. The intention is to scrub any free space on the partition "
13792 "containing C<dir>."
13796 #: ../src/guestfs-actions.pod:5507
13797 msgid "guestfs_set_append"
13801 #: ../src/guestfs-actions.pod:5509
13805 " guestfs_set_append (guestfs_h *g,\n"
13806 " const char *append);\n"
13811 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3672
13813 "This function is used to add additional options to the guest kernel command "
13818 #: ../src/guestfs-actions.pod:5516 ../fish/guestfish-actions.pod:3675
13820 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13821 "environment variable."
13825 #: ../src/guestfs-actions.pod:5519 ../fish/guestfish-actions.pod:3678
13827 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13828 "(libguestfs always adds a few of its own)."
13832 #: ../src/guestfs-actions.pod:5526
13833 msgid "guestfs_set_autosync"
13837 #: ../src/guestfs-actions.pod:5528
13841 " guestfs_set_autosync (guestfs_h *g,\n"
13842 " int autosync);\n"
13847 #: ../src/guestfs-actions.pod:5532
13849 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13850 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13851 "the handle is closed (also if the program exits without closing handles)."
13855 #: ../src/guestfs-actions.pod:5537 ../fish/guestfish-actions.pod:3692
13857 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13858 "disabled by default)."
13862 #: ../src/guestfs-actions.pod:5544
13863 msgid "guestfs_set_direct"
13867 #: ../src/guestfs-actions.pod:5546
13871 " guestfs_set_direct (guestfs_h *g,\n"
13877 #: ../src/guestfs-actions.pod:5550 ../fish/guestfish-actions.pod:3701
13879 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13880 "passed directly through to the appliance once it is launched."
13884 #: ../src/guestfs-actions.pod:5554
13886 "One consequence of this is that log messages aren't caught by the library "
13887 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13892 #: ../src/guestfs-actions.pod:5558 ../fish/guestfish-actions.pod:3709
13893 msgid "You probably don't want to use this unless you know what you are doing."
13897 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:3712
13898 msgid "The default is disabled."
13902 #: ../src/guestfs-actions.pod:5567
13903 msgid "guestfs_set_e2label"
13907 #: ../src/guestfs-actions.pod:5569
13911 " guestfs_set_e2label (guestfs_h *g,\n"
13912 " const char *device,\n"
13913 " const char *label);\n"
13918 #: ../src/guestfs-actions.pod:5574 ../fish/guestfish-actions.pod:3718
13920 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13921 "C<label>. Filesystem labels are limited to 16 characters."
13925 #: ../src/guestfs-actions.pod:5578
13927 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13928 "the existing label on a filesystem."
13932 #: ../src/guestfs-actions.pod:5585
13933 msgid "guestfs_set_e2uuid"
13937 #: ../src/guestfs-actions.pod:5587
13941 " guestfs_set_e2uuid (guestfs_h *g,\n"
13942 " const char *device,\n"
13943 " const char *uuid);\n"
13948 #: ../src/guestfs-actions.pod:5592 ../fish/guestfish-actions.pod:3729
13950 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13951 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13952 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13956 #: ../src/guestfs-actions.pod:5597
13958 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13959 "the existing UUID of a filesystem."
13963 #: ../src/guestfs-actions.pod:5604
13964 msgid "guestfs_set_memsize"
13968 #: ../src/guestfs-actions.pod:5606
13972 " guestfs_set_memsize (guestfs_h *g,\n"
13978 #: ../src/guestfs-actions.pod:5610
13980 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13981 "This only has any effect if called before C<guestfs_launch>."
13985 #: ../src/guestfs-actions.pod:5614 ../fish/guestfish-actions.pod:3747
13987 "You can also change this by setting the environment variable "
13988 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13992 #: ../src/guestfs-actions.pod:5625
13993 msgid "guestfs_set_network"
13997 #: ../src/guestfs-actions.pod:5627
14001 " guestfs_set_network (guestfs_h *g,\n"
14007 #: ../src/guestfs-actions.pod:5631 ../fish/guestfish-actions.pod:3760
14009 "If C<network> is true, then the network is enabled in the libguestfs "
14010 "appliance. The default is false."
14014 #: ../src/guestfs-actions.pod:5634 ../fish/guestfish-actions.pod:3763
14016 "This affects whether commands are able to access the network (see L<guestfs"
14017 "(3)/RUNNING COMMANDS>)."
14021 #: ../src/guestfs-actions.pod:5637
14023 "You must call this before calling C<guestfs_launch>, otherwise it has no "
14028 #: ../src/guestfs-actions.pod:5644
14029 msgid "guestfs_set_path"
14033 #: ../src/guestfs-actions.pod:5646
14037 " guestfs_set_path (guestfs_h *g,\n"
14038 " const char *searchpath);\n"
14043 #: ../src/guestfs-actions.pod:5650 ../fish/guestfish-actions.pod:3775
14044 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14048 #: ../src/guestfs-actions.pod:5652 ../fish/guestfish-actions.pod:3777
14050 "The default is C<$libdir/guestfs> unless overridden by setting "
14051 "C<LIBGUESTFS_PATH> environment variable."
14055 #: ../src/guestfs-actions.pod:5655 ../fish/guestfish-actions.pod:3780
14056 msgid "Setting C<path> to C<NULL> restores the default path."
14060 #: ../src/guestfs-actions.pod:5661
14061 msgid "guestfs_set_qemu"
14065 #: ../src/guestfs-actions.pod:5663
14069 " guestfs_set_qemu (guestfs_h *g,\n"
14070 " const char *qemu);\n"
14075 #: ../src/guestfs-actions.pod:5667 ../fish/guestfish-actions.pod:3788
14076 msgid "Set the qemu binary that we will use."
14080 #: ../src/guestfs-actions.pod:5669 ../fish/guestfish-actions.pod:3790
14082 "The default is chosen when the library was compiled by the configure script."
14086 #: ../src/guestfs-actions.pod:5672 ../fish/guestfish-actions.pod:3793
14088 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14093 #: ../src/guestfs-actions.pod:5675 ../fish/guestfish-actions.pod:3796
14094 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14098 #: ../src/guestfs-actions.pod:5677 ../fish/guestfish-actions.pod:3798
14100 "Note that you should call this function as early as possible after creating "
14101 "the handle. This is because some pre-launch operations depend on testing "
14102 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14103 "don't retest features, and so you might see inconsistent results. Using the "
14104 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14105 "the qemu binary at the same time as the handle is created."
14109 #: ../src/guestfs-actions.pod:5689
14110 msgid "guestfs_set_recovery_proc"
14114 #: ../src/guestfs-actions.pod:5691
14118 " guestfs_set_recovery_proc (guestfs_h *g,\n"
14119 " int recoveryproc);\n"
14124 #: ../src/guestfs-actions.pod:5695
14126 "If this is called with the parameter C<false> then C<guestfs_launch> does "
14127 "not create a recovery process. The purpose of the recovery process is to "
14128 "stop runaway qemu processes in the case where the main program aborts "
14133 #: ../src/guestfs-actions.pod:5700
14135 "This only has any effect if called before C<guestfs_launch>, and the default "
14140 #: ../src/guestfs-actions.pod:5703 ../fish/guestfish-actions.pod:3820
14142 "About the only time when you would want to disable this is if the main "
14143 "process will fork itself into the background (\"daemonize\" itself). In "
14144 "this case the recovery process thinks that the main program has disappeared "
14145 "and so kills qemu, which is not very helpful."
14149 #: ../src/guestfs-actions.pod:5713
14150 msgid "guestfs_set_selinux"
14154 #: ../src/guestfs-actions.pod:5715
14158 " guestfs_set_selinux (guestfs_h *g,\n"
14164 #: ../src/guestfs-actions.pod:5719 ../fish/guestfish-actions.pod:3832
14166 "This sets the selinux flag that is passed to the appliance at boot time. "
14167 "The default is C<selinux=0> (disabled)."
14171 #: ../src/guestfs-actions.pod:5722 ../fish/guestfish-actions.pod:3835
14173 "Note that if SELinux is enabled, it is always in Permissive mode "
14174 "(C<enforcing=0>)."
14178 #: ../src/guestfs-actions.pod:5732
14179 msgid "guestfs_set_trace"
14183 #: ../src/guestfs-actions.pod:5734
14187 " guestfs_set_trace (guestfs_h *g,\n"
14193 #: ../src/guestfs-actions.pod:5738 ../fish/guestfish-actions.pod:3847
14195 "If the command trace flag is set to 1, then commands are printed on stderr "
14196 "before they are executed in a format which is very similar to the one used "
14197 "by guestfish. In other words, you can run a program with this enabled, and "
14198 "you will get out a script which you can feed to guestfish to perform the "
14199 "same set of actions."
14203 #: ../src/guestfs-actions.pod:5745 ../fish/guestfish-actions.pod:3854
14205 "If you want to trace C API calls into libguestfs (and other libraries) then "
14206 "possibly a better way is to use the external ltrace(1) command."
14210 #: ../src/guestfs-actions.pod:5749 ../fish/guestfish-actions.pod:3858
14212 "Command traces are disabled unless the environment variable "
14213 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14217 #: ../src/guestfs-actions.pod:5756
14218 msgid "guestfs_set_verbose"
14222 #: ../src/guestfs-actions.pod:5758
14226 " guestfs_set_verbose (guestfs_h *g,\n"
14232 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3867
14233 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
14237 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3869
14239 "Verbose messages are disabled unless the environment variable "
14240 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14244 #: ../src/guestfs-actions.pod:5771
14245 msgid "guestfs_setcon"
14249 #: ../src/guestfs-actions.pod:5773
14253 " guestfs_setcon (guestfs_h *g,\n"
14254 " const char *context);\n"
14259 #: ../src/guestfs-actions.pod:5777 ../fish/guestfish-actions.pod:3876
14261 "This sets the SELinux security context of the daemon to the string "
14266 #: ../src/guestfs-actions.pod:5780 ../fish/guestfish-actions.pod:3879
14267 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14271 #: ../src/guestfs-actions.pod:5786
14272 msgid "guestfs_setxattr"
14276 #: ../src/guestfs-actions.pod:5788
14280 " guestfs_setxattr (guestfs_h *g,\n"
14281 " const char *xattr,\n"
14282 " const char *val,\n"
14284 " const char *path);\n"
14289 #: ../src/guestfs-actions.pod:5795 ../fish/guestfish-actions.pod:3885
14291 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14292 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14296 #: ../src/guestfs-actions.pod:5799
14297 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14301 #: ../src/guestfs-actions.pod:5805
14302 msgid "guestfs_sfdisk"
14306 #: ../src/guestfs-actions.pod:5807
14310 " guestfs_sfdisk (guestfs_h *g,\n"
14311 " const char *device,\n"
14315 " char *const *lines);\n"
14320 #: ../src/guestfs-actions.pod:5815 ../fish/guestfish-actions.pod:3895
14322 "This is a direct interface to the L<sfdisk(8)> program for creating "
14323 "partitions on block devices."
14327 #: ../src/guestfs-actions.pod:5818 ../fish/guestfish-actions.pod:3898
14328 msgid "C<device> should be a block device, for example C</dev/sda>."
14332 #: ../src/guestfs-actions.pod:5820 ../fish/guestfish-actions.pod:3900
14334 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14335 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14336 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14337 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14338 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14339 "the kernel) cannot work out the right geometry and you will need to tell it."
14343 #: ../src/guestfs-actions.pod:5828 ../fish/guestfish-actions.pod:3908
14345 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14346 "refer to the L<sfdisk(8)> manpage."
14350 #: ../src/guestfs-actions.pod:5831 ../fish/guestfish-actions.pod:3911
14352 "To create a single partition occupying the whole disk, you would pass "
14353 "C<lines> as a single element list, when the single element being the string "
14358 #: ../src/guestfs-actions.pod:5835
14360 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14364 #: ../src/guestfs-actions.pod:5845
14365 msgid "guestfs_sfdiskM"
14369 #: ../src/guestfs-actions.pod:5847
14373 " guestfs_sfdiskM (guestfs_h *g,\n"
14374 " const char *device,\n"
14375 " char *const *lines);\n"
14380 #: ../src/guestfs-actions.pod:5852
14382 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14383 "partition sizes are specified in megabytes only (rounded to the nearest "
14384 "cylinder) and you don't need to specify the cyls, heads and sectors "
14385 "parameters which were rarely if ever used anyway."
14389 #: ../src/guestfs-actions.pod:5858
14391 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14392 "C<guestfs_part_disk>"
14396 #: ../src/guestfs-actions.pod:5868
14397 msgid "guestfs_sfdisk_N"
14401 #: ../src/guestfs-actions.pod:5870
14405 " guestfs_sfdisk_N (guestfs_h *g,\n"
14406 " const char *device,\n"
14411 " const char *line);\n"
14416 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3941
14418 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14419 "(note: C<n> counts from 1)."
14423 #: ../src/guestfs-actions.pod:5882
14425 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14426 "for the cyls/heads/sectors parameters."
14430 #: ../src/guestfs-actions.pod:5885
14431 msgid "See also: C<guestfs_part_add>"
14435 #: ../src/guestfs-actions.pod:5894
14436 msgid "guestfs_sfdisk_disk_geometry"
14440 #: ../src/guestfs-actions.pod:5896
14444 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14445 " const char *device);\n"
14450 #: ../src/guestfs-actions.pod:5900
14452 "This displays the disk geometry of C<device> read from the partition table. "
14453 "Especially in the case where the underlying block device has been resized, "
14454 "this can be different from the kernel's idea of the geometry (see "
14455 "C<guestfs_sfdisk_kernel_geometry>)."
14459 #: ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:5921
14460 #: ../fish/guestfish-actions.pod:3961 ../fish/guestfish-actions.pod:3970
14461 msgid "The result is in human-readable format, and not designed to be parsed."
14465 #: ../src/guestfs-actions.pod:5913
14466 msgid "guestfs_sfdisk_kernel_geometry"
14470 #: ../src/guestfs-actions.pod:5915
14474 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14475 " const char *device);\n"
14480 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:3968
14481 msgid "This displays the kernel's idea of the geometry of C<device>."
14485 #: ../src/guestfs-actions.pod:5929
14486 msgid "guestfs_sfdisk_l"
14490 #: ../src/guestfs-actions.pod:5931
14494 " guestfs_sfdisk_l (guestfs_h *g,\n"
14495 " const char *device);\n"
14500 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:3977
14502 "This displays the partition table on C<device>, in the human-readable output "
14503 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14507 #: ../src/guestfs-actions.pod:5939
14508 msgid "See also: C<guestfs_part_list>"
14512 #: ../src/guestfs-actions.pod:5946
14517 #: ../src/guestfs-actions.pod:5948
14521 " guestfs_sh (guestfs_h *g,\n"
14522 " const char *command);\n"
14527 #: ../src/guestfs-actions.pod:5952 ../fish/guestfish-actions.pod:3987
14529 "This call runs a command from the guest filesystem via the guest's C</bin/"
14534 #: ../src/guestfs-actions.pod:5955
14535 msgid "This is like C<guestfs_command>, but passes the command to:"
14539 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:3992
14542 " /bin/sh -c \"command\"\n"
14547 #: ../src/guestfs-actions.pod:5959 ../fish/guestfish-actions.pod:3994
14549 "Depending on the guest's shell, this usually results in wildcards being "
14550 "expanded, shell expressions being interpolated and so on."
14554 #: ../src/guestfs-actions.pod:5963
14555 msgid "All the provisos about C<guestfs_command> apply to this call."
14559 #: ../src/guestfs-actions.pod:5970
14560 msgid "guestfs_sh_lines"
14564 #: ../src/guestfs-actions.pod:5972
14568 " guestfs_sh_lines (guestfs_h *g,\n"
14569 " const char *command);\n"
14574 #: ../src/guestfs-actions.pod:5976
14576 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14581 #: ../src/guestfs-actions.pod:5979
14582 msgid "See also: C<guestfs_command_lines>"
14586 #: ../src/guestfs-actions.pod:5987
14587 msgid "guestfs_sleep"
14591 #: ../src/guestfs-actions.pod:5989
14595 " guestfs_sleep (guestfs_h *g,\n"
14601 #: ../src/guestfs-actions.pod:5993 ../fish/guestfish-actions.pod:4013
14602 msgid "Sleep for C<secs> seconds."
14606 #: ../src/guestfs-actions.pod:5997
14607 msgid "(Added in 1.0.41)"
14611 #: ../src/guestfs-actions.pod:5999 ../src/guestfs-structs.pod:109
14612 msgid "guestfs_stat"
14616 #: ../src/guestfs-actions.pod:6001
14619 " struct guestfs_stat *\n"
14620 " guestfs_stat (guestfs_h *g,\n"
14621 " const char *path);\n"
14626 #: ../src/guestfs-actions.pod:6007 ../fish/guestfish-actions.pod:4021
14627 msgid "This is the same as the C<stat(2)> system call."
14631 #: ../src/guestfs-actions.pod:6015 ../src/guestfs-structs.pod:135
14632 msgid "guestfs_statvfs"
14636 #: ../src/guestfs-actions.pod:6017
14639 " struct guestfs_statvfs *\n"
14640 " guestfs_statvfs (guestfs_h *g,\n"
14641 " const char *path);\n"
14646 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:4027
14648 "Returns file system statistics for any mounted file system. C<path> should "
14649 "be a file or directory in the mounted file system (typically it is the mount "
14650 "point itself, but it doesn't need to be)."
14654 #: ../src/guestfs-actions.pod:6025 ../fish/guestfish-actions.pod:4031
14655 msgid "This is the same as the C<statvfs(2)> system call."
14659 #: ../src/guestfs-actions.pod:6027
14661 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14662 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14666 #: ../src/guestfs-actions.pod:6033
14667 msgid "guestfs_strings"
14671 #: ../src/guestfs-actions.pod:6035
14675 " guestfs_strings (guestfs_h *g,\n"
14676 " const char *path);\n"
14681 #: ../src/guestfs-actions.pod:6039 ../fish/guestfish-actions.pod:4037
14683 "This runs the L<strings(1)> command on a file and returns the list of "
14684 "printable strings found."
14688 #: ../src/guestfs-actions.pod:6051
14689 msgid "guestfs_strings_e"
14693 #: ../src/guestfs-actions.pod:6053
14697 " guestfs_strings_e (guestfs_h *g,\n"
14698 " const char *encoding,\n"
14699 " const char *path);\n"
14704 #: ../src/guestfs-actions.pod:6058
14706 "This is like the C<guestfs_strings> command, but allows you to specify the "
14707 "encoding of strings that are looked for in the source file C<path>."
14711 #: ../src/guestfs-actions.pod:6062 ../fish/guestfish-actions.pod:4051
14712 msgid "Allowed encodings are:"
14716 #: ../src/guestfs-actions.pod:6066 ../fish/guestfish-actions.pod:4055
14721 #: ../src/guestfs-actions.pod:6068
14723 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14724 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14728 #: ../src/guestfs-actions.pod:6071 ../fish/guestfish-actions.pod:4060
14733 #: ../src/guestfs-actions.pod:6073 ../fish/guestfish-actions.pod:4062
14734 msgid "Single 8-bit-byte characters."
14738 #: ../src/guestfs-actions.pod:6075 ../fish/guestfish-actions.pod:4064
14743 #: ../src/guestfs-actions.pod:6077 ../fish/guestfish-actions.pod:4066
14744 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14748 #: ../src/guestfs-actions.pod:6080 ../fish/guestfish-actions.pod:4069
14749 msgid "l (lower case letter L)"
14753 #: ../src/guestfs-actions.pod:6082 ../fish/guestfish-actions.pod:4071
14755 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14756 "examining binaries in Windows guests."
14760 #: ../src/guestfs-actions.pod:6085 ../fish/guestfish-actions.pod:4074
14765 #: ../src/guestfs-actions.pod:6087 ../fish/guestfish-actions.pod:4076
14766 msgid "32-bit big endian such as UCS-4BE."
14770 #: ../src/guestfs-actions.pod:6089 ../fish/guestfish-actions.pod:4078
14775 #: ../src/guestfs-actions.pod:6091 ../fish/guestfish-actions.pod:4080
14776 msgid "32-bit little endian such as UCS-4LE."
14780 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4084
14781 msgid "The returned strings are transcoded to UTF-8."
14785 #: ../src/guestfs-actions.pod:6106
14786 msgid "guestfs_swapoff_device"
14790 #: ../src/guestfs-actions.pod:6108
14794 " guestfs_swapoff_device (guestfs_h *g,\n"
14795 " const char *device);\n"
14800 #: ../src/guestfs-actions.pod:6112
14802 "This command disables the libguestfs appliance swap device or partition "
14803 "named C<device>. See C<guestfs_swapon_device>."
14807 #: ../src/guestfs-actions.pod:6120
14808 msgid "guestfs_swapoff_file"
14812 #: ../src/guestfs-actions.pod:6122
14816 " guestfs_swapoff_file (guestfs_h *g,\n"
14817 " const char *file);\n"
14822 #: ../src/guestfs-actions.pod:6126 ../fish/guestfish-actions.pod:4101
14823 msgid "This command disables the libguestfs appliance swap on file."
14827 #: ../src/guestfs-actions.pod:6132
14828 msgid "guestfs_swapoff_label"
14832 #: ../src/guestfs-actions.pod:6134
14836 " guestfs_swapoff_label (guestfs_h *g,\n"
14837 " const char *label);\n"
14842 #: ../src/guestfs-actions.pod:6138 ../fish/guestfish-actions.pod:4107
14844 "This command disables the libguestfs appliance swap on labeled swap "
14849 #: ../src/guestfs-actions.pod:6145
14850 msgid "guestfs_swapoff_uuid"
14854 #: ../src/guestfs-actions.pod:6147
14858 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14859 " const char *uuid);\n"
14864 #: ../src/guestfs-actions.pod:6151 ../fish/guestfish-actions.pod:4114
14866 "This command disables the libguestfs appliance swap partition with the given "
14871 #: ../src/guestfs-actions.pod:6158
14872 msgid "guestfs_swapon_device"
14876 #: ../src/guestfs-actions.pod:6160
14880 " guestfs_swapon_device (guestfs_h *g,\n"
14881 " const char *device);\n"
14886 #: ../src/guestfs-actions.pod:6164
14888 "This command enables the libguestfs appliance to use the swap device or "
14889 "partition named C<device>. The increased memory is made available for all "
14890 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14894 #: ../src/guestfs-actions.pod:6169 ../fish/guestfish-actions.pod:4126
14896 "Note that you should not swap to existing guest swap partitions unless you "
14897 "know what you are doing. They may contain hibernation information, or other "
14898 "information that the guest doesn't want you to trash. You also risk leaking "
14899 "information about the host to the guest this way. Instead, attach a new "
14900 "host device to the guest and swap on that."
14904 #: ../src/guestfs-actions.pod:6180
14905 msgid "guestfs_swapon_file"
14909 #: ../src/guestfs-actions.pod:6182
14913 " guestfs_swapon_file (guestfs_h *g,\n"
14914 " const char *file);\n"
14919 #: ../src/guestfs-actions.pod:6186
14921 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14926 #: ../src/guestfs-actions.pod:6193
14927 msgid "guestfs_swapon_label"
14931 #: ../src/guestfs-actions.pod:6195
14935 " guestfs_swapon_label (guestfs_h *g,\n"
14936 " const char *label);\n"
14941 #: ../src/guestfs-actions.pod:6199
14943 "This command enables swap to a labeled swap partition. See "
14944 "C<guestfs_swapon_device> for other notes."
14948 #: ../src/guestfs-actions.pod:6206
14949 msgid "guestfs_swapon_uuid"
14953 #: ../src/guestfs-actions.pod:6208
14957 " guestfs_swapon_uuid (guestfs_h *g,\n"
14958 " const char *uuid);\n"
14963 #: ../src/guestfs-actions.pod:6212
14965 "This command enables swap to a swap partition with the given UUID. See "
14966 "C<guestfs_swapon_device> for other notes."
14970 #: ../src/guestfs-actions.pod:6219
14971 msgid "guestfs_sync"
14975 #: ../src/guestfs-actions.pod:6221
14979 " guestfs_sync (guestfs_h *g);\n"
14984 #: ../src/guestfs-actions.pod:6224 ../fish/guestfish-actions.pod:4158
14986 "This syncs the disk, so that any writes are flushed through to the "
14987 "underlying disk image."
14991 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4161
14993 "You should always call this if you have modified a disk image, before "
14994 "closing the handle."
14998 #: ../src/guestfs-actions.pod:6234
14999 msgid "guestfs_tail"
15003 #: ../src/guestfs-actions.pod:6236
15007 " guestfs_tail (guestfs_h *g,\n"
15008 " const char *path);\n"
15013 #: ../src/guestfs-actions.pod:6240 ../fish/guestfish-actions.pod:4168
15015 "This command returns up to the last 10 lines of a file as a list of strings."
15019 #: ../src/guestfs-actions.pod:6252
15020 msgid "guestfs_tail_n"
15024 #: ../src/guestfs-actions.pod:6254
15028 " guestfs_tail_n (guestfs_h *g,\n"
15030 " const char *path);\n"
15035 #: ../src/guestfs-actions.pod:6259 ../fish/guestfish-actions.pod:4178
15037 "If the parameter C<nrlines> is a positive number, this returns the last "
15038 "C<nrlines> lines of the file C<path>."
15042 #: ../src/guestfs-actions.pod:6262 ../fish/guestfish-actions.pod:4181
15044 "If the parameter C<nrlines> is a negative number, this returns lines from "
15045 "the file C<path>, starting with the C<-nrlines>th line."
15049 #: ../src/guestfs-actions.pod:6276
15050 msgid "guestfs_tar_in"
15054 #: ../src/guestfs-actions.pod:6278
15058 " guestfs_tar_in (guestfs_h *g,\n"
15059 " const char *tarfile,\n"
15060 " const char *directory);\n"
15065 #: ../src/guestfs-actions.pod:6283 ../fish/guestfish-actions.pod:4193
15067 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15068 "tar file) into C<directory>."
15072 #: ../src/guestfs-actions.pod:6286
15074 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
15078 #: ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6308
15079 #: ../src/guestfs-actions.pod:6324 ../src/guestfs-actions.pod:6340
15080 msgid "(Added in 1.0.3)"
15084 #: ../src/guestfs-actions.pod:6293
15085 msgid "guestfs_tar_out"
15089 #: ../src/guestfs-actions.pod:6295
15093 " guestfs_tar_out (guestfs_h *g,\n"
15094 " const char *directory,\n"
15095 " const char *tarfile);\n"
15100 #: ../src/guestfs-actions.pod:6300 ../fish/guestfish-actions.pod:4205
15102 "This command packs the contents of C<directory> and downloads it to local "
15107 #: ../src/guestfs-actions.pod:6303
15109 "To download a compressed tarball, use C<guestfs_tgz_out> or "
15110 "C<guestfs_txz_out>."
15114 #: ../src/guestfs-actions.pod:6310
15115 msgid "guestfs_tgz_in"
15119 #: ../src/guestfs-actions.pod:6312
15123 " guestfs_tgz_in (guestfs_h *g,\n"
15124 " const char *tarball,\n"
15125 " const char *directory);\n"
15130 #: ../src/guestfs-actions.pod:6317 ../fish/guestfish-actions.pod:4217
15132 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15133 "tar file) into C<directory>."
15137 #: ../src/guestfs-actions.pod:6320
15138 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
15142 #: ../src/guestfs-actions.pod:6326
15143 msgid "guestfs_tgz_out"
15147 #: ../src/guestfs-actions.pod:6328
15151 " guestfs_tgz_out (guestfs_h *g,\n"
15152 " const char *directory,\n"
15153 " const char *tarball);\n"
15158 #: ../src/guestfs-actions.pod:6333 ../fish/guestfish-actions.pod:4228
15160 "This command packs the contents of C<directory> and downloads it to local "
15165 #: ../src/guestfs-actions.pod:6336
15166 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
15170 #: ../src/guestfs-actions.pod:6342
15171 msgid "guestfs_touch"
15175 #: ../src/guestfs-actions.pod:6344
15179 " guestfs_touch (guestfs_h *g,\n"
15180 " const char *path);\n"
15185 #: ../src/guestfs-actions.pod:6348 ../fish/guestfish-actions.pod:4239
15187 "Touch acts like the L<touch(1)> command. It can be used to update the "
15188 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15193 #: ../src/guestfs-actions.pod:6352 ../fish/guestfish-actions.pod:4243
15195 "This command only works on regular files, and will fail on other file types "
15196 "such as directories, symbolic links, block special etc."
15200 #: ../src/guestfs-actions.pod:6359
15201 msgid "guestfs_truncate"
15205 #: ../src/guestfs-actions.pod:6361
15209 " guestfs_truncate (guestfs_h *g,\n"
15210 " const char *path);\n"
15215 #: ../src/guestfs-actions.pod:6365 ../fish/guestfish-actions.pod:4250
15217 "This command truncates C<path> to a zero-length file. The file must exist "
15222 #: ../src/guestfs-actions.pod:6372
15223 msgid "guestfs_truncate_size"
15227 #: ../src/guestfs-actions.pod:6374
15231 " guestfs_truncate_size (guestfs_h *g,\n"
15232 " const char *path,\n"
15233 " int64_t size);\n"
15238 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4257
15240 "This command truncates C<path> to size C<size> bytes. The file must exist "
15245 #: ../src/guestfs-actions.pod:6382
15247 "If the current file size is less than C<size> then the file is extended to "
15248 "the required size with zero bytes. This creates a sparse file (ie. disk "
15249 "blocks are not allocated for the file until you write to it). To create a "
15250 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
15254 #: ../src/guestfs-actions.pod:6392
15255 msgid "guestfs_tune2fs_l"
15259 #: ../src/guestfs-actions.pod:6394
15263 " guestfs_tune2fs_l (guestfs_h *g,\n"
15264 " const char *device);\n"
15269 #: ../src/guestfs-actions.pod:6398 ../fish/guestfish-actions.pod:4270
15271 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15276 #: ../src/guestfs-actions.pod:6401 ../fish/guestfish-actions.pod:4273
15278 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15279 "for more details. The list of fields returned isn't clearly defined, and "
15280 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15281 "and the filesystem itself."
15285 #: ../src/guestfs-actions.pod:6414
15286 msgid "guestfs_txz_in"
15290 #: ../src/guestfs-actions.pod:6416
15294 " guestfs_txz_in (guestfs_h *g,\n"
15295 " const char *tarball,\n"
15296 " const char *directory);\n"
15301 #: ../src/guestfs-actions.pod:6421 ../fish/guestfish-actions.pod:4282
15303 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15304 "tar file) into C<directory>."
15308 #: ../src/guestfs-actions.pod:6428
15309 msgid "guestfs_txz_out"
15313 #: ../src/guestfs-actions.pod:6430
15317 " guestfs_txz_out (guestfs_h *g,\n"
15318 " const char *directory,\n"
15319 " const char *tarball);\n"
15324 #: ../src/guestfs-actions.pod:6435 ../fish/guestfish-actions.pod:4291
15326 "This command packs the contents of C<directory> and downloads it to local "
15327 "file C<tarball> (as an xz compressed tar archive)."
15331 #: ../src/guestfs-actions.pod:6442
15332 msgid "guestfs_umask"
15336 #: ../src/guestfs-actions.pod:6444
15340 " guestfs_umask (guestfs_h *g,\n"
15346 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4300
15348 "This function sets the mask used for creating new files and device nodes to "
15353 #: ../src/guestfs-actions.pod:6451 ../fish/guestfish-actions.pod:4303
15355 "Typical umask values would be C<022> which creates new files with "
15356 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15357 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15361 #: ../src/guestfs-actions.pod:6456 ../fish/guestfish-actions.pod:4308
15363 "The default umask is C<022>. This is important because it means that "
15364 "directories and device nodes will be created with C<0644> or C<0755> mode "
15365 "even if you specify C<0777>."
15369 #: ../src/guestfs-actions.pod:6460
15371 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15372 "C<guestfs_mkdir>."
15376 #: ../src/guestfs-actions.pod:6463 ../fish/guestfish-actions.pod:4315
15377 msgid "This call returns the previous umask."
15381 #: ../src/guestfs-actions.pod:6469
15382 msgid "guestfs_umount"
15386 #: ../src/guestfs-actions.pod:6471
15390 " guestfs_umount (guestfs_h *g,\n"
15391 " const char *pathordevice);\n"
15396 #: ../src/guestfs-actions.pod:6475 ../fish/guestfish-actions.pod:4323
15398 "This unmounts the given filesystem. The filesystem may be specified either "
15399 "by its mountpoint (path) or the device which contains the filesystem."
15403 #: ../src/guestfs-actions.pod:6483
15404 msgid "guestfs_umount_all"
15408 #: ../src/guestfs-actions.pod:6485
15412 " guestfs_umount_all (guestfs_h *g);\n"
15417 #: ../src/guestfs-actions.pod:6488 ../fish/guestfish-actions.pod:4333
15418 msgid "This unmounts all mounted filesystems."
15422 #: ../src/guestfs-actions.pod:6490 ../fish/guestfish-actions.pod:4335
15423 msgid "Some internal mounts are not unmounted by this call."
15427 #: ../src/guestfs-actions.pod:6496
15428 msgid "guestfs_upload"
15432 #: ../src/guestfs-actions.pod:6498
15436 " guestfs_upload (guestfs_h *g,\n"
15437 " const char *filename,\n"
15438 " const char *remotefilename);\n"
15443 #: ../src/guestfs-actions.pod:6503 ../src/guestfs-actions.pod:6527
15444 #: ../fish/guestfish-actions.pod:4341 ../fish/guestfish-actions.pod:4354
15445 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15449 #: ../src/guestfs-actions.pod:6508
15450 msgid "See also C<guestfs_download>."
15454 #: ../src/guestfs-actions.pod:6519
15455 msgid "guestfs_upload_offset"
15459 #: ../src/guestfs-actions.pod:6521
15463 " guestfs_upload_offset (guestfs_h *g,\n"
15464 " const char *filename,\n"
15465 " const char *remotefilename,\n"
15466 " int64_t offset);\n"
15471 #: ../src/guestfs-actions.pod:6530 ../fish/guestfish-actions.pod:4357
15473 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15474 "The intention is to overwrite parts of existing files or devices, although "
15475 "if a non-existant file is specified then it is created with a \"hole\" "
15476 "before C<offset>. The size of the data written is implicit in the size of "
15477 "the source C<filename>."
15481 #: ../src/guestfs-actions.pod:6537
15483 "Note that there is no limit on the amount of data that can be uploaded with "
15484 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15485 "full amount unless an error occurs."
15489 #: ../src/guestfs-actions.pod:6542
15490 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15494 #: ../src/guestfs-actions.pod:6553
15495 msgid "guestfs_utimens"
15499 #: ../src/guestfs-actions.pod:6555
15503 " guestfs_utimens (guestfs_h *g,\n"
15504 " const char *path,\n"
15505 " int64_t atsecs,\n"
15506 " int64_t atnsecs,\n"
15507 " int64_t mtsecs,\n"
15508 " int64_t mtnsecs);\n"
15513 #: ../src/guestfs-actions.pod:6563 ../fish/guestfish-actions.pod:4377
15514 msgid "This command sets the timestamps of a file with nanosecond precision."
15518 #: ../src/guestfs-actions.pod:6566 ../fish/guestfish-actions.pod:4380
15520 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15525 #: ../src/guestfs-actions.pod:6569 ../fish/guestfish-actions.pod:4383
15527 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15528 "nanoseconds from the epoch."
15532 #: ../src/guestfs-actions.pod:6572 ../fish/guestfish-actions.pod:4386
15534 "If the C<*nsecs> field contains the special value C<-1> then the "
15535 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15536 "ignored in this case)."
15540 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4390
15542 "If the C<*nsecs> field contains the special value C<-2> then the "
15543 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15548 #: ../src/guestfs-actions.pod:6584 ../src/guestfs-structs.pod:175
15549 msgid "guestfs_version"
15553 #: ../src/guestfs-actions.pod:6586
15556 " struct guestfs_version *\n"
15557 " guestfs_version (guestfs_h *g);\n"
15562 #: ../src/guestfs-actions.pod:6589 ../fish/guestfish-actions.pod:4398
15564 "Return the libguestfs version number that the program is linked against."
15568 #: ../src/guestfs-actions.pod:6592 ../fish/guestfish-actions.pod:4401
15570 "Note that because of dynamic linking this is not necessarily the version of "
15571 "libguestfs that you compiled against. You can compile the program, and then "
15572 "at runtime dynamically link against a completely different C<libguestfs.so> "
15577 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4406
15579 "This call was added in version C<1.0.58>. In previous versions of "
15580 "libguestfs there was no way to get the version number. From C code you can "
15581 "use dynamic linker functions to find out if this symbol exists (if it "
15582 "doesn't, then it's an earlier version)."
15586 #: ../src/guestfs-actions.pod:6603 ../fish/guestfish-actions.pod:4412
15588 "The call returns a structure with four elements. The first three (C<major>, "
15589 "C<minor> and C<release>) are numbers and correspond to the usual version "
15590 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15591 "but may be used for distro-specific information."
15595 #: ../src/guestfs-actions.pod:6609 ../fish/guestfish-actions.pod:4418
15597 "To construct the original version string: C<$major.$minor.$release$extra>"
15601 #: ../src/guestfs-actions.pod:6612 ../fish/guestfish-actions.pod:4421
15602 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15606 #: ../src/guestfs-actions.pod:6614
15608 "I<Note:> Don't use this call to test for availability of features. In "
15609 "enterprise distributions we backport features from later versions into "
15610 "earlier versions, making this an unreliable way to test for features. Use "
15611 "C<guestfs_available> instead."
15615 #: ../src/guestfs-actions.pod:6620
15617 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15618 "error. I<The caller must call C<guestfs_free_version> after use>."
15622 #: ../src/guestfs-actions.pod:6624
15623 msgid "(Added in 1.0.58)"
15627 #: ../src/guestfs-actions.pod:6626
15628 msgid "guestfs_vfs_label"
15632 #: ../src/guestfs-actions.pod:6628
15636 " guestfs_vfs_label (guestfs_h *g,\n"
15637 " const char *device);\n"
15642 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4433
15643 msgid "This returns the filesystem label of the filesystem on C<device>."
15647 #: ../src/guestfs-actions.pod:6635 ../fish/guestfish-actions.pod:4436
15648 msgid "If the filesystem is unlabeled, this returns the empty string."
15652 #: ../src/guestfs-actions.pod:6637
15653 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15657 #: ../src/guestfs-actions.pod:6642 ../src/guestfs-actions.pod:6679
15658 msgid "(Added in 1.3.18)"
15662 #: ../src/guestfs-actions.pod:6644
15663 msgid "guestfs_vfs_type"
15667 #: ../src/guestfs-actions.pod:6646
15671 " guestfs_vfs_type (guestfs_h *g,\n"
15672 " const char *device);\n"
15677 #: ../src/guestfs-actions.pod:6650 ../fish/guestfish-actions.pod:4444
15679 "This command gets the filesystem type corresponding to the filesystem on "
15684 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4447
15686 "For most filesystems, the result is the name of the Linux VFS module which "
15687 "would be used to mount this filesystem if you mounted it without specifying "
15688 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15692 #: ../src/guestfs-actions.pod:6663
15693 msgid "guestfs_vfs_uuid"
15697 #: ../src/guestfs-actions.pod:6665
15701 " guestfs_vfs_uuid (guestfs_h *g,\n"
15702 " const char *device);\n"
15707 #: ../src/guestfs-actions.pod:6669 ../fish/guestfish-actions.pod:4456
15708 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15712 #: ../src/guestfs-actions.pod:6672 ../fish/guestfish-actions.pod:4459
15713 msgid "If the filesystem does not have a UUID, this returns the empty string."
15717 #: ../src/guestfs-actions.pod:6674
15718 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15722 #: ../src/guestfs-actions.pod:6681
15723 msgid "guestfs_vg_activate"
15727 #: ../src/guestfs-actions.pod:6683
15731 " guestfs_vg_activate (guestfs_h *g,\n"
15733 " char *const *volgroups);\n"
15738 #: ../src/guestfs-actions.pod:6688 ../fish/guestfish-actions.pod:4467
15740 "This command activates or (if C<activate> is false) deactivates all logical "
15741 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15742 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15743 "deactivated, then those devices disappear."
15747 #: ../src/guestfs-actions.pod:6694 ../fish/guestfish-actions.pod:4473
15748 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15752 #: ../src/guestfs-actions.pod:6696 ../fish/guestfish-actions.pod:4475
15754 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15755 "activated or deactivated."
15759 #: ../src/guestfs-actions.pod:6703
15760 msgid "guestfs_vg_activate_all"
15764 #: ../src/guestfs-actions.pod:6705
15768 " guestfs_vg_activate_all (guestfs_h *g,\n"
15769 " int activate);\n"
15774 #: ../src/guestfs-actions.pod:6709 ../fish/guestfish-actions.pod:4482
15776 "This command activates or (if C<activate> is false) deactivates all logical "
15777 "volumes in all volume groups. If activated, then they are made known to the "
15778 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15779 "those devices disappear."
15783 #: ../src/guestfs-actions.pod:6715 ../fish/guestfish-actions.pod:4488
15784 msgid "This command is the same as running C<vgchange -a y|n>"
15788 #: ../src/guestfs-actions.pod:6721
15789 msgid "guestfs_vgcreate"
15793 #: ../src/guestfs-actions.pod:6723
15797 " guestfs_vgcreate (guestfs_h *g,\n"
15798 " const char *volgroup,\n"
15799 " char *const *physvols);\n"
15804 #: ../src/guestfs-actions.pod:6728 ../fish/guestfish-actions.pod:4494
15806 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15807 "of physical volumes C<physvols>."
15811 #: ../src/guestfs-actions.pod:6735
15812 msgid "guestfs_vglvuuids"
15816 #: ../src/guestfs-actions.pod:6737
15820 " guestfs_vglvuuids (guestfs_h *g,\n"
15821 " const char *vgname);\n"
15826 #: ../src/guestfs-actions.pod:6741 ../fish/guestfish-actions.pod:4501
15828 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15829 "volumes created in this volume group."
15833 #: ../src/guestfs-actions.pod:6744
15835 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15836 "associate logical volumes and volume groups."
15840 #: ../src/guestfs-actions.pod:6747
15841 msgid "See also C<guestfs_vgpvuuids>."
15845 #: ../src/guestfs-actions.pod:6755
15846 msgid "guestfs_vgpvuuids"
15850 #: ../src/guestfs-actions.pod:6757
15854 " guestfs_vgpvuuids (guestfs_h *g,\n"
15855 " const char *vgname);\n"
15860 #: ../src/guestfs-actions.pod:6761 ../fish/guestfish-actions.pod:4513
15862 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15863 "volumes that this volume group resides on."
15867 #: ../src/guestfs-actions.pod:6764
15869 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15870 "associate physical volumes and volume groups."
15874 #: ../src/guestfs-actions.pod:6767
15875 msgid "See also C<guestfs_vglvuuids>."
15879 #: ../src/guestfs-actions.pod:6775
15880 msgid "guestfs_vgremove"
15884 #: ../src/guestfs-actions.pod:6777
15888 " guestfs_vgremove (guestfs_h *g,\n"
15889 " const char *vgname);\n"
15894 #: ../src/guestfs-actions.pod:6781 ../fish/guestfish-actions.pod:4525
15895 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15899 #: ../src/guestfs-actions.pod:6783 ../fish/guestfish-actions.pod:4527
15901 "This also forcibly removes all logical volumes in the volume group (if any)."
15905 #: ../src/guestfs-actions.pod:6790
15906 msgid "guestfs_vgrename"
15910 #: ../src/guestfs-actions.pod:6792
15914 " guestfs_vgrename (guestfs_h *g,\n"
15915 " const char *volgroup,\n"
15916 " const char *newvolgroup);\n"
15921 #: ../src/guestfs-actions.pod:6797 ../fish/guestfish-actions.pod:4534
15922 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15926 #: ../src/guestfs-actions.pod:6803
15927 msgid "guestfs_vgs"
15931 #: ../src/guestfs-actions.pod:6805
15935 " guestfs_vgs (guestfs_h *g);\n"
15940 #: ../src/guestfs-actions.pod:6808 ../fish/guestfish-actions.pod:4540
15942 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15947 #: ../src/guestfs-actions.pod:6811 ../fish/guestfish-actions.pod:4543
15949 "This returns a list of just the volume group names that were detected (eg. "
15954 #: ../src/guestfs-actions.pod:6814
15955 msgid "See also C<guestfs_vgs_full>."
15959 #: ../src/guestfs-actions.pod:6822
15960 msgid "guestfs_vgs_full"
15964 #: ../src/guestfs-actions.pod:6824
15967 " struct guestfs_lvm_vg_list *\n"
15968 " guestfs_vgs_full (guestfs_h *g);\n"
15973 #: ../src/guestfs-actions.pod:6827 ../fish/guestfish-actions.pod:4552
15975 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15976 "> command. The \"full\" version includes all fields."
15980 #: ../src/guestfs-actions.pod:6830
15982 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15983 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15987 #: ../src/guestfs-actions.pod:6836
15988 msgid "guestfs_vgscan"
15992 #: ../src/guestfs-actions.pod:6838
15996 " guestfs_vgscan (guestfs_h *g);\n"
16001 #: ../src/guestfs-actions.pod:6841 ../fish/guestfish-actions.pod:4559
16003 "This rescans all block devices and rebuilds the list of LVM physical "
16004 "volumes, volume groups and logical volumes."
16008 #: ../src/guestfs-actions.pod:6848
16009 msgid "guestfs_vguuid"
16013 #: ../src/guestfs-actions.pod:6850
16017 " guestfs_vguuid (guestfs_h *g,\n"
16018 " const char *vgname);\n"
16023 #: ../src/guestfs-actions.pod:6854 ../fish/guestfish-actions.pod:4566
16024 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16028 #: ../src/guestfs-actions.pod:6861
16029 msgid "guestfs_wait_ready"
16033 #: ../src/guestfs-actions.pod:6863
16037 " guestfs_wait_ready (guestfs_h *g);\n"
16042 #: ../src/guestfs-actions.pod:6866
16043 msgid "This function is a no op."
16047 #: ../src/guestfs-actions.pod:6868
16049 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
16050 "calling C<guestfs_launch> to wait for the launch to complete. However this "
16051 "is no longer necessary because C<guestfs_launch> now does the waiting."
16055 #: ../src/guestfs-actions.pod:6873
16057 "If you see any calls to this function in code then you can just remove them, "
16058 "unless you want to retain compatibility with older versions of the API."
16062 #: ../src/guestfs-actions.pod:6881
16063 msgid "guestfs_wc_c"
16067 #: ../src/guestfs-actions.pod:6883
16071 " guestfs_wc_c (guestfs_h *g,\n"
16072 " const char *path);\n"
16077 #: ../src/guestfs-actions.pod:6887 ../fish/guestfish-actions.pod:4572
16079 "This command counts the characters in a file, using the C<wc -c> external "
16084 #: ../src/guestfs-actions.pod:6894
16085 msgid "guestfs_wc_l"
16089 #: ../src/guestfs-actions.pod:6896
16093 " guestfs_wc_l (guestfs_h *g,\n"
16094 " const char *path);\n"
16099 #: ../src/guestfs-actions.pod:6900 ../fish/guestfish-actions.pod:4579
16101 "This command counts the lines in a file, using the C<wc -l> external command."
16105 #: ../src/guestfs-actions.pod:6907
16106 msgid "guestfs_wc_w"
16110 #: ../src/guestfs-actions.pod:6909
16114 " guestfs_wc_w (guestfs_h *g,\n"
16115 " const char *path);\n"
16120 #: ../src/guestfs-actions.pod:6913 ../fish/guestfish-actions.pod:4586
16122 "This command counts the words in a file, using the C<wc -w> external command."
16126 #: ../src/guestfs-actions.pod:6920
16127 msgid "guestfs_write"
16131 #: ../src/guestfs-actions.pod:6922
16135 " guestfs_write (guestfs_h *g,\n"
16136 " const char *path,\n"
16137 " const char *content,\n"
16138 " size_t content_size);\n"
16143 #: ../src/guestfs-actions.pod:6928 ../fish/guestfish-actions.pod:4593
16145 "This call creates a file called C<path>. The content of the file is the "
16146 "string C<content> (which can contain any 8 bit data)."
16150 #: ../src/guestfs-actions.pod:6938
16151 msgid "guestfs_write_file"
16155 #: ../src/guestfs-actions.pod:6940
16159 " guestfs_write_file (guestfs_h *g,\n"
16160 " const char *path,\n"
16161 " const char *content,\n"
16167 #: ../src/guestfs-actions.pod:6946 ../fish/guestfish-actions.pod:4603
16169 "This call creates a file called C<path>. The contents of the file is the "
16170 "string C<content> (which can contain any 8 bit data), with length C<size>."
16174 #: ../src/guestfs-actions.pod:6950 ../fish/guestfish-actions.pod:4607
16176 "As a special case, if C<size> is C<0> then the length is calculated using "
16177 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16181 #: ../src/guestfs-actions.pod:6954 ../fish/guestfish-actions.pod:4611
16183 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16184 "I<not> work, even if the length is specified."
16188 #: ../src/guestfs-actions.pod:6962 ../fish/guestfish-actions.pod:4617
16190 "This function is deprecated. In new code, use the C<write> call instead."
16194 #: ../src/guestfs-actions.pod:6971
16195 msgid "guestfs_zegrep"
16199 #: ../src/guestfs-actions.pod:6973
16203 " guestfs_zegrep (guestfs_h *g,\n"
16204 " const char *regex,\n"
16205 " const char *path);\n"
16210 #: ../src/guestfs-actions.pod:6978 ../fish/guestfish-actions.pod:4628
16212 "This calls the external C<zegrep> program and returns the matching lines."
16216 #: ../src/guestfs-actions.pod:6990
16217 msgid "guestfs_zegrepi"
16221 #: ../src/guestfs-actions.pod:6992
16225 " guestfs_zegrepi (guestfs_h *g,\n"
16226 " const char *regex,\n"
16227 " const char *path);\n"
16232 #: ../src/guestfs-actions.pod:6997 ../fish/guestfish-actions.pod:4638
16234 "This calls the external C<zegrep -i> program and returns the matching lines."
16238 #: ../src/guestfs-actions.pod:7009
16239 msgid "guestfs_zero"
16243 #: ../src/guestfs-actions.pod:7011
16247 " guestfs_zero (guestfs_h *g,\n"
16248 " const char *device);\n"
16253 #: ../src/guestfs-actions.pod:7015 ../fish/guestfish-actions.pod:4648
16254 msgid "This command writes zeroes over the first few blocks of C<device>."
16258 #: ../src/guestfs-actions.pod:7017 ../fish/guestfish-actions.pod:4650
16260 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16261 "securely wipe the device). It should be sufficient to remove any partition "
16262 "tables, filesystem superblocks and so on."
16266 #: ../src/guestfs-actions.pod:7021
16267 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
16271 #: ../src/guestfs-actions.pod:7032
16272 msgid "guestfs_zero_device"
16276 #: ../src/guestfs-actions.pod:7034
16280 " guestfs_zero_device (guestfs_h *g,\n"
16281 " const char *device);\n"
16286 #: ../src/guestfs-actions.pod:7038
16288 "This command writes zeroes over the entire C<device>. Compare with "
16289 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16293 #: ../src/guestfs-actions.pod:7052
16294 msgid "(Added in 1.3.1)"
16298 #: ../src/guestfs-actions.pod:7054
16299 msgid "guestfs_zerofree"
16303 #: ../src/guestfs-actions.pod:7056
16307 " guestfs_zerofree (guestfs_h *g,\n"
16308 " const char *device);\n"
16313 #: ../src/guestfs-actions.pod:7060 ../fish/guestfish-actions.pod:4671
16315 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16316 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16317 "possible to compress the filesystem more effectively."
16321 #: ../src/guestfs-actions.pod:7065 ../fish/guestfish-actions.pod:4676
16322 msgid "You should B<not> run this program if the filesystem is mounted."
16326 #: ../src/guestfs-actions.pod:7068 ../fish/guestfish-actions.pod:4679
16328 "It is possible that using this program can damage the filesystem or data on "
16333 #: ../src/guestfs-actions.pod:7075
16334 msgid "guestfs_zfgrep"
16338 #: ../src/guestfs-actions.pod:7077
16342 " guestfs_zfgrep (guestfs_h *g,\n"
16343 " const char *pattern,\n"
16344 " const char *path);\n"
16349 #: ../src/guestfs-actions.pod:7082 ../fish/guestfish-actions.pod:4686
16351 "This calls the external C<zfgrep> program and returns the matching lines."
16355 #: ../src/guestfs-actions.pod:7094
16356 msgid "guestfs_zfgrepi"
16360 #: ../src/guestfs-actions.pod:7096
16364 " guestfs_zfgrepi (guestfs_h *g,\n"
16365 " const char *pattern,\n"
16366 " const char *path);\n"
16371 #: ../src/guestfs-actions.pod:7101 ../fish/guestfish-actions.pod:4696
16373 "This calls the external C<zfgrep -i> program and returns the matching lines."
16377 #: ../src/guestfs-actions.pod:7113
16378 msgid "guestfs_zfile"
16382 #: ../src/guestfs-actions.pod:7115
16386 " guestfs_zfile (guestfs_h *g,\n"
16387 " const char *meth,\n"
16388 " const char *path);\n"
16393 #: ../src/guestfs-actions.pod:7120 ../fish/guestfish-actions.pod:4706
16395 "This command runs C<file> after first decompressing C<path> using C<method>."
16399 #: ../src/guestfs-actions.pod:7123 ../fish/guestfish-actions.pod:4709
16400 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16404 #: ../src/guestfs-actions.pod:7125
16406 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16411 #: ../src/guestfs-actions.pod:7131 ../fish/guestfish-actions.pod:4714
16413 "This function is deprecated. In new code, use the C<file> call instead."
16417 #: ../src/guestfs-actions.pod:7140
16418 msgid "guestfs_zgrep"
16422 #: ../src/guestfs-actions.pod:7142
16426 " guestfs_zgrep (guestfs_h *g,\n"
16427 " const char *regex,\n"
16428 " const char *path);\n"
16433 #: ../src/guestfs-actions.pod:7147 ../fish/guestfish-actions.pod:4725
16435 "This calls the external C<zgrep> program and returns the matching lines."
16439 #: ../src/guestfs-actions.pod:7159
16440 msgid "guestfs_zgrepi"
16444 #: ../src/guestfs-actions.pod:7161
16448 " guestfs_zgrepi (guestfs_h *g,\n"
16449 " const char *regex,\n"
16450 " const char *path);\n"
16455 #: ../src/guestfs-actions.pod:7166 ../fish/guestfish-actions.pod:4735
16457 "This calls the external C<zgrep -i> program and returns the matching lines."
16461 #: ../src/guestfs-availability.pod:3
16466 #: ../src/guestfs-availability.pod:5
16468 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16469 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16470 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16471 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16472 "L</guestfs_aug_save> L</guestfs_aug_set>"
16476 #: ../src/guestfs-availability.pod:21
16481 #: ../src/guestfs-availability.pod:23
16483 "The following functions: L</guestfs_inotify_add_watch> L</"
16484 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16485 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16489 #: ../src/guestfs-availability.pod:31
16490 msgid "B<linuxfsuuid>"
16494 #: ../src/guestfs-availability.pod:33
16496 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16497 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16501 #: ../src/guestfs-availability.pod:40
16502 msgid "B<linuxmodules>"
16506 #: ../src/guestfs-availability.pod:42
16507 msgid "The following functions: L</guestfs_modprobe>"
16511 #: ../src/guestfs-availability.pod:45
16512 msgid "B<linuxxattrs>"
16516 #: ../src/guestfs-availability.pod:47
16518 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
16519 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
16520 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
16521 "guestfs_setxattr>"
16525 #: ../src/guestfs-availability.pod:58
16530 #: ../src/guestfs-availability.pod:60
16532 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16533 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16534 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16538 #: ../src/guestfs-availability.pod:69
16543 #: ../src/guestfs-availability.pod:71
16545 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16546 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16547 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16548 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16549 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16550 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16551 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16555 #: ../src/guestfs-availability.pod:94
16560 #: ../src/guestfs-availability.pod:96
16562 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16563 "guestfs_mknod_b> L</guestfs_mknod_c>"
16567 #: ../src/guestfs-availability.pod:102
16572 #: ../src/guestfs-availability.pod:104
16573 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16577 #: ../src/guestfs-availability.pod:107
16578 msgid "B<ntfsprogs>"
16582 #: ../src/guestfs-availability.pod:109
16584 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16588 #: ../src/guestfs-availability.pod:113
16589 msgid "B<realpath>"
16593 #: ../src/guestfs-availability.pod:115
16594 msgid "The following functions: L</guestfs_realpath>"
16598 #: ../src/guestfs-availability.pod:118
16603 #: ../src/guestfs-availability.pod:120
16605 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16606 "guestfs_scrub_freespace>"
16610 #: ../src/guestfs-availability.pod:125
16615 #: ../src/guestfs-availability.pod:127
16616 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16620 #: ../src/guestfs-availability.pod:131
16625 #: ../src/guestfs-availability.pod:133
16626 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16630 #: ../src/guestfs-availability.pod:137
16631 msgid "B<zerofree>"
16635 #: ../src/guestfs-availability.pod:139
16636 msgid "The following functions: L</guestfs_zerofree>"
16640 #: ../src/guestfs-structs.pod:1
16641 msgid "guestfs_int_bool"
16645 #: ../src/guestfs-structs.pod:3
16648 " struct guestfs_int_bool {\n"
16656 #: ../src/guestfs-structs.pod:8
16659 " struct guestfs_int_bool_list {\n"
16660 " uint32_t len; /* Number of elements in list. */\n"
16661 " struct guestfs_int_bool *val; /* Elements. */\n"
16667 #: ../src/guestfs-structs.pod:13
16670 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16671 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16676 #: ../src/guestfs-structs.pod:16
16677 msgid "guestfs_lvm_pv"
16681 #: ../src/guestfs-structs.pod:18
16684 " struct guestfs_lvm_pv {\n"
16685 " char *pv_name;\n"
16686 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16687 " char pv_uuid[32];\n"
16689 " uint64_t pv_size;\n"
16690 " uint64_t dev_size;\n"
16691 " uint64_t pv_free;\n"
16692 " uint64_t pv_used;\n"
16693 " char *pv_attr;\n"
16694 " int64_t pv_pe_count;\n"
16695 " int64_t pv_pe_alloc_count;\n"
16696 " char *pv_tags;\n"
16697 " uint64_t pe_start;\n"
16698 " int64_t pv_mda_count;\n"
16699 " uint64_t pv_mda_free;\n"
16705 #: ../src/guestfs-structs.pod:36
16708 " struct guestfs_lvm_pv_list {\n"
16709 " uint32_t len; /* Number of elements in list. */\n"
16710 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16716 #: ../src/guestfs-structs.pod:41
16719 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16720 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16725 #: ../src/guestfs-structs.pod:44
16726 msgid "guestfs_lvm_vg"
16730 #: ../src/guestfs-structs.pod:46
16733 " struct guestfs_lvm_vg {\n"
16734 " char *vg_name;\n"
16735 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16736 " char vg_uuid[32];\n"
16738 " char *vg_attr;\n"
16739 " uint64_t vg_size;\n"
16740 " uint64_t vg_free;\n"
16741 " char *vg_sysid;\n"
16742 " uint64_t vg_extent_size;\n"
16743 " int64_t vg_extent_count;\n"
16744 " int64_t vg_free_count;\n"
16745 " int64_t max_lv;\n"
16746 " int64_t max_pv;\n"
16747 " int64_t pv_count;\n"
16748 " int64_t lv_count;\n"
16749 " int64_t snap_count;\n"
16750 " int64_t vg_seqno;\n"
16751 " char *vg_tags;\n"
16752 " int64_t vg_mda_count;\n"
16753 " uint64_t vg_mda_free;\n"
16759 #: ../src/guestfs-structs.pod:69
16762 " struct guestfs_lvm_vg_list {\n"
16763 " uint32_t len; /* Number of elements in list. */\n"
16764 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16770 #: ../src/guestfs-structs.pod:74
16773 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16774 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16779 #: ../src/guestfs-structs.pod:77
16780 msgid "guestfs_lvm_lv"
16784 #: ../src/guestfs-structs.pod:79
16787 " struct guestfs_lvm_lv {\n"
16788 " char *lv_name;\n"
16789 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16790 " char lv_uuid[32];\n"
16791 " char *lv_attr;\n"
16792 " int64_t lv_major;\n"
16793 " int64_t lv_minor;\n"
16794 " int64_t lv_kernel_major;\n"
16795 " int64_t lv_kernel_minor;\n"
16796 " uint64_t lv_size;\n"
16797 " int64_t seg_count;\n"
16799 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16800 " float snap_percent;\n"
16801 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16802 " float copy_percent;\n"
16803 " char *move_pv;\n"
16804 " char *lv_tags;\n"
16805 " char *mirror_log;\n"
16806 " char *modules;\n"
16812 #: ../src/guestfs-structs.pod:101
16815 " struct guestfs_lvm_lv_list {\n"
16816 " uint32_t len; /* Number of elements in list. */\n"
16817 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16823 #: ../src/guestfs-structs.pod:106
16826 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16827 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16832 #: ../src/guestfs-structs.pod:111
16835 " struct guestfs_stat {\n"
16839 " int64_t nlink;\n"
16844 " int64_t blksize;\n"
16845 " int64_t blocks;\n"
16846 " int64_t atime;\n"
16847 " int64_t mtime;\n"
16848 " int64_t ctime;\n"
16854 #: ../src/guestfs-structs.pod:127
16857 " struct guestfs_stat_list {\n"
16858 " uint32_t len; /* Number of elements in list. */\n"
16859 " struct guestfs_stat *val; /* Elements. */\n"
16865 #: ../src/guestfs-structs.pod:132
16868 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16869 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16874 #: ../src/guestfs-structs.pod:137
16877 " struct guestfs_statvfs {\n"
16878 " int64_t bsize;\n"
16879 " int64_t frsize;\n"
16880 " int64_t blocks;\n"
16881 " int64_t bfree;\n"
16882 " int64_t bavail;\n"
16883 " int64_t files;\n"
16884 " int64_t ffree;\n"
16885 " int64_t favail;\n"
16888 " int64_t namemax;\n"
16894 #: ../src/guestfs-structs.pod:151
16897 " struct guestfs_statvfs_list {\n"
16898 " uint32_t len; /* Number of elements in list. */\n"
16899 " struct guestfs_statvfs *val; /* Elements. */\n"
16905 #: ../src/guestfs-structs.pod:156
16908 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16909 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16914 #: ../src/guestfs-structs.pod:159
16915 msgid "guestfs_dirent"
16919 #: ../src/guestfs-structs.pod:161
16922 " struct guestfs_dirent {\n"
16931 #: ../src/guestfs-structs.pod:167
16934 " struct guestfs_dirent_list {\n"
16935 " uint32_t len; /* Number of elements in list. */\n"
16936 " struct guestfs_dirent *val; /* Elements. */\n"
16942 #: ../src/guestfs-structs.pod:172
16945 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16946 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16951 #: ../src/guestfs-structs.pod:177
16954 " struct guestfs_version {\n"
16955 " int64_t major;\n"
16956 " int64_t minor;\n"
16957 " int64_t release;\n"
16964 #: ../src/guestfs-structs.pod:184
16967 " struct guestfs_version_list {\n"
16968 " uint32_t len; /* Number of elements in list. */\n"
16969 " struct guestfs_version *val; /* Elements. */\n"
16975 #: ../src/guestfs-structs.pod:189
16978 " void guestfs_free_version (struct guestfs_free_version *);\n"
16979 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16984 #: ../src/guestfs-structs.pod:192
16985 msgid "guestfs_xattr"
16989 #: ../src/guestfs-structs.pod:194
16992 " struct guestfs_xattr {\n"
16993 " char *attrname;\n"
16994 " /* The next two fields describe a byte array. */\n"
16995 " uint32_t attrval_len;\n"
16996 " char *attrval;\n"
17002 #: ../src/guestfs-structs.pod:201
17005 " struct guestfs_xattr_list {\n"
17006 " uint32_t len; /* Number of elements in list. */\n"
17007 " struct guestfs_xattr *val; /* Elements. */\n"
17013 #: ../src/guestfs-structs.pod:206
17016 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
17017 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
17022 #: ../src/guestfs-structs.pod:209
17023 msgid "guestfs_inotify_event"
17027 #: ../src/guestfs-structs.pod:211
17030 " struct guestfs_inotify_event {\n"
17031 " int64_t in_wd;\n"
17032 " uint32_t in_mask;\n"
17033 " uint32_t in_cookie;\n"
17034 " char *in_name;\n"
17040 #: ../src/guestfs-structs.pod:218
17043 " struct guestfs_inotify_event_list {\n"
17044 " uint32_t len; /* Number of elements in list. */\n"
17045 " struct guestfs_inotify_event *val; /* Elements. */\n"
17051 #: ../src/guestfs-structs.pod:223
17054 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
17055 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
17060 #: ../src/guestfs-structs.pod:226
17061 msgid "guestfs_partition"
17065 #: ../src/guestfs-structs.pod:228
17068 " struct guestfs_partition {\n"
17069 " int32_t part_num;\n"
17070 " uint64_t part_start;\n"
17071 " uint64_t part_end;\n"
17072 " uint64_t part_size;\n"
17078 #: ../src/guestfs-structs.pod:235
17081 " struct guestfs_partition_list {\n"
17082 " uint32_t len; /* Number of elements in list. */\n"
17083 " struct guestfs_partition *val; /* Elements. */\n"
17089 #: ../src/guestfs-structs.pod:240
17092 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
17093 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
17098 #: ../src/guestfs-structs.pod:243
17099 msgid "guestfs_application"
17103 #: ../src/guestfs-structs.pod:245
17106 " struct guestfs_application {\n"
17107 " char *app_name;\n"
17108 " char *app_display_name;\n"
17109 " int32_t app_epoch;\n"
17110 " char *app_version;\n"
17111 " char *app_release;\n"
17112 " char *app_install_path;\n"
17113 " char *app_trans_path;\n"
17114 " char *app_publisher;\n"
17115 " char *app_url;\n"
17116 " char *app_source_package;\n"
17117 " char *app_summary;\n"
17118 " char *app_description;\n"
17124 #: ../src/guestfs-structs.pod:260
17127 " struct guestfs_application_list {\n"
17128 " uint32_t len; /* Number of elements in list. */\n"
17129 " struct guestfs_application *val; /* Elements. */\n"
17135 #: ../src/guestfs-structs.pod:265
17138 " void guestfs_free_application (struct guestfs_free_application *);\n"
17139 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
17144 #: ../fish/guestfish.pod:5
17145 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17149 #: ../fish/guestfish.pod:9
17152 " guestfish [--options] [commands]\n"
17157 #: ../fish/guestfish.pod:11
17165 #: ../fish/guestfish.pod:13
17168 " guestfish [--ro|--rw] -a disk.img\n"
17173 #: ../fish/guestfish.pod:15
17176 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17181 #: ../fish/guestfish.pod:17
17184 " guestfish -d libvirt-domain\n"
17189 #: ../fish/guestfish.pod:19
17192 " guestfish [--ro|--rw] -a disk.img -i\n"
17197 #: ../fish/guestfish.pod:21
17200 " guestfish -d libvirt-domain -i\n"
17205 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
17206 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
17211 #: ../fish/guestfish.pod:25
17213 "Using guestfish in read/write mode on live virtual machines can be "
17214 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17215 "option to use guestfish safely if the disk image or virtual machine might be "
17220 #: ../fish/guestfish.pod:32
17222 "Guestfish is a shell and command-line tool for examining and modifying "
17223 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17224 "functionality of the guestfs API, see L<guestfs(3)>."
17228 #: ../fish/guestfish.pod:36
17230 "Guestfish gives you structured access to the libguestfs API, from shell "
17231 "scripts or the command line or interactively. If you want to rescue a "
17232 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17237 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:897
17238 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
17239 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:45
17244 #: ../fish/guestfish.pod:43
17245 msgid "As an interactive shell"
17249 #: ../fish/guestfish.pod:45
17257 #: ../fish/guestfish.pod:47
17260 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17261 " editing virtual machine filesystems.\n"
17266 #: ../fish/guestfish.pod:50
17269 " Type: 'help' for a list of commands\n"
17270 " 'man' to read the manual\n"
17271 " 'quit' to quit the shell\n"
17276 #: ../fish/guestfish.pod:54
17279 " ><fs> add-ro disk.img\n"
17281 " ><fs> list-filesystems\n"
17282 " /dev/sda1: ext4\n"
17283 " /dev/vg_guest/lv_root: ext4\n"
17284 " /dev/vg_guest/lv_swap: swap\n"
17285 " ><fs> mount /dev/vg_guest/lv_root /\n"
17286 " ><fs> cat /etc/fstab\n"
17288 " # Created by anaconda\n"
17295 #: ../fish/guestfish.pod:67
17296 msgid "From shell scripts"
17300 #: ../fish/guestfish.pod:69
17301 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17305 #: ../fish/guestfish.pod:71
17308 " guestfish <<_EOF_\n"
17311 " mount /dev/vg_guest/lv_root /\n"
17312 " write /etc/motd \"Welcome, new users\"\n"
17318 #: ../fish/guestfish.pod:78
17319 msgid "List the LVM logical volumes in a disk image:"
17323 #: ../fish/guestfish.pod:80
17326 " guestfish -a disk.img --ro <<_EOF_\n"
17334 #: ../fish/guestfish.pod:85
17335 msgid "List all the filesystems in a disk image:"
17339 #: ../fish/guestfish.pod:87
17342 " guestfish -a disk.img --ro <<_EOF_\n"
17344 " list-filesystems\n"
17350 #: ../fish/guestfish.pod:92
17351 msgid "On one command line"
17355 #: ../fish/guestfish.pod:94
17356 msgid "Update C</etc/resolv.conf> in a guest:"
17360 #: ../fish/guestfish.pod:96
17364 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17365 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17370 #: ../fish/guestfish.pod:100
17371 msgid "Edit C</boot/grub/grub.conf> interactively:"
17375 #: ../fish/guestfish.pod:102
17378 " guestfish --rw --add disk.img \\\n"
17379 " --mount /dev/vg_guest/lv_root \\\n"
17380 " --mount /dev/sda1:/boot \\\n"
17381 " edit /boot/grub/grub.conf\n"
17386 #: ../fish/guestfish.pod:107
17387 msgid "Mount disks automatically"
17391 #: ../fish/guestfish.pod:109
17393 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17397 #: ../fish/guestfish.pod:112
17400 " guestfish --ro -a disk.img -i cat /etc/group\n"
17405 #: ../fish/guestfish.pod:114
17408 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17413 #: ../fish/guestfish.pod:116
17414 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17418 #: ../fish/guestfish.pod:118
17421 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17426 #: ../fish/guestfish.pod:120
17427 msgid "As a script interpreter"
17431 #: ../fish/guestfish.pod:122
17432 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17436 #: ../fish/guestfish.pod:124
17439 " #!/usr/bin/guestfish -f\n"
17440 " sparse test1.img 100M\n"
17442 " part-disk /dev/sda mbr\n"
17443 " mkfs ext2 /dev/sda1\n"
17448 #: ../fish/guestfish.pod:130
17449 msgid "Start with a prepared disk"
17453 #: ../fish/guestfish.pod:132
17455 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17456 "single ext2-formatted partition:"
17460 #: ../fish/guestfish.pod:135
17463 " guestfish -N fs\n"
17468 #: ../fish/guestfish.pod:137
17469 msgid "To list what is available do:"
17473 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:888
17476 " guestfish -N help | less\n"
17481 #: ../fish/guestfish.pod:141
17482 msgid "Remote control"
17486 #: ../fish/guestfish.pod:143
17489 " eval \"`guestfish --listen`\"\n"
17490 " guestfish --remote add-ro disk.img\n"
17491 " guestfish --remote run\n"
17492 " guestfish --remote lvs\n"
17497 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17498 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
17499 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
17500 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:98
17501 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
17506 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17507 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
17508 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
17509 #: ../tools/virt-tar.pl:106 ../tools/virt-make-fs.pl:161
17510 #: ../tools/virt-list-partitions.pl:62
17515 #: ../fish/guestfish.pod:154
17516 msgid "Displays general help on options."
17520 #: ../fish/guestfish.pod:156
17525 #: ../fish/guestfish.pod:158
17526 msgid "B<--cmd-help>"
17530 #: ../fish/guestfish.pod:160
17531 msgid "Lists all available guestfish commands."
17535 #: ../fish/guestfish.pod:162
17540 #: ../fish/guestfish.pod:164
17541 msgid "B<--cmd-help cmd>"
17545 #: ../fish/guestfish.pod:166
17546 msgid "Displays detailed help on a single command C<cmd>."
17550 #: ../fish/guestfish.pod:168
17551 msgid "B<-a image>"
17555 #: ../fish/guestfish.pod:170
17556 msgid "B<--add image>"
17560 #: ../fish/guestfish.pod:172
17561 msgid "Add a block device or virtual machine image to the shell."
17565 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
17567 "The format of the disk image is auto-detected. To override this and force a "
17568 "particular format use the I<--format=..> option."
17572 #: ../fish/guestfish.pod:177
17574 "Using this flag is mostly equivalent to using the C<add> command, with "
17575 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17576 "the I<--format:...> flag was given."
17580 #: ../fish/guestfish.pod:181
17585 #: ../fish/guestfish.pod:183
17586 msgid "B<--connect URI>"
17590 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
17592 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17593 "URI to use. The default is to use the default libvirt connection."
17597 #: ../fish/guestfish.pod:189
17602 #: ../fish/guestfish.pod:191
17604 "If using the I<--listen> option and a csh-like shell, use this option. See "
17605 "section L</REMOTE CONTROL AND CSH> below."
17609 #: ../fish/guestfish.pod:194
17610 msgid "B<-d libvirt-domain>"
17614 #: ../fish/guestfish.pod:196
17615 msgid "B<--domain libvirt-domain>"
17619 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
17621 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17622 "used, then any libvirt domain can be used. However in write mode, only "
17623 "libvirt domains which are shut down can be named here."
17627 #: ../fish/guestfish.pod:202
17629 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17630 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17631 "if the I<--format:...> flag was given."
17635 #: ../fish/guestfish.pod:206
17640 #: ../fish/guestfish.pod:208
17641 msgid "B<--no-dest-paths>"
17645 #: ../fish/guestfish.pod:210
17647 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17648 "to hit the tab key to complete paths on the guest filesystem, but this "
17649 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17650 "allow this feature to be disabled."
17654 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
17655 msgid "B<--echo-keys>"
17659 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
17661 "When prompting for keys and passphrases, guestfish normally turns echoing "
17662 "off so you cannot see what you are typing. If you are not worried about "
17663 "Tempest attacks and there is no one else in the room you can specify this "
17664 "flag to see what you are typing."
17668 #: ../fish/guestfish.pod:222
17673 #: ../fish/guestfish.pod:224
17674 msgid "B<--file file>"
17678 #: ../fish/guestfish.pod:226
17679 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17683 #: ../fish/guestfish.pod:229
17686 " #!/usr/bin/guestfish -f\n"
17691 #: ../fish/guestfish.pod:231
17692 msgid "B<--format=raw|qcow2|..>"
17696 #: ../fish/guestfish.pod:233
17697 msgid "B<--format>"
17701 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
17703 "The default for the I<-a> option is to auto-detect the format of the disk "
17704 "image. Using this forces the disk format for I<-a> options which follow on "
17705 "the command line. Using I<--format> with no argument switches back to auto-"
17706 "detection for subsequent I<-a> options."
17710 #: ../fish/guestfish.pod:240 ../fish/guestfish.pod:594
17711 msgid "For example:"
17715 #: ../fish/guestfish.pod:242
17718 " guestfish --format=raw -a disk.img\n"
17723 #: ../fish/guestfish.pod:244
17724 msgid "forces raw format (no auto-detection) for C<disk.img>."
17728 #: ../fish/guestfish.pod:246
17731 " guestfish --format=raw -a disk.img --format -a another.img\n"
17736 #: ../fish/guestfish.pod:248
17738 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17739 "detection for C<another.img>."
17743 #: ../fish/guestfish.pod:251
17745 "If you have untrusted raw-format guest disk images, you should use this "
17746 "option to specify the disk format. This avoids a possible security problem "
17747 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17751 #: ../fish/guestfish.pod:256
17756 #: ../fish/guestfish.pod:258
17757 msgid "B<--inspector>"
17761 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
17763 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17764 "system and mount filesystems as they would be mounted on the real virtual "
17769 #: ../fish/guestfish.pod:264
17770 msgid "Typical usage is either:"
17774 #: ../fish/guestfish.pod:266
17777 " guestfish -d myguest -i\n"
17782 #: ../fish/guestfish.pod:268
17783 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17787 #: ../fish/guestfish.pod:270
17790 " guestfish --ro -d myguest -i\n"
17795 #: ../fish/guestfish.pod:272
17796 msgid "(for active domains, readonly), or specify the block device directly:"
17800 #: ../fish/guestfish.pod:274
17803 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17808 #: ../fish/guestfish.pod:276
17810 "Note that the command line syntax changed slightly over older versions of "
17811 "guestfish. You can still use the old syntax:"
17815 #: ../fish/guestfish.pod:279
17818 " guestfish [--ro] -i disk.img\n"
17823 #: ../fish/guestfish.pod:281
17826 " guestfish [--ro] -i libvirt-domain\n"
17831 #: ../fish/guestfish.pod:283
17833 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17834 "then using other commands to mount the filesystems that were found."
17838 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
17839 msgid "B<--keys-from-stdin>"
17843 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
17845 "Read key or passphrase parameters from stdin. The default is to try to read "
17846 "passphrases from the user by opening C</dev/tty>."
17850 #: ../fish/guestfish.pod:292
17851 msgid "B<--listen>"
17855 #: ../fish/guestfish.pod:294
17857 "Fork into the background and listen for remote commands. See section L</"
17858 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17862 #: ../fish/guestfish.pod:297
17863 msgid "B<-m dev[:mountpoint]>"
17867 #: ../fish/guestfish.pod:299
17868 msgid "B<--mount dev[:mountpoint]>"
17872 #: ../fish/guestfish.pod:301
17873 msgid "Mount the named partition or logical volume on the given mountpoint."
17877 #: ../fish/guestfish.pod:303
17878 msgid "If the mountpoint is omitted, it defaults to C</>."
17882 #: ../fish/guestfish.pod:305
17883 msgid "You have to mount something on C</> before most commands will work."
17887 #: ../fish/guestfish.pod:307
17889 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17894 #: ../fish/guestfish.pod:310
17896 "If you don't know what filesystems a disk image contains, you can either run "
17897 "guestfish without this option, then list the partitions, filesystems and LVs "
17898 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17899 "commands), or you can use the L<virt-filesystems(1)> program."
17903 #: ../fish/guestfish.pod:316
17905 "Using this flag is mostly equivalent to using the C<mount-options> command "
17906 "or the C<mount-ro> command if the I<--ro> flag was given."
17910 #: ../fish/guestfish.pod:319
17915 #: ../fish/guestfish.pod:321
17916 msgid "B<--no-sync>"
17920 #: ../fish/guestfish.pod:323
17922 "Disable autosync. This is enabled by default. See the discussion of "
17923 "autosync in the L<guestfs(3)> manpage."
17927 #: ../fish/guestfish.pod:326
17932 #: ../fish/guestfish.pod:328
17933 msgid "B<--new type>"
17937 #: ../fish/guestfish.pod:330
17942 #: ../fish/guestfish.pod:332
17944 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17945 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17946 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17951 #: ../fish/guestfish.pod:337
17952 msgid "B<--progress-bars>"
17956 #: ../fish/guestfish.pod:339
17957 msgid "Enable progress bars, even when guestfish is used non-interactively."
17961 #: ../fish/guestfish.pod:341
17963 "Progress bars are enabled by default when guestfish is used as an "
17964 "interactive shell."
17968 #: ../fish/guestfish.pod:344
17969 msgid "B<--no-progress-bars>"
17973 #: ../fish/guestfish.pod:346
17974 msgid "Disable progress bars."
17978 #: ../fish/guestfish.pod:348
17979 msgid "B<--remote[=pid]>"
17983 #: ../fish/guestfish.pod:350
17985 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17986 "CONTROL GUESTFISH OVER A SOCKET> below."
17990 #: ../fish/guestfish.pod:353
17995 #: ../fish/guestfish.pod:355
18000 #: ../fish/guestfish.pod:357
18002 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18003 "mounts are done read-only."
18007 #: ../fish/guestfish.pod:360
18009 "The option must always be used if the disk image or virtual machine might be "
18010 "running, and is generally recommended in cases where you don't need write "
18011 "access to the disk."
18015 #: ../fish/guestfish.pod:364
18017 "Note that prepared disk images created with I<-N> are not affected by this "
18018 "option. Also commands like C<add> are not affected - you have to specify "
18019 "the C<readonly:true> option explicitly if you need it."
18023 #: ../fish/guestfish.pod:368
18024 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18028 #: ../fish/guestfish.pod:370 ../fuse/guestmount.pod:208
18029 msgid "B<--selinux>"
18033 #: ../fish/guestfish.pod:372
18034 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18038 #: ../fish/guestfish.pod:374
18043 #: ../fish/guestfish.pod:376
18044 msgid "B<--verbose>"
18048 #: ../fish/guestfish.pod:378
18050 "Enable very verbose messages. This is particularly useful if you find a bug."
18054 #: ../fish/guestfish.pod:381
18059 #: ../fish/guestfish.pod:383 ../tools/virt-edit.pl:88
18060 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
18061 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:114
18062 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
18063 msgid "B<--version>"
18067 #: ../fish/guestfish.pod:385
18068 msgid "Display the guestfish / libguestfs version number and exit."
18072 #: ../fish/guestfish.pod:387
18077 #: ../fish/guestfish.pod:389
18082 #: ../fish/guestfish.pod:391
18084 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
18089 #: ../fish/guestfish.pod:394
18094 #: ../fish/guestfish.pod:396
18095 msgid "Echo each command before executing it."
18099 #: ../fish/guestfish.pod:400
18100 msgid "COMMANDS ON COMMAND LINE"
18104 #: ../fish/guestfish.pod:402
18106 "Any additional (non-option) arguments are treated as commands to execute."
18110 #: ../fish/guestfish.pod:405
18112 "Commands to execute should be separated by a colon (C<:>), where the colon "
18113 "is a separate parameter. Thus:"
18117 #: ../fish/guestfish.pod:408
18120 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18125 #: ../fish/guestfish.pod:410
18127 "If there are no additional arguments, then we enter a shell, either an "
18128 "interactive shell with a prompt (if the input is a terminal) or a non-"
18129 "interactive shell."
18133 #: ../fish/guestfish.pod:414
18135 "In either command line mode or non-interactive shell, the first command that "
18136 "gives an error causes the whole shell to exit. In interactive mode (with a "
18137 "prompt) if a command fails, you can continue to enter commands."
18141 #: ../fish/guestfish.pod:419
18142 msgid "USING launch (OR run)"
18146 #: ../fish/guestfish.pod:421
18148 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18149 "then launch it, then mount any disks you need, and finally issue actions/"
18150 "commands. So the general order of the day is:"
18154 #: ../fish/guestfish.pod:429
18155 msgid "add or -a/--add"
18159 #: ../fish/guestfish.pod:433
18160 msgid "launch (aka run)"
18164 #: ../fish/guestfish.pod:437
18165 msgid "mount or -m/--mount"
18169 #: ../fish/guestfish.pod:441
18170 msgid "any other commands"
18174 #: ../fish/guestfish.pod:445
18176 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18177 "guest before mounting or performing any other commands."
18181 #: ../fish/guestfish.pod:448
18183 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18184 "I<--new> options were given then C<run> is done automatically, simply "
18185 "because guestfish can't perform the action you asked for without doing this."
18189 #: ../fish/guestfish.pod:453
18190 msgid "OPENING DISKS FOR READ AND WRITE"
18194 #: ../fish/guestfish.pod:455
18196 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
18197 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
18198 "open disk images read-only or for writing."
18202 #: ../fish/guestfish.pod:459
18204 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
18205 "disk images supplied on the command line for write. To open a disk image "
18206 "read-only you have to do I<-a image --ro>."
18210 #: ../fish/guestfish.pod:463
18212 "This matters: If you accidentally open a live VM disk image writable then "
18213 "you will cause irreversible disk corruption."
18217 #: ../fish/guestfish.pod:466
18219 "By libguestfs 1.8 we intend to change the default the other way. Disk "
18220 "images will be opened read-only. You will have to either specify "
18221 "I<guestfish --rw> or change a configuration file in order to get write "
18222 "access for disk images specified by those other command line options."
18226 #: ../fish/guestfish.pod:471
18228 "This version of guestfish has a I<--rw> option which does nothing (it is "
18229 "already the default). However it is highly recommended that you use this "
18230 "option to indicate that guestfish needs write access, and to prepare your "
18231 "scripts for the day when this option will be required for write access."
18235 #: ../fish/guestfish.pod:477
18237 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18238 "other libguestfs program apart from guestfish and guestmount."
18242 #: ../fish/guestfish.pod:480
18247 #: ../fish/guestfish.pod:482
18249 "You can quote ordinary parameters using either single or double quotes. For "
18254 #: ../fish/guestfish.pod:485
18257 " add \"file with a space.img\"\n"
18262 #: ../fish/guestfish.pod:487
18265 " rm '/file name'\n"
18270 #: ../fish/guestfish.pod:489
18278 #: ../fish/guestfish.pod:491
18280 "A few commands require a list of strings to be passed. For these, use a "
18281 "whitespace-separated list, enclosed in quotes. Strings containing "
18282 "whitespace to be passed through must be enclosed in single quotes. A "
18283 "literal single quote must be escaped with a backslash."
18287 #: ../fish/guestfish.pod:496
18290 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18291 " command \"/bin/echo 'foo bar'\"\n"
18292 " command \"/bin/echo \\'foo\\'\"\n"
18297 #: ../fish/guestfish.pod:500
18298 msgid "OPTIONAL ARGUMENTS"
18302 #: ../fish/guestfish.pod:502
18304 "Some commands take optional arguments. These arguments appear in this "
18305 "documentation as C<[argname:..]>. You can use them as in these examples:"
18309 #: ../fish/guestfish.pod:506
18312 " add-drive-opts filename\n"
18317 #: ../fish/guestfish.pod:508
18320 " add-drive-opts filename readonly:true\n"
18325 #: ../fish/guestfish.pod:510
18328 " add-drive-opts filename format:qcow2 readonly:false\n"
18333 #: ../fish/guestfish.pod:512
18335 "Each optional argument can appear at most once. All optional arguments must "
18336 "appear after the required ones."
18340 #: ../fish/guestfish.pod:515
18345 #: ../fish/guestfish.pod:517
18347 "This section applies to all commands which can take integers as parameters."
18351 #: ../fish/guestfish.pod:520
18352 msgid "SIZE SUFFIX"
18356 #: ../fish/guestfish.pod:522
18358 "When the command takes a parameter measured in bytes, you can use one of the "
18359 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18363 #: ../fish/guestfish.pod:528
18364 msgid "B<k> or B<K> or B<KiB>"
18368 #: ../fish/guestfish.pod:530
18369 msgid "The size in kilobytes (multiplied by 1024)."
18373 #: ../fish/guestfish.pod:532
18378 #: ../fish/guestfish.pod:534
18379 msgid "The size in SI 1000 byte units."
18383 #: ../fish/guestfish.pod:536
18384 msgid "B<M> or B<MiB>"
18388 #: ../fish/guestfish.pod:538
18389 msgid "The size in megabytes (multiplied by 1048576)."
18393 #: ../fish/guestfish.pod:540
18398 #: ../fish/guestfish.pod:542
18399 msgid "The size in SI 1000000 byte units."
18403 #: ../fish/guestfish.pod:544
18404 msgid "B<G> or B<GiB>"
18408 #: ../fish/guestfish.pod:546
18409 msgid "The size in gigabytes (multiplied by 2**30)."
18413 #: ../fish/guestfish.pod:548
18418 #: ../fish/guestfish.pod:550
18419 msgid "The size in SI 10**9 byte units."
18423 #: ../fish/guestfish.pod:552
18424 msgid "B<T> or B<TiB>"
18428 #: ../fish/guestfish.pod:554
18429 msgid "The size in terabytes (multiplied by 2**40)."
18433 #: ../fish/guestfish.pod:556
18438 #: ../fish/guestfish.pod:558
18439 msgid "The size in SI 10**12 byte units."
18443 #: ../fish/guestfish.pod:560
18444 msgid "B<P> or B<PiB>"
18448 #: ../fish/guestfish.pod:562
18449 msgid "The size in petabytes (multiplied by 2**50)."
18453 #: ../fish/guestfish.pod:564
18458 #: ../fish/guestfish.pod:566
18459 msgid "The size in SI 10**15 byte units."
18463 #: ../fish/guestfish.pod:568
18464 msgid "B<E> or B<EiB>"
18468 #: ../fish/guestfish.pod:570
18469 msgid "The size in exabytes (multiplied by 2**60)."
18473 #: ../fish/guestfish.pod:572
18478 #: ../fish/guestfish.pod:574
18479 msgid "The size in SI 10**18 byte units."
18483 #: ../fish/guestfish.pod:576
18484 msgid "B<Z> or B<ZiB>"
18488 #: ../fish/guestfish.pod:578
18489 msgid "The size in zettabytes (multiplied by 2**70)."
18493 #: ../fish/guestfish.pod:580
18498 #: ../fish/guestfish.pod:582
18499 msgid "The size in SI 10**21 byte units."
18503 #: ../fish/guestfish.pod:584
18504 msgid "B<Y> or B<YiB>"
18508 #: ../fish/guestfish.pod:586
18509 msgid "The size in yottabytes (multiplied by 2**80)."
18513 #: ../fish/guestfish.pod:588
18518 #: ../fish/guestfish.pod:590
18519 msgid "The size in SI 10**24 byte units."
18523 #: ../fish/guestfish.pod:596
18526 " truncate-size /file 1G\n"
18531 #: ../fish/guestfish.pod:598
18532 msgid "would truncate the file to 1 gigabyte."
18536 #: ../fish/guestfish.pod:600
18538 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18539 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18540 "suffix will probably not do what you expect."
18544 #: ../fish/guestfish.pod:604
18545 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18549 #: ../fish/guestfish.pod:606
18551 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18552 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18556 #: ../fish/guestfish.pod:609
18559 " 1234 decimal number 1234\n"
18560 " 02322 octal number, equivalent to decimal 1234\n"
18561 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18566 #: ../fish/guestfish.pod:613
18568 "When using the C<chmod> command, you almost always want to specify an octal "
18569 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18570 "L<chmod(1)> program):"
18574 #: ../fish/guestfish.pod:617
18577 " chmod 0777 /public # OK\n"
18578 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18583 #: ../fish/guestfish.pod:620
18585 "Commands that return numbers usually print them in decimal, but some "
18586 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18587 "octal, preceeded by C<0>)."
18591 #: ../fish/guestfish.pod:624
18592 msgid "WILDCARDS AND GLOBBING"
18596 #: ../fish/guestfish.pod:626
18598 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18599 "(globbing) by default. So for example the following will not do what you "
18604 #: ../fish/guestfish.pod:630
18612 #: ../fish/guestfish.pod:632
18614 "Assuming you don't have a directory called literally C</home/*> then the "
18615 "above command will return an error."
18619 #: ../fish/guestfish.pod:635
18620 msgid "To perform wildcard expansion, use the C<glob> command."
18624 #: ../fish/guestfish.pod:637
18627 " glob rm-rf /home/*\n"
18632 #: ../fish/guestfish.pod:639
18634 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18635 "many times), equivalent to:"
18639 #: ../fish/guestfish.pod:642
18642 " rm-rf /home/jim\n"
18643 " rm-rf /home/joe\n"
18644 " rm-rf /home/mary\n"
18649 #: ../fish/guestfish.pod:646
18650 msgid "C<glob> only works on simple guest paths and not on device names."
18654 #: ../fish/guestfish.pod:648
18656 "If you have several parameters, each containing a wildcard, then glob will "
18657 "perform a Cartesian product."
18661 #: ../fish/guestfish.pod:651
18666 #: ../fish/guestfish.pod:653
18668 "Any line which starts with a I<#> character is treated as a comment and "
18669 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18670 "a command. For example:"
18674 #: ../fish/guestfish.pod:657
18677 " # this is a comment\n"
18678 " # this is a comment\n"
18679 " foo # NOT a comment\n"
18684 #: ../fish/guestfish.pod:661
18685 msgid "Blank lines are also ignored."
18689 #: ../fish/guestfish.pod:663
18690 msgid "RUNNING COMMANDS LOCALLY"
18694 #: ../fish/guestfish.pod:665
18696 "Any line which starts with a I<!> character is treated as a command sent to "
18697 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18701 #: ../fish/guestfish.pod:669
18705 " tgz-out /remote local/remote-data.tar.gz\n"
18710 #: ../fish/guestfish.pod:672
18712 "will create a directory C<local> on the host, and then export the contents "
18713 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18714 "(See C<tgz-out>)."
18718 #: ../fish/guestfish.pod:676
18720 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18721 "effect, due to the way that subprocesses work in Unix."
18725 #: ../fish/guestfish.pod:679
18730 #: ../fish/guestfish.pod:681
18732 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18733 "command (a guestfish command) to the second command (any host command). For "
18738 #: ../fish/guestfish.pod:685
18741 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18746 #: ../fish/guestfish.pod:687
18748 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18749 "program). The above command would list all accounts in the guest filesystem "
18750 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18754 #: ../fish/guestfish.pod:692
18757 " hexdump /bin/ls | head\n"
18758 " list-devices | tail -1\n"
18759 " tgz-out / - | tar ztf -\n"
18764 #: ../fish/guestfish.pod:696
18766 "The space before the pipe symbol is required, any space after the pipe "
18767 "symbol is optional. Everything after the pipe symbol is just passed "
18768 "straight to the host shell, so it can contain redirections, globs and "
18769 "anything else that makes sense on the host side."
18773 #: ../fish/guestfish.pod:701
18775 "To use a literal argument which begins with a pipe symbol, you have to quote "
18780 #: ../fish/guestfish.pod:704
18788 #: ../fish/guestfish.pod:706
18789 msgid "HOME DIRECTORIES"
18793 #: ../fish/guestfish.pod:708
18795 "If a parameter starts with the character C<~> then the tilde may be expanded "
18796 "as a home directory path (either C<~> for the current user's home directory, "
18797 "or C<~user> for another user)."
18801 #: ../fish/guestfish.pod:712
18803 "Note that home directory expansion happens for users known I<on the host>, "
18804 "not in the guest filesystem."
18808 #: ../fish/guestfish.pod:715
18810 "To use a literal argument which begins with a tilde, you have to quote it, "
18815 #: ../fish/guestfish.pod:718
18823 #: ../fish/guestfish.pod:722
18825 "Libguestfs has some support for Linux guests encrypted according to the "
18826 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18827 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18828 "LUKS is supported."
18832 #: ../fish/guestfish.pod:727
18833 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18837 #: ../fish/guestfish.pod:729
18840 " ><fs> vfs-type /dev/sda2\n"
18846 #: ../fish/guestfish.pod:732
18848 "Then open those devices using L</luks-open>. This creates a device-mapper "
18849 "device called C</dev/mapper/luksdev>."
18853 #: ../fish/guestfish.pod:735
18856 " ><fs> luks-open /dev/sda2 luksdev\n"
18857 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18862 #: ../fish/guestfish.pod:738
18864 "Finally you have to tell LVM to scan for volume groups on the newly created "
18869 #: ../fish/guestfish.pod:741
18873 " vg-activate-all true\n"
18878 #: ../fish/guestfish.pod:744
18879 msgid "The logical volume(s) can now be mounted in the usual way."
18883 #: ../fish/guestfish.pod:746
18885 "Before closing a LUKS device you must unmount any logical volumes on it and "
18886 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18887 "one. Then you can close the mapper device:"
18891 #: ../fish/guestfish.pod:750
18894 " vg-activate false /dev/VG\n"
18895 " luks-close /dev/mapper/luksdev\n"
18900 #: ../fish/guestfish.pod:753
18901 msgid "WINDOWS PATHS"
18905 #: ../fish/guestfish.pod:755
18907 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18908 "(with some limitations). The following commands are equivalent:"
18912 #: ../fish/guestfish.pod:758
18915 " file /WINDOWS/system32/config/system.LOG\n"
18920 #: ../fish/guestfish.pod:760
18923 " file win:/windows/system32/config/system.log\n"
18928 #: ../fish/guestfish.pod:762
18931 " file win:\\windows\\system32\\config\\system.log\n"
18936 #: ../fish/guestfish.pod:764
18939 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18944 #: ../fish/guestfish.pod:766
18946 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18947 "handles case insensitivity like Windows would. This only works in argument "
18948 "positions that expect a path."
18952 #: ../fish/guestfish.pod:770
18953 msgid "UPLOADING AND DOWNLOADING FILES"
18957 #: ../fish/guestfish.pod:772
18959 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18960 "others which upload from or download to a local file, you can use the "
18961 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18965 #: ../fish/guestfish.pod:776
18973 #: ../fish/guestfish.pod:778
18975 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18979 #: ../fish/guestfish.pod:781
18982 " tar-out /etc - | tar tf -\n"
18987 #: ../fish/guestfish.pod:783
18989 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18990 "command (see L</PIPES>)."
18994 #: ../fish/guestfish.pod:786
18996 "When using C<-> to read from stdin, the input is read up to the end of "
18997 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18998 "some arbitrary end marker:"
19002 #: ../fish/guestfish.pod:790
19005 " upload -<<END /foo\n"
19014 #: ../fish/guestfish.pod:796
19016 "Any string of characters can be used instead of C<END>. The end marker must "
19017 "appear on a line of its own, without any preceeding or following characters "
19018 "(not even spaces)."
19022 #: ../fish/guestfish.pod:800
19024 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19025 "upload local files (so-called \"FileIn\" parameters in the generator)."
19029 #: ../fish/guestfish.pod:803
19030 msgid "EXIT ON ERROR BEHAVIOUR"
19034 #: ../fish/guestfish.pod:805
19036 "By default, guestfish will ignore any errors when in interactive mode (ie. "
19037 "taking commands from a human over a tty), and will exit on the first error "
19038 "in non-interactive mode (scripts, commands given on the command line)."
19042 #: ../fish/guestfish.pod:810
19044 "If you prefix a command with a I<-> character, then that command will not "
19045 "cause guestfish to exit, even if that (one) command returns an error."
19049 #: ../fish/guestfish.pod:814
19050 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19054 #: ../fish/guestfish.pod:816
19056 "Guestfish can be remote-controlled over a socket. This is useful "
19057 "particularly in shell scripts where you want to make several different "
19058 "changes to a filesystem, but you don't want the overhead of starting up a "
19059 "guestfish process each time."
19063 #: ../fish/guestfish.pod:821
19064 msgid "Start a guestfish server process using:"
19068 #: ../fish/guestfish.pod:823
19071 " eval \"`guestfish --listen`\"\n"
19076 #: ../fish/guestfish.pod:825
19077 msgid "and then send it commands by doing:"
19081 #: ../fish/guestfish.pod:827
19084 " guestfish --remote cmd [...]\n"
19089 #: ../fish/guestfish.pod:829
19090 msgid "To cause the server to exit, send it the exit command:"
19094 #: ../fish/guestfish.pod:831
19097 " guestfish --remote exit\n"
19102 #: ../fish/guestfish.pod:833
19104 "Note that the server will normally exit if there is an error in a command. "
19105 "You can change this in the usual way. See section L</EXIT ON ERROR "
19110 #: ../fish/guestfish.pod:837
19111 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19115 #: ../fish/guestfish.pod:839
19117 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19118 "is how the I<--remote> option knows where to send the commands. You can "
19119 "have several guestfish listener processes running using:"
19123 #: ../fish/guestfish.pod:843
19126 " eval \"`guestfish --listen`\"\n"
19127 " pid1=$GUESTFISH_PID\n"
19128 " eval \"`guestfish --listen`\"\n"
19129 " pid2=$GUESTFISH_PID\n"
19131 " guestfish --remote=$pid1 cmd\n"
19132 " guestfish --remote=$pid2 cmd\n"
19137 #: ../fish/guestfish.pod:851
19138 msgid "REMOTE CONTROL AND CSH"
19142 #: ../fish/guestfish.pod:853
19144 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19149 #: ../fish/guestfish.pod:856
19152 " eval \"`guestfish --listen --csh`\"\n"
19157 #: ../fish/guestfish.pod:858
19158 msgid "REMOTE CONTROL DETAILS"
19162 #: ../fish/guestfish.pod:860
19164 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
19165 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
19166 "and C<$PID> is the process ID of the server."
19170 #: ../fish/guestfish.pod:864
19171 msgid "Guestfish client and server versions must match exactly."
19175 #: ../fish/guestfish.pod:866
19176 msgid "PREPARED DISK IMAGES"
19180 #: ../fish/guestfish.pod:868
19182 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19183 "preformatted disk images that guestfish can make for you to save typing. "
19184 "This is particularly useful for testing purposes. This option is used "
19185 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19186 "can be mixed with I<-a>)."
19190 #: ../fish/guestfish.pod:874
19192 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19193 "the second and so on. Existing files in the current directory are "
19198 #: ../fish/guestfish.pod:878
19200 "The type briefly describes how the disk should be sized, partitioned, how "
19201 "filesystem(s) should be created, and how content should be added. "
19202 "Optionally the type can be followed by extra parameters, separated by C<:> "
19203 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
19204 "allocated disk, containing a single partition, with the partition formatted "
19205 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
19210 #: ../fish/guestfish.pod:886
19211 msgid "To list the available types and any extra parameters they take, run:"
19215 #: ../fish/guestfish.pod:890
19217 "Note that the prepared filesystem is not mounted. You would usually have to "
19218 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19222 #: ../fish/guestfish.pod:894
19224 "If any I<-N> or I<--new> options are given, the guest is automatically "
19229 #: ../fish/guestfish.pod:899
19230 msgid "Create a 100MB disk with an ext4-formatted partition:"
19234 #: ../fish/guestfish.pod:901
19237 " guestfish -N fs:ext4\n"
19242 #: ../fish/guestfish.pod:903
19243 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19247 #: ../fish/guestfish.pod:905
19250 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19255 #: ../fish/guestfish.pod:907
19256 msgid "Create a blank 200MB disk:"
19260 #: ../fish/guestfish.pod:909
19263 " guestfish -N disk:200M\n"
19268 #: ../fish/guestfish.pod:911
19269 msgid "PROGRESS BARS"
19273 #: ../fish/guestfish.pod:913
19275 "Some (not all) long-running commands send progress notification messages as "
19276 "they are running. Guestfish turns these messages into progress bars."
19280 #: ../fish/guestfish.pod:917
19282 "When a command that supports progress bars takes longer than two seconds to "
19283 "run, and if progress bars are enabled, then you will see one appearing below "
19288 #: ../fish/guestfish.pod:921
19291 " ><fs> copy-size /large-file /another-file 2048M\n"
19292 " / 10% [#####-----------------------------------------] 00:30\n"
19297 #: ../fish/guestfish.pod:924
19299 "The spinner on the left hand side moves round once for every progress "
19300 "notification received from the backend. This is a (reasonably) golden "
19301 "assurance that the command is \"doing something\" even if the progress bar "
19302 "is not moving, because the command is able to send the progress "
19303 "notifications. When the bar reaches 100% and the command finishes, the "
19304 "spinner disappears."
19308 #: ../fish/guestfish.pod:931
19310 "Progress bars are enabled by default when guestfish is used interactively. "
19311 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19312 "and you can disable them completely using I<--no-progress-bars>."
19316 #: ../fish/guestfish.pod:936
19317 msgid "GUESTFISH COMMANDS"
19321 #: ../fish/guestfish.pod:938
19323 "The commands in this section are guestfish convenience commands, in other "
19324 "words, they are not part of the L<guestfs(3)> API."
19328 #: ../fish/guestfish.pod:941
19333 #: ../fish/guestfish.pod:943
19342 #: ../fish/guestfish.pod:946
19343 msgid "Without any parameter, this provides general help."
19347 #: ../fish/guestfish.pod:948
19348 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19352 #: ../fish/guestfish.pod:950
19353 msgid "quit | exit"
19357 #: ../fish/guestfish.pod:952
19358 msgid "This exits guestfish. You can also use C<^D> key."
19362 #: ../fish/guestfish.pod:954
19363 msgid "@FISH_COMMANDS@"
19367 #: ../fish/guestfish.pod:956
19372 #: ../fish/guestfish.pod:960 ../test-tool/libguestfs-test-tool.pod:83
19377 #: ../fish/guestfish.pod:962
19379 "guestfish returns 0 if the commands completed without error, or 1 if there "
19384 #: ../fish/guestfish.pod:969
19389 #: ../fish/guestfish.pod:971
19391 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19396 #: ../fish/guestfish.pod:974
19397 msgid "GUESTFISH_PID"
19401 #: ../fish/guestfish.pod:976
19403 "Used with the I<--remote> option to specify the remote guestfish process to "
19404 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19408 #: ../fish/guestfish.pod:980
19413 #: ../fish/guestfish.pod:982
19415 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19416 "not specified, the external L<hexedit(1)> program is used."
19420 #: ../fish/guestfish.pod:986
19425 #: ../fish/guestfish.pod:988
19427 "If compiled with GNU readline support, various files in the home directory "
19428 "can be used. See L</FILES>."
19432 #: ../fish/guestfish.pod:997
19434 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19435 "effect as using the B<-v> option."
19439 #: ../fish/guestfish.pod:1009
19441 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19442 "the discussion of paths in L<guestfs(3)>."
19446 #: ../fish/guestfish.pod:1020
19447 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19451 #: ../fish/guestfish.pod:1022
19456 #: ../fish/guestfish.pod:1024
19458 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19463 #: ../fish/guestfish.pod:1039 ../test-tool/libguestfs-test-tool.pod:88
19468 #: ../fish/guestfish.pod:1043
19469 msgid "$HOME/.guestfish"
19473 #: ../fish/guestfish.pod:1045
19475 "If compiled with GNU readline support, then the command history is saved in "
19480 #: ../fish/guestfish.pod:1048
19481 msgid "$HOME/.inputrc"
19485 #: ../fish/guestfish.pod:1050
19486 msgid "/etc/inputrc"
19490 #: ../fish/guestfish.pod:1052
19492 "If compiled with GNU readline support, then these files can be used to "
19493 "configure readline. For further information, please see L<readline(3)/"
19494 "INITIALIZATION FILE>."
19498 #: ../fish/guestfish.pod:1056
19499 msgid "To write rules which only apply to guestfish, use:"
19503 #: ../fish/guestfish.pod:1058
19513 #: ../fish/guestfish.pod:1062
19515 "Variables that you can set in inputrc that change the behaviour of guestfish "
19516 "in useful ways include:"
19520 #: ../fish/guestfish.pod:1067
19521 msgid "completion-ignore-case (default: on)"
19525 #: ../fish/guestfish.pod:1069
19527 "By default, guestfish will ignore case when tab-completing paths on the "
19532 #: ../fish/guestfish.pod:1072
19535 " set completion-ignore-case off\n"
19540 #: ../fish/guestfish.pod:1074
19541 msgid "to make guestfish case sensitive."
19545 #: ../fish/guestfish.pod:1078
19550 #: ../fish/guestfish.pod:1080
19551 msgid "test2.img (etc)"
19555 #: ../fish/guestfish.pod:1082
19557 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19558 "will be created in the file C<test1.img> in the current directory. The "
19559 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19560 "the same name will be overwritten."
19564 #: ../fish/guestfish.pod:1091
19566 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19567 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
19568 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
19569 ">, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, "
19574 #: ../fish/guestfish.pod:1117 ../test-tool/libguestfs-test-tool.pod:124
19575 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370
19576 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512
19577 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:300
19578 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
19580 "This program is free software; you can redistribute it and/or modify it "
19581 "under the terms of the GNU General Public License as published by the Free "
19582 "Software Foundation; either version 2 of the License, or (at your option) "
19583 "any later version."
19587 #: ../fish/guestfish.pod:1122 ../test-tool/libguestfs-test-tool.pod:129
19588 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375
19589 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517
19590 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:305
19591 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
19593 "This program is distributed in the hope that it will be useful, but WITHOUT "
19594 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19595 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19600 #: ../fish/guestfish.pod:1127 ../test-tool/libguestfs-test-tool.pod:134
19601 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380
19602 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522
19603 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:310
19604 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
19606 "You should have received a copy of the GNU General Public License along with "
19607 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19608 "Ave, Cambridge, MA 02139, USA."
19612 #: ../fish/guestfish-actions.pod:1
19617 #: ../fish/guestfish-actions.pod:3
19620 " add-cdrom filename\n"
19625 #: ../fish/guestfish-actions.pod:15
19627 "This call checks for the existence of C<filename>. This stops you from "
19628 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19629 "and C<http:> URLs. To specify those, use the general L</config> call "
19634 #: ../fish/guestfish-actions.pod:22
19636 "If you just want to add an ISO file (often you use this as an efficient way "
19637 "to transfer large files into the guest), then you should probably use L</add-"
19638 "drive-ro> instead."
19642 #: ../fish/guestfish-actions.pod:35
19647 #: ../fish/guestfish-actions.pod:37
19652 #: ../fish/guestfish-actions.pod:39
19655 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19660 #: ../fish/guestfish-actions.pod:41
19662 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19663 "It works by connecting to libvirt, requesting the domain and domain XML from "
19664 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19668 #: ../fish/guestfish-actions.pod:58
19670 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19671 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19672 "libvirt URI (or one set through an environment variable, see the libvirt "
19673 "documentation for full details). If you are using the C API directly then "
19674 "it is more flexible to create the libvirt connection object yourself, get "
19675 "the domain object, and call L</add-libvirt-dom>."
19679 #: ../fish/guestfish-actions.pod:66
19681 "The other optional parameters are passed directly through to L</add-drive-"
19686 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19687 #: ../fish/guestfish-actions.pod:2844
19689 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19693 #: ../fish/guestfish-actions.pod:71
19698 #: ../fish/guestfish-actions.pod:73
19701 " add-drive filename\n"
19706 #: ../fish/guestfish-actions.pod:75
19708 "This function is the equivalent of calling L</add-drive-opts> with no "
19709 "optional parameters, so the disk is added writable, with the format being "
19710 "detected automatically."
19714 #: ../fish/guestfish-actions.pod:79
19716 "Automatic detection of the format opens you up to a potential security hole "
19717 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19718 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19719 "you should think about replacing calls to this function with calls to L</add-"
19720 "drive-opts>, and specifying the format."
19724 #: ../fish/guestfish-actions.pod:86
19725 msgid "add-drive-opts"
19729 #: ../fish/guestfish-actions.pod:88
19734 #: ../fish/guestfish-actions.pod:90
19737 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19742 #: ../fish/guestfish-actions.pod:117
19744 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19745 "add-drive-ro>) then the format is automatically detected. Possible formats "
19746 "include C<raw> and C<qcow2>."
19750 #: ../fish/guestfish-actions.pod:128
19752 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19753 "add-drive-with-if> call (q.v.)"
19757 #: ../fish/guestfish-actions.pod:135
19758 msgid "add-drive-ro"
19762 #: ../fish/guestfish-actions.pod:137
19767 #: ../fish/guestfish-actions.pod:139
19770 " add-drive-ro filename\n"
19775 #: ../fish/guestfish-actions.pod:141
19777 "This function is the equivalent of calling L</add-drive-opts> with the "
19778 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19779 "is added read-only, with the format being detected automatically."
19783 #: ../fish/guestfish-actions.pod:146
19784 msgid "add-drive-ro-with-if"
19788 #: ../fish/guestfish-actions.pod:148
19791 " add-drive-ro-with-if filename iface\n"
19796 #: ../fish/guestfish-actions.pod:150
19798 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19799 "interface emulation to use at run time."
19803 #: ../fish/guestfish-actions.pod:160
19804 msgid "add-drive-with-if"
19808 #: ../fish/guestfish-actions.pod:162
19811 " add-drive-with-if filename iface\n"
19816 #: ../fish/guestfish-actions.pod:164
19818 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19819 "interface emulation to use at run time."
19823 #: ../fish/guestfish-actions.pod:174
19828 #: ../fish/guestfish-actions.pod:176
19831 " aug-clear augpath\n"
19836 #: ../fish/guestfish-actions.pod:181
19841 #: ../fish/guestfish-actions.pod:183
19849 #: ../fish/guestfish-actions.pod:185
19851 "Close the current Augeas handle and free up any resources used by it. After "
19852 "calling this, you have to call L</aug-init> again before you can use any "
19853 "other Augeas functions."
19857 #: ../fish/guestfish-actions.pod:190
19858 msgid "aug-defnode"
19862 #: ../fish/guestfish-actions.pod:192
19865 " aug-defnode name expr val\n"
19870 #: ../fish/guestfish-actions.pod:197
19872 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19873 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19874 "containing that single node."
19878 #: ../fish/guestfish-actions.pod:205
19883 #: ../fish/guestfish-actions.pod:207
19886 " aug-defvar name expr\n"
19891 #: ../fish/guestfish-actions.pod:216
19896 #: ../fish/guestfish-actions.pod:218
19899 " aug-get augpath\n"
19904 #: ../fish/guestfish-actions.pod:223
19909 #: ../fish/guestfish-actions.pod:225
19912 " aug-init root flags\n"
19917 #: ../fish/guestfish-actions.pod:231
19918 msgid "You must call this before using any other L</aug-*> commands."
19922 #: ../fish/guestfish-actions.pod:266
19923 msgid "Do not load the tree in L</aug-init>."
19927 #: ../fish/guestfish-actions.pod:270
19928 msgid "To close the handle, you can call L</aug-close>."
19932 #: ../fish/guestfish-actions.pod:274
19937 #: ../fish/guestfish-actions.pod:276
19940 " aug-insert augpath label true|false\n"
19945 #: ../fish/guestfish-actions.pod:286
19950 #: ../fish/guestfish-actions.pod:288
19958 #: ../fish/guestfish-actions.pod:295
19963 #: ../fish/guestfish-actions.pod:297
19966 " aug-ls augpath\n"
19971 #: ../fish/guestfish-actions.pod:299
19973 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19974 "resulting nodes into alphabetical order."
19978 #: ../fish/guestfish-actions.pod:302
19983 #: ../fish/guestfish-actions.pod:304
19986 " aug-match augpath\n"
19991 #: ../fish/guestfish-actions.pod:310
19996 #: ../fish/guestfish-actions.pod:312
19999 " aug-mv src dest\n"
20004 #: ../fish/guestfish-actions.pod:317
20009 #: ../fish/guestfish-actions.pod:319
20012 " aug-rm augpath\n"
20017 #: ../fish/guestfish-actions.pod:325
20022 #: ../fish/guestfish-actions.pod:327
20030 #: ../fish/guestfish-actions.pod:331
20032 "The flags which were passed to L</aug-init> affect exactly how files are "
20037 #: ../fish/guestfish-actions.pod:334
20042 #: ../fish/guestfish-actions.pod:336
20045 " aug-set augpath val\n"
20050 #: ../fish/guestfish-actions.pod:340
20052 "In the Augeas API, it is possible to clear a node by setting the value to "
20053 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
20054 "this call. Instead you must use the L</aug-clear> call."
20058 #: ../fish/guestfish-actions.pod:345
20063 #: ../fish/guestfish-actions.pod:347
20066 " available 'groups ...'\n"
20071 #: ../fish/guestfish-actions.pod:353
20073 "The libguestfs groups, and the functions that those groups correspond to, "
20074 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
20075 "runtime by calling L</available-all-groups>."
20079 #: ../fish/guestfish-actions.pod:377
20080 msgid "You must call L</launch> before calling this function."
20084 #: ../fish/guestfish-actions.pod:399
20086 "This call was added in version C<1.0.80>. In previous versions of "
20087 "libguestfs all you could do would be to speculatively execute a command to "
20088 "find out if the daemon implemented it. See also L</version>."
20092 #: ../fish/guestfish-actions.pod:406
20093 msgid "available-all-groups"
20097 #: ../fish/guestfish-actions.pod:408
20100 " available-all-groups\n"
20105 #: ../fish/guestfish-actions.pod:410
20107 "This command returns a list of all optional groups that this daemon knows "
20108 "about. Note this returns both supported and unsupported groups. To find "
20109 "out which ones the daemon can actually support you have to call L</"
20110 "available> on each member of the returned list."
20114 #: ../fish/guestfish-actions.pod:416
20115 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
20119 #: ../fish/guestfish-actions.pod:418
20124 #: ../fish/guestfish-actions.pod:420
20127 " base64-in (base64file|-) filename\n"
20132 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
20133 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
20134 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
20135 #: ../fish/guestfish-actions.pod:4199 ../fish/guestfish-actions.pod:4211
20136 #: ../fish/guestfish-actions.pod:4222 ../fish/guestfish-actions.pod:4233
20137 #: ../fish/guestfish-actions.pod:4285 ../fish/guestfish-actions.pod:4294
20138 #: ../fish/guestfish-actions.pod:4348 ../fish/guestfish-actions.pod:4371
20139 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
20143 #: ../fish/guestfish-actions.pod:427
20148 #: ../fish/guestfish-actions.pod:429
20151 " base64-out filename (base64file|-)\n"
20156 #: ../fish/guestfish-actions.pod:436
20157 msgid "blockdev-flushbufs"
20161 #: ../fish/guestfish-actions.pod:438
20164 " blockdev-flushbufs device\n"
20169 #: ../fish/guestfish-actions.pod:445
20170 msgid "blockdev-getbsz"
20174 #: ../fish/guestfish-actions.pod:447
20177 " blockdev-getbsz device\n"
20182 #: ../fish/guestfish-actions.pod:456
20183 msgid "blockdev-getro"
20187 #: ../fish/guestfish-actions.pod:458
20190 " blockdev-getro device\n"
20195 #: ../fish/guestfish-actions.pod:465
20196 msgid "blockdev-getsize64"
20200 #: ../fish/guestfish-actions.pod:467
20203 " blockdev-getsize64 device\n"
20208 #: ../fish/guestfish-actions.pod:471
20209 msgid "See also L</blockdev-getsz>."
20213 #: ../fish/guestfish-actions.pod:475
20214 msgid "blockdev-getss"
20218 #: ../fish/guestfish-actions.pod:477
20221 " blockdev-getss device\n"
20226 #: ../fish/guestfish-actions.pod:482
20228 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
20232 #: ../fish/guestfish-actions.pod:487
20233 msgid "blockdev-getsz"
20237 #: ../fish/guestfish-actions.pod:489
20240 " blockdev-getsz device\n"
20245 #: ../fish/guestfish-actions.pod:494
20247 "See also L</blockdev-getss> for the real sector size of the device, and L</"
20248 "blockdev-getsize64> for the more useful I<size in bytes>."
20252 #: ../fish/guestfish-actions.pod:500
20253 msgid "blockdev-rereadpt"
20257 #: ../fish/guestfish-actions.pod:502
20260 " blockdev-rereadpt device\n"
20265 #: ../fish/guestfish-actions.pod:508
20266 msgid "blockdev-setbsz"
20270 #: ../fish/guestfish-actions.pod:510
20273 " blockdev-setbsz device blocksize\n"
20278 #: ../fish/guestfish-actions.pod:519
20279 msgid "blockdev-setro"
20283 #: ../fish/guestfish-actions.pod:521
20286 " blockdev-setro device\n"
20291 #: ../fish/guestfish-actions.pod:527
20292 msgid "blockdev-setrw"
20296 #: ../fish/guestfish-actions.pod:529
20299 " blockdev-setrw device\n"
20304 #: ../fish/guestfish-actions.pod:535
20305 msgid "case-sensitive-path"
20309 #: ../fish/guestfish-actions.pod:537
20312 " case-sensitive-path path\n"
20317 #: ../fish/guestfish-actions.pod:561
20319 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
20320 "WINDOWS/system32\"> (the exact return value would depend on details of how "
20321 "the directories were originally created under Windows)."
20325 #: ../fish/guestfish-actions.pod:569
20326 msgid "See also L</realpath>."
20330 #: ../fish/guestfish-actions.pod:571
20335 #: ../fish/guestfish-actions.pod:573
20343 #: ../fish/guestfish-actions.pod:577
20345 "Note that this function cannot correctly handle binary files (specifically, "
20346 "files containing C<\\0> character which is treated as end of string). For "
20347 "those you need to use the L</read-file> or L</download> functions which have "
20348 "a more complex interface."
20352 #: ../fish/guestfish-actions.pod:585
20357 #: ../fish/guestfish-actions.pod:587
20360 " checksum csumtype path\n"
20365 #: ../fish/guestfish-actions.pod:630
20366 msgid "To get the checksum for a device, use L</checksum-device>."
20370 #: ../fish/guestfish-actions.pod:632
20371 msgid "To get the checksums for many files, use L</checksums-out>."
20375 #: ../fish/guestfish-actions.pod:634
20376 msgid "checksum-device"
20380 #: ../fish/guestfish-actions.pod:636
20383 " checksum-device csumtype device\n"
20388 #: ../fish/guestfish-actions.pod:638
20390 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20391 "device named C<device>. For the types of checksums supported see the L</"
20392 "checksum> command."
20396 #: ../fish/guestfish-actions.pod:642
20397 msgid "checksums-out"
20401 #: ../fish/guestfish-actions.pod:644
20404 " checksums-out csumtype directory (sumsfile|-)\n"
20409 #: ../fish/guestfish-actions.pod:660
20414 #: ../fish/guestfish-actions.pod:662
20417 " chmod mode path\n"
20422 #: ../fish/guestfish-actions.pod:673
20427 #: ../fish/guestfish-actions.pod:675
20430 " chown owner group path\n"
20435 #: ../fish/guestfish-actions.pod:683
20440 #: ../fish/guestfish-actions.pod:685
20443 " command 'arguments ...'\n"
20448 #: ../fish/guestfish-actions.pod:692
20450 "The single parameter is an argv-style list of arguments. The first element "
20451 "is the name of the program to run. Subsequent elements are parameters. The "
20452 "list must be non-empty (ie. must contain a program name). Note that the "
20453 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20457 #: ../fish/guestfish-actions.pod:720
20458 msgid "command-lines"
20462 #: ../fish/guestfish-actions.pod:722
20465 " command-lines 'arguments ...'\n"
20470 #: ../fish/guestfish-actions.pod:724
20472 "This is the same as L</command>, but splits the result into a list of lines."
20476 #: ../fish/guestfish-actions.pod:727
20477 msgid "See also: L</sh-lines>"
20481 #: ../fish/guestfish-actions.pod:732
20486 #: ../fish/guestfish-actions.pod:734
20489 " config qemuparam qemuvalue\n"
20494 #: ../fish/guestfish-actions.pod:745
20499 #: ../fish/guestfish-actions.pod:747
20502 " copy-size src dest size\n"
20507 #: ../fish/guestfish-actions.pod:755
20512 #: ../fish/guestfish-actions.pod:757
20520 #: ../fish/guestfish-actions.pod:762
20525 #: ../fish/guestfish-actions.pod:764
20533 #: ../fish/guestfish-actions.pod:769
20538 #: ../fish/guestfish-actions.pod:771
20546 #: ../fish/guestfish-actions.pod:778
20548 "If the destination is a device, it must be as large or larger than the "
20549 "source file or device, otherwise the copy will fail. This command cannot do "
20550 "partial copies (see L</copy-size>)."
20554 #: ../fish/guestfish-actions.pod:782
20559 #: ../fish/guestfish-actions.pod:784
20567 #: ../fish/guestfish-actions.pod:792
20572 #: ../fish/guestfish-actions.pod:794
20580 #: ../fish/guestfish-actions.pod:803
20585 #: ../fish/guestfish-actions.pod:805
20593 #: ../fish/guestfish-actions.pod:811
20595 "Another way to get the same information is to enable verbose messages with "
20596 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20597 "before running the program."
20601 #: ../fish/guestfish-actions.pod:816
20606 #: ../fish/guestfish-actions.pod:818
20609 " download remotefilename (filename|-)\n"
20614 #: ../fish/guestfish-actions.pod:825
20615 msgid "See also L</upload>, L</cat>."
20619 #: ../fish/guestfish-actions.pod:829
20620 msgid "download-offset"
20624 #: ../fish/guestfish-actions.pod:831
20627 " download-offset remotefilename (filename|-) offset size\n"
20632 #: ../fish/guestfish-actions.pod:839
20634 "Note that there is no limit on the amount of data that can be downloaded "
20635 "with this call, unlike with L</pread>, and this call always reads the full "
20636 "amount unless an error occurs."
20640 #: ../fish/guestfish-actions.pod:844
20641 msgid "See also L</download>, L</pread>."
20645 #: ../fish/guestfish-actions.pod:848
20646 msgid "drop-caches"
20650 #: ../fish/guestfish-actions.pod:850
20653 " drop-caches whattodrop\n"
20658 #: ../fish/guestfish-actions.pod:862
20663 #: ../fish/guestfish-actions.pod:864
20671 #: ../fish/guestfish-actions.pod:876
20676 #: ../fish/guestfish-actions.pod:878
20679 " e2fsck-f device\n"
20684 #: ../fish/guestfish-actions.pod:884
20686 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20687 "should use L</fsck>."
20691 #: ../fish/guestfish-actions.pod:887
20692 msgid "echo-daemon"
20696 #: ../fish/guestfish-actions.pod:889
20699 " echo-daemon 'words ...'\n"
20704 #: ../fish/guestfish-actions.pod:896
20705 msgid "See also L</ping-daemon>."
20709 #: ../fish/guestfish-actions.pod:898
20714 #: ../fish/guestfish-actions.pod:900
20717 " egrep regex path\n"
20722 #: ../fish/guestfish-actions.pod:908
20727 #: ../fish/guestfish-actions.pod:910
20730 " egrepi regex path\n"
20735 #: ../fish/guestfish-actions.pod:918
20740 #: ../fish/guestfish-actions.pod:920
20743 " equal file1 file2\n"
20748 #: ../fish/guestfish-actions.pod:927
20753 #: ../fish/guestfish-actions.pod:929
20761 #: ../fish/guestfish-actions.pod:934
20762 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20766 #: ../fish/guestfish-actions.pod:936
20771 #: ../fish/guestfish-actions.pod:938
20774 " fallocate path len\n"
20779 #: ../fish/guestfish-actions.pod:955
20780 msgid "fallocate64"
20784 #: ../fish/guestfish-actions.pod:957
20787 " fallocate64 path len\n"
20792 #: ../fish/guestfish-actions.pod:963
20794 "Note that this call allocates disk blocks for the file. To create a sparse "
20795 "file use L</truncate-size> instead."
20799 #: ../fish/guestfish-actions.pod:966
20801 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20802 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20803 "maximum size of files created through that call to 1GB."
20807 #: ../fish/guestfish-actions.pod:975
20812 #: ../fish/guestfish-actions.pod:977
20815 " fgrep pattern path\n"
20820 #: ../fish/guestfish-actions.pod:985
20825 #: ../fish/guestfish-actions.pod:987
20828 " fgrepi pattern path\n"
20833 #: ../fish/guestfish-actions.pod:995
20838 #: ../fish/guestfish-actions.pod:997
20846 #: ../fish/guestfish-actions.pod:1009
20848 "This command can also be used on C</dev/> devices (and partitions, LV "
20849 "names). You can for example use this to determine if a device contains a "
20850 "filesystem, although it's usually better to use L</vfs-type>."
20854 #: ../fish/guestfish-actions.pod:1019
20855 msgid "file-architecture"
20859 #: ../fish/guestfish-actions.pod:1021
20862 " file-architecture filename\n"
20867 #: ../fish/guestfish-actions.pod:1124
20872 #: ../fish/guestfish-actions.pod:1126
20880 #: ../fish/guestfish-actions.pod:1130
20882 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20883 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20887 #: ../fish/guestfish-actions.pod:1134
20892 #: ../fish/guestfish-actions.pod:1136
20895 " fill c len path\n"
20900 #: ../fish/guestfish-actions.pod:1142
20902 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20903 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20904 "L</fill-pattern>."
20908 #: ../fish/guestfish-actions.pod:1147
20909 msgid "fill-pattern"
20913 #: ../fish/guestfish-actions.pod:1149
20916 " fill-pattern pattern len path\n"
20921 #: ../fish/guestfish-actions.pod:1151
20923 "This function is like L</fill> except that it creates a new file of length "
20924 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20925 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20930 #: ../fish/guestfish-actions.pod:1156
20935 #: ../fish/guestfish-actions.pod:1158
20938 " find directory\n"
20943 #: ../fish/guestfish-actions.pod:1172
20944 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20948 #: ../fish/guestfish-actions.pod:1185
20949 msgid "See also L</find0>."
20953 #: ../fish/guestfish-actions.pod:1190
20958 #: ../fish/guestfish-actions.pod:1192
20961 " find0 directory (files|-)\n"
20966 #: ../fish/guestfish-actions.pod:1198
20968 "This command works the same way as L</find> with the following exceptions:"
20972 #: ../fish/guestfish-actions.pod:1225
20973 msgid "findfs-label"
20977 #: ../fish/guestfish-actions.pod:1227
20980 " findfs-label label\n"
20985 #: ../fish/guestfish-actions.pod:1233
20986 msgid "To find the label of a filesystem, use L</vfs-label>."
20990 #: ../fish/guestfish-actions.pod:1235
20991 msgid "findfs-uuid"
20995 #: ../fish/guestfish-actions.pod:1237
20998 " findfs-uuid uuid\n"
21003 #: ../fish/guestfish-actions.pod:1243
21004 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
21008 #: ../fish/guestfish-actions.pod:1245
21013 #: ../fish/guestfish-actions.pod:1247
21016 " fsck fstype device\n"
21021 #: ../fish/guestfish-actions.pod:1277
21026 #: ../fish/guestfish-actions.pod:1279
21034 #: ../fish/guestfish-actions.pod:1286
21035 msgid "get-autosync"
21039 #: ../fish/guestfish-actions.pod:1288
21047 #: ../fish/guestfish-actions.pod:1292
21052 #: ../fish/guestfish-actions.pod:1294
21060 #: ../fish/guestfish-actions.pod:1298
21061 msgid "get-e2label"
21065 #: ../fish/guestfish-actions.pod:1300
21068 " get-e2label device\n"
21073 #: ../fish/guestfish-actions.pod:1312
21078 #: ../fish/guestfish-actions.pod:1314
21081 " get-e2uuid device\n"
21086 #: ../fish/guestfish-actions.pod:1326
21087 msgid "get-memsize"
21091 #: ../fish/guestfish-actions.pod:1328
21099 #: ../fish/guestfish-actions.pod:1333
21101 "If L</set-memsize> was not called on this handle, and if "
21102 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
21103 "value for memsize."
21107 #: ../fish/guestfish-actions.pod:1340
21108 msgid "get-network"
21112 #: ../fish/guestfish-actions.pod:1342
21120 #: ../fish/guestfish-actions.pod:1346
21125 #: ../fish/guestfish-actions.pod:1348
21133 #: ../fish/guestfish-actions.pod:1355
21138 #: ../fish/guestfish-actions.pod:1357
21143 #: ../fish/guestfish-actions.pod:1359
21151 #: ../fish/guestfish-actions.pod:1366
21156 #: ../fish/guestfish-actions.pod:1368
21164 #: ../fish/guestfish-actions.pod:1375
21165 msgid "get-recovery-proc"
21169 #: ../fish/guestfish-actions.pod:1377
21172 " get-recovery-proc\n"
21177 #: ../fish/guestfish-actions.pod:1381
21178 msgid "get-selinux"
21182 #: ../fish/guestfish-actions.pod:1383
21190 #: ../fish/guestfish-actions.pod:1385
21192 "This returns the current setting of the selinux flag which is passed to the "
21193 "appliance at boot time. See L</set-selinux>."
21197 #: ../fish/guestfish-actions.pod:1391
21202 #: ../fish/guestfish-actions.pod:1393
21210 #: ../fish/guestfish-actions.pod:1400
21215 #: ../fish/guestfish-actions.pod:1402
21223 #: ../fish/guestfish-actions.pod:1406
21228 #: ../fish/guestfish-actions.pod:1408
21236 #: ../fish/guestfish-actions.pod:1410
21238 "Return the current umask. By default the umask is C<022> unless it has been "
21239 "set by calling L</umask>."
21243 #: ../fish/guestfish-actions.pod:1413
21244 msgid "get-verbose"
21248 #: ../fish/guestfish-actions.pod:1415
21256 #: ../fish/guestfish-actions.pod:1419
21261 #: ../fish/guestfish-actions.pod:1421
21269 #: ../fish/guestfish-actions.pod:1425
21270 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
21274 #: ../fish/guestfish-actions.pod:1428
21279 #: ../fish/guestfish-actions.pod:1430
21282 " getxattr path name\n"
21287 #: ../fish/guestfish-actions.pod:1432
21289 "Get a single extended attribute from file C<path> named C<name>. This call "
21290 "follows symlinks. If you want to lookup an extended attribute for the "
21291 "symlink itself, use L</lgetxattr>."
21295 #: ../fish/guestfish-actions.pod:1436 ../fish/guestfish-actions.pod:2263
21297 "Normally it is better to get all extended attributes from a file in one go "
21298 "by calling L</getxattrs>. However some Linux filesystem implementations are "
21299 "buggy and do not provide a way to list out attributes. For these "
21300 "filesystems (notably ntfs-3g) you have to know the names of the extended "
21301 "attributes you want in advance and call this function."
21305 #: ../fish/guestfish-actions.pod:1446
21306 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
21310 #: ../fish/guestfish-actions.pod:1448
21315 #: ../fish/guestfish-actions.pod:1450
21318 " getxattrs path\n"
21323 #: ../fish/guestfish-actions.pod:1458
21324 msgid "See also: L</lgetxattrs>, L<attr(5)>."
21328 #: ../fish/guestfish-actions.pod:1460
21329 msgid "glob-expand"
21333 #: ../fish/guestfish-actions.pod:1462
21336 " glob-expand pattern\n"
21341 #: ../fish/guestfish-actions.pod:1475
21346 #: ../fish/guestfish-actions.pod:1477
21349 " grep regex path\n"
21354 #: ../fish/guestfish-actions.pod:1485
21359 #: ../fish/guestfish-actions.pod:1487
21362 " grepi regex path\n"
21367 #: ../fish/guestfish-actions.pod:1495
21368 msgid "grub-install"
21372 #: ../fish/guestfish-actions.pod:1497
21375 " grub-install root device\n"
21380 #: ../fish/guestfish-actions.pod:1513
21385 #: ../fish/guestfish-actions.pod:1515
21393 #: ../fish/guestfish-actions.pod:1523
21398 #: ../fish/guestfish-actions.pod:1525
21401 " head-n nrlines path\n"
21406 #: ../fish/guestfish-actions.pod:1538
21411 #: ../fish/guestfish-actions.pod:1540
21419 #: ../fish/guestfish-actions.pod:1548
21424 #: ../fish/guestfish-actions.pod:1550
21427 " initrd-cat initrdpath filename\n"
21432 #: ../fish/guestfish-actions.pod:1562
21433 msgid "See also L</initrd-list>."
21437 #: ../fish/guestfish-actions.pod:1567
21438 msgid "initrd-list"
21442 #: ../fish/guestfish-actions.pod:1569
21445 " initrd-list path\n"
21450 #: ../fish/guestfish-actions.pod:1581
21451 msgid "inotify-add-watch"
21455 #: ../fish/guestfish-actions.pod:1583
21458 " inotify-add-watch path mask\n"
21463 #: ../fish/guestfish-actions.pod:1595
21464 msgid "inotify-close"
21468 #: ../fish/guestfish-actions.pod:1597
21476 #: ../fish/guestfish-actions.pod:1603
21477 msgid "inotify-files"
21481 #: ../fish/guestfish-actions.pod:1605
21489 #: ../fish/guestfish-actions.pod:1607
21491 "This function is a helpful wrapper around L</inotify-read> which just "
21492 "returns a list of pathnames of objects that were touched. The returned "
21493 "pathnames are sorted and deduplicated."
21497 #: ../fish/guestfish-actions.pod:1611
21498 msgid "inotify-init"
21502 #: ../fish/guestfish-actions.pod:1613
21505 " inotify-init maxevents\n"
21510 #: ../fish/guestfish-actions.pod:1619
21512 "C<maxevents> is the maximum number of events which will be queued up between "
21513 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21514 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21515 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21516 "but records the fact that it threw them away by setting a flag "
21517 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21521 #: ../fish/guestfish-actions.pod:1629
21523 "Before any events are generated, you have to add some watches to the "
21524 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21525 "L</inotify-watch-all>."
21529 #: ../fish/guestfish-actions.pod:1635
21531 "Queued up events should be read periodically by calling L</inotify-read> (or "
21532 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21533 "If you don't read the events out often enough then you risk the internal "
21534 "queue overflowing."
21538 #: ../fish/guestfish-actions.pod:1642
21540 "The handle should be closed after use by calling L</inotify-close>. This "
21541 "also removes any watches automatically."
21545 #: ../fish/guestfish-actions.pod:1651
21546 msgid "inotify-read"
21550 #: ../fish/guestfish-actions.pod:1653
21558 #: ../fish/guestfish-actions.pod:1666
21559 msgid "inotify-rm-watch"
21563 #: ../fish/guestfish-actions.pod:1668
21566 " inotify-rm-watch wd\n"
21571 #: ../fish/guestfish-actions.pod:1670
21572 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21576 #: ../fish/guestfish-actions.pod:1673
21577 msgid "inspect-get-arch"
21581 #: ../fish/guestfish-actions.pod:1675
21584 " inspect-get-arch root\n"
21589 #: ../fish/guestfish-actions.pod:1677 ../fish/guestfish-actions.pod:1693
21590 #: ../fish/guestfish-actions.pod:1767 ../fish/guestfish-actions.pod:1785
21591 #: ../fish/guestfish-actions.pod:1800 ../fish/guestfish-actions.pod:1821
21592 #: ../fish/guestfish-actions.pod:1836 ../fish/guestfish-actions.pod:1859
21593 #: ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:1905
21594 #: ../fish/guestfish-actions.pod:1935 ../fish/guestfish-actions.pod:1970
21595 #: ../fish/guestfish-actions.pod:1986
21597 "This function should only be called with a root device string as returned by "
21602 #: ../fish/guestfish-actions.pod:1680
21604 "This returns the architecture of the inspected operating system. The "
21605 "possible return values are listed under L</file-architecture>."
21609 #: ../fish/guestfish-actions.pod:1689
21610 msgid "inspect-get-distro"
21614 #: ../fish/guestfish-actions.pod:1691
21617 " inspect-get-distro root\n"
21622 #: ../fish/guestfish-actions.pod:1763
21623 msgid "inspect-get-filesystems"
21627 #: ../fish/guestfish-actions.pod:1765
21630 " inspect-get-filesystems root\n"
21635 #: ../fish/guestfish-actions.pod:1778
21637 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21638 "get-mountpoints>."
21642 #: ../fish/guestfish-actions.pod:1781
21643 msgid "inspect-get-hostname"
21647 #: ../fish/guestfish-actions.pod:1783
21650 " inspect-get-hostname root\n"
21655 #: ../fish/guestfish-actions.pod:1796
21656 msgid "inspect-get-major-version"
21660 #: ../fish/guestfish-actions.pod:1798
21663 " inspect-get-major-version root\n"
21668 #: ../fish/guestfish-actions.pod:1817
21669 msgid "inspect-get-minor-version"
21673 #: ../fish/guestfish-actions.pod:1819
21676 " inspect-get-minor-version root\n"
21681 #: ../fish/guestfish-actions.pod:1829
21683 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21684 "get-major-version>."
21688 #: ../fish/guestfish-actions.pod:1832
21689 msgid "inspect-get-mountpoints"
21693 #: ../fish/guestfish-actions.pod:1834
21696 " inspect-get-mountpoints root\n"
21701 #: ../fish/guestfish-actions.pod:1852
21703 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21704 "get-filesystems>."
21708 #: ../fish/guestfish-actions.pod:1855
21709 msgid "inspect-get-package-format"
21713 #: ../fish/guestfish-actions.pod:1857
21716 " inspect-get-package-format root\n"
21721 #: ../fish/guestfish-actions.pod:1862
21723 "This function and L</inspect-get-package-management> return the package "
21724 "format and package management tool used by the inspected operating system. "
21725 "For example for Fedora these functions would return C<rpm> (package format) "
21726 "and C<yum> (package management)."
21730 #: ../fish/guestfish-actions.pod:1877
21731 msgid "inspect-get-package-management"
21735 #: ../fish/guestfish-actions.pod:1879
21738 " inspect-get-package-management root\n"
21743 #: ../fish/guestfish-actions.pod:1884
21745 "L</inspect-get-package-format> and this function return the package format "
21746 "and package management tool used by the inspected operating system. For "
21747 "example for Fedora these functions would return C<rpm> (package format) and "
21748 "C<yum> (package management)."
21752 #: ../fish/guestfish-actions.pod:1901
21753 msgid "inspect-get-product-name"
21757 #: ../fish/guestfish-actions.pod:1903
21760 " inspect-get-product-name root\n"
21765 #: ../fish/guestfish-actions.pod:1918
21766 msgid "inspect-get-roots"
21770 #: ../fish/guestfish-actions.pod:1920
21773 " inspect-get-roots\n"
21778 #: ../fish/guestfish-actions.pod:1922
21780 "This function is a convenient way to get the list of root devices, as "
21781 "returned from a previous call to L</inspect-os>, but without redoing the "
21782 "whole inspection process."
21786 #: ../fish/guestfish-actions.pod:1926
21788 "This returns an empty list if either no root devices were found or the "
21789 "caller has not called L</inspect-os>."
21793 #: ../fish/guestfish-actions.pod:1931
21794 msgid "inspect-get-type"
21798 #: ../fish/guestfish-actions.pod:1933
21801 " inspect-get-type root\n"
21806 #: ../fish/guestfish-actions.pod:1966
21807 msgid "inspect-get-windows-systemroot"
21811 #: ../fish/guestfish-actions.pod:1968
21814 " inspect-get-windows-systemroot root\n"
21819 #: ../fish/guestfish-actions.pod:1982
21820 msgid "inspect-list-applications"
21824 #: ../fish/guestfish-actions.pod:1984
21827 " inspect-list-applications root\n"
21832 #: ../fish/guestfish-actions.pod:1991
21834 "I<Note:> This call works differently from other parts of the inspection "
21835 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21836 "then mount up the disks, before calling this. Listing applications is a "
21837 "significantly more difficult operation which requires access to the full "
21838 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21839 "are just returning data cached in the libguestfs handle, this call actually "
21840 "reads parts of the mounted filesystems during the call."
21844 #: ../fish/guestfish-actions.pod:2081
21849 #: ../fish/guestfish-actions.pod:2083
21857 #: ../fish/guestfish-actions.pod:2098
21859 "You can pass the root string(s) returned to other L</inspect-get-*> "
21860 "functions in order to query further information about each operating system, "
21861 "such as the name and version."
21865 #: ../fish/guestfish-actions.pod:2103
21867 "This function uses other libguestfs features such as L</mount-ro> and L</"
21868 "umount-all> in order to mount and unmount filesystems and look at the "
21869 "contents. This should be called with no disks currently mounted. The "
21870 "function may also use Augeas, so any existing Augeas handle will be closed."
21874 #: ../fish/guestfish-actions.pod:2115 ../fish/guestfish-actions.pod:2291
21875 #: ../fish/guestfish-actions.pod:2337
21876 msgid "See also L</list-filesystems>."
21880 #: ../fish/guestfish-actions.pod:2117
21881 msgid "is-blockdev"
21885 #: ../fish/guestfish-actions.pod:2119
21888 " is-blockdev path\n"
21893 #: ../fish/guestfish-actions.pod:2124 ../fish/guestfish-actions.pod:2142
21894 #: ../fish/guestfish-actions.pod:2161 ../fish/guestfish-actions.pod:2170
21895 #: ../fish/guestfish-actions.pod:2180 ../fish/guestfish-actions.pod:2214
21896 #: ../fish/guestfish-actions.pod:2223
21897 msgid "See also L</stat>."
21901 #: ../fish/guestfish-actions.pod:2126
21906 #: ../fish/guestfish-actions.pod:2128
21914 #: ../fish/guestfish-actions.pod:2135
21919 #: ../fish/guestfish-actions.pod:2137
21922 " is-chardev path\n"
21927 #: ../fish/guestfish-actions.pod:2144
21932 #: ../fish/guestfish-actions.pod:2146
21940 #: ../fish/guestfish-actions.pod:2153
21945 #: ../fish/guestfish-actions.pod:2155
21953 #: ../fish/guestfish-actions.pod:2163
21958 #: ../fish/guestfish-actions.pod:2165
21966 #: ../fish/guestfish-actions.pod:2172
21971 #: ../fish/guestfish-actions.pod:2174
21979 #: ../fish/guestfish-actions.pod:2182
21980 msgid "is-launching"
21984 #: ../fish/guestfish-actions.pod:2184
21992 #: ../fish/guestfish-actions.pod:2191
21997 #: ../fish/guestfish-actions.pod:2193
22005 #: ../fish/guestfish-actions.pod:2198
22010 #: ../fish/guestfish-actions.pod:2200
22018 #: ../fish/guestfish-actions.pod:2207
22023 #: ../fish/guestfish-actions.pod:2209
22026 " is-socket path\n"
22031 #: ../fish/guestfish-actions.pod:2216
22036 #: ../fish/guestfish-actions.pod:2218
22039 " is-symlink path\n"
22044 #: ../fish/guestfish-actions.pod:2225
22045 msgid "kill-subprocess"
22049 #: ../fish/guestfish-actions.pod:2227
22052 " kill-subprocess\n"
22057 #: ../fish/guestfish-actions.pod:2231
22062 #: ../fish/guestfish-actions.pod:2233
22067 #: ../fish/guestfish-actions.pod:2235
22075 #: ../fish/guestfish-actions.pod:2243
22080 #: ../fish/guestfish-actions.pod:2245
22083 " lchown owner group path\n"
22088 #: ../fish/guestfish-actions.pod:2247
22090 "Change the file owner to C<owner> and group to C<group>. This is like L</"
22091 "chown> but if C<path> is a symlink then the link itself is changed, not the "
22096 #: ../fish/guestfish-actions.pod:2255
22101 #: ../fish/guestfish-actions.pod:2257
22104 " lgetxattr path name\n"
22109 #: ../fish/guestfish-actions.pod:2273
22110 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
22114 #: ../fish/guestfish-actions.pod:2275
22119 #: ../fish/guestfish-actions.pod:2277
22122 " lgetxattrs path\n"
22127 #: ../fish/guestfish-actions.pod:2279
22129 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
22130 "it returns the extended attributes of the link itself."
22134 #: ../fish/guestfish-actions.pod:2283
22135 msgid "list-devices"
22139 #: ../fish/guestfish-actions.pod:2285
22147 #: ../fish/guestfish-actions.pod:2293
22148 msgid "list-filesystems"
22152 #: ../fish/guestfish-actions.pod:2295
22155 " list-filesystems\n"
22160 #: ../fish/guestfish-actions.pod:2314
22162 "This command runs other libguestfs commands, which might include L</mount> "
22163 "and L</umount>, and therefore you should use this soon after launch and only "
22164 "when nothing is mounted."
22168 #: ../fish/guestfish-actions.pod:2318
22170 "Not all of the filesystems returned will be mountable. In particular, swap "
22171 "partitions are returned in the list. Also this command does not check that "
22172 "each filesystem found is valid and mountable, and some filesystems might be "
22173 "mountable but require special options. Filesystems may not all belong to a "
22174 "single logical operating system (use L</inspect-os> to look for OSes)."
22178 #: ../fish/guestfish-actions.pod:2326
22179 msgid "list-partitions"
22183 #: ../fish/guestfish-actions.pod:2328
22186 " list-partitions\n"
22191 #: ../fish/guestfish-actions.pod:2334
22193 "This does not return logical volumes. For that you will need to call L</"
22198 #: ../fish/guestfish-actions.pod:2339
22203 #: ../fish/guestfish-actions.pod:2341
22211 #: ../fish/guestfish-actions.pod:2349
22216 #: ../fish/guestfish-actions.pod:2351
22219 " ln target linkname\n"
22224 #: ../fish/guestfish-actions.pod:2355
22229 #: ../fish/guestfish-actions.pod:2357
22232 " ln-f target linkname\n"
22237 #: ../fish/guestfish-actions.pod:2362
22242 #: ../fish/guestfish-actions.pod:2364
22245 " ln-s target linkname\n"
22250 #: ../fish/guestfish-actions.pod:2368
22255 #: ../fish/guestfish-actions.pod:2370
22258 " ln-sf target linkname\n"
22263 #: ../fish/guestfish-actions.pod:2375
22264 msgid "lremovexattr"
22268 #: ../fish/guestfish-actions.pod:2377
22271 " lremovexattr xattr path\n"
22276 #: ../fish/guestfish-actions.pod:2379
22278 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
22279 "it removes an extended attribute of the link itself."
22283 #: ../fish/guestfish-actions.pod:2383
22288 #: ../fish/guestfish-actions.pod:2385
22296 #: ../fish/guestfish-actions.pod:2391
22298 "This command is mostly useful for interactive sessions. Programs should "
22299 "probably use L</readdir> instead."
22303 #: ../fish/guestfish-actions.pod:2394
22308 #: ../fish/guestfish-actions.pod:2396
22311 " lsetxattr xattr val vallen path\n"
22316 #: ../fish/guestfish-actions.pod:2398
22318 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
22319 "sets an extended attribute of the link itself."
22323 #: ../fish/guestfish-actions.pod:2402
22328 #: ../fish/guestfish-actions.pod:2404
22336 #: ../fish/guestfish-actions.pod:2408
22338 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
22339 "the link is stat-ed, not the file it refers to."
22343 #: ../fish/guestfish-actions.pod:2414
22348 #: ../fish/guestfish-actions.pod:2416
22351 " lstatlist path 'names ...'\n"
22356 #: ../fish/guestfish-actions.pod:2418
22358 "This call allows you to perform the L</lstat> operation on multiple files, "
22359 "where all files are in the directory C<path>. C<names> is the list of files "
22360 "from this directory."
22364 #: ../fish/guestfish-actions.pod:2427
22366 "This call is intended for programs that want to efficiently list a directory "
22367 "contents without making many round-trips. See also L</lxattrlist> for a "
22368 "similarly efficient call for getting extended attributes. Very long "
22369 "directory listings might cause the protocol message size to be exceeded, "
22370 "causing this call to fail. The caller must split up such requests into "
22371 "smaller groups of names."
22375 #: ../fish/guestfish-actions.pod:2435
22376 msgid "luks-add-key"
22380 #: ../fish/guestfish-actions.pod:2437
22383 " luks-add-key device keyslot\n"
22388 #: ../fish/guestfish-actions.pod:2444
22390 "Note that if C<keyslot> already contains a key, then this command will "
22391 "fail. You have to use L</luks-kill-slot> first to remove that key."
22395 #: ../fish/guestfish-actions.pod:2448 ../fish/guestfish-actions.pod:2470
22396 #: ../fish/guestfish-actions.pod:2483 ../fish/guestfish-actions.pod:2497
22397 #: ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2530
22399 "This command has one or more key or passphrase parameters. Guestfish will "
22400 "prompt for these separately."
22404 #: ../fish/guestfish-actions.pod:2451
22409 #: ../fish/guestfish-actions.pod:2453
22412 " luks-close device\n"
22417 #: ../fish/guestfish-actions.pod:2455
22419 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
22420 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
22421 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
22426 #: ../fish/guestfish-actions.pod:2461
22427 msgid "luks-format"
22431 #: ../fish/guestfish-actions.pod:2463
22434 " luks-format device keyslot\n"
22439 #: ../fish/guestfish-actions.pod:2476
22440 msgid "luks-format-cipher"
22444 #: ../fish/guestfish-actions.pod:2478
22447 " luks-format-cipher device keyslot cipher\n"
22452 #: ../fish/guestfish-actions.pod:2480
22454 "This command is the same as L</luks-format> but it also allows you to set "
22455 "the C<cipher> used."
22459 #: ../fish/guestfish-actions.pod:2489
22460 msgid "luks-kill-slot"
22464 #: ../fish/guestfish-actions.pod:2491
22467 " luks-kill-slot device keyslot\n"
22472 #: ../fish/guestfish-actions.pod:2500
22477 #: ../fish/guestfish-actions.pod:2502
22480 " luks-open device mapname\n"
22485 #: ../fish/guestfish-actions.pod:2516
22487 "If this block device contains LVM volume groups, then calling L</vgscan> "
22488 "followed by L</vg-activate-all> will make them visible."
22492 #: ../fish/guestfish-actions.pod:2523
22493 msgid "luks-open-ro"
22497 #: ../fish/guestfish-actions.pod:2525
22500 " luks-open-ro device mapname\n"
22505 #: ../fish/guestfish-actions.pod:2527
22507 "This is the same as L</luks-open> except that a read-only mapping is created."
22511 #: ../fish/guestfish-actions.pod:2533
22516 #: ../fish/guestfish-actions.pod:2535
22519 " lvcreate logvol volgroup mbytes\n"
22524 #: ../fish/guestfish-actions.pod:2540
22525 msgid "lvm-canonical-lv-name"
22529 #: ../fish/guestfish-actions.pod:2542
22532 " lvm-canonical-lv-name lvname\n"
22537 #: ../fish/guestfish-actions.pod:2551
22538 msgid "See also L</is-lv>."
22542 #: ../fish/guestfish-actions.pod:2553
22543 msgid "lvm-clear-filter"
22547 #: ../fish/guestfish-actions.pod:2555
22550 " lvm-clear-filter\n"
22555 #: ../fish/guestfish-actions.pod:2557
22557 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22562 #: ../fish/guestfish-actions.pod:2563
22563 msgid "lvm-remove-all"
22567 #: ../fish/guestfish-actions.pod:2565
22570 " lvm-remove-all\n"
22575 #: ../fish/guestfish-actions.pod:2573
22576 msgid "lvm-set-filter"
22580 #: ../fish/guestfish-actions.pod:2575
22583 " lvm-set-filter 'devices ...'\n"
22588 #: ../fish/guestfish-actions.pod:2600
22593 #: ../fish/guestfish-actions.pod:2602
22596 " lvremove device\n"
22601 #: ../fish/guestfish-actions.pod:2610
22606 #: ../fish/guestfish-actions.pod:2612
22609 " lvrename logvol newlogvol\n"
22614 #: ../fish/guestfish-actions.pod:2616
22619 #: ../fish/guestfish-actions.pod:2618
22622 " lvresize device mbytes\n"
22627 #: ../fish/guestfish-actions.pod:2624
22628 msgid "lvresize-free"
22632 #: ../fish/guestfish-actions.pod:2626
22635 " lvresize-free lv percent\n"
22640 #: ../fish/guestfish-actions.pod:2634
22645 #: ../fish/guestfish-actions.pod:2636
22653 #: ../fish/guestfish-actions.pod:2644
22654 msgid "See also L</lvs-full>, L</list-filesystems>."
22658 #: ../fish/guestfish-actions.pod:2646
22663 #: ../fish/guestfish-actions.pod:2648
22671 #: ../fish/guestfish-actions.pod:2653
22676 #: ../fish/guestfish-actions.pod:2655
22684 #: ../fish/guestfish-actions.pod:2659
22689 #: ../fish/guestfish-actions.pod:2661
22692 " lxattrlist path 'names ...'\n"
22697 #: ../fish/guestfish-actions.pod:2677
22699 "This call is intended for programs that want to efficiently list a directory "
22700 "contents without making many round-trips. See also L</lstatlist> for a "
22701 "similarly efficient call for getting standard stats. Very long directory "
22702 "listings might cause the protocol message size to be exceeded, causing this "
22703 "call to fail. The caller must split up such requests into smaller groups of "
22708 #: ../fish/guestfish-actions.pod:2685
22713 #: ../fish/guestfish-actions.pod:2687
22721 #: ../fish/guestfish-actions.pod:2691
22726 #: ../fish/guestfish-actions.pod:2693
22729 " mkdir-mode path mode\n"
22734 #: ../fish/guestfish-actions.pod:2702
22735 msgid "See also L</mkdir>, L</umask>"
22739 #: ../fish/guestfish-actions.pod:2704
22744 #: ../fish/guestfish-actions.pod:2706
22752 #: ../fish/guestfish-actions.pod:2711
22757 #: ../fish/guestfish-actions.pod:2713
22760 " mkdtemp template\n"
22765 #: ../fish/guestfish-actions.pod:2734
22770 #: ../fish/guestfish-actions.pod:2736
22773 " mke2fs-J fstype blocksize device journal\n"
22778 #: ../fish/guestfish-actions.pod:2744
22779 msgid "See also L</mke2journal>."
22783 #: ../fish/guestfish-actions.pod:2746
22788 #: ../fish/guestfish-actions.pod:2748
22791 " mke2fs-JL fstype blocksize device label\n"
22796 #: ../fish/guestfish-actions.pod:2753
22797 msgid "See also L</mke2journal-L>."
22801 #: ../fish/guestfish-actions.pod:2755
22806 #: ../fish/guestfish-actions.pod:2757
22809 " mke2fs-JU fstype blocksize device uuid\n"
22814 #: ../fish/guestfish-actions.pod:2762
22815 msgid "See also L</mke2journal-U>."
22819 #: ../fish/guestfish-actions.pod:2764
22820 msgid "mke2journal"
22824 #: ../fish/guestfish-actions.pod:2766
22827 " mke2journal blocksize device\n"
22832 #: ../fish/guestfish-actions.pod:2773
22833 msgid "mke2journal-L"
22837 #: ../fish/guestfish-actions.pod:2775
22840 " mke2journal-L blocksize label device\n"
22845 #: ../fish/guestfish-actions.pod:2779
22846 msgid "mke2journal-U"
22850 #: ../fish/guestfish-actions.pod:2781
22853 " mke2journal-U blocksize uuid device\n"
22858 #: ../fish/guestfish-actions.pod:2785
22863 #: ../fish/guestfish-actions.pod:2787
22866 " mkfifo mode path\n"
22871 #: ../fish/guestfish-actions.pod:2789
22873 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22874 "is just a convenient wrapper around L</mknod>."
22878 #: ../fish/guestfish-actions.pod:2795
22883 #: ../fish/guestfish-actions.pod:2797
22886 " mkfs fstype device\n"
22891 #: ../fish/guestfish-actions.pod:2803
22896 #: ../fish/guestfish-actions.pod:2805
22899 " mkfs-b fstype blocksize device\n"
22904 #: ../fish/guestfish-actions.pod:2807
22906 "This call is similar to L</mkfs>, but it allows you to control the block "
22907 "size of the resulting filesystem. Supported block sizes depend on the "
22908 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22912 #: ../fish/guestfish-actions.pod:2822
22917 #: ../fish/guestfish-actions.pod:2824
22920 " mkfs-opts fstype device [blocksize:..]\n"
22925 #: ../fish/guestfish-actions.pod:2846
22926 msgid "mkmountpoint"
22930 #: ../fish/guestfish-actions.pod:2848
22933 " mkmountpoint exemptpath\n"
22938 #: ../fish/guestfish-actions.pod:2850
22940 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22941 "to create extra mountpoints before mounting the first filesystem."
22945 #: ../fish/guestfish-actions.pod:2874
22947 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22948 "unexpected errors if you try to mix these calls. It is safest to manually "
22949 "unmount filesystems and remove mountpoints after use."
22953 #: ../fish/guestfish-actions.pod:2878
22955 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22956 "for this to work for manual mountpoints, you must ensure that the innermost "
22957 "mountpoints have the longest pathnames, as in the example code above."
22961 #: ../fish/guestfish-actions.pod:2885
22963 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22964 "that L</umount-all> is called when the handle is closed which can also "
22965 "trigger these issues."
22969 #: ../fish/guestfish-actions.pod:2889
22974 #: ../fish/guestfish-actions.pod:2891
22977 " mknod mode devmajor devminor path\n"
22982 #: ../fish/guestfish-actions.pod:2901
22984 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22985 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22986 "regular file). These constants are available in the standard Linux header "
22987 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22988 "wrappers around this command which bitwise OR in the appropriate constant "
22993 #: ../fish/guestfish-actions.pod:2911
22998 #: ../fish/guestfish-actions.pod:2913
23001 " mknod-b mode devmajor devminor path\n"
23006 #: ../fish/guestfish-actions.pod:2915
23008 "This call creates a block device node called C<path> with mode C<mode> and "
23009 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23010 "wrapper around L</mknod>."
23014 #: ../fish/guestfish-actions.pod:2921
23019 #: ../fish/guestfish-actions.pod:2923
23022 " mknod-c mode devmajor devminor path\n"
23027 #: ../fish/guestfish-actions.pod:2925
23029 "This call creates a char device node called C<path> with mode C<mode> and "
23030 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
23031 "wrapper around L</mknod>."
23035 #: ../fish/guestfish-actions.pod:2931
23040 #: ../fish/guestfish-actions.pod:2933
23048 #: ../fish/guestfish-actions.pod:2937
23053 #: ../fish/guestfish-actions.pod:2939
23056 " mkswap-L label device\n"
23061 #: ../fish/guestfish-actions.pod:2947
23066 #: ../fish/guestfish-actions.pod:2949
23069 " mkswap-U uuid device\n"
23074 #: ../fish/guestfish-actions.pod:2953
23075 msgid "mkswap-file"
23079 #: ../fish/guestfish-actions.pod:2955
23082 " mkswap-file path\n"
23087 #: ../fish/guestfish-actions.pod:2959
23089 "This command just writes a swap file signature to an existing file. To "
23090 "create the file itself, use something like L</fallocate>."
23094 #: ../fish/guestfish-actions.pod:2962
23099 #: ../fish/guestfish-actions.pod:2964
23102 " modprobe modulename\n"
23107 #: ../fish/guestfish-actions.pod:2971
23112 #: ../fish/guestfish-actions.pod:2973
23115 " mount device mountpoint\n"
23120 #: ../fish/guestfish-actions.pod:2989
23122 "B<Important note:> When you use this call, the filesystem options C<sync> "
23123 "and C<noatime> are set implicitly. This was originally done because we "
23124 "thought it would improve reliability, but it turns out that I<-o sync> has a "
23125 "very large negative performance impact and negligible effect on "
23126 "reliability. Therefore we recommend that you avoid using L</mount> in any "
23127 "code that needs performance, and instead use L</mount-options> (use an empty "
23128 "string for the first parameter if you don't want any options)."
23132 #: ../fish/guestfish-actions.pod:2999
23137 #: ../fish/guestfish-actions.pod:3001
23140 " mount-loop file mountpoint\n"
23145 #: ../fish/guestfish-actions.pod:3007
23146 msgid "mount-options"
23150 #: ../fish/guestfish-actions.pod:3009
23153 " mount-options options device mountpoint\n"
23158 #: ../fish/guestfish-actions.pod:3011
23160 "This is the same as the L</mount> command, but it allows you to set the "
23161 "mount options as for the L<mount(8)> I<-o> flag."
23165 #: ../fish/guestfish-actions.pod:3019
23170 #: ../fish/guestfish-actions.pod:3021
23173 " mount-ro device mountpoint\n"
23178 #: ../fish/guestfish-actions.pod:3023
23180 "This is the same as the L</mount> command, but it mounts the filesystem with "
23181 "the read-only (I<-o ro>) flag."
23185 #: ../fish/guestfish-actions.pod:3026
23190 #: ../fish/guestfish-actions.pod:3028
23193 " mount-vfs options vfstype device mountpoint\n"
23198 #: ../fish/guestfish-actions.pod:3030
23200 "This is the same as the L</mount> command, but it allows you to set both the "
23201 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
23205 #: ../fish/guestfish-actions.pod:3034
23206 msgid "mountpoints"
23210 #: ../fish/guestfish-actions.pod:3036
23218 #: ../fish/guestfish-actions.pod:3038
23220 "This call is similar to L</mounts>. That call returns a list of devices. "
23221 "This one returns a hash table (map) of device name to directory where the "
23222 "device is mounted."
23226 #: ../fish/guestfish-actions.pod:3042
23231 #: ../fish/guestfish-actions.pod:3044
23239 #: ../fish/guestfish-actions.pod:3051
23240 msgid "See also: L</mountpoints>"
23244 #: ../fish/guestfish-actions.pod:3053
23249 #: ../fish/guestfish-actions.pod:3055
23257 #: ../fish/guestfish-actions.pod:3060
23258 msgid "ntfs-3g-probe"
23262 #: ../fish/guestfish-actions.pod:3062
23265 " ntfs-3g-probe true|false device\n"
23270 #: ../fish/guestfish-actions.pod:3076
23275 #: ../fish/guestfish-actions.pod:3078
23278 " ntfsresize device\n"
23283 #: ../fish/guestfish-actions.pod:3084
23284 msgid "ntfsresize-size"
23288 #: ../fish/guestfish-actions.pod:3086
23291 " ntfsresize-size device size\n"
23296 #: ../fish/guestfish-actions.pod:3088
23298 "This command is the same as L</ntfsresize> except that it allows you to "
23299 "specify the new size (in bytes) explicitly."
23303 #: ../fish/guestfish-actions.pod:3091
23308 #: ../fish/guestfish-actions.pod:3093
23311 " part-add device prlogex startsect endsect\n"
23316 #: ../fish/guestfish-actions.pod:3095
23318 "This command adds a partition to C<device>. If there is no partition table "
23319 "on the device, call L</part-init> first."
23323 #: ../fish/guestfish-actions.pod:3107
23325 "Creating a partition which covers the whole disk is not so easy. Use L</"
23326 "part-disk> to do that."
23330 #: ../fish/guestfish-actions.pod:3110
23335 #: ../fish/guestfish-actions.pod:3112
23338 " part-del device partnum\n"
23343 #: ../fish/guestfish-actions.pod:3120
23348 #: ../fish/guestfish-actions.pod:3122
23351 " part-disk device parttype\n"
23356 #: ../fish/guestfish-actions.pod:3124
23358 "This command is simply a combination of L</part-init> followed by L</part-"
23359 "add> to create a single primary partition covering the whole disk."
23363 #: ../fish/guestfish-actions.pod:3128
23365 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
23366 "possible values are described in L</part-init>."
23370 #: ../fish/guestfish-actions.pod:3134
23371 msgid "part-get-bootable"
23375 #: ../fish/guestfish-actions.pod:3136
23378 " part-get-bootable device partnum\n"
23383 #: ../fish/guestfish-actions.pod:3141
23384 msgid "See also L</part-set-bootable>."
23388 #: ../fish/guestfish-actions.pod:3143
23389 msgid "part-get-mbr-id"
23393 #: ../fish/guestfish-actions.pod:3145
23396 " part-get-mbr-id device partnum\n"
23401 #: ../fish/guestfish-actions.pod:3150 ../fish/guestfish-actions.pod:3288
23403 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
23404 "undefined results for other partition table types (see L</part-get-"
23409 #: ../fish/guestfish-actions.pod:3154
23410 msgid "part-get-parttype"
23414 #: ../fish/guestfish-actions.pod:3156
23417 " part-get-parttype device\n"
23422 #: ../fish/guestfish-actions.pod:3161
23424 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
23425 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
23426 "possible, although unusual. See L</part-init> for a full list."
23430 #: ../fish/guestfish-actions.pod:3166
23435 #: ../fish/guestfish-actions.pod:3168
23438 " part-init device parttype\n"
23443 #: ../fish/guestfish-actions.pod:3174
23445 "Initially there are no partitions. Following this, you should call L</part-"
23446 "add> for each partition required."
23450 #: ../fish/guestfish-actions.pod:3237
23455 #: ../fish/guestfish-actions.pod:3239
23458 " part-list device\n"
23463 #: ../fish/guestfish-actions.pod:3254
23465 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23466 "the device's sector size, see L</blockdev-getss>."
23470 #: ../fish/guestfish-actions.pod:3267
23471 msgid "part-set-bootable"
23475 #: ../fish/guestfish-actions.pod:3269
23478 " part-set-bootable device partnum true|false\n"
23483 #: ../fish/guestfish-actions.pod:3278
23484 msgid "part-set-mbr-id"
23488 #: ../fish/guestfish-actions.pod:3280
23491 " part-set-mbr-id device partnum idbyte\n"
23496 #: ../fish/guestfish-actions.pod:3292
23497 msgid "part-set-name"
23501 #: ../fish/guestfish-actions.pod:3294
23504 " part-set-name device partnum name\n"
23509 #: ../fish/guestfish-actions.pod:3302
23510 msgid "part-to-dev"
23514 #: ../fish/guestfish-actions.pod:3304
23517 " part-to-dev partition\n"
23522 #: ../fish/guestfish-actions.pod:3310
23524 "The named partition must exist, for example as a string returned from L</"
23525 "list-partitions>."
23529 #: ../fish/guestfish-actions.pod:3313
23530 msgid "ping-daemon"
23534 #: ../fish/guestfish-actions.pod:3315
23542 #: ../fish/guestfish-actions.pod:3322
23547 #: ../fish/guestfish-actions.pod:3324
23550 " pread path count offset\n"
23555 #: ../fish/guestfish-actions.pod:3332
23556 msgid "See also L</pwrite>, L</pread-device>."
23560 #: ../fish/guestfish-actions.pod:3337
23561 msgid "pread-device"
23565 #: ../fish/guestfish-actions.pod:3339
23568 " pread-device device count offset\n"
23573 #: ../fish/guestfish-actions.pod:3347
23574 msgid "See also L</pread>."
23578 #: ../fish/guestfish-actions.pod:3352
23583 #: ../fish/guestfish-actions.pod:3354
23586 " pvcreate device\n"
23591 #: ../fish/guestfish-actions.pod:3360
23596 #: ../fish/guestfish-actions.pod:3362
23599 " pvremove device\n"
23604 #: ../fish/guestfish-actions.pod:3371
23609 #: ../fish/guestfish-actions.pod:3373
23612 " pvresize device\n"
23617 #: ../fish/guestfish-actions.pod:3378
23618 msgid "pvresize-size"
23622 #: ../fish/guestfish-actions.pod:3380
23625 " pvresize-size device size\n"
23630 #: ../fish/guestfish-actions.pod:3382
23632 "This command is the same as L</pvresize> except that it allows you to "
23633 "specify the new size (in bytes) explicitly."
23637 #: ../fish/guestfish-actions.pod:3385
23642 #: ../fish/guestfish-actions.pod:3387
23650 #: ../fish/guestfish-actions.pod:3395
23651 msgid "See also L</pvs-full>."
23655 #: ../fish/guestfish-actions.pod:3397
23660 #: ../fish/guestfish-actions.pod:3399
23668 #: ../fish/guestfish-actions.pod:3404
23673 #: ../fish/guestfish-actions.pod:3406
23681 #: ../fish/guestfish-actions.pod:3410
23686 #: ../fish/guestfish-actions.pod:3412
23689 " pwrite path content offset\n"
23694 #: ../fish/guestfish-actions.pod:3423
23695 msgid "See also L</pread>, L</pwrite-device>."
23699 #: ../fish/guestfish-actions.pod:3428
23700 msgid "pwrite-device"
23704 #: ../fish/guestfish-actions.pod:3430
23707 " pwrite-device device content offset\n"
23712 #: ../fish/guestfish-actions.pod:3440
23713 msgid "See also L</pwrite>."
23717 #: ../fish/guestfish-actions.pod:3445
23722 #: ../fish/guestfish-actions.pod:3447
23725 " read-file path\n"
23730 #: ../fish/guestfish-actions.pod:3452
23732 "Unlike L</cat>, this function can correctly handle files that contain "
23733 "embedded ASCII NUL characters. However unlike L</download>, this function "
23734 "is limited in the total size of file that can be handled."
23738 #: ../fish/guestfish-actions.pod:3460
23743 #: ../fish/guestfish-actions.pod:3462
23746 " read-lines path\n"
23751 #: ../fish/guestfish-actions.pod:3469
23753 "Note that this function cannot correctly handle binary files (specifically, "
23754 "files containing C<\\0> character which is treated as end of line). For "
23755 "those you need to use the L</read-file> function which has a more complex "
23760 #: ../fish/guestfish-actions.pod:3474
23765 #: ../fish/guestfish-actions.pod:3476
23773 #: ../fish/guestfish-actions.pod:3528
23775 "This function is primarily intended for use by programs. To get a simple "
23776 "list of names, use L</ls>. To get a printable directory for human "
23777 "consumption, use L</ll>."
23781 #: ../fish/guestfish-actions.pod:3532
23786 #: ../fish/guestfish-actions.pod:3534
23794 #: ../fish/guestfish-actions.pod:3538
23795 msgid "readlinklist"
23799 #: ../fish/guestfish-actions.pod:3540
23802 " readlinklist path 'names ...'\n"
23807 #: ../fish/guestfish-actions.pod:3564
23812 #: ../fish/guestfish-actions.pod:3566
23820 #: ../fish/guestfish-actions.pod:3571
23821 msgid "removexattr"
23825 #: ../fish/guestfish-actions.pod:3573
23828 " removexattr xattr path\n"
23833 #: ../fish/guestfish-actions.pod:3578
23834 msgid "See also: L</lremovexattr>, L<attr(5)>."
23838 #: ../fish/guestfish-actions.pod:3580
23843 #: ../fish/guestfish-actions.pod:3582
23846 " resize2fs device\n"
23851 #: ../fish/guestfish-actions.pod:3587
23853 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23854 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23855 "gives an error about this and sometimes not. In any case, it is always safe "
23856 "to call L</e2fsck-f> before calling this function."
23860 #: ../fish/guestfish-actions.pod:3593
23861 msgid "resize2fs-size"
23865 #: ../fish/guestfish-actions.pod:3595
23868 " resize2fs-size device size\n"
23873 #: ../fish/guestfish-actions.pod:3597
23875 "This command is the same as L</resize2fs> except that it allows you to "
23876 "specify the new size (in bytes) explicitly."
23880 #: ../fish/guestfish-actions.pod:3600
23885 #: ../fish/guestfish-actions.pod:3602
23893 #: ../fish/guestfish-actions.pod:3606
23898 #: ../fish/guestfish-actions.pod:3608
23906 #: ../fish/guestfish-actions.pod:3614
23911 #: ../fish/guestfish-actions.pod:3616
23919 #: ../fish/guestfish-actions.pod:3620
23920 msgid "rmmountpoint"
23924 #: ../fish/guestfish-actions.pod:3622
23927 " rmmountpoint exemptpath\n"
23932 #: ../fish/guestfish-actions.pod:3624
23934 "This calls removes a mountpoint that was previously created with L</"
23935 "mkmountpoint>. See L</mkmountpoint> for full details."
23939 #: ../fish/guestfish-actions.pod:3628
23940 msgid "scrub-device"
23944 #: ../fish/guestfish-actions.pod:3630
23947 " scrub-device device\n"
23952 #: ../fish/guestfish-actions.pod:3641
23957 #: ../fish/guestfish-actions.pod:3643
23960 " scrub-file file\n"
23965 #: ../fish/guestfish-actions.pod:3653
23966 msgid "scrub-freespace"
23970 #: ../fish/guestfish-actions.pod:3655
23973 " scrub-freespace dir\n"
23978 #: ../fish/guestfish-actions.pod:3657
23980 "This command creates the directory C<dir> and then fills it with files until "
23981 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23982 "deletes them. The intention is to scrub any free space on the partition "
23983 "containing C<dir>."
23987 #: ../fish/guestfish-actions.pod:3666
23992 #: ../fish/guestfish-actions.pod:3668
23997 #: ../fish/guestfish-actions.pod:3670
24000 " set-append append\n"
24005 #: ../fish/guestfish-actions.pod:3681
24006 msgid "set-autosync"
24010 #: ../fish/guestfish-actions.pod:3683
24015 #: ../fish/guestfish-actions.pod:3685
24018 " set-autosync true|false\n"
24023 #: ../fish/guestfish-actions.pod:3687
24025 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
24026 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
24027 "closed (also if the program exits without closing handles)."
24031 #: ../fish/guestfish-actions.pod:3695
24036 #: ../fish/guestfish-actions.pod:3697
24041 #: ../fish/guestfish-actions.pod:3699
24044 " set-direct true|false\n"
24049 #: ../fish/guestfish-actions.pod:3705
24051 "One consequence of this is that log messages aren't caught by the library "
24052 "and handled by L</set-log-message-callback>, but go straight to stdout."
24056 #: ../fish/guestfish-actions.pod:3714
24057 msgid "set-e2label"
24061 #: ../fish/guestfish-actions.pod:3716
24064 " set-e2label device label\n"
24069 #: ../fish/guestfish-actions.pod:3722
24071 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
24072 "label on a filesystem."
24076 #: ../fish/guestfish-actions.pod:3725
24081 #: ../fish/guestfish-actions.pod:3727
24084 " set-e2uuid device uuid\n"
24089 #: ../fish/guestfish-actions.pod:3734
24091 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
24092 "UUID of a filesystem."
24096 #: ../fish/guestfish-actions.pod:3737
24097 msgid "set-memsize"
24101 #: ../fish/guestfish-actions.pod:3739
24106 #: ../fish/guestfish-actions.pod:3741
24109 " set-memsize memsize\n"
24114 #: ../fish/guestfish-actions.pod:3743
24116 "This sets the memory size in megabytes allocated to the qemu subprocess. "
24117 "This only has any effect if called before L</launch>."
24121 #: ../fish/guestfish-actions.pod:3754
24122 msgid "set-network"
24126 #: ../fish/guestfish-actions.pod:3756
24131 #: ../fish/guestfish-actions.pod:3758
24134 " set-network true|false\n"
24139 #: ../fish/guestfish-actions.pod:3766
24141 "You must call this before calling L</launch>, otherwise it has no effect."
24145 #: ../fish/guestfish-actions.pod:3769
24150 #: ../fish/guestfish-actions.pod:3771
24155 #: ../fish/guestfish-actions.pod:3773
24158 " set-path searchpath\n"
24163 #: ../fish/guestfish-actions.pod:3782
24168 #: ../fish/guestfish-actions.pod:3784
24173 #: ../fish/guestfish-actions.pod:3786
24181 #: ../fish/guestfish-actions.pod:3806
24182 msgid "set-recovery-proc"
24186 #: ../fish/guestfish-actions.pod:3808
24187 msgid "recovery-proc"
24191 #: ../fish/guestfish-actions.pod:3810
24194 " set-recovery-proc true|false\n"
24199 #: ../fish/guestfish-actions.pod:3812
24201 "If this is called with the parameter C<false> then L</launch> does not "
24202 "create a recovery process. The purpose of the recovery process is to stop "
24203 "runaway qemu processes in the case where the main program aborts abruptly."
24207 #: ../fish/guestfish-actions.pod:3817
24209 "This only has any effect if called before L</launch>, and the default is "
24214 #: ../fish/guestfish-actions.pod:3826
24215 msgid "set-selinux"
24219 #: ../fish/guestfish-actions.pod:3828
24224 #: ../fish/guestfish-actions.pod:3830
24227 " set-selinux true|false\n"
24232 #: ../fish/guestfish-actions.pod:3841
24237 #: ../fish/guestfish-actions.pod:3843
24242 #: ../fish/guestfish-actions.pod:3845
24245 " set-trace true|false\n"
24250 #: ../fish/guestfish-actions.pod:3861
24251 msgid "set-verbose"
24255 #: ../fish/guestfish-actions.pod:3863
24260 #: ../fish/guestfish-actions.pod:3865
24263 " set-verbose true|false\n"
24268 #: ../fish/guestfish-actions.pod:3872
24273 #: ../fish/guestfish-actions.pod:3874
24276 " setcon context\n"
24281 #: ../fish/guestfish-actions.pod:3881
24286 #: ../fish/guestfish-actions.pod:3883
24289 " setxattr xattr val vallen path\n"
24294 #: ../fish/guestfish-actions.pod:3889
24295 msgid "See also: L</lsetxattr>, L<attr(5)>."
24299 #: ../fish/guestfish-actions.pod:3891
24304 #: ../fish/guestfish-actions.pod:3893
24307 " sfdisk device cyls heads sectors 'lines ...'\n"
24312 #: ../fish/guestfish-actions.pod:3915
24313 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
24317 #: ../fish/guestfish-actions.pod:3921
24322 #: ../fish/guestfish-actions.pod:3923
24325 " sfdiskM device 'lines ...'\n"
24330 #: ../fish/guestfish-actions.pod:3925
24332 "This is a simplified interface to the L</sfdisk> command, where partition "
24333 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
24334 "you don't need to specify the cyls, heads and sectors parameters which were "
24335 "rarely if ever used anyway."
24339 #: ../fish/guestfish-actions.pod:3931
24340 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
24344 #: ../fish/guestfish-actions.pod:3937
24349 #: ../fish/guestfish-actions.pod:3939
24352 " sfdisk-N device partnum cyls heads sectors line\n"
24357 #: ../fish/guestfish-actions.pod:3944
24359 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
24360 "cyls/heads/sectors parameters."
24364 #: ../fish/guestfish-actions.pod:3947
24365 msgid "See also: L</part-add>"
24369 #: ../fish/guestfish-actions.pod:3952
24370 msgid "sfdisk-disk-geometry"
24374 #: ../fish/guestfish-actions.pod:3954
24377 " sfdisk-disk-geometry device\n"
24382 #: ../fish/guestfish-actions.pod:3956
24384 "This displays the disk geometry of C<device> read from the partition table. "
24385 "Especially in the case where the underlying block device has been resized, "
24386 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
24387 "kernel-geometry>)."
24391 #: ../fish/guestfish-actions.pod:3964
24392 msgid "sfdisk-kernel-geometry"
24396 #: ../fish/guestfish-actions.pod:3966
24399 " sfdisk-kernel-geometry device\n"
24404 #: ../fish/guestfish-actions.pod:3973
24409 #: ../fish/guestfish-actions.pod:3975
24412 " sfdisk-l device\n"
24417 #: ../fish/guestfish-actions.pod:3981
24418 msgid "See also: L</part-list>"
24422 #: ../fish/guestfish-actions.pod:3983
24427 #: ../fish/guestfish-actions.pod:3985
24435 #: ../fish/guestfish-actions.pod:3990
24436 msgid "This is like L</command>, but passes the command to:"
24440 #: ../fish/guestfish-actions.pod:3998
24441 msgid "All the provisos about L</command> apply to this call."
24445 #: ../fish/guestfish-actions.pod:4000
24450 #: ../fish/guestfish-actions.pod:4002
24453 " sh-lines command\n"
24458 #: ../fish/guestfish-actions.pod:4004
24459 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24463 #: ../fish/guestfish-actions.pod:4007
24464 msgid "See also: L</command-lines>"
24468 #: ../fish/guestfish-actions.pod:4009
24473 #: ../fish/guestfish-actions.pod:4011
24481 #: ../fish/guestfish-actions.pod:4015
24486 #: ../fish/guestfish-actions.pod:4017
24494 #: ../fish/guestfish-actions.pod:4023
24499 #: ../fish/guestfish-actions.pod:4025
24507 #: ../fish/guestfish-actions.pod:4033
24512 #: ../fish/guestfish-actions.pod:4035
24520 #: ../fish/guestfish-actions.pod:4043
24525 #: ../fish/guestfish-actions.pod:4045
24528 " strings-e encoding path\n"
24533 #: ../fish/guestfish-actions.pod:4047
24535 "This is like the L</strings> command, but allows you to specify the encoding "
24536 "of strings that are looked for in the source file C<path>."
24540 #: ../fish/guestfish-actions.pod:4057
24542 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24543 "ISO-8859-X (this is what L</strings> uses)."
24547 #: ../fish/guestfish-actions.pod:4089
24548 msgid "swapoff-device"
24552 #: ../fish/guestfish-actions.pod:4091
24555 " swapoff-device device\n"
24560 #: ../fish/guestfish-actions.pod:4093
24562 "This command disables the libguestfs appliance swap device or partition "
24563 "named C<device>. See L</swapon-device>."
24567 #: ../fish/guestfish-actions.pod:4097
24568 msgid "swapoff-file"
24572 #: ../fish/guestfish-actions.pod:4099
24575 " swapoff-file file\n"
24580 #: ../fish/guestfish-actions.pod:4103
24581 msgid "swapoff-label"
24585 #: ../fish/guestfish-actions.pod:4105
24588 " swapoff-label label\n"
24593 #: ../fish/guestfish-actions.pod:4110
24594 msgid "swapoff-uuid"
24598 #: ../fish/guestfish-actions.pod:4112
24601 " swapoff-uuid uuid\n"
24606 #: ../fish/guestfish-actions.pod:4117
24607 msgid "swapon-device"
24611 #: ../fish/guestfish-actions.pod:4119
24614 " swapon-device device\n"
24619 #: ../fish/guestfish-actions.pod:4121
24621 "This command enables the libguestfs appliance to use the swap device or "
24622 "partition named C<device>. The increased memory is made available for all "
24623 "commands, for example those run using L</command> or L</sh>."
24627 #: ../fish/guestfish-actions.pod:4133
24628 msgid "swapon-file"
24632 #: ../fish/guestfish-actions.pod:4135
24635 " swapon-file file\n"
24640 #: ../fish/guestfish-actions.pod:4137
24642 "This command enables swap to a file. See L</swapon-device> for other notes."
24646 #: ../fish/guestfish-actions.pod:4140
24647 msgid "swapon-label"
24651 #: ../fish/guestfish-actions.pod:4142
24654 " swapon-label label\n"
24659 #: ../fish/guestfish-actions.pod:4144
24661 "This command enables swap to a labeled swap partition. See L</swapon-"
24662 "device> for other notes."
24666 #: ../fish/guestfish-actions.pod:4147
24667 msgid "swapon-uuid"
24671 #: ../fish/guestfish-actions.pod:4149
24674 " swapon-uuid uuid\n"
24679 #: ../fish/guestfish-actions.pod:4151
24681 "This command enables swap to a swap partition with the given UUID. See L</"
24682 "swapon-device> for other notes."
24686 #: ../fish/guestfish-actions.pod:4154
24691 #: ../fish/guestfish-actions.pod:4156
24699 #: ../fish/guestfish-actions.pod:4164
24704 #: ../fish/guestfish-actions.pod:4166
24712 #: ../fish/guestfish-actions.pod:4174
24717 #: ../fish/guestfish-actions.pod:4176
24720 " tail-n nrlines path\n"
24725 #: ../fish/guestfish-actions.pod:4189
24730 #: ../fish/guestfish-actions.pod:4191
24733 " tar-in (tarfile|-) directory\n"
24738 #: ../fish/guestfish-actions.pod:4196
24739 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24743 #: ../fish/guestfish-actions.pod:4201
24748 #: ../fish/guestfish-actions.pod:4203
24751 " tar-out directory (tarfile|-)\n"
24756 #: ../fish/guestfish-actions.pod:4208
24757 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24761 #: ../fish/guestfish-actions.pod:4213
24766 #: ../fish/guestfish-actions.pod:4215
24769 " tgz-in (tarball|-) directory\n"
24774 #: ../fish/guestfish-actions.pod:4220
24775 msgid "To upload an uncompressed tarball, use L</tar-in>."
24779 #: ../fish/guestfish-actions.pod:4224
24784 #: ../fish/guestfish-actions.pod:4226
24787 " tgz-out directory (tarball|-)\n"
24792 #: ../fish/guestfish-actions.pod:4231
24793 msgid "To download an uncompressed tarball, use L</tar-out>."
24797 #: ../fish/guestfish-actions.pod:4235
24802 #: ../fish/guestfish-actions.pod:4237
24810 #: ../fish/guestfish-actions.pod:4246
24815 #: ../fish/guestfish-actions.pod:4248
24823 #: ../fish/guestfish-actions.pod:4253
24824 msgid "truncate-size"
24828 #: ../fish/guestfish-actions.pod:4255
24831 " truncate-size path size\n"
24836 #: ../fish/guestfish-actions.pod:4260
24838 "If the current file size is less than C<size> then the file is extended to "
24839 "the required size with zero bytes. This creates a sparse file (ie. disk "
24840 "blocks are not allocated for the file until you write to it). To create a "
24841 "non-sparse file of zeroes, use L</fallocate64> instead."
24845 #: ../fish/guestfish-actions.pod:4266
24850 #: ../fish/guestfish-actions.pod:4268
24853 " tune2fs-l device\n"
24858 #: ../fish/guestfish-actions.pod:4278
24863 #: ../fish/guestfish-actions.pod:4280
24866 " txz-in (tarball|-) directory\n"
24871 #: ../fish/guestfish-actions.pod:4287
24876 #: ../fish/guestfish-actions.pod:4289
24879 " txz-out directory (tarball|-)\n"
24884 #: ../fish/guestfish-actions.pod:4296
24889 #: ../fish/guestfish-actions.pod:4298
24897 #: ../fish/guestfish-actions.pod:4312
24898 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24902 #: ../fish/guestfish-actions.pod:4317
24907 #: ../fish/guestfish-actions.pod:4319
24912 #: ../fish/guestfish-actions.pod:4321
24915 " umount pathordevice\n"
24920 #: ../fish/guestfish-actions.pod:4327
24925 #: ../fish/guestfish-actions.pod:4329
24926 msgid "unmount-all"
24930 #: ../fish/guestfish-actions.pod:4331
24938 #: ../fish/guestfish-actions.pod:4337
24943 #: ../fish/guestfish-actions.pod:4339
24946 " upload (filename|-) remotefilename\n"
24951 #: ../fish/guestfish-actions.pod:4346
24952 msgid "See also L</download>."
24956 #: ../fish/guestfish-actions.pod:4350
24957 msgid "upload-offset"
24961 #: ../fish/guestfish-actions.pod:4352
24964 " upload-offset (filename|-) remotefilename offset\n"
24969 #: ../fish/guestfish-actions.pod:4364
24971 "Note that there is no limit on the amount of data that can be uploaded with "
24972 "this call, unlike with L</pwrite>, and this call always writes the full "
24973 "amount unless an error occurs."
24977 #: ../fish/guestfish-actions.pod:4369
24978 msgid "See also L</upload>, L</pwrite>."
24982 #: ../fish/guestfish-actions.pod:4373
24987 #: ../fish/guestfish-actions.pod:4375
24990 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24995 #: ../fish/guestfish-actions.pod:4394
25000 #: ../fish/guestfish-actions.pod:4396
25008 #: ../fish/guestfish-actions.pod:4423
25010 "I<Note:> Don't use this call to test for availability of features. In "
25011 "enterprise distributions we backport features from later versions into "
25012 "earlier versions, making this an unreliable way to test for features. Use "
25013 "L</available> instead."
25017 #: ../fish/guestfish-actions.pod:4429
25022 #: ../fish/guestfish-actions.pod:4431
25025 " vfs-label device\n"
25030 #: ../fish/guestfish-actions.pod:4438
25031 msgid "To find a filesystem from the label, use L</findfs-label>."
25035 #: ../fish/guestfish-actions.pod:4440
25040 #: ../fish/guestfish-actions.pod:4442
25043 " vfs-type device\n"
25048 #: ../fish/guestfish-actions.pod:4452
25053 #: ../fish/guestfish-actions.pod:4454
25056 " vfs-uuid device\n"
25061 #: ../fish/guestfish-actions.pod:4461
25062 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
25066 #: ../fish/guestfish-actions.pod:4463
25067 msgid "vg-activate"
25071 #: ../fish/guestfish-actions.pod:4465
25074 " vg-activate true|false 'volgroups ...'\n"
25079 #: ../fish/guestfish-actions.pod:4478
25080 msgid "vg-activate-all"
25084 #: ../fish/guestfish-actions.pod:4480
25087 " vg-activate-all true|false\n"
25092 #: ../fish/guestfish-actions.pod:4490
25097 #: ../fish/guestfish-actions.pod:4492
25100 " vgcreate volgroup 'physvols ...'\n"
25105 #: ../fish/guestfish-actions.pod:4497
25110 #: ../fish/guestfish-actions.pod:4499
25113 " vglvuuids vgname\n"
25118 #: ../fish/guestfish-actions.pod:4504
25120 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
25121 "logical volumes and volume groups."
25125 #: ../fish/guestfish-actions.pod:4507
25126 msgid "See also L</vgpvuuids>."
25130 #: ../fish/guestfish-actions.pod:4509
25135 #: ../fish/guestfish-actions.pod:4511
25138 " vgpvuuids vgname\n"
25143 #: ../fish/guestfish-actions.pod:4516
25145 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
25146 "physical volumes and volume groups."
25150 #: ../fish/guestfish-actions.pod:4519
25151 msgid "See also L</vglvuuids>."
25155 #: ../fish/guestfish-actions.pod:4521
25160 #: ../fish/guestfish-actions.pod:4523
25163 " vgremove vgname\n"
25168 #: ../fish/guestfish-actions.pod:4530
25173 #: ../fish/guestfish-actions.pod:4532
25176 " vgrename volgroup newvolgroup\n"
25181 #: ../fish/guestfish-actions.pod:4536
25186 #: ../fish/guestfish-actions.pod:4538
25194 #: ../fish/guestfish-actions.pod:4546
25195 msgid "See also L</vgs-full>."
25199 #: ../fish/guestfish-actions.pod:4548
25204 #: ../fish/guestfish-actions.pod:4550
25212 #: ../fish/guestfish-actions.pod:4555
25217 #: ../fish/guestfish-actions.pod:4557
25225 #: ../fish/guestfish-actions.pod:4562
25230 #: ../fish/guestfish-actions.pod:4564
25238 #: ../fish/guestfish-actions.pod:4568
25243 #: ../fish/guestfish-actions.pod:4570
25251 #: ../fish/guestfish-actions.pod:4575
25256 #: ../fish/guestfish-actions.pod:4577
25264 #: ../fish/guestfish-actions.pod:4582
25269 #: ../fish/guestfish-actions.pod:4584
25277 #: ../fish/guestfish-actions.pod:4589
25282 #: ../fish/guestfish-actions.pod:4591
25285 " write path content\n"
25290 #: ../fish/guestfish-actions.pod:4599
25295 #: ../fish/guestfish-actions.pod:4601
25298 " write-file path content size\n"
25303 #: ../fish/guestfish-actions.pod:4624
25308 #: ../fish/guestfish-actions.pod:4626
25311 " zegrep regex path\n"
25316 #: ../fish/guestfish-actions.pod:4634
25321 #: ../fish/guestfish-actions.pod:4636
25324 " zegrepi regex path\n"
25329 #: ../fish/guestfish-actions.pod:4644
25334 #: ../fish/guestfish-actions.pod:4646
25342 #: ../fish/guestfish-actions.pod:4654
25343 msgid "See also: L</zero-device>, L</scrub-device>."
25347 #: ../fish/guestfish-actions.pod:4656
25348 msgid "zero-device"
25352 #: ../fish/guestfish-actions.pod:4658
25355 " zero-device device\n"
25360 #: ../fish/guestfish-actions.pod:4660
25362 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
25363 "which just zeroes the first few blocks of a device."
25367 #: ../fish/guestfish-actions.pod:4667
25372 #: ../fish/guestfish-actions.pod:4669
25375 " zerofree device\n"
25380 #: ../fish/guestfish-actions.pod:4682
25385 #: ../fish/guestfish-actions.pod:4684
25388 " zfgrep pattern path\n"
25393 #: ../fish/guestfish-actions.pod:4692
25398 #: ../fish/guestfish-actions.pod:4694
25401 " zfgrepi pattern path\n"
25406 #: ../fish/guestfish-actions.pod:4702
25411 #: ../fish/guestfish-actions.pod:4704
25414 " zfile meth path\n"
25419 #: ../fish/guestfish-actions.pod:4711
25421 "Since 1.0.63, use L</file> instead which can now process compressed files."
25425 #: ../fish/guestfish-actions.pod:4721
25430 #: ../fish/guestfish-actions.pod:4723
25433 " zgrep regex path\n"
25438 #: ../fish/guestfish-actions.pod:4731
25443 #: ../fish/guestfish-actions.pod:4733
25446 " zgrepi regex path\n"
25451 #: ../fish/guestfish-commands.pod:1
25456 #: ../fish/guestfish-commands.pod:3
25461 #: ../fish/guestfish-commands.pod:5
25464 " alloc filename size\n"
25469 #: ../fish/guestfish-commands.pod:7
25471 "This creates an empty (zeroed) file of the given size, and then adds so it "
25472 "can be further examined."
25476 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25477 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25481 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25482 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25486 #: ../fish/guestfish-commands.pod:14
25488 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25489 "image, see L</PREPARED DISK IMAGES>."
25493 #: ../fish/guestfish-commands.pod:17
25498 #: ../fish/guestfish-commands.pod:19
25501 " copy-in local [local ...] /remotedir\n"
25506 #: ../fish/guestfish-commands.pod:21
25508 "C<copy-in> copies local files or directories recursively into the disk "
25509 "image, placing them in the directory called C</remotedir> (which must "
25510 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25511 "other commands as necessary."
25515 #: ../fish/guestfish-commands.pod:26
25517 "Multiple local files and directories can be specified, but the last "
25518 "parameter must always be a remote directory. Wildcards cannot be used."
25522 #: ../fish/guestfish-commands.pod:30
25527 #: ../fish/guestfish-commands.pod:32
25530 " copy-out remote [remote ...] localdir\n"
25535 #: ../fish/guestfish-commands.pod:34
25537 "C<copy-out> copies remote files or directories recursively out of the disk "
25538 "image, placing them on the host disk in a local directory called C<localdir> "
25539 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25540 "download>, L</tar-out> and other commands as necessary."
25544 #: ../fish/guestfish-commands.pod:40
25546 "Multiple remote files and directories can be specified, but the last "
25547 "parameter must always be a local directory. To download to the current "
25548 "directory, use C<.> as in:"
25552 #: ../fish/guestfish-commands.pod:44
25555 " copy-out /home .\n"
25560 #: ../fish/guestfish-commands.pod:46
25562 "Wildcards cannot be used in the ordinary command, but you can use them with "
25563 "the help of L</glob> like this:"
25567 #: ../fish/guestfish-commands.pod:49
25570 " glob copy-out /home/* .\n"
25575 #: ../fish/guestfish-commands.pod:51
25580 #: ../fish/guestfish-commands.pod:53
25583 " echo [params ...]\n"
25588 #: ../fish/guestfish-commands.pod:55
25589 msgid "This echos the parameters to the terminal."
25593 #: ../fish/guestfish-commands.pod:57
25598 #: ../fish/guestfish-commands.pod:59
25603 #: ../fish/guestfish-commands.pod:61
25608 #: ../fish/guestfish-commands.pod:63
25616 #: ../fish/guestfish-commands.pod:65
25618 "This is used to edit a file. It downloads the file, edits it locally using "
25619 "your editor, then uploads the result."
25623 #: ../fish/guestfish-commands.pod:68
25625 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25626 "or C<emacs> you will get those corresponding editors."
25630 #: ../fish/guestfish-commands.pod:72
25635 #: ../fish/guestfish-commands.pod:74
25638 " glob command args...\n"
25643 #: ../fish/guestfish-commands.pod:76
25645 "Expand wildcards in any paths in the args list, and run C<command> "
25646 "repeatedly on each matching path."
25650 #: ../fish/guestfish-commands.pod:79
25651 msgid "See L</WILDCARDS AND GLOBBING>."
25655 #: ../fish/guestfish-commands.pod:81
25660 #: ../fish/guestfish-commands.pod:83
25663 " hexedit <filename|device>\n"
25664 " hexedit <filename|device> <max>\n"
25665 " hexedit <filename|device> <start> <max>\n"
25670 #: ../fish/guestfish-commands.pod:87
25672 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25677 #: ../fish/guestfish-commands.pod:90
25679 "This command works by downloading potentially the whole file or device, "
25680 "editing it locally, then uploading it. If the file or device is large, you "
25681 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25682 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25683 "usual modifiers allowed such as C<1M> (1 megabyte)."
25687 #: ../fish/guestfish-commands.pod:97
25688 msgid "For example to edit the first few sectors of a disk you might do:"
25692 #: ../fish/guestfish-commands.pod:100
25695 " hexedit /dev/sda 1M\n"
25700 #: ../fish/guestfish-commands.pod:102
25702 "which would allow you to edit anywhere within the first megabyte of the disk."
25706 #: ../fish/guestfish-commands.pod:105
25707 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25711 #: ../fish/guestfish-commands.pod:107
25714 " hexedit /dev/sda1 0x400 0x400\n"
25719 #: ../fish/guestfish-commands.pod:109
25720 msgid "(assuming the superblock is in the standard location)."
25724 #: ../fish/guestfish-commands.pod:111
25726 "This command requires the external L<hexedit(1)> program. You can specify "
25727 "another program to use by setting the C<HEXEDITOR> environment variable."
25731 #: ../fish/guestfish-commands.pod:115
25732 msgid "See also L</hexdump>."
25736 #: ../fish/guestfish-commands.pod:117
25741 #: ../fish/guestfish-commands.pod:119
25749 #: ../fish/guestfish-commands.pod:121
25751 "Change the local directory, ie. the current directory of guestfish itself."
25755 #: ../fish/guestfish-commands.pod:124
25756 msgid "Note that C<!cd> won't do what you might expect."
25760 #: ../fish/guestfish-commands.pod:126
25765 #: ../fish/guestfish-commands.pod:128
25770 #: ../fish/guestfish-commands.pod:130
25778 #: ../fish/guestfish-commands.pod:132
25779 msgid "Opens the manual page for guestfish."
25783 #: ../fish/guestfish-commands.pod:134
25788 #: ../fish/guestfish-commands.pod:136
25793 #: ../fish/guestfish-commands.pod:138
25801 #: ../fish/guestfish-commands.pod:140
25809 #: ../fish/guestfish-commands.pod:142
25810 msgid "This is used to view a file."
25814 #: ../fish/guestfish-commands.pod:144
25816 "The default viewer is C<$PAGER>. However if you use the alternate command "
25817 "C<less> you will get the C<less> command specifically."
25821 #: ../fish/guestfish-commands.pod:147
25826 #: ../fish/guestfish-commands.pod:149
25834 #: ../fish/guestfish-commands.pod:151
25836 "Close and reopen the libguestfs handle. It is not necessary to use this "
25837 "normally, because the handle is closed properly when guestfish exits. "
25838 "However this is occasionally useful for testing."
25842 #: ../fish/guestfish-commands.pod:155
25847 #: ../fish/guestfish-commands.pod:157
25850 " sparse filename size\n"
25855 #: ../fish/guestfish-commands.pod:159
25857 "This creates an empty sparse file of the given size, and then adds so it can "
25858 "be further examined."
25862 #: ../fish/guestfish-commands.pod:162
25864 "In all respects it works the same as the L</alloc> command, except that the "
25865 "image file is allocated sparsely, which means that disk blocks are not "
25866 "assigned to the file until they are needed. Sparse disk files only use "
25867 "space when written to, but they are slower and there is a danger you could "
25868 "run out of real disk space during a write operation."
25872 #: ../fish/guestfish-commands.pod:172
25877 #: ../fish/guestfish-commands.pod:174
25885 #: ../fish/guestfish-commands.pod:176
25887 "This command returns a list of the optional groups known to the daemon, and "
25888 "indicates which ones are supported by this build of the libguestfs appliance."
25892 #: ../fish/guestfish-commands.pod:180
25893 msgid "See also L<guestfs(3)/AVAILABILITY>."
25897 #: ../fish/guestfish-commands.pod:182
25902 #: ../fish/guestfish-commands.pod:184
25905 " time command args...\n"
25910 #: ../fish/guestfish-commands.pod:186
25912 "Run the command as usual, but print the elapsed time afterwards. This can "
25913 "be useful for benchmarking operations."
25917 #: ../test-tool/libguestfs-test-tool.pod:5
25918 msgid "libguestfs-test-tool - End user tests for libguestfs"
25922 #: ../test-tool/libguestfs-test-tool.pod:9
25925 " libguestfs-test-tool [--options]\n"
25930 #: ../test-tool/libguestfs-test-tool.pod:13
25932 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25933 "and developers, to allow them to check basic libguestfs functionality is "
25934 "working. This is needed because libguestfs occasionally breaks for reasons "
25935 "beyond our control: usually because of changes in the underlying qemu or "
25936 "kernel packages, or the host environment."
25940 #: ../test-tool/libguestfs-test-tool.pod:20
25941 msgid "If you suspect a problem in libguestfs, then just run:"
25945 #: ../test-tool/libguestfs-test-tool.pod:22
25948 " libguestfs-test-tool\n"
25953 #: ../test-tool/libguestfs-test-tool.pod:24
25954 msgid "It will print lots of diagnostic messages."
25958 #: ../test-tool/libguestfs-test-tool.pod:26
25959 msgid "If it runs to completion successfully, you will see this near the end:"
25963 #: ../test-tool/libguestfs-test-tool.pod:28
25966 " ===== TEST FINISHED OK =====\n"
25971 #: ../test-tool/libguestfs-test-tool.pod:30
25972 msgid "and the test tool will exit with code 0."
25976 #: ../test-tool/libguestfs-test-tool.pod:32
25978 "If it fails (and/or exits with non-zero error code), please paste the "
25979 "B<complete, unedited> output of the test tool into a bug report. More "
25980 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25985 #: ../test-tool/libguestfs-test-tool.pod:41
25990 #: ../test-tool/libguestfs-test-tool.pod:43
25991 msgid "Display short usage information and exit."
25995 #: ../test-tool/libguestfs-test-tool.pod:45
25996 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
26000 #: ../test-tool/libguestfs-test-tool.pod:47
26002 "Pass an alternate name for the helper program. libguestfs-test-tool will "
26003 "normally look in the C<$libexec> directory that was configured when the tool "
26008 #: ../test-tool/libguestfs-test-tool.pod:51
26009 msgid "I<--qemu qemu_binary>"
26013 #: ../test-tool/libguestfs-test-tool.pod:53
26015 "If you have downloaded another qemu binary, point this option at the full "
26016 "path of the binary to try it."
26020 #: ../test-tool/libguestfs-test-tool.pod:56
26021 msgid "I<--qemudir qemu_source_dir>"
26025 #: ../test-tool/libguestfs-test-tool.pod:58
26027 "If you have compiled qemu from source, point this option at the source "
26028 "directory to try it."
26032 #: ../test-tool/libguestfs-test-tool.pod:61
26033 msgid "I<--timeout N>"
26037 #: ../test-tool/libguestfs-test-tool.pod:63
26039 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
26040 "does not usually need to be adjusted unless your machine is very slow."
26044 #: ../test-tool/libguestfs-test-tool.pod:69
26045 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
26049 #: ../test-tool/libguestfs-test-tool.pod:71
26051 "If you have compiled another version of qemu from source and would like to "
26052 "try that, then you can use the I<--qemudir> option to point to the qemu "
26053 "source directory."
26057 #: ../test-tool/libguestfs-test-tool.pod:75
26059 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
26060 "option to point to the binary."
26064 #: ../test-tool/libguestfs-test-tool.pod:78
26066 "When using an alternate qemu with libguestfs, usually you would need to "
26067 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
26068 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
26069 "use either of the I<--qemudir> or I<--qemu> options."
26073 #: ../test-tool/libguestfs-test-tool.pod:85
26075 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
26076 "I<1> if there was an error."
26080 #: ../test-tool/libguestfs-test-tool.pod:92
26081 msgid "/usr/libexec/libguestfs-test-tool-helper"
26085 #: ../test-tool/libguestfs-test-tool.pod:94
26087 "This helper program is run inside the appliance and provides additional "
26092 #: ../test-tool/libguestfs-test-tool.pod:97
26093 msgid "/usr/bin/mkisofs"
26097 #: ../test-tool/libguestfs-test-tool.pod:99
26099 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
26100 "which is used as part of the tests."
26104 #: ../test-tool/libguestfs-test-tool.pod:106
26106 "For the full list of environment variables which may affect libguestfs, "
26107 "please see the L<guestfs(3)> manual page."
26111 #: ../test-tool/libguestfs-test-tool.pod:111
26112 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
26116 #: ../test-tool/libguestfs-test-tool.pod:121
26117 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
26121 #: ../fuse/guestmount.pod:5
26123 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
26127 #: ../fuse/guestmount.pod:9
26130 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
26135 #: ../fuse/guestmount.pod:11
26138 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
26143 #: ../fuse/guestmount.pod:13
26146 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
26151 #: ../fuse/guestmount.pod:17
26153 "You must I<not> use C<guestmount> in read-write mode on live virtual "
26154 "machines. If you do this, you risk disk corruption in the VM."
26158 #: ../fuse/guestmount.pod:22
26160 "The guestmount program can be used to mount virtual machine filesystems and "
26161 "other disk images on the host. It uses libguestfs for access to the guest "
26162 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
26163 "a mountable device."
26167 #: ../fuse/guestmount.pod:27
26169 "Along with other options, you have to give at least one device (I<-a> "
26170 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
26171 "option) or use the I<-i> inspection option. How this works is better "
26172 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
26177 #: ../fuse/guestmount.pod:33
26179 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
26180 "by you, and the filesystem will not be visible to any other users unless you "
26181 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
26182 "the filesystem, use the C<fusermount -u> command."
26186 #: ../fuse/guestmount.pod:41
26188 "For a typical Windows guest which has its main filesystem on the first "
26193 #: ../fuse/guestmount.pod:44
26196 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
26201 #: ../fuse/guestmount.pod:46
26203 "For a typical Linux guest which has a /boot filesystem on the first "
26204 "partition, and the root filesystem on a logical volume:"
26208 #: ../fuse/guestmount.pod:49
26211 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
26216 #: ../fuse/guestmount.pod:51
26217 msgid "To get libguestfs to detect guest mountpoints for you:"
26221 #: ../fuse/guestmount.pod:53
26224 " guestmount -a guest.img -i --ro /mnt\n"
26229 #: ../fuse/guestmount.pod:55
26230 msgid "For a libvirt guest called \"Guest\" you could do:"
26234 #: ../fuse/guestmount.pod:57
26237 " guestmount -d Guest -i --ro /mnt\n"
26242 #: ../fuse/guestmount.pod:59
26244 "If you don't know what filesystems are contained in a guest or disk image, "
26245 "use L<virt-filesystems(1)> first:"
26249 #: ../fuse/guestmount.pod:62
26252 " virt-filesystems MyGuest\n"
26257 #: ../fuse/guestmount.pod:64
26259 "If you want to trace the libguestfs calls but without excessive debugging "
26260 "information, we recommend:"
26264 #: ../fuse/guestmount.pod:67
26267 " guestmount [...] --trace /mnt\n"
26272 #: ../fuse/guestmount.pod:69
26273 msgid "If you want to debug the program, we recommend:"
26277 #: ../fuse/guestmount.pod:71
26280 " guestmount [...] --trace --verbose /mnt\n"
26285 #: ../fuse/guestmount.pod:77
26286 msgid "B<-a image> | B<--add image>"
26290 #: ../fuse/guestmount.pod:79
26291 msgid "Add a block device or virtual machine image."
26295 #: ../fuse/guestmount.pod:84
26296 msgid "B<-c URI> | B<--connect URI>"
26300 #: ../fuse/guestmount.pod:90
26301 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
26305 #: ../fuse/guestmount.pod:96
26306 msgid "B<--dir-cache-timeout N>"
26310 #: ../fuse/guestmount.pod:98
26312 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
26313 "seconds. The readdir cache [actually, there are several semi-independent "
26314 "caches] is populated after a readdir(2) call with the stat and extended "
26315 "attributes of the files in the directory, in anticipation that they will be "
26316 "requested soon after."
26320 #: ../fuse/guestmount.pod:104
26322 "There is also a different attribute cache implemented by FUSE (see the FUSE "
26323 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
26324 "requests, only cache existing ones."
26328 #: ../fuse/guestmount.pod:115
26329 msgid "B<--format=raw|qcow2|..> | B<--format>"
26333 #: ../fuse/guestmount.pod:122
26335 "If you have untrusted raw-format guest disk images, you should use this "
26336 "option to specify the disk format. This avoids a possible security problem "
26337 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
26338 "guestfs_add_drive_opts>."
26342 #: ../fuse/guestmount.pod:127
26343 msgid "B<--fuse-help>"
26347 #: ../fuse/guestmount.pod:129
26348 msgid "Display help on special FUSE options (see I<-o> below)."
26352 #: ../fuse/guestmount.pod:133
26353 msgid "Display brief help and exit."
26357 #: ../fuse/guestmount.pod:135
26358 msgid "B<-i> | B<--inspector>"
26362 #: ../fuse/guestmount.pod:146
26363 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
26367 #: ../fuse/guestmount.pod:148
26369 "Mount the named partition or logical volume on the given mountpoint B<in the "
26370 "guest> (this has nothing to do with mountpoints in the host)."
26374 #: ../fuse/guestmount.pod:151
26376 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
26377 "something on C</>."
26381 #: ../fuse/guestmount.pod:154
26382 msgid "B<-n> | B<--no-sync>"
26386 #: ../fuse/guestmount.pod:156
26388 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
26389 "unmounted. If you specify this option, then we don't attempt to sync the "
26390 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
26394 #: ../fuse/guestmount.pod:161
26395 msgid "B<-o option> | B<--option option>"
26399 #: ../fuse/guestmount.pod:163
26400 msgid "Pass extra options to FUSE."
26404 #: ../fuse/guestmount.pod:165
26406 "To get a list of all the extra options supported by FUSE, use the command "
26407 "below. Note that only the FUSE I<-o> options can be passed, and only some "
26408 "of them are a good idea."
26412 #: ../fuse/guestmount.pod:169
26415 " guestmount --fuse-help\n"
26420 #: ../fuse/guestmount.pod:171
26421 msgid "Some potentially useful FUSE options:"
26425 #: ../fuse/guestmount.pod:175
26426 msgid "B<-o allow_other>"
26430 #: ../fuse/guestmount.pod:177
26431 msgid "Allow other users to see the filesystem."
26435 #: ../fuse/guestmount.pod:179
26436 msgid "B<-o attr_timeout=N>"
26440 #: ../fuse/guestmount.pod:181
26441 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
26445 #: ../fuse/guestmount.pod:183
26446 msgid "B<-o kernel_cache>"
26450 #: ../fuse/guestmount.pod:185
26452 "Allow the kernel to cache files (reduces the number of reads that have to go "
26453 "through the L<guestfs(3)> API). This is generally a good idea if you can "
26454 "afford the extra memory usage."
26458 #: ../fuse/guestmount.pod:189
26459 msgid "B<-o uid=N> B<-o gid=N>"
26463 #: ../fuse/guestmount.pod:191
26465 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
26466 "the chosen values."
26470 #: ../fuse/guestmount.pod:196
26471 msgid "B<-r> | B<--ro>"
26475 #: ../fuse/guestmount.pod:198
26477 "Add devices and mount everything read-only. Also disallow writes and make "
26478 "the disk appear read-only to FUSE."
26482 #: ../fuse/guestmount.pod:201
26484 "This is highly recommended if you are not going to edit the guest disk. If "
26485 "the guest is running and this option is I<not> supplied, then there is a "
26486 "strong risk of disk corruption in the guest. We try to prevent this from "
26487 "happening, but it is not always possible."
26491 #: ../fuse/guestmount.pod:206
26492 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26496 #: ../fuse/guestmount.pod:210
26497 msgid "Enable SELinux support for the guest."
26501 #: ../fuse/guestmount.pod:212
26502 msgid "B<-v> | B<--verbose>"
26506 #: ../fuse/guestmount.pod:214
26507 msgid "Enable verbose messages from underlying libguestfs."
26511 #: ../fuse/guestmount.pod:216
26512 msgid "B<-V> | B<--version>"
26516 #: ../fuse/guestmount.pod:218
26517 msgid "Display the program version and exit."
26521 #: ../fuse/guestmount.pod:220
26522 msgid "B<-w> | B<--rw>"
26526 #: ../fuse/guestmount.pod:222
26528 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26529 "FOR READ AND WRITE>."
26533 #: ../fuse/guestmount.pod:225
26534 msgid "B<-x> | B<--trace>"
26538 #: ../fuse/guestmount.pod:227
26539 msgid "Trace libguestfs calls."
26543 #: ../fuse/guestmount.pod:229
26544 msgid "This also stops the daemon from forking into the background."
26548 #: ../fuse/guestmount.pod:235
26550 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26551 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26556 #: ../tools/virt-edit.pl:34
26557 msgid "virt-edit - Edit a file in a virtual machine"
26561 #: ../tools/virt-edit.pl:38
26564 " virt-edit [--options] domname file\n"
26569 #: ../tools/virt-edit.pl:40
26572 " virt-edit [--options] disk.img [disk.img ...] file\n"
26577 #: ../tools/virt-edit.pl:42
26580 " virt-edit [domname|disk.img] file -e 'expr'\n"
26585 #: ../tools/virt-edit.pl:46
26587 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26588 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26589 "doing this, but doesn't catch all cases."
26593 #: ../tools/virt-edit.pl:52
26595 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26596 "the named virtual machine (or disk image)."
26600 #: ../tools/virt-edit.pl:55
26602 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26603 "you should look at the L<guestfish(1)> tool."
26607 #: ../tools/virt-edit.pl:60
26608 msgid "Edit the named files interactively:"
26612 #: ../tools/virt-edit.pl:62
26615 " virt-edit mydomain /boot/grub/grub.conf\n"
26620 #: ../tools/virt-edit.pl:64
26623 " virt-edit mydomain /etc/passwd\n"
26628 #: ../tools/virt-edit.pl:66
26630 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26631 "below). To change the init default level to 5:"
26635 #: ../tools/virt-edit.pl:70
26638 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26643 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
26644 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:108
26645 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
26646 msgid "Display brief help."
26650 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
26651 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
26652 #: ../tools/virt-tar.pl:116 ../tools/virt-make-fs.pl:171
26653 #: ../tools/virt-list-partitions.pl:72
26654 msgid "Display version number and exit."
26658 #: ../tools/virt-edit.pl:96
26659 msgid "B<--backup extension> | B<-b extension>"
26663 #: ../tools/virt-edit.pl:98
26665 "Create a backup of the original file I<in the guest disk image>. The backup "
26666 "has the original filename with C<extension> added."
26670 #: ../tools/virt-edit.pl:101
26672 "Usually the first character of C<extension> would be a dot C<.> so you would "
26677 #: ../tools/virt-edit.pl:104
26680 " virt-edit -b .orig [etc]\n"
26685 #: ../tools/virt-edit.pl:106
26686 msgid "By default, no backup file is made."
26690 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
26691 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:122
26692 #: ../tools/virt-list-partitions.pl:78
26693 msgid "B<--connect URI> | B<-c URI>"
26697 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
26698 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:124
26699 #: ../tools/virt-list-partitions.pl:80
26701 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26702 "to the default libvirt hypervisor."
26706 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
26707 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:127
26708 #: ../tools/virt-list-partitions.pl:83
26710 "If you specify guest block devices directly, then libvirt is not used at all."
26714 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
26715 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
26716 #: ../tools/virt-tar.pl:134 ../tools/virt-list-partitions.pl:90
26717 msgid "B<--format> raw"
26721 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
26722 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:136
26723 #: ../tools/virt-list-partitions.pl:92
26725 "Specify the format of disk images given on the command line. If this is "
26726 "omitted then the format is autodetected from the content of the disk image."
26730 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
26731 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:140
26732 #: ../tools/virt-list-partitions.pl:96
26734 "If disk images are requested from libvirt, then this program asks libvirt "
26735 "for this information. In this case, the value of the format parameter is "
26740 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
26741 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
26742 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:144
26743 #: ../tools/virt-list-partitions.pl:100
26745 "If working with untrusted raw-format guest disk images, you should ensure "
26746 "the format is always specified."
26750 #: ../tools/virt-edit.pl:141
26751 msgid "B<--expr EXPR> | B<-e EXPR>"
26755 #: ../tools/virt-edit.pl:143
26757 "Instead of launching the external editor, non-interactively apply the Perl "
26758 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26763 #: ../tools/virt-edit.pl:147
26765 "Be careful to properly quote the expression to prevent it from being altered "
26770 #: ../tools/virt-edit.pl:268
26771 msgid "NON-INTERACTIVE EDITING"
26775 #: ../tools/virt-edit.pl:270
26777 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26778 "administrator can interactively edit the file."
26782 #: ../tools/virt-edit.pl:273
26784 "There are two ways also to use C<virt-edit> from scripts in order to make "
26785 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26786 "like this, it's less error-prone to write scripts directly using the "
26787 "libguestfs API and Augeas for configuration file editing.)"
26791 #: ../tools/virt-edit.pl:279
26793 "The first method is to temporarily set C<$EDITOR> to any script or program "
26794 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26795 "update C<tmpfile> in place however it likes."
26799 #: ../tools/virt-edit.pl:283
26801 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26802 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26803 "instances of C<foo> with C<bar> in a file:"
26807 #: ../tools/virt-edit.pl:287
26810 " virt-edit domname filename -e 's/foo/bar/'\n"
26815 #: ../tools/virt-edit.pl:289
26817 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26818 "For example to delete root's password you could do:"
26822 #: ../tools/virt-edit.pl:292
26825 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26830 #: ../tools/virt-edit.pl:294
26832 "What really happens is that the snippet is evaluated as a Perl expression "
26833 "for each line of the file. The line, including the final C<\\n>, is passed "
26834 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26838 #: ../tools/virt-edit.pl:299
26840 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26841 "C<apache> user account from the password file you can do:"
26845 #: ../tools/virt-edit.pl:302
26848 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26853 #: ../tools/virt-edit.pl:304
26855 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26856 "the end of the file is rather difficult this way since there is no concept "
26857 "of \"last line of the file\" - your expression just doesn't get called "
26858 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26863 #: ../tools/virt-edit.pl:310
26865 "The variable C<$lineno> contains the current line number. As is "
26866 "traditional, the first line in the file is number C<1>."
26870 #: ../tools/virt-edit.pl:313
26872 "The return value from the expression is ignored, but the expression may call "
26873 "C<die> in order to abort the whole program, leaving the original file "
26878 #: ../tools/virt-edit.pl:317
26880 "Remember when matching the end of a line that C<$_> may contain the final C<"
26881 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26882 "newline then neither of these. Thus to match or substitute some text at the "
26883 "end of a line, use this regular expression:"
26887 #: ../tools/virt-edit.pl:322
26890 " /some text(\\r?\\n)?$/\n"
26895 #: ../tools/virt-edit.pl:324
26897 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26898 "$_> itself (since that would remove all newlines from the file):"
26902 #: ../tools/virt-edit.pl:328
26905 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26910 #: ../tools/virt-edit.pl:334
26915 #: ../tools/virt-edit.pl:336
26917 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26922 #: ../tools/virt-edit.pl:339
26923 msgid "If not set, C<vi> is used."
26927 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
26928 #: ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182
26929 #: ../tools/virt-tar.pl:274 ../tools/virt-make-fs.pl:527
26930 #: ../tools/virt-list-partitions.pl:250
26931 msgid "SHELL QUOTING"
26935 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
26936 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
26937 #: ../tools/virt-tar.pl:276 ../tools/virt-make-fs.pl:529
26938 #: ../tools/virt-list-partitions.pl:252
26940 "Libvirt guest names can contain arbitrary characters, some of which have "
26941 "meaning to the shell such as C<#> and space. You may need to quote or "
26942 "escape these characters on the command line. See the shell manual page L<sh"
26943 "(1)> for details."
26947 #: ../tools/virt-edit.pl:352
26949 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26950 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26955 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:598
26956 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
26957 #: ../tools/virt-tar.pl:292 ../tools/virt-make-fs.pl:559
26958 #: ../tools/virt-list-partitions.pl:269
26963 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:600
26964 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
26965 #: ../tools/virt-tar.pl:294 ../tools/virt-make-fs.pl:561
26966 #: ../tools/virt-list-partitions.pl:271
26967 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26971 #: ../tools/virt-edit.pl:368 ../tools/virt-list-partitions.pl:275
26972 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26976 #: ../tools/virt-win-reg.pl:37
26978 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26982 #: ../tools/virt-win-reg.pl:41
26985 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26990 #: ../tools/virt-win-reg.pl:43
26993 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26998 #: ../tools/virt-win-reg.pl:45
27001 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
27006 #: ../tools/virt-win-reg.pl:47
27009 " virt-win-reg --merge domname [input.reg ...]\n"
27014 #: ../tools/virt-win-reg.pl:49
27017 " virt-win-reg [--options] disk.img ... # instead of domname\n"
27022 #: ../tools/virt-win-reg.pl:53
27024 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
27025 "virtual machines. If you do this, you I<will> get irreversible disk "
27026 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
27027 "but doesn't catch all cases."
27031 #: ../tools/virt-win-reg.pl:58
27033 "Modifying the Windows Registry is an inherently risky operation. The format "
27034 "is deliberately obscure and undocumented, and Registry changes can leave the "
27035 "system unbootable. Therefore when using the C<--merge> option, make sure "
27036 "you have a reliable backup first."
27040 #: ../tools/virt-win-reg.pl:65
27042 "This program can export and merge Windows Registry entries from a Windows "
27047 #: ../tools/virt-win-reg.pl:68
27049 "The first parameter is the libvirt guest name or the raw disk image of a "
27054 #: ../tools/virt-win-reg.pl:71
27056 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
27057 "exported (recursively). For example:"
27061 #: ../tools/virt-win-reg.pl:74
27064 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
27069 #: ../tools/virt-win-reg.pl:76
27071 "You can also display single values from within registry keys, for example:"
27075 #: ../tools/virt-win-reg.pl:79
27078 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
27079 " $ virt-win-reg Windows7 $cvkey ProductName\n"
27080 " Windows 7 Enterprise\n"
27085 #: ../tools/virt-win-reg.pl:83
27087 "With C<--merge>, you can merge a textual regedit file into the Windows "
27092 #: ../tools/virt-win-reg.pl:86
27095 " $ virt-win-reg --merge Windows7 changes.reg\n"
27100 #: ../tools/virt-win-reg.pl:88
27105 #: ../tools/virt-win-reg.pl:90
27107 "This program is only meant for simple access to the registry. If you want "
27108 "to do complicated things with the registry, we suggest you download the "
27109 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
27110 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
27111 "L<hivexregedit(1)>."
27115 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
27120 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
27121 msgid "Enable debugging messages."
27125 #: ../tools/virt-win-reg.pl:157
27130 #: ../tools/virt-win-reg.pl:159
27132 "In merge mode, this merges a textual regedit file into the Windows Registry "
27133 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
27134 "displays or exports Registry entries instead."
27138 #: ../tools/virt-win-reg.pl:163
27140 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
27141 "result in disk corruption. However exporting (without this flag) is always "
27146 #: ../tools/virt-win-reg.pl:171
27147 msgid "B<--encoding> UTF-16LE|ASCII"
27151 #: ../tools/virt-win-reg.pl:173
27153 "When merging (only), you may need to specify the encoding for strings to be "
27154 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
27155 "(3)/ENCODING STRINGS>."
27159 #: ../tools/virt-win-reg.pl:177
27161 "The default is to use UTF-16LE, which should work with recent versions of "
27166 #: ../tools/virt-win-reg.pl:402
27167 msgid "SUPPORTED SYSTEMS"
27171 #: ../tools/virt-win-reg.pl:404
27173 "The program currently supports Windows NT-derived guests starting with "
27174 "Windows XP through to at least Windows 7."
27178 #: ../tools/virt-win-reg.pl:407
27180 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
27181 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
27182 "and C<HKEY_USERS\\.DEFAULT>."
27186 #: ../tools/virt-win-reg.pl:411
27188 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
27193 #: ../tools/virt-win-reg.pl:414
27195 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
27200 #: ../tools/virt-win-reg.pl:417
27205 #: ../tools/virt-win-reg.pl:419
27207 "C<virt-win-reg> expects that regedit files have already been reencoded in "
27208 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
27209 "style line endings. Since Windows regedit files are often in UTF-16LE with "
27210 "Windows-style line endings, you may need to reencode the whole file before "
27211 "or after processing."
27215 #: ../tools/virt-win-reg.pl:425
27217 "To reencode a file from Windows format to Linux (before processing it with "
27218 "the C<--merge> option), you would do something like this:"
27222 #: ../tools/virt-win-reg.pl:428
27225 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
27230 #: ../tools/virt-win-reg.pl:430
27232 "To go in the opposite direction, after exporting and before sending the file "
27233 "to a Windows user, do something like this:"
27237 #: ../tools/virt-win-reg.pl:433
27240 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
27245 #: ../tools/virt-win-reg.pl:435
27246 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
27250 #: ../tools/virt-win-reg.pl:437
27252 "If you are unsure about the current encoding, use the L<file(1)> command. "
27253 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
27254 "style (CRLF) line endings, like this:"
27258 #: ../tools/virt-win-reg.pl:441
27261 " $ file software.reg\n"
27262 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
27263 " with CRLF line terminators\n"
27268 #: ../tools/virt-win-reg.pl:445
27269 msgid "This file would need conversion before you could C<--merge> it."
27273 #: ../tools/virt-win-reg.pl:447
27274 msgid "CurrentControlSet etc."
27278 #: ../tools/virt-win-reg.pl:449
27280 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
27281 "Registry at the level of the hive file, and therefore you cannot modify "
27286 #: ../tools/virt-win-reg.pl:453
27288 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
27289 "circumstances it might refer to another control set. The way to find out is "
27290 "to look at the C<HKLM\\SYSTEM\\Select> key:"
27294 #: ../tools/virt-win-reg.pl:457
27297 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
27298 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
27299 " \"Current\"=dword:00000001\n"
27300 " \"Default\"=dword:00000001\n"
27301 " \"Failed\"=dword:00000000\n"
27302 " \"LastKnownGood\"=dword:00000002\n"
27307 #: ../tools/virt-win-reg.pl:464
27308 msgid "\"Current\" is the one which Windows will choose when it boots."
27312 #: ../tools/virt-win-reg.pl:466
27314 "Similarly, other C<Current...> keys in the path may need to be replaced."
27318 #: ../tools/virt-win-reg.pl:469
27319 msgid "WINDOWS TIPS"
27323 #: ../tools/virt-win-reg.pl:471
27325 "Note that some of these tips modify the guest disk image. The guest I<must> "
27326 "be shut off, else you will get disk corruption."
27330 #: ../tools/virt-win-reg.pl:474
27331 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
27335 #: ../tools/virt-win-reg.pl:476
27337 "Prepare a DOS batch script, VBScript or executable. Upload this using "
27338 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
27339 "is uploaded into C<C:\\>:"
27343 #: ../tools/virt-win-reg.pl:480
27346 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
27351 #: ../tools/virt-win-reg.pl:482
27352 msgid "Prepare a regedit file containing the registry change:"
27356 #: ../tools/virt-win-reg.pl:484
27359 " cat > test.reg <<'EOF'\n"
27360 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
27361 " \"Test\"=\"c:\\\\test.bat\"\n"
27367 #: ../tools/virt-win-reg.pl:489
27369 "In this example we use the key C<RunOnce> which means that the script will "
27370 "run precisely once when the first user logs in. If you want it to run every "
27371 "time a user logs in, replace C<RunOnce> with C<Run>."
27375 #: ../tools/virt-win-reg.pl:493
27376 msgid "Now update the registry:"
27380 #: ../tools/virt-win-reg.pl:495
27383 " virt-win-reg --merge WindowsGuest test.reg\n"
27388 #: ../tools/virt-win-reg.pl:497
27389 msgid "INSTALLING A SERVICE"
27393 #: ../tools/virt-win-reg.pl:499
27395 "This section assumes you are familiar with Windows services, and you either "
27396 "have a program which handles the Windows Service Control Protocol directly "
27397 "or you want to run any program using a service wrapper like SrvAny or the "
27402 #: ../tools/virt-win-reg.pl:504
27404 "First upload the program and optionally the service wrapper. In this case "
27405 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
27409 #: ../tools/virt-win-reg.pl:508
27412 " guestfish -i -d WindowsGuest <<EOF\n"
27413 " upload rhsrvany.exe /rhsrvany.exe\n"
27414 " upload test.exe /test.exe\n"
27420 #: ../tools/virt-win-reg.pl:513
27422 "Prepare a regedit file containing the registry changes. In this example, "
27423 "the first registry change is needed for the service itself or the service "
27424 "wrapper (if used). The second registry change is only needed because I am "
27425 "using the RHSrvAny service wrapper."
27429 #: ../tools/virt-win-reg.pl:518
27432 " cat > service.reg <<'EOF'\n"
27433 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
27434 " \"Type\"=dword:00000010\n"
27435 " \"Start\"=dword:00000002\n"
27436 " \"ErrorControl\"=dword:00000001\n"
27437 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
27438 " \"DisplayName\"=\"RHSrvAny\"\n"
27439 " \"ObjectName\"=\"NetworkService\"\n"
27444 #: ../tools/virt-win-reg.pl:527
27447 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
27448 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
27449 " \"PWD\"=\"c:\\\\Temp\"\n"
27455 #: ../tools/virt-win-reg.pl:538
27457 "For use of C<ControlSet001> see the section above in this manual page. You "
27458 "may need to adjust this according to the control set that is in use by the "
27463 #: ../tools/virt-win-reg.pl:544
27465 "C<\"ObjectName\"> controls the privileges that the service will have. An "
27466 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
27467 "privileged account."
27471 #: ../tools/virt-win-reg.pl:550
27473 "For the meaning of the magic numbers, see this Microsoft KB article: "
27474 "L<http://support.microsoft.com/kb/103000>."
27478 #: ../tools/virt-win-reg.pl:555
27479 msgid "Update the registry:"
27483 #: ../tools/virt-win-reg.pl:557
27486 " virt-win-reg --merge WindowsGuest service.reg\n"
27491 #: ../tools/virt-win-reg.pl:561
27493 "Be careful when passing parameters containing C<\\> (backslash) in the "
27494 "shell. Usually you will have to use 'single quotes' or double backslashes "
27495 "(but not both) to protect them from the shell."
27499 #: ../tools/virt-win-reg.pl:565
27500 msgid "Paths and value names are case-insensitive."
27504 #: ../tools/virt-win-reg.pl:574
27506 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
27507 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
27508 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27512 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
27514 "When reporting bugs, please enable debugging and capture the I<complete> "
27519 #: ../tools/virt-win-reg.pl:592
27522 " export LIBGUESTFS_DEBUG=1\n"
27523 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
27528 #: ../tools/virt-win-reg.pl:595
27530 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
27535 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510
27536 #: ../tools/virt-make-fs.pl:565
27537 msgid "Copyright (C) 2010 Red Hat Inc."
27541 #: ../tools/virt-resize.pl:42
27542 msgid "virt-resize - Resize a virtual machine disk"
27546 #: ../tools/virt-resize.pl:46
27549 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27550 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27551 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27556 #: ../tools/virt-resize.pl:52
27558 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27559 "larger or smaller overall, and resizing or deleting any partitions contained "
27564 #: ../tools/virt-resize.pl:56
27566 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27567 "not> be used on live virtual machines - for consistent results, shut the "
27568 "virtual machine down before resizing it."
27572 #: ../tools/virt-resize.pl:60
27574 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
27575 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
27579 #: ../tools/virt-resize.pl:66
27581 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27582 "fill the extra 5GB of space."
27586 #: ../tools/virt-resize.pl:69
27589 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27590 " virt-filesystems --long --h --all -a olddisk\n"
27591 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27592 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27597 #: ../tools/virt-resize.pl:74
27599 "As above, but make the /boot partition 200MB bigger, while giving the "
27600 "remaining space to /dev/sda2:"
27604 #: ../tools/virt-resize.pl:77
27607 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27612 #: ../tools/virt-resize.pl:79
27613 msgid "As above, but the output format will be uncompressed qcow2:"
27617 #: ../tools/virt-resize.pl:81
27620 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27621 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27626 #: ../tools/virt-resize.pl:84
27627 msgid "DETAILED USAGE"
27631 #: ../tools/virt-resize.pl:86
27632 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27636 #: ../tools/virt-resize.pl:90
27637 msgid "1. Shut down the virtual machine"
27641 #: ../tools/virt-resize.pl:92
27642 msgid "2. Locate input disk image"
27646 #: ../tools/virt-resize.pl:94
27648 "Locate the input disk image (ie. the file or device on the host containing "
27649 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27650 "dumpxml> like this to find the disk image name:"
27654 #: ../tools/virt-resize.pl:98
27657 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27658 " Found 1 nodes:\n"
27660 " <source dev=\"/dev/vg/lv_guest\" />\n"
27665 #: ../tools/virt-resize.pl:103
27666 msgid "3. Look at current sizing"
27670 #: ../tools/virt-resize.pl:105
27671 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
27675 #: ../tools/virt-resize.pl:108
27678 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
27679 " Name Type Size Parent\n"
27680 " /dev/sda1 partition 101M /dev/sda\n"
27681 " /dev/sda2 partition 7.9G /dev/sda\n"
27682 " /dev/sda device 8.0G -\n"
27687 #: ../tools/virt-resize.pl:114
27689 "(This example is a virtual machine with an 8 GB disk which we would like to "
27690 "expand up to 10 GB)."
27694 #: ../tools/virt-resize.pl:117
27695 msgid "4. Create output disk"
27699 #: ../tools/virt-resize.pl:119
27701 "Virt-resize cannot do in-place disk modifications. You have to have space "
27702 "to store the resized output disk."
27706 #: ../tools/virt-resize.pl:122
27708 "To store the resized disk image in a file, create a file of a suitable size:"
27712 #: ../tools/virt-resize.pl:125
27715 " # rm -f outdisk\n"
27716 " # truncate -s 10G outdisk\n"
27721 #: ../tools/virt-resize.pl:128
27722 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27726 #: ../tools/virt-resize.pl:130
27729 " # lvcreate -L 10G -n lv_name vg_name\n"
27734 #: ../tools/virt-resize.pl:132
27735 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27739 #: ../tools/virt-resize.pl:134
27742 " # virsh pool-list\n"
27743 " # virsh vol-create-as poolname newvol 10G\n"
27748 #: ../tools/virt-resize.pl:137
27753 #: ../tools/virt-resize.pl:139
27755 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27756 "file) and the output disk. The output disk is the one created in the "
27761 #: ../tools/virt-resize.pl:143
27764 " # virt-resize indisk outdisk\n"
27769 #: ../tools/virt-resize.pl:145
27771 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27772 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27773 "larger, then an extra, empty partition is created at the end of the disk "
27774 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27779 #: ../tools/virt-resize.pl:151
27781 "More realistically you'd want to expand existing partitions in the disk "
27782 "image by passing extra options (for the full list see the L</OPTIONS> "
27787 #: ../tools/virt-resize.pl:155
27789 "L</--expand> is the most useful option. It expands the named partition "
27790 "within the disk to fill any extra space:"
27794 #: ../tools/virt-resize.pl:158
27797 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27802 #: ../tools/virt-resize.pl:160
27804 "(In this case, an extra partition is I<not> created at the end of the disk, "
27805 "because there will be no unused space)."
27809 #: ../tools/virt-resize.pl:163
27811 "L</--resize> is the other commonly used option. The following would "
27812 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27813 "rest of the available space:"
27817 #: ../tools/virt-resize.pl:167
27820 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27821 " indisk outdisk\n"
27826 #: ../tools/virt-resize.pl:170
27828 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27829 "if virt-resize knows how, it will resize the contents, the equivalent of "
27830 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27831 ">. However virt-resize does not know how to resize some filesystems, so you "
27832 "would have to online resize them after booting the guest."
27836 #: ../tools/virt-resize.pl:177
27837 msgid "Other options are covered below."
27841 #: ../tools/virt-resize.pl:179
27846 #: ../tools/virt-resize.pl:181
27847 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27851 #: ../tools/virt-resize.pl:183
27852 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27856 #: ../tools/virt-resize.pl:185
27859 " # virsh edit guestname\n"
27864 #: ../tools/virt-resize.pl:187
27866 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27867 "html#elementsDisks>"
27871 #: ../tools/virt-resize.pl:190
27872 msgid "Then start up the domain with the new, resized disk:"
27876 #: ../tools/virt-resize.pl:192
27879 " # virsh start guestname\n"
27884 #: ../tools/virt-resize.pl:194
27886 "and check that it still works. See also the L</NOTES> section below for "
27887 "additional information."
27891 #: ../tools/virt-resize.pl:197
27892 msgid "7. Resize LVs etc inside the guest"
27896 #: ../tools/virt-resize.pl:199
27897 msgid "(This can also be done offline using L<guestfish(1)>)"
27901 #: ../tools/virt-resize.pl:201
27903 "Once the guest has booted you should see the new space available, at least "
27904 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27905 "may need to resize LVs inside PVs, and also resize filesystem types that "
27906 "virt-resize does not know how to expand."
27910 #: ../tools/virt-resize.pl:208
27911 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27915 #: ../tools/virt-resize.pl:210
27917 "Shrinking is somewhat more complex than expanding, and only an overview is "
27922 #: ../tools/virt-resize.pl:213
27924 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27925 "filesystems). The user has to shrink content before passing the disk image "
27926 "to virt-resize, and virt-resize will check that the content has been shrunk "
27931 #: ../tools/virt-resize.pl:218
27932 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27936 #: ../tools/virt-resize.pl:220
27938 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27939 "steps 3 and 4 above to allocate a new disk image."
27943 #: ../tools/virt-resize.pl:223
27945 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27949 #: ../tools/virt-resize.pl:226
27950 msgid "IGNORING OR DELETING PARTITIONS"
27954 #: ../tools/virt-resize.pl:228
27956 "virt-resize also gives a convenient way to ignore or delete partitions when "
27957 "copying from the input disk to the output disk. Ignoring a partition speeds "
27958 "up the copy where you don't care about the existing contents of a "
27959 "partition. Deleting a partition removes it completely, but note that it "
27960 "also renumbers any partitions after the one which is deleted, which can "
27961 "leave some guests unbootable."
27965 #: ../tools/virt-resize.pl:235
27966 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27970 #: ../tools/virt-resize.pl:237
27972 "If the input disk is in qcow2 format, then you may prefer that the output is "
27973 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27974 "the fly. The output format is simply determined by the format of the empty "
27975 "output container that you provide. Thus to create qcow2 output, use:"
27979 #: ../tools/virt-resize.pl:243
27982 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27987 #: ../tools/virt-resize.pl:245
27988 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
27992 #: ../tools/virt-resize.pl:247
27993 msgid "Similarly, to get non-sparse raw output use:"
27997 #: ../tools/virt-resize.pl:249
28000 " fallocate -l size outdisk\n"
28005 #: ../tools/virt-resize.pl:251
28007 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
28008 "dev/zero of=outdisk bs=1M count=..>)"
28012 #: ../tools/virt-resize.pl:264
28013 msgid "Display help."
28017 #: ../tools/virt-resize.pl:278
28018 msgid "B<--resize part=size>"
28022 #: ../tools/virt-resize.pl:280
28024 "Resize the named partition (expanding or shrinking it) so that it has the "
28029 #: ../tools/virt-resize.pl:283
28031 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
28032 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
28033 "Exabytes; or as a percentage of the current size; or as a relative number or "
28034 "percentage. For example:"
28038 #: ../tools/virt-resize.pl:288
28041 " --resize /dev/sda2=10G\n"
28046 #: ../tools/virt-resize.pl:290
28049 " --resize /dev/sda4=90%\n"
28054 #: ../tools/virt-resize.pl:292
28057 " --resize /dev/sda2=+1G\n"
28062 #: ../tools/virt-resize.pl:294
28065 " --resize /dev/sda2=-200M\n"
28070 #: ../tools/virt-resize.pl:296
28073 " --resize /dev/sda1=+128K\n"
28078 #: ../tools/virt-resize.pl:298
28081 " --resize /dev/sda1=+10%\n"
28086 #: ../tools/virt-resize.pl:300
28089 " --resize /dev/sda1=-10%\n"
28094 #: ../tools/virt-resize.pl:302
28096 "You can increase the size of any partition. Virt-resize will expand the "
28097 "direct content of the partition if it knows how (see C<--expand> below)."
28101 #: ../tools/virt-resize.pl:306
28103 "You can only I<decrease> the size of partitions that contain filesystems or "
28104 "PVs which have already been shrunk. Virt-resize will check this has been "
28105 "done before proceeding, or else will print an error (see also C<--resize-"
28110 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
28111 #: ../tools/virt-resize.pl:420
28112 msgid "You can give this option multiple times."
28116 #: ../tools/virt-resize.pl:317
28117 msgid "B<--resize-force part=size>"
28121 #: ../tools/virt-resize.pl:319
28123 "This is the same as C<--resize> except that it will let you decrease the "
28124 "size of any partition. Generally this means you will lose any data which "
28125 "was at the end of the partition you shrink, but you may not care about that "
28126 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
28127 "as a swap partition)."
28131 #: ../tools/virt-resize.pl:325
28132 msgid "See also the C<--ignore> option."
28136 #: ../tools/virt-resize.pl:331
28137 msgid "B<--expand part>"
28141 #: ../tools/virt-resize.pl:333
28143 "Expand the named partition so it uses up all extra space (space left over "
28144 "after any other resize changes that you request have been done)."
28148 #: ../tools/virt-resize.pl:336
28150 "If virt-resize knows how, it will expand the direct content of the "
28151 "partition. For example, if the partition is an LVM PV, it will expand the "
28152 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
28153 "content it doesn't know about alone."
28157 #: ../tools/virt-resize.pl:341
28158 msgid "Currently virt-resize can resize:"
28162 #: ../tools/virt-resize.pl:347
28164 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
28169 #: ../tools/virt-resize.pl:352
28171 "NTFS filesystems contained directly in a partition, if libguestfs was "
28172 "compiled with support for NTFS."
28176 #: ../tools/virt-resize.pl:355
28178 "The filesystem must have been shut down consistently last time it was used. "
28179 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
28180 "consistency check, so at the first boot after resizing Windows will check "
28185 #: ../tools/virt-resize.pl:362
28187 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
28188 "inside the PV, but see the C<--LV-expand> option. The user could also "
28189 "resize LVs as desired after boot."
28193 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
28194 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
28198 #: ../tools/virt-resize.pl:374
28199 msgid "B<--shrink part>"
28203 #: ../tools/virt-resize.pl:376
28205 "Shrink the named partition until the overall disk image fits in the "
28206 "destination. The named partition B<must> contain a filesystem or PV which "
28207 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
28208 "online tools). Virt-resize will check this and give an error if it has not "
28213 #: ../tools/virt-resize.pl:382
28215 "The amount by which the overall disk must be shrunk (after carrying out all "
28216 "other operations requested by the user) is called the \"deficit\". For "
28217 "example, a straight copy (assume no other operations) from a 5GB disk image "
28218 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
28219 "would give an error unless the user specified a partition to shrink and that "
28220 "partition had more than a gigabyte of free space."
28224 #: ../tools/virt-resize.pl:396
28225 msgid "B<--ignore part>"
28229 #: ../tools/virt-resize.pl:398
28231 "Ignore the named partition. Effectively this means the partition is "
28232 "allocated on the destination disk, but the content is not copied across from "
28233 "the source disk. The content of the partition will be blank (all zero "
28238 #: ../tools/virt-resize.pl:409
28239 msgid "B<--delete part>"
28243 #: ../tools/virt-resize.pl:411
28245 "Delete the named partition. It would be more accurate to describe this as "
28246 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
28247 "the original disk image is left intact."
28251 #: ../tools/virt-resize.pl:415
28253 "Note that when you delete a partition, then anything contained in the "
28254 "partition is also deleted. Furthermore, this causes any partitions that "
28255 "come after to be I<renumbered>, which can easily make your guest unbootable."
28259 #: ../tools/virt-resize.pl:426
28260 msgid "B<--LV-expand logvol>"
28264 #: ../tools/virt-resize.pl:428
28266 "This takes the logical volume and, as a final step, expands it to fill all "
28267 "the space available in its volume group. A typical usage, assuming a Linux "
28268 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
28269 "lv_root> would be:"
28273 #: ../tools/virt-resize.pl:433
28276 " virt-resize indisk outdisk \\\n"
28277 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
28282 #: ../tools/virt-resize.pl:436
28284 "This would first expand the partition (and PV), and then expand the root "
28285 "device to fill the extra space in the PV."
28289 #: ../tools/virt-resize.pl:439
28291 "The contents of the LV are also resized if virt-resize knows how to do "
28292 "that. You can stop virt-resize from trying to expand the content by using "
28293 "the option C<--no-expand-content>."
28297 #: ../tools/virt-resize.pl:443
28298 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
28302 #: ../tools/virt-resize.pl:446
28304 "You can give this option multiple times, I<but> it doesn't make sense to do "
28305 "this unless the logical volumes you specify are all in different volume "
28310 #: ../tools/virt-resize.pl:454
28311 msgid "B<--no-copy-boot-loader>"
28315 #: ../tools/virt-resize.pl:456
28317 "By default, virt-resize copies over some sectors at the start of the disk "
28318 "(up to the beginning of the first partition). Commonly these sectors "
28319 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28320 "in order for the guest to boot correctly."
28324 #: ../tools/virt-resize.pl:461
28326 "If you specify this flag, then this initial copy is not done. You may need "
28327 "to reinstall the boot loader in this case."
28331 #: ../tools/virt-resize.pl:469
28332 msgid "B<--no-extra-partition>"
28336 #: ../tools/virt-resize.pl:471
28338 "By default, virt-resize creates an extra partition if there is any extra, "
28339 "unused space after all resizing has happened. Use this option to prevent "
28340 "the extra partition from being created. If you do this then the extra space "
28341 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28342 "tool in the guest."
28346 #: ../tools/virt-resize.pl:477
28348 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28353 #: ../tools/virt-resize.pl:484
28354 msgid "B<--no-expand-content>"
28358 #: ../tools/virt-resize.pl:486
28360 "By default, virt-resize will try to expand the direct contents of "
28361 "partitions, if it knows how (see C<--expand> option above)."
28365 #: ../tools/virt-resize.pl:489
28367 "If you give the C<--no-expand-content> option then virt-resize will not "
28372 #: ../tools/virt-resize.pl:496
28373 msgid "B<-d> | B<--debug>"
28377 #: ../tools/virt-resize.pl:504
28378 msgid "B<-n> | B<--dryrun>"
28382 #: ../tools/virt-resize.pl:506
28383 msgid "Print a summary of what would be done, but don't do anything."
28387 #: ../tools/virt-resize.pl:512
28388 msgid "B<-q> | B<--quiet>"
28392 #: ../tools/virt-resize.pl:514
28393 msgid "Don't print the summary."
28397 #: ../tools/virt-resize.pl:522
28399 "Specify the format of the input disk image. If this flag is not given then "
28400 "it is auto-detected from the image itself."
28404 #: ../tools/virt-resize.pl:528
28406 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28407 "AND NON-SPARSE RAW FORMATS>."
28411 #: ../tools/virt-resize.pl:535
28412 msgid "B<--output-format> raw"
28416 #: ../tools/virt-resize.pl:537
28418 "Specify the format of the output disk image. If this flag is not given then "
28419 "it is auto-detected from the image itself."
28423 #: ../tools/virt-resize.pl:543
28425 "Note that you still need to create the output disk with the right format. "
28426 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28430 #: ../tools/virt-resize.pl:1419
28435 #: ../tools/virt-resize.pl:1421
28436 msgid "\"Partition 1 does not end on cylinder boundary.\""
28440 #: ../tools/virt-resize.pl:1423
28442 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28443 "means the partitions will not be aligned to the ancient CHS geometry. "
28444 "However CHS geometry is meaningless for disks manufactured since the early "
28445 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28446 "cylinders is not required by any modern operating system."
28450 #: ../tools/virt-resize.pl:1430
28451 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28455 #: ../tools/virt-resize.pl:1432
28457 "In Windows Vista and later versions, Microsoft switched to using a separate "
28458 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28459 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28460 "the boot partition. Doing so seems to break the guest completely. However "
28461 "expanding the second partition (ie. C: drive) should work."
28465 #: ../tools/virt-resize.pl:1439
28467 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28468 "NTFS partitions have been expanded. This is just a safety check and (unless "
28469 "it find errors) is nothing to worry about."
28473 #: ../tools/virt-resize.pl:1443
28474 msgid "GUEST BOOT STUCK AT \"GRUB\""
28478 #: ../tools/virt-resize.pl:1445
28480 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28481 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28482 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28483 "although we think is to do with partition alignment."
28487 #: ../tools/virt-resize.pl:1450
28490 " guestfish -i -a newdisk\n"
28491 " ><fs> cat /boot/grub/device.map\n"
28492 " # check the contents of this file are sensible or\n"
28493 " # edit the file if necessary\n"
28494 " ><fs> grub-install / /dev/vda\n"
28500 #: ../tools/virt-resize.pl:1457
28502 "For more flexible guest reconfiguration, including if you need to specify "
28503 "other parameters to grub-install, use L<virt-rescue(1)>."
28507 #: ../tools/virt-resize.pl:1460
28508 msgid "ALTERNATIVE TOOLS"
28512 #: ../tools/virt-resize.pl:1462
28514 "There are several proprietary tools for resizing partitions. We won't "
28515 "mention any here."
28519 #: ../tools/virt-resize.pl:1465
28521 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28522 "operations on disk images. They can resize and move partitions, but I don't "
28523 "think they can do anything with the contents, and they certainly don't "
28528 #: ../tools/virt-resize.pl:1470
28530 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28531 "but at a much lower level. You will probably end up hand-calculating sector "
28532 "offsets, which is something that virt-resize was designed to avoid. If you "
28533 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28538 #: ../tools/virt-resize.pl:1485
28540 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
28541 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
28542 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
28543 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
28544 "libguestfs.org/>."
28548 #: ../tools/virt-list-filesystems.pl:32
28550 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28554 #: ../tools/virt-list-filesystems.pl:36
28557 " virt-list-filesystems [--options] domname\n"
28562 #: ../tools/virt-list-filesystems.pl:38
28565 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28570 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
28572 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
28577 #: ../tools/virt-list-filesystems.pl:45
28579 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28580 "are contained in a virtual machine or disk image."
28584 #: ../tools/virt-list-filesystems.pl:49
28586 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28587 "functionality. For more complex cases you should look at the L<guestfish(1)"
28592 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
28593 msgid "B<-l> | B<--long>"
28597 #: ../tools/virt-list-filesystems.pl:108
28599 "With this option, C<virt-list-filesystems> displays the type of each "
28600 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28604 #: ../tools/virt-list-filesystems.pl:115
28605 msgid "B<-a> | B<--all>"
28609 #: ../tools/virt-list-filesystems.pl:117
28611 "Normally we only show mountable filesystems. If this option is given then "
28612 "swap devices are shown too."
28616 #: ../tools/virt-list-filesystems.pl:191
28618 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
28619 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28620 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28624 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:298
28625 msgid "Copyright (C) 2009 Red Hat Inc."
28629 #: ../tools/virt-tar.pl:33
28630 msgid "virt-tar - Extract or upload files to a virtual machine"
28634 #: ../tools/virt-tar.pl:37
28637 " virt-tar [--options] -x domname directory tarball\n"
28642 #: ../tools/virt-tar.pl:39
28645 " virt-tar [--options] -u domname tarball directory\n"
28650 #: ../tools/virt-tar.pl:41
28653 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28658 #: ../tools/virt-tar.pl:43
28661 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28666 #: ../tools/virt-tar.pl:47
28667 msgid "Download C</home> from the VM into a local tarball:"
28671 #: ../tools/virt-tar.pl:49
28674 " virt-tar -x domname /home home.tar\n"
28679 #: ../tools/virt-tar.pl:51
28682 " virt-tar -zx domname /home home.tar.gz\n"
28687 #: ../tools/virt-tar.pl:53
28688 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28692 #: ../tools/virt-tar.pl:55
28695 " virt-tar -u domname uploadstuff.tar /tmp\n"
28700 #: ../tools/virt-tar.pl:57
28703 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28708 #: ../tools/virt-tar.pl:61
28710 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28711 "virtual machines. If you do this, you risk disk corruption in the VM. "
28712 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28716 #: ../tools/virt-tar.pl:66
28718 "You can use C<-x> (extract) on live virtual machines, but you might get "
28719 "inconsistent results or errors if there is filesystem activity inside the "
28720 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28721 "work, but the only way to guarantee consistent results is if the virtual "
28722 "machine is shut down."
28726 #: ../tools/virt-tar.pl:74
28728 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28729 "parts of a guest filesystem. There are many possibilities: making backups, "
28730 "uploading data files, snooping on guest activity, fixing or customizing "
28735 #: ../tools/virt-tar.pl:79
28737 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28738 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28739 "should look at the L<guestfish(1)> tool."
28743 #: ../tools/virt-tar.pl:83
28745 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28746 "its contents (recursively) from the virtual machine into a local tarball. "
28747 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28748 "virtual machine. You cannot use these two options together."
28752 #: ../tools/virt-tar.pl:89
28754 "In addition, you may need to use the C<-z> (gZip) option to enable "
28755 "compression. When uploading, you have to specify C<-z> if the upload file "
28756 "is compressed because virt-tar won't detect this on its own."
28760 #: ../tools/virt-tar.pl:93
28762 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28763 "example it cannot do PKZip files or bzip2 compression. If you want that "
28764 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28765 "the L<libguestfs(3)> API)."
28769 #: ../tools/virt-tar.pl:151
28770 msgid "B<-x> | B<--extract> | B<--download>"
28774 #: ../tools/virt-tar.pl:153
28775 msgid "B<-u> | B<--upload>"
28779 #: ../tools/virt-tar.pl:155
28781 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28786 #: ../tools/virt-tar.pl:158
28788 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28789 "Please read the L</WARNING> section above before using this option."
28793 #: ../tools/virt-tar.pl:162
28794 msgid "You must specify exactly one of these options."
28798 #: ../tools/virt-tar.pl:168
28799 msgid "B<-z> | B<--gzip>"
28803 #: ../tools/virt-tar.pl:170
28804 msgid "Specify that the input or output tarball is gzip-compressed."
28808 #: ../tools/virt-tar.pl:283
28810 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28811 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28816 #: ../tools/virt-make-fs.pl:37
28817 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28821 #: ../tools/virt-make-fs.pl:41
28824 " virt-make-fs [--options] input.tar output.img\n"
28829 #: ../tools/virt-make-fs.pl:43
28832 " virt-make-fs [--options] input.tar.gz output.img\n"
28837 #: ../tools/virt-make-fs.pl:45
28840 " virt-make-fs [--options] directory output.img\n"
28845 #: ../tools/virt-make-fs.pl:49
28847 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28848 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28849 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28850 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28851 "you want to attach these filesystems to existing virtual machines (eg. to "
28852 "import large amounts of read-only data to a VM)."
28856 #: ../tools/virt-make-fs.pl:57
28857 msgid "Basic usage is:"
28861 #: ../tools/virt-make-fs.pl:59
28864 " virt-make-fs input output\n"
28869 #: ../tools/virt-make-fs.pl:61
28871 "where C<input> is either a directory containing files that you want to add, "
28872 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28873 "C<output> is a disk image. The input type is detected automatically. The "
28874 "output disk image defaults to a raw ext2 image unless you specify extra "
28875 "flags (see L</OPTIONS> below)."
28879 #: ../tools/virt-make-fs.pl:67
28880 msgid "EXTRA SPACE"
28884 #: ../tools/virt-make-fs.pl:69
28886 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28887 "the files that it contains, but might have extra space. Depending on how "
28888 "you are going to use the output, you might think this extra space is wasted "
28889 "and want to minimize it, or you might want to leave space so that more files "
28890 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28891 "but you can use the C<--size> flag to leave space in the filesystem if you "
28896 #: ../tools/virt-make-fs.pl:77
28898 "An alternative way to leave extra space but not make the output image any "
28899 "bigger is to use an alternative disk image format (instead of the default "
28900 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28901 "image format (check your hypervisor supports this before using it). This "
28902 "allows you to choose a large C<--size> but the extra space won't actually be "
28903 "allocated in the image until you try to store something in it."
28907 #: ../tools/virt-make-fs.pl:85
28909 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28910 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28911 "resize to build another image from scratch."
28915 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28916 #: ../tools/virt-make-fs.pl:142
28921 #: ../tools/virt-make-fs.pl:91
28924 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28929 #: ../tools/virt-make-fs.pl:93
28930 msgid "FILESYSTEM TYPE"
28934 #: ../tools/virt-make-fs.pl:95
28936 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28937 "libguestfs supports can be used (but I<not> read-only formats like "
28938 "ISO9660). Here are some of the more common choices:"
28942 #: ../tools/virt-make-fs.pl:101
28947 #: ../tools/virt-make-fs.pl:103
28949 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
28950 "you are not going to use the filesystem in a way that requires the journal, "
28951 "then this is just wasted overhead."
28955 #: ../tools/virt-make-fs.pl:107
28956 msgid "I<ntfs> or I<vfat>"
28960 #: ../tools/virt-make-fs.pl:109
28961 msgid "Useful if exporting data to a Windows guest."
28965 #: ../tools/virt-make-fs.pl:111
28967 "I<Note for vfat>: The tar archive or local directory must only contain files "
28968 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
28969 "program running within libguestfs is unable to change the ownership of non-"
28970 "root files, since vfat itself does not support this."
28974 #: ../tools/virt-make-fs.pl:116
28979 #: ../tools/virt-make-fs.pl:118
28981 "Lower overhead than C<ext2>, but certain limitations on filename length and "
28982 "total filesystem size."
28986 #: ../tools/virt-make-fs.pl:125
28989 " virt-make-fs --type=minix input minixfs.img\n"
28994 #: ../tools/virt-make-fs.pl:127
28995 msgid "TO PARTITION OR NOT TO PARTITION"
28999 #: ../tools/virt-make-fs.pl:129
29000 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29004 #: ../tools/virt-make-fs.pl:131
29006 "Adding a partition can make the disk image more compatible with certain "
29007 "virtualized operating systems which don't expect to see a filesystem "
29008 "directly located on a block device (Linux doesn't care and will happily "
29009 "handle both types)."
29013 #: ../tools/virt-make-fs.pl:136
29015 "On the other hand, if you have a partition table then the output image is no "
29016 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29017 "directly on a partitioned disk image. (However libguestfs tools such as "
29018 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29022 #: ../tools/virt-make-fs.pl:144
29023 msgid "Add an MBR partition:"
29027 #: ../tools/virt-make-fs.pl:146
29030 " virt-make-fs --partition -- input disk.img\n"
29035 #: ../tools/virt-make-fs.pl:148
29037 "If the output disk image could be terabyte-sized or larger, it's better to "
29038 "use an EFI/GPT-compatible partition table:"
29042 #: ../tools/virt-make-fs.pl:151
29045 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29050 #: ../tools/virt-make-fs.pl:179
29051 msgid "Enable debugging information."
29055 #: ../tools/virt-make-fs.pl:185
29056 msgid "B<--size=E<lt>NE<gt>>"
29060 #: ../tools/virt-make-fs.pl:187
29061 msgid "B<--size=+E<lt>NE<gt>>"
29065 #: ../tools/virt-make-fs.pl:189
29066 msgid "B<-s E<lt>NE<gt>>"
29070 #: ../tools/virt-make-fs.pl:191
29071 msgid "B<-s +E<lt>NE<gt>>"
29075 #: ../tools/virt-make-fs.pl:193
29077 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
29081 #: ../tools/virt-make-fs.pl:196
29083 "If this option is I<not> given, then the output image will be just large "
29084 "enough to contain all the files, with not much wasted space."
29088 #: ../tools/virt-make-fs.pl:199
29090 "To choose a fixed size output disk, specify an absolute number followed by b/"
29091 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29092 "Petabytes or Exabytes. This must be large enough to contain all the input "
29093 "files, else you will get an error."
29097 #: ../tools/virt-make-fs.pl:204
29099 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
29100 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29101 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29102 "the input files, and (approximately) an extra 200 MB free space."
29106 #: ../tools/virt-make-fs.pl:210
29108 "Note that virt-make-fs estimates free space, and therefore will not produce "
29109 "filesystems containing precisely the free space requested. (It is much more "
29110 "expensive and time-consuming to produce a filesystem which has precisely the "
29111 "desired free space)."
29115 #: ../tools/virt-make-fs.pl:219
29116 msgid "B<--format=E<lt>fmtE<gt>>"
29120 #: ../tools/virt-make-fs.pl:221
29121 msgid "B<-F E<lt>fmtE<gt>>"
29125 #: ../tools/virt-make-fs.pl:223
29126 msgid "Choose the output disk image format."
29130 #: ../tools/virt-make-fs.pl:225
29131 msgid "The default is C<raw> (raw disk image)."
29135 #: ../tools/virt-make-fs.pl:227
29137 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29138 "that would really make sense here is C<qcow2>."
29142 #: ../tools/virt-make-fs.pl:234
29143 msgid "B<--type=E<lt>fsE<gt>>"
29147 #: ../tools/virt-make-fs.pl:236
29148 msgid "B<-t E<lt>fsE<gt>>"
29152 #: ../tools/virt-make-fs.pl:238
29153 msgid "Choose the output filesystem type."
29157 #: ../tools/virt-make-fs.pl:240
29158 msgid "The default is C<ext2>."
29162 #: ../tools/virt-make-fs.pl:242
29164 "Any filesystem which is supported read-write by libguestfs can be used here."
29168 #: ../tools/virt-make-fs.pl:249
29169 msgid "B<--partition>"
29173 #: ../tools/virt-make-fs.pl:251
29174 msgid "B<--partition=E<lt>parttypeE<gt>>"
29178 #: ../tools/virt-make-fs.pl:253
29180 "If specified, this flag adds an MBR partition table to the output disk image."
29184 #: ../tools/virt-make-fs.pl:256
29186 "You can change the partition table type, eg. C<--partition=gpt> for large "
29191 #: ../tools/virt-make-fs.pl:259
29193 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29194 "might consider the next parameter to be the partition type. For example:"
29198 #: ../tools/virt-make-fs.pl:263
29201 " virt-make-fs --partition input.tar ...\n"
29206 #: ../tools/virt-make-fs.pl:265
29208 "would cause virt-make-fs to think you wanted to use a partition type of "
29209 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29210 "dash) between options and the input file argument:"
29214 #: ../tools/virt-make-fs.pl:269
29217 " virt-make-fs --partition -- input.tar ...\n"
29222 #: ../tools/virt-make-fs.pl:536
29224 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
29225 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
29226 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29230 #: ../tools/virt-make-fs.pl:553
29233 " export LIBGUESTFS_DEBUG=1\n"
29234 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29239 #: ../tools/virt-make-fs.pl:556
29241 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
29246 #: ../tools/virt-list-partitions.pl:32
29248 "virt-list-partitions - List partitions in a virtual machine or disk image"
29252 #: ../tools/virt-list-partitions.pl:36
29255 " virt-list-partitions [--options] domname\n"
29260 #: ../tools/virt-list-partitions.pl:38
29263 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29268 #: ../tools/virt-list-partitions.pl:45
29270 "C<virt-list-partitions> is a command line tool to list the partitions that "
29271 "are contained in a virtual machine or disk image. It is mainly useful as a "
29272 "first step to using L<virt-resize(1)>."
29276 #: ../tools/virt-list-partitions.pl:50
29278 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29279 "functionality. For more complex cases you should look at the L<guestfish(1)"
29284 #: ../tools/virt-list-partitions.pl:107
29285 msgid "B<-h> | B<--human-readable>"
29289 #: ../tools/virt-list-partitions.pl:109
29290 msgid "Show sizes in human-readable form (eg. \"1G\")."
29294 #: ../tools/virt-list-partitions.pl:117
29296 "With this option, C<virt-list-partitions> displays the type and size of each "
29297 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29301 #: ../tools/virt-list-partitions.pl:124
29302 msgid "B<-t> | B<--total>"
29306 #: ../tools/virt-list-partitions.pl:126
29308 "Display the total size of each block device (as a separate row or rows)."
29312 #: ../tools/virt-list-partitions.pl:259
29314 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
29315 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
29316 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."