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-11-19 22:30+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 ../tools/virt-df.pl:32
23 #: ../tools/virt-ls.pl:30 ../tools/virt-resize.pl:38
24 #: ../tools/virt-list-filesystems.pl:28 ../tools/virt-tar.pl:29
25 #: ../tools/virt-rescue.pl:29 ../tools/virt-make-fs.pl:33
26 #: ../tools/virt-list-partitions.pl:28
31 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
32 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
33 #: ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-df.pl:34
34 #: ../tools/virt-ls.pl:32 ../tools/virt-resize.pl:40
35 #: ../tools/virt-list-filesystems.pl:30 ../tools/virt-tar.pl:31
36 #: ../tools/virt-rescue.pl:31 ../tools/virt-make-fs.pl:35
37 #: ../tools/virt-list-partitions.pl:30
42 #: ../src/guestfs.pod:5
43 msgid "guestfs - Library for accessing and modifying virtual machine images"
47 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
48 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
49 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-df.pl:38
50 #: ../tools/virt-ls.pl:36 ../tools/virt-resize.pl:44
51 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35
52 #: ../tools/virt-rescue.pl:35 ../tools/virt-make-fs.pl:39
53 #: ../tools/virt-list-partitions.pl:34
58 #: ../src/guestfs.pod:9
61 " #include <guestfs.h>\n"
66 #: ../src/guestfs.pod:11
69 " guestfs_h *g = guestfs_create ();\n"
70 " guestfs_add_drive (g, \"guest.img\");\n"
71 " guestfs_launch (g);\n"
72 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
73 " guestfs_touch (g, \"/hello\");\n"
74 " guestfs_umount (g, \"/\");\n"
75 " guestfs_sync (g);\n"
76 " guestfs_close (g);\n"
81 #: ../src/guestfs.pod:20
84 " cc prog.c -o prog -lguestfs\n"
86 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
91 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30
92 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
93 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-df.pl:46
94 #: ../tools/virt-ls.pl:42 ../tools/virt-resize.pl:50
95 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:72
96 #: ../tools/virt-rescue.pl:51 ../tools/virt-make-fs.pl:47
97 #: ../tools/virt-list-partitions.pl:40
102 #: ../src/guestfs.pod:26
104 "Libguestfs is a library for accessing and modifying guest disk images. "
105 "Amongst the things this is good for: making batch configuration changes to "
106 "guests, getting disk used/free statistics (see also: virt-df), migrating "
107 "between virtualization systems (see also: virt-p2v), performing partial "
108 "backups, performing partial guest clones, cloning guests and changing "
109 "registry/UUID/hostname info, and much else besides."
113 #: ../src/guestfs.pod:34
115 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
116 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
117 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
122 #: ../src/guestfs.pod:39
124 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
125 "what filesystem is in each LV, etc.). It can also run commands in the "
126 "context of the guest. Also you can access filesystems over FUSE."
130 #: ../src/guestfs.pod:44
132 "Libguestfs is a library that can be linked with C and C++ management "
133 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
134 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
139 #: ../src/guestfs.pod:49
141 "You don't need to be root to use libguestfs, although obviously you do need "
142 "enough permissions to access the disk images."
146 #: ../src/guestfs.pod:52
148 "Libguestfs is a large API because it can do many things. For a gentle "
149 "introduction, please read the L</API OVERVIEW> section next."
153 #: ../src/guestfs.pod:55
158 #: ../src/guestfs.pod:57
160 "This section provides a gentler overview of the libguestfs API. We also try "
161 "to group API calls together, where that may not be obvious from reading "
162 "about the individual calls in the main section of this manual."
166 #: ../src/guestfs.pod:62
171 #: ../src/guestfs.pod:64
173 "Before you can use libguestfs calls, you have to create a handle. Then you "
174 "must add at least one disk image to the handle, followed by launching the "
175 "handle, then performing whatever operations you want, and finally closing "
176 "the handle. By convention we use the single letter C<g> for the name of the "
177 "handle variable, although of course you can use any name you want."
181 #: ../src/guestfs.pod:71
182 msgid "The general structure of all libguestfs-using programs looks like this:"
186 #: ../src/guestfs.pod:74
189 " guestfs_h *g = guestfs_create ();\n"
194 #: ../src/guestfs.pod:76
197 " /* Call guestfs_add_drive additional times if there are\n"
198 " * multiple disk images.\n"
200 " guestfs_add_drive (g, \"guest.img\");\n"
205 #: ../src/guestfs.pod:81
208 " /* Most manipulation calls won't work until you've launched\n"
209 " * the handle 'g'. You have to do this _after_ adding drives\n"
210 " * and _before_ other commands.\n"
212 " guestfs_launch (g);\n"
217 #: ../src/guestfs.pod:87
220 " /* Now you can examine what partitions, LVs etc are available.\n"
222 " char **partitions = guestfs_list_partitions (g);\n"
223 " char **logvols = guestfs_lvs (g);\n"
228 #: ../src/guestfs.pod:92
231 " /* To access a filesystem in the image, you must mount it.\n"
233 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
238 #: ../src/guestfs.pod:96
241 " /* Now you can perform filesystem actions on the guest\n"
244 " guestfs_touch (g, \"/hello\");\n"
249 #: ../src/guestfs.pod:101
252 " /* You only need to call guestfs_sync if you have made\n"
253 " * changes to the guest image. (But if you've made changes\n"
254 " * then you *must* sync). See also: guestfs_umount and\n"
255 " * guestfs_umount_all calls.\n"
257 " guestfs_sync (g);\n"
262 #: ../src/guestfs.pod:108
265 " /* Close the handle 'g'. */\n"
266 " guestfs_close (g);\n"
271 #: ../src/guestfs.pod:111
273 "The code above doesn't include any error checking. In real code you should "
274 "check return values carefully for errors. In general all functions that "
275 "return integers return C<-1> on error, and all functions that return "
276 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
277 "how to handle errors, and consult the documentation for each function call "
278 "below to see precisely how they return error indications."
282 #: ../src/guestfs.pod:119
287 #: ../src/guestfs.pod:121
289 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
290 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
291 "actual block device, or simply an empty file of zeroes that you have created "
292 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
297 #: ../src/guestfs.pod:127
299 "The call you should use in modern code for adding drives is L</"
300 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
301 "specifying that the format is raw, do:"
305 #: ../src/guestfs.pod:131
308 " guestfs_add_drive_opts (g, filename,\n"
309 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
315 #: ../src/guestfs.pod:135
316 msgid "You can add a disk read-only using:"
320 #: ../src/guestfs.pod:137
323 " guestfs_add_drive_opts (g, filename,\n"
324 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
325 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
331 #: ../src/guestfs.pod:142
333 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
334 "libguestfs won't modify the file."
338 #: ../src/guestfs.pod:145
340 "Be extremely cautious if the disk image is in use, eg. if it is being used "
341 "by a virtual machine. Adding it read-write will almost certainly cause disk "
342 "corruption, but adding it read-only is safe."
346 #: ../src/guestfs.pod:149
348 "You must add at least one disk image, and you may add multiple disk images. "
349 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
350 "first one you added), C</dev/sdb> (for the second one you added), etc."
354 #: ../src/guestfs.pod:154
356 "Once L</guestfs_launch> has been called you cannot add any more images. You "
357 "can call L</guestfs_list_devices> to get a list of the device names, in the "
358 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
362 #: ../src/guestfs.pod:159
367 #: ../src/guestfs.pod:161
369 "Before you can read or write files, create directories and so on in a disk "
370 "image that contains filesystems, you have to mount those filesystems using "
371 "L</guestfs_mount>. If you already know that a disk image contains (for "
372 "example) one partition with a filesystem on that partition, then you can "
377 #: ../src/guestfs.pod:167
380 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
385 #: ../src/guestfs.pod:169
387 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
388 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
389 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
393 #: ../src/guestfs.pod:173
395 "If you are given a disk image and you don't know what it contains then you "
396 "have to find out. Libguestfs can do that too: use L</"
397 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
398 "LVs, and either try mounting each to see what is mountable, or else examine "
399 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
400 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
401 "you might find it easier to look at higher level programs built on top of "
402 "libguestfs, in particular L<virt-inspector(1)>."
406 #: ../src/guestfs.pod:183
408 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
409 "several other variations of the C<guestfs_mount_*> call."
413 #: ../src/guestfs.pod:186
414 msgid "FILESYSTEM ACCESS AND MODIFICATION"
418 #: ../src/guestfs.pod:188
420 "The majority of the libguestfs API consists of fairly low-level calls for "
421 "accessing and modifying the files, directories, symlinks etc on mounted "
422 "filesystems. There are over a hundred such calls which you can find listed "
423 "in detail below in this man page, and we don't even pretend to cover them "
424 "all in this overview."
428 #: ../src/guestfs.pod:194
430 "Specify filenames as full paths, starting with C<\"/\"> and including the "
435 #: ../src/guestfs.pod:197
437 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
438 "the file called C<\"etc/passwd\"> then you could do:"
442 #: ../src/guestfs.pod:200
445 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
450 #: ../src/guestfs.pod:202
452 "This would return C<data> as a newly allocated buffer containing the full "
453 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
454 "or C<NULL> if there was an error."
458 #: ../src/guestfs.pod:206
460 "As another example, to create a top-level directory on that filesystem "
461 "called C<\"var\"> you would do:"
465 #: ../src/guestfs.pod:209
468 " guestfs_mkdir (g, \"/var\");\n"
473 #: ../src/guestfs.pod:211
474 msgid "To create a symlink you could do:"
478 #: ../src/guestfs.pod:213
481 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
482 " \"/etc/rc3.d/S30portmap\");\n"
487 #: ../src/guestfs.pod:216
489 "Libguestfs will reject attempts to use relative paths and there is no "
490 "concept of a current working directory."
494 #: ../src/guestfs.pod:219
496 "Libguestfs can return errors in many situations: for example if the "
497 "filesystem isn't writable, or if a file or directory that you requested "
498 "doesn't exist. If you are using the C API (documented here) you have to "
499 "check for those error conditions after each call. (Other language bindings "
500 "turn these errors into exceptions)."
504 #: ../src/guestfs.pod:225
506 "File writes are affected by the per-handle umask, set by calling L</"
507 "guestfs_umask> and defaulting to 022. See L</UMASK>."
511 #: ../src/guestfs.pod:228
516 #: ../src/guestfs.pod:230
518 "Libguestfs contains API calls to read, create and modify partition tables on "
523 #: ../src/guestfs.pod:233
525 "In the common case where you want to create a single partition covering the "
526 "whole disk, you should use the L</guestfs_part_disk> call:"
530 #: ../src/guestfs.pod:237
533 " const char *parttype = \"mbr\";\n"
534 " if (disk_is_larger_than_2TB)\n"
535 " parttype = \"gpt\";\n"
536 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
541 #: ../src/guestfs.pod:242
543 "Obviously this effectively wipes anything that was on that disk image before."
547 #: ../src/guestfs.pod:245
552 #: ../src/guestfs.pod:247
554 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
555 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
556 "you familiarize yourself with the concepts of physical volumes, volume "
557 "groups and logical volumes."
561 #: ../src/guestfs.pod:252
563 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
564 "tldp.org/HOWTO/LVM-HOWTO/>."
568 #: ../src/guestfs.pod:255
573 #: ../src/guestfs.pod:257
575 "Use L</guestfs_cat> to download small, text only files. This call is "
576 "limited to files which are less than 2 MB and which cannot contain any ASCII "
577 "NUL (C<\\0>) characters. However it has a very simple to use API."
581 #: ../src/guestfs.pod:262
583 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
584 "bit data, since it returns a (pointer, size) pair. However it is still "
585 "limited to \"small\" files, less than 2 MB."
589 #: ../src/guestfs.pod:266
591 "L</guestfs_download> can be used to download any file, with no limits on "
592 "content or size (even files larger than 4 GB)."
596 #: ../src/guestfs.pod:269
598 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
602 #: ../src/guestfs.pod:272
607 #: ../src/guestfs.pod:274
609 "It's often the case that you want to write a file or files to the disk image."
613 #: ../src/guestfs.pod:277
615 "To write a small file with fixed content, use L</guestfs_write>. To create "
616 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
617 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
618 "of other functions for creating test files, for example L</guestfs_fill> and "
619 "L</guestfs_fill_pattern>."
623 #: ../src/guestfs.pod:283
625 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
626 "file content or size (even files larger than 4 GB)."
630 #: ../src/guestfs.pod:286
632 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
636 #: ../src/guestfs.pod:288
638 "However the fastest way to upload I<large numbers of arbitrary files> is to "
639 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
640 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
641 "in a predictable way (eg. adding it last after all other drives) then you "
642 "can get the device name from L</guestfs_list_devices> and mount it directly "
643 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
644 "portable between kernel versions, and they don't support labels or UUIDs. "
645 "If you want to pre-build an image or you need to mount it using a label or "
646 "UUID, use an ISO image instead."
650 #: ../src/guestfs.pod:299
655 #: ../src/guestfs.pod:301
657 "There are various different commands for copying between files and devices "
658 "and in and out of the guest filesystem. These are summarised in the table "
663 #: ../src/guestfs.pod:307
664 msgid "B<file> to B<file>"
668 #: ../src/guestfs.pod:309
670 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
671 "directories recursively."
675 #: ../src/guestfs.pod:312
676 msgid "B<file or device> to B<file or device>"
680 #: ../src/guestfs.pod:314
682 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
683 "devices in the guest."
687 #: ../src/guestfs.pod:317
688 msgid "Example: duplicate the contents of an LV:"
692 #: ../src/guestfs.pod:319
695 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
700 #: ../src/guestfs.pod:321
702 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
703 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
704 "guestfs_copy_size>."
708 #: ../src/guestfs.pod:325
709 msgid "B<file on the host> to B<file or device>"
713 #: ../src/guestfs.pod:327
714 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
718 #: ../src/guestfs.pod:329
719 msgid "B<file or device> to B<file on the host>"
723 #: ../src/guestfs.pod:331
724 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
728 #: ../src/guestfs.pod:335
729 msgid "LISTING FILES"
733 #: ../src/guestfs.pod:337
735 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
736 "L<guestfish(1)>-equivalent command C<ll>)."
740 #: ../src/guestfs.pod:340
742 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
743 "programs, as a flat list of strings."
747 #: ../src/guestfs.pod:343
749 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
750 "directory, plus additional information about each one. It is more "
751 "equivalent to using the L<readdir(3)> call on a local filesystem."
755 #: ../src/guestfs.pod:347
757 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
761 #: ../src/guestfs.pod:350
762 msgid "RUNNING COMMANDS"
766 #: ../src/guestfs.pod:352
768 "Although libguestfs is primarily an API for manipulating files inside guest "
769 "images, we also provide some limited facilities for running commands inside "
774 #: ../src/guestfs.pod:356
775 msgid "There are many limitations to this:"
779 #: ../src/guestfs.pod:360 ../src/guestfs.pod:365 ../src/guestfs.pod:370
780 #: ../src/guestfs.pod:374 ../src/guestfs.pod:379 ../src/guestfs.pod:383
781 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:957
782 #: ../src/guestfs.pod:961 ../src/guestfs.pod:965 ../src/guestfs.pod:970
783 #: ../src/guestfs.pod:978 ../src/guestfs.pod:997 ../src/guestfs.pod:1005
784 #: ../src/guestfs.pod:1027 ../src/guestfs.pod:1031 ../src/guestfs.pod:1035
785 #: ../src/guestfs.pod:1039 ../src/guestfs.pod:1043 ../src/guestfs.pod:1047
786 #: ../src/guestfs.pod:1529 ../src/guestfs.pod:1534 ../src/guestfs.pod:1538
787 #: ../src/guestfs.pod:1648 ../src/guestfs.pod:1653 ../src/guestfs.pod:1657
788 #: ../src/guestfs.pod:2001 ../src/guestfs.pod:2007 ../src/guestfs.pod:2012
789 #: ../src/guestfs.pod:2018 ../src/guestfs.pod:2125 ../src/guestfs.pod:2129
790 #: ../src/guestfs.pod:2133 ../src/guestfs.pod:2137
791 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
792 #: ../src/guestfs-actions.pod:569 ../src/guestfs-actions.pod:577
793 #: ../src/guestfs-actions.pod:584 ../src/guestfs-actions.pod:591
794 #: ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:1591
795 #: ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599
796 #: ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1611
797 #: ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1625
798 #: ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1633
799 #: ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1775
800 #: ../src/guestfs-actions.pod:1780 ../src/guestfs-actions.pod:1785
801 #: ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850
802 #: ../src/guestfs-actions.pod:1855 ../fish/guestfish.pod:376
803 #: ../fish/guestfish.pod:380 ../fish/guestfish.pod:384
804 #: ../fish/guestfish.pod:388 ../fish/guestfish-actions.pod:13
805 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375
806 #: ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390
807 #: ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067
808 #: ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075
809 #: ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087
810 #: ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095
811 #: ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109
812 #: ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203
813 #: ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212
814 #: ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259
815 #: ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268
816 #: ../tools/virt-df.pl:161 ../tools/virt-df.pl:167 ../tools/virt-resize.pl:348
817 #: ../tools/virt-resize.pl:353 ../tools/virt-resize.pl:363
822 #: ../src/guestfs.pod:362
824 "The kernel version that the command runs under will be different from what "
829 #: ../src/guestfs.pod:367
831 "If the command needs to communicate with daemons, then most likely they "
836 #: ../src/guestfs.pod:372
837 msgid "The command will be running in limited memory."
841 #: ../src/guestfs.pod:376
843 "The network may not be available unless you enable it (see L</"
844 "guestfs_set_network>)."
848 #: ../src/guestfs.pod:381
849 msgid "Only supports Linux guests (not Windows, BSD, etc)."
853 #: ../src/guestfs.pod:385
855 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
859 #: ../src/guestfs.pod:390
861 "For SELinux guests, you may need to enable SELinux and load policy first. "
862 "See L</SELINUX> in this manpage."
866 #: ../src/guestfs.pod:395
868 "I<Security:> It is not safe to run commands from untrusted, possibly "
869 "malicious guests. These commands may attempt to exploit your program by "
870 "sending unexpected output. They could also try to exploit the Linux kernel "
871 "or qemu provided by the libguestfs appliance. They could use the network "
872 "provided by the libguestfs appliance to bypass ordinary network partitions "
873 "and firewalls. They could use the elevated privileges or different SELinux "
874 "context of your program to their advantage."
878 #: ../src/guestfs.pod:404
880 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
881 "(a script which runs when the guest next boots normally), and to have this "
882 "script run the commands you want in the normal context of the running guest, "
883 "network security and so on. For information about other security issues, "
888 #: ../src/guestfs.pod:412
890 "The two main API calls to run commands are L</guestfs_command> and L</"
891 "guestfs_sh> (there are also variations)."
895 #: ../src/guestfs.pod:415
897 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
898 "shell globs, redirections, etc will work."
902 #: ../src/guestfs.pod:418
903 msgid "CONFIGURATION FILES"
907 #: ../src/guestfs.pod:420
909 "To read and write configuration files in Linux guest filesystems, we "
910 "strongly recommend using Augeas. For example, Augeas understands how to "
911 "read and write, say, a Linux shadow password file or X.org configuration "
912 "file, and so avoids you having to write that code."
916 #: ../src/guestfs.pod:425
918 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
919 "document Augeas itself here because there is excellent documentation on the "
920 "L<http://augeas.net/> website."
924 #: ../src/guestfs.pod:429
926 "If you don't want to use Augeas (you fool!) then try calling L</"
927 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
932 #: ../src/guestfs.pod:433
937 #: ../src/guestfs.pod:435
939 "We support SELinux guests. To ensure that labeling happens correctly in "
940 "SELinux guests, you need to enable SELinux and load the guest's policy:"
944 #: ../src/guestfs.pod:441 ../src/guestfs.pod:1150 ../src/guestfs.pod:1281
949 #: ../src/guestfs.pod:443
950 msgid "Before launching, do:"
954 #: ../src/guestfs.pod:445
957 " guestfs_set_selinux (g, 1);\n"
962 #: ../src/guestfs.pod:447 ../src/guestfs.pod:1154 ../src/guestfs.pod:1285
967 #: ../src/guestfs.pod:449
969 "After mounting the guest's filesystem(s), load the policy. This is best "
970 "done by running the L<load_policy(8)> command in the guest itself:"
974 #: ../src/guestfs.pod:453
977 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
982 #: ../src/guestfs.pod:455
984 "(Older versions of C<load_policy> require you to specify the name of the "
989 #: ../src/guestfs.pod:458 ../src/guestfs.pod:1291
994 #: ../src/guestfs.pod:460
996 "Optionally, set the security context for the API. The correct security "
997 "context to use can only be known by inspecting the guest. As an example:"
1001 #: ../src/guestfs.pod:464
1004 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1009 #: ../src/guestfs.pod:468
1010 msgid "This will work for running commands and editing existing files."
1014 #: ../src/guestfs.pod:470
1016 "When new files are created, you may need to label them explicitly, for "
1017 "example by running the external command C<restorecon pathname>."
1021 #: ../src/guestfs.pod:474
1026 #: ../src/guestfs.pod:476
1028 "Certain calls are affected by the current file mode creation mask (the "
1029 "\"umask\"). In particular ones which create files or directories, such as "
1030 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1031 "either the default mode that the file is created with or modifies the mode "
1036 #: ../src/guestfs.pod:482
1038 "The default umask is C<022>, so files are created with modes such as C<0644> "
1039 "and directories with C<0755>."
1043 #: ../src/guestfs.pod:485
1045 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1046 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1047 "guestfs_chmod> after creating each file or directory."
1051 #: ../src/guestfs.pod:489
1052 msgid "For more information about umask, see L<umask(2)>."
1056 #: ../src/guestfs.pod:491 ../fish/guestfish.pod:669
1057 msgid "ENCRYPTED DISKS"
1061 #: ../src/guestfs.pod:493
1063 "Libguestfs allows you to access Linux guests which have been encrypted using "
1064 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1065 "standard. This includes nearly all whole disk encryption systems used by "
1066 "modern Linux guests."
1070 #: ../src/guestfs.pod:499
1072 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1073 "returns the string C<crypto_LUKS>)."
1077 #: ../src/guestfs.pod:502
1079 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1080 "will require the passphrase!"
1084 #: ../src/guestfs.pod:505
1086 "Opening a LUKS device creates a new device mapper device called C</dev/"
1087 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1088 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1089 "from and encrypted to the underlying block device respectively."
1093 #: ../src/guestfs.pod:511
1095 "LVM volume groups on the device can be made visible by calling L</"
1096 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1097 "(s) can now be mounted in the usual way."
1101 #: ../src/guestfs.pod:515
1103 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1104 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1105 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1106 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1107 "underlying encrypted block device)."
1111 #: ../src/guestfs.pod:522
1116 #: ../src/guestfs.pod:524
1118 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1119 "contains operating systems. (These APIs used to be in a separate Perl-only "
1120 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1121 "frequently used part of this library has been rewritten in C and moved into "
1126 #: ../src/guestfs.pod:530
1128 "Add all disks belonging to the unknown virtual machine and call L</"
1129 "guestfs_launch> in the usual way."
1133 #: ../src/guestfs.pod:533
1135 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1136 "and certain heuristics, and returns a list of operating systems that were "
1137 "found. An empty list means none were found. A single element is the root "
1138 "filesystem of the operating system. For dual- or multi-boot guests, "
1139 "multiple roots can be returned, each one corresponding to a separate "
1140 "operating system. (Multi-boot virtual machines are extremely rare in the "
1141 "world of virtualization, but since this scenario can happen, we have built "
1142 "libguestfs to deal with it.)"
1146 #: ../src/guestfs.pod:542
1148 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1149 "to get additional details about that operating system. For example, call L</"
1150 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1151 "Windows and Linux-based operating systems respectively."
1155 #: ../src/guestfs.pod:548
1157 "Un*x-like and Linux-based operating systems usually consist of several "
1158 "filesystems which are mounted at boot time (for example, a separate boot "
1159 "partition mounted on C</boot>). The inspection rules are able to detect how "
1160 "filesystems correspond to mount points. Call "
1161 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1162 "hash table like this example:"
1166 #: ../src/guestfs.pod:555
1169 " /boot => /dev/sda1\n"
1170 " / => /dev/vg_guest/lv_root\n"
1171 " /usr => /dev/vg_guest/lv_usr\n"
1176 #: ../src/guestfs.pod:559
1178 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1179 "filesystems as suggested."
1183 #: ../src/guestfs.pod:562
1185 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1186 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1190 #: ../src/guestfs.pod:566
1192 "Inspection currently only works for some common operating systems. "
1193 "Contributors are welcome to send patches for other operating systems that we "
1194 "currently cannot detect."
1198 #: ../src/guestfs.pod:570
1200 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1201 "for more details. The L</guestfs_inspect_os> function just ignores any "
1202 "encrypted devices."
1206 #: ../src/guestfs.pod:574
1208 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1209 "inspection and caches the results in the guest handle. Subsequent calls to "
1210 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1211 "read the disks. If you change the content of the guest disks, you can redo "
1212 "inspection by calling L</guestfs_inspect_os> again. (L</"
1213 "guestfs_inspect_list_applications> works a little differently from the other "
1214 "calls and does read the disks. See documentation for that function for "
1219 #: ../src/guestfs.pod:583
1220 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1224 #: ../src/guestfs.pod:585
1226 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1227 "ntfs-3g.org/> driver."
1231 #: ../src/guestfs.pod:588
1233 "DOS and Windows still use drive letters, and the filesystems are always "
1234 "treated as case insensitive by Windows itself, and therefore you might find "
1235 "a Windows configuration file referring to a path like C<c:\\windows"
1236 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1237 "might be referred to as C</WINDOWS/System32>."
1241 #: ../src/guestfs.pod:594
1243 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1244 "libguestfs to read the appropriate Windows Registry and configuration files, "
1245 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1250 #: ../src/guestfs.pod:599
1252 "Replacing backslash characters with forward slash characters is also outside "
1253 "the scope of libguestfs, but something that you can easily do."
1257 #: ../src/guestfs.pod:602
1259 "Where we can help is in resolving the case insensitivity of paths. For "
1260 "this, call L</guestfs_case_sensitive_path>."
1264 #: ../src/guestfs.pod:605
1266 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1267 "files, through the library C<hivex> which is part of the libguestfs project "
1268 "although ships as a separate tarball. You have to locate and download the "
1269 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1270 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1271 "reg(1)> for more help on this issue."
1275 #: ../src/guestfs.pod:613
1276 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1280 #: ../src/guestfs.pod:615
1282 "Although we don't want to discourage you from using the C API, we will "
1283 "mention here that the same API is also available in other languages."
1287 #: ../src/guestfs.pod:618
1289 "The API is broadly identical in all supported languages. This means that "
1290 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1291 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1292 "words, a straightforward, predictable isomorphism between each language."
1296 #: ../src/guestfs.pod:624
1298 "Error messages are automatically transformed into exceptions if the language "
1303 #: ../src/guestfs.pod:627
1305 "We don't try to \"object orientify\" parts of the API in OO languages, "
1306 "although contributors are welcome to write higher level APIs above what we "
1307 "provide in their favourite languages if they wish."
1311 #: ../src/guestfs.pod:633
1316 #: ../src/guestfs.pod:635
1318 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1319 "identical to the C API. C++ classes and exceptions are not used."
1323 #: ../src/guestfs.pod:639
1328 #: ../src/guestfs.pod:641
1330 "The C# bindings are highly experimental. Please read the warnings at the "
1331 "top of C<csharp/Libguestfs.cs>."
1335 #: ../src/guestfs.pod:644
1340 #: ../src/guestfs.pod:646
1342 "This is the only language binding that is working but incomplete. Only "
1343 "calls which return simple integers have been bound in Haskell, and we are "
1344 "looking for help to complete this binding."
1348 #: ../src/guestfs.pod:650
1353 #: ../src/guestfs.pod:652
1355 "Full documentation is contained in the Javadoc which is distributed with "
1360 #: ../src/guestfs.pod:655
1365 #: ../src/guestfs.pod:657
1366 msgid "For documentation see the file C<guestfs.mli>."
1370 #: ../src/guestfs.pod:659
1375 #: ../src/guestfs.pod:661
1376 msgid "For documentation see L<Sys::Guestfs(3)>."
1380 #: ../src/guestfs.pod:663
1385 #: ../src/guestfs.pod:665
1387 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1388 "the php-libguestfs package for your distribution."
1392 #: ../src/guestfs.pod:668
1393 msgid "The PHP binding only works correctly on 64 bit machines."
1397 #: ../src/guestfs.pod:670
1402 #: ../src/guestfs.pod:672
1403 msgid "For documentation do:"
1407 #: ../src/guestfs.pod:674
1411 " >>> import guestfs\n"
1412 " >>> help (guestfs)\n"
1417 #: ../src/guestfs.pod:678
1422 #: ../src/guestfs.pod:680
1424 "Use the Guestfs module. There is no Ruby-specific documentation, but you "
1425 "can find examples written in Ruby in the libguestfs source."
1429 #: ../src/guestfs.pod:683
1430 msgid "B<shell scripts>"
1434 #: ../src/guestfs.pod:685
1435 msgid "For documentation see L<guestfish(1)>."
1439 #: ../src/guestfs.pod:689
1440 msgid "LIBGUESTFS GOTCHAS"
1444 #: ../src/guestfs.pod:691
1446 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1447 "system [...] that works in the way it is documented but is counterintuitive "
1448 "and almost invites mistakes.\""
1452 #: ../src/guestfs.pod:695
1454 "Since we developed libguestfs and the associated tools, there are several "
1455 "things we would have designed differently, but are now stuck with for "
1456 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1457 "release, you can expect these to change. Beware of them."
1461 #: ../src/guestfs.pod:703
1462 msgid "Autosync / forgetting to sync."
1466 #: ../src/guestfs.pod:705
1468 "When modifying a filesystem from C or another language, you B<must> unmount "
1469 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1470 "libguestfs handle. You can also call:"
1474 #: ../src/guestfs.pod:709
1477 " guestfs_set_autosync (g, 1);\n"
1482 #: ../src/guestfs.pod:711
1484 "to have the unmount/sync done automatically for you when the handle 'g' is "
1485 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1489 #: ../src/guestfs.pod:715
1491 "If you forget to do this, then it is entirely possible that your changes "
1492 "won't be written out, or will be partially written, or (very rarely) that "
1493 "you'll get disk corruption."
1497 #: ../src/guestfs.pod:719
1499 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1500 "guestfish scripts that forget to sync will work just fine, which can make "
1501 "this very puzzling if you are trying to debug a problem."
1505 #: ../src/guestfs.pod:723
1507 "Update: Autosync is enabled by default for all API users starting from "
1508 "libguestfs 1.5.24."
1512 #: ../src/guestfs.pod:726
1513 msgid "Mount option C<-o sync> should not be the default."
1517 #: ../src/guestfs.pod:728
1519 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1520 "However C<-o sync> does not add any reliability benefit, but does have a "
1521 "very large performance impact."
1525 #: ../src/guestfs.pod:732
1527 "The work around is to use L</guestfs_mount_options> and set the mount "
1528 "options that you actually want to use."
1532 #: ../src/guestfs.pod:735
1533 msgid "Read-only should be the default."
1537 #: ../src/guestfs.pod:737
1539 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1540 "specify I<--rw> if you want to make changes to the image."
1544 #: ../src/guestfs.pod:740
1545 msgid "This would reduce the potential to corrupt live VM images."
1549 #: ../src/guestfs.pod:742
1551 "Note that many filesystems change the disk when you just mount and unmount, "
1552 "even if you didn't perform any writes. You need to use L</"
1553 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1557 #: ../src/guestfs.pod:746
1558 msgid "guestfish command line is hard to use."
1562 #: ../src/guestfs.pod:748
1564 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1565 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1566 "exist, so it fails. In earlier versions of guestfish the error message was "
1567 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1568 "we should have used C<guestfish -c command> to run commands."
1572 #: ../src/guestfs.pod:755
1573 msgid "guestfish megabyte modifiers don't work right on all commands"
1577 #: ../src/guestfs.pod:757
1579 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1580 "other modifiers). What guestfish actually does is to multiply the number "
1581 "part by the modifier part and pass the result to the C API. However this "
1582 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1583 "expecting some other unit (eg. megabytes)."
1587 #: ../src/guestfs.pod:764
1588 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1592 #: ../src/guestfs.pod:766
1595 " lvcreate LV VG 100M\n"
1600 #: ../src/guestfs.pod:768
1602 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1603 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1604 "megabytes * megabytes) logical volume. The error message you get from this "
1605 "is also a little obscure."
1609 #: ../src/guestfs.pod:773
1611 "This could be fixed in the generator by specially marking parameters and "
1612 "return values which take bytes or other units."
1616 #: ../src/guestfs.pod:776
1617 msgid "Ambiguity between devices and paths"
1621 #: ../src/guestfs.pod:778
1623 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1624 "sdb2>) and a similar pathname. A file might just happen to be called "
1625 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1629 #: ../src/guestfs.pod:783
1631 "In the current API we usually resolve this ambiguity by having two separate "
1632 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1633 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1634 "detecting if the path supplied begins with C</dev/>."
1638 #: ../src/guestfs.pod:789
1640 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1641 "make paths/devices into structured names. One way to do this would be to "
1642 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1643 "aspect of grub. Another way would be to use a structured type, equivalent "
1644 "to this OCaml type:"
1648 #: ../src/guestfs.pod:795
1651 " type path = Path of string | Device of int | Partition of int * int\n"
1656 #: ../src/guestfs.pod:797
1657 msgid "which would allow you to pass arguments like:"
1661 #: ../src/guestfs.pod:799
1664 " Path \"/foo/bar\"\n"
1665 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1666 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1667 " Path \"/dev/sdb2\" (* not a device *)\n"
1672 #: ../src/guestfs.pod:804
1674 "As you can see there are still problems to resolve even with this "
1675 "representation. Also consider how it might work in guestfish."
1679 #: ../src/guestfs.pod:809
1680 msgid "PROTOCOL LIMITS"
1684 #: ../src/guestfs.pod:811
1686 "Internally libguestfs uses a message-based protocol to pass API calls and "
1687 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1688 "plenty more detail about this). The maximum message size used by the "
1689 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1690 "aware of this limit. The API calls which may be affected are individually "
1691 "documented, with a link back to this section of the documentation."
1695 #: ../src/guestfs.pod:819
1697 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1698 "a simple string. Because this string is at some point internally encoded as "
1699 "a message, the maximum size that it can return is slightly under 4 MB. If "
1700 "the requested file is larger than this then you will get an error."
1704 #: ../src/guestfs.pod:825
1706 "In order to transfer large files into and out of the guest filesystem, you "
1707 "need to use particular calls that support this. The sections L</UPLOADING> "
1708 "and L</DOWNLOADING> document how to do this."
1712 #: ../src/guestfs.pod:829
1714 "You might also consider mounting the disk image using our FUSE filesystem "
1715 "support (L<guestmount(1)>)."
1719 #: ../src/guestfs.pod:832
1720 msgid "KEYS AND PASSPHRASES"
1724 #: ../src/guestfs.pod:834
1726 "Certain libguestfs calls take a parameter that contains sensitive key "
1727 "material, passed in as a C string."
1731 #: ../src/guestfs.pod:837
1733 "In the future we would hope to change the libguestfs implementation so that "
1734 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1735 "swap. However this is I<not> done at the moment, because of the complexity "
1736 "of such an implementation."
1740 #: ../src/guestfs.pod:842
1742 "Therefore you should be aware that any key parameter you pass to libguestfs "
1743 "might end up being written out to the swap partition. If this is a concern, "
1744 "scrub the swap partition or don't use libguestfs on encrypted devices."
1748 #: ../src/guestfs.pod:847
1749 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1753 #: ../src/guestfs.pod:849
1755 "All high-level libguestfs actions are synchronous. If you want to use "
1756 "libguestfs asynchronously then you must create a thread."
1760 #: ../src/guestfs.pod:852
1762 "Only use the handle from a single thread. Either use the handle exclusively "
1763 "from one thread, or provide your own mutex so that two threads cannot issue "
1764 "calls on the same handle at the same time."
1768 #: ../src/guestfs.pod:856
1770 "See the graphical program guestfs-browser for one possible architecture for "
1771 "multithreaded programs using libvirt and libguestfs."
1775 #: ../src/guestfs.pod:859
1780 #: ../src/guestfs.pod:861
1782 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1787 #: ../src/guestfs.pod:864
1789 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1790 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1794 #: ../src/guestfs.pod:867
1796 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1797 "to change the directories that libguestfs will search in. The value is a "
1798 "colon-separated list of paths. The current directory is I<not> searched "
1799 "unless the path contains an empty element or C<.>. For example "
1800 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1801 "then C</usr/lib/guestfs>."
1805 #: ../src/guestfs.pod:874
1806 msgid "QEMU WRAPPERS"
1810 #: ../src/guestfs.pod:876
1812 "If you want to compile your own qemu, run qemu from a non-standard location, "
1813 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1818 #: ../src/guestfs.pod:880
1820 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1821 "last command in the shell script (so that qemu replaces the shell and "
1822 "becomes the direct child of the libguestfs-using program). If you don't do "
1823 "this, then the qemu process won't be cleaned up correctly."
1827 #: ../src/guestfs.pod:885
1829 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1834 #: ../src/guestfs.pod:888
1838 " qemudir=/home/rjones/d/qemu\n"
1839 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1844 #: ../src/guestfs.pod:892
1846 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1847 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1852 #: ../src/guestfs.pod:896
1855 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1860 #: ../src/guestfs.pod:898
1862 "Note that libguestfs also calls qemu with the -help and -version options in "
1863 "order to determine features."
1867 #: ../src/guestfs.pod:901
1868 msgid "ABI GUARANTEE"
1872 #: ../src/guestfs.pod:903
1874 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1875 "actions as outlined in this section. Although we will deprecate some "
1876 "actions, for example if they get replaced by newer calls, we will keep the "
1877 "old actions forever. This allows you the developer to program in confidence "
1878 "against the libguestfs API."
1882 #: ../src/guestfs.pod:909
1883 msgid "BLOCK DEVICE NAMING"
1887 #: ../src/guestfs.pod:911
1889 "In the kernel there is now quite a profusion of schemata for naming block "
1890 "devices (in this context, by I<block device> I mean a physical or virtual "
1891 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1892 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1893 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1894 "for the old IDE driver (particularly for SATA devices) those devices also "
1895 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1896 "paravirtualized drivers. This has created several different naming systems, "
1897 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1901 #: ../src/guestfs.pod:923
1903 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1904 "Linux kernel to access block devices. We can run a variety of appliances "
1905 "based on a variety of Linux kernels."
1909 #: ../src/guestfs.pod:927
1911 "This causes a problem for libguestfs because many API calls use device or "
1912 "partition names. Working scripts and the recipe (example) scripts that we "
1913 "make available over the internet could fail if the naming scheme changes."
1917 #: ../src/guestfs.pod:932
1919 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1920 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1921 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1922 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1926 #: ../src/guestfs.pod:938
1928 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1929 "L</guestfs_list_partitions> and similar calls return the true names of the "
1930 "devices and partitions as known to the appliance."
1934 #: ../src/guestfs.pod:943
1935 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1939 #: ../src/guestfs.pod:945
1941 "Usually this translation is transparent. However in some (very rare) cases "
1942 "you may need to know the exact algorithm. Such cases include where you use "
1943 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
1944 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
1948 #: ../src/guestfs.pod:951
1950 "The algorithm is applied only to I<parameters> which are known to be either "
1951 "device or partition names. Return values from functions such as L</"
1952 "guestfs_list_devices> are never changed."
1956 #: ../src/guestfs.pod:959
1957 msgid "Is the string a parameter which is a device or partition name?"
1961 #: ../src/guestfs.pod:963
1962 msgid "Does the string begin with C</dev/sd>?"
1966 #: ../src/guestfs.pod:967
1968 "Does the named device exist? If so, we use that device. However if I<not> "
1969 "then we continue with this algorithm."
1973 #: ../src/guestfs.pod:972
1974 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1978 #: ../src/guestfs.pod:974
1979 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1983 #: ../src/guestfs.pod:976
1984 msgid "If that named device exists, use it. If not, continue."
1988 #: ../src/guestfs.pod:980
1989 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1993 #: ../src/guestfs.pod:982
1994 msgid "If that named device exists, use it. If not, return an error."
1998 #: ../src/guestfs.pod:986
1999 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2003 #: ../src/guestfs.pod:988
2005 "Although the standard naming scheme and automatic translation is useful for "
2006 "simple programs and guestfish scripts, for larger programs it is best not to "
2007 "rely on this mechanism."
2011 #: ../src/guestfs.pod:992
2013 "Where possible for maximum future portability programs using libguestfs "
2014 "should use these future-proof techniques:"
2018 #: ../src/guestfs.pod:999
2020 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2021 "device names, and then use those names directly."
2025 #: ../src/guestfs.pod:1002
2027 "Since those device names exist by definition, they will never be translated."
2031 #: ../src/guestfs.pod:1007
2033 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2034 "filesystem labels."
2038 #: ../src/guestfs.pod:1012
2043 #: ../src/guestfs.pod:1014
2045 "This section discusses security implications of using libguestfs, "
2046 "particularly with untrusted or malicious guests or disk images."
2050 #: ../src/guestfs.pod:1017
2051 msgid "GENERAL SECURITY CONSIDERATIONS"
2055 #: ../src/guestfs.pod:1019
2057 "Be careful with any files or data that you download from a guest (by "
2058 "\"download\" we mean not just the L</guestfs_download> command but any "
2059 "command that reads files, filenames, directories or anything else from a "
2060 "disk image). An attacker could manipulate the data to fool your program "
2061 "into doing the wrong thing. Consider cases such as:"
2065 #: ../src/guestfs.pod:1029
2066 msgid "the data (file etc) not being present"
2070 #: ../src/guestfs.pod:1033
2071 msgid "being present but empty"
2075 #: ../src/guestfs.pod:1037
2076 msgid "being much larger than normal"
2080 #: ../src/guestfs.pod:1041
2081 msgid "containing arbitrary 8 bit data"
2085 #: ../src/guestfs.pod:1045
2086 msgid "being in an unexpected character encoding"
2090 #: ../src/guestfs.pod:1049
2091 msgid "containing homoglyphs."
2095 #: ../src/guestfs.pod:1053
2096 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2100 #: ../src/guestfs.pod:1055
2102 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2103 "(VFS) module can sometimes be escalated into exploits by deliberately "
2104 "creating a malicious, malformed filesystem. These exploits are very severe "
2105 "for two reasons. Firstly there are very many filesystem drivers in the "
2106 "kernel, and many of them are infrequently used and not much developer "
2107 "attention has been paid to the code. Linux userspace helps potential "
2108 "crackers by detecting the filesystem type and automatically choosing the "
2109 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2110 "the administrator. Secondly, a kernel-level exploit is like a local root "
2111 "exploit (worse in some ways), giving immediate and total access to the "
2112 "system right down to the hardware level."
2116 #: ../src/guestfs.pod:1068
2118 "That explains why you should never mount a filesystem from an untrusted "
2119 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2120 "inside a qemu virtual machine, usually running as a non-root user. The "
2121 "attacker would need to write a filesystem which first exploited the kernel, "
2122 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2123 "the libguestfs protocol, and finally to be as serious as the host kernel "
2124 "exploit it would need to escalate its privileges to root. This multi-step "
2125 "escalation, performed by a static piece of data, is thought to be extremely "
2126 "hard to do, although we never say 'never' about security issues."
2130 #: ../src/guestfs.pod:1079
2132 "In any case callers can reduce the attack surface by forcing the filesystem "
2133 "type when mounting (use L</guestfs_mount_vfs>)."
2137 #: ../src/guestfs.pod:1082
2138 msgid "PROTOCOL SECURITY"
2142 #: ../src/guestfs.pod:1084
2144 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2145 "defined upper message size. However a program that uses libguestfs must "
2146 "also take care - for example you can write a program that downloads a binary "
2147 "from a disk image and executes it locally, and no amount of protocol "
2148 "security will save you from the consequences."
2152 #: ../src/guestfs.pod:1090
2153 msgid "INSPECTION SECURITY"
2157 #: ../src/guestfs.pod:1092
2159 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2160 "directly from the guest, and these could contain any 8 bit data. Callers "
2161 "should be careful to escape these before printing them to a structured file "
2162 "(for example, use HTML escaping if creating a web page)."
2166 #: ../src/guestfs.pod:1098
2168 "Guest configuration may be altered in unusual ways by the administrator of "
2169 "the virtual machine, and may not reflect reality (particularly for untrusted "
2170 "or actively malicious guests). For example we parse the hostname from "
2171 "configuration files like C</etc/sysconfig/network> that we find in the "
2172 "guest, but the guest administrator can easily manipulate these files to "
2173 "provide the wrong hostname."
2177 #: ../src/guestfs.pod:1106
2179 "The inspection API parses guest configuration using two external libraries: "
2180 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2181 "designed to be robust in the face of malicious data, although denial of "
2182 "service attacks are still possible, for example with oversized configuration "
2187 #: ../src/guestfs.pod:1112
2188 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2192 #: ../src/guestfs.pod:1114
2194 "Be very cautious about running commands from the guest. By running a "
2195 "command in the guest, you are giving CPU time to a binary that you do not "
2196 "control, under the same user account as the library, albeit wrapped in qemu "
2197 "virtualization. More information and alternatives can be found in the "
2198 "section L</RUNNING COMMANDS>."
2202 #: ../src/guestfs.pod:1120
2203 msgid "CVE-2010-3851"
2207 #: ../src/guestfs.pod:1122
2208 msgid "https://bugzilla.redhat.com/642934"
2212 #: ../src/guestfs.pod:1124
2214 "This security bug concerns the automatic disk format detection that qemu "
2215 "does on disk images."
2219 #: ../src/guestfs.pod:1127
2221 "A raw disk image is just the raw bytes, there is no header. Other disk "
2222 "images like qcow2 contain a special header. Qemu deals with this by looking "
2223 "for one of the known headers, and if none is found then assuming the disk "
2224 "image must be raw."
2228 #: ../src/guestfs.pod:1132
2230 "This allows a guest which has been given a raw disk image to write some "
2231 "other header. At next boot (or when the disk image is accessed by "
2232 "libguestfs) qemu would do autodetection and think the disk image format was, "
2233 "say, qcow2 based on the header written by the guest."
2237 #: ../src/guestfs.pod:1137
2239 "This in itself would not be a problem, but qcow2 offers many features, one "
2240 "of which is to allow a disk image to refer to another image (called the "
2241 "\"backing disk\"). It does this by placing the path to the backing disk "
2242 "into the qcow2 header. This path is not validated and could point to any "
2243 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2244 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2245 "control of the attacker."
2249 #: ../src/guestfs.pod:1145
2251 "In libguestfs this is rather hard to exploit except under two circumstances:"
2255 #: ../src/guestfs.pod:1152
2256 msgid "You have enabled the network or have opened the disk in write mode."
2260 #: ../src/guestfs.pod:1156
2262 "You are also running untrusted code from the guest (see L</RUNNING "
2267 #: ../src/guestfs.pod:1161
2269 "The way to avoid this is to specify the expected disk format when adding "
2270 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2271 "should always do this if the disk is raw format, and it's a good idea for "
2276 #: ../src/guestfs.pod:1166
2278 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2279 "format is fetched from libvirt and passed through."
2283 #: ../src/guestfs.pod:1169
2285 "For libguestfs tools, use the I<--format> command line parameter as "
2290 #: ../src/guestfs.pod:1172
2291 msgid "CONNECTION MANAGEMENT"
2295 #: ../src/guestfs.pod:1174
2300 #: ../src/guestfs.pod:1176
2302 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2303 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2304 "handle and release all resources used."
2308 #: ../src/guestfs.pod:1180
2310 "For information on using multiple handles and threads, see the section L</"
2311 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2315 #: ../src/guestfs.pod:1183
2316 msgid "guestfs_create"
2320 #: ../src/guestfs.pod:1185
2323 " guestfs_h *guestfs_create (void);\n"
2328 #: ../src/guestfs.pod:1187
2329 msgid "Create a connection handle."
2333 #: ../src/guestfs.pod:1189
2335 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2336 "on the handle at least once."
2340 #: ../src/guestfs.pod:1192
2342 "This function returns a non-NULL pointer to a handle on success or NULL on "
2347 #: ../src/guestfs.pod:1195
2348 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2352 #: ../src/guestfs.pod:1197
2354 "You may also want to configure error handling for the handle. See L</ERROR "
2355 "HANDLING> section below."
2359 #: ../src/guestfs.pod:1200
2360 msgid "guestfs_close"
2364 #: ../src/guestfs.pod:1202
2367 " void guestfs_close (guestfs_h *g);\n"
2372 #: ../src/guestfs.pod:1204
2373 msgid "This closes the connection handle and frees up all resources used."
2377 #: ../src/guestfs.pod:1206
2378 msgid "ERROR HANDLING"
2382 #: ../src/guestfs.pod:1208
2384 "API functions can return errors. For example, almost all functions that "
2385 "return C<int> will return C<-1> to indicate an error."
2389 #: ../src/guestfs.pod:1211
2391 "Additional information is available for errors: an error message string and "
2392 "optionally an error number (errno) if the thing that failed was a system "
2397 #: ../src/guestfs.pod:1215
2399 "You can get at the additional information about the last error on the handle "
2400 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2401 "up an error handler with L</guestfs_set_error_handler>."
2405 #: ../src/guestfs.pod:1220
2407 "When the handle is created, a default error handler is installed which "
2408 "prints the error message string to C<stderr>. For small short-running "
2409 "command line programs it is sufficient to do:"
2413 #: ../src/guestfs.pod:1224
2416 " if (guestfs_launch (g) == -1)\n"
2417 " exit (EXIT_FAILURE);\n"
2422 #: ../src/guestfs.pod:1227
2424 "since the default error handler will ensure that an error message has been "
2425 "printed to C<stderr> before the program exits."
2429 #: ../src/guestfs.pod:1230
2431 "For other programs the caller will almost certainly want to install an "
2432 "alternate error handler or do error handling in-line like this:"
2436 #: ../src/guestfs.pod:1233
2439 " g = guestfs_create ();\n"
2444 #: ../src/guestfs.pod:1235
2447 " /* This disables the default behaviour of printing errors\n"
2449 " guestfs_set_error_handler (g, NULL, NULL);\n"
2454 #: ../src/guestfs.pod:1239
2457 " if (guestfs_launch (g) == -1) {\n"
2458 " /* Examine the error message and print it etc. */\n"
2459 " char *msg = guestfs_last_error (g);\n"
2460 " int errnum = guestfs_last_errno (g);\n"
2461 " fprintf (stderr, \"%s\\n\", msg);\n"
2468 #: ../src/guestfs.pod:1247
2470 "Out of memory errors are handled differently. The default action is to call "
2471 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2472 "guestfs_set_out_of_memory_handler>."
2476 #: ../src/guestfs.pod:1251
2478 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2479 "because there is no handle if this happens there is no way to get additional "
2480 "error information. However L</guestfs_create> is supposed to be a "
2481 "lightweight operation which can only fail because of insufficient memory (it "
2482 "returns NULL in this case)."
2486 #: ../src/guestfs.pod:1257
2487 msgid "guestfs_last_error"
2491 #: ../src/guestfs.pod:1259
2494 " const char *guestfs_last_error (guestfs_h *g);\n"
2499 #: ../src/guestfs.pod:1261
2501 "This returns the last error message that happened on C<g>. If there has not "
2502 "been an error since the handle was created, then this returns C<NULL>."
2506 #: ../src/guestfs.pod:1265
2508 "The lifetime of the returned string is until the next error occurs, or L</"
2509 "guestfs_close> is called."
2513 #: ../src/guestfs.pod:1268
2514 msgid "guestfs_last_errno"
2518 #: ../src/guestfs.pod:1270
2521 " int guestfs_last_errno (guestfs_h *g);\n"
2526 #: ../src/guestfs.pod:1272
2527 msgid "This returns the last error number (errno) that happened on C<g>."
2531 #: ../src/guestfs.pod:1274
2532 msgid "If successful, an errno integer not equal to zero is returned."
2536 #: ../src/guestfs.pod:1276
2538 "If no error, this returns 0. This call can return 0 in three situations:"
2542 #: ../src/guestfs.pod:1283
2543 msgid "There has not been any error on the handle."
2547 #: ../src/guestfs.pod:1287
2549 "There has been an error but the errno was meaningless. This corresponds to "
2550 "the case where the error did not come from a failed system call, but for "
2551 "some other reason."
2555 #: ../src/guestfs.pod:1293
2557 "There was an error from a failed system call, but for some reason the errno "
2558 "was not captured and returned. This usually indicates a bug in libguestfs."
2562 #: ../src/guestfs.pod:1299
2564 "Libguestfs tries to convert the errno from inside the applicance into a "
2565 "corresponding errno for the caller (not entirely trivial: the appliance "
2566 "might be running a completely different operating system from the library "
2567 "and error numbers are not standardized across Un*xen). If this could not be "
2568 "done, then the error is translated to C<EINVAL>. In practice this should "
2569 "only happen in very rare circumstances."
2573 #: ../src/guestfs.pod:1307
2574 msgid "guestfs_set_error_handler"
2578 #: ../src/guestfs.pod:1309
2581 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2583 " const char *msg);\n"
2584 " void guestfs_set_error_handler (guestfs_h *g,\n"
2585 " guestfs_error_handler_cb cb,\n"
2591 #: ../src/guestfs.pod:1316
2593 "The callback C<cb> will be called if there is an error. The parameters "
2594 "passed to the callback are an opaque data pointer and the error message "
2599 #: ../src/guestfs.pod:1320
2601 "C<errno> is not passed to the callback. To get that the callback must call "
2602 "L</guestfs_last_errno>."
2606 #: ../src/guestfs.pod:1323
2608 "Note that the message string C<msg> is freed as soon as the callback "
2609 "function returns, so if you want to stash it somewhere you must make your "
2614 #: ../src/guestfs.pod:1327
2615 msgid "The default handler prints messages on C<stderr>."
2619 #: ../src/guestfs.pod:1329
2620 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2624 #: ../src/guestfs.pod:1331
2625 msgid "guestfs_get_error_handler"
2629 #: ../src/guestfs.pod:1333
2632 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2633 " void **opaque_rtn);\n"
2638 #: ../src/guestfs.pod:1336
2639 msgid "Returns the current error handler callback."
2643 #: ../src/guestfs.pod:1338
2644 msgid "guestfs_set_out_of_memory_handler"
2648 #: ../src/guestfs.pod:1340
2651 " typedef void (*guestfs_abort_cb) (void);\n"
2652 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2653 " guestfs_abort_cb);\n"
2658 #: ../src/guestfs.pod:1344
2660 "The callback C<cb> will be called if there is an out of memory situation. "
2661 "I<Note this callback must not return>."
2665 #: ../src/guestfs.pod:1347
2666 msgid "The default is to call L<abort(3)>."
2670 #: ../src/guestfs.pod:1349
2672 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2676 #: ../src/guestfs.pod:1352
2677 msgid "guestfs_get_out_of_memory_handler"
2681 #: ../src/guestfs.pod:1354
2684 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2689 #: ../src/guestfs.pod:1356
2690 msgid "This returns the current out of memory handler."
2694 #: ../src/guestfs.pod:1358
2699 #: ../src/guestfs.pod:1360 ../fish/guestfish.pod:907
2704 #: ../src/guestfs.pod:1362
2709 #: ../src/guestfs.pod:1364
2714 #: ../src/guestfs.pod:1366
2715 msgid "AVAILABILITY"
2719 #: ../src/guestfs.pod:1368
2720 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2724 #: ../src/guestfs.pod:1370
2726 "Using L</guestfs_available> you can test availability of the following "
2727 "groups of functions. This test queries the appliance to see if the "
2728 "appliance you are currently using supports the functionality."
2732 #: ../src/guestfs.pod:1375
2733 msgid "@AVAILABILITY@"
2737 #: ../src/guestfs.pod:1377
2738 msgid "GUESTFISH supported COMMAND"
2742 #: ../src/guestfs.pod:1379
2744 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2745 "prints out the available groups and whether they are supported by this build "
2746 "of libguestfs. Note however that you have to do C<run> first."
2750 #: ../src/guestfs.pod:1384
2751 msgid "SINGLE CALLS AT COMPILE TIME"
2755 #: ../src/guestfs.pod:1386
2757 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2758 "function, such as:"
2762 #: ../src/guestfs.pod:1389
2765 " #define LIBGUESTFS_HAVE_DD 1\n"
2770 #: ../src/guestfs.pod:1391
2771 msgid "if L</guestfs_dd> is available."
2775 #: ../src/guestfs.pod:1393
2777 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2778 "function is available at compile time, we recommended using build tools such "
2779 "as autoconf or cmake. For example in autotools you could use:"
2783 #: ../src/guestfs.pod:1398
2786 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2787 " AC_CHECK_FUNCS([guestfs_dd])\n"
2792 #: ../src/guestfs.pod:1401
2794 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2799 #: ../src/guestfs.pod:1404
2800 msgid "SINGLE CALLS AT RUN TIME"
2804 #: ../src/guestfs.pod:1406
2806 "Testing at compile time doesn't guarantee that a function really exists in "
2807 "the library. The reason is that you might be dynamically linked against a "
2808 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2809 "This situation unfortunately results in a segmentation fault, which is a "
2810 "shortcoming of the C dynamic linking system itself."
2814 #: ../src/guestfs.pod:1413
2816 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2817 "in this example program (note that you still need the compile time check as "
2822 #: ../src/guestfs.pod:1417
2825 " #include <stdio.h>\n"
2826 " #include <stdlib.h>\n"
2827 " #include <unistd.h>\n"
2828 " #include <dlfcn.h>\n"
2829 " #include <guestfs.h>\n"
2834 #: ../src/guestfs.pod:1423
2839 " #ifdef LIBGUESTFS_HAVE_DD\n"
2841 " int has_function;\n"
2846 #: ../src/guestfs.pod:1429
2849 " /* Test if the function guestfs_dd is really available. */\n"
2850 " dl = dlopen (NULL, RTLD_LAZY);\n"
2852 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2853 " exit (EXIT_FAILURE);\n"
2855 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2861 #: ../src/guestfs.pod:1438
2864 " if (!has_function)\n"
2865 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2867 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2868 " /* Now it's safe to call\n"
2869 " guestfs_dd (g, \"foo\", \"bar\");\n"
2873 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2880 #: ../src/guestfs.pod:1451
2882 "You may think the above is an awful lot of hassle, and it is. There are "
2883 "other ways outside of the C linking system to ensure that this kind of "
2884 "incompatibility never arises, such as using package versioning:"
2888 #: ../src/guestfs.pod:1456
2891 " Requires: libguestfs >= 1.0.80\n"
2896 #: ../src/guestfs.pod:1458
2897 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2901 #: ../src/guestfs.pod:1460
2903 "A recent feature of the API is the introduction of calls which take optional "
2904 "arguments. In C these are declared 3 ways. The main way is as a call which "
2905 "takes variable arguments (ie. C<...>), as in this example:"
2909 #: ../src/guestfs.pod:1465
2912 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2917 #: ../src/guestfs.pod:1467
2919 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2920 "call with no optional arguments specified:"
2924 #: ../src/guestfs.pod:1470
2927 " guestfs_add_drive_opts (g, filename, -1);\n"
2932 #: ../src/guestfs.pod:1472
2933 msgid "With a single optional argument:"
2937 #: ../src/guestfs.pod:1474
2940 " guestfs_add_drive_opts (g, filename,\n"
2941 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2947 #: ../src/guestfs.pod:1478
2952 #: ../src/guestfs.pod:1480
2955 " guestfs_add_drive_opts (g, filename,\n"
2956 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2957 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2963 #: ../src/guestfs.pod:1485
2965 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2970 #: ../src/guestfs.pod:1488
2971 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2975 #: ../src/guestfs.pod:1490
2977 "The second variant has the same name with the suffix C<_va>, which works the "
2978 "same way but takes a C<va_list>. See the C manual for details. For the "
2979 "example function, this is declared:"
2983 #: ../src/guestfs.pod:1494
2986 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2992 #: ../src/guestfs.pod:1497
2993 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2997 #: ../src/guestfs.pod:1499
2999 "The third variant is useful where you need to construct these calls. You "
3000 "pass in a structure where you fill in the optional fields. The structure "
3001 "has a bitmask as the first element which you must set to indicate which "
3002 "fields you have filled in. For our example function the structure and call "
3007 #: ../src/guestfs.pod:1505
3010 " struct guestfs_add_drive_opts_argv {\n"
3011 " uint64_t bitmask;\n"
3013 " const char *format;\n"
3016 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3017 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3022 #: ../src/guestfs.pod:1514
3023 msgid "You could call it like this:"
3027 #: ../src/guestfs.pod:1516
3030 " struct guestfs_add_drive_opts_argv optargs = {\n"
3031 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3032 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3034 " .format = \"qcow2\"\n"
3040 #: ../src/guestfs.pod:1523
3043 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3048 #: ../src/guestfs.pod:1525 ../src/guestfs-actions.pod:11
3049 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9
3050 #: ../fish/guestfish-actions.pod:1255
3055 #: ../src/guestfs.pod:1531
3056 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3060 #: ../src/guestfs.pod:1536
3061 msgid "You do not need to fill in all fields of the structure."
3065 #: ../src/guestfs.pod:1540
3067 "There must be a one-to-one correspondence between fields of the structure "
3068 "that are filled in, and bits set in the bitmask."
3072 #: ../src/guestfs.pod:1545
3073 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3077 #: ../src/guestfs.pod:1547
3079 "In other languages, optional arguments are expressed in the way that is "
3080 "natural for that language. We refer you to the language-specific "
3081 "documentation for more details on that."
3085 #: ../src/guestfs.pod:1551
3086 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3090 #: ../src/guestfs.pod:1553
3091 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3095 #: ../src/guestfs.pod:1555
3097 "The child process generates events in some situations. Current events "
3098 "include: receiving a log message, the child process exits."
3102 #: ../src/guestfs.pod:1558
3104 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3109 #: ../src/guestfs.pod:1561
3111 "Only I<one callback of each type> can be registered for each handle. "
3112 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3113 "that type. Cancel all callbacks of this type by calling this function with "
3114 "C<cb> set to C<NULL>."
3118 #: ../src/guestfs.pod:1566
3119 msgid "guestfs_set_log_message_callback"
3123 #: ../src/guestfs.pod:1568
3126 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3127 " char *buf, int len);\n"
3128 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3129 " guestfs_log_message_cb cb,\n"
3135 #: ../src/guestfs.pod:1574
3137 "The callback function C<cb> will be called whenever qemu or the guest writes "
3138 "anything to the console."
3142 #: ../src/guestfs.pod:1577
3143 msgid "Use this function to capture kernel messages and similar."
3147 #: ../src/guestfs.pod:1579
3149 "Normally there is no log message handler, and log messages are just "
3154 #: ../src/guestfs.pod:1582
3155 msgid "guestfs_set_subprocess_quit_callback"
3159 #: ../src/guestfs.pod:1584
3162 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3163 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3164 " guestfs_subprocess_quit_cb cb,\n"
3170 #: ../src/guestfs.pod:1589
3172 "The callback function C<cb> will be called when the child process quits, "
3173 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3174 "corresponds to a transition from any state to the CONFIG state)."
3178 #: ../src/guestfs.pod:1594
3179 msgid "guestfs_set_launch_done_callback"
3183 #: ../src/guestfs.pod:1596
3186 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3187 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3188 " guestfs_launch_done_cb cb,\n"
3194 #: ../src/guestfs.pod:1601
3196 "The callback function C<cb> will be called when the child process becomes "
3197 "ready first time after it has been launched. (This corresponds to a "
3198 "transition from LAUNCHING to the READY state)."
3202 #: ../src/guestfs.pod:1605
3203 msgid "guestfs_set_close_callback"
3207 #: ../src/guestfs.pod:1607
3210 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3211 " void guestfs_set_close_callback (guestfs_h *g,\n"
3212 " guestfs_close_cb cb,\n"
3218 #: ../src/guestfs.pod:1612
3220 "The callback function C<cb> will be called while the handle is being closed "
3221 "(synchronously from L</guestfs_close>)."
3225 #: ../src/guestfs.pod:1615
3227 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3228 "handles that are open when the program exits. This means that this callback "
3229 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3230 "problems in higher-level languages (eg. if your HLL interpreter has already "
3231 "been cleaned up by the time this is called, and if your callback then jumps "
3232 "into some HLL function)."
3236 #: ../src/guestfs.pod:1623
3237 msgid "guestfs_set_progress_callback"
3241 #: ../src/guestfs.pod:1625
3244 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3245 " int proc_nr, int serial,\n"
3246 " uint64_t position, uint64_t total);\n"
3247 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3248 " guestfs_progress_cb cb,\n"
3254 #: ../src/guestfs.pod:1632
3256 "Some long-running operations can generate progress messages. If this "
3257 "callback is registered, then it will be called each time a progress message "
3258 "is generated (usually two seconds after the operation started, and three "
3259 "times per second thereafter until it completes, although the frequency may "
3260 "change in future versions)."
3264 #: ../src/guestfs.pod:1638
3266 "The callback receives two numbers: C<position> and C<total>. The units of "
3267 "C<total> are not defined, although for some operations C<total> may relate "
3268 "in some way to the amount of data to be transferred (eg. in bytes or "
3269 "megabytes), and C<position> may be the portion which has been transferred."
3273 #: ../src/guestfs.pod:1644
3274 msgid "The only defined and stable parts of the API are:"
3278 #: ../src/guestfs.pod:1650
3280 "The callback can display to the user some type of progress bar or indicator "
3281 "which shows the ratio of C<position>:C<total>."
3285 #: ../src/guestfs.pod:1655
3286 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3290 #: ../src/guestfs.pod:1659
3292 "If any progress notification is sent during a call, then a final progress "
3293 "notification is always sent when C<position> = C<total>."
3297 #: ../src/guestfs.pod:1662
3299 "This is to simplify caller code, so callers can easily set the progress "
3300 "indicator to \"100%\" at the end of the operation, without requiring special "
3301 "code to detect this case."
3305 #: ../src/guestfs.pod:1668
3307 "The callback also receives the procedure number and serial number of the "
3308 "call. These are only useful for debugging protocol issues, and the callback "
3309 "can normally ignore them. The callback may want to print these numbers in "
3310 "error messages or debugging messages."
3314 #: ../src/guestfs.pod:1673
3315 msgid "PRIVATE DATA AREA"
3319 #: ../src/guestfs.pod:1675
3321 "You can attach named pieces of private data to the libguestfs handle, and "
3322 "fetch them by name for the lifetime of the handle. This is called the "
3323 "private data area and is only available from the C API."
3327 #: ../src/guestfs.pod:1679
3328 msgid "To attach a named piece of data, use the following call:"
3332 #: ../src/guestfs.pod:1681
3335 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3340 #: ../src/guestfs.pod:1683
3342 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3343 "pointer (which can be C<NULL>). Any previous item with the same name is "
3348 #: ../src/guestfs.pod:1687
3350 "You can use any C<key> you want, but names beginning with an underscore "
3351 "character are reserved for internal libguestfs purposes (for implementing "
3352 "language bindings). It is recommended to prefix the name with some unique "
3353 "string to avoid collisions with other users."
3357 #: ../src/guestfs.pod:1692
3358 msgid "To retrieve the pointer, use:"
3362 #: ../src/guestfs.pod:1694
3365 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3370 #: ../src/guestfs.pod:1696
3372 "This function returns C<NULL> if either no data is found associated with "
3373 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3378 #: ../src/guestfs.pod:1700
3380 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3381 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3382 "all. In particular, libguestfs does I<not> try to free the data when the "
3383 "handle is closed. If the data must be freed, then the caller must either "
3384 "free it before calling L</guestfs_close> or must set up a close callback to "
3385 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3386 "can be registered for a handle)."
3390 #: ../src/guestfs.pod:1708
3392 "The private data area is implemented using a hash table, and should be "
3393 "reasonably efficient for moderate numbers of keys."
3397 #: ../src/guestfs.pod:1711 ../src/guestfs.pod:1716
3402 #: ../src/guestfs.pod:1713
3404 "<!-- old anchor for the next section --> <a name="
3405 "\"state_machine_and_low_level_event_api\"/>"
3409 #: ../src/guestfs.pod:1718
3410 msgid "ARCHITECTURE"
3414 #: ../src/guestfs.pod:1720
3416 "Internally, libguestfs is implemented by running an appliance (a special "
3417 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3418 "process of the main program."
3422 #: ../src/guestfs.pod:1724
3425 " ___________________\n"
3427 " | main program |\n"
3429 " | | child process / appliance\n"
3430 " | | __________________________\n"
3432 " +-------------------+ RPC | +-----------------+ |\n"
3433 " | libguestfs <--------------------> guestfsd | |\n"
3434 " | | | +-----------------+ |\n"
3435 " \\___________________/ | | Linux kernel | |\n"
3436 " | +--^--------------+ |\n"
3437 " \\_________|________________/\n"
3443 " \\______________/\n"
3448 #: ../src/guestfs.pod:1744
3450 "The library, linked to the main program, creates the child process and hence "
3451 "the appliance in the L</guestfs_launch> function."
3455 #: ../src/guestfs.pod:1747
3457 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3458 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3459 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3460 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3461 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3462 "attached to the qemu process which translates device access by the "
3463 "appliance's Linux kernel into accesses to the image."
3467 #: ../src/guestfs.pod:1756
3469 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3470 "Although the disk image you are attached to might also be used by some "
3471 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3472 "care if both libguestfs's qemu process and your virtual machine are trying "
3473 "to update the disk image at the same time, since these usually results in "
3474 "massive disk corruption)."
3478 #: ../src/guestfs.pod:1763
3479 msgid "STATE MACHINE"
3483 #: ../src/guestfs.pod:1765
3484 msgid "libguestfs uses a state machine to model the child process:"
3488 #: ../src/guestfs.pod:1767
3500 " / | \\ \\ guestfs_launch\n"
3501 " / | _\\__V______\n"
3503 " / | | LAUNCHING |\n"
3504 " / | \\___________/\n"
3506 " / | guestfs_launch\n"
3508 " ______ / __|____V\n"
3509 " / \\ ------> / \\\n"
3510 " | BUSY | | READY |\n"
3511 " \\______/ <------ \\________/\n"
3516 #: ../src/guestfs.pod:1789
3518 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3519 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3520 "(3) alternating between READY and BUSY as commands are issued to, and "
3521 "carried out by, the child process."
3525 #: ../src/guestfs.pod:1794
3527 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3528 "asynchronously at any time (eg. due to some internal error), and that causes "
3529 "the state to transition back to CONFIG."
3533 #: ../src/guestfs.pod:1798
3535 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3536 "issued when in the CONFIG state."
3540 #: ../src/guestfs.pod:1801
3542 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3543 "L</guestfs_launch> blocks until the child process is READY to accept "
3544 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3545 "moves the state from CONFIG to LAUNCHING while it is running."
3549 #: ../src/guestfs.pod:1807
3551 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3552 "state. These API calls block waiting for the command to be carried out (ie. "
3553 "the state to transition to BUSY and then back to READY). There are no non-"
3554 "blocking versions, and no way to issue more than one command per handle at "
3559 #: ../src/guestfs.pod:1813
3561 "Finally, the child process sends asynchronous messages back to the main "
3562 "program, such as kernel log messages. You can register a callback to "
3563 "receive these messages."
3567 #: ../src/guestfs.pod:1817
3572 #: ../src/guestfs.pod:1819
3573 msgid "COMMUNICATION PROTOCOL"
3577 #: ../src/guestfs.pod:1821
3579 "Don't rely on using this protocol directly. This section documents how it "
3580 "currently works, but it may change at any time."
3584 #: ../src/guestfs.pod:1824
3586 "The protocol used to talk between the library and the daemon running inside "
3587 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3588 "1014, RFC 1832, RFC 4506)."
3592 #: ../src/guestfs.pod:1828
3594 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3595 "this file is automatically generated)."
3599 #: ../src/guestfs.pod:1831
3601 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3602 "and C<FileOut> parameters, which are handled with very simple request/reply "
3603 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3604 "parameters, which use the same request and reply messages, but they may also "
3605 "be followed by files sent using a chunked encoding."
3609 #: ../src/guestfs.pod:1838
3610 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3614 #: ../src/guestfs.pod:1840
3615 msgid "For ordinary functions, the request message is:"
3619 #: ../src/guestfs.pod:1842
3622 " total length (header + arguments,\n"
3623 " but not including the length word itself)\n"
3624 " struct guestfs_message_header (encoded as XDR)\n"
3625 " struct guestfs_<foo>_args (encoded as XDR)\n"
3630 #: ../src/guestfs.pod:1847
3632 "The total length field allows the daemon to allocate a fixed size buffer "
3633 "into which it slurps the rest of the message. As a result, the total length "
3634 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3635 "effective size of any request is limited to somewhere under this size."
3639 #: ../src/guestfs.pod:1853
3641 "Note also that many functions don't take any arguments, in which case the "
3642 "C<guestfs_I<foo>_args> is completely omitted."
3646 #: ../src/guestfs.pod:1856
3648 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3649 "receiver knows what type of args structure to expect, or none at all."
3653 #: ../src/guestfs.pod:1860
3654 msgid "The reply message for ordinary functions is:"
3658 #: ../src/guestfs.pod:1862
3661 " total length (header + ret,\n"
3662 " but not including the length word itself)\n"
3663 " struct guestfs_message_header (encoded as XDR)\n"
3664 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3669 #: ../src/guestfs.pod:1867
3671 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3672 "functions that return no formal return values."
3676 #: ../src/guestfs.pod:1870
3678 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3682 #: ../src/guestfs.pod:1873
3684 "In the case of an error, a flag is set in the header, and the reply message "
3685 "is slightly changed:"
3689 #: ../src/guestfs.pod:1876
3692 " total length (header + error,\n"
3693 " but not including the length word itself)\n"
3694 " struct guestfs_message_header (encoded as XDR)\n"
3695 " struct guestfs_message_error (encoded as XDR)\n"
3700 #: ../src/guestfs.pod:1881
3702 "The C<guestfs_message_error> structure contains the error message as a "
3707 #: ../src/guestfs.pod:1884
3708 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3712 #: ../src/guestfs.pod:1886
3714 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3715 "The normal request message is sent (see above). However this is followed by "
3716 "a sequence of file chunks."
3720 #: ../src/guestfs.pod:1890
3723 " total length (header + arguments,\n"
3724 " but not including the length word itself,\n"
3725 " and not including the chunks)\n"
3726 " struct guestfs_message_header (encoded as XDR)\n"
3727 " struct guestfs_<foo>_args (encoded as XDR)\n"
3728 " sequence of chunks for FileIn param #0\n"
3729 " sequence of chunks for FileIn param #1 etc.\n"
3734 #: ../src/guestfs.pod:1898
3735 msgid "The \"sequence of chunks\" is:"
3739 #: ../src/guestfs.pod:1900
3742 " length of chunk (not including length word itself)\n"
3743 " struct guestfs_chunk (encoded as XDR)\n"
3744 " length of chunk\n"
3745 " struct guestfs_chunk (encoded as XDR)\n"
3747 " length of chunk\n"
3748 " struct guestfs_chunk (with data.data_len == 0)\n"
3753 #: ../src/guestfs.pod:1908
3755 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3756 "is set in the final chunk to indicate either successful completion or early "
3761 #: ../src/guestfs.pod:1912
3763 "At time of writing there are no functions that have more than one FileIn "
3764 "parameter. However this is (theoretically) supported, by sending the "
3765 "sequence of chunks for each FileIn parameter one after another (from left to "
3770 #: ../src/guestfs.pod:1917
3772 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3773 "transfer. The library does this by sending a chunk with a special flag set "
3774 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3775 "RPC, does I<not> send any reply, and goes back to reading the next request."
3779 #: ../src/guestfs.pod:1923
3781 "The daemon may also cancel. It does this by writing a special word "
3782 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3783 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3784 "cancel chunk). The special word is chosen so that even if cancellation "
3785 "happens right at the end of the transfer (after the library has finished "
3786 "writing and has started listening for the reply), the \"spurious\" cancel "
3787 "flag will not be confused with the reply message."
3791 #: ../src/guestfs.pod:1932
3793 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3794 "limit), and also files where the size is not known in advance (eg. from "
3795 "pipes or sockets). However the chunks are rather small "
3796 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3797 "to keep much in memory."
3801 #: ../src/guestfs.pod:1938
3802 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3806 #: ../src/guestfs.pod:1940
3808 "The protocol for FileOut parameters is exactly the same as for FileIn "
3809 "parameters, but with the roles of daemon and library reversed."
3813 #: ../src/guestfs.pod:1943
3816 " total length (header + ret,\n"
3817 " but not including the length word itself,\n"
3818 " and not including the chunks)\n"
3819 " struct guestfs_message_header (encoded as XDR)\n"
3820 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3821 " sequence of chunks for FileOut param #0\n"
3822 " sequence of chunks for FileOut param #1 etc.\n"
3827 #: ../src/guestfs.pod:1951
3828 msgid "INITIAL MESSAGE"
3832 #: ../src/guestfs.pod:1953
3834 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3835 "which indicates that the guest and daemon is alive. This is what L</"
3836 "guestfs_launch> waits for."
3840 #: ../src/guestfs.pod:1957
3841 msgid "PROGRESS NOTIFICATION MESSAGES"
3845 #: ../src/guestfs.pod:1959
3847 "The daemon may send progress notification messages at any time. These are "
3848 "distinguished by the normal length word being replaced by "
3849 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3853 #: ../src/guestfs.pod:1963
3855 "The library turns them into progress callbacks (see "
3856 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3857 "discards them if not."
3861 #: ../src/guestfs.pod:1967
3863 "The daemon self-limits the frequency of progress messages it sends (see "
3864 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3869 #: ../src/guestfs.pod:1971
3870 msgid "LIBGUESTFS VERSION NUMBERS"
3874 #: ../src/guestfs.pod:1973
3876 "Since April 2010, libguestfs has started to make separate development and "
3877 "stable releases, along with corresponding branches in our git repository. "
3878 "These separate releases can be identified by version number:"
3882 #: ../src/guestfs.pod:1978
3885 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3886 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3892 " | `-------- sub-version\n"
3894 " `------ always '1' because we don't change the ABI\n"
3899 #: ../src/guestfs.pod:1989
3900 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3904 #: ../src/guestfs.pod:1991
3906 "As time passes we cherry pick fixes from the development branch and backport "
3907 "those into the stable branch, the effect being that the stable branch should "
3908 "get more stable and less buggy over time. So the stable releases are ideal "
3909 "for people who don't need new features but would just like the software to "
3914 #: ../src/guestfs.pod:1997
3915 msgid "Our criteria for backporting changes are:"
3919 #: ../src/guestfs.pod:2003
3921 "Documentation changes which don't affect any code are backported unless the "
3922 "documentation refers to a future feature which is not in stable."
3926 #: ../src/guestfs.pod:2009
3928 "Bug fixes which are not controversial, fix obvious problems, and have been "
3929 "well tested are backported."
3933 #: ../src/guestfs.pod:2014
3935 "Simple rearrangements of code which shouldn't affect how it works get "
3936 "backported. This is so that the code in the two branches doesn't get too "
3937 "far out of step, allowing us to backport future fixes more easily."
3941 #: ../src/guestfs.pod:2020
3943 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3944 "exceptional case: the new feature is required in order to implement an "
3945 "important bug fix."
3949 #: ../src/guestfs.pod:2026
3951 "A new stable branch starts when we think the new features in development are "
3952 "substantial and compelling enough over the current stable branch to warrant "
3953 "it. When that happens we create new stable and development versions 1.N.0 "
3954 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3955 "stable at this point, but by backporting fixes from development, that branch "
3956 "will stabilize over time."
3960 #: ../src/guestfs.pod:2034 ../fish/guestfish.pod:914
3961 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3962 #: ../tools/virt-rescue.pl:255
3963 msgid "ENVIRONMENT VARIABLES"
3967 #: ../src/guestfs.pod:2038 ../fish/guestfish.pod:940
3968 msgid "LIBGUESTFS_APPEND"
3972 #: ../src/guestfs.pod:2040 ../fish/guestfish.pod:942
3973 msgid "Pass additional options to the guest kernel."
3977 #: ../src/guestfs.pod:2042 ../fish/guestfish.pod:944
3978 msgid "LIBGUESTFS_DEBUG"
3982 #: ../src/guestfs.pod:2044
3984 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3985 "effect as calling C<guestfs_set_verbose (g, 1)>."
3989 #: ../src/guestfs.pod:2047 ../fish/guestfish.pod:949
3990 msgid "LIBGUESTFS_MEMSIZE"
3994 #: ../src/guestfs.pod:2049 ../fish/guestfish.pod:951
3996 "Set the memory allocated to the qemu process, in megabytes. For example:"
4000 #: ../src/guestfs.pod:2052 ../fish/guestfish.pod:954
4003 " LIBGUESTFS_MEMSIZE=700\n"
4008 #: ../src/guestfs.pod:2054 ../fish/guestfish.pod:956
4009 msgid "LIBGUESTFS_PATH"
4013 #: ../src/guestfs.pod:2056
4015 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4016 "the discussion of paths in section PATH above."
4020 #: ../src/guestfs.pod:2059 ../fish/guestfish.pod:961
4021 msgid "LIBGUESTFS_QEMU"
4025 #: ../src/guestfs.pod:2061 ../fish/guestfish.pod:963
4027 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4028 "which was found at compile time by the configure script is used."
4032 #: ../src/guestfs.pod:2065
4033 msgid "See also L</QEMU WRAPPERS> above."
4037 #: ../src/guestfs.pod:2067 ../fish/guestfish.pod:967
4038 msgid "LIBGUESTFS_TRACE"
4042 #: ../src/guestfs.pod:2069
4044 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4045 "effect as calling C<guestfs_set_trace (g, 1)>."
4049 #: ../src/guestfs.pod:2072 ../fish/guestfish.pod:976
4054 #: ../src/guestfs.pod:2074 ../fish/guestfish.pod:978
4055 msgid "Location of temporary directory, defaults to C</tmp>."
4059 #: ../src/guestfs.pod:2076 ../fish/guestfish.pod:980
4061 "If libguestfs was compiled to use the supermin appliance then the real "
4062 "appliance is cached in this directory, shared between all handles belonging "
4063 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4064 "use in case C</tmp> is not large enough."
4068 #: ../src/guestfs.pod:2084 ../fish/guestfish.pod:1038
4069 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4070 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484
4071 #: ../tools/virt-df.pl:640 ../tools/virt-ls.pl:232
4072 #: ../tools/virt-resize.pl:1486 ../tools/virt-list-filesystems.pl:186
4073 #: ../tools/virt-tar.pl:281 ../tools/virt-rescue.pl:267
4074 #: ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:254
4079 #: ../src/guestfs.pod:2086
4081 "L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, L<virt-edit"
4082 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
4083 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
4084 "tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
4085 "L<http://libguestfs.org/>."
4089 #: ../src/guestfs.pod:2104
4091 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4092 "(8)>, L<disktype(1)>."
4096 #: ../src/guestfs.pod:2111 ../tools/virt-win-reg.pl:499
4097 #: ../tools/virt-make-fs.pl:548
4102 #: ../src/guestfs.pod:2113
4103 msgid "To get a list of bugs against libguestfs use this link:"
4107 #: ../src/guestfs.pod:2115
4109 "L<https://bugzilla.redhat.com/buglist.cgi?"
4110 "component=libguestfs&product=Virtualization+Tools>"
4114 #: ../src/guestfs.pod:2117
4115 msgid "To report a new bug against libguestfs use this link:"
4119 #: ../src/guestfs.pod:2119
4121 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4122 "component=libguestfs&product=Virtualization+Tools>"
4126 #: ../src/guestfs.pod:2121
4127 msgid "When reporting a bug, please check:"
4131 #: ../src/guestfs.pod:2127
4132 msgid "That the bug hasn't been reported already."
4136 #: ../src/guestfs.pod:2131
4137 msgid "That you are testing a recent version."
4141 #: ../src/guestfs.pod:2135
4142 msgid "Describe the bug accurately, and give a way to reproduce it."
4146 #: ../src/guestfs.pod:2139
4148 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4153 #: ../src/guestfs.pod:2144 ../fish/guestfish.pod:1055
4154 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4159 #: ../src/guestfs.pod:2146 ../fish/guestfish.pod:1057
4160 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4161 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4165 #: ../src/guestfs.pod:2148 ../fish/guestfish.pod:1059
4166 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4167 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514
4168 #: ../tools/virt-df.pl:653 ../tools/virt-ls.pl:247
4169 #: ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:202
4170 #: ../tools/virt-tar.pl:296 ../tools/virt-rescue.pl:281
4171 #: ../tools/virt-make-fs.pl:563 ../tools/virt-list-partitions.pl:269
4176 #: ../src/guestfs.pod:2150 ../fish/guestfish.pod:1061
4177 #: ../fuse/guestmount.pod:250
4178 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4182 #: ../src/guestfs.pod:2153
4184 "This library is free software; you can redistribute it and/or modify it "
4185 "under the terms of the GNU Lesser General Public License as published by the "
4186 "Free Software Foundation; either version 2 of the License, or (at your "
4187 "option) any later version."
4191 #: ../src/guestfs.pod:2158
4193 "This library is distributed in the hope that it will be useful, but WITHOUT "
4194 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4195 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4200 #: ../src/guestfs.pod:2163
4202 "You should have received a copy of the GNU Lesser General Public License "
4203 "along with this library; if not, write to the Free Software Foundation, "
4204 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4208 #: ../src/guestfs-actions.pod:1
4209 msgid "guestfs_add_cdrom"
4213 #: ../src/guestfs-actions.pod:3
4217 " guestfs_add_cdrom (guestfs_h *g,\n"
4218 " const char *filename);\n"
4223 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4224 msgid "This function adds a virtual CD-ROM disk image to the guest."
4228 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4229 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4233 #: ../src/guestfs-actions.pod:17
4235 "This call checks for the existence of C<filename>. This stops you from "
4236 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4237 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4242 #: ../src/guestfs-actions.pod:24
4244 "If you just want to add an ISO file (often you use this as an efficient way "
4245 "to transfer large files into the guest), then you should probably use "
4246 "C<guestfs_add_drive_ro> instead."
4250 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126
4251 #: ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224
4252 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259
4253 #: ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293
4254 #: ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428
4255 #: ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487
4256 #: ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533
4257 #: ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633
4258 #: ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662
4259 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
4260 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
4261 #: ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988
4262 #: ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090
4263 #: ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127
4264 #: ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161
4265 #: ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262
4266 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324
4267 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464
4268 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704
4269 #: ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2213
4270 #: ../src/guestfs-actions.pod:2357 ../src/guestfs-actions.pod:2418
4271 #: ../src/guestfs-actions.pod:2453 ../src/guestfs-actions.pod:3182
4272 #: ../src/guestfs-actions.pod:3197 ../src/guestfs-actions.pod:3217
4273 #: ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3356
4274 #: ../src/guestfs-actions.pod:3369 ../src/guestfs-actions.pod:3383
4275 #: ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3434
4276 #: ../src/guestfs-actions.pod:3506 ../src/guestfs-actions.pod:3526
4277 #: ../src/guestfs-actions.pod:3543 ../src/guestfs-actions.pod:3566
4278 #: ../src/guestfs-actions.pod:3589 ../src/guestfs-actions.pod:3621
4279 #: ../src/guestfs-actions.pod:3640 ../src/guestfs-actions.pod:3659
4280 #: ../src/guestfs-actions.pod:3694 ../src/guestfs-actions.pod:3706
4281 #: ../src/guestfs-actions.pod:3742 ../src/guestfs-actions.pod:3758
4282 #: ../src/guestfs-actions.pod:3771 ../src/guestfs-actions.pod:3786
4283 #: ../src/guestfs-actions.pod:3803 ../src/guestfs-actions.pod:3896
4284 #: ../src/guestfs-actions.pod:3916 ../src/guestfs-actions.pod:3929
4285 #: ../src/guestfs-actions.pod:3980 ../src/guestfs-actions.pod:3998
4286 #: ../src/guestfs-actions.pod:4016 ../src/guestfs-actions.pod:4032
4287 #: ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:4060
4288 #: ../src/guestfs-actions.pod:4077 ../src/guestfs-actions.pod:4092
4289 #: ../src/guestfs-actions.pod:4112 ../src/guestfs-actions.pod:4161
4290 #: ../src/guestfs-actions.pod:4192 ../src/guestfs-actions.pod:4211
4291 #: ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:4242
4292 #: ../src/guestfs-actions.pod:4259 ../src/guestfs-actions.pod:4272
4293 #: ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4302
4294 #: ../src/guestfs-actions.pod:4337 ../src/guestfs-actions.pod:4352
4295 #: ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:4386
4296 #: ../src/guestfs-actions.pod:4403 ../src/guestfs-actions.pod:4452
4297 #: ../src/guestfs-actions.pod:4489 ../src/guestfs-actions.pod:4503
4298 #: ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4548
4299 #: ../src/guestfs-actions.pod:4566 ../src/guestfs-actions.pod:4700
4300 #: ../src/guestfs-actions.pod:4757 ../src/guestfs-actions.pod:4779
4301 #: ../src/guestfs-actions.pod:4797 ../src/guestfs-actions.pod:4829
4302 #: ../src/guestfs-actions.pod:4895 ../src/guestfs-actions.pod:4912
4303 #: ../src/guestfs-actions.pod:4925 ../src/guestfs-actions.pod:4939
4304 #: ../src/guestfs-actions.pod:5228 ../src/guestfs-actions.pod:5247
4305 #: ../src/guestfs-actions.pod:5261 ../src/guestfs-actions.pod:5273
4306 #: ../src/guestfs-actions.pod:5287 ../src/guestfs-actions.pod:5299
4307 #: ../src/guestfs-actions.pod:5313 ../src/guestfs-actions.pod:5329
4308 #: ../src/guestfs-actions.pod:5350 ../src/guestfs-actions.pod:5369
4309 #: ../src/guestfs-actions.pod:5388 ../src/guestfs-actions.pod:5406
4310 #: ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:5447
4311 #: ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5487
4312 #: ../src/guestfs-actions.pod:5506 ../src/guestfs-actions.pod:5523
4313 #: ../src/guestfs-actions.pod:5551 ../src/guestfs-actions.pod:5575
4314 #: ../src/guestfs-actions.pod:5594 ../src/guestfs-actions.pod:5618
4315 #: ../src/guestfs-actions.pod:5633 ../src/guestfs-actions.pod:5648
4316 #: ../src/guestfs-actions.pod:5667 ../src/guestfs-actions.pod:5704
4317 #: ../src/guestfs-actions.pod:5727 ../src/guestfs-actions.pod:5753
4318 #: ../src/guestfs-actions.pod:5861 ../src/guestfs-actions.pod:5982
4319 #: ../src/guestfs-actions.pod:5994 ../src/guestfs-actions.pod:6007
4320 #: ../src/guestfs-actions.pod:6020 ../src/guestfs-actions.pod:6042
4321 #: ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6068
4322 #: ../src/guestfs-actions.pod:6081 ../src/guestfs-actions.pod:6096
4323 #: ../src/guestfs-actions.pod:6155 ../src/guestfs-actions.pod:6172
4324 #: ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6204
4325 #: ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6234
4326 #: ../src/guestfs-actions.pod:6254 ../src/guestfs-actions.pod:6290
4327 #: ../src/guestfs-actions.pod:6304 ../src/guestfs-actions.pod:6345
4328 #: ../src/guestfs-actions.pod:6358 ../src/guestfs-actions.pod:6376
4329 #: ../src/guestfs-actions.pod:6405 ../src/guestfs-actions.pod:6436
4330 #: ../src/guestfs-actions.pod:6555 ../src/guestfs-actions.pod:6573
4331 #: ../src/guestfs-actions.pod:6587 ../src/guestfs-actions.pod:6642
4332 #: ../src/guestfs-actions.pod:6655 ../src/guestfs-actions.pod:6700
4333 #: ../src/guestfs-actions.pod:6733 ../src/guestfs-actions.pod:6787
4334 #: ../src/guestfs-actions.pod:6813 ../src/guestfs-actions.pod:6879
4335 #: ../src/guestfs-actions.pod:6898 ../src/guestfs-actions.pod:6927
4336 msgid "This function returns 0 on success or -1 on error."
4340 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240
4341 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28
4342 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4344 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4349 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243
4350 #: ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435
4351 #: ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942
4352 #: ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6990
4353 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:156
4354 #: ../fish/guestfish-actions.pod:170 ../fish/guestfish-actions.pod:951
4355 #: ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1322
4356 #: ../fish/guestfish-actions.pod:4549 ../fish/guestfish-actions.pod:4646
4358 "Deprecated functions will not be removed from the API, but the fact that "
4359 "they are deprecated indicates that there are problems with correct use of "
4364 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128
4365 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893
4366 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094
4367 #: ../src/guestfs-actions.pod:3184 ../src/guestfs-actions.pod:3199
4368 #: ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:5408
4369 #: ../src/guestfs-actions.pod:5525 ../src/guestfs-actions.pod:5635
4370 #: ../src/guestfs-actions.pod:6098 ../src/guestfs-actions.pod:6223
4371 #: ../src/guestfs-actions.pod:6735
4372 msgid "(Added in 0.3)"
4376 #: ../src/guestfs-actions.pod:41
4377 msgid "guestfs_add_domain"
4381 #: ../src/guestfs-actions.pod:43
4385 " guestfs_add_domain (guestfs_h *g,\n"
4386 " const char *dom,\n"
4392 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137
4394 "You may supply a list of optional arguments to this call. Use zero or more "
4395 "of the following pairs of parameters, and terminate the list with C<-1> on "
4396 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4400 #: ../src/guestfs-actions.pod:53
4403 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4404 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4405 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4410 #: ../src/guestfs-actions.pod:57
4412 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4413 "It works by connecting to libvirt, requesting the domain and domain XML from "
4414 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4419 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4421 "The number of disks added is returned. This operation is atomic: if an "
4422 "error is returned, then no disks are added."
4426 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4428 "This function does some minimal checks to make sure the libvirt domain is "
4429 "not running (unless C<readonly> is true). In a future version we will try "
4430 "to acquire the libvirt lock on each disk."
4434 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4436 "Disks must be accessible locally. This often means that adding disks from a "
4437 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4438 "unless those disks are accessible via the same device path locally too."
4442 #: ../src/guestfs-actions.pod:74
4444 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4445 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4446 "libvirt URI (or one set through an environment variable, see the libvirt "
4447 "documentation for full details). If you are using the C API directly then "
4448 "it is more flexible to create the libvirt connection object yourself, get "
4449 "the domain object, and call C<guestfs_add_libvirt_dom>."
4453 #: ../src/guestfs-actions.pod:82
4455 "The other optional parameters are passed directly through to "
4456 "C<guestfs_add_drive_opts>."
4460 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:336
4461 #: ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679
4462 #: ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728
4463 #: ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307
4464 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864
4465 #: ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003
4466 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081
4467 #: ../src/guestfs-actions.pod:2344 ../src/guestfs-actions.pod:2630
4468 #: ../src/guestfs-actions.pod:2651 ../src/guestfs-actions.pod:4475
4469 #: ../src/guestfs-actions.pod:4603 ../src/guestfs-actions.pod:5009
4470 #: ../src/guestfs-actions.pod:5035 ../src/guestfs-actions.pod:6331
4471 #: ../src/guestfs-actions.pod:6746 ../src/guestfs-actions.pod:6759
4472 #: ../src/guestfs-actions.pod:6772
4473 msgid "On error this function returns -1."
4477 #: ../src/guestfs-actions.pod:87
4478 msgid "guestfs_add_domain_va"
4482 #: ../src/guestfs-actions.pod:89
4486 " guestfs_add_domain_va (guestfs_h *g,\n"
4487 " const char *dom,\n"
4493 #: ../src/guestfs-actions.pod:94
4494 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4498 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107
4499 #: ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211
4500 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4504 #: ../src/guestfs-actions.pod:98
4505 msgid "guestfs_add_domain_argv"
4509 #: ../src/guestfs-actions.pod:100
4513 " guestfs_add_domain_argv (guestfs_h *g,\n"
4514 " const char *dom,\n"
4515 " const struct guestfs_add_domain_argv *optargs);\n"
4520 #: ../src/guestfs-actions.pod:105
4521 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4525 #: ../src/guestfs-actions.pod:109
4526 msgid "guestfs_add_drive"
4530 #: ../src/guestfs-actions.pod:111
4534 " guestfs_add_drive (guestfs_h *g,\n"
4535 " const char *filename);\n"
4540 #: ../src/guestfs-actions.pod:115
4542 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4543 "optional parameters, so the disk is added writable, with the format being "
4544 "detected automatically."
4548 #: ../src/guestfs-actions.pod:119
4550 "Automatic detection of the format opens you up to a potential security hole "
4551 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4552 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4553 "you should think about replacing calls to this function with calls to "
4554 "C<guestfs_add_drive_opts>, and specifying the format."
4558 #: ../src/guestfs-actions.pod:130
4559 msgid "guestfs_add_drive_opts"
4563 #: ../src/guestfs-actions.pod:132
4567 " guestfs_add_drive_opts (guestfs_h *g,\n"
4568 " const char *filename,\n"
4574 #: ../src/guestfs-actions.pod:142
4577 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4578 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4579 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4584 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:92
4586 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4587 "The first time you call this function, the disk appears as C</dev/sda>, the "
4588 "second time as C</dev/sdb>, and so on."
4592 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:97
4594 "You don't necessarily need to be root when using libguestfs. However you "
4595 "obviously do need sufficient permissions to access the filename for whatever "
4596 "operations you want to perform (ie. read access if you just want to read the "
4597 "image or write access if you want to modify the image)."
4601 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:103
4602 msgid "This call checks that C<filename> exists."
4606 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:105
4607 msgid "The optional arguments are:"
4611 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:109
4616 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:111
4618 "If true then the image is treated as read-only. Writes are still allowed, "
4619 "but they are stored in a temporary snapshot overlay which is discarded at "
4620 "the end. The disk that you add is not modified."
4624 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:115
4629 #: ../src/guestfs-actions.pod:171
4631 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4632 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4633 "Possible formats include C<raw> and C<qcow2>."
4637 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:121
4639 "Automatic detection of the format opens you up to a potential security hole "
4640 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4641 "RHBZ#642934. Specifying the format closes this security hole."
4645 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:126
4650 #: ../src/guestfs-actions.pod:182
4652 "This rarely-used option lets you emulate the behaviour of the deprecated "
4653 "C<guestfs_add_drive_with_if> call (q.v.)"
4657 #: ../src/guestfs-actions.pod:189
4658 msgid "(Added in 1.5.23)"
4662 #: ../src/guestfs-actions.pod:191
4663 msgid "guestfs_add_drive_opts_va"
4667 #: ../src/guestfs-actions.pod:193
4671 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4672 " const char *filename,\n"
4678 #: ../src/guestfs-actions.pod:198
4679 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4683 #: ../src/guestfs-actions.pod:202
4684 msgid "guestfs_add_drive_opts_argv"
4688 #: ../src/guestfs-actions.pod:204
4692 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4693 " const char *filename,\n"
4694 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4699 #: ../src/guestfs-actions.pod:209
4700 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4704 #: ../src/guestfs-actions.pod:213
4705 msgid "guestfs_add_drive_ro"
4709 #: ../src/guestfs-actions.pod:215
4713 " guestfs_add_drive_ro (guestfs_h *g,\n"
4714 " const char *filename);\n"
4719 #: ../src/guestfs-actions.pod:219
4721 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4722 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4723 "disk is added read-only, with the format being detected automatically."
4727 #: ../src/guestfs-actions.pod:226
4728 msgid "(Added in 1.0.38)"
4732 #: ../src/guestfs-actions.pod:228
4733 msgid "guestfs_add_drive_ro_with_if"
4737 #: ../src/guestfs-actions.pod:230
4741 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4742 " const char *filename,\n"
4743 " const char *iface);\n"
4748 #: ../src/guestfs-actions.pod:235
4750 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4751 "QEMU interface emulation to use at run time."
4755 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268
4756 #: ../src/guestfs-actions.pod:2303
4757 msgid "(Added in 1.0.84)"
4761 #: ../src/guestfs-actions.pod:249
4762 msgid "guestfs_add_drive_with_if"
4766 #: ../src/guestfs-actions.pod:251
4770 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4771 " const char *filename,\n"
4772 " const char *iface);\n"
4777 #: ../src/guestfs-actions.pod:256
4779 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4780 "QEMU interface emulation to use at run time."
4784 #: ../src/guestfs-actions.pod:270
4785 msgid "guestfs_aug_clear"
4789 #: ../src/guestfs-actions.pod:272
4793 " guestfs_aug_clear (guestfs_h *g,\n"
4794 " const char *augpath);\n"
4799 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:178
4801 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4802 "L<augtool(1)> C<clear> command."
4806 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
4807 msgid "(Added in 1.3.4)"
4811 #: ../src/guestfs-actions.pod:283
4812 msgid "guestfs_aug_close"
4816 #: ../src/guestfs-actions.pod:285
4820 " guestfs_aug_close (guestfs_h *g);\n"
4825 #: ../src/guestfs-actions.pod:288
4827 "Close the current Augeas handle and free up any resources used by it. After "
4828 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4829 "any other Augeas functions."
4833 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320
4834 #: ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352
4835 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4836 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475
4837 #: ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503
4838 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4839 #: ../src/guestfs-actions.pod:5086
4840 msgid "(Added in 0.7)"
4844 #: ../src/guestfs-actions.pod:297
4845 msgid "guestfs_aug_defnode"
4849 #: ../src/guestfs-actions.pod:299
4852 " struct guestfs_int_bool *\n"
4853 " guestfs_aug_defnode (guestfs_h *g,\n"
4854 " const char *name,\n"
4855 " const char *expr,\n"
4856 " const char *val);\n"
4861 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:194
4863 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4867 #: ../src/guestfs-actions.pod:308
4869 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4870 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4871 "containing that single node."
4875 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:201
4877 "On success this returns a pair containing the number of nodes in the "
4878 "nodeset, and a boolean flag if a node was created."
4882 #: ../src/guestfs-actions.pod:316
4884 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4885 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4889 #: ../src/guestfs-actions.pod:322
4890 msgid "guestfs_aug_defvar"
4894 #: ../src/guestfs-actions.pod:324
4898 " guestfs_aug_defvar (guestfs_h *g,\n"
4899 " const char *name,\n"
4900 " const char *expr);\n"
4905 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:209
4907 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4908 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4912 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:213
4914 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4915 "evaluates to something which is not a nodeset."
4919 #: ../src/guestfs-actions.pod:340
4920 msgid "guestfs_aug_get"
4924 #: ../src/guestfs-actions.pod:342
4928 " guestfs_aug_get (guestfs_h *g,\n"
4929 " const char *augpath);\n"
4934 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:220
4936 "Look up the value associated with C<path>. If C<path> matches exactly one "
4937 "node, the C<value> is returned."
4941 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849
4942 #: ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927
4943 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046
4944 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193
4945 #: ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341
4946 #: ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644
4947 #: ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824
4948 #: ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936
4949 #: ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2268
4950 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2556
4951 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2712
4952 #: ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:2763
4953 #: ../src/guestfs-actions.pod:2823 ../src/guestfs-actions.pod:2846
4954 #: ../src/guestfs-actions.pod:3328 ../src/guestfs-actions.pod:3678
4955 #: ../src/guestfs-actions.pod:3848 ../src/guestfs-actions.pod:3958
4956 #: ../src/guestfs-actions.pod:4621 ../src/guestfs-actions.pod:4814
4957 #: ../src/guestfs-actions.pod:4984 ../src/guestfs-actions.pod:5162
4958 #: ../src/guestfs-actions.pod:5211 ../src/guestfs-actions.pod:5774
4959 #: ../src/guestfs-actions.pod:5790 ../src/guestfs-actions.pod:5807
4960 #: ../src/guestfs-actions.pod:5831 ../src/guestfs-actions.pod:6495
4961 #: ../src/guestfs-actions.pod:6514 ../src/guestfs-actions.pod:6532
4962 #: ../src/guestfs-actions.pod:6712 ../src/guestfs-actions.pod:6984
4964 "This function returns a string, or NULL on error. I<The caller must free "
4965 "the returned string after use>."
4969 #: ../src/guestfs-actions.pod:354
4970 msgid "guestfs_aug_init"
4974 #: ../src/guestfs-actions.pod:356
4978 " guestfs_aug_init (guestfs_h *g,\n"
4979 " const char *root,\n"
4985 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:227
4987 "Create a new Augeas handle for editing configuration files. If there was "
4988 "any previous Augeas handle associated with this guestfs session, then it is "
4993 #: ../src/guestfs-actions.pod:365
4994 msgid "You must call this before using any other C<guestfs_aug_*> commands."
4998 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:234
5000 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5004 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:237
5006 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5007 "logical I<or> of the following integers:"
5011 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:243
5012 msgid "C<AUG_SAVE_BACKUP> = 1"
5016 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:245
5017 msgid "Keep the original file with a C<.augsave> extension."
5021 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:247
5022 msgid "C<AUG_SAVE_NEWFILE> = 2"
5026 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:249
5028 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5029 "original. Overrides C<AUG_SAVE_BACKUP>."
5033 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:252
5034 msgid "C<AUG_TYPE_CHECK> = 4"
5038 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:254
5039 msgid "Typecheck lenses (can be expensive)."
5043 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:256
5044 msgid "C<AUG_NO_STDINC> = 8"
5048 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:258
5049 msgid "Do not use standard load path for modules."
5053 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:260
5054 msgid "C<AUG_SAVE_NOOP> = 16"
5058 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:262
5059 msgid "Make save a no-op, just record what would have been changed."
5063 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:264
5064 msgid "C<AUG_NO_LOAD> = 32"
5068 #: ../src/guestfs-actions.pod:400
5069 msgid "Do not load the tree in C<guestfs_aug_init>."
5073 #: ../src/guestfs-actions.pod:404
5074 msgid "To close the handle, you can call C<guestfs_aug_close>."
5078 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:272
5079 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5083 #: ../src/guestfs-actions.pod:412
5084 msgid "guestfs_aug_insert"
5088 #: ../src/guestfs-actions.pod:414
5092 " guestfs_aug_insert (guestfs_h *g,\n"
5093 " const char *augpath,\n"
5094 " const char *label,\n"
5100 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:278
5102 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5103 "or after C<path> (depending on the boolean flag C<before>)."
5107 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:282
5109 "C<path> must match exactly one existing node in the tree, and C<label> must "
5110 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5114 #: ../src/guestfs-actions.pod:432
5115 msgid "guestfs_aug_load"
5119 #: ../src/guestfs-actions.pod:434
5123 " guestfs_aug_load (guestfs_h *g);\n"
5128 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:290
5129 msgid "Load files into the tree."
5133 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:292
5134 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5138 #: ../src/guestfs-actions.pod:446
5139 msgid "guestfs_aug_ls"
5143 #: ../src/guestfs-actions.pod:448
5147 " guestfs_aug_ls (guestfs_h *g,\n"
5148 " const char *augpath);\n"
5153 #: ../src/guestfs-actions.pod:452
5155 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5156 "sorting the resulting nodes into alphabetical order."
5160 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471
5161 #: ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065
5162 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375
5163 #: ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497
5164 #: ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2148
5165 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2183
5166 #: ../src/guestfs-actions.pod:2226 ../src/guestfs-actions.pod:2250
5167 #: ../src/guestfs-actions.pod:2321 ../src/guestfs-actions.pod:2370
5168 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2782
5169 #: ../src/guestfs-actions.pod:2993 ../src/guestfs-actions.pod:3248
5170 #: ../src/guestfs-actions.pod:3310 ../src/guestfs-actions.pod:3415
5171 #: ../src/guestfs-actions.pod:3820 ../src/guestfs-actions.pod:4436
5172 #: ../src/guestfs-actions.pod:4956 ../src/guestfs-actions.pod:5082
5173 #: ../src/guestfs-actions.pod:5196 ../src/guestfs-actions.pod:5847
5174 #: ../src/guestfs-actions.pod:5908 ../src/guestfs-actions.pod:5963
5175 #: ../src/guestfs-actions.pod:6109 ../src/guestfs-actions.pod:6133
5176 #: ../src/guestfs-actions.pod:6605 ../src/guestfs-actions.pod:6625
5177 #: ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6837
5178 #: ../src/guestfs-actions.pod:6856 ../src/guestfs-actions.pod:6941
5179 #: ../src/guestfs-actions.pod:6960 ../src/guestfs-actions.pod:7006
5180 #: ../src/guestfs-actions.pod:7025
5182 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5183 ">), or NULL if there was an error. I<The caller must free the strings and "
5184 "the array after use>."
5188 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990
5189 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413
5190 #: ../src/guestfs-actions.pod:3071 ../src/guestfs-actions.pod:3102
5191 #: ../src/guestfs-actions.pod:3661 ../src/guestfs-actions.pod:3711
5192 #: ../src/guestfs-actions.pod:3898 ../src/guestfs-actions.pod:3931
5193 #: ../src/guestfs-actions.pod:4094 ../src/guestfs-actions.pod:4440
5194 #: ../src/guestfs-actions.pod:4897 ../src/guestfs-actions.pod:5275
5195 #: ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5301
5196 #: ../src/guestfs-actions.pod:5709 ../src/guestfs-actions.pod:6347
5197 #: ../src/guestfs-actions.pod:6360 ../src/guestfs-actions.pod:6589
5198 #: ../src/guestfs-actions.pod:6792 ../src/guestfs-actions.pod:6825
5199 msgid "(Added in 0.8)"
5203 #: ../src/guestfs-actions.pod:461
5204 msgid "guestfs_aug_match"
5208 #: ../src/guestfs-actions.pod:463
5212 " guestfs_aug_match (guestfs_h *g,\n"
5213 " const char *augpath);\n"
5218 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:306
5220 "Returns a list of paths which match the path expression C<path>. The "
5221 "returned paths are sufficiently qualified so that they match exactly one "
5222 "node in the current tree."
5226 #: ../src/guestfs-actions.pod:477
5227 msgid "guestfs_aug_mv"
5231 #: ../src/guestfs-actions.pod:479
5235 " guestfs_aug_mv (guestfs_h *g,\n"
5236 " const char *src,\n"
5237 " const char *dest);\n"
5242 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:314
5244 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5245 "C<dest> is overwritten if it exists."
5249 #: ../src/guestfs-actions.pod:491
5250 msgid "guestfs_aug_rm"
5254 #: ../src/guestfs-actions.pod:493
5258 " guestfs_aug_rm (guestfs_h *g,\n"
5259 " const char *augpath);\n"
5264 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:321
5265 msgid "Remove C<path> and all of its children."
5269 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:323
5270 msgid "On success this returns the number of entries which were removed."
5274 #: ../src/guestfs-actions.pod:505
5275 msgid "guestfs_aug_save"
5279 #: ../src/guestfs-actions.pod:507
5283 " guestfs_aug_save (guestfs_h *g);\n"
5288 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:329
5289 msgid "This writes all pending changes to disk."
5293 #: ../src/guestfs-actions.pod:512
5295 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5300 #: ../src/guestfs-actions.pod:519
5301 msgid "guestfs_aug_set"
5305 #: ../src/guestfs-actions.pod:521
5309 " guestfs_aug_set (guestfs_h *g,\n"
5310 " const char *augpath,\n"
5311 " const char *val);\n"
5316 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:338
5317 msgid "Set the value associated with C<path> to C<val>."
5321 #: ../src/guestfs-actions.pod:528
5323 "In the Augeas API, it is possible to clear a node by setting the value to "
5324 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5325 "this call. Instead you must use the C<guestfs_aug_clear> call."
5329 #: ../src/guestfs-actions.pod:537
5330 msgid "guestfs_available"
5334 #: ../src/guestfs-actions.pod:539
5338 " guestfs_available (guestfs_h *g,\n"
5339 " char *const *groups);\n"
5344 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:349
5346 "This command is used to check the availability of some groups of "
5347 "functionality in the appliance, which not all builds of the libguestfs "
5348 "appliance will be able to provide."
5352 #: ../src/guestfs-actions.pod:547
5354 "The libguestfs groups, and the functions that those groups correspond to, "
5355 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5356 "runtime by calling C<guestfs_available_all_groups>."
5360 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:358
5362 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5363 "\"]> would check for the availability of the Linux inotify functions and "
5364 "Augeas (configuration file editing) functions."
5368 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:363
5369 msgid "The command returns no error if I<all> requested groups are available."
5373 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:365
5375 "It fails with an error if one or more of the requested groups is unavailable "
5380 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:368
5382 "If an unknown group name is included in the list of groups then an error is "
5387 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:371
5392 #: ../src/guestfs-actions.pod:571
5393 msgid "You must call C<guestfs_launch> before calling this function."
5397 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:379
5399 "The reason is because we don't know what groups are supported by the "
5400 "appliance/daemon until it is running and can be queried."
5404 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:385
5406 "If a group of functions is available, this does not necessarily mean that "
5407 "they will work. You still have to check for errors when calling individual "
5408 "API functions even if they are available."
5412 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:392
5414 "It is usually the job of distro packagers to build complete functionality "
5415 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5416 "with all requirements satisfied, will support everything."
5420 #: ../src/guestfs-actions.pod:593
5422 "This call was added in version C<1.0.80>. In previous versions of "
5423 "libguestfs all you could do would be to speculatively execute a command to "
5424 "find out if the daemon implemented it. See also C<guestfs_version>."
5428 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
5429 msgid "(Added in 1.0.80)"
5433 #: ../src/guestfs-actions.pod:604
5434 msgid "guestfs_available_all_groups"
5438 #: ../src/guestfs-actions.pod:606
5442 " guestfs_available_all_groups (guestfs_h *g);\n"
5447 #: ../src/guestfs-actions.pod:609
5449 "This command returns a list of all optional groups that this daemon knows "
5450 "about. Note this returns both supported and unsupported groups. To find "
5451 "out which ones the daemon can actually support you have to call "
5452 "C<guestfs_available> on each member of the returned list."
5456 #: ../src/guestfs-actions.pod:615
5457 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5461 #: ../src/guestfs-actions.pod:621
5462 msgid "(Added in 1.3.15)"
5466 #: ../src/guestfs-actions.pod:623
5467 msgid "guestfs_base64_in"
5471 #: ../src/guestfs-actions.pod:625
5475 " guestfs_base64_in (guestfs_h *g,\n"
5476 " const char *base64file,\n"
5477 " const char *filename);\n"
5482 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:422
5484 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5488 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
5489 msgid "(Added in 1.3.5)"
5493 #: ../src/guestfs-actions.pod:637
5494 msgid "guestfs_base64_out"
5498 #: ../src/guestfs-actions.pod:639
5502 " guestfs_base64_out (guestfs_h *g,\n"
5503 " const char *filename,\n"
5504 " const char *base64file);\n"
5509 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:431
5511 "This command downloads the contents of C<filename>, writing it out to local "
5512 "file C<base64file> encoded as base64."
5516 #: ../src/guestfs-actions.pod:651
5517 msgid "guestfs_blockdev_flushbufs"
5521 #: ../src/guestfs-actions.pod:653
5525 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5526 " const char *device);\n"
5531 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:440
5533 "This tells the kernel to flush internal buffers associated with C<device>."
5537 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677
5538 #: ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708
5539 #: ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745
5540 #: ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777
5541 #: ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805
5542 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5543 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5544 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5545 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5546 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5547 msgid "This uses the L<blockdev(8)> command."
5551 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681
5552 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712
5553 #: ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749
5554 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
5555 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
5556 msgid "(Added in 0.9.3)"
5560 #: ../src/guestfs-actions.pod:666
5561 msgid "guestfs_blockdev_getbsz"
5565 #: ../src/guestfs-actions.pod:668
5569 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5570 " const char *device);\n"
5575 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:449
5576 msgid "This returns the block size of a device."
5580 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774
5581 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5583 "(Note this is different from both I<size in blocks> and I<filesystem block "
5588 #: ../src/guestfs-actions.pod:683
5589 msgid "guestfs_blockdev_getro"
5593 #: ../src/guestfs-actions.pod:685
5597 " guestfs_blockdev_getro (guestfs_h *g,\n"
5598 " const char *device);\n"
5603 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:460
5605 "Returns a boolean indicating if the block device is read-only (true if read-"
5606 "only, false if not)."
5610 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396
5611 #: ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891
5612 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974
5613 #: ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044
5614 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092
5615 #: ../src/guestfs-actions.pod:3010 ../src/guestfs-actions.pod:3024
5616 #: ../src/guestfs-actions.pod:3039 ../src/guestfs-actions.pod:3053
5617 #: ../src/guestfs-actions.pod:3069 ../src/guestfs-actions.pod:3084
5618 #: ../src/guestfs-actions.pod:3100 ../src/guestfs-actions.pod:3114
5619 #: ../src/guestfs-actions.pod:3127 ../src/guestfs-actions.pod:3141
5620 #: ../src/guestfs-actions.pod:3156 ../src/guestfs-actions.pod:3171
5621 #: ../src/guestfs-actions.pod:4585
5622 msgid "This function returns a C truth value on success or -1 on error."
5626 #: ../src/guestfs-actions.pod:698
5627 msgid "guestfs_blockdev_getsize64"
5631 #: ../src/guestfs-actions.pod:700
5635 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5636 " const char *device);\n"
5641 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:469
5642 msgid "This returns the size of the device in bytes."
5646 #: ../src/guestfs-actions.pod:706
5647 msgid "See also C<guestfs_blockdev_getsz>."
5651 #: ../src/guestfs-actions.pod:714
5652 msgid "guestfs_blockdev_getss"
5656 #: ../src/guestfs-actions.pod:716
5660 " guestfs_blockdev_getss (guestfs_h *g,\n"
5661 " const char *device);\n"
5666 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:479
5668 "This returns the size of sectors on a block device. Usually 512, but can be "
5669 "larger for modern devices."
5673 #: ../src/guestfs-actions.pod:723
5675 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5680 #: ../src/guestfs-actions.pod:732
5681 msgid "guestfs_blockdev_getsz"
5685 #: ../src/guestfs-actions.pod:734
5689 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5690 " const char *device);\n"
5695 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:491
5697 "This returns the size of the device in units of 512-byte sectors (even if "
5698 "the sectorsize isn't 512 bytes ... weird)."
5702 #: ../src/guestfs-actions.pod:741
5704 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5705 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5709 #: ../src/guestfs-actions.pod:751
5710 msgid "guestfs_blockdev_rereadpt"
5714 #: ../src/guestfs-actions.pod:753
5718 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5719 " const char *device);\n"
5724 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:504
5725 msgid "Reread the partition table on C<device>."
5729 #: ../src/guestfs-actions.pod:765
5730 msgid "guestfs_blockdev_setbsz"
5734 #: ../src/guestfs-actions.pod:767
5738 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5739 " const char *device,\n"
5740 " int blocksize);\n"
5745 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:512
5746 msgid "This sets the block size of a device."
5750 #: ../src/guestfs-actions.pod:783
5751 msgid "guestfs_blockdev_setro"
5755 #: ../src/guestfs-actions.pod:785
5759 " guestfs_blockdev_setro (guestfs_h *g,\n"
5760 " const char *device);\n"
5765 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:523
5766 msgid "Sets the block device named C<device> to read-only."
5770 #: ../src/guestfs-actions.pod:797
5771 msgid "guestfs_blockdev_setrw"
5775 #: ../src/guestfs-actions.pod:799
5779 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5780 " const char *device);\n"
5785 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:531
5786 msgid "Sets the block device named C<device> to read-write."
5790 #: ../src/guestfs-actions.pod:811
5791 msgid "guestfs_case_sensitive_path"
5795 #: ../src/guestfs-actions.pod:813
5799 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5800 " const char *path);\n"
5805 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:539
5807 "This can be used to resolve case insensitive paths on a filesystem which is "
5808 "case sensitive. The use case is to resolve paths which you have read from "
5809 "Windows configuration files or the Windows Registry, to the true path."
5813 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:544
5815 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5816 "(and probably others), which is that although the underlying filesystem is "
5817 "case-insensitive, the driver exports the filesystem to Linux as case-"
5822 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:549
5824 "One consequence of this is that special directories such as C<c:\\windows> "
5825 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5826 "precise details of how they were created. In Windows itself this would not "
5831 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:555
5833 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5838 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:558
5840 "This function resolves the true case of each element in the path and returns "
5841 "the case-sensitive path."
5845 #: ../src/guestfs-actions.pod:839
5847 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5848 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5849 "how the directories were originally created under Windows)."
5853 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:566
5854 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5858 #: ../src/guestfs-actions.pod:847
5859 msgid "See also C<guestfs_realpath>."
5863 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6517
5864 msgid "(Added in 1.0.75)"
5868 #: ../src/guestfs-actions.pod:854
5873 #: ../src/guestfs-actions.pod:856
5877 " guestfs_cat (guestfs_h *g,\n"
5878 " const char *path);\n"
5883 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5072
5884 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3393
5885 msgid "Return the contents of the file named C<path>."
5889 #: ../src/guestfs-actions.pod:862
5891 "Note that this function cannot correctly handle binary files (specifically, "
5892 "files containing C<\\0> character which is treated as end of string). For "
5893 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5894 "functions which have a more complex interface."
5898 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049
5899 #: ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360
5900 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482
5901 #: ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750
5902 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:2187
5903 #: ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2254
5904 #: ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:2300
5905 #: ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:4880
5906 #: ../src/guestfs-actions.pod:5011 ../src/guestfs-actions.pod:5037
5907 #: ../src/guestfs-actions.pod:5061 ../src/guestfs-actions.pod:5912
5908 #: ../src/guestfs-actions.pod:5967 ../src/guestfs-actions.pod:6113
5909 #: ../src/guestfs-actions.pod:6137 ../src/guestfs-actions.pod:6789
5910 #: ../src/guestfs-actions.pod:6815 ../src/guestfs-actions.pod:6841
5911 #: ../src/guestfs-actions.pod:6860 ../src/guestfs-actions.pod:6945
5912 #: ../src/guestfs-actions.pod:6964 ../src/guestfs-actions.pod:7010
5913 #: ../src/guestfs-actions.pod:7029 ../fish/guestfish-actions.pod:582
5914 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5915 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5916 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5917 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462
5918 #: ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500
5919 #: ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525
5920 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3263
5921 #: ../fish/guestfish-actions.pod:3278 ../fish/guestfish-actions.pod:3354
5922 #: ../fish/guestfish-actions.pod:3371 ../fish/guestfish-actions.pod:3386
5923 #: ../fish/guestfish-actions.pod:3969 ../fish/guestfish-actions.pod:4015
5924 #: ../fish/guestfish-actions.pod:4100 ../fish/guestfish-actions.pod:4115
5925 #: ../fish/guestfish-actions.pod:4525 ../fish/guestfish-actions.pod:4543
5926 #: ../fish/guestfish-actions.pod:4560 ../fish/guestfish-actions.pod:4570
5927 #: ../fish/guestfish-actions.pod:4618 ../fish/guestfish-actions.pod:4628
5928 #: ../fish/guestfish-actions.pod:4657 ../fish/guestfish-actions.pod:4667
5930 "Because of the message protocol, there is a transfer limit of somewhere "
5931 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5935 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3252
5936 #: ../src/guestfs-actions.pod:3314 ../src/guestfs-actions.pod:3331
5937 #: ../src/guestfs-actions.pod:3419 ../src/guestfs-actions.pod:3824
5938 #: ../src/guestfs-actions.pod:3838 ../src/guestfs-actions.pod:4960
5939 #: ../src/guestfs-actions.pod:4974 ../src/guestfs-actions.pod:6676
5940 #: ../src/guestfs-actions.pod:6690
5941 msgid "(Added in 0.4)"
5945 #: ../src/guestfs-actions.pod:875
5946 msgid "guestfs_checksum"
5950 #: ../src/guestfs-actions.pod:877
5954 " guestfs_checksum (guestfs_h *g,\n"
5955 " const char *csumtype,\n"
5956 " const char *path);\n"
5961 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:589
5963 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5967 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:592
5969 "The type of checksum to compute is given by the C<csumtype> parameter which "
5970 "must have one of the following values:"
5974 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:597
5979 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:599
5981 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5986 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:602
5991 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:604
5992 msgid "Compute the MD5 hash (using the C<md5sum> program)."
5996 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:606
6001 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:608
6002 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6006 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:610
6011 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:612
6012 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6016 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:614
6021 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:616
6022 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6026 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:618
6031 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:620
6032 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6036 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:622
6041 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:624
6042 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6046 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:628
6047 msgid "The checksum is returned as a printable string."
6051 #: ../src/guestfs-actions.pod:923
6052 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6056 #: ../src/guestfs-actions.pod:925
6057 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6061 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238
6062 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:3026
6063 #: ../src/guestfs-actions.pod:3055 ../src/guestfs-actions.pod:3116
6064 #: ../src/guestfs-actions.pod:3143 ../src/guestfs-actions.pod:6378
6065 msgid "(Added in 1.0.2)"
6069 #: ../src/guestfs-actions.pod:932
6070 msgid "guestfs_checksum_device"
6074 #: ../src/guestfs-actions.pod:934
6078 " guestfs_checksum_device (guestfs_h *g,\n"
6079 " const char *csumtype,\n"
6080 " const char *device);\n"
6085 #: ../src/guestfs-actions.pod:939
6087 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6088 "device named C<device>. For the types of checksums supported see the "
6089 "C<guestfs_checksum> command."
6093 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4491
6094 #: ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:4587
6095 #: ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:4781
6096 #: ../src/guestfs-actions.pod:6292 ../src/guestfs-actions.pod:6306
6097 #: ../src/guestfs-actions.pod:6702
6098 msgid "(Added in 1.3.2)"
6102 #: ../src/guestfs-actions.pod:948
6103 msgid "guestfs_checksums_out"
6107 #: ../src/guestfs-actions.pod:950
6111 " guestfs_checksums_out (guestfs_h *g,\n"
6112 " const char *csumtype,\n"
6113 " const char *directory,\n"
6114 " const char *sumsfile);\n"
6119 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:646
6121 "This command computes the checksums of all regular files in C<directory> and "
6122 "then emits a list of those checksums to the local output file C<sumsfile>."
6126 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:650
6128 "This can be used for verifying the integrity of a virtual machine. However "
6129 "to be properly secure you should pay attention to the output of the checksum "
6130 "command (it uses the ones from GNU coreutils). In particular when the "
6131 "filename is not printable, coreutils uses a special backslash syntax. For "
6132 "more information, see the GNU coreutils info file."
6136 #: ../src/guestfs-actions.pod:970
6137 msgid "(Added in 1.3.7)"
6141 #: ../src/guestfs-actions.pod:972
6142 msgid "guestfs_chmod"
6146 #: ../src/guestfs-actions.pod:974
6150 " guestfs_chmod (guestfs_h *g,\n"
6152 " const char *path);\n"
6157 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:664
6159 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6164 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:667
6166 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6167 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6172 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:4075
6173 #: ../src/guestfs-actions.pod:4190 ../src/guestfs-actions.pod:4209
6174 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:671
6175 #: ../fish/guestfish-actions.pod:2753 ../fish/guestfish-actions.pod:2838
6176 #: ../fish/guestfish-actions.pod:2848 ../fish/guestfish-actions.pod:2858
6177 msgid "The mode actually set is affected by the umask."
6181 #: ../src/guestfs-actions.pod:992
6182 msgid "guestfs_chown"
6186 #: ../src/guestfs-actions.pod:994
6190 " guestfs_chown (guestfs_h *g,\n"
6193 " const char *path);\n"
6198 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:677
6199 msgid "Change the file owner to C<owner> and group to C<group>."
6203 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3213
6204 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2231
6206 "Only numeric uid and gid are supported. If you want to use names, you will "
6207 "need to locate and parse the password file yourself (Augeas support makes "
6208 "this relatively easy)."
6212 #: ../src/guestfs-actions.pod:1010
6213 msgid "guestfs_command"
6217 #: ../src/guestfs-actions.pod:1012
6221 " guestfs_command (guestfs_h *g,\n"
6222 " char *const *arguments);\n"
6227 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:687
6229 "This call runs a command from the guest filesystem. The filesystem must be "
6230 "mounted, and must contain a compatible operating system (ie. something "
6231 "Linux, with the same or compatible processor architecture)."
6235 #: ../src/guestfs-actions.pod:1021
6237 "The single parameter is an argv-style list of arguments. The first element "
6238 "is the name of the program to run. Subsequent elements are parameters. The "
6239 "list must be non-empty (ie. must contain a program name). Note that the "
6240 "command runs directly, and is I<not> invoked via the shell (see "
6245 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:699
6246 msgid "The return value is anything printed to I<stdout> by the command."
6250 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:702
6252 "If the command returns a non-zero exit status, then this function returns an "
6253 "error message. The error message string is the content of I<stderr> from "
6258 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:706
6260 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6261 "bin>. If you require a program from another location, you should provide "
6262 "the full path in the first parameter."
6266 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:711
6268 "Shared libraries and data files required by the program must be available on "
6269 "filesystems which are mounted in the correct places. It is the caller's "
6270 "responsibility to ensure all filesystems that are needed are mounted at the "
6275 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072
6276 #: ../src/guestfs-actions.pod:1535
6277 msgid "(Added in 0.9.1)"
6281 #: ../src/guestfs-actions.pod:1054
6282 msgid "guestfs_command_lines"
6286 #: ../src/guestfs-actions.pod:1056
6290 " guestfs_command_lines (guestfs_h *g,\n"
6291 " char *const *arguments);\n"
6296 #: ../src/guestfs-actions.pod:1060
6298 "This is the same as C<guestfs_command>, but splits the result into a list of "
6303 #: ../src/guestfs-actions.pod:1063
6304 msgid "See also: C<guestfs_sh_lines>"
6308 #: ../src/guestfs-actions.pod:1074
6309 msgid "guestfs_config"
6313 #: ../src/guestfs-actions.pod:1076
6317 " guestfs_config (guestfs_h *g,\n"
6318 " const char *qemuparam,\n"
6319 " const char *qemuvalue);\n"
6324 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:736
6326 "This can be used to add arbitrary qemu command line parameters of the form "
6327 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6328 "setting some parameters which would interfere with parameters that we use."
6332 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:741
6333 msgid "The first character of C<param> string must be a C<-> (dash)."
6337 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:743
6338 msgid "C<value> can be NULL."
6342 #: ../src/guestfs-actions.pod:1094
6343 msgid "guestfs_copy_size"
6347 #: ../src/guestfs-actions.pod:1096
6351 " guestfs_copy_size (guestfs_h *g,\n"
6352 " const char *src,\n"
6353 " const char *dest,\n"
6359 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:749
6361 "This command copies exactly C<size> bytes from one source device or file "
6362 "C<src> to another destination device or file C<dest>."
6366 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:752
6368 "Note this will fail if the source is too short or if the destination is not "
6373 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233
6374 #: ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684
6375 #: ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6881
6376 #: ../src/guestfs-actions.pod:6900
6378 "This long-running command can generate progress notification messages so "
6379 "that the caller can display a progress bar or indicator. To receive these "
6380 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6381 "guestfs_set_progress_callback>."
6385 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:3851
6386 #: ../src/guestfs-actions.pod:4987 ../src/guestfs-actions.pod:6609
6387 #: ../src/guestfs-actions.pod:6629 ../src/guestfs-actions.pod:6715
6388 msgid "(Added in 1.0.87)"
6392 #: ../src/guestfs-actions.pod:1117
6397 #: ../src/guestfs-actions.pod:1119
6401 " guestfs_cp (guestfs_h *g,\n"
6402 " const char *src,\n"
6403 " const char *dest);\n"
6408 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:759
6410 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6411 "destination filename or destination directory."
6415 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143
6416 #: ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289
6417 #: ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4454
6418 #: ../src/guestfs-actions.pod:4831
6419 msgid "(Added in 1.0.18)"
6423 #: ../src/guestfs-actions.pod:1131
6424 msgid "guestfs_cp_a"
6428 #: ../src/guestfs-actions.pod:1133
6432 " guestfs_cp_a (guestfs_h *g,\n"
6433 " const char *src,\n"
6434 " const char *dest);\n"
6439 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:766
6441 "This copies a file or directory from C<src> to C<dest> recursively using the "
6446 #: ../src/guestfs-actions.pod:1145
6451 #: ../src/guestfs-actions.pod:1147
6455 " guestfs_dd (guestfs_h *g,\n"
6456 " const char *src,\n"
6457 " const char *dest);\n"
6462 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:773
6464 "This command copies from one source device or file C<src> to another "
6465 "destination device or file C<dest>. Normally you would use this to copy to "
6466 "or from a device or partition, for example to duplicate a filesystem."
6470 #: ../src/guestfs-actions.pod:1157
6472 "If the destination is a device, it must be as large or larger than the "
6473 "source file or device, otherwise the copy will fail. This command cannot do "
6474 "partial copies (see C<guestfs_copy_size>)."
6478 #: ../src/guestfs-actions.pod:1165
6483 #: ../src/guestfs-actions.pod:1167
6487 " guestfs_df (guestfs_h *g);\n"
6492 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:786
6493 msgid "This command runs the C<df> command to report disk space used."
6497 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189
6498 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6500 "This command is mostly useful for interactive sessions. It is I<not> "
6501 "intended that you try to parse the output string. Use C<statvfs> from "
6506 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196
6507 #: ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2233
6508 #: ../src/guestfs-actions.pod:2257 ../src/guestfs-actions.pod:2325
6509 #: ../src/guestfs-actions.pod:3961 ../src/guestfs-actions.pod:4354
6510 #: ../src/guestfs-actions.pod:6116 ../src/guestfs-actions.pod:6140
6511 #: ../src/guestfs-actions.pod:6748 ../src/guestfs-actions.pod:6761
6512 #: ../src/guestfs-actions.pod:6774
6513 msgid "(Added in 1.0.54)"
6517 #: ../src/guestfs-actions.pod:1181
6518 msgid "guestfs_df_h"
6522 #: ../src/guestfs-actions.pod:1183
6526 " guestfs_df_h (guestfs_h *g);\n"
6531 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:796
6533 "This command runs the C<df -h> command to report disk space used in human-"
6538 #: ../src/guestfs-actions.pod:1198
6539 msgid "guestfs_dmesg"
6543 #: ../src/guestfs-actions.pod:1200
6547 " guestfs_dmesg (guestfs_h *g);\n"
6552 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:807
6554 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6555 "This is sometimes useful for extended debugging of problems."
6559 #: ../src/guestfs-actions.pod:1207
6561 "Another way to get the same information is to enable verbose messages with "
6562 "C<guestfs_set_verbose> or by setting the environment variable "
6563 "C<LIBGUESTFS_DEBUG=1> before running the program."
6567 #: ../src/guestfs-actions.pod:1217
6568 msgid "guestfs_download"
6572 #: ../src/guestfs-actions.pod:1219
6576 " guestfs_download (guestfs_h *g,\n"
6577 " const char *remotefilename,\n"
6578 " const char *filename);\n"
6583 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249
6584 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6586 "Download file C<remotefilename> and save it as C<filename> on the local "
6591 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6372
6592 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4273
6593 msgid "C<filename> can also be a named pipe."
6597 #: ../src/guestfs-actions.pod:1229
6598 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6602 #: ../src/guestfs-actions.pod:1240
6603 msgid "guestfs_download_offset"
6607 #: ../src/guestfs-actions.pod:1242
6611 " guestfs_download_offset (guestfs_h *g,\n"
6612 " const char *remotefilename,\n"
6613 " const char *filename,\n"
6614 " int64_t offset,\n"
6620 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:836
6622 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6623 "region must be within the file or device)."
6627 #: ../src/guestfs-actions.pod:1255
6629 "Note that there is no limit on the amount of data that can be downloaded "
6630 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6631 "full amount unless an error occurs."
6635 #: ../src/guestfs-actions.pod:1260
6636 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6640 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6407
6641 msgid "(Added in 1.5.17)"
6645 #: ../src/guestfs-actions.pod:1271
6646 msgid "guestfs_drop_caches"
6650 #: ../src/guestfs-actions.pod:1273
6654 " guestfs_drop_caches (guestfs_h *g,\n"
6655 " int whattodrop);\n"
6660 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:852
6662 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6663 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6664 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6668 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:857
6669 msgid "Setting C<whattodrop> to 3 should drop everything."
6673 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:859
6675 "This automatically calls L<sync(2)> before the operation, so that the "
6676 "maximum guest memory is freed."
6680 #: ../src/guestfs-actions.pod:1291
6685 #: ../src/guestfs-actions.pod:1293
6689 " guestfs_du (guestfs_h *g,\n"
6690 " const char *path);\n"
6695 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:866
6697 "This command runs the C<du -s> command to estimate file space usage for "
6702 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:869
6704 "C<path> can be a file or a directory. If C<path> is a directory then the "
6705 "estimate includes the contents of the directory and all subdirectories "
6710 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:873
6712 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6716 #: ../src/guestfs-actions.pod:1311
6717 msgid "guestfs_e2fsck_f"
6721 #: ../src/guestfs-actions.pod:1313
6725 " guestfs_e2fsck_f (guestfs_h *g,\n"
6726 " const char *device);\n"
6731 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:880
6733 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6734 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6739 #: ../src/guestfs-actions.pod:1321
6741 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6742 "Normally you should use C<guestfs_fsck>."
6746 #: ../src/guestfs-actions.pod:1326
6747 msgid "(Added in 1.0.29)"
6751 #: ../src/guestfs-actions.pod:1328
6752 msgid "guestfs_echo_daemon"
6756 #: ../src/guestfs-actions.pod:1330
6760 " guestfs_echo_daemon (guestfs_h *g,\n"
6761 " char *const *words);\n"
6766 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:891
6768 "This command concatenates the list of C<words> passed with single spaces "
6769 "between them and returns the resulting string."
6773 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:894
6774 msgid "You can use this command to test the connection through to the daemon."
6778 #: ../src/guestfs-actions.pod:1339
6779 msgid "See also C<guestfs_ping_daemon>."
6783 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071
6784 #: ../src/guestfs-actions.pod:5620
6785 msgid "(Added in 1.0.69)"
6789 #: ../src/guestfs-actions.pod:1346
6790 msgid "guestfs_egrep"
6794 #: ../src/guestfs-actions.pod:1348
6798 " guestfs_egrep (guestfs_h *g,\n"
6799 " const char *regex,\n"
6800 " const char *path);\n"
6805 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:902
6807 "This calls the external C<egrep> program and returns the matching lines."
6811 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382
6812 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485
6813 #: ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2171
6814 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:2346
6815 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2374
6816 #: ../src/guestfs-actions.pod:2420 ../src/guestfs-actions.pod:2442
6817 #: ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3344
6818 #: ../src/guestfs-actions.pod:3358 ../src/guestfs-actions.pod:3371
6819 #: ../src/guestfs-actions.pod:3385 ../src/guestfs-actions.pod:4289
6820 #: ../src/guestfs-actions.pod:5165 ../src/guestfs-actions.pod:5214
6821 #: ../src/guestfs-actions.pod:5984 ../src/guestfs-actions.pod:5996
6822 #: ../src/guestfs-actions.pod:6009 ../src/guestfs-actions.pod:6022
6823 #: ../src/guestfs-actions.pod:6044 ../src/guestfs-actions.pod:6057
6824 #: ../src/guestfs-actions.pod:6070 ../src/guestfs-actions.pod:6083
6825 #: ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6863
6826 #: ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:6967
6827 #: ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7032
6828 msgid "(Added in 1.0.66)"
6832 #: ../src/guestfs-actions.pod:1365
6833 msgid "guestfs_egrepi"
6837 #: ../src/guestfs-actions.pod:1367
6841 " guestfs_egrepi (guestfs_h *g,\n"
6842 " const char *regex,\n"
6843 " const char *path);\n"
6848 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:912
6850 "This calls the external C<egrep -i> program and returns the matching lines."
6854 #: ../src/guestfs-actions.pod:1384
6855 msgid "guestfs_equal"
6859 #: ../src/guestfs-actions.pod:1386
6863 " guestfs_equal (guestfs_h *g,\n"
6864 " const char *file1,\n"
6865 " const char *file2);\n"
6870 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:922
6872 "This compares the two files C<file1> and C<file2> and returns true if their "
6873 "content is exactly equal, or false otherwise."
6877 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:925
6878 msgid "The external L<cmp(1)> program is used for the comparison."
6882 #: ../src/guestfs-actions.pod:1400
6883 msgid "guestfs_exists"
6887 #: ../src/guestfs-actions.pod:1402
6891 " guestfs_exists (guestfs_h *g,\n"
6892 " const char *path);\n"
6897 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:931
6899 "This returns C<true> if and only if there is a file, directory (or anything) "
6900 "with the given C<path> name."
6904 #: ../src/guestfs-actions.pod:1409
6905 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6909 #: ../src/guestfs-actions.pod:1415
6910 msgid "guestfs_fallocate"
6914 #: ../src/guestfs-actions.pod:1417
6918 " guestfs_fallocate (guestfs_h *g,\n"
6919 " const char *path,\n"
6925 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448
6926 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6928 "This command preallocates a file (containing zero bytes) named C<path> of "
6929 "size C<len> bytes. If the file exists already, it is overwritten."
6933 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:944
6935 "Do not confuse this with the guestfish-specific C<alloc> command which "
6936 "allocates a file in the host and attaches it as a device."
6940 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:948
6942 "This function is deprecated. In new code, use the C<fallocate64> call "
6947 #: ../src/guestfs-actions.pod:1441
6948 msgid "guestfs_fallocate64"
6952 #: ../src/guestfs-actions.pod:1443
6956 " guestfs_fallocate64 (guestfs_h *g,\n"
6957 " const char *path,\n"
6963 #: ../src/guestfs-actions.pod:1452
6965 "Note that this call allocates disk blocks for the file. To create a sparse "
6966 "file use C<guestfs_truncate_size> instead."
6970 #: ../src/guestfs-actions.pod:1455
6972 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6973 "oversight it only allowed 30 bit lengths to be specified, effectively "
6974 "limiting the maximum size of files created through that call to 1GB."
6978 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:971
6980 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6981 "commands which create a file in the host and attach it as a device."
6985 #: ../src/guestfs-actions.pod:1466
6986 msgid "(Added in 1.3.17)"
6990 #: ../src/guestfs-actions.pod:1468
6991 msgid "guestfs_fgrep"
6995 #: ../src/guestfs-actions.pod:1470
6999 " guestfs_fgrep (guestfs_h *g,\n"
7000 " const char *pattern,\n"
7001 " const char *path);\n"
7006 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:979
7008 "This calls the external C<fgrep> program and returns the matching lines."
7012 #: ../src/guestfs-actions.pod:1487
7013 msgid "guestfs_fgrepi"
7017 #: ../src/guestfs-actions.pod:1489
7021 " guestfs_fgrepi (guestfs_h *g,\n"
7022 " const char *pattern,\n"
7023 " const char *path);\n"
7028 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:989
7030 "This calls the external C<fgrep -i> program and returns the matching lines."
7034 #: ../src/guestfs-actions.pod:1506
7035 msgid "guestfs_file"
7039 #: ../src/guestfs-actions.pod:1508
7043 " guestfs_file (guestfs_h *g,\n"
7044 " const char *path);\n"
7049 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:999
7051 "This call uses the standard L<file(1)> command to determine the type or "
7052 "contents of the file."
7056 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1002
7058 "This call will also transparently look inside various types of compressed "
7063 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1005
7065 "The exact command which runs is C<file -zb path>. Note in particular that "
7066 "the filename is not prepended to the output (the C<-b> option)."
7070 #: ../src/guestfs-actions.pod:1522
7072 "This command can also be used on C</dev/> devices (and partitions, LV "
7073 "names). You can for example use this to determine if a device contains a "
7074 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7078 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1014
7080 "If the C<path> does not begin with C</dev/> then this command only works for "
7081 "the content of regular files. For other file types (directory, symbolic "
7082 "link etc) it will just return the string C<directory> etc."
7086 #: ../src/guestfs-actions.pod:1537
7087 msgid "guestfs_file_architecture"
7091 #: ../src/guestfs-actions.pod:1539
7095 " guestfs_file_architecture (guestfs_h *g,\n"
7096 " const char *filename);\n"
7101 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1023
7103 "This detects the architecture of the binary C<filename>, and returns it if "
7108 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1026
7109 msgid "Currently defined architectures are:"
7113 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1030
7118 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1032
7120 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7121 "irrespective of the precise processor requirements of the binary."
7125 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1035
7130 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1037
7131 msgid "64 bit x86-64."
7135 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1039
7140 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1041
7141 msgid "32 bit SPARC."
7145 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1043
7150 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1045
7151 msgid "64 bit SPARC V9 and above."
7155 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1047
7160 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1049
7161 msgid "Intel Itanium."
7165 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1051
7170 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1053
7171 msgid "32 bit Power PC."
7175 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1055
7180 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1057
7181 msgid "64 bit Power PC."
7185 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1061
7186 msgid "Libguestfs may return other architecture strings in future."
7190 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1063
7191 msgid "The function works on at least the following types of files:"
7195 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1069
7196 msgid "many types of Un*x and Linux binary"
7200 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1073
7201 msgid "many types of Un*x and Linux shared library"
7205 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1077
7206 msgid "Windows Win32 and Win64 binaries"
7210 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1081
7211 msgid "Windows Win32 and Win64 DLLs"
7215 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1083
7216 msgid "Win32 binaries and DLLs return C<i386>."
7220 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1085
7221 msgid "Win64 binaries and DLLs return C<x86_64>."
7225 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1089
7226 msgid "Linux kernel modules"
7230 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1093
7231 msgid "Linux new-style initrd images"
7235 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1097
7236 msgid "some non-x86 Linux vmlinuz kernels"
7240 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1101
7241 msgid "What it can't do currently:"
7245 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1107
7246 msgid "static libraries (libfoo.a)"
7250 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1111
7251 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7255 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1115
7256 msgid "x86 Linux vmlinuz kernels"
7260 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1117
7262 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7263 "compressed code, and are horribly hard to unpack. If you want to find the "
7264 "architecture of a kernel, use the architecture of the associated initrd or "
7265 "kernel module(s) instead."
7269 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810
7270 #: ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2478
7271 #: ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2585
7272 #: ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2653
7273 #: ../src/guestfs-actions.pod:2686 ../src/guestfs-actions.pod:2766
7274 #: ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:2997
7275 #: ../src/guestfs-actions.pod:3129
7276 msgid "(Added in 1.5.3)"
7280 #: ../src/guestfs-actions.pod:1649
7281 msgid "guestfs_filesize"
7285 #: ../src/guestfs-actions.pod:1651
7289 " guestfs_filesize (guestfs_h *g,\n"
7290 " const char *file);\n"
7295 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1128
7296 msgid "This command returns the size of C<file> in bytes."
7300 #: ../src/guestfs-actions.pod:1657
7302 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7303 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7304 "devices, use C<guestfs_blockdev_getsize64>."
7308 #: ../src/guestfs-actions.pod:1663
7309 msgid "(Added in 1.0.82)"
7313 #: ../src/guestfs-actions.pod:1665
7314 msgid "guestfs_fill"
7318 #: ../src/guestfs-actions.pod:1667
7322 " guestfs_fill (guestfs_h *g,\n"
7325 " const char *path);\n"
7330 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1138
7332 "This command creates a new file called C<path>. The initial content of the "
7333 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7338 #: ../src/guestfs-actions.pod:1677
7340 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7341 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7342 "bytes use C<guestfs_fill_pattern>."
7346 #: ../src/guestfs-actions.pod:1689
7347 msgid "(Added in 1.0.79)"
7351 #: ../src/guestfs-actions.pod:1691
7352 msgid "guestfs_fill_pattern"
7356 #: ../src/guestfs-actions.pod:1693
7360 " guestfs_fill_pattern (guestfs_h *g,\n"
7361 " const char *pattern,\n"
7363 " const char *path);\n"
7368 #: ../src/guestfs-actions.pod:1699
7370 "This function is like C<guestfs_fill> except that it creates a new file of "
7371 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7372 "pattern is truncated if necessary to ensure the length of the file is "
7373 "exactly C<len> bytes."
7377 #: ../src/guestfs-actions.pod:1711
7378 msgid "(Added in 1.3.12)"
7382 #: ../src/guestfs-actions.pod:1713
7383 msgid "guestfs_find"
7387 #: ../src/guestfs-actions.pod:1715
7391 " guestfs_find (guestfs_h *g,\n"
7392 " const char *directory);\n"
7397 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1160
7399 "This command lists out all files and directories, recursively, starting at "
7400 "C<directory>. It is essentially equivalent to running the shell command "
7401 "C<find directory -print> but some post-processing happens on the output, "
7406 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1165
7408 "This returns a list of strings I<without any prefix>. Thus if the directory "
7413 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1168
7423 #: ../src/guestfs-actions.pod:1731
7425 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7429 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1175
7440 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1180
7441 msgid "If C<directory> is not a directory, then this command returns an error."
7445 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1183
7446 msgid "The returned list is sorted."
7450 #: ../src/guestfs-actions.pod:1744
7451 msgid "See also C<guestfs_find0>."
7455 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3788
7456 #: ../src/guestfs-actions.pod:5249
7457 msgid "(Added in 1.0.27)"
7461 #: ../src/guestfs-actions.pod:1755
7462 msgid "guestfs_find0"
7466 #: ../src/guestfs-actions.pod:1757
7470 " guestfs_find0 (guestfs_h *g,\n"
7471 " const char *directory,\n"
7472 " const char *files);\n"
7477 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1194
7479 "This command lists out all files and directories, recursively, starting at "
7480 "C<directory>, placing the resulting list in the external file called "
7485 #: ../src/guestfs-actions.pod:1766
7487 "This command works the same way as C<guestfs_find> with the following "
7492 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1205
7493 msgid "The resulting list is written to an external file."
7497 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1209
7499 "Items (filenames) in the result are separated by C<\\0> characters. See "
7500 "L<find(1)> option I<-print0>."
7504 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1214
7505 msgid "This command is not limited in the number of names that it can return."
7509 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1219
7510 msgid "The result list is not sorted."
7514 #: ../src/guestfs-actions.pod:1793
7515 msgid "(Added in 1.0.74)"
7519 #: ../src/guestfs-actions.pod:1795
7520 msgid "guestfs_findfs_label"
7524 #: ../src/guestfs-actions.pod:1797
7528 " guestfs_findfs_label (guestfs_h *g,\n"
7529 " const char *label);\n"
7534 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1229
7536 "This command searches the filesystems and returns the one which has the "
7537 "given label. An error is returned if no such filesystem can be found."
7541 #: ../src/guestfs-actions.pod:1805
7542 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7546 #: ../src/guestfs-actions.pod:1812
7547 msgid "guestfs_findfs_uuid"
7551 #: ../src/guestfs-actions.pod:1814
7555 " guestfs_findfs_uuid (guestfs_h *g,\n"
7556 " const char *uuid);\n"
7561 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1239
7563 "This command searches the filesystems and returns the one which has the "
7564 "given UUID. An error is returned if no such filesystem can be found."
7568 #: ../src/guestfs-actions.pod:1822
7569 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7573 #: ../src/guestfs-actions.pod:1829
7574 msgid "guestfs_fsck"
7578 #: ../src/guestfs-actions.pod:1831
7582 " guestfs_fsck (guestfs_h *g,\n"
7583 " const char *fstype,\n"
7584 " const char *device);\n"
7589 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1249
7591 "This runs the filesystem checker (fsck) on C<device> which should have "
7592 "filesystem type C<fstype>."
7596 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1252
7598 "The returned integer is the status. See L<fsck(8)> for the list of status "
7599 "codes from C<fsck>."
7603 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1261
7604 msgid "Multiple status codes can be summed together."
7608 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1265
7610 "A non-zero return code can mean \"success\", for example if errors have been "
7611 "corrected on the filesystem."
7615 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1270
7616 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7620 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1275
7622 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7626 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:6886
7627 msgid "(Added in 1.0.16)"
7631 #: ../src/guestfs-actions.pod:1868
7632 msgid "guestfs_get_append"
7636 #: ../src/guestfs-actions.pod:1870
7640 " guestfs_get_append (guestfs_h *g);\n"
7645 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1281
7647 "Return the additional kernel options which are added to the guest kernel "
7652 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1284
7653 msgid "If C<NULL> then no options are added."
7657 #: ../src/guestfs-actions.pod:1878
7659 "This function returns a string which may be NULL. There is no way to return "
7660 "an error from this function. The string is owned by the guest handle and "
7661 "must I<not> be freed."
7665 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:4927
7666 #: ../src/guestfs-actions.pod:5390 ../src/guestfs-actions.pod:5758
7667 #: ../src/guestfs-actions.pod:5777 ../src/guestfs-actions.pod:5793
7668 #: ../src/guestfs-actions.pod:5810 ../src/guestfs-actions.pod:6557
7669 #: ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:6929
7670 msgid "(Added in 1.0.26)"
7674 #: ../src/guestfs-actions.pod:1884
7675 msgid "guestfs_get_autosync"
7679 #: ../src/guestfs-actions.pod:1886
7683 " guestfs_get_autosync (guestfs_h *g);\n"
7688 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1290
7689 msgid "Get the autosync flag."
7693 #: ../src/guestfs-actions.pod:1895
7694 msgid "guestfs_get_direct"
7698 #: ../src/guestfs-actions.pod:1897
7702 " guestfs_get_direct (guestfs_h *g);\n"
7707 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1296
7708 msgid "Return the direct appliance mode flag."
7712 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5431
7713 msgid "(Added in 1.0.72)"
7717 #: ../src/guestfs-actions.pod:1906
7718 msgid "guestfs_get_e2label"
7722 #: ../src/guestfs-actions.pod:1908
7726 " guestfs_get_e2label (guestfs_h *g,\n"
7727 " const char *device);\n"
7732 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1302
7734 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7738 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1305
7740 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7744 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946
7745 #: ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5468
7746 msgid "(Added in 1.0.15)"
7750 #: ../src/guestfs-actions.pod:1927
7751 msgid "guestfs_get_e2uuid"
7755 #: ../src/guestfs-actions.pod:1929
7759 " guestfs_get_e2uuid (guestfs_h *g,\n"
7760 " const char *device);\n"
7765 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1316
7767 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7771 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1319
7773 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7777 #: ../src/guestfs-actions.pod:1948
7778 msgid "guestfs_get_memsize"
7782 #: ../src/guestfs-actions.pod:1950
7786 " guestfs_get_memsize (guestfs_h *g);\n"
7791 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1330
7793 "This gets the memory size in megabytes allocated to the qemu subprocess."
7797 #: ../src/guestfs-actions.pod:1956
7799 "If C<guestfs_set_memsize> was not called on this handle, and if "
7800 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7801 "value for memsize."
7805 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041
7806 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5591
7807 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7808 #: ../fish/guestfish-actions.pod:3680 ../fish/guestfish-actions.pod:3767
7810 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7814 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:4079
7815 #: ../src/guestfs-actions.pod:4194 ../src/guestfs-actions.pod:4213
7816 #: ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4244
7817 #: ../src/guestfs-actions.pod:4261 ../src/guestfs-actions.pod:4274
7818 #: ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5489
7819 #: ../src/guestfs-actions.pod:5732 ../src/guestfs-actions.pod:6333
7820 msgid "(Added in 1.0.55)"
7824 #: ../src/guestfs-actions.pod:1967
7825 msgid "guestfs_get_network"
7829 #: ../src/guestfs-actions.pod:1969
7833 " guestfs_get_network (guestfs_h *g);\n"
7838 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1344
7839 msgid "This returns the enable network flag."
7843 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5508
7844 msgid "(Added in 1.5.4)"
7848 #: ../src/guestfs-actions.pod:1978
7849 msgid "guestfs_get_path"
7853 #: ../src/guestfs-actions.pod:1980
7857 " guestfs_get_path (guestfs_h *g);\n"
7862 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1350
7863 msgid "Return the current search path."
7867 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1352
7869 "This is always non-NULL. If it wasn't set already, then this will return "
7874 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
7876 "This function returns a string, or NULL on error. The string is owned by "
7877 "the guest handle and must I<not> be freed."
7881 #: ../src/guestfs-actions.pod:1993
7882 msgid "guestfs_get_pid"
7886 #: ../src/guestfs-actions.pod:1995
7890 " guestfs_get_pid (guestfs_h *g);\n"
7895 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1361
7897 "Return the process ID of the qemu subprocess. If there is no qemu "
7898 "subprocess, then this will return an error."
7902 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1364
7903 msgid "This is an internal call used for debugging and testing."
7907 #: ../src/guestfs-actions.pod:2005
7908 msgid "(Added in 1.0.56)"
7912 #: ../src/guestfs-actions.pod:2007
7913 msgid "guestfs_get_qemu"
7917 #: ../src/guestfs-actions.pod:2009
7921 " guestfs_get_qemu (guestfs_h *g);\n"
7926 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1370
7927 msgid "Return the current qemu binary."
7931 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1372
7933 "This is always non-NULL. If it wasn't set already, then this will return "
7934 "the default qemu binary name."
7938 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5553
7939 msgid "(Added in 1.0.6)"
7943 #: ../src/guestfs-actions.pod:2022
7944 msgid "guestfs_get_recovery_proc"
7948 #: ../src/guestfs-actions.pod:2024
7952 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7957 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1379
7958 msgid "Return the recovery process enabled flag."
7962 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3219
7963 #: ../src/guestfs-actions.pod:3486 ../src/guestfs-actions.pod:3886
7964 #: ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:4857
7965 #: ../src/guestfs-actions.pod:5200 ../src/guestfs-actions.pod:5577
7966 #: ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6256
7967 #: ../src/guestfs-actions.pod:6438
7968 msgid "(Added in 1.0.77)"
7972 #: ../src/guestfs-actions.pod:2033
7973 msgid "guestfs_get_selinux"
7977 #: ../src/guestfs-actions.pod:2035
7981 " guestfs_get_selinux (guestfs_h *g);\n"
7986 #: ../src/guestfs-actions.pod:2038
7988 "This returns the current setting of the selinux flag which is passed to the "
7989 "appliance at boot time. See C<guestfs_set_selinux>."
7993 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109
7994 #: ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:5650
7995 msgid "(Added in 1.0.67)"
7999 #: ../src/guestfs-actions.pod:2048
8000 msgid "guestfs_get_state"
8004 #: ../src/guestfs-actions.pod:2050
8008 " guestfs_get_state (guestfs_h *g);\n"
8013 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1395
8015 "This returns the current state as an opaque integer. This is only useful "
8016 "for printing debug and internal error messages."
8020 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:3022
8021 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3112
8022 #: ../src/guestfs-actions.pod:3139 ../fish/guestfish-actions.pod:1398
8023 #: ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2131
8024 #: ../fish/guestfish-actions.pod:2169 ../fish/guestfish-actions.pod:2185
8025 msgid "For more information on states, see L<guestfs(3)>."
8029 #: ../src/guestfs-actions.pod:2062
8030 msgid "guestfs_get_trace"
8034 #: ../src/guestfs-actions.pod:2064
8038 " guestfs_get_trace (guestfs_h *g);\n"
8043 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1404
8044 msgid "Return the command trace flag."
8048 #: ../src/guestfs-actions.pod:2073
8049 msgid "guestfs_get_umask"
8053 #: ../src/guestfs-actions.pod:2075
8057 " guestfs_get_umask (guestfs_h *g);\n"
8062 #: ../src/guestfs-actions.pod:2078
8064 "Return the current umask. By default the umask is C<022> unless it has been "
8065 "set by calling C<guestfs_umask>."
8069 #: ../src/guestfs-actions.pod:2085
8070 msgid "guestfs_get_verbose"
8074 #: ../src/guestfs-actions.pod:2087
8078 " guestfs_get_verbose (guestfs_h *g);\n"
8083 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1417
8084 msgid "This returns the verbose messages flag."
8088 #: ../src/guestfs-actions.pod:2096
8089 msgid "guestfs_getcon"
8093 #: ../src/guestfs-actions.pod:2098
8097 " guestfs_getcon (guestfs_h *g);\n"
8102 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1423
8103 msgid "This gets the SELinux security context of the daemon."
8107 #: ../src/guestfs-actions.pod:2103
8109 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8113 #: ../src/guestfs-actions.pod:2111
8114 msgid "guestfs_getxattrs"
8118 #: ../src/guestfs-actions.pod:2113
8121 " struct guestfs_xattr_list *\n"
8122 " guestfs_getxattrs (guestfs_h *g,\n"
8123 " const char *path);\n"
8128 #: ../src/guestfs-actions.pod:2117 ../fish/guestfish-actions.pod:1432
8130 "This call lists the extended attributes of the file or directory C<path>."
8134 #: ../src/guestfs-actions.pod:2120 ../fish/guestfish-actions.pod:1435
8136 "At the system call level, this is a combination of the L<listxattr(2)> and "
8137 "L<getxattr(2)> calls."
8141 #: ../src/guestfs-actions.pod:2123
8142 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8146 #: ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:3231
8147 #: ../src/guestfs-actions.pod:3882
8149 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8150 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8154 #: ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:3235
8155 #: ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3436
8156 #: ../src/guestfs-actions.pod:5230 ../src/guestfs-actions.pod:5669
8157 #: ../src/guestfs-actions.pod:6994
8158 msgid "(Added in 1.0.59)"
8162 #: ../src/guestfs-actions.pod:2131
8163 msgid "guestfs_glob_expand"
8167 #: ../src/guestfs-actions.pod:2133
8171 " guestfs_glob_expand (guestfs_h *g,\n"
8172 " const char *pattern);\n"
8177 #: ../src/guestfs-actions.pod:2137 ../fish/guestfish-actions.pod:1444
8179 "This command searches for all the pathnames matching C<pattern> according to "
8180 "the wildcard expansion rules used by the shell."
8184 #: ../src/guestfs-actions.pod:2141 ../fish/guestfish-actions.pod:1448
8186 "If no paths match, then this returns an empty list (note: not an error)."
8190 #: ../src/guestfs-actions.pod:2144 ../fish/guestfish-actions.pod:1451
8192 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8193 "GLOB_BRACE>. See that manual page for more details."
8197 #: ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:5834
8198 #: ../src/guestfs-actions.pod:5851
8199 msgid "(Added in 1.0.50)"
8203 #: ../src/guestfs-actions.pod:2154
8204 msgid "guestfs_grep"
8208 #: ../src/guestfs-actions.pod:2156
8212 " guestfs_grep (guestfs_h *g,\n"
8213 " const char *regex,\n"
8214 " const char *path);\n"
8219 #: ../src/guestfs-actions.pod:2161 ../fish/guestfish-actions.pod:1459
8220 msgid "This calls the external C<grep> program and returns the matching lines."
8224 #: ../src/guestfs-actions.pod:2173
8225 msgid "guestfs_grepi"
8229 #: ../src/guestfs-actions.pod:2175
8233 " guestfs_grepi (guestfs_h *g,\n"
8234 " const char *regex,\n"
8235 " const char *path);\n"
8240 #: ../src/guestfs-actions.pod:2180 ../fish/guestfish-actions.pod:1469
8242 "This calls the external C<grep -i> program and returns the matching lines."
8246 #: ../src/guestfs-actions.pod:2192
8247 msgid "guestfs_grub_install"
8251 #: ../src/guestfs-actions.pod:2194
8255 " guestfs_grub_install (guestfs_h *g,\n"
8256 " const char *root,\n"
8257 " const char *device);\n"
8262 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1479
8264 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8265 "the root directory being C<root>."
8269 #: ../src/guestfs-actions.pod:2202 ../fish/guestfish-actions.pod:1482
8271 "Note: If grub-install reports the error \"No suitable drive was found in the "
8272 "generated device map.\" it may be that you need to create a C</boot/grub/"
8273 "device.map> file first that contains the mapping between grub device names "
8274 "and Linux device names. It is usually sufficient to create a file "
8279 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1489
8287 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1491
8288 msgid "replacing C</dev/vda> with the name of the installation device."
8292 #: ../src/guestfs-actions.pod:2215
8293 msgid "(Added in 1.0.17)"
8297 #: ../src/guestfs-actions.pod:2217
8298 msgid "guestfs_head"
8302 #: ../src/guestfs-actions.pod:2219
8306 " guestfs_head (guestfs_h *g,\n"
8307 " const char *path);\n"
8312 #: ../src/guestfs-actions.pod:2223 ../fish/guestfish-actions.pod:1497
8314 "This command returns up to the first 10 lines of a file as a list of strings."
8318 #: ../src/guestfs-actions.pod:2235
8319 msgid "guestfs_head_n"
8323 #: ../src/guestfs-actions.pod:2237
8327 " guestfs_head_n (guestfs_h *g,\n"
8329 " const char *path);\n"
8334 #: ../src/guestfs-actions.pod:2242 ../fish/guestfish-actions.pod:1507
8336 "If the parameter C<nrlines> is a positive number, this returns the first "
8337 "C<nrlines> lines of the file C<path>."
8341 #: ../src/guestfs-actions.pod:2245 ../fish/guestfish-actions.pod:1510
8343 "If the parameter C<nrlines> is a negative number, this returns lines from "
8344 "the file C<path>, excluding the last C<nrlines> lines."
8348 #: ../src/guestfs-actions.pod:2248 ../src/guestfs-actions.pod:6131
8349 #: ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:4113
8350 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8354 #: ../src/guestfs-actions.pod:2259
8355 msgid "guestfs_hexdump"
8359 #: ../src/guestfs-actions.pod:2261
8363 " guestfs_hexdump (guestfs_h *g,\n"
8364 " const char *path);\n"
8369 #: ../src/guestfs-actions.pod:2265 ../fish/guestfish-actions.pod:1522
8371 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8372 "readable, canonical hex dump of the file."
8376 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:5915
8377 #: ../src/guestfs-actions.pod:5970
8378 msgid "(Added in 1.0.22)"
8382 #: ../src/guestfs-actions.pod:2276
8383 msgid "guestfs_initrd_cat"
8387 #: ../src/guestfs-actions.pod:2278
8391 " guestfs_initrd_cat (guestfs_h *g,\n"
8392 " const char *initrdpath,\n"
8393 " const char *filename,\n"
8394 " size_t *size_r);\n"
8399 #: ../src/guestfs-actions.pod:2284 ../fish/guestfish-actions.pod:1532
8401 "This command unpacks the file C<filename> from the initrd file called "
8402 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8407 #: ../src/guestfs-actions.pod:2288 ../fish/guestfish-actions.pod:1536
8409 "For example, in guestfish you could use the following command to examine the "
8410 "boot script (usually called C</init>) contained in a Linux initrd or "
8415 #: ../src/guestfs-actions.pod:2292 ../fish/guestfish-actions.pod:1540
8418 " initrd-cat /boot/initrd-<version>.img init\n"
8423 #: ../src/guestfs-actions.pod:2294
8424 msgid "See also C<guestfs_initrd_list>."
8428 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:4850
8429 #: ../src/guestfs-actions.pod:4876 ../src/guestfs-actions.pod:5057
8431 "This function returns a buffer, or NULL on error. The size of the returned "
8432 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8437 #: ../src/guestfs-actions.pod:2305
8438 msgid "guestfs_initrd_list"
8442 #: ../src/guestfs-actions.pod:2307
8446 " guestfs_initrd_list (guestfs_h *g,\n"
8447 " const char *path);\n"
8452 #: ../src/guestfs-actions.pod:2311 ../fish/guestfish-actions.pod:1551
8453 msgid "This command lists out files contained in an initrd."
8457 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
8459 "The files are listed without any initial C</> character. The files are "
8460 "listed in the order they appear (not necessarily alphabetical). Directory "
8461 "names are listed as separate items."
8465 #: ../src/guestfs-actions.pod:2317 ../fish/guestfish-actions.pod:1557
8467 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8468 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8473 #: ../src/guestfs-actions.pod:2327
8474 msgid "guestfs_inotify_add_watch"
8478 #: ../src/guestfs-actions.pod:2329
8482 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8483 " const char *path,\n"
8489 #: ../src/guestfs-actions.pod:2334 ../fish/guestfish-actions.pod:1565
8490 msgid "Watch C<path> for the events listed in C<mask>."
8494 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
8496 "Note that if C<path> is a directory then events within that directory are "
8497 "watched, but this does I<not> happen recursively (in subdirectories)."
8501 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
8503 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8504 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8508 #: ../src/guestfs-actions.pod:2348
8509 msgid "guestfs_inotify_close"
8513 #: ../src/guestfs-actions.pod:2350
8517 " guestfs_inotify_close (guestfs_h *g);\n"
8522 #: ../src/guestfs-actions.pod:2353 ../fish/guestfish-actions.pod:1579
8524 "This closes the inotify handle which was previously opened by inotify_init. "
8525 "It removes all watches, throws away any pending events, and deallocates all "
8530 #: ../src/guestfs-actions.pod:2361
8531 msgid "guestfs_inotify_files"
8535 #: ../src/guestfs-actions.pod:2363
8539 " guestfs_inotify_files (guestfs_h *g);\n"
8544 #: ../src/guestfs-actions.pod:2366
8546 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8547 "returns a list of pathnames of objects that were touched. The returned "
8548 "pathnames are sorted and deduplicated."
8552 #: ../src/guestfs-actions.pod:2376
8553 msgid "guestfs_inotify_init"
8557 #: ../src/guestfs-actions.pod:2378
8561 " guestfs_inotify_init (guestfs_h *g,\n"
8562 " int maxevents);\n"
8567 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1595
8569 "This command creates a new inotify handle. The inotify subsystem can be "
8570 "used to notify events which happen to objects in the guest filesystem."
8574 #: ../src/guestfs-actions.pod:2386
8576 "C<maxevents> is the maximum number of events which will be queued up between "
8577 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8578 "passed as C<0>, then the kernel (or previously set) default is used. For "
8579 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8580 "throws away events, but records the fact that it threw them away by setting "
8581 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8582 "C<guestfs_inotify_read>)."
8586 #: ../src/guestfs-actions.pod:2396
8588 "Before any events are generated, you have to add some watches to the "
8589 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8590 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8594 #: ../src/guestfs-actions.pod:2402
8596 "Queued up events should be read periodically by calling "
8597 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8598 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8599 "often enough then you risk the internal queue overflowing."
8603 #: ../src/guestfs-actions.pod:2409
8605 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8606 "This also removes any watches automatically."
8610 #: ../src/guestfs-actions.pod:2413 ../fish/guestfish-actions.pod:1626
8612 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8613 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8614 "that there is one global inotify handle per libguestfs instance."
8618 #: ../src/guestfs-actions.pod:2422
8619 msgid "guestfs_inotify_read"
8623 #: ../src/guestfs-actions.pod:2424
8626 " struct guestfs_inotify_event_list *\n"
8627 " guestfs_inotify_read (guestfs_h *g);\n"
8632 #: ../src/guestfs-actions.pod:2427 ../fish/guestfish-actions.pod:1635
8634 "Return the complete queue of events that have happened since the previous "
8639 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1638
8640 msgid "If no events have happened, this returns an empty list."
8644 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1640
8646 "I<Note>: In order to make sure that all events have been read, you must call "
8647 "this function repeatedly until it returns an empty list. The reason is that "
8648 "the call will read events up to the maximum appliance-to-host message size "
8649 "and leave remaining events in the queue."
8653 #: ../src/guestfs-actions.pod:2438
8655 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8656 "there was an error. I<The caller must call "
8657 "C<guestfs_free_inotify_event_list> after use>."
8661 #: ../src/guestfs-actions.pod:2444
8662 msgid "guestfs_inotify_rm_watch"
8666 #: ../src/guestfs-actions.pod:2446
8670 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8676 #: ../src/guestfs-actions.pod:2450
8678 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8682 #: ../src/guestfs-actions.pod:2457
8683 msgid "guestfs_inspect_get_arch"
8687 #: ../src/guestfs-actions.pod:2459
8691 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8692 " const char *root);\n"
8697 #: ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:2486
8698 #: ../src/guestfs-actions.pod:2567 ../src/guestfs-actions.pod:2593
8699 #: ../src/guestfs-actions.pod:2613 ../src/guestfs-actions.pod:2640
8700 #: ../src/guestfs-actions.pod:2661 ../src/guestfs-actions.pod:2694
8701 #: ../src/guestfs-actions.pod:2721 ../src/guestfs-actions.pod:2750
8702 #: ../src/guestfs-actions.pod:2792 ../src/guestfs-actions.pod:2834
8703 #: ../src/guestfs-actions.pod:2857
8705 "This function should only be called with a root device string as returned by "
8706 "C<guestfs_inspect_os>."
8710 #: ../src/guestfs-actions.pod:2466
8712 "This returns the architecture of the inspected operating system. The "
8713 "possible return values are listed under C<guestfs_file_architecture>."
8717 #: ../src/guestfs-actions.pod:2470 ../fish/guestfish-actions.pod:1664
8719 "If the architecture could not be determined, then the string C<unknown> is "
8724 #: ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2554
8725 #: ../src/guestfs-actions.pod:2602 ../src/guestfs-actions.pod:2628
8726 #: ../src/guestfs-actions.pod:2710 ../src/guestfs-actions.pod:2739
8727 #: ../src/guestfs-actions.pod:2761 ../src/guestfs-actions.pod:2780
8728 #: ../src/guestfs-actions.pod:2821 ../src/guestfs-actions.pod:2844
8729 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:2989
8730 #: ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1741
8731 #: ../fish/guestfish-actions.pod:1774 ../fish/guestfish-actions.pod:1795
8732 #: ../fish/guestfish-actions.pod:1855 ../fish/guestfish-actions.pod:1879
8733 #: ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1909
8734 #: ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1960
8735 #: ../fish/guestfish-actions.pod:2059 ../fish/guestfish-actions.pod:2093
8736 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8740 #: ../src/guestfs-actions.pod:2480
8741 msgid "guestfs_inspect_get_distro"
8745 #: ../src/guestfs-actions.pod:2482
8749 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8750 " const char *root);\n"
8755 #: ../src/guestfs-actions.pod:2489 ../fish/guestfish-actions.pod:1676
8757 "This returns the distro (distribution) of the inspected operating system."
8761 #: ../src/guestfs-actions.pod:2492 ../fish/guestfish-actions.pod:1679
8762 msgid "Currently defined distros are:"
8766 #: ../src/guestfs-actions.pod:2496 ../fish/guestfish-actions.pod:1683
8767 msgid "\"archlinux\""
8771 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1685
8776 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1687
8781 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1689
8786 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1691
8791 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1693
8796 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1695
8801 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1697
8806 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1699
8807 msgid "\"linuxmint\""
8811 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1701
8816 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1703
8817 msgid "\"mandriva\""
8821 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1705
8826 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1707
8831 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1709
8836 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1711
8841 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1713
8846 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1715
8847 msgid "\"redhat-based\""
8851 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1717
8852 msgid "Some Red Hat-derived distro."
8856 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1719
8861 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1721
8862 msgid "Red Hat Enterprise Linux and some derivatives."
8866 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1723
8871 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1725
8876 #: ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2812
8877 #: ../fish/guestfish-actions.pod:1727 ../fish/guestfish-actions.pod:1935
8882 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1729
8883 msgid "The distro could not be determined."
8887 #: ../src/guestfs-actions.pod:2544 ../src/guestfs-actions.pod:2804
8888 #: ../fish/guestfish-actions.pod:1731 ../fish/guestfish-actions.pod:1927
8893 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1733
8895 "Windows does not have distributions. This string is returned if the OS type "
8900 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2818
8901 #: ../fish/guestfish-actions.pod:1738 ../fish/guestfish-actions.pod:1941
8903 "Future versions of libguestfs may return other strings here. The caller "
8904 "should be prepared to handle any string."
8908 #: ../src/guestfs-actions.pod:2561
8909 msgid "guestfs_inspect_get_filesystems"
8913 #: ../src/guestfs-actions.pod:2563
8917 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8918 " const char *root);\n"
8923 #: ../src/guestfs-actions.pod:2570 ../fish/guestfish-actions.pod:1750
8925 "This returns a list of all the filesystems that we think are associated with "
8926 "this operating system. This includes the root filesystem, other ordinary "
8927 "filesystems, and non-mounted devices like swap partitions."
8931 #: ../src/guestfs-actions.pod:2575 ../fish/guestfish-actions.pod:1755
8933 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8934 "to be shared between operating systems."
8938 #: ../src/guestfs-actions.pod:2578
8940 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8941 "C<guestfs_inspect_get_mountpoints>."
8945 #: ../src/guestfs-actions.pod:2587
8946 msgid "guestfs_inspect_get_hostname"
8950 #: ../src/guestfs-actions.pod:2589
8954 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
8955 " const char *root);\n"
8960 #: ../src/guestfs-actions.pod:2596 ../fish/guestfish-actions.pod:1768
8962 "This function returns the hostname of the operating system as found by "
8963 "inspection of the guest's configuration files."
8967 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:1771
8969 "If the hostname could not be determined, then the string C<unknown> is "
8974 #: ../src/guestfs-actions.pod:2607
8975 msgid "guestfs_inspect_get_major_version"
8979 #: ../src/guestfs-actions.pod:2609
8983 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
8984 " const char *root);\n"
8989 #: ../src/guestfs-actions.pod:2616 ../fish/guestfish-actions.pod:1783
8991 "This returns the major version number of the inspected operating system."
8995 #: ../src/guestfs-actions.pod:2619 ../fish/guestfish-actions.pod:1786
8997 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
8998 "popular public names used by the operating system. Notably the operating "
8999 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9000 "1). You can find out the real versions corresponding to releases of Windows "
9001 "by consulting Wikipedia or MSDN."
9005 #: ../src/guestfs-actions.pod:2626 ../src/guestfs-actions.pod:2646
9006 #: ../fish/guestfish-actions.pod:1793 ../fish/guestfish-actions.pod:1807
9007 msgid "If the version could not be determined, then C<0> is returned."
9011 #: ../src/guestfs-actions.pod:2634
9012 msgid "guestfs_inspect_get_minor_version"
9016 #: ../src/guestfs-actions.pod:2636
9020 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9021 " const char *root);\n"
9026 #: ../src/guestfs-actions.pod:2643 ../fish/guestfish-actions.pod:1804
9028 "This returns the minor version number of the inspected operating system."
9032 #: ../src/guestfs-actions.pod:2648
9034 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9035 "C<guestfs_inspect_get_major_version>."
9039 #: ../src/guestfs-actions.pod:2655
9040 msgid "guestfs_inspect_get_mountpoints"
9044 #: ../src/guestfs-actions.pod:2657
9048 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9049 " const char *root);\n"
9054 #: ../src/guestfs-actions.pod:2664 ../fish/guestfish-actions.pod:1819
9056 "This returns a hash of where we think the filesystems associated with this "
9057 "operating system should be mounted. Callers should note that this is at "
9058 "best an educated guess made by reading configuration files such as C</etc/"
9063 #: ../src/guestfs-actions.pod:2669 ../fish/guestfish-actions.pod:1824
9065 "Each element in the returned hashtable has a key which is the path of the "
9066 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9067 "mounted there (eg. C</dev/sda1>)."
9071 #: ../src/guestfs-actions.pod:2674 ../fish/guestfish-actions.pod:1829
9073 "Non-mounted devices such as swap devices are I<not> returned in this list."
9077 #: ../src/guestfs-actions.pod:2677
9079 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9080 "C<guestfs_inspect_get_filesystems>."
9084 #: ../src/guestfs-actions.pod:2680 ../src/guestfs-actions.pod:3288
9085 #: ../src/guestfs-actions.pod:4416 ../src/guestfs-actions.pod:6272
9087 "This function returns a NULL-terminated array of strings, or NULL if there "
9088 "was an error. The array of strings will always have length C<2n+1>, where "
9089 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9090 "caller must free the strings and the array after use>."
9094 #: ../src/guestfs-actions.pod:2688
9095 msgid "guestfs_inspect_get_package_format"
9099 #: ../src/guestfs-actions.pod:2690
9103 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9104 " const char *root);\n"
9109 #: ../src/guestfs-actions.pod:2697
9111 "This function and C<guestfs_inspect_get_package_management> return the "
9112 "package format and package management tool used by the inspected operating "
9113 "system. For example for Fedora these functions would return C<rpm> (package "
9114 "format) and C<yum> (package management)."
9118 #: ../src/guestfs-actions.pod:2703 ../fish/guestfish-actions.pod:1848
9120 "This returns the string C<unknown> if we could not determine the package "
9121 "format I<or> if the operating system does not have a real packaging system "
9126 #: ../src/guestfs-actions.pod:2707 ../fish/guestfish-actions.pod:1852
9128 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9129 "Future versions of libguestfs may return other strings."
9133 #: ../src/guestfs-actions.pod:2715
9134 msgid "guestfs_inspect_get_package_management"
9138 #: ../src/guestfs-actions.pod:2717
9142 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9143 " const char *root);\n"
9148 #: ../src/guestfs-actions.pod:2724
9150 "C<guestfs_inspect_get_package_format> and this function return the package "
9151 "format and package management tool used by the inspected operating system. "
9152 "For example for Fedora these functions would return C<rpm> (package format) "
9153 "and C<yum> (package management)."
9157 #: ../src/guestfs-actions.pod:2730 ../fish/guestfish-actions.pod:1870
9159 "This returns the string C<unknown> if we could not determine the package "
9160 "management tool I<or> if the operating system does not have a real packaging "
9161 "system (eg. Windows)."
9165 #: ../src/guestfs-actions.pod:2734 ../fish/guestfish-actions.pod:1874
9167 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9168 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9169 "libguestfs may return other strings."
9173 #: ../src/guestfs-actions.pod:2744
9174 msgid "guestfs_inspect_get_product_name"
9178 #: ../src/guestfs-actions.pod:2746
9182 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9183 " const char *root);\n"
9188 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:1888
9190 "This returns the product name of the inspected operating system. The "
9191 "product name is generally some freeform string which can be displayed to the "
9192 "user, but should not be parsed by programs."
9196 #: ../src/guestfs-actions.pod:2758 ../fish/guestfish-actions.pod:1893
9198 "If the product name could not be determined, then the string C<unknown> is "
9203 #: ../src/guestfs-actions.pod:2768
9204 msgid "guestfs_inspect_get_roots"
9208 #: ../src/guestfs-actions.pod:2770
9212 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9217 #: ../src/guestfs-actions.pod:2773
9219 "This function is a convenient way to get the list of root devices, as "
9220 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9221 "the whole inspection process."
9225 #: ../src/guestfs-actions.pod:2777
9227 "This returns an empty list if either no root devices were found or the "
9228 "caller has not called C<guestfs_inspect_os>."
9232 #: ../src/guestfs-actions.pod:2786
9233 msgid "guestfs_inspect_get_type"
9237 #: ../src/guestfs-actions.pod:2788
9241 " guestfs_inspect_get_type (guestfs_h *g,\n"
9242 " const char *root);\n"
9247 #: ../src/guestfs-actions.pod:2795 ../fish/guestfish-actions.pod:1918
9249 "This returns the type of the inspected operating system. Currently defined "
9254 #: ../src/guestfs-actions.pod:2800 ../fish/guestfish-actions.pod:1923
9259 #: ../src/guestfs-actions.pod:2802 ../fish/guestfish-actions.pod:1925
9260 msgid "Any Linux-based operating system."
9264 #: ../src/guestfs-actions.pod:2806 ../fish/guestfish-actions.pod:1929
9265 msgid "Any Microsoft Windows operating system."
9269 #: ../src/guestfs-actions.pod:2808 ../fish/guestfish-actions.pod:1931
9274 #: ../src/guestfs-actions.pod:2810 ../fish/guestfish-actions.pod:1933
9279 #: ../src/guestfs-actions.pod:2814 ../fish/guestfish-actions.pod:1937
9280 msgid "The operating system type could not be determined."
9284 #: ../src/guestfs-actions.pod:2828
9285 msgid "guestfs_inspect_get_windows_systemroot"
9289 #: ../src/guestfs-actions.pod:2830
9293 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9294 " const char *root);\n"
9299 #: ../src/guestfs-actions.pod:2837 ../fish/guestfish-actions.pod:1953
9301 "This returns the Windows systemroot of the inspected guest. The systemroot "
9302 "is a directory path such as C</WINDOWS>."
9306 #: ../src/guestfs-actions.pod:2840 ../fish/guestfish-actions.pod:1956
9308 "This call assumes that the guest is Windows and that the systemroot could be "
9309 "determined by inspection. If this is not the case then an error is returned."
9313 #: ../src/guestfs-actions.pod:2849
9314 msgid "(Added in 1.5.25)"
9318 #: ../src/guestfs-actions.pod:2851
9319 msgid "guestfs_inspect_list_applications"
9323 #: ../src/guestfs-actions.pod:2853
9326 " struct guestfs_application_list *\n"
9327 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9328 " const char *root);\n"
9333 #: ../src/guestfs-actions.pod:2860 ../fish/guestfish-actions.pod:1969
9334 msgid "Return the list of applications installed in the operating system."
9338 #: ../src/guestfs-actions.pod:2862
9340 "I<Note:> This call works differently from other parts of the inspection "
9341 "API. You have to call C<guestfs_inspect_os>, then "
9342 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9343 "this. Listing applications is a significantly more difficult operation "
9344 "which requires access to the full filesystem. Also note that unlike the "
9345 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9346 "the libguestfs handle, this call actually reads parts of the mounted "
9347 "filesystems during the call."
9351 #: ../src/guestfs-actions.pod:2872 ../fish/guestfish-actions.pod:1981
9353 "This returns an empty list if the inspection code was not able to determine "
9354 "the list of applications."
9358 #: ../src/guestfs-actions.pod:2875 ../fish/guestfish-actions.pod:1984
9359 msgid "The application structure contains the following fields:"
9363 #: ../src/guestfs-actions.pod:2879 ../fish/guestfish-actions.pod:1988
9368 #: ../src/guestfs-actions.pod:2881 ../fish/guestfish-actions.pod:1990
9370 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9371 "guests, this is the package name."
9375 #: ../src/guestfs-actions.pod:2884 ../fish/guestfish-actions.pod:1993
9376 msgid "C<app_display_name>"
9380 #: ../src/guestfs-actions.pod:2886 ../fish/guestfish-actions.pod:1995
9382 "The display name of the application, sometimes localized to the install "
9383 "language of the guest operating system."
9387 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:1998
9389 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9390 "to display something can use C<app_name> instead."
9394 #: ../src/guestfs-actions.pod:2892 ../fish/guestfish-actions.pod:2001
9395 msgid "C<app_epoch>"
9399 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:2003
9401 "For package managers which use epochs, this contains the epoch of the "
9402 "package (an integer). If unavailable, this is returned as C<0>."
9406 #: ../src/guestfs-actions.pod:2897 ../fish/guestfish-actions.pod:2006
9407 msgid "C<app_version>"
9411 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:2008
9413 "The version string of the application or package. If unavailable this is "
9414 "returned as an empty string C<\"\">."
9418 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2011
9419 msgid "C<app_release>"
9423 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2013
9425 "The release string of the application or package, for package managers that "
9426 "use this. If unavailable this is returned as an empty string C<\"\">."
9430 #: ../src/guestfs-actions.pod:2908 ../fish/guestfish-actions.pod:2017
9431 msgid "C<app_install_path>"
9435 #: ../src/guestfs-actions.pod:2910 ../fish/guestfish-actions.pod:2019
9437 "The installation path of the application (on operating systems such as "
9438 "Windows which use installation paths). This path is in the format used by "
9439 "the guest operating system, it is not a libguestfs path."
9443 #: ../src/guestfs-actions.pod:2915 ../fish/guestfish-actions.pod:2024
9444 msgid "If unavailable this is returned as an empty string C<\"\">."
9448 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:2026
9449 msgid "C<app_trans_path>"
9453 #: ../src/guestfs-actions.pod:2919 ../fish/guestfish-actions.pod:2028
9455 "The install path translated into a libguestfs path. If unavailable this is "
9456 "returned as an empty string C<\"\">."
9460 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2031
9461 msgid "C<app_publisher>"
9465 #: ../src/guestfs-actions.pod:2924 ../fish/guestfish-actions.pod:2033
9467 "The name of the publisher of the application, for package managers that use "
9468 "this. If unavailable this is returned as an empty string C<\"\">."
9472 #: ../src/guestfs-actions.pod:2928 ../fish/guestfish-actions.pod:2037
9477 #: ../src/guestfs-actions.pod:2930 ../fish/guestfish-actions.pod:2039
9479 "The URL (eg. upstream URL) of the application. If unavailable this is "
9480 "returned as an empty string C<\"\">."
9484 #: ../src/guestfs-actions.pod:2933 ../fish/guestfish-actions.pod:2042
9485 msgid "C<app_source_package>"
9489 #: ../src/guestfs-actions.pod:2935 ../fish/guestfish-actions.pod:2044
9491 "For packaging systems which support this, the name of the source package. "
9492 "If unavailable this is returned as an empty string C<\"\">."
9496 #: ../src/guestfs-actions.pod:2938 ../fish/guestfish-actions.pod:2047
9497 msgid "C<app_summary>"
9501 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2049
9503 "A short (usually one line) description of the application or package. If "
9504 "unavailable this is returned as an empty string C<\"\">."
9508 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2052
9509 msgid "C<app_description>"
9513 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2054
9515 "A longer description of the application or package. If unavailable this is "
9516 "returned as an empty string C<\"\">."
9520 #: ../src/guestfs-actions.pod:2952
9522 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9523 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9528 #: ../src/guestfs-actions.pod:2956
9529 msgid "guestfs_inspect_os"
9533 #: ../src/guestfs-actions.pod:2958
9537 " guestfs_inspect_os (guestfs_h *g);\n"
9542 #: ../src/guestfs-actions.pod:2961 ../fish/guestfish-actions.pod:2065
9544 "This function uses other libguestfs functions and certain heuristics to "
9545 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9546 "for operating systems."
9550 #: ../src/guestfs-actions.pod:2965 ../fish/guestfish-actions.pod:2069
9551 msgid "The list returned is empty if no operating systems were found."
9555 #: ../src/guestfs-actions.pod:2967 ../fish/guestfish-actions.pod:2071
9557 "If one operating system was found, then this returns a list with a single "
9558 "element, which is the name of the root filesystem of this operating system. "
9559 "It is also possible for this function to return a list containing more than "
9560 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9561 "element being the root filesystem of one of the operating systems."
9565 #: ../src/guestfs-actions.pod:2974
9567 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9568 "functions in order to query further information about each operating system, "
9569 "such as the name and version."
9573 #: ../src/guestfs-actions.pod:2979
9575 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9576 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9577 "the contents. This should be called with no disks currently mounted. The "
9578 "function may also use Augeas, so any existing Augeas handle will be closed."
9582 #: ../src/guestfs-actions.pod:2985 ../fish/guestfish-actions.pod:2089
9584 "This function cannot decrypt encrypted disks. The caller must do that first "
9585 "(supplying the necessary keys) if the disk is encrypted."
9589 #: ../src/guestfs-actions.pod:2991 ../src/guestfs-actions.pod:3246
9590 #: ../src/guestfs-actions.pod:3308
9591 msgid "See also C<guestfs_list_filesystems>."
9595 #: ../src/guestfs-actions.pod:2999
9596 msgid "guestfs_is_blockdev"
9600 #: ../src/guestfs-actions.pod:3001
9604 " guestfs_is_blockdev (guestfs_h *g,\n"
9605 " const char *path);\n"
9610 #: ../src/guestfs-actions.pod:3005 ../fish/guestfish-actions.pod:2101
9612 "This returns C<true> if and only if there is a block device with the given "
9617 #: ../src/guestfs-actions.pod:3008 ../src/guestfs-actions.pod:3037
9618 #: ../src/guestfs-actions.pod:3067 ../src/guestfs-actions.pod:3082
9619 #: ../src/guestfs-actions.pod:3098 ../src/guestfs-actions.pod:3154
9620 #: ../src/guestfs-actions.pod:3169
9621 msgid "See also C<guestfs_stat>."
9625 #: ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3041
9626 #: ../src/guestfs-actions.pod:3086 ../src/guestfs-actions.pod:3158
9627 #: ../src/guestfs-actions.pod:3173
9628 msgid "(Added in 1.5.10)"
9632 #: ../src/guestfs-actions.pod:3014
9633 msgid "guestfs_is_busy"
9637 #: ../src/guestfs-actions.pod:3016
9641 " guestfs_is_busy (guestfs_h *g);\n"
9646 #: ../src/guestfs-actions.pod:3019 ../fish/guestfish-actions.pod:2110
9648 "This returns true iff this handle is busy processing a command (in the "
9653 #: ../src/guestfs-actions.pod:3028
9654 msgid "guestfs_is_chardev"
9658 #: ../src/guestfs-actions.pod:3030
9662 " guestfs_is_chardev (guestfs_h *g,\n"
9663 " const char *path);\n"
9668 #: ../src/guestfs-actions.pod:3034 ../fish/guestfish-actions.pod:2119
9670 "This returns C<true> if and only if there is a character device with the "
9671 "given C<path> name."
9675 #: ../src/guestfs-actions.pod:3043
9676 msgid "guestfs_is_config"
9680 #: ../src/guestfs-actions.pod:3045
9684 " guestfs_is_config (guestfs_h *g);\n"
9689 #: ../src/guestfs-actions.pod:3048 ../fish/guestfish-actions.pod:2128
9691 "This returns true iff this handle is being configured (in the C<CONFIG> "
9696 #: ../src/guestfs-actions.pod:3057
9697 msgid "guestfs_is_dir"
9701 #: ../src/guestfs-actions.pod:3059
9705 " guestfs_is_dir (guestfs_h *g,\n"
9706 " const char *path);\n"
9711 #: ../src/guestfs-actions.pod:3063 ../fish/guestfish-actions.pod:2137
9713 "This returns C<true> if and only if there is a directory with the given "
9714 "C<path> name. Note that it returns false for other objects like files."
9718 #: ../src/guestfs-actions.pod:3073
9719 msgid "guestfs_is_fifo"
9723 #: ../src/guestfs-actions.pod:3075
9727 " guestfs_is_fifo (guestfs_h *g,\n"
9728 " const char *path);\n"
9733 #: ../src/guestfs-actions.pod:3079 ../fish/guestfish-actions.pod:2147
9735 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9736 "given C<path> name."
9740 #: ../src/guestfs-actions.pod:3088
9741 msgid "guestfs_is_file"
9745 #: ../src/guestfs-actions.pod:3090
9749 " guestfs_is_file (guestfs_h *g,\n"
9750 " const char *path);\n"
9755 #: ../src/guestfs-actions.pod:3094 ../fish/guestfish-actions.pod:2156
9757 "This returns C<true> if and only if there is a regular file with the given "
9758 "C<path> name. Note that it returns false for other objects like directories."
9762 #: ../src/guestfs-actions.pod:3104
9763 msgid "guestfs_is_launching"
9767 #: ../src/guestfs-actions.pod:3106
9771 " guestfs_is_launching (guestfs_h *g);\n"
9776 #: ../src/guestfs-actions.pod:3109 ../fish/guestfish-actions.pod:2166
9778 "This returns true iff this handle is launching the subprocess (in the "
9779 "C<LAUNCHING> state)."
9783 #: ../src/guestfs-actions.pod:3118
9784 msgid "guestfs_is_lv"
9788 #: ../src/guestfs-actions.pod:3120
9792 " guestfs_is_lv (guestfs_h *g,\n"
9793 " const char *device);\n"
9798 #: ../src/guestfs-actions.pod:3124 ../fish/guestfish-actions.pod:2175
9800 "This command tests whether C<device> is a logical volume, and returns true "
9801 "iff this is the case."
9805 #: ../src/guestfs-actions.pod:3131
9806 msgid "guestfs_is_ready"
9810 #: ../src/guestfs-actions.pod:3133
9814 " guestfs_is_ready (guestfs_h *g);\n"
9819 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2182
9821 "This returns true iff this handle is ready to accept commands (in the "
9826 #: ../src/guestfs-actions.pod:3145
9827 msgid "guestfs_is_socket"
9831 #: ../src/guestfs-actions.pod:3147
9835 " guestfs_is_socket (guestfs_h *g,\n"
9836 " const char *path);\n"
9841 #: ../src/guestfs-actions.pod:3151 ../fish/guestfish-actions.pod:2191
9843 "This returns C<true> if and only if there is a Unix domain socket with the "
9844 "given C<path> name."
9848 #: ../src/guestfs-actions.pod:3160
9849 msgid "guestfs_is_symlink"
9853 #: ../src/guestfs-actions.pod:3162
9857 " guestfs_is_symlink (guestfs_h *g,\n"
9858 " const char *path);\n"
9863 #: ../src/guestfs-actions.pod:3166 ../fish/guestfish-actions.pod:2200
9865 "This returns C<true> if and only if there is a symbolic link with the given "
9870 #: ../src/guestfs-actions.pod:3175
9871 msgid "guestfs_kill_subprocess"
9875 #: ../src/guestfs-actions.pod:3177
9879 " guestfs_kill_subprocess (guestfs_h *g);\n"
9884 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2209
9885 msgid "This kills the qemu subprocess. You should never need to call this."
9889 #: ../src/guestfs-actions.pod:3186
9890 msgid "guestfs_launch"
9894 #: ../src/guestfs-actions.pod:3188
9898 " guestfs_launch (guestfs_h *g);\n"
9903 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2217
9905 "Internally libguestfs is implemented by running a virtual machine using "
9910 #: ../src/guestfs-actions.pod:3194 ../fish/guestfish-actions.pod:2220
9912 "You should call this after configuring the handle (eg. adding drives) but "
9913 "before performing any actions."
9917 #: ../src/guestfs-actions.pod:3201
9918 msgid "guestfs_lchown"
9922 #: ../src/guestfs-actions.pod:3203
9926 " guestfs_lchown (guestfs_h *g,\n"
9929 " const char *path);\n"
9934 #: ../src/guestfs-actions.pod:3209
9936 "Change the file owner to C<owner> and group to C<group>. This is like "
9937 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9938 "changed, not the target."
9942 #: ../src/guestfs-actions.pod:3221
9943 msgid "guestfs_lgetxattrs"
9947 #: ../src/guestfs-actions.pod:3223
9950 " struct guestfs_xattr_list *\n"
9951 " guestfs_lgetxattrs (guestfs_h *g,\n"
9952 " const char *path);\n"
9957 #: ../src/guestfs-actions.pod:3227
9959 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9960 "then it returns the extended attributes of the link itself."
9964 #: ../src/guestfs-actions.pod:3237
9965 msgid "guestfs_list_devices"
9969 #: ../src/guestfs-actions.pod:3239
9973 " guestfs_list_devices (guestfs_h *g);\n"
9978 #: ../src/guestfs-actions.pod:3242 ../fish/guestfish-actions.pod:2247
9979 msgid "List all the block devices."
9983 #: ../src/guestfs-actions.pod:3244 ../fish/guestfish-actions.pod:2249
9984 msgid "The full block device names are returned, eg. C</dev/sda>."
9988 #: ../src/guestfs-actions.pod:3254
9989 msgid "guestfs_list_filesystems"
9993 #: ../src/guestfs-actions.pod:3256
9997 " guestfs_list_filesystems (guestfs_h *g);\n"
10002 #: ../src/guestfs-actions.pod:3259 ../fish/guestfish-actions.pod:2257
10004 "This inspection command looks for filesystems on partitions, block devices "
10005 "and logical volumes, returning a list of devices containing filesystems and "
10010 #: ../src/guestfs-actions.pod:3263 ../fish/guestfish-actions.pod:2261
10012 "The return value is a hash, where the keys are the devices containing "
10013 "filesystems, and the values are the filesystem types. For example:"
10017 #: ../src/guestfs-actions.pod:3267 ../fish/guestfish-actions.pod:2265
10020 " \"/dev/sda1\" => \"ntfs\"\n"
10021 " \"/dev/sda2\" => \"ext2\"\n"
10022 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10023 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10028 #: ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:2270
10030 "The value can have the special value \"unknown\", meaning the content of the "
10031 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10035 #: ../src/guestfs-actions.pod:3276
10037 "This command runs other libguestfs commands, which might include "
10038 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10039 "soon after launch and only when nothing is mounted."
10043 #: ../src/guestfs-actions.pod:3280
10045 "Not all of the filesystems returned will be mountable. In particular, swap "
10046 "partitions are returned in the list. Also this command does not check that "
10047 "each filesystem found is valid and mountable, and some filesystems might be "
10048 "mountable but require special options. Filesystems may not all belong to a "
10049 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10053 #: ../src/guestfs-actions.pod:3294 ../src/guestfs-actions.pod:4817
10054 msgid "(Added in 1.5.15)"
10058 #: ../src/guestfs-actions.pod:3296
10059 msgid "guestfs_list_partitions"
10063 #: ../src/guestfs-actions.pod:3298
10067 " guestfs_list_partitions (guestfs_h *g);\n"
10072 #: ../src/guestfs-actions.pod:3301 ../fish/guestfish-actions.pod:2290
10073 msgid "List all the partitions detected on all block devices."
10077 #: ../src/guestfs-actions.pod:3303 ../fish/guestfish-actions.pod:2292
10078 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10082 #: ../src/guestfs-actions.pod:3305
10084 "This does not return logical volumes. For that you will need to call "
10089 #: ../src/guestfs-actions.pod:3316
10094 #: ../src/guestfs-actions.pod:3318
10098 " guestfs_ll (guestfs_h *g,\n"
10099 " const char *directory);\n"
10104 #: ../src/guestfs-actions.pod:3322 ../fish/guestfish-actions.pod:2303
10106 "List the files in C<directory> (relative to the root directory, there is no "
10107 "cwd) in the format of 'ls -la'."
10111 #: ../src/guestfs-actions.pod:3325 ../fish/guestfish-actions.pod:2306
10113 "This command is mostly useful for interactive sessions. It is I<not> "
10114 "intended that you try to parse the output string."
10118 #: ../src/guestfs-actions.pod:3333
10123 #: ../src/guestfs-actions.pod:3335
10127 " guestfs_ln (guestfs_h *g,\n"
10128 " const char *target,\n"
10129 " const char *linkname);\n"
10134 #: ../src/guestfs-actions.pod:3340 ../fish/guestfish-actions.pod:2313
10135 msgid "This command creates a hard link using the C<ln> command."
10139 #: ../src/guestfs-actions.pod:3346
10140 msgid "guestfs_ln_f"
10144 #: ../src/guestfs-actions.pod:3348
10148 " guestfs_ln_f (guestfs_h *g,\n"
10149 " const char *target,\n"
10150 " const char *linkname);\n"
10155 #: ../src/guestfs-actions.pod:3353 ../fish/guestfish-actions.pod:2319
10157 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10158 "option removes the link (C<linkname>) if it exists already."
10162 #: ../src/guestfs-actions.pod:3360
10163 msgid "guestfs_ln_s"
10167 #: ../src/guestfs-actions.pod:3362
10171 " guestfs_ln_s (guestfs_h *g,\n"
10172 " const char *target,\n"
10173 " const char *linkname);\n"
10178 #: ../src/guestfs-actions.pod:3367 ../fish/guestfish-actions.pod:2326
10179 msgid "This command creates a symbolic link using the C<ln -s> command."
10183 #: ../src/guestfs-actions.pod:3373
10184 msgid "guestfs_ln_sf"
10188 #: ../src/guestfs-actions.pod:3375
10192 " guestfs_ln_sf (guestfs_h *g,\n"
10193 " const char *target,\n"
10194 " const char *linkname);\n"
10199 #: ../src/guestfs-actions.pod:3380 ../fish/guestfish-actions.pod:2332
10201 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10202 "option removes the link (C<linkname>) if it exists already."
10206 #: ../src/guestfs-actions.pod:3387
10207 msgid "guestfs_lremovexattr"
10211 #: ../src/guestfs-actions.pod:3389
10215 " guestfs_lremovexattr (guestfs_h *g,\n"
10216 " const char *xattr,\n"
10217 " const char *path);\n"
10222 #: ../src/guestfs-actions.pod:3394
10224 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10225 "link, then it removes an extended attribute of the link itself."
10229 #: ../src/guestfs-actions.pod:3402
10234 #: ../src/guestfs-actions.pod:3404
10238 " guestfs_ls (guestfs_h *g,\n"
10239 " const char *directory);\n"
10244 #: ../src/guestfs-actions.pod:3408 ../fish/guestfish-actions.pod:2347
10246 "List the files in C<directory> (relative to the root directory, there is no "
10247 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10251 #: ../src/guestfs-actions.pod:3412
10253 "This command is mostly useful for interactive sessions. Programs should "
10254 "probably use C<guestfs_readdir> instead."
10258 #: ../src/guestfs-actions.pod:3421
10259 msgid "guestfs_lsetxattr"
10263 #: ../src/guestfs-actions.pod:3423
10267 " guestfs_lsetxattr (guestfs_h *g,\n"
10268 " const char *xattr,\n"
10269 " const char *val,\n"
10271 " const char *path);\n"
10276 #: ../src/guestfs-actions.pod:3430
10278 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10279 "then it sets an extended attribute of the link itself."
10283 #: ../src/guestfs-actions.pod:3438
10284 msgid "guestfs_lstat"
10288 #: ../src/guestfs-actions.pod:3440
10291 " struct guestfs_stat *\n"
10292 " guestfs_lstat (guestfs_h *g,\n"
10293 " const char *path);\n"
10298 #: ../src/guestfs-actions.pod:3444 ../src/guestfs-actions.pod:5871
10299 #: ../fish/guestfish-actions.pod:2366 ../fish/guestfish-actions.pod:3948
10300 msgid "Returns file information for the given C<path>."
10304 #: ../src/guestfs-actions.pod:3446
10306 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10307 "link, then the link is stat-ed, not the file it refers to."
10311 #: ../src/guestfs-actions.pod:3450 ../fish/guestfish-actions.pod:2372
10312 msgid "This is the same as the C<lstat(2)> system call."
10316 #: ../src/guestfs-actions.pod:3452 ../src/guestfs-actions.pod:5875
10318 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10319 "error. I<The caller must call C<guestfs_free_stat> after use>."
10323 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:5879
10324 #: ../src/guestfs-actions.pod:5897 ../src/guestfs-actions.pod:6278
10325 msgid "(Added in 0.9.2)"
10329 #: ../src/guestfs-actions.pod:3458
10330 msgid "guestfs_lstatlist"
10334 #: ../src/guestfs-actions.pod:3460
10337 " struct guestfs_stat_list *\n"
10338 " guestfs_lstatlist (guestfs_h *g,\n"
10339 " const char *path,\n"
10340 " char *const *names);\n"
10345 #: ../src/guestfs-actions.pod:3465
10347 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10348 "files, where all files are in the directory C<path>. C<names> is the list "
10349 "of files from this directory."
10353 #: ../src/guestfs-actions.pod:3469 ../fish/guestfish-actions.pod:2382
10355 "On return you get a list of stat structs, with a one-to-one correspondence "
10356 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10357 "then the C<ino> field of that structure is set to C<-1>."
10361 #: ../src/guestfs-actions.pod:3474
10363 "This call is intended for programs that want to efficiently list a directory "
10364 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10365 "for a similarly efficient call for getting extended attributes. Very long "
10366 "directory listings might cause the protocol message size to be exceeded, "
10367 "causing this call to fail. The caller must split up such requests into "
10368 "smaller groups of names."
10372 #: ../src/guestfs-actions.pod:3482
10374 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10375 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10379 #: ../src/guestfs-actions.pod:3488
10380 msgid "guestfs_luks_add_key"
10384 #: ../src/guestfs-actions.pod:3490
10388 " guestfs_luks_add_key (guestfs_h *g,\n"
10389 " const char *device,\n"
10390 " const char *key,\n"
10391 " const char *newkey,\n"
10397 #: ../src/guestfs-actions.pod:3497 ../fish/guestfish-actions.pod:2399
10399 "This command adds a new key on LUKS device C<device>. C<key> is any "
10400 "existing key, and is used to access the device. C<newkey> is the new key to "
10401 "add. C<keyslot> is the key slot that will be replaced."
10405 #: ../src/guestfs-actions.pod:3502
10407 "Note that if C<keyslot> already contains a key, then this command will "
10408 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10412 #: ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3548
10413 #: ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:3591
10414 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3642
10416 "This function takes a key or passphrase parameter which could contain "
10417 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10422 #: ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:3552
10423 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3595
10424 msgid "(Added in 1.5.2)"
10428 #: ../src/guestfs-actions.pod:3514
10429 msgid "guestfs_luks_close"
10433 #: ../src/guestfs-actions.pod:3516
10437 " guestfs_luks_close (guestfs_h *g,\n"
10438 " const char *device);\n"
10443 #: ../src/guestfs-actions.pod:3520
10445 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10446 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10447 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10448 "underlying block device."
10452 #: ../src/guestfs-actions.pod:3528 ../src/guestfs-actions.pod:3627
10453 #: ../src/guestfs-actions.pod:3646 ../src/guestfs-actions.pod:3696
10454 #: ../src/guestfs-actions.pod:3744
10455 msgid "(Added in 1.5.1)"
10459 #: ../src/guestfs-actions.pod:3530
10460 msgid "guestfs_luks_format"
10464 #: ../src/guestfs-actions.pod:3532
10468 " guestfs_luks_format (guestfs_h *g,\n"
10469 " const char *device,\n"
10470 " const char *key,\n"
10476 #: ../src/guestfs-actions.pod:3538 ../fish/guestfish-actions.pod:2425
10478 "This command erases existing data on C<device> and formats the device as a "
10479 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10480 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10484 #: ../src/guestfs-actions.pod:3545 ../src/guestfs-actions.pod:3568
10485 #: ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:4568
10486 #: ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5706
10487 #: ../src/guestfs-actions.pod:5729 ../src/guestfs-actions.pod:5755
10488 #: ../src/guestfs-actions.pod:6905 ../fish/guestfish-actions.pod:2433
10489 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2530
10490 #: ../fish/guestfish-actions.pod:3060 ../fish/guestfish-actions.pod:3567
10491 #: ../fish/guestfish-actions.pod:3847 ../fish/guestfish-actions.pod:3863
10492 #: ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:4593
10494 "B<This command is dangerous. Without careful use you can easily destroy all "
10499 #: ../src/guestfs-actions.pod:3554
10500 msgid "guestfs_luks_format_cipher"
10504 #: ../src/guestfs-actions.pod:3556
10508 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10509 " const char *device,\n"
10510 " const char *key,\n"
10512 " const char *cipher);\n"
10517 #: ../src/guestfs-actions.pod:3563
10519 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10520 "set the C<cipher> used."
10524 #: ../src/guestfs-actions.pod:3577
10525 msgid "guestfs_luks_kill_slot"
10529 #: ../src/guestfs-actions.pod:3579
10533 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10534 " const char *device,\n"
10535 " const char *key,\n"
10541 #: ../src/guestfs-actions.pod:3585 ../fish/guestfish-actions.pod:2453
10543 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10544 "device C<device>. C<key> must be one of the I<other> keys."
10548 #: ../src/guestfs-actions.pod:3597
10549 msgid "guestfs_luks_open"
10553 #: ../src/guestfs-actions.pod:3599
10557 " guestfs_luks_open (guestfs_h *g,\n"
10558 " const char *device,\n"
10559 " const char *key,\n"
10560 " const char *mapname);\n"
10565 #: ../src/guestfs-actions.pod:3605 ../fish/guestfish-actions.pod:2464
10567 "This command opens a block device which has been encrypted according to the "
10568 "Linux Unified Key Setup (LUKS) standard."
10572 #: ../src/guestfs-actions.pod:3608 ../fish/guestfish-actions.pod:2467
10573 msgid "C<device> is the encrypted block device or partition."
10577 #: ../src/guestfs-actions.pod:3610 ../fish/guestfish-actions.pod:2469
10579 "The caller must supply one of the keys associated with the LUKS block "
10580 "device, in the C<key> parameter."
10584 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2472
10586 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10587 "writes to this block device are decrypted from and encrypted to the "
10588 "underlying C<device> respectively."
10592 #: ../src/guestfs-actions.pod:3617
10594 "If this block device contains LVM volume groups, then calling "
10595 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10600 #: ../src/guestfs-actions.pod:3629
10601 msgid "guestfs_luks_open_ro"
10605 #: ../src/guestfs-actions.pod:3631
10609 " guestfs_luks_open_ro (guestfs_h *g,\n"
10610 " const char *device,\n"
10611 " const char *key,\n"
10612 " const char *mapname);\n"
10617 #: ../src/guestfs-actions.pod:3637
10619 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10624 #: ../src/guestfs-actions.pod:3648
10625 msgid "guestfs_lvcreate"
10629 #: ../src/guestfs-actions.pod:3650
10633 " guestfs_lvcreate (guestfs_h *g,\n"
10634 " const char *logvol,\n"
10635 " const char *volgroup,\n"
10641 #: ../src/guestfs-actions.pod:3656 ../fish/guestfish-actions.pod:2497
10643 "This creates an LVM logical volume called C<logvol> on the volume group "
10644 "C<volgroup>, with C<size> megabytes."
10648 #: ../src/guestfs-actions.pod:3663
10649 msgid "guestfs_lvm_canonical_lv_name"
10653 #: ../src/guestfs-actions.pod:3665
10657 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10658 " const char *lvname);\n"
10663 #: ../src/guestfs-actions.pod:3669 ../fish/guestfish-actions.pod:2504
10665 "This converts alternative naming schemes for LVs that you might find to the "
10666 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10671 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2508
10673 "This command returns an error if the C<lvname> parameter does not refer to a "
10678 #: ../src/guestfs-actions.pod:3676
10679 msgid "See also C<guestfs_is_lv>."
10683 #: ../src/guestfs-actions.pod:3681
10684 msgid "(Added in 1.5.24)"
10688 #: ../src/guestfs-actions.pod:3683
10689 msgid "guestfs_lvm_clear_filter"
10693 #: ../src/guestfs-actions.pod:3685
10697 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10702 #: ../src/guestfs-actions.pod:3688
10704 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10705 "see every block device."
10709 #: ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3733
10710 #: ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2551
10712 "This command also clears the LVM cache and performs a volume group scan."
10716 #: ../src/guestfs-actions.pod:3698
10717 msgid "guestfs_lvm_remove_all"
10721 #: ../src/guestfs-actions.pod:3700
10725 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10730 #: ../src/guestfs-actions.pod:3703 ../fish/guestfish-actions.pod:2527
10732 "This command removes all LVM logical volumes, volume groups and physical "
10737 #: ../src/guestfs-actions.pod:3713
10738 msgid "guestfs_lvm_set_filter"
10742 #: ../src/guestfs-actions.pod:3715
10746 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10747 " char *const *devices);\n"
10752 #: ../src/guestfs-actions.pod:3719 ../fish/guestfish-actions.pod:2537
10754 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10755 "block devices in the list C<devices>, and will ignore all other attached "
10760 #: ../src/guestfs-actions.pod:3723 ../fish/guestfish-actions.pod:2541
10762 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10763 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10764 "there are two types of duplication possible: either cloned PVs/VGs which "
10765 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10766 "same name. In normal operation you cannot create this situation, but you "
10767 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10768 "inside the LVM metadata."
10772 #: ../src/guestfs-actions.pod:3736 ../fish/guestfish-actions.pod:2554
10773 msgid "You can filter whole block devices or individual partitions."
10777 #: ../src/guestfs-actions.pod:3738 ../fish/guestfish-actions.pod:2556
10779 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10780 "filesystem), even if you are not filtering out that VG."
10784 #: ../src/guestfs-actions.pod:3746
10785 msgid "guestfs_lvremove"
10789 #: ../src/guestfs-actions.pod:3748
10793 " guestfs_lvremove (guestfs_h *g,\n"
10794 " const char *device);\n"
10799 #: ../src/guestfs-actions.pod:3752 ../fish/guestfish-actions.pod:2564
10801 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10802 "LV, such as C</dev/VG/LV>."
10806 #: ../src/guestfs-actions.pod:3755 ../fish/guestfish-actions.pod:2567
10808 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10813 #: ../src/guestfs-actions.pod:3760 ../src/guestfs-actions.pod:4914
10814 #: ../src/guestfs-actions.pod:6644
10815 msgid "(Added in 1.0.13)"
10819 #: ../src/guestfs-actions.pod:3762
10820 msgid "guestfs_lvrename"
10824 #: ../src/guestfs-actions.pod:3764
10828 " guestfs_lvrename (guestfs_h *g,\n"
10829 " const char *logvol,\n"
10830 " const char *newlogvol);\n"
10835 #: ../src/guestfs-actions.pod:3769 ../fish/guestfish-actions.pod:2574
10836 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10840 #: ../src/guestfs-actions.pod:3773 ../src/guestfs-actions.pod:6657
10841 msgid "(Added in 1.0.83)"
10845 #: ../src/guestfs-actions.pod:3775
10846 msgid "guestfs_lvresize"
10850 #: ../src/guestfs-actions.pod:3777
10854 " guestfs_lvresize (guestfs_h *g,\n"
10855 " const char *device,\n"
10861 #: ../src/guestfs-actions.pod:3782 ../fish/guestfish-actions.pod:2580
10863 "This resizes (expands or shrinks) an existing LVM logical volume to "
10864 "C<mbytes>. When reducing, data in the reduced part is lost."
10868 #: ../src/guestfs-actions.pod:3790
10869 msgid "guestfs_lvresize_free"
10873 #: ../src/guestfs-actions.pod:3792
10877 " guestfs_lvresize_free (guestfs_h *g,\n"
10878 " const char *lv,\n"
10884 #: ../src/guestfs-actions.pod:3797 ../fish/guestfish-actions.pod:2588
10886 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10887 "remaining free space in the volume group. Commonly you would call this with "
10888 "pc = 100 which expands the logical volume as much as possible, using all "
10889 "remaining free space in the volume group."
10893 #: ../src/guestfs-actions.pod:3805
10894 msgid "(Added in 1.3.3)"
10898 #: ../src/guestfs-actions.pod:3807
10899 msgid "guestfs_lvs"
10903 #: ../src/guestfs-actions.pod:3809
10907 " guestfs_lvs (guestfs_h *g);\n"
10912 #: ../src/guestfs-actions.pod:3812 ../fish/guestfish-actions.pod:2598
10914 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10919 #: ../src/guestfs-actions.pod:3815 ../fish/guestfish-actions.pod:2601
10921 "This returns a list of the logical volume device names (eg. C</dev/"
10922 "VolGroup00/LogVol00>)."
10926 #: ../src/guestfs-actions.pod:3818
10927 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10931 #: ../src/guestfs-actions.pod:3826
10932 msgid "guestfs_lvs_full"
10936 #: ../src/guestfs-actions.pod:3828
10939 " struct guestfs_lvm_lv_list *\n"
10940 " guestfs_lvs_full (guestfs_h *g);\n"
10945 #: ../src/guestfs-actions.pod:3831 ../fish/guestfish-actions.pod:2610
10947 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10948 "(8)> command. The \"full\" version includes all fields."
10952 #: ../src/guestfs-actions.pod:3834
10954 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10955 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
10959 #: ../src/guestfs-actions.pod:3840
10960 msgid "guestfs_lvuuid"
10964 #: ../src/guestfs-actions.pod:3842
10968 " guestfs_lvuuid (guestfs_h *g,\n"
10969 " const char *device);\n"
10974 #: ../src/guestfs-actions.pod:3846 ../fish/guestfish-actions.pod:2617
10975 msgid "This command returns the UUID of the LVM LV C<device>."
10979 #: ../src/guestfs-actions.pod:3853
10980 msgid "guestfs_lxattrlist"
10984 #: ../src/guestfs-actions.pod:3855
10987 " struct guestfs_xattr_list *\n"
10988 " guestfs_lxattrlist (guestfs_h *g,\n"
10989 " const char *path,\n"
10990 " char *const *names);\n"
10995 #: ../src/guestfs-actions.pod:3860 ../fish/guestfish-actions.pod:2623
10997 "This call allows you to get the extended attributes of multiple files, where "
10998 "all files are in the directory C<path>. C<names> is the list of files from "
11003 #: ../src/guestfs-actions.pod:3864 ../fish/guestfish-actions.pod:2627
11005 "On return you get a flat list of xattr structs which must be interpreted "
11006 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11007 "C<attrval> in this struct is zero-length to indicate there was an error "
11008 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11009 "number (the number of following attributes for this file, which could be C<"
11010 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11011 "for the first named file. This repeats for the second and subsequent files."
11015 #: ../src/guestfs-actions.pod:3874
11017 "This call is intended for programs that want to efficiently list a directory "
11018 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11019 "a similarly efficient call for getting standard stats. Very long directory "
11020 "listings might cause the protocol message size to be exceeded, causing this "
11021 "call to fail. The caller must split up such requests into smaller groups of "
11026 #: ../src/guestfs-actions.pod:3888
11027 msgid "guestfs_mkdir"
11031 #: ../src/guestfs-actions.pod:3890
11035 " guestfs_mkdir (guestfs_h *g,\n"
11036 " const char *path);\n"
11041 #: ../src/guestfs-actions.pod:3894 ../fish/guestfish-actions.pod:2649
11042 msgid "Create a directory named C<path>."
11046 #: ../src/guestfs-actions.pod:3900
11047 msgid "guestfs_mkdir_mode"
11051 #: ../src/guestfs-actions.pod:3902
11055 " guestfs_mkdir_mode (guestfs_h *g,\n"
11056 " const char *path,\n"
11062 #: ../src/guestfs-actions.pod:3907 ../fish/guestfish-actions.pod:2655
11064 "This command creates a directory, setting the initial permissions of the "
11065 "directory to C<mode>."
11069 #: ../src/guestfs-actions.pod:3910 ../fish/guestfish-actions.pod:2658
11071 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11072 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11077 #: ../src/guestfs-actions.pod:3914
11078 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11082 #: ../src/guestfs-actions.pod:3920
11083 msgid "guestfs_mkdir_p"
11087 #: ../src/guestfs-actions.pod:3922
11091 " guestfs_mkdir_p (guestfs_h *g,\n"
11092 " const char *path);\n"
11097 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:2668
11099 "Create a directory named C<path>, creating any parent directories as "
11100 "necessary. This is like the C<mkdir -p> shell command."
11104 #: ../src/guestfs-actions.pod:3933
11105 msgid "guestfs_mkdtemp"
11109 #: ../src/guestfs-actions.pod:3935
11113 " guestfs_mkdtemp (guestfs_h *g,\n"
11114 " const char *template);\n"
11119 #: ../src/guestfs-actions.pod:3939 ../fish/guestfish-actions.pod:2675
11121 "This command creates a temporary directory. The C<template> parameter "
11122 "should be a full pathname for the temporary directory name with the final "
11123 "six characters being \"XXXXXX\"."
11127 #: ../src/guestfs-actions.pod:3944 ../fish/guestfish-actions.pod:2680
11129 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11130 "being suitable for Windows filesystems."
11134 #: ../src/guestfs-actions.pod:3947 ../fish/guestfish-actions.pod:2683
11135 msgid "The name of the temporary directory that was created is returned."
11139 #: ../src/guestfs-actions.pod:3950 ../fish/guestfish-actions.pod:2686
11140 msgid "The temporary directory is created with mode 0700 and is owned by root."
11144 #: ../src/guestfs-actions.pod:3953 ../fish/guestfish-actions.pod:2689
11146 "The caller is responsible for deleting the temporary directory and its "
11147 "contents after use."
11151 #: ../src/guestfs-actions.pod:3956 ../fish/guestfish-actions.pod:2692
11152 msgid "See also: L<mkdtemp(3)>"
11156 #: ../src/guestfs-actions.pod:3963
11157 msgid "guestfs_mke2fs_J"
11161 #: ../src/guestfs-actions.pod:3965
11165 " guestfs_mke2fs_J (guestfs_h *g,\n"
11166 " const char *fstype,\n"
11167 " int blocksize,\n"
11168 " const char *device,\n"
11169 " const char *journal);\n"
11174 #: ../src/guestfs-actions.pod:3972 ../fish/guestfish-actions.pod:2698
11176 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11177 "C<journal>. It is equivalent to the command:"
11181 #: ../src/guestfs-actions.pod:3976 ../fish/guestfish-actions.pod:2702
11184 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11189 #: ../src/guestfs-actions.pod:3978
11190 msgid "See also C<guestfs_mke2journal>."
11194 #: ../src/guestfs-actions.pod:3982 ../src/guestfs-actions.pod:4000
11195 #: ../src/guestfs-actions.pod:4018 ../src/guestfs-actions.pod:4034
11196 #: ../src/guestfs-actions.pod:4048 ../src/guestfs-actions.pod:4062
11197 #: ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4304
11198 msgid "(Added in 1.0.68)"
11202 #: ../src/guestfs-actions.pod:3984
11203 msgid "guestfs_mke2fs_JL"
11207 #: ../src/guestfs-actions.pod:3986
11211 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11212 " const char *fstype,\n"
11213 " int blocksize,\n"
11214 " const char *device,\n"
11215 " const char *label);\n"
11220 #: ../src/guestfs-actions.pod:3993 ../fish/guestfish-actions.pod:2710
11222 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11223 "the journal labeled C<label>."
11227 #: ../src/guestfs-actions.pod:3996
11228 msgid "See also C<guestfs_mke2journal_L>."
11232 #: ../src/guestfs-actions.pod:4002
11233 msgid "guestfs_mke2fs_JU"
11237 #: ../src/guestfs-actions.pod:4004
11241 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11242 " const char *fstype,\n"
11243 " int blocksize,\n"
11244 " const char *device,\n"
11245 " const char *uuid);\n"
11250 #: ../src/guestfs-actions.pod:4011 ../fish/guestfish-actions.pod:2719
11252 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11253 "the journal with UUID C<uuid>."
11257 #: ../src/guestfs-actions.pod:4014
11258 msgid "See also C<guestfs_mke2journal_U>."
11262 #: ../src/guestfs-actions.pod:4020
11263 msgid "guestfs_mke2journal"
11267 #: ../src/guestfs-actions.pod:4022
11271 " guestfs_mke2journal (guestfs_h *g,\n"
11272 " int blocksize,\n"
11273 " const char *device);\n"
11278 #: ../src/guestfs-actions.pod:4027 ../fish/guestfish-actions.pod:2728
11280 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11285 #: ../src/guestfs-actions.pod:4030 ../fish/guestfish-actions.pod:2731
11288 " mke2fs -O journal_dev -b blocksize device\n"
11293 #: ../src/guestfs-actions.pod:4036
11294 msgid "guestfs_mke2journal_L"
11298 #: ../src/guestfs-actions.pod:4038
11302 " guestfs_mke2journal_L (guestfs_h *g,\n"
11303 " int blocksize,\n"
11304 " const char *label,\n"
11305 " const char *device);\n"
11310 #: ../src/guestfs-actions.pod:4044 ../fish/guestfish-actions.pod:2737
11311 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11315 #: ../src/guestfs-actions.pod:4050
11316 msgid "guestfs_mke2journal_U"
11320 #: ../src/guestfs-actions.pod:4052
11324 " guestfs_mke2journal_U (guestfs_h *g,\n"
11325 " int blocksize,\n"
11326 " const char *uuid,\n"
11327 " const char *device);\n"
11332 #: ../src/guestfs-actions.pod:4058 ../fish/guestfish-actions.pod:2743
11333 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11337 #: ../src/guestfs-actions.pod:4064
11338 msgid "guestfs_mkfifo"
11342 #: ../src/guestfs-actions.pod:4066
11346 " guestfs_mkfifo (guestfs_h *g,\n"
11348 " const char *path);\n"
11353 #: ../src/guestfs-actions.pod:4071
11355 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11356 "is just a convenient wrapper around C<guestfs_mknod>."
11360 #: ../src/guestfs-actions.pod:4081
11361 msgid "guestfs_mkfs"
11365 #: ../src/guestfs-actions.pod:4083
11369 " guestfs_mkfs (guestfs_h *g,\n"
11370 " const char *fstype,\n"
11371 " const char *device);\n"
11376 #: ../src/guestfs-actions.pod:4088 ../fish/guestfish-actions.pod:2759
11378 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11379 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11383 #: ../src/guestfs-actions.pod:4096
11384 msgid "guestfs_mkfs_b"
11388 #: ../src/guestfs-actions.pod:4098
11392 " guestfs_mkfs_b (guestfs_h *g,\n"
11393 " const char *fstype,\n"
11394 " int blocksize,\n"
11395 " const char *device);\n"
11400 #: ../src/guestfs-actions.pod:4104
11402 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11403 "block size of the resulting filesystem. Supported block sizes depend on the "
11404 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11408 #: ../src/guestfs-actions.pod:4109 ../fish/guestfish-actions.pod:2772
11410 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11415 #: ../src/guestfs-actions.pod:4116
11416 msgid "guestfs_mkmountpoint"
11420 #: ../src/guestfs-actions.pod:4118
11424 " guestfs_mkmountpoint (guestfs_h *g,\n"
11425 " const char *exemptpath);\n"
11430 #: ../src/guestfs-actions.pod:4122
11432 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11433 "that can be used to create extra mountpoints before mounting the first "
11438 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2783
11440 "These calls are I<only> necessary in some very limited circumstances, mainly "
11441 "the case where you want to mount a mix of unrelated and/or read-only "
11442 "filesystems together."
11446 #: ../src/guestfs-actions.pod:4130 ../fish/guestfish-actions.pod:2787
11448 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11449 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11450 "inside that. You can unpack this as follows in guestfish:"
11454 #: ../src/guestfs-actions.pod:4135 ../fish/guestfish-actions.pod:2792
11457 " add-ro Fedora-11-i686-Live.iso\n"
11459 " mkmountpoint /cd\n"
11460 " mkmountpoint /sqsh\n"
11461 " mkmountpoint /ext3fs\n"
11462 " mount /dev/sda /cd\n"
11463 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11464 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11469 #: ../src/guestfs-actions.pod:4144 ../fish/guestfish-actions.pod:2801
11470 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11474 #: ../src/guestfs-actions.pod:4146
11476 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11477 "may get unexpected errors if you try to mix these calls. It is safest to "
11478 "manually unmount filesystems and remove mountpoints after use."
11482 #: ../src/guestfs-actions.pod:4150
11484 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11485 "first, so for this to work for manual mountpoints, you must ensure that the "
11486 "innermost mountpoints have the longest pathnames, as in the example code "
11491 #: ../src/guestfs-actions.pod:4155 ../fish/guestfish-actions.pod:2812
11493 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11497 #: ../src/guestfs-actions.pod:4157
11499 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11500 "means that C<guestfs_umount_all> is called when the handle is closed which "
11501 "can also trigger these issues."
11505 #: ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:4422
11506 #: ../src/guestfs-actions.pod:5315
11507 msgid "(Added in 1.0.62)"
11511 #: ../src/guestfs-actions.pod:4165
11512 msgid "guestfs_mknod"
11516 #: ../src/guestfs-actions.pod:4167
11520 " guestfs_mknod (guestfs_h *g,\n"
11524 " const char *path);\n"
11529 #: ../src/guestfs-actions.pod:4174 ../fish/guestfish-actions.pod:2822
11531 "This call creates block or character special devices, or named pipes (FIFOs)."
11535 #: ../src/guestfs-actions.pod:4177 ../fish/guestfish-actions.pod:2825
11537 "The C<mode> parameter should be the mode, using the standard constants. "
11538 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11539 "used when creating block and character special devices."
11543 #: ../src/guestfs-actions.pod:4182
11545 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11546 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11547 "regular file). These constants are available in the standard Linux header "
11548 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11549 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11550 "the appropriate constant for you."
11554 #: ../src/guestfs-actions.pod:4196
11555 msgid "guestfs_mknod_b"
11559 #: ../src/guestfs-actions.pod:4198
11563 " guestfs_mknod_b (guestfs_h *g,\n"
11567 " const char *path);\n"
11572 #: ../src/guestfs-actions.pod:4205
11574 "This call creates a block device node called C<path> with mode C<mode> and "
11575 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11576 "wrapper around C<guestfs_mknod>."
11580 #: ../src/guestfs-actions.pod:4215
11581 msgid "guestfs_mknod_c"
11585 #: ../src/guestfs-actions.pod:4217
11589 " guestfs_mknod_c (guestfs_h *g,\n"
11593 " const char *path);\n"
11598 #: ../src/guestfs-actions.pod:4224
11600 "This call creates a char device node called C<path> with mode C<mode> and "
11601 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11602 "wrapper around C<guestfs_mknod>."
11606 #: ../src/guestfs-actions.pod:4234
11607 msgid "guestfs_mkswap"
11611 #: ../src/guestfs-actions.pod:4236
11615 " guestfs_mkswap (guestfs_h *g,\n"
11616 " const char *device);\n"
11621 #: ../src/guestfs-actions.pod:4240 ../fish/guestfish-actions.pod:2864
11622 msgid "Create a swap partition on C<device>."
11626 #: ../src/guestfs-actions.pod:4246
11627 msgid "guestfs_mkswap_L"
11631 #: ../src/guestfs-actions.pod:4248
11635 " guestfs_mkswap_L (guestfs_h *g,\n"
11636 " const char *label,\n"
11637 " const char *device);\n"
11642 #: ../src/guestfs-actions.pod:4253 ../fish/guestfish-actions.pod:2870
11643 msgid "Create a swap partition on C<device> with label C<label>."
11647 #: ../src/guestfs-actions.pod:4255 ../fish/guestfish-actions.pod:2872
11649 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11650 "sda>), just to a partition. This appears to be a limitation of the kernel "
11655 #: ../src/guestfs-actions.pod:4263
11656 msgid "guestfs_mkswap_U"
11660 #: ../src/guestfs-actions.pod:4265
11664 " guestfs_mkswap_U (guestfs_h *g,\n"
11665 " const char *uuid,\n"
11666 " const char *device);\n"
11671 #: ../src/guestfs-actions.pod:4270 ../fish/guestfish-actions.pod:2880
11672 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11676 #: ../src/guestfs-actions.pod:4276
11677 msgid "guestfs_mkswap_file"
11681 #: ../src/guestfs-actions.pod:4278
11685 " guestfs_mkswap_file (guestfs_h *g,\n"
11686 " const char *path);\n"
11691 #: ../src/guestfs-actions.pod:4282 ../fish/guestfish-actions.pod:2886
11692 msgid "Create a swap file."
11696 #: ../src/guestfs-actions.pod:4284
11698 "This command just writes a swap file signature to an existing file. To "
11699 "create the file itself, use something like C<guestfs_fallocate>."
11703 #: ../src/guestfs-actions.pod:4291
11704 msgid "guestfs_modprobe"
11708 #: ../src/guestfs-actions.pod:4293
11712 " guestfs_modprobe (guestfs_h *g,\n"
11713 " const char *modulename);\n"
11718 #: ../src/guestfs-actions.pod:4297 ../fish/guestfish-actions.pod:2895
11719 msgid "This loads a kernel module in the appliance."
11723 #: ../src/guestfs-actions.pod:4299 ../fish/guestfish-actions.pod:2897
11725 "The kernel module must have been whitelisted when libguestfs was built (see "
11726 "C<appliance/kmod.whitelist.in> in the source)."
11730 #: ../src/guestfs-actions.pod:4306
11731 msgid "guestfs_mount"
11735 #: ../src/guestfs-actions.pod:4308
11739 " guestfs_mount (guestfs_h *g,\n"
11740 " const char *device,\n"
11741 " const char *mountpoint);\n"
11746 #: ../src/guestfs-actions.pod:4313 ../fish/guestfish-actions.pod:2904
11748 "Mount a guest disk at a position in the filesystem. Block devices are named "
11749 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11750 "those block devices contain partitions, they will have the usual names (eg. "
11751 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11755 #: ../src/guestfs-actions.pod:4319 ../fish/guestfish-actions.pod:2910
11757 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11758 "mounted on C</> before others can be mounted. Other filesystems can only be "
11759 "mounted on directories which already exist."
11763 #: ../src/guestfs-actions.pod:4324 ../fish/guestfish-actions.pod:2915
11765 "The mounted filesystem is writable, if we have sufficient permissions on the "
11766 "underlying device."
11770 #: ../src/guestfs-actions.pod:4327
11772 "B<Important note:> When you use this call, the filesystem options C<sync> "
11773 "and C<noatime> are set implicitly. This was originally done because we "
11774 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11775 "very large negative performance impact and negligible effect on "
11776 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11777 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11778 "(use an empty string for the first parameter if you don't want any options)."
11782 #: ../src/guestfs-actions.pod:4341
11783 msgid "guestfs_mount_loop"
11787 #: ../src/guestfs-actions.pod:4343
11791 " guestfs_mount_loop (guestfs_h *g,\n"
11792 " const char *file,\n"
11793 " const char *mountpoint);\n"
11798 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2932
11800 "This command lets you mount C<file> (a filesystem image in a file) on a "
11801 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11806 #: ../src/guestfs-actions.pod:4356
11807 msgid "guestfs_mount_options"
11811 #: ../src/guestfs-actions.pod:4358
11815 " guestfs_mount_options (guestfs_h *g,\n"
11816 " const char *options,\n"
11817 " const char *device,\n"
11818 " const char *mountpoint);\n"
11823 #: ../src/guestfs-actions.pod:4364
11825 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11826 "the mount options as for the L<mount(8)> I<-o> flag."
11830 #: ../src/guestfs-actions.pod:4368 ../fish/guestfish-actions.pod:2944
11832 "If the C<options> parameter is an empty string, then no options are passed "
11833 "(all options default to whatever the filesystem uses)."
11837 #: ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4388
11838 #: ../src/guestfs-actions.pod:4405
11839 msgid "(Added in 1.0.10)"
11843 #: ../src/guestfs-actions.pod:4376
11844 msgid "guestfs_mount_ro"
11848 #: ../src/guestfs-actions.pod:4378
11852 " guestfs_mount_ro (guestfs_h *g,\n"
11853 " const char *device,\n"
11854 " const char *mountpoint);\n"
11859 #: ../src/guestfs-actions.pod:4383
11861 "This is the same as the C<guestfs_mount> command, but it mounts the "
11862 "filesystem with the read-only (I<-o ro>) flag."
11866 #: ../src/guestfs-actions.pod:4390
11867 msgid "guestfs_mount_vfs"
11871 #: ../src/guestfs-actions.pod:4392
11875 " guestfs_mount_vfs (guestfs_h *g,\n"
11876 " const char *options,\n"
11877 " const char *vfstype,\n"
11878 " const char *device,\n"
11879 " const char *mountpoint);\n"
11884 #: ../src/guestfs-actions.pod:4399
11886 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11887 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
11892 #: ../src/guestfs-actions.pod:4407
11893 msgid "guestfs_mountpoints"
11897 #: ../src/guestfs-actions.pod:4409
11901 " guestfs_mountpoints (guestfs_h *g);\n"
11906 #: ../src/guestfs-actions.pod:4412
11908 "This call is similar to C<guestfs_mounts>. That call returns a list of "
11909 "devices. This one returns a hash table (map) of device name to directory "
11910 "where the device is mounted."
11914 #: ../src/guestfs-actions.pod:4424
11915 msgid "guestfs_mounts"
11919 #: ../src/guestfs-actions.pod:4426
11923 " guestfs_mounts (guestfs_h *g);\n"
11928 #: ../src/guestfs-actions.pod:4429 ../fish/guestfish-actions.pod:2975
11930 "This returns the list of currently mounted filesystems. It returns the list "
11931 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
11935 #: ../src/guestfs-actions.pod:4432 ../fish/guestfish-actions.pod:2978
11936 msgid "Some internal mounts are not shown."
11940 #: ../src/guestfs-actions.pod:4434
11941 msgid "See also: C<guestfs_mountpoints>"
11945 #: ../src/guestfs-actions.pod:4442
11950 #: ../src/guestfs-actions.pod:4444
11954 " guestfs_mv (guestfs_h *g,\n"
11955 " const char *src,\n"
11956 " const char *dest);\n"
11961 #: ../src/guestfs-actions.pod:4449 ../fish/guestfish-actions.pod:2986
11963 "This moves a file from C<src> to C<dest> where C<dest> is either a "
11964 "destination filename or destination directory."
11968 #: ../src/guestfs-actions.pod:4456
11969 msgid "guestfs_ntfs_3g_probe"
11973 #: ../src/guestfs-actions.pod:4458
11977 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
11979 " const char *device);\n"
11984 #: ../src/guestfs-actions.pod:4463 ../fish/guestfish-actions.pod:2993
11986 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
11987 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
11988 "write, and some cannot be mounted at all)."
11992 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:2997
11994 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
11995 "can be mounted read-write. Set it to false if you want to test if the "
11996 "volume can be mounted read-only."
12000 #: ../src/guestfs-actions.pod:4471 ../fish/guestfish-actions.pod:3001
12002 "The return value is an integer which C<0> if the operation would succeed, or "
12003 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12007 #: ../src/guestfs-actions.pod:4477
12008 msgid "(Added in 1.0.43)"
12012 #: ../src/guestfs-actions.pod:4479
12013 msgid "guestfs_ntfsresize"
12017 #: ../src/guestfs-actions.pod:4481
12021 " guestfs_ntfsresize (guestfs_h *g,\n"
12022 " const char *device);\n"
12027 #: ../src/guestfs-actions.pod:4485 ../fish/guestfish-actions.pod:3009
12029 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12030 "size of the underlying device. See also L<ntfsresize(8)>."
12034 #: ../src/guestfs-actions.pod:4493
12035 msgid "guestfs_ntfsresize_size"
12039 #: ../src/guestfs-actions.pod:4495
12043 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12044 " const char *device,\n"
12045 " int64_t size);\n"
12050 #: ../src/guestfs-actions.pod:4500
12052 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12053 "to specify the new size (in bytes) explicitly."
12057 #: ../src/guestfs-actions.pod:4505 ../src/guestfs-actions.pod:4941
12058 #: ../src/guestfs-actions.pod:5014 ../src/guestfs-actions.pod:5263
12059 msgid "(Added in 1.3.14)"
12063 #: ../src/guestfs-actions.pod:4507
12064 msgid "guestfs_part_add"
12068 #: ../src/guestfs-actions.pod:4509
12072 " guestfs_part_add (guestfs_h *g,\n"
12073 " const char *device,\n"
12074 " const char *prlogex,\n"
12075 " int64_t startsect,\n"
12076 " int64_t endsect);\n"
12081 #: ../src/guestfs-actions.pod:4516
12083 "This command adds a partition to C<device>. If there is no partition table "
12084 "on the device, call C<guestfs_part_init> first."
12088 #: ../src/guestfs-actions.pod:4519 ../fish/guestfish-actions.pod:3027
12090 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12091 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12092 "C<logical>) and C<e> (or C<extended>) partition types."
12096 #: ../src/guestfs-actions.pod:4524 ../fish/guestfish-actions.pod:3032
12098 "C<startsect> and C<endsect> are the start and end of the partition in "
12099 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12100 "from the end of the disk (C<-1> is the last sector)."
12104 #: ../src/guestfs-actions.pod:4528
12106 "Creating a partition which covers the whole disk is not so easy. Use "
12107 "C<guestfs_part_disk> to do that."
12111 #: ../src/guestfs-actions.pod:4533 ../src/guestfs-actions.pod:4571
12112 #: ../src/guestfs-actions.pod:4624 ../src/guestfs-actions.pod:4702
12113 #: ../src/guestfs-actions.pod:4740 ../src/guestfs-actions.pod:4759
12114 #: ../src/guestfs-actions.pod:4799
12115 msgid "(Added in 1.0.78)"
12119 #: ../src/guestfs-actions.pod:4535
12120 msgid "guestfs_part_del"
12124 #: ../src/guestfs-actions.pod:4537
12128 " guestfs_part_del (guestfs_h *g,\n"
12129 " const char *device,\n"
12135 #: ../src/guestfs-actions.pod:4542 ../fish/guestfish-actions.pod:3043
12136 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12140 #: ../src/guestfs-actions.pod:4544 ../fish/guestfish-actions.pod:3045
12142 "Note that in the case of MBR partitioning, deleting an extended partition "
12143 "also deletes any logical partitions it contains."
12147 #: ../src/guestfs-actions.pod:4552
12148 msgid "guestfs_part_disk"
12152 #: ../src/guestfs-actions.pod:4554
12156 " guestfs_part_disk (guestfs_h *g,\n"
12157 " const char *device,\n"
12158 " const char *parttype);\n"
12163 #: ../src/guestfs-actions.pod:4559
12165 "This command is simply a combination of C<guestfs_part_init> followed by "
12166 "C<guestfs_part_add> to create a single primary partition covering the whole "
12171 #: ../src/guestfs-actions.pod:4563
12173 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12174 "possible values are described in C<guestfs_part_init>."
12178 #: ../src/guestfs-actions.pod:4573
12179 msgid "guestfs_part_get_bootable"
12183 #: ../src/guestfs-actions.pod:4575
12187 " guestfs_part_get_bootable (guestfs_h *g,\n"
12188 " const char *device,\n"
12194 #: ../src/guestfs-actions.pod:4580 ../fish/guestfish-actions.pod:3067
12196 "This command returns true if the partition C<partnum> on C<device> has the "
12197 "bootable flag set."
12201 #: ../src/guestfs-actions.pod:4583
12202 msgid "See also C<guestfs_part_set_bootable>."
12206 #: ../src/guestfs-actions.pod:4589
12207 msgid "guestfs_part_get_mbr_id"
12211 #: ../src/guestfs-actions.pod:4591
12215 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12216 " const char *device,\n"
12222 #: ../src/guestfs-actions.pod:4596 ../fish/guestfish-actions.pod:3076
12224 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12225 "partition C<partnum>."
12229 #: ../src/guestfs-actions.pod:4599 ../src/guestfs-actions.pod:4775
12231 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12232 "undefined results for other partition table types (see "
12233 "C<guestfs_part_get_parttype>)."
12237 #: ../src/guestfs-actions.pod:4607
12238 msgid "guestfs_part_get_parttype"
12242 #: ../src/guestfs-actions.pod:4609
12246 " guestfs_part_get_parttype (guestfs_h *g,\n"
12247 " const char *device);\n"
12252 #: ../src/guestfs-actions.pod:4613 ../fish/guestfish-actions.pod:3087
12254 "This command examines the partition table on C<device> and returns the "
12255 "partition table type (format) being used."
12259 #: ../src/guestfs-actions.pod:4616
12261 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12262 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12263 "possible, although unusual. See C<guestfs_part_init> for a full list."
12267 #: ../src/guestfs-actions.pod:4626
12268 msgid "guestfs_part_init"
12272 #: ../src/guestfs-actions.pod:4628
12276 " guestfs_part_init (guestfs_h *g,\n"
12277 " const char *device,\n"
12278 " const char *parttype);\n"
12283 #: ../src/guestfs-actions.pod:4633 ../fish/guestfish-actions.pod:3099
12285 "This creates an empty partition table on C<device> of one of the partition "
12286 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12287 "(for large disks)."
12291 #: ../src/guestfs-actions.pod:4637
12293 "Initially there are no partitions. Following this, you should call "
12294 "C<guestfs_part_add> for each partition required."
12298 #: ../src/guestfs-actions.pod:4640 ../fish/guestfish-actions.pod:3106
12299 msgid "Possible values for C<parttype> are:"
12303 #: ../src/guestfs-actions.pod:4644 ../fish/guestfish-actions.pod:3110
12304 msgid "B<efi> | B<gpt>"
12308 #: ../src/guestfs-actions.pod:4646 ../fish/guestfish-actions.pod:3112
12309 msgid "Intel EFI / GPT partition table."
12313 #: ../src/guestfs-actions.pod:4648 ../fish/guestfish-actions.pod:3114
12315 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12316 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12317 "the C<mbr> format."
12321 #: ../src/guestfs-actions.pod:4652 ../fish/guestfish-actions.pod:3118
12322 msgid "B<mbr> | B<msdos>"
12326 #: ../src/guestfs-actions.pod:4654 ../fish/guestfish-actions.pod:3120
12328 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12329 "Windows. This partition type will B<only> work for device sizes up to 2 "
12330 "TB. For large disks we recommend using C<gpt>."
12334 #: ../src/guestfs-actions.pod:4661 ../fish/guestfish-actions.pod:3127
12336 "Other partition table types that may work but are not supported include:"
12340 #: ../src/guestfs-actions.pod:4666 ../fish/guestfish-actions.pod:3132
12345 #: ../src/guestfs-actions.pod:4668 ../fish/guestfish-actions.pod:3134
12346 msgid "AIX disk labels."
12350 #: ../src/guestfs-actions.pod:4670 ../fish/guestfish-actions.pod:3136
12351 msgid "B<amiga> | B<rdb>"
12355 #: ../src/guestfs-actions.pod:4672 ../fish/guestfish-actions.pod:3138
12356 msgid "Amiga \"Rigid Disk Block\" format."
12360 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3140
12365 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3142
12366 msgid "BSD disk labels."
12370 #: ../src/guestfs-actions.pod:4678 ../fish/guestfish-actions.pod:3144
12375 #: ../src/guestfs-actions.pod:4680 ../fish/guestfish-actions.pod:3146
12376 msgid "DASD, used on IBM mainframes."
12380 #: ../src/guestfs-actions.pod:4682 ../fish/guestfish-actions.pod:3148
12385 #: ../src/guestfs-actions.pod:4684 ../fish/guestfish-actions.pod:3150
12386 msgid "MIPS/SGI volumes."
12390 #: ../src/guestfs-actions.pod:4686 ../fish/guestfish-actions.pod:3152
12395 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3154
12396 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12400 #: ../src/guestfs-actions.pod:4690 ../fish/guestfish-actions.pod:3156
12405 #: ../src/guestfs-actions.pod:4692 ../fish/guestfish-actions.pod:3158
12406 msgid "NEC PC-98 format, common in Japan apparently."
12410 #: ../src/guestfs-actions.pod:4694 ../fish/guestfish-actions.pod:3160
12415 #: ../src/guestfs-actions.pod:4696 ../fish/guestfish-actions.pod:3162
12416 msgid "Sun disk labels."
12420 #: ../src/guestfs-actions.pod:4704
12421 msgid "guestfs_part_list"
12425 #: ../src/guestfs-actions.pod:4706
12428 " struct guestfs_partition_list *\n"
12429 " guestfs_part_list (guestfs_h *g,\n"
12430 " const char *device);\n"
12435 #: ../src/guestfs-actions.pod:4710 ../fish/guestfish-actions.pod:3170
12437 "This command parses the partition table on C<device> and returns the list of "
12438 "partitions found."
12442 #: ../src/guestfs-actions.pod:4713 ../fish/guestfish-actions.pod:3173
12443 msgid "The fields in the returned structure are:"
12447 #: ../src/guestfs-actions.pod:4717 ../fish/guestfish-actions.pod:3177
12448 msgid "B<part_num>"
12452 #: ../src/guestfs-actions.pod:4719 ../fish/guestfish-actions.pod:3179
12453 msgid "Partition number, counting from 1."
12457 #: ../src/guestfs-actions.pod:4721 ../fish/guestfish-actions.pod:3181
12458 msgid "B<part_start>"
12462 #: ../src/guestfs-actions.pod:4723
12464 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12465 "the device's sector size, see C<guestfs_blockdev_getss>."
12469 #: ../src/guestfs-actions.pod:4726 ../fish/guestfish-actions.pod:3186
12470 msgid "B<part_end>"
12474 #: ../src/guestfs-actions.pod:4728 ../fish/guestfish-actions.pod:3188
12475 msgid "End of the partition in bytes."
12479 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3190
12480 msgid "B<part_size>"
12484 #: ../src/guestfs-actions.pod:4732 ../fish/guestfish-actions.pod:3192
12485 msgid "Size of the partition in bytes."
12489 #: ../src/guestfs-actions.pod:4736
12491 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12492 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12497 #: ../src/guestfs-actions.pod:4742
12498 msgid "guestfs_part_set_bootable"
12502 #: ../src/guestfs-actions.pod:4744
12506 " guestfs_part_set_bootable (guestfs_h *g,\n"
12507 " const char *device,\n"
12509 " int bootable);\n"
12514 #: ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3200
12516 "This sets the bootable flag on partition numbered C<partnum> on device "
12517 "C<device>. Note that partitions are numbered from 1."
12521 #: ../src/guestfs-actions.pod:4753 ../fish/guestfish-actions.pod:3203
12523 "The bootable flag is used by some operating systems (notably Windows) to "
12524 "determine which partition to boot from. It is by no means universally "
12529 #: ../src/guestfs-actions.pod:4761
12530 msgid "guestfs_part_set_mbr_id"
12534 #: ../src/guestfs-actions.pod:4763
12538 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12539 " const char *device,\n"
12546 #: ../src/guestfs-actions.pod:4769 ../fish/guestfish-actions.pod:3211
12548 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12549 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12550 "documentation are in fact hexadecimal numbers, but usually documented "
12551 "without any leading \"0x\" which might be confusing."
12555 #: ../src/guestfs-actions.pod:4783
12556 msgid "guestfs_part_set_name"
12560 #: ../src/guestfs-actions.pod:4785
12564 " guestfs_part_set_name (guestfs_h *g,\n"
12565 " const char *device,\n"
12567 " const char *name);\n"
12572 #: ../src/guestfs-actions.pod:4791 ../fish/guestfish-actions.pod:3225
12574 "This sets the partition name on partition numbered C<partnum> on device "
12575 "C<device>. Note that partitions are numbered from 1."
12579 #: ../src/guestfs-actions.pod:4794 ../fish/guestfish-actions.pod:3228
12581 "The partition name can only be set on certain types of partition table. "
12582 "This works on C<gpt> but not on C<mbr> partitions."
12586 #: ../src/guestfs-actions.pod:4801
12587 msgid "guestfs_part_to_dev"
12591 #: ../src/guestfs-actions.pod:4803
12595 " guestfs_part_to_dev (guestfs_h *g,\n"
12596 " const char *partition);\n"
12601 #: ../src/guestfs-actions.pod:4807 ../fish/guestfish-actions.pod:3235
12603 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12604 "partition number, returning the device name (eg. \"/dev/sdb\")."
12608 #: ../src/guestfs-actions.pod:4811
12610 "The named partition must exist, for example as a string returned from "
12611 "C<guestfs_list_partitions>."
12615 #: ../src/guestfs-actions.pod:4819
12616 msgid "guestfs_ping_daemon"
12620 #: ../src/guestfs-actions.pod:4821
12624 " guestfs_ping_daemon (guestfs_h *g);\n"
12629 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3246
12631 "This is a test probe into the guestfs daemon running inside the qemu "
12632 "subprocess. Calling this function checks that the daemon responds to the "
12633 "ping message, without affecting the daemon or attached block device(s) in "
12638 #: ../src/guestfs-actions.pod:4833
12639 msgid "guestfs_pread"
12643 #: ../src/guestfs-actions.pod:4835
12647 " guestfs_pread (guestfs_h *g,\n"
12648 " const char *path,\n"
12650 " int64_t offset,\n"
12651 " size_t *size_r);\n"
12656 #: ../src/guestfs-actions.pod:4842 ../fish/guestfish-actions.pod:3255
12658 "This command lets you read part of a file. It reads C<count> bytes of the "
12659 "file, starting at C<offset>, from file C<path>."
12663 #: ../src/guestfs-actions.pod:4845 ../src/guestfs-actions.pod:4871
12664 #: ../fish/guestfish-actions.pod:3258 ../fish/guestfish-actions.pod:3273
12666 "This may read fewer bytes than requested. For further details see the "
12667 "L<pread(2)> system call."
12671 #: ../src/guestfs-actions.pod:4848
12672 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12676 #: ../src/guestfs-actions.pod:4859
12677 msgid "guestfs_pread_device"
12681 #: ../src/guestfs-actions.pod:4861
12685 " guestfs_pread_device (guestfs_h *g,\n"
12686 " const char *device,\n"
12688 " int64_t offset,\n"
12689 " size_t *size_r);\n"
12694 #: ../src/guestfs-actions.pod:4868 ../fish/guestfish-actions.pod:3270
12696 "This command lets you read part of a file. It reads C<count> bytes of "
12697 "C<device>, starting at C<offset>."
12701 #: ../src/guestfs-actions.pod:4874
12702 msgid "See also C<guestfs_pread>."
12706 #: ../src/guestfs-actions.pod:4883
12707 msgid "(Added in 1.5.21)"
12711 #: ../src/guestfs-actions.pod:4885
12712 msgid "guestfs_pvcreate"
12716 #: ../src/guestfs-actions.pod:4887
12720 " guestfs_pvcreate (guestfs_h *g,\n"
12721 " const char *device);\n"
12726 #: ../src/guestfs-actions.pod:4891 ../fish/guestfish-actions.pod:3285
12728 "This creates an LVM physical volume on the named C<device>, where C<device> "
12729 "should usually be a partition name such as C</dev/sda1>."
12733 #: ../src/guestfs-actions.pod:4899
12734 msgid "guestfs_pvremove"
12738 #: ../src/guestfs-actions.pod:4901
12742 " guestfs_pvremove (guestfs_h *g,\n"
12743 " const char *device);\n"
12748 #: ../src/guestfs-actions.pod:4905 ../fish/guestfish-actions.pod:3293
12750 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12755 #: ../src/guestfs-actions.pod:4908 ../fish/guestfish-actions.pod:3296
12757 "The implementation uses the C<pvremove> command which refuses to wipe "
12758 "physical volumes that contain any volume groups, so you have to remove those "
12763 #: ../src/guestfs-actions.pod:4916
12764 msgid "guestfs_pvresize"
12768 #: ../src/guestfs-actions.pod:4918
12772 " guestfs_pvresize (guestfs_h *g,\n"
12773 " const char *device);\n"
12778 #: ../src/guestfs-actions.pod:4922 ../fish/guestfish-actions.pod:3304
12780 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12781 "the new size of the underlying device."
12785 #: ../src/guestfs-actions.pod:4929
12786 msgid "guestfs_pvresize_size"
12790 #: ../src/guestfs-actions.pod:4931
12794 " guestfs_pvresize_size (guestfs_h *g,\n"
12795 " const char *device,\n"
12796 " int64_t size);\n"
12801 #: ../src/guestfs-actions.pod:4936
12803 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12804 "specify the new size (in bytes) explicitly."
12808 #: ../src/guestfs-actions.pod:4943
12809 msgid "guestfs_pvs"
12813 #: ../src/guestfs-actions.pod:4945
12817 " guestfs_pvs (guestfs_h *g);\n"
12822 #: ../src/guestfs-actions.pod:4948 ../fish/guestfish-actions.pod:3318
12824 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12829 #: ../src/guestfs-actions.pod:4951 ../fish/guestfish-actions.pod:3321
12831 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12836 #: ../src/guestfs-actions.pod:4954
12837 msgid "See also C<guestfs_pvs_full>."
12841 #: ../src/guestfs-actions.pod:4962
12842 msgid "guestfs_pvs_full"
12846 #: ../src/guestfs-actions.pod:4964
12849 " struct guestfs_lvm_pv_list *\n"
12850 " guestfs_pvs_full (guestfs_h *g);\n"
12855 #: ../src/guestfs-actions.pod:4967 ../fish/guestfish-actions.pod:3330
12857 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12858 "(8)> command. The \"full\" version includes all fields."
12862 #: ../src/guestfs-actions.pod:4970
12864 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12865 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
12869 #: ../src/guestfs-actions.pod:4976
12870 msgid "guestfs_pvuuid"
12874 #: ../src/guestfs-actions.pod:4978
12878 " guestfs_pvuuid (guestfs_h *g,\n"
12879 " const char *device);\n"
12884 #: ../src/guestfs-actions.pod:4982 ../fish/guestfish-actions.pod:3337
12885 msgid "This command returns the UUID of the LVM PV C<device>."
12889 #: ../src/guestfs-actions.pod:4989
12890 msgid "guestfs_pwrite"
12894 #: ../src/guestfs-actions.pod:4991
12898 " guestfs_pwrite (guestfs_h *g,\n"
12899 " const char *path,\n"
12900 " const char *content,\n"
12901 " size_t content_size,\n"
12902 " int64_t offset);\n"
12907 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3343
12909 "This command writes to part of a file. It writes the data buffer C<content> "
12910 "to the file C<path> starting at offset C<offset>."
12914 #: ../src/guestfs-actions.pod:5001 ../fish/guestfish-actions.pod:3346
12916 "This command implements the L<pwrite(2)> system call, and like that system "
12917 "call it may not write the full data requested. The return value is the "
12918 "number of bytes that were actually written to the file. This could even be "
12919 "0, although short writes are unlikely for regular files in ordinary "
12924 #: ../src/guestfs-actions.pod:5007
12925 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
12929 #: ../src/guestfs-actions.pod:5016
12930 msgid "guestfs_pwrite_device"
12934 #: ../src/guestfs-actions.pod:5018
12938 " guestfs_pwrite_device (guestfs_h *g,\n"
12939 " const char *device,\n"
12940 " const char *content,\n"
12941 " size_t content_size,\n"
12942 " int64_t offset);\n"
12947 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3361
12949 "This command writes to part of a device. It writes the data buffer "
12950 "C<content> to C<device> starting at offset C<offset>."
12954 #: ../src/guestfs-actions.pod:5028 ../fish/guestfish-actions.pod:3364
12956 "This command implements the L<pwrite(2)> system call, and like that system "
12957 "call it may not write the full data requested (although short writes to disk "
12958 "devices and partitions are probably impossible with standard Linux kernels)."
12962 #: ../src/guestfs-actions.pod:5033
12963 msgid "See also C<guestfs_pwrite>."
12967 #: ../src/guestfs-actions.pod:5040
12968 msgid "(Added in 1.5.20)"
12972 #: ../src/guestfs-actions.pod:5042
12973 msgid "guestfs_read_file"
12977 #: ../src/guestfs-actions.pod:5044
12981 " guestfs_read_file (guestfs_h *g,\n"
12982 " const char *path,\n"
12983 " size_t *size_r);\n"
12988 #: ../src/guestfs-actions.pod:5049 ../fish/guestfish-actions.pod:3378
12989 msgid "This calls returns the contents of the file C<path> as a buffer."
12993 #: ../src/guestfs-actions.pod:5052
12995 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
12996 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
12997 "function is limited in the total size of file that can be handled."
13001 #: ../src/guestfs-actions.pod:5064
13002 msgid "(Added in 1.0.63)"
13006 #: ../src/guestfs-actions.pod:5066
13007 msgid "guestfs_read_lines"
13011 #: ../src/guestfs-actions.pod:5068
13015 " guestfs_read_lines (guestfs_h *g,\n"
13016 " const char *path);\n"
13021 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3395
13023 "The file contents are returned as a list of lines. Trailing C<LF> and "
13024 "C<CRLF> character sequences are I<not> returned."
13028 #: ../src/guestfs-actions.pod:5077
13030 "Note that this function cannot correctly handle binary files (specifically, "
13031 "files containing C<\\0> character which is treated as end of line). For "
13032 "those you need to use the C<guestfs_read_file> function which has a more "
13033 "complex interface."
13037 #: ../src/guestfs-actions.pod:5088
13038 msgid "guestfs_readdir"
13042 #: ../src/guestfs-actions.pod:5090
13045 " struct guestfs_dirent_list *\n"
13046 " guestfs_readdir (guestfs_h *g,\n"
13047 " const char *dir);\n"
13052 #: ../src/guestfs-actions.pod:5094 ../fish/guestfish-actions.pod:3407
13053 msgid "This returns the list of directory entries in directory C<dir>."
13057 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3409
13059 "All entries in the directory are returned, including C<.> and C<..>. The "
13060 "entries are I<not> sorted, but returned in the same order as the underlying "
13065 #: ../src/guestfs-actions.pod:5100 ../fish/guestfish-actions.pod:3413
13067 "Also this call returns basic file type information about each file. The "
13068 "C<ftyp> field will contain one of the following characters:"
13072 #: ../src/guestfs-actions.pod:5105 ../fish/guestfish-actions.pod:3418
13077 #: ../src/guestfs-actions.pod:5107 ../fish/guestfish-actions.pod:3420
13078 msgid "Block special"
13082 #: ../src/guestfs-actions.pod:5109 ../fish/guestfish-actions.pod:3422
13087 #: ../src/guestfs-actions.pod:5111 ../fish/guestfish-actions.pod:3424
13088 msgid "Char special"
13092 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3426
13097 #: ../src/guestfs-actions.pod:5115 ../fish/guestfish-actions.pod:3428
13102 #: ../src/guestfs-actions.pod:5117 ../fish/guestfish-actions.pod:3430
13107 #: ../src/guestfs-actions.pod:5119 ../fish/guestfish-actions.pod:3432
13108 msgid "FIFO (named pipe)"
13112 #: ../src/guestfs-actions.pod:5121 ../fish/guestfish-actions.pod:3434
13117 #: ../src/guestfs-actions.pod:5123 ../fish/guestfish-actions.pod:3436
13118 msgid "Symbolic link"
13122 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3438
13127 #: ../src/guestfs-actions.pod:5127 ../fish/guestfish-actions.pod:3440
13128 msgid "Regular file"
13132 #: ../src/guestfs-actions.pod:5129 ../fish/guestfish-actions.pod:3442
13137 #: ../src/guestfs-actions.pod:5131 ../fish/guestfish-actions.pod:3444
13142 #: ../src/guestfs-actions.pod:5133 ../fish/guestfish-actions.pod:3446
13147 #: ../src/guestfs-actions.pod:5135 ../fish/guestfish-actions.pod:3448
13148 msgid "Unknown file type"
13152 #: ../src/guestfs-actions.pod:5137 ../fish/guestfish-actions.pod:3450
13157 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:3452
13159 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13163 #: ../src/guestfs-actions.pod:5144
13165 "This function is primarily intended for use by programs. To get a simple "
13166 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13167 "consumption, use C<guestfs_ll>."
13171 #: ../src/guestfs-actions.pod:5148
13173 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13174 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13178 #: ../src/guestfs-actions.pod:5154
13179 msgid "guestfs_readlink"
13183 #: ../src/guestfs-actions.pod:5156
13187 " guestfs_readlink (guestfs_h *g,\n"
13188 " const char *path);\n"
13193 #: ../src/guestfs-actions.pod:5160 ../fish/guestfish-actions.pod:3465
13194 msgid "This command reads the target of a symbolic link."
13198 #: ../src/guestfs-actions.pod:5167
13199 msgid "guestfs_readlinklist"
13203 #: ../src/guestfs-actions.pod:5169
13207 " guestfs_readlinklist (guestfs_h *g,\n"
13208 " const char *path,\n"
13209 " char *const *names);\n"
13214 #: ../src/guestfs-actions.pod:5174 ../fish/guestfish-actions.pod:3471
13216 "This call allows you to do a C<readlink> operation on multiple files, where "
13217 "all files are in the directory C<path>. C<names> is the list of files from "
13222 #: ../src/guestfs-actions.pod:5178 ../fish/guestfish-actions.pod:3475
13224 "On return you get a list of strings, with a one-to-one correspondence to the "
13225 "C<names> list. Each string is the value of the symbolic link."
13229 #: ../src/guestfs-actions.pod:5182 ../fish/guestfish-actions.pod:3479
13231 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13232 "result string is the empty string C<\"\">. However the whole operation is "
13233 "completed even if there were C<readlink(2)> errors, and so you can call this "
13234 "function with names where you don't know if they are symbolic links already "
13235 "(albeit slightly less efficient)."
13239 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:3486
13241 "This call is intended for programs that want to efficiently list a directory "
13242 "contents without making many round-trips. Very long directory listings "
13243 "might cause the protocol message size to be exceeded, causing this call to "
13244 "fail. The caller must split up such requests into smaller groups of names."
13248 #: ../src/guestfs-actions.pod:5202
13249 msgid "guestfs_realpath"
13253 #: ../src/guestfs-actions.pod:5204
13257 " guestfs_realpath (guestfs_h *g,\n"
13258 " const char *path);\n"
13263 #: ../src/guestfs-actions.pod:5208 ../fish/guestfish-actions.pod:3497
13265 "Return the canonicalized absolute pathname of C<path>. The returned path "
13266 "has no C<.>, C<..> or symbolic link path elements."
13270 #: ../src/guestfs-actions.pod:5216
13271 msgid "guestfs_removexattr"
13275 #: ../src/guestfs-actions.pod:5218
13279 " guestfs_removexattr (guestfs_h *g,\n"
13280 " const char *xattr,\n"
13281 " const char *path);\n"
13286 #: ../src/guestfs-actions.pod:5223 ../fish/guestfish-actions.pod:3504
13288 "This call removes the extended attribute named C<xattr> of the file C<path>."
13292 #: ../src/guestfs-actions.pod:5226
13293 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13297 #: ../src/guestfs-actions.pod:5232
13298 msgid "guestfs_resize2fs"
13302 #: ../src/guestfs-actions.pod:5234
13306 " guestfs_resize2fs (guestfs_h *g,\n"
13307 " const char *device);\n"
13312 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:3513
13314 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13315 "underlying device."
13319 #: ../src/guestfs-actions.pod:5241
13321 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13322 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13323 "sometimes gives an error about this and sometimes not. In any case, it is "
13324 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13328 #: ../src/guestfs-actions.pod:5251
13329 msgid "guestfs_resize2fs_size"
13333 #: ../src/guestfs-actions.pod:5253
13337 " guestfs_resize2fs_size (guestfs_h *g,\n"
13338 " const char *device,\n"
13339 " int64_t size);\n"
13344 #: ../src/guestfs-actions.pod:5258
13346 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13347 "to specify the new size (in bytes) explicitly."
13351 #: ../src/guestfs-actions.pod:5265
13356 #: ../src/guestfs-actions.pod:5267
13360 " guestfs_rm (guestfs_h *g,\n"
13361 " const char *path);\n"
13366 #: ../src/guestfs-actions.pod:5271 ../fish/guestfish-actions.pod:3533
13367 msgid "Remove the single file C<path>."
13371 #: ../src/guestfs-actions.pod:5277
13372 msgid "guestfs_rm_rf"
13376 #: ../src/guestfs-actions.pod:5279
13380 " guestfs_rm_rf (guestfs_h *g,\n"
13381 " const char *path);\n"
13386 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:3539
13388 "Remove the file or directory C<path>, recursively removing the contents if "
13389 "its a directory. This is like the C<rm -rf> shell command."
13393 #: ../src/guestfs-actions.pod:5291
13394 msgid "guestfs_rmdir"
13398 #: ../src/guestfs-actions.pod:5293
13402 " guestfs_rmdir (guestfs_h *g,\n"
13403 " const char *path);\n"
13408 #: ../src/guestfs-actions.pod:5297 ../fish/guestfish-actions.pod:3547
13409 msgid "Remove the single directory C<path>."
13413 #: ../src/guestfs-actions.pod:5303
13414 msgid "guestfs_rmmountpoint"
13418 #: ../src/guestfs-actions.pod:5305
13422 " guestfs_rmmountpoint (guestfs_h *g,\n"
13423 " const char *exemptpath);\n"
13428 #: ../src/guestfs-actions.pod:5309
13430 "This calls removes a mountpoint that was previously created with "
13431 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13435 #: ../src/guestfs-actions.pod:5317
13436 msgid "guestfs_scrub_device"
13440 #: ../src/guestfs-actions.pod:5319
13444 " guestfs_scrub_device (guestfs_h *g,\n"
13445 " const char *device);\n"
13450 #: ../src/guestfs-actions.pod:5323 ../fish/guestfish-actions.pod:3561
13452 "This command writes patterns over C<device> to make data retrieval more "
13457 #: ../src/guestfs-actions.pod:5326 ../src/guestfs-actions.pod:5347
13458 #: ../src/guestfs-actions.pod:5366 ../fish/guestfish-actions.pod:3564
13459 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3592
13461 "It is an interface to the L<scrub(1)> program. See that manual page for "
13466 #: ../src/guestfs-actions.pod:5334 ../src/guestfs-actions.pod:5352
13467 #: ../src/guestfs-actions.pod:5371
13468 msgid "(Added in 1.0.52)"
13472 #: ../src/guestfs-actions.pod:5336
13473 msgid "guestfs_scrub_file"
13477 #: ../src/guestfs-actions.pod:5338
13481 " guestfs_scrub_file (guestfs_h *g,\n"
13482 " const char *file);\n"
13487 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3574
13489 "This command writes patterns over a file to make data retrieval more "
13494 #: ../src/guestfs-actions.pod:5345 ../fish/guestfish-actions.pod:3577
13495 msgid "The file is I<removed> after scrubbing."
13499 #: ../src/guestfs-actions.pod:5354
13500 msgid "guestfs_scrub_freespace"
13504 #: ../src/guestfs-actions.pod:5356
13508 " guestfs_scrub_freespace (guestfs_h *g,\n"
13509 " const char *dir);\n"
13514 #: ../src/guestfs-actions.pod:5360
13516 "This command creates the directory C<dir> and then fills it with files until "
13517 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13518 "and deletes them. The intention is to scrub any free space on the partition "
13519 "containing C<dir>."
13523 #: ../src/guestfs-actions.pod:5373
13524 msgid "guestfs_set_append"
13528 #: ../src/guestfs-actions.pod:5375
13532 " guestfs_set_append (guestfs_h *g,\n"
13533 " const char *append);\n"
13538 #: ../src/guestfs-actions.pod:5379 ../fish/guestfish-actions.pod:3601
13540 "This function is used to add additional options to the guest kernel command "
13545 #: ../src/guestfs-actions.pod:5382 ../fish/guestfish-actions.pod:3604
13547 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13548 "environment variable."
13552 #: ../src/guestfs-actions.pod:5385 ../fish/guestfish-actions.pod:3607
13554 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13555 "(libguestfs always adds a few of its own)."
13559 #: ../src/guestfs-actions.pod:5392
13560 msgid "guestfs_set_autosync"
13564 #: ../src/guestfs-actions.pod:5394
13568 " guestfs_set_autosync (guestfs_h *g,\n"
13569 " int autosync);\n"
13574 #: ../src/guestfs-actions.pod:5398
13576 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13577 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13578 "the handle is closed (also if the program exits without closing handles)."
13582 #: ../src/guestfs-actions.pod:5403 ../fish/guestfish-actions.pod:3621
13584 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13585 "disabled by default)."
13589 #: ../src/guestfs-actions.pod:5410
13590 msgid "guestfs_set_direct"
13594 #: ../src/guestfs-actions.pod:5412
13598 " guestfs_set_direct (guestfs_h *g,\n"
13604 #: ../src/guestfs-actions.pod:5416 ../fish/guestfish-actions.pod:3630
13606 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13607 "passed directly through to the appliance once it is launched."
13611 #: ../src/guestfs-actions.pod:5420
13613 "One consequence of this is that log messages aren't caught by the library "
13614 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13619 #: ../src/guestfs-actions.pod:5424 ../fish/guestfish-actions.pod:3638
13620 msgid "You probably don't want to use this unless you know what you are doing."
13624 #: ../src/guestfs-actions.pod:5427 ../fish/guestfish-actions.pod:3641
13625 msgid "The default is disabled."
13629 #: ../src/guestfs-actions.pod:5433
13630 msgid "guestfs_set_e2label"
13634 #: ../src/guestfs-actions.pod:5435
13638 " guestfs_set_e2label (guestfs_h *g,\n"
13639 " const char *device,\n"
13640 " const char *label);\n"
13645 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:3647
13647 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13648 "C<label>. Filesystem labels are limited to 16 characters."
13652 #: ../src/guestfs-actions.pod:5444
13654 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13655 "the existing label on a filesystem."
13659 #: ../src/guestfs-actions.pod:5451
13660 msgid "guestfs_set_e2uuid"
13664 #: ../src/guestfs-actions.pod:5453
13668 " guestfs_set_e2uuid (guestfs_h *g,\n"
13669 " const char *device,\n"
13670 " const char *uuid);\n"
13675 #: ../src/guestfs-actions.pod:5458 ../fish/guestfish-actions.pod:3658
13677 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13678 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13679 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13683 #: ../src/guestfs-actions.pod:5463
13685 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13686 "the existing UUID of a filesystem."
13690 #: ../src/guestfs-actions.pod:5470
13691 msgid "guestfs_set_memsize"
13695 #: ../src/guestfs-actions.pod:5472
13699 " guestfs_set_memsize (guestfs_h *g,\n"
13705 #: ../src/guestfs-actions.pod:5476
13707 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13708 "This only has any effect if called before C<guestfs_launch>."
13712 #: ../src/guestfs-actions.pod:5480 ../fish/guestfish-actions.pod:3676
13714 "You can also change this by setting the environment variable "
13715 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13719 #: ../src/guestfs-actions.pod:5491
13720 msgid "guestfs_set_network"
13724 #: ../src/guestfs-actions.pod:5493
13728 " guestfs_set_network (guestfs_h *g,\n"
13734 #: ../src/guestfs-actions.pod:5497 ../fish/guestfish-actions.pod:3689
13736 "If C<network> is true, then the network is enabled in the libguestfs "
13737 "appliance. The default is false."
13741 #: ../src/guestfs-actions.pod:5500 ../fish/guestfish-actions.pod:3692
13743 "This affects whether commands are able to access the network (see L<guestfs"
13744 "(3)/RUNNING COMMANDS>)."
13748 #: ../src/guestfs-actions.pod:5503
13750 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13755 #: ../src/guestfs-actions.pod:5510
13756 msgid "guestfs_set_path"
13760 #: ../src/guestfs-actions.pod:5512
13764 " guestfs_set_path (guestfs_h *g,\n"
13765 " const char *searchpath);\n"
13770 #: ../src/guestfs-actions.pod:5516 ../fish/guestfish-actions.pod:3704
13771 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13775 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:3706
13777 "The default is C<$libdir/guestfs> unless overridden by setting "
13778 "C<LIBGUESTFS_PATH> environment variable."
13782 #: ../src/guestfs-actions.pod:5521 ../fish/guestfish-actions.pod:3709
13783 msgid "Setting C<path> to C<NULL> restores the default path."
13787 #: ../src/guestfs-actions.pod:5527
13788 msgid "guestfs_set_qemu"
13792 #: ../src/guestfs-actions.pod:5529
13796 " guestfs_set_qemu (guestfs_h *g,\n"
13797 " const char *qemu);\n"
13802 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:3717
13803 msgid "Set the qemu binary that we will use."
13807 #: ../src/guestfs-actions.pod:5535 ../fish/guestfish-actions.pod:3719
13809 "The default is chosen when the library was compiled by the configure script."
13813 #: ../src/guestfs-actions.pod:5538 ../fish/guestfish-actions.pod:3722
13815 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13820 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:3725
13821 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13825 #: ../src/guestfs-actions.pod:5543 ../fish/guestfish-actions.pod:3727
13827 "Note that you should call this function as early as possible after creating "
13828 "the handle. This is because some pre-launch operations depend on testing "
13829 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13830 "don't retest features, and so you might see inconsistent results. Using the "
13831 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13832 "the qemu binary at the same time as the handle is created."
13836 #: ../src/guestfs-actions.pod:5555
13837 msgid "guestfs_set_recovery_proc"
13841 #: ../src/guestfs-actions.pod:5557
13845 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13846 " int recoveryproc);\n"
13851 #: ../src/guestfs-actions.pod:5561
13853 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13854 "not create a recovery process. The purpose of the recovery process is to "
13855 "stop runaway qemu processes in the case where the main program aborts "
13860 #: ../src/guestfs-actions.pod:5566
13862 "This only has any effect if called before C<guestfs_launch>, and the default "
13867 #: ../src/guestfs-actions.pod:5569 ../fish/guestfish-actions.pod:3749
13869 "About the only time when you would want to disable this is if the main "
13870 "process will fork itself into the background (\"daemonize\" itself). In "
13871 "this case the recovery process thinks that the main program has disappeared "
13872 "and so kills qemu, which is not very helpful."
13876 #: ../src/guestfs-actions.pod:5579
13877 msgid "guestfs_set_selinux"
13881 #: ../src/guestfs-actions.pod:5581
13885 " guestfs_set_selinux (guestfs_h *g,\n"
13891 #: ../src/guestfs-actions.pod:5585 ../fish/guestfish-actions.pod:3761
13893 "This sets the selinux flag that is passed to the appliance at boot time. "
13894 "The default is C<selinux=0> (disabled)."
13898 #: ../src/guestfs-actions.pod:5588 ../fish/guestfish-actions.pod:3764
13900 "Note that if SELinux is enabled, it is always in Permissive mode "
13901 "(C<enforcing=0>)."
13905 #: ../src/guestfs-actions.pod:5598
13906 msgid "guestfs_set_trace"
13910 #: ../src/guestfs-actions.pod:5600
13914 " guestfs_set_trace (guestfs_h *g,\n"
13920 #: ../src/guestfs-actions.pod:5604 ../fish/guestfish-actions.pod:3776
13922 "If the command trace flag is set to 1, then commands are printed on stderr "
13923 "before they are executed in a format which is very similar to the one used "
13924 "by guestfish. In other words, you can run a program with this enabled, and "
13925 "you will get out a script which you can feed to guestfish to perform the "
13926 "same set of actions."
13930 #: ../src/guestfs-actions.pod:5611 ../fish/guestfish-actions.pod:3783
13932 "If you want to trace C API calls into libguestfs (and other libraries) then "
13933 "possibly a better way is to use the external ltrace(1) command."
13937 #: ../src/guestfs-actions.pod:5615 ../fish/guestfish-actions.pod:3787
13939 "Command traces are disabled unless the environment variable "
13940 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
13944 #: ../src/guestfs-actions.pod:5622
13945 msgid "guestfs_set_verbose"
13949 #: ../src/guestfs-actions.pod:5624
13953 " guestfs_set_verbose (guestfs_h *g,\n"
13959 #: ../src/guestfs-actions.pod:5628 ../fish/guestfish-actions.pod:3796
13960 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
13964 #: ../src/guestfs-actions.pod:5630 ../fish/guestfish-actions.pod:3798
13966 "Verbose messages are disabled unless the environment variable "
13967 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
13971 #: ../src/guestfs-actions.pod:5637
13972 msgid "guestfs_setcon"
13976 #: ../src/guestfs-actions.pod:5639
13980 " guestfs_setcon (guestfs_h *g,\n"
13981 " const char *context);\n"
13986 #: ../src/guestfs-actions.pod:5643 ../fish/guestfish-actions.pod:3805
13988 "This sets the SELinux security context of the daemon to the string "
13993 #: ../src/guestfs-actions.pod:5646 ../fish/guestfish-actions.pod:3808
13994 msgid "See the documentation about SELINUX in L<guestfs(3)>."
13998 #: ../src/guestfs-actions.pod:5652
13999 msgid "guestfs_setxattr"
14003 #: ../src/guestfs-actions.pod:5654
14007 " guestfs_setxattr (guestfs_h *g,\n"
14008 " const char *xattr,\n"
14009 " const char *val,\n"
14011 " const char *path);\n"
14016 #: ../src/guestfs-actions.pod:5661 ../fish/guestfish-actions.pod:3814
14018 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14019 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14023 #: ../src/guestfs-actions.pod:5665
14024 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14028 #: ../src/guestfs-actions.pod:5671
14029 msgid "guestfs_sfdisk"
14033 #: ../src/guestfs-actions.pod:5673
14037 " guestfs_sfdisk (guestfs_h *g,\n"
14038 " const char *device,\n"
14042 " char *const *lines);\n"
14047 #: ../src/guestfs-actions.pod:5681 ../fish/guestfish-actions.pod:3824
14049 "This is a direct interface to the L<sfdisk(8)> program for creating "
14050 "partitions on block devices."
14054 #: ../src/guestfs-actions.pod:5684 ../fish/guestfish-actions.pod:3827
14055 msgid "C<device> should be a block device, for example C</dev/sda>."
14059 #: ../src/guestfs-actions.pod:5686 ../fish/guestfish-actions.pod:3829
14061 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14062 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14063 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14064 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14065 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14066 "the kernel) cannot work out the right geometry and you will need to tell it."
14070 #: ../src/guestfs-actions.pod:5694 ../fish/guestfish-actions.pod:3837
14072 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14073 "refer to the L<sfdisk(8)> manpage."
14077 #: ../src/guestfs-actions.pod:5697 ../fish/guestfish-actions.pod:3840
14079 "To create a single partition occupying the whole disk, you would pass "
14080 "C<lines> as a single element list, when the single element being the string "
14085 #: ../src/guestfs-actions.pod:5701
14087 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14091 #: ../src/guestfs-actions.pod:5711
14092 msgid "guestfs_sfdiskM"
14096 #: ../src/guestfs-actions.pod:5713
14100 " guestfs_sfdiskM (guestfs_h *g,\n"
14101 " const char *device,\n"
14102 " char *const *lines);\n"
14107 #: ../src/guestfs-actions.pod:5718
14109 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14110 "partition sizes are specified in megabytes only (rounded to the nearest "
14111 "cylinder) and you don't need to specify the cyls, heads and sectors "
14112 "parameters which were rarely if ever used anyway."
14116 #: ../src/guestfs-actions.pod:5724
14118 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14119 "C<guestfs_part_disk>"
14123 #: ../src/guestfs-actions.pod:5734
14124 msgid "guestfs_sfdisk_N"
14128 #: ../src/guestfs-actions.pod:5736
14132 " guestfs_sfdisk_N (guestfs_h *g,\n"
14133 " const char *device,\n"
14138 " const char *line);\n"
14143 #: ../src/guestfs-actions.pod:5745 ../fish/guestfish-actions.pod:3870
14145 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14146 "(note: C<n> counts from 1)."
14150 #: ../src/guestfs-actions.pod:5748
14152 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14153 "for the cyls/heads/sectors parameters."
14157 #: ../src/guestfs-actions.pod:5751
14158 msgid "See also: C<guestfs_part_add>"
14162 #: ../src/guestfs-actions.pod:5760
14163 msgid "guestfs_sfdisk_disk_geometry"
14167 #: ../src/guestfs-actions.pod:5762
14171 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14172 " const char *device);\n"
14177 #: ../src/guestfs-actions.pod:5766
14179 "This displays the disk geometry of C<device> read from the partition table. "
14180 "Especially in the case where the underlying block device has been resized, "
14181 "this can be different from the kernel's idea of the geometry (see "
14182 "C<guestfs_sfdisk_kernel_geometry>)."
14186 #: ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5787
14187 #: ../fish/guestfish-actions.pod:3890 ../fish/guestfish-actions.pod:3899
14188 msgid "The result is in human-readable format, and not designed to be parsed."
14192 #: ../src/guestfs-actions.pod:5779
14193 msgid "guestfs_sfdisk_kernel_geometry"
14197 #: ../src/guestfs-actions.pod:5781
14201 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14202 " const char *device);\n"
14207 #: ../src/guestfs-actions.pod:5785 ../fish/guestfish-actions.pod:3897
14208 msgid "This displays the kernel's idea of the geometry of C<device>."
14212 #: ../src/guestfs-actions.pod:5795
14213 msgid "guestfs_sfdisk_l"
14217 #: ../src/guestfs-actions.pod:5797
14221 " guestfs_sfdisk_l (guestfs_h *g,\n"
14222 " const char *device);\n"
14227 #: ../src/guestfs-actions.pod:5801 ../fish/guestfish-actions.pod:3906
14229 "This displays the partition table on C<device>, in the human-readable output "
14230 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14234 #: ../src/guestfs-actions.pod:5805
14235 msgid "See also: C<guestfs_part_list>"
14239 #: ../src/guestfs-actions.pod:5812
14244 #: ../src/guestfs-actions.pod:5814
14248 " guestfs_sh (guestfs_h *g,\n"
14249 " const char *command);\n"
14254 #: ../src/guestfs-actions.pod:5818 ../fish/guestfish-actions.pod:3916
14256 "This call runs a command from the guest filesystem via the guest's C</bin/"
14261 #: ../src/guestfs-actions.pod:5821
14262 msgid "This is like C<guestfs_command>, but passes the command to:"
14266 #: ../src/guestfs-actions.pod:5823 ../fish/guestfish-actions.pod:3921
14269 " /bin/sh -c \"command\"\n"
14274 #: ../src/guestfs-actions.pod:5825 ../fish/guestfish-actions.pod:3923
14276 "Depending on the guest's shell, this usually results in wildcards being "
14277 "expanded, shell expressions being interpolated and so on."
14281 #: ../src/guestfs-actions.pod:5829
14282 msgid "All the provisos about C<guestfs_command> apply to this call."
14286 #: ../src/guestfs-actions.pod:5836
14287 msgid "guestfs_sh_lines"
14291 #: ../src/guestfs-actions.pod:5838
14295 " guestfs_sh_lines (guestfs_h *g,\n"
14296 " const char *command);\n"
14301 #: ../src/guestfs-actions.pod:5842
14303 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14308 #: ../src/guestfs-actions.pod:5845
14309 msgid "See also: C<guestfs_command_lines>"
14313 #: ../src/guestfs-actions.pod:5853
14314 msgid "guestfs_sleep"
14318 #: ../src/guestfs-actions.pod:5855
14322 " guestfs_sleep (guestfs_h *g,\n"
14328 #: ../src/guestfs-actions.pod:5859 ../fish/guestfish-actions.pod:3942
14329 msgid "Sleep for C<secs> seconds."
14333 #: ../src/guestfs-actions.pod:5863
14334 msgid "(Added in 1.0.41)"
14338 #: ../src/guestfs-actions.pod:5865 ../src/guestfs-structs.pod:109
14339 msgid "guestfs_stat"
14343 #: ../src/guestfs-actions.pod:5867
14346 " struct guestfs_stat *\n"
14347 " guestfs_stat (guestfs_h *g,\n"
14348 " const char *path);\n"
14353 #: ../src/guestfs-actions.pod:5873 ../fish/guestfish-actions.pod:3950
14354 msgid "This is the same as the C<stat(2)> system call."
14358 #: ../src/guestfs-actions.pod:5881 ../src/guestfs-structs.pod:135
14359 msgid "guestfs_statvfs"
14363 #: ../src/guestfs-actions.pod:5883
14366 " struct guestfs_statvfs *\n"
14367 " guestfs_statvfs (guestfs_h *g,\n"
14368 " const char *path);\n"
14373 #: ../src/guestfs-actions.pod:5887 ../fish/guestfish-actions.pod:3956
14375 "Returns file system statistics for any mounted file system. C<path> should "
14376 "be a file or directory in the mounted file system (typically it is the mount "
14377 "point itself, but it doesn't need to be)."
14381 #: ../src/guestfs-actions.pod:5891 ../fish/guestfish-actions.pod:3960
14382 msgid "This is the same as the C<statvfs(2)> system call."
14386 #: ../src/guestfs-actions.pod:5893
14388 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14389 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14393 #: ../src/guestfs-actions.pod:5899
14394 msgid "guestfs_strings"
14398 #: ../src/guestfs-actions.pod:5901
14402 " guestfs_strings (guestfs_h *g,\n"
14403 " const char *path);\n"
14408 #: ../src/guestfs-actions.pod:5905 ../fish/guestfish-actions.pod:3966
14410 "This runs the L<strings(1)> command on a file and returns the list of "
14411 "printable strings found."
14415 #: ../src/guestfs-actions.pod:5917
14416 msgid "guestfs_strings_e"
14420 #: ../src/guestfs-actions.pod:5919
14424 " guestfs_strings_e (guestfs_h *g,\n"
14425 " const char *encoding,\n"
14426 " const char *path);\n"
14431 #: ../src/guestfs-actions.pod:5924
14433 "This is like the C<guestfs_strings> command, but allows you to specify the "
14434 "encoding of strings that are looked for in the source file C<path>."
14438 #: ../src/guestfs-actions.pod:5928 ../fish/guestfish-actions.pod:3980
14439 msgid "Allowed encodings are:"
14443 #: ../src/guestfs-actions.pod:5932 ../fish/guestfish-actions.pod:3984
14448 #: ../src/guestfs-actions.pod:5934
14450 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14451 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14455 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3989
14460 #: ../src/guestfs-actions.pod:5939 ../fish/guestfish-actions.pod:3991
14461 msgid "Single 8-bit-byte characters."
14465 #: ../src/guestfs-actions.pod:5941 ../fish/guestfish-actions.pod:3993
14470 #: ../src/guestfs-actions.pod:5943 ../fish/guestfish-actions.pod:3995
14471 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14475 #: ../src/guestfs-actions.pod:5946 ../fish/guestfish-actions.pod:3998
14476 msgid "l (lower case letter L)"
14480 #: ../src/guestfs-actions.pod:5948 ../fish/guestfish-actions.pod:4000
14482 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14483 "examining binaries in Windows guests."
14487 #: ../src/guestfs-actions.pod:5951 ../fish/guestfish-actions.pod:4003
14492 #: ../src/guestfs-actions.pod:5953 ../fish/guestfish-actions.pod:4005
14493 msgid "32-bit big endian such as UCS-4BE."
14497 #: ../src/guestfs-actions.pod:5955 ../fish/guestfish-actions.pod:4007
14502 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:4009
14503 msgid "32-bit little endian such as UCS-4LE."
14507 #: ../src/guestfs-actions.pod:5961 ../fish/guestfish-actions.pod:4013
14508 msgid "The returned strings are transcoded to UTF-8."
14512 #: ../src/guestfs-actions.pod:5972
14513 msgid "guestfs_swapoff_device"
14517 #: ../src/guestfs-actions.pod:5974
14521 " guestfs_swapoff_device (guestfs_h *g,\n"
14522 " const char *device);\n"
14527 #: ../src/guestfs-actions.pod:5978
14529 "This command disables the libguestfs appliance swap device or partition "
14530 "named C<device>. See C<guestfs_swapon_device>."
14534 #: ../src/guestfs-actions.pod:5986
14535 msgid "guestfs_swapoff_file"
14539 #: ../src/guestfs-actions.pod:5988
14543 " guestfs_swapoff_file (guestfs_h *g,\n"
14544 " const char *file);\n"
14549 #: ../src/guestfs-actions.pod:5992 ../fish/guestfish-actions.pod:4030
14550 msgid "This command disables the libguestfs appliance swap on file."
14554 #: ../src/guestfs-actions.pod:5998
14555 msgid "guestfs_swapoff_label"
14559 #: ../src/guestfs-actions.pod:6000
14563 " guestfs_swapoff_label (guestfs_h *g,\n"
14564 " const char *label);\n"
14569 #: ../src/guestfs-actions.pod:6004 ../fish/guestfish-actions.pod:4036
14571 "This command disables the libguestfs appliance swap on labeled swap "
14576 #: ../src/guestfs-actions.pod:6011
14577 msgid "guestfs_swapoff_uuid"
14581 #: ../src/guestfs-actions.pod:6013
14585 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14586 " const char *uuid);\n"
14591 #: ../src/guestfs-actions.pod:6017 ../fish/guestfish-actions.pod:4043
14593 "This command disables the libguestfs appliance swap partition with the given "
14598 #: ../src/guestfs-actions.pod:6024
14599 msgid "guestfs_swapon_device"
14603 #: ../src/guestfs-actions.pod:6026
14607 " guestfs_swapon_device (guestfs_h *g,\n"
14608 " const char *device);\n"
14613 #: ../src/guestfs-actions.pod:6030
14615 "This command enables the libguestfs appliance to use the swap device or "
14616 "partition named C<device>. The increased memory is made available for all "
14617 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14621 #: ../src/guestfs-actions.pod:6035 ../fish/guestfish-actions.pod:4055
14623 "Note that you should not swap to existing guest swap partitions unless you "
14624 "know what you are doing. They may contain hibernation information, or other "
14625 "information that the guest doesn't want you to trash. You also risk leaking "
14626 "information about the host to the guest this way. Instead, attach a new "
14627 "host device to the guest and swap on that."
14631 #: ../src/guestfs-actions.pod:6046
14632 msgid "guestfs_swapon_file"
14636 #: ../src/guestfs-actions.pod:6048
14640 " guestfs_swapon_file (guestfs_h *g,\n"
14641 " const char *file);\n"
14646 #: ../src/guestfs-actions.pod:6052
14648 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14653 #: ../src/guestfs-actions.pod:6059
14654 msgid "guestfs_swapon_label"
14658 #: ../src/guestfs-actions.pod:6061
14662 " guestfs_swapon_label (guestfs_h *g,\n"
14663 " const char *label);\n"
14668 #: ../src/guestfs-actions.pod:6065
14670 "This command enables swap to a labeled swap partition. See "
14671 "C<guestfs_swapon_device> for other notes."
14675 #: ../src/guestfs-actions.pod:6072
14676 msgid "guestfs_swapon_uuid"
14680 #: ../src/guestfs-actions.pod:6074
14684 " guestfs_swapon_uuid (guestfs_h *g,\n"
14685 " const char *uuid);\n"
14690 #: ../src/guestfs-actions.pod:6078
14692 "This command enables swap to a swap partition with the given UUID. See "
14693 "C<guestfs_swapon_device> for other notes."
14697 #: ../src/guestfs-actions.pod:6085
14698 msgid "guestfs_sync"
14702 #: ../src/guestfs-actions.pod:6087
14706 " guestfs_sync (guestfs_h *g);\n"
14711 #: ../src/guestfs-actions.pod:6090 ../fish/guestfish-actions.pod:4087
14713 "This syncs the disk, so that any writes are flushed through to the "
14714 "underlying disk image."
14718 #: ../src/guestfs-actions.pod:6093 ../fish/guestfish-actions.pod:4090
14720 "You should always call this if you have modified a disk image, before "
14721 "closing the handle."
14725 #: ../src/guestfs-actions.pod:6100
14726 msgid "guestfs_tail"
14730 #: ../src/guestfs-actions.pod:6102
14734 " guestfs_tail (guestfs_h *g,\n"
14735 " const char *path);\n"
14740 #: ../src/guestfs-actions.pod:6106 ../fish/guestfish-actions.pod:4097
14742 "This command returns up to the last 10 lines of a file as a list of strings."
14746 #: ../src/guestfs-actions.pod:6118
14747 msgid "guestfs_tail_n"
14751 #: ../src/guestfs-actions.pod:6120
14755 " guestfs_tail_n (guestfs_h *g,\n"
14757 " const char *path);\n"
14762 #: ../src/guestfs-actions.pod:6125 ../fish/guestfish-actions.pod:4107
14764 "If the parameter C<nrlines> is a positive number, this returns the last "
14765 "C<nrlines> lines of the file C<path>."
14769 #: ../src/guestfs-actions.pod:6128 ../fish/guestfish-actions.pod:4110
14771 "If the parameter C<nrlines> is a negative number, this returns lines from "
14772 "the file C<path>, starting with the C<-nrlines>th line."
14776 #: ../src/guestfs-actions.pod:6142
14777 msgid "guestfs_tar_in"
14781 #: ../src/guestfs-actions.pod:6144
14785 " guestfs_tar_in (guestfs_h *g,\n"
14786 " const char *tarfile,\n"
14787 " const char *directory);\n"
14792 #: ../src/guestfs-actions.pod:6149 ../fish/guestfish-actions.pod:4122
14794 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14795 "tar file) into C<directory>."
14799 #: ../src/guestfs-actions.pod:6152
14801 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14805 #: ../src/guestfs-actions.pod:6157 ../src/guestfs-actions.pod:6174
14806 #: ../src/guestfs-actions.pod:6190 ../src/guestfs-actions.pod:6206
14807 msgid "(Added in 1.0.3)"
14811 #: ../src/guestfs-actions.pod:6159
14812 msgid "guestfs_tar_out"
14816 #: ../src/guestfs-actions.pod:6161
14820 " guestfs_tar_out (guestfs_h *g,\n"
14821 " const char *directory,\n"
14822 " const char *tarfile);\n"
14827 #: ../src/guestfs-actions.pod:6166 ../fish/guestfish-actions.pod:4134
14829 "This command packs the contents of C<directory> and downloads it to local "
14834 #: ../src/guestfs-actions.pod:6169
14836 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14837 "C<guestfs_txz_out>."
14841 #: ../src/guestfs-actions.pod:6176
14842 msgid "guestfs_tgz_in"
14846 #: ../src/guestfs-actions.pod:6178
14850 " guestfs_tgz_in (guestfs_h *g,\n"
14851 " const char *tarball,\n"
14852 " const char *directory);\n"
14857 #: ../src/guestfs-actions.pod:6183 ../fish/guestfish-actions.pod:4146
14859 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14860 "tar file) into C<directory>."
14864 #: ../src/guestfs-actions.pod:6186
14865 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14869 #: ../src/guestfs-actions.pod:6192
14870 msgid "guestfs_tgz_out"
14874 #: ../src/guestfs-actions.pod:6194
14878 " guestfs_tgz_out (guestfs_h *g,\n"
14879 " const char *directory,\n"
14880 " const char *tarball);\n"
14885 #: ../src/guestfs-actions.pod:6199 ../fish/guestfish-actions.pod:4157
14887 "This command packs the contents of C<directory> and downloads it to local "
14892 #: ../src/guestfs-actions.pod:6202
14893 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
14897 #: ../src/guestfs-actions.pod:6208
14898 msgid "guestfs_touch"
14902 #: ../src/guestfs-actions.pod:6210
14906 " guestfs_touch (guestfs_h *g,\n"
14907 " const char *path);\n"
14912 #: ../src/guestfs-actions.pod:6214 ../fish/guestfish-actions.pod:4168
14914 "Touch acts like the L<touch(1)> command. It can be used to update the "
14915 "timestamps on a file, or, if the file does not exist, to create a new zero-"
14920 #: ../src/guestfs-actions.pod:6218 ../fish/guestfish-actions.pod:4172
14922 "This command only works on regular files, and will fail on other file types "
14923 "such as directories, symbolic links, block special etc."
14927 #: ../src/guestfs-actions.pod:6225
14928 msgid "guestfs_truncate"
14932 #: ../src/guestfs-actions.pod:6227
14936 " guestfs_truncate (guestfs_h *g,\n"
14937 " const char *path);\n"
14942 #: ../src/guestfs-actions.pod:6231 ../fish/guestfish-actions.pod:4179
14944 "This command truncates C<path> to a zero-length file. The file must exist "
14949 #: ../src/guestfs-actions.pod:6238
14950 msgid "guestfs_truncate_size"
14954 #: ../src/guestfs-actions.pod:6240
14958 " guestfs_truncate_size (guestfs_h *g,\n"
14959 " const char *path,\n"
14960 " int64_t size);\n"
14965 #: ../src/guestfs-actions.pod:6245 ../fish/guestfish-actions.pod:4186
14967 "This command truncates C<path> to size C<size> bytes. The file must exist "
14972 #: ../src/guestfs-actions.pod:6248
14974 "If the current file size is less than C<size> then the file is extended to "
14975 "the required size with zero bytes. This creates a sparse file (ie. disk "
14976 "blocks are not allocated for the file until you write to it). To create a "
14977 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
14981 #: ../src/guestfs-actions.pod:6258
14982 msgid "guestfs_tune2fs_l"
14986 #: ../src/guestfs-actions.pod:6260
14990 " guestfs_tune2fs_l (guestfs_h *g,\n"
14991 " const char *device);\n"
14996 #: ../src/guestfs-actions.pod:6264 ../fish/guestfish-actions.pod:4199
14998 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15003 #: ../src/guestfs-actions.pod:6267 ../fish/guestfish-actions.pod:4202
15005 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15006 "for more details. The list of fields returned isn't clearly defined, and "
15007 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15008 "and the filesystem itself."
15012 #: ../src/guestfs-actions.pod:6280
15013 msgid "guestfs_txz_in"
15017 #: ../src/guestfs-actions.pod:6282
15021 " guestfs_txz_in (guestfs_h *g,\n"
15022 " const char *tarball,\n"
15023 " const char *directory);\n"
15028 #: ../src/guestfs-actions.pod:6287 ../fish/guestfish-actions.pod:4211
15030 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15031 "tar file) into C<directory>."
15035 #: ../src/guestfs-actions.pod:6294
15036 msgid "guestfs_txz_out"
15040 #: ../src/guestfs-actions.pod:6296
15044 " guestfs_txz_out (guestfs_h *g,\n"
15045 " const char *directory,\n"
15046 " const char *tarball);\n"
15051 #: ../src/guestfs-actions.pod:6301 ../fish/guestfish-actions.pod:4220
15053 "This command packs the contents of C<directory> and downloads it to local "
15054 "file C<tarball> (as an xz compressed tar archive)."
15058 #: ../src/guestfs-actions.pod:6308
15059 msgid "guestfs_umask"
15063 #: ../src/guestfs-actions.pod:6310
15067 " guestfs_umask (guestfs_h *g,\n"
15073 #: ../src/guestfs-actions.pod:6314 ../fish/guestfish-actions.pod:4229
15075 "This function sets the mask used for creating new files and device nodes to "
15080 #: ../src/guestfs-actions.pod:6317 ../fish/guestfish-actions.pod:4232
15082 "Typical umask values would be C<022> which creates new files with "
15083 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15084 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15088 #: ../src/guestfs-actions.pod:6322 ../fish/guestfish-actions.pod:4237
15090 "The default umask is C<022>. This is important because it means that "
15091 "directories and device nodes will be created with C<0644> or C<0755> mode "
15092 "even if you specify C<0777>."
15096 #: ../src/guestfs-actions.pod:6326
15098 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15099 "C<guestfs_mkdir>."
15103 #: ../src/guestfs-actions.pod:6329 ../fish/guestfish-actions.pod:4244
15104 msgid "This call returns the previous umask."
15108 #: ../src/guestfs-actions.pod:6335
15109 msgid "guestfs_umount"
15113 #: ../src/guestfs-actions.pod:6337
15117 " guestfs_umount (guestfs_h *g,\n"
15118 " const char *pathordevice);\n"
15123 #: ../src/guestfs-actions.pod:6341 ../fish/guestfish-actions.pod:4252
15125 "This unmounts the given filesystem. The filesystem may be specified either "
15126 "by its mountpoint (path) or the device which contains the filesystem."
15130 #: ../src/guestfs-actions.pod:6349
15131 msgid "guestfs_umount_all"
15135 #: ../src/guestfs-actions.pod:6351
15139 " guestfs_umount_all (guestfs_h *g);\n"
15144 #: ../src/guestfs-actions.pod:6354 ../fish/guestfish-actions.pod:4262
15145 msgid "This unmounts all mounted filesystems."
15149 #: ../src/guestfs-actions.pod:6356 ../fish/guestfish-actions.pod:4264
15150 msgid "Some internal mounts are not unmounted by this call."
15154 #: ../src/guestfs-actions.pod:6362
15155 msgid "guestfs_upload"
15159 #: ../src/guestfs-actions.pod:6364
15163 " guestfs_upload (guestfs_h *g,\n"
15164 " const char *filename,\n"
15165 " const char *remotefilename);\n"
15170 #: ../src/guestfs-actions.pod:6369 ../src/guestfs-actions.pod:6388
15171 #: ../fish/guestfish-actions.pod:4270 ../fish/guestfish-actions.pod:4283
15172 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15176 #: ../src/guestfs-actions.pod:6374
15177 msgid "See also C<guestfs_download>."
15181 #: ../src/guestfs-actions.pod:6380
15182 msgid "guestfs_upload_offset"
15186 #: ../src/guestfs-actions.pod:6382
15190 " guestfs_upload_offset (guestfs_h *g,\n"
15191 " const char *filename,\n"
15192 " const char *remotefilename,\n"
15193 " int64_t offset);\n"
15198 #: ../src/guestfs-actions.pod:6391 ../fish/guestfish-actions.pod:4286
15200 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15201 "The intention is to overwrite parts of existing files or devices, although "
15202 "if a non-existant file is specified then it is created with a \"hole\" "
15203 "before C<offset>. The size of the data written is implicit in the size of "
15204 "the source C<filename>."
15208 #: ../src/guestfs-actions.pod:6398
15210 "Note that there is no limit on the amount of data that can be uploaded with "
15211 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15212 "full amount unless an error occurs."
15216 #: ../src/guestfs-actions.pod:6403
15217 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15221 #: ../src/guestfs-actions.pod:6409
15222 msgid "guestfs_utimens"
15226 #: ../src/guestfs-actions.pod:6411
15230 " guestfs_utimens (guestfs_h *g,\n"
15231 " const char *path,\n"
15232 " int64_t atsecs,\n"
15233 " int64_t atnsecs,\n"
15234 " int64_t mtsecs,\n"
15235 " int64_t mtnsecs);\n"
15240 #: ../src/guestfs-actions.pod:6419 ../fish/guestfish-actions.pod:4306
15241 msgid "This command sets the timestamps of a file with nanosecond precision."
15245 #: ../src/guestfs-actions.pod:6422 ../fish/guestfish-actions.pod:4309
15247 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15252 #: ../src/guestfs-actions.pod:6425 ../fish/guestfish-actions.pod:4312
15254 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15255 "nanoseconds from the epoch."
15259 #: ../src/guestfs-actions.pod:6428 ../fish/guestfish-actions.pod:4315
15261 "If the C<*nsecs> field contains the special value C<-1> then the "
15262 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15263 "ignored in this case)."
15267 #: ../src/guestfs-actions.pod:6432 ../fish/guestfish-actions.pod:4319
15269 "If the C<*nsecs> field contains the special value C<-2> then the "
15270 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15275 #: ../src/guestfs-actions.pod:6440 ../src/guestfs-structs.pod:175
15276 msgid "guestfs_version"
15280 #: ../src/guestfs-actions.pod:6442
15283 " struct guestfs_version *\n"
15284 " guestfs_version (guestfs_h *g);\n"
15289 #: ../src/guestfs-actions.pod:6445 ../fish/guestfish-actions.pod:4327
15291 "Return the libguestfs version number that the program is linked against."
15295 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4330
15297 "Note that because of dynamic linking this is not necessarily the version of "
15298 "libguestfs that you compiled against. You can compile the program, and then "
15299 "at runtime dynamically link against a completely different C<libguestfs.so> "
15304 #: ../src/guestfs-actions.pod:6453 ../fish/guestfish-actions.pod:4335
15306 "This call was added in version C<1.0.58>. In previous versions of "
15307 "libguestfs there was no way to get the version number. From C code you can "
15308 "use dynamic linker functions to find out if this symbol exists (if it "
15309 "doesn't, then it's an earlier version)."
15313 #: ../src/guestfs-actions.pod:6459 ../fish/guestfish-actions.pod:4341
15315 "The call returns a structure with four elements. The first three (C<major>, "
15316 "C<minor> and C<release>) are numbers and correspond to the usual version "
15317 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15318 "but may be used for distro-specific information."
15322 #: ../src/guestfs-actions.pod:6465 ../fish/guestfish-actions.pod:4347
15324 "To construct the original version string: C<$major.$minor.$release$extra>"
15328 #: ../src/guestfs-actions.pod:6468 ../fish/guestfish-actions.pod:4350
15329 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15333 #: ../src/guestfs-actions.pod:6470
15335 "I<Note:> Don't use this call to test for availability of features. In "
15336 "enterprise distributions we backport features from later versions into "
15337 "earlier versions, making this an unreliable way to test for features. Use "
15338 "C<guestfs_available> instead."
15342 #: ../src/guestfs-actions.pod:6476
15344 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15345 "error. I<The caller must call C<guestfs_free_version> after use>."
15349 #: ../src/guestfs-actions.pod:6480
15350 msgid "(Added in 1.0.58)"
15354 #: ../src/guestfs-actions.pod:6482
15355 msgid "guestfs_vfs_label"
15359 #: ../src/guestfs-actions.pod:6484
15363 " guestfs_vfs_label (guestfs_h *g,\n"
15364 " const char *device);\n"
15369 #: ../src/guestfs-actions.pod:6488 ../fish/guestfish-actions.pod:4362
15370 msgid "This returns the filesystem label of the filesystem on C<device>."
15374 #: ../src/guestfs-actions.pod:6491 ../fish/guestfish-actions.pod:4365
15375 msgid "If the filesystem is unlabeled, this returns the empty string."
15379 #: ../src/guestfs-actions.pod:6493
15380 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15384 #: ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6535
15385 msgid "(Added in 1.3.18)"
15389 #: ../src/guestfs-actions.pod:6500
15390 msgid "guestfs_vfs_type"
15394 #: ../src/guestfs-actions.pod:6502
15398 " guestfs_vfs_type (guestfs_h *g,\n"
15399 " const char *device);\n"
15404 #: ../src/guestfs-actions.pod:6506 ../fish/guestfish-actions.pod:4373
15406 "This command gets the filesystem type corresponding to the filesystem on "
15411 #: ../src/guestfs-actions.pod:6509 ../fish/guestfish-actions.pod:4376
15413 "For most filesystems, the result is the name of the Linux VFS module which "
15414 "would be used to mount this filesystem if you mounted it without specifying "
15415 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15419 #: ../src/guestfs-actions.pod:6519
15420 msgid "guestfs_vfs_uuid"
15424 #: ../src/guestfs-actions.pod:6521
15428 " guestfs_vfs_uuid (guestfs_h *g,\n"
15429 " const char *device);\n"
15434 #: ../src/guestfs-actions.pod:6525 ../fish/guestfish-actions.pod:4385
15435 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15439 #: ../src/guestfs-actions.pod:6528 ../fish/guestfish-actions.pod:4388
15440 msgid "If the filesystem does not have a UUID, this returns the empty string."
15444 #: ../src/guestfs-actions.pod:6530
15445 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15449 #: ../src/guestfs-actions.pod:6537
15450 msgid "guestfs_vg_activate"
15454 #: ../src/guestfs-actions.pod:6539
15458 " guestfs_vg_activate (guestfs_h *g,\n"
15460 " char *const *volgroups);\n"
15465 #: ../src/guestfs-actions.pod:6544 ../fish/guestfish-actions.pod:4396
15467 "This command activates or (if C<activate> is false) deactivates all logical "
15468 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15469 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15470 "deactivated, then those devices disappear."
15474 #: ../src/guestfs-actions.pod:6550 ../fish/guestfish-actions.pod:4402
15475 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15479 #: ../src/guestfs-actions.pod:6552 ../fish/guestfish-actions.pod:4404
15481 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15482 "activated or deactivated."
15486 #: ../src/guestfs-actions.pod:6559
15487 msgid "guestfs_vg_activate_all"
15491 #: ../src/guestfs-actions.pod:6561
15495 " guestfs_vg_activate_all (guestfs_h *g,\n"
15496 " int activate);\n"
15501 #: ../src/guestfs-actions.pod:6565 ../fish/guestfish-actions.pod:4411
15503 "This command activates or (if C<activate> is false) deactivates all logical "
15504 "volumes in all volume groups. If activated, then they are made known to the "
15505 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15506 "those devices disappear."
15510 #: ../src/guestfs-actions.pod:6571 ../fish/guestfish-actions.pod:4417
15511 msgid "This command is the same as running C<vgchange -a y|n>"
15515 #: ../src/guestfs-actions.pod:6577
15516 msgid "guestfs_vgcreate"
15520 #: ../src/guestfs-actions.pod:6579
15524 " guestfs_vgcreate (guestfs_h *g,\n"
15525 " const char *volgroup,\n"
15526 " char *const *physvols);\n"
15531 #: ../src/guestfs-actions.pod:6584 ../fish/guestfish-actions.pod:4423
15533 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15534 "of physical volumes C<physvols>."
15538 #: ../src/guestfs-actions.pod:6591
15539 msgid "guestfs_vglvuuids"
15543 #: ../src/guestfs-actions.pod:6593
15547 " guestfs_vglvuuids (guestfs_h *g,\n"
15548 " const char *vgname);\n"
15553 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4430
15555 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15556 "volumes created in this volume group."
15560 #: ../src/guestfs-actions.pod:6600
15562 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15563 "associate logical volumes and volume groups."
15567 #: ../src/guestfs-actions.pod:6603
15568 msgid "See also C<guestfs_vgpvuuids>."
15572 #: ../src/guestfs-actions.pod:6611
15573 msgid "guestfs_vgpvuuids"
15577 #: ../src/guestfs-actions.pod:6613
15581 " guestfs_vgpvuuids (guestfs_h *g,\n"
15582 " const char *vgname);\n"
15587 #: ../src/guestfs-actions.pod:6617 ../fish/guestfish-actions.pod:4442
15589 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15590 "volumes that this volume group resides on."
15594 #: ../src/guestfs-actions.pod:6620
15596 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15597 "associate physical volumes and volume groups."
15601 #: ../src/guestfs-actions.pod:6623
15602 msgid "See also C<guestfs_vglvuuids>."
15606 #: ../src/guestfs-actions.pod:6631
15607 msgid "guestfs_vgremove"
15611 #: ../src/guestfs-actions.pod:6633
15615 " guestfs_vgremove (guestfs_h *g,\n"
15616 " const char *vgname);\n"
15621 #: ../src/guestfs-actions.pod:6637 ../fish/guestfish-actions.pod:4454
15622 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15626 #: ../src/guestfs-actions.pod:6639 ../fish/guestfish-actions.pod:4456
15628 "This also forcibly removes all logical volumes in the volume group (if any)."
15632 #: ../src/guestfs-actions.pod:6646
15633 msgid "guestfs_vgrename"
15637 #: ../src/guestfs-actions.pod:6648
15641 " guestfs_vgrename (guestfs_h *g,\n"
15642 " const char *volgroup,\n"
15643 " const char *newvolgroup);\n"
15648 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4463
15649 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15653 #: ../src/guestfs-actions.pod:6659
15654 msgid "guestfs_vgs"
15658 #: ../src/guestfs-actions.pod:6661
15662 " guestfs_vgs (guestfs_h *g);\n"
15667 #: ../src/guestfs-actions.pod:6664 ../fish/guestfish-actions.pod:4469
15669 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15674 #: ../src/guestfs-actions.pod:6667 ../fish/guestfish-actions.pod:4472
15676 "This returns a list of just the volume group names that were detected (eg. "
15681 #: ../src/guestfs-actions.pod:6670
15682 msgid "See also C<guestfs_vgs_full>."
15686 #: ../src/guestfs-actions.pod:6678
15687 msgid "guestfs_vgs_full"
15691 #: ../src/guestfs-actions.pod:6680
15694 " struct guestfs_lvm_vg_list *\n"
15695 " guestfs_vgs_full (guestfs_h *g);\n"
15700 #: ../src/guestfs-actions.pod:6683 ../fish/guestfish-actions.pod:4481
15702 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15703 "> command. The \"full\" version includes all fields."
15707 #: ../src/guestfs-actions.pod:6686
15709 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15710 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15714 #: ../src/guestfs-actions.pod:6692
15715 msgid "guestfs_vgscan"
15719 #: ../src/guestfs-actions.pod:6694
15723 " guestfs_vgscan (guestfs_h *g);\n"
15728 #: ../src/guestfs-actions.pod:6697 ../fish/guestfish-actions.pod:4488
15730 "This rescans all block devices and rebuilds the list of LVM physical "
15731 "volumes, volume groups and logical volumes."
15735 #: ../src/guestfs-actions.pod:6704
15736 msgid "guestfs_vguuid"
15740 #: ../src/guestfs-actions.pod:6706
15744 " guestfs_vguuid (guestfs_h *g,\n"
15745 " const char *vgname);\n"
15750 #: ../src/guestfs-actions.pod:6710 ../fish/guestfish-actions.pod:4495
15751 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15755 #: ../src/guestfs-actions.pod:6717
15756 msgid "guestfs_wait_ready"
15760 #: ../src/guestfs-actions.pod:6719
15764 " guestfs_wait_ready (guestfs_h *g);\n"
15769 #: ../src/guestfs-actions.pod:6722
15770 msgid "This function is a no op."
15774 #: ../src/guestfs-actions.pod:6724
15776 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15777 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15778 "is no longer necessary because C<guestfs_launch> now does the waiting."
15782 #: ../src/guestfs-actions.pod:6729
15784 "If you see any calls to this function in code then you can just remove them, "
15785 "unless you want to retain compatibility with older versions of the API."
15789 #: ../src/guestfs-actions.pod:6737
15790 msgid "guestfs_wc_c"
15794 #: ../src/guestfs-actions.pod:6739
15798 " guestfs_wc_c (guestfs_h *g,\n"
15799 " const char *path);\n"
15804 #: ../src/guestfs-actions.pod:6743 ../fish/guestfish-actions.pod:4501
15806 "This command counts the characters in a file, using the C<wc -c> external "
15811 #: ../src/guestfs-actions.pod:6750
15812 msgid "guestfs_wc_l"
15816 #: ../src/guestfs-actions.pod:6752
15820 " guestfs_wc_l (guestfs_h *g,\n"
15821 " const char *path);\n"
15826 #: ../src/guestfs-actions.pod:6756 ../fish/guestfish-actions.pod:4508
15828 "This command counts the lines in a file, using the C<wc -l> external command."
15832 #: ../src/guestfs-actions.pod:6763
15833 msgid "guestfs_wc_w"
15837 #: ../src/guestfs-actions.pod:6765
15841 " guestfs_wc_w (guestfs_h *g,\n"
15842 " const char *path);\n"
15847 #: ../src/guestfs-actions.pod:6769 ../fish/guestfish-actions.pod:4515
15849 "This command counts the words in a file, using the C<wc -w> external command."
15853 #: ../src/guestfs-actions.pod:6776
15854 msgid "guestfs_write"
15858 #: ../src/guestfs-actions.pod:6778
15862 " guestfs_write (guestfs_h *g,\n"
15863 " const char *path,\n"
15864 " const char *content,\n"
15865 " size_t content_size);\n"
15870 #: ../src/guestfs-actions.pod:6784 ../fish/guestfish-actions.pod:4522
15872 "This call creates a file called C<path>. The content of the file is the "
15873 "string C<content> (which can contain any 8 bit data)."
15877 #: ../src/guestfs-actions.pod:6794
15878 msgid "guestfs_write_file"
15882 #: ../src/guestfs-actions.pod:6796
15886 " guestfs_write_file (guestfs_h *g,\n"
15887 " const char *path,\n"
15888 " const char *content,\n"
15894 #: ../src/guestfs-actions.pod:6802 ../fish/guestfish-actions.pod:4532
15896 "This call creates a file called C<path>. The contents of the file is the "
15897 "string C<content> (which can contain any 8 bit data), with length C<size>."
15901 #: ../src/guestfs-actions.pod:6806 ../fish/guestfish-actions.pod:4536
15903 "As a special case, if C<size> is C<0> then the length is calculated using "
15904 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
15908 #: ../src/guestfs-actions.pod:6810 ../fish/guestfish-actions.pod:4540
15910 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
15911 "I<not> work, even if the length is specified."
15915 #: ../src/guestfs-actions.pod:6818 ../fish/guestfish-actions.pod:4546
15917 "This function is deprecated. In new code, use the C<write> call instead."
15921 #: ../src/guestfs-actions.pod:6827
15922 msgid "guestfs_zegrep"
15926 #: ../src/guestfs-actions.pod:6829
15930 " guestfs_zegrep (guestfs_h *g,\n"
15931 " const char *regex,\n"
15932 " const char *path);\n"
15937 #: ../src/guestfs-actions.pod:6834 ../fish/guestfish-actions.pod:4557
15939 "This calls the external C<zegrep> program and returns the matching lines."
15943 #: ../src/guestfs-actions.pod:6846
15944 msgid "guestfs_zegrepi"
15948 #: ../src/guestfs-actions.pod:6848
15952 " guestfs_zegrepi (guestfs_h *g,\n"
15953 " const char *regex,\n"
15954 " const char *path);\n"
15959 #: ../src/guestfs-actions.pod:6853 ../fish/guestfish-actions.pod:4567
15961 "This calls the external C<zegrep -i> program and returns the matching lines."
15965 #: ../src/guestfs-actions.pod:6865
15966 msgid "guestfs_zero"
15970 #: ../src/guestfs-actions.pod:6867
15974 " guestfs_zero (guestfs_h *g,\n"
15975 " const char *device);\n"
15980 #: ../src/guestfs-actions.pod:6871 ../fish/guestfish-actions.pod:4577
15981 msgid "This command writes zeroes over the first few blocks of C<device>."
15985 #: ../src/guestfs-actions.pod:6873 ../fish/guestfish-actions.pod:4579
15987 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
15988 "securely wipe the device). It should be sufficient to remove any partition "
15989 "tables, filesystem superblocks and so on."
15993 #: ../src/guestfs-actions.pod:6877
15994 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
15998 #: ../src/guestfs-actions.pod:6888
15999 msgid "guestfs_zero_device"
16003 #: ../src/guestfs-actions.pod:6890
16007 " guestfs_zero_device (guestfs_h *g,\n"
16008 " const char *device);\n"
16013 #: ../src/guestfs-actions.pod:6894
16015 "This command writes zeroes over the entire C<device>. Compare with "
16016 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16020 #: ../src/guestfs-actions.pod:6908
16021 msgid "(Added in 1.3.1)"
16025 #: ../src/guestfs-actions.pod:6910
16026 msgid "guestfs_zerofree"
16030 #: ../src/guestfs-actions.pod:6912
16034 " guestfs_zerofree (guestfs_h *g,\n"
16035 " const char *device);\n"
16040 #: ../src/guestfs-actions.pod:6916 ../fish/guestfish-actions.pod:4600
16042 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16043 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16044 "possible to compress the filesystem more effectively."
16048 #: ../src/guestfs-actions.pod:6921 ../fish/guestfish-actions.pod:4605
16049 msgid "You should B<not> run this program if the filesystem is mounted."
16053 #: ../src/guestfs-actions.pod:6924 ../fish/guestfish-actions.pod:4608
16055 "It is possible that using this program can damage the filesystem or data on "
16060 #: ../src/guestfs-actions.pod:6931
16061 msgid "guestfs_zfgrep"
16065 #: ../src/guestfs-actions.pod:6933
16069 " guestfs_zfgrep (guestfs_h *g,\n"
16070 " const char *pattern,\n"
16071 " const char *path);\n"
16076 #: ../src/guestfs-actions.pod:6938 ../fish/guestfish-actions.pod:4615
16078 "This calls the external C<zfgrep> program and returns the matching lines."
16082 #: ../src/guestfs-actions.pod:6950
16083 msgid "guestfs_zfgrepi"
16087 #: ../src/guestfs-actions.pod:6952
16091 " guestfs_zfgrepi (guestfs_h *g,\n"
16092 " const char *pattern,\n"
16093 " const char *path);\n"
16098 #: ../src/guestfs-actions.pod:6957 ../fish/guestfish-actions.pod:4625
16100 "This calls the external C<zfgrep -i> program and returns the matching lines."
16104 #: ../src/guestfs-actions.pod:6969
16105 msgid "guestfs_zfile"
16109 #: ../src/guestfs-actions.pod:6971
16113 " guestfs_zfile (guestfs_h *g,\n"
16114 " const char *meth,\n"
16115 " const char *path);\n"
16120 #: ../src/guestfs-actions.pod:6976 ../fish/guestfish-actions.pod:4635
16122 "This command runs C<file> after first decompressing C<path> using C<method>."
16126 #: ../src/guestfs-actions.pod:6979 ../fish/guestfish-actions.pod:4638
16127 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16131 #: ../src/guestfs-actions.pod:6981
16133 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16138 #: ../src/guestfs-actions.pod:6987 ../fish/guestfish-actions.pod:4643
16140 "This function is deprecated. In new code, use the C<file> call instead."
16144 #: ../src/guestfs-actions.pod:6996
16145 msgid "guestfs_zgrep"
16149 #: ../src/guestfs-actions.pod:6998
16153 " guestfs_zgrep (guestfs_h *g,\n"
16154 " const char *regex,\n"
16155 " const char *path);\n"
16160 #: ../src/guestfs-actions.pod:7003 ../fish/guestfish-actions.pod:4654
16162 "This calls the external C<zgrep> program and returns the matching lines."
16166 #: ../src/guestfs-actions.pod:7015
16167 msgid "guestfs_zgrepi"
16171 #: ../src/guestfs-actions.pod:7017
16175 " guestfs_zgrepi (guestfs_h *g,\n"
16176 " const char *regex,\n"
16177 " const char *path);\n"
16182 #: ../src/guestfs-actions.pod:7022 ../fish/guestfish-actions.pod:4664
16184 "This calls the external C<zgrep -i> program and returns the matching lines."
16188 #: ../src/guestfs-availability.pod:3
16193 #: ../src/guestfs-availability.pod:5
16195 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16196 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16197 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16198 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16199 "L</guestfs_aug_save> L</guestfs_aug_set>"
16203 #: ../src/guestfs-availability.pod:21
16208 #: ../src/guestfs-availability.pod:23
16210 "The following functions: L</guestfs_inotify_add_watch> L</"
16211 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16212 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16216 #: ../src/guestfs-availability.pod:31
16217 msgid "B<linuxfsuuid>"
16221 #: ../src/guestfs-availability.pod:33
16223 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16224 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16228 #: ../src/guestfs-availability.pod:40
16229 msgid "B<linuxmodules>"
16233 #: ../src/guestfs-availability.pod:42
16234 msgid "The following functions: L</guestfs_modprobe>"
16238 #: ../src/guestfs-availability.pod:45
16239 msgid "B<linuxxattrs>"
16243 #: ../src/guestfs-availability.pod:47
16245 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
16246 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
16247 "guestfs_removexattr> L</guestfs_setxattr>"
16251 #: ../src/guestfs-availability.pod:56
16256 #: ../src/guestfs-availability.pod:58
16258 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16259 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16260 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16264 #: ../src/guestfs-availability.pod:67
16269 #: ../src/guestfs-availability.pod:69
16271 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16272 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16273 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16274 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16275 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16276 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16277 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16281 #: ../src/guestfs-availability.pod:92
16286 #: ../src/guestfs-availability.pod:94
16288 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16289 "guestfs_mknod_b> L</guestfs_mknod_c>"
16293 #: ../src/guestfs-availability.pod:100
16298 #: ../src/guestfs-availability.pod:102
16299 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16303 #: ../src/guestfs-availability.pod:105
16304 msgid "B<ntfsprogs>"
16308 #: ../src/guestfs-availability.pod:107
16310 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16314 #: ../src/guestfs-availability.pod:111
16315 msgid "B<realpath>"
16319 #: ../src/guestfs-availability.pod:113
16320 msgid "The following functions: L</guestfs_realpath>"
16324 #: ../src/guestfs-availability.pod:116
16329 #: ../src/guestfs-availability.pod:118
16331 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16332 "guestfs_scrub_freespace>"
16336 #: ../src/guestfs-availability.pod:123
16341 #: ../src/guestfs-availability.pod:125
16342 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16346 #: ../src/guestfs-availability.pod:129
16351 #: ../src/guestfs-availability.pod:131
16352 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16356 #: ../src/guestfs-availability.pod:135
16357 msgid "B<zerofree>"
16361 #: ../src/guestfs-availability.pod:137
16362 msgid "The following functions: L</guestfs_zerofree>"
16366 #: ../src/guestfs-structs.pod:1
16367 msgid "guestfs_int_bool"
16371 #: ../src/guestfs-structs.pod:3
16374 " struct guestfs_int_bool {\n"
16382 #: ../src/guestfs-structs.pod:8
16385 " struct guestfs_int_bool_list {\n"
16386 " uint32_t len; /* Number of elements in list. */\n"
16387 " struct guestfs_int_bool *val; /* Elements. */\n"
16393 #: ../src/guestfs-structs.pod:13
16396 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16397 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16402 #: ../src/guestfs-structs.pod:16
16403 msgid "guestfs_lvm_pv"
16407 #: ../src/guestfs-structs.pod:18
16410 " struct guestfs_lvm_pv {\n"
16411 " char *pv_name;\n"
16412 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16413 " char pv_uuid[32];\n"
16415 " uint64_t pv_size;\n"
16416 " uint64_t dev_size;\n"
16417 " uint64_t pv_free;\n"
16418 " uint64_t pv_used;\n"
16419 " char *pv_attr;\n"
16420 " int64_t pv_pe_count;\n"
16421 " int64_t pv_pe_alloc_count;\n"
16422 " char *pv_tags;\n"
16423 " uint64_t pe_start;\n"
16424 " int64_t pv_mda_count;\n"
16425 " uint64_t pv_mda_free;\n"
16431 #: ../src/guestfs-structs.pod:36
16434 " struct guestfs_lvm_pv_list {\n"
16435 " uint32_t len; /* Number of elements in list. */\n"
16436 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16442 #: ../src/guestfs-structs.pod:41
16445 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16446 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16451 #: ../src/guestfs-structs.pod:44
16452 msgid "guestfs_lvm_vg"
16456 #: ../src/guestfs-structs.pod:46
16459 " struct guestfs_lvm_vg {\n"
16460 " char *vg_name;\n"
16461 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16462 " char vg_uuid[32];\n"
16464 " char *vg_attr;\n"
16465 " uint64_t vg_size;\n"
16466 " uint64_t vg_free;\n"
16467 " char *vg_sysid;\n"
16468 " uint64_t vg_extent_size;\n"
16469 " int64_t vg_extent_count;\n"
16470 " int64_t vg_free_count;\n"
16471 " int64_t max_lv;\n"
16472 " int64_t max_pv;\n"
16473 " int64_t pv_count;\n"
16474 " int64_t lv_count;\n"
16475 " int64_t snap_count;\n"
16476 " int64_t vg_seqno;\n"
16477 " char *vg_tags;\n"
16478 " int64_t vg_mda_count;\n"
16479 " uint64_t vg_mda_free;\n"
16485 #: ../src/guestfs-structs.pod:69
16488 " struct guestfs_lvm_vg_list {\n"
16489 " uint32_t len; /* Number of elements in list. */\n"
16490 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16496 #: ../src/guestfs-structs.pod:74
16499 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16500 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16505 #: ../src/guestfs-structs.pod:77
16506 msgid "guestfs_lvm_lv"
16510 #: ../src/guestfs-structs.pod:79
16513 " struct guestfs_lvm_lv {\n"
16514 " char *lv_name;\n"
16515 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16516 " char lv_uuid[32];\n"
16517 " char *lv_attr;\n"
16518 " int64_t lv_major;\n"
16519 " int64_t lv_minor;\n"
16520 " int64_t lv_kernel_major;\n"
16521 " int64_t lv_kernel_minor;\n"
16522 " uint64_t lv_size;\n"
16523 " int64_t seg_count;\n"
16525 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16526 " float snap_percent;\n"
16527 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16528 " float copy_percent;\n"
16529 " char *move_pv;\n"
16530 " char *lv_tags;\n"
16531 " char *mirror_log;\n"
16532 " char *modules;\n"
16538 #: ../src/guestfs-structs.pod:101
16541 " struct guestfs_lvm_lv_list {\n"
16542 " uint32_t len; /* Number of elements in list. */\n"
16543 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16549 #: ../src/guestfs-structs.pod:106
16552 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16553 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16558 #: ../src/guestfs-structs.pod:111
16561 " struct guestfs_stat {\n"
16565 " int64_t nlink;\n"
16570 " int64_t blksize;\n"
16571 " int64_t blocks;\n"
16572 " int64_t atime;\n"
16573 " int64_t mtime;\n"
16574 " int64_t ctime;\n"
16580 #: ../src/guestfs-structs.pod:127
16583 " struct guestfs_stat_list {\n"
16584 " uint32_t len; /* Number of elements in list. */\n"
16585 " struct guestfs_stat *val; /* Elements. */\n"
16591 #: ../src/guestfs-structs.pod:132
16594 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16595 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16600 #: ../src/guestfs-structs.pod:137
16603 " struct guestfs_statvfs {\n"
16604 " int64_t bsize;\n"
16605 " int64_t frsize;\n"
16606 " int64_t blocks;\n"
16607 " int64_t bfree;\n"
16608 " int64_t bavail;\n"
16609 " int64_t files;\n"
16610 " int64_t ffree;\n"
16611 " int64_t favail;\n"
16614 " int64_t namemax;\n"
16620 #: ../src/guestfs-structs.pod:151
16623 " struct guestfs_statvfs_list {\n"
16624 " uint32_t len; /* Number of elements in list. */\n"
16625 " struct guestfs_statvfs *val; /* Elements. */\n"
16631 #: ../src/guestfs-structs.pod:156
16634 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16635 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16640 #: ../src/guestfs-structs.pod:159
16641 msgid "guestfs_dirent"
16645 #: ../src/guestfs-structs.pod:161
16648 " struct guestfs_dirent {\n"
16657 #: ../src/guestfs-structs.pod:167
16660 " struct guestfs_dirent_list {\n"
16661 " uint32_t len; /* Number of elements in list. */\n"
16662 " struct guestfs_dirent *val; /* Elements. */\n"
16668 #: ../src/guestfs-structs.pod:172
16671 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16672 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16677 #: ../src/guestfs-structs.pod:177
16680 " struct guestfs_version {\n"
16681 " int64_t major;\n"
16682 " int64_t minor;\n"
16683 " int64_t release;\n"
16690 #: ../src/guestfs-structs.pod:184
16693 " struct guestfs_version_list {\n"
16694 " uint32_t len; /* Number of elements in list. */\n"
16695 " struct guestfs_version *val; /* Elements. */\n"
16701 #: ../src/guestfs-structs.pod:189
16704 " void guestfs_free_version (struct guestfs_free_version *);\n"
16705 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16710 #: ../src/guestfs-structs.pod:192
16711 msgid "guestfs_xattr"
16715 #: ../src/guestfs-structs.pod:194
16718 " struct guestfs_xattr {\n"
16719 " char *attrname;\n"
16720 " /* The next two fields describe a byte array. */\n"
16721 " uint32_t attrval_len;\n"
16722 " char *attrval;\n"
16728 #: ../src/guestfs-structs.pod:201
16731 " struct guestfs_xattr_list {\n"
16732 " uint32_t len; /* Number of elements in list. */\n"
16733 " struct guestfs_xattr *val; /* Elements. */\n"
16739 #: ../src/guestfs-structs.pod:206
16742 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16743 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16748 #: ../src/guestfs-structs.pod:209
16749 msgid "guestfs_inotify_event"
16753 #: ../src/guestfs-structs.pod:211
16756 " struct guestfs_inotify_event {\n"
16757 " int64_t in_wd;\n"
16758 " uint32_t in_mask;\n"
16759 " uint32_t in_cookie;\n"
16760 " char *in_name;\n"
16766 #: ../src/guestfs-structs.pod:218
16769 " struct guestfs_inotify_event_list {\n"
16770 " uint32_t len; /* Number of elements in list. */\n"
16771 " struct guestfs_inotify_event *val; /* Elements. */\n"
16777 #: ../src/guestfs-structs.pod:223
16780 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16781 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
16786 #: ../src/guestfs-structs.pod:226
16787 msgid "guestfs_partition"
16791 #: ../src/guestfs-structs.pod:228
16794 " struct guestfs_partition {\n"
16795 " int32_t part_num;\n"
16796 " uint64_t part_start;\n"
16797 " uint64_t part_end;\n"
16798 " uint64_t part_size;\n"
16804 #: ../src/guestfs-structs.pod:235
16807 " struct guestfs_partition_list {\n"
16808 " uint32_t len; /* Number of elements in list. */\n"
16809 " struct guestfs_partition *val; /* Elements. */\n"
16815 #: ../src/guestfs-structs.pod:240
16818 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16819 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16824 #: ../src/guestfs-structs.pod:243
16825 msgid "guestfs_application"
16829 #: ../src/guestfs-structs.pod:245
16832 " struct guestfs_application {\n"
16833 " char *app_name;\n"
16834 " char *app_display_name;\n"
16835 " int32_t app_epoch;\n"
16836 " char *app_version;\n"
16837 " char *app_release;\n"
16838 " char *app_install_path;\n"
16839 " char *app_trans_path;\n"
16840 " char *app_publisher;\n"
16841 " char *app_url;\n"
16842 " char *app_source_package;\n"
16843 " char *app_summary;\n"
16844 " char *app_description;\n"
16850 #: ../src/guestfs-structs.pod:260
16853 " struct guestfs_application_list {\n"
16854 " uint32_t len; /* Number of elements in list. */\n"
16855 " struct guestfs_application *val; /* Elements. */\n"
16861 #: ../src/guestfs-structs.pod:265
16864 " void guestfs_free_application (struct guestfs_free_application *);\n"
16865 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
16870 #: ../fish/guestfish.pod:5
16871 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16875 #: ../fish/guestfish.pod:9
16878 " guestfish [--options] [commands]\n"
16883 #: ../fish/guestfish.pod:11
16891 #: ../fish/guestfish.pod:13
16894 " guestfish [--ro|--rw] -a disk.img\n"
16899 #: ../fish/guestfish.pod:15
16902 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16907 #: ../fish/guestfish.pod:17
16910 " guestfish -d libvirt-domain\n"
16915 #: ../fish/guestfish.pod:19
16918 " guestfish [--ro|--rw] -a disk.img -i\n"
16923 #: ../fish/guestfish.pod:21
16926 " guestfish -d libvirt-domain -i\n"
16931 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
16932 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
16933 #: ../tools/virt-rescue.pl:41
16938 #: ../fish/guestfish.pod:25
16940 "Using guestfish in read/write mode on live virtual machines can be "
16941 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16942 "option to use guestfish safely if the disk image or virtual machine might be "
16947 #: ../fish/guestfish.pod:32
16949 "Guestfish is a shell and command-line tool for examining and modifying "
16950 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16951 "functionality of the guestfs API, see L<guestfs(3)>."
16955 #: ../fish/guestfish.pod:36
16957 "Guestfish gives you structured access to the libguestfs API, from shell "
16958 "scripts or the command line or interactively. If you want to rescue a "
16959 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16964 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:846
16965 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
16966 #: ../tools/virt-resize.pl:66 ../tools/virt-tar.pl:45
16971 #: ../fish/guestfish.pod:43
16972 msgid "As an interactive shell"
16976 #: ../fish/guestfish.pod:45
16984 #: ../fish/guestfish.pod:47
16987 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16988 " editing virtual machine filesystems.\n"
16993 #: ../fish/guestfish.pod:50
16996 " Type: 'help' for a list of commands\n"
16997 " 'man' to read the manual\n"
16998 " 'quit' to quit the shell\n"
17003 #: ../fish/guestfish.pod:54
17006 " ><fs> add-ro disk.img\n"
17008 " ><fs> list-filesystems\n"
17009 " /dev/sda1: ext4\n"
17010 " /dev/vg_guest/lv_root: ext4\n"
17011 " /dev/vg_guest/lv_swap: swap\n"
17012 " ><fs> mount /dev/vg_guest/lv_root /\n"
17013 " ><fs> cat /etc/fstab\n"
17015 " # Created by anaconda\n"
17022 #: ../fish/guestfish.pod:67
17023 msgid "From shell scripts"
17027 #: ../fish/guestfish.pod:69
17028 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17032 #: ../fish/guestfish.pod:71
17035 " guestfish <<_EOF_\n"
17038 " mount /dev/vg_guest/lv_root /\n"
17039 " write /etc/motd \"Welcome, new users\"\n"
17045 #: ../fish/guestfish.pod:78
17046 msgid "List the LVM logical volumes in a disk image:"
17050 #: ../fish/guestfish.pod:80
17053 " guestfish -a disk.img --ro <<_EOF_\n"
17061 #: ../fish/guestfish.pod:85
17062 msgid "List all the filesystems in a disk image:"
17066 #: ../fish/guestfish.pod:87
17069 " guestfish -a disk.img --ro <<_EOF_\n"
17071 " list-filesystems\n"
17077 #: ../fish/guestfish.pod:92
17078 msgid "On one command line"
17082 #: ../fish/guestfish.pod:94
17083 msgid "Update C</etc/resolv.conf> in a guest:"
17087 #: ../fish/guestfish.pod:96
17091 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17092 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17097 #: ../fish/guestfish.pod:100
17098 msgid "Edit C</boot/grub/grub.conf> interactively:"
17102 #: ../fish/guestfish.pod:102
17105 " guestfish --rw --add disk.img \\\n"
17106 " --mount /dev/vg_guest/lv_root \\\n"
17107 " --mount /dev/sda1:/boot \\\n"
17108 " edit /boot/grub/grub.conf\n"
17113 #: ../fish/guestfish.pod:107
17114 msgid "Mount disks automatically"
17118 #: ../fish/guestfish.pod:109
17120 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17124 #: ../fish/guestfish.pod:112
17127 " guestfish --ro -a disk.img -i cat /etc/group\n"
17132 #: ../fish/guestfish.pod:114
17135 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17140 #: ../fish/guestfish.pod:116
17141 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17145 #: ../fish/guestfish.pod:118
17148 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17153 #: ../fish/guestfish.pod:120
17154 msgid "As a script interpreter"
17158 #: ../fish/guestfish.pod:122
17159 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17163 #: ../fish/guestfish.pod:124
17166 " #!/usr/bin/guestfish -f\n"
17167 " sparse test1.img 100M\n"
17169 " part-disk /dev/sda mbr\n"
17170 " mkfs ext2 /dev/sda1\n"
17175 #: ../fish/guestfish.pod:130
17176 msgid "Start with a prepared disk"
17180 #: ../fish/guestfish.pod:132
17182 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17183 "single ext2-formatted partition:"
17187 #: ../fish/guestfish.pod:135
17190 " guestfish -N fs\n"
17195 #: ../fish/guestfish.pod:137
17196 msgid "To list what is available do:"
17200 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:837
17203 " guestfish -N help | less\n"
17208 #: ../fish/guestfish.pod:141
17209 msgid "Remote control"
17213 #: ../fish/guestfish.pod:143
17216 " eval \"`guestfish --listen`\"\n"
17217 " guestfish --remote add-ro disk.img\n"
17218 " guestfish --remote run\n"
17219 " guestfish --remote lvs\n"
17224 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17225 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
17226 #: ../tools/virt-win-reg.pl:171 ../tools/virt-df.pl:71 ../tools/virt-ls.pl:78
17227 #: ../tools/virt-resize.pl:257 ../tools/virt-list-filesystems.pl:50
17228 #: ../tools/virt-tar.pl:98 ../tools/virt-rescue.pl:103
17229 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:51
17234 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17235 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179
17236 #: ../tools/virt-df.pl:79 ../tools/virt-ls.pl:86 ../tools/virt-resize.pl:265
17237 #: ../tools/virt-list-filesystems.pl:58 ../tools/virt-tar.pl:106
17238 #: ../tools/virt-rescue.pl:111 ../tools/virt-make-fs.pl:161
17239 #: ../tools/virt-list-partitions.pl:59
17244 #: ../fish/guestfish.pod:154
17245 msgid "Displays general help on options."
17249 #: ../fish/guestfish.pod:156
17250 msgid "B<-h> | B<--cmd-help>"
17254 #: ../fish/guestfish.pod:158
17255 msgid "Lists all available guestfish commands."
17259 #: ../fish/guestfish.pod:160
17260 msgid "B<-h cmd> | B<--cmd-help cmd>"
17264 #: ../fish/guestfish.pod:162
17265 msgid "Displays detailed help on a single command C<cmd>."
17269 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
17270 msgid "B<-a image> | B<--add image>"
17274 #: ../fish/guestfish.pod:166
17275 msgid "Add a block device or virtual machine image to the shell."
17279 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
17281 "The format of the disk image is auto-detected. To override this and force a "
17282 "particular format use the I<--format=..> option."
17286 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
17287 msgid "B<-c URI> | B<--connect URI>"
17291 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
17293 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17294 "URI to use. The default is to use the default libvirt connection."
17298 #: ../fish/guestfish.pod:177
17303 #: ../fish/guestfish.pod:179
17305 "If using the I<--listen> option and a csh-like shell, use this option. See "
17306 "section L</REMOTE CONTROL AND CSH> below."
17310 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
17311 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
17315 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
17317 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17318 "used, then any libvirt domain can be used. However in write mode, only "
17319 "libvirt domains which are shut down can be named here."
17323 #: ../fish/guestfish.pod:188
17324 msgid "B<-D> | B<--no-dest-paths>"
17328 #: ../fish/guestfish.pod:190
17330 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17331 "to hit the tab key to complete paths on the guest filesystem, but this "
17332 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17333 "allow this feature to be disabled."
17337 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
17338 msgid "B<--echo-keys>"
17342 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
17344 "When prompting for keys and passphrases, guestfish normally turns echoing "
17345 "off so you cannot see what you are typing. If you are not worried about "
17346 "Tempest attacks and there is no one else in the room you can specify this "
17347 "flag to see what you are typing."
17351 #: ../fish/guestfish.pod:202
17352 msgid "B<-f file> | B<--file file>"
17356 #: ../fish/guestfish.pod:204
17357 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17361 #: ../fish/guestfish.pod:207
17364 " #!/usr/bin/guestfish -f\n"
17369 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
17370 msgid "B<--format=raw|qcow2|..> | B<--format>"
17374 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17376 "The default for the I<-a> option is to auto-detect the format of the disk "
17377 "image. Using this forces the disk format for I<-a> options which follow on "
17378 "the command line. Using I<--format> with no argument switches back to auto-"
17379 "detection for subsequent I<-a> options."
17383 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:543
17384 msgid "For example:"
17388 #: ../fish/guestfish.pod:218
17391 " guestfish --format=raw -a disk.img\n"
17396 #: ../fish/guestfish.pod:220
17397 msgid "forces raw format (no auto-detection) for C<disk.img>."
17401 #: ../fish/guestfish.pod:222
17404 " guestfish --format=raw -a disk.img --format -a another.img\n"
17409 #: ../fish/guestfish.pod:224
17411 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17412 "detection for C<another.img>."
17416 #: ../fish/guestfish.pod:227
17418 "If you have untrusted raw-format guest disk images, you should use this "
17419 "option to specify the disk format. This avoids a possible security problem "
17420 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17424 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17425 msgid "B<-i> | B<--inspector>"
17429 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17431 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17432 "system and mount filesystems as they would be mounted on the real virtual "
17437 #: ../fish/guestfish.pod:238
17438 msgid "Typical usage is either:"
17442 #: ../fish/guestfish.pod:240
17445 " guestfish -d myguest -i\n"
17450 #: ../fish/guestfish.pod:242
17451 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17455 #: ../fish/guestfish.pod:244
17458 " guestfish --ro -d myguest -i\n"
17463 #: ../fish/guestfish.pod:246
17464 msgid "(for active domains, readonly), or specify the block device directly:"
17468 #: ../fish/guestfish.pod:248
17471 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17476 #: ../fish/guestfish.pod:250
17478 "Note that the command line syntax changed slightly over older versions of "
17479 "guestfish. You can still use the old syntax:"
17483 #: ../fish/guestfish.pod:253
17486 " guestfish [--ro] -i disk.img\n"
17491 #: ../fish/guestfish.pod:255
17494 " guestfish [--ro] -i libvirt-domain\n"
17499 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17500 msgid "B<--keys-from-stdin>"
17504 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17506 "Read key or passphrase parameters from stdin. The default is to try to read "
17507 "passphrases from the user by opening C</dev/tty>."
17511 #: ../fish/guestfish.pod:262
17512 msgid "B<--listen>"
17516 #: ../fish/guestfish.pod:264
17518 "Fork into the background and listen for remote commands. See section L</"
17519 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17523 #: ../fish/guestfish.pod:267
17524 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17528 #: ../fish/guestfish.pod:269
17529 msgid "Mount the named partition or logical volume on the given mountpoint."
17533 #: ../fish/guestfish.pod:271
17534 msgid "If the mountpoint is omitted, it defaults to C</>."
17538 #: ../fish/guestfish.pod:273
17539 msgid "You have to mount something on C</> before most commands will work."
17543 #: ../fish/guestfish.pod:275
17545 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17550 #: ../fish/guestfish.pod:278
17552 "If you don't know what filesystems a disk image contains, you can either run "
17553 "guestfish without this option, then list the partitions and LVs available "
17554 "(see L</list-partitions> and L</lvs> commands), or you can use the L<virt-"
17555 "list-filesystems(1)> program."
17559 #: ../fish/guestfish.pod:283 ../fuse/guestmount.pod:154
17560 msgid "B<-n> | B<--no-sync>"
17564 #: ../fish/guestfish.pod:285
17566 "Disable autosync. This is enabled by default. See the discussion of "
17567 "autosync in the L<guestfs(3)> manpage."
17571 #: ../fish/guestfish.pod:288
17572 msgid "B<-N type> | B<--new type> | B<-N help>"
17576 #: ../fish/guestfish.pod:290
17578 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17579 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17580 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17585 #: ../fish/guestfish.pod:295
17586 msgid "B<--progress-bars>"
17590 #: ../fish/guestfish.pod:297
17591 msgid "Enable progress bars, even when guestfish is used non-interactively."
17595 #: ../fish/guestfish.pod:299
17597 "Progress bars are enabled by default when guestfish is used as an "
17598 "interactive shell."
17602 #: ../fish/guestfish.pod:302
17603 msgid "B<--no-progress-bars>"
17607 #: ../fish/guestfish.pod:304
17608 msgid "Disable progress bars."
17612 #: ../fish/guestfish.pod:306
17613 msgid "B<--remote[=pid]>"
17617 #: ../fish/guestfish.pod:308
17619 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17620 "CONTROL GUESTFISH OVER A SOCKET> below."
17624 #: ../fish/guestfish.pod:311 ../fuse/guestmount.pod:196
17625 msgid "B<-r> | B<--ro>"
17629 #: ../fish/guestfish.pod:313
17631 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17632 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17636 #: ../fish/guestfish.pod:316 ../tools/virt-rescue.pl:187
17638 "The option must always be used if the disk image or virtual machine might be "
17639 "running, and is generally recommended in cases where you don't need write "
17640 "access to the disk."
17644 #: ../fish/guestfish.pod:320
17646 "Note that prepared disk images created with I<-N> are not affected by the "
17651 #: ../fish/guestfish.pod:323
17652 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17656 #: ../fish/guestfish.pod:325 ../fuse/guestmount.pod:208
17657 #: ../tools/virt-rescue.pl:195
17658 msgid "B<--selinux>"
17662 #: ../fish/guestfish.pod:327
17663 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17667 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:212
17668 msgid "B<-v> | B<--verbose>"
17672 #: ../fish/guestfish.pod:331
17674 "Enable very verbose messages. This is particularly useful if you find a bug."
17678 #: ../fish/guestfish.pod:334 ../fuse/guestmount.pod:216
17679 msgid "B<-V> | B<--version>"
17683 #: ../fish/guestfish.pod:336
17684 msgid "Display the guestfish / libguestfs version number and exit."
17688 #: ../fish/guestfish.pod:338 ../fuse/guestmount.pod:220
17689 msgid "B<-w> | B<--rw>"
17693 #: ../fish/guestfish.pod:340
17695 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17700 #: ../fish/guestfish.pod:343
17705 #: ../fish/guestfish.pod:345
17706 msgid "Echo each command before executing it."
17710 #: ../fish/guestfish.pod:349
17711 msgid "COMMANDS ON COMMAND LINE"
17715 #: ../fish/guestfish.pod:351
17717 "Any additional (non-option) arguments are treated as commands to execute."
17721 #: ../fish/guestfish.pod:354
17723 "Commands to execute should be separated by a colon (C<:>), where the colon "
17724 "is a separate parameter. Thus:"
17728 #: ../fish/guestfish.pod:357
17731 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17736 #: ../fish/guestfish.pod:359
17738 "If there are no additional arguments, then we enter a shell, either an "
17739 "interactive shell with a prompt (if the input is a terminal) or a non-"
17740 "interactive shell."
17744 #: ../fish/guestfish.pod:363
17746 "In either command line mode or non-interactive shell, the first command that "
17747 "gives an error causes the whole shell to exit. In interactive mode (with a "
17748 "prompt) if a command fails, you can continue to enter commands."
17752 #: ../fish/guestfish.pod:368
17753 msgid "USING launch (OR run)"
17757 #: ../fish/guestfish.pod:370
17759 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17760 "then launch it, then mount any disks you need, and finally issue actions/"
17761 "commands. So the general order of the day is:"
17765 #: ../fish/guestfish.pod:378
17766 msgid "add or -a/--add"
17770 #: ../fish/guestfish.pod:382
17771 msgid "launch (aka run)"
17775 #: ../fish/guestfish.pod:386
17776 msgid "mount or -m/--mount"
17780 #: ../fish/guestfish.pod:390
17781 msgid "any other commands"
17785 #: ../fish/guestfish.pod:394
17787 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17788 "guest before mounting or performing any other commands."
17792 #: ../fish/guestfish.pod:397
17794 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17795 "I<--new> options were given then C<run> is done automatically, simply "
17796 "because guestfish can't perform the action you asked for without doing this."
17800 #: ../fish/guestfish.pod:402
17801 msgid "OPENING DISKS FOR READ AND WRITE"
17805 #: ../fish/guestfish.pod:404
17807 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17808 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17809 "open disk images read-only or for writing."
17813 #: ../fish/guestfish.pod:408
17815 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17816 "disk images supplied on the command line for write. To open a disk image "
17817 "read-only you have to do I<-a image --ro>."
17821 #: ../fish/guestfish.pod:412
17823 "This matters: If you accidentally open a live VM disk image writable then "
17824 "you will cause irreversible disk corruption."
17828 #: ../fish/guestfish.pod:415
17830 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17831 "images will be opened read-only. You will have to either specify "
17832 "I<guestfish --rw> or change a configuration file in order to get write "
17833 "access for disk images specified by those other command line options."
17837 #: ../fish/guestfish.pod:420
17839 "This version of guestfish has a I<--rw> option which does nothing (it is "
17840 "already the default). However it is highly recommended that you use this "
17841 "option to indicate that guestfish needs write access, and to prepare your "
17842 "scripts for the day when this option will be required for write access."
17846 #: ../fish/guestfish.pod:426
17848 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17849 "other libguestfs program apart from guestfish and guestmount."
17853 #: ../fish/guestfish.pod:429
17858 #: ../fish/guestfish.pod:431
17860 "You can quote ordinary parameters using either single or double quotes. For "
17865 #: ../fish/guestfish.pod:434
17868 " add \"file with a space.img\"\n"
17873 #: ../fish/guestfish.pod:436
17876 " rm '/file name'\n"
17881 #: ../fish/guestfish.pod:438
17889 #: ../fish/guestfish.pod:440
17891 "A few commands require a list of strings to be passed. For these, use a "
17892 "whitespace-separated list, enclosed in quotes. Strings containing "
17893 "whitespace to be passed through must be enclosed in single quotes. A "
17894 "literal single quote must be escaped with a backslash."
17898 #: ../fish/guestfish.pod:445
17901 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17902 " command \"/bin/echo 'foo bar'\"\n"
17903 " command \"/bin/echo \\'foo\\'\"\n"
17908 #: ../fish/guestfish.pod:449
17909 msgid "OPTIONAL ARGUMENTS"
17913 #: ../fish/guestfish.pod:451
17915 "Some commands take optional arguments. These arguments appear in this "
17916 "documentation as C<[argname:..]>. You can use them as in these examples:"
17920 #: ../fish/guestfish.pod:455
17923 " add-drive-opts filename\n"
17928 #: ../fish/guestfish.pod:457
17931 " add-drive-opts filename readonly:true\n"
17936 #: ../fish/guestfish.pod:459
17939 " add-drive-opts filename format:qcow2 readonly:false\n"
17944 #: ../fish/guestfish.pod:461
17946 "Each optional argument can appear at most once. All optional arguments must "
17947 "appear after the required ones."
17951 #: ../fish/guestfish.pod:464
17956 #: ../fish/guestfish.pod:466
17958 "This section applies to all commands which can take integers as parameters."
17962 #: ../fish/guestfish.pod:469
17963 msgid "SIZE SUFFIX"
17967 #: ../fish/guestfish.pod:471
17969 "When the command takes a parameter measured in bytes, you can use one of the "
17970 "following suffixes to specify kilobytes, megabytes and larger sizes:"
17974 #: ../fish/guestfish.pod:477
17975 msgid "B<k> or B<K> or B<KiB>"
17979 #: ../fish/guestfish.pod:479
17980 msgid "The size in kilobytes (multiplied by 1024)."
17984 #: ../fish/guestfish.pod:481
17989 #: ../fish/guestfish.pod:483
17990 msgid "The size in SI 1000 byte units."
17994 #: ../fish/guestfish.pod:485
17995 msgid "B<M> or B<MiB>"
17999 #: ../fish/guestfish.pod:487
18000 msgid "The size in megabytes (multiplied by 1048576)."
18004 #: ../fish/guestfish.pod:489
18009 #: ../fish/guestfish.pod:491
18010 msgid "The size in SI 1000000 byte units."
18014 #: ../fish/guestfish.pod:493
18015 msgid "B<G> or B<GiB>"
18019 #: ../fish/guestfish.pod:495
18020 msgid "The size in gigabytes (multiplied by 2**30)."
18024 #: ../fish/guestfish.pod:497
18029 #: ../fish/guestfish.pod:499
18030 msgid "The size in SI 10**9 byte units."
18034 #: ../fish/guestfish.pod:501
18035 msgid "B<T> or B<TiB>"
18039 #: ../fish/guestfish.pod:503
18040 msgid "The size in terabytes (multiplied by 2**40)."
18044 #: ../fish/guestfish.pod:505
18049 #: ../fish/guestfish.pod:507
18050 msgid "The size in SI 10**12 byte units."
18054 #: ../fish/guestfish.pod:509
18055 msgid "B<P> or B<PiB>"
18059 #: ../fish/guestfish.pod:511
18060 msgid "The size in petabytes (multiplied by 2**50)."
18064 #: ../fish/guestfish.pod:513
18069 #: ../fish/guestfish.pod:515
18070 msgid "The size in SI 10**15 byte units."
18074 #: ../fish/guestfish.pod:517
18075 msgid "B<E> or B<EiB>"
18079 #: ../fish/guestfish.pod:519
18080 msgid "The size in exabytes (multiplied by 2**60)."
18084 #: ../fish/guestfish.pod:521
18089 #: ../fish/guestfish.pod:523
18090 msgid "The size in SI 10**18 byte units."
18094 #: ../fish/guestfish.pod:525
18095 msgid "B<Z> or B<ZiB>"
18099 #: ../fish/guestfish.pod:527
18100 msgid "The size in zettabytes (multiplied by 2**70)."
18104 #: ../fish/guestfish.pod:529
18109 #: ../fish/guestfish.pod:531
18110 msgid "The size in SI 10**21 byte units."
18114 #: ../fish/guestfish.pod:533
18115 msgid "B<Y> or B<YiB>"
18119 #: ../fish/guestfish.pod:535
18120 msgid "The size in yottabytes (multiplied by 2**80)."
18124 #: ../fish/guestfish.pod:537
18129 #: ../fish/guestfish.pod:539
18130 msgid "The size in SI 10**24 byte units."
18134 #: ../fish/guestfish.pod:545
18137 " truncate-size /file 1G\n"
18142 #: ../fish/guestfish.pod:547
18143 msgid "would truncate the file to 1 gigabyte."
18147 #: ../fish/guestfish.pod:549
18149 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18150 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18151 "suffix will probably not do what you expect."
18155 #: ../fish/guestfish.pod:553
18156 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18160 #: ../fish/guestfish.pod:555
18162 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18163 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18167 #: ../fish/guestfish.pod:558
18170 " 1234 decimal number 1234\n"
18171 " 02322 octal number, equivalent to decimal 1234\n"
18172 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18177 #: ../fish/guestfish.pod:562
18179 "When using the C<chmod> command, you almost always want to specify an octal "
18180 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18181 "L<chmod(1)> program):"
18185 #: ../fish/guestfish.pod:566
18188 " chmod 0777 /public # OK\n"
18189 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18194 #: ../fish/guestfish.pod:569
18196 "Commands that return numbers usually print them in decimal, but some "
18197 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18198 "octal, preceeded by C<0>)."
18202 #: ../fish/guestfish.pod:573
18203 msgid "WILDCARDS AND GLOBBING"
18207 #: ../fish/guestfish.pod:575
18209 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18210 "(globbing) by default. So for example the following will not do what you "
18215 #: ../fish/guestfish.pod:579
18223 #: ../fish/guestfish.pod:581
18225 "Assuming you don't have a directory called literally C</home/*> then the "
18226 "above command will return an error."
18230 #: ../fish/guestfish.pod:584
18231 msgid "To perform wildcard expansion, use the C<glob> command."
18235 #: ../fish/guestfish.pod:586
18238 " glob rm-rf /home/*\n"
18243 #: ../fish/guestfish.pod:588
18245 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18246 "many times), equivalent to:"
18250 #: ../fish/guestfish.pod:591
18253 " rm-rf /home/jim\n"
18254 " rm-rf /home/joe\n"
18255 " rm-rf /home/mary\n"
18260 #: ../fish/guestfish.pod:595
18261 msgid "C<glob> only works on simple guest paths and not on device names."
18265 #: ../fish/guestfish.pod:597
18267 "If you have several parameters, each containing a wildcard, then glob will "
18268 "perform a Cartesian product."
18272 #: ../fish/guestfish.pod:600
18277 #: ../fish/guestfish.pod:602
18279 "Any line which starts with a I<#> character is treated as a comment and "
18280 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18281 "a command. For example:"
18285 #: ../fish/guestfish.pod:606
18288 " # this is a comment\n"
18289 " # this is a comment\n"
18290 " foo # NOT a comment\n"
18295 #: ../fish/guestfish.pod:610
18296 msgid "Blank lines are also ignored."
18300 #: ../fish/guestfish.pod:612
18301 msgid "RUNNING COMMANDS LOCALLY"
18305 #: ../fish/guestfish.pod:614
18307 "Any line which starts with a I<!> character is treated as a command sent to "
18308 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18312 #: ../fish/guestfish.pod:618
18316 " tgz-out /remote local/remote-data.tar.gz\n"
18321 #: ../fish/guestfish.pod:621
18323 "will create a directory C<local> on the host, and then export the contents "
18324 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18325 "(See C<tgz-out>)."
18329 #: ../fish/guestfish.pod:625
18331 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18332 "effect, due to the way that subprocesses work in Unix."
18336 #: ../fish/guestfish.pod:628
18341 #: ../fish/guestfish.pod:630
18343 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18344 "command (a guestfish command) to the second command (any host command). For "
18349 #: ../fish/guestfish.pod:634
18352 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18357 #: ../fish/guestfish.pod:636
18359 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18360 "program). The above command would list all accounts in the guest filesystem "
18361 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18365 #: ../fish/guestfish.pod:641
18368 " hexdump /bin/ls | head\n"
18369 " list-devices | tail -1\n"
18370 " tgz-out / - | tar ztf -\n"
18375 #: ../fish/guestfish.pod:645
18377 "The space before the pipe symbol is required, any space after the pipe "
18378 "symbol is optional. Everything after the pipe symbol is just passed "
18379 "straight to the host shell, so it can contain redirections, globs and "
18380 "anything else that makes sense on the host side."
18384 #: ../fish/guestfish.pod:650
18386 "To use a literal argument which begins with a pipe symbol, you have to quote "
18391 #: ../fish/guestfish.pod:653
18399 #: ../fish/guestfish.pod:655
18400 msgid "HOME DIRECTORIES"
18404 #: ../fish/guestfish.pod:657
18406 "If a parameter starts with the character C<~> then the tilde may be expanded "
18407 "as a home directory path (either C<~> for the current user's home directory, "
18408 "or C<~user> for another user)."
18412 #: ../fish/guestfish.pod:661
18414 "Note that home directory expansion happens for users known I<on the host>, "
18415 "not in the guest filesystem."
18419 #: ../fish/guestfish.pod:664
18421 "To use a literal argument which begins with a tilde, you have to quote it, "
18426 #: ../fish/guestfish.pod:667
18434 #: ../fish/guestfish.pod:671
18436 "Libguestfs has some support for Linux guests encrypted according to the "
18437 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18438 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18439 "LUKS is supported."
18443 #: ../fish/guestfish.pod:676
18444 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18448 #: ../fish/guestfish.pod:678
18451 " ><fs> vfs-type /dev/sda2\n"
18457 #: ../fish/guestfish.pod:681
18459 "Then open those devices using L</luks-open>. This creates a device-mapper "
18460 "device called C</dev/mapper/luksdev>."
18464 #: ../fish/guestfish.pod:684
18467 " ><fs> luks-open /dev/sda2 luksdev\n"
18468 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18473 #: ../fish/guestfish.pod:687
18475 "Finally you have to tell LVM to scan for volume groups on the newly created "
18480 #: ../fish/guestfish.pod:690
18484 " vg-activate-all true\n"
18489 #: ../fish/guestfish.pod:693
18490 msgid "The logical volume(s) can now be mounted in the usual way."
18494 #: ../fish/guestfish.pod:695
18496 "Before closing a LUKS device you must unmount any logical volumes on it and "
18497 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18498 "one. Then you can close the mapper device:"
18502 #: ../fish/guestfish.pod:699
18505 " vg-activate false /dev/VG\n"
18506 " luks-close /dev/mapper/luksdev\n"
18511 #: ../fish/guestfish.pod:702
18512 msgid "WINDOWS PATHS"
18516 #: ../fish/guestfish.pod:704
18518 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18519 "(with some limitations). The following commands are equivalent:"
18523 #: ../fish/guestfish.pod:707
18526 " file /WINDOWS/system32/config/system.LOG\n"
18531 #: ../fish/guestfish.pod:709
18534 " file win:/windows/system32/config/system.log\n"
18539 #: ../fish/guestfish.pod:711
18542 " file win:\\windows\\system32\\config\\system.log\n"
18547 #: ../fish/guestfish.pod:713
18550 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18555 #: ../fish/guestfish.pod:715
18557 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18558 "handles case insensitivity like Windows would. This only works in argument "
18559 "positions that expect a path."
18563 #: ../fish/guestfish.pod:719
18564 msgid "UPLOADING AND DOWNLOADING FILES"
18568 #: ../fish/guestfish.pod:721
18570 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18571 "others which upload from or download to a local file, you can use the "
18572 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18576 #: ../fish/guestfish.pod:725
18584 #: ../fish/guestfish.pod:727
18586 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18590 #: ../fish/guestfish.pod:730
18593 " tar-out /etc - | tar tf -\n"
18598 #: ../fish/guestfish.pod:732
18600 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18601 "command (see L</PIPES>)."
18605 #: ../fish/guestfish.pod:735
18607 "When using C<-> to read from stdin, the input is read up to the end of "
18608 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18609 "some arbitrary end marker:"
18613 #: ../fish/guestfish.pod:739
18616 " upload -<<END /foo\n"
18625 #: ../fish/guestfish.pod:745
18627 "Any string of characters can be used instead of C<END>. The end marker must "
18628 "appear on a line of its own, without any preceeding or following characters "
18629 "(not even spaces)."
18633 #: ../fish/guestfish.pod:749
18635 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18636 "upload local files (so-called \"FileIn\" parameters in the generator)."
18640 #: ../fish/guestfish.pod:752
18641 msgid "EXIT ON ERROR BEHAVIOUR"
18645 #: ../fish/guestfish.pod:754
18647 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18648 "taking commands from a human over a tty), and will exit on the first error "
18649 "in non-interactive mode (scripts, commands given on the command line)."
18653 #: ../fish/guestfish.pod:759
18655 "If you prefix a command with a I<-> character, then that command will not "
18656 "cause guestfish to exit, even if that (one) command returns an error."
18660 #: ../fish/guestfish.pod:763
18661 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18665 #: ../fish/guestfish.pod:765
18667 "Guestfish can be remote-controlled over a socket. This is useful "
18668 "particularly in shell scripts where you want to make several different "
18669 "changes to a filesystem, but you don't want the overhead of starting up a "
18670 "guestfish process each time."
18674 #: ../fish/guestfish.pod:770
18675 msgid "Start a guestfish server process using:"
18679 #: ../fish/guestfish.pod:772
18682 " eval \"`guestfish --listen`\"\n"
18687 #: ../fish/guestfish.pod:774
18688 msgid "and then send it commands by doing:"
18692 #: ../fish/guestfish.pod:776
18695 " guestfish --remote cmd [...]\n"
18700 #: ../fish/guestfish.pod:778
18701 msgid "To cause the server to exit, send it the exit command:"
18705 #: ../fish/guestfish.pod:780
18708 " guestfish --remote exit\n"
18713 #: ../fish/guestfish.pod:782
18715 "Note that the server will normally exit if there is an error in a command. "
18716 "You can change this in the usual way. See section L</EXIT ON ERROR "
18721 #: ../fish/guestfish.pod:786
18722 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18726 #: ../fish/guestfish.pod:788
18728 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18729 "is how the I<--remote> option knows where to send the commands. You can "
18730 "have several guestfish listener processes running using:"
18734 #: ../fish/guestfish.pod:792
18737 " eval \"`guestfish --listen`\"\n"
18738 " pid1=$GUESTFISH_PID\n"
18739 " eval \"`guestfish --listen`\"\n"
18740 " pid2=$GUESTFISH_PID\n"
18742 " guestfish --remote=$pid1 cmd\n"
18743 " guestfish --remote=$pid2 cmd\n"
18748 #: ../fish/guestfish.pod:800
18749 msgid "REMOTE CONTROL AND CSH"
18753 #: ../fish/guestfish.pod:802
18755 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18760 #: ../fish/guestfish.pod:805
18763 " eval \"`guestfish --listen --csh`\"\n"
18768 #: ../fish/guestfish.pod:807
18769 msgid "REMOTE CONTROL DETAILS"
18773 #: ../fish/guestfish.pod:809
18775 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18776 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18777 "and C<$PID> is the process ID of the server."
18781 #: ../fish/guestfish.pod:813
18782 msgid "Guestfish client and server versions must match exactly."
18786 #: ../fish/guestfish.pod:815
18787 msgid "PREPARED DISK IMAGES"
18791 #: ../fish/guestfish.pod:817
18793 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18794 "preformatted disk images that guestfish can make for you to save typing. "
18795 "This is particularly useful for testing purposes. This option is used "
18796 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18797 "can be mixed with I<-a>)."
18801 #: ../fish/guestfish.pod:823
18803 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18804 "the second and so on. Existing files in the current directory are "
18809 #: ../fish/guestfish.pod:827
18811 "The type briefly describes how the disk should be sized, partitioned, how "
18812 "filesystem(s) should be created, and how content should be added. "
18813 "Optionally the type can be followed by extra parameters, separated by C<:> "
18814 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18815 "allocated disk, containing a single partition, with the partition formatted "
18816 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18821 #: ../fish/guestfish.pod:835
18822 msgid "To list the available types and any extra parameters they take, run:"
18826 #: ../fish/guestfish.pod:839
18828 "Note that the prepared filesystem is not mounted. You would usually have to "
18829 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18833 #: ../fish/guestfish.pod:843
18835 "If any I<-N> or I<--new> options are given, the guest is automatically "
18840 #: ../fish/guestfish.pod:848
18841 msgid "Create a 100MB disk with an ext4-formatted partition:"
18845 #: ../fish/guestfish.pod:850
18848 " guestfish -N fs:ext4\n"
18853 #: ../fish/guestfish.pod:852
18854 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18858 #: ../fish/guestfish.pod:854
18861 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18866 #: ../fish/guestfish.pod:856
18867 msgid "Create a blank 200MB disk:"
18871 #: ../fish/guestfish.pod:858
18874 " guestfish -N disk:200M\n"
18879 #: ../fish/guestfish.pod:860
18880 msgid "PROGRESS BARS"
18884 #: ../fish/guestfish.pod:862
18886 "Some (not all) long-running commands send progress notification messages as "
18887 "they are running. Guestfish turns these messages into progress bars."
18891 #: ../fish/guestfish.pod:866
18893 "When a command that supports progress bars takes longer than two seconds to "
18894 "run, and if progress bars are enabled, then you will see one appearing below "
18899 #: ../fish/guestfish.pod:870
18902 " ><fs> copy-size /large-file /another-file 2048M\n"
18903 " / 10% [#####-----------------------------------------] 00:30\n"
18908 #: ../fish/guestfish.pod:873
18910 "The spinner on the left hand side moves round once for every progress "
18911 "notification received from the backend. This is a (reasonably) golden "
18912 "assurance that the command is \"doing something\" even if the progress bar "
18913 "is not moving, because the command is able to send the progress "
18914 "notifications. When the bar reaches 100% and the command finishes, the "
18915 "spinner disappears."
18919 #: ../fish/guestfish.pod:880
18921 "Progress bars are enabled by default when guestfish is used interactively. "
18922 "You can enable them even for non-interactive modes using I<--progress-bars>, "
18923 "and you can disable them completely using I<--no-progress-bars>."
18927 #: ../fish/guestfish.pod:885
18928 msgid "GUESTFISH COMMANDS"
18932 #: ../fish/guestfish.pod:887
18934 "The commands in this section are guestfish convenience commands, in other "
18935 "words, they are not part of the L<guestfs(3)> API."
18939 #: ../fish/guestfish.pod:890
18944 #: ../fish/guestfish.pod:892
18953 #: ../fish/guestfish.pod:895
18954 msgid "Without any parameter, this provides general help."
18958 #: ../fish/guestfish.pod:897
18959 msgid "With a C<cmd> parameter, this displays detailed help for that command."
18963 #: ../fish/guestfish.pod:899
18964 msgid "quit | exit"
18968 #: ../fish/guestfish.pod:901
18969 msgid "This exits guestfish. You can also use C<^D> key."
18973 #: ../fish/guestfish.pod:903
18974 msgid "@FISH_COMMANDS@"
18978 #: ../fish/guestfish.pod:905
18983 #: ../fish/guestfish.pod:909 ../test-tool/libguestfs-test-tool.pod:83
18988 #: ../fish/guestfish.pod:911
18990 "guestfish returns 0 if the commands completed without error, or 1 if there "
18995 #: ../fish/guestfish.pod:918
19000 #: ../fish/guestfish.pod:920
19002 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19007 #: ../fish/guestfish.pod:923
19008 msgid "GUESTFISH_PID"
19012 #: ../fish/guestfish.pod:925
19014 "Used with the I<--remote> option to specify the remote guestfish process to "
19015 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19019 #: ../fish/guestfish.pod:929
19024 #: ../fish/guestfish.pod:931
19026 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19027 "not specified, the external L<hexedit(1)> program is used."
19031 #: ../fish/guestfish.pod:935
19036 #: ../fish/guestfish.pod:937
19038 "If compiled with GNU readline support, various files in the home directory "
19039 "can be used. See L</FILES>."
19043 #: ../fish/guestfish.pod:946
19045 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19046 "effect as using the B<-v> option."
19050 #: ../fish/guestfish.pod:958
19052 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19053 "the discussion of paths in L<guestfs(3)>."
19057 #: ../fish/guestfish.pod:969
19058 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19062 #: ../fish/guestfish.pod:971
19067 #: ../fish/guestfish.pod:973
19069 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19074 #: ../fish/guestfish.pod:988 ../test-tool/libguestfs-test-tool.pod:88
19079 #: ../fish/guestfish.pod:992
19080 msgid "$HOME/.guestfish"
19084 #: ../fish/guestfish.pod:994
19086 "If compiled with GNU readline support, then the command history is saved in "
19091 #: ../fish/guestfish.pod:997
19092 msgid "$HOME/.inputrc"
19096 #: ../fish/guestfish.pod:999
19097 msgid "/etc/inputrc"
19101 #: ../fish/guestfish.pod:1001
19103 "If compiled with GNU readline support, then these files can be used to "
19104 "configure readline. For further information, please see L<readline(3)/"
19105 "INITIALIZATION FILE>."
19109 #: ../fish/guestfish.pod:1005
19110 msgid "To write rules which only apply to guestfish, use:"
19114 #: ../fish/guestfish.pod:1007
19124 #: ../fish/guestfish.pod:1011
19126 "Variables that you can set in inputrc that change the behaviour of guestfish "
19127 "in useful ways include:"
19131 #: ../fish/guestfish.pod:1016
19132 msgid "completion-ignore-case (default: on)"
19136 #: ../fish/guestfish.pod:1018
19138 "By default, guestfish will ignore case when tab-completing paths on the "
19143 #: ../fish/guestfish.pod:1021
19146 " set completion-ignore-case off\n"
19151 #: ../fish/guestfish.pod:1023
19152 msgid "to make guestfish case sensitive."
19156 #: ../fish/guestfish.pod:1027
19161 #: ../fish/guestfish.pod:1029
19162 msgid "test2.img (etc)"
19166 #: ../fish/guestfish.pod:1031
19168 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19169 "will be created in the file C<test1.img> in the current directory. The "
19170 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19171 "the same name will be overwritten."
19175 #: ../fish/guestfish.pod:1040
19177 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19178 "L<virt-edit(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, "
19179 "L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19180 "L<virt-tar(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
19184 #: ../fish/guestfish.pod:1064 ../test-tool/libguestfs-test-tool.pod:124
19185 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370
19186 #: ../tools/virt-win-reg.pl:518 ../tools/virt-df.pl:657
19187 #: ../tools/virt-ls.pl:251 ../tools/virt-resize.pl:1516
19188 #: ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:300
19189 #: ../tools/virt-rescue.pl:285 ../tools/virt-make-fs.pl:567
19190 #: ../tools/virt-list-partitions.pl:273
19192 "This program is free software; you can redistribute it and/or modify it "
19193 "under the terms of the GNU General Public License as published by the Free "
19194 "Software Foundation; either version 2 of the License, or (at your option) "
19195 "any later version."
19199 #: ../fish/guestfish.pod:1069 ../test-tool/libguestfs-test-tool.pod:129
19200 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375
19201 #: ../tools/virt-win-reg.pl:523 ../tools/virt-df.pl:662
19202 #: ../tools/virt-ls.pl:256 ../tools/virt-resize.pl:1521
19203 #: ../tools/virt-list-filesystems.pl:211 ../tools/virt-tar.pl:305
19204 #: ../tools/virt-rescue.pl:290 ../tools/virt-make-fs.pl:572
19205 #: ../tools/virt-list-partitions.pl:278
19207 "This program is distributed in the hope that it will be useful, but WITHOUT "
19208 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19209 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19214 #: ../fish/guestfish.pod:1074 ../test-tool/libguestfs-test-tool.pod:134
19215 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380
19216 #: ../tools/virt-win-reg.pl:528 ../tools/virt-df.pl:667
19217 #: ../tools/virt-ls.pl:261 ../tools/virt-resize.pl:1526
19218 #: ../tools/virt-list-filesystems.pl:216 ../tools/virt-tar.pl:310
19219 #: ../tools/virt-rescue.pl:295 ../tools/virt-make-fs.pl:577
19220 #: ../tools/virt-list-partitions.pl:283
19222 "You should have received a copy of the GNU General Public License along with "
19223 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19224 "Ave, Cambridge, MA 02139, USA."
19228 #: ../fish/guestfish-actions.pod:1
19233 #: ../fish/guestfish-actions.pod:3
19236 " add-cdrom filename\n"
19241 #: ../fish/guestfish-actions.pod:15
19243 "This call checks for the existence of C<filename>. This stops you from "
19244 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19245 "and C<http:> URLs. To specify those, use the general L</config> call "
19250 #: ../fish/guestfish-actions.pod:22
19252 "If you just want to add an ISO file (often you use this as an efficient way "
19253 "to transfer large files into the guest), then you should probably use L</add-"
19254 "drive-ro> instead."
19258 #: ../fish/guestfish-actions.pod:35
19263 #: ../fish/guestfish-actions.pod:37
19268 #: ../fish/guestfish-actions.pod:39
19271 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19276 #: ../fish/guestfish-actions.pod:41
19278 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19279 "It works by connecting to libvirt, requesting the domain and domain XML from "
19280 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19284 #: ../fish/guestfish-actions.pod:58
19286 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19287 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19288 "libvirt URI (or one set through an environment variable, see the libvirt "
19289 "documentation for full details). If you are using the C API directly then "
19290 "it is more flexible to create the libvirt connection object yourself, get "
19291 "the domain object, and call L</add-libvirt-dom>."
19295 #: ../fish/guestfish-actions.pod:66
19297 "The other optional parameters are passed directly through to L</add-drive-"
19302 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19304 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19308 #: ../fish/guestfish-actions.pod:71
19313 #: ../fish/guestfish-actions.pod:73
19316 " add-drive filename\n"
19321 #: ../fish/guestfish-actions.pod:75
19323 "This function is the equivalent of calling L</add-drive-opts> with no "
19324 "optional parameters, so the disk is added writable, with the format being "
19325 "detected automatically."
19329 #: ../fish/guestfish-actions.pod:79
19331 "Automatic detection of the format opens you up to a potential security hole "
19332 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19333 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19334 "you should think about replacing calls to this function with calls to L</add-"
19335 "drive-opts>, and specifying the format."
19339 #: ../fish/guestfish-actions.pod:86
19340 msgid "add-drive-opts"
19344 #: ../fish/guestfish-actions.pod:88
19349 #: ../fish/guestfish-actions.pod:90
19352 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19357 #: ../fish/guestfish-actions.pod:117
19359 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19360 "add-drive-ro>) then the format is automatically detected. Possible formats "
19361 "include C<raw> and C<qcow2>."
19365 #: ../fish/guestfish-actions.pod:128
19367 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19368 "add-drive-with-if> call (q.v.)"
19372 #: ../fish/guestfish-actions.pod:135
19373 msgid "add-drive-ro"
19377 #: ../fish/guestfish-actions.pod:137
19382 #: ../fish/guestfish-actions.pod:139
19385 " add-drive-ro filename\n"
19390 #: ../fish/guestfish-actions.pod:141
19392 "This function is the equivalent of calling L</add-drive-opts> with the "
19393 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19394 "is added read-only, with the format being detected automatically."
19398 #: ../fish/guestfish-actions.pod:146
19399 msgid "add-drive-ro-with-if"
19403 #: ../fish/guestfish-actions.pod:148
19406 " add-drive-ro-with-if filename iface\n"
19411 #: ../fish/guestfish-actions.pod:150
19413 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19414 "interface emulation to use at run time."
19418 #: ../fish/guestfish-actions.pod:160
19419 msgid "add-drive-with-if"
19423 #: ../fish/guestfish-actions.pod:162
19426 " add-drive-with-if filename iface\n"
19431 #: ../fish/guestfish-actions.pod:164
19433 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19434 "interface emulation to use at run time."
19438 #: ../fish/guestfish-actions.pod:174
19443 #: ../fish/guestfish-actions.pod:176
19446 " aug-clear augpath\n"
19451 #: ../fish/guestfish-actions.pod:181
19456 #: ../fish/guestfish-actions.pod:183
19464 #: ../fish/guestfish-actions.pod:185
19466 "Close the current Augeas handle and free up any resources used by it. After "
19467 "calling this, you have to call L</aug-init> again before you can use any "
19468 "other Augeas functions."
19472 #: ../fish/guestfish-actions.pod:190
19473 msgid "aug-defnode"
19477 #: ../fish/guestfish-actions.pod:192
19480 " aug-defnode name expr val\n"
19485 #: ../fish/guestfish-actions.pod:197
19487 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19488 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19489 "containing that single node."
19493 #: ../fish/guestfish-actions.pod:205
19498 #: ../fish/guestfish-actions.pod:207
19501 " aug-defvar name expr\n"
19506 #: ../fish/guestfish-actions.pod:216
19511 #: ../fish/guestfish-actions.pod:218
19514 " aug-get augpath\n"
19519 #: ../fish/guestfish-actions.pod:223
19524 #: ../fish/guestfish-actions.pod:225
19527 " aug-init root flags\n"
19532 #: ../fish/guestfish-actions.pod:231
19533 msgid "You must call this before using any other L</aug-*> commands."
19537 #: ../fish/guestfish-actions.pod:266
19538 msgid "Do not load the tree in L</aug-init>."
19542 #: ../fish/guestfish-actions.pod:270
19543 msgid "To close the handle, you can call L</aug-close>."
19547 #: ../fish/guestfish-actions.pod:274
19552 #: ../fish/guestfish-actions.pod:276
19555 " aug-insert augpath label true|false\n"
19560 #: ../fish/guestfish-actions.pod:286
19565 #: ../fish/guestfish-actions.pod:288
19573 #: ../fish/guestfish-actions.pod:295
19578 #: ../fish/guestfish-actions.pod:297
19581 " aug-ls augpath\n"
19586 #: ../fish/guestfish-actions.pod:299
19588 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19589 "resulting nodes into alphabetical order."
19593 #: ../fish/guestfish-actions.pod:302
19598 #: ../fish/guestfish-actions.pod:304
19601 " aug-match augpath\n"
19606 #: ../fish/guestfish-actions.pod:310
19611 #: ../fish/guestfish-actions.pod:312
19614 " aug-mv src dest\n"
19619 #: ../fish/guestfish-actions.pod:317
19624 #: ../fish/guestfish-actions.pod:319
19627 " aug-rm augpath\n"
19632 #: ../fish/guestfish-actions.pod:325
19637 #: ../fish/guestfish-actions.pod:327
19645 #: ../fish/guestfish-actions.pod:331
19647 "The flags which were passed to L</aug-init> affect exactly how files are "
19652 #: ../fish/guestfish-actions.pod:334
19657 #: ../fish/guestfish-actions.pod:336
19660 " aug-set augpath val\n"
19665 #: ../fish/guestfish-actions.pod:340
19667 "In the Augeas API, it is possible to clear a node by setting the value to "
19668 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19669 "this call. Instead you must use the L</aug-clear> call."
19673 #: ../fish/guestfish-actions.pod:345
19678 #: ../fish/guestfish-actions.pod:347
19681 " available 'groups ...'\n"
19686 #: ../fish/guestfish-actions.pod:353
19688 "The libguestfs groups, and the functions that those groups correspond to, "
19689 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19690 "runtime by calling L</available-all-groups>."
19694 #: ../fish/guestfish-actions.pod:377
19695 msgid "You must call L</launch> before calling this function."
19699 #: ../fish/guestfish-actions.pod:399
19701 "This call was added in version C<1.0.80>. In previous versions of "
19702 "libguestfs all you could do would be to speculatively execute a command to "
19703 "find out if the daemon implemented it. See also L</version>."
19707 #: ../fish/guestfish-actions.pod:406
19708 msgid "available-all-groups"
19712 #: ../fish/guestfish-actions.pod:408
19715 " available-all-groups\n"
19720 #: ../fish/guestfish-actions.pod:410
19722 "This command returns a list of all optional groups that this daemon knows "
19723 "about. Note this returns both supported and unsupported groups. To find "
19724 "out which ones the daemon can actually support you have to call L</"
19725 "available> on each member of the returned list."
19729 #: ../fish/guestfish-actions.pod:416
19730 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19734 #: ../fish/guestfish-actions.pod:418
19739 #: ../fish/guestfish-actions.pod:420
19742 " base64-in (base64file|-) filename\n"
19747 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
19748 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
19749 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
19750 #: ../fish/guestfish-actions.pod:4128 ../fish/guestfish-actions.pod:4140
19751 #: ../fish/guestfish-actions.pod:4151 ../fish/guestfish-actions.pod:4162
19752 #: ../fish/guestfish-actions.pod:4214 ../fish/guestfish-actions.pod:4223
19753 #: ../fish/guestfish-actions.pod:4277 ../fish/guestfish-actions.pod:4300
19754 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19758 #: ../fish/guestfish-actions.pod:427
19763 #: ../fish/guestfish-actions.pod:429
19766 " base64-out filename (base64file|-)\n"
19771 #: ../fish/guestfish-actions.pod:436
19772 msgid "blockdev-flushbufs"
19776 #: ../fish/guestfish-actions.pod:438
19779 " blockdev-flushbufs device\n"
19784 #: ../fish/guestfish-actions.pod:445
19785 msgid "blockdev-getbsz"
19789 #: ../fish/guestfish-actions.pod:447
19792 " blockdev-getbsz device\n"
19797 #: ../fish/guestfish-actions.pod:456
19798 msgid "blockdev-getro"
19802 #: ../fish/guestfish-actions.pod:458
19805 " blockdev-getro device\n"
19810 #: ../fish/guestfish-actions.pod:465
19811 msgid "blockdev-getsize64"
19815 #: ../fish/guestfish-actions.pod:467
19818 " blockdev-getsize64 device\n"
19823 #: ../fish/guestfish-actions.pod:471
19824 msgid "See also L</blockdev-getsz>."
19828 #: ../fish/guestfish-actions.pod:475
19829 msgid "blockdev-getss"
19833 #: ../fish/guestfish-actions.pod:477
19836 " blockdev-getss device\n"
19841 #: ../fish/guestfish-actions.pod:482
19843 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19847 #: ../fish/guestfish-actions.pod:487
19848 msgid "blockdev-getsz"
19852 #: ../fish/guestfish-actions.pod:489
19855 " blockdev-getsz device\n"
19860 #: ../fish/guestfish-actions.pod:494
19862 "See also L</blockdev-getss> for the real sector size of the device, and L</"
19863 "blockdev-getsize64> for the more useful I<size in bytes>."
19867 #: ../fish/guestfish-actions.pod:500
19868 msgid "blockdev-rereadpt"
19872 #: ../fish/guestfish-actions.pod:502
19875 " blockdev-rereadpt device\n"
19880 #: ../fish/guestfish-actions.pod:508
19881 msgid "blockdev-setbsz"
19885 #: ../fish/guestfish-actions.pod:510
19888 " blockdev-setbsz device blocksize\n"
19893 #: ../fish/guestfish-actions.pod:519
19894 msgid "blockdev-setro"
19898 #: ../fish/guestfish-actions.pod:521
19901 " blockdev-setro device\n"
19906 #: ../fish/guestfish-actions.pod:527
19907 msgid "blockdev-setrw"
19911 #: ../fish/guestfish-actions.pod:529
19914 " blockdev-setrw device\n"
19919 #: ../fish/guestfish-actions.pod:535
19920 msgid "case-sensitive-path"
19924 #: ../fish/guestfish-actions.pod:537
19927 " case-sensitive-path path\n"
19932 #: ../fish/guestfish-actions.pod:561
19934 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
19935 "WINDOWS/system32\"> (the exact return value would depend on details of how "
19936 "the directories were originally created under Windows)."
19940 #: ../fish/guestfish-actions.pod:569
19941 msgid "See also L</realpath>."
19945 #: ../fish/guestfish-actions.pod:571
19950 #: ../fish/guestfish-actions.pod:573
19958 #: ../fish/guestfish-actions.pod:577
19960 "Note that this function cannot correctly handle binary files (specifically, "
19961 "files containing C<\\0> character which is treated as end of string). For "
19962 "those you need to use the L</read-file> or L</download> functions which have "
19963 "a more complex interface."
19967 #: ../fish/guestfish-actions.pod:585
19972 #: ../fish/guestfish-actions.pod:587
19975 " checksum csumtype path\n"
19980 #: ../fish/guestfish-actions.pod:630
19981 msgid "To get the checksum for a device, use L</checksum-device>."
19985 #: ../fish/guestfish-actions.pod:632
19986 msgid "To get the checksums for many files, use L</checksums-out>."
19990 #: ../fish/guestfish-actions.pod:634
19991 msgid "checksum-device"
19995 #: ../fish/guestfish-actions.pod:636
19998 " checksum-device csumtype device\n"
20003 #: ../fish/guestfish-actions.pod:638
20005 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20006 "device named C<device>. For the types of checksums supported see the L</"
20007 "checksum> command."
20011 #: ../fish/guestfish-actions.pod:642
20012 msgid "checksums-out"
20016 #: ../fish/guestfish-actions.pod:644
20019 " checksums-out csumtype directory (sumsfile|-)\n"
20024 #: ../fish/guestfish-actions.pod:660
20029 #: ../fish/guestfish-actions.pod:662
20032 " chmod mode path\n"
20037 #: ../fish/guestfish-actions.pod:673
20042 #: ../fish/guestfish-actions.pod:675
20045 " chown owner group path\n"
20050 #: ../fish/guestfish-actions.pod:683
20055 #: ../fish/guestfish-actions.pod:685
20058 " command 'arguments ...'\n"
20063 #: ../fish/guestfish-actions.pod:692
20065 "The single parameter is an argv-style list of arguments. The first element "
20066 "is the name of the program to run. Subsequent elements are parameters. The "
20067 "list must be non-empty (ie. must contain a program name). Note that the "
20068 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20072 #: ../fish/guestfish-actions.pod:720
20073 msgid "command-lines"
20077 #: ../fish/guestfish-actions.pod:722
20080 " command-lines 'arguments ...'\n"
20085 #: ../fish/guestfish-actions.pod:724
20087 "This is the same as L</command>, but splits the result into a list of lines."
20091 #: ../fish/guestfish-actions.pod:727
20092 msgid "See also: L</sh-lines>"
20096 #: ../fish/guestfish-actions.pod:732
20101 #: ../fish/guestfish-actions.pod:734
20104 " config qemuparam qemuvalue\n"
20109 #: ../fish/guestfish-actions.pod:745
20114 #: ../fish/guestfish-actions.pod:747
20117 " copy-size src dest size\n"
20122 #: ../fish/guestfish-actions.pod:755
20127 #: ../fish/guestfish-actions.pod:757
20135 #: ../fish/guestfish-actions.pod:762
20140 #: ../fish/guestfish-actions.pod:764
20148 #: ../fish/guestfish-actions.pod:769
20153 #: ../fish/guestfish-actions.pod:771
20161 #: ../fish/guestfish-actions.pod:778
20163 "If the destination is a device, it must be as large or larger than the "
20164 "source file or device, otherwise the copy will fail. This command cannot do "
20165 "partial copies (see L</copy-size>)."
20169 #: ../fish/guestfish-actions.pod:782
20174 #: ../fish/guestfish-actions.pod:784
20182 #: ../fish/guestfish-actions.pod:792
20187 #: ../fish/guestfish-actions.pod:794
20195 #: ../fish/guestfish-actions.pod:803
20200 #: ../fish/guestfish-actions.pod:805
20208 #: ../fish/guestfish-actions.pod:811
20210 "Another way to get the same information is to enable verbose messages with "
20211 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20212 "before running the program."
20216 #: ../fish/guestfish-actions.pod:816
20221 #: ../fish/guestfish-actions.pod:818
20224 " download remotefilename (filename|-)\n"
20229 #: ../fish/guestfish-actions.pod:825
20230 msgid "See also L</upload>, L</cat>."
20234 #: ../fish/guestfish-actions.pod:829
20235 msgid "download-offset"
20239 #: ../fish/guestfish-actions.pod:831
20242 " download-offset remotefilename (filename|-) offset size\n"
20247 #: ../fish/guestfish-actions.pod:839
20249 "Note that there is no limit on the amount of data that can be downloaded "
20250 "with this call, unlike with L</pread>, and this call always reads the full "
20251 "amount unless an error occurs."
20255 #: ../fish/guestfish-actions.pod:844
20256 msgid "See also L</download>, L</pread>."
20260 #: ../fish/guestfish-actions.pod:848
20261 msgid "drop-caches"
20265 #: ../fish/guestfish-actions.pod:850
20268 " drop-caches whattodrop\n"
20273 #: ../fish/guestfish-actions.pod:862
20278 #: ../fish/guestfish-actions.pod:864
20286 #: ../fish/guestfish-actions.pod:876
20291 #: ../fish/guestfish-actions.pod:878
20294 " e2fsck-f device\n"
20299 #: ../fish/guestfish-actions.pod:884
20301 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20302 "should use L</fsck>."
20306 #: ../fish/guestfish-actions.pod:887
20307 msgid "echo-daemon"
20311 #: ../fish/guestfish-actions.pod:889
20314 " echo-daemon 'words ...'\n"
20319 #: ../fish/guestfish-actions.pod:896
20320 msgid "See also L</ping-daemon>."
20324 #: ../fish/guestfish-actions.pod:898
20329 #: ../fish/guestfish-actions.pod:900
20332 " egrep regex path\n"
20337 #: ../fish/guestfish-actions.pod:908
20342 #: ../fish/guestfish-actions.pod:910
20345 " egrepi regex path\n"
20350 #: ../fish/guestfish-actions.pod:918
20355 #: ../fish/guestfish-actions.pod:920
20358 " equal file1 file2\n"
20363 #: ../fish/guestfish-actions.pod:927
20368 #: ../fish/guestfish-actions.pod:929
20376 #: ../fish/guestfish-actions.pod:934
20377 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20381 #: ../fish/guestfish-actions.pod:936
20386 #: ../fish/guestfish-actions.pod:938
20389 " fallocate path len\n"
20394 #: ../fish/guestfish-actions.pod:955
20395 msgid "fallocate64"
20399 #: ../fish/guestfish-actions.pod:957
20402 " fallocate64 path len\n"
20407 #: ../fish/guestfish-actions.pod:963
20409 "Note that this call allocates disk blocks for the file. To create a sparse "
20410 "file use L</truncate-size> instead."
20414 #: ../fish/guestfish-actions.pod:966
20416 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20417 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20418 "maximum size of files created through that call to 1GB."
20422 #: ../fish/guestfish-actions.pod:975
20427 #: ../fish/guestfish-actions.pod:977
20430 " fgrep pattern path\n"
20435 #: ../fish/guestfish-actions.pod:985
20440 #: ../fish/guestfish-actions.pod:987
20443 " fgrepi pattern path\n"
20448 #: ../fish/guestfish-actions.pod:995
20453 #: ../fish/guestfish-actions.pod:997
20461 #: ../fish/guestfish-actions.pod:1009
20463 "This command can also be used on C</dev/> devices (and partitions, LV "
20464 "names). You can for example use this to determine if a device contains a "
20465 "filesystem, although it's usually better to use L</vfs-type>."
20469 #: ../fish/guestfish-actions.pod:1019
20470 msgid "file-architecture"
20474 #: ../fish/guestfish-actions.pod:1021
20477 " file-architecture filename\n"
20482 #: ../fish/guestfish-actions.pod:1124
20487 #: ../fish/guestfish-actions.pod:1126
20495 #: ../fish/guestfish-actions.pod:1130
20497 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20498 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20502 #: ../fish/guestfish-actions.pod:1134
20507 #: ../fish/guestfish-actions.pod:1136
20510 " fill c len path\n"
20515 #: ../fish/guestfish-actions.pod:1142
20517 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20518 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20519 "L</fill-pattern>."
20523 #: ../fish/guestfish-actions.pod:1147
20524 msgid "fill-pattern"
20528 #: ../fish/guestfish-actions.pod:1149
20531 " fill-pattern pattern len path\n"
20536 #: ../fish/guestfish-actions.pod:1151
20538 "This function is like L</fill> except that it creates a new file of length "
20539 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20540 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20545 #: ../fish/guestfish-actions.pod:1156
20550 #: ../fish/guestfish-actions.pod:1158
20553 " find directory\n"
20558 #: ../fish/guestfish-actions.pod:1172
20559 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20563 #: ../fish/guestfish-actions.pod:1185
20564 msgid "See also L</find0>."
20568 #: ../fish/guestfish-actions.pod:1190
20573 #: ../fish/guestfish-actions.pod:1192
20576 " find0 directory (files|-)\n"
20581 #: ../fish/guestfish-actions.pod:1198
20583 "This command works the same way as L</find> with the following exceptions:"
20587 #: ../fish/guestfish-actions.pod:1225
20588 msgid "findfs-label"
20592 #: ../fish/guestfish-actions.pod:1227
20595 " findfs-label label\n"
20600 #: ../fish/guestfish-actions.pod:1233
20601 msgid "To find the label of a filesystem, use L</vfs-label>."
20605 #: ../fish/guestfish-actions.pod:1235
20606 msgid "findfs-uuid"
20610 #: ../fish/guestfish-actions.pod:1237
20613 " findfs-uuid uuid\n"
20618 #: ../fish/guestfish-actions.pod:1243
20619 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20623 #: ../fish/guestfish-actions.pod:1245
20628 #: ../fish/guestfish-actions.pod:1247
20631 " fsck fstype device\n"
20636 #: ../fish/guestfish-actions.pod:1277
20641 #: ../fish/guestfish-actions.pod:1279
20649 #: ../fish/guestfish-actions.pod:1286
20650 msgid "get-autosync"
20654 #: ../fish/guestfish-actions.pod:1288
20662 #: ../fish/guestfish-actions.pod:1292
20667 #: ../fish/guestfish-actions.pod:1294
20675 #: ../fish/guestfish-actions.pod:1298
20676 msgid "get-e2label"
20680 #: ../fish/guestfish-actions.pod:1300
20683 " get-e2label device\n"
20688 #: ../fish/guestfish-actions.pod:1312
20693 #: ../fish/guestfish-actions.pod:1314
20696 " get-e2uuid device\n"
20701 #: ../fish/guestfish-actions.pod:1326
20702 msgid "get-memsize"
20706 #: ../fish/guestfish-actions.pod:1328
20714 #: ../fish/guestfish-actions.pod:1333
20716 "If L</set-memsize> was not called on this handle, and if "
20717 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20718 "value for memsize."
20722 #: ../fish/guestfish-actions.pod:1340
20723 msgid "get-network"
20727 #: ../fish/guestfish-actions.pod:1342
20735 #: ../fish/guestfish-actions.pod:1346
20740 #: ../fish/guestfish-actions.pod:1348
20748 #: ../fish/guestfish-actions.pod:1355
20753 #: ../fish/guestfish-actions.pod:1357
20758 #: ../fish/guestfish-actions.pod:1359
20766 #: ../fish/guestfish-actions.pod:1366
20771 #: ../fish/guestfish-actions.pod:1368
20779 #: ../fish/guestfish-actions.pod:1375
20780 msgid "get-recovery-proc"
20784 #: ../fish/guestfish-actions.pod:1377
20787 " get-recovery-proc\n"
20792 #: ../fish/guestfish-actions.pod:1381
20793 msgid "get-selinux"
20797 #: ../fish/guestfish-actions.pod:1383
20805 #: ../fish/guestfish-actions.pod:1385
20807 "This returns the current setting of the selinux flag which is passed to the "
20808 "appliance at boot time. See L</set-selinux>."
20812 #: ../fish/guestfish-actions.pod:1391
20817 #: ../fish/guestfish-actions.pod:1393
20825 #: ../fish/guestfish-actions.pod:1400
20830 #: ../fish/guestfish-actions.pod:1402
20838 #: ../fish/guestfish-actions.pod:1406
20843 #: ../fish/guestfish-actions.pod:1408
20851 #: ../fish/guestfish-actions.pod:1410
20853 "Return the current umask. By default the umask is C<022> unless it has been "
20854 "set by calling L</umask>."
20858 #: ../fish/guestfish-actions.pod:1413
20859 msgid "get-verbose"
20863 #: ../fish/guestfish-actions.pod:1415
20871 #: ../fish/guestfish-actions.pod:1419
20876 #: ../fish/guestfish-actions.pod:1421
20884 #: ../fish/guestfish-actions.pod:1425
20885 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
20889 #: ../fish/guestfish-actions.pod:1428
20894 #: ../fish/guestfish-actions.pod:1430
20897 " getxattrs path\n"
20902 #: ../fish/guestfish-actions.pod:1438
20903 msgid "See also: L</lgetxattrs>, L<attr(5)>."
20907 #: ../fish/guestfish-actions.pod:1440
20908 msgid "glob-expand"
20912 #: ../fish/guestfish-actions.pod:1442
20915 " glob-expand pattern\n"
20920 #: ../fish/guestfish-actions.pod:1455
20925 #: ../fish/guestfish-actions.pod:1457
20928 " grep regex path\n"
20933 #: ../fish/guestfish-actions.pod:1465
20938 #: ../fish/guestfish-actions.pod:1467
20941 " grepi regex path\n"
20946 #: ../fish/guestfish-actions.pod:1475
20947 msgid "grub-install"
20951 #: ../fish/guestfish-actions.pod:1477
20954 " grub-install root device\n"
20959 #: ../fish/guestfish-actions.pod:1493
20964 #: ../fish/guestfish-actions.pod:1495
20972 #: ../fish/guestfish-actions.pod:1503
20977 #: ../fish/guestfish-actions.pod:1505
20980 " head-n nrlines path\n"
20985 #: ../fish/guestfish-actions.pod:1518
20990 #: ../fish/guestfish-actions.pod:1520
20998 #: ../fish/guestfish-actions.pod:1528
21003 #: ../fish/guestfish-actions.pod:1530
21006 " initrd-cat initrdpath filename\n"
21011 #: ../fish/guestfish-actions.pod:1542
21012 msgid "See also L</initrd-list>."
21016 #: ../fish/guestfish-actions.pod:1547
21017 msgid "initrd-list"
21021 #: ../fish/guestfish-actions.pod:1549
21024 " initrd-list path\n"
21029 #: ../fish/guestfish-actions.pod:1561
21030 msgid "inotify-add-watch"
21034 #: ../fish/guestfish-actions.pod:1563
21037 " inotify-add-watch path mask\n"
21042 #: ../fish/guestfish-actions.pod:1575
21043 msgid "inotify-close"
21047 #: ../fish/guestfish-actions.pod:1577
21055 #: ../fish/guestfish-actions.pod:1583
21056 msgid "inotify-files"
21060 #: ../fish/guestfish-actions.pod:1585
21068 #: ../fish/guestfish-actions.pod:1587
21070 "This function is a helpful wrapper around L</inotify-read> which just "
21071 "returns a list of pathnames of objects that were touched. The returned "
21072 "pathnames are sorted and deduplicated."
21076 #: ../fish/guestfish-actions.pod:1591
21077 msgid "inotify-init"
21081 #: ../fish/guestfish-actions.pod:1593
21084 " inotify-init maxevents\n"
21089 #: ../fish/guestfish-actions.pod:1599
21091 "C<maxevents> is the maximum number of events which will be queued up between "
21092 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21093 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21094 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21095 "but records the fact that it threw them away by setting a flag "
21096 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21100 #: ../fish/guestfish-actions.pod:1609
21102 "Before any events are generated, you have to add some watches to the "
21103 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21104 "L</inotify-watch-all>."
21108 #: ../fish/guestfish-actions.pod:1615
21110 "Queued up events should be read periodically by calling L</inotify-read> (or "
21111 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21112 "If you don't read the events out often enough then you risk the internal "
21113 "queue overflowing."
21117 #: ../fish/guestfish-actions.pod:1622
21119 "The handle should be closed after use by calling L</inotify-close>. This "
21120 "also removes any watches automatically."
21124 #: ../fish/guestfish-actions.pod:1631
21125 msgid "inotify-read"
21129 #: ../fish/guestfish-actions.pod:1633
21137 #: ../fish/guestfish-actions.pod:1646
21138 msgid "inotify-rm-watch"
21142 #: ../fish/guestfish-actions.pod:1648
21145 " inotify-rm-watch wd\n"
21150 #: ../fish/guestfish-actions.pod:1650
21151 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21155 #: ../fish/guestfish-actions.pod:1653
21156 msgid "inspect-get-arch"
21160 #: ../fish/guestfish-actions.pod:1655
21163 " inspect-get-arch root\n"
21168 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673
21169 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1765
21170 #: ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1801
21171 #: ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1839
21172 #: ../fish/guestfish-actions.pod:1861 ../fish/guestfish-actions.pod:1885
21173 #: ../fish/guestfish-actions.pod:1915 ../fish/guestfish-actions.pod:1950
21174 #: ../fish/guestfish-actions.pod:1966
21176 "This function should only be called with a root device string as returned by "
21181 #: ../fish/guestfish-actions.pod:1660
21183 "This returns the architecture of the inspected operating system. The "
21184 "possible return values are listed under L</file-architecture>."
21188 #: ../fish/guestfish-actions.pod:1669
21189 msgid "inspect-get-distro"
21193 #: ../fish/guestfish-actions.pod:1671
21196 " inspect-get-distro root\n"
21201 #: ../fish/guestfish-actions.pod:1743
21202 msgid "inspect-get-filesystems"
21206 #: ../fish/guestfish-actions.pod:1745
21209 " inspect-get-filesystems root\n"
21214 #: ../fish/guestfish-actions.pod:1758
21216 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21217 "get-mountpoints>."
21221 #: ../fish/guestfish-actions.pod:1761
21222 msgid "inspect-get-hostname"
21226 #: ../fish/guestfish-actions.pod:1763
21229 " inspect-get-hostname root\n"
21234 #: ../fish/guestfish-actions.pod:1776
21235 msgid "inspect-get-major-version"
21239 #: ../fish/guestfish-actions.pod:1778
21242 " inspect-get-major-version root\n"
21247 #: ../fish/guestfish-actions.pod:1797
21248 msgid "inspect-get-minor-version"
21252 #: ../fish/guestfish-actions.pod:1799
21255 " inspect-get-minor-version root\n"
21260 #: ../fish/guestfish-actions.pod:1809
21262 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21263 "get-major-version>."
21267 #: ../fish/guestfish-actions.pod:1812
21268 msgid "inspect-get-mountpoints"
21272 #: ../fish/guestfish-actions.pod:1814
21275 " inspect-get-mountpoints root\n"
21280 #: ../fish/guestfish-actions.pod:1832
21282 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21283 "get-filesystems>."
21287 #: ../fish/guestfish-actions.pod:1835
21288 msgid "inspect-get-package-format"
21292 #: ../fish/guestfish-actions.pod:1837
21295 " inspect-get-package-format root\n"
21300 #: ../fish/guestfish-actions.pod:1842
21302 "This function and L</inspect-get-package-management> return the package "
21303 "format and package management tool used by the inspected operating system. "
21304 "For example for Fedora these functions would return C<rpm> (package format) "
21305 "and C<yum> (package management)."
21309 #: ../fish/guestfish-actions.pod:1857
21310 msgid "inspect-get-package-management"
21314 #: ../fish/guestfish-actions.pod:1859
21317 " inspect-get-package-management root\n"
21322 #: ../fish/guestfish-actions.pod:1864
21324 "L</inspect-get-package-format> and this function return the package format "
21325 "and package management tool used by the inspected operating system. For "
21326 "example for Fedora these functions would return C<rpm> (package format) and "
21327 "C<yum> (package management)."
21331 #: ../fish/guestfish-actions.pod:1881
21332 msgid "inspect-get-product-name"
21336 #: ../fish/guestfish-actions.pod:1883
21339 " inspect-get-product-name root\n"
21344 #: ../fish/guestfish-actions.pod:1898
21345 msgid "inspect-get-roots"
21349 #: ../fish/guestfish-actions.pod:1900
21352 " inspect-get-roots\n"
21357 #: ../fish/guestfish-actions.pod:1902
21359 "This function is a convenient way to get the list of root devices, as "
21360 "returned from a previous call to L</inspect-os>, but without redoing the "
21361 "whole inspection process."
21365 #: ../fish/guestfish-actions.pod:1906
21367 "This returns an empty list if either no root devices were found or the "
21368 "caller has not called L</inspect-os>."
21372 #: ../fish/guestfish-actions.pod:1911
21373 msgid "inspect-get-type"
21377 #: ../fish/guestfish-actions.pod:1913
21380 " inspect-get-type root\n"
21385 #: ../fish/guestfish-actions.pod:1946
21386 msgid "inspect-get-windows-systemroot"
21390 #: ../fish/guestfish-actions.pod:1948
21393 " inspect-get-windows-systemroot root\n"
21398 #: ../fish/guestfish-actions.pod:1962
21399 msgid "inspect-list-applications"
21403 #: ../fish/guestfish-actions.pod:1964
21406 " inspect-list-applications root\n"
21411 #: ../fish/guestfish-actions.pod:1971
21413 "I<Note:> This call works differently from other parts of the inspection "
21414 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21415 "then mount up the disks, before calling this. Listing applications is a "
21416 "significantly more difficult operation which requires access to the full "
21417 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21418 "are just returning data cached in the libguestfs handle, this call actually "
21419 "reads parts of the mounted filesystems during the call."
21423 #: ../fish/guestfish-actions.pod:2061
21428 #: ../fish/guestfish-actions.pod:2063
21436 #: ../fish/guestfish-actions.pod:2078
21438 "You can pass the root string(s) returned to other L</inspect-get-*> "
21439 "functions in order to query further information about each operating system, "
21440 "such as the name and version."
21444 #: ../fish/guestfish-actions.pod:2083
21446 "This function uses other libguestfs features such as L</mount-ro> and L</"
21447 "umount-all> in order to mount and unmount filesystems and look at the "
21448 "contents. This should be called with no disks currently mounted. The "
21449 "function may also use Augeas, so any existing Augeas handle will be closed."
21453 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2251
21454 #: ../fish/guestfish-actions.pod:2297
21455 msgid "See also L</list-filesystems>."
21459 #: ../fish/guestfish-actions.pod:2097
21460 msgid "is-blockdev"
21464 #: ../fish/guestfish-actions.pod:2099
21467 " is-blockdev path\n"
21472 #: ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2122
21473 #: ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2150
21474 #: ../fish/guestfish-actions.pod:2160 ../fish/guestfish-actions.pod:2194
21475 #: ../fish/guestfish-actions.pod:2203
21476 msgid "See also L</stat>."
21480 #: ../fish/guestfish-actions.pod:2106
21485 #: ../fish/guestfish-actions.pod:2108
21493 #: ../fish/guestfish-actions.pod:2115
21498 #: ../fish/guestfish-actions.pod:2117
21501 " is-chardev path\n"
21506 #: ../fish/guestfish-actions.pod:2124
21511 #: ../fish/guestfish-actions.pod:2126
21519 #: ../fish/guestfish-actions.pod:2133
21524 #: ../fish/guestfish-actions.pod:2135
21532 #: ../fish/guestfish-actions.pod:2143
21537 #: ../fish/guestfish-actions.pod:2145
21545 #: ../fish/guestfish-actions.pod:2152
21550 #: ../fish/guestfish-actions.pod:2154
21558 #: ../fish/guestfish-actions.pod:2162
21559 msgid "is-launching"
21563 #: ../fish/guestfish-actions.pod:2164
21571 #: ../fish/guestfish-actions.pod:2171
21576 #: ../fish/guestfish-actions.pod:2173
21584 #: ../fish/guestfish-actions.pod:2178
21589 #: ../fish/guestfish-actions.pod:2180
21597 #: ../fish/guestfish-actions.pod:2187
21602 #: ../fish/guestfish-actions.pod:2189
21605 " is-socket path\n"
21610 #: ../fish/guestfish-actions.pod:2196
21615 #: ../fish/guestfish-actions.pod:2198
21618 " is-symlink path\n"
21623 #: ../fish/guestfish-actions.pod:2205
21624 msgid "kill-subprocess"
21628 #: ../fish/guestfish-actions.pod:2207
21631 " kill-subprocess\n"
21636 #: ../fish/guestfish-actions.pod:2211
21641 #: ../fish/guestfish-actions.pod:2213
21646 #: ../fish/guestfish-actions.pod:2215
21654 #: ../fish/guestfish-actions.pod:2223
21659 #: ../fish/guestfish-actions.pod:2225
21662 " lchown owner group path\n"
21667 #: ../fish/guestfish-actions.pod:2227
21669 "Change the file owner to C<owner> and group to C<group>. This is like L</"
21670 "chown> but if C<path> is a symlink then the link itself is changed, not the "
21675 #: ../fish/guestfish-actions.pod:2235
21680 #: ../fish/guestfish-actions.pod:2237
21683 " lgetxattrs path\n"
21688 #: ../fish/guestfish-actions.pod:2239
21690 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21691 "it returns the extended attributes of the link itself."
21695 #: ../fish/guestfish-actions.pod:2243
21696 msgid "list-devices"
21700 #: ../fish/guestfish-actions.pod:2245
21708 #: ../fish/guestfish-actions.pod:2253
21709 msgid "list-filesystems"
21713 #: ../fish/guestfish-actions.pod:2255
21716 " list-filesystems\n"
21721 #: ../fish/guestfish-actions.pod:2274
21723 "This command runs other libguestfs commands, which might include L</mount> "
21724 "and L</umount>, and therefore you should use this soon after launch and only "
21725 "when nothing is mounted."
21729 #: ../fish/guestfish-actions.pod:2278
21731 "Not all of the filesystems returned will be mountable. In particular, swap "
21732 "partitions are returned in the list. Also this command does not check that "
21733 "each filesystem found is valid and mountable, and some filesystems might be "
21734 "mountable but require special options. Filesystems may not all belong to a "
21735 "single logical operating system (use L</inspect-os> to look for OSes)."
21739 #: ../fish/guestfish-actions.pod:2286
21740 msgid "list-partitions"
21744 #: ../fish/guestfish-actions.pod:2288
21747 " list-partitions\n"
21752 #: ../fish/guestfish-actions.pod:2294
21754 "This does not return logical volumes. For that you will need to call L</"
21759 #: ../fish/guestfish-actions.pod:2299
21764 #: ../fish/guestfish-actions.pod:2301
21772 #: ../fish/guestfish-actions.pod:2309
21777 #: ../fish/guestfish-actions.pod:2311
21780 " ln target linkname\n"
21785 #: ../fish/guestfish-actions.pod:2315
21790 #: ../fish/guestfish-actions.pod:2317
21793 " ln-f target linkname\n"
21798 #: ../fish/guestfish-actions.pod:2322
21803 #: ../fish/guestfish-actions.pod:2324
21806 " ln-s target linkname\n"
21811 #: ../fish/guestfish-actions.pod:2328
21816 #: ../fish/guestfish-actions.pod:2330
21819 " ln-sf target linkname\n"
21824 #: ../fish/guestfish-actions.pod:2335
21825 msgid "lremovexattr"
21829 #: ../fish/guestfish-actions.pod:2337
21832 " lremovexattr xattr path\n"
21837 #: ../fish/guestfish-actions.pod:2339
21839 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21840 "it removes an extended attribute of the link itself."
21844 #: ../fish/guestfish-actions.pod:2343
21849 #: ../fish/guestfish-actions.pod:2345
21857 #: ../fish/guestfish-actions.pod:2351
21859 "This command is mostly useful for interactive sessions. Programs should "
21860 "probably use L</readdir> instead."
21864 #: ../fish/guestfish-actions.pod:2354
21869 #: ../fish/guestfish-actions.pod:2356
21872 " lsetxattr xattr val vallen path\n"
21877 #: ../fish/guestfish-actions.pod:2358
21879 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
21880 "sets an extended attribute of the link itself."
21884 #: ../fish/guestfish-actions.pod:2362
21889 #: ../fish/guestfish-actions.pod:2364
21897 #: ../fish/guestfish-actions.pod:2368
21899 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
21900 "the link is stat-ed, not the file it refers to."
21904 #: ../fish/guestfish-actions.pod:2374
21909 #: ../fish/guestfish-actions.pod:2376
21912 " lstatlist path 'names ...'\n"
21917 #: ../fish/guestfish-actions.pod:2378
21919 "This call allows you to perform the L</lstat> operation on multiple files, "
21920 "where all files are in the directory C<path>. C<names> is the list of files "
21921 "from this directory."
21925 #: ../fish/guestfish-actions.pod:2387
21927 "This call is intended for programs that want to efficiently list a directory "
21928 "contents without making many round-trips. See also L</lxattrlist> for a "
21929 "similarly efficient call for getting extended attributes. Very long "
21930 "directory listings might cause the protocol message size to be exceeded, "
21931 "causing this call to fail. The caller must split up such requests into "
21932 "smaller groups of names."
21936 #: ../fish/guestfish-actions.pod:2395
21937 msgid "luks-add-key"
21941 #: ../fish/guestfish-actions.pod:2397
21944 " luks-add-key device keyslot\n"
21949 #: ../fish/guestfish-actions.pod:2404
21951 "Note that if C<keyslot> already contains a key, then this command will "
21952 "fail. You have to use L</luks-kill-slot> first to remove that key."
21956 #: ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2430
21957 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2457
21958 #: ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2490
21960 "This command has one or more key or passphrase parameters. Guestfish will "
21961 "prompt for these separately."
21965 #: ../fish/guestfish-actions.pod:2411
21970 #: ../fish/guestfish-actions.pod:2413
21973 " luks-close device\n"
21978 #: ../fish/guestfish-actions.pod:2415
21980 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
21981 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
21982 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
21987 #: ../fish/guestfish-actions.pod:2421
21988 msgid "luks-format"
21992 #: ../fish/guestfish-actions.pod:2423
21995 " luks-format device keyslot\n"
22000 #: ../fish/guestfish-actions.pod:2436
22001 msgid "luks-format-cipher"
22005 #: ../fish/guestfish-actions.pod:2438
22008 " luks-format-cipher device keyslot cipher\n"
22013 #: ../fish/guestfish-actions.pod:2440
22015 "This command is the same as L</luks-format> but it also allows you to set "
22016 "the C<cipher> used."
22020 #: ../fish/guestfish-actions.pod:2449
22021 msgid "luks-kill-slot"
22025 #: ../fish/guestfish-actions.pod:2451
22028 " luks-kill-slot device keyslot\n"
22033 #: ../fish/guestfish-actions.pod:2460
22038 #: ../fish/guestfish-actions.pod:2462
22041 " luks-open device mapname\n"
22046 #: ../fish/guestfish-actions.pod:2476
22048 "If this block device contains LVM volume groups, then calling L</vgscan> "
22049 "followed by L</vg-activate-all> will make them visible."
22053 #: ../fish/guestfish-actions.pod:2483
22054 msgid "luks-open-ro"
22058 #: ../fish/guestfish-actions.pod:2485
22061 " luks-open-ro device mapname\n"
22066 #: ../fish/guestfish-actions.pod:2487
22068 "This is the same as L</luks-open> except that a read-only mapping is created."
22072 #: ../fish/guestfish-actions.pod:2493
22077 #: ../fish/guestfish-actions.pod:2495
22080 " lvcreate logvol volgroup mbytes\n"
22085 #: ../fish/guestfish-actions.pod:2500
22086 msgid "lvm-canonical-lv-name"
22090 #: ../fish/guestfish-actions.pod:2502
22093 " lvm-canonical-lv-name lvname\n"
22098 #: ../fish/guestfish-actions.pod:2511
22099 msgid "See also L</is-lv>."
22103 #: ../fish/guestfish-actions.pod:2513
22104 msgid "lvm-clear-filter"
22108 #: ../fish/guestfish-actions.pod:2515
22111 " lvm-clear-filter\n"
22116 #: ../fish/guestfish-actions.pod:2517
22118 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22123 #: ../fish/guestfish-actions.pod:2523
22124 msgid "lvm-remove-all"
22128 #: ../fish/guestfish-actions.pod:2525
22131 " lvm-remove-all\n"
22136 #: ../fish/guestfish-actions.pod:2533
22137 msgid "lvm-set-filter"
22141 #: ../fish/guestfish-actions.pod:2535
22144 " lvm-set-filter 'devices ...'\n"
22149 #: ../fish/guestfish-actions.pod:2560
22154 #: ../fish/guestfish-actions.pod:2562
22157 " lvremove device\n"
22162 #: ../fish/guestfish-actions.pod:2570
22167 #: ../fish/guestfish-actions.pod:2572
22170 " lvrename logvol newlogvol\n"
22175 #: ../fish/guestfish-actions.pod:2576
22180 #: ../fish/guestfish-actions.pod:2578
22183 " lvresize device mbytes\n"
22188 #: ../fish/guestfish-actions.pod:2584
22189 msgid "lvresize-free"
22193 #: ../fish/guestfish-actions.pod:2586
22196 " lvresize-free lv percent\n"
22201 #: ../fish/guestfish-actions.pod:2594
22206 #: ../fish/guestfish-actions.pod:2596
22214 #: ../fish/guestfish-actions.pod:2604
22215 msgid "See also L</lvs-full>, L</list-filesystems>."
22219 #: ../fish/guestfish-actions.pod:2606
22224 #: ../fish/guestfish-actions.pod:2608
22232 #: ../fish/guestfish-actions.pod:2613
22237 #: ../fish/guestfish-actions.pod:2615
22245 #: ../fish/guestfish-actions.pod:2619
22250 #: ../fish/guestfish-actions.pod:2621
22253 " lxattrlist path 'names ...'\n"
22258 #: ../fish/guestfish-actions.pod:2637
22260 "This call is intended for programs that want to efficiently list a directory "
22261 "contents without making many round-trips. See also L</lstatlist> for a "
22262 "similarly efficient call for getting standard stats. Very long directory "
22263 "listings might cause the protocol message size to be exceeded, causing this "
22264 "call to fail. The caller must split up such requests into smaller groups of "
22269 #: ../fish/guestfish-actions.pod:2645
22274 #: ../fish/guestfish-actions.pod:2647
22282 #: ../fish/guestfish-actions.pod:2651
22287 #: ../fish/guestfish-actions.pod:2653
22290 " mkdir-mode path mode\n"
22295 #: ../fish/guestfish-actions.pod:2662
22296 msgid "See also L</mkdir>, L</umask>"
22300 #: ../fish/guestfish-actions.pod:2664
22305 #: ../fish/guestfish-actions.pod:2666
22313 #: ../fish/guestfish-actions.pod:2671
22318 #: ../fish/guestfish-actions.pod:2673
22321 " mkdtemp template\n"
22326 #: ../fish/guestfish-actions.pod:2694
22331 #: ../fish/guestfish-actions.pod:2696
22334 " mke2fs-J fstype blocksize device journal\n"
22339 #: ../fish/guestfish-actions.pod:2704
22340 msgid "See also L</mke2journal>."
22344 #: ../fish/guestfish-actions.pod:2706
22349 #: ../fish/guestfish-actions.pod:2708
22352 " mke2fs-JL fstype blocksize device label\n"
22357 #: ../fish/guestfish-actions.pod:2713
22358 msgid "See also L</mke2journal-L>."
22362 #: ../fish/guestfish-actions.pod:2715
22367 #: ../fish/guestfish-actions.pod:2717
22370 " mke2fs-JU fstype blocksize device uuid\n"
22375 #: ../fish/guestfish-actions.pod:2722
22376 msgid "See also L</mke2journal-U>."
22380 #: ../fish/guestfish-actions.pod:2724
22381 msgid "mke2journal"
22385 #: ../fish/guestfish-actions.pod:2726
22388 " mke2journal blocksize device\n"
22393 #: ../fish/guestfish-actions.pod:2733
22394 msgid "mke2journal-L"
22398 #: ../fish/guestfish-actions.pod:2735
22401 " mke2journal-L blocksize label device\n"
22406 #: ../fish/guestfish-actions.pod:2739
22407 msgid "mke2journal-U"
22411 #: ../fish/guestfish-actions.pod:2741
22414 " mke2journal-U blocksize uuid device\n"
22419 #: ../fish/guestfish-actions.pod:2745
22424 #: ../fish/guestfish-actions.pod:2747
22427 " mkfifo mode path\n"
22432 #: ../fish/guestfish-actions.pod:2749
22434 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22435 "is just a convenient wrapper around L</mknod>."
22439 #: ../fish/guestfish-actions.pod:2755
22444 #: ../fish/guestfish-actions.pod:2757
22447 " mkfs fstype device\n"
22452 #: ../fish/guestfish-actions.pod:2763
22457 #: ../fish/guestfish-actions.pod:2765
22460 " mkfs-b fstype blocksize device\n"
22465 #: ../fish/guestfish-actions.pod:2767
22467 "This call is similar to L</mkfs>, but it allows you to control the block "
22468 "size of the resulting filesystem. Supported block sizes depend on the "
22469 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22473 #: ../fish/guestfish-actions.pod:2775
22474 msgid "mkmountpoint"
22478 #: ../fish/guestfish-actions.pod:2777
22481 " mkmountpoint exemptpath\n"
22486 #: ../fish/guestfish-actions.pod:2779
22488 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22489 "to create extra mountpoints before mounting the first filesystem."
22493 #: ../fish/guestfish-actions.pod:2803
22495 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22496 "unexpected errors if you try to mix these calls. It is safest to manually "
22497 "unmount filesystems and remove mountpoints after use."
22501 #: ../fish/guestfish-actions.pod:2807
22503 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22504 "for this to work for manual mountpoints, you must ensure that the innermost "
22505 "mountpoints have the longest pathnames, as in the example code above."
22509 #: ../fish/guestfish-actions.pod:2814
22511 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22512 "that L</umount-all> is called when the handle is closed which can also "
22513 "trigger these issues."
22517 #: ../fish/guestfish-actions.pod:2818
22522 #: ../fish/guestfish-actions.pod:2820
22525 " mknod mode devmajor devminor path\n"
22530 #: ../fish/guestfish-actions.pod:2830
22532 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22533 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22534 "regular file). These constants are available in the standard Linux header "
22535 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22536 "wrappers around this command which bitwise OR in the appropriate constant "
22541 #: ../fish/guestfish-actions.pod:2840
22546 #: ../fish/guestfish-actions.pod:2842
22549 " mknod-b mode devmajor devminor path\n"
22554 #: ../fish/guestfish-actions.pod:2844
22556 "This call creates a block device node called C<path> with mode C<mode> and "
22557 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22558 "wrapper around L</mknod>."
22562 #: ../fish/guestfish-actions.pod:2850
22567 #: ../fish/guestfish-actions.pod:2852
22570 " mknod-c mode devmajor devminor path\n"
22575 #: ../fish/guestfish-actions.pod:2854
22577 "This call creates a char device node called C<path> with mode C<mode> and "
22578 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22579 "wrapper around L</mknod>."
22583 #: ../fish/guestfish-actions.pod:2860
22588 #: ../fish/guestfish-actions.pod:2862
22596 #: ../fish/guestfish-actions.pod:2866
22601 #: ../fish/guestfish-actions.pod:2868
22604 " mkswap-L label device\n"
22609 #: ../fish/guestfish-actions.pod:2876
22614 #: ../fish/guestfish-actions.pod:2878
22617 " mkswap-U uuid device\n"
22622 #: ../fish/guestfish-actions.pod:2882
22623 msgid "mkswap-file"
22627 #: ../fish/guestfish-actions.pod:2884
22630 " mkswap-file path\n"
22635 #: ../fish/guestfish-actions.pod:2888
22637 "This command just writes a swap file signature to an existing file. To "
22638 "create the file itself, use something like L</fallocate>."
22642 #: ../fish/guestfish-actions.pod:2891
22647 #: ../fish/guestfish-actions.pod:2893
22650 " modprobe modulename\n"
22655 #: ../fish/guestfish-actions.pod:2900
22660 #: ../fish/guestfish-actions.pod:2902
22663 " mount device mountpoint\n"
22668 #: ../fish/guestfish-actions.pod:2918
22670 "B<Important note:> When you use this call, the filesystem options C<sync> "
22671 "and C<noatime> are set implicitly. This was originally done because we "
22672 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22673 "very large negative performance impact and negligible effect on "
22674 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22675 "code that needs performance, and instead use L</mount-options> (use an empty "
22676 "string for the first parameter if you don't want any options)."
22680 #: ../fish/guestfish-actions.pod:2928
22685 #: ../fish/guestfish-actions.pod:2930
22688 " mount-loop file mountpoint\n"
22693 #: ../fish/guestfish-actions.pod:2936
22694 msgid "mount-options"
22698 #: ../fish/guestfish-actions.pod:2938
22701 " mount-options options device mountpoint\n"
22706 #: ../fish/guestfish-actions.pod:2940
22708 "This is the same as the L</mount> command, but it allows you to set the "
22709 "mount options as for the L<mount(8)> I<-o> flag."
22713 #: ../fish/guestfish-actions.pod:2948
22718 #: ../fish/guestfish-actions.pod:2950
22721 " mount-ro device mountpoint\n"
22726 #: ../fish/guestfish-actions.pod:2952
22728 "This is the same as the L</mount> command, but it mounts the filesystem with "
22729 "the read-only (I<-o ro>) flag."
22733 #: ../fish/guestfish-actions.pod:2955
22738 #: ../fish/guestfish-actions.pod:2957
22741 " mount-vfs options vfstype device mountpoint\n"
22746 #: ../fish/guestfish-actions.pod:2959
22748 "This is the same as the L</mount> command, but it allows you to set both the "
22749 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22753 #: ../fish/guestfish-actions.pod:2963
22754 msgid "mountpoints"
22758 #: ../fish/guestfish-actions.pod:2965
22766 #: ../fish/guestfish-actions.pod:2967
22768 "This call is similar to L</mounts>. That call returns a list of devices. "
22769 "This one returns a hash table (map) of device name to directory where the "
22770 "device is mounted."
22774 #: ../fish/guestfish-actions.pod:2971
22779 #: ../fish/guestfish-actions.pod:2973
22787 #: ../fish/guestfish-actions.pod:2980
22788 msgid "See also: L</mountpoints>"
22792 #: ../fish/guestfish-actions.pod:2982
22797 #: ../fish/guestfish-actions.pod:2984
22805 #: ../fish/guestfish-actions.pod:2989
22806 msgid "ntfs-3g-probe"
22810 #: ../fish/guestfish-actions.pod:2991
22813 " ntfs-3g-probe true|false device\n"
22818 #: ../fish/guestfish-actions.pod:3005
22823 #: ../fish/guestfish-actions.pod:3007
22826 " ntfsresize device\n"
22831 #: ../fish/guestfish-actions.pod:3013
22832 msgid "ntfsresize-size"
22836 #: ../fish/guestfish-actions.pod:3015
22839 " ntfsresize-size device size\n"
22844 #: ../fish/guestfish-actions.pod:3017
22846 "This command is the same as L</ntfsresize> except that it allows you to "
22847 "specify the new size (in bytes) explicitly."
22851 #: ../fish/guestfish-actions.pod:3020
22856 #: ../fish/guestfish-actions.pod:3022
22859 " part-add device prlogex startsect endsect\n"
22864 #: ../fish/guestfish-actions.pod:3024
22866 "This command adds a partition to C<device>. If there is no partition table "
22867 "on the device, call L</part-init> first."
22871 #: ../fish/guestfish-actions.pod:3036
22873 "Creating a partition which covers the whole disk is not so easy. Use L</"
22874 "part-disk> to do that."
22878 #: ../fish/guestfish-actions.pod:3039
22883 #: ../fish/guestfish-actions.pod:3041
22886 " part-del device partnum\n"
22891 #: ../fish/guestfish-actions.pod:3049
22896 #: ../fish/guestfish-actions.pod:3051
22899 " part-disk device parttype\n"
22904 #: ../fish/guestfish-actions.pod:3053
22906 "This command is simply a combination of L</part-init> followed by L</part-"
22907 "add> to create a single primary partition covering the whole disk."
22911 #: ../fish/guestfish-actions.pod:3057
22913 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
22914 "possible values are described in L</part-init>."
22918 #: ../fish/guestfish-actions.pod:3063
22919 msgid "part-get-bootable"
22923 #: ../fish/guestfish-actions.pod:3065
22926 " part-get-bootable device partnum\n"
22931 #: ../fish/guestfish-actions.pod:3070
22932 msgid "See also L</part-set-bootable>."
22936 #: ../fish/guestfish-actions.pod:3072
22937 msgid "part-get-mbr-id"
22941 #: ../fish/guestfish-actions.pod:3074
22944 " part-get-mbr-id device partnum\n"
22949 #: ../fish/guestfish-actions.pod:3079 ../fish/guestfish-actions.pod:3217
22951 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
22952 "undefined results for other partition table types (see L</part-get-"
22957 #: ../fish/guestfish-actions.pod:3083
22958 msgid "part-get-parttype"
22962 #: ../fish/guestfish-actions.pod:3085
22965 " part-get-parttype device\n"
22970 #: ../fish/guestfish-actions.pod:3090
22972 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
22973 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
22974 "possible, although unusual. See L</part-init> for a full list."
22978 #: ../fish/guestfish-actions.pod:3095
22983 #: ../fish/guestfish-actions.pod:3097
22986 " part-init device parttype\n"
22991 #: ../fish/guestfish-actions.pod:3103
22993 "Initially there are no partitions. Following this, you should call L</part-"
22994 "add> for each partition required."
22998 #: ../fish/guestfish-actions.pod:3166
23003 #: ../fish/guestfish-actions.pod:3168
23006 " part-list device\n"
23011 #: ../fish/guestfish-actions.pod:3183
23013 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23014 "the device's sector size, see L</blockdev-getss>."
23018 #: ../fish/guestfish-actions.pod:3196
23019 msgid "part-set-bootable"
23023 #: ../fish/guestfish-actions.pod:3198
23026 " part-set-bootable device partnum true|false\n"
23031 #: ../fish/guestfish-actions.pod:3207
23032 msgid "part-set-mbr-id"
23036 #: ../fish/guestfish-actions.pod:3209
23039 " part-set-mbr-id device partnum idbyte\n"
23044 #: ../fish/guestfish-actions.pod:3221
23045 msgid "part-set-name"
23049 #: ../fish/guestfish-actions.pod:3223
23052 " part-set-name device partnum name\n"
23057 #: ../fish/guestfish-actions.pod:3231
23058 msgid "part-to-dev"
23062 #: ../fish/guestfish-actions.pod:3233
23065 " part-to-dev partition\n"
23070 #: ../fish/guestfish-actions.pod:3239
23072 "The named partition must exist, for example as a string returned from L</"
23073 "list-partitions>."
23077 #: ../fish/guestfish-actions.pod:3242
23078 msgid "ping-daemon"
23082 #: ../fish/guestfish-actions.pod:3244
23090 #: ../fish/guestfish-actions.pod:3251
23095 #: ../fish/guestfish-actions.pod:3253
23098 " pread path count offset\n"
23103 #: ../fish/guestfish-actions.pod:3261
23104 msgid "See also L</pwrite>, L</pread-device>."
23108 #: ../fish/guestfish-actions.pod:3266
23109 msgid "pread-device"
23113 #: ../fish/guestfish-actions.pod:3268
23116 " pread-device device count offset\n"
23121 #: ../fish/guestfish-actions.pod:3276
23122 msgid "See also L</pread>."
23126 #: ../fish/guestfish-actions.pod:3281
23131 #: ../fish/guestfish-actions.pod:3283
23134 " pvcreate device\n"
23139 #: ../fish/guestfish-actions.pod:3289
23144 #: ../fish/guestfish-actions.pod:3291
23147 " pvremove device\n"
23152 #: ../fish/guestfish-actions.pod:3300
23157 #: ../fish/guestfish-actions.pod:3302
23160 " pvresize device\n"
23165 #: ../fish/guestfish-actions.pod:3307
23166 msgid "pvresize-size"
23170 #: ../fish/guestfish-actions.pod:3309
23173 " pvresize-size device size\n"
23178 #: ../fish/guestfish-actions.pod:3311
23180 "This command is the same as L</pvresize> except that it allows you to "
23181 "specify the new size (in bytes) explicitly."
23185 #: ../fish/guestfish-actions.pod:3314
23190 #: ../fish/guestfish-actions.pod:3316
23198 #: ../fish/guestfish-actions.pod:3324
23199 msgid "See also L</pvs-full>."
23203 #: ../fish/guestfish-actions.pod:3326
23208 #: ../fish/guestfish-actions.pod:3328
23216 #: ../fish/guestfish-actions.pod:3333
23221 #: ../fish/guestfish-actions.pod:3335
23229 #: ../fish/guestfish-actions.pod:3339
23234 #: ../fish/guestfish-actions.pod:3341
23237 " pwrite path content offset\n"
23242 #: ../fish/guestfish-actions.pod:3352
23243 msgid "See also L</pread>, L</pwrite-device>."
23247 #: ../fish/guestfish-actions.pod:3357
23248 msgid "pwrite-device"
23252 #: ../fish/guestfish-actions.pod:3359
23255 " pwrite-device device content offset\n"
23260 #: ../fish/guestfish-actions.pod:3369
23261 msgid "See also L</pwrite>."
23265 #: ../fish/guestfish-actions.pod:3374
23270 #: ../fish/guestfish-actions.pod:3376
23273 " read-file path\n"
23278 #: ../fish/guestfish-actions.pod:3381
23280 "Unlike L</cat>, this function can correctly handle files that contain "
23281 "embedded ASCII NUL characters. However unlike L</download>, this function "
23282 "is limited in the total size of file that can be handled."
23286 #: ../fish/guestfish-actions.pod:3389
23291 #: ../fish/guestfish-actions.pod:3391
23294 " read-lines path\n"
23299 #: ../fish/guestfish-actions.pod:3398
23301 "Note that this function cannot correctly handle binary files (specifically, "
23302 "files containing C<\\0> character which is treated as end of line). For "
23303 "those you need to use the L</read-file> function which has a more complex "
23308 #: ../fish/guestfish-actions.pod:3403
23313 #: ../fish/guestfish-actions.pod:3405
23321 #: ../fish/guestfish-actions.pod:3457
23323 "This function is primarily intended for use by programs. To get a simple "
23324 "list of names, use L</ls>. To get a printable directory for human "
23325 "consumption, use L</ll>."
23329 #: ../fish/guestfish-actions.pod:3461
23334 #: ../fish/guestfish-actions.pod:3463
23342 #: ../fish/guestfish-actions.pod:3467
23343 msgid "readlinklist"
23347 #: ../fish/guestfish-actions.pod:3469
23350 " readlinklist path 'names ...'\n"
23355 #: ../fish/guestfish-actions.pod:3493
23360 #: ../fish/guestfish-actions.pod:3495
23368 #: ../fish/guestfish-actions.pod:3500
23369 msgid "removexattr"
23373 #: ../fish/guestfish-actions.pod:3502
23376 " removexattr xattr path\n"
23381 #: ../fish/guestfish-actions.pod:3507
23382 msgid "See also: L</lremovexattr>, L<attr(5)>."
23386 #: ../fish/guestfish-actions.pod:3509
23391 #: ../fish/guestfish-actions.pod:3511
23394 " resize2fs device\n"
23399 #: ../fish/guestfish-actions.pod:3516
23401 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23402 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23403 "gives an error about this and sometimes not. In any case, it is always safe "
23404 "to call L</e2fsck-f> before calling this function."
23408 #: ../fish/guestfish-actions.pod:3522
23409 msgid "resize2fs-size"
23413 #: ../fish/guestfish-actions.pod:3524
23416 " resize2fs-size device size\n"
23421 #: ../fish/guestfish-actions.pod:3526
23423 "This command is the same as L</resize2fs> except that it allows you to "
23424 "specify the new size (in bytes) explicitly."
23428 #: ../fish/guestfish-actions.pod:3529
23433 #: ../fish/guestfish-actions.pod:3531
23441 #: ../fish/guestfish-actions.pod:3535
23446 #: ../fish/guestfish-actions.pod:3537
23454 #: ../fish/guestfish-actions.pod:3543
23459 #: ../fish/guestfish-actions.pod:3545
23467 #: ../fish/guestfish-actions.pod:3549
23468 msgid "rmmountpoint"
23472 #: ../fish/guestfish-actions.pod:3551
23475 " rmmountpoint exemptpath\n"
23480 #: ../fish/guestfish-actions.pod:3553
23482 "This calls removes a mountpoint that was previously created with L</"
23483 "mkmountpoint>. See L</mkmountpoint> for full details."
23487 #: ../fish/guestfish-actions.pod:3557
23488 msgid "scrub-device"
23492 #: ../fish/guestfish-actions.pod:3559
23495 " scrub-device device\n"
23500 #: ../fish/guestfish-actions.pod:3570
23505 #: ../fish/guestfish-actions.pod:3572
23508 " scrub-file file\n"
23513 #: ../fish/guestfish-actions.pod:3582
23514 msgid "scrub-freespace"
23518 #: ../fish/guestfish-actions.pod:3584
23521 " scrub-freespace dir\n"
23526 #: ../fish/guestfish-actions.pod:3586
23528 "This command creates the directory C<dir> and then fills it with files until "
23529 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23530 "deletes them. The intention is to scrub any free space on the partition "
23531 "containing C<dir>."
23535 #: ../fish/guestfish-actions.pod:3595
23540 #: ../fish/guestfish-actions.pod:3597
23545 #: ../fish/guestfish-actions.pod:3599
23548 " set-append append\n"
23553 #: ../fish/guestfish-actions.pod:3610
23554 msgid "set-autosync"
23558 #: ../fish/guestfish-actions.pod:3612
23563 #: ../fish/guestfish-actions.pod:3614
23566 " set-autosync true|false\n"
23571 #: ../fish/guestfish-actions.pod:3616
23573 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23574 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23575 "closed (also if the program exits without closing handles)."
23579 #: ../fish/guestfish-actions.pod:3624
23584 #: ../fish/guestfish-actions.pod:3626
23589 #: ../fish/guestfish-actions.pod:3628
23592 " set-direct true|false\n"
23597 #: ../fish/guestfish-actions.pod:3634
23599 "One consequence of this is that log messages aren't caught by the library "
23600 "and handled by L</set-log-message-callback>, but go straight to stdout."
23604 #: ../fish/guestfish-actions.pod:3643
23605 msgid "set-e2label"
23609 #: ../fish/guestfish-actions.pod:3645
23612 " set-e2label device label\n"
23617 #: ../fish/guestfish-actions.pod:3651
23619 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23620 "label on a filesystem."
23624 #: ../fish/guestfish-actions.pod:3654
23629 #: ../fish/guestfish-actions.pod:3656
23632 " set-e2uuid device uuid\n"
23637 #: ../fish/guestfish-actions.pod:3663
23639 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23640 "UUID of a filesystem."
23644 #: ../fish/guestfish-actions.pod:3666
23645 msgid "set-memsize"
23649 #: ../fish/guestfish-actions.pod:3668
23654 #: ../fish/guestfish-actions.pod:3670
23657 " set-memsize memsize\n"
23662 #: ../fish/guestfish-actions.pod:3672
23664 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23665 "This only has any effect if called before L</launch>."
23669 #: ../fish/guestfish-actions.pod:3683
23670 msgid "set-network"
23674 #: ../fish/guestfish-actions.pod:3685
23679 #: ../fish/guestfish-actions.pod:3687
23682 " set-network true|false\n"
23687 #: ../fish/guestfish-actions.pod:3695
23689 "You must call this before calling L</launch>, otherwise it has no effect."
23693 #: ../fish/guestfish-actions.pod:3698
23698 #: ../fish/guestfish-actions.pod:3700
23703 #: ../fish/guestfish-actions.pod:3702
23706 " set-path searchpath\n"
23711 #: ../fish/guestfish-actions.pod:3711
23716 #: ../fish/guestfish-actions.pod:3713
23721 #: ../fish/guestfish-actions.pod:3715
23729 #: ../fish/guestfish-actions.pod:3735
23730 msgid "set-recovery-proc"
23734 #: ../fish/guestfish-actions.pod:3737
23735 msgid "recovery-proc"
23739 #: ../fish/guestfish-actions.pod:3739
23742 " set-recovery-proc true|false\n"
23747 #: ../fish/guestfish-actions.pod:3741
23749 "If this is called with the parameter C<false> then L</launch> does not "
23750 "create a recovery process. The purpose of the recovery process is to stop "
23751 "runaway qemu processes in the case where the main program aborts abruptly."
23755 #: ../fish/guestfish-actions.pod:3746
23757 "This only has any effect if called before L</launch>, and the default is "
23762 #: ../fish/guestfish-actions.pod:3755
23763 msgid "set-selinux"
23767 #: ../fish/guestfish-actions.pod:3757
23772 #: ../fish/guestfish-actions.pod:3759
23775 " set-selinux true|false\n"
23780 #: ../fish/guestfish-actions.pod:3770
23785 #: ../fish/guestfish-actions.pod:3772
23790 #: ../fish/guestfish-actions.pod:3774
23793 " set-trace true|false\n"
23798 #: ../fish/guestfish-actions.pod:3790
23799 msgid "set-verbose"
23803 #: ../fish/guestfish-actions.pod:3792
23808 #: ../fish/guestfish-actions.pod:3794
23811 " set-verbose true|false\n"
23816 #: ../fish/guestfish-actions.pod:3801
23821 #: ../fish/guestfish-actions.pod:3803
23824 " setcon context\n"
23829 #: ../fish/guestfish-actions.pod:3810
23834 #: ../fish/guestfish-actions.pod:3812
23837 " setxattr xattr val vallen path\n"
23842 #: ../fish/guestfish-actions.pod:3818
23843 msgid "See also: L</lsetxattr>, L<attr(5)>."
23847 #: ../fish/guestfish-actions.pod:3820
23852 #: ../fish/guestfish-actions.pod:3822
23855 " sfdisk device cyls heads sectors 'lines ...'\n"
23860 #: ../fish/guestfish-actions.pod:3844
23861 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23865 #: ../fish/guestfish-actions.pod:3850
23870 #: ../fish/guestfish-actions.pod:3852
23873 " sfdiskM device 'lines ...'\n"
23878 #: ../fish/guestfish-actions.pod:3854
23880 "This is a simplified interface to the L</sfdisk> command, where partition "
23881 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
23882 "you don't need to specify the cyls, heads and sectors parameters which were "
23883 "rarely if ever used anyway."
23887 #: ../fish/guestfish-actions.pod:3860
23888 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
23892 #: ../fish/guestfish-actions.pod:3866
23897 #: ../fish/guestfish-actions.pod:3868
23900 " sfdisk-N device partnum cyls heads sectors line\n"
23905 #: ../fish/guestfish-actions.pod:3873
23907 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
23908 "cyls/heads/sectors parameters."
23912 #: ../fish/guestfish-actions.pod:3876
23913 msgid "See also: L</part-add>"
23917 #: ../fish/guestfish-actions.pod:3881
23918 msgid "sfdisk-disk-geometry"
23922 #: ../fish/guestfish-actions.pod:3883
23925 " sfdisk-disk-geometry device\n"
23930 #: ../fish/guestfish-actions.pod:3885
23932 "This displays the disk geometry of C<device> read from the partition table. "
23933 "Especially in the case where the underlying block device has been resized, "
23934 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
23935 "kernel-geometry>)."
23939 #: ../fish/guestfish-actions.pod:3893
23940 msgid "sfdisk-kernel-geometry"
23944 #: ../fish/guestfish-actions.pod:3895
23947 " sfdisk-kernel-geometry device\n"
23952 #: ../fish/guestfish-actions.pod:3902
23957 #: ../fish/guestfish-actions.pod:3904
23960 " sfdisk-l device\n"
23965 #: ../fish/guestfish-actions.pod:3910
23966 msgid "See also: L</part-list>"
23970 #: ../fish/guestfish-actions.pod:3912
23975 #: ../fish/guestfish-actions.pod:3914
23983 #: ../fish/guestfish-actions.pod:3919
23984 msgid "This is like L</command>, but passes the command to:"
23988 #: ../fish/guestfish-actions.pod:3927
23989 msgid "All the provisos about L</command> apply to this call."
23993 #: ../fish/guestfish-actions.pod:3929
23998 #: ../fish/guestfish-actions.pod:3931
24001 " sh-lines command\n"
24006 #: ../fish/guestfish-actions.pod:3933
24007 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24011 #: ../fish/guestfish-actions.pod:3936
24012 msgid "See also: L</command-lines>"
24016 #: ../fish/guestfish-actions.pod:3938
24021 #: ../fish/guestfish-actions.pod:3940
24029 #: ../fish/guestfish-actions.pod:3944
24034 #: ../fish/guestfish-actions.pod:3946
24042 #: ../fish/guestfish-actions.pod:3952
24047 #: ../fish/guestfish-actions.pod:3954
24055 #: ../fish/guestfish-actions.pod:3962
24060 #: ../fish/guestfish-actions.pod:3964
24068 #: ../fish/guestfish-actions.pod:3972
24073 #: ../fish/guestfish-actions.pod:3974
24076 " strings-e encoding path\n"
24081 #: ../fish/guestfish-actions.pod:3976
24083 "This is like the L</strings> command, but allows you to specify the encoding "
24084 "of strings that are looked for in the source file C<path>."
24088 #: ../fish/guestfish-actions.pod:3986
24090 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24091 "ISO-8859-X (this is what L</strings> uses)."
24095 #: ../fish/guestfish-actions.pod:4018
24096 msgid "swapoff-device"
24100 #: ../fish/guestfish-actions.pod:4020
24103 " swapoff-device device\n"
24108 #: ../fish/guestfish-actions.pod:4022
24110 "This command disables the libguestfs appliance swap device or partition "
24111 "named C<device>. See L</swapon-device>."
24115 #: ../fish/guestfish-actions.pod:4026
24116 msgid "swapoff-file"
24120 #: ../fish/guestfish-actions.pod:4028
24123 " swapoff-file file\n"
24128 #: ../fish/guestfish-actions.pod:4032
24129 msgid "swapoff-label"
24133 #: ../fish/guestfish-actions.pod:4034
24136 " swapoff-label label\n"
24141 #: ../fish/guestfish-actions.pod:4039
24142 msgid "swapoff-uuid"
24146 #: ../fish/guestfish-actions.pod:4041
24149 " swapoff-uuid uuid\n"
24154 #: ../fish/guestfish-actions.pod:4046
24155 msgid "swapon-device"
24159 #: ../fish/guestfish-actions.pod:4048
24162 " swapon-device device\n"
24167 #: ../fish/guestfish-actions.pod:4050
24169 "This command enables the libguestfs appliance to use the swap device or "
24170 "partition named C<device>. The increased memory is made available for all "
24171 "commands, for example those run using L</command> or L</sh>."
24175 #: ../fish/guestfish-actions.pod:4062
24176 msgid "swapon-file"
24180 #: ../fish/guestfish-actions.pod:4064
24183 " swapon-file file\n"
24188 #: ../fish/guestfish-actions.pod:4066
24190 "This command enables swap to a file. See L</swapon-device> for other notes."
24194 #: ../fish/guestfish-actions.pod:4069
24195 msgid "swapon-label"
24199 #: ../fish/guestfish-actions.pod:4071
24202 " swapon-label label\n"
24207 #: ../fish/guestfish-actions.pod:4073
24209 "This command enables swap to a labeled swap partition. See L</swapon-"
24210 "device> for other notes."
24214 #: ../fish/guestfish-actions.pod:4076
24215 msgid "swapon-uuid"
24219 #: ../fish/guestfish-actions.pod:4078
24222 " swapon-uuid uuid\n"
24227 #: ../fish/guestfish-actions.pod:4080
24229 "This command enables swap to a swap partition with the given UUID. See L</"
24230 "swapon-device> for other notes."
24234 #: ../fish/guestfish-actions.pod:4083
24239 #: ../fish/guestfish-actions.pod:4085
24247 #: ../fish/guestfish-actions.pod:4093
24252 #: ../fish/guestfish-actions.pod:4095
24260 #: ../fish/guestfish-actions.pod:4103
24265 #: ../fish/guestfish-actions.pod:4105
24268 " tail-n nrlines path\n"
24273 #: ../fish/guestfish-actions.pod:4118
24278 #: ../fish/guestfish-actions.pod:4120
24281 " tar-in (tarfile|-) directory\n"
24286 #: ../fish/guestfish-actions.pod:4125
24287 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24291 #: ../fish/guestfish-actions.pod:4130
24296 #: ../fish/guestfish-actions.pod:4132
24299 " tar-out directory (tarfile|-)\n"
24304 #: ../fish/guestfish-actions.pod:4137
24305 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24309 #: ../fish/guestfish-actions.pod:4142
24314 #: ../fish/guestfish-actions.pod:4144
24317 " tgz-in (tarball|-) directory\n"
24322 #: ../fish/guestfish-actions.pod:4149
24323 msgid "To upload an uncompressed tarball, use L</tar-in>."
24327 #: ../fish/guestfish-actions.pod:4153
24332 #: ../fish/guestfish-actions.pod:4155
24335 " tgz-out directory (tarball|-)\n"
24340 #: ../fish/guestfish-actions.pod:4160
24341 msgid "To download an uncompressed tarball, use L</tar-out>."
24345 #: ../fish/guestfish-actions.pod:4164
24350 #: ../fish/guestfish-actions.pod:4166
24358 #: ../fish/guestfish-actions.pod:4175
24363 #: ../fish/guestfish-actions.pod:4177
24371 #: ../fish/guestfish-actions.pod:4182
24372 msgid "truncate-size"
24376 #: ../fish/guestfish-actions.pod:4184
24379 " truncate-size path size\n"
24384 #: ../fish/guestfish-actions.pod:4189
24386 "If the current file size is less than C<size> then the file is extended to "
24387 "the required size with zero bytes. This creates a sparse file (ie. disk "
24388 "blocks are not allocated for the file until you write to it). To create a "
24389 "non-sparse file of zeroes, use L</fallocate64> instead."
24393 #: ../fish/guestfish-actions.pod:4195
24398 #: ../fish/guestfish-actions.pod:4197
24401 " tune2fs-l device\n"
24406 #: ../fish/guestfish-actions.pod:4207
24411 #: ../fish/guestfish-actions.pod:4209
24414 " txz-in (tarball|-) directory\n"
24419 #: ../fish/guestfish-actions.pod:4216
24424 #: ../fish/guestfish-actions.pod:4218
24427 " txz-out directory (tarball|-)\n"
24432 #: ../fish/guestfish-actions.pod:4225
24437 #: ../fish/guestfish-actions.pod:4227
24445 #: ../fish/guestfish-actions.pod:4241
24446 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24450 #: ../fish/guestfish-actions.pod:4246
24455 #: ../fish/guestfish-actions.pod:4248
24460 #: ../fish/guestfish-actions.pod:4250
24463 " umount pathordevice\n"
24468 #: ../fish/guestfish-actions.pod:4256
24473 #: ../fish/guestfish-actions.pod:4258
24474 msgid "unmount-all"
24478 #: ../fish/guestfish-actions.pod:4260
24486 #: ../fish/guestfish-actions.pod:4266
24491 #: ../fish/guestfish-actions.pod:4268
24494 " upload (filename|-) remotefilename\n"
24499 #: ../fish/guestfish-actions.pod:4275
24500 msgid "See also L</download>."
24504 #: ../fish/guestfish-actions.pod:4279
24505 msgid "upload-offset"
24509 #: ../fish/guestfish-actions.pod:4281
24512 " upload-offset (filename|-) remotefilename offset\n"
24517 #: ../fish/guestfish-actions.pod:4293
24519 "Note that there is no limit on the amount of data that can be uploaded with "
24520 "this call, unlike with L</pwrite>, and this call always writes the full "
24521 "amount unless an error occurs."
24525 #: ../fish/guestfish-actions.pod:4298
24526 msgid "See also L</upload>, L</pwrite>."
24530 #: ../fish/guestfish-actions.pod:4302
24535 #: ../fish/guestfish-actions.pod:4304
24538 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24543 #: ../fish/guestfish-actions.pod:4323
24548 #: ../fish/guestfish-actions.pod:4325
24556 #: ../fish/guestfish-actions.pod:4352
24558 "I<Note:> Don't use this call to test for availability of features. In "
24559 "enterprise distributions we backport features from later versions into "
24560 "earlier versions, making this an unreliable way to test for features. Use "
24561 "L</available> instead."
24565 #: ../fish/guestfish-actions.pod:4358
24570 #: ../fish/guestfish-actions.pod:4360
24573 " vfs-label device\n"
24578 #: ../fish/guestfish-actions.pod:4367
24579 msgid "To find a filesystem from the label, use L</findfs-label>."
24583 #: ../fish/guestfish-actions.pod:4369
24588 #: ../fish/guestfish-actions.pod:4371
24591 " vfs-type device\n"
24596 #: ../fish/guestfish-actions.pod:4381
24601 #: ../fish/guestfish-actions.pod:4383
24604 " vfs-uuid device\n"
24609 #: ../fish/guestfish-actions.pod:4390
24610 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24614 #: ../fish/guestfish-actions.pod:4392
24615 msgid "vg-activate"
24619 #: ../fish/guestfish-actions.pod:4394
24622 " vg-activate true|false 'volgroups ...'\n"
24627 #: ../fish/guestfish-actions.pod:4407
24628 msgid "vg-activate-all"
24632 #: ../fish/guestfish-actions.pod:4409
24635 " vg-activate-all true|false\n"
24640 #: ../fish/guestfish-actions.pod:4419
24645 #: ../fish/guestfish-actions.pod:4421
24648 " vgcreate volgroup 'physvols ...'\n"
24653 #: ../fish/guestfish-actions.pod:4426
24658 #: ../fish/guestfish-actions.pod:4428
24661 " vglvuuids vgname\n"
24666 #: ../fish/guestfish-actions.pod:4433
24668 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24669 "logical volumes and volume groups."
24673 #: ../fish/guestfish-actions.pod:4436
24674 msgid "See also L</vgpvuuids>."
24678 #: ../fish/guestfish-actions.pod:4438
24683 #: ../fish/guestfish-actions.pod:4440
24686 " vgpvuuids vgname\n"
24691 #: ../fish/guestfish-actions.pod:4445
24693 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24694 "physical volumes and volume groups."
24698 #: ../fish/guestfish-actions.pod:4448
24699 msgid "See also L</vglvuuids>."
24703 #: ../fish/guestfish-actions.pod:4450
24708 #: ../fish/guestfish-actions.pod:4452
24711 " vgremove vgname\n"
24716 #: ../fish/guestfish-actions.pod:4459
24721 #: ../fish/guestfish-actions.pod:4461
24724 " vgrename volgroup newvolgroup\n"
24729 #: ../fish/guestfish-actions.pod:4465
24734 #: ../fish/guestfish-actions.pod:4467
24742 #: ../fish/guestfish-actions.pod:4475
24743 msgid "See also L</vgs-full>."
24747 #: ../fish/guestfish-actions.pod:4477
24752 #: ../fish/guestfish-actions.pod:4479
24760 #: ../fish/guestfish-actions.pod:4484
24765 #: ../fish/guestfish-actions.pod:4486
24773 #: ../fish/guestfish-actions.pod:4491
24778 #: ../fish/guestfish-actions.pod:4493
24786 #: ../fish/guestfish-actions.pod:4497
24791 #: ../fish/guestfish-actions.pod:4499
24799 #: ../fish/guestfish-actions.pod:4504
24804 #: ../fish/guestfish-actions.pod:4506
24812 #: ../fish/guestfish-actions.pod:4511
24817 #: ../fish/guestfish-actions.pod:4513
24825 #: ../fish/guestfish-actions.pod:4518
24830 #: ../fish/guestfish-actions.pod:4520
24833 " write path content\n"
24838 #: ../fish/guestfish-actions.pod:4528
24843 #: ../fish/guestfish-actions.pod:4530
24846 " write-file path content size\n"
24851 #: ../fish/guestfish-actions.pod:4553
24856 #: ../fish/guestfish-actions.pod:4555
24859 " zegrep regex path\n"
24864 #: ../fish/guestfish-actions.pod:4563
24869 #: ../fish/guestfish-actions.pod:4565
24872 " zegrepi regex path\n"
24877 #: ../fish/guestfish-actions.pod:4573
24882 #: ../fish/guestfish-actions.pod:4575
24890 #: ../fish/guestfish-actions.pod:4583
24891 msgid "See also: L</zero-device>, L</scrub-device>."
24895 #: ../fish/guestfish-actions.pod:4585
24896 msgid "zero-device"
24900 #: ../fish/guestfish-actions.pod:4587
24903 " zero-device device\n"
24908 #: ../fish/guestfish-actions.pod:4589
24910 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
24911 "which just zeroes the first few blocks of a device."
24915 #: ../fish/guestfish-actions.pod:4596
24920 #: ../fish/guestfish-actions.pod:4598
24923 " zerofree device\n"
24928 #: ../fish/guestfish-actions.pod:4611
24933 #: ../fish/guestfish-actions.pod:4613
24936 " zfgrep pattern path\n"
24941 #: ../fish/guestfish-actions.pod:4621
24946 #: ../fish/guestfish-actions.pod:4623
24949 " zfgrepi pattern path\n"
24954 #: ../fish/guestfish-actions.pod:4631
24959 #: ../fish/guestfish-actions.pod:4633
24962 " zfile meth path\n"
24967 #: ../fish/guestfish-actions.pod:4640
24969 "Since 1.0.63, use L</file> instead which can now process compressed files."
24973 #: ../fish/guestfish-actions.pod:4650
24978 #: ../fish/guestfish-actions.pod:4652
24981 " zgrep regex path\n"
24986 #: ../fish/guestfish-actions.pod:4660
24991 #: ../fish/guestfish-actions.pod:4662
24994 " zgrepi regex path\n"
24999 #: ../fish/guestfish-commands.pod:1
25004 #: ../fish/guestfish-commands.pod:3
25009 #: ../fish/guestfish-commands.pod:5
25012 " alloc filename size\n"
25017 #: ../fish/guestfish-commands.pod:7
25019 "This creates an empty (zeroed) file of the given size, and then adds so it "
25020 "can be further examined."
25024 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25025 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25029 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25030 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25034 #: ../fish/guestfish-commands.pod:14
25036 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25037 "image, see L</PREPARED DISK IMAGES>."
25041 #: ../fish/guestfish-commands.pod:17
25046 #: ../fish/guestfish-commands.pod:19
25049 " copy-in local [local ...] /remotedir\n"
25054 #: ../fish/guestfish-commands.pod:21
25056 "C<copy-in> copies local files or directories recursively into the disk "
25057 "image, placing them in the directory called C</remotedir> (which must "
25058 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25059 "other commands as necessary."
25063 #: ../fish/guestfish-commands.pod:26
25065 "Multiple local files and directories can be specified, but the last "
25066 "parameter must always be a remote directory. Wildcards cannot be used."
25070 #: ../fish/guestfish-commands.pod:30
25075 #: ../fish/guestfish-commands.pod:32
25078 " copy-out remote [remote ...] localdir\n"
25083 #: ../fish/guestfish-commands.pod:34
25085 "C<copy-out> copies remote files or directories recursively out of the disk "
25086 "image, placing them on the host disk in a local directory called C<localdir> "
25087 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25088 "download>, L</tar-out> and other commands as necessary."
25092 #: ../fish/guestfish-commands.pod:40
25094 "Multiple remote files and directories can be specified, but the last "
25095 "parameter must always be a local directory. To download to the current "
25096 "directory, use C<.> as in:"
25100 #: ../fish/guestfish-commands.pod:44
25103 " copy-out /home .\n"
25108 #: ../fish/guestfish-commands.pod:46
25110 "Wildcards cannot be used in the ordinary command, but you can use them with "
25111 "the help of L</glob> like this:"
25115 #: ../fish/guestfish-commands.pod:49
25118 " glob copy-out /home/* .\n"
25123 #: ../fish/guestfish-commands.pod:51
25128 #: ../fish/guestfish-commands.pod:53
25131 " echo [params ...]\n"
25136 #: ../fish/guestfish-commands.pod:55
25137 msgid "This echos the parameters to the terminal."
25141 #: ../fish/guestfish-commands.pod:57
25146 #: ../fish/guestfish-commands.pod:59
25151 #: ../fish/guestfish-commands.pod:61
25156 #: ../fish/guestfish-commands.pod:63
25164 #: ../fish/guestfish-commands.pod:65
25166 "This is used to edit a file. It downloads the file, edits it locally using "
25167 "your editor, then uploads the result."
25171 #: ../fish/guestfish-commands.pod:68
25173 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25174 "or C<emacs> you will get those corresponding editors."
25178 #: ../fish/guestfish-commands.pod:72
25183 #: ../fish/guestfish-commands.pod:74
25186 " glob command args...\n"
25191 #: ../fish/guestfish-commands.pod:76
25193 "Expand wildcards in any paths in the args list, and run C<command> "
25194 "repeatedly on each matching path."
25198 #: ../fish/guestfish-commands.pod:79
25199 msgid "See L</WILDCARDS AND GLOBBING>."
25203 #: ../fish/guestfish-commands.pod:81
25208 #: ../fish/guestfish-commands.pod:83
25211 " hexedit <filename|device>\n"
25212 " hexedit <filename|device> <max>\n"
25213 " hexedit <filename|device> <start> <max>\n"
25218 #: ../fish/guestfish-commands.pod:87
25220 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25225 #: ../fish/guestfish-commands.pod:90
25227 "This command works by downloading potentially the whole file or device, "
25228 "editing it locally, then uploading it. If the file or device is large, you "
25229 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25230 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25231 "usual modifiers allowed such as C<1M> (1 megabyte)."
25235 #: ../fish/guestfish-commands.pod:97
25236 msgid "For example to edit the first few sectors of a disk you might do:"
25240 #: ../fish/guestfish-commands.pod:100
25243 " hexedit /dev/sda 1M\n"
25248 #: ../fish/guestfish-commands.pod:102
25250 "which would allow you to edit anywhere within the first megabyte of the disk."
25254 #: ../fish/guestfish-commands.pod:105
25255 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25259 #: ../fish/guestfish-commands.pod:107
25262 " hexedit /dev/sda1 0x400 0x400\n"
25267 #: ../fish/guestfish-commands.pod:109
25268 msgid "(assuming the superblock is in the standard location)."
25272 #: ../fish/guestfish-commands.pod:111
25274 "This command requires the external L<hexedit(1)> program. You can specify "
25275 "another program to use by setting the C<HEXEDITOR> environment variable."
25279 #: ../fish/guestfish-commands.pod:115
25280 msgid "See also L</hexdump>."
25284 #: ../fish/guestfish-commands.pod:117
25289 #: ../fish/guestfish-commands.pod:119
25297 #: ../fish/guestfish-commands.pod:121
25299 "Change the local directory, ie. the current directory of guestfish itself."
25303 #: ../fish/guestfish-commands.pod:124
25304 msgid "Note that C<!cd> won't do what you might expect."
25308 #: ../fish/guestfish-commands.pod:126
25313 #: ../fish/guestfish-commands.pod:128
25318 #: ../fish/guestfish-commands.pod:130
25326 #: ../fish/guestfish-commands.pod:132
25327 msgid "Opens the manual page for guestfish."
25331 #: ../fish/guestfish-commands.pod:134
25336 #: ../fish/guestfish-commands.pod:136
25341 #: ../fish/guestfish-commands.pod:138
25349 #: ../fish/guestfish-commands.pod:140
25357 #: ../fish/guestfish-commands.pod:142
25358 msgid "This is used to view a file."
25362 #: ../fish/guestfish-commands.pod:144
25364 "The default viewer is C<$PAGER>. However if you use the alternate command "
25365 "C<less> you will get the C<less> command specifically."
25369 #: ../fish/guestfish-commands.pod:147
25374 #: ../fish/guestfish-commands.pod:149
25382 #: ../fish/guestfish-commands.pod:151
25384 "Close and reopen the libguestfs handle. It is not necessary to use this "
25385 "normally, because the handle is closed properly when guestfish exits. "
25386 "However this is occasionally useful for testing."
25390 #: ../fish/guestfish-commands.pod:155
25395 #: ../fish/guestfish-commands.pod:157
25398 " sparse filename size\n"
25403 #: ../fish/guestfish-commands.pod:159
25405 "This creates an empty sparse file of the given size, and then adds so it can "
25406 "be further examined."
25410 #: ../fish/guestfish-commands.pod:162
25412 "In all respects it works the same as the L</alloc> command, except that the "
25413 "image file is allocated sparsely, which means that disk blocks are not "
25414 "assigned to the file until they are needed. Sparse disk files only use "
25415 "space when written to, but they are slower and there is a danger you could "
25416 "run out of real disk space during a write operation."
25420 #: ../fish/guestfish-commands.pod:172
25425 #: ../fish/guestfish-commands.pod:174
25433 #: ../fish/guestfish-commands.pod:176
25435 "This command returns a list of the optional groups known to the daemon, and "
25436 "indicates which ones are supported by this build of the libguestfs appliance."
25440 #: ../fish/guestfish-commands.pod:180
25441 msgid "See also L<guestfs(3)/AVAILABILITY>."
25445 #: ../fish/guestfish-commands.pod:182
25450 #: ../fish/guestfish-commands.pod:184
25453 " time command args...\n"
25458 #: ../fish/guestfish-commands.pod:186
25460 "Run the command as usual, but print the elapsed time afterwards. This can "
25461 "be useful for benchmarking operations."
25465 #: ../test-tool/libguestfs-test-tool.pod:5
25466 msgid "libguestfs-test-tool - End user tests for libguestfs"
25470 #: ../test-tool/libguestfs-test-tool.pod:9
25473 " libguestfs-test-tool [--options]\n"
25478 #: ../test-tool/libguestfs-test-tool.pod:13
25480 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25481 "and developers, to allow them to check basic libguestfs functionality is "
25482 "working. This is needed because libguestfs occasionally breaks for reasons "
25483 "beyond our control: usually because of changes in the underlying qemu or "
25484 "kernel packages, or the host environment."
25488 #: ../test-tool/libguestfs-test-tool.pod:20
25489 msgid "If you suspect a problem in libguestfs, then just run:"
25493 #: ../test-tool/libguestfs-test-tool.pod:22
25496 " libguestfs-test-tool\n"
25501 #: ../test-tool/libguestfs-test-tool.pod:24
25502 msgid "It will print lots of diagnostic messages."
25506 #: ../test-tool/libguestfs-test-tool.pod:26
25507 msgid "If it runs to completion successfully, you will see this near the end:"
25511 #: ../test-tool/libguestfs-test-tool.pod:28
25514 " ===== TEST FINISHED OK =====\n"
25519 #: ../test-tool/libguestfs-test-tool.pod:30
25520 msgid "and the test tool will exit with code 0."
25524 #: ../test-tool/libguestfs-test-tool.pod:32
25526 "If it fails (and/or exits with non-zero error code), please paste the "
25527 "B<complete, unedited> output of the test tool into a bug report. More "
25528 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25533 #: ../test-tool/libguestfs-test-tool.pod:41
25538 #: ../test-tool/libguestfs-test-tool.pod:43
25539 msgid "Display short usage information and exit."
25543 #: ../test-tool/libguestfs-test-tool.pod:45
25544 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25548 #: ../test-tool/libguestfs-test-tool.pod:47
25550 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25551 "normally look in the C<$libexec> directory that was configured when the tool "
25556 #: ../test-tool/libguestfs-test-tool.pod:51
25557 msgid "I<--qemu qemu_binary>"
25561 #: ../test-tool/libguestfs-test-tool.pod:53
25563 "If you have downloaded another qemu binary, point this option at the full "
25564 "path of the binary to try it."
25568 #: ../test-tool/libguestfs-test-tool.pod:56
25569 msgid "I<--qemudir qemu_source_dir>"
25573 #: ../test-tool/libguestfs-test-tool.pod:58
25575 "If you have compiled qemu from source, point this option at the source "
25576 "directory to try it."
25580 #: ../test-tool/libguestfs-test-tool.pod:61
25581 msgid "I<--timeout N>"
25585 #: ../test-tool/libguestfs-test-tool.pod:63
25587 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25588 "does not usually need to be adjusted unless your machine is very slow."
25592 #: ../test-tool/libguestfs-test-tool.pod:69
25593 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25597 #: ../test-tool/libguestfs-test-tool.pod:71
25599 "If you have compiled another version of qemu from source and would like to "
25600 "try that, then you can use the I<--qemudir> option to point to the qemu "
25601 "source directory."
25605 #: ../test-tool/libguestfs-test-tool.pod:75
25607 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25608 "option to point to the binary."
25612 #: ../test-tool/libguestfs-test-tool.pod:78
25614 "When using an alternate qemu with libguestfs, usually you would need to "
25615 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
25616 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
25617 "use either of the I<--qemudir> or I<--qemu> options."
25621 #: ../test-tool/libguestfs-test-tool.pod:85
25623 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25624 "I<1> if there was an error."
25628 #: ../test-tool/libguestfs-test-tool.pod:92
25629 msgid "/usr/libexec/libguestfs-test-tool-helper"
25633 #: ../test-tool/libguestfs-test-tool.pod:94
25635 "This helper program is run inside the appliance and provides additional "
25640 #: ../test-tool/libguestfs-test-tool.pod:97
25641 msgid "/usr/bin/mkisofs"
25645 #: ../test-tool/libguestfs-test-tool.pod:99
25647 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25648 "which is used as part of the tests."
25652 #: ../test-tool/libguestfs-test-tool.pod:106
25654 "For the full list of environment variables which may affect libguestfs, "
25655 "please see the L<guestfs(3)> manual page."
25659 #: ../test-tool/libguestfs-test-tool.pod:111
25660 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25664 #: ../test-tool/libguestfs-test-tool.pod:121
25665 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25669 #: ../fuse/guestmount.pod:5
25671 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25675 #: ../fuse/guestmount.pod:9
25678 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25683 #: ../fuse/guestmount.pod:11
25686 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25691 #: ../fuse/guestmount.pod:13
25694 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25699 #: ../fuse/guestmount.pod:17
25701 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25702 "machines. If you do this, you risk disk corruption in the VM."
25706 #: ../fuse/guestmount.pod:22
25708 "The guestmount program can be used to mount virtual machine filesystems and "
25709 "other disk images on the host. It uses libguestfs for access to the guest "
25710 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25711 "a mountable device."
25715 #: ../fuse/guestmount.pod:27
25717 "Along with other options, you have to give at least one device (I<-a> "
25718 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25719 "option) or use the I<-i> inspection option. How this works is better "
25720 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25725 #: ../fuse/guestmount.pod:33
25727 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25728 "by you, and the filesystem will not be visible to any other users unless you "
25729 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25730 "the filesystem, use the C<fusermount -u> command."
25734 #: ../fuse/guestmount.pod:41
25736 "For a typical Windows guest which has its main filesystem on the first "
25741 #: ../fuse/guestmount.pod:44
25744 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25749 #: ../fuse/guestmount.pod:46
25751 "For a typical Linux guest which has a /boot filesystem on the first "
25752 "partition, and the root filesystem on a logical volume:"
25756 #: ../fuse/guestmount.pod:49
25759 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25764 #: ../fuse/guestmount.pod:51
25765 msgid "To get libguestfs to detect guest mountpoints for you:"
25769 #: ../fuse/guestmount.pod:53
25772 " guestmount -a guest.img -i --ro /mnt\n"
25777 #: ../fuse/guestmount.pod:55
25778 msgid "For a libvirt guest called \"Guest\" you could do:"
25782 #: ../fuse/guestmount.pod:57
25785 " guestmount -d Guest -i --ro /mnt\n"
25790 #: ../fuse/guestmount.pod:59
25792 "If you don't know what filesystems are contained in a guest or disk image, "
25793 "use L<virt-list-filesystems(1)> first:"
25797 #: ../fuse/guestmount.pod:62
25800 " virt-list-filesystems MyGuest\n"
25805 #: ../fuse/guestmount.pod:64
25807 "If you want to trace the libguestfs calls but without excessive debugging "
25808 "information, we recommend:"
25812 #: ../fuse/guestmount.pod:67
25815 " guestmount [...] --trace /mnt\n"
25820 #: ../fuse/guestmount.pod:69
25821 msgid "If you want to debug the program, we recommend:"
25825 #: ../fuse/guestmount.pod:71
25828 " guestmount [...] --trace --verbose /mnt\n"
25833 #: ../fuse/guestmount.pod:79
25834 msgid "Add a block device or virtual machine image."
25838 #: ../fuse/guestmount.pod:96
25839 msgid "B<--dir-cache-timeout N>"
25843 #: ../fuse/guestmount.pod:98
25845 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25846 "seconds. The readdir cache [actually, there are several semi-independent "
25847 "caches] is populated after a readdir(2) call with the stat and extended "
25848 "attributes of the files in the directory, in anticipation that they will be "
25849 "requested soon after."
25853 #: ../fuse/guestmount.pod:104
25855 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25856 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25857 "requests, only cache existing ones."
25861 #: ../fuse/guestmount.pod:122
25863 "If you have untrusted raw-format guest disk images, you should use this "
25864 "option to specify the disk format. This avoids a possible security problem "
25865 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
25866 "guestfs_add_drive_opts>."
25870 #: ../fuse/guestmount.pod:127
25871 msgid "B<--fuse-help>"
25875 #: ../fuse/guestmount.pod:129
25876 msgid "Display help on special FUSE options (see I<-o> below)."
25880 #: ../fuse/guestmount.pod:133
25881 msgid "Display brief help and exit."
25885 #: ../fuse/guestmount.pod:146
25886 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
25890 #: ../fuse/guestmount.pod:148
25892 "Mount the named partition or logical volume on the given mountpoint B<in the "
25893 "guest> (this has nothing to do with mountpoints in the host)."
25897 #: ../fuse/guestmount.pod:151
25899 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
25900 "something on C</>."
25904 #: ../fuse/guestmount.pod:156
25906 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
25907 "unmounted. If you specify this option, then we don't attempt to sync the "
25908 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
25912 #: ../fuse/guestmount.pod:161
25913 msgid "B<-o option> | B<--option option>"
25917 #: ../fuse/guestmount.pod:163
25918 msgid "Pass extra options to FUSE."
25922 #: ../fuse/guestmount.pod:165
25924 "To get a list of all the extra options supported by FUSE, use the command "
25925 "below. Note that only the FUSE I<-o> options can be passed, and only some "
25926 "of them are a good idea."
25930 #: ../fuse/guestmount.pod:169
25933 " guestmount --fuse-help\n"
25938 #: ../fuse/guestmount.pod:171
25939 msgid "Some potentially useful FUSE options:"
25943 #: ../fuse/guestmount.pod:175
25944 msgid "B<-o allow_other>"
25948 #: ../fuse/guestmount.pod:177
25949 msgid "Allow other users to see the filesystem."
25953 #: ../fuse/guestmount.pod:179
25954 msgid "B<-o attr_timeout=N>"
25958 #: ../fuse/guestmount.pod:181
25959 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
25963 #: ../fuse/guestmount.pod:183
25964 msgid "B<-o kernel_cache>"
25968 #: ../fuse/guestmount.pod:185
25970 "Allow the kernel to cache files (reduces the number of reads that have to go "
25971 "through the L<guestfs(3)> API). This is generally a good idea if you can "
25972 "afford the extra memory usage."
25976 #: ../fuse/guestmount.pod:189
25977 msgid "B<-o uid=N> B<-o gid=N>"
25981 #: ../fuse/guestmount.pod:191
25983 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
25984 "the chosen values."
25988 #: ../fuse/guestmount.pod:198
25990 "Add devices and mount everything read-only. Also disallow writes and make "
25991 "the disk appear read-only to FUSE."
25995 #: ../fuse/guestmount.pod:201
25997 "This is highly recommended if you are not going to edit the guest disk. If "
25998 "the guest is running and this option is I<not> supplied, then there is a "
25999 "strong risk of disk corruption in the guest. We try to prevent this from "
26000 "happening, but it is not always possible."
26004 #: ../fuse/guestmount.pod:206
26005 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26009 #: ../fuse/guestmount.pod:210
26010 msgid "Enable SELinux support for the guest."
26014 #: ../fuse/guestmount.pod:214
26015 msgid "Enable verbose messages from underlying libguestfs."
26019 #: ../fuse/guestmount.pod:218
26020 msgid "Display the program version and exit."
26024 #: ../fuse/guestmount.pod:222
26026 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26027 "FOR READ AND WRITE>."
26031 #: ../fuse/guestmount.pod:225
26032 msgid "B<-x> | B<--trace>"
26036 #: ../fuse/guestmount.pod:227
26037 msgid "Trace libguestfs calls."
26041 #: ../fuse/guestmount.pod:229
26042 msgid "This also stops the daemon from forking into the background."
26046 #: ../fuse/guestmount.pod:235
26048 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26049 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26054 #: ../tools/virt-edit.pl:34
26055 msgid "virt-edit - Edit a file in a virtual machine"
26059 #: ../tools/virt-edit.pl:38
26062 " virt-edit [--options] domname file\n"
26067 #: ../tools/virt-edit.pl:40
26070 " virt-edit [--options] disk.img [disk.img ...] file\n"
26075 #: ../tools/virt-edit.pl:42
26078 " virt-edit [domname|disk.img] file -e 'expr'\n"
26083 #: ../tools/virt-edit.pl:46
26085 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26086 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26087 "doing this, but doesn't catch all cases."
26091 #: ../tools/virt-edit.pl:52
26093 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26094 "the named virtual machine (or disk image)."
26098 #: ../tools/virt-edit.pl:55
26100 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26101 "you should look at the L<guestfish(1)> tool."
26105 #: ../tools/virt-edit.pl:60
26106 msgid "Edit the named files interactively:"
26110 #: ../tools/virt-edit.pl:62
26113 " virt-edit mydomain /boot/grub/grub.conf\n"
26118 #: ../tools/virt-edit.pl:64
26121 " virt-edit mydomain /etc/passwd\n"
26126 #: ../tools/virt-edit.pl:66
26128 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26129 "below). To change the init default level to 5:"
26133 #: ../tools/virt-edit.pl:70
26136 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26141 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181
26142 #: ../tools/virt-df.pl:81 ../tools/virt-ls.pl:88
26143 #: ../tools/virt-list-filesystems.pl:60 ../tools/virt-tar.pl:108
26144 #: ../tools/virt-rescue.pl:113 ../tools/virt-make-fs.pl:163
26145 #: ../tools/virt-list-partitions.pl:61
26146 msgid "Display brief help."
26150 #: ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187
26151 #: ../tools/virt-df.pl:87 ../tools/virt-ls.pl:94 ../tools/virt-resize.pl:273
26152 #: ../tools/virt-list-filesystems.pl:66 ../tools/virt-tar.pl:114
26153 #: ../tools/virt-rescue.pl:119 ../tools/virt-make-fs.pl:169
26154 #: ../tools/virt-list-partitions.pl:67
26155 msgid "B<--version>"
26159 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189
26160 #: ../tools/virt-df.pl:89 ../tools/virt-ls.pl:96 ../tools/virt-resize.pl:275
26161 #: ../tools/virt-list-filesystems.pl:68 ../tools/virt-tar.pl:116
26162 #: ../tools/virt-rescue.pl:121 ../tools/virt-make-fs.pl:171
26163 #: ../tools/virt-list-partitions.pl:69
26164 msgid "Display version number and exit."
26168 #: ../tools/virt-edit.pl:96
26169 msgid "B<--backup extension> | B<-b extension>"
26173 #: ../tools/virt-edit.pl:98
26175 "Create a backup of the original file I<in the guest disk image>. The backup "
26176 "has the original filename with C<extension> added."
26180 #: ../tools/virt-edit.pl:101
26182 "Usually the first character of C<extension> would be a dot C<.> so you would "
26187 #: ../tools/virt-edit.pl:104
26190 " virt-edit -b .orig [etc]\n"
26195 #: ../tools/virt-edit.pl:106
26196 msgid "By default, no backup file is made."
26200 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203
26201 #: ../tools/virt-df.pl:95 ../tools/virt-ls.pl:102
26202 #: ../tools/virt-list-filesystems.pl:74 ../tools/virt-tar.pl:122
26203 #: ../tools/virt-rescue.pl:135 ../tools/virt-list-partitions.pl:75
26204 msgid "B<--connect URI> | B<-c URI>"
26208 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205
26209 #: ../tools/virt-df.pl:97 ../tools/virt-ls.pl:104
26210 #: ../tools/virt-list-filesystems.pl:76 ../tools/virt-tar.pl:124
26211 #: ../tools/virt-rescue.pl:137 ../tools/virt-list-partitions.pl:77
26213 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26214 "to the default libvirt hypervisor."
26218 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
26219 #: ../tools/virt-df.pl:100 ../tools/virt-ls.pl:107
26220 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:127
26221 #: ../tools/virt-rescue.pl:140 ../tools/virt-list-partitions.pl:80
26223 "If you specify guest block devices directly, then libvirt is not used at all."
26227 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215
26228 #: ../tools/virt-df.pl:117 ../tools/virt-ls.pl:114 ../tools/virt-resize.pl:523
26229 #: ../tools/virt-list-filesystems.pl:86 ../tools/virt-tar.pl:134
26230 #: ../tools/virt-rescue.pl:147 ../tools/virt-list-partitions.pl:87
26231 msgid "B<--format> raw"
26235 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217
26236 #: ../tools/virt-df.pl:119 ../tools/virt-ls.pl:116
26237 #: ../tools/virt-list-filesystems.pl:88 ../tools/virt-tar.pl:136
26238 #: ../tools/virt-rescue.pl:149 ../tools/virt-list-partitions.pl:89
26240 "Specify the format of disk images given on the command line. If this is "
26241 "omitted then the format is autodetected from the content of the disk image."
26245 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221
26246 #: ../tools/virt-df.pl:123 ../tools/virt-ls.pl:120
26247 #: ../tools/virt-list-filesystems.pl:92 ../tools/virt-tar.pl:140
26248 #: ../tools/virt-rescue.pl:153 ../tools/virt-list-partitions.pl:93
26250 "If disk images are requested from libvirt, then this program asks libvirt "
26251 "for this information. In this case, the value of the format parameter is "
26256 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225
26257 #: ../tools/virt-df.pl:127 ../tools/virt-ls.pl:124 ../tools/virt-resize.pl:528
26258 #: ../tools/virt-resize.pl:543 ../tools/virt-list-filesystems.pl:96
26259 #: ../tools/virt-tar.pl:144 ../tools/virt-rescue.pl:157
26260 #: ../tools/virt-list-partitions.pl:97
26262 "If working with untrusted raw-format guest disk images, you should ensure "
26263 "the format is always specified."
26267 #: ../tools/virt-edit.pl:141
26268 msgid "B<--expr EXPR> | B<-e EXPR>"
26272 #: ../tools/virt-edit.pl:143
26274 "Instead of launching the external editor, non-interactively apply the Perl "
26275 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26280 #: ../tools/virt-edit.pl:147
26282 "Be careful to properly quote the expression to prevent it from being altered "
26287 #: ../tools/virt-edit.pl:268
26288 msgid "NON-INTERACTIVE EDITING"
26292 #: ../tools/virt-edit.pl:270
26294 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26295 "administrator can interactively edit the file."
26299 #: ../tools/virt-edit.pl:273
26301 "There are two ways also to use C<virt-edit> from scripts in order to make "
26302 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26303 "like this, it's less error-prone to write scripts directly using the "
26304 "libguestfs API and Augeas for configuration file editing.)"
26308 #: ../tools/virt-edit.pl:279
26310 "The first method is to temporarily set C<$EDITOR> to any script or program "
26311 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26312 "update C<tmpfile> in place however it likes."
26316 #: ../tools/virt-edit.pl:283
26318 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26319 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26320 "instances of C<foo> with C<bar> in a file:"
26324 #: ../tools/virt-edit.pl:287
26327 " virt-edit domname filename -e 's/foo/bar/'\n"
26332 #: ../tools/virt-edit.pl:289
26334 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26335 "For example to delete root's password you could do:"
26339 #: ../tools/virt-edit.pl:292
26342 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26347 #: ../tools/virt-edit.pl:294
26349 "What really happens is that the snippet is evaluated as a Perl expression "
26350 "for each line of the file. The line, including the final C<\\n>, is passed "
26351 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26355 #: ../tools/virt-edit.pl:299
26357 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26358 "C<apache> user account from the password file you can do:"
26362 #: ../tools/virt-edit.pl:302
26365 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26370 #: ../tools/virt-edit.pl:304
26372 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26373 "the end of the file is rather difficult this way since there is no concept "
26374 "of \"last line of the file\" - your expression just doesn't get called "
26375 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26380 #: ../tools/virt-edit.pl:310
26382 "The variable C<$lineno> contains the current line number. As is "
26383 "traditional, the first line in the file is number C<1>."
26387 #: ../tools/virt-edit.pl:313
26389 "The return value from the expression is ignored, but the expression may call "
26390 "C<die> in order to abort the whole program, leaving the original file "
26395 #: ../tools/virt-edit.pl:317
26397 "Remember when matching the end of a line that C<$_> may contain the final C<"
26398 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26399 "newline then neither of these. Thus to match or substitute some text at the "
26400 "end of a line, use this regular expression:"
26404 #: ../tools/virt-edit.pl:322
26407 " /some text(\\r?\\n)?$/\n"
26412 #: ../tools/virt-edit.pl:324
26414 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26415 "$_> itself (since that would remove all newlines from the file):"
26419 #: ../tools/virt-edit.pl:328
26422 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26427 #: ../tools/virt-edit.pl:334
26432 #: ../tools/virt-edit.pl:336
26434 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26439 #: ../tools/virt-edit.pl:339
26440 msgid "If not set, C<vi> is used."
26444 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141
26445 #: ../tools/virt-win-reg.pl:477 ../tools/virt-df.pl:633
26446 #: ../tools/virt-ls.pl:225 ../tools/virt-resize.pl:1479
26447 #: ../tools/virt-list-filesystems.pl:179 ../tools/virt-tar.pl:274
26448 #: ../tools/virt-rescue.pl:260 ../tools/virt-make-fs.pl:527
26449 #: ../tools/virt-list-partitions.pl:247
26450 msgid "SHELL QUOTING"
26454 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479
26455 #: ../tools/virt-df.pl:635 ../tools/virt-ls.pl:227
26456 #: ../tools/virt-resize.pl:1481 ../tools/virt-list-filesystems.pl:181
26457 #: ../tools/virt-tar.pl:276 ../tools/virt-rescue.pl:262
26458 #: ../tools/virt-make-fs.pl:529 ../tools/virt-list-partitions.pl:249
26460 "Libvirt guest names can contain arbitrary characters, some of which have "
26461 "meaning to the shell such as C<#> and space. You may need to quote or "
26462 "escape these characters on the command line. See the shell manual page L<sh"
26463 "(1)> for details."
26467 #: ../tools/virt-edit.pl:352
26469 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26470 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26475 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
26476 #: ../tools/virt-df.pl:649 ../tools/virt-ls.pl:243
26477 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:198
26478 #: ../tools/virt-tar.pl:292 ../tools/virt-rescue.pl:277
26479 #: ../tools/virt-make-fs.pl:559 ../tools/virt-list-partitions.pl:265
26484 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512
26485 #: ../tools/virt-df.pl:651 ../tools/virt-ls.pl:245
26486 #: ../tools/virt-resize.pl:1510 ../tools/virt-list-filesystems.pl:200
26487 #: ../tools/virt-tar.pl:294 ../tools/virt-rescue.pl:279
26488 #: ../tools/virt-make-fs.pl:561 ../tools/virt-list-partitions.pl:267
26489 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26493 #: ../tools/virt-edit.pl:368 ../tools/virt-df.pl:655
26494 #: ../tools/virt-rescue.pl:283 ../tools/virt-list-partitions.pl:271
26495 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26499 #: ../tools/virt-win-reg.pl:37
26501 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26505 #: ../tools/virt-win-reg.pl:41
26508 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26513 #: ../tools/virt-win-reg.pl:43
26516 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26521 #: ../tools/virt-win-reg.pl:45
26524 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26529 #: ../tools/virt-win-reg.pl:47
26532 " virt-win-reg --merge domname [input.reg ...]\n"
26537 #: ../tools/virt-win-reg.pl:49
26540 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26545 #: ../tools/virt-win-reg.pl:53
26547 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26548 "virtual machines. If you do this, you I<will> get irreversible disk "
26549 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26550 "but doesn't catch all cases."
26554 #: ../tools/virt-win-reg.pl:58
26556 "Modifying the Windows Registry is an inherently risky operation. The format "
26557 "is deliberately obscure and undocumented, and Registry changes can leave the "
26558 "system unbootable. Therefore when using the C<--merge> option, make sure "
26559 "you have a reliable backup first."
26563 #: ../tools/virt-win-reg.pl:65
26565 "This program can export and merge Windows Registry entries from a Windows "
26570 #: ../tools/virt-win-reg.pl:68
26572 "The first parameter is the libvirt guest name or the raw disk image of a "
26577 #: ../tools/virt-win-reg.pl:71
26579 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26580 "exported (recursively). For example:"
26584 #: ../tools/virt-win-reg.pl:74
26587 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26592 #: ../tools/virt-win-reg.pl:76
26594 "You can also display single values from within registry keys, for example:"
26598 #: ../tools/virt-win-reg.pl:79
26601 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26602 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26603 " Windows 7 Enterprise\n"
26608 #: ../tools/virt-win-reg.pl:83
26610 "With C<--merge>, you can merge a textual regedit file into the Windows "
26615 #: ../tools/virt-win-reg.pl:86
26618 " $ virt-win-reg --merge Windows7 changes.reg\n"
26623 #: ../tools/virt-win-reg.pl:88
26624 msgid "SUPPORTED SYSTEMS"
26628 #: ../tools/virt-win-reg.pl:90
26630 "The program currently supports Windows NT-derived guests starting with "
26631 "Windows XP through to at least Windows 7."
26635 #: ../tools/virt-win-reg.pl:93
26637 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26638 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26639 "and C<HKEY_USERS\\.DEFAULT>."
26643 #: ../tools/virt-win-reg.pl:97
26645 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26650 #: ../tools/virt-win-reg.pl:100
26652 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26657 #: ../tools/virt-win-reg.pl:103
26662 #: ../tools/virt-win-reg.pl:105
26664 "This program is only meant for simple access to the registry. If you want "
26665 "to do complicated things with the registry, we suggest you download the "
26666 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26667 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26668 "L<hivexregedit(1)>."
26672 #: ../tools/virt-win-reg.pl:111
26677 #: ../tools/virt-win-reg.pl:113
26679 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26680 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26681 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26682 "Windows-style line endings, you may need to reencode the whole file before "
26683 "or after processing."
26687 #: ../tools/virt-win-reg.pl:119
26689 "To reencode a file from Windows format to Linux (before processing it with "
26690 "the C<--merge> option), you would do something like this:"
26694 #: ../tools/virt-win-reg.pl:122
26697 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26702 #: ../tools/virt-win-reg.pl:124
26704 "To go in the opposite direction, after exporting and before sending the file "
26705 "to a Windows user, do something like this:"
26709 #: ../tools/virt-win-reg.pl:127
26712 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26717 #: ../tools/virt-win-reg.pl:129
26718 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26722 #: ../tools/virt-win-reg.pl:131
26724 "If you are unsure about the current encoding, use the L<file(1)> command. "
26725 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26726 "style (CRLF) line endings, like this:"
26730 #: ../tools/virt-win-reg.pl:135
26733 " $ file software.reg\n"
26734 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26735 " with CRLF line terminators\n"
26740 #: ../tools/virt-win-reg.pl:139
26741 msgid "This file would need conversion before you could C<--merge> it."
26745 #: ../tools/virt-win-reg.pl:143
26747 "Be careful when passing parameters containing C<\\> (backslash) in the "
26748 "shell. Usually you will have to use 'single quotes' or double backslashes "
26749 "(but not both) to protect them from the shell."
26753 #: ../tools/virt-win-reg.pl:147
26754 msgid "Paths and value names are case-insensitive."
26758 #: ../tools/virt-win-reg.pl:149
26759 msgid "CurrentControlSet etc."
26763 #: ../tools/virt-win-reg.pl:151
26765 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26766 "Registry at the level of the hive file, and therefore you cannot modify "
26771 #: ../tools/virt-win-reg.pl:155
26773 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26774 "circumstances it might refer to another control set. The way to find out is "
26775 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26779 #: ../tools/virt-win-reg.pl:159
26782 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26783 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26784 " \"Current\"=dword:00000001\n"
26785 " \"Default\"=dword:00000001\n"
26786 " \"Failed\"=dword:00000000\n"
26787 " \"LastKnownGood\"=dword:00000002\n"
26792 #: ../tools/virt-win-reg.pl:166
26793 msgid "\"Current\" is the one which Windows will choose when it boots."
26797 #: ../tools/virt-win-reg.pl:168
26799 "Similarly, other C<Current...> keys in the path may need to be replaced."
26803 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
26808 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:501
26809 msgid "Enable debugging messages."
26813 #: ../tools/virt-win-reg.pl:232
26818 #: ../tools/virt-win-reg.pl:234
26820 "In merge mode, this merges a textual regedit file into the Windows Registry "
26821 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26822 "displays or exports Registry entries instead."
26826 #: ../tools/virt-win-reg.pl:238
26828 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26829 "result in disk corruption. However exporting (without this flag) is always "
26834 #: ../tools/virt-win-reg.pl:246
26835 msgid "B<--encoding> UTF-16LE|ASCII"
26839 #: ../tools/virt-win-reg.pl:248
26841 "When merging (only), you may need to specify the encoding for strings to be "
26842 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26843 "(3)/ENCODING STRINGS>."
26847 #: ../tools/virt-win-reg.pl:252
26849 "The default is to use UTF-16LE, which should work with recent versions of "
26854 #: ../tools/virt-win-reg.pl:486
26856 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26857 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26858 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26862 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
26864 "When reporting bugs, please enable debugging and capture the I<complete> "
26869 #: ../tools/virt-win-reg.pl:504
26872 " export LIBGUESTFS_DEBUG=1\n"
26873 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26878 #: ../tools/virt-win-reg.pl:507
26880 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
26885 #: ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1514
26886 #: ../tools/virt-make-fs.pl:565
26887 msgid "Copyright (C) 2010 Red Hat Inc."
26891 #: ../tools/virt-df.pl:36
26892 msgid "virt-df - Display free space on virtual filesystems"
26896 #: ../tools/virt-df.pl:40
26899 " virt-df [--options]\n"
26904 #: ../tools/virt-df.pl:42
26907 " virt-df [--options] domname\n"
26912 #: ../tools/virt-df.pl:44
26915 " virt-df [--options] disk.img [disk.img ...]\n"
26920 #: ../tools/virt-df.pl:48
26922 "C<virt-df> is a command line tool to display free space on virtual machine "
26923 "filesystems. Unlike other tools, it doesn't just display the amount of "
26924 "space allocated to a virtual machine, but can look inside the virtual "
26925 "machine to see how much space is really being used."
26929 #: ../tools/virt-df.pl:53
26931 "It is like the L<df(1)> command, but for virtual machines, except that it "
26932 "also works for Windows virtual machines."
26936 #: ../tools/virt-df.pl:56
26938 "If used without any arguments, C<virt-df> checks with libvirt to get a list "
26939 "of all active and inactive guests, and performs a C<df>-type operation on "
26940 "each one in turn, printing out the results."
26944 #: ../tools/virt-df.pl:60
26946 "If used with any argument(s), C<virt-df> performs a C<df>-type operation on "
26947 "either the single named libvirt domain, or on the disk image(s) listed on "
26948 "the command line (which must all belong to a single VM). In this mode (with "
26949 "arguments), C<virt-df> will I<only work for a single guest>. If you want to "
26950 "run on multiple guests, then you have to invoke C<virt-df> multiple times."
26954 #: ../tools/virt-df.pl:67
26956 "Use the C<--csv> option to get a format which can be easily parsed by other "
26957 "programs. Other options are mostly similar to standard C<df> options. See "
26958 "below for the complete list."
26962 #: ../tools/virt-df.pl:107
26967 #: ../tools/virt-df.pl:109
26969 "Write out the results in CSV format (comma-separated values). This format "
26970 "can be imported easily into databases and spreadsheets, but read L</NOTE "
26971 "ABOUT CSV FORMAT> below."
26975 #: ../tools/virt-df.pl:134
26976 msgid "B<--human-readable> | B<-h>"
26980 #: ../tools/virt-df.pl:136
26981 msgid "Print sizes in human-readable format."
26985 #: ../tools/virt-df.pl:138
26986 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
26990 #: ../tools/virt-df.pl:144
26991 msgid "B<--inodes> | B<-i>"
26995 #: ../tools/virt-df.pl:146
26996 msgid "Print inodes instead of blocks."
27000 #: ../tools/virt-df.pl:152
27001 msgid "B<--one-per-guest>"
27005 #: ../tools/virt-df.pl:154
27007 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
27008 "disks from several guests to a single libguestfs appliance."
27012 #: ../tools/virt-df.pl:157
27013 msgid "You might use this option in the following circumstances:"
27017 #: ../tools/virt-df.pl:163
27019 "If you think an untrusted guest might actively try to exploit the libguestfs "
27020 "appliance kernel, then this prevents one guest from interfering with the "
27021 "stats printed for another guest."
27025 #: ../tools/virt-df.pl:169
27027 "If the kernel has a bug which stops it from accessing a filesystem in one "
27028 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
27029 "and report stats for further guests."
27033 #: ../tools/virt-df.pl:180
27038 #: ../tools/virt-df.pl:182
27040 "Print UUIDs instead of names. This is useful for following a guest even "
27041 "when the guest is migrated or renamed, or when two guests happen to have the "
27046 #: ../tools/virt-df.pl:186
27048 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
27049 "images, we still print the disk image name even when this option is "
27054 #: ../tools/virt-df.pl:609
27055 msgid "NOTE ABOUT CSV FORMAT"
27059 #: ../tools/virt-df.pl:611
27061 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
27062 "should be easy to parse, but it is definitely not easy to parse."
27066 #: ../tools/virt-df.pl:614
27068 "Myth: Just split fields at commas. Reality: This does I<not> work "
27069 "reliably. This example has two columns:"
27073 #: ../tools/virt-df.pl:617
27076 " \"foo,bar\",baz\n"
27081 #: ../tools/virt-df.pl:619
27083 "Myth: Read the file one line at a time. Reality: This does I<not> work "
27084 "reliably. This example has one row:"
27088 #: ../tools/virt-df.pl:622
27097 #: ../tools/virt-df.pl:625
27099 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
27100 "packaged in major Linux distributions)."
27104 #: ../tools/virt-df.pl:628
27106 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
27107 "or Python's built-in csv library)."
27111 #: ../tools/virt-df.pl:631
27112 msgid "Most spreadsheets and databases can import CSV directly."
27116 #: ../tools/virt-df.pl:642
27118 "L<guestfs(3)>, L<guestfish(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
27119 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
27123 #: ../tools/virt-ls.pl:34
27124 msgid "virt-ls - List files in a virtual machine"
27128 #: ../tools/virt-ls.pl:38
27131 " virt-ls [--options] domname directory\n"
27136 #: ../tools/virt-ls.pl:40
27139 " virt-ls [--options] disk.img [disk.img ...] directory\n"
27144 #: ../tools/virt-ls.pl:44
27146 "C<virt-ls> is a command line tool to list the names of files in a directory "
27147 "inside a virtual machine or disk image."
27151 #: ../tools/virt-ls.pl:47
27153 "C<virt-ls> is just a simple wrapper around L<libguestfs(3)> functionality. "
27154 "For more complex cases you should look at the L<guestfish(1)> tool."
27158 #: ../tools/virt-ls.pl:51
27160 "C<virt-ls> can be used in one of three modes: simple, long and recursive. A "
27161 "simple listing is like the ordinary L<ls(1)> command:"
27165 #: ../tools/virt-ls.pl:54
27168 " $ virt-ls myguest /\n"
27176 #: ../tools/virt-ls.pl:59
27177 msgid "With the C<-l> (C<--long>) option, C<virt-ls> shows more detail:"
27181 #: ../tools/virt-ls.pl:61
27184 " $ virt-ls -l myguest /\n"
27186 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
27187 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
27193 #: ../tools/virt-ls.pl:67
27195 "With the C<-R> (C<--recursive>) option, C<virt-ls> lists the names of files "
27196 "and directories recursively:"
27200 #: ../tools/virt-ls.pl:70
27203 " $ virt-ls -R myguest /tmp\n"
27211 #: ../tools/virt-ls.pl:75
27213 "You I<cannot> combine these options. To do more complicated things, use "
27218 #: ../tools/virt-ls.pl:131 ../tools/virt-list-filesystems.pl:103
27219 #: ../tools/virt-list-partitions.pl:112
27220 msgid "B<-l> | B<--long>"
27224 #: ../tools/virt-ls.pl:133
27225 msgid "B<-R> | B<--recursive>"
27229 #: ../tools/virt-ls.pl:135
27231 "Select the mode. With neither of these options, C<virt-ls> produces a "
27232 "simple, flat list of the files in the named directory."
27236 #: ../tools/virt-ls.pl:138
27238 "C<virt-ls -l> produces a \"long listing\", which shows more detail (just "
27239 "like the plain C<ls -l> command)."
27243 #: ../tools/virt-ls.pl:141
27245 "C<virt-ls -R> produces a recursive list of files starting at the named "
27246 "directory. See the documentation for L<guestfs(3)/guestfs_find> for precise "
27251 #: ../tools/virt-ls.pl:145
27252 msgid "You cannot combine these options."
27256 #: ../tools/virt-ls.pl:234
27258 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<Sys::"
27259 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
27264 #: ../tools/virt-ls.pl:249 ../tools/virt-list-filesystems.pl:204
27265 #: ../tools/virt-tar.pl:298
27266 msgid "Copyright (C) 2009 Red Hat Inc."
27270 #: ../tools/virt-resize.pl:42
27271 msgid "virt-resize - Resize a virtual machine disk"
27275 #: ../tools/virt-resize.pl:46
27278 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27279 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27280 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27285 #: ../tools/virt-resize.pl:52
27287 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27288 "larger or smaller overall, and resizing or deleting any partitions contained "
27293 #: ../tools/virt-resize.pl:56
27295 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27296 "not> be used on live virtual machines - for consistent results, shut the "
27297 "virtual machine down before resizing it."
27301 #: ../tools/virt-resize.pl:60
27303 "If you are not familiar with the associated tools: L<virt-list-partitions(1)"
27304 ">, L<virt-list-filesystems(1)> and L<virt-df(1)>, we recommend you go and "
27305 "read those manual pages first."
27309 #: ../tools/virt-resize.pl:68
27311 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27312 "fill the extra 5GB of space."
27316 #: ../tools/virt-resize.pl:71
27319 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27320 " virt-list-partitions -lht olddisk\n"
27321 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27322 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27327 #: ../tools/virt-resize.pl:76
27329 "As above, but make the /boot partition 200MB bigger, while giving the "
27330 "remaining space to /dev/sda2:"
27334 #: ../tools/virt-resize.pl:79
27337 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27342 #: ../tools/virt-resize.pl:81
27343 msgid "As above, but the output format will be uncompressed qcow2:"
27347 #: ../tools/virt-resize.pl:83
27350 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27351 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27356 #: ../tools/virt-resize.pl:86
27357 msgid "DETAILED USAGE"
27361 #: ../tools/virt-resize.pl:88
27362 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27366 #: ../tools/virt-resize.pl:92
27367 msgid "1. Shut down the virtual machine"
27371 #: ../tools/virt-resize.pl:94
27372 msgid "2. Locate input disk image"
27376 #: ../tools/virt-resize.pl:96
27378 "Locate the input disk image (ie. the file or device on the host containing "
27379 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27380 "dumpxml> like this to find the disk image name:"
27384 #: ../tools/virt-resize.pl:100
27387 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27388 " Found 1 nodes:\n"
27390 " <source dev=\"/dev/vg/lv_guest\" />\n"
27395 #: ../tools/virt-resize.pl:105
27396 msgid "3. Look at current sizing"
27400 #: ../tools/virt-resize.pl:107
27402 "Use L<virt-list-partitions(1)> to display the current partitions and sizes:"
27406 #: ../tools/virt-resize.pl:110
27409 " # virt-list-partitions -lht /dev/vg/lv_guest\n"
27410 " /dev/sda1 ext3 101.9M\n"
27411 " /dev/sda2 pv 7.9G\n"
27412 " /dev/sda device 8.0G\n"
27417 #: ../tools/virt-resize.pl:115
27419 "(This example is a virtual machine with an 8 GB disk which we would like to "
27420 "expand up to 10 GB)."
27424 #: ../tools/virt-resize.pl:118
27425 msgid "4. Create output disk"
27429 #: ../tools/virt-resize.pl:120
27431 "Virt-resize cannot do in-place disk modifications. You have to have space "
27432 "to store the resized output disk."
27436 #: ../tools/virt-resize.pl:123
27438 "To store the resized disk image in a file, create a file of a suitable size:"
27442 #: ../tools/virt-resize.pl:126
27445 " # rm -f outdisk\n"
27446 " # truncate -s 10G outdisk\n"
27451 #: ../tools/virt-resize.pl:129
27452 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27456 #: ../tools/virt-resize.pl:131
27459 " # lvcreate -L 10G -n lv_name vg_name\n"
27464 #: ../tools/virt-resize.pl:133
27465 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27469 #: ../tools/virt-resize.pl:135
27472 " # virsh pool-list\n"
27473 " # virsh vol-create-as poolname newvol 10G\n"
27478 #: ../tools/virt-resize.pl:138
27483 #: ../tools/virt-resize.pl:140
27485 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27486 "file) and the output disk. The output disk is the one created in the "
27491 #: ../tools/virt-resize.pl:144
27494 " # virt-resize indisk outdisk\n"
27499 #: ../tools/virt-resize.pl:146
27501 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27502 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27503 "larger, then an extra, empty partition is created at the end of the disk "
27504 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27509 #: ../tools/virt-resize.pl:152
27511 "More realistically you'd want to expand existing partitions in the disk "
27512 "image by passing extra options (for the full list see the L</OPTIONS> "
27517 #: ../tools/virt-resize.pl:156
27519 "L</--expand> is the most useful option. It expands the named partition "
27520 "within the disk to fill any extra space:"
27524 #: ../tools/virt-resize.pl:159
27527 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27532 #: ../tools/virt-resize.pl:161
27534 "(In this case, an extra partition is I<not> created at the end of the disk, "
27535 "because there will be no unused space)."
27539 #: ../tools/virt-resize.pl:164
27541 "L</--resize> is the other commonly used option. The following would "
27542 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27543 "rest of the available space:"
27547 #: ../tools/virt-resize.pl:168
27550 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27551 " indisk outdisk\n"
27556 #: ../tools/virt-resize.pl:171
27558 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27559 "if virt-resize knows how, it will resize the contents, the equivalent of "
27560 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27561 ">. However virt-resize does not know how to resize some filesystems, so you "
27562 "would have to online resize them after booting the guest. And virt-resize "
27563 "also does not resize anything inside an LVM PV, it just resizes the PV "
27564 "itself and leaves the user to resize any LVs inside that PV as desired."
27568 #: ../tools/virt-resize.pl:180
27569 msgid "Other options are covered below."
27573 #: ../tools/virt-resize.pl:182
27578 #: ../tools/virt-resize.pl:184
27579 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27583 #: ../tools/virt-resize.pl:186
27584 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27588 #: ../tools/virt-resize.pl:188
27591 " # virsh edit guestname\n"
27596 #: ../tools/virt-resize.pl:190
27598 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27599 "html#elementsDisks>"
27603 #: ../tools/virt-resize.pl:193
27604 msgid "Then start up the domain with the new, resized disk:"
27608 #: ../tools/virt-resize.pl:195
27611 " # virsh start guestname\n"
27616 #: ../tools/virt-resize.pl:197
27618 "and check that it still works. See also the L</NOTES> section below for "
27619 "additional information."
27623 #: ../tools/virt-resize.pl:200
27624 msgid "7. Resize LVs etc inside the guest"
27628 #: ../tools/virt-resize.pl:202
27629 msgid "(This can also be done offline using L<guestfish(1)>)"
27633 #: ../tools/virt-resize.pl:204
27635 "Once the guest has booted you should see the new space available, at least "
27636 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27637 "may need to resize LVs inside PVs, and also resize filesystem types that "
27638 "virt-resize does not know how to expand."
27642 #: ../tools/virt-resize.pl:211
27643 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27647 #: ../tools/virt-resize.pl:213
27649 "Shrinking is somewhat more complex than expanding, and only an overview is "
27654 #: ../tools/virt-resize.pl:216
27656 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27657 "filesystems). The user has to shrink content before passing the disk image "
27658 "to virt-resize, and virt-resize will check that the content has been shrunk "
27663 #: ../tools/virt-resize.pl:221
27664 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27668 #: ../tools/virt-resize.pl:223
27670 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27671 "steps 3 and 4 above to allocate a new disk image."
27675 #: ../tools/virt-resize.pl:226
27677 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27681 #: ../tools/virt-resize.pl:229
27682 msgid "IGNORING OR DELETING PARTITIONS"
27686 #: ../tools/virt-resize.pl:231
27688 "virt-resize also gives a convenient way to ignore or delete partitions when "
27689 "copying from the input disk to the output disk. Ignoring a partition speeds "
27690 "up the copy where you don't care about the existing contents of a "
27691 "partition. Deleting a partition removes it completely, but note that it "
27692 "also renumbers any partitions after the one which is deleted, which can "
27693 "leave some guests unbootable."
27697 #: ../tools/virt-resize.pl:238
27698 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27702 #: ../tools/virt-resize.pl:240
27704 "If the input disk is in qcow2 format, then you may prefer that the output is "
27705 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27706 "the fly. The output format is simply determined by the format of the empty "
27707 "output container that you provide. Thus to create qcow2 output, use:"
27711 #: ../tools/virt-resize.pl:246
27714 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27719 #: ../tools/virt-resize.pl:248
27720 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
27724 #: ../tools/virt-resize.pl:250
27725 msgid "Similarly, to get non-sparse raw output use:"
27729 #: ../tools/virt-resize.pl:252
27732 " fallocate -l size outdisk\n"
27737 #: ../tools/virt-resize.pl:254
27739 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
27740 "dev/zero of=outdisk bs=1M count=..>)"
27744 #: ../tools/virt-resize.pl:267
27745 msgid "Display help."
27749 #: ../tools/virt-resize.pl:281
27750 msgid "B<--resize part=size>"
27754 #: ../tools/virt-resize.pl:283
27756 "Resize the named partition (expanding or shrinking it) so that it has the "
27761 #: ../tools/virt-resize.pl:286
27763 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
27764 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
27765 "Exabytes; or as a percentage of the current size; or as a relative number or "
27766 "percentage. For example:"
27770 #: ../tools/virt-resize.pl:291
27773 " --resize /dev/sda2=10G\n"
27778 #: ../tools/virt-resize.pl:293
27781 " --resize /dev/sda4=90%\n"
27786 #: ../tools/virt-resize.pl:295
27789 " --resize /dev/sda2=+1G\n"
27794 #: ../tools/virt-resize.pl:297
27797 " --resize /dev/sda2=-200M\n"
27802 #: ../tools/virt-resize.pl:299
27805 " --resize /dev/sda1=+128K\n"
27810 #: ../tools/virt-resize.pl:301
27813 " --resize /dev/sda1=+10%\n"
27818 #: ../tools/virt-resize.pl:303
27821 " --resize /dev/sda1=-10%\n"
27826 #: ../tools/virt-resize.pl:305
27828 "You can increase the size of any partition. Virt-resize will expand the "
27829 "direct content of the partition if it knows how (see C<--expand> below)."
27833 #: ../tools/virt-resize.pl:309
27835 "You can only I<decrease> the size of partitions that contain filesystems or "
27836 "PVs which have already been shrunk. Virt-resize will check this has been "
27837 "done before proceeding, or else will print an error (see also C<--resize-"
27842 #: ../tools/virt-resize.pl:314 ../tools/virt-resize.pl:406
27843 #: ../tools/virt-resize.pl:423
27844 msgid "You can give this option multiple times."
27848 #: ../tools/virt-resize.pl:320
27849 msgid "B<--resize-force part=size>"
27853 #: ../tools/virt-resize.pl:322
27855 "This is the same as C<--resize> except that it will let you decrease the "
27856 "size of any partition. Generally this means you will lose any data which "
27857 "was at the end of the partition you shrink, but you may not care about that "
27858 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
27859 "as a swap partition)."
27863 #: ../tools/virt-resize.pl:328
27864 msgid "See also the C<--ignore> option."
27868 #: ../tools/virt-resize.pl:334
27869 msgid "B<--expand part>"
27873 #: ../tools/virt-resize.pl:336
27875 "Expand the named partition so it uses up all extra space (space left over "
27876 "after any other resize changes that you request have been done)."
27880 #: ../tools/virt-resize.pl:339
27882 "If virt-resize knows how, it will expand the direct content of the "
27883 "partition. For example, if the partition is an LVM PV, it will expand the "
27884 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
27885 "content it doesn't know about alone."
27889 #: ../tools/virt-resize.pl:344
27890 msgid "Currently virt-resize can resize:"
27894 #: ../tools/virt-resize.pl:350
27896 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
27901 #: ../tools/virt-resize.pl:355
27903 "NTFS filesystems contained directly in a partition, if libguestfs was "
27904 "compiled with support for NTFS."
27908 #: ../tools/virt-resize.pl:358
27910 "The filesystem must have been shut down consistently last time it was used. "
27911 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
27912 "consistency check, so at the first boot after resizing Windows will check "
27917 #: ../tools/virt-resize.pl:365
27919 "LVM PVs (physical volumes). However virt-resize does I<not> resize anything "
27920 "inside the PV. The user will have to resize LVs as desired."
27924 #: ../tools/virt-resize.pl:371 ../tools/virt-resize.pl:393
27925 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
27929 #: ../tools/virt-resize.pl:377
27930 msgid "B<--shrink part>"
27934 #: ../tools/virt-resize.pl:379
27936 "Shrink the named partition until the overall disk image fits in the "
27937 "destination. The named partition B<must> contain a filesystem or PV which "
27938 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
27939 "online tools). Virt-resize will check this and give an error if it has not "
27944 #: ../tools/virt-resize.pl:385
27946 "The amount by which the overall disk must be shrunk (after carrying out all "
27947 "other operations requested by the user) is called the \"deficit\". For "
27948 "example, a straight copy (assume no other operations) from a 5GB disk image "
27949 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
27950 "would give an error unless the user specified a partition to shrink and that "
27951 "partition had more than a gigabyte of free space."
27955 #: ../tools/virt-resize.pl:399
27956 msgid "B<--ignore part>"
27960 #: ../tools/virt-resize.pl:401
27962 "Ignore the named partition. Effectively this means the partition is "
27963 "allocated on the destination disk, but the content is not copied across from "
27964 "the source disk. The content of the partition will be blank (all zero "
27969 #: ../tools/virt-resize.pl:412
27970 msgid "B<--delete part>"
27974 #: ../tools/virt-resize.pl:414
27976 "Delete the named partition. It would be more accurate to describe this as "
27977 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
27978 "the original disk image is left intact."
27982 #: ../tools/virt-resize.pl:418
27984 "Note that when you delete a partition, then anything contained in the "
27985 "partition is also deleted. Furthermore, this causes any partitions that "
27986 "come after to be I<renumbered>, which can easily make your guest unbootable."
27990 #: ../tools/virt-resize.pl:429
27991 msgid "B<--LV-expand logvol>"
27995 #: ../tools/virt-resize.pl:431
27997 "This takes the logical volume and, as a final step, expands it to fill all "
27998 "the space available in its volume group. A typical usage, assuming a Linux "
27999 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
28000 "lv_root> would be:"
28004 #: ../tools/virt-resize.pl:436
28007 " virt-resize indisk outdisk \\\n"
28008 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
28013 #: ../tools/virt-resize.pl:439
28015 "This would first expand the partition (and PV), and then expand the root "
28016 "device to fill the extra space in the PV."
28020 #: ../tools/virt-resize.pl:442
28022 "The contents of the LV are also resized if virt-resize knows how to do "
28023 "that. You can stop virt-resize from trying to expand the content by using "
28024 "the option C<--no-expand-content>."
28028 #: ../tools/virt-resize.pl:446
28029 msgid "Use L<virt-list-filesystems(1)> to list the filesystems in the guest."
28033 #: ../tools/virt-resize.pl:449
28035 "You can give this option multiple times, I<but> it doesn't make sense to do "
28036 "this unless the logical volumes you specify are all in different volume "
28041 #: ../tools/virt-resize.pl:457
28042 msgid "B<--no-copy-boot-loader>"
28046 #: ../tools/virt-resize.pl:459
28048 "By default, virt-resize copies over some sectors at the start of the disk "
28049 "(up to the beginning of the first partition). Commonly these sectors "
28050 "contain the Master Boot Record (MBR) and the boot loader, and are required "
28051 "in order for the guest to boot correctly."
28055 #: ../tools/virt-resize.pl:464
28057 "If you specify this flag, then this initial copy is not done. You may need "
28058 "to reinstall the boot loader in this case."
28062 #: ../tools/virt-resize.pl:472
28063 msgid "B<--no-extra-partition>"
28067 #: ../tools/virt-resize.pl:474
28069 "By default, virt-resize creates an extra partition if there is any extra, "
28070 "unused space after all resizing has happened. Use this option to prevent "
28071 "the extra partition from being created. If you do this then the extra space "
28072 "will be inaccessible until you run fdisk, parted, or some other partitioning "
28073 "tool in the guest."
28077 #: ../tools/virt-resize.pl:480
28079 "Note that if the surplus space is smaller than 10 MB, no extra partition "
28084 #: ../tools/virt-resize.pl:487
28085 msgid "B<--no-expand-content>"
28089 #: ../tools/virt-resize.pl:489
28091 "By default, virt-resize will try to expand the direct contents of "
28092 "partitions, if it knows how (see C<--expand> option above)."
28096 #: ../tools/virt-resize.pl:492
28098 "If you give the C<--no-expand-content> option then virt-resize will not "
28103 #: ../tools/virt-resize.pl:499
28104 msgid "B<-d> | B<--debug>"
28108 #: ../tools/virt-resize.pl:507
28109 msgid "B<-n> | B<--dryrun>"
28113 #: ../tools/virt-resize.pl:509
28114 msgid "Print a summary of what would be done, but don't do anything."
28118 #: ../tools/virt-resize.pl:515
28119 msgid "B<-q> | B<--quiet>"
28123 #: ../tools/virt-resize.pl:517
28124 msgid "Don't print the summary."
28128 #: ../tools/virt-resize.pl:525
28130 "Specify the format of the input disk image. If this flag is not given then "
28131 "it is auto-detected from the image itself."
28135 #: ../tools/virt-resize.pl:531
28137 "Note that this option I<does not> affect the output format. See L</QCOW2 "
28138 "AND NON-SPARSE RAW FORMATS>."
28142 #: ../tools/virt-resize.pl:538
28143 msgid "B<--output-format> raw"
28147 #: ../tools/virt-resize.pl:540
28149 "Specify the format of the output disk image. If this flag is not given then "
28150 "it is auto-detected from the image itself."
28154 #: ../tools/virt-resize.pl:546
28156 "Note that you still need to create the output disk with the right format. "
28157 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
28161 #: ../tools/virt-resize.pl:1422 ../tools/virt-rescue.pl:90
28166 #: ../tools/virt-resize.pl:1424
28167 msgid "\"Partition 1 does not end on cylinder boundary.\""
28171 #: ../tools/virt-resize.pl:1426
28173 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
28174 "means the partitions will not be aligned to the ancient CHS geometry. "
28175 "However CHS geometry is meaningless for disks manufactured since the early "
28176 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
28177 "cylinders is not required by any modern operating system."
28181 #: ../tools/virt-resize.pl:1433
28182 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
28186 #: ../tools/virt-resize.pl:1435
28188 "In Windows Vista and later versions, Microsoft switched to using a separate "
28189 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
28190 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
28191 "the boot partition. Doing so seems to break the guest completely. However "
28192 "expanding the second partition (ie. C: drive) should work."
28196 #: ../tools/virt-resize.pl:1442
28198 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
28199 "NTFS partitions have been expanded. This is just a safety check and (unless "
28200 "it find errors) is nothing to worry about."
28204 #: ../tools/virt-resize.pl:1446
28205 msgid "GUEST BOOT STUCK AT \"GRUB\""
28209 #: ../tools/virt-resize.pl:1448
28211 "If a Linux guest does not boot after resizing, and the boot is stuck after "
28212 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
28213 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
28214 "although we think is to do with partition alignment."
28218 #: ../tools/virt-resize.pl:1453
28221 " guestfish -i -a newdisk\n"
28222 " ><fs> cat /boot/grub/device.map\n"
28223 " # check the contents of this file are sensible or\n"
28224 " # edit the file if necessary\n"
28225 " ><fs> grub-install / /dev/vda\n"
28231 #: ../tools/virt-resize.pl:1460
28233 "For more flexible guest reconfiguration, including if you need to specify "
28234 "other parameters to grub-install, use L<virt-rescue(1)>."
28238 #: ../tools/virt-resize.pl:1463
28239 msgid "ALTERNATIVE TOOLS"
28243 #: ../tools/virt-resize.pl:1465
28245 "There are several proprietary tools for resizing partitions. We won't "
28246 "mention any here."
28250 #: ../tools/virt-resize.pl:1468
28252 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
28253 "operations on disk images. They can resize and move partitions, but I don't "
28254 "think they can do anything with the contents, and they certainly don't "
28259 #: ../tools/virt-resize.pl:1473
28261 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
28262 "but at a much lower level. You will probably end up hand-calculating sector "
28263 "offsets, which is something that virt-resize was designed to avoid. If you "
28264 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28269 #: ../tools/virt-resize.pl:1488
28271 "L<virt-list-partitions(1)>, L<virt-list-filesystems(1)>, L<virt-df(1)>, "
28272 "L<guestfs(3)>, L<guestfish(1)>, L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, "
28273 "L<resize2fs(8)>, L<ntfsresize(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)"
28274 ">, L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
28275 "L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28279 #: ../tools/virt-list-filesystems.pl:32
28281 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28285 #: ../tools/virt-list-filesystems.pl:36
28288 " virt-list-filesystems [--options] domname\n"
28293 #: ../tools/virt-list-filesystems.pl:38
28296 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28301 #: ../tools/virt-list-filesystems.pl:42
28303 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28304 "are contained in a virtual machine or disk image."
28308 #: ../tools/virt-list-filesystems.pl:46
28310 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28311 "functionality. For more complex cases you should look at the L<guestfish(1)"
28316 #: ../tools/virt-list-filesystems.pl:105
28318 "With this option, C<virt-list-filesystems> displays the type of each "
28319 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28323 #: ../tools/virt-list-filesystems.pl:112
28324 msgid "B<-a> | B<--all>"
28328 #: ../tools/virt-list-filesystems.pl:114
28330 "Normally we only show mountable filesystems. If this option is given then "
28331 "swap devices are shown too."
28335 #: ../tools/virt-list-filesystems.pl:188
28337 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-list-"
28338 "partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)"
28339 ">, L<http://libguestfs.org/>."
28343 #: ../tools/virt-tar.pl:33
28344 msgid "virt-tar - Extract or upload files to a virtual machine"
28348 #: ../tools/virt-tar.pl:37
28351 " virt-tar [--options] -x domname directory tarball\n"
28356 #: ../tools/virt-tar.pl:39
28359 " virt-tar [--options] -u domname tarball directory\n"
28364 #: ../tools/virt-tar.pl:41
28367 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28372 #: ../tools/virt-tar.pl:43
28375 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28380 #: ../tools/virt-tar.pl:47
28381 msgid "Download C</home> from the VM into a local tarball:"
28385 #: ../tools/virt-tar.pl:49
28388 " virt-tar -x domname /home home.tar\n"
28393 #: ../tools/virt-tar.pl:51
28396 " virt-tar -zx domname /home home.tar.gz\n"
28401 #: ../tools/virt-tar.pl:53
28402 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28406 #: ../tools/virt-tar.pl:55
28409 " virt-tar -u domname uploadstuff.tar /tmp\n"
28414 #: ../tools/virt-tar.pl:57
28417 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28422 #: ../tools/virt-tar.pl:61
28424 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28425 "virtual machines. If you do this, you risk disk corruption in the VM. "
28426 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28430 #: ../tools/virt-tar.pl:66
28432 "You can use C<-x> (extract) on live virtual machines, but you might get "
28433 "inconsistent results or errors if there is filesystem activity inside the "
28434 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28435 "work, but the only way to guarantee consistent results is if the virtual "
28436 "machine is shut down."
28440 #: ../tools/virt-tar.pl:74
28442 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28443 "parts of a guest filesystem. There are many possibilities: making backups, "
28444 "uploading data files, snooping on guest activity, fixing or customizing "
28449 #: ../tools/virt-tar.pl:79
28451 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28452 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28453 "should look at the L<guestfish(1)> tool."
28457 #: ../tools/virt-tar.pl:83
28459 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28460 "its contents (recursively) from the virtual machine into a local tarball. "
28461 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28462 "virtual machine. You cannot use these two options together."
28466 #: ../tools/virt-tar.pl:89
28468 "In addition, you may need to use the C<-z> (gZip) option to enable "
28469 "compression. When uploading, you have to specify C<-z> if the upload file "
28470 "is compressed because virt-tar won't detect this on its own."
28474 #: ../tools/virt-tar.pl:93
28476 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28477 "example it cannot do PKZip files or bzip2 compression. If you want that "
28478 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28479 "the L<libguestfs(3)> API)."
28483 #: ../tools/virt-tar.pl:151
28484 msgid "B<-x> | B<--extract> | B<--download>"
28488 #: ../tools/virt-tar.pl:153
28489 msgid "B<-u> | B<--upload>"
28493 #: ../tools/virt-tar.pl:155
28495 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28500 #: ../tools/virt-tar.pl:158
28502 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28503 "Please read the L</WARNING> section above before using this option."
28507 #: ../tools/virt-tar.pl:162
28508 msgid "You must specify exactly one of these options."
28512 #: ../tools/virt-tar.pl:168
28513 msgid "B<-z> | B<--gzip>"
28517 #: ../tools/virt-tar.pl:170
28518 msgid "Specify that the input or output tarball is gzip-compressed."
28522 #: ../tools/virt-tar.pl:283
28524 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28525 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28530 #: ../tools/virt-rescue.pl:33
28531 msgid "virt-rescue - Run a rescue shell on a virtual machine"
28535 #: ../tools/virt-rescue.pl:37
28538 " virt-rescue [--options] domname\n"
28543 #: ../tools/virt-rescue.pl:39
28546 " virt-rescue [--options] disk.img [disk.img ...]\n"
28551 #: ../tools/virt-rescue.pl:43
28553 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
28554 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
28555 "you from doing this, but doesn't catch all cases."
28559 #: ../tools/virt-rescue.pl:47
28561 "However if you use the I<--ro> (read only) option, then you can attach a "
28562 "shell to a live virtual machine. The results might be strange or "
28563 "inconsistent at times but you won't get disk corruption."
28567 #: ../tools/virt-rescue.pl:53
28569 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
28570 "need for a CD. virt-rescue gives you a rescue shell and some simple "
28571 "recovery tools which you can use to examine or rescue a virtual machine or "
28576 #: ../tools/virt-rescue.pl:58
28578 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
28579 "on disk image(s):"
28583 #: ../tools/virt-rescue.pl:61
28586 " virt-rescue GuestName\n"
28591 #: ../tools/virt-rescue.pl:63
28594 " virt-rescue --ro /path/to/disk.img\n"
28599 #: ../tools/virt-rescue.pl:65
28602 " virt-rescue /dev/sdc\n"
28607 #: ../tools/virt-rescue.pl:67
28608 msgid "For live VMs you I<must> use the --ro option."
28612 #: ../tools/virt-rescue.pl:69
28614 "When you run virt-rescue on a virtual machine or disk image, you are placed "
28615 "in an interactive bash shell where you can use many ordinary Linux "
28616 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
28617 "appliance. You must mount the virtual machine's filesystems by hand. There "
28618 "is an empty directory called C</sysroot> where you can mount filesystems."
28622 #: ../tools/virt-rescue.pl:76
28624 "In the example below, we list logical volumes, then choose one to mount "
28625 "under C</sysroot>:"
28629 #: ../tools/virt-rescue.pl:79
28633 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
28634 " lv_root vg_f11x64 -wi-a- 8.83G\n"
28635 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
28636 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
28637 " ><rescue> ls /sysroot\n"
28642 #: ../tools/virt-rescue.pl:86
28644 "If you don't know what filesystems are available on the virtual machine then "
28645 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
28649 #: ../tools/virt-rescue.pl:92
28651 "Virt-rescue can be used on I<any> disk image file or device, not just a "
28652 "virtual machine. For example you can use it on a blank file if you want to "
28653 "partition that file (although we would recommend using L<guestfish(1)> "
28654 "instead as it is more suitable for this purpose). You can even use virt-"
28655 "rescue on things like SD cards."
28659 #: ../tools/virt-rescue.pl:98
28661 "This tool is just designed for quick interactive hacking on a virtual "
28662 "machine. For more structured access to a virtual machine disk image, you "
28663 "should use L<guestfs(3)>. To get a structured shell that you can use to "
28664 "make scripted changes to guests, use L<guestfish(1)>."
28668 #: ../tools/virt-rescue.pl:127
28669 msgid "B<--append kernelopts>"
28673 #: ../tools/virt-rescue.pl:129
28674 msgid "Pass additional options to the rescue kernel."
28678 #: ../tools/virt-rescue.pl:164
28679 msgid "B<--memsize MB> | B<-m MB>"
28683 #: ../tools/virt-rescue.pl:166
28685 "Change the amount of memory allocated to the rescue system. The default is "
28686 "set by libguestfs and is small but adequate for running system tools. The "
28687 "occasional program might need more memory. The parameter is specified in "
28692 #: ../tools/virt-rescue.pl:175
28693 msgid "B<--network>"
28697 #: ../tools/virt-rescue.pl:177
28698 msgid "Enable QEMU user networking in the guest."
28702 #: ../tools/virt-rescue.pl:183
28703 msgid "B<--ro> | B<-r>"
28707 #: ../tools/virt-rescue.pl:185
28708 msgid "Open the image read-only."
28712 #: ../tools/virt-rescue.pl:197
28714 "Enable SELinux in the rescue appliance. You should read L<guestfs(3)/"
28715 "SELINUX> before using this option."
28719 #: ../tools/virt-rescue.pl:257
28721 "Several environment variables affect virt-rescue. See L<guestfs(3)/"
28722 "ENVIRONMENT VARIABLES> for the complete list."
28726 #: ../tools/virt-rescue.pl:269
28728 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28729 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28733 #: ../tools/virt-make-fs.pl:37
28734 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28738 #: ../tools/virt-make-fs.pl:41
28741 " virt-make-fs [--options] input.tar output.img\n"
28746 #: ../tools/virt-make-fs.pl:43
28749 " virt-make-fs [--options] input.tar.gz output.img\n"
28754 #: ../tools/virt-make-fs.pl:45
28757 " virt-make-fs [--options] directory output.img\n"
28762 #: ../tools/virt-make-fs.pl:49
28764 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28765 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28766 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28767 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28768 "you want to attach these filesystems to existing virtual machines (eg. to "
28769 "import large amounts of read-only data to a VM)."
28773 #: ../tools/virt-make-fs.pl:57
28774 msgid "Basic usage is:"
28778 #: ../tools/virt-make-fs.pl:59
28781 " virt-make-fs input output\n"
28786 #: ../tools/virt-make-fs.pl:61
28788 "where C<input> is either a directory containing files that you want to add, "
28789 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28790 "C<output> is a disk image. The input type is detected automatically. The "
28791 "output disk image defaults to a raw ext2 image unless you specify extra "
28792 "flags (see L</OPTIONS> below)."
28796 #: ../tools/virt-make-fs.pl:67
28797 msgid "EXTRA SPACE"
28801 #: ../tools/virt-make-fs.pl:69
28803 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28804 "the files that it contains, but might have extra space. Depending on how "
28805 "you are going to use the output, you might think this extra space is wasted "
28806 "and want to minimize it, or you might want to leave space so that more files "
28807 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28808 "but you can use the C<--size> flag to leave space in the filesystem if you "
28813 #: ../tools/virt-make-fs.pl:77
28815 "An alternative way to leave extra space but not make the output image any "
28816 "bigger is to use an alternative disk image format (instead of the default "
28817 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28818 "image format (check your hypervisor supports this before using it). This "
28819 "allows you to choose a large C<--size> but the extra space won't actually be "
28820 "allocated in the image until you try to store something in it."
28824 #: ../tools/virt-make-fs.pl:85
28826 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28827 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28828 "resize to build another image from scratch."
28832 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28833 #: ../tools/virt-make-fs.pl:142
28838 #: ../tools/virt-make-fs.pl:91
28841 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28846 #: ../tools/virt-make-fs.pl:93
28847 msgid "FILESYSTEM TYPE"
28851 #: ../tools/virt-make-fs.pl:95
28853 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28854 "libguestfs supports can be used (but I<not> read-only formats like "
28855 "ISO9660). Here are some of the more common choices:"
28859 #: ../tools/virt-make-fs.pl:101
28864 #: ../tools/virt-make-fs.pl:103
28866 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
28867 "you are not going to use the filesystem in a way that requires the journal, "
28868 "then this is just wasted overhead."
28872 #: ../tools/virt-make-fs.pl:107
28873 msgid "I<ntfs> or I<vfat>"
28877 #: ../tools/virt-make-fs.pl:109
28878 msgid "Useful if exporting data to a Windows guest."
28882 #: ../tools/virt-make-fs.pl:111
28884 "I<Note for vfat>: The tar archive or local directory must only contain files "
28885 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
28886 "program running within libguestfs is unable to change the ownership of non-"
28887 "root files, since vfat itself does not support this."
28891 #: ../tools/virt-make-fs.pl:116
28896 #: ../tools/virt-make-fs.pl:118
28898 "Lower overhead than C<ext2>, but certain limitations on filename length and "
28899 "total filesystem size."
28903 #: ../tools/virt-make-fs.pl:125
28906 " virt-make-fs --type=minix input minixfs.img\n"
28911 #: ../tools/virt-make-fs.pl:127
28912 msgid "TO PARTITION OR NOT TO PARTITION"
28916 #: ../tools/virt-make-fs.pl:129
28917 msgid "Optionally virt-make-fs can add a partition table to the output disk."
28921 #: ../tools/virt-make-fs.pl:131
28923 "Adding a partition can make the disk image more compatible with certain "
28924 "virtualized operating systems which don't expect to see a filesystem "
28925 "directly located on a block device (Linux doesn't care and will happily "
28926 "handle both types)."
28930 #: ../tools/virt-make-fs.pl:136
28932 "On the other hand, if you have a partition table then the output image is no "
28933 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
28934 "directly on a partitioned disk image. (However libguestfs tools such as "
28935 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
28939 #: ../tools/virt-make-fs.pl:144
28940 msgid "Add an MBR partition:"
28944 #: ../tools/virt-make-fs.pl:146
28947 " virt-make-fs --partition -- input disk.img\n"
28952 #: ../tools/virt-make-fs.pl:148
28954 "If the output disk image could be terabyte-sized or larger, it's better to "
28955 "use an EFI/GPT-compatible partition table:"
28959 #: ../tools/virt-make-fs.pl:151
28962 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
28967 #: ../tools/virt-make-fs.pl:179
28968 msgid "Enable debugging information."
28972 #: ../tools/virt-make-fs.pl:185
28973 msgid "B<--size=E<lt>NE<gt>>"
28977 #: ../tools/virt-make-fs.pl:187
28978 msgid "B<--size=+E<lt>NE<gt>>"
28982 #: ../tools/virt-make-fs.pl:189
28983 msgid "B<-s E<lt>NE<gt>>"
28987 #: ../tools/virt-make-fs.pl:191
28988 msgid "B<-s +E<lt>NE<gt>>"
28992 #: ../tools/virt-make-fs.pl:193
28994 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
28998 #: ../tools/virt-make-fs.pl:196
29000 "If this option is I<not> given, then the output image will be just large "
29001 "enough to contain all the files, with not much wasted space."
29005 #: ../tools/virt-make-fs.pl:199
29007 "To choose a fixed size output disk, specify an absolute number followed by b/"
29008 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29009 "Petabytes or Exabytes. This must be large enough to contain all the input "
29010 "files, else you will get an error."
29014 #: ../tools/virt-make-fs.pl:204
29016 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
29017 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29018 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29019 "the input files, and (approximately) an extra 200 MB free space."
29023 #: ../tools/virt-make-fs.pl:210
29025 "Note that virt-make-fs estimates free space, and therefore will not produce "
29026 "filesystems containing precisely the free space requested. (It is much more "
29027 "expensive and time-consuming to produce a filesystem which has precisely the "
29028 "desired free space)."
29032 #: ../tools/virt-make-fs.pl:219
29033 msgid "B<--format=E<lt>fmtE<gt>>"
29037 #: ../tools/virt-make-fs.pl:221
29038 msgid "B<-F E<lt>fmtE<gt>>"
29042 #: ../tools/virt-make-fs.pl:223
29043 msgid "Choose the output disk image format."
29047 #: ../tools/virt-make-fs.pl:225
29048 msgid "The default is C<raw> (raw disk image)."
29052 #: ../tools/virt-make-fs.pl:227
29054 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29055 "that would really make sense here is C<qcow2>."
29059 #: ../tools/virt-make-fs.pl:234
29060 msgid "B<--type=E<lt>fsE<gt>>"
29064 #: ../tools/virt-make-fs.pl:236
29065 msgid "B<-t E<lt>fsE<gt>>"
29069 #: ../tools/virt-make-fs.pl:238
29070 msgid "Choose the output filesystem type."
29074 #: ../tools/virt-make-fs.pl:240
29075 msgid "The default is C<ext2>."
29079 #: ../tools/virt-make-fs.pl:242
29081 "Any filesystem which is supported read-write by libguestfs can be used here."
29085 #: ../tools/virt-make-fs.pl:249
29086 msgid "B<--partition>"
29090 #: ../tools/virt-make-fs.pl:251
29091 msgid "B<--partition=E<lt>parttypeE<gt>>"
29095 #: ../tools/virt-make-fs.pl:253
29097 "If specified, this flag adds an MBR partition table to the output disk image."
29101 #: ../tools/virt-make-fs.pl:256
29103 "You can change the partition table type, eg. C<--partition=gpt> for large "
29108 #: ../tools/virt-make-fs.pl:259
29110 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29111 "might consider the next parameter to be the partition type. For example:"
29115 #: ../tools/virt-make-fs.pl:263
29118 " virt-make-fs --partition input.tar ...\n"
29123 #: ../tools/virt-make-fs.pl:265
29125 "would cause virt-make-fs to think you wanted to use a partition type of "
29126 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29127 "dash) between options and the input file argument:"
29131 #: ../tools/virt-make-fs.pl:269
29134 " virt-make-fs --partition -- input.tar ...\n"
29139 #: ../tools/virt-make-fs.pl:536
29141 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
29142 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
29143 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29147 #: ../tools/virt-make-fs.pl:553
29150 " export LIBGUESTFS_DEBUG=1\n"
29151 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29156 #: ../tools/virt-make-fs.pl:556
29158 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
29163 #: ../tools/virt-list-partitions.pl:32
29165 "virt-list-partitions - List partitions in a virtual machine or disk image"
29169 #: ../tools/virt-list-partitions.pl:36
29172 " virt-list-partitions [--options] domname\n"
29177 #: ../tools/virt-list-partitions.pl:38
29180 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29185 #: ../tools/virt-list-partitions.pl:42
29187 "C<virt-list-partitions> is a command line tool to list the partitions that "
29188 "are contained in a virtual machine or disk image. It is mainly useful as a "
29189 "first step to using L<virt-resize(1)>."
29193 #: ../tools/virt-list-partitions.pl:47
29195 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
29196 "functionality. For more complex cases you should look at the L<guestfish(1)"
29201 #: ../tools/virt-list-partitions.pl:104
29202 msgid "B<-h> | B<--human-readable>"
29206 #: ../tools/virt-list-partitions.pl:106
29207 msgid "Show sizes in human-readable form (eg. \"1G\")."
29211 #: ../tools/virt-list-partitions.pl:114
29213 "With this option, C<virt-list-partitions> displays the type and size of each "
29214 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
29218 #: ../tools/virt-list-partitions.pl:121
29219 msgid "B<-t> | B<--total>"
29223 #: ../tools/virt-list-partitions.pl:123
29225 "Display the total size of each block device (as a separate row or rows)."
29229 #: ../tools/virt-list-partitions.pl:256
29231 "L<guestfs(3)>, L<guestfish(1)>, L<virt-list-filesystems(1)>, L<virt-resize(1)"
29232 ">, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://"
29233 "libguestfs.org/>."